@nextcloud/vue 8.25.0 → 8.25.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.
Files changed (169) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/Components/NcActionInput.cjs +1 -1
  3. package/dist/Components/NcActionInput.mjs +1 -1
  4. package/dist/Components/NcActions.cjs +1 -1
  5. package/dist/Components/NcActions.mjs +1 -1
  6. package/dist/Components/NcAppNavigationCaption.cjs +1 -1
  7. package/dist/Components/NcAppNavigationCaption.mjs +1 -1
  8. package/dist/Components/NcAppNavigationItem.cjs +1 -1
  9. package/dist/Components/NcAppNavigationItem.mjs +1 -1
  10. package/dist/Components/NcAppSidebar.cjs +1 -1
  11. package/dist/Components/NcAppSidebar.mjs +1 -1
  12. package/dist/Components/NcAvatar.cjs +1 -1
  13. package/dist/Components/NcAvatar.mjs +1 -1
  14. package/dist/Components/NcBreadcrumb.cjs +1 -1
  15. package/dist/Components/NcBreadcrumb.mjs +1 -1
  16. package/dist/Components/NcBreadcrumbs.cjs +1 -1
  17. package/dist/Components/NcBreadcrumbs.mjs +1 -1
  18. package/dist/Components/NcChip.cjs +1 -1
  19. package/dist/Components/NcChip.mjs +1 -1
  20. package/dist/Components/NcCollectionList.cjs +1 -1
  21. package/dist/Components/NcCollectionList.mjs +1 -1
  22. package/dist/Components/NcColorPicker.cjs +1 -1
  23. package/dist/Components/NcColorPicker.mjs +1 -1
  24. package/dist/Components/NcDashboardWidget.cjs +1 -1
  25. package/dist/Components/NcDashboardWidget.mjs +1 -1
  26. package/dist/Components/NcDashboardWidgetItem.cjs +1 -1
  27. package/dist/Components/NcDashboardWidgetItem.mjs +1 -1
  28. package/dist/Components/NcDateTimePicker.cjs +4 -4
  29. package/dist/Components/NcDateTimePicker.mjs +4 -4
  30. package/dist/Components/NcDateTimePickerNative.cjs +1 -1
  31. package/dist/Components/NcDateTimePickerNative.mjs +1 -1
  32. package/dist/Components/NcEmojiPicker.cjs +1 -1
  33. package/dist/Components/NcEmojiPicker.mjs +1 -1
  34. package/dist/Components/NcListItem.cjs +1 -1
  35. package/dist/Components/NcListItem.mjs +1 -1
  36. package/dist/Components/NcListItemIcon.cjs +1 -1
  37. package/dist/Components/NcListItemIcon.mjs +1 -1
  38. package/dist/Components/NcModal.cjs +2 -2
  39. package/dist/Components/NcModal.mjs +2 -2
  40. package/dist/Components/NcPopover.cjs +1 -1
  41. package/dist/Components/NcPopover.mjs +1 -1
  42. package/dist/Components/NcRichContenteditable.cjs +1 -1
  43. package/dist/Components/NcRichContenteditable.mjs +1 -1
  44. package/dist/Components/NcRichText.cjs +2 -2
  45. package/dist/Components/NcRichText.mjs +3 -3
  46. package/dist/Components/NcSelect.cjs +1 -1
  47. package/dist/Components/NcSelect.mjs +1 -1
  48. package/dist/Components/NcSelectTags.cjs +1 -1
  49. package/dist/Components/NcSelectTags.mjs +1 -1
  50. package/dist/Components/NcSelectUsers.cjs +1 -1
  51. package/dist/Components/NcSelectUsers.mjs +1 -1
  52. package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
  53. package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
  54. package/dist/Components/NcTimezonePicker.cjs +1 -1
  55. package/dist/Components/NcTimezonePicker.mjs +1 -1
  56. package/dist/Components/NcUserBubble.cjs +1 -1
  57. package/dist/Components/NcUserBubble.mjs +1 -1
  58. package/dist/Functions/reference.cjs +1 -1
  59. package/dist/Functions/reference.mjs +1 -1
  60. package/dist/assets/{NcDateTimePicker-BY1UnUZM.css → NcDateTimePicker-HmPjr-d7.css} +7 -7
  61. package/dist/assets/{NcPopover-CWwUNpmE.css → NcPopover-Dx28oc68.css} +22 -9
  62. package/dist/assets/{NcRichContenteditable-CtPZudY6.css → NcRichContenteditable-BbOjh6i7.css} +29 -29
  63. package/dist/chunks/{NcActionInput-B-7FoLVy.cjs → NcActionInput-BqyC5dsN.cjs} +2 -2
  64. package/dist/chunks/{NcActionInput-B-7FoLVy.cjs.map → NcActionInput-BqyC5dsN.cjs.map} +1 -1
  65. package/dist/chunks/{NcActionInput-D-zf_ZR9.mjs → NcActionInput-QO_UKY2v.mjs} +2 -2
  66. package/dist/chunks/{NcActionInput-D-zf_ZR9.mjs.map → NcActionInput-QO_UKY2v.mjs.map} +1 -1
  67. package/dist/chunks/{NcActions-Bkh3UMs3.mjs → NcActions-CucWK-m-.mjs} +2 -2
  68. package/dist/chunks/{NcActions-Bkh3UMs3.mjs.map → NcActions-CucWK-m-.mjs.map} +1 -1
  69. package/dist/chunks/{NcActions-DFHXBqKC.cjs → NcActions-DEXtGQeq.cjs} +2 -2
  70. package/dist/chunks/{NcActions-DFHXBqKC.cjs.map → NcActions-DEXtGQeq.cjs.map} +1 -1
  71. package/dist/chunks/{NcAppNavigationCaption-Dz7wVRDM.mjs → NcAppNavigationCaption-C0Fkd9G7.mjs} +2 -2
  72. package/dist/chunks/{NcAppNavigationCaption-Dz7wVRDM.mjs.map → NcAppNavigationCaption-C0Fkd9G7.mjs.map} +1 -1
  73. package/dist/chunks/{NcAppNavigationCaption-Kjwx7t2O.cjs → NcAppNavigationCaption-CIrXtXSn.cjs} +2 -2
  74. package/dist/chunks/{NcAppNavigationCaption-Kjwx7t2O.cjs.map → NcAppNavigationCaption-CIrXtXSn.cjs.map} +1 -1
  75. package/dist/chunks/{NcAppNavigationItem-Dpm3T1dA.mjs → NcAppNavigationItem-CDut0DWY.mjs} +2 -2
  76. package/dist/chunks/{NcAppNavigationItem-Dpm3T1dA.mjs.map → NcAppNavigationItem-CDut0DWY.mjs.map} +1 -1
  77. package/dist/chunks/{NcAppNavigationItem-CHa42b-x.cjs → NcAppNavigationItem-CV-XN8Ym.cjs} +2 -2
  78. package/dist/chunks/{NcAppNavigationItem-CHa42b-x.cjs.map → NcAppNavigationItem-CV-XN8Ym.cjs.map} +1 -1
  79. package/dist/chunks/{NcAppSidebar-DOJNq1iG.mjs → NcAppSidebar-C5fqF8Ll.mjs} +2 -2
  80. package/dist/chunks/{NcAppSidebar-DOJNq1iG.mjs.map → NcAppSidebar-C5fqF8Ll.mjs.map} +1 -1
  81. package/dist/chunks/{NcAppSidebar-Bmlid_Pa.cjs → NcAppSidebar-MYr8K1cN.cjs} +2 -2
  82. package/dist/chunks/{NcAppSidebar-Bmlid_Pa.cjs.map → NcAppSidebar-MYr8K1cN.cjs.map} +1 -1
  83. package/dist/chunks/{NcAvatar-Bp1wPu2I.cjs → NcAvatar-C3s9tDzi.cjs} +2 -2
  84. package/dist/chunks/{NcAvatar-Bp1wPu2I.cjs.map → NcAvatar-C3s9tDzi.cjs.map} +1 -1
  85. package/dist/chunks/{NcAvatar-DOvpF1gr.mjs → NcAvatar-Db8tkJt9.mjs} +2 -2
  86. package/dist/chunks/{NcAvatar-DOvpF1gr.mjs.map → NcAvatar-Db8tkJt9.mjs.map} +1 -1
  87. package/dist/chunks/{NcBreadcrumb-9pV_jqex.cjs → NcBreadcrumb-C2vGhFLp.cjs} +2 -2
  88. package/dist/chunks/{NcBreadcrumb-9pV_jqex.cjs.map → NcBreadcrumb-C2vGhFLp.cjs.map} +1 -1
  89. package/dist/chunks/{NcBreadcrumb-1Gv4FRrG.mjs → NcBreadcrumb-CuKf9Utm.mjs} +2 -2
  90. package/dist/chunks/{NcBreadcrumb-1Gv4FRrG.mjs.map → NcBreadcrumb-CuKf9Utm.mjs.map} +1 -1
  91. package/dist/chunks/{NcBreadcrumbs-D4RrS0HT.cjs → NcBreadcrumbs-BYnhLIRo.cjs} +3 -3
  92. package/dist/chunks/{NcBreadcrumbs-D4RrS0HT.cjs.map → NcBreadcrumbs-BYnhLIRo.cjs.map} +1 -1
  93. package/dist/chunks/{NcBreadcrumbs-CwuR-hUE.mjs → NcBreadcrumbs-DR2_1tNR.mjs} +3 -3
  94. package/dist/chunks/{NcBreadcrumbs-CwuR-hUE.mjs.map → NcBreadcrumbs-DR2_1tNR.mjs.map} +1 -1
  95. package/dist/chunks/{NcCollectionList-C3QKgLIe.cjs → NcCollectionList-Co7MVk82.cjs} +4 -4
  96. package/dist/chunks/{NcCollectionList-C3QKgLIe.cjs.map → NcCollectionList-Co7MVk82.cjs.map} +1 -1
  97. package/dist/chunks/{NcCollectionList-D51FpJCr.mjs → NcCollectionList-N169E0Rf.mjs} +4 -4
  98. package/dist/chunks/{NcCollectionList-D51FpJCr.mjs.map → NcCollectionList-N169E0Rf.mjs.map} +1 -1
  99. package/dist/chunks/{NcColorPicker-9BNg5lJ0.cjs → NcColorPicker-BD9YqGfy.cjs} +2 -2
  100. package/dist/chunks/{NcColorPicker-9BNg5lJ0.cjs.map → NcColorPicker-BD9YqGfy.cjs.map} +1 -1
  101. package/dist/chunks/{NcColorPicker-sJKL33GV.mjs → NcColorPicker-BzSsZRm3.mjs} +2 -2
  102. package/dist/chunks/{NcColorPicker-sJKL33GV.mjs.map → NcColorPicker-BzSsZRm3.mjs.map} +1 -1
  103. package/dist/chunks/{NcDashboardWidget-B1och7uR.cjs → NcDashboardWidget-CInFASK-.cjs} +3 -3
  104. package/dist/chunks/{NcDashboardWidget-B1och7uR.cjs.map → NcDashboardWidget-CInFASK-.cjs.map} +1 -1
  105. package/dist/chunks/{NcDashboardWidget-CioEwUfN.mjs → NcDashboardWidget-DwWee7mc.mjs} +3 -3
  106. package/dist/chunks/{NcDashboardWidget-CioEwUfN.mjs.map → NcDashboardWidget-DwWee7mc.mjs.map} +1 -1
  107. package/dist/chunks/{NcDashboardWidgetItem-D4EefvnL.mjs → NcDashboardWidgetItem-Csgi1gF2.mjs} +3 -3
  108. package/dist/chunks/{NcDashboardWidgetItem-D4EefvnL.mjs.map → NcDashboardWidgetItem-Csgi1gF2.mjs.map} +1 -1
  109. package/dist/chunks/{NcDashboardWidgetItem-BZPoOCWQ.cjs → NcDashboardWidgetItem-IkaGY5B0.cjs} +3 -3
  110. package/dist/chunks/{NcDashboardWidgetItem-BZPoOCWQ.cjs.map → NcDashboardWidgetItem-IkaGY5B0.cjs.map} +1 -1
  111. package/dist/chunks/{NcEmojiPicker-DcTSImTm.cjs → NcEmojiPicker-BLBi5V-V.cjs} +3 -3
  112. package/dist/chunks/{NcEmojiPicker-DcTSImTm.cjs.map → NcEmojiPicker-BLBi5V-V.cjs.map} +1 -1
  113. package/dist/chunks/{NcEmojiPicker-B49sJeMw.mjs → NcEmojiPicker-DyBFXXm7.mjs} +3 -3
  114. package/dist/chunks/{NcEmojiPicker-B49sJeMw.mjs.map → NcEmojiPicker-DyBFXXm7.mjs.map} +1 -1
  115. package/dist/chunks/{NcListItem-D_mvsnph.cjs → NcListItem-B1cSkFFh.cjs} +2 -2
  116. package/dist/chunks/{NcListItem-D_mvsnph.cjs.map → NcListItem-B1cSkFFh.cjs.map} +1 -1
  117. package/dist/chunks/{NcListItem-BBTd7BLc.mjs → NcListItem-BGoyHTZy.mjs} +2 -2
  118. package/dist/chunks/{NcListItem-BBTd7BLc.mjs.map → NcListItem-BGoyHTZy.mjs.map} +1 -1
  119. package/dist/chunks/{NcListItemIcon-B16M-aHV.mjs → NcListItemIcon-BG5v_qys.mjs} +2 -2
  120. package/dist/chunks/{NcListItemIcon-B16M-aHV.mjs.map → NcListItemIcon-BG5v_qys.mjs.map} +1 -1
  121. package/dist/chunks/{NcListItemIcon-COUzDQI5.cjs → NcListItemIcon-CF64acsf.cjs} +2 -2
  122. package/dist/chunks/{NcListItemIcon-COUzDQI5.cjs.map → NcListItemIcon-CF64acsf.cjs.map} +1 -1
  123. package/dist/chunks/{NcPopover-BxLo6SFb.cjs → NcPopover-Djf9_BrD.cjs} +2 -2
  124. package/dist/chunks/{NcPopover-w98cBbbF.mjs.map → NcPopover-Djf9_BrD.cjs.map} +1 -1
  125. package/dist/chunks/{NcPopover-w98cBbbF.mjs → NcPopover-m0hDmALa.mjs} +2 -2
  126. package/dist/chunks/{NcPopover-BxLo6SFb.cjs.map → NcPopover-m0hDmALa.mjs.map} +1 -1
  127. package/dist/chunks/{NcRichContenteditable-ClHXIiXL.cjs → NcRichContenteditable-C6HRESuM.cjs} +16 -16
  128. package/dist/chunks/{NcRichContenteditable-ClHXIiXL.cjs.map → NcRichContenteditable-C6HRESuM.cjs.map} +1 -1
  129. package/dist/chunks/{NcRichContenteditable-zZQChT9M.mjs → NcRichContenteditable-CE1hvtcT.mjs} +16 -16
  130. package/dist/chunks/{NcRichContenteditable-zZQChT9M.mjs.map → NcRichContenteditable-CE1hvtcT.mjs.map} +1 -1
  131. package/dist/chunks/{NcRichText-C43cKGcR.mjs → NcRichText-D6qJ5S5v.mjs} +2 -2
  132. package/dist/chunks/{NcRichText-C43cKGcR.mjs.map → NcRichText-D6qJ5S5v.mjs.map} +1 -1
  133. package/dist/chunks/{NcRichText-CMbtZkLP.cjs → NcRichText-Oqj-vWQP.cjs} +2 -2
  134. package/dist/chunks/{NcRichText-CMbtZkLP.cjs.map → NcRichText-Oqj-vWQP.cjs.map} +1 -1
  135. package/dist/chunks/{NcSelect-C9cGa-5v.cjs → NcSelect-FLFfISt6.cjs} +2 -2
  136. package/dist/chunks/{NcSelect-C9cGa-5v.cjs.map → NcSelect-FLFfISt6.cjs.map} +1 -1
  137. package/dist/chunks/{NcSelect-XLdUgokz.mjs → NcSelect-TmGBPLzc.mjs} +2 -2
  138. package/dist/chunks/{NcSelect-XLdUgokz.mjs.map → NcSelect-TmGBPLzc.mjs.map} +1 -1
  139. package/dist/chunks/{NcSelectTags-B0rsXdxP.cjs → NcSelectTags-BIEfsajL.cjs} +2 -2
  140. package/dist/chunks/{NcSelectTags-B0rsXdxP.cjs.map → NcSelectTags-BIEfsajL.cjs.map} +1 -1
  141. package/dist/chunks/{NcSelectTags-DT2Y3Kms.mjs → NcSelectTags-li-HYR2n.mjs} +2 -2
  142. package/dist/chunks/{NcSelectTags-DT2Y3Kms.mjs.map → NcSelectTags-li-HYR2n.mjs.map} +1 -1
  143. package/dist/chunks/{NcSelectUsers-DFlj_h9t.mjs → NcSelectUsers-BQO_sQJ8.mjs} +3 -3
  144. package/dist/chunks/{NcSelectUsers-DFlj_h9t.mjs.map → NcSelectUsers-BQO_sQJ8.mjs.map} +1 -1
  145. package/dist/chunks/{NcSelectUsers-C-bbm2cW.cjs → NcSelectUsers-yQZZACfZ.cjs} +3 -3
  146. package/dist/chunks/{NcSelectUsers-C-bbm2cW.cjs.map → NcSelectUsers-yQZZACfZ.cjs.map} +1 -1
  147. package/dist/chunks/{NcSettingsSelectGroup-CE71MIQo.cjs → NcSettingsSelectGroup-BZCbUSci.cjs} +2 -2
  148. package/dist/chunks/{NcSettingsSelectGroup-CE71MIQo.cjs.map → NcSettingsSelectGroup-BZCbUSci.cjs.map} +1 -1
  149. package/dist/chunks/{NcSettingsSelectGroup-B4isXyUU.mjs → NcSettingsSelectGroup-dzvfki-M.mjs} +2 -2
  150. package/dist/chunks/{NcSettingsSelectGroup-B4isXyUU.mjs.map → NcSettingsSelectGroup-dzvfki-M.mjs.map} +1 -1
  151. package/dist/chunks/{NcTimezonePicker-sAG8kn1b.mjs → NcTimezonePicker-C17Rji1h.mjs} +2 -2
  152. package/dist/chunks/{NcTimezonePicker-sAG8kn1b.mjs.map → NcTimezonePicker-C17Rji1h.mjs.map} +1 -1
  153. package/dist/chunks/{NcTimezonePicker-BTyhPxMT.cjs → NcTimezonePicker-DZ4evH1Q.cjs} +2 -2
  154. package/dist/chunks/{NcTimezonePicker-BTyhPxMT.cjs.map → NcTimezonePicker-DZ4evH1Q.cjs.map} +1 -1
  155. package/dist/chunks/{NcUserBubble-cX4wyq1_.cjs → NcUserBubble-Cu4Jzq9u.cjs} +3 -3
  156. package/dist/chunks/{NcUserBubble-cX4wyq1_.cjs.map → NcUserBubble-Cu4Jzq9u.cjs.map} +1 -1
  157. package/dist/chunks/{NcUserBubble-DmZZOMRr.mjs → NcUserBubble-cO5krePG.mjs} +3 -3
  158. package/dist/chunks/{NcUserBubble-DmZZOMRr.mjs.map → NcUserBubble-cO5krePG.mjs.map} +1 -1
  159. package/dist/chunks/{ScopeComponent-BaHwjQGQ.mjs → ScopeComponent-B97avXP9.mjs} +2 -2
  160. package/dist/chunks/{ScopeComponent-BaHwjQGQ.mjs.map → ScopeComponent-B97avXP9.mjs.map} +1 -1
  161. package/dist/chunks/{ScopeComponent-CqVh6vwk.cjs → ScopeComponent-CrVWjyKO.cjs} +2 -2
  162. package/dist/chunks/{ScopeComponent-CqVh6vwk.cjs.map → ScopeComponent-CrVWjyKO.cjs.map} +1 -1
  163. package/dist/chunks/{referencePickerModal-Bxp4FMcs.mjs → referencePickerModal-CMKHbYwz.mjs} +2 -2
  164. package/dist/chunks/{referencePickerModal-Bxp4FMcs.mjs.map → referencePickerModal-CMKHbYwz.mjs.map} +1 -1
  165. package/dist/chunks/{referencePickerModal-BdK-_zC6.cjs → referencePickerModal-TV83KedC.cjs} +2 -2
  166. package/dist/chunks/{referencePickerModal-BdK-_zC6.cjs.map → referencePickerModal-TV83KedC.cjs.map} +1 -1
  167. package/dist/index.cjs +25 -25
  168. package/dist/index.mjs +26 -26
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"NcSelectTags-DT2Y3Kms.mjs","sources":["../../src/components/NcSelectTags/api.js","../../src/components/NcSelectTags/NcSelectTags.vue"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport axios from '@nextcloud/axios'\nimport { generateRemoteUrl } from '@nextcloud/router'\n\nconst xmlToJson = (xml) => {\n\tlet obj = {}\n\n\tif (xml.nodeType === 1) {\n\t\tif (xml.attributes.length > 0) {\n\t\t\tobj['@attributes'] = {}\n\t\t\tfor (let j = 0; j < xml.attributes.length; j++) {\n\t\t\t\tconst attribute = xml.attributes.item(j)\n\t\t\t\tobj['@attributes'][attribute.nodeName] = attribute.nodeValue\n\t\t\t}\n\t\t}\n\t} else if (xml.nodeType === 3) {\n\t\tobj = xml.nodeValue\n\t}\n\n\tif (xml.hasChildNodes()) {\n\t\tfor (let i = 0; i < xml.childNodes.length; i++) {\n\t\t\tconst item = xml.childNodes.item(i)\n\t\t\tconst nodeName = item.nodeName\n\t\t\tif (typeof (obj[nodeName]) === 'undefined') {\n\t\t\t\tobj[nodeName] = xmlToJson(item)\n\t\t\t} else {\n\t\t\t\tif (typeof obj[nodeName].push === 'undefined') {\n\t\t\t\t\tconst old = obj[nodeName]\n\t\t\t\t\tobj[nodeName] = []\n\t\t\t\t\tobj[nodeName].push(old)\n\t\t\t\t}\n\t\t\t\tobj[nodeName].push(xmlToJson(item))\n\t\t\t}\n\t\t}\n\t}\n\treturn obj\n}\n\nconst parseXml = (xml) => {\n\tlet dom = null\n\ttry {\n\t\tdom = (new DOMParser()).parseFromString(xml, 'text/xml')\n\t} catch (e) {\n\t\tconsole.error('Failed to parse xml document', e)\n\t}\n\treturn dom\n}\n\nconst xmlToTagList = (xml) => {\n\tconst json = xmlToJson(parseXml(xml))\n\tconst list = json['d:multistatus']['d:response']\n\tconst result = []\n\tfor (const index in list) {\n\t\tconst tag = list[index]['d:propstat']\n\n\t\tif (tag['d:status']['#text'] !== 'HTTP/1.1 200 OK') {\n\t\t\tcontinue\n\t\t}\n\t\tresult.push({\n\t\t\tid: parseInt(tag['d:prop']['oc:id']['#text']),\n\t\t\tdisplayName: tag['d:prop']['oc:display-name']['#text'],\n\t\t\tcanAssign: tag['d:prop']['oc:can-assign']['#text'] === 'true',\n\t\t\tuserAssignable: tag['d:prop']['oc:user-assignable']['#text'] === 'true',\n\t\t\tuserVisible: tag['d:prop']['oc:user-visible']['#text'] === 'true',\n\t\t})\n\t}\n\treturn result\n}\n\nconst searchTags = async function() {\n\tif (window.NextcloudVueDocs) {\n\t\treturn Promise.resolve(xmlToTagList(window.NextcloudVueDocs.tags))\n\t}\n\n\tconst result = await axios({\n\t\tmethod: 'PROPFIND',\n\t\turl: generateRemoteUrl('dav') + '/systemtags/',\n\t\tdata: `<?xml version=\"1.0\"?>\n\t\t\t\t\t<d:propfind xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\">\n\t\t\t\t\t <d:prop>\n\t\t\t\t\t\t<oc:id />\n\t\t\t\t\t\t<oc:display-name />\n\t\t\t\t\t\t<oc:user-visible />\n\t\t\t\t\t\t<oc:user-assignable />\n\t\t\t\t\t\t<oc:can-assign />\n\t\t\t\t\t </d:prop>\n\t\t\t\t\t</d:propfind>`,\n\t})\n\treturn xmlToTagList(result.data)\n}\n\nexport {\n\tsearchTags,\n}\n","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Single tag selector\n\n```vue\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcSelectTags v-model=\"value\" input-label=\"Tag\" :multiple=\"false\" />\n\t\t{{ value }}\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tvalue: 1,\n\t\t}\n\t}\n}\n</script>\n```\n\n### Multiple tag selector\n```vue\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcSelectTags v-model=\"value\" input-label=\"Tags\" :multiple=\"true\" />\n\t\t{{ value }}\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tvalue: [\n\t\t\t\t1,\n\t\t\t\t2,\n\t\t\t],\n\t\t}\n\t}\n}\n</script>\n```\n\n### Custom filter\nBecause of compatibility reasons only 5 tag entries are shown by default. If you want to show all available tags set the `limit` prop to `null`:\n```vue\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcSelectTags v-model=\"value\" input-label=\"Tags\" :limit=\"null\" />\n\t\t{{ value }}\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tvalue: [\n\t\t\t\t1,\n\t\t\t\t2,\n\t\t\t],\n\t\t}\n\t}\n}\n</script>\n```\n\nIt's also possible to apply any custom filter logic by setting the `optionsFilter` function-prop to any custom function receiving the tag element and the index:\n```vue\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcSelectTags v-model=\"value\" input-label=\"Tags\" :options-filter=\"customFilter\" />\n\t\t{{ value }}\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tvalue: [\n\t\t\t\t3,\n\t\t\t],\n\t\t}\n\t},\n\tmethods: {\n\t\t/**\n\t\t* Implement your custom filter logic to filter tags delivered\n\t\t* by the server\n\t\t*\n\t\t* @param {object} the tag object\n\t\t* @param {int} the index of the object inside the collection\n\t\t*/\n\t\tcustomFilter(element, index) {\n\t\t\t/*\n\t\t\t* Tag objects returned by the server will have the\n\t\t\t* following properties (see also api.js):\n\t\t\t* id, displayName, canAssign, userAssignable, userVisible\n\t\t\t*/\n\t\t\treturn element.id >= 2 && element.displayName !== '' && element.canAssign && element.userAssignable && element.userVisible\n\t\t}\n\t}\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcSelect v-bind=\"propsToForward\"\n\t\t:options=\"availableOptions\"\n\t\t:close-on-select=\"!multiple\"\n\t\t:value=\"passthru ? model : localValue\"\n\t\t@search=\"searchString => search = searchString\"\n\t\tv-on=\"{\n\t\t\t...$listeners,\n\t\t\tinput: passthru ? $listeners.input : noop,\n\t\t\t'update:modelValue': passthru ? $listeners['update:modelValue'] : handleInput,\n\t\t\t'update:model-value': passthru ? $listeners['update:model-value'] : noop,\n\t\t}\">\n\t\t<template #option=\"option\">\n\t\t\t<NcEllipsisedOption :name=\"getOptionLabel(option)\"\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t\t<template #selected-option=\"selectedOption\">\n\t\t\t<NcEllipsisedOption :name=\"getOptionLabel(selectedOption)\"\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t\t<template v-for=\"(_, name) in $scopedSlots\" #[name]=\"data\">\n\t\t\t<!-- @slot Any combination of slots from https://vue-select.org/api/slots.html -->\n\t\t\t<slot :name=\"name\" v-bind=\"data\" />\n\t\t</template>\n\t</NcSelect>\n</template>\n\n<script>\nimport NcEllipsisedOption from '../NcEllipsisedOption/index.js'\nimport NcSelect from '../NcSelect/index.js'\n\nimport { searchTags } from './api.js'\nimport { t } from '../../l10n.js'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\n\nexport default {\n\tname: 'NcSelectTags',\n\n\tcomponents: {\n\t\tNcEllipsisedOption,\n\t\tNcSelect,\n\t},\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t// Add NcSelect prop defaults and populate $props\n\t\t...NcSelect.props,\n\n\t\t/**\n\t\t * Enable automatic fetching of tags\n\t\t *\n\t\t * If `false`, available tags must be passed using the `options` prop\n\t\t */\n\t\tfetchTags: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Callback to generate the label text\n\t\t *\n\t\t * @see https://vue-select.org/api/props.html#getoptionlabel\n\t\t */\n\t\tgetOptionLabel: {\n\t\t\ttype: Function,\n\t\t\tdefault: (option) => {\n\t\t\t\tconst { displayName, userVisible, userAssignable } = option\n\t\t\t\tif (userVisible === false) {\n\t\t\t\t\treturn t('{tag} (invisible)', { tag: displayName })\n\t\t\t\t}\n\t\t\t\tif (userAssignable === false) {\n\t\t\t\t\treturn t('{tag} (restricted)', { tag: displayName })\n\t\t\t\t}\n\t\t\t\treturn displayName\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Sets the maximum number of tags to display in the dropdown list\n\t\t *\n\t\t * Because of compatibility reasons only 5 tag entries are shown by\n\t\t * default\n\t\t */\n\t\tlimit: {\n\t\t\ttype: Number,\n\t\t\tdefault: 5,\n\t\t},\n\n\t\t/**\n\t\t * Allow selection of multiple options\n\t\t *\n\t\t * This prop automatically sets the internal `closeOnSelect` prop to\n\t\t * its boolean opposite\n\t\t *\n\t\t * @see https://vue-select.org/api/props.html#multiple\n\t\t */\n\t\tmultiple: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Callback to filter available options\n\t\t */\n\t\toptionsFilter: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Enable passing of `value` prop and emitted `input` events as-is\n\t\t * i.e. for usage with `v-model`\n\t\t *\n\t\t * If `true`, custom internal `value` and `input` handling is disabled\n\t\t */\n\t\tpassthru: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Placeholder text\n\t\t *\n\t\t * @see https://vue-select.org/api/props.html#placeholder\n\t\t */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Select a tag'),\n\t\t},\n\n\t\t/**\n\t\t * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: [Number, Array, Object],\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * Currently selected value\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: [Number, Array, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Any available prop\n\t\t *\n\t\t * @see https://vue-select.org/api/props.html\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t */\n\t\t'input',\n\t\t/**\n\t\t * Emitted on input events of the multiselect field\n\t\t *\n\t\t * @type {number|number[]}\n\t\t */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t\t/**\n\t\t * All events from https://vue-select.org/api/events.html\n\t\t */\n\t\t// Not an actual event but needed to show in vue-styleguidist docs\n\t\t' ',\n\t],\n\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\tconst noop = () => {}\n\t\treturn {\n\t\t\tmodel,\n\t\t\tnoop,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tsearch: '',\n\t\t\tavailableTags: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tavailableOptions() {\n\t\t\tif (this.optionsFilter) {\n\t\t\t\treturn this.tags.filter(this.optionsFilter)\n\t\t\t}\n\t\t\treturn this.tags\n\t\t},\n\n\t\tlocalValue() {\n\t\t\tif (this.tags.length === 0) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (this.multiple) {\n\t\t\t\treturn this.model\n\t\t\t\t\t.filter(tag => tag !== '')\n\t\t\t\t\t.map(id => this.tags.find(tag2 => tag2.id === id))\n\t\t\t} else {\n\t\t\t\treturn this.tags.find(tag => tag.id === this.model)\n\t\t\t}\n\t\t},\n\n\t\tpropsToForward() {\n\t\t\tconst {\n\t\t\t\t// Props handled by this component\n\t\t\t\tfetchTags,\n\t\t\t\toptionsFilter,\n\t\t\t\tpassthru,\n\t\t\t\t// Props to forward\n\t\t\t\t...propsToForward\n\t\t\t} = this.$props\n\n\t\t\treturn propsToForward\n\t\t},\n\n\t\ttags() {\n\t\t\tif (!this.fetchTags) {\n\t\t\t\treturn this.options\n\t\t\t}\n\t\t\treturn this.availableTags\n\t\t},\n\t},\n\n\tasync created() {\n\t\tif (!this.fetchTags) {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tconst result = await searchTags()\n\t\t\tthis.availableTags = result\n\t\t} catch (error) {\n\t\t\tconsole.error('Loading systemtags failed', error)\n\t\t}\n\t},\n\n\tmethods: {\n\t\thandleInput(value) {\n\t\t\tif (this.multiple) {\n\t\t\t\t/**\n\t\t\t\t * Emitted on input events of the multiselect field\n\t\t\t\t *\n\t\t\t\t * @type {number|number[]}\n\t\t\t\t */\n\t\t\t\tthis.model = value.map(element => element.id)\n\t\t\t} else {\n\t\t\t\tif (value === null) {\n\t\t\t\t\tthis.model = null\n\t\t\t\t} else {\n\t\t\t\t\tthis.model = value.id\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n"],"names":[],"mappings":";;;;;;;AAQA,MAAM,YAAY,CAAC,Q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AAA;AAAA,QACA,OAAA;AACA,eAAA,QAAA,MAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcSelectTags-li-HYR2n.mjs","sources":["../../src/components/NcSelectTags/api.js","../../src/components/NcSelectTags/NcSelectTags.vue"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport axios from '@nextcloud/axios'\nimport { generateRemoteUrl } from '@nextcloud/router'\n\nconst xmlToJson = (xml) => {\n\tlet obj = {}\n\n\tif (xml.nodeType === 1) {\n\t\tif (xml.attributes.length > 0) {\n\t\t\tobj['@attributes'] = {}\n\t\t\tfor (let j = 0; j < xml.attributes.length; j++) {\n\t\t\t\tconst attribute = xml.attributes.item(j)\n\t\t\t\tobj['@attributes'][attribute.nodeName] = attribute.nodeValue\n\t\t\t}\n\t\t}\n\t} else if (xml.nodeType === 3) {\n\t\tobj = xml.nodeValue\n\t}\n\n\tif (xml.hasChildNodes()) {\n\t\tfor (let i = 0; i < xml.childNodes.length; i++) {\n\t\t\tconst item = xml.childNodes.item(i)\n\t\t\tconst nodeName = item.nodeName\n\t\t\tif (typeof (obj[nodeName]) === 'undefined') {\n\t\t\t\tobj[nodeName] = xmlToJson(item)\n\t\t\t} else {\n\t\t\t\tif (typeof obj[nodeName].push === 'undefined') {\n\t\t\t\t\tconst old = obj[nodeName]\n\t\t\t\t\tobj[nodeName] = []\n\t\t\t\t\tobj[nodeName].push(old)\n\t\t\t\t}\n\t\t\t\tobj[nodeName].push(xmlToJson(item))\n\t\t\t}\n\t\t}\n\t}\n\treturn obj\n}\n\nconst parseXml = (xml) => {\n\tlet dom = null\n\ttry {\n\t\tdom = (new DOMParser()).parseFromString(xml, 'text/xml')\n\t} catch (e) {\n\t\tconsole.error('Failed to parse xml document', e)\n\t}\n\treturn dom\n}\n\nconst xmlToTagList = (xml) => {\n\tconst json = xmlToJson(parseXml(xml))\n\tconst list = json['d:multistatus']['d:response']\n\tconst result = []\n\tfor (const index in list) {\n\t\tconst tag = list[index]['d:propstat']\n\n\t\tif (tag['d:status']['#text'] !== 'HTTP/1.1 200 OK') {\n\t\t\tcontinue\n\t\t}\n\t\tresult.push({\n\t\t\tid: parseInt(tag['d:prop']['oc:id']['#text']),\n\t\t\tdisplayName: tag['d:prop']['oc:display-name']['#text'],\n\t\t\tcanAssign: tag['d:prop']['oc:can-assign']['#text'] === 'true',\n\t\t\tuserAssignable: tag['d:prop']['oc:user-assignable']['#text'] === 'true',\n\t\t\tuserVisible: tag['d:prop']['oc:user-visible']['#text'] === 'true',\n\t\t})\n\t}\n\treturn result\n}\n\nconst searchTags = async function() {\n\tif (window.NextcloudVueDocs) {\n\t\treturn Promise.resolve(xmlToTagList(window.NextcloudVueDocs.tags))\n\t}\n\n\tconst result = await axios({\n\t\tmethod: 'PROPFIND',\n\t\turl: generateRemoteUrl('dav') + '/systemtags/',\n\t\tdata: `<?xml version=\"1.0\"?>\n\t\t\t\t\t<d:propfind xmlns:d=\"DAV:\" xmlns:oc=\"http://owncloud.org/ns\">\n\t\t\t\t\t <d:prop>\n\t\t\t\t\t\t<oc:id />\n\t\t\t\t\t\t<oc:display-name />\n\t\t\t\t\t\t<oc:user-visible />\n\t\t\t\t\t\t<oc:user-assignable />\n\t\t\t\t\t\t<oc:can-assign />\n\t\t\t\t\t </d:prop>\n\t\t\t\t\t</d:propfind>`,\n\t})\n\treturn xmlToTagList(result.data)\n}\n\nexport {\n\tsearchTags,\n}\n","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Single tag selector\n\n```vue\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcSelectTags v-model=\"value\" input-label=\"Tag\" :multiple=\"false\" />\n\t\t{{ value }}\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tvalue: 1,\n\t\t}\n\t}\n}\n</script>\n```\n\n### Multiple tag selector\n```vue\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcSelectTags v-model=\"value\" input-label=\"Tags\" :multiple=\"true\" />\n\t\t{{ value }}\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tvalue: [\n\t\t\t\t1,\n\t\t\t\t2,\n\t\t\t],\n\t\t}\n\t}\n}\n</script>\n```\n\n### Custom filter\nBecause of compatibility reasons only 5 tag entries are shown by default. If you want to show all available tags set the `limit` prop to `null`:\n```vue\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcSelectTags v-model=\"value\" input-label=\"Tags\" :limit=\"null\" />\n\t\t{{ value }}\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tvalue: [\n\t\t\t\t1,\n\t\t\t\t2,\n\t\t\t],\n\t\t}\n\t}\n}\n</script>\n```\n\nIt's also possible to apply any custom filter logic by setting the `optionsFilter` function-prop to any custom function receiving the tag element and the index:\n```vue\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcSelectTags v-model=\"value\" input-label=\"Tags\" :options-filter=\"customFilter\" />\n\t\t{{ value }}\n\t</div>\n</template>\n\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tvalue: [\n\t\t\t\t3,\n\t\t\t],\n\t\t}\n\t},\n\tmethods: {\n\t\t/**\n\t\t* Implement your custom filter logic to filter tags delivered\n\t\t* by the server\n\t\t*\n\t\t* @param {object} the tag object\n\t\t* @param {int} the index of the object inside the collection\n\t\t*/\n\t\tcustomFilter(element, index) {\n\t\t\t/*\n\t\t\t* Tag objects returned by the server will have the\n\t\t\t* following properties (see also api.js):\n\t\t\t* id, displayName, canAssign, userAssignable, userVisible\n\t\t\t*/\n\t\t\treturn element.id >= 2 && element.displayName !== '' && element.canAssign && element.userAssignable && element.userVisible\n\t\t}\n\t}\n}\n</script>\n```\n</docs>\n\n<template>\n\t<NcSelect v-bind=\"propsToForward\"\n\t\t:options=\"availableOptions\"\n\t\t:close-on-select=\"!multiple\"\n\t\t:value=\"passthru ? model : localValue\"\n\t\t@search=\"searchString => search = searchString\"\n\t\tv-on=\"{\n\t\t\t...$listeners,\n\t\t\tinput: passthru ? $listeners.input : noop,\n\t\t\t'update:modelValue': passthru ? $listeners['update:modelValue'] : handleInput,\n\t\t\t'update:model-value': passthru ? $listeners['update:model-value'] : noop,\n\t\t}\">\n\t\t<template #option=\"option\">\n\t\t\t<NcEllipsisedOption :name=\"getOptionLabel(option)\"\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t\t<template #selected-option=\"selectedOption\">\n\t\t\t<NcEllipsisedOption :name=\"getOptionLabel(selectedOption)\"\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t\t<template v-for=\"(_, name) in $scopedSlots\" #[name]=\"data\">\n\t\t\t<!-- @slot Any combination of slots from https://vue-select.org/api/slots.html -->\n\t\t\t<slot :name=\"name\" v-bind=\"data\" />\n\t\t</template>\n\t</NcSelect>\n</template>\n\n<script>\nimport NcEllipsisedOption from '../NcEllipsisedOption/index.js'\nimport NcSelect from '../NcSelect/index.js'\n\nimport { searchTags } from './api.js'\nimport { t } from '../../l10n.js'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\n\nexport default {\n\tname: 'NcSelectTags',\n\n\tcomponents: {\n\t\tNcEllipsisedOption,\n\t\tNcSelect,\n\t},\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t// Add NcSelect prop defaults and populate $props\n\t\t...NcSelect.props,\n\n\t\t/**\n\t\t * Enable automatic fetching of tags\n\t\t *\n\t\t * If `false`, available tags must be passed using the `options` prop\n\t\t */\n\t\tfetchTags: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Callback to generate the label text\n\t\t *\n\t\t * @see https://vue-select.org/api/props.html#getoptionlabel\n\t\t */\n\t\tgetOptionLabel: {\n\t\t\ttype: Function,\n\t\t\tdefault: (option) => {\n\t\t\t\tconst { displayName, userVisible, userAssignable } = option\n\t\t\t\tif (userVisible === false) {\n\t\t\t\t\treturn t('{tag} (invisible)', { tag: displayName })\n\t\t\t\t}\n\t\t\t\tif (userAssignable === false) {\n\t\t\t\t\treturn t('{tag} (restricted)', { tag: displayName })\n\t\t\t\t}\n\t\t\t\treturn displayName\n\t\t\t},\n\t\t},\n\n\t\t/**\n\t\t * Sets the maximum number of tags to display in the dropdown list\n\t\t *\n\t\t * Because of compatibility reasons only 5 tag entries are shown by\n\t\t * default\n\t\t */\n\t\tlimit: {\n\t\t\ttype: Number,\n\t\t\tdefault: 5,\n\t\t},\n\n\t\t/**\n\t\t * Allow selection of multiple options\n\t\t *\n\t\t * This prop automatically sets the internal `closeOnSelect` prop to\n\t\t * its boolean opposite\n\t\t *\n\t\t * @see https://vue-select.org/api/props.html#multiple\n\t\t */\n\t\tmultiple: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Callback to filter available options\n\t\t */\n\t\toptionsFilter: {\n\t\t\ttype: Function,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Enable passing of `value` prop and emitted `input` events as-is\n\t\t * i.e. for usage with `v-model`\n\t\t *\n\t\t * If `true`, custom internal `value` and `input` handling is disabled\n\t\t */\n\t\tpassthru: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Placeholder text\n\t\t *\n\t\t * @see https://vue-select.org/api/props.html#placeholder\n\t\t */\n\t\tplaceholder: {\n\t\t\ttype: String,\n\t\t\tdefault: t('Select a tag'),\n\t\t},\n\n\t\t/**\n\t\t * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: [Number, Array, Object],\n\t\t\tdefault: undefined,\n\t\t},\n\n\t\t/**\n\t\t * Currently selected value\n\t\t */\n\t\tmodelValue: {\n\t\t\ttype: [Number, Array, Object],\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Any available prop\n\t\t *\n\t\t * @see https://vue-select.org/api/props.html\n\t\t */\n\t\t// Not an actual prop but needed to show in vue-styleguidist docs\n\t\t// eslint-disable-next-line\n\t\t' ': {},\n\t},\n\n\temits: [\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t */\n\t\t'input',\n\t\t/**\n\t\t * Emitted on input events of the multiselect field\n\t\t *\n\t\t * @type {number|number[]}\n\t\t */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t\t/**\n\t\t * All events from https://vue-select.org/api/events.html\n\t\t */\n\t\t// Not an actual event but needed to show in vue-styleguidist docs\n\t\t' ',\n\t],\n\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\tconst noop = () => {}\n\t\treturn {\n\t\t\tmodel,\n\t\t\tnoop,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tsearch: '',\n\t\t\tavailableTags: [],\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tavailableOptions() {\n\t\t\tif (this.optionsFilter) {\n\t\t\t\treturn this.tags.filter(this.optionsFilter)\n\t\t\t}\n\t\t\treturn this.tags\n\t\t},\n\n\t\tlocalValue() {\n\t\t\tif (this.tags.length === 0) {\n\t\t\t\treturn []\n\t\t\t}\n\t\t\tif (this.multiple) {\n\t\t\t\treturn this.model\n\t\t\t\t\t.filter(tag => tag !== '')\n\t\t\t\t\t.map(id => this.tags.find(tag2 => tag2.id === id))\n\t\t\t} else {\n\t\t\t\treturn this.tags.find(tag => tag.id === this.model)\n\t\t\t}\n\t\t},\n\n\t\tpropsToForward() {\n\t\t\tconst {\n\t\t\t\t// Props handled by this component\n\t\t\t\tfetchTags,\n\t\t\t\toptionsFilter,\n\t\t\t\tpassthru,\n\t\t\t\t// Props to forward\n\t\t\t\t...propsToForward\n\t\t\t} = this.$props\n\n\t\t\treturn propsToForward\n\t\t},\n\n\t\ttags() {\n\t\t\tif (!this.fetchTags) {\n\t\t\t\treturn this.options\n\t\t\t}\n\t\t\treturn this.availableTags\n\t\t},\n\t},\n\n\tasync created() {\n\t\tif (!this.fetchTags) {\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tconst result = await searchTags()\n\t\t\tthis.availableTags = result\n\t\t} catch (error) {\n\t\t\tconsole.error('Loading systemtags failed', error)\n\t\t}\n\t},\n\n\tmethods: {\n\t\thandleInput(value) {\n\t\t\tif (this.multiple) {\n\t\t\t\t/**\n\t\t\t\t * Emitted on input events of the multiselect field\n\t\t\t\t *\n\t\t\t\t * @type {number|number[]}\n\t\t\t\t */\n\t\t\t\tthis.model = value.map(element => element.id)\n\t\t\t} else {\n\t\t\t\tif (value === null) {\n\t\t\t\t\tthis.model = null\n\t\t\t\t} else {\n\t\t\t\t\tthis.model = value.id\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n"],"names":[],"mappings":";;;;;;;AAQA,MAAM,YAAY,CAAC,QAAQ;AAC1B,MAAI,MAAM,CAAA;AAEV,MAAI,IAAI,aAAa,GAAG;AACvB,QAAI,IAAI,WAAW,SAAS,GAAG;AAC9B,UAAI,aAAa,IAAI,CAAA;AACrB,eAAS,IAAI,GAAG,IAAI,IAAI,WAAW,QAAQ,KAAK;AAC/C,cAAM,YAAY,IAAI,WAAW,KAAK,CAAC;AACvC,YAAI,aAAa,EAAE,UAAU,QAAQ,IAAI,UAAU;AAAA,MACvD;AAAA,IACA;AAAA,EACA,WAAY,IAAI,aAAa,GAAG;AAC9B,UAAM,IAAI;AAAA,EACZ;AAEC,MAAI,IAAI,iBAAiB;AACxB,aAAS,IAAI,GAAG,IAAI,IAAI,WAAW,QAAQ,KAAK;AAC/C,YAAM,OAA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AAA,KAAA,KAAA,KAAA,UAAA,KAAA,OAAA,EAAA,CAAA;AAAA,MACA,OAAA;AACA,eAAA,KAAA,KAAA,KAAA,SAAA,IAAA,OAAA,KAAA,KAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,iBAAA;AACA,YAAA;AAAA;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,QAEA,GAAA;AAAA,MACA,IAAA,KAAA;AAEA,aAAA;AAAA,IACA;AAAA,IAEA,OAAA;AACA,UAAA,CAAA,KAAA,WAAA;AACA,eAAA,KAAA;AAAA,MACA;AACA,aAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,MAAA,UAAA;AACA,QAAA,CAAA,KAAA,WAAA;AACA;AAAA,IACA;AACA,QAAA;AACA,YAAA,SAAA,MAAA,WAAA;AACA,WAAA,gBAAA;AAAA,IACA,SAAA,OAAA;AACA,cAAA,MAAA,6BAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;AAAA,IACA,YAAA,OAAA;AACA,UAAA,KAAA,UAAA;AAMA,aAAA,QAAA,MAAA,IAAA,aAAA,QAAA,EAAA;AAAA,MACA,OAAA;AACA,YAAA,UAAA,MAAA;AACA,eAAA,QAAA;AAAA,QACA,OAAA;AACA,eAAA,QAAA,MAAA;AAAA,QACA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,8 +2,8 @@ import '../assets/NcSelectUsers-BoxBQpbA.css';
2
2
  import { ref } from "vue";
3
3
  import { r as register, i as t43, d as t15, a as t } from "./_l10n-Dt0m9Fxw.mjs";
4
4
  import { G as GenRandomId } from "./GenRandomId-CMooMQt0.mjs";
5
- import { N as NcListItemIcon } from "./NcListItemIcon-B16M-aHV.mjs";
6
- import { N as NcSelect } from "./NcSelect-XLdUgokz.mjs";
5
+ import { N as NcListItemIcon } from "./NcListItemIcon-BG5v_qys.mjs";
6
+ import { N as NcSelect } from "./NcSelect-TmGBPLzc.mjs";
7
7
  import { n as normalizeComponent } from "./_plugin-vue2_normalizer-DU4iP6Vu.mjs";
8
8
  register(t15, t43);
9
9
  const _sfc_main = {
@@ -185,4 +185,4 @@ const NcSelectUsers = __component__.exports;
185
185
  export {
186
186
  NcSelectUsers as N
187
187
  };
188
- //# sourceMappingURL=NcSelectUsers-DFlj_h9t.mjs.map
188
+ //# sourceMappingURL=NcSelectUsers-BQO_sQJ8.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NcSelectUsers-DFlj_h9t.mjs","sources":["../../src/components/NcSelectUsers/NcSelectUsers.vue"],"sourcesContent":["<!--\n\t- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n\t- SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Nextcloud user picker\n\n#### Examples\n\n```vue\n<template>\n\t<div class=\"grid\">\n\t\t<div v-for=\"{ props } in selectArray\"\n\t\t\tclass=\"container\">\n\t\t\t<NcSelectUsers v-bind=\"props\"\n\t\t\t\tv-model=\"props.value\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport svgAccountGroup from '@mdi/svg/svg/account-group.svg?raw'\nimport svgEmail from '@mdi/svg/svg/email.svg?raw'\n\nconst selectArray = [\n\t{\n\t\tprops: {\n\t\t\tinputLabel: 'User select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tid: '0-john',\n\t\t\t\t\tdisplayName: 'John',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'john@example.org',\n\t\t\t\t\t// Example of how to show the user status within the option\n\t\t\t\t\tuser: '0-john',\n\t\t\t\t\tpreloadedUserStatus: {\n\t\t\t\t\t\tstatus: 'online',\n\t\t\t\t\t\tmessage: 'I am online',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-emma',\n\t\t\t\t\tdisplayName: 'Emma',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'emma@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-olivia',\n\t\t\t\t\tdisplayName: 'Olivia',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'olivia@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-noah',\n\t\t\t\t\tdisplayName: 'Noah',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'noah@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-oliver',\n\t\t\t\t\tdisplayName: 'Oliver',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'oliver@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '1-admin',\n\t\t\t\t\tdisplayName: 'Admin',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\ticonSvg: svgAccountGroup,\n\t\t\t\t\ticonName: 'Group icon',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '2-org@example.org',\n\t\t\t\t\tdisplayName: 'Organization',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\tsubname: 'org@example.org',\n\t\t\t\t\ticonSvg: svgEmail,\n\t\t\t\t\ticonName: 'Email icon',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\n\t{\n\t\tprops: {\n\t\t\tinputLabel: 'Multiple user select (stay open on select)',\n\t\t\tkeepOpen: true,\n\t\t\tmultiple: true,\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tid: '0-john',\n\t\t\t\t\tdisplayName: 'John',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'john@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-emma',\n\t\t\t\t\tdisplayName: 'Emma',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'emma@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-olivia',\n\t\t\t\t\tdisplayName: 'Olivia',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'olivia@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-noah',\n\t\t\t\t\tdisplayName: 'Noah',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'noah@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-oliver',\n\t\t\t\t\tdisplayName: 'Oliver',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'oliver@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '1-admin',\n\t\t\t\t\tdisplayName: 'Admin',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\ticonSvg: svgAccountGroup,\n\t\t\t\t\ticonName: 'Group icon',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '2-org@example.org',\n\t\t\t\t\tdisplayName: 'Organization',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\tsubname: 'org@example.org',\n\t\t\t\t\ticonSvg: svgEmail,\n\t\t\t\t\ticonName: 'Email icon',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n]\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tselectArray,\n\t\t}\n\t},\n}\n</script>\n\n<style>\n.grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(1, 500px);\n\tgap: 10px;\n}\n\n.container {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px 0;\n}\n</style>\n```\n</docs>\n\n<script setup>\nimport { ref } from 'vue'\nimport { t } from '../../l10n.js'\nimport createElementId from '../../utils/GenRandomId.js'\n\nimport NcListItemIcon from '../NcListItemIcon/NcListItemIcon.vue'\nimport NcSelect from '../NcSelect/index.js'\n\nconst props = defineProps({\n\t/**\n\t * `aria-label` for the clear input button\n\t */\n\tariaLabelClearSelected: {\n\t\ttype: String,\n\t\tdefault: t('Clear selected'),\n\t},\n\n\t/**\n\t * `aria-label` for the listbox element\n\t */\n\tariaLabelListbox: {\n\t\ttype: String,\n\t\tdefault: t('Options'),\n\t},\n\n\t/**\n\t * Allows to customize the `aria-label` for the deselect-option button\n\t * The default is \"Deselect \" + optionLabel\n\t * @type {(optionLabel: string) => string}\n\t */\n\tariaLabelDeselectOption: {\n\t\ttype: Function,\n\t\tdefault: (optionLabel) => t('Deselect {option}', { option: optionLabel }),\n\t},\n\n\t/**\n\t * Keep the dropdown open after selecting an entry.\n\t */\n\tkeepOpen: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Disable the component\n\t */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Callback to determine if the provided option should match the current search text.\n\t * Used to determine if the option should be displayed.\n\t *\n\t * By default it filters by the `displayName` and `subname` properties of the user\n\t * option object unless this prop is set explicitly\n\t */\n\tfilterBy: {\n\t\ttype: Function,\n\t\tdefault: null,\n\t},\n\n\t/**\n\t * Input element id\n\t */\n\tinputId: {\n\t\ttype: String,\n\t\tdefault: () => createElementId(),\n\t},\n\n\t/**\n\t * Visible label for the input element\n\t *\n\t * @default 'Select account'\n\t */\n\tinputLabel: {\n\t\ttype: String,\n\t\tdefault: t('Select account'),\n\t},\n\n\t/**\n\t * Pass true if you are using an external label.\n\t * In this case make sure you set the `for` attribute of your `<label>` to the `inputId` of this component.\n\t */\n\tlabelOutside: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Show a loading icon.\n\t *\n\t * @default false\n\t */\n\tloading: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Allow selection of multiple options\n\t *\n\t * @default false\n\t */\n\tmultiple: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Disable automatic wrapping when selected options overflow the width.\n\t *\n\t * @default false\n\t */\n\tnoWrap: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Array of users.\n\t *\n\t * @type {{displayName: string, user: string, subname?: string, iconSvg?: string, iconName?: string, isGuest?: boolean, isNoUser?: boolean}[]}\n\t */\n\toptions: {\n\t\ttype: Array,\n\t\tdefault: () => [],\n\t},\n\n\t/**\n\t * Placeholder text.\n\t */\n\tplaceholder: {\n\t\ttype: String,\n\t\tdefault: '',\n\t},\n\n\t/**\n\t * Enable if a value is required for native form validation\n\t */\n\trequired: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Currently selected value\n\t *\n\t * The `v-model` directive may be used for two-way data binding\n\t */\n\tmodelValue: {\n\t\ttype: Object,\n\t\tdefault: null,\n\t},\n})\n\ndefineEmits(['update:modelValue'])\n\nconst search = ref('')\n\n// Avatar size so the component has the same size as Nc*Field\nconst clickableArea = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue('--default-clickable-area'))\nconst gridBaseLine = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue('--default-grid-baseline'))\nconst avatarSize = clickableArea - 2 * gridBaseLine\n\n/**\n * Filter function to search users.\n *\n * @param {{subname: string}} option - The option to check\n * @param {string} label - The label of the option\n * @param {string} search - The current search string\n */\nfunction localFilterBy(option, label, search) {\n\tif (props.filterBy) {\n\t\treturn props.filterBy\n\t}\n\n\t// Match the email notation like \"Jane <j.doe@example.com>\" with the email address as matching group\n\tconst EMAIL_NOTATION = /[^<]*<([^>]+)/\n\n\tconst match = search.match(EMAIL_NOTATION)\n\tconst subname = option.subname?.toLocaleLowerCase() ?? ''\n\treturn (match && subname.indexOf(match[1].toLocaleLowerCase()) > -1)\n\t\t|| (`${label} ${option.subname}`\n\t\t\t.toLocaleLowerCase()\n\t\t\t.indexOf(search.toLocaleLowerCase()) > -1)\n}\n</script>\n\n<template>\n\t<NcSelect class=\"nc-select-users\"\n\t\tv-bind=\"$props\"\n\t\t:filter-by=\"localFilterBy\"\n\t\tlabel=\"displayName\"\n\t\t@search=\"search = $event\"\n\t\t@update:model-value=\"$emit('update:modelValue', $event)\">\n\t\t<template #option=\"option\">\n\t\t\t<NcListItemIcon v-bind=\"option\"\n\t\t\t\t:avatar-size=\"32\"\n\t\t\t\t:name=\"option.displayName\"\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t\t<template #selected-option=\"selectedOption\">\n\t\t\t<NcListItemIcon v-bind=\"selectedOption\"\n\t\t\t\t:avatar-size=\"avatarSize\"\n\t\t\t\t:name=\"selectedOption.displayName\"\n\t\t\t\tno-margin\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t</NcSelect>\n</template>\n\n<style scoped lang=\"css\">\n.nc-select-users :deep(.vs__selected) {\n\tpadding-inline: 0 5px !important;\n}\n</style>\n"],"names":["search"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqUA,UAAM,SAAS,IAAI,EAAE;AAGrB,UAAM,gBAAgB,OAAO,SAAS,OAAO,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,0BAA0B,CAAC;AACzH,UAAM,eAAe,OAAO,SAAS,OAAO,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,yBAAyB,CAAC;AACvH,UAAM,aAAa,gBAAgB,IAAI;AASvC,aAAS,cAAc,QAAQ,OAAOA,SAAQ;AAC7C,UAAI,MAAM,UAAU;AACnB,eAAO,MAAM;AAAA,MACf;AAGC,YAAM,iBAAiB;AAEvB,YAAM,QAAQA,QAAO,MAAM,cAAc;AACzC,YAAM,UAAU,OAAO,SAAS,kBAAiB,KAAM;AACvD,aAAQ,SAAS,QAAQ,QAAQ,MAAM,CAAC,EAAE,kBAAmB,CAAA,IAAI,MAC5D,GAAG,KAAK,IAAI,OAAO,OAAO,GAC5B,kBAAiB,EACjB,QAAQA,QAAO,kBAAmB,CAAA,IAAI;AAAA,IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcSelectUsers-BQO_sQJ8.mjs","sources":["../../src/components/NcSelectUsers/NcSelectUsers.vue"],"sourcesContent":["<!--\n\t- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n\t- SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Nextcloud user picker\n\n#### Examples\n\n```vue\n<template>\n\t<div class=\"grid\">\n\t\t<div v-for=\"{ props } in selectArray\"\n\t\t\tclass=\"container\">\n\t\t\t<NcSelectUsers v-bind=\"props\"\n\t\t\t\tv-model=\"props.value\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport svgAccountGroup from '@mdi/svg/svg/account-group.svg?raw'\nimport svgEmail from '@mdi/svg/svg/email.svg?raw'\n\nconst selectArray = [\n\t{\n\t\tprops: {\n\t\t\tinputLabel: 'User select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tid: '0-john',\n\t\t\t\t\tdisplayName: 'John',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'john@example.org',\n\t\t\t\t\t// Example of how to show the user status within the option\n\t\t\t\t\tuser: '0-john',\n\t\t\t\t\tpreloadedUserStatus: {\n\t\t\t\t\t\tstatus: 'online',\n\t\t\t\t\t\tmessage: 'I am online',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-emma',\n\t\t\t\t\tdisplayName: 'Emma',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'emma@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-olivia',\n\t\t\t\t\tdisplayName: 'Olivia',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'olivia@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-noah',\n\t\t\t\t\tdisplayName: 'Noah',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'noah@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-oliver',\n\t\t\t\t\tdisplayName: 'Oliver',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'oliver@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '1-admin',\n\t\t\t\t\tdisplayName: 'Admin',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\ticonSvg: svgAccountGroup,\n\t\t\t\t\ticonName: 'Group icon',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '2-org@example.org',\n\t\t\t\t\tdisplayName: 'Organization',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\tsubname: 'org@example.org',\n\t\t\t\t\ticonSvg: svgEmail,\n\t\t\t\t\ticonName: 'Email icon',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\n\t{\n\t\tprops: {\n\t\t\tinputLabel: 'Multiple user select (stay open on select)',\n\t\t\tkeepOpen: true,\n\t\t\tmultiple: true,\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tid: '0-john',\n\t\t\t\t\tdisplayName: 'John',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'john@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-emma',\n\t\t\t\t\tdisplayName: 'Emma',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'emma@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-olivia',\n\t\t\t\t\tdisplayName: 'Olivia',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'olivia@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-noah',\n\t\t\t\t\tdisplayName: 'Noah',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'noah@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-oliver',\n\t\t\t\t\tdisplayName: 'Oliver',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'oliver@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '1-admin',\n\t\t\t\t\tdisplayName: 'Admin',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\ticonSvg: svgAccountGroup,\n\t\t\t\t\ticonName: 'Group icon',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '2-org@example.org',\n\t\t\t\t\tdisplayName: 'Organization',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\tsubname: 'org@example.org',\n\t\t\t\t\ticonSvg: svgEmail,\n\t\t\t\t\ticonName: 'Email icon',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n]\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tselectArray,\n\t\t}\n\t},\n}\n</script>\n\n<style>\n.grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(1, 500px);\n\tgap: 10px;\n}\n\n.container {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px 0;\n}\n</style>\n```\n</docs>\n\n<script setup>\nimport { ref } from 'vue'\nimport { t } from '../../l10n.js'\nimport createElementId from '../../utils/GenRandomId.js'\n\nimport NcListItemIcon from '../NcListItemIcon/NcListItemIcon.vue'\nimport NcSelect from '../NcSelect/index.js'\n\nconst props = defineProps({\n\t/**\n\t * `aria-label` for the clear input button\n\t */\n\tariaLabelClearSelected: {\n\t\ttype: String,\n\t\tdefault: t('Clear selected'),\n\t},\n\n\t/**\n\t * `aria-label` for the listbox element\n\t */\n\tariaLabelListbox: {\n\t\ttype: String,\n\t\tdefault: t('Options'),\n\t},\n\n\t/**\n\t * Allows to customize the `aria-label` for the deselect-option button\n\t * The default is \"Deselect \" + optionLabel\n\t * @type {(optionLabel: string) => string}\n\t */\n\tariaLabelDeselectOption: {\n\t\ttype: Function,\n\t\tdefault: (optionLabel) => t('Deselect {option}', { option: optionLabel }),\n\t},\n\n\t/**\n\t * Keep the dropdown open after selecting an entry.\n\t */\n\tkeepOpen: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Disable the component\n\t */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Callback to determine if the provided option should match the current search text.\n\t * Used to determine if the option should be displayed.\n\t *\n\t * By default it filters by the `displayName` and `subname` properties of the user\n\t * option object unless this prop is set explicitly\n\t */\n\tfilterBy: {\n\t\ttype: Function,\n\t\tdefault: null,\n\t},\n\n\t/**\n\t * Input element id\n\t */\n\tinputId: {\n\t\ttype: String,\n\t\tdefault: () => createElementId(),\n\t},\n\n\t/**\n\t * Visible label for the input element\n\t *\n\t * @default 'Select account'\n\t */\n\tinputLabel: {\n\t\ttype: String,\n\t\tdefault: t('Select account'),\n\t},\n\n\t/**\n\t * Pass true if you are using an external label.\n\t * In this case make sure you set the `for` attribute of your `<label>` to the `inputId` of this component.\n\t */\n\tlabelOutside: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Show a loading icon.\n\t *\n\t * @default false\n\t */\n\tloading: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Allow selection of multiple options\n\t *\n\t * @default false\n\t */\n\tmultiple: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Disable automatic wrapping when selected options overflow the width.\n\t *\n\t * @default false\n\t */\n\tnoWrap: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Array of users.\n\t *\n\t * @type {{displayName: string, user: string, subname?: string, iconSvg?: string, iconName?: string, isGuest?: boolean, isNoUser?: boolean}[]}\n\t */\n\toptions: {\n\t\ttype: Array,\n\t\tdefault: () => [],\n\t},\n\n\t/**\n\t * Placeholder text.\n\t */\n\tplaceholder: {\n\t\ttype: String,\n\t\tdefault: '',\n\t},\n\n\t/**\n\t * Enable if a value is required for native form validation\n\t */\n\trequired: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Currently selected value\n\t *\n\t * The `v-model` directive may be used for two-way data binding\n\t */\n\tmodelValue: {\n\t\ttype: Object,\n\t\tdefault: null,\n\t},\n})\n\ndefineEmits(['update:modelValue'])\n\nconst search = ref('')\n\n// Avatar size so the component has the same size as Nc*Field\nconst clickableArea = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue('--default-clickable-area'))\nconst gridBaseLine = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue('--default-grid-baseline'))\nconst avatarSize = clickableArea - 2 * gridBaseLine\n\n/**\n * Filter function to search users.\n *\n * @param {{subname: string}} option - The option to check\n * @param {string} label - The label of the option\n * @param {string} search - The current search string\n */\nfunction localFilterBy(option, label, search) {\n\tif (props.filterBy) {\n\t\treturn props.filterBy\n\t}\n\n\t// Match the email notation like \"Jane <j.doe@example.com>\" with the email address as matching group\n\tconst EMAIL_NOTATION = /[^<]*<([^>]+)/\n\n\tconst match = search.match(EMAIL_NOTATION)\n\tconst subname = option.subname?.toLocaleLowerCase() ?? ''\n\treturn (match && subname.indexOf(match[1].toLocaleLowerCase()) > -1)\n\t\t|| (`${label} ${option.subname}`\n\t\t\t.toLocaleLowerCase()\n\t\t\t.indexOf(search.toLocaleLowerCase()) > -1)\n}\n</script>\n\n<template>\n\t<NcSelect class=\"nc-select-users\"\n\t\tv-bind=\"$props\"\n\t\t:filter-by=\"localFilterBy\"\n\t\tlabel=\"displayName\"\n\t\t@search=\"search = $event\"\n\t\t@update:model-value=\"$emit('update:modelValue', $event)\">\n\t\t<template #option=\"option\">\n\t\t\t<NcListItemIcon v-bind=\"option\"\n\t\t\t\t:avatar-size=\"32\"\n\t\t\t\t:name=\"option.displayName\"\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t\t<template #selected-option=\"selectedOption\">\n\t\t\t<NcListItemIcon v-bind=\"selectedOption\"\n\t\t\t\t:avatar-size=\"avatarSize\"\n\t\t\t\t:name=\"selectedOption.displayName\"\n\t\t\t\tno-margin\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t</NcSelect>\n</template>\n\n<style scoped lang=\"css\">\n.nc-select-users :deep(.vs__selected) {\n\tpadding-inline: 0 5px !important;\n}\n</style>\n"],"names":["search"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqUA,UAAM,SAAS,IAAI,EAAE;AAGrB,UAAM,gBAAgB,OAAO,SAAS,OAAO,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,0BAA0B,CAAC;AACzH,UAAM,eAAe,OAAO,SAAS,OAAO,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,yBAAyB,CAAC;AACvH,UAAM,aAAa,gBAAgB,IAAI;AASvC,aAAS,cAAc,QAAQ,OAAOA,SAAQ;AAC7C,UAAI,MAAM,UAAU;AACnB,eAAO,MAAM;AAAA,MACf;AAGC,YAAM,iBAAiB;AAEvB,YAAM,QAAQA,QAAO,MAAM,cAAc;AACzC,YAAM,UAAU,OAAO,SAAS,kBAAiB,KAAM;AACvD,aAAQ,SAAS,QAAQ,QAAQ,MAAM,CAAC,EAAE,kBAAmB,CAAA,IAAI,MAC5D,GAAG,KAAK,IAAI,OAAO,OAAO,GAC5B,kBAAiB,EACjB,QAAQA,QAAO,kBAAmB,CAAA,IAAI;AAAA,IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,8 +3,8 @@ require('../assets/NcSelectUsers-BoxBQpbA.css');
3
3
  const Vue = require("vue");
4
4
  const _l10n = require("./_l10n-BiiXtYiP.cjs");
5
5
  const GenRandomId = require("./GenRandomId-BQDud3d4.cjs");
6
- const NcListItemIcon = require("./NcListItemIcon-COUzDQI5.cjs");
7
- const NcSelect = require("./NcSelect-C9cGa-5v.cjs");
6
+ const NcListItemIcon = require("./NcListItemIcon-CF64acsf.cjs");
7
+ const NcSelect = require("./NcSelect-FLFfISt6.cjs");
8
8
  const _pluginVue2_normalizer = require("./_plugin-vue2_normalizer-V0q-tHlQ.cjs");
9
9
  _l10n.register(_l10n.t15, _l10n.t43);
10
10
  const _sfc_main = {
@@ -184,4 +184,4 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
184
184
  );
185
185
  const NcSelectUsers = __component__.exports;
186
186
  exports.NcSelectUsers = NcSelectUsers;
187
- //# sourceMappingURL=NcSelectUsers-C-bbm2cW.cjs.map
187
+ //# sourceMappingURL=NcSelectUsers-yQZZACfZ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NcSelectUsers-C-bbm2cW.cjs","sources":["../../src/components/NcSelectUsers/NcSelectUsers.vue"],"sourcesContent":["<!--\n\t- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n\t- SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Nextcloud user picker\n\n#### Examples\n\n```vue\n<template>\n\t<div class=\"grid\">\n\t\t<div v-for=\"{ props } in selectArray\"\n\t\t\tclass=\"container\">\n\t\t\t<NcSelectUsers v-bind=\"props\"\n\t\t\t\tv-model=\"props.value\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport svgAccountGroup from '@mdi/svg/svg/account-group.svg?raw'\nimport svgEmail from '@mdi/svg/svg/email.svg?raw'\n\nconst selectArray = [\n\t{\n\t\tprops: {\n\t\t\tinputLabel: 'User select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tid: '0-john',\n\t\t\t\t\tdisplayName: 'John',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'john@example.org',\n\t\t\t\t\t// Example of how to show the user status within the option\n\t\t\t\t\tuser: '0-john',\n\t\t\t\t\tpreloadedUserStatus: {\n\t\t\t\t\t\tstatus: 'online',\n\t\t\t\t\t\tmessage: 'I am online',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-emma',\n\t\t\t\t\tdisplayName: 'Emma',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'emma@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-olivia',\n\t\t\t\t\tdisplayName: 'Olivia',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'olivia@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-noah',\n\t\t\t\t\tdisplayName: 'Noah',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'noah@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-oliver',\n\t\t\t\t\tdisplayName: 'Oliver',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'oliver@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '1-admin',\n\t\t\t\t\tdisplayName: 'Admin',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\ticonSvg: svgAccountGroup,\n\t\t\t\t\ticonName: 'Group icon',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '2-org@example.org',\n\t\t\t\t\tdisplayName: 'Organization',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\tsubname: 'org@example.org',\n\t\t\t\t\ticonSvg: svgEmail,\n\t\t\t\t\ticonName: 'Email icon',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\n\t{\n\t\tprops: {\n\t\t\tinputLabel: 'Multiple user select (stay open on select)',\n\t\t\tkeepOpen: true,\n\t\t\tmultiple: true,\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tid: '0-john',\n\t\t\t\t\tdisplayName: 'John',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'john@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-emma',\n\t\t\t\t\tdisplayName: 'Emma',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'emma@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-olivia',\n\t\t\t\t\tdisplayName: 'Olivia',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'olivia@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-noah',\n\t\t\t\t\tdisplayName: 'Noah',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'noah@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-oliver',\n\t\t\t\t\tdisplayName: 'Oliver',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'oliver@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '1-admin',\n\t\t\t\t\tdisplayName: 'Admin',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\ticonSvg: svgAccountGroup,\n\t\t\t\t\ticonName: 'Group icon',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '2-org@example.org',\n\t\t\t\t\tdisplayName: 'Organization',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\tsubname: 'org@example.org',\n\t\t\t\t\ticonSvg: svgEmail,\n\t\t\t\t\ticonName: 'Email icon',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n]\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tselectArray,\n\t\t}\n\t},\n}\n</script>\n\n<style>\n.grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(1, 500px);\n\tgap: 10px;\n}\n\n.container {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px 0;\n}\n</style>\n```\n</docs>\n\n<script setup>\nimport { ref } from 'vue'\nimport { t } from '../../l10n.js'\nimport createElementId from '../../utils/GenRandomId.js'\n\nimport NcListItemIcon from '../NcListItemIcon/NcListItemIcon.vue'\nimport NcSelect from '../NcSelect/index.js'\n\nconst props = defineProps({\n\t/**\n\t * `aria-label` for the clear input button\n\t */\n\tariaLabelClearSelected: {\n\t\ttype: String,\n\t\tdefault: t('Clear selected'),\n\t},\n\n\t/**\n\t * `aria-label` for the listbox element\n\t */\n\tariaLabelListbox: {\n\t\ttype: String,\n\t\tdefault: t('Options'),\n\t},\n\n\t/**\n\t * Allows to customize the `aria-label` for the deselect-option button\n\t * The default is \"Deselect \" + optionLabel\n\t * @type {(optionLabel: string) => string}\n\t */\n\tariaLabelDeselectOption: {\n\t\ttype: Function,\n\t\tdefault: (optionLabel) => t('Deselect {option}', { option: optionLabel }),\n\t},\n\n\t/**\n\t * Keep the dropdown open after selecting an entry.\n\t */\n\tkeepOpen: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Disable the component\n\t */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Callback to determine if the provided option should match the current search text.\n\t * Used to determine if the option should be displayed.\n\t *\n\t * By default it filters by the `displayName` and `subname` properties of the user\n\t * option object unless this prop is set explicitly\n\t */\n\tfilterBy: {\n\t\ttype: Function,\n\t\tdefault: null,\n\t},\n\n\t/**\n\t * Input element id\n\t */\n\tinputId: {\n\t\ttype: String,\n\t\tdefault: () => createElementId(),\n\t},\n\n\t/**\n\t * Visible label for the input element\n\t *\n\t * @default 'Select account'\n\t */\n\tinputLabel: {\n\t\ttype: String,\n\t\tdefault: t('Select account'),\n\t},\n\n\t/**\n\t * Pass true if you are using an external label.\n\t * In this case make sure you set the `for` attribute of your `<label>` to the `inputId` of this component.\n\t */\n\tlabelOutside: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Show a loading icon.\n\t *\n\t * @default false\n\t */\n\tloading: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Allow selection of multiple options\n\t *\n\t * @default false\n\t */\n\tmultiple: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Disable automatic wrapping when selected options overflow the width.\n\t *\n\t * @default false\n\t */\n\tnoWrap: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Array of users.\n\t *\n\t * @type {{displayName: string, user: string, subname?: string, iconSvg?: string, iconName?: string, isGuest?: boolean, isNoUser?: boolean}[]}\n\t */\n\toptions: {\n\t\ttype: Array,\n\t\tdefault: () => [],\n\t},\n\n\t/**\n\t * Placeholder text.\n\t */\n\tplaceholder: {\n\t\ttype: String,\n\t\tdefault: '',\n\t},\n\n\t/**\n\t * Enable if a value is required for native form validation\n\t */\n\trequired: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Currently selected value\n\t *\n\t * The `v-model` directive may be used for two-way data binding\n\t */\n\tmodelValue: {\n\t\ttype: Object,\n\t\tdefault: null,\n\t},\n})\n\ndefineEmits(['update:modelValue'])\n\nconst search = ref('')\n\n// Avatar size so the component has the same size as Nc*Field\nconst clickableArea = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue('--default-clickable-area'))\nconst gridBaseLine = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue('--default-grid-baseline'))\nconst avatarSize = clickableArea - 2 * gridBaseLine\n\n/**\n * Filter function to search users.\n *\n * @param {{subname: string}} option - The option to check\n * @param {string} label - The label of the option\n * @param {string} search - The current search string\n */\nfunction localFilterBy(option, label, search) {\n\tif (props.filterBy) {\n\t\treturn props.filterBy\n\t}\n\n\t// Match the email notation like \"Jane <j.doe@example.com>\" with the email address as matching group\n\tconst EMAIL_NOTATION = /[^<]*<([^>]+)/\n\n\tconst match = search.match(EMAIL_NOTATION)\n\tconst subname = option.subname?.toLocaleLowerCase() ?? ''\n\treturn (match && subname.indexOf(match[1].toLocaleLowerCase()) > -1)\n\t\t|| (`${label} ${option.subname}`\n\t\t\t.toLocaleLowerCase()\n\t\t\t.indexOf(search.toLocaleLowerCase()) > -1)\n}\n</script>\n\n<template>\n\t<NcSelect class=\"nc-select-users\"\n\t\tv-bind=\"$props\"\n\t\t:filter-by=\"localFilterBy\"\n\t\tlabel=\"displayName\"\n\t\t@search=\"search = $event\"\n\t\t@update:model-value=\"$emit('update:modelValue', $event)\">\n\t\t<template #option=\"option\">\n\t\t\t<NcListItemIcon v-bind=\"option\"\n\t\t\t\t:avatar-size=\"32\"\n\t\t\t\t:name=\"option.displayName\"\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t\t<template #selected-option=\"selectedOption\">\n\t\t\t<NcListItemIcon v-bind=\"selectedOption\"\n\t\t\t\t:avatar-size=\"avatarSize\"\n\t\t\t\t:name=\"selectedOption.displayName\"\n\t\t\t\tno-margin\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t</NcSelect>\n</template>\n\n<style scoped lang=\"css\">\n.nc-select-users :deep(.vs__selected) {\n\tpadding-inline: 0 5px !important;\n}\n</style>\n"],"names":["ref","search"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqUA,UAAM,SAASA,IAAG,IAAC,EAAE;AAGrB,UAAM,gBAAgB,OAAO,SAAS,OAAO,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,0BAA0B,CAAC;AACzH,UAAM,eAAe,OAAO,SAAS,OAAO,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,yBAAyB,CAAC;AACvH,UAAM,aAAa,gBAAgB,IAAI;AASvC,aAAS,cAAc,QAAQ,OAAOC,SAAQ;AAC7C,UAAI,MAAM,UAAU;AACnB,eAAO,MAAM;AAAA,MACf;AAGC,YAAM,iBAAiB;AAEvB,YAAM,QAAQA,QAAO,MAAM,cAAc;AACzC,YAAM,UAAU,OAAO,SAAS,kBAAiB,KAAM;AACvD,aAAQ,SAAS,QAAQ,QAAQ,MAAM,CAAC,EAAE,kBAAmB,CAAA,IAAI,MAC5D,GAAG,KAAK,IAAI,OAAO,OAAO,GAC5B,kBAAiB,EACjB,QAAQA,QAAO,kBAAmB,CAAA,IAAI;AAAA,IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcSelectUsers-yQZZACfZ.cjs","sources":["../../src/components/NcSelectUsers/NcSelectUsers.vue"],"sourcesContent":["<!--\n\t- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n\t- SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Nextcloud user picker\n\n#### Examples\n\n```vue\n<template>\n\t<div class=\"grid\">\n\t\t<div v-for=\"{ props } in selectArray\"\n\t\t\tclass=\"container\">\n\t\t\t<NcSelectUsers v-bind=\"props\"\n\t\t\t\tv-model=\"props.value\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport svgAccountGroup from '@mdi/svg/svg/account-group.svg?raw'\nimport svgEmail from '@mdi/svg/svg/email.svg?raw'\n\nconst selectArray = [\n\t{\n\t\tprops: {\n\t\t\tinputLabel: 'User select',\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tid: '0-john',\n\t\t\t\t\tdisplayName: 'John',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'john@example.org',\n\t\t\t\t\t// Example of how to show the user status within the option\n\t\t\t\t\tuser: '0-john',\n\t\t\t\t\tpreloadedUserStatus: {\n\t\t\t\t\t\tstatus: 'online',\n\t\t\t\t\t\tmessage: 'I am online',\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-emma',\n\t\t\t\t\tdisplayName: 'Emma',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'emma@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-olivia',\n\t\t\t\t\tdisplayName: 'Olivia',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'olivia@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-noah',\n\t\t\t\t\tdisplayName: 'Noah',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'noah@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-oliver',\n\t\t\t\t\tdisplayName: 'Oliver',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'oliver@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '1-admin',\n\t\t\t\t\tdisplayName: 'Admin',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\ticonSvg: svgAccountGroup,\n\t\t\t\t\ticonName: 'Group icon',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '2-org@example.org',\n\t\t\t\t\tdisplayName: 'Organization',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\tsubname: 'org@example.org',\n\t\t\t\t\ticonSvg: svgEmail,\n\t\t\t\t\ticonName: 'Email icon',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\n\t{\n\t\tprops: {\n\t\t\tinputLabel: 'Multiple user select (stay open on select)',\n\t\t\tkeepOpen: true,\n\t\t\tmultiple: true,\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tid: '0-john',\n\t\t\t\t\tdisplayName: 'John',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'john@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-emma',\n\t\t\t\t\tdisplayName: 'Emma',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'emma@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-olivia',\n\t\t\t\t\tdisplayName: 'Olivia',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'olivia@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-noah',\n\t\t\t\t\tdisplayName: 'Noah',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'noah@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '0-oliver',\n\t\t\t\t\tdisplayName: 'Oliver',\n\t\t\t\t\tisNoUser: false,\n\t\t\t\t\tsubname: 'oliver@example.org',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '1-admin',\n\t\t\t\t\tdisplayName: 'Admin',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\ticonSvg: svgAccountGroup,\n\t\t\t\t\ticonName: 'Group icon',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: '2-org@example.org',\n\t\t\t\t\tdisplayName: 'Organization',\n\t\t\t\t\tisNoUser: true,\n\t\t\t\t\tsubname: 'org@example.org',\n\t\t\t\t\ticonSvg: svgEmail,\n\t\t\t\t\ticonName: 'Email icon',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n]\n\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\tselectArray,\n\t\t}\n\t},\n}\n</script>\n\n<style>\n.grid {\n\tdisplay: grid;\n\tgrid-template-columns: repeat(1, 500px);\n\tgap: 10px;\n}\n\n.container {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 2px 0;\n}\n</style>\n```\n</docs>\n\n<script setup>\nimport { ref } from 'vue'\nimport { t } from '../../l10n.js'\nimport createElementId from '../../utils/GenRandomId.js'\n\nimport NcListItemIcon from '../NcListItemIcon/NcListItemIcon.vue'\nimport NcSelect from '../NcSelect/index.js'\n\nconst props = defineProps({\n\t/**\n\t * `aria-label` for the clear input button\n\t */\n\tariaLabelClearSelected: {\n\t\ttype: String,\n\t\tdefault: t('Clear selected'),\n\t},\n\n\t/**\n\t * `aria-label` for the listbox element\n\t */\n\tariaLabelListbox: {\n\t\ttype: String,\n\t\tdefault: t('Options'),\n\t},\n\n\t/**\n\t * Allows to customize the `aria-label` for the deselect-option button\n\t * The default is \"Deselect \" + optionLabel\n\t * @type {(optionLabel: string) => string}\n\t */\n\tariaLabelDeselectOption: {\n\t\ttype: Function,\n\t\tdefault: (optionLabel) => t('Deselect {option}', { option: optionLabel }),\n\t},\n\n\t/**\n\t * Keep the dropdown open after selecting an entry.\n\t */\n\tkeepOpen: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Disable the component\n\t */\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Callback to determine if the provided option should match the current search text.\n\t * Used to determine if the option should be displayed.\n\t *\n\t * By default it filters by the `displayName` and `subname` properties of the user\n\t * option object unless this prop is set explicitly\n\t */\n\tfilterBy: {\n\t\ttype: Function,\n\t\tdefault: null,\n\t},\n\n\t/**\n\t * Input element id\n\t */\n\tinputId: {\n\t\ttype: String,\n\t\tdefault: () => createElementId(),\n\t},\n\n\t/**\n\t * Visible label for the input element\n\t *\n\t * @default 'Select account'\n\t */\n\tinputLabel: {\n\t\ttype: String,\n\t\tdefault: t('Select account'),\n\t},\n\n\t/**\n\t * Pass true if you are using an external label.\n\t * In this case make sure you set the `for` attribute of your `<label>` to the `inputId` of this component.\n\t */\n\tlabelOutside: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Show a loading icon.\n\t *\n\t * @default false\n\t */\n\tloading: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Allow selection of multiple options\n\t *\n\t * @default false\n\t */\n\tmultiple: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Disable automatic wrapping when selected options overflow the width.\n\t *\n\t * @default false\n\t */\n\tnoWrap: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Array of users.\n\t *\n\t * @type {{displayName: string, user: string, subname?: string, iconSvg?: string, iconName?: string, isGuest?: boolean, isNoUser?: boolean}[]}\n\t */\n\toptions: {\n\t\ttype: Array,\n\t\tdefault: () => [],\n\t},\n\n\t/**\n\t * Placeholder text.\n\t */\n\tplaceholder: {\n\t\ttype: String,\n\t\tdefault: '',\n\t},\n\n\t/**\n\t * Enable if a value is required for native form validation\n\t */\n\trequired: {\n\t\ttype: Boolean,\n\t\tdefault: false,\n\t},\n\n\t/**\n\t * Currently selected value\n\t *\n\t * The `v-model` directive may be used for two-way data binding\n\t */\n\tmodelValue: {\n\t\ttype: Object,\n\t\tdefault: null,\n\t},\n})\n\ndefineEmits(['update:modelValue'])\n\nconst search = ref('')\n\n// Avatar size so the component has the same size as Nc*Field\nconst clickableArea = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue('--default-clickable-area'))\nconst gridBaseLine = Number.parseInt(window.getComputedStyle(document.body).getPropertyValue('--default-grid-baseline'))\nconst avatarSize = clickableArea - 2 * gridBaseLine\n\n/**\n * Filter function to search users.\n *\n * @param {{subname: string}} option - The option to check\n * @param {string} label - The label of the option\n * @param {string} search - The current search string\n */\nfunction localFilterBy(option, label, search) {\n\tif (props.filterBy) {\n\t\treturn props.filterBy\n\t}\n\n\t// Match the email notation like \"Jane <j.doe@example.com>\" with the email address as matching group\n\tconst EMAIL_NOTATION = /[^<]*<([^>]+)/\n\n\tconst match = search.match(EMAIL_NOTATION)\n\tconst subname = option.subname?.toLocaleLowerCase() ?? ''\n\treturn (match && subname.indexOf(match[1].toLocaleLowerCase()) > -1)\n\t\t|| (`${label} ${option.subname}`\n\t\t\t.toLocaleLowerCase()\n\t\t\t.indexOf(search.toLocaleLowerCase()) > -1)\n}\n</script>\n\n<template>\n\t<NcSelect class=\"nc-select-users\"\n\t\tv-bind=\"$props\"\n\t\t:filter-by=\"localFilterBy\"\n\t\tlabel=\"displayName\"\n\t\t@search=\"search = $event\"\n\t\t@update:model-value=\"$emit('update:modelValue', $event)\">\n\t\t<template #option=\"option\">\n\t\t\t<NcListItemIcon v-bind=\"option\"\n\t\t\t\t:avatar-size=\"32\"\n\t\t\t\t:name=\"option.displayName\"\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t\t<template #selected-option=\"selectedOption\">\n\t\t\t<NcListItemIcon v-bind=\"selectedOption\"\n\t\t\t\t:avatar-size=\"avatarSize\"\n\t\t\t\t:name=\"selectedOption.displayName\"\n\t\t\t\tno-margin\n\t\t\t\t:search=\"search\" />\n\t\t</template>\n\t</NcSelect>\n</template>\n\n<style scoped lang=\"css\">\n.nc-select-users :deep(.vs__selected) {\n\tpadding-inline: 0 5px !important;\n}\n</style>\n"],"names":["ref","search"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqUA,UAAM,SAASA,IAAG,IAAC,EAAE;AAGrB,UAAM,gBAAgB,OAAO,SAAS,OAAO,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,0BAA0B,CAAC;AACzH,UAAM,eAAe,OAAO,SAAS,OAAO,iBAAiB,SAAS,IAAI,EAAE,iBAAiB,yBAAyB,CAAC;AACvH,UAAM,aAAa,gBAAgB,IAAI;AASvC,aAAS,cAAc,QAAQ,OAAOC,SAAQ;AAC7C,UAAI,MAAM,UAAU;AACnB,eAAO,MAAM;AAAA,MACf;AAGC,YAAM,iBAAiB;AAEvB,YAAM,QAAQA,QAAO,MAAM,cAAc;AACzC,YAAM,UAAU,OAAO,SAAS,kBAAiB,KAAM;AACvD,aAAQ,SAAS,QAAQ,QAAQ,MAAM,CAAC,EAAE,kBAAmB,CAAA,IAAI,MAC5D,GAAG,KAAK,IAAI,OAAO,OAAO,GAC5B,kBAAiB,EACjB,QAAQA,QAAO,kBAAmB,CAAA,IAAI;AAAA,IAC1C;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  require('../assets/NcSettingsSelectGroup-BEjOwCJQ.css');
2
2
  "use strict";
3
- const NcSelect = require("./NcSelect-C9cGa-5v.cjs");
3
+ const NcSelect = require("./NcSelect-FLFfISt6.cjs");
4
4
  const _l10n = require("./_l10n-BiiXtYiP.cjs");
5
5
  const GenRandomId = require("./GenRandomId-BQDud3d4.cjs");
6
6
  const useModelMigration = require("./useModelMigration-D5zhrNXr.cjs");
@@ -236,4 +236,4 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
236
236
  );
237
237
  const NcSettingsSelectGroup = __component__.exports;
238
238
  exports.NcSettingsSelectGroup = NcSettingsSelectGroup;
239
- //# sourceMappingURL=NcSettingsSelectGroup-CE71MIQo.cjs.map
239
+ //# sourceMappingURL=NcSettingsSelectGroup-BZCbUSci.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NcSettingsSelectGroup-CE71MIQo.cjs","sources":["../../src/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\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@update:model-value=\"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'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\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\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Array,\n\t\t\tdefault: undefined,\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\tmodelValue: {\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/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'input',\n\t\t/** Emitted when the groups selection changes<br />**Payload:** `value` (`Array`) - *Ids of selected groups */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t\t'error',\n\t],\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\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.model.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.model.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\tthis.model = 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":["NcSelect","GenRandomId","useModelMigration","t","axios","generateOcsUrl","debounce"],"mappings":";;;;;;;;;;;;;AA+DA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAA,SAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAA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,CAAA,YAAA,QAAA,EAAA;AACA,WAAA,QAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQA,MAAA,UAAA,OAAA;AACA,UAAA;AACA,gBAAA,OAAA,UAAA,WAAA,UAAA,KAAA,IAAA;AACA,cAAA,WAAA,MAAAC,eAAA,QAAA,IAAAC,OAAAA,eAAA,+BAAA,KAAA,aAAA,CAAA,CAAA;AAGA,YAAA,KAAA,iBAAA,IAAA;AACA,iBAAA,WAAA,MAAA;AACA,iBAAA,eAAA;AAAA,UACA,GAAA,GAAA;AAAA,QACA;AAEA,YAAA,OAAA,KAAA,SAAA,KAAA,IAAA,KAAA,MAAA,EAAA,SAAA,GAAA;AACA,gBAAA,YAAA,OAAA,YAAA,SAAA,KAAA,IAAA,KAAA,OAAA,IAAA,CAAA,YAAA,CAAA,QAAA,IAAA,OAAA,CAAA,CAAA;AACA,eAAA,SAAA,EAAA,GAAA,KAAA,QAAA,GAAA,UAAA;AACA,iBAAA;AAAA,QACA;AAAA,MACA,SAAA,OAAA;AAEA,aAAA,MAAA,SAAA,KAAA;AACA,aAAA,eAAAF,MAAAA,EAAA,4BAAA;AAAA,MACA;AACA,aAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAA,QAAA,OAAA,QAAA;AACA,aAAA,GAAA,SAAA,EAAA,IAAA,OAAA,EAAA,GAAA,kBAAA,EAAA,QAAA,OAAA,kBAAA,CAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAAG,kBAAAA,QAAA,SAAA,OAAA;AACA,WAAA,UAAA,KAAA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcSettingsSelectGroup-BZCbUSci.cjs","sources":["../../src/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\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@update:model-value=\"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'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\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\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Array,\n\t\t\tdefault: undefined,\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\tmodelValue: {\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/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'input',\n\t\t/** Emitted when the groups selection changes<br />**Payload:** `value` (`Array`) - *Ids of selected groups */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t\t'error',\n\t],\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\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.model.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.model.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\tthis.model = 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":["NcSelect","GenRandomId","useModelMigration","t","axios","generateOcsUrl","debounce"],"mappings":";;;;;;;;;;;;;AA+DA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,UAAAA,SAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;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,wBAAA;AAAA,MACA,WAAA,QAAA,GAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;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;AAAA;AAAA;AAAA;AAAA,IAKA;AAAA;AAAA,IAEA;AAAA;AAAA,IAEA;AAAA,IACA;AAAA,EACA;AAAA,EAC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;AACA,aAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAA,QAAA,OAAA,QAAA;AACA,aAAA,GAAA,SAAA,EAAA,IAAA,OAAA,EAAA,GAAA,kBAAA,EAAA,QAAA,OAAA,kBAAA,CAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAAG,kBAAAA,QAAA,SAAA,OAAA;AACA,WAAA,UAAA,KAAA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import '../assets/NcSettingsSelectGroup-BEjOwCJQ.css';
2
- import { N as NcSelect } from "./NcSelect-XLdUgokz.mjs";
2
+ import { N as NcSelect } from "./NcSelect-TmGBPLzc.mjs";
3
3
  import { r as register, g as t48, a as t } from "./_l10n-Dt0m9Fxw.mjs";
4
4
  import { G as GenRandomId } from "./GenRandomId-CMooMQt0.mjs";
5
5
  import { u as useModelMigration } from "./useModelMigration-EhAWvqDD.mjs";
@@ -234,4 +234,4 @@ const NcSettingsSelectGroup = __component__.exports;
234
234
  export {
235
235
  NcSettingsSelectGroup as N
236
236
  };
237
- //# sourceMappingURL=NcSettingsSelectGroup-B4isXyUU.mjs.map
237
+ //# sourceMappingURL=NcSettingsSelectGroup-dzvfki-M.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NcSettingsSelectGroup-B4isXyUU.mjs","sources":["../../src/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\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@update:model-value=\"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'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\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\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Array,\n\t\t\tdefault: undefined,\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\tmodelValue: {\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/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'input',\n\t\t/** Emitted when the groups selection changes<br />**Payload:** `value` (`Array`) - *Ids of selected groups */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t\t'error',\n\t],\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\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.model.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.model.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\tthis.model = 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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"version":3,"file":"NcSettingsSelectGroup-dzvfki-M.mjs","sources":["../../src/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\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@update:model-value=\"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'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\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\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: Array,\n\t\t\tdefault: undefined,\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\tmodelValue: {\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/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'input',\n\t\t/** Emitted when the groups selection changes<br />**Payload:** `value` (`Array`) - *Ids of selected groups */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t\t'error',\n\t],\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\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.model.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.model.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\tthis.model = 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":[],"mappings":";;;;;;;;;AA+DA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;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,YAAA,YAAA;AAAA,MACA,WAAA,QAAA,GAAA,KAAA,MAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,YAAA;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;AAAA;AAAA;AAAA;AAAA,IAK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AAA,4BAAA;AAAA,MACA;AACA,aAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAA,QAAA,OAAA,QAAA;AACA,aAAA,GAAA,SAAA,EAAA,IAAA,OAAA,EAAA,GAAA,kBAAA,EAAA,QAAA,OAAA,kBAAA,CAAA,IAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,UAAA,SAAA,SAAA,OAAA;AACA,WAAA,UAAA,KAAA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { r as register, y as t24, a as t, z as t41 } from "./_l10n-Dt0m9Fxw.mjs";
2
2
  import { getTimezoneManager as getTimezoneManager$1 } from "@nextcloud/timezones";
3
3
  import { G as GenRandomId } from "./GenRandomId-CMooMQt0.mjs";
4
- import { N as NcSelect } from "./NcSelect-XLdUgokz.mjs";
4
+ import { N as NcSelect } from "./NcSelect-TmGBPLzc.mjs";
5
5
  import { u as useModelMigration } from "./useModelMigration-EhAWvqDD.mjs";
6
6
  import { n as normalizeComponent } from "./_plugin-vue2_normalizer-DU4iP6Vu.mjs";
7
7
  register(t24);
@@ -212,4 +212,4 @@ const NcTimezonePicker = __component__.exports;
212
212
  export {
213
213
  NcTimezonePicker as N
214
214
  };
215
- //# sourceMappingURL=NcTimezonePicker-sAG8kn1b.mjs.map
215
+ //# sourceMappingURL=NcTimezonePicker-C17Rji1h.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NcTimezonePicker-sAG8kn1b.mjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getTimezoneManager } from '@nextcloud/timezones'\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\ttimezoneManager.registerDefaultTimezones()\n\t\tinitialized = true\n\t}\n\n\treturn timezoneManager\n}\n","<!--\n - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\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'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\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\tmodelValue: {\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: [\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'input',\n\t\t/**\n\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t],\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\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.model) {\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.model),\n\t\t\t\ttimezoneId: this.model,\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\tthis.model = 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":["getTimezoneManager","timezoneManager"],"mappings":";;;;;;;AAaO,SAAS,sBAAsB,eAAe,IAAI,sBAAsB,CAAA,GAAI;AAClF,QAAM,oBAAoB,CAAA;AAC1B,QAAM,aAAa,CAAA;AAEnB,aAAW,cAAc,cAAc;AACtC,UAAM,aAAa,WAAW,MAAM,GAAG;AACvC,QAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,SAAS,WAAW,KAAK,GAAG,CAAC;AACjE,QAAI,CAAC,MAAM;AACV,aAAO;AAEP,kBAAY,EAAE,QAAQ;AAAA,IACzB;AAEE,sBAAkB,SAAS,IAAI,kBAAkB,SAAS,KAAK;AAAA,MAC9D;AAAA,MACA,SAAS,CAAE;AAAA,IACd;AAEE,sBAAkB,SAAS,EAAE,QAAQ,KAAK;AAAA,MACzC,OAAO,wBAAwB,IAAI;AAAA,MACnC,QAAQ,CAAE;AAAA,MACV;AAAA,IACA,CAAA;AAAA,EACH;AAEC,aAAW,sBAAsB,qBAAqB;AACrD,UAAM,EAAE,WAAW,OAAO,eAAe;AAEzC,sBAAkB,SAAS,IAAI,kBAAkB,SAAS,KAAK;AAAA,MAC9D;AAAA,MACA,SAAS,CAAE;AAAA,IACd;AAEE,sBAAkB,SAAS,EAAE,QAAQ,KAAK;AAAA,MACzC;AAAA,MACA,QAAQ,CAAE;AAAA,MACV;AAAA,IACA,CAAA;AAAA,EACH;AAEC,aAAW,aAAa,mBAAmB;AAC1C,QAAI,CAAC,OAAO,UAAU,eAAe,KAAK,mBAAmB,SAAS,GAAG;AACxE;AAAA,IACH;AAEE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AAA,KAAA,gBAAA,OAAA,YAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA,YAAA,OAAA;AACA,aAAA,MAAA,MAAA,UAAA,WAAA,YAAA,EAAA,SAAA,KAAA,aAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcTimezonePicker-C17Rji1h.mjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getTimezoneManager } from '@nextcloud/timezones'\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\ttimezoneManager.registerDefaultTimezones()\n\t\tinitialized = true\n\t}\n\n\treturn timezoneManager\n}\n","<!--\n - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\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'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\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\tmodelValue: {\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: [\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'input',\n\t\t/**\n\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t],\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\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.model) {\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.model),\n\t\t\t\ttimezoneId: this.model,\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\tthis.model = 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":["getTimezoneManager","timezoneManager"],"mappings":";;;;;;;AAaO,SAAS,sBAAsB,eAAe,IAAI,sBAAsB,CAAA,GAAI;AAClF,QAAM,oBAAoB,CAAA;AAC1B,QAAM,aAAa,CAAA;AAEnB,aAAW,cAAc,cAAc;AACtC,UAAM,aAAa,WAAW,MAAM,GAAG;AACvC,QAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,SAAS,WAAW,KAAK,GAAG,CAAC;AACjE,QAAI,CAAC,MAAM;AACV,aAAO;AAEP,kBAAY,EAAE,QAAQ;AAAA,IACzB;AAEE,sBAAkB,SAAS,IAAI,kBAAkB,SAAS,KAAK;AAAA,MAC9D;AAAA,MACA,SAAS,CAAE;AAAA,IACd;AAEE,sBAAkB,SAAS,EAAE,QAAQ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UAAA;AACA,UAAA,CAAA,UAAA;AACA;AAAA,MACA;AAEA,WAAA,QAAA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAA,QAAA;AACA,aAAA,CAAA,OAAA,WAAA,WAAA,YAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,SAAA,QAAA,OAAA,QAAA;AAEA,YAAA,QAAA,OAAA,KAAA,EAAA,MAAA,GAAA;AAGA,UAAA,OAAA,WAAA,WAAA,YAAA,GAAA;AACA,eAAA,OAAA,QAAA,KAAA,YAAA;AACA,iBAAA,KAAA,gBAAA,OAAA,YAAA,KAAA;AAAA,QACA,CAAA;AAAA,MACA;AAGA,aAAA,KAAA,gBAAA,OAAA,YAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA,YAAA,OAAA;AACA,aAAA,MAAA,MAAA,UAAA,WAAA,YAAA,EAAA,SAAA,KAAA,aAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;"}
@@ -2,7 +2,7 @@
2
2
  const _l10n = require("./_l10n-BiiXtYiP.cjs");
3
3
  const timezones = require("@nextcloud/timezones");
4
4
  const GenRandomId = require("./GenRandomId-BQDud3d4.cjs");
5
- const NcSelect = require("./NcSelect-C9cGa-5v.cjs");
5
+ const NcSelect = require("./NcSelect-FLFfISt6.cjs");
6
6
  const useModelMigration = require("./useModelMigration-D5zhrNXr.cjs");
7
7
  const _pluginVue2_normalizer = require("./_plugin-vue2_normalizer-V0q-tHlQ.cjs");
8
8
  _l10n.register(_l10n.t24);
@@ -211,4 +211,4 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
211
211
  );
