diff options
Diffstat (limited to 'js/contacts.js')
-rw-r--r-- | js/contacts.js | 702 |
1 files changed, 393 insertions, 309 deletions
diff --git a/js/contacts.js b/js/contacts.js index 0ec538da..91c9958b 100644 --- a/js/contacts.js +++ b/js/contacts.js @@ -106,7 +106,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _ical = __webpack_require__(/*! ical.js */ \"./node_modules/ical.js/build/ical.js\");\n\nvar _ical2 = _interopRequireDefault(_ical);\n\nvar _vueClickOutside = __webpack_require__(/*! vue-click-outside */ \"./node_modules/vue-click-outside/index.js\");\n\nvar _vueClickOutside2 = _interopRequireDefault(_vueClickOutside);\n\nvar _vue = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nvar _vTooltip = __webpack_require__(/*! v-tooltip */ \"./node_modules/v-tooltip/dist/v-tooltip.esm.js\");\n\nvar _vTooltip2 = _interopRequireDefault(_vTooltip);\n\nvar _debounce = __webpack_require__(/*! debounce */ \"./node_modules/debounce/index.js\");\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nvar _contact = __webpack_require__(/*! ../models/contact */ \"./src/models/contact.js\");\n\nvar _contact2 = _interopRequireDefault(_contact);\n\nvar _rfcProps = __webpack_require__(/*! ../models/rfcProps.js */ \"./src/models/rfcProps.js\");\n\nvar _rfcProps2 = _interopRequireDefault(_rfcProps);\n\nvar _popoverMenu = __webpack_require__(/*! ./core/popoverMenu */ \"./src/components/core/popoverMenu.vue\");\n\nvar _popoverMenu2 = _interopRequireDefault(_popoverMenu);\n\nvar _ContactDetailsProperty = __webpack_require__(/*! ./ContactDetails/ContactDetailsProperty */ \"./src/components/ContactDetails/ContactDetailsProperty.vue\");\n\nvar _ContactDetailsProperty2 = _interopRequireDefault(_ContactDetailsProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_vue2.default.use(_vTooltip2.default); //\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\nexports.default = {\n\tname: 'ContactDetails',\n\n\tcomponents: {\n\t\tpopoverMenu: _popoverMenu2.default,\n\t\tcontactDetailsProperty: _ContactDetailsProperty2.default\n\t},\n\n\tdirectives: {\n\t\tClickOutside: _vueClickOutside2.default\n\t},\n\n\tprops: {\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true\n\t\t},\n\t\tuid: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined\n\t\t}\n\t},\n\n\tdata: function data() {\n\t\treturn {\n\t\t\tcontact: undefined,\n\t\t\topenedMenu: false\n\t\t};\n\t},\n\n\n\tcomputed: {\n\t\tcolorAvatar: function colorAvatar() {\n\t\t\ttry {\n\t\t\t\tvar color = this.contact.uid.toRgb();\n\t\t\t\treturn 'rgb(' + color.r + ', ' + color.g + ', ' + color.b + ')';\n\t\t\t} catch (e) {\n\t\t\t\treturn 'grey';\n\t\t\t}\n\t\t},\n\n\n\t\t/**\n * Header actions for the contact\n */\n\t\tcontactActions: function contactActions() {\n\t\t\tvar actions = [{\n\t\t\t\ticon: 'icon-download',\n\t\t\t\ttext: t('contacts', 'Download'),\n\t\t\t\thref: this.contact.url\n\t\t\t}];\n\t\t\tif (this.contact.addressbook.enabled) {\n\t\t\t\tactions.push({\n\t\t\t\t\ticon: 'icon-delete',\n\t\t\t\t\ttext: t('contacts', 'Delete'),\n\t\t\t\t\taction: this.deleteContact\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn actions;\n\t\t},\n\n\n\t\t/**\n * Contact properties copied and sorted by rfcProps.fieldOrder\n */\n\t\tsortedProperties: function sortedProperties() {\n\t\t\treturn this.contact.properties.slice(0).sort(function (a, b) {\n\t\t\t\treturn _rfcProps2.default.fieldOrder.indexOf(a.name) - _rfcProps2.default.fieldOrder.indexOf(b.name);\n\t\t\t});\n\t\t}\n\t},\n\n\twatch: {\n\t\t// url changed, get and show selected contact\n\t\tuid: function uid() {\n\t\t\tthis.updateLocalContact();\n\t\t},\n\t\t// done loading, check if the provided uid is valid and open details\n\t\tloading: function loading() {\n\t\t\tif (this.uid) {\n\t\t\t\tthis.updateLocalContact();\n\t\t\t}\n\t\t}\n\t},\n\n\tmethods: {\n\n\t\t/**\n * Fetch the selected contact from the store\n * and store it as a local data for editing\n */\n\t\tupdateLocalContact: function updateLocalContact() {\n\t\t\t// create new local instance of this contact\n\t\t\tvar contact = this.$store.getters.getContact(this.uid);\n\t\t\tthis.contact = new _contact2.default(_ical2.default.stringify(contact.jCal), contact.addressbook);\n\t\t},\n\n\n\t\t/**\n * Executed on the 'updatedcontact' event\n * Send the local clone of contact to the store\n */\n\t\tupdateContact: function updateContact() {\n\t\t\tthis.$store.dispatch('updateContact', this.contact);\n\t\t},\n\n\t\t/**\n * Debounce the contact update for the header props\n * photo, fn, org, title\n */\n\t\tdebounceUpdateContact: (0, _debounce2.default)(function (e) {\n\t\t\tthis.updateContact();\n\t\t}, 500),\n\n\t\t// menu handling\n\t\tcloseMenu: function closeMenu() {\n\t\t\tthis.openedMenu = false;\n\t\t},\n\t\ttoggleMenu: function toggleMenu() {\n\t\t\tthis.openedMenu = !this.openedMenu;\n\t\t}\n\t}\n\n};\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vc3JjL2N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29udGFjdCB1cGRhdGUgZm9yIHRoZSBoZWFkZXIgcHJvcHNcblx0XHQgKiBwaG90bywgZm4sIG9yZywgdGl0bGVcblx0XHQgKi9cblx0XHRkZWJvdW5jZVVwZGF0ZUNvbnRhY3Q6IGRlYm91bmNlKGZ1bmN0aW9uKGUpIHtcblx0XHRcdHRoaXMudXBkYXRlQ29udGFjdCgpXG5cdFx0fSwgNTAwKSxcblxuXHRcdC8vIG1lbnUgaGFuZGxpbmdcblx0XHRjbG9zZU1lbnUoKSB7XG5cdFx0XHR0aGlzLm9wZW5lZE1lbnUgPSBmYWxzZVxuXHRcdH0sXG5cdFx0dG9nZ2xlTWVudSgpIHtcblx0XHRcdHRoaXMub3BlbmVkTWVudSA9ICF0aGlzLm9wZW5lZE1lbnVcblx0XHR9XG5cdH1cblxufVxuPC9zY3JpcHQ+XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js?!./src/components/ContactDetails.vue?vue&type=script&lang=js&\n"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _vueClickOutside = __webpack_require__(/*! vue-click-outside */ \"./node_modules/vue-click-outside/index.js\");\n\nvar _vueClickOutside2 = _interopRequireDefault(_vueClickOutside);\n\nvar _vue = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.esm.js\");\n\nvar _vue2 = _interopRequireDefault(_vue);\n\nvar _vTooltip = __webpack_require__(/*! v-tooltip */ \"./node_modules/v-tooltip/dist/v-tooltip.esm.js\");\n\nvar _vTooltip2 = _interopRequireDefault(_vTooltip);\n\nvar _debounce = __webpack_require__(/*! debounce */ \"./node_modules/debounce/index.js\");\n\nvar _debounce2 = _interopRequireDefault(_debounce);\n\nvar _contact = __webpack_require__(/*! ../models/contact */ \"./src/models/contact.js\");\n\nvar _contact2 = _interopRequireDefault(_contact);\n\nvar _rfcProps = __webpack_require__(/*! ../models/rfcProps.js */ \"./src/models/rfcProps.js\");\n\nvar _rfcProps2 = _interopRequireDefault(_rfcProps);\n\nvar _popoverMenu = __webpack_require__(/*! ./core/popoverMenu */ \"./src/components/core/popoverMenu.vue\");\n\nvar _popoverMenu2 = _interopRequireDefault(_popoverMenu);\n\nvar _ContactDetailsProperty = __webpack_require__(/*! ./ContactDetails/ContactDetailsProperty */ \"./src/components/ContactDetails/ContactDetailsProperty.vue\");\n\nvar _ContactDetailsProperty2 = _interopRequireDefault(_ContactDetailsProperty);\n\nvar _PropertySelect = __webpack_require__(/*! ./Properties/PropertySelect */ \"./src/components/Properties/PropertySelect.vue\");\n\nvar _PropertySelect2 = _interopRequireDefault(_PropertySelect);\n\nvar _PropertyGroups = __webpack_require__(/*! ./Properties/PropertyGroups */ \"./src/components/Properties/PropertyGroups.vue\");\n\nvar _PropertyGroups2 = _interopRequireDefault(_PropertyGroups);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n_vue2.default.use(_vTooltip2.default);\n\nexports.default = {\n\tname: 'ContactDetails',\n\n\tcomponents: {\n\t\tPopoverMenu: _popoverMenu2.default,\n\t\tContactDetailsProperty: _ContactDetailsProperty2.default,\n\t\tPropertySelect: _PropertySelect2.default,\n\t\tPropertyGroups: _PropertyGroups2.default\n\t},\n\n\tdirectives: {\n\t\tClickOutside: _vueClickOutside2.default\n\t},\n\n\tprops: {\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true\n\t\t},\n\t\tuid: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined\n\t\t}\n\t},\n\n\tdata: function data() {\n\t\treturn {\n\t\t\topenedMenu: false,\n\t\t\taddressbookModel: {\n\t\t\t\treadableName: t('contacts', 'Addressbook'),\n\t\t\t\ticon: 'icon-addressbook'\n\t\t\t}\n\t\t};\n\t},\n\n\n\tcomputed: {\n\t\t/**\n * Contact color based on uid\n */\n\t\tcolorAvatar: function colorAvatar() {\n\t\t\ttry {\n\t\t\t\tvar color = this.contact.uid.toRgb();\n\t\t\t\treturn 'rgb(' + color.r + ', ' + color.g + ', ' + color.b + ')';\n\t\t\t} catch (e) {\n\t\t\t\treturn 'grey';\n\t\t\t}\n\t\t},\n\n\n\t\t/**\n * Header actions for the contact\n */\n\t\tcontactActions: function contactActions() {\n\t\t\tvar actions = [{\n\t\t\t\ticon: 'icon-download',\n\t\t\t\ttext: t('contacts', 'Download'),\n\t\t\t\thref: this.contact.url\n\t\t\t}];\n\t\t\tif (this.contact.addressbook.enabled) {\n\t\t\t\tactions.push({\n\t\t\t\t\ticon: 'icon-delete',\n\t\t\t\t\ttext: t('contacts', 'Delete'),\n\t\t\t\t\taction: this.deleteContact\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn actions;\n\t\t},\n\n\n\t\t/**\n * Contact properties copied and sorted by rfcProps.fieldOrder\n */\n\t\tsortedProperties: function sortedProperties() {\n\t\t\treturn this.contact.properties.slice(0).sort(function (a, b) {\n\t\t\t\treturn _rfcProps2.default.fieldOrder.indexOf(a.name) - _rfcProps2.default.fieldOrder.indexOf(b.name);\n\t\t\t});\n\t\t},\n\n\n\t\t// usable addressbook object linked to the local contact\n\t\taddressbook: {\n\t\t\tget: function get() {\n\t\t\t\treturn {\n\t\t\t\t\tid: this.contact.addressbook.id,\n\t\t\t\t\tname: this.contact.addressbook.displayName\n\t\t\t\t};\n\t\t\t},\n\t\t\tset: function set(addressbook) {\n\t\t\t\tthis.moveContactToAddressbook(addressbook);\n\t\t\t}\n\t\t},\n\n\t\t// store getters filtered and mapped to usable object\n\t\taddressbooksOptions: function addressbooksOptions() {\n\t\t\treturn this.addressbooks.filter(function (addressbook) {\n\t\t\t\treturn addressbook.enabled;\n\t\t\t}).map(function (addressbook) {\n\t\t\t\treturn {\n\t\t\t\t\tid: addressbook.id,\n\t\t\t\t\tname: addressbook.displayName\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\n\n\t\t// store getter\n\t\taddressbooks: function addressbooks() {\n\t\t\treturn this.$store.getters.getAddressbooks;\n\t\t},\n\n\n\t\t// local version of the contact\n\t\tcontact: function contact() {\n\t\t\tvar contact = this.$store.getters.getContact(this.uid);\n\t\t\tif (contact) {\n\t\t\t\t// create empty contact and copy inner data\n\t\t\t\tvar localContact = new _contact2.default('BEGIN:VCARD\\nUID:' + contact.uid + '\\nEND:VCARD', contact.addressbook);\n\t\t\t\tlocalContact.updateContact(contact.jCal);\n\t\t\t\treturn localContact;\n\t\t\t}\n\t\t}\n\t},\n\n\tmethods: {\n\t\t/**\n * Executed on the 'updatedcontact' event\n * Send the local clone of contact to the store\n */\n\t\tupdateContact: function updateContact() {\n\t\t\tthis.$store.dispatch('updateContact', this.contact);\n\t\t},\n\n\t\t/**\n * Debounce the contact update for the header props\n * photo, fn, org, title\n */\n\t\tdebounceUpdateContact: (0, _debounce2.default)(function (e) {\n\t\t\tthis.updateContact();\n\t\t}, 500),\n\n\t\t// menu handling\n\t\tcloseMenu: function closeMenu() {\n\t\t\tthis.openedMenu = false;\n\t\t},\n\t\ttoggleMenu: function toggleMenu() {\n\t\t\tthis.openedMenu = !this.openedMenu;\n\t\t},\n\n\n\t\t/**\n * Move contact to the specified addressbook\n *\n * @param {Object} addressbook the desired addressbook\n */\n\t\tmoveContactToAddressbook: function moveContactToAddressbook(addressbook) {\n\t\t\tvar _this = this;\n\n\t\t\taddressbook = this.addressbooks.find(function (search) {\n\t\t\t\treturn search.id === addressbook.id;\n\t\t\t});\n\t\t\t// we need to use the store contact, not the local contact\n\t\t\tvar contact = this.$store.getters.getContact(this.contact.key);\n\t\t\t// TODO Make sure we do not overwrite contacts\n\t\t\tif (addressbook) {\n\t\t\t\tthis.$store.dispatch('moveContactToAddressbook', {\n\t\t\t\t\tcontact: contact,\n\t\t\t\t\taddressbook: addressbook\n\t\t\t\t}).then(function () {\n\t\t\t\t\t_this.updateContact();\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n};\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vc3JjL2NvbXBvbmVudHMvQ29udGFjdERldGFpbHMudnVlPzBmNjMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBaUdBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7O0FBRUE7Ozs7QUFDQTs7OztBQUVBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBRUE7O2tCQUVBO0FBQ0EsdUJBREE7O0FBR0E7QUFDQSxvQ0FEQTtBQUVBLDBEQUZBO0FBR0EsMENBSEE7QUFJQTtBQUpBLEVBSEE7O0FBVUE7QUFDQTtBQURBLEVBVkE7O0FBY0E7QUFDQTtBQUNBLGdCQURBO0FBRUE7QUFGQSxHQURBO0FBS0E7QUFDQSxlQURBO0FBRUE7QUFGQTtBQUxBLEVBZEE7O0FBeUJBLEtBekJBLGtCQXlCQTtBQUNBO0FBQ0Esb0JBREE7QUFFQTtBQUNBLDhDQURBO0FBRUE7QUFGQTtBQUZBO0FBT0EsRUFqQ0E7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YWN0VG9BZGRyZXNzYm9vayhhZGRyZXNzYm9vaykge1xuXHRcdFx0YWRkcmVzc2Jvb2sgPSB0aGlzLmFkZHJlc3Nib29rcy5maW5kKFxuXHRcdFx0XHRzZWFyY2ggPT4gc2VhcmNoLmlkID09PSBhZGRyZXNzYm9vay5pZFxuXHRcdFx0KVxuXHRcdFx0Ly8gd2UgbmVlZCB0byB1c2UgdGhlIHN0b3JlIGNvbnRhY3QsIG5vdCB0aGUgbG9jYWwgY29udGFjdFxuXHRcdFx0bGV0IGNvbnRhY3QgPSB0aGlzLiRzdG9yZS5nZXR0ZXJzLmdldENvbnRhY3QodGhpcy5jb250YWN0LmtleSlcblx0XHRcdC8vIFRPRE8gTWFrZSBzdXJlIHdlIGRvIG5vdCBvdmVyd3JpdGUgY29udGFjdHNcblx0XHRcdGlmIChhZGRyZXNzYm9vaykge1xuXHRcdFx0XHR0aGlzLiRzdG9yZVxuXHRcdFx0XHRcdC5kaXNwYXRjaCgnbW92ZUNvbnRhY3RUb0FkZHJlc3Nib29rJywge1xuXHRcdFx0XHRcdFx0Y29udGFjdDogY29udGFjdCxcblx0XHRcdFx0XHRcdGFkZHJlc3Nib29rXG5cdFx0XHRcdFx0fSlcblx0XHRcdFx0XHQudGhlbigoKSA9PiB7XG5cdFx0XHRcdFx0XHR0aGlzLnVwZGF0ZUNvbnRhY3QoKVxuXHRcdFx0XHRcdH0pXG5cdFx0XHR9XG5cdFx0fVxuXHR9XG59XG48L3NjcmlwdD5cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js?!./src/components/ContactDetails.vue?vue&type=script&lang=js&\n"); /***/ }), @@ -118,7 +118,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\n\nvar _ical = __webpack_require__(/*! ical.js */ \"./node_modules/ical.js/build/ical.js\");\n\nvar _rfcProps = __webpack_require__(/*! ../../models/rfcProps.js */ \"./src/models/rfcProps.js\");\n\nvar _rfcProps2 = _interopRequireDefault(_rfcProps);\n\nvar _contact = __webpack_require__(/*! ../../models/contact */ \"./src/models/contact.js\");\n\nvar _contact2 = _interopRequireDefault(_contact);\n\nvar _PropertyText = __webpack_require__(/*! ../properties/PropertyText */ \"./src/components/properties/PropertyText.vue\");\n\nvar _PropertyText2 = _interopRequireDefault(_PropertyText);\n\nvar _PropertyMultipleText = __webpack_require__(/*! ../properties/PropertyMultipleText */ \"./src/components/properties/PropertyMultipleText.vue\");\n\nvar _PropertyMultipleText2 = _interopRequireDefault(_PropertyMultipleText);\n\nvar _PropertyDateTime = __webpack_require__(/*! ../properties/PropertyDateTime */ \"./src/components/properties/PropertyDateTime.vue\");\n\nvar _PropertyDateTime2 = _interopRequireDefault(_PropertyDateTime);\n\nvar _PropertyGroups = __webpack_require__(/*! ../properties/PropertyGroups */ \"./src/components/properties/PropertyGroups.vue\");\n\nvar _PropertyGroups2 = _interopRequireDefault(_PropertyGroups);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// import PropertySelect from '../properties/PropertyMultipleText'\n\nexports.default = {\n\tname: 'ContactDetailsProperty',\n\n\tprops: {\n\t\tproperty: {\n\t\t\ttype: _ical.Property,\n\t\t\tdefault: true\n\t\t},\n\t\tsortedProperties: {\n\t\t\ttype: Array,\n\t\t\tdefault: function _default() {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t},\n\t\tindex: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0\n\t\t},\n\t\tcontact: {\n\t\t\ttype: _contact2.default,\n\t\t\tdefault: null\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t// dynamically load component based on property type\n\t\tcomponentInstance: function componentInstance() {\n\t\t\t// groups\n\t\t\tif (this.propName === 'categories') {\n\t\t\t\treturn _PropertyGroups2.default;\n\t\t\t}\n\n\t\t\t// dynamic matching\n\t\t\tif (this.property.isMultiValue && this.propType === 'text') {\n\t\t\t\treturn _PropertyMultipleText2.default;\n\t\t\t} else if (this.propType && ['date-and-or-time', 'date-time', 'time', 'date'].indexOf(this.propType) > -1) {\n\t\t\t\treturn _PropertyDateTime2.default;\n\t\t\t} else if (this.propType && this.propType !== 'unknown') {\n\t\t\t\treturn _PropertyText2.default;\n\t\t\t}\n\t\t\treturn _PropertyText2.default;\n\t\t},\n\n\n\t\t// rfc properties list\n\t\tproperties: function properties() {\n\t\t\treturn _rfcProps2.default.properties;\n\t\t},\n\t\tfieldOrder: function fieldOrder() {\n\t\t\treturn _rfcProps2.default.fieldOrder;\n\t\t},\n\n\n\t\t// is this the first property of its kind\n\t\tisFirstProperty: function isFirstProperty() {\n\t\t\tif (this.index > 0) {\n\t\t\t\treturn this.sortedProperties[this.index - 1].name !== this.propName;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\t\t// is this the last property of its kind\n\t\tisLastProperty: function isLastProperty() {\n\t\t\tif (this.index < this.sortedProperties.length) {\n\t\t\t\treturn this.sortedProperties[this.index + 1].name !== this.propName;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\n\n\t\t// the type of the prop e.g. FN\n\t\tpropName: function propName() {\n\t\t\treturn this.property.name;\n\t\t},\n\t\tpropType: function propType() {\n\t\t\treturn this.property.type;\n\t\t},\n\n\n\t\t// template to use\n\t\tpropModel: function propModel() {\n\t\t\treturn this.properties[this.propName];\n\t\t},\n\n\n\t\t// select type handler\n\t\tselectType: {\n\t\t\tget: function get() {\n\t\t\t\tif (this.propModel && this.propModel.options && this.type) {\n\n\t\t\t\t\tvar selectedType = this.type\n\t\t\t\t\t// vcard 3.0 save pref alongside TYPE\n\t\t\t\t\t.filter(function (type) {\n\t\t\t\t\t\treturn type !== 'pref';\n\t\t\t\t\t})\n\t\t\t\t\t// we only use uppercase strings\n\t\t\t\t\t.map(function (str) {\n\t\t\t\t\t\treturn str.toUpperCase();\n\t\t\t\t\t});\n\n\t\t\t\t\t// Compare array and score them by how many matches they have to the selected type\n\t\t\t\t\t// sorting directly is cleaner but slower\n\t\t\t\t\t// https://jsperf.com/array-map-and-intersection-perf\n\t\t\t\t\tvar matchingTypes = this.propModel.options.map(function (type) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: type,\n\t\t\t\t\t\t\t// \"WORK,HOME\" => ['WORK', 'HOME']\n\t\t\t\t\t\t\tscore: type.id.split(',').filter(function (value) {\n\t\t\t\t\t\t\t\treturn selectedType.indexOf(value) !== -1;\n\t\t\t\t\t\t\t}).length\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\n\t\t\t\t\t// Sort by score, filtering out the null score and selecting the first match\n\t\t\t\t\tvar matchingType = matchingTypes.sort(function (a, b) {\n\t\t\t\t\t\treturn b.score - a.score;\n\t\t\t\t\t}).filter(function (type) {\n\t\t\t\t\t\treturn type.score > 0;\n\t\t\t\t\t})[0];\n\n\t\t\t\t\tif (matchingType) {\n\t\t\t\t\t\treturn matchingType.type;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.type) {\n\t\t\t\t\t// vcard 3.0 save pref alongside TYPE\n\t\t\t\t\tvar _selectedType = this.type.filter(function (type) {\n\t\t\t\t\t\treturn type !== 'pref';\n\t\t\t\t\t}).join(',');\n\t\t\t\t\treturn {\n\t\t\t\t\t\tid: _selectedType,\n\t\t\t\t\t\tname: _selectedType\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tset: function set(data) {\n\t\t\t\t// ical.js take types as arrays\n\t\t\t\tthis.type = data.id.split(',');\n\t\t\t\tthis.$emit('updatedcontact');\n\t\t\t}\n\t\t},\n\n\t\t// property value(s)\n\t\tvalue: {\n\t\t\tget: function get() {\n\t\t\t\tif (this.property.isMultiValue) {\n\t\t\t\t\t// differences between values types :x;x;x;x;x and x,x,x,x,x\n\t\t\t\t\treturn this.property.isStructuredValue ? this.property.getValues()[0] : this.property.getValues();\n\t\t\t\t}\n\t\t\t\treturn this.property.getFirstValue();\n\t\t\t},\n\t\t\tset: function set(data) {\n\t\t\t\tif (this.property.isMultiValue) {\n\t\t\t\t\t// differences between values types :x;x;x;x;x and x,x,x,x,x\n\t\t\t\t\tthis.property.isStructuredValue ? this.property.setValues([data]) : this.property.setValues(data);\n\t\t\t\t}\n\t\t\t\tthis.property.setValue(data);\n\t\t\t\tthis.$emit('updatedcontact');\n\t\t\t}\n\t\t},\n\n\t\t// property meta type\n\t\ttype: {\n\t\t\tget: function get() {\n\t\t\t\tvar type = this.property.getParameter('type');\n\t\t\t\t// ensure we have an array\n\t\t\t\tif (type) {\n\t\t\t\t\treturn Array.isArray(type) ? type : [type];\n\t\t\t\t}\n\t\t\t},\n\t\t\tset: function set(data) {\n\t\t\t\tthis.property.setParameter('type', data);\n\t\t\t}\n\t\t},\n\n\t\t// property meta pref\n\t\tpref: {\n\t\t\tget: function get() {\n\t\t\t\treturn this.property.getParameter('pref');\n\t\t\t},\n\t\t\tset: function set(data) {\n\t\t\t\tthis.property.setParameter('pref', data);\n\t\t\t}\n\t\t}\n\t},\n\n\tmethods: {\n\t\tdeleteProp: function deleteProp() {\n\t\t\talert('deleted');\n\t\t}\n\t}\n\n}; //\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vc3JjL2NvbXBvbmVudHMvQ29udGFjdERldGFpbHMvQ29udGFjdERldGFpbHNQcm9wZXJ0eS52dWU/ODY3MCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUE4QkE7O0FBQ0E7Ozs7QUFDQTs7OztBQUVBOzs7O0FBQ0E7Ozs7QUFDQTs7OztBQUNB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