@nextcloud/vue 8.32.0 → 8.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -1
- package/dist/Components/NcActionButton.cjs +1 -1
- package/dist/Components/NcActionButton.mjs +1 -1
- package/dist/Components/NcActionButtonGroup.cjs +1 -1
- package/dist/Components/NcActionButtonGroup.mjs +1 -1
- package/dist/Components/NcActionCheckbox.cjs +1 -1
- package/dist/Components/NcActionCheckbox.mjs +1 -1
- package/dist/Components/NcActionInput.cjs +1 -1
- package/dist/Components/NcActionInput.mjs +1 -1
- package/dist/Components/NcActionLink.cjs +5 -5
- package/dist/Components/NcActionLink.cjs.map +1 -1
- package/dist/Components/NcActionLink.mjs +5 -5
- package/dist/Components/NcActionLink.mjs.map +1 -1
- package/dist/Components/NcActionRadio.cjs +1 -1
- package/dist/Components/NcActionRadio.mjs +1 -1
- package/dist/Components/NcActionRouter.cjs +4 -4
- package/dist/Components/NcActionRouter.cjs.map +1 -1
- package/dist/Components/NcActionRouter.mjs +4 -4
- package/dist/Components/NcActionRouter.mjs.map +1 -1
- package/dist/Components/NcActionText.cjs +4 -4
- package/dist/Components/NcActionText.cjs.map +1 -1
- package/dist/Components/NcActionText.mjs +4 -4
- package/dist/Components/NcActionText.mjs.map +1 -1
- package/dist/Components/NcActionTextEditable.cjs +1 -1
- package/dist/Components/NcActionTextEditable.mjs +1 -1
- package/dist/Components/NcActions.cjs +1 -1
- package/dist/Components/NcActions.mjs +1 -1
- package/dist/Components/NcAppContent.cjs +1 -1
- package/dist/Components/NcAppContent.mjs +1 -1
- package/dist/Components/NcAppNavigation.cjs +1 -1
- package/dist/Components/NcAppNavigation.mjs +1 -1
- package/dist/Components/NcAppNavigationCaption.cjs +1 -1
- package/dist/Components/NcAppNavigationCaption.mjs +1 -1
- package/dist/Components/NcAppNavigationItem.cjs +1 -1
- package/dist/Components/NcAppNavigationItem.mjs +1 -1
- package/dist/Components/NcAppNavigationNew.cjs +1 -1
- package/dist/Components/NcAppNavigationNew.mjs +1 -1
- package/dist/Components/NcAppNavigationNewItem.cjs +1 -1
- package/dist/Components/NcAppNavigationNewItem.mjs +1 -1
- package/dist/Components/NcAppNavigationSearch.cjs +1 -1
- package/dist/Components/NcAppNavigationSearch.mjs +1 -1
- package/dist/Components/NcAppNavigationSettings.cjs +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +1 -1
- package/dist/Components/NcAppNavigationToggle.cjs +1 -1
- package/dist/Components/NcAppNavigationToggle.mjs +1 -1
- package/dist/Components/NcAppSettingsDialog.cjs +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +1 -1
- package/dist/Components/NcAppSettingsSection.cjs +1 -1
- package/dist/Components/NcAppSettingsSection.mjs +1 -1
- package/dist/Components/NcAppSettingsSectionShortcuts.cjs +4 -0
- package/dist/Components/NcAppSettingsSectionShortcuts.cjs.map +1 -0
- package/dist/Components/NcAppSettingsSectionShortcuts.mjs +5 -0
- package/dist/Components/NcAppSettingsSectionShortcuts.mjs.map +1 -0
- package/dist/Components/NcAppSidebar.cjs +1 -1
- package/dist/Components/NcAppSidebar.mjs +1 -1
- package/dist/Components/NcAppSidebarTab.cjs +2 -3
- package/dist/Components/NcAppSidebarTab.cjs.map +1 -1
- package/dist/Components/NcAppSidebarTab.mjs +2 -3
- package/dist/Components/NcAppSidebarTab.mjs.map +1 -1
- package/dist/Components/NcAssistantButton.cjs +1 -1
- package/dist/Components/NcAssistantButton.mjs +1 -1
- package/dist/Components/NcAssistantIcon.cjs +1 -1
- package/dist/Components/NcAssistantIcon.mjs +1 -1
- package/dist/Components/NcAvatar.cjs +1 -1
- package/dist/Components/NcAvatar.mjs +1 -1
- package/dist/Components/NcBreadcrumb.cjs +1 -1
- package/dist/Components/NcBreadcrumb.mjs +1 -1
- package/dist/Components/NcBreadcrumbs.cjs +1 -1
- package/dist/Components/NcBreadcrumbs.mjs +1 -1
- package/dist/Components/NcButton.cjs +1 -1
- package/dist/Components/NcButton.mjs +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +1 -1
- package/dist/Components/NcChip.cjs +11 -17
- package/dist/Components/NcChip.cjs.map +1 -1
- package/dist/Components/NcChip.mjs +11 -17
- package/dist/Components/NcChip.mjs.map +1 -1
- package/dist/Components/NcCollectionList.cjs +1 -1
- package/dist/Components/NcCollectionList.mjs +1 -1
- package/dist/Components/NcColorPicker.cjs +1 -1
- package/dist/Components/NcColorPicker.mjs +1 -1
- package/dist/Components/NcContent.cjs +1 -1
- package/dist/Components/NcContent.mjs +1 -1
- package/dist/Components/NcCounterBubble.cjs +1 -1
- package/dist/Components/NcCounterBubble.mjs +1 -1
- package/dist/Components/NcDashboardWidget.cjs +1 -1
- package/dist/Components/NcDashboardWidget.mjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.cjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +1 -1
- package/dist/Components/NcDateTimePicker.cjs +17 -30
- package/dist/Components/NcDateTimePicker.cjs.map +1 -1
- package/dist/Components/NcDateTimePicker.mjs +17 -30
- package/dist/Components/NcDateTimePicker.mjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.cjs +14 -32
- package/dist/Components/NcDateTimePickerNative.cjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +14 -32
- package/dist/Components/NcDateTimePickerNative.mjs.map +1 -1
- package/dist/Components/NcDialog.cjs +1 -1
- package/dist/Components/NcDialog.mjs +1 -1
- package/dist/Components/NcDialogButton.cjs +1 -1
- package/dist/Components/NcDialogButton.mjs +1 -1
- package/dist/Components/NcEllipsisedOption.cjs +1 -1
- package/dist/Components/NcEllipsisedOption.mjs +1 -1
- package/dist/Components/NcEmojiPicker.cjs +1 -1
- package/dist/Components/NcEmojiPicker.mjs +1 -1
- package/dist/Components/NcEmptyContent.cjs +14 -9
- package/dist/Components/NcEmptyContent.cjs.map +1 -1
- package/dist/Components/NcEmptyContent.mjs +14 -9
- package/dist/Components/NcEmptyContent.mjs.map +1 -1
- package/dist/Components/NcHeaderButton.cjs +1 -1
- package/dist/Components/NcHeaderButton.mjs +1 -1
- package/dist/Components/NcHeaderMenu.cjs +1 -1
- package/dist/Components/NcHeaderMenu.mjs +1 -1
- package/dist/Components/NcHighlight.cjs +1 -1
- package/dist/Components/NcHighlight.mjs +1 -1
- package/dist/Components/NcHotkey.cjs +4 -0
- package/dist/Components/NcHotkey.cjs.map +1 -0
- package/dist/Components/NcHotkey.mjs +5 -0
- package/dist/Components/NcHotkey.mjs.map +1 -0
- package/dist/Components/NcHotkeyList.cjs +4 -0
- package/dist/Components/NcHotkeyList.cjs.map +1 -0
- package/dist/Components/NcHotkeyList.mjs +5 -0
- package/dist/Components/NcHotkeyList.mjs.map +1 -0
- package/dist/Components/NcIconSvgWrapper.cjs +1 -1
- package/dist/Components/NcIconSvgWrapper.mjs +1 -1
- package/dist/Components/NcInputField.cjs +1 -1
- package/dist/Components/NcInputField.mjs +1 -1
- package/dist/Components/NcKbd.cjs +2 -63
- package/dist/Components/NcKbd.cjs.map +1 -1
- package/dist/Components/NcKbd.mjs +2 -63
- package/dist/Components/NcKbd.mjs.map +1 -1
- package/dist/Components/NcListItem.cjs +1 -1
- package/dist/Components/NcListItem.mjs +1 -1
- package/dist/Components/NcListItemIcon.cjs +1 -1
- package/dist/Components/NcListItemIcon.mjs +1 -1
- package/dist/Components/NcModal.cjs +12 -13
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +12 -13
- package/dist/Components/NcModal.mjs.map +1 -1
- package/dist/Components/NcNoteCard.cjs +2 -2
- package/dist/Components/NcNoteCard.mjs +2 -2
- package/dist/Components/NcPasswordField.cjs +1 -1
- package/dist/Components/NcPasswordField.mjs +1 -1
- package/dist/Components/NcPopover.cjs +1 -1
- package/dist/Components/NcPopover.mjs +1 -1
- package/dist/Components/NcProgressBar.cjs +1 -1
- package/dist/Components/NcProgressBar.mjs +1 -1
- package/dist/Components/NcRadioGroup.cjs +1 -1
- package/dist/Components/NcRadioGroup.mjs +1 -1
- package/dist/Components/NcRadioGroupButton.cjs +1 -1
- package/dist/Components/NcRadioGroupButton.mjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +1 -1
- package/dist/Components/NcRichContenteditable.cjs +2 -2
- package/dist/Components/NcRichContenteditable.mjs +2 -2
- package/dist/Components/NcRichText.cjs +3 -3
- package/dist/Components/NcRichText.mjs +4 -4
- package/dist/Components/NcSelect.cjs +1 -1
- package/dist/Components/NcSelect.mjs +1 -1
- package/dist/Components/NcSelectTags.cjs +1 -1
- package/dist/Components/NcSelectTags.mjs +1 -1
- package/dist/Components/NcSelectUsers.cjs +1 -1
- package/dist/Components/NcSelectUsers.mjs +1 -1
- package/dist/Components/NcSettingsInputText.cjs +1 -1
- package/dist/Components/NcSettingsInputText.mjs +1 -1
- package/dist/Components/NcSettingsSection.cjs +1 -1
- package/dist/Components/NcSettingsSection.mjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
- package/dist/Components/NcTextArea.cjs +1 -1
- package/dist/Components/NcTextArea.mjs +1 -1
- package/dist/Components/NcTextField.cjs +1 -1
- package/dist/Components/NcTextField.mjs +1 -1
- package/dist/Components/NcThemeProvider.cjs +1 -1
- package/dist/Components/NcThemeProvider.mjs +1 -1
- package/dist/Components/NcTimezonePicker.cjs +1 -1
- package/dist/Components/NcTimezonePicker.mjs +1 -1
- package/dist/Components/NcUserBubble.cjs +1 -1
- package/dist/Components/NcUserBubble.mjs +1 -1
- package/dist/Components/NcUserStatusIcon.cjs +1 -1
- package/dist/Components/NcUserStatusIcon.mjs +1 -1
- package/dist/Components/NcVNodes.cjs +1 -2
- package/dist/Components/NcVNodes.cjs.map +1 -1
- package/dist/Components/NcVNodes.mjs +1 -2
- package/dist/Components/NcVNodes.mjs.map +1 -1
- package/dist/Composables/useFormatDateTime.cjs +12 -27
- package/dist/Composables/useFormatDateTime.cjs.map +1 -1
- package/dist/Composables/useFormatDateTime.mjs +12 -27
- package/dist/Composables/useFormatDateTime.mjs.map +1 -1
- package/dist/Composables/useHotKey.cjs +1 -2
- package/dist/Composables/useHotKey.cjs.map +1 -1
- package/dist/Composables/useHotKey.mjs +1 -2
- package/dist/Composables/useHotKey.mjs.map +1 -1
- package/dist/Composables/useIsDarkTheme.cjs +2 -5
- package/dist/Composables/useIsDarkTheme.cjs.map +1 -1
- package/dist/Composables/useIsDarkTheme.mjs +2 -5
- package/dist/Composables/useIsDarkTheme.mjs.map +1 -1
- package/dist/Directives/Linkify.cjs +1 -2
- package/dist/Directives/Linkify.cjs.map +1 -1
- package/dist/Directives/Linkify.mjs +1 -2
- package/dist/Directives/Linkify.mjs.map +1 -1
- package/dist/Functions/contactsMenu.cjs +2 -3
- package/dist/Functions/contactsMenu.cjs.map +1 -1
- package/dist/Functions/contactsMenu.mjs +2 -3
- package/dist/Functions/contactsMenu.mjs.map +1 -1
- package/dist/Functions/dialog.cjs +5 -20
- package/dist/Functions/dialog.cjs.map +1 -1
- package/dist/Functions/dialog.mjs +5 -20
- package/dist/Functions/dialog.mjs.map +1 -1
- package/dist/Functions/emoji.cjs +1 -1
- package/dist/Functions/emoji.mjs +1 -1
- package/dist/Functions/reference.cjs +2 -2
- package/dist/Functions/reference.mjs +2 -2
- package/dist/Functions/registerReference.cjs +1 -1
- package/dist/Functions/registerReference.mjs +1 -1
- package/dist/Functions/usernameToColor.cjs +1 -1
- package/dist/Functions/usernameToColor.mjs +1 -1
- package/dist/Mixins/richEditor.cjs +1 -1
- package/dist/Mixins/richEditor.mjs +1 -1
- package/dist/assets/{NcActionButton-DwJihiLc.css → NcActionButton-CG4V9b5b.css} +18 -18
- package/dist/assets/{NcActionCheckbox-DvdNISIs.css → NcActionCheckbox-C8I_k6NA.css} +12 -12
- package/dist/assets/{NcActionInput-DsGwr3wt.css → NcActionInput-BvPYSqDP.css} +65 -65
- package/dist/assets/{NcActionLink-7Wp6P-Nk.css → NcActionLink-BtpJIbvI.css} +13 -13
- package/dist/assets/{NcActionRadio-CLsR2Ore.css → NcActionRadio-CLIRNp3t.css} +12 -12
- package/dist/assets/{NcActionRouter-ByijfQtF.css → NcActionRouter-Bpv5Ywxq.css} +16 -16
- package/dist/assets/{NcActionText-CR_yvwWo.css → NcActionText-IMOkntPi.css} +18 -18
- package/dist/assets/{NcActionTextEditable-CCWTiT5c.css → NcActionTextEditable-BCmDMuUg.css} +65 -65
- package/dist/assets/{NcAppContent-BpjG38I8.css → NcAppContent-Ri_iNfn5.css} +4 -4
- package/dist/assets/{NcAppNavigationItem-UaB3qdsS.css → NcAppNavigationItem-DSL2nLRf.css} +36 -36
- package/dist/assets/{NcAppNavigationNewItem-Cjbn5XkO.css → NcAppNavigationNewItem-CYSjj3pD.css} +38 -38
- package/dist/assets/NcAppNavigationSettings-2Wh1E3Hq.css +53 -0
- package/dist/assets/{NcAppSettingsDialog-DH3DIIwL.css → NcAppSettingsDialog-2axspyf-.css} +10 -10
- package/dist/assets/{NcAppSettingsSection-Dq0eTGEp.css → NcAppSettingsSection-CLSVNQzv.css} +3 -3
- package/dist/assets/NcAppSettingsSectionShortcuts-BuI-s4kd.css +27 -0
- package/dist/assets/{NcChip-Cc17FJEC.css → NcChip-ByvuZS2-.css} +23 -11
- package/dist/assets/{NcDateTimePicker-C6sMtYzL.css → NcDateTimePicker-BmMuUpwr.css} +22 -22
- package/dist/assets/{NcEmptyContent-xdTcF0yQ.css → NcEmptyContent-CUFc_Dds.css} +9 -9
- package/dist/assets/{NcHeaderButton-CeT-dsLr.css → NcHeaderButton-DI-1Gsph.css} +9 -9
- package/dist/assets/{NcHeaderMenu-BXb9npZp.css → NcHeaderMenu-BkpmEa3M.css} +13 -13
- package/dist/assets/NcHotkey-QklVKSyr.css +44 -0
- package/dist/assets/NcHotkeyList-B42a0d8Z.css +9 -0
- package/dist/assets/{NcInputField-BI3vWgSo.css → NcInputField-CtUAgq1i.css} +42 -42
- package/dist/assets/{NcRadioGroupButton-6mf16D0h.css → NcRadioGroupButton-qxDfssOp.css} +13 -13
- package/dist/assets/{NcRichContenteditable-Ds_cptgr.css → NcRichContenteditable-CO5ziuZO.css} +12 -12
- package/dist/assets/{NcRichText-CVy4zTPr.css → NcRichText-BpXupu1n.css} +86 -87
- package/dist/chunks/{NcActionButton-CZsSFAT4.mjs → NcActionButton-CD1Z-o2Y.mjs} +6 -6
- package/dist/chunks/{NcActionButton-CZsSFAT4.mjs.map → NcActionButton-CD1Z-o2Y.mjs.map} +1 -1
- package/dist/chunks/{NcActionButton-lJ0IA3IS.cjs → NcActionButton-DSq_luox.cjs} +6 -6
- package/dist/chunks/{NcActionButton-lJ0IA3IS.cjs.map → NcActionButton-DSq_luox.cjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-CIvAeDpU.mjs → NcActionButtonGroup-Bd-SOAHU.mjs} +3 -3
- package/dist/chunks/{NcActionButtonGroup-CIvAeDpU.mjs.map → NcActionButtonGroup-Bd-SOAHU.mjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-CQZL14Nz.cjs → NcActionButtonGroup-DKVCsZhH.cjs} +3 -3
- package/dist/chunks/{NcActionButtonGroup-CQZL14Nz.cjs.map → NcActionButtonGroup-DKVCsZhH.cjs.map} +1 -1
- package/dist/chunks/{NcActionCheckbox-BAuN4ZMC.mjs → NcActionCheckbox-D9aQuEYw.mjs} +4 -4
- package/dist/chunks/{NcActionCheckbox-BAuN4ZMC.mjs.map → NcActionCheckbox-D9aQuEYw.mjs.map} +1 -1
- package/dist/chunks/{NcActionCheckbox-BvMmq0jL.cjs → NcActionCheckbox-ixZtnZR4.cjs} +4 -4
- package/dist/chunks/{NcActionCheckbox-BvMmq0jL.cjs.map → NcActionCheckbox-ixZtnZR4.cjs.map} +1 -1
- package/dist/chunks/{NcActionInput-DfjLV0Gg.cjs → NcActionInput-BMUreHhp.cjs} +10 -10
- package/dist/chunks/{NcActionInput-DfjLV0Gg.cjs.map → NcActionInput-BMUreHhp.cjs.map} +1 -1
- package/dist/chunks/{NcActionInput-CfznemNH.mjs → NcActionInput-D4MLI-0P.mjs} +10 -10
- package/dist/chunks/{NcActionInput-CfznemNH.mjs.map → NcActionInput-D4MLI-0P.mjs.map} +1 -1
- package/dist/chunks/{NcActionRadio-Bg5VuF7I.mjs → NcActionRadio-BmVR-lhZ.mjs} +4 -4
- package/dist/chunks/{NcActionRadio-CBh6AlC4.cjs.map → NcActionRadio-BmVR-lhZ.mjs.map} +1 -1
- package/dist/chunks/{NcActionRadio-CBh6AlC4.cjs → NcActionRadio-DPF0_wH9.cjs} +4 -4
- package/dist/chunks/{NcActionRadio-Bg5VuF7I.mjs.map → NcActionRadio-DPF0_wH9.cjs.map} +1 -1
- package/dist/chunks/{NcActionTextEditable-CSP4OjpU.mjs → NcActionTextEditable-5mNFl7Jm.mjs} +7 -7
- package/dist/chunks/{NcActionTextEditable-CSP4OjpU.mjs.map → NcActionTextEditable-5mNFl7Jm.mjs.map} +1 -1
- package/dist/chunks/{NcActionTextEditable-BhucWrOO.cjs → NcActionTextEditable-C8B1qqqe.cjs} +7 -7
- package/dist/chunks/NcActionTextEditable-C8B1qqqe.cjs.map +1 -0
- package/dist/chunks/{NcActions-A918mfXE.mjs → NcActions-BvFVkIzX.mjs} +64 -82
- package/dist/chunks/{NcActions-A918mfXE.mjs.map → NcActions-BvFVkIzX.mjs.map} +1 -1
- package/dist/chunks/{NcActions-D3N_As6c.cjs → NcActions-CF9VxHHD.cjs} +64 -82
- package/dist/chunks/{NcActions-D3N_As6c.cjs.map → NcActions-CF9VxHHD.cjs.map} +1 -1
- package/dist/chunks/{NcAppContent-CCyPMvUa.cjs → NcAppContent-BSyhjn2J.cjs} +23 -24
- package/dist/chunks/NcAppContent-BSyhjn2J.cjs.map +1 -0
- package/dist/chunks/{NcAppContent-DFlcxER-.mjs → NcAppContent-C7hwN-sU.mjs} +23 -24
- package/dist/chunks/NcAppContent-C7hwN-sU.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigation-CLF6-i2t.mjs → NcAppNavigation-B2cKVKBH.mjs} +4 -5
- package/dist/chunks/{NcAppNavigation-CLF6-i2t.mjs.map → NcAppNavigation-B2cKVKBH.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-CCHYn0D6.cjs → NcAppNavigation-DApCpI_F.cjs} +4 -5
- package/dist/chunks/{NcAppNavigation-CCHYn0D6.cjs.map → NcAppNavigation-DApCpI_F.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-DhW300oH.cjs → NcAppNavigationCaption-BOHmVyQb.cjs} +3 -3
- package/dist/chunks/{NcAppNavigationCaption-DhW300oH.cjs.map → NcAppNavigationCaption-BOHmVyQb.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-CsG8P-1P.mjs → NcAppNavigationCaption-bTauZtcw.mjs} +3 -3
- package/dist/chunks/{NcAppNavigationCaption-CsG8P-1P.mjs.map → NcAppNavigationCaption-bTauZtcw.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-HZVy5JEa.cjs → NcAppNavigationItem-DbtR6u7Y.cjs} +10 -10
- package/dist/chunks/{NcAppNavigationItem-CwuKVEUN.mjs.map → NcAppNavigationItem-DbtR6u7Y.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-CwuKVEUN.mjs → NcAppNavigationItem-geCwhCsd.mjs} +10 -10
- package/dist/chunks/{NcAppNavigationItem-HZVy5JEa.cjs.map → NcAppNavigationItem-geCwhCsd.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNew-DbqusDUV.mjs → NcAppNavigationNew-BHzvRlVc.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationNew-DbqusDUV.mjs.map → NcAppNavigationNew-BHzvRlVc.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNew-T56pahiu.cjs → NcAppNavigationNew-BYvFykgl.cjs} +2 -2
- package/dist/chunks/{NcAppNavigationNew-T56pahiu.cjs.map → NcAppNavigationNew-BYvFykgl.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-DMRZwa_y.cjs → NcAppNavigationNewItem-Dqnwa8Gl.cjs} +4 -4
- package/dist/chunks/{NcAppNavigationNewItem-DMRZwa_y.cjs.map → NcAppNavigationNewItem-Dqnwa8Gl.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-BsnZWCLW.mjs → NcAppNavigationNewItem-Yy56yPrn.mjs} +4 -4
- package/dist/chunks/{NcAppNavigationNewItem-BsnZWCLW.mjs.map → NcAppNavigationNewItem-Yy56yPrn.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-DCMN2cWp.mjs → NcAppNavigationSearch-WfL4IPD8.mjs} +6 -10
- package/dist/chunks/{NcAppNavigationSearch-DCMN2cWp.mjs.map → NcAppNavigationSearch-WfL4IPD8.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-BlG1xMok.cjs → NcAppNavigationSearch-pMlFjm9w.cjs} +6 -10
- package/dist/chunks/{NcAppNavigationSearch-BlG1xMok.cjs.map → NcAppNavigationSearch-pMlFjm9w.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-n8OaxTbE.mjs → NcAppNavigationSettings-BhK7vlfP.mjs} +17 -11
- package/dist/chunks/NcAppNavigationSettings-BhK7vlfP.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationSettings-DlIDzhxh.cjs → NcAppNavigationSettings-C6qjJ3hF.cjs} +17 -11
- package/dist/chunks/NcAppNavigationSettings-C6qjJ3hF.cjs.map +1 -0
- package/dist/chunks/{NcAppNavigationToggle-Cn1UvxNP.cjs → NcAppNavigationToggle-8lSuagjd.cjs} +13 -14
- package/dist/chunks/{NcAppNavigationToggle-Cn1UvxNP.cjs.map → NcAppNavigationToggle-8lSuagjd.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-ClYKr8Zn.mjs → NcAppNavigationToggle-DlnxjlcH.mjs} +13 -14
- package/dist/chunks/{NcAppNavigationToggle-ClYKr8Zn.mjs.map → NcAppNavigationToggle-DlnxjlcH.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-R6Y-tl6d.cjs → NcAppSettingsDialog--RlMIfbo.cjs} +26 -28
- package/dist/chunks/NcAppSettingsDialog--RlMIfbo.cjs.map +1 -0
- package/dist/chunks/{NcAppSettingsDialog-Cpjr8Tca.mjs → NcAppSettingsDialog-8YaW7ud3.mjs} +27 -29
- package/dist/chunks/NcAppSettingsDialog-8YaW7ud3.mjs.map +1 -0
- package/dist/chunks/NcAppSettingsSection-DVrBPuLD.mjs +53 -0
- package/dist/chunks/NcAppSettingsSection-DVrBPuLD.mjs.map +1 -0
- package/dist/chunks/NcAppSettingsSection-OPWPqi2Y.cjs +52 -0
- package/dist/chunks/NcAppSettingsSection-OPWPqi2Y.cjs.map +1 -0
- package/dist/chunks/NcAppSettingsSectionShortcuts-CBYgfYGz.cjs +42 -0
- package/dist/chunks/NcAppSettingsSectionShortcuts-CBYgfYGz.cjs.map +1 -0
- package/dist/chunks/NcAppSettingsSectionShortcuts-CdP-4ktS.mjs +43 -0
- package/dist/chunks/NcAppSettingsSectionShortcuts-CdP-4ktS.mjs.map +1 -0
- package/dist/chunks/{NcAppSidebar-Ddt82bsA.cjs → NcAppSidebar-DLb6ALHL.cjs} +15 -18
- package/dist/chunks/{NcAppSidebar-Ddt82bsA.cjs.map → NcAppSidebar-DLb6ALHL.cjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-CVcOP4bk.mjs → NcAppSidebar-f7tuofzM.mjs} +15 -18
- package/dist/chunks/{NcAppSidebar-CVcOP4bk.mjs.map → NcAppSidebar-f7tuofzM.mjs.map} +1 -1
- package/dist/chunks/{NcAssistantButton-WQvWhoAr.cjs → NcAssistantButton-BMzPE7WA.cjs} +4 -4
- package/dist/chunks/{NcAssistantButton-WQvWhoAr.cjs.map → NcAssistantButton-BMzPE7WA.cjs.map} +1 -1
- package/dist/chunks/{NcAssistantButton-lDdWOemf.mjs → NcAssistantButton-enexPvoC.mjs} +4 -4
- package/dist/chunks/{NcAssistantButton-lDdWOemf.mjs.map → NcAssistantButton-enexPvoC.mjs.map} +1 -1
- package/dist/chunks/{NcAssistantIcon-RDQ8YhZE.cjs → NcAssistantIcon-DfVd2zWt.cjs} +4 -4
- package/dist/chunks/{NcAssistantIcon-RDQ8YhZE.cjs.map → NcAssistantIcon-DfVd2zWt.cjs.map} +1 -1
- package/dist/chunks/{NcAssistantIcon-BTjYuSQ9.mjs → NcAssistantIcon-XwQFzBgA.mjs} +4 -4
- package/dist/chunks/{NcAssistantIcon-BTjYuSQ9.mjs.map → NcAssistantIcon-XwQFzBgA.mjs.map} +1 -1
- package/dist/chunks/{NcAvatar-D_0Aw88L.cjs → NcAvatar-BwioPrbY.cjs} +23 -25
- package/dist/chunks/{NcAvatar-D_0Aw88L.cjs.map → NcAvatar-BwioPrbY.cjs.map} +1 -1
- package/dist/chunks/{NcAvatar-Cupl4prm.mjs → NcAvatar-DwUmx6Fg.mjs} +23 -25
- package/dist/chunks/{NcAvatar-Cupl4prm.mjs.map → NcAvatar-DwUmx6Fg.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-FbePEaGS.cjs → NcBreadcrumb-B-zWjBNp.cjs} +6 -22
- package/dist/chunks/{NcBreadcrumb-FbePEaGS.cjs.map → NcBreadcrumb-B-zWjBNp.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-VJGW992x.mjs → NcBreadcrumb-ljdZbX7p.mjs} +6 -22
- package/dist/chunks/{NcBreadcrumb-VJGW992x.mjs.map → NcBreadcrumb-ljdZbX7p.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-CrNBCyUa.cjs → NcBreadcrumbs-B6tPEu9b.cjs} +29 -47
- package/dist/chunks/{NcBreadcrumbs-DJSAcn8x.mjs.map → NcBreadcrumbs-B6tPEu9b.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-DJSAcn8x.mjs → NcBreadcrumbs-D2DtX3XC.mjs} +29 -47
- package/dist/chunks/{NcBreadcrumbs-CrNBCyUa.cjs.map → NcBreadcrumbs-D2DtX3XC.mjs.map} +1 -1
- package/dist/chunks/{NcButton-DK7bNZIL.cjs → NcButton-CJBZrdiL.cjs} +18 -33
- package/dist/chunks/{NcButton-D3CaJu1f.mjs.map → NcButton-CJBZrdiL.cjs.map} +1 -1
- package/dist/chunks/{NcButton-D3CaJu1f.mjs → NcButton-DUZTtFhr.mjs} +18 -33
- package/dist/chunks/{NcButton-DK7bNZIL.cjs.map → NcButton-DUZTtFhr.mjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch-ezquUuPz.mjs → NcCheckboxRadioSwitch-NPJuwzqS.mjs} +8 -8
- package/dist/chunks/{NcCheckboxRadioSwitch-ezquUuPz.mjs.map → NcCheckboxRadioSwitch-NPJuwzqS.mjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch-CDFUoj2J.cjs → NcCheckboxRadioSwitch-wSD3hWxs.cjs} +8 -8
- package/dist/chunks/{NcCheckboxRadioSwitch-CDFUoj2J.cjs.map → NcCheckboxRadioSwitch-wSD3hWxs.cjs.map} +1 -1
- package/dist/chunks/{NcCollectionList-zAI6Ysc0.cjs → NcCollectionList-Br6V_EiM.cjs} +7 -8
- package/dist/chunks/{NcCollectionList-zAI6Ysc0.cjs.map → NcCollectionList-Br6V_EiM.cjs.map} +1 -1
- package/dist/chunks/{NcCollectionList-w-7M5HGN.mjs → NcCollectionList-D85QdobI.mjs} +7 -8
- package/dist/chunks/{NcCollectionList-w-7M5HGN.mjs.map → NcCollectionList-D85QdobI.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-DpLU-oKM.mjs → NcColorPicker-BoS26yac.mjs} +15 -35
- package/dist/chunks/{NcColorPicker-DpLU-oKM.mjs.map → NcColorPicker-BoS26yac.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-F-UP8OaJ.cjs → NcColorPicker-Dg3d5_aQ.cjs} +15 -35
- package/dist/chunks/{NcColorPicker-F-UP8OaJ.cjs.map → NcColorPicker-Dg3d5_aQ.cjs.map} +1 -1
- package/dist/chunks/{NcContent-DITvuNbF.cjs → NcContent-BbPae-OV.cjs} +5 -5
- package/dist/chunks/{NcContent-DITvuNbF.cjs.map → NcContent-BbPae-OV.cjs.map} +1 -1
- package/dist/chunks/{NcContent-C0_AA_wt.mjs → NcContent-D8OFKv52.mjs} +5 -5
- package/dist/chunks/{NcContent-C0_AA_wt.mjs.map → NcContent-D8OFKv52.mjs.map} +1 -1
- package/dist/chunks/{NcCounterBubble-B_H3NCef.cjs → NcCounterBubble-hyvazclA.cjs} +4 -6
- package/dist/chunks/{NcCounterBubble-B_H3NCef.cjs.map → NcCounterBubble-hyvazclA.cjs.map} +1 -1
- package/dist/chunks/{NcCounterBubble-BKPpoBiy.mjs → NcCounterBubble-oxV8oMlX.mjs} +4 -6
- package/dist/chunks/{NcCounterBubble-BKPpoBiy.mjs.map → NcCounterBubble-oxV8oMlX.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-CEL-DhKX.mjs → NcDashboardWidget-SSlGHcII.mjs} +5 -5
- package/dist/chunks/{NcDashboardWidget-CEL-DhKX.mjs.map → NcDashboardWidget-SSlGHcII.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget--n1nzfhg.cjs → NcDashboardWidget-mEPmvuR0.cjs} +5 -5
- package/dist/chunks/{NcDashboardWidget--n1nzfhg.cjs.map → NcDashboardWidget-mEPmvuR0.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-DeQtScn8.mjs → NcDashboardWidgetItem-BqlNJI6a.mjs} +4 -4
- package/dist/chunks/{NcDashboardWidgetItem-DeQtScn8.mjs.map → NcDashboardWidgetItem-BqlNJI6a.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-loanO02A.cjs → NcDashboardWidgetItem-C7AmqxH4.cjs} +4 -4
- package/dist/chunks/{NcDashboardWidgetItem-loanO02A.cjs.map → NcDashboardWidgetItem-C7AmqxH4.cjs.map} +1 -1
- package/dist/chunks/{NcDialog-BM_wTqUn.mjs → NcDialog-Bg0hY6TP.mjs} +3 -3
- package/dist/chunks/{NcDialog-BM_wTqUn.mjs.map → NcDialog-Bg0hY6TP.mjs.map} +1 -1
- package/dist/chunks/{NcDialog-CG2sufkb.cjs → NcDialog-D020rlVy.cjs} +3 -3
- package/dist/chunks/{NcDialog-CG2sufkb.cjs.map → NcDialog-D020rlVy.cjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-DkfxsIhv.cjs → NcDialogButton-8JhFaC5X.cjs} +6 -7
- package/dist/chunks/{NcDialogButton-DkfxsIhv.cjs.map → NcDialogButton-8JhFaC5X.cjs.map} +1 -1
- package/dist/chunks/{NcDialogButton-Cr0wVMne.mjs → NcDialogButton-DSrC6lFd.mjs} +6 -7
- package/dist/chunks/{NcDialogButton-Cr0wVMne.mjs.map → NcDialogButton-DSrC6lFd.mjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-BV_iVlIv.mjs → NcEmojiPicker-CAphjgaf.mjs} +12 -13
- package/dist/chunks/{NcEmojiPicker-BV_iVlIv.mjs.map → NcEmojiPicker-CAphjgaf.mjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-fgsuVz7X.cjs → NcEmojiPicker-DwXhWYHY.cjs} +12 -13
- package/dist/chunks/{NcEmojiPicker-fgsuVz7X.cjs.map → NcEmojiPicker-DwXhWYHY.cjs.map} +1 -1
- package/dist/chunks/{NcHeaderButton-CNQVz4QP.cjs → NcHeaderButton-6kuTEKbj.cjs} +4 -4
- package/dist/chunks/{NcHeaderButton-CNQVz4QP.cjs.map → NcHeaderButton-6kuTEKbj.cjs.map} +1 -1
- package/dist/chunks/{NcHeaderButton-TJML067P.mjs → NcHeaderButton-TgPjfPtk.mjs} +4 -4
- package/dist/chunks/{NcHeaderButton-TJML067P.mjs.map → NcHeaderButton-TgPjfPtk.mjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-BzyFhg55.cjs → NcHeaderMenu-CwjH_j0c.cjs} +10 -12
- package/dist/chunks/{NcHeaderMenu-D5ddiKnF.mjs.map → NcHeaderMenu-CwjH_j0c.cjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-D5ddiKnF.mjs → NcHeaderMenu-Hk8OTuma.mjs} +10 -12
- package/dist/chunks/{NcHeaderMenu-BzyFhg55.cjs.map → NcHeaderMenu-Hk8OTuma.mjs.map} +1 -1
- package/dist/chunks/NcHotkey-BVMf1V89.mjs +60 -0
- package/dist/chunks/NcHotkey-BVMf1V89.mjs.map +1 -0
- package/dist/chunks/NcHotkey-CUPH5u09.cjs +59 -0
- package/dist/chunks/NcHotkey-CUPH5u09.cjs.map +1 -0
- package/dist/chunks/NcHotkeyList-CUjp1-hr.cjs +47 -0
- package/dist/chunks/NcHotkeyList-CUjp1-hr.cjs.map +1 -0
- package/dist/chunks/NcHotkeyList-jfSroQAQ.mjs +48 -0
- package/dist/chunks/NcHotkeyList-jfSroQAQ.mjs.map +1 -0
- package/dist/chunks/{NcIconSvgWrapper-BCVwmZN2.mjs → NcIconSvgWrapper-BreCg8pX.mjs} +2 -2
- package/dist/chunks/{NcIconSvgWrapper-BCVwmZN2.mjs.map → NcIconSvgWrapper-BreCg8pX.mjs.map} +1 -1
- package/dist/chunks/{NcIconSvgWrapper-DoVPfeNg.cjs → NcIconSvgWrapper-D-aKMbf3.cjs} +2 -2
- package/dist/chunks/{NcIconSvgWrapper-DoVPfeNg.cjs.map → NcIconSvgWrapper-D-aKMbf3.cjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-DVVTaxWi.cjs → NcInputConfirmCancel-Bk_FQ5aA.cjs} +3 -3
- package/dist/chunks/{NcInputConfirmCancel-DVVTaxWi.cjs.map → NcInputConfirmCancel-Bk_FQ5aA.cjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-C8WnMK2V.mjs → NcInputConfirmCancel-XPlRewAN.mjs} +3 -3
- package/dist/chunks/{NcInputConfirmCancel-C8WnMK2V.mjs.map → NcInputConfirmCancel-XPlRewAN.mjs.map} +1 -1
- package/dist/chunks/{NcInputField-LBv3nCrt.cjs → NcInputField-DAllLk3X.cjs} +12 -16
- package/dist/chunks/NcInputField-DAllLk3X.cjs.map +1 -0
- package/dist/chunks/{NcInputField-1ujONIvp.mjs → NcInputField-DUtDY_1I.mjs} +12 -16
- package/dist/chunks/NcInputField-DUtDY_1I.mjs.map +1 -0
- package/dist/chunks/NcKbd-BdW5UbhW.mjs +66 -0
- package/dist/chunks/NcKbd-BdW5UbhW.mjs.map +1 -0
- package/dist/chunks/NcKbd-CVBh8nyU.cjs +65 -0
- package/dist/chunks/NcKbd-CVBh8nyU.cjs.map +1 -0
- package/dist/chunks/{NcListItem-DFEvD1TA.cjs → NcListItem-D3HiK7ra.cjs} +7 -9
- package/dist/chunks/{NcListItem-DFEvD1TA.cjs.map → NcListItem-D3HiK7ra.cjs.map} +1 -1
- package/dist/chunks/{NcListItem-DNMfT12A.mjs → NcListItem-YVemqwZ_.mjs} +7 -9
- package/dist/chunks/{NcListItem-DNMfT12A.mjs.map → NcListItem-YVemqwZ_.mjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-PNp6Wael.mjs → NcListItemIcon-BKwmcXnO.mjs} +5 -6
- package/dist/chunks/{NcListItemIcon-PNp6Wael.mjs.map → NcListItemIcon-BKwmcXnO.mjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-OzD38-2R.cjs → NcListItemIcon-DL1VwHvL.cjs} +5 -6
- package/dist/chunks/{NcListItemIcon-OzD38-2R.cjs.map → NcListItemIcon-DL1VwHvL.cjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-lqTDeja4.cjs → NcPasswordField-BeEYmL5N.cjs} +16 -29
- package/dist/chunks/{NcPasswordField-lqTDeja4.cjs.map → NcPasswordField-BeEYmL5N.cjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-D2iDTTpp.mjs → NcPasswordField-CujpFQHq.mjs} +16 -29
- package/dist/chunks/{NcPasswordField-D2iDTTpp.mjs.map → NcPasswordField-CujpFQHq.mjs.map} +1 -1
- package/dist/chunks/{NcPopover-DrXnNOgM.cjs → NcPopover-BgUZkmjk.cjs} +8 -12
- package/dist/chunks/{NcPopover-nzbq2IjT.mjs.map → NcPopover-BgUZkmjk.cjs.map} +1 -1
- package/dist/chunks/{NcPopover-nzbq2IjT.mjs → NcPopover-gxcAqoEb.mjs} +8 -12
- package/dist/chunks/{NcPopover-DrXnNOgM.cjs.map → NcPopover-gxcAqoEb.mjs.map} +1 -1
- package/dist/chunks/{NcProgressBar-BwnuvxiZ.mjs → NcProgressBar-D7zYeXBH.mjs} +2 -2
- package/dist/chunks/{NcProgressBar-BwnuvxiZ.mjs.map → NcProgressBar-D7zYeXBH.mjs.map} +1 -1
- package/dist/chunks/{NcProgressBar-D10gQgAY.cjs → NcProgressBar-DvxA9bq5.cjs} +2 -2
- package/dist/chunks/{NcProgressBar-D10gQgAY.cjs.map → NcProgressBar-DvxA9bq5.cjs.map} +1 -1
- package/dist/chunks/{NcRadioGroup-DsnIVQZJ.cjs → NcRadioGroup-BZ-humrK.cjs} +5 -23
- package/dist/chunks/{NcRadioGroup-sZaH_3Y0.mjs.map → NcRadioGroup-BZ-humrK.cjs.map} +1 -1
- package/dist/chunks/{NcRadioGroup-sZaH_3Y0.mjs → NcRadioGroup-VKZJ0Vnh.mjs} +5 -23
- package/dist/chunks/{NcRadioGroup-DsnIVQZJ.cjs.map → NcRadioGroup-VKZJ0Vnh.mjs.map} +1 -1
- package/dist/chunks/{NcRadioGroupButton-B6m10k9G.mjs → NcRadioGroupButton-CD4tkF_s.mjs} +9 -9
- package/dist/chunks/{NcRadioGroupButton-B6m10k9G.mjs.map → NcRadioGroupButton-CD4tkF_s.mjs.map} +1 -1
- package/dist/chunks/{NcRadioGroupButton-CDf_01-t.cjs → NcRadioGroupButton-DrqgN-8C.cjs} +9 -9
- package/dist/chunks/{NcRadioGroupButton-CDf_01-t.cjs.map → NcRadioGroupButton-DrqgN-8C.cjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-Q6jZk-Pm.mjs → NcRelatedResourcesPanel-BTyqVb_E.mjs} +35 -44
- package/dist/chunks/{NcRelatedResourcesPanel-Q6jZk-Pm.mjs.map → NcRelatedResourcesPanel-BTyqVb_E.mjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-bfv-6W_Z.cjs → NcRelatedResourcesPanel-CO6jajKF.cjs} +35 -44
- package/dist/chunks/{NcRelatedResourcesPanel-bfv-6W_Z.cjs.map → NcRelatedResourcesPanel-CO6jajKF.cjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-8_poOeSx.mjs → NcRichContenteditable-BivvoSO5.mjs} +32 -54
- package/dist/chunks/{NcRichContenteditable-8_poOeSx.mjs.map → NcRichContenteditable-BivvoSO5.mjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-CtLNSs0S.cjs → NcRichContenteditable-BjxmdpS0.cjs} +32 -54
- package/dist/chunks/{NcRichContenteditable-CtLNSs0S.cjs.map → NcRichContenteditable-BjxmdpS0.cjs.map} +1 -1
- package/dist/chunks/{NcRichText-CEsiozf5.cjs → NcRichText-DoQg3Lha.cjs} +120 -111
- package/dist/chunks/{NcRichText-CEsiozf5.cjs.map → NcRichText-DoQg3Lha.cjs.map} +1 -1
- package/dist/chunks/{NcRichText-Dnx5x9WS.mjs → NcRichText-Dy5By94Y.mjs} +120 -113
- package/dist/chunks/{NcRichText-Dnx5x9WS.mjs.map → NcRichText-Dy5By94Y.mjs.map} +1 -1
- package/dist/chunks/{NcSelect-bo6wla87.cjs → NcSelect-Bw8EG_xU.cjs} +25 -42
- package/dist/chunks/{NcSelect-bo6wla87.cjs.map → NcSelect-Bw8EG_xU.cjs.map} +1 -1
- package/dist/chunks/{NcSelect-TjZw7TJ_.mjs → NcSelect-QVd6uJPA.mjs} +25 -42
- package/dist/chunks/{NcSelect-TjZw7TJ_.mjs.map → NcSelect-QVd6uJPA.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-CytnLDOw.mjs → NcSelectTags-D-22teKJ.mjs} +28 -49
- package/dist/chunks/{NcSelectTags-D2OSaAfO.cjs.map → NcSelectTags-D-22teKJ.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-D2OSaAfO.cjs → NcSelectTags-aGwTgIM-.cjs} +28 -49
- package/dist/chunks/{NcSelectTags-CytnLDOw.mjs.map → NcSelectTags-aGwTgIM-.cjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-Bm0877Tm.mjs → NcSelectUsers-DR6-q1aK.mjs} +7 -8
- package/dist/chunks/{NcSelectUsers-Bm0877Tm.mjs.map → NcSelectUsers-DR6-q1aK.mjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-wcRyExkC.cjs → NcSelectUsers-Qhrizan5.cjs} +7 -8
- package/dist/chunks/{NcSelectUsers-wcRyExkC.cjs.map → NcSelectUsers-Qhrizan5.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-DaFMiOS6.cjs → NcSettingsInputText-O8870Grr.cjs} +4 -4
- package/dist/chunks/{NcSettingsInputText-DaFMiOS6.cjs.map → NcSettingsInputText-O8870Grr.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-DPAtsY2T.mjs → NcSettingsInputText-Q8DDr-Yj.mjs} +4 -4
- package/dist/chunks/{NcSettingsInputText-DPAtsY2T.mjs.map → NcSettingsInputText-Q8DDr-Yj.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-r4NOxKIz.cjs → NcSettingsSection-DKpzo7eI.cjs} +3 -4
- package/dist/chunks/{NcSettingsSection-r4NOxKIz.cjs.map → NcSettingsSection-DKpzo7eI.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-CX5q924g.mjs → NcSettingsSection-VxcVEF8L.mjs} +3 -4
- package/dist/chunks/{NcSettingsSection-CX5q924g.mjs.map → NcSettingsSection-VxcVEF8L.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-DYYAPkgp.cjs → NcSettingsSelectGroup-BQWwtSEb.cjs} +10 -26
- package/dist/chunks/{NcSettingsSelectGroup-DYYAPkgp.cjs.map → NcSettingsSelectGroup-BQWwtSEb.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-CR4XLrgs.mjs → NcSettingsSelectGroup-CZ0EjeJb.mjs} +10 -26
- package/dist/chunks/{NcSettingsSelectGroup-CR4XLrgs.mjs.map → NcSettingsSelectGroup-CZ0EjeJb.mjs.map} +1 -1
- package/dist/chunks/{NcTextArea-If_ygOSv.mjs → NcTextArea-DHmD6-6s.mjs} +5 -5
- package/dist/chunks/{NcTextArea-If_ygOSv.mjs.map → NcTextArea-DHmD6-6s.mjs.map} +1 -1
- package/dist/chunks/{NcTextArea-iDhGI-Ko.cjs → NcTextArea-DkVtHTpD.cjs} +5 -5
- package/dist/chunks/{NcTextArea-iDhGI-Ko.cjs.map → NcTextArea-DkVtHTpD.cjs.map} +1 -1
- package/dist/chunks/{NcTextField-OPiMgNR7.cjs → NcTextField-52Fnd27A.cjs} +17 -31
- package/dist/chunks/{NcTextField-OPiMgNR7.cjs.map → NcTextField-52Fnd27A.cjs.map} +1 -1
- package/dist/chunks/{NcTextField-BE9R1pLt.mjs → NcTextField-CVfixgfj.mjs} +17 -31
- package/dist/chunks/{NcTextField-BE9R1pLt.mjs.map → NcTextField-CVfixgfj.mjs.map} +1 -1
- package/dist/chunks/{NcThemeProvider-E_S5rhIQ.mjs → NcThemeProvider-25ResoIv.mjs} +2 -2
- package/dist/chunks/{NcThemeProvider-E_S5rhIQ.mjs.map → NcThemeProvider-25ResoIv.mjs.map} +1 -1
- package/dist/chunks/{NcThemeProvider-DbNRSwkX.cjs → NcThemeProvider-BqGPTeWg.cjs} +2 -2
- package/dist/chunks/{NcThemeProvider-DbNRSwkX.cjs.map → NcThemeProvider-BqGPTeWg.cjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-D4y736xC.mjs → NcTimezonePicker-BInLNCSt.mjs} +6 -6
- package/dist/chunks/{NcTimezonePicker-D4y736xC.mjs.map → NcTimezonePicker-BInLNCSt.mjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-DPpWz5fa.cjs → NcTimezonePicker-CtFsF-jG.cjs} +6 -6
- package/dist/chunks/{NcTimezonePicker-DPpWz5fa.cjs.map → NcTimezonePicker-CtFsF-jG.cjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-Bb9WBP1S.cjs → NcUserBubble-ByvVV8jh.cjs} +6 -7
- package/dist/chunks/{NcUserBubble-Bb9WBP1S.cjs.map → NcUserBubble-ByvVV8jh.cjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-8Mts76ii.mjs → NcUserBubble-sIUM-Rru.mjs} +6 -7
- package/dist/chunks/{NcUserBubble-8Mts76ii.mjs.map → NcUserBubble-sIUM-Rru.mjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-DV2H-KfR.cjs → NcUserStatusIcon-CYsrjxDh.cjs} +9 -12
- package/dist/chunks/{NcUserStatusIcon-DV2H-KfR.cjs.map → NcUserStatusIcon-CYsrjxDh.cjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-BWxo_etm.mjs → NcUserStatusIcon-DZI9jlXE.mjs} +9 -12
- package/dist/chunks/{NcUserStatusIcon-BWxo_etm.mjs.map → NcUserStatusIcon-DZI9jlXE.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-CDX-s-IV.cjs → ScopeComponent-BCznIxFT.cjs} +2 -2
- package/dist/chunks/{ScopeComponent-CDX-s-IV.cjs.map → ScopeComponent-BCznIxFT.cjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-DsONbC6w.mjs → ScopeComponent-CNZ_b7IG.mjs} +2 -2
- package/dist/chunks/{ScopeComponent-DsONbC6w.mjs.map → ScopeComponent-CNZ_b7IG.mjs.map} +1 -1
- package/dist/chunks/{_l10n-DSLCwJSN.mjs → _l10n-BWisB7-O.mjs} +43 -43
- package/dist/chunks/_l10n-BWisB7-O.mjs.map +1 -0
- package/dist/chunks/{_l10n-9b4TMo5Q.cjs → _l10n-eOBJ3Dwl.cjs} +24 -24
- package/dist/chunks/{_l10n-9b4TMo5Q.cjs.map → _l10n-eOBJ3Dwl.cjs.map} +1 -1
- package/dist/chunks/{actionText-ZM1k96ts.mjs → actionText-BMig9Egt.mjs} +2 -2
- package/dist/chunks/{actionText-ZM1k96ts.mjs.map → actionText-BMig9Egt.mjs.map} +1 -1
- package/dist/chunks/{actionText-D_3-6fCH.cjs → actionText-D2-z0ud3.cjs} +2 -2
- package/dist/chunks/{actionText-D_3-6fCH.cjs.map → actionText-D2-z0ud3.cjs.map} +1 -1
- package/dist/chunks/{colors-DcbJ13is.cjs → colors-BsDQ1Yz3.cjs} +4 -4
- package/dist/chunks/{colors-DcbJ13is.cjs.map → colors-BsDQ1Yz3.cjs.map} +1 -1
- package/dist/chunks/{colors-BMiIMYXK.mjs → colors-D3xlq-id.mjs} +4 -4
- package/dist/chunks/{colors-BMiIMYXK.mjs.map → colors-D3xlq-id.mjs.map} +1 -1
- package/dist/chunks/createElementId-DhjFt1I9.mjs +8 -0
- package/dist/chunks/{createElementId-5skgwxOP.mjs.map → createElementId-DhjFt1I9.mjs.map} +1 -1
- package/dist/chunks/createElementId-lalylSCf.cjs +7 -0
- package/dist/chunks/{createElementId-DaJhnLzq.cjs.map → createElementId-lalylSCf.cjs.map} +1 -1
- package/dist/chunks/{customPickerElements-BPROmh4T.mjs → customPickerElements-DLFtgReB.mjs} +21 -43
- package/dist/chunks/{customPickerElements-BPROmh4T.mjs.map → customPickerElements-DLFtgReB.mjs.map} +1 -1
- package/dist/chunks/{customPickerElements-DBEOrbce.cjs → customPickerElements-GyIIOHiQ.cjs} +21 -43
- package/dist/chunks/{customPickerElements-DBEOrbce.cjs.map → customPickerElements-GyIIOHiQ.cjs.map} +1 -1
- package/dist/chunks/{emoji-V6ytyzoR.mjs → emoji-BY_D0V5K.mjs} +3 -4
- package/dist/chunks/{emoji-V6ytyzoR.mjs.map → emoji-BY_D0V5K.mjs.map} +1 -1
- package/dist/chunks/{emoji-BCCCB3t3.cjs → emoji-VgSjNTd5.cjs} +3 -4
- package/dist/chunks/{emoji-BCCCB3t3.cjs.map → emoji-VgSjNTd5.cjs.map} +1 -1
- package/dist/chunks/{focusTrap-DhhUL4JZ.cjs → focusTrap-DUTqW_IG.cjs} +2 -3
- package/dist/chunks/{focusTrap-BibOtksr.mjs.map → focusTrap-DUTqW_IG.cjs.map} +1 -1
- package/dist/chunks/{focusTrap-BibOtksr.mjs → focusTrap-HJQ4pqHV.mjs} +2 -3
- package/dist/chunks/{focusTrap-DhhUL4JZ.cjs.map → focusTrap-HJQ4pqHV.mjs.map} +1 -1
- package/dist/chunks/getAvatarUrl-Du9Y3cPO.cjs +14 -0
- package/dist/chunks/{getAvatarUrl-DwWyuiUZ.cjs.map → getAvatarUrl-Du9Y3cPO.cjs.map} +1 -1
- package/dist/chunks/getAvatarUrl-IhLacDEr.mjs +15 -0
- package/dist/chunks/{getAvatarUrl-C8Q41hfR.mjs.map → getAvatarUrl-IhLacDEr.mjs.map} +1 -1
- package/dist/chunks/{index-D_jGr37E.cjs → index-CgkN1xho.cjs} +9 -9
- package/dist/chunks/{index-D_jGr37E.cjs.map → index-CgkN1xho.cjs.map} +1 -1
- package/dist/chunks/{index-JArK0Dbx.mjs → index-CxTT94_h.mjs} +4 -22
- package/dist/chunks/{index-JArK0Dbx.mjs.map → index-CxTT94_h.mjs.map} +1 -1
- package/dist/chunks/{index-CmwBGDjr.cjs → index-Dr9k4hIP.cjs} +4 -22
- package/dist/chunks/{index-CmwBGDjr.cjs.map → index-Dr9k4hIP.cjs.map} +1 -1
- package/dist/chunks/{index-BsEMR4S4.mjs → index-TmAR7I2T.mjs} +9 -9
- package/dist/chunks/{index-BsEMR4S4.mjs.map → index-TmAR7I2T.mjs.map} +1 -1
- package/dist/chunks/legacy-KBXhWdRy.cjs +5 -0
- package/dist/chunks/{legacy-NU_qxPFK.mjs.map → legacy-KBXhWdRy.cjs.map} +1 -1
- package/dist/chunks/legacy-MK4GvP26.mjs +6 -0
- package/dist/chunks/{legacy-DUgfmdiS.cjs.map → legacy-MK4GvP26.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-DpJUQ5fq.mjs → referencePickerModal-Cl3fIc9s.mjs} +34 -65
- package/dist/chunks/{referencePickerModal-DpJUQ5fq.mjs.map → referencePickerModal-Cl3fIc9s.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-CusxgEsK.cjs → referencePickerModal-Dz1h1EHq.cjs} +34 -65
- package/dist/chunks/{referencePickerModal-CusxgEsK.cjs.map → referencePickerModal-Dz1h1EHq.cjs.map} +1 -1
- package/dist/chunks/useAppSettingsDialog-CPqmms-u.cjs.map +1 -1
- package/dist/chunks/useAppSettingsDialog-Dn48dw1k.mjs.map +1 -1
- package/dist/chunks/{useModelMigration-HPf30klj.cjs → useModelMigration-D5zhrNXr.cjs} +2 -2
- package/dist/chunks/{useModelMigration-HPf30klj.cjs.map → useModelMigration-D5zhrNXr.cjs.map} +1 -1
- package/dist/chunks/{useModelMigration-DBUi8saj.mjs → useModelMigration-EhAWvqDD.mjs} +2 -2
- package/dist/chunks/{useModelMigration-DBUi8saj.mjs.map → useModelMigration-EhAWvqDD.mjs.map} +1 -1
- package/dist/chunks/{useTrapStackControl-2gEo3rvr.mjs → useTrapStackControl-BnLfCgGU.mjs} +2 -2
- package/dist/chunks/{useTrapStackControl-2gEo3rvr.mjs.map → useTrapStackControl-BnLfCgGU.mjs.map} +1 -1
- package/dist/chunks/{useTrapStackControl-dthvITlQ.cjs → useTrapStackControl-XYABY64G.cjs} +2 -2
- package/dist/chunks/{useTrapStackControl-dthvITlQ.cjs.map → useTrapStackControl-XYABY64G.cjs.map} +1 -1
- package/dist/components/NcAppSettingsDialog/useAppSettingsDialog.d.ts +3 -2
- package/dist/components/NcAppSettingsSection/index.d.ts +5 -0
- package/dist/components/NcAppSettingsSectionShortcuts/index.d.ts +1 -0
- package/dist/components/NcHotkey/index.d.ts +1 -0
- package/dist/components/NcHotkeyList/index.d.ts +1 -0
- package/dist/index.cjs +74 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +76 -67
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -12
- package/dist/assets/NcAppNavigationSettings-1YRzh-xl.css +0 -74
- package/dist/chunks/NcActionTextEditable-BhucWrOO.cjs.map +0 -1
- package/dist/chunks/NcAppContent-CCyPMvUa.cjs.map +0 -1
- package/dist/chunks/NcAppContent-DFlcxER-.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationSettings-DlIDzhxh.cjs.map +0 -1
- package/dist/chunks/NcAppNavigationSettings-n8OaxTbE.mjs.map +0 -1
- package/dist/chunks/NcAppSettingsDialog-Cpjr8Tca.mjs.map +0 -1
- package/dist/chunks/NcAppSettingsDialog-R6Y-tl6d.cjs.map +0 -1
- package/dist/chunks/NcAppSettingsSection-BNVlt4g0.mjs +0 -88
- package/dist/chunks/NcAppSettingsSection-BNVlt4g0.mjs.map +0 -1
- package/dist/chunks/NcAppSettingsSection-CTqViPnP.cjs +0 -87
- package/dist/chunks/NcAppSettingsSection-CTqViPnP.cjs.map +0 -1
- package/dist/chunks/NcInputField-1ujONIvp.mjs.map +0 -1
- package/dist/chunks/NcInputField-LBv3nCrt.cjs.map +0 -1
- package/dist/chunks/_l10n-DSLCwJSN.mjs.map +0 -1
- package/dist/chunks/createElementId-5skgwxOP.mjs +0 -9
- package/dist/chunks/createElementId-DaJhnLzq.cjs +0 -8
- package/dist/chunks/getAvatarUrl-C8Q41hfR.mjs +0 -16
- package/dist/chunks/getAvatarUrl-DwWyuiUZ.cjs +0 -15
- package/dist/chunks/legacy-DUgfmdiS.cjs +0 -6
- package/dist/chunks/legacy-NU_qxPFK.mjs +0 -7
|
@@ -1,33 +1,14 @@
|
|
|
1
1
|
require('../assets/NcPasswordField-mhXQk8aT.css');
|
|
2
2
|
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
|
-
var __spreadValues = (a, b) => {
|
|
11
|
-
for (var prop in b || (b = {}))
|
|
12
|
-
if (__hasOwnProp.call(b, prop))
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
22
3
|
const axios = require("@nextcloud/axios");
|
|
23
4
|
const initialState = require("@nextcloud/initial-state");
|
|
24
5
|
const router = require("@nextcloud/router");
|
|
25
6
|
const core = require("@vueuse/core");
|
|
26
7
|
const debounce = require("debounce");
|
|
27
8
|
const _pluginVue2_normalizer = require("./_plugin-vue2_normalizer-V0q-tHlQ.cjs");
|
|
28
|
-
const NcInputField = require("./NcInputField-
|
|
29
|
-
const useModelMigration = require("./useModelMigration-
|
|
30
|
-
const _l10n = require("./_l10n-
|
|
9
|
+
const NcInputField = require("./NcInputField-DAllLk3X.cjs");
|
|
10
|
+
const useModelMigration = require("./useModelMigration-D5zhrNXr.cjs");
|
|
11
|
+
const _l10n = require("./_l10n-eOBJ3Dwl.cjs");
|
|
31
12
|
const logger = require("./logger-3HuiEIF6.cjs");
|
|
32
13
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
33
14
|
const axios__default = /* @__PURE__ */ _interopDefault(axios);
|
|
@@ -114,14 +95,15 @@ const _sfc_main = {
|
|
|
114
95
|
prop: "modelValue",
|
|
115
96
|
event: "update:modelValue"
|
|
116
97
|
},
|
|
117
|
-
props:
|
|
98
|
+
props: {
|
|
118
99
|
/**
|
|
119
100
|
* Any [NcInputField](#/Components/NcFields?id=ncinputfield) props
|
|
120
101
|
*/
|
|
121
102
|
// Not an actual prop but needed to show in vue-styleguidist docs
|
|
122
103
|
// eslint-disable-next-line
|
|
123
|
-
" ": {}
|
|
124
|
-
|
|
104
|
+
" ": {},
|
|
105
|
+
// Reuse all the props from NcInputField for better typing and documentation
|
|
106
|
+
...NcInputField.NcInputField.props,
|
|
125
107
|
// Redefined props
|
|
126
108
|
/**
|
|
127
109
|
* Controls whether to display the trailing button.
|
|
@@ -182,7 +164,7 @@ const _sfc_main = {
|
|
|
182
164
|
type: Boolean,
|
|
183
165
|
default: false
|
|
184
166
|
}
|
|
185
|
-
}
|
|
167
|
+
},
|
|
186
168
|
emits: [
|
|
187
169
|
"valid",
|
|
188
170
|
"invalid",
|
|
@@ -239,14 +221,19 @@ const _sfc_main = {
|
|
|
239
221
|
rules() {
|
|
240
222
|
const { minlength } = this;
|
|
241
223
|
return {
|
|
242
|
-
minlength: minlength
|
|
224
|
+
minlength: minlength ?? passwordPolicy?.minLength
|
|
243
225
|
};
|
|
244
226
|
},
|
|
245
227
|
trailingButtonLabelPassword() {
|
|
246
228
|
return this.visibility ? _l10n.t("Hide password") : _l10n.t("Show password");
|
|
247
229
|
},
|
|
248
230
|
propsAndAttrsToForward() {
|
|
249
|
-
return
|
|
231
|
+
return {
|
|
232
|
+
// Proxy all the HTML attributes
|
|
233
|
+
...this.$attrs,
|
|
234
|
+
// Proxy original NcInputField's props
|
|
235
|
+
...Object.fromEntries(Object.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)))
|
|
236
|
+
};
|
|
250
237
|
}
|
|
251
238
|
},
|
|
252
239
|
watch: {
|
|
@@ -320,4 +307,4 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
|
320
307
|
);
|
|
321
308
|
const NcPasswordField = __component__.exports;
|
|
322
309
|
exports.NcPasswordField = NcPasswordField;
|
|
323
|
-
//# sourceMappingURL=NcPasswordField-
|
|
310
|
+
//# sourceMappingURL=NcPasswordField-BeEYmL5N.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcPasswordField-lqTDeja4.cjs","sources":["../../node_modules/vue-material-design-icons/Eye.vue","../../node_modules/vue-material-design-icons/EyeOff.vue","../../src/components/NcPasswordField/NcPasswordField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-off-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeOffIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose password field component.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcPasswordField v-model=\"text1\"\n\t\t\tlabel=\"Old password\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">New password</label>\n\t\t\t<NcPasswordField id=\"textField\"\n\t\t\t\tv-model=\"text2\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\" />\n\t\t</div>\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField2\">New password</label>\n\t\t\t<NcPasswordField id=\"textField2\"\n\t\t\t\tv-model=\"text3\"\n\t\t\t\t:error=\"true\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\thelper-text=\"Password is insecure\" />\n\t\t</div>\n\n\t\t<NcPasswordField v-model=\"text4\"\n\t\t\tlabel=\"Good new password\"\n\t\t\t:success=\"true\"\n\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\thelper-text=\"Password is secure\" />\n\n\t\t<NcPasswordField v-model=\"text5\"\n\t\t\t:disabled=\"true\"\n\t\t\tlabel=\"Disabled\" />\n\n\t\t<NcPasswordField v-model=\"text6\"\n\t\t\tlabel=\"Secret token\"\n\t\t\tas-text />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: 'hunter',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t\ttext6: 'secret-token',\n\t\t}\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField\n\t\tv-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\t:type=\"visibility || asText ? 'text' : 'password'\"\n\t\t:trailing-button-label=\"trailingButtonLabelPassword\"\n\t\t:helper-text=\"computedHelperText\"\n\t\t:error=\"computedError\"\n\t\t:success=\"computedSuccess\"\n\t\t:minlength=\"rules.minlength\"\n\t\t:input-class=\"{ 'password-field__input--secure-text': !visibility && asText }\"\n\t\tv-on=\"$listeners\"\n\t\t@trailing-button-click=\"toggleVisibility\"\n\t\t@input=\"handleInput\">\n\t\t<template v-if=\"!!$scopedSlots.icon || !!$slots.default || !!$scopedSlots.default\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- @slot Deprecated, removed in v9: use #icon slot instead. -->\n\t\t\t\t<slot />\n\t\t\t</slot>\n\t\t</template>\n\n\t\t<template #trailing-button-icon>\n\t\t\t<IconEyeOff v-if=\"visibility\" :size=\"18\" />\n\t\t\t<IconEye v-else :size=\"18\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { loadState } from '@nextcloud/initial-state'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { useVModel } from '@vueuse/core'\nimport debounce from 'debounce'\nimport IconEye from 'vue-material-design-icons/Eye.vue'\nimport IconEyeOff from 'vue-material-design-icons/EyeOff.vue'\nimport NcInputField from '../NcInputField/NcInputField.vue'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport { t } from '../../l10n.js'\nimport { logger } from '../../utils/logger.ts'\n\n/**\n * @typedef PasswordPolicy\n * @property {object} api - The URLs to the password_policy app methods\n * @property {string} api.generate - The URL to the password generator\n * @property {string} api.validate - The URL to the password validator\n * @property {boolean} enforceNonCommonPassword - Whether to enforce non common passwords\n * @property {boolean} enforceNumericCharacters - Whether to enforce numeric characters\n * @property {boolean} enforceSpecialCharacters - Whether to enforce special characters\n * @property {boolean} enforceUpperLowerCase - Whether to enforce upper and lower case\n * @property {number} minLength - The minimum length of the password\n */\n\n/** @type {PasswordPolicy|null} */\nconst passwordPolicy = loadState('core', 'capabilities', {}).password_policy || null\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcPasswordField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tIconEye,\n\t\tIconEyeOff,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\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\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t// Redefined props\n\n\t\t/**\n\t\t * Controls whether to display the trailing button.\n\t\t */\n\t\tshowTrailingButton: {\n\t\t\ttype: Boolean,\n\t\t\t// eslint-disable-next-line vue/no-boolean-default\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Removed NcInputField props, defined only by this component\n\t\t */\n\t\ttrailingButtonLabel: undefined,\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Check if the user entered a valid password using the password_policy\n\t\t * app if available.\n\t\t *\n\t\t * Warning: this doesn't replace server side checking and will do nothing\n\t\t * if the password_policy app is disabled.\n\t\t */\n\t\tcheckPasswordStrength: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The minlength property defines the minimum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tminlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * The maxlength property defines the maximum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tmaxlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Render as input[type=text] that looks like password field.\n\t\t * Allows to avoid unwanted password-specific browser behavior,\n\t\t * such as save or generate password prompt.\n\t\t * Useful for secret token fields.\n\t\t * Note: autocomplete=\"off\" is ignored by browsers.\n\t\t */\n\t\tasText: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Visibility of the password.\n\t\t * If this is set to `true` then the password will be shown to the user (input type will be set to `text`).\n\t\t */\n\t\tvisible: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'valid',\n\t\t'invalid',\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\t'update:value',\n\t\t/**\n\t\t * Triggers when the value inside the password field is\n\t\t * updated.\n\t\t *\n\t\t * @property {string} The new value\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 * Updated visibility of the password\n\t\t *\n\t\t * @property {boolean} visible the new visibility state\n\t\t */\n\t\t'update:visible',\n\t],\n\n\tsetup(props, { emit }) {\n\t\tconst model = useModelMigration('value', 'update:value')\n\t\tconst visibility = useVModel(props, 'visible', emit, { passive: true })\n\n\t\treturn {\n\t\t\tt,\n\n\t\t\tmodel,\n\t\t\tvisibility,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tinternalHelpMessage: '',\n\t\t\tisValid: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcomputedError() {\n\t\t\treturn this.error || this.isValid === false\n\t\t},\n\n\t\tcomputedSuccess() {\n\t\t\treturn this.success || this.isValid === true\n\t\t},\n\n\t\tcomputedHelperText() {\n\t\t\tif (this.helperText.length > 0) {\n\t\t\t\treturn this.helperText\n\t\t\t}\n\t\t\treturn this.internalHelpMessage\n\t\t},\n\n\t\trules() {\n\t\t\tconst { minlength } = this\n\t\t\treturn {\n\t\t\t\tminlength: minlength ?? passwordPolicy?.minLength,\n\t\t\t}\n\t\t},\n\n\t\ttrailingButtonLabelPassword() {\n\t\t\treturn this.visibility ? t('Hide password') : t('Show password')\n\t\t},\n\n\t\tpropsAndAttrsToForward() {\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(Object.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key))),\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodel(newValue) {\n\t\t\tif (this.checkPasswordStrength) {\n\t\t\t\tif (passwordPolicy === null) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.checkPassword(newValue)\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.model = event.target.value\n\t\t},\n\n\t\ttoggleVisibility() {\n\t\t\tthis.visibility = !this.visibility\n\t\t},\n\n\t\tcheckPassword: debounce(async function(password) {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.post(generateOcsUrl('apps/password_policy/api/v1/validate'), { password })\n\t\t\t\tthis.isValid = data.ocs.data.passed\n\t\t\t\tif (data.ocs.data.passed) {\n\t\t\t\t\tthis.internalHelpMessage = t('Password is secure')\n\t\t\t\t\t/**\n\t\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t\t * password entered is valid.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('valid')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.internalHelpMessage = data.ocs.data.reason\n\t\t\t\t/**\n\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t * password entered is invalid.\n\t\t\t\t */\n\t\t\t\tthis.$emit('invalid')\n\t\t\t} catch (e) {\n\t\t\t\tlogger.error('Password policy returned an error', e)\n\t\t\t}\n\t\t}, 500),\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n:deep(.password-field__input--secure-text) {\n\t// Emulate password field look\n\t// This is not a part of the standard but well supported\n\t-webkit-text-security: disc;\n}\n</style>\n"],"names":["_sfc_main","loadState","NcInputField","useModelMigration","useVModel","t","debounce","axios","generateOcsUrl","logger"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;AChBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;ACwGA,MAAA,iBAAAC,aAAAA,UAAA,QAAA,gBAAA,CAAA,CAAA,EAAA,mBAAA;AAEA,MAAA,oBAAA,IAAA,IAAA,OAAA,KAAAC,aAAAA,aAAA,KAAA,CAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAA,aAAAA;AAAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,I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,UAAA,KAAA,IAAA,KAAA;AACA,YAAA,KAAA,IAAA,KAAA,QAAA;AACA,eAAA,sBAAAH,MAAAA,EAAA,oBAAA;AAKA,eAAA,MAAA,OAAA;AACA;AAAA,QACA;AAEA,aAAA,sBAAA,KAAA,IAAA,KAAA;AAKA,aAAA,MAAA,SAAA;AAAA,MACA,SAAA,GAAA;AACAI,sBAAA,MAAA,qCAAA,CAAA;AAAA,MACA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"NcPasswordField-BeEYmL5N.cjs","sources":["../../node_modules/vue-material-design-icons/Eye.vue","../../node_modules/vue-material-design-icons/EyeOff.vue","../../src/components/NcPasswordField/NcPasswordField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-off-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeOffIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose password field component.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcPasswordField v-model=\"text1\"\n\t\t\tlabel=\"Old password\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">New password</label>\n\t\t\t<NcPasswordField id=\"textField\"\n\t\t\t\tv-model=\"text2\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\" />\n\t\t</div>\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField2\">New password</label>\n\t\t\t<NcPasswordField id=\"textField2\"\n\t\t\t\tv-model=\"text3\"\n\t\t\t\t:error=\"true\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\thelper-text=\"Password is insecure\" />\n\t\t</div>\n\n\t\t<NcPasswordField v-model=\"text4\"\n\t\t\tlabel=\"Good new password\"\n\t\t\t:success=\"true\"\n\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\thelper-text=\"Password is secure\" />\n\n\t\t<NcPasswordField v-model=\"text5\"\n\t\t\t:disabled=\"true\"\n\t\t\tlabel=\"Disabled\" />\n\n\t\t<NcPasswordField v-model=\"text6\"\n\t\t\tlabel=\"Secret token\"\n\t\t\tas-text />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: 'hunter',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t\ttext6: 'secret-token',\n\t\t}\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField\n\t\tv-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\t:type=\"visibility || asText ? 'text' : 'password'\"\n\t\t:trailing-button-label=\"trailingButtonLabelPassword\"\n\t\t:helper-text=\"computedHelperText\"\n\t\t:error=\"computedError\"\n\t\t:success=\"computedSuccess\"\n\t\t:minlength=\"rules.minlength\"\n\t\t:input-class=\"{ 'password-field__input--secure-text': !visibility && asText }\"\n\t\tv-on=\"$listeners\"\n\t\t@trailing-button-click=\"toggleVisibility\"\n\t\t@input=\"handleInput\">\n\t\t<template v-if=\"!!$scopedSlots.icon || !!$slots.default || !!$scopedSlots.default\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- @slot Deprecated, removed in v9: use #icon slot instead. -->\n\t\t\t\t<slot />\n\t\t\t</slot>\n\t\t</template>\n\n\t\t<template #trailing-button-icon>\n\t\t\t<IconEyeOff v-if=\"visibility\" :size=\"18\" />\n\t\t\t<IconEye v-else :size=\"18\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { loadState } from '@nextcloud/initial-state'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { useVModel } from '@vueuse/core'\nimport debounce from 'debounce'\nimport IconEye from 'vue-material-design-icons/Eye.vue'\nimport IconEyeOff from 'vue-material-design-icons/EyeOff.vue'\nimport NcInputField from '../NcInputField/NcInputField.vue'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport { t } from '../../l10n.js'\nimport { logger } from '../../utils/logger.ts'\n\n/**\n * @typedef PasswordPolicy\n * @property {object} api - The URLs to the password_policy app methods\n * @property {string} api.generate - The URL to the password generator\n * @property {string} api.validate - The URL to the password validator\n * @property {boolean} enforceNonCommonPassword - Whether to enforce non common passwords\n * @property {boolean} enforceNumericCharacters - Whether to enforce numeric characters\n * @property {boolean} enforceSpecialCharacters - Whether to enforce special characters\n * @property {boolean} enforceUpperLowerCase - Whether to enforce upper and lower case\n * @property {number} minLength - The minimum length of the password\n */\n\n/** @type {PasswordPolicy|null} */\nconst passwordPolicy = loadState('core', 'capabilities', {}).password_policy || null\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcPasswordField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tIconEye,\n\t\tIconEyeOff,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\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\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t// Redefined props\n\n\t\t/**\n\t\t * Controls whether to display the trailing button.\n\t\t */\n\t\tshowTrailingButton: {\n\t\t\ttype: Boolean,\n\t\t\t// eslint-disable-next-line vue/no-boolean-default\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Removed NcInputField props, defined only by this component\n\t\t */\n\t\ttrailingButtonLabel: undefined,\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Check if the user entered a valid password using the password_policy\n\t\t * app if available.\n\t\t *\n\t\t * Warning: this doesn't replace server side checking and will do nothing\n\t\t * if the password_policy app is disabled.\n\t\t */\n\t\tcheckPasswordStrength: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The minlength property defines the minimum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tminlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * The maxlength property defines the maximum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tmaxlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Render as input[type=text] that looks like password field.\n\t\t * Allows to avoid unwanted password-specific browser behavior,\n\t\t * such as save or generate password prompt.\n\t\t * Useful for secret token fields.\n\t\t * Note: autocomplete=\"off\" is ignored by browsers.\n\t\t */\n\t\tasText: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Visibility of the password.\n\t\t * If this is set to `true` then the password will be shown to the user (input type will be set to `text`).\n\t\t */\n\t\tvisible: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'valid',\n\t\t'invalid',\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\t'update:value',\n\t\t/**\n\t\t * Triggers when the value inside the password field is\n\t\t * updated.\n\t\t *\n\t\t * @property {string} The new value\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 * Updated visibility of the password\n\t\t *\n\t\t * @property {boolean} visible the new visibility state\n\t\t */\n\t\t'update:visible',\n\t],\n\n\tsetup(props, { emit }) {\n\t\tconst model = useModelMigration('value', 'update:value')\n\t\tconst visibility = useVModel(props, 'visible', emit, { passive: true })\n\n\t\treturn {\n\t\t\tt,\n\n\t\t\tmodel,\n\t\t\tvisibility,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tinternalHelpMessage: '',\n\t\t\tisValid: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcomputedError() {\n\t\t\treturn this.error || this.isValid === false\n\t\t},\n\n\t\tcomputedSuccess() {\n\t\t\treturn this.success || this.isValid === true\n\t\t},\n\n\t\tcomputedHelperText() {\n\t\t\tif (this.helperText.length > 0) {\n\t\t\t\treturn this.helperText\n\t\t\t}\n\t\t\treturn this.internalHelpMessage\n\t\t},\n\n\t\trules() {\n\t\t\tconst { minlength } = this\n\t\t\treturn {\n\t\t\t\tminlength: minlength ?? passwordPolicy?.minLength,\n\t\t\t}\n\t\t},\n\n\t\ttrailingButtonLabelPassword() {\n\t\t\treturn this.visibility ? t('Hide password') : t('Show password')\n\t\t},\n\n\t\tpropsAndAttrsToForward() {\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(Object.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key))),\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodel(newValue) {\n\t\t\tif (this.checkPasswordStrength) {\n\t\t\t\tif (passwordPolicy === null) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.checkPassword(newValue)\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.model = event.target.value\n\t\t},\n\n\t\ttoggleVisibility() {\n\t\t\tthis.visibility = !this.visibility\n\t\t},\n\n\t\tcheckPassword: debounce(async function(password) {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.post(generateOcsUrl('apps/password_policy/api/v1/validate'), { password })\n\t\t\t\tthis.isValid = data.ocs.data.passed\n\t\t\t\tif (data.ocs.data.passed) {\n\t\t\t\t\tthis.internalHelpMessage = t('Password is secure')\n\t\t\t\t\t/**\n\t\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t\t * password entered is valid.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('valid')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.internalHelpMessage = data.ocs.data.reason\n\t\t\t\t/**\n\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t * password entered is invalid.\n\t\t\t\t */\n\t\t\t\tthis.$emit('invalid')\n\t\t\t} catch (e) {\n\t\t\t\tlogger.error('Password policy returned an error', e)\n\t\t\t}\n\t\t}, 500),\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n:deep(.password-field__input--secure-text) {\n\t// Emulate password field look\n\t// This is not a part of the standard but well supported\n\t-webkit-text-security: disc;\n}\n</style>\n"],"names":["_sfc_main","loadState","NcInputField","useModelMigration","useVModel","t","debounce","axios","generateOcsUrl","logger"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;AChBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;ACwGA,MAAA,iBAAAC,aAAAA,UAAA,QAAA,gBAAA,CAAA,CAAA,EAAA,mBAAA;AAEA,MAAA,oBAAA,IAAA,IAAA,OAAA,KAAAC,aAAAA,aAAA,KAAA,CAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA,cAAAA,aAAAA;AAAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,KAAA,CAAA;AAAA;AAAA,IAGA,GAAAA,a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,aAAA,UAAA,KAAA,IAAA,KAAA;AACA,YAAA,KAAA,IAAA,KAAA,QAAA;AACA,eAAA,sBAAAH,MAAAA,EAAA,oBAAA;AAKA,eAAA,MAAA,OAAA;AACA;AAAA,QACA;AAEA,aAAA,sBAAA,KAAA,IAAA,KAAA;AAKA,aAAA,MAAA,SAAA;AAAA,MACA,SAAA,GAAA;AACAI,sBAAA,MAAA,qCAAA,CAAA;AAAA,MACA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -1,32 +1,13 @@
|
|
|
1
1
|
import '../assets/NcPasswordField-mhXQk8aT.css';
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
2
|
import axios from "@nextcloud/axios";
|
|
22
3
|
import { loadState } from "@nextcloud/initial-state";
|
|
23
4
|
import { generateOcsUrl } from "@nextcloud/router";
|
|
24
5
|
import { useVModel } from "@vueuse/core";
|
|
25
6
|
import debounce from "debounce";
|
|
26
7
|
import { n as normalizeComponent } from "./_plugin-vue2_normalizer-DU4iP6Vu.mjs";
|
|
27
|
-
import { N as NcInputField } from "./NcInputField-
|
|
28
|
-
import { u as useModelMigration } from "./useModelMigration-
|
|
29
|
-
import { r as register, B as t28, a as t } from "./_l10n-
|
|
8
|
+
import { N as NcInputField } from "./NcInputField-DUtDY_1I.mjs";
|
|
9
|
+
import { u as useModelMigration } from "./useModelMigration-EhAWvqDD.mjs";
|
|
10
|
+
import { r as register, B as t28, a as t } from "./_l10n-BWisB7-O.mjs";
|
|
30
11
|
import { l as logger } from "./logger-D3RVzcfQ.mjs";
|
|
31
12
|
const _sfc_main$2 = {
|
|
32
13
|
name: "EyeIcon",
|
|
@@ -110,14 +91,15 @@ const _sfc_main = {
|
|
|
110
91
|
prop: "modelValue",
|
|
111
92
|
event: "update:modelValue"
|
|
112
93
|
},
|
|
113
|
-
props:
|
|
94
|
+
props: {
|
|
114
95
|
/**
|
|
115
96
|
* Any [NcInputField](#/Components/NcFields?id=ncinputfield) props
|
|
116
97
|
*/
|
|
117
98
|
// Not an actual prop but needed to show in vue-styleguidist docs
|
|
118
99
|
// eslint-disable-next-line
|
|
119
|
-
" ": {}
|
|
120
|
-
|
|
100
|
+
" ": {},
|
|
101
|
+
// Reuse all the props from NcInputField for better typing and documentation
|
|
102
|
+
...NcInputField.props,
|
|
121
103
|
// Redefined props
|
|
122
104
|
/**
|
|
123
105
|
* Controls whether to display the trailing button.
|
|
@@ -178,7 +160,7 @@ const _sfc_main = {
|
|
|
178
160
|
type: Boolean,
|
|
179
161
|
default: false
|
|
180
162
|
}
|
|
181
|
-
}
|
|
163
|
+
},
|
|
182
164
|
emits: [
|
|
183
165
|
"valid",
|
|
184
166
|
"invalid",
|
|
@@ -235,14 +217,19 @@ const _sfc_main = {
|
|
|
235
217
|
rules() {
|
|
236
218
|
const { minlength } = this;
|
|
237
219
|
return {
|
|
238
|
-
minlength: minlength
|
|
220
|
+
minlength: minlength ?? passwordPolicy?.minLength
|
|
239
221
|
};
|
|
240
222
|
},
|
|
241
223
|
trailingButtonLabelPassword() {
|
|
242
224
|
return this.visibility ? t("Hide password") : t("Show password");
|
|
243
225
|
},
|
|
244
226
|
propsAndAttrsToForward() {
|
|
245
|
-
return
|
|
227
|
+
return {
|
|
228
|
+
// Proxy all the HTML attributes
|
|
229
|
+
...this.$attrs,
|
|
230
|
+
// Proxy original NcInputField's props
|
|
231
|
+
...Object.fromEntries(Object.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key)))
|
|
232
|
+
};
|
|
246
233
|
}
|
|
247
234
|
},
|
|
248
235
|
watch: {
|
|
@@ -318,4 +305,4 @@ const NcPasswordField = __component__.exports;
|
|
|
318
305
|
export {
|
|
319
306
|
NcPasswordField as N
|
|
320
307
|
};
|
|
321
|
-
//# sourceMappingURL=NcPasswordField-
|
|
308
|
+
//# sourceMappingURL=NcPasswordField-CujpFQHq.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcPasswordField-D2iDTTpp.mjs","sources":["../../node_modules/vue-material-design-icons/Eye.vue","../../node_modules/vue-material-design-icons/EyeOff.vue","../../src/components/NcPasswordField/NcPasswordField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-off-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeOffIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose password field component.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcPasswordField v-model=\"text1\"\n\t\t\tlabel=\"Old password\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">New password</label>\n\t\t\t<NcPasswordField id=\"textField\"\n\t\t\t\tv-model=\"text2\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\" />\n\t\t</div>\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField2\">New password</label>\n\t\t\t<NcPasswordField id=\"textField2\"\n\t\t\t\tv-model=\"text3\"\n\t\t\t\t:error=\"true\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\thelper-text=\"Password is insecure\" />\n\t\t</div>\n\n\t\t<NcPasswordField v-model=\"text4\"\n\t\t\tlabel=\"Good new password\"\n\t\t\t:success=\"true\"\n\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\thelper-text=\"Password is secure\" />\n\n\t\t<NcPasswordField v-model=\"text5\"\n\t\t\t:disabled=\"true\"\n\t\t\tlabel=\"Disabled\" />\n\n\t\t<NcPasswordField v-model=\"text6\"\n\t\t\tlabel=\"Secret token\"\n\t\t\tas-text />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: 'hunter',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t\ttext6: 'secret-token',\n\t\t}\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField\n\t\tv-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\t:type=\"visibility || asText ? 'text' : 'password'\"\n\t\t:trailing-button-label=\"trailingButtonLabelPassword\"\n\t\t:helper-text=\"computedHelperText\"\n\t\t:error=\"computedError\"\n\t\t:success=\"computedSuccess\"\n\t\t:minlength=\"rules.minlength\"\n\t\t:input-class=\"{ 'password-field__input--secure-text': !visibility && asText }\"\n\t\tv-on=\"$listeners\"\n\t\t@trailing-button-click=\"toggleVisibility\"\n\t\t@input=\"handleInput\">\n\t\t<template v-if=\"!!$scopedSlots.icon || !!$slots.default || !!$scopedSlots.default\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- @slot Deprecated, removed in v9: use #icon slot instead. -->\n\t\t\t\t<slot />\n\t\t\t</slot>\n\t\t</template>\n\n\t\t<template #trailing-button-icon>\n\t\t\t<IconEyeOff v-if=\"visibility\" :size=\"18\" />\n\t\t\t<IconEye v-else :size=\"18\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { loadState } from '@nextcloud/initial-state'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { useVModel } from '@vueuse/core'\nimport debounce from 'debounce'\nimport IconEye from 'vue-material-design-icons/Eye.vue'\nimport IconEyeOff from 'vue-material-design-icons/EyeOff.vue'\nimport NcInputField from '../NcInputField/NcInputField.vue'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport { t } from '../../l10n.js'\nimport { logger } from '../../utils/logger.ts'\n\n/**\n * @typedef PasswordPolicy\n * @property {object} api - The URLs to the password_policy app methods\n * @property {string} api.generate - The URL to the password generator\n * @property {string} api.validate - The URL to the password validator\n * @property {boolean} enforceNonCommonPassword - Whether to enforce non common passwords\n * @property {boolean} enforceNumericCharacters - Whether to enforce numeric characters\n * @property {boolean} enforceSpecialCharacters - Whether to enforce special characters\n * @property {boolean} enforceUpperLowerCase - Whether to enforce upper and lower case\n * @property {number} minLength - The minimum length of the password\n */\n\n/** @type {PasswordPolicy|null} */\nconst passwordPolicy = loadState('core', 'capabilities', {}).password_policy || null\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcPasswordField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tIconEye,\n\t\tIconEyeOff,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\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\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t// Redefined props\n\n\t\t/**\n\t\t * Controls whether to display the trailing button.\n\t\t */\n\t\tshowTrailingButton: {\n\t\t\ttype: Boolean,\n\t\t\t// eslint-disable-next-line vue/no-boolean-default\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Removed NcInputField props, defined only by this component\n\t\t */\n\t\ttrailingButtonLabel: undefined,\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Check if the user entered a valid password using the password_policy\n\t\t * app if available.\n\t\t *\n\t\t * Warning: this doesn't replace server side checking and will do nothing\n\t\t * if the password_policy app is disabled.\n\t\t */\n\t\tcheckPasswordStrength: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The minlength property defines the minimum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tminlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * The maxlength property defines the maximum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tmaxlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Render as input[type=text] that looks like password field.\n\t\t * Allows to avoid unwanted password-specific browser behavior,\n\t\t * such as save or generate password prompt.\n\t\t * Useful for secret token fields.\n\t\t * Note: autocomplete=\"off\" is ignored by browsers.\n\t\t */\n\t\tasText: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Visibility of the password.\n\t\t * If this is set to `true` then the password will be shown to the user (input type will be set to `text`).\n\t\t */\n\t\tvisible: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'valid',\n\t\t'invalid',\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\t'update:value',\n\t\t/**\n\t\t * Triggers when the value inside the password field is\n\t\t * updated.\n\t\t *\n\t\t * @property {string} The new value\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 * Updated visibility of the password\n\t\t *\n\t\t * @property {boolean} visible the new visibility state\n\t\t */\n\t\t'update:visible',\n\t],\n\n\tsetup(props, { emit }) {\n\t\tconst model = useModelMigration('value', 'update:value')\n\t\tconst visibility = useVModel(props, 'visible', emit, { passive: true })\n\n\t\treturn {\n\t\t\tt,\n\n\t\t\tmodel,\n\t\t\tvisibility,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tinternalHelpMessage: '',\n\t\t\tisValid: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcomputedError() {\n\t\t\treturn this.error || this.isValid === false\n\t\t},\n\n\t\tcomputedSuccess() {\n\t\t\treturn this.success || this.isValid === true\n\t\t},\n\n\t\tcomputedHelperText() {\n\t\t\tif (this.helperText.length > 0) {\n\t\t\t\treturn this.helperText\n\t\t\t}\n\t\t\treturn this.internalHelpMessage\n\t\t},\n\n\t\trules() {\n\t\t\tconst { minlength } = this\n\t\t\treturn {\n\t\t\t\tminlength: minlength ?? passwordPolicy?.minLength,\n\t\t\t}\n\t\t},\n\n\t\ttrailingButtonLabelPassword() {\n\t\t\treturn this.visibility ? t('Hide password') : t('Show password')\n\t\t},\n\n\t\tpropsAndAttrsToForward() {\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(Object.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key))),\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodel(newValue) {\n\t\t\tif (this.checkPasswordStrength) {\n\t\t\t\tif (passwordPolicy === null) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.checkPassword(newValue)\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.model = event.target.value\n\t\t},\n\n\t\ttoggleVisibility() {\n\t\t\tthis.visibility = !this.visibility\n\t\t},\n\n\t\tcheckPassword: debounce(async function(password) {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.post(generateOcsUrl('apps/password_policy/api/v1/validate'), { password })\n\t\t\t\tthis.isValid = data.ocs.data.passed\n\t\t\t\tif (data.ocs.data.passed) {\n\t\t\t\t\tthis.internalHelpMessage = t('Password is secure')\n\t\t\t\t\t/**\n\t\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t\t * password entered is valid.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('valid')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.internalHelpMessage = data.ocs.data.reason\n\t\t\t\t/**\n\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t * password entered is invalid.\n\t\t\t\t */\n\t\t\t\tthis.$emit('invalid')\n\t\t\t} catch (e) {\n\t\t\t\tlogger.error('Password policy returned an error', e)\n\t\t\t}\n\t\t}, 500),\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n:deep(.password-field__input--secure-text) {\n\t// Emulate password field look\n\t// This is not a part of the standard but well supported\n\t-webkit-text-security: disc;\n}\n</style>\n"],"names":["_sfc_main"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;AChBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;ACwGA,MAAA,iBAAA,UAAA,QAAA,gBAAA,CAAA,CAAA,EAAA,mBAAA;AAEA,MAAA,oBAAA,IAAA,IAAA,OAAA,KAAA,aAAA,KAAA,CAAA;AAEA,MAAA,YAAA;AAAA,EACA,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AA,IAEA,eAAA,SAAA,eAAA,UAAA;AACA,UAAA;AACA,cAAA,EAAA,KAAA,IAAA,MAAA,MAAA,KAAA,eAAA,sCAAA,GAAA,EAAA,SAAA,CAAA;AACA,aAAA,UAAA,KAAA,IAAA,KAAA;AACA,YAAA,KAAA,IAAA,KAAA,QAAA;AACA,eAAA,sBAAA,EAAA,oBAAA;AAKA,eAAA,MAAA,OAAA;AACA;AAAA,QACA;AAEA,aAAA,sBAAA,KAAA,IAAA,KAAA;AAKA,aAAA,MAAA,SAAA;AAAA,MACA,SAAA,GAAA;AACA,eAAA,MAAA,qCAAA,CAAA;AAAA,MACA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"NcPasswordField-CujpFQHq.mjs","sources":["../../node_modules/vue-material-design-icons/Eye.vue","../../node_modules/vue-material-design-icons/EyeOff.vue","../../src/components/NcPasswordField/NcPasswordField.vue"],"sourcesContent":["<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon eye-off-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"EyeOffIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n### Description\nSee [NcInputField](#/Components/NcFields?id=ncinputfield) for a list of all available props.\n\nGeneral purpose password field component.\n\n```\n<template>\n\t<div class=\"wrapper\">\n\t\t<NcPasswordField v-model=\"text1\"\n\t\t\tlabel=\"Old password\" />\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField\">New password</label>\n\t\t\t<NcPasswordField id=\"textField\"\n\t\t\t\tv-model=\"text2\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\" />\n\t\t</div>\n\t\t<div class=\"external-label\">\n\t\t\t<label for=\"textField2\">New password</label>\n\t\t\t<NcPasswordField id=\"textField2\"\n\t\t\t\tv-model=\"text3\"\n\t\t\t\t:error=\"true\"\n\t\t\t\t:label-outside=\"true\"\n\t\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\t\thelper-text=\"Password is insecure\" />\n\t\t</div>\n\n\t\t<NcPasswordField v-model=\"text4\"\n\t\t\tlabel=\"Good new password\"\n\t\t\t:success=\"true\"\n\t\t\tplaceholder=\"Min. 12 characters\"\n\t\t\thelper-text=\"Password is secure\" />\n\n\t\t<NcPasswordField v-model=\"text5\"\n\t\t\t:disabled=\"true\"\n\t\t\tlabel=\"Disabled\" />\n\n\t\t<NcPasswordField v-model=\"text6\"\n\t\t\tlabel=\"Secret token\"\n\t\t\tas-text />\n\t</div>\n</template>\n<script>\nexport default {\n\tdata() {\n\t\treturn {\n\t\t\ttext1: '',\n\t\t\ttext2: '',\n\t\t\ttext3: 'hunter',\n\t\t\ttext4: '',\n\t\t\ttext5: '',\n\t\t\ttext6: 'secret-token',\n\t\t}\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.wrapper {\n\tdisplay: flex;\n\tgap: 4px;\n\talign-items: flex-end;\n\tflex-wrap: wrap;\n}\n\n.external-label {\n\tdisplay: flex;\n\tgap: 14px;\n\twidth: 100%;\n\tmargin-top: 1rem;\n}\n\n.external-label label {\n\tpadding-top: 7px;\n\twhite-space: nowrap;\n}\n</style>\n```\n</docs>\n\n<template>\n\t<NcInputField\n\t\tv-bind=\"propsAndAttrsToForward\"\n\t\tref=\"inputField\"\n\t\t:type=\"visibility || asText ? 'text' : 'password'\"\n\t\t:trailing-button-label=\"trailingButtonLabelPassword\"\n\t\t:helper-text=\"computedHelperText\"\n\t\t:error=\"computedError\"\n\t\t:success=\"computedSuccess\"\n\t\t:minlength=\"rules.minlength\"\n\t\t:input-class=\"{ 'password-field__input--secure-text': !visibility && asText }\"\n\t\tv-on=\"$listeners\"\n\t\t@trailing-button-click=\"toggleVisibility\"\n\t\t@input=\"handleInput\">\n\t\t<template v-if=\"!!$scopedSlots.icon || !!$slots.default || !!$scopedSlots.default\" #icon>\n\t\t\t<!-- @slot Leading icon -->\n\t\t\t<slot name=\"icon\">\n\t\t\t\t<!-- @slot Deprecated, removed in v9: use #icon slot instead. -->\n\t\t\t\t<slot />\n\t\t\t</slot>\n\t\t</template>\n\n\t\t<template #trailing-button-icon>\n\t\t\t<IconEyeOff v-if=\"visibility\" :size=\"18\" />\n\t\t\t<IconEye v-else :size=\"18\" />\n\t\t</template>\n\t</NcInputField>\n</template>\n\n<script>\nimport axios from '@nextcloud/axios'\nimport { loadState } from '@nextcloud/initial-state'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { useVModel } from '@vueuse/core'\nimport debounce from 'debounce'\nimport IconEye from 'vue-material-design-icons/Eye.vue'\nimport IconEyeOff from 'vue-material-design-icons/EyeOff.vue'\nimport NcInputField from '../NcInputField/NcInputField.vue'\nimport { useModelMigration } from '../../composables/useModelMigration.ts'\nimport { t } from '../../l10n.js'\nimport { logger } from '../../utils/logger.ts'\n\n/**\n * @typedef PasswordPolicy\n * @property {object} api - The URLs to the password_policy app methods\n * @property {string} api.generate - The URL to the password generator\n * @property {string} api.validate - The URL to the password validator\n * @property {boolean} enforceNonCommonPassword - Whether to enforce non common passwords\n * @property {boolean} enforceNumericCharacters - Whether to enforce numeric characters\n * @property {boolean} enforceSpecialCharacters - Whether to enforce special characters\n * @property {boolean} enforceUpperLowerCase - Whether to enforce upper and lower case\n * @property {number} minLength - The minimum length of the password\n */\n\n/** @type {PasswordPolicy|null} */\nconst passwordPolicy = loadState('core', 'capabilities', {}).password_policy || null\n\nconst NcInputFieldProps = new Set(Object.keys(NcInputField.props))\n\nexport default {\n\tname: 'NcPasswordField',\n\n\tcomponents: {\n\t\tNcInputField,\n\t\tIconEye,\n\t\tIconEyeOff,\n\t},\n\n\t// Allow forwarding all attributes\n\tinheritAttrs: false,\n\n\tmodel: {\n\t\tprop: 'modelValue',\n\t\tevent: 'update:modelValue',\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Any [NcInputField](#/Components/NcFields?id=ncinputfield) props\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\n\t\t// Reuse all the props from NcInputField for better typing and documentation\n\t\t...NcInputField.props,\n\n\t\t// Redefined props\n\n\t\t/**\n\t\t * Controls whether to display the trailing button.\n\t\t */\n\t\tshowTrailingButton: {\n\t\t\ttype: Boolean,\n\t\t\t// eslint-disable-next-line vue/no-boolean-default\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Removed NcInputField props, defined only by this component\n\t\t */\n\t\ttrailingButtonLabel: undefined,\n\n\t\t// Custom props\n\n\t\t/**\n\t\t * Check if the user entered a valid password using the password_policy\n\t\t * app if available.\n\t\t *\n\t\t * Warning: this doesn't replace server side checking and will do nothing\n\t\t * if the password_policy app is disabled.\n\t\t */\n\t\tcheckPasswordStrength: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * The minlength property defines the minimum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tminlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: 0,\n\t\t},\n\n\t\t/**\n\t\t * The maxlength property defines the maximum number of characters\n\t\t * (as UTF-16 code units) the user can enter\n\t\t */\n\t\tmaxlength: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Render as input[type=text] that looks like password field.\n\t\t * Allows to avoid unwanted password-specific browser behavior,\n\t\t * such as save or generate password prompt.\n\t\t * Useful for secret token fields.\n\t\t * Note: autocomplete=\"off\" is ignored by browsers.\n\t\t */\n\t\tasText: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Visibility of the password.\n\t\t * If this is set to `true` then the password will be shown to the user (input type will be set to `text`).\n\t\t */\n\t\tvisible: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'valid',\n\t\t'invalid',\n\t\t/**\n\t\t * Removed in v9 - use `update:modelValue` (`v-model`) instead\n\t\t *\n\t\t * @deprecated\n\t\t */\n\t\t'update:value',\n\t\t/**\n\t\t * Triggers when the value inside the password field is\n\t\t * updated.\n\t\t *\n\t\t * @property {string} The new value\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 * Updated visibility of the password\n\t\t *\n\t\t * @property {boolean} visible the new visibility state\n\t\t */\n\t\t'update:visible',\n\t],\n\n\tsetup(props, { emit }) {\n\t\tconst model = useModelMigration('value', 'update:value')\n\t\tconst visibility = useVModel(props, 'visible', emit, { passive: true })\n\n\t\treturn {\n\t\t\tt,\n\n\t\t\tmodel,\n\t\t\tvisibility,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tinternalHelpMessage: '',\n\t\t\tisValid: null,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tcomputedError() {\n\t\t\treturn this.error || this.isValid === false\n\t\t},\n\n\t\tcomputedSuccess() {\n\t\t\treturn this.success || this.isValid === true\n\t\t},\n\n\t\tcomputedHelperText() {\n\t\t\tif (this.helperText.length > 0) {\n\t\t\t\treturn this.helperText\n\t\t\t}\n\t\t\treturn this.internalHelpMessage\n\t\t},\n\n\t\trules() {\n\t\t\tconst { minlength } = this\n\t\t\treturn {\n\t\t\t\tminlength: minlength ?? passwordPolicy?.minLength,\n\t\t\t}\n\t\t},\n\n\t\ttrailingButtonLabelPassword() {\n\t\t\treturn this.visibility ? t('Hide password') : t('Show password')\n\t\t},\n\n\t\tpropsAndAttrsToForward() {\n\t\t\treturn {\n\t\t\t\t// Proxy all the HTML attributes\n\t\t\t\t...this.$attrs,\n\t\t\t\t// Proxy original NcInputField's props\n\t\t\t\t...Object.fromEntries(Object.entries(this.$props).filter(([key]) => NcInputFieldProps.has(key))),\n\t\t\t}\n\t\t},\n\t},\n\n\twatch: {\n\t\tmodel(newValue) {\n\t\t\tif (this.checkPasswordStrength) {\n\t\t\t\tif (passwordPolicy === null) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tthis.checkPassword(newValue)\n\t\t\t}\n\t\t},\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Focus the input element\n\t\t *\n\t\t * @public\n\t\t */\n\t\tfocus() {\n\t\t\tthis.$refs.inputField.focus()\n\t\t},\n\n\t\t/**\n\t\t * Select all the text in the input\n\t\t *\n\t\t * @public\n\t\t */\n\t\tselect() {\n\t\t\tthis.$refs.inputField.select()\n\t\t},\n\n\t\thandleInput(event) {\n\t\t\tthis.model = event.target.value\n\t\t},\n\n\t\ttoggleVisibility() {\n\t\t\tthis.visibility = !this.visibility\n\t\t},\n\n\t\tcheckPassword: debounce(async function(password) {\n\t\t\ttry {\n\t\t\t\tconst { data } = await axios.post(generateOcsUrl('apps/password_policy/api/v1/validate'), { password })\n\t\t\t\tthis.isValid = data.ocs.data.passed\n\t\t\t\tif (data.ocs.data.passed) {\n\t\t\t\t\tthis.internalHelpMessage = t('Password is secure')\n\t\t\t\t\t/**\n\t\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t\t * password entered is valid.\n\t\t\t\t\t */\n\t\t\t\t\tthis.$emit('valid')\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tthis.internalHelpMessage = data.ocs.data.reason\n\t\t\t\t/**\n\t\t\t\t * Triggers when the internal password_policy detect that the\n\t\t\t\t * password entered is invalid.\n\t\t\t\t */\n\t\t\t\tthis.$emit('invalid')\n\t\t\t} catch (e) {\n\t\t\t\tlogger.error('Password policy returned an error', e)\n\t\t\t}\n\t\t}, 500),\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n:deep(.password-field__input--secure-text) {\n\t// Emulate password field look\n\t// This is not a part of the standard but well supported\n\t-webkit-text-security: disc;\n}\n</style>\n"],"names":["_sfc_main"],"mappings":";;;;;;;;;;AAoBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;AChBA,MAAAA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA,CAAA,OAAA;AAAA,EACA,OAAA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,IACA;AAAA,IACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;ACwGA,MAAA,iBAAA,UAAA,QAAA,gBAAA,CAAA,CAAA,EAAA,mBAAA;AAEA,MAAA,oBAAA,IAAA,IAAA,OAAA,KAAA,aAAA,KAAA,CAAA;AAEA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA;AAAA,EAGA,cAAA;AAAA,EAEA,OAAA;AAAA,IACA,MAAA;AAAA,IACA,OAAA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,KA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,YAAA,KAAA,IAAA,KAAA,QAAA;AACA,eAAA,sBAAA,EAAA,oBAAA;AAKA,eAAA,MAAA,OAAA;AACA;AAAA,QACA;AAEA,aAAA,sBAAA,KAAA,IAAA,KAAA;AAKA,aAAA,MAAA,SAAA;AAAA,MACA,SAAA,GAAA;AACA,eAAA,MAAA,qCAAA,CAAA;AAAA,MACA;AAAA,IACA,GAAA,GAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[0,1]}
|
|
@@ -5,7 +5,7 @@ const focusTrap = require("focus-trap");
|
|
|
5
5
|
const tabbable = require("tabbable");
|
|
6
6
|
const Vue = require("vue");
|
|
7
7
|
const _pluginVue2_normalizer = require("./_plugin-vue2_normalizer-V0q-tHlQ.cjs");
|
|
8
|
-
const focusTrap$1 = require("./focusTrap-
|
|
8
|
+
const focusTrap$1 = require("./focusTrap-DUTqW_IG.cjs");
|
|
9
9
|
const logger = require("./logger-3HuiEIF6.cjs");
|
|
10
10
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
11
11
|
const Vue__default = /* @__PURE__ */ _interopDefault(Vue);
|
|
@@ -42,8 +42,7 @@ const _sfc_main$1 = Vue.defineComponent({
|
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
render() {
|
|
45
|
-
|
|
46
|
-
return (_b = (_a = this.$scopedSlots).default) == null ? void 0 : _b.call(_a, {
|
|
45
|
+
return this.$scopedSlots.default?.({
|
|
47
46
|
attrs: this.triggerAttrs
|
|
48
47
|
});
|
|
49
48
|
}
|
|
@@ -174,8 +173,7 @@ const _sfc_main = {
|
|
|
174
173
|
* Important to check custom trigger button.
|
|
175
174
|
*/
|
|
176
175
|
checkTriggerA11y() {
|
|
177
|
-
|
|
178
|
-
if ((_a = window.OC) == null ? void 0 : _a.debug) {
|
|
176
|
+
if (window.OC?.debug) {
|
|
179
177
|
const triggerButton = this.getPopoverTriggerButtonElement();
|
|
180
178
|
if (!triggerButton || !triggerButton.hasAttributes("aria-expanded", "aria-haspopup")) {
|
|
181
179
|
Vue__default.default.util.warn("It looks like you are using a custom button as a <NcPopover> or other popover #trigger. If you are not using <NcButton> as a trigger, you need to bind attrs from the #trigger slot props to your custom button. See <NcPopover> docs for an example.");
|
|
@@ -198,8 +196,7 @@ const _sfc_main = {
|
|
|
198
196
|
* @return {HTMLElement|undefined}
|
|
199
197
|
*/
|
|
200
198
|
getPopoverContentElement() {
|
|
201
|
-
|
|
202
|
-
return (_b = (_a = this.$refs.popover) == null ? void 0 : _a.$refs.popperContent) == null ? void 0 : _b.$el;
|
|
199
|
+
return this.$refs.popover?.$refs.popperContent?.$el;
|
|
203
200
|
},
|
|
204
201
|
/**
|
|
205
202
|
* @return {HTMLElement|undefined}
|
|
@@ -244,9 +241,8 @@ const _sfc_main = {
|
|
|
244
241
|
* @param {object} options The configuration options for focusTrap
|
|
245
242
|
*/
|
|
246
243
|
clearFocusTrap(options = {}) {
|
|
247
|
-
var _a;
|
|
248
244
|
try {
|
|
249
|
-
|
|
245
|
+
this.$focusTrap?.deactivate(options);
|
|
250
246
|
this.$focusTrap = null;
|
|
251
247
|
} catch (error) {
|
|
252
248
|
logger.logger.warn("Could not clear focus trap", { error });
|
|
@@ -261,14 +257,14 @@ const _sfc_main = {
|
|
|
261
257
|
*/
|
|
262
258
|
addEscapeStopPropagation() {
|
|
263
259
|
const el = this.getPopoverContentElement();
|
|
264
|
-
el
|
|
260
|
+
el?.addEventListener("keydown", this.stopKeydownEscapeHandler);
|
|
265
261
|
},
|
|
266
262
|
/**
|
|
267
263
|
* Remove stop Escape handler
|
|
268
264
|
*/
|
|
269
265
|
clearEscapeStopPropagation() {
|
|
270
266
|
const el = this.getPopoverContentElement();
|
|
271
|
-
el
|
|
267
|
+
el?.removeEventListener("keydown", this.stopKeydownEscapeHandler);
|
|
272
268
|
},
|
|
273
269
|
/**
|
|
274
270
|
* @param {KeyboardEvent} event - native keydown event
|
|
@@ -325,4 +321,4 @@ var __component__ = /* @__PURE__ */ _pluginVue2_normalizer.normalizeComponent(
|
|
|
325
321
|
);
|
|
326
322
|
const NcPopover = __component__.exports;
|
|
327
323
|
exports.NcPopover = NcPopover;
|
|
328
|
-
//# sourceMappingURL=NcPopover-
|
|
324
|
+
//# sourceMappingURL=NcPopover-BgUZkmjk.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NcPopover-nzbq2IjT.mjs","sources":["../../src/components/NcPopover/NcPopoverTriggerProvider.vue","../../src/components/NcPopover/NcPopover.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<script>\nimport { defineComponent } from 'vue'\n\nexport default defineComponent({\n\tname: 'NcPopoverTriggerProvider',\n\n\tprovide() {\n\t\treturn {\n\t\t\t'NcPopover:trigger:shown': () => this.shown,\n\t\t\t'NcPopover:trigger:attrs': () => this.triggerAttrs,\n\t\t}\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Is the popover currently shown\n\t\t */\n\t\tshown: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * ARIA Role of the popup\n\t\t */\n\t\tpopupRole: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\ttriggerAttrs() {\n\t\t\treturn {\n\t\t\t\t'aria-haspopup': this.popupRole,\n\t\t\t\t'aria-expanded': this.shown.toString(),\n\t\t\t}\n\t\t},\n\t},\n\n\trender() {\n\t\t// TODO: Vue 3 - replace with $slots\n\t\treturn this.$scopedSlots.default?.({\n\t\t\tattrs: this.triggerAttrs,\n\t\t})\n\t},\n})\n</script>\n","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### General description\n\nThis component is just a wrapper for the floating-vue plugin by Akryum,\nplease refer to this documentation for customization:\nhttps://github.com/Akryum/floating-vue\n\nThis components has two slots:\n* 'trigger' which can be any html element and it will trigger the popover\nthis slot is optional since you can toggle the popover also by updating the\nopen prop on this component;\n\n* a default slot that is for the content of the popover.\n\n### Examples\n\n#### With a `<NcButton>` as a trigger:\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>I am the trigger</NcButton>\n\t\t\t</template>\n\t\t\t<template>\n\t\t\t\t<form tabindex=\"0\" role=\"dialog\" aria-labelledby=\"popover-example-dialog-header-1\" @submit.prevent>\n\t\t\t\t\t<h2 id=\"popover-example-dialog-header-1\">this is some content</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. <br/>\n\t\t\t\t\t\tVestibulum eget placerat velit.\n\t\t\t\t\t</p>\n\t\t\t\t\t<label>\n\t\t\t\t\t\tLabel element\n\t\t\t\t\t\t<input type=\"text\" placeholder=\"input element\"/>\n\t\t\t\t\t</label>\n\t\t\t\t</form>\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### Without focus trap:\n\nThe [`focus-trap`](https://github.com/focus-trap/focus-trap) emits an error when used in a non-focusable element tree.\n\nThe prop `:focus-trap=\"false\"` help to prevent it when the default behavior is not relevant.\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover :focus-trap=\"false\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>Click me!</NcButton>\n\t\t\t</template>\n\t\t\t<template>\n\t\t\t\tHi! 🚀\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### With passing props to `floating-vue`'s `Dropdown`:\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover container=\"body\" :popper-hide-triggers=\"(triggers) => [...triggers, 'click']\" popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>I am the trigger</NcButton>\n\t\t\t</template>\n\t\t\t<template #default>\n\t\t\t\t<NcButton>Click on the button will close NcPopover</NcButton>\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### With a custom button in as a trigger:\n\nWhen `<NcButton>` is used as a `<NcPopover>` trigger, it injects required for a11y attributes to the button.\n\nIf you are using your own custom button as a trigger make sure to bind `attrs` from the trigger slot props.\nSee code example below.\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover>\n\t\t\t<!-- Take \"attrs\" from the slot props -->\n\t\t\t<template #trigger=\"{ attrs }\">\n\t\t\t\t<!-- Bind attrs as the button attrs -->\n\t\t\t\t<button v-bind=\"attrs\">\n\t\t\t\t\tI am a custom button in the trigger\n\t\t\t\t</button>\n\t\t\t</template>\n\n\t\t\tHi! 🚀\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### Provide role for the popover content\n\nFor accessibility reasons, popover should have a role. Provide it to the `popup-role` and make sure that the popover content is an element with the same role.\n\nSee: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<!-- Provide popup role -->\n\t\t<NcPopover popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>Delete</NcButton>\n\t\t\t</template>\n\n\t\t\t<!-- Popover content should has the same role -->\n\t\t\t<div role=\"dialog\" aria-labelledby=\"popover-example-custom-role-1\" aria-modal=\"true\">\n\t\t\t\t<!-- This is not required but better to provide a label -->\n\t\t\t\t<header id=\"popover-example-custom-role-1\">\n\t\t\t\t\t<strong>Confirm remove</strong>\n\t\t\t\t</header>\n\t\t\t\t<NcButton type=\"danger\">Delete</NcButton>\n\t\t\t</div>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n</docs>\n\n<template>\n\t<Dropdown\n\t\tref=\"popover\"\n\t\t:distance=\"10\"\n\t\t:arrow-padding=\"10\"\n\t\tv-bind=\"$attrs\"\n\t\t:no-auto-focus=\"true /* Handled by the focus trap */\"\n\t\t:popper-class=\"[$style.ncPopover, popoverBaseClass]\"\n\t\t:theme=\"THEME\"\n\t\t:shown=\"internalShown\"\n\t\tv-on=\"$listeners\"\n\t\t@update:shown=\"internalShown = $event\"\n\t\t@apply-show=\"afterShow\"\n\t\t@apply-hide=\"afterHide\">\n\t\t<NcPopoverTriggerProvider v-slot=\"slotProps\" :shown=\"internalShown\" :popup-role=\"popupRole\">\n\t\t\t<!-- This will be the popover target (for the events and position) -->\n\t\t\t<slot name=\"trigger\" v-bind=\"slotProps\" />\n\t\t</NcPopoverTriggerProvider>\n\n\t\t<!-- This will be the content of the popover -->\n\t\t<template #popper=\"slotProps\">\n\t\t\t<slot name=\"default\" v-bind=\"slotProps\" />\n\t\t</template>\n\t</Dropdown>\n</template>\n\n<script>\nimport { Dropdown, options } from 'floating-vue'\nimport { createFocusTrap } from 'focus-trap'\nimport { tabbable } from 'tabbable'\nimport Vue from 'vue'\nimport NcPopoverTriggerProvider from './NcPopoverTriggerProvider.vue'\nimport { getTrapStack } from '../../utils/focusTrap.ts'\nimport { logger } from '../../utils/logger.ts'\n\nconst THEME = 'nc-popover-8'\n\n// NcPopover has a custom theme to have a custom name but same as the default \"dropdown\" theme\noptions.themes[THEME] = structuredClone(options.themes.dropdown)\n\n/**\n * @typedef {import('focus-trap').FocusTargetValueOrFalse} FocusTargetValueOrFalse\n * @typedef {FocusTargetValueOrFalse|() => FocusTargetValueOrFalse} SetReturnFocus\n */\n\nexport default {\n\tname: 'NcPopover',\n\n\tcomponents: {\n\t\tDropdown,\n\t\tNcPopoverTriggerProvider,\n\t},\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Show or hide the popper\n\t\t *\n\t\t * @see https://floating-vue.starpad.dev/api/#shown\n\t\t */\n\t\tshown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Popup role\n\t\t *\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#values\n\t\t */\n\t\tpopupRole: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: (value) => ['menu', 'listbox', 'tree', 'grid', 'dialog', 'true'].includes(value),\n\t\t},\n\n\t\t/**\n\t\t * Class to be applied to the popover base\n\t\t */\n\t\tpopoverBaseClass: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Enable popover focus trap\n\t\t *\n\t\t * @deprecated use noFocusTrap instead\n\t\t */\n\t\tfocusTrap: {\n\t\t\ttype: Boolean,\n\t\t\t// eslint-disable-next-line vue/no-boolean-default\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Disable the popover focus trap.\n\t\t */\n\t\tnoFocusTrap: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Set element to return focus to after focus trap deactivation\n\t\t *\n\t\t * @type {SetReturnFocus}\n\t\t */\n\t\tsetReturnFocus: {\n\t\t\tdefault: undefined,\n\t\t\ttype: [Boolean, HTMLElement, SVGElement, String, Function],\n\t\t},\n\n\t\t/**\n\t\t * When there is no setReturnFocus, NcPopover will try to return focus to the trigger button.\n\t\t * Use this prop to disable this behavior.\n\t\t */\n\t\tnoAutoReturnFocus: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'after-show',\n\t\t'after-hide',\n\t\t/**\n\t\t * @see https://floating-vue.starpad.dev/api/#update-shown\n\t\t */\n\t\t'update:shown',\n\t],\n\n\tsetup() {\n\t\treturn {\n\t\t\tTHEME,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tinternalShown: this.shown,\n\t\t}\n\t},\n\n\twatch: {\n\t\tshown(value) {\n\t\t\tthis.internalShown = value\n\t\t},\n\n\t\tinternalShown(value) {\n\t\t\tthis.$emit('update:shown', value)\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.checkTriggerA11y()\n\t},\n\n\tbeforeDestroy() {\n\t\tthis.clearFocusTrap()\n\t\tthis.clearEscapeStopPropagation()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Check if the trigger has all required a11y attributes.\n\t\t * Important to check custom trigger button.\n\t\t */\n\t\tcheckTriggerA11y() {\n\t\t\tif (window.OC?.debug) {\n\t\t\t\tconst triggerButton = this.getPopoverTriggerButtonElement()\n\t\t\t\tif (!triggerButton || !triggerButton.hasAttributes('aria-expanded', 'aria-haspopup')) {\n\t\t\t\t\tVue.util.warn('It looks like you are using a custom button as a <NcPopover> or other popover #trigger. If you are not using <NcButton> as a trigger, you need to bind attrs from the #trigger slot props to your custom button. See <NcPopover> docs for an example.')\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove incorrect aria-describedby attribute from the trigger.\n\t\t *\n\t\t * @see https://github.com/Akryum/floating-vue/blob/8d4f7125aae0e3ea00ba4093d6d2001ab15058f1/packages/floating-vue/src/components/Popper.ts#L734\n\t\t */\n\t\tremoveFloatingVueAriaDescribedBy() {\n\t\t\t// When the popover is shown, floating-vue mutates the root elements of the trigger adding data-popper-shown and incorrect aria-describedby attributes.\n\t\t\tconst triggerContainer = this.getPopoverTriggerElement()\n\t\t\tconst triggerElements = triggerContainer.querySelectorAll('[data-popper-shown]')\n\t\t\tfor (const el of triggerElements) {\n\t\t\t\tel.removeAttribute('aria-describedby')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverContentElement() {\n\t\t\treturn this.$refs.popover?.$refs.popperContent?.$el\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverTriggerElement() {\n\t\t\t// TODO: Vue 3: should be\n\t\t\t// this.$refs.popover.$refs.popper.$refs.reference\n\t\t\treturn this.$refs.popover.$refs.reference\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverTriggerButtonElement() {\n\t\t\tconst triggerContainer = this.getPopoverTriggerElement()\n\t\t\treturn triggerContainer && tabbable(triggerContainer)[0]\n\t\t},\n\n\t\t/**\n\t\t * Add focus trap for accessibility.\n\t\t */\n\t\tasync useFocusTrap() {\n\t\t\tawait this.$nextTick()\n\n\t\t\tif (this.noFocusTrap || !this.focusTrap) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel.tabIndex = -1\n\n\t\t\tif (!el) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Init focus trap\n\t\t\tthis.$focusTrap = createFocusTrap(el, {\n\t\t\t\t// Prevents to lose focus using esc key\n\t\t\t\t// Focus will be release when popover be hide\n\t\t\t\tescapeDeactivates: false,\n\t\t\t\tallowOutsideClick: true,\n\t\t\t\tsetReturnFocus: this.setReturnFocus || (!this.noAutoReturnFocus && this.getPopoverTriggerButtonElement()),\n\t\t\t\ttrapStack: getTrapStack(),\n\t\t\t\tfallBackFocus: el,\n\t\t\t})\n\t\t\tthis.$focusTrap.activate()\n\t\t},\n\n\t\t/**\n\t\t * Remove focus trap\n\t\t *\n\t\t * @param {object} options The configuration options for focusTrap\n\t\t */\n\t\tclearFocusTrap(options = {}) {\n\t\t\ttry {\n\t\t\t\tthis.$focusTrap?.deactivate(options)\n\t\t\t\tthis.$focusTrap = null\n\t\t\t} catch (error) {\n\t\t\t\tlogger.warn('Could not clear focus trap', { error })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Add stopPropagation for Escape.\n\t\t * It prevents global Escape handling after closing popover.\n\t\t *\n\t\t * Manual event handling is used here instead of v-on because there is no direct access to the node.\n\t\t * Alternative - wrap <template #popover> in a div wrapper.\n\t\t */\n\t\taddEscapeStopPropagation() {\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel?.addEventListener('keydown', this.stopKeydownEscapeHandler)\n\t\t},\n\n\t\t/**\n\t\t * Remove stop Escape handler\n\t\t */\n\t\tclearEscapeStopPropagation() {\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel?.removeEventListener('keydown', this.stopKeydownEscapeHandler)\n\t\t},\n\n\t\t/**\n\t\t * @param {KeyboardEvent} event - native keydown event\n\t\t */\n\t\tstopKeydownEscapeHandler(event) {\n\t\t\tif (event.type === 'keydown' && event.key === 'Escape') {\n\t\t\t\tevent.stopPropagation()\n\t\t\t}\n\t\t},\n\n\t\tasync afterShow() {\n\t\t\tthis.getPopoverContentElement().addEventListener('transitionend', () => {\n\t\t\t\t/**\n\t\t\t\t * Triggered after the tooltip was visually displayed.\n\t\t\t\t *\n\t\t\t\t * This is different from the 'show' and 'apply-show' which\n\t\t\t\t * run earlier than this where there is no guarantee that the\n\t\t\t\t * tooltip is already visible and in the DOM.\n\t\t\t\t */\n\t\t\t\tthis.$emit('after-show')\n\t\t\t}, { once: true, passive: true })\n\n\t\t\tthis.removeFloatingVueAriaDescribedBy()\n\n\t\t\tawait this.$nextTick()\n\t\t\tawait this.useFocusTrap()\n\t\t\tthis.addEscapeStopPropagation()\n\t\t},\n\n\t\tafterHide() {\n\t\t\tthis.getPopoverContentElement().addEventListener('transitionend', () => {\n\t\t\t\t/**\n\t\t\t\t * Triggered after the tooltip was visually hidden.\n\t\t\t\t *\n\t\t\t\t * This is different from the 'hide' and 'apply-hide' which\n\t\t\t\t * run earlier than this where there is no guarantee that the\n\t\t\t\t * tooltip is already visible and in the DOM.\n\t\t\t\t */\n\t\t\t\tthis.$emit('after-hide')\n\t\t\t}, { once: true, passive: true })\n\n\t\t\tthis.clearFocusTrap()\n\t\t\tthis.clearEscapeStopPropagation()\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" module>\n$arrow-width: 10px;\n// Move the arrow just slightly inside the popover\n// To prevent a visual gap on page scaling\n$arrow-position: $arrow-width - 1px;\n\n// Class is built by floating-vue as \"v-popper--theme-{THEME}\"\n.ncPopover:global(.v-popper--theme-nc-popover-8) {\n\t// Size class comes from the floating-vue library we use\n\t:global(.resize-observer) {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\tleft: 0;\n\t\tz-index: -1;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: none;\n\t\tbackground-color: transparent;\n\t\tpointer-events: none;\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\topacity: 0;\n\n\t\tobject {\n\t\t\tdisplay: block;\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tleft: 0;\n\t\t\theight: 100%;\n\t\t\twidth: 100%;\n\t\t\toverflow: hidden;\n\t\t\tpointer-events: none;\n\t\t\tz-index: -1;\n\t\t}\n\t}\n\n\t&:global(.v-popper__popper) {\n\t\tz-index: 100000;\n\t\ttop: 0;\n\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\tleft: 0;\n\t\tdisplay: block !important;\n\n\t\t:global(.v-popper__wrapper) {\n\t\t\t/*\n\t\t\t * In theory, \"filter: drop-shadow\" would look better here with arrow shadow.\n\t\t\t * In fact, in results in a blurry popover in Chromium on scaling.\n\t\t\t * The hypothesis is that \"filter\" creates a new composition layer,\n\t\t\t * and with GPU acceleration requires the previous layers content to be rasterized.\n\t\t\t * In combination with translate3d from floating-vue, it makes Chromium to first render and rasterize the popover\n\t\t\t * and then apply scaling, which results in a blurry popover.\n\t\t\t */\n\t\t\tbox-shadow: 0 1px 10px var(--color-box-shadow);\n\t\t\tborder-radius: var(--border-radius-large);\n\t\t}\n\n\t\t:global(.v-popper__inner) {\n\t\t\tpadding: 0;\n\t\t\tcolor: var(--color-main-text);\n\t\t\tborder-radius: var(--border-radius-large);\n\t\t\toverflow: hidden;\n\t\t\tbackground: var(--color-main-background);\n\t\t}\n\n\t\t:global(.v-popper__arrow-container) {\n\t\t\tposition: absolute;\n\t\t\tz-index: 1;\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder-style: solid;\n\t\t\tborder-color: transparent;\n\t\t\tborder-width: $arrow-width;\n\t\t}\n\n\t\t&[data-popper-placement^='top'] :global(.v-popper__arrow-container) {\n\t\t\tbottom: -$arrow-position;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-bottom-width: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-top-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='bottom'] :global(.v-popper__arrow-container) {\n\t\t\ttop: -$arrow-position;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-top-width: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-bottom-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='right'] :global(.v-popper__arrow-container) {\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tleft: -$arrow-position;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-left-width: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-right-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='left'] :global(.v-popper__arrow-container) {\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tright: -$arrow-position;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-right-width: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-left-color: var(--color-main-background);\n\t\t}\n\n\t\t&[aria-hidden='true'] {\n\t\t\tvisibility: hidden;\n\t\t\ttransition: opacity var(--animation-quick), visibility var(--animation-quick);\n\t\t\topacity: 0;\n\t\t}\n\n\t\t&[aria-hidden='false'] {\n\t\t\tvisibility: visible;\n\t\t\ttransition: opacity var(--animation-quick);\n\t\t\topacity: 1;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","options"],"mappings":";;;;;;;AAQA,MAAAA,cAAA,gBAAA;AAAA,EACA,MAAA;AAAA,EAEA,UAAA;AACA,WAAA;AAAA,MACA,2BAAA,MAAA,KAAA;AAAA,MACA,2BAAA,MAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,eAAA;AACA,aAAA;AAAA,QACA,iBAAA,KAAA;AAAA,QACA,iBAAA,KAAA,MAAA,SAAA;AAAA,MACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,SAAA;;AAEA,YAAA,gBAAA,cAAA,YAAA,4BAAA;AAAA,MACA,OAAA,KAAA;AAAA,IACA;AAAA,EACA;AACA,CAAA;;;;;;;;;;;;;;;;;AC6HA,MAAA,QAAA;AAGA,QAAA,OAAA,KAAA,IAAA,gBAAA,QAAA,OAAA,QAAA;AAOA,MAAA,YAAA;AAAA,EACA,MAAA;AAAA,EAEA,YAAA;AAAA,IACA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,cAAA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA,CAAA,UAAA,CAAA,QAAA,WAAA,QAAA,QAAA,UAAA,MAA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AAA,KAAA,KAAA,yBAAA;AACA,+BAAA,iBAAA,WAAA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,6BAAA;AACA,YAAA,KAAA,KAAA,yBAAA;AACA,+BAAA,oBAAA,WAAA,KAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,yBAAA,OAAA;AACA,UAAA,MAAA,SAAA,aAAA,MAAA,QAAA,UAAA;AACA,cAAA,gBAAA;AAAA,MACA;AAAA,IACA;AAAA,IAEA,MAAA,YAAA;AACA,WAAA,yBAAA,EAAA,iBAAA,iBAAA,MAAA;AAQA,aAAA,MAAA,YAAA;AAAA,MACA,GAAA,EAAA,MAAA,MAAA,SAAA,KAAA,CAAA;AAEA,WAAA,iCAAA;AAEA,YAAA,KAAA,UAAA;AACA,YAAA,KAAA,aAAA;AACA,WAAA,yBAAA;AAAA,IACA;AAAA,IAEA,YAAA;AACA,WAAA,yBAAA,EAAA,iBAAA,iBAAA,MAAA;AAQA,aAAA,MAAA,YAAA;AAAA,MACA,GAAA,EAAA,MAAA,MAAA,SAAA,KAAA,CAAA;AAEA,WAAA,eAAA;AACA,WAAA,2BAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"NcPopover-BgUZkmjk.cjs","sources":["../../src/components/NcPopover/NcPopoverTriggerProvider.vue","../../src/components/NcPopover/NcPopover.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<script>\nimport { defineComponent } from 'vue'\n\nexport default defineComponent({\n\tname: 'NcPopoverTriggerProvider',\n\n\tprovide() {\n\t\treturn {\n\t\t\t'NcPopover:trigger:shown': () => this.shown,\n\t\t\t'NcPopover:trigger:attrs': () => this.triggerAttrs,\n\t\t}\n\t},\n\n\tprops: {\n\t\t/**\n\t\t * Is the popover currently shown\n\t\t */\n\t\tshown: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\n\t\t/**\n\t\t * ARIA Role of the popup\n\t\t */\n\t\tpopupRole: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\ttriggerAttrs() {\n\t\t\treturn {\n\t\t\t\t'aria-haspopup': this.popupRole,\n\t\t\t\t'aria-expanded': this.shown.toString(),\n\t\t\t}\n\t\t},\n\t},\n\n\trender() {\n\t\t// TODO: Vue 3 - replace with $slots\n\t\treturn this.$scopedSlots.default?.({\n\t\t\tattrs: this.triggerAttrs,\n\t\t})\n\t},\n})\n</script>\n","<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<docs>\n\n### General description\n\nThis component is just a wrapper for the floating-vue plugin by Akryum,\nplease refer to this documentation for customization:\nhttps://github.com/Akryum/floating-vue\n\nThis components has two slots:\n* 'trigger' which can be any html element and it will trigger the popover\nthis slot is optional since you can toggle the popover also by updating the\nopen prop on this component;\n\n* a default slot that is for the content of the popover.\n\n### Examples\n\n#### With a `<NcButton>` as a trigger:\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>I am the trigger</NcButton>\n\t\t\t</template>\n\t\t\t<template>\n\t\t\t\t<form tabindex=\"0\" role=\"dialog\" aria-labelledby=\"popover-example-dialog-header-1\" @submit.prevent>\n\t\t\t\t\t<h2 id=\"popover-example-dialog-header-1\">this is some content</h2>\n\t\t\t\t\t<p>\n\t\t\t\t\t\tLorem ipsum dolor sit amet, consectetur adipiscing elit. <br/>\n\t\t\t\t\t\tVestibulum eget placerat velit.\n\t\t\t\t\t</p>\n\t\t\t\t\t<label>\n\t\t\t\t\t\tLabel element\n\t\t\t\t\t\t<input type=\"text\" placeholder=\"input element\"/>\n\t\t\t\t\t</label>\n\t\t\t\t</form>\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### Without focus trap:\n\nThe [`focus-trap`](https://github.com/focus-trap/focus-trap) emits an error when used in a non-focusable element tree.\n\nThe prop `:focus-trap=\"false\"` help to prevent it when the default behavior is not relevant.\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover :focus-trap=\"false\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>Click me!</NcButton>\n\t\t\t</template>\n\t\t\t<template>\n\t\t\t\tHi! 🚀\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### With passing props to `floating-vue`'s `Dropdown`:\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover container=\"body\" :popper-hide-triggers=\"(triggers) => [...triggers, 'click']\" popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>I am the trigger</NcButton>\n\t\t\t</template>\n\t\t\t<template #default>\n\t\t\t\t<NcButton>Click on the button will close NcPopover</NcButton>\n\t\t\t</template>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### With a custom button in as a trigger:\n\nWhen `<NcButton>` is used as a `<NcPopover>` trigger, it injects required for a11y attributes to the button.\n\nIf you are using your own custom button as a trigger make sure to bind `attrs` from the trigger slot props.\nSee code example below.\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<NcPopover>\n\t\t\t<!-- Take \"attrs\" from the slot props -->\n\t\t\t<template #trigger=\"{ attrs }\">\n\t\t\t\t<!-- Bind attrs as the button attrs -->\n\t\t\t\t<button v-bind=\"attrs\">\n\t\t\t\t\tI am a custom button in the trigger\n\t\t\t\t</button>\n\t\t\t</template>\n\n\t\t\tHi! 🚀\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n\n#### Provide role for the popover content\n\nFor accessibility reasons, popover should have a role. Provide it to the `popup-role` and make sure that the popover content is an element with the same role.\n\nSee: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup\n\n```vue\n<template>\n\t<div style=\"display: flex\">\n\t\t<!-- Provide popup role -->\n\t\t<NcPopover popup-role=\"dialog\">\n\t\t\t<template #trigger>\n\t\t\t\t<NcButton>Delete</NcButton>\n\t\t\t</template>\n\n\t\t\t<!-- Popover content should has the same role -->\n\t\t\t<div role=\"dialog\" aria-labelledby=\"popover-example-custom-role-1\" aria-modal=\"true\">\n\t\t\t\t<!-- This is not required but better to provide a label -->\n\t\t\t\t<header id=\"popover-example-custom-role-1\">\n\t\t\t\t\t<strong>Confirm remove</strong>\n\t\t\t\t</header>\n\t\t\t\t<NcButton type=\"danger\">Delete</NcButton>\n\t\t\t</div>\n\t\t</NcPopover>\n\t</div>\n</template>\n```\n</docs>\n\n<template>\n\t<Dropdown\n\t\tref=\"popover\"\n\t\t:distance=\"10\"\n\t\t:arrow-padding=\"10\"\n\t\tv-bind=\"$attrs\"\n\t\t:no-auto-focus=\"true /* Handled by the focus trap */\"\n\t\t:popper-class=\"[$style.ncPopover, popoverBaseClass]\"\n\t\t:theme=\"THEME\"\n\t\t:shown=\"internalShown\"\n\t\tv-on=\"$listeners\"\n\t\t@update:shown=\"internalShown = $event\"\n\t\t@apply-show=\"afterShow\"\n\t\t@apply-hide=\"afterHide\">\n\t\t<NcPopoverTriggerProvider v-slot=\"slotProps\" :shown=\"internalShown\" :popup-role=\"popupRole\">\n\t\t\t<!-- This will be the popover target (for the events and position) -->\n\t\t\t<slot name=\"trigger\" v-bind=\"slotProps\" />\n\t\t</NcPopoverTriggerProvider>\n\n\t\t<!-- This will be the content of the popover -->\n\t\t<template #popper=\"slotProps\">\n\t\t\t<slot name=\"default\" v-bind=\"slotProps\" />\n\t\t</template>\n\t</Dropdown>\n</template>\n\n<script>\nimport { Dropdown, options } from 'floating-vue'\nimport { createFocusTrap } from 'focus-trap'\nimport { tabbable } from 'tabbable'\nimport Vue from 'vue'\nimport NcPopoverTriggerProvider from './NcPopoverTriggerProvider.vue'\nimport { getTrapStack } from '../../utils/focusTrap.ts'\nimport { logger } from '../../utils/logger.ts'\n\nconst THEME = 'nc-popover-8'\n\n// NcPopover has a custom theme to have a custom name but same as the default \"dropdown\" theme\noptions.themes[THEME] = structuredClone(options.themes.dropdown)\n\n/**\n * @typedef {import('focus-trap').FocusTargetValueOrFalse} FocusTargetValueOrFalse\n * @typedef {FocusTargetValueOrFalse|() => FocusTargetValueOrFalse} SetReturnFocus\n */\n\nexport default {\n\tname: 'NcPopover',\n\n\tcomponents: {\n\t\tDropdown,\n\t\tNcPopoverTriggerProvider,\n\t},\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\t/**\n\t\t * Show or hide the popper\n\t\t *\n\t\t * @see https://floating-vue.starpad.dev/api/#shown\n\t\t */\n\t\tshown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Popup role\n\t\t *\n\t\t * @see https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-haspopup#values\n\t\t */\n\t\tpopupRole: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t\tvalidator: (value) => ['menu', 'listbox', 'tree', 'grid', 'dialog', 'true'].includes(value),\n\t\t},\n\n\t\t/**\n\t\t * Class to be applied to the popover base\n\t\t */\n\t\tpopoverBaseClass: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\n\t\t/**\n\t\t * Enable popover focus trap\n\t\t *\n\t\t * @deprecated use noFocusTrap instead\n\t\t */\n\t\tfocusTrap: {\n\t\t\ttype: Boolean,\n\t\t\t// eslint-disable-next-line vue/no-boolean-default\n\t\t\tdefault: true,\n\t\t},\n\n\t\t/**\n\t\t * Disable the popover focus trap.\n\t\t */\n\t\tnoFocusTrap: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Set element to return focus to after focus trap deactivation\n\t\t *\n\t\t * @type {SetReturnFocus}\n\t\t */\n\t\tsetReturnFocus: {\n\t\t\tdefault: undefined,\n\t\t\ttype: [Boolean, HTMLElement, SVGElement, String, Function],\n\t\t},\n\n\t\t/**\n\t\t * When there is no setReturnFocus, NcPopover will try to return focus to the trigger button.\n\t\t * Use this prop to disable this behavior.\n\t\t */\n\t\tnoAutoReturnFocus: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\temits: [\n\t\t'after-show',\n\t\t'after-hide',\n\t\t/**\n\t\t * @see https://floating-vue.starpad.dev/api/#update-shown\n\t\t */\n\t\t'update:shown',\n\t],\n\n\tsetup() {\n\t\treturn {\n\t\t\tTHEME,\n\t\t}\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tinternalShown: this.shown,\n\t\t}\n\t},\n\n\twatch: {\n\t\tshown(value) {\n\t\t\tthis.internalShown = value\n\t\t},\n\n\t\tinternalShown(value) {\n\t\t\tthis.$emit('update:shown', value)\n\t\t},\n\t},\n\n\tmounted() {\n\t\tthis.checkTriggerA11y()\n\t},\n\n\tbeforeDestroy() {\n\t\tthis.clearFocusTrap()\n\t\tthis.clearEscapeStopPropagation()\n\t},\n\n\tmethods: {\n\t\t/**\n\t\t * Check if the trigger has all required a11y attributes.\n\t\t * Important to check custom trigger button.\n\t\t */\n\t\tcheckTriggerA11y() {\n\t\t\tif (window.OC?.debug) {\n\t\t\t\tconst triggerButton = this.getPopoverTriggerButtonElement()\n\t\t\t\tif (!triggerButton || !triggerButton.hasAttributes('aria-expanded', 'aria-haspopup')) {\n\t\t\t\t\tVue.util.warn('It looks like you are using a custom button as a <NcPopover> or other popover #trigger. If you are not using <NcButton> as a trigger, you need to bind attrs from the #trigger slot props to your custom button. See <NcPopover> docs for an example.')\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Remove incorrect aria-describedby attribute from the trigger.\n\t\t *\n\t\t * @see https://github.com/Akryum/floating-vue/blob/8d4f7125aae0e3ea00ba4093d6d2001ab15058f1/packages/floating-vue/src/components/Popper.ts#L734\n\t\t */\n\t\tremoveFloatingVueAriaDescribedBy() {\n\t\t\t// When the popover is shown, floating-vue mutates the root elements of the trigger adding data-popper-shown and incorrect aria-describedby attributes.\n\t\t\tconst triggerContainer = this.getPopoverTriggerElement()\n\t\t\tconst triggerElements = triggerContainer.querySelectorAll('[data-popper-shown]')\n\t\t\tfor (const el of triggerElements) {\n\t\t\t\tel.removeAttribute('aria-describedby')\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverContentElement() {\n\t\t\treturn this.$refs.popover?.$refs.popperContent?.$el\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverTriggerElement() {\n\t\t\t// TODO: Vue 3: should be\n\t\t\t// this.$refs.popover.$refs.popper.$refs.reference\n\t\t\treturn this.$refs.popover.$refs.reference\n\t\t},\n\n\t\t/**\n\t\t * @return {HTMLElement|undefined}\n\t\t */\n\t\tgetPopoverTriggerButtonElement() {\n\t\t\tconst triggerContainer = this.getPopoverTriggerElement()\n\t\t\treturn triggerContainer && tabbable(triggerContainer)[0]\n\t\t},\n\n\t\t/**\n\t\t * Add focus trap for accessibility.\n\t\t */\n\t\tasync useFocusTrap() {\n\t\t\tawait this.$nextTick()\n\n\t\t\tif (this.noFocusTrap || !this.focusTrap) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel.tabIndex = -1\n\n\t\t\tif (!el) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Init focus trap\n\t\t\tthis.$focusTrap = createFocusTrap(el, {\n\t\t\t\t// Prevents to lose focus using esc key\n\t\t\t\t// Focus will be release when popover be hide\n\t\t\t\tescapeDeactivates: false,\n\t\t\t\tallowOutsideClick: true,\n\t\t\t\tsetReturnFocus: this.setReturnFocus || (!this.noAutoReturnFocus && this.getPopoverTriggerButtonElement()),\n\t\t\t\ttrapStack: getTrapStack(),\n\t\t\t\tfallBackFocus: el,\n\t\t\t})\n\t\t\tthis.$focusTrap.activate()\n\t\t},\n\n\t\t/**\n\t\t * Remove focus trap\n\t\t *\n\t\t * @param {object} options The configuration options for focusTrap\n\t\t */\n\t\tclearFocusTrap(options = {}) {\n\t\t\ttry {\n\t\t\t\tthis.$focusTrap?.deactivate(options)\n\t\t\t\tthis.$focusTrap = null\n\t\t\t} catch (error) {\n\t\t\t\tlogger.warn('Could not clear focus trap', { error })\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Add stopPropagation for Escape.\n\t\t * It prevents global Escape handling after closing popover.\n\t\t *\n\t\t * Manual event handling is used here instead of v-on because there is no direct access to the node.\n\t\t * Alternative - wrap <template #popover> in a div wrapper.\n\t\t */\n\t\taddEscapeStopPropagation() {\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel?.addEventListener('keydown', this.stopKeydownEscapeHandler)\n\t\t},\n\n\t\t/**\n\t\t * Remove stop Escape handler\n\t\t */\n\t\tclearEscapeStopPropagation() {\n\t\t\tconst el = this.getPopoverContentElement()\n\t\t\tel?.removeEventListener('keydown', this.stopKeydownEscapeHandler)\n\t\t},\n\n\t\t/**\n\t\t * @param {KeyboardEvent} event - native keydown event\n\t\t */\n\t\tstopKeydownEscapeHandler(event) {\n\t\t\tif (event.type === 'keydown' && event.key === 'Escape') {\n\t\t\t\tevent.stopPropagation()\n\t\t\t}\n\t\t},\n\n\t\tasync afterShow() {\n\t\t\tthis.getPopoverContentElement().addEventListener('transitionend', () => {\n\t\t\t\t/**\n\t\t\t\t * Triggered after the tooltip was visually displayed.\n\t\t\t\t *\n\t\t\t\t * This is different from the 'show' and 'apply-show' which\n\t\t\t\t * run earlier than this where there is no guarantee that the\n\t\t\t\t * tooltip is already visible and in the DOM.\n\t\t\t\t */\n\t\t\t\tthis.$emit('after-show')\n\t\t\t}, { once: true, passive: true })\n\n\t\t\tthis.removeFloatingVueAriaDescribedBy()\n\n\t\t\tawait this.$nextTick()\n\t\t\tawait this.useFocusTrap()\n\t\t\tthis.addEscapeStopPropagation()\n\t\t},\n\n\t\tafterHide() {\n\t\t\tthis.getPopoverContentElement().addEventListener('transitionend', () => {\n\t\t\t\t/**\n\t\t\t\t * Triggered after the tooltip was visually hidden.\n\t\t\t\t *\n\t\t\t\t * This is different from the 'hide' and 'apply-hide' which\n\t\t\t\t * run earlier than this where there is no guarantee that the\n\t\t\t\t * tooltip is already visible and in the DOM.\n\t\t\t\t */\n\t\t\t\tthis.$emit('after-hide')\n\t\t\t}, { once: true, passive: true })\n\n\t\t\tthis.clearFocusTrap()\n\t\t\tthis.clearEscapeStopPropagation()\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" module>\n$arrow-width: 10px;\n// Move the arrow just slightly inside the popover\n// To prevent a visual gap on page scaling\n$arrow-position: $arrow-width - 1px;\n\n// Class is built by floating-vue as \"v-popper--theme-{THEME}\"\n.ncPopover:global(.v-popper--theme-nc-popover-8) {\n\t// Size class comes from the floating-vue library we use\n\t:global(.resize-observer) {\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\tleft: 0;\n\t\tz-index: -1;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tborder: none;\n\t\tbackground-color: transparent;\n\t\tpointer-events: none;\n\t\tdisplay: block;\n\t\toverflow: hidden;\n\t\topacity: 0;\n\n\t\tobject {\n\t\t\tdisplay: block;\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tleft: 0;\n\t\t\theight: 100%;\n\t\t\twidth: 100%;\n\t\t\toverflow: hidden;\n\t\t\tpointer-events: none;\n\t\t\tz-index: -1;\n\t\t}\n\t}\n\n\t&:global(.v-popper__popper) {\n\t\tz-index: 100000;\n\t\ttop: 0;\n\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\tleft: 0;\n\t\tdisplay: block !important;\n\n\t\t:global(.v-popper__wrapper) {\n\t\t\t/*\n\t\t\t * In theory, \"filter: drop-shadow\" would look better here with arrow shadow.\n\t\t\t * In fact, in results in a blurry popover in Chromium on scaling.\n\t\t\t * The hypothesis is that \"filter\" creates a new composition layer,\n\t\t\t * and with GPU acceleration requires the previous layers content to be rasterized.\n\t\t\t * In combination with translate3d from floating-vue, it makes Chromium to first render and rasterize the popover\n\t\t\t * and then apply scaling, which results in a blurry popover.\n\t\t\t */\n\t\t\tbox-shadow: 0 1px 10px var(--color-box-shadow);\n\t\t\tborder-radius: var(--border-radius-large);\n\t\t}\n\n\t\t:global(.v-popper__inner) {\n\t\t\tpadding: 0;\n\t\t\tcolor: var(--color-main-text);\n\t\t\tborder-radius: var(--border-radius-large);\n\t\t\toverflow: hidden;\n\t\t\tbackground: var(--color-main-background);\n\t\t}\n\n\t\t:global(.v-popper__arrow-container) {\n\t\t\tposition: absolute;\n\t\t\tz-index: 1;\n\t\t\twidth: 0;\n\t\t\theight: 0;\n\t\t\tborder-style: solid;\n\t\t\tborder-color: transparent;\n\t\t\tborder-width: $arrow-width;\n\t\t}\n\n\t\t&[data-popper-placement^='top'] :global(.v-popper__arrow-container) {\n\t\t\tbottom: -$arrow-position;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-bottom-width: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-top-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='bottom'] :global(.v-popper__arrow-container) {\n\t\t\ttop: -$arrow-position;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-top-width: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-bottom-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='right'] :global(.v-popper__arrow-container) {\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tleft: -$arrow-position;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-left-width: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-right-color: var(--color-main-background);\n\t\t}\n\n\t\t&[data-popper-placement^='left'] :global(.v-popper__arrow-container) {\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tright: -$arrow-position;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-right-width: 0;\n\t\t\t/* stylelint-disable-next-line csstools/use-logical */ /* upstream logic */\n\t\t\tborder-left-color: var(--color-main-background);\n\t\t}\n\n\t\t&[aria-hidden='true'] {\n\t\t\tvisibility: hidden;\n\t\t\ttransition: opacity var(--animation-quick), visibility var(--animation-quick);\n\t\t\topacity: 0;\n\t\t}\n\n\t\t&[aria-hidden='false'] {\n\t\t\tvisibility: visible;\n\t\t\ttransition: opacity var(--animation-quick);\n\t\t\topacity: 1;\n\t\t}\n\t}\n}\n\n</style>\n"],"names":["_sfc_main","defineComponent","options","Dropdown","Vue","tabbable","createFocusTrap","getTrapStack","logger"],"mappings":";;;;;;;;;;AAQA,MAAAA,cAAAC,IAAAA,gBAAA;AAAA,EACA,MAAA;AAAA,EAEA,UAAA;AACA,WAAA;AAAA,MACA,2BAAA,MAAA,KAAA;AAAA,MACA,2BAAA,MAAA,KAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,OAAA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAKA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,EACA;AAAA,EAEA,UAAA;AAAA,IACA,eAAA;AACA,aAAA;AAAA,QACA,iBAAA,KAAA;AAAA,QACA,iB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AA;AACA,WAAA,yBAAA,EAAA,iBAAA,iBAAA,MAAA;AAQA,aAAA,MAAA,YAAA;AAAA,MACA,GAAA,EAAA,MAAA,MAAA,SAAA,KAAA,CAAA;AAEA,WAAA,eAAA;AACA,WAAA,2BAAA;AAAA,IACA;AAAA,EACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ import { createFocusTrap } from "focus-trap";
|
|
|
4
4
|
import { tabbable } from "tabbable";
|
|
5
5
|
import Vue, { defineComponent } from "vue";
|
|
6
6
|
import { n as normalizeComponent } from "./_plugin-vue2_normalizer-DU4iP6Vu.mjs";
|
|
7
|
-
import { g as getTrapStack } from "./focusTrap-
|
|
7
|
+
import { g as getTrapStack } from "./focusTrap-HJQ4pqHV.mjs";
|
|
8
8
|
import { l as logger } from "./logger-D3RVzcfQ.mjs";
|
|
9
9
|
const _sfc_main$1 = defineComponent({
|
|
10
10
|
name: "NcPopoverTriggerProvider",
|
|
@@ -39,8 +39,7 @@ const _sfc_main$1 = defineComponent({
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
render() {
|
|
42
|
-
|
|
43
|
-
return (_b = (_a = this.$scopedSlots).default) == null ? void 0 : _b.call(_a, {
|
|
42
|
+
return this.$scopedSlots.default?.({
|
|
44
43
|
attrs: this.triggerAttrs
|
|
45
44
|
});
|
|
46
45
|
}
|
|
@@ -171,8 +170,7 @@ const _sfc_main = {
|
|
|
171
170
|
* Important to check custom trigger button.
|
|
172
171
|
*/
|
|
173
172
|
checkTriggerA11y() {
|
|
174
|
-
|
|
175
|
-
if ((_a = window.OC) == null ? void 0 : _a.debug) {
|
|
173
|
+
if (window.OC?.debug) {
|
|
176
174
|
const triggerButton = this.getPopoverTriggerButtonElement();
|
|
177
175
|
if (!triggerButton || !triggerButton.hasAttributes("aria-expanded", "aria-haspopup")) {
|
|
178
176
|
Vue.util.warn("It looks like you are using a custom button as a <NcPopover> or other popover #trigger. If you are not using <NcButton> as a trigger, you need to bind attrs from the #trigger slot props to your custom button. See <NcPopover> docs for an example.");
|
|
@@ -195,8 +193,7 @@ const _sfc_main = {
|
|
|
195
193
|
* @return {HTMLElement|undefined}
|
|
196
194
|
*/
|
|
197
195
|
getPopoverContentElement() {
|
|
198
|
-
|
|
199
|
-
return (_b = (_a = this.$refs.popover) == null ? void 0 : _a.$refs.popperContent) == null ? void 0 : _b.$el;
|
|
196
|
+
return this.$refs.popover?.$refs.popperContent?.$el;
|
|
200
197
|
},
|
|
201
198
|
/**
|
|
202
199
|
* @return {HTMLElement|undefined}
|
|
@@ -241,9 +238,8 @@ const _sfc_main = {
|
|
|
241
238
|
* @param {object} options The configuration options for focusTrap
|
|
242
239
|
*/
|
|
243
240
|
clearFocusTrap(options2 = {}) {
|
|
244
|
-
var _a;
|
|
245
241
|
try {
|
|
246
|
-
|
|
242
|
+
this.$focusTrap?.deactivate(options2);
|
|
247
243
|
this.$focusTrap = null;
|
|
248
244
|
} catch (error) {
|
|
249
245
|
logger.warn("Could not clear focus trap", { error });
|
|
@@ -258,14 +254,14 @@ const _sfc_main = {
|
|
|
258
254
|
*/
|
|
259
255
|
addEscapeStopPropagation() {
|
|
260
256
|
const el = this.getPopoverContentElement();
|
|
261
|
-
el
|
|
257
|
+
el?.addEventListener("keydown", this.stopKeydownEscapeHandler);
|
|
262
258
|
},
|
|
263
259
|
/**
|
|
264
260
|
* Remove stop Escape handler
|
|
265
261
|
*/
|
|
266
262
|
clearEscapeStopPropagation() {
|
|
267
263
|
const el = this.getPopoverContentElement();
|
|
268
|
-
el
|
|
264
|
+
el?.removeEventListener("keydown", this.stopKeydownEscapeHandler);
|
|
269
265
|
},
|
|
270
266
|
/**
|
|
271
267
|
* @param {KeyboardEvent} event - native keydown event
|
|
@@ -324,4 +320,4 @@ const NcPopover = __component__.exports;
|
|
|
324
320
|
export {
|
|
325
321
|
NcPopover as N
|
|
326
322
|
};
|
|
327
|
-
//# sourceMappingURL=NcPopover-
|
|
323
|
+
//# sourceMappingURL=NcPopover-gxcAqoEb.mjs.map
|