212
212
  const NcTimezonePicker = __component__.exports;
213
213
  exports.NcTimezonePicker = NcTimezonePicker;
214
- //# sourceMappingURL=NcTimezonePicker-BTyhPxMT.cjs.map
214
+ //# sourceMappingURL=NcTimezonePicker-DZ4evH1Q.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NcTimezonePicker-BTyhPxMT.cjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getTimezoneManager } from '@nextcloud/timezones'\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\ttimezoneManager.registerDefaultTimezones()\n\t\tinitialized = true\n\t}\n\n\treturn timezoneManager\n}\n","<!--\n - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\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'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\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\tmodelValue: {\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: [\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'input',\n\t\t/**\n\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t],\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\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.model) {\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.model),\n\t\t\t\ttimezoneId: this.model,\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\tthis.model = 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":["t","getTimezoneManager","NcSelect","GenRandomId","useModelMigration","timezoneManager"],"mappings":";;;;;;;;AAaO,SAAS,sBAAsB,eAAe,IAAI,sBAAsB,CAAA,GAAI;AAClF,QAAM,oBAAoB,CAAA;AAC1B,QAAM,aAAa,CAAA;AAEnB,aAAW,cAAc,cAAc;AACtC,UAAM,aAAa,WAAW,MAAM,GAAG;AACvC,QAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,SAAS,WAAW,KAAK,GAAG,CAAC;AACjE,QAAI,CAAC,MAAM;AACV,aAAO;AAEP,kBAAYA,MAAC,EAAC,QAAQ;AAAA,IACzB;AAEE,sBAAkB,SAAS,IAAI,kBAAkB,SAAS,KAAK;AAAA,MAC9D;AAAA,MACA,SAAS,CAAE;AAAA,IACd;AAEE,sBAAkB,SAAS,EAAE,QAAQ,KAAK;AAAA,MACzC,OAAO,wBAAwB,IAAI;AAAA,MACnC,QAAQ,CAAE;AAAA,MACV;AAAA,IACA,CAAA;AAAA,EACH;AAEC,aAAW,s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A;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASA,aAAA,QAAA;AACA,aAAA,CAAA,OAAA,WAAA,WAAA,YAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,SAAA,QAAA,OAAA,QAAA;AAEA,YAAA,QAAA,OAAA,KAAA,EAAA,MAAA,GAAA;AAGA,UAAA,OAAA,WAAA,WAAA,YAAA,GAAA;AACA,eAAA,OAAA,QAAA,KAAA,YAAA;AACA,iBAAA,KAAA,gBAAA,OAAA,YAAA,KAAA;AAAA,QACA,CAAA;AAAA,MACA;AAGA,aAAA,KAAA,gBAAA,OAAA,YAAA,KAAA;AAAA,IACA;AAAA,IAEA,gBAAA,YAAA,OAAA;AACA,aAAA,MAAA,MAAA,UAAA,WAAA,YAAA,EAAA,SAAA,KAAA,aAAA,CAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"NcTimezonePicker-DZ4evH1Q.cjs","sources":["../../src/components/NcTimezonePicker/timezone.js","../../src/components/NcTimezonePicker/timezoneDataProviderService.js","../../src/components/NcTimezonePicker/NcTimezonePicker.vue"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getTimezoneManager } from '@nextcloud/timezones'\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\ttimezoneManager.registerDefaultTimezones()\n\t\tinitialized = true\n\t}\n\n\treturn timezoneManager\n}\n","<!--\n - SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\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'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\n\nexport default {\n\tname: 'NcTimezonePicker',\n\tcomponents: {\n\t\tNcSelect,\n\t},\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\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 * Removed in v9 - use `modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\tvalue: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\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\tmodelValue: {\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: [\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t * @deprecated\n\t\t */\n\t\t'input',\n\t\t/**\n\t\t * Two-way binding of the value prop. Use v-model=\"selectedTimezone\" for two-way binding\n\t\t */\n\t\t'update:modelValue',\n\t\t/** Same as update:modelValue for Vue 2 compatibility */\n\t\t'update:model-value',\n\t],\n\tsetup() {\n\t\tconst model = useModelMigration('value', 'input')\n\t\treturn {\n\t\t\tmodel,\n\t\t}\n\t},\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.model) {\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.model),\n\t\t\t\ttimezoneId: this.model,\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\tthis.model = 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":["t","getTimezoneManager","NcSelect","GenRandomId","useModelMigration","timezoneManager"],"mappings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NcUserBubble-BsTKRhKz.css');
2
2
  "use strict";
3
3
  const _pluginVue2_normalizer = require("./_plugin-vue2_normalizer-V0q-tHlQ.cjs");
4
- const NcAvatar = require("./NcAvatar-Bp1wPu2I.cjs");
5
- const NcPopover = require("./NcPopover-BxLo6SFb.cjs");
4
+ const NcAvatar = require("./NcAvatar-C3s9tDzi.cjs");
5
+ const NcPopover = require("./NcPopover-Djf9_BrD.cjs");
6
6
  const Vue = require("vue");
7
7
  const vueRouter = require("vue-router");
8
8
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
@@ -219,4 +219,4 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
219
219
  );
220
220
  const NcUserBubble = __component__.exports;
221
221
  exports.NcUserBubble = NcUserBubble;
222
- //# sourceMappingURL=NcUserBubble-cX4wyq1_.cjs.map
222
+ //# sourceMappingURL=NcUserBubble-Cu4Jzq9u.cjs.map