@nextcloud/vue 8.6.2 → 8.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/dist/Components/NcActionButton.cjs +6 -6
- package/dist/Components/NcActionButton.cjs.map +1 -1
- package/dist/Components/NcActionButton.mjs +3 -3
- package/dist/Components/NcActionButton.mjs.map +1 -1
- package/dist/Components/NcActionInput.cjs +1 -1
- package/dist/Components/NcActionInput.mjs +1 -1
- package/dist/Components/NcBreadcrumb.cjs +1 -1
- package/dist/Components/NcBreadcrumb.mjs +1 -1
- package/dist/Components/NcBreadcrumbs.cjs +1 -1
- package/dist/Components/NcBreadcrumbs.mjs +1 -1
- package/dist/Components/NcDashboardWidget.cjs +1 -1
- package/dist/Components/NcDashboardWidget.mjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.cjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +1 -1
- package/dist/Components/NcDateTimePicker.cjs +3 -3
- package/dist/Components/NcDateTimePicker.cjs.map +1 -1
- package/dist/Components/NcDateTimePicker.mjs +8 -8
- package/dist/Components/NcDateTimePicker.mjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.cjs +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +1 -1
- package/dist/Components/NcListItem.cjs +1 -1
- package/dist/Components/NcListItem.mjs +1 -1
- package/dist/Components/NcModal.cjs +7 -7
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +6 -6
- package/dist/Components/NcModal.mjs.map +1 -1
- package/dist/Components/NcRichContenteditable.cjs +1 -1
- package/dist/Components/NcRichContenteditable.mjs +1 -1
- package/dist/Components/NcRichText.cjs +11 -11
- package/dist/Components/NcRichText.cjs.map +1 -1
- package/dist/Components/NcRichText.mjs +22 -21
- package/dist/Components/NcRichText.mjs.map +1 -1
- package/dist/Components/NcSelect.cjs +1 -1
- package/dist/Components/NcSelect.mjs +1 -1
- package/dist/Components/NcSelectTags.cjs +1 -1
- package/dist/Components/NcSelectTags.mjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
- package/dist/Components/NcTimezonePicker.cjs +1 -1
- package/dist/Components/NcTimezonePicker.mjs +1 -1
- package/dist/Functions/reference.cjs +16 -0
- package/dist/Functions/reference.cjs.map +1 -0
- package/dist/Functions/reference.mjs +17 -0
- package/dist/Functions/reference.mjs.map +1 -0
- package/dist/Functions/registerReference.cjs +71 -0
- package/dist/Functions/registerReference.cjs.map +1 -0
- package/dist/Functions/registerReference.mjs +71 -0
- package/dist/Functions/registerReference.mjs.map +1 -0
- package/dist/assets/{NcActionButton-1Z9lN7ar.css → NcActionButton-rOZFVQA8.css} +17 -17
- package/dist/assets/{NcBreadcrumb-M3hqCbqS.css → NcBreadcrumb-HspaFygg.css} +16 -16
- package/dist/assets/{NcDashboardWidgetItem-S7fELANA.css → NcDashboardWidgetItem-OL--xR_P.css} +15 -13
- package/dist/assets/{NcDateTimePicker-rixdCL1X.css → NcDateTimePicker-TArRbMs-.css} +17 -17
- package/dist/assets/{NcListItem-5XAhBDJv.css → NcListItem-L8LeGwpe.css} +43 -43
- package/dist/assets/{NcModal-UZh031V1.css → NcModal-sIK5sUoC.css} +63 -63
- package/dist/assets/{NcRichContenteditable-WQVknpPy.css → NcRichContenteditable-CuR1YKTU.css} +34 -32
- package/dist/assets/NcRichText-Pw6kTpnR.css +215 -0
- package/dist/assets/referencePickerModal-A0PlFUEI.css +316 -0
- package/dist/chunks/{NcActionInput-BN9rIyI8.mjs → NcActionInput-XHMzOL_h.mjs} +1 -1
- package/dist/chunks/{NcActionInput-BN9rIyI8.mjs.map → NcActionInput-XHMzOL_h.mjs.map} +1 -1
- package/dist/chunks/{NcActionInput-qeRQBGlt.cjs → NcActionInput-f1Oq2O71.cjs} +1 -1
- package/dist/chunks/{NcActionInput-qeRQBGlt.cjs.map → NcActionInput-f1Oq2O71.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-EGgIr-sA.cjs → NcBreadcrumb-DEWk7wO9.cjs} +27 -20
- package/dist/chunks/NcBreadcrumb-DEWk7wO9.cjs.map +1 -0
- package/dist/chunks/{NcBreadcrumb-on01ofev.mjs → NcBreadcrumb-w1UX2NR-.mjs} +13 -6
- package/dist/chunks/NcBreadcrumb-w1UX2NR-.mjs.map +1 -0
- package/dist/chunks/{NcBreadcrumbs-hQmUGh48.cjs → NcBreadcrumbs-VuaG3ex5.cjs} +1 -1
- package/dist/chunks/{NcBreadcrumbs-hQmUGh48.cjs.map → NcBreadcrumbs-VuaG3ex5.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-2l-mWYHl.mjs → NcBreadcrumbs-tRR9CjKD.mjs} +1 -1
- package/dist/chunks/{NcBreadcrumbs-2l-mWYHl.mjs.map → NcBreadcrumbs-tRR9CjKD.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-ogqyHahY.mjs → NcDashboardWidget-9LDutUO0.mjs} +1 -1
- package/dist/chunks/{NcDashboardWidget-ogqyHahY.mjs.map → NcDashboardWidget-9LDutUO0.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-QciRRvL4.cjs → NcDashboardWidget-oPZKAkd-.cjs} +1 -1
- package/dist/chunks/{NcDashboardWidget-QciRRvL4.cjs.map → NcDashboardWidget-oPZKAkd-.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-mIPkPR7r.cjs → NcDashboardWidgetItem-1r760Ikh.cjs} +3 -3
- package/dist/chunks/NcDashboardWidgetItem-1r760Ikh.cjs.map +1 -0
- package/dist/chunks/{NcDashboardWidgetItem-wuUHTeLl.mjs → NcDashboardWidgetItem-Qd8gSF2h.mjs} +5 -5
- package/dist/chunks/NcDashboardWidgetItem-Qd8gSF2h.mjs.map +1 -0
- package/dist/chunks/{NcListItem-RDF4Yv0n.cjs → NcListItem--_PCqetA.cjs} +2 -2
- package/dist/chunks/{NcListItem-_PBHug1k.mjs.map → NcListItem--_PCqetA.cjs.map} +1 -1
- package/dist/chunks/{NcListItem-_PBHug1k.mjs → NcListItem-AMcc69jK.mjs} +2 -2
- package/dist/chunks/{NcListItem-RDF4Yv0n.cjs.map → NcListItem-AMcc69jK.mjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-xcoJkj3I.cjs → NcRichContenteditable-cUZMZlgG.cjs} +77 -54
- package/dist/chunks/NcRichContenteditable-cUZMZlgG.cjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-glkLWE43.mjs → NcRichContenteditable-d4EOAT2a.mjs} +86 -64
- package/dist/chunks/NcRichContenteditable-d4EOAT2a.mjs.map +1 -0
- package/dist/chunks/NcRichText-S34HoIhH.cjs +313 -0
- package/dist/chunks/NcRichText-S34HoIhH.cjs.map +1 -0
- package/dist/chunks/NcRichText-yfYdNWFh.mjs +328 -0
- package/dist/chunks/NcRichText-yfYdNWFh.mjs.map +1 -0
- package/dist/chunks/{NcSelect-SlL-Y8Qz.cjs → NcSelect-U9LJcdIo.cjs} +54 -44
- package/dist/chunks/NcSelect-U9LJcdIo.cjs.map +1 -0
- package/dist/chunks/{NcSelect-2ClmJ8jJ.mjs → NcSelect-b2H-YQsK.mjs} +39 -29
- package/dist/chunks/NcSelect-b2H-YQsK.mjs.map +1 -0
- package/dist/chunks/{NcSelectTags-TC2UmbfI.mjs → NcSelectTags-MlILya2b.mjs} +1 -1
- package/dist/chunks/{NcSelectTags-TC2UmbfI.mjs.map → NcSelectTags-MlILya2b.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-FKigJPco.cjs → NcSelectTags-rO88Pk-1.cjs} +1 -1
- package/dist/chunks/{NcSelectTags-FKigJPco.cjs.map → NcSelectTags-rO88Pk-1.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-fOU9O4VD.cjs → NcSettingsSelectGroup-rfeDPLCg.cjs} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-fOU9O4VD.cjs.map → NcSettingsSelectGroup-rfeDPLCg.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-Bcai5uHx.mjs → NcSettingsSelectGroup-xhnDBg8a.mjs} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-Bcai5uHx.mjs.map → NcSettingsSelectGroup-xhnDBg8a.mjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-Dv6pIP9O.cjs → NcTimezonePicker-KG0dvgUv.cjs} +1 -1
- package/dist/chunks/{NcTimezonePicker-Dv6pIP9O.cjs.map → NcTimezonePicker-KG0dvgUv.cjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-DDce-mch.mjs → NcTimezonePicker-jJeiI-Ff.mjs} +1 -1
- package/dist/chunks/{NcTimezonePicker-DDce-mch.mjs.map → NcTimezonePicker-jJeiI-Ff.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-hYwaRplQ.mjs → ScopeComponent-ZQvTL_tO.mjs} +1 -1
- package/dist/chunks/{ScopeComponent-hYwaRplQ.mjs.map → ScopeComponent-ZQvTL_tO.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-qBzpvxit.cjs → ScopeComponent-v4OJPQb8.cjs} +1 -1
- package/dist/chunks/{ScopeComponent-qBzpvxit.cjs.map → ScopeComponent-v4OJPQb8.cjs.map} +1 -1
- package/dist/chunks/referencePickerModal-cPBjsn4r.cjs +2393 -0
- package/dist/chunks/referencePickerModal-cPBjsn4r.cjs.map +1 -0
- package/dist/chunks/referencePickerModal-gDBkGfNV.mjs +2414 -0
- package/dist/chunks/referencePickerModal-gDBkGfNV.mjs.map +1 -0
- package/dist/index.cjs +189 -170
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +178 -159
- package/dist/index.mjs.map +1 -1
- package/dist/vendor.LICENSE.txt +4 -0
- package/package.json +2 -2
- package/dist/assets/referencePickerModal-yucfxaTX.css +0 -509
- package/dist/chunks/NcBreadcrumb-EGgIr-sA.cjs.map +0 -1
- package/dist/chunks/NcBreadcrumb-on01ofev.mjs.map +0 -1
- package/dist/chunks/NcDashboardWidgetItem-mIPkPR7r.cjs.map +0 -1
- package/dist/chunks/NcDashboardWidgetItem-wuUHTeLl.mjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-glkLWE43.mjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-xcoJkj3I.cjs.map +0 -1
- package/dist/chunks/NcRichText-TdyEC_z7.cjs +0 -337
- package/dist/chunks/NcRichText-TdyEC_z7.cjs.map +0 -1
- package/dist/chunks/NcRichText-lyvuLvpr.mjs +0 -353
- package/dist/chunks/NcRichText-lyvuLvpr.mjs.map +0 -1
- package/dist/chunks/NcSelect-2ClmJ8jJ.mjs.map +0 -1
- package/dist/chunks/NcSelect-SlL-Y8Qz.cjs.map +0 -1
- package/dist/chunks/referencePickerModal-cy4_Q5bu.cjs +0 -880
- package/dist/chunks/referencePickerModal-cy4_Q5bu.cjs.map +0 -1
- package/dist/chunks/referencePickerModal-wDsYQHxX.mjs +0 -897
- package/dist/chunks/referencePickerModal-wDsYQHxX.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcSettingsSelectGroup-fOU9O4VD.cjs","sources":["../../src/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>\n -\n - @author Julius Härtl <jus@bitgrid.net>\n - @author Greta Doci <gretadoci@gmail.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n```vue\n<template>\n\t<section>\n\t\t<NcSettingsSelectGroup v-model=\"groups\" placeholder=\"Select user groups\" label=\"The hidden label\" />\n\t\t<NcSettingsSelectGroup v-model=\"otherGroups\" :disabled=\"true\" label=\"Also a fallback for the placeholder\" />\n\t\t<div>You have selected: <code>{{ groups }}</code> and <code>{{ otherGroups }}</code></div>\n\t</section>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tgroups: [],\n\t\t\totherGroups: ['admin']\n\t\t}\n\t}\n}\n</script>\n<style scoped>\nsection * {\n\tpadding: 6px 0px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<div>\n\t\t<label v-if=\"label\" :for=\"id\" class=\"hidden-visually\">{{ label }}</label>\n\t\t<NcSelect :value=\"inputValue\"\n\t\t\t:options=\"groupsArray\"\n\t\t\t:placeholder=\"placeholder || label\"\n\t\t\t:filter-by=\"filterGroups\"\n\t\t\t:input-id=\"id\"\n\t\t\t:limit=\"5\"\n\t\t\tlabel=\"displayname\"\n\t\t\t:multiple=\"true\"\n\t\t\t:close-on-select=\"false\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t@input=\"update\"\n\t\t\t@search=\"onSearch\" />\n\t\t<div v-show=\"hasError\" class=\"select-group-error\">\n\t\t\t{{ errorMessage }}\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport NcSelect from '../../components/NcSelect/index.js'\nimport { t } from '../../l10n.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nimport axios from '@nextcloud/axios'\nimport debounce from 'debounce'\nimport { generateOcsUrl } from '@nextcloud/router'\n\nexport default {\n\tname: 'NcSettingsSelectGroup',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The text of the label element of the select group input\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * Placeholder for the input element\n\t\t * For backwards compatibility it falls back to the `label` value\n\t\t */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the select group element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'action-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * value of the select group input\n\t\t * A list of group IDs can be provided\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the settings select group input\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\temits: [\n\t\t'input',\n\t\t'error',\n\t],\n\tdata() {\n\t\treturn {\n\t\t\t/** Temporary store to cache groups */\n\t\t\tgroups: {},\n\t\t\trandId: GenRandomId(),\n\t\t\terrorMessage: '',\n\t\t}\n\t},\n\tcomputed: {\n\t\t/**\n\t\t * If the error message should be shown\n\t\t */\n\t\thasError() {\n\t\t\treturn this.errorMessage !== ''\n\t\t},\n\n\t\t/**\n\t\t * Validate input value and only return valid strings (group IDs)\n\t\t *\n\t\t * @return {string[]}\n\t\t */\n\t\tfilteredValue() {\n\t\t\treturn this.value.filter((group) => group !== '' && typeof group === 'string')\n\t\t},\n\n\t\t/**\n\t\t * value property converted to an array of group objects used as input for the NcSelect\n\t\t */\n\t\tinputValue() {\n\t\t\treturn this.filteredValue.map(\n\t\t\t\t(id) => {\n\t\t\t\t\tif (typeof this.groups[id] === 'undefined') {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tdisplayname: id,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this.groups[id]\n\t\t\t\t},\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Convert groups object to array of groups required for NcSelect.options\n\t\t * Filter out currently selected values\n\t\t *\n\t\t * @return {object[]}\n\t\t */\n\t\tgroupsArray() {\n\t\t\treturn Object.values(this.groups).filter(g => !this.value.includes(g.id))\n\t\t},\n\t},\n\twatch: {\n\t\t/**\n\t\t * If the value is changed, check that all groups are loaded so we show the correct display name\n\t\t */\n\t\tvalue: {\n\t\t\thandler() {\n\t\t\t\tconst loadedGroupIds = Object.keys(this.groups)\n\t\t\t\tconst missing = this.filteredValue.filter(group => !loadedGroupIds.includes(group))\n\t\t\t\tmissing.forEach((groupId) => {\n\t\t\t\t\tthis.loadGroup(groupId)\n\t\t\t\t})\n\t\t\t},\n\t\t\t// Run the watch handler also when the component is initially mounted\n\t\t\timmediate: true,\n\t\t},\n\t},\n\t/**\n\t * Load groups matching the empty query to reduce API calls\n\t */\n\tasync mounted() {\n\t\t// version scoped to prevent issues with different library versions\n\t\tconst storageName = `${appName}:${appVersion}/initialGroups`\n\n\t\tlet savedGroups = window.sessionStorage.getItem(storageName)\n\t\tif (savedGroups) {\n\t\t\tsavedGroups = Object.fromEntries(JSON.parse(savedGroups).map(group => [group.id, group]))\n\t\t\tthis.groups = { ...this.groups, ...savedGroups }\n\t\t} else {\n\t\t\tawait this.loadGroup('')\n\t\t\twindow.sessionStorage.setItem(storageName, JSON.stringify(Object.values(this.groups)))\n\t\t}\n\t},\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Called when a new group is selected or previous group is deselected to emit the update event\n\t\t *\n\t\t * @param {object[]} updatedValue Array of selected groups\n\t\t */\n\t\tupdate(updatedValue) {\n\t\t\tconst value = updatedValue.map((element) => element.id)\n\t\t\t/** Emitted when the groups selection changes<br />**Payload:** `value` (`Array`) - *Ids of selected groups */\n\t\t\tthis.$emit('input', value)\n\t\t},\n\n\t\t/**\n\t\t * Use provisioning API to search for given group and save it in the groups object\n\t\t *\n\t\t * @param {string} query The query like parts of the id oder display name\n\t\t * @return {boolean}\n\t\t */\n\t\tasync loadGroup(query) {\n\t\t\ttry {\n\t\t\t\tquery = typeof query === 'string' ? encodeURI(query) : ''\n\t\t\t\tconst response = await axios.get(generateOcsUrl(`cloud/groups/details?search=${query}&limit=10`, 2))\n\n\t\t\t\t// No network error, so reset any error after 5 seconds\n\t\t\t\tif (this.errorMessage !== '') {\n\t\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\t\tthis.errorMessage = ''\n\t\t\t\t\t}, 5000)\n\t\t\t\t}\n\n\t\t\t\tif (Object.keys(response.data.ocs.data.groups).length > 0) {\n\t\t\t\t\tconst newGroups = Object.fromEntries(response.data.ocs.data.groups.map((element) => [element.id, element]))\n\t\t\t\t\tthis.groups = { ...this.groups, ...newGroups }\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t/** Emitted if groups could not be queried.<br />**Payload:** `error` (`object`) - The Axios error */\n\t\t\t\tthis.$emit('error', error)\n\t\t\t\tthis.errorMessage = t('Unable to search the group')\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\t/**\n\t\t * Custom filter function for `NcSelect` to filter by ID *and* display name\n\t\t *\n\t\t * @param {object} option One of the groups\n\t\t * @param {string} label The label property of the group\n\t\t * @param {string} search The current search string\n\t\t */\n\t\tfilterGroups(option, label, search) {\n\t\t\treturn `${label || ''} ${option.id}`.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1\n\t\t},\n\n\t\t/**\n\t\t * Debounce the group search (reduce API calls)\n\t\t */\n\t\tonSearch: debounce(function(query) {\n\t\t\tthis.loadGroup(query)\n\t\t}, 200),\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.select-group-error {\n\tcolor: var(--color-error);\n\tfont-size: 13px;\n\tpadding-inline-start: var(--border-radius-large);\n}\n</style>\n"],"names":["_sfc_main","NcSelect","GenRandomId","id","group","g","loadedGroupIds","groupId","storageName","savedGroups","t","updatedValue","value","element","query","response","axios","generateOcsUrl","newGroups","error","option","label","search","debounce"],"mappings":";;;AAiFA,MAAAA,IAAA;AAAA,EACA,M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A,IAAAC,EAAA,eAAA,+BAAAH,CAAA,aAAA,CAAA,CAAA;AASA,YANA,KAAA,iBAAA,MACA,OAAA,WAAA,MAAA;AACA,eAAA,eAAA;AAAA,QACA,GAAA,GAAA,GAGA,OAAA,KAAAC,EAAA,KAAA,IAAA,KAAA,MAAA,EAAA,SAAA,GAAA;AACA,gBAAAG,IAAA,OAAA,YAAAH,EAAA,KAAA,IAAA,KAAA,OAAA,IAAA,CAAAF,MAAA,CAAAA,EAAA,IAAAA,CAAA,CAAA,CAAA;AACA,sBAAA,SAAA,EAAA,GAAA,KAAA,QAAA,GAAAK,EAAA,GACA;AAAA,QACA;AAAA,MACA,SAAAC,GAAA;AAEA,aAAA,MAAA,SAAAA,CAAA,GACA,KAAA,eAAAT,EAAA,EAAA,4BAAA;AAAA,MACA;AACA,aAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAAU,GAAAC,GAAAC,GAAA;AACA,aAAA,GAAAD,KAAA,EAAA,IAAAD,EAAA,EAAA,GAAA,kBAAA,EAAA,QAAAE,EAAA,kBAAA,CAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAAC,EAAAA,QAAA,SAAAT,GAAA;AACA,WAAA,UAAAA,CAAA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcSettingsSelectGroup-rfeDPLCg.cjs","sources":["../../src/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>\n -\n - @author Julius Härtl <jus@bitgrid.net>\n - @author Greta Doci <gretadoci@gmail.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n```vue\n<template>\n\t<section>\n\t\t<NcSettingsSelectGroup v-model=\"groups\" placeholder=\"Select user groups\" label=\"The hidden label\" />\n\t\t<NcSettingsSelectGroup v-model=\"otherGroups\" :disabled=\"true\" label=\"Also a fallback for the placeholder\" />\n\t\t<div>You have selected: <code>{{ groups }}</code> and <code>{{ otherGroups }}</code></div>\n\t</section>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tgroups: [],\n\t\t\totherGroups: ['admin']\n\t\t}\n\t}\n}\n</script>\n<style scoped>\nsection * {\n\tpadding: 6px 0px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<div>\n\t\t<label v-if=\"label\" :for=\"id\" class=\"hidden-visually\">{{ label }}</label>\n\t\t<NcSelect :value=\"inputValue\"\n\t\t\t:options=\"groupsArray\"\n\t\t\t:placeholder=\"placeholder || label\"\n\t\t\t:filter-by=\"filterGroups\"\n\t\t\t:input-id=\"id\"\n\t\t\t:limit=\"5\"\n\t\t\tlabel=\"displayname\"\n\t\t\t:multiple=\"true\"\n\t\t\t:close-on-select=\"false\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t@input=\"update\"\n\t\t\t@search=\"onSearch\" />\n\t\t<div v-show=\"hasError\" class=\"select-group-error\">\n\t\t\t{{ errorMessage }}\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport NcSelect from '../../components/NcSelect/index.js'\nimport { t } from '../../l10n.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nimport axios from '@nextcloud/axios'\nimport debounce from 'debounce'\nimport { generateOcsUrl } from '@nextcloud/router'\n\nexport default {\n\tname: 'NcSettingsSelectGroup',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The text of the label element of the select group input\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * Placeholder for the input element\n\t\t * For backwards compatibility it falls back to the `label` value\n\t\t */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the select group element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'action-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * value of the select group input\n\t\t * A list of group IDs can be provided\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the settings select group input\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\temits: [\n\t\t'input',\n\t\t'error',\n\t],\n\tdata() {\n\t\treturn {\n\t\t\t/** Temporary store to cache groups */\n\t\t\tgroups: {},\n\t\t\trandId: GenRandomId(),\n\t\t\terrorMessage: '',\n\t\t}\n\t},\n\tcomputed: {\n\t\t/**\n\t\t * If the error message should be shown\n\t\t */\n\t\thasError() {\n\t\t\treturn this.errorMessage !== ''\n\t\t},\n\n\t\t/**\n\t\t * Validate input value and only return valid strings (group IDs)\n\t\t *\n\t\t * @return {string[]}\n\t\t */\n\t\tfilteredValue() {\n\t\t\treturn this.value.filter((group) => group !== '' && typeof group === 'string')\n\t\t},\n\n\t\t/**\n\t\t * value property converted to an array of group objects used as input for the NcSelect\n\t\t */\n\t\tinputValue() {\n\t\t\treturn this.filteredValue.map(\n\t\t\t\t(id) => {\n\t\t\t\t\tif (typeof this.groups[id] === 'undefined') {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tdisplayname: id,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this.groups[id]\n\t\t\t\t},\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Convert groups object to array of groups required for NcSelect.options\n\t\t * Filter out currently selected values\n\t\t *\n\t\t * @return {object[]}\n\t\t */\n\t\tgroupsArray() {\n\t\t\treturn Object.values(this.groups).filter(g => !this.value.includes(g.id))\n\t\t},\n\t},\n\twatch: {\n\t\t/**\n\t\t * If the value is changed, check that all groups are loaded so we show the correct display name\n\t\t */\n\t\tvalue: {\n\t\t\thandler() {\n\t\t\t\tconst loadedGroupIds = Object.keys(this.groups)\n\t\t\t\tconst missing = this.filteredValue.filter(group => !loadedGroupIds.includes(group))\n\t\t\t\tmissing.forEach((groupId) => {\n\t\t\t\t\tthis.loadGroup(groupId)\n\t\t\t\t})\n\t\t\t},\n\t\t\t// Run the watch handler also when the component is initially mounted\n\t\t\timmediate: true,\n\t\t},\n\t},\n\t/**\n\t * Load groups matching the empty query to reduce API calls\n\t */\n\tasync mounted() {\n\t\t// version scoped to prevent issues with different library versions\n\t\tconst storageName = `${appName}:${appVersion}/initialGroups`\n\n\t\tlet savedGroups = window.sessionStorage.getItem(storageName)\n\t\tif (savedGroups) {\n\t\t\tsavedGroups = Object.fromEntries(JSON.parse(savedGroups).map(group => [group.id, group]))\n\t\t\tthis.groups = { ...this.groups, ...savedGroups }\n\t\t} else {\n\t\t\tawait this.loadGroup('')\n\t\t\twindow.sessionStorage.setItem(storageName, JSON.stringify(Object.values(this.groups)))\n\t\t}\n\t},\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Called when a new group is selected or previous group is deselected to emit the update event\n\t\t *\n\t\t * @param {object[]} updatedValue Array of selected groups\n\t\t */\n\t\tupdate(updatedValue) {\n\t\t\tconst value = updatedValue.map((element) => element.id)\n\t\t\t/** Emitted when the groups selection changes<br />**Payload:** `value` (`Array`) - *Ids of selected groups */\n\t\t\tthis.$emit('input', value)\n\t\t},\n\n\t\t/**\n\t\t * Use provisioning API to search for given group and save it in the groups object\n\t\t *\n\t\t * @param {string} query The query like parts of the id oder display name\n\t\t * @return {boolean}\n\t\t */\n\t\tasync loadGroup(query) {\n\t\t\ttry {\n\t\t\t\tquery = typeof query === 'string' ? encodeURI(query) : ''\n\t\t\t\tconst response = await axios.get(generateOcsUrl(`cloud/groups/details?search=${query}&limit=10`, 2))\n\n\t\t\t\t// No network error, so reset any error after 5 seconds\n\t\t\t\tif (this.errorMessage !== '') {\n\t\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\t\tthis.errorMessage = ''\n\t\t\t\t\t}, 5000)\n\t\t\t\t}\n\n\t\t\t\tif (Object.keys(response.data.ocs.data.groups).length > 0) {\n\t\t\t\t\tconst newGroups = Object.fromEntries(response.data.ocs.data.groups.map((element) => [element.id, element]))\n\t\t\t\t\tthis.groups = { ...this.groups, ...newGroups }\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t/** Emitted if groups could not be queried.<br />**Payload:** `error` (`object`) - The Axios error */\n\t\t\t\tthis.$emit('error', error)\n\t\t\t\tthis.errorMessage = t('Unable to search the group')\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\t/**\n\t\t * Custom filter function for `NcSelect` to filter by ID *and* display name\n\t\t *\n\t\t * @param {object} option One of the groups\n\t\t * @param {string} label The label property of the group\n\t\t * @param {string} search The current search string\n\t\t */\n\t\tfilterGroups(option, label, search) {\n\t\t\treturn `${label || ''} ${option.id}`.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1\n\t\t},\n\n\t\t/**\n\t\t * Debounce the group search (reduce API calls)\n\t\t */\n\t\tonSearch: debounce(function(query) {\n\t\t\tthis.loadGroup(query)\n\t\t}, 200),\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.select-group-error {\n\tcolor: var(--color-error);\n\tfont-size: 13px;\n\tpadding-inline-start: var(--border-radius-large);\n}\n</style>\n"],"names":["_sfc_main","NcSelect","GenRandomId","id","group","g","loadedGroupIds","groupId","storageName","savedGroups","t","updatedValue","value","element","query","response","axios","generateOcsUrl","newGroups","error","option","label","search","debounce"],"mappings":";;;AAiFA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC,EAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,YAAAC,cAAA;AAAA,MACA,WAAA,CAAAC,MAAAA,EAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,CAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EACA,OAAA;AACA,WAAA;AAAA;AAAA,MAEA,QAAA,CAAA;AAAA,MACA,QAAAD,EAAAA,YAAA;AAAA,MACA,cAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,UAAA;AAAA;AAAA;AAAA;AAAA,IAIA,WAAA;AACA,aAAA,KAAA,iBAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,gBAAA;AACA,aAAA,KAAA,MAAA,OAAA,CAAAE,MAAAA,MAAA,MAAA,OAAAA,KAAA,QAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,aAAA;AACA,aAAA,KAAA,cAAA;AAAA,QACA,CAAAD,MACA,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,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,MAAA,UAAAE,GAAA;AACA,UAAA;AACA,QAAAA,IAAA,OAAAA,KAAA,WAAA,UAAAA,CAAA,IAAA;AACA,cAAAC,IAAA,MAAAC,UAAA,IAAAC,EAAA,eAAA,+BAAAH,CAAA,aAAA,CAAA,CAAA;AASA,YANA,KAAA,iBAAA,MACA,OAAA,WAAA,MAAA;AACA,eAAA,eAAA;AAAA,QACA,GAAA,GAAA,GAGA,OAAA,KAAAC,EAAA,KAAA,IAAA,KAAA,MAAA,EAAA,SAAA,GAAA;AACA,gBAAAG,IAAA,OAAA,YAAAH,EAAA,KAAA,IAAA,KAAA,OAAA,IAAA,CAAAF,MAAA,CAAAA,EAAA,IAAAA,CAAA,CAAA,CAAA;AACA,sBAAA,SAAA,EAAA,GAAA,KAAA,QAAA,GAAAK,EAAA,GACA;AAAA,QACA;AAAA,MACA,SAAAC,GAAA;AAEA,aAAA,MAAA,SAAAA,CAAA,GACA,KAAA,eAAAT,EAAA,EAAA,4BAAA;AAAA,MACA;AACA,aAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAAU,GAAAC,GAAAC,GAAA;AACA,aAAA,GAAAD,KAAA,EAAA,IAAAD,EAAA,EAAA,GAAA,kBAAA,EAAA,QAAAE,EAAA,kBAAA,CAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAAC,EAAAA,QAAA,SAAAT,GAAA;AACA,WAAA,UAAAA,CAAA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
package/dist/chunks/{NcSettingsSelectGroup-Bcai5uHx.mjs → NcSettingsSelectGroup-xhnDBg8a.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../assets/NcSettingsSelectGroup-_Jpb8yE3.css';
|
|
2
|
-
import { N as i } from "./NcSelect-
|
|
2
|
+
import { N as i } from "./NcSelect-b2H-YQsK.mjs";
|
|
3
3
|
import { r as l, e as n, a } from "./_l10n-FmsZpnE4.mjs";
|
|
4
4
|
import { G as o } from "./GenRandomId-VodkdWbp.mjs";
|
|
5
5
|
import u from "@nextcloud/axios";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcSettingsSelectGroup-Bcai5uHx.mjs","sources":["../../src/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>\n -\n - @author Julius Härtl <jus@bitgrid.net>\n - @author Greta Doci <gretadoci@gmail.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n```vue\n<template>\n\t<section>\n\t\t<NcSettingsSelectGroup v-model=\"groups\" placeholder=\"Select user groups\" label=\"The hidden label\" />\n\t\t<NcSettingsSelectGroup v-model=\"otherGroups\" :disabled=\"true\" label=\"Also a fallback for the placeholder\" />\n\t\t<div>You have selected: <code>{{ groups }}</code> and <code>{{ otherGroups }}</code></div>\n\t</section>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tgroups: [],\n\t\t\totherGroups: ['admin']\n\t\t}\n\t}\n}\n</script>\n<style scoped>\nsection * {\n\tpadding: 6px 0px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<div>\n\t\t<label v-if=\"label\" :for=\"id\" class=\"hidden-visually\">{{ label }}</label>\n\t\t<NcSelect :value=\"inputValue\"\n\t\t\t:options=\"groupsArray\"\n\t\t\t:placeholder=\"placeholder || label\"\n\t\t\t:filter-by=\"filterGroups\"\n\t\t\t:input-id=\"id\"\n\t\t\t:limit=\"5\"\n\t\t\tlabel=\"displayname\"\n\t\t\t:multiple=\"true\"\n\t\t\t:close-on-select=\"false\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t@input=\"update\"\n\t\t\t@search=\"onSearch\" />\n\t\t<div v-show=\"hasError\" class=\"select-group-error\">\n\t\t\t{{ errorMessage }}\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport NcSelect from '../../components/NcSelect/index.js'\nimport { t } from '../../l10n.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nimport axios from '@nextcloud/axios'\nimport debounce from 'debounce'\nimport { generateOcsUrl } from '@nextcloud/router'\n\nexport default {\n\tname: 'NcSettingsSelectGroup',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The text of the label element of the select group input\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * Placeholder for the input element\n\t\t * For backwards compatibility it falls back to the `label` value\n\t\t */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the select group element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'action-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * value of the select group input\n\t\t * A list of group IDs can be provided\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the settings select group input\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\temits: [\n\t\t'input',\n\t\t'error',\n\t],\n\tdata() {\n\t\treturn {\n\t\t\t/** Temporary store to cache groups */\n\t\t\tgroups: {},\n\t\t\trandId: GenRandomId(),\n\t\t\terrorMessage: '',\n\t\t}\n\t},\n\tcomputed: {\n\t\t/**\n\t\t * If the error message should be shown\n\t\t */\n\t\thasError() {\n\t\t\treturn this.errorMessage !== ''\n\t\t},\n\n\t\t/**\n\t\t * Validate input value and only return valid strings (group IDs)\n\t\t *\n\t\t * @return {string[]}\n\t\t */\n\t\tfilteredValue() {\n\t\t\treturn this.value.filter((group) => group !== '' && typeof group === 'string')\n\t\t},\n\n\t\t/**\n\t\t * value property converted to an array of group objects used as input for the NcSelect\n\t\t */\n\t\tinputValue() {\n\t\t\treturn this.filteredValue.map(\n\t\t\t\t(id) => {\n\t\t\t\t\tif (typeof this.groups[id] === 'undefined') {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tdisplayname: id,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this.groups[id]\n\t\t\t\t},\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Convert groups object to array of groups required for NcSelect.options\n\t\t * Filter out currently selected values\n\t\t *\n\t\t * @return {object[]}\n\t\t */\n\t\tgroupsArray() {\n\t\t\treturn Object.values(this.groups).filter(g => !this.value.includes(g.id))\n\t\t},\n\t},\n\twatch: {\n\t\t/**\n\t\t * If the value is changed, check that all groups are loaded so we show the correct display name\n\t\t */\n\t\tvalue: {\n\t\t\thandler() {\n\t\t\t\tconst loadedGroupIds = Object.keys(this.groups)\n\t\t\t\tconst missing = this.filteredValue.filter(group => !loadedGroupIds.includes(group))\n\t\t\t\tmissing.forEach((groupId) => {\n\t\t\t\t\tthis.loadGroup(groupId)\n\t\t\t\t})\n\t\t\t},\n\t\t\t// Run the watch handler also when the component is initially mounted\n\t\t\timmediate: true,\n\t\t},\n\t},\n\t/**\n\t * Load groups matching the empty query to reduce API calls\n\t */\n\tasync mounted() {\n\t\t// version scoped to prevent issues with different library versions\n\t\tconst storageName = `${appName}:${appVersion}/initialGroups`\n\n\t\tlet savedGroups = window.sessionStorage.getItem(storageName)\n\t\tif (savedGroups) {\n\t\t\tsavedGroups = Object.fromEntries(JSON.parse(savedGroups).map(group => [group.id, group]))\n\t\t\tthis.groups = { ...this.groups, ...savedGroups }\n\t\t} else {\n\t\t\tawait this.loadGroup('')\n\t\t\twindow.sessionStorage.setItem(storageName, JSON.stringify(Object.values(this.groups)))\n\t\t}\n\t},\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Called when a new group is selected or previous group is deselected to emit the update event\n\t\t *\n\t\t * @param {object[]} updatedValue Array of selected groups\n\t\t */\n\t\tupdate(updatedValue) {\n\t\t\tconst value = updatedValue.map((element) => element.id)\n\t\t\t/** Emitted when the groups selection changes<br />**Payload:** `value` (`Array`) - *Ids of selected groups */\n\t\t\tthis.$emit('input', value)\n\t\t},\n\n\t\t/**\n\t\t * Use provisioning API to search for given group and save it in the groups object\n\t\t *\n\t\t * @param {string} query The query like parts of the id oder display name\n\t\t * @return {boolean}\n\t\t */\n\t\tasync loadGroup(query) {\n\t\t\ttry {\n\t\t\t\tquery = typeof query === 'string' ? encodeURI(query) : ''\n\t\t\t\tconst response = await axios.get(generateOcsUrl(`cloud/groups/details?search=${query}&limit=10`, 2))\n\n\t\t\t\t// No network error, so reset any error after 5 seconds\n\t\t\t\tif (this.errorMessage !== '') {\n\t\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\t\tthis.errorMessage = ''\n\t\t\t\t\t}, 5000)\n\t\t\t\t}\n\n\t\t\t\tif (Object.keys(response.data.ocs.data.groups).length > 0) {\n\t\t\t\t\tconst newGroups = Object.fromEntries(response.data.ocs.data.groups.map((element) => [element.id, element]))\n\t\t\t\t\tthis.groups = { ...this.groups, ...newGroups }\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t/** Emitted if groups could not be queried.<br />**Payload:** `error` (`object`) - The Axios error */\n\t\t\t\tthis.$emit('error', error)\n\t\t\t\tthis.errorMessage = t('Unable to search the group')\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\t/**\n\t\t * Custom filter function for `NcSelect` to filter by ID *and* display name\n\t\t *\n\t\t * @param {object} option One of the groups\n\t\t * @param {string} label The label property of the group\n\t\t * @param {string} search The current search string\n\t\t */\n\t\tfilterGroups(option, label, search) {\n\t\t\treturn `${label || ''} ${option.id}`.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1\n\t\t},\n\n\t\t/**\n\t\t * Debounce the group search (reduce API calls)\n\t\t */\n\t\tonSearch: debounce(function(query) {\n\t\t\tthis.loadGroup(query)\n\t\t}, 200),\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.select-group-error {\n\tcolor: var(--color-error);\n\tfont-size: 13px;\n\tpadding-inline-start: var(--border-radius-large);\n}\n</style>\n"],"names":["_sfc_main","NcSelect","GenRandomId","id","group","g","loadedGroupIds","groupId","storageName","savedGroups","t","updatedValue","value","element","query","response","axios","generateOcsUrl","newGroups","error","option","label","search","debounce"],"mappings":";;;;;;;;AAiFA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,YAAAC,EAAA;AAAA,MACA,WAAA,CAAAC,MAAAA,EAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,CAAA;AAAA,IACA;AAAA;AAAA;A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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAAU,GAAAC,GAAAC,GAAA;AACA,aAAA,GAAAD,KAAA,EAAA,IAAAD,EAAA,EAAA,GAAA,kBAAA,EAAA,QAAAE,EAAA,kBAAA,CAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAAC,EAAA,SAAAT,GAAA;AACA,WAAA,UAAAA,CAAA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcSettingsSelectGroup-xhnDBg8a.mjs","sources":["../../src/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2019 Julius Härtl <jus@bitgrid.net>\n -\n - @author Julius Härtl <jus@bitgrid.net>\n - @author Greta Doci <gretadoci@gmail.com>\n - @author Ferdinand Thiessen <opensource@fthiessen.de>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n```vue\n<template>\n\t<section>\n\t\t<NcSettingsSelectGroup v-model=\"groups\" placeholder=\"Select user groups\" label=\"The hidden label\" />\n\t\t<NcSettingsSelectGroup v-model=\"otherGroups\" :disabled=\"true\" label=\"Also a fallback for the placeholder\" />\n\t\t<div>You have selected: <code>{{ groups }}</code> and <code>{{ otherGroups }}</code></div>\n\t</section>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tgroups: [],\n\t\t\totherGroups: ['admin']\n\t\t}\n\t}\n}\n</script>\n<style scoped>\nsection * {\n\tpadding: 6px 0px;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<div>\n\t\t<label v-if=\"label\" :for=\"id\" class=\"hidden-visually\">{{ label }}</label>\n\t\t<NcSelect :value=\"inputValue\"\n\t\t\t:options=\"groupsArray\"\n\t\t\t:placeholder=\"placeholder || label\"\n\t\t\t:filter-by=\"filterGroups\"\n\t\t\t:input-id=\"id\"\n\t\t\t:limit=\"5\"\n\t\t\tlabel=\"displayname\"\n\t\t\t:multiple=\"true\"\n\t\t\t:close-on-select=\"false\"\n\t\t\t:disabled=\"disabled\"\n\t\t\t@input=\"update\"\n\t\t\t@search=\"onSearch\" />\n\t\t<div v-show=\"hasError\" class=\"select-group-error\">\n\t\t\t{{ errorMessage }}\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport NcSelect from '../../components/NcSelect/index.js'\nimport { t } from '../../l10n.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\n\nimport axios from '@nextcloud/axios'\nimport debounce from 'debounce'\nimport { generateOcsUrl } from '@nextcloud/router'\n\nexport default {\n\tname: 'NcSettingsSelectGroup',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * The text of the label element of the select group input\n\t\t */\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * Placeholder for the input element\n\t\t * For backwards compatibility it falls back to the `label` value\n\t\t */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * id attribute of the select group element\n\t\t */\n\t\tid: {\n\t\t\ttype: String,\n\t\t\tdefault: () => 'action-' + GenRandomId(),\n\t\t\tvalidator: id => id.trim() !== '',\n\t\t},\n\n\t\t/**\n\t\t * value of the select group input\n\t\t * A list of group IDs can be provided\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\n\t\t/**\n\t\t * disabled state of the settings select group input\n\t\t */\n\t\tdisabled: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\temits: [\n\t\t'input',\n\t\t'error',\n\t],\n\tdata() {\n\t\treturn {\n\t\t\t/** Temporary store to cache groups */\n\t\t\tgroups: {},\n\t\t\trandId: GenRandomId(),\n\t\t\terrorMessage: '',\n\t\t}\n\t},\n\tcomputed: {\n\t\t/**\n\t\t * If the error message should be shown\n\t\t */\n\t\thasError() {\n\t\t\treturn this.errorMessage !== ''\n\t\t},\n\n\t\t/**\n\t\t * Validate input value and only return valid strings (group IDs)\n\t\t *\n\t\t * @return {string[]}\n\t\t */\n\t\tfilteredValue() {\n\t\t\treturn this.value.filter((group) => group !== '' && typeof group === 'string')\n\t\t},\n\n\t\t/**\n\t\t * value property converted to an array of group objects used as input for the NcSelect\n\t\t */\n\t\tinputValue() {\n\t\t\treturn this.filteredValue.map(\n\t\t\t\t(id) => {\n\t\t\t\t\tif (typeof this.groups[id] === 'undefined') {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\tdisplayname: id,\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn this.groups[id]\n\t\t\t\t},\n\t\t\t)\n\t\t},\n\n\t\t/**\n\t\t * Convert groups object to array of groups required for NcSelect.options\n\t\t * Filter out currently selected values\n\t\t *\n\t\t * @return {object[]}\n\t\t */\n\t\tgroupsArray() {\n\t\t\treturn Object.values(this.groups).filter(g => !this.value.includes(g.id))\n\t\t},\n\t},\n\twatch: {\n\t\t/**\n\t\t * If the value is changed, check that all groups are loaded so we show the correct display name\n\t\t */\n\t\tvalue: {\n\t\t\thandler() {\n\t\t\t\tconst loadedGroupIds = Object.keys(this.groups)\n\t\t\t\tconst missing = this.filteredValue.filter(group => !loadedGroupIds.includes(group))\n\t\t\t\tmissing.forEach((groupId) => {\n\t\t\t\t\tthis.loadGroup(groupId)\n\t\t\t\t})\n\t\t\t},\n\t\t\t// Run the watch handler also when the component is initially mounted\n\t\t\timmediate: true,\n\t\t},\n\t},\n\t/**\n\t * Load groups matching the empty query to reduce API calls\n\t */\n\tasync mounted() {\n\t\t// version scoped to prevent issues with different library versions\n\t\tconst storageName = `${appName}:${appVersion}/initialGroups`\n\n\t\tlet savedGroups = window.sessionStorage.getItem(storageName)\n\t\tif (savedGroups) {\n\t\t\tsavedGroups = Object.fromEntries(JSON.parse(savedGroups).map(group => [group.id, group]))\n\t\t\tthis.groups = { ...this.groups, ...savedGroups }\n\t\t} else {\n\t\t\tawait this.loadGroup('')\n\t\t\twindow.sessionStorage.setItem(storageName, JSON.stringify(Object.values(this.groups)))\n\t\t}\n\t},\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Called when a new group is selected or previous group is deselected to emit the update event\n\t\t *\n\t\t * @param {object[]} updatedValue Array of selected groups\n\t\t */\n\t\tupdate(updatedValue) {\n\t\t\tconst value = updatedValue.map((element) => element.id)\n\t\t\t/** Emitted when the groups selection changes<br />**Payload:** `value` (`Array`) - *Ids of selected groups */\n\t\t\tthis.$emit('input', value)\n\t\t},\n\n\t\t/**\n\t\t * Use provisioning API to search for given group and save it in the groups object\n\t\t *\n\t\t * @param {string} query The query like parts of the id oder display name\n\t\t * @return {boolean}\n\t\t */\n\t\tasync loadGroup(query) {\n\t\t\ttry {\n\t\t\t\tquery = typeof query === 'string' ? encodeURI(query) : ''\n\t\t\t\tconst response = await axios.get(generateOcsUrl(`cloud/groups/details?search=${query}&limit=10`, 2))\n\n\t\t\t\t// No network error, so reset any error after 5 seconds\n\t\t\t\tif (this.errorMessage !== '') {\n\t\t\t\t\twindow.setTimeout(() => {\n\t\t\t\t\t\tthis.errorMessage = ''\n\t\t\t\t\t}, 5000)\n\t\t\t\t}\n\n\t\t\t\tif (Object.keys(response.data.ocs.data.groups).length > 0) {\n\t\t\t\t\tconst newGroups = Object.fromEntries(response.data.ocs.data.groups.map((element) => [element.id, element]))\n\t\t\t\t\tthis.groups = { ...this.groups, ...newGroups }\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t/** Emitted if groups could not be queried.<br />**Payload:** `error` (`object`) - The Axios error */\n\t\t\t\tthis.$emit('error', error)\n\t\t\t\tthis.errorMessage = t('Unable to search the group')\n\t\t\t}\n\t\t\treturn false\n\t\t},\n\n\t\t/**\n\t\t * Custom filter function for `NcSelect` to filter by ID *and* display name\n\t\t *\n\t\t * @param {object} option One of the groups\n\t\t * @param {string} label The label property of the group\n\t\t * @param {string} search The current search string\n\t\t */\n\t\tfilterGroups(option, label, search) {\n\t\t\treturn `${label || ''} ${option.id}`.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1\n\t\t},\n\n\t\t/**\n\t\t * Debounce the group search (reduce API calls)\n\t\t */\n\t\tonSearch: debounce(function(query) {\n\t\t\tthis.loadGroup(query)\n\t\t}, 200),\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.select-group-error {\n\tcolor: var(--color-error);\n\tfont-size: 13px;\n\tpadding-inline-start: var(--border-radius-large);\n}\n</style>\n"],"names":["_sfc_main","NcSelect","GenRandomId","id","group","g","loadedGroupIds","groupId","storageName","savedGroups","t","updatedValue","value","element","query","response","axios","generateOcsUrl","newGroups","error","option","label","search","debounce"],"mappings":";;;;;;;;AAiFA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAC;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,aAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA,MAAA,YAAAC,EAAA;AAAA,MACA,WAAA,CAAAC,MAAAA,EAAA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;AAAA,QACA;AAAA,MACA,SAAAC,GAAA;AAEA,aAAA,MAAA,SAAAA,CAAA,GACA,KAAA,eAAAT,EAAA,4BAAA;AAAA,MACA;AACA,aAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAAU,GAAAC,GAAAC,GAAA;AACA,aAAA,GAAAD,KAAA,EAAA,IAAAD,EAAA,EAAA,GAAA,kBAAA,EAAA,QAAAE,EAAA,kBAAA,CAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAAC,EAAA,SAAAT,GAAA;AACA,WAAA,UAAAA,CAAA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const F = require("./_l10n-Od-4xzJA.cjs"), t = require("./logger-G6OKp5ly.cjs"), e = require("@nextcloud/calendar-js"), Z = require("./GenRandomId-ULxaMkkr.cjs"), Y = require("./NcSelect-
|
|
2
|
+
const F = require("./_l10n-Od-4xzJA.cjs"), t = require("./logger-G6OKp5ly.cjs"), e = require("@nextcloud/calendar-js"), Z = require("./GenRandomId-ULxaMkkr.cjs"), Y = require("./NcSelect-U9LJcdIo.cjs"), M = require("./_plugin-vue2_normalizer-DCfUPqga.cjs");
|
|
3
3
|
F.register(F.t22);
|
|
4
4
|
/**
|
|
5
5
|
* @copyright Copyright (c) 2019 Georg Ehrke
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcTimezonePicker-Dv6pIP9O.cjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { t } from '../../l10n.js'\n\n/**\n *\n * @param {string[]} timezoneList List of Olsen timezones\n * @param {Array} additionalTimezones List of additional timezones\n * @return {Array}\n */\nexport function getSortedTimezoneList(timezoneList = [], additionalTimezones = []) {\n\tconst sortedByContinent = {}\n\tconst sortedList = []\n\n\tfor (const timezoneId of timezoneList) {\n\t\tconst components = timezoneId.split('/')\n\t\tlet [continent, name] = [components.shift(), components.join('/')]\n\t\tif (!name) {\n\t\t\tname = continent\n\t\t\t// TRANSLATORS This refers to global timezones in the timezone picker\n\t\t\tcontinent = t('Global')\n\t\t}\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel: getReadableTimezoneName(name),\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const additionalTimezone of additionalTimezones) {\n\t\tconst { continent, label, timezoneId } = additionalTimezone\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel,\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const continent in sortedByContinent) {\n\t\tif (!Object.prototype.hasOwnProperty.call(sortedByContinent, continent)) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsortedByContinent[continent].regions.sort((a, b) => {\n\t\t\tif (a.label < b.label) {\n\t\t\t\treturn -1\n\t\t\t}\n\n\t\t\treturn 1\n\t\t})\n\t\tsortedList.push(sortedByContinent[continent])\n\t}\n\n\t// Sort continents by name\n\tsortedList.sort((a, b) => {\n\t\tif (a.continent < b.continent) {\n\t\t\treturn -1\n\t\t}\n\n\t\treturn 1\n\t})\n\n\treturn sortedList\n}\n\n/**\n * Get human-readable name for timezoneId\n *\n * @param {string} timezoneId TimezoneId to turn human-readable\n * @return {string}\n */\nexport function getReadableTimezoneName(timezoneId) {\n\treturn timezoneId\n\t\t.split('_')\n\t\t.join(' ')\n\t\t.replace('St ', 'St. ')\n\t\t.split('/')\n\t\t.join(' - ')\n}\n","/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport tzData from '../../../resources/timezones/zones.json'\nimport logger from '../../utils/logger.js'\n\nimport { getTimezoneManager } from '@nextcloud/calendar-js'\n\nconst timezoneManager = getTimezoneManager()\nlet initialized = false\n\n/**\n * Gets the timezone-manager\n * initializes it if necessary\n *\n * @return {object}\n */\nexport default function() {\n\tif (!initialized) {\n\t\tinitialize()\n\t}\n\n\treturn timezoneManager\n}\n\n/**\n * Initializes the timezone-manager with all timezones shipped by the calendar app\n */\nfunction initialize() {\n\tlogger.debug(`Using version ${tzData.version} of the timezone database`)\n\n\tfor (const tzid in tzData.zones) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.zones, [tzid])) {\n\t\t\tconst ics = [\n\t\t\t\t'BEGIN:VTIMEZONE',\n\t\t\t\t'TZID:' + tzid,\n\t\t\t\t...tzData.zones[tzid].ics,\n\t\t\t\t'END:VTIMEZONE',\n\t\t\t].join('\\r\\n')\n\t\t\ttimezoneManager.registerTimezoneFromICS(tzid, ics)\n\t\t}\n\t}\n\n\tfor (const tzid in tzData.aliases) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.aliases, [tzid])) {\n\t\t\ttimezoneManager.registerAlias(tzid, tzData.aliases[tzid].aliasTo)\n\t\t}\n\t}\n\n\tinitialized = true\n}\n","<!--\n - @copyright Copyright (c) 2021 Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @author Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n### Example\n```vue\n<template>\n\t<span>\n\t\t<NcTimezonePicker v-model=\"tz\" />\n\t</span>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttz: 'Hawaiian Standard Time',\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcSelect :aria-label-combobox=\"t('Search for time zone')\"\n\t\t:clearable=\"false\"\n\t\t:filter-by=\"filterBy\"\n\t\t:multiple=\"false\"\n\t\t:options=\"options\"\n\t\t:placeholder=\"placeholder\"\n\t\t:selectable=\"isSelectable\"\n\t\t:uid=\"uid\"\n\t\t:value=\"selectedTimezone\"\n\t\tlabel=\"label\"\n\t\t@option:selected=\"change\" />\n</template>\n\n<script>\nimport {\n\tgetReadableTimezoneName,\n\tgetSortedTimezoneList,\n} from './timezone.js'\nimport getTimezoneManager from './timezoneDataProviderService.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\nimport NcSelect from '../NcSelect/index.js'\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tprops: {\n\t\t/**\n\t\t * An array of additional timezones to include with the standard database. Useful if there is a custom timezone, e.g. read from user data\n\t\t */\n\t\tadditionalTimezones: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t/**\n\t\t * The selected timezone. Use v-model for two-way binding. The default timezone is floating, which means a time independent of timezone. See https://icalendar.org/CalDAV-Access-RFC-4791/7-3-date-and-floating-time.html for details.\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: 'floating',\n\t\t},\n\t\t/**\n\t\t * ID of the inner vue-select element, can be used for labels like: `vs-${uid}__combobox`\n\t\t */\n\t\tuid: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: () => `tz-${GenRandomId(5)}`,\n\t\t},\n\t},\n\temits: ['input'],\n\tcomputed: {\n\t\tplaceholder() {\n\t\t\treturn t('Type to search time zone')\n\t\t},\n\t\tselectedTimezone() {\n\t\t\tfor (const additionalTimezone of this.additionalTimezones) {\n\t\t\t\tif (additionalTimezone.timezoneId === this.value) {\n\t\t\t\t\treturn additionalTimezone\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel: getReadableTimezoneName(this.value),\n\t\t\t\ttimezoneId: this.value,\n\t\t\t}\n\t\t},\n\t\toptions() {\n\t\t\tconst timezoneManager = getTimezoneManager()\n\t\t\tconst timezoneList = getSortedTimezoneList(timezoneManager.listAllTimezones(), this.additionalTimezones)\n\t\t\t/**\n\t\t\t * Since NcSelect does not support groups,\n\t\t\t * we create an object with the grouped timezones and continent labels.\n\t\t\t *\n\t\t\t * NOTE for now we are removing the grouping from the fields to fix an accessibility issue\n\t\t\t * in the future, other options can be introduced to better display the different areas\n\t\t\t */\n\t\t\tlet timezonesGrouped = []\n\t\t\tObject.values(timezoneList).forEach(group => {\n\t\t\t\t// Add an entry as group label\n\t\t\t\t// timezonesGrouped.push({\n\t\t\t\t// label: group.continent,\n\t\t\t\t// timezoneId: `tz-group__${group.continent}`,\n\t\t\t\t// regions: group.regions,\n\t\t\t\t// })\n\t\t\t\ttimezonesGrouped = timezonesGrouped.concat(group.regions)\n\t\t\t})\n\t\t\treturn timezonesGrouped\n\t\t},\n\t},\n\tmethods: {\n\t\tt,\n\n\t\tchange(newValue) {\n\t\t\tif (!newValue) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t\t */\n\t\t\tthis.$emit('input', newValue.timezoneId)\n\t\t},\n\n\t\t/**\n\t\t * Returns whether this is a continent label,\n\t\t * or an actual timezone. Continent labels are not selectable.\n\t\t *\n\t\t * @param {string} option The option\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelectable(option) {\n\t\t\treturn !option.timezoneId.startsWith('tz-group__')\n\t\t},\n\n\t\t/**\n\t\t * Function to filter the timezone list.\n\t\t * We search in the timezoneId, so both continent and region names can be matched.\n\t\t *\n\t\t * @param {object} option The timezone option\n\t\t * @param {string} label The label of the timezone\n\t\t * @param {string} search The search string\n\t\t * @return {boolean}\n\t\t */\n\t\tfilterBy(option, label, search) {\n\t\t\t// We split the search term in case one searches \"<continent> <region>\".\n\t\t\tconst terms = search.trim().split(' ')\n\n\t\t\t// For the continent labels, we have to check if one region matches every search term.\n\t\t\tif (option.timezoneId.startsWith('tz-group__')) {\n\t\t\t\treturn option.regions.some(region => {\n\t\t\t\t\treturn this.matchTimezoneId(region.timezoneId, terms)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// For a region, every search term must be found.\n\t\t\treturn this.matchTimezoneId(option.timezoneId, terms)\n\t\t},\n\n\t\tmatchTimezoneId(timezoneId, terms) {\n\t\t\treturn terms.every(term => timezoneId.toLowerCase().includes(term.toLowerCase()))\n\t\t},\n\t},\n}\n</script>\n"],"names":["getSortedTimezoneList","timezoneList","additionalTimezones","sortedByContinent","sortedList","timezoneId","components","continent","name","t","getReadableTimezoneName","additionalTimezone","label","a","b","timezoneManager","getTimezoneManager","initialized","initialize","logger","tzData","tzid","ics","_sfc_main","NcSelect","GenRandomId","timezonesGrouped","group","newValue","option","search","terms","region","term"],"mappings":";;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BO,SAASA,EAAsBC,IAAe,IAAIC,IAAsB,CAAA,GAAI;AAClF,QAAMC,IAAoB,CAAE,GACtBC,IAAa,CAAE;AAErB,aAAWC,KAAcJ,GAAc;AACtC,UAAMK,IAAaD,EAAW,MAAM,GAAG;AACvC,QAAI,CAACE,GAAWC,CAAI,IAAI,CAACF,EAAW,MAAK,GAAIA,EAAW,KAAK,GAAG,CAAC;AACjE,IAAKE,MACJA,IAAOD,GAEPA,IAAYE,EAAC,EAAC,QAAQ,IAGvBN,EAAkBI,CAAS,IAAIJ,EAAkBI,CAAS,KAAK;AAAA,MAC9D,WAAAA;AAAA,MACA,SAAS,CAAE;AAAA,IACX,GAEDJ,EAAkBI,CAAS,EAAE,QAAQ,KAAK;AAAA,MACzC,OAAOG,EAAwBF,CAAI;AAAA,MACnC,QAAQ,CAAE;AAAA,MACV,YAAAH;AAAA,IACH,CAAG;AAAA,EACD;AAED,aAAWM,KAAsBT,GAAqB;AACrD,UAAM,EAAE,WAAAK,GAAW,OAAAK,GAAO,YAAAP,EAAY,IAAGM;AAEzC,IAAAR,EAAkBI,CAAS,IAAIJ,EAAkBI,CAAS,KAAK;AAAA,MAC9D,WAAAA;AAAA,MACA,SAAS,CAAE;AAAA,IACX,GAEDJ,EAAkBI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kB,GAAA;AAEA,YAAAC,IAAAD,EAAA,KAAA,EAAA,MAAA,GAAA;AAGA,aAAAD,EAAA,WAAA,WAAA,YAAA,IACAA,EAAA,QAAA,KAAA,CAAAG,MACA,KAAA,gBAAAA,EAAA,YAAAD,CAAA,CACA,IAIA,KAAA,gBAAAF,EAAA,YAAAE,CAAA;AAAA,IACA;AAAA,IAEA,gBAAA1B,GAAA0B,GAAA;AACA,aAAAA,EAAA,MAAA,CAAAE,MAAA5B,EAAA,YAAA,EAAA,SAAA4B,EAAA,YAAA,CAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcTimezonePicker-KG0dvgUv.cjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { t } from '../../l10n.js'\n\n/**\n *\n * @param {string[]} timezoneList List of Olsen timezones\n * @param {Array} additionalTimezones List of additional timezones\n * @return {Array}\n */\nexport function getSortedTimezoneList(timezoneList = [], additionalTimezones = []) {\n\tconst sortedByContinent = {}\n\tconst sortedList = []\n\n\tfor (const timezoneId of timezoneList) {\n\t\tconst components = timezoneId.split('/')\n\t\tlet [continent, name] = [components.shift(), components.join('/')]\n\t\tif (!name) {\n\t\t\tname = continent\n\t\t\t// TRANSLATORS This refers to global timezones in the timezone picker\n\t\t\tcontinent = t('Global')\n\t\t}\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel: getReadableTimezoneName(name),\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const additionalTimezone of additionalTimezones) {\n\t\tconst { continent, label, timezoneId } = additionalTimezone\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel,\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const continent in sortedByContinent) {\n\t\tif (!Object.prototype.hasOwnProperty.call(sortedByContinent, continent)) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsortedByContinent[continent].regions.sort((a, b) => {\n\t\t\tif (a.label < b.label) {\n\t\t\t\treturn -1\n\t\t\t}\n\n\t\t\treturn 1\n\t\t})\n\t\tsortedList.push(sortedByContinent[continent])\n\t}\n\n\t// Sort continents by name\n\tsortedList.sort((a, b) => {\n\t\tif (a.continent < b.continent) {\n\t\t\treturn -1\n\t\t}\n\n\t\treturn 1\n\t})\n\n\treturn sortedList\n}\n\n/**\n * Get human-readable name for timezoneId\n *\n * @param {string} timezoneId TimezoneId to turn human-readable\n * @return {string}\n */\nexport function getReadableTimezoneName(timezoneId) {\n\treturn timezoneId\n\t\t.split('_')\n\t\t.join(' ')\n\t\t.replace('St ', 'St. ')\n\t\t.split('/')\n\t\t.join(' - ')\n}\n","/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport tzData from '../../../resources/timezones/zones.json'\nimport logger from '../../utils/logger.js'\n\nimport { getTimezoneManager } from '@nextcloud/calendar-js'\n\nconst timezoneManager = getTimezoneManager()\nlet initialized = false\n\n/**\n * Gets the timezone-manager\n * initializes it if necessary\n *\n * @return {object}\n */\nexport default function() {\n\tif (!initialized) {\n\t\tinitialize()\n\t}\n\n\treturn timezoneManager\n}\n\n/**\n * Initializes the timezone-manager with all timezones shipped by the calendar app\n */\nfunction initialize() {\n\tlogger.debug(`Using version ${tzData.version} of the timezone database`)\n\n\tfor (const tzid in tzData.zones) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.zones, [tzid])) {\n\t\t\tconst ics = [\n\t\t\t\t'BEGIN:VTIMEZONE',\n\t\t\t\t'TZID:' + tzid,\n\t\t\t\t...tzData.zones[tzid].ics,\n\t\t\t\t'END:VTIMEZONE',\n\t\t\t].join('\\r\\n')\n\t\t\ttimezoneManager.registerTimezoneFromICS(tzid, ics)\n\t\t}\n\t}\n\n\tfor (const tzid in tzData.aliases) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.aliases, [tzid])) {\n\t\t\ttimezoneManager.registerAlias(tzid, tzData.aliases[tzid].aliasTo)\n\t\t}\n\t}\n\n\tinitialized = true\n}\n","<!--\n - @copyright Copyright (c) 2021 Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @author Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n### Example\n```vue\n<template>\n\t<span>\n\t\t<NcTimezonePicker v-model=\"tz\" />\n\t</span>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttz: 'Hawaiian Standard Time',\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcSelect :aria-label-combobox=\"t('Search for time zone')\"\n\t\t:clearable=\"false\"\n\t\t:filter-by=\"filterBy\"\n\t\t:multiple=\"false\"\n\t\t:options=\"options\"\n\t\t:placeholder=\"placeholder\"\n\t\t:selectable=\"isSelectable\"\n\t\t:uid=\"uid\"\n\t\t:value=\"selectedTimezone\"\n\t\tlabel=\"label\"\n\t\t@option:selected=\"change\" />\n</template>\n\n<script>\nimport {\n\tgetReadableTimezoneName,\n\tgetSortedTimezoneList,\n} from './timezone.js'\nimport getTimezoneManager from './timezoneDataProviderService.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\nimport NcSelect from '../NcSelect/index.js'\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tprops: {\n\t\t/**\n\t\t * An array of additional timezones to include with the standard database. Useful if there is a custom timezone, e.g. read from user data\n\t\t */\n\t\tadditionalTimezones: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t/**\n\t\t * The selected timezone. Use v-model for two-way binding. The default timezone is floating, which means a time independent of timezone. See https://icalendar.org/CalDAV-Access-RFC-4791/7-3-date-and-floating-time.html for details.\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: 'floating',\n\t\t},\n\t\t/**\n\t\t * ID of the inner vue-select element, can be used for labels like: `vs-${uid}__combobox`\n\t\t */\n\t\tuid: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: () => `tz-${GenRandomId(5)}`,\n\t\t},\n\t},\n\temits: ['input'],\n\tcomputed: {\n\t\tplaceholder() {\n\t\t\treturn t('Type to search time zone')\n\t\t},\n\t\tselectedTimezone() {\n\t\t\tfor (const additionalTimezone of this.additionalTimezones) {\n\t\t\t\tif (additionalTimezone.timezoneId === this.value) {\n\t\t\t\t\treturn additionalTimezone\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel: getReadableTimezoneName(this.value),\n\t\t\t\ttimezoneId: this.value,\n\t\t\t}\n\t\t},\n\t\toptions() {\n\t\t\tconst timezoneManager = getTimezoneManager()\n\t\t\tconst timezoneList = getSortedTimezoneList(timezoneManager.listAllTimezones(), this.additionalTimezones)\n\t\t\t/**\n\t\t\t * Since NcSelect does not support groups,\n\t\t\t * we create an object with the grouped timezones and continent labels.\n\t\t\t *\n\t\t\t * NOTE for now we are removing the grouping from the fields to fix an accessibility issue\n\t\t\t * in the future, other options can be introduced to better display the different areas\n\t\t\t */\n\t\t\tlet timezonesGrouped = []\n\t\t\tObject.values(timezoneList).forEach(group => {\n\t\t\t\t// Add an entry as group label\n\t\t\t\t// timezonesGrouped.push({\n\t\t\t\t// label: group.continent,\n\t\t\t\t// timezoneId: `tz-group__${group.continent}`,\n\t\t\t\t// regions: group.regions,\n\t\t\t\t// })\n\t\t\t\ttimezonesGrouped = timezonesGrouped.concat(group.regions)\n\t\t\t})\n\t\t\treturn timezonesGrouped\n\t\t},\n\t},\n\tmethods: {\n\t\tt,\n\n\t\tchange(newValue) {\n\t\t\tif (!newValue) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t\t */\n\t\t\tthis.$emit('input', newValue.timezoneId)\n\t\t},\n\n\t\t/**\n\t\t * Returns whether this is a continent label,\n\t\t * or an actual timezone. Continent labels are not selectable.\n\t\t *\n\t\t * @param {string} option The option\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelectable(option) {\n\t\t\treturn !option.timezoneId.startsWith('tz-group__')\n\t\t},\n\n\t\t/**\n\t\t * Function to filter the timezone list.\n\t\t * We search in the timezoneId, so both continent and region names can be matched.\n\t\t *\n\t\t * @param {object} option The timezone option\n\t\t * @param {string} label The label of the timezone\n\t\t * @param {string} search The search string\n\t\t * @return {boolean}\n\t\t */\n\t\tfilterBy(option, label, search) {\n\t\t\t// We split the search term in case one searches \"<continent> <region>\".\n\t\t\tconst terms = search.trim().split(' ')\n\n\t\t\t// For the continent labels, we have to check if one region matches every search term.\n\t\t\tif (option.timezoneId.startsWith('tz-group__')) {\n\t\t\t\treturn option.regions.some(region => {\n\t\t\t\t\treturn this.matchTimezoneId(region.timezoneId, terms)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// For a region, every search term must be found.\n\t\t\treturn this.matchTimezoneId(option.timezoneId, terms)\n\t\t},\n\n\t\tmatchTimezoneId(timezoneId, terms) {\n\t\t\treturn terms.every(term => timezoneId.toLowerCase().includes(term.toLowerCase()))\n\t\t},\n\t},\n}\n</script>\n"],"names":["getSortedTimezoneList","timezoneList","additionalTimezones","sortedByContinent","sortedList","timezoneId","components","continent","name","t","getReadableTimezoneName","additionalTimezone","label","a","b","timezoneManager","getTimezoneManager","initialized","initialize","logger","tzData","tzid","ics","_sfc_main","NcSelect","GenRandomId","timezonesGrouped","group","newValue","option","search","terms","region","term"],"mappings":";;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BO,SAASA,EAAsBC,IAAe,IAAIC,IAAsB,CAAA,GAAI;AAClF,QAAMC,IAAoB,CAAE,GACtBC,IAAa,CAAE;A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aAAA;AAAA,QACA,OAAAD,EAAA,KAAA,KAAA;AAAA,QACA,YAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IACA,UAAA;AACA,YAAAK,IAAAC,EAAA,GACAf,IAAAD,EAAAe,EAAA,iBAAA,GAAA,KAAA,mBAAA;AAQA,UAAAW,IAAA,CAAA;AACA,oBAAA,OAAAzB,CAAA,EAAA,QAAA,CAAA0B,MAAA;AAOA,QAAAD,IAAAA,EAAA,OAAAC,EAAA,OAAA;AAAA,MACA,CAAA,GACAD;AAAA,IACA;AAAA,EACA;AAAA,EACA,SAAA;AAAA,IACA,GAAAjB,EAAA;AAAA,IAEA,OAAAmB,GAAA;AACA,MAAAA,KAOA,KAAA,MAAA,SAAAA,EAAA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAAC,GAAA;AACA,aAAA,CAAAA,EAAA,WAAA,WAAA,YAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,SAAAA,GAAAjB,GAAAkB,GAAA;AAEA,YAAAC,IAAAD,EAAA,KAAA,EAAA,MAAA,GAAA;AAGA,aAAAD,EAAA,WAAA,WAAA,YAAA,IACAA,EAAA,QAAA,KAAA,CAAAG,MACA,KAAA,gBAAAA,EAAA,YAAAD,CAAA,CACA,IAIA,KAAA,gBAAAF,EAAA,YAAAE,CAAA;AAAA,IACA;AAAA,IAEA,gBAAA1B,GAAA0B,GAAA;AACA,aAAAA,EAAA,MAAA,CAAAE,MAAA5B,EAAA,YAAA,EAAA,SAAA4B,EAAA,YAAA,CAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { r as i, z as Z, a as N, A as e } from "./_l10n-FmsZpnE4.mjs";
|
|
|
2
2
|
import { l as Y } from "./logger-3m1eQsSo.mjs";
|
|
3
3
|
import { getTimezoneManager as M } from "@nextcloud/calendar-js";
|
|
4
4
|
import { G as l } from "./GenRandomId-VodkdWbp.mjs";
|
|
5
|
-
import { N as B } from "./NcSelect-
|
|
5
|
+
import { N as B } from "./NcSelect-b2H-YQsK.mjs";
|
|
6
6
|
import { n as u } from "./_plugin-vue2_normalizer-u6G_3nkj.mjs";
|
|
7
7
|
i(Z);
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcTimezonePicker-DDce-mch.mjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { t } from '../../l10n.js'\n\n/**\n *\n * @param {string[]} timezoneList List of Olsen timezones\n * @param {Array} additionalTimezones List of additional timezones\n * @return {Array}\n */\nexport function getSortedTimezoneList(timezoneList = [], additionalTimezones = []) {\n\tconst sortedByContinent = {}\n\tconst sortedList = []\n\n\tfor (const timezoneId of timezoneList) {\n\t\tconst components = timezoneId.split('/')\n\t\tlet [continent, name] = [components.shift(), components.join('/')]\n\t\tif (!name) {\n\t\t\tname = continent\n\t\t\t// TRANSLATORS This refers to global timezones in the timezone picker\n\t\t\tcontinent = t('Global')\n\t\t}\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel: getReadableTimezoneName(name),\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const additionalTimezone of additionalTimezones) {\n\t\tconst { continent, label, timezoneId } = additionalTimezone\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel,\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const continent in sortedByContinent) {\n\t\tif (!Object.prototype.hasOwnProperty.call(sortedByContinent, continent)) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsortedByContinent[continent].regions.sort((a, b) => {\n\t\t\tif (a.label < b.label) {\n\t\t\t\treturn -1\n\t\t\t}\n\n\t\t\treturn 1\n\t\t})\n\t\tsortedList.push(sortedByContinent[continent])\n\t}\n\n\t// Sort continents by name\n\tsortedList.sort((a, b) => {\n\t\tif (a.continent < b.continent) {\n\t\t\treturn -1\n\t\t}\n\n\t\treturn 1\n\t})\n\n\treturn sortedList\n}\n\n/**\n * Get human-readable name for timezoneId\n *\n * @param {string} timezoneId TimezoneId to turn human-readable\n * @return {string}\n */\nexport function getReadableTimezoneName(timezoneId) {\n\treturn timezoneId\n\t\t.split('_')\n\t\t.join(' ')\n\t\t.replace('St ', 'St. ')\n\t\t.split('/')\n\t\t.join(' - ')\n}\n","/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport tzData from '../../../resources/timezones/zones.json'\nimport logger from '../../utils/logger.js'\n\nimport { getTimezoneManager } from '@nextcloud/calendar-js'\n\nconst timezoneManager = getTimezoneManager()\nlet initialized = false\n\n/**\n * Gets the timezone-manager\n * initializes it if necessary\n *\n * @return {object}\n */\nexport default function() {\n\tif (!initialized) {\n\t\tinitialize()\n\t}\n\n\treturn timezoneManager\n}\n\n/**\n * Initializes the timezone-manager with all timezones shipped by the calendar app\n */\nfunction initialize() {\n\tlogger.debug(`Using version ${tzData.version} of the timezone database`)\n\n\tfor (const tzid in tzData.zones) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.zones, [tzid])) {\n\t\t\tconst ics = [\n\t\t\t\t'BEGIN:VTIMEZONE',\n\t\t\t\t'TZID:' + tzid,\n\t\t\t\t...tzData.zones[tzid].ics,\n\t\t\t\t'END:VTIMEZONE',\n\t\t\t].join('\\r\\n')\n\t\t\ttimezoneManager.registerTimezoneFromICS(tzid, ics)\n\t\t}\n\t}\n\n\tfor (const tzid in tzData.aliases) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.aliases, [tzid])) {\n\t\t\ttimezoneManager.registerAlias(tzid, tzData.aliases[tzid].aliasTo)\n\t\t}\n\t}\n\n\tinitialized = true\n}\n","<!--\n - @copyright Copyright (c) 2021 Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @author Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n### Example\n```vue\n<template>\n\t<span>\n\t\t<NcTimezonePicker v-model=\"tz\" />\n\t</span>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttz: 'Hawaiian Standard Time',\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcSelect :aria-label-combobox=\"t('Search for time zone')\"\n\t\t:clearable=\"false\"\n\t\t:filter-by=\"filterBy\"\n\t\t:multiple=\"false\"\n\t\t:options=\"options\"\n\t\t:placeholder=\"placeholder\"\n\t\t:selectable=\"isSelectable\"\n\t\t:uid=\"uid\"\n\t\t:value=\"selectedTimezone\"\n\t\tlabel=\"label\"\n\t\t@option:selected=\"change\" />\n</template>\n\n<script>\nimport {\n\tgetReadableTimezoneName,\n\tgetSortedTimezoneList,\n} from './timezone.js'\nimport getTimezoneManager from './timezoneDataProviderService.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\nimport NcSelect from '../NcSelect/index.js'\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tprops: {\n\t\t/**\n\t\t * An array of additional timezones to include with the standard database. Useful if there is a custom timezone, e.g. read from user data\n\t\t */\n\t\tadditionalTimezones: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t/**\n\t\t * The selected timezone. Use v-model for two-way binding. The default timezone is floating, which means a time independent of timezone. See https://icalendar.org/CalDAV-Access-RFC-4791/7-3-date-and-floating-time.html for details.\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: 'floating',\n\t\t},\n\t\t/**\n\t\t * ID of the inner vue-select element, can be used for labels like: `vs-${uid}__combobox`\n\t\t */\n\t\tuid: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: () => `tz-${GenRandomId(5)}`,\n\t\t},\n\t},\n\temits: ['input'],\n\tcomputed: {\n\t\tplaceholder() {\n\t\t\treturn t('Type to search time zone')\n\t\t},\n\t\tselectedTimezone() {\n\t\t\tfor (const additionalTimezone of this.additionalTimezones) {\n\t\t\t\tif (additionalTimezone.timezoneId === this.value) {\n\t\t\t\t\treturn additionalTimezone\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel: getReadableTimezoneName(this.value),\n\t\t\t\ttimezoneId: this.value,\n\t\t\t}\n\t\t},\n\t\toptions() {\n\t\t\tconst timezoneManager = getTimezoneManager()\n\t\t\tconst timezoneList = getSortedTimezoneList(timezoneManager.listAllTimezones(), this.additionalTimezones)\n\t\t\t/**\n\t\t\t * Since NcSelect does not support groups,\n\t\t\t * we create an object with the grouped timezones and continent labels.\n\t\t\t *\n\t\t\t * NOTE for now we are removing the grouping from the fields to fix an accessibility issue\n\t\t\t * in the future, other options can be introduced to better display the different areas\n\t\t\t */\n\t\t\tlet timezonesGrouped = []\n\t\t\tObject.values(timezoneList).forEach(group => {\n\t\t\t\t// Add an entry as group label\n\t\t\t\t// timezonesGrouped.push({\n\t\t\t\t// label: group.continent,\n\t\t\t\t// timezoneId: `tz-group__${group.continent}`,\n\t\t\t\t// regions: group.regions,\n\t\t\t\t// })\n\t\t\t\ttimezonesGrouped = timezonesGrouped.concat(group.regions)\n\t\t\t})\n\t\t\treturn timezonesGrouped\n\t\t},\n\t},\n\tmethods: {\n\t\tt,\n\n\t\tchange(newValue) {\n\t\t\tif (!newValue) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t\t */\n\t\t\tthis.$emit('input', newValue.timezoneId)\n\t\t},\n\n\t\t/**\n\t\t * Returns whether this is a continent label,\n\t\t * or an actual timezone. Continent labels are not selectable.\n\t\t *\n\t\t * @param {string} option The option\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelectable(option) {\n\t\t\treturn !option.timezoneId.startsWith('tz-group__')\n\t\t},\n\n\t\t/**\n\t\t * Function to filter the timezone list.\n\t\t * We search in the timezoneId, so both continent and region names can be matched.\n\t\t *\n\t\t * @param {object} option The timezone option\n\t\t * @param {string} label The label of the timezone\n\t\t * @param {string} search The search string\n\t\t * @return {boolean}\n\t\t */\n\t\tfilterBy(option, label, search) {\n\t\t\t// We split the search term in case one searches \"<continent> <region>\".\n\t\t\tconst terms = search.trim().split(' ')\n\n\t\t\t// For the continent labels, we have to check if one region matches every search term.\n\t\t\tif (option.timezoneId.startsWith('tz-group__')) {\n\t\t\t\treturn option.regions.some(region => {\n\t\t\t\t\treturn this.matchTimezoneId(region.timezoneId, terms)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// For a region, every search term must be found.\n\t\t\treturn this.matchTimezoneId(option.timezoneId, terms)\n\t\t},\n\n\t\tmatchTimezoneId(timezoneId, terms) {\n\t\t\treturn terms.every(term => timezoneId.toLowerCase().includes(term.toLowerCase()))\n\t\t},\n\t},\n}\n</script>\n"],"names":["getSortedTimezoneList","timezoneList","additionalTimezones","sortedByContinent","sortedList","timezoneId","components","continent","name","t","getReadableTimezoneName","additionalTimezone","label","a","b","timezoneManager","getTimezoneManager","initialized","initialize","logger","tzData","tzid","ics","_sfc_main","NcSelect","GenRandomId","timezonesGrouped","group","newValue","option","search","terms","region","term"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BO,SAASA,EAAsBC,IAAe,IAAIC,IAAsB,CAAA,GAAI;AAClF,QAAMC,IAAoB,CAAE,GACtBC,IAAa,CAAE;AAErB,aAAWC,KAAcJ,GAAc;AACtC,UAAMK,IAAaD,EAAW,MAAM,GAAG;AACvC,QAAI,CAACE,GAAWC,CAAI,IAAI,CAACF,EAAW,MAAK,GAAIA,EAAW,KAAK,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AAQA,UAAAW,IAAA,CAAA;AACA,oBAAA,OAAAzB,CAAA,EAAA,QAAA,CAAA0B,MAAA;AAOA,QAAAD,IAAAA,EAAA,OAAAC,EAAA,OAAA;AAAA,MACA,CAAA,GACAD;AAAA,IACA;AAAA,EACA;AAAA,EACA,SAAA;AAAA,IACA,GAAAjB;AAAA,IAEA,OAAAmB,GAAA;AACA,MAAAA,KAOA,KAAA,MAAA,SAAAA,EAAA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAAC,GAAA;AACA,aAAA,CAAAA,EAAA,WAAA,WAAA,YAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,SAAAA,GAAAjB,GAAAkB,GAAA;AAEA,YAAAC,IAAAD,EAAA,KAAA,EAAA,MAAA,GAAA;AAGA,aAAAD,EAAA,WAAA,WAAA,YAAA,IACAA,EAAA,QAAA,KAAA,CAAAG,MACA,KAAA,gBAAAA,EAAA,YAAAD,CAAA,CACA,IAIA,KAAA,gBAAAF,EAAA,YAAAE,CAAA;AAAA,IACA;AAAA,IAEA,gBAAA1B,GAAA0B,GAAA;AACA,aAAAA,EAAA,MAAA,CAAAE,MAAA5B,EAAA,YAAA,EAAA,SAAA4B,EAAA,YAAA,CAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcTimezonePicker-jJeiI-Ff.mjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport { t } from '../../l10n.js'\n\n/**\n *\n * @param {string[]} timezoneList List of Olsen timezones\n * @param {Array} additionalTimezones List of additional timezones\n * @return {Array}\n */\nexport function getSortedTimezoneList(timezoneList = [], additionalTimezones = []) {\n\tconst sortedByContinent = {}\n\tconst sortedList = []\n\n\tfor (const timezoneId of timezoneList) {\n\t\tconst components = timezoneId.split('/')\n\t\tlet [continent, name] = [components.shift(), components.join('/')]\n\t\tif (!name) {\n\t\t\tname = continent\n\t\t\t// TRANSLATORS This refers to global timezones in the timezone picker\n\t\t\tcontinent = t('Global')\n\t\t}\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel: getReadableTimezoneName(name),\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const additionalTimezone of additionalTimezones) {\n\t\tconst { continent, label, timezoneId } = additionalTimezone\n\n\t\tsortedByContinent[continent] = sortedByContinent[continent] || {\n\t\t\tcontinent,\n\t\t\tregions: [],\n\t\t}\n\n\t\tsortedByContinent[continent].regions.push({\n\t\t\tlabel,\n\t\t\tcities: [],\n\t\t\ttimezoneId,\n\t\t})\n\t}\n\n\tfor (const continent in sortedByContinent) {\n\t\tif (!Object.prototype.hasOwnProperty.call(sortedByContinent, continent)) {\n\t\t\tcontinue\n\t\t}\n\n\t\tsortedByContinent[continent].regions.sort((a, b) => {\n\t\t\tif (a.label < b.label) {\n\t\t\t\treturn -1\n\t\t\t}\n\n\t\t\treturn 1\n\t\t})\n\t\tsortedList.push(sortedByContinent[continent])\n\t}\n\n\t// Sort continents by name\n\tsortedList.sort((a, b) => {\n\t\tif (a.continent < b.continent) {\n\t\t\treturn -1\n\t\t}\n\n\t\treturn 1\n\t})\n\n\treturn sortedList\n}\n\n/**\n * Get human-readable name for timezoneId\n *\n * @param {string} timezoneId TimezoneId to turn human-readable\n * @return {string}\n */\nexport function getReadableTimezoneName(timezoneId) {\n\treturn timezoneId\n\t\t.split('_')\n\t\t.join(' ')\n\t\t.replace('St ', 'St. ')\n\t\t.split('/')\n\t\t.join(' - ')\n}\n","/**\n * @copyright Copyright (c) 2019 Georg Ehrke\n *\n * @author Georg Ehrke <oc.list@georgehrke.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\nimport tzData from '../../../resources/timezones/zones.json'\nimport logger from '../../utils/logger.js'\n\nimport { getTimezoneManager } from '@nextcloud/calendar-js'\n\nconst timezoneManager = getTimezoneManager()\nlet initialized = false\n\n/**\n * Gets the timezone-manager\n * initializes it if necessary\n *\n * @return {object}\n */\nexport default function() {\n\tif (!initialized) {\n\t\tinitialize()\n\t}\n\n\treturn timezoneManager\n}\n\n/**\n * Initializes the timezone-manager with all timezones shipped by the calendar app\n */\nfunction initialize() {\n\tlogger.debug(`Using version ${tzData.version} of the timezone database`)\n\n\tfor (const tzid in tzData.zones) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.zones, [tzid])) {\n\t\t\tconst ics = [\n\t\t\t\t'BEGIN:VTIMEZONE',\n\t\t\t\t'TZID:' + tzid,\n\t\t\t\t...tzData.zones[tzid].ics,\n\t\t\t\t'END:VTIMEZONE',\n\t\t\t].join('\\r\\n')\n\t\t\ttimezoneManager.registerTimezoneFromICS(tzid, ics)\n\t\t}\n\t}\n\n\tfor (const tzid in tzData.aliases) {\n\t\tif (Object.prototype.hasOwnProperty.call(tzData.aliases, [tzid])) {\n\t\t\ttimezoneManager.registerAlias(tzid, tzData.aliases[tzid].aliasTo)\n\t\t}\n\t}\n\n\tinitialized = true\n}\n","<!--\n - @copyright Copyright (c) 2021 Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @author Christoph Wurst <christoph@winzerhof-wurst.at>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<docs>\n### Example\n```vue\n<template>\n\t<span>\n\t\t<NcTimezonePicker v-model=\"tz\" />\n\t</span>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttz: 'Hawaiian Standard Time',\n\t\t}\n\t},\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcSelect :aria-label-combobox=\"t('Search for time zone')\"\n\t\t:clearable=\"false\"\n\t\t:filter-by=\"filterBy\"\n\t\t:multiple=\"false\"\n\t\t:options=\"options\"\n\t\t:placeholder=\"placeholder\"\n\t\t:selectable=\"isSelectable\"\n\t\t:uid=\"uid\"\n\t\t:value=\"selectedTimezone\"\n\t\tlabel=\"label\"\n\t\t@option:selected=\"change\" />\n</template>\n\n<script>\nimport {\n\tgetReadableTimezoneName,\n\tgetSortedTimezoneList,\n} from './timezone.js'\nimport getTimezoneManager from './timezoneDataProviderService.js'\nimport GenRandomId from '../../utils/GenRandomId.js'\nimport NcSelect from '../NcSelect/index.js'\nimport { t } from '../../l10n.js'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tprops: {\n\t\t/**\n\t\t * An array of additional timezones to include with the standard database. Useful if there is a custom timezone, e.g. read from user data\n\t\t */\n\t\tadditionalTimezones: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t/**\n\t\t * The selected timezone. Use v-model for two-way binding. The default timezone is floating, which means a time independent of timezone. See https://icalendar.org/CalDAV-Access-RFC-4791/7-3-date-and-floating-time.html for details.\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: 'floating',\n\t\t},\n\t\t/**\n\t\t * ID of the inner vue-select element, can be used for labels like: `vs-${uid}__combobox`\n\t\t */\n\t\tuid: {\n\t\t\ttype: [String, Number],\n\t\t\tdefault: () => `tz-${GenRandomId(5)}`,\n\t\t},\n\t},\n\temits: ['input'],\n\tcomputed: {\n\t\tplaceholder() {\n\t\t\treturn t('Type to search time zone')\n\t\t},\n\t\tselectedTimezone() {\n\t\t\tfor (const additionalTimezone of this.additionalTimezones) {\n\t\t\t\tif (additionalTimezone.timezoneId === this.value) {\n\t\t\t\t\treturn additionalTimezone\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tlabel: getReadableTimezoneName(this.value),\n\t\t\t\ttimezoneId: this.value,\n\t\t\t}\n\t\t},\n\t\toptions() {\n\t\t\tconst timezoneManager = getTimezoneManager()\n\t\t\tconst timezoneList = getSortedTimezoneList(timezoneManager.listAllTimezones(), this.additionalTimezones)\n\t\t\t/**\n\t\t\t * Since NcSelect does not support groups,\n\t\t\t * we create an object with the grouped timezones and continent labels.\n\t\t\t *\n\t\t\t * NOTE for now we are removing the grouping from the fields to fix an accessibility issue\n\t\t\t * in the future, other options can be introduced to better display the different areas\n\t\t\t */\n\t\t\tlet timezonesGrouped = []\n\t\t\tObject.values(timezoneList).forEach(group => {\n\t\t\t\t// Add an entry as group label\n\t\t\t\t// timezonesGrouped.push({\n\t\t\t\t// label: group.continent,\n\t\t\t\t// timezoneId: `tz-group__${group.continent}`,\n\t\t\t\t// regions: group.regions,\n\t\t\t\t// })\n\t\t\t\ttimezonesGrouped = timezonesGrouped.concat(group.regions)\n\t\t\t})\n\t\t\treturn timezonesGrouped\n\t\t},\n\t},\n\tmethods: {\n\t\tt,\n\n\t\tchange(newValue) {\n\t\t\tif (!newValue) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t\t */\n\t\t\tthis.$emit('input', newValue.timezoneId)\n\t\t},\n\n\t\t/**\n\t\t * Returns whether this is a continent label,\n\t\t * or an actual timezone. Continent labels are not selectable.\n\t\t *\n\t\t * @param {string} option The option\n\t\t * @return {boolean}\n\t\t */\n\t\tisSelectable(option) {\n\t\t\treturn !option.timezoneId.startsWith('tz-group__')\n\t\t},\n\n\t\t/**\n\t\t * Function to filter the timezone list.\n\t\t * We search in the timezoneId, so both continent and region names can be matched.\n\t\t *\n\t\t * @param {object} option The timezone option\n\t\t * @param {string} label The label of the timezone\n\t\t * @param {string} search The search string\n\t\t * @return {boolean}\n\t\t */\n\t\tfilterBy(option, label, search) {\n\t\t\t// We split the search term in case one searches \"<continent> <region>\".\n\t\t\tconst terms = search.trim().split(' ')\n\n\t\t\t// For the continent labels, we have to check if one region matches every search term.\n\t\t\tif (option.timezoneId.startsWith('tz-group__')) {\n\t\t\t\treturn option.regions.some(region => {\n\t\t\t\t\treturn this.matchTimezoneId(region.timezoneId, terms)\n\t\t\t\t})\n\t\t\t}\n\n\t\t\t// For a region, every search term must be found.\n\t\t\treturn this.matchTimezoneId(option.timezoneId, terms)\n\t\t},\n\n\t\tmatchTimezoneId(timezoneId, terms) {\n\t\t\treturn terms.every(term => timezoneId.toLowerCase().includes(term.toLowerCase()))\n\t\t},\n\t},\n}\n</script>\n"],"names":["getSortedTimezoneList","timezoneList","additionalTimezones","sortedByContinent","sortedList","timezoneId","components","continent","name","t","getReadableTimezoneName","additionalTimezone","label","a","b","timezoneManager","getTimezoneManager","initialized","initialize","logger","tzData","tzid","ics","_sfc_main","NcSelect","GenRandomId","timezonesGrouped","group","newValue","option","search","terms","region","term"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA6BO,SAASA,EAAsBC,IAAe,IAAIC,IAAsB,CAAA,GAAI;AAClF,QAAMC,IAAoB,CAAE,GACtBC,IAAa,CAAE;AAErB,aAAWC,KAAcJ,GAAc;AACtC,UAAMK,IAAaD,EAAW,MAAM,GAAG;AACvC,QAAI,CAACE,GAAWC,CAAI,IAAI,CAACF,EAAW,MAAK,GAAIA,EAAW,KAAK,GAAG,CAAC;AACjE,IAAKE,MACJA,IAAOD,GAEPA,IAAYE,EAAE,QAAQ,IAGvBN,EAAkBI,CAAS,IAAIJ,EAAkBI,CAAS,KAAK;AAAA,MAC9D,WAAAA;AAAA,MACA,SAAS,CAAE;AAAA,IACX,GAEDJ,EAAkBI,CAAS,EAAE,QAAQ,KAAK;AAAA,MACzC,OAAOG,EAAwBF,CAAI;AAAA,MACnC,QAAQ,CAAE;AAAA,MACV,YAAAH;AAAA,IACH,CAAG;AAAA,EACD;AAED,aAAWM,KAAsBT,GAAqB;AACrD,UAAM,EAAE,WAAAK,GAAW,OAAAK,GAAO,YAAAP,EAAY,IAAGM;AAEzC,IAAAR,EAAkBI,CAAS,IAAIJ,EAAkBI,CAAS,KAAK;AAAA,MAC9D,WAAAA;AAAA,MACA,SAAS,CAAE;AAAA,IACX,GAEDJ,EAAkBI,CAAS,EAAE,QAAQ,KAAK;AAAA,MACzC,OAAAK;AAAA,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AA,IACAA,EAAA,QAAA,KAAA,CAAAG,MACA,KAAA,gBAAAA,EAAA,YAAAD,CAAA,CACA,IAIA,KAAA,gBAAAF,EAAA,YAAAE,CAAA;AAAA,IACA;AAAA,IAEA,gBAAA1B,GAAA0B,GAAA;AACA,aAAAA,EAAA,MAAA,CAAAE,MAAA5B,EAAA,YAAA,EAAA,SAAA4B,EAAA,YAAA,CAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
const e = (t) => {
|
|
23
23
|
t.mounted ? Array.isArray(t.mounted) || (t.mounted = [t.mounted]) : t.mounted = [], t.mounted.push(function() {
|
|
24
|
-
this.$el.setAttribute("data-v-
|
|
24
|
+
this.$el.setAttribute("data-v-98ecc7d", "");
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScopeComponent-
|
|
1
|
+
{"version":3,"file":"ScopeComponent-ZQvTL_tO.mjs","sources":["../../src/utils/ScopeComponent.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nconst ScopeComponent = (Component) => {\n\t// Init mounted vue if none\n\tif (!Component.mounted) {\n\t\tComponent.mounted = []\n\t} else if (!Array.isArray(Component.mounted)) {\n\t\tComponent.mounted = [Component.mounted]\n\t}\n\n\t// Inject root scoping function\n\tComponent.mounted.push(function() {\n\t\tthis.$el.setAttribute(`data-v-${SCOPE_VERSION}`, '')\n\t})\n}\n\nexport default ScopeComponent\n"],"names":["ScopeComponent","Component"],"mappings":"AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBK,MAACA,IAAiB,CAACC,MAAc;AAErC,EAAKA,EAAU,UAEH,MAAM,QAAQA,EAAU,OAAO,MAC1CA,EAAU,UAAU,CAACA,EAAU,OAAO,KAFtCA,EAAU,UAAU,CAAE,GAMvBA,EAAU,QAAQ,KAAK,WAAW;AACjC,SAAK,IAAI,aAAa,kBAA2B,EAAE;AAAA,EACrD,CAAE;AACF;"}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
const e = (t) => {
|
|
24
24
|
t.mounted ? Array.isArray(t.mounted) || (t.mounted = [t.mounted]) : t.mounted = [], t.mounted.push(function() {
|
|
25
|
-
this.$el.setAttribute("data-v-
|
|
25
|
+
this.$el.setAttribute("data-v-98ecc7d", "");
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
exports.ScopeComponent = e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScopeComponent-
|
|
1
|
+
{"version":3,"file":"ScopeComponent-v4OJPQb8.cjs","sources":["../../src/utils/ScopeComponent.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nconst ScopeComponent = (Component) => {\n\t// Init mounted vue if none\n\tif (!Component.mounted) {\n\t\tComponent.mounted = []\n\t} else if (!Array.isArray(Component.mounted)) {\n\t\tComponent.mounted = [Component.mounted]\n\t}\n\n\t// Inject root scoping function\n\tComponent.mounted.push(function() {\n\t\tthis.$el.setAttribute(`data-v-${SCOPE_VERSION}`, '')\n\t})\n}\n\nexport default ScopeComponent\n"],"names":["ScopeComponent","Component"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsBK,MAACA,IAAiB,CAACC,MAAc;AAErC,EAAKA,EAAU,UAEH,MAAM,QAAQA,EAAU,OAAO,MAC1CA,EAAU,UAAU,CAACA,EAAU,OAAO,KAFtCA,EAAU,UAAU,CAAE,GAMvBA,EAAU,QAAQ,KAAK,WAAW;AACjC,SAAK,IAAI,aAAa,kBAA2B,EAAE;AAAA,EACrD,CAAE;AACF;;"}
|