@feugene/granularity 0.1.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/LICENSE +201 -0
- package/README.md +79 -0
- package/dist/assets/granularity-2oOxNk_f.css +2 -0
- package/dist/chunks/DsAlert-r_Ed-JrB.js +129 -0
- package/dist/chunks/DsAvatar-cyMI8jUi.js +32 -0
- package/dist/chunks/DsBadge-Dnd7_I-K.js +27 -0
- package/dist/chunks/DsBadgeWrap-UgP-TMdA.js +26 -0
- package/dist/chunks/DsBottomNav-Dze5cFVz.js +21 -0
- package/dist/chunks/DsButton-CA18Fha-.js +67 -0
- package/dist/chunks/DsButtonGroup-Ceat9ADe.js +16 -0
- package/dist/chunks/DsCard-GtapCsjq.js +10 -0
- package/dist/chunks/DsCheckbox-Afg94qUm.js +101 -0
- package/dist/chunks/DsCollapse-DWfip4gp.js +144 -0
- package/dist/chunks/DsConfirmDialog-DdUrG-DW.js +87 -0
- package/dist/chunks/DsDataTable-DgBkEgDK.js +91 -0
- package/dist/chunks/DsDialog-BAGAa9DN.js +178 -0
- package/dist/chunks/DsDrawer-gmVF_0I0.js +112 -0
- package/dist/chunks/DsDropdown-BcFjxaMe.js +106 -0
- package/dist/chunks/DsDropdownMenu-CA7259h5.js +218 -0
- package/dist/chunks/DsEmptyState-BdLoQ0-z.js +46 -0
- package/dist/chunks/DsFileUpload-IwtpKocj.js +282 -0
- package/dist/chunks/DsFormField-XVZK7YVU.js +28 -0
- package/dist/chunks/DsFormFile-C5ldcCAs.js +219 -0
- package/dist/chunks/DsFormSection-DmIDIQg7.js +18 -0
- package/dist/chunks/DsIcon-Q-KQGAQU.js +25 -0
- package/dist/chunks/DsImageViewer-C9NZ42St.js +313 -0
- package/dist/chunks/DsInput-DeoAkT6R.js +159 -0
- package/dist/chunks/DsInputTag-DWip_-Cr.js +201 -0
- package/dist/chunks/DsLink-CWpVQ0ij.js +56 -0
- package/dist/chunks/DsList-XI8AAk9b.js +31 -0
- package/dist/chunks/DsLoading-ogfmbPE4.js +53 -0
- package/dist/chunks/DsModal-Bl9r6v33.js +75 -0
- package/dist/chunks/DsNavbar-DJ4bv_MR.js +54 -0
- package/dist/chunks/DsNumberInput-D-m5QoQJ.js +301 -0
- package/dist/chunks/DsPagination-B28ms0hc.js +81 -0
- package/dist/chunks/DsProgressBar-Bkuqudkg.js +27 -0
- package/dist/chunks/DsPromptDialog-DdSca52S.js +133 -0
- package/dist/chunks/DsRadio-x2vmEUCv.js +141 -0
- package/dist/chunks/DsRadioGroup-CzlzJF2E.js +63 -0
- package/dist/chunks/DsSegmented-BwQ8VnOZ.js +250 -0
- package/dist/chunks/DsSelect-DEHGeICn.js +304 -0
- package/dist/chunks/DsSidebar-BNLaBCYD.js +18 -0
- package/dist/chunks/DsSkeleton-BcXabaQ7.js +25 -0
- package/dist/chunks/DsSwitch-DBdjltGz.js +60 -0
- package/dist/chunks/DsTable-apqrsbxV.js +10 -0
- package/dist/chunks/DsTabs-B1kkklFS.js +47 -0
- package/dist/chunks/DsTextarea-DVSsoqi3.js +56 -0
- package/dist/chunks/DsToaster-B9u2x_Ii.js +48 -0
- package/dist/chunks/DsTooltip-BqNVJw2f.js +27 -0
- package/dist/chunks/DsTree-Bz37FcIb.js +602 -0
- package/dist/chunks/DsTreeSelect-CU0aC9Mz.js +319 -0
- package/dist/chunks/_plugin-vue_export-helper-DOgycIVc.js +8 -0
- package/dist/chunks/adapter-BKKNB3Ii.js +4 -0
- package/dist/chunks/arrow-up-B4OlmAKz.js +23 -0
- package/dist/chunks/classTokens-CT1tqF2j.js +6 -0
- package/dist/chunks/componentConfig-CQndJxd1.js +14 -0
- package/dist/chunks/config-4vrmi-D0.js +9 -0
- package/dist/chunks/config-ANT_Zf3l.js +18 -0
- package/dist/chunks/config-B-tMv4PT.js +66 -0
- package/dist/chunks/config-B75oSW74.js +18 -0
- package/dist/chunks/config-B7HAOCA1.js +33 -0
- package/dist/chunks/config-B7yrZO9u.js +18 -0
- package/dist/chunks/config-B98-jCfY.js +9 -0
- package/dist/chunks/config-BDJ2JaFs.js +9 -0
- package/dist/chunks/config-BEzNFZ_R.js +10 -0
- package/dist/chunks/config-BKpHj94n.js +13 -0
- package/dist/chunks/config-BLYxW-WQ.js +9 -0
- package/dist/chunks/config-BS0vLD_L.js +41 -0
- package/dist/chunks/config-BXlW2GSa.js +33 -0
- package/dist/chunks/config-BY6edpDp.js +9 -0
- package/dist/chunks/config-BZDKypuQ.js +8 -0
- package/dist/chunks/config-BeJEy8yN.js +9 -0
- package/dist/chunks/config-BnryTLnh.js +47 -0
- package/dist/chunks/config-BqaCteFh2.js +9 -0
- package/dist/chunks/config-BrwOndwO.js +9 -0
- package/dist/chunks/config-BusLdkqX.js +8 -0
- package/dist/chunks/config-CBo4aVMV.js +8 -0
- package/dist/chunks/config-CLyDbB2M.js +14 -0
- package/dist/chunks/config-CML-WrGM.js +10 -0
- package/dist/chunks/config-CMuBf0u72.js +33 -0
- package/dist/chunks/config-CTGjkM7q.js +140 -0
- package/dist/chunks/config-CVEwIRRR.js +30 -0
- package/dist/chunks/config-Ch0TH9wN.js +42 -0
- package/dist/chunks/config-ClPYX-LP.js +24 -0
- package/dist/chunks/config-DA3cYUSo.js +8 -0
- package/dist/chunks/config-DAiP4yeJ.js +8 -0
- package/dist/chunks/config-DG_de8vE.js +15 -0
- package/dist/chunks/config-DIgvSIEs.js +9 -0
- package/dist/chunks/config-DJ7xDo-q.js +16 -0
- package/dist/chunks/config-DSFnRpu82.js +19 -0
- package/dist/chunks/config-DVHe_id-.js +22 -0
- package/dist/chunks/config-DoT3gzx7.js +9 -0
- package/dist/chunks/config-DuaBaVyF.js +34 -0
- package/dist/chunks/config-F4Bb6hVJ.js +30 -0
- package/dist/chunks/config-G7h6ftb62.js +39 -0
- package/dist/chunks/config-aUoIf7kK.js +28 -0
- package/dist/chunks/config-cKk87ycz2.js +14 -0
- package/dist/chunks/config-kfb3OyGZ.js +24 -0
- package/dist/chunks/config-oDjY8ZrP2.js +8 -0
- package/dist/chunks/config-panSV6Wo.js +9 -0
- package/dist/chunks/config-qlwX-rLq.js +42 -0
- package/dist/chunks/config-tQBoBLph.js +26 -0
- package/dist/chunks/dsBadgeStyles-yLd1GFUa.js +52 -0
- package/dist/chunks/dsButtonStyles-C1c_j958.js +207 -0
- package/dist/chunks/dsDialogStyles-C7QOvzmt.js +11 -0
- package/dist/chunks/dsDropdownStyles-DXGN-A-d.js +37 -0
- package/dist/chunks/dsFormFieldStyles-DspgXEqY.js +9 -0
- package/dist/chunks/dsLoadingStyles-B2ScgHwn.js +16 -0
- package/dist/chunks/dsModalStyles-C7E5kJ1o.js +54 -0
- package/dist/chunks/dsSelectStyles-Bym0uW4f.js +82 -0
- package/dist/chunks/en-CKkdzd7q.js +39 -0
- package/dist/chunks/es-CPXSlGMa.js +39 -0
- package/dist/chunks/fileValidation-gR8aUBMZ.js +193 -0
- package/dist/chunks/granularityI18n-DBuOHekC.js +24 -0
- package/dist/chunks/info-CmLOtVnO.js +26 -0
- package/dist/chunks/loader-circle-DtXjkqR7.js +23 -0
- package/dist/chunks/preset-DBXBjf5u.js +2235 -0
- package/dist/chunks/ru-D7AyvUyA.js +39 -0
- package/dist/chunks/transition-CT9vsWnT.js +1617 -0
- package/dist/chunks/x-circle-BZnfL2nz.js +61 -0
- package/dist/chunks/x-dGjszOU2.js +23 -0
- package/dist/components/DsAlert/index.js +3 -0
- package/dist/components/DsAlert/styles.css +386 -0
- package/dist/components/DsAvatar/index.js +3 -0
- package/dist/components/DsAvatar/styles.css +373 -0
- package/dist/components/DsBadge/index.js +4 -0
- package/dist/components/DsBadge/styles.css +422 -0
- package/dist/components/DsBadgeWrap/index.js +3 -0
- package/dist/components/DsBadgeWrap/styles.css +378 -0
- package/dist/components/DsBottomNav/index.js +3 -0
- package/dist/components/DsBottomNav/styles.css +388 -0
- package/dist/components/DsButton/index.js +4 -0
- package/dist/components/DsButton/styles.css +633 -0
- package/dist/components/DsButton/tokens.css +96 -0
- package/dist/components/DsButtonGroup/index.js +3 -0
- package/dist/components/DsButtonGroup/styles.css +23 -0
- package/dist/components/DsCard/index.js +3 -0
- package/dist/components/DsCard/styles.css +365 -0
- package/dist/components/DsCheckbox/index.js +3 -0
- package/dist/components/DsCheckbox/styles.css +394 -0
- package/dist/components/DsCollapse/index.js +3 -0
- package/dist/components/DsCollapse/styles.css +399 -0
- package/dist/components/DsConfirmDialog/index.js +3 -0
- package/dist/components/DsConfirmDialog/styles.css +595 -0
- package/dist/components/DsDataTable/index.js +3 -0
- package/dist/components/DsDataTable/styles.css +387 -0
- package/dist/components/DsDialog/index.js +3 -0
- package/dist/components/DsDialog/styles.css +592 -0
- package/dist/components/DsDrawer/index.js +3 -0
- package/dist/components/DsDrawer/styles.css +579 -0
- package/dist/components/DsDropdown/index.js +4 -0
- package/dist/components/DsDropdown/styles.css +392 -0
- package/dist/components/DsDropdownMenu/index.js +3 -0
- package/dist/components/DsDropdownMenu/styles.css +430 -0
- package/dist/components/DsEmptyState/index.js +3 -0
- package/dist/components/DsEmptyState/styles.css +380 -0
- package/dist/components/DsFileUpload/index.js +4 -0
- package/dist/components/DsFileUpload/styles.css +403 -0
- package/dist/components/DsFormField/index.js +3 -0
- package/dist/components/DsFormField/styles.css +365 -0
- package/dist/components/DsFormFile/index.js +3 -0
- package/dist/components/DsFormFile/styles.css +555 -0
- package/dist/components/DsFormSection/index.js +3 -0
- package/dist/components/DsFormSection/styles.css +365 -0
- package/dist/components/DsIcon/index.js +3 -0
- package/dist/components/DsIcon/styles.css +20 -0
- package/dist/components/DsIcon/tokens.css +3 -0
- package/dist/components/DsImageViewer/index.js +3 -0
- package/dist/components/DsImageViewer/styles.css +465 -0
- package/dist/components/DsInput/index.js +3 -0
- package/dist/components/DsInput/styles.css +416 -0
- package/dist/components/DsInputTag/index.js +3 -0
- package/dist/components/DsInputTag/styles.css +498 -0
- package/dist/components/DsLink/index.js +3 -0
- package/dist/components/DsLink/styles.css +390 -0
- package/dist/components/DsList/index.js +3 -0
- package/dist/components/DsList/styles.css +376 -0
- package/dist/components/DsLoading/index.js +4 -0
- package/dist/components/DsLoading/styles.css +381 -0
- package/dist/components/DsModal/index.js +4 -0
- package/dist/components/DsModal/styles.css +404 -0
- package/dist/components/DsNavbar/index.js +3 -0
- package/dist/components/DsNavbar/styles.css +549 -0
- package/dist/components/DsNumberInput/index.js +3 -0
- package/dist/components/DsNumberInput/styles.css +428 -0
- package/dist/components/DsPagination/index.js +3 -0
- package/dist/components/DsPagination/styles.css +637 -0
- package/dist/components/DsProgressBar/index.js +3 -0
- package/dist/components/DsProgressBar/styles.css +398 -0
- package/dist/components/DsProgressBar/tokens.css +23 -0
- package/dist/components/DsPromptDialog/index.js +3 -0
- package/dist/components/DsPromptDialog/styles.css +622 -0
- package/dist/components/DsRadio/index.js +3 -0
- package/dist/components/DsRadio/styles.css +558 -0
- package/dist/components/DsRadioGroup/index.js +3 -0
- package/dist/components/DsRadioGroup/styles.css +560 -0
- package/dist/components/DsSegmented/index.js +3 -0
- package/dist/components/DsSegmented/styles.css +422 -0
- package/dist/components/DsSegmented/tokens.css +9 -0
- package/dist/components/DsSelect/index.js +4 -0
- package/dist/components/DsSelect/styles.css +483 -0
- package/dist/components/DsSidebar/index.js +3 -0
- package/dist/components/DsSidebar/styles.css +370 -0
- package/dist/components/DsSkeleton/index.js +3 -0
- package/dist/components/DsSkeleton/styles.css +363 -0
- package/dist/components/DsSwitch/index.js +3 -0
- package/dist/components/DsSwitch/styles.css +393 -0
- package/dist/components/DsTable/index.js +3 -0
- package/dist/components/DsTable/styles.css +369 -0
- package/dist/components/DsTabs/index.js +3 -0
- package/dist/components/DsTabs/styles.css +390 -0
- package/dist/components/DsTextarea/index.js +3 -0
- package/dist/components/DsTextarea/styles.css +382 -0
- package/dist/components/DsToaster/index.js +3 -0
- package/dist/components/DsToaster/styles.css +558 -0
- package/dist/components/DsTooltip/index.js +3 -0
- package/dist/components/DsTooltip/styles.css +388 -0
- package/dist/components/DsTree/index.js +3 -0
- package/dist/components/DsTree/styles.css +375 -0
- package/dist/components/DsTreeSelect/index.js +3 -0
- package/dist/components/DsTreeSelect/styles.css +466 -0
- package/dist/composables/useTheme.js +44 -0
- package/dist/composables/useToast.js +37 -0
- package/dist/directives/autofocus.js +46 -0
- package/dist/directives/autosize.js +62 -0
- package/dist/directives/clickOutside.js +82 -0
- package/dist/directives/dropzone.js +110 -0
- package/dist/directives/globalDirectives.js +0 -0
- package/dist/directives/hotkey.js +104 -0
- package/dist/directives/loading.js +125 -0
- package/dist/directives.js +7 -0
- package/dist/fileValidation.js +2 -0
- package/dist/foundation.css +358 -0
- package/dist/i18n.js +9 -0
- package/dist/index.js +124 -0
- package/dist/package.json +293 -0
- package/dist/styles/base.css +33 -0
- package/dist/styles/themes/dark.css +102 -0
- package/dist/styles/themes/light.css +98 -0
- package/dist/styles/tokens.css +118 -0
- package/dist/styles.css +1134 -0
- package/dist/types/src/components/DsAlert/DsAlert.vue.d.ts +70 -0
- package/dist/types/src/components/DsAlert/config.d.ts +1 -0
- package/dist/types/src/components/DsAlert/index.d.ts +5 -0
- package/dist/types/src/components/DsAlert/safelist.d.ts +1 -0
- package/dist/types/src/components/DsAvatar/DsAvatar.vue.d.ts +53 -0
- package/dist/types/src/components/DsAvatar/config.d.ts +1 -0
- package/dist/types/src/components/DsAvatar/dsAvatarStyles.d.ts +6 -0
- package/dist/types/src/components/DsAvatar/index.d.ts +5 -0
- package/dist/types/src/components/DsAvatar/safelist.d.ts +1 -0
- package/dist/types/src/components/DsBadge/DsBadge.vue.d.ts +54 -0
- package/dist/types/src/components/DsBadge/config.d.ts +1 -0
- package/dist/types/src/components/DsBadge/dsBadgeStyles.d.ts +10 -0
- package/dist/types/src/components/DsBadge/index.d.ts +5 -0
- package/dist/types/src/components/DsBadge/safelist.d.ts +1 -0
- package/dist/types/src/components/DsBadgeWrap/DsBadgeWrap.vue.d.ts +44 -0
- package/dist/types/src/components/DsBadgeWrap/config.d.ts +1 -0
- package/dist/types/src/components/DsBadgeWrap/index.d.ts +4 -0
- package/dist/types/src/components/DsBadgeWrap/safelist.d.ts +1 -0
- package/dist/types/src/components/DsBottomNav/DsBottomNav.vue.d.ts +23 -0
- package/dist/types/src/components/DsBottomNav/config.d.ts +1 -0
- package/dist/types/src/components/DsBottomNav/index.d.ts +5 -0
- package/dist/types/src/components/DsBottomNav/safelist.d.ts +1 -0
- package/dist/types/src/components/DsButton/DsButton.vue.d.ts +70 -0
- package/dist/types/src/components/DsButton/config.d.ts +1 -0
- package/dist/types/src/components/DsButton/dsButtonStyles.d.ts +20 -0
- package/dist/types/src/components/DsButton/index.d.ts +5 -0
- package/dist/types/src/components/DsButton/safelist.d.ts +1 -0
- package/dist/types/src/components/DsButton/styles.css.d.ts +4 -0
- package/dist/types/src/components/DsButtonGroup/DsButtonGroup.vue.d.ts +40 -0
- package/dist/types/src/components/DsButtonGroup/config.d.ts +1 -0
- package/dist/types/src/components/DsButtonGroup/index.d.ts +4 -0
- package/dist/types/src/components/DsButtonGroup/safelist.d.ts +1 -0
- package/dist/types/src/components/DsButtonGroup/styles.css.d.ts +3 -0
- package/dist/types/src/components/DsCard/DsCard.vue.d.ts +13 -0
- package/dist/types/src/components/DsCard/config.d.ts +1 -0
- package/dist/types/src/components/DsCard/index.d.ts +4 -0
- package/dist/types/src/components/DsCard/safelist.d.ts +1 -0
- package/dist/types/src/components/DsCheckbox/DsCheckbox.vue.d.ts +64 -0
- package/dist/types/src/components/DsCheckbox/config.d.ts +1 -0
- package/dist/types/src/components/DsCheckbox/index.d.ts +4 -0
- package/dist/types/src/components/DsCheckbox/safelist.d.ts +1 -0
- package/dist/types/src/components/DsCollapse/DsCollapse.vue.d.ts +59 -0
- package/dist/types/src/components/DsCollapse/DsCollapseItem.vue.d.ts +51 -0
- package/dist/types/src/components/DsCollapse/config.d.ts +1 -0
- package/dist/types/src/components/DsCollapse/dsCollapseContext.d.ts +10 -0
- package/dist/types/src/components/DsCollapse/index.d.ts +7 -0
- package/dist/types/src/components/DsCollapse/safelist.d.ts +1 -0
- package/dist/types/src/components/DsConfirmDialog/DsConfirmDialog.vue.d.ts +93 -0
- package/dist/types/src/components/DsConfirmDialog/config.d.ts +1 -0
- package/dist/types/src/components/DsConfirmDialog/index.d.ts +4 -0
- package/dist/types/src/components/DsConfirmDialog/safelist.d.ts +1 -0
- package/dist/types/src/components/DsDataTable/DsDataTable.vue.d.ts +58 -0
- package/dist/types/src/components/DsDataTable/config.d.ts +1 -0
- package/dist/types/src/components/DsDataTable/index.d.ts +5 -0
- package/dist/types/src/components/DsDataTable/safelist.d.ts +1 -0
- package/dist/types/src/components/DsDialog/DsDialog.vue.d.ts +76 -0
- package/dist/types/src/components/DsDialog/DsDialogCloseButton.vue.d.ts +7 -0
- package/dist/types/src/components/DsDialog/DsDialogFooter.vue.d.ts +41 -0
- package/dist/types/src/components/DsDialog/DsDialogHeader.vue.d.ts +54 -0
- package/dist/types/src/components/DsDialog/config.d.ts +1 -0
- package/dist/types/src/components/DsDialog/dialogShared.d.ts +10 -0
- package/dist/types/src/components/DsDialog/dsDialogStyles.d.ts +1 -0
- package/dist/types/src/components/DsDialog/index.d.ts +4 -0
- package/dist/types/src/components/DsDrawer/DsDrawer.vue.d.ts +61 -0
- package/dist/types/src/components/DsDrawer/config.d.ts +1 -0
- package/dist/types/src/components/DsDrawer/dsDrawerStyles.d.ts +21 -0
- package/dist/types/src/components/DsDrawer/index.d.ts +4 -0
- package/dist/types/src/components/DsDrawer/safelist.d.ts +1 -0
- package/dist/types/src/components/DsDropdown/DsDropdown.vue.d.ts +67 -0
- package/dist/types/src/components/DsDropdown/config.d.ts +1 -0
- package/dist/types/src/components/DsDropdown/dsDropdownStyles.d.ts +6 -0
- package/dist/types/src/components/DsDropdown/index.d.ts +4 -0
- package/dist/types/src/components/DsDropdown/safelist.d.ts +1 -0
- package/dist/types/src/components/DsDropdownMenu/DsDropdownMenu.vue.d.ts +78 -0
- package/dist/types/src/components/DsDropdownMenu/DsDropdownMenuColumn.vue.d.ts +40 -0
- package/dist/types/src/components/DsDropdownMenu/DsDropdownMenuColumns.vue.d.ts +40 -0
- package/dist/types/src/components/DsDropdownMenu/DsDropdownMenuDivider.vue.d.ts +30 -0
- package/dist/types/src/components/DsDropdownMenu/DsDropdownMenuGroup.vue.d.ts +53 -0
- package/dist/types/src/components/DsDropdownMenu/DsDropdownMenuHeader.vue.d.ts +49 -0
- package/dist/types/src/components/DsDropdownMenu/DsDropdownMenuItem.vue.d.ts +55 -0
- package/dist/types/src/components/DsDropdownMenu/DsDropdownMenuList.vue.d.ts +48 -0
- package/dist/types/src/components/DsDropdownMenu/config.d.ts +1 -0
- package/dist/types/src/components/DsDropdownMenu/index.d.ts +14 -0
- package/dist/types/src/components/DsDropdownMenu/safelist.d.ts +1 -0
- package/dist/types/src/components/DsEmptyState/DsEmptyState.vue.d.ts +41 -0
- package/dist/types/src/components/DsEmptyState/config.d.ts +1 -0
- package/dist/types/src/components/DsEmptyState/index.d.ts +4 -0
- package/dist/types/src/components/DsEmptyState/safelist.d.ts +1 -0
- package/dist/types/src/components/DsFileUpload/DsFileUpload.vue.d.ts +136 -0
- package/dist/types/src/components/DsFileUpload/FileValidationError.d.ts +1 -0
- package/dist/types/src/components/DsFileUpload/acceptValidator.d.ts +1 -0
- package/dist/types/src/components/DsFileUpload/config.d.ts +1 -0
- package/dist/types/src/components/DsFileUpload/index.d.ts +5 -0
- package/dist/types/src/components/DsFileUpload/matchAccept.d.ts +1 -0
- package/dist/types/src/components/DsFileUpload/maxSizeMbValidator.d.ts +1 -0
- package/dist/types/src/components/DsFileUpload/runFileValidators.d.ts +2 -0
- package/dist/types/src/components/DsFileUpload/safelist.d.ts +1 -0
- package/dist/types/src/components/DsFileUpload/types.d.ts +1 -0
- package/dist/types/src/components/DsFormField/DsFormField.vue.d.ts +53 -0
- package/dist/types/src/components/DsFormField/config.d.ts +1 -0
- package/dist/types/src/components/DsFormField/dsFormFieldStyles.d.ts +1 -0
- package/dist/types/src/components/DsFormField/index.d.ts +3 -0
- package/dist/types/src/components/DsFormFile/DsFormFile.vue.d.ts +102 -0
- package/dist/types/src/components/DsFormFile/config.d.ts +1 -0
- package/dist/types/src/components/DsFormFile/index.d.ts +5 -0
- package/dist/types/src/components/DsFormFile/safelist.d.ts +1 -0
- package/dist/types/src/components/DsFormSection/DsFormSection.vue.d.ts +41 -0
- package/dist/types/src/components/DsFormSection/config.d.ts +1 -0
- package/dist/types/src/components/DsFormSection/index.d.ts +4 -0
- package/dist/types/src/components/DsFormSection/safelist.d.ts +1 -0
- package/dist/types/src/components/DsIcon/DsIcon.vue.d.ts +26 -0
- package/dist/types/src/components/DsIcon/config.d.ts +1 -0
- package/dist/types/src/components/DsIcon/dsIconStyles.d.ts +2 -0
- package/dist/types/src/components/DsIcon/index.d.ts +5 -0
- package/dist/types/src/components/DsIcon/styles.css.d.ts +5 -0
- package/dist/types/src/components/DsImageViewer/DsImageViewer.vue.d.ts +121 -0
- package/dist/types/src/components/DsImageViewer/config.d.ts +1 -0
- package/dist/types/src/components/DsImageViewer/index.d.ts +4 -0
- package/dist/types/src/components/DsImageViewer/safelist.d.ts +1 -0
- package/dist/types/src/components/DsInput/DsInput.vue.d.ts +109 -0
- package/dist/types/src/components/DsInput/config.d.ts +1 -0
- package/dist/types/src/components/DsInput/dsInputStyles.d.ts +1 -0
- package/dist/types/src/components/DsInput/index.d.ts +5 -0
- package/dist/types/src/components/DsInputTag/DsInputTag.vue.d.ts +123 -0
- package/dist/types/src/components/DsInputTag/config.d.ts +1 -0
- package/dist/types/src/components/DsInputTag/dsInputTagStyles.d.ts +11 -0
- package/dist/types/src/components/DsInputTag/index.d.ts +5 -0
- package/dist/types/src/components/DsInputTag/safelist.d.ts +1 -0
- package/dist/types/src/components/DsLink/DsLink.vue.d.ts +76 -0
- package/dist/types/src/components/DsLink/config.d.ts +1 -0
- package/dist/types/src/components/DsLink/dsLinkStyles.d.ts +10 -0
- package/dist/types/src/components/DsLink/index.d.ts +5 -0
- package/dist/types/src/components/DsLink/safelist.d.ts +1 -0
- package/dist/types/src/components/DsList/DsList.vue.d.ts +40 -0
- package/dist/types/src/components/DsList/DsListItem.vue.d.ts +25 -0
- package/dist/types/src/components/DsList/config.d.ts +1 -0
- package/dist/types/src/components/DsList/index.d.ts +5 -0
- package/dist/types/src/components/DsList/safelist.d.ts +1 -0
- package/dist/types/src/components/DsLoading/DsLoading.vue.d.ts +59 -0
- package/dist/types/src/components/DsLoading/config.d.ts +1 -0
- package/dist/types/src/components/DsLoading/dsLoadingStyles.d.ts +6 -0
- package/dist/types/src/components/DsLoading/index.d.ts +4 -0
- package/dist/types/src/components/DsLoading/safelist.d.ts +1 -0
- package/dist/types/src/components/DsModal/DsModal.vue.d.ts +51 -0
- package/dist/types/src/components/DsModal/config.d.ts +1 -0
- package/dist/types/src/components/DsModal/dsModalStyles.d.ts +17 -0
- package/dist/types/src/components/DsModal/index.d.ts +5 -0
- package/dist/types/src/components/DsModal/safelist.d.ts +1 -0
- package/dist/types/src/components/DsModal/styles.css.d.ts +3 -0
- package/dist/types/src/components/DsNavbar/DsNavbar.vue.d.ts +52 -0
- package/dist/types/src/components/DsNavbar/config.d.ts +1 -0
- package/dist/types/src/components/DsNavbar/index.d.ts +4 -0
- package/dist/types/src/components/DsNavbar/safelist.d.ts +1 -0
- package/dist/types/src/components/DsNumberInput/DsNumberInput.vue.d.ts +135 -0
- package/dist/types/src/components/DsNumberInput/config.d.ts +1 -0
- package/dist/types/src/components/DsNumberInput/dsNumberInputStyles.d.ts +15 -0
- package/dist/types/src/components/DsNumberInput/index.d.ts +5 -0
- package/dist/types/src/components/DsNumberInput/safelist.d.ts +1 -0
- package/dist/types/src/components/DsPagination/DsPagination.vue.d.ts +39 -0
- package/dist/types/src/components/DsPagination/config.d.ts +1 -0
- package/dist/types/src/components/DsPagination/index.d.ts +4 -0
- package/dist/types/src/components/DsPagination/safelist.d.ts +1 -0
- package/dist/types/src/components/DsProgressBar/DsProgressBar.vue.d.ts +36 -0
- package/dist/types/src/components/DsProgressBar/config.d.ts +1 -0
- package/dist/types/src/components/DsProgressBar/dsStyle.d.ts +6 -0
- package/dist/types/src/components/DsProgressBar/index.d.ts +4 -0
- package/dist/types/src/components/DsProgressBar/safelist.d.ts +1 -0
- package/dist/types/src/components/DsPromptDialog/DsPromptDialog.vue.d.ts +108 -0
- package/dist/types/src/components/DsPromptDialog/config.d.ts +1 -0
- package/dist/types/src/components/DsPromptDialog/index.d.ts +4 -0
- package/dist/types/src/components/DsPromptDialog/safelist.d.ts +1 -0
- package/dist/types/src/components/DsPromptDialog/styles.css.d.ts +1 -0
- package/dist/types/src/components/DsRadio/DsRadio.vue.d.ts +94 -0
- package/dist/types/src/components/DsRadio/config.d.ts +1 -0
- package/dist/types/src/components/DsRadio/dsRadioGroupContext.d.ts +10 -0
- package/dist/types/src/components/DsRadio/dsRadioStyles.d.ts +16 -0
- package/dist/types/src/components/DsRadio/index.d.ts +7 -0
- package/dist/types/src/components/DsRadio/safelist.d.ts +1 -0
- package/dist/types/src/components/DsRadioGroup/DsRadioGroup.vue.d.ts +69 -0
- package/dist/types/src/components/DsRadioGroup/config.d.ts +1 -0
- package/dist/types/src/components/DsRadioGroup/index.d.ts +5 -0
- package/dist/types/src/components/DsRadioGroup/safelist.d.ts +1 -0
- package/dist/types/src/components/DsSegmented/DsSegmented.vue.d.ts +77 -0
- package/dist/types/src/components/DsSegmented/config.d.ts +1 -0
- package/dist/types/src/components/DsSegmented/dsSegmentedStyles.d.ts +45 -0
- package/dist/types/src/components/DsSegmented/index.d.ts +5 -0
- package/dist/types/src/components/DsSegmented/safelist.d.ts +1 -0
- package/dist/types/src/components/DsSelect/DsSelect.vue.d.ts +132 -0
- package/dist/types/src/components/DsSelect/config.d.ts +1 -0
- package/dist/types/src/components/DsSelect/dsSelectStyles.d.ts +35 -0
- package/dist/types/src/components/DsSelect/index.d.ts +5 -0
- package/dist/types/src/components/DsSelect/safelist.d.ts +1 -0
- package/dist/types/src/components/DsSelect/styles.css.d.ts +1 -0
- package/dist/types/src/components/DsSidebar/DsSidebar.vue.d.ts +41 -0
- package/dist/types/src/components/DsSidebar/config.d.ts +1 -0
- package/dist/types/src/components/DsSidebar/index.d.ts +4 -0
- package/dist/types/src/components/DsSidebar/safelist.d.ts +1 -0
- package/dist/types/src/components/DsSkeleton/DsSkeleton.vue.d.ts +38 -0
- package/dist/types/src/components/DsSkeleton/config.d.ts +1 -0
- package/dist/types/src/components/DsSkeleton/index.d.ts +4 -0
- package/dist/types/src/components/DsSkeleton/safelist.d.ts +1 -0
- package/dist/types/src/components/DsSwitch/DsSwitch.vue.d.ts +63 -0
- package/dist/types/src/components/DsSwitch/config.d.ts +1 -0
- package/dist/types/src/components/DsSwitch/dsSwitchStyles.d.ts +19 -0
- package/dist/types/src/components/DsSwitch/index.d.ts +5 -0
- package/dist/types/src/components/DsSwitch/safelist.d.ts +1 -0
- package/dist/types/src/components/DsTable/DsTable.vue.d.ts +15 -0
- package/dist/types/src/components/DsTable/config.d.ts +1 -0
- package/dist/types/src/components/DsTable/index.d.ts +4 -0
- package/dist/types/src/components/DsTable/safelist.d.ts +1 -0
- package/dist/types/src/components/DsTabs/DsTabs.vue.d.ts +24 -0
- package/dist/types/src/components/DsTabs/config.d.ts +1 -0
- package/dist/types/src/components/DsTabs/index.d.ts +5 -0
- package/dist/types/src/components/DsTabs/safelist.d.ts +1 -0
- package/dist/types/src/components/DsTextarea/DsTextarea.vue.d.ts +65 -0
- package/dist/types/src/components/DsTextarea/config.d.ts +1 -0
- package/dist/types/src/components/DsTextarea/dsTextareaStyles.d.ts +6 -0
- package/dist/types/src/components/DsTextarea/index.d.ts +5 -0
- package/dist/types/src/components/DsTextarea/safelist.d.ts +1 -0
- package/dist/types/src/components/DsToaster/DsToaster.vue.d.ts +3 -0
- package/dist/types/src/components/DsToaster/config.d.ts +1 -0
- package/dist/types/src/components/DsToaster/index.d.ts +4 -0
- package/dist/types/src/components/DsToaster/safelist.d.ts +1 -0
- package/dist/types/src/components/DsTooltip/DsTooltip.vue.d.ts +41 -0
- package/dist/types/src/components/DsTooltip/config.d.ts +1 -0
- package/dist/types/src/components/DsTooltip/index.d.ts +4 -0
- package/dist/types/src/components/DsTooltip/safelist.d.ts +1 -0
- package/dist/types/src/components/DsTree/DsTree.vue.d.ts +35 -0
- package/dist/types/src/components/DsTree/config.d.ts +1 -0
- package/dist/types/src/components/DsTree/dsTreeDataAdapter.d.ts +14 -0
- package/dist/types/src/components/DsTree/dsTreeInteractionContext.d.ts +31 -0
- package/dist/types/src/components/DsTree/dsTreeProps.d.ts +57 -0
- package/dist/types/src/components/DsTree/dsTreeStore.d.ts +45 -0
- package/dist/types/src/components/DsTree/dsTreeTypes.d.ts +24 -0
- package/dist/types/src/components/DsTree/index.d.ts +6 -0
- package/dist/types/src/components/DsTree/safelist.d.ts +1 -0
- package/dist/types/src/components/DsTreeSelect/DsTreeSelect.vue.d.ts +72 -0
- package/dist/types/src/components/DsTreeSelect/config.d.ts +1 -0
- package/dist/types/src/components/DsTreeSelect/dsTreeSelectStyles.d.ts +9 -0
- package/dist/types/src/components/DsTreeSelect/dsTreeSelectTypes.d.ts +3 -0
- package/dist/types/src/components/DsTreeSelect/index.d.ts +5 -0
- package/dist/types/src/components/DsTreeSelect/safelist.d.ts +1 -0
- package/dist/types/src/components/shared/classTokens.d.ts +1 -0
- package/dist/types/src/composables/useTheme.d.ts +24 -0
- package/dist/types/src/composables/useToast.d.ts +19 -0
- package/dist/types/src/directives/autofocus.d.ts +11 -0
- package/dist/types/src/directives/autosize.d.ts +13 -0
- package/dist/types/src/directives/clickOutside.d.ts +18 -0
- package/dist/types/src/directives/dropzone.d.ts +30 -0
- package/dist/types/src/directives/globalDirectives.d.ts +18 -0
- package/dist/types/src/directives/hotkey.d.ts +25 -0
- package/dist/types/src/directives/index.d.ts +13 -0
- package/dist/types/src/directives/loading.d.ts +38 -0
- package/dist/types/src/fileValidation/FileValidationError.d.ts +7 -0
- package/dist/types/src/fileValidation/acceptValidator.d.ts +2 -0
- package/dist/types/src/fileValidation/allowedExtensionsValidator.d.ts +2 -0
- package/dist/types/src/fileValidation/allowedMimeTypesValidator.d.ts +9 -0
- package/dist/types/src/fileValidation/index.d.ts +11 -0
- package/dist/types/src/fileValidation/matchAccept.d.ts +1 -0
- package/dist/types/src/fileValidation/maxFileSizeBytesValidator.d.ts +2 -0
- package/dist/types/src/fileValidation/maxSizeMbValidator.d.ts +2 -0
- package/dist/types/src/fileValidation/maxTotalSizeBytesValidator.d.ts +2 -0
- package/dist/types/src/fileValidation/runFileValidators.d.ts +7 -0
- package/dist/types/src/fileValidation/types.d.ts +27 -0
- package/dist/types/src/i18n/adapter.d.ts +8 -0
- package/dist/types/src/i18n/index.d.ts +2 -0
- package/dist/types/src/i18n/messages.d.ts +268 -0
- package/dist/types/src/index.d.ts +59 -0
- package/dist/types/src/internal/granularityI18n.d.ts +8 -0
- package/dist/types/src/registry/componentConfig.d.ts +17 -0
- package/dist/types/src/registry/componentCss.d.ts +3 -0
- package/dist/types/src/registry/componentCss.node.d.ts +5 -0
- package/dist/types/src/registry/components.d.ts +56 -0
- package/dist/types/src/registry/safelist.d.ts +11 -0
- package/dist/types/src/theming/themeRegistry.d.ts +19 -0
- package/dist/types/src/theming/themeRegistry.node.d.ts +14 -0
- package/dist/types/src/unocss/preset.d.ts +18 -0
- package/dist/types/src/unocss/preset.node.d.ts +15 -0
- package/dist/types/src/unocss/rules/animation.d.ts +3 -0
- package/dist/types/src/unocss/rules/colorOpacity.d.ts +2 -0
- package/dist/types/src/unocss/rules/filters.d.ts +8 -0
- package/dist/types/src/unocss/rules/spacing.d.ts +8 -0
- package/dist/uno-node.js +103 -0
- package/dist/uno.js +2 -0
- package/package.json +367 -0
- package/web-types.json +100 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import { a as e, n as t, r as n, t as ee } from "./transition-CT9vsWnT.js";
|
|
2
|
+
import { Fragment as te, Teleport as ne, computed as r, createBlock as re, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeStyle as l, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, unref as m, watch as h, withCtx as g } from "vue";
|
|
3
|
+
//#region src/components/DsImageViewer/DsImageViewer.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var ie = { class: "fixed inset-0 overflow-hidden" }, ae = { class: "pointer-events-none absolute inset-x-0 top-0 z-30 px-3 py-3 sm:px-6" }, _ = { class: "pointer-events-auto flex items-center justify-between gap-3" }, v = { class: "flex items-center gap-2" }, y = {
|
|
5
|
+
key: 0,
|
|
6
|
+
"data-ds-image-viewer-progress": "",
|
|
7
|
+
class: "rounded-full bg-black/35 px-3 py-1 text-xs font-600 text-white/95 sm:text-sm"
|
|
8
|
+
}, b = {
|
|
9
|
+
key: 1,
|
|
10
|
+
"data-ds-image-viewer-zoom-value": "",
|
|
11
|
+
class: "rounded-full bg-black/35 px-3 py-1 text-xs font-700 text-white/95 sm:text-sm"
|
|
12
|
+
}, x = { class: "relative z-10 h-full w-full flex items-center justify-center px-16 py-16 sm:px-24 sm:py-20" }, S = { class: "h-full w-full flex items-center justify-center" }, C = ["src"], w = {
|
|
13
|
+
key: 1,
|
|
14
|
+
class: "rounded-[var(--ds-radius-xl)] border border-white/20 bg-black/25 px-4 py-3 text-sm text-white/80"
|
|
15
|
+
}, oe = { class: "pointer-events-none absolute inset-x-0 bottom-0 z-30 px-3 pb-3 sm:px-6 sm:pb-6" }, se = { class: "pointer-events-auto mx-auto w-full max-w-max" }, ce = { class: "rounded-full border border-white/20 bg-black/35 p-1 backdrop-blur-sm flex items-center gap-1" }, le = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "mx-1 h-6 w-px bg-white/25",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}, ue = 2e3, T = /* @__PURE__ */ c({
|
|
20
|
+
__name: "DsImageViewer",
|
|
21
|
+
props: {
|
|
22
|
+
modelValue: { type: Boolean },
|
|
23
|
+
urlList: {},
|
|
24
|
+
initialIndex: { default: 0 },
|
|
25
|
+
zoomRate: { default: 1.2 },
|
|
26
|
+
minScale: { default: .5 },
|
|
27
|
+
maxScale: { default: 5 },
|
|
28
|
+
hideOnClickModal: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
closeOnPressEscape: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !0
|
|
35
|
+
},
|
|
36
|
+
showProgress: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
showZoomValue: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !0
|
|
43
|
+
},
|
|
44
|
+
zIndex: { default: void 0 }
|
|
45
|
+
},
|
|
46
|
+
emits: [
|
|
47
|
+
"update:modelValue",
|
|
48
|
+
"close",
|
|
49
|
+
"switch",
|
|
50
|
+
"rotate"
|
|
51
|
+
],
|
|
52
|
+
setup(c, { emit: T }) {
|
|
53
|
+
let E = c, D = T, O = /\.0$/, de = r(() => E.modelValue), k = r(() => E.urlList.length), A = r(() => k.value > 0), j = d(0), M = d(1), N = d(0), P = d(0), F = d(0), I = r(() => {
|
|
54
|
+
if (A.value) return E.urlList[j.value];
|
|
55
|
+
}), L = r(() => A.value ? j.value + 1 : 0), R = r(() => ({ zIndex: String(Number.isFinite(E.zIndex) ? E.zIndex : ue) })), z = r(() => ({ transform: `translate3d(${P.value}px, ${F.value}px, 0) scale(${M.value}) rotate(${N.value}deg)` })), B = r(() => {
|
|
56
|
+
let e = M.value * 100;
|
|
57
|
+
return Number.isInteger(e) ? String(e) : e.toFixed(1).replace(O, "");
|
|
58
|
+
});
|
|
59
|
+
function V(e) {
|
|
60
|
+
return A.value ? ((Number.isFinite(e) ? Math.trunc(e) : 0) % k.value + k.value) % k.value : 0;
|
|
61
|
+
}
|
|
62
|
+
function H() {
|
|
63
|
+
M.value = 1, N.value = 0, P.value = 0, F.value = 0;
|
|
64
|
+
}
|
|
65
|
+
function U(e, t) {
|
|
66
|
+
let n = V(e);
|
|
67
|
+
n !== j.value && (j.value = n, H(), t?.emitSwitch !== !1 && D("switch", n));
|
|
68
|
+
}
|
|
69
|
+
function W() {
|
|
70
|
+
if (!A.value) {
|
|
71
|
+
j.value = 0;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
j.value = V(E.initialIndex), H();
|
|
75
|
+
}
|
|
76
|
+
function G(e) {
|
|
77
|
+
let t = E.urlList[e];
|
|
78
|
+
if (!t) return;
|
|
79
|
+
let n = new Image();
|
|
80
|
+
n.decoding = "async", n.src = t;
|
|
81
|
+
}
|
|
82
|
+
function K() {
|
|
83
|
+
D("update:modelValue", !1), D("close");
|
|
84
|
+
}
|
|
85
|
+
function q() {
|
|
86
|
+
U(j.value - 1);
|
|
87
|
+
}
|
|
88
|
+
function J() {
|
|
89
|
+
U(j.value + 1);
|
|
90
|
+
}
|
|
91
|
+
function Y() {
|
|
92
|
+
M.value = Math.min(E.maxScale, Number((M.value * E.zoomRate).toFixed(4)));
|
|
93
|
+
}
|
|
94
|
+
function X() {
|
|
95
|
+
M.value = Math.max(E.minScale, Number((M.value / E.zoomRate).toFixed(4)));
|
|
96
|
+
}
|
|
97
|
+
function Z() {
|
|
98
|
+
N.value -= 90, D("rotate", N.value);
|
|
99
|
+
}
|
|
100
|
+
function Q() {
|
|
101
|
+
N.value += 90, D("rotate", N.value);
|
|
102
|
+
}
|
|
103
|
+
let $ = {
|
|
104
|
+
close: K,
|
|
105
|
+
prev: q,
|
|
106
|
+
next: J,
|
|
107
|
+
zoomIn: Y,
|
|
108
|
+
zoomOut: X,
|
|
109
|
+
reset: H,
|
|
110
|
+
rotateLeft: Z,
|
|
111
|
+
rotateRight: Q
|
|
112
|
+
};
|
|
113
|
+
function fe() {
|
|
114
|
+
E.hideOnClickModal && K();
|
|
115
|
+
}
|
|
116
|
+
function pe(e) {
|
|
117
|
+
switch (e.key) {
|
|
118
|
+
case "Escape":
|
|
119
|
+
if (!E.closeOnPressEscape) return;
|
|
120
|
+
e.preventDefault(), K();
|
|
121
|
+
return;
|
|
122
|
+
case "ArrowLeft":
|
|
123
|
+
e.preventDefault(), q();
|
|
124
|
+
return;
|
|
125
|
+
case "ArrowRight":
|
|
126
|
+
e.preventDefault(), J();
|
|
127
|
+
return;
|
|
128
|
+
case "+":
|
|
129
|
+
case "=":
|
|
130
|
+
case "Add":
|
|
131
|
+
e.preventDefault(), Y();
|
|
132
|
+
return;
|
|
133
|
+
case "-":
|
|
134
|
+
case "_":
|
|
135
|
+
case "Subtract":
|
|
136
|
+
e.preventDefault(), X();
|
|
137
|
+
return;
|
|
138
|
+
case "0":
|
|
139
|
+
e.preventDefault(), H();
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return h(() => E.modelValue, (e) => {
|
|
145
|
+
e && W();
|
|
146
|
+
}, { immediate: !0 }), h(() => E.initialIndex, () => {
|
|
147
|
+
E.modelValue && W();
|
|
148
|
+
}), h(() => E.urlList, () => {
|
|
149
|
+
E.modelValue && W();
|
|
150
|
+
}, { deep: !0 }), h(j, (e) => {
|
|
151
|
+
!A.value || k.value < 2 || (G(V(e - 1)), G(V(e + 1)));
|
|
152
|
+
}, { immediate: !0 }), (r, d) => (u(), re(ne, { to: "body" }, [s(m(ee), {
|
|
153
|
+
show: de.value,
|
|
154
|
+
as: "template"
|
|
155
|
+
}, {
|
|
156
|
+
default: g(() => [s(m(e), {
|
|
157
|
+
as: "div",
|
|
158
|
+
class: "fixed inset-0",
|
|
159
|
+
style: l(R.value),
|
|
160
|
+
role: "dialog",
|
|
161
|
+
"aria-modal": "true",
|
|
162
|
+
static: !0,
|
|
163
|
+
onKeydown: pe
|
|
164
|
+
}, {
|
|
165
|
+
default: g(() => [o("div", ie, [s(m(t), {
|
|
166
|
+
as: "template",
|
|
167
|
+
enter: "duration-150 ease-out",
|
|
168
|
+
"enter-from": "opacity-0",
|
|
169
|
+
"enter-to": "opacity-100",
|
|
170
|
+
leave: "duration-120 ease-in",
|
|
171
|
+
"leave-from": "opacity-100",
|
|
172
|
+
"leave-to": "opacity-0"
|
|
173
|
+
}, {
|
|
174
|
+
default: g(() => [o("div", {
|
|
175
|
+
"data-ds-image-viewer-overlay": "",
|
|
176
|
+
class: "absolute inset-0 bg-black/60 backdrop-blur-sm",
|
|
177
|
+
"aria-hidden": "true",
|
|
178
|
+
onClick: fe
|
|
179
|
+
})]),
|
|
180
|
+
_: 1
|
|
181
|
+
}), s(m(t), {
|
|
182
|
+
as: "template",
|
|
183
|
+
enter: "duration-180 ease-out",
|
|
184
|
+
"enter-from": "opacity-0 scale-98",
|
|
185
|
+
"enter-to": "opacity-100 scale-100",
|
|
186
|
+
leave: "duration-130 ease-in",
|
|
187
|
+
"leave-from": "opacity-100 scale-100",
|
|
188
|
+
"leave-to": "opacity-0 scale-98"
|
|
189
|
+
}, {
|
|
190
|
+
default: g(() => [s(m(n), {
|
|
191
|
+
"data-ds-image-viewer-panel": "",
|
|
192
|
+
class: "relative z-10 h-full w-full outline-none",
|
|
193
|
+
tabindex: "-1"
|
|
194
|
+
}, {
|
|
195
|
+
default: g(() => [
|
|
196
|
+
o("div", ae, [o("div", _, [o("div", v, [c.showProgress ? (u(), a("div", y, p(L.value) + " / " + p(k.value), 1)) : i("", !0), c.showZoomValue ? (u(), a("div", b, p(B.value) + "% ", 1)) : i("", !0)]), o("button", {
|
|
197
|
+
type: "button",
|
|
198
|
+
"data-ds-image-viewer-close": "",
|
|
199
|
+
"aria-label": "Close image viewer",
|
|
200
|
+
class: "h-11 w-11 flex items-center justify-center rounded-full border border-white/20 bg-black/35 text-white transition-colors hover:bg-black/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/80",
|
|
201
|
+
onClick: K
|
|
202
|
+
}, [...d[0] ||= [o("span", {
|
|
203
|
+
"aria-hidden": "true",
|
|
204
|
+
class: "text-lg leading-none"
|
|
205
|
+
}, "✕", -1)]])])]),
|
|
206
|
+
o("div", x, [
|
|
207
|
+
k.value > 1 ? (u(), a("button", {
|
|
208
|
+
key: 0,
|
|
209
|
+
type: "button",
|
|
210
|
+
"data-ds-image-viewer-prev": "",
|
|
211
|
+
"aria-label": "Previous image",
|
|
212
|
+
class: "absolute left-3 top-1/2 z-20 h-12 w-12 -translate-y-1/2 flex items-center justify-center rounded-full border border-white/20 bg-black/35 text-white transition-colors hover:bg-black/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/80 sm:left-6",
|
|
213
|
+
onClick: q
|
|
214
|
+
}, [...d[1] ||= [o("span", {
|
|
215
|
+
"aria-hidden": "true",
|
|
216
|
+
class: "text-xl leading-none"
|
|
217
|
+
}, "‹", -1)]])) : i("", !0),
|
|
218
|
+
k.value > 1 ? (u(), a("button", {
|
|
219
|
+
key: 1,
|
|
220
|
+
type: "button",
|
|
221
|
+
"data-ds-image-viewer-next": "",
|
|
222
|
+
"aria-label": "Next image",
|
|
223
|
+
class: "absolute right-3 top-1/2 z-20 h-12 w-12 -translate-y-1/2 flex items-center justify-center rounded-full border border-white/20 bg-black/35 text-white transition-colors hover:bg-black/55 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/80 sm:right-6",
|
|
224
|
+
onClick: J
|
|
225
|
+
}, [...d[2] ||= [o("span", {
|
|
226
|
+
"aria-hidden": "true",
|
|
227
|
+
class: "text-xl leading-none"
|
|
228
|
+
}, "›", -1)]])) : i("", !0),
|
|
229
|
+
o("div", S, [I.value ? (u(), a("img", {
|
|
230
|
+
key: 0,
|
|
231
|
+
"data-ds-image-viewer-image": "",
|
|
232
|
+
src: I.value,
|
|
233
|
+
alt: "",
|
|
234
|
+
draggable: "false",
|
|
235
|
+
class: "max-h-full max-w-full select-none object-contain will-change-transform transition-transform duration-150 ease-out",
|
|
236
|
+
style: l(z.value)
|
|
237
|
+
}, null, 12, C)) : (u(), a("div", w, " No image "))])
|
|
238
|
+
]),
|
|
239
|
+
o("div", oe, [o("div", se, [f(r.$slots, "toolbar", {
|
|
240
|
+
index: j.value,
|
|
241
|
+
displayIndex: L.value,
|
|
242
|
+
total: k.value,
|
|
243
|
+
scale: M.value,
|
|
244
|
+
rotation: N.value,
|
|
245
|
+
actions: $
|
|
246
|
+
}, () => [o("div", ce, [
|
|
247
|
+
o("button", {
|
|
248
|
+
type: "button",
|
|
249
|
+
"data-ds-image-viewer-zoom-out": "",
|
|
250
|
+
"aria-label": "Zoom out",
|
|
251
|
+
class: "h-11 min-w-11 px-2 flex items-center justify-center rounded-full text-sm font-600 text-white transition-colors hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/80",
|
|
252
|
+
onClick: X
|
|
253
|
+
}, " − "),
|
|
254
|
+
o("button", {
|
|
255
|
+
type: "button",
|
|
256
|
+
"data-ds-image-viewer-zoom-reset": "",
|
|
257
|
+
"aria-label": "Reset zoom",
|
|
258
|
+
class: "h-11 min-w-11 px-3 flex items-center justify-center rounded-full text-xs font-700 text-white transition-colors hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/80",
|
|
259
|
+
onClick: H
|
|
260
|
+
}, " 100% "),
|
|
261
|
+
o("button", {
|
|
262
|
+
type: "button",
|
|
263
|
+
"data-ds-image-viewer-zoom-in": "",
|
|
264
|
+
"aria-label": "Zoom in",
|
|
265
|
+
class: "h-11 min-w-11 px-2 flex items-center justify-center rounded-full text-sm font-600 text-white transition-colors hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/80",
|
|
266
|
+
onClick: Y
|
|
267
|
+
}, " + "),
|
|
268
|
+
r.$slots["toolbar-actions"] ? (u(), a(te, { key: 0 }, [
|
|
269
|
+
d[3] ||= o("div", {
|
|
270
|
+
class: "mx-1 h-6 w-px bg-white/25",
|
|
271
|
+
"aria-hidden": "true"
|
|
272
|
+
}, null, -1),
|
|
273
|
+
f(r.$slots, "toolbar-actions", {
|
|
274
|
+
index: j.value,
|
|
275
|
+
displayIndex: L.value,
|
|
276
|
+
total: k.value,
|
|
277
|
+
scale: M.value,
|
|
278
|
+
rotation: N.value,
|
|
279
|
+
actions: $
|
|
280
|
+
}),
|
|
281
|
+
d[4] ||= o("div", {
|
|
282
|
+
class: "mx-1 h-6 w-px bg-white/25",
|
|
283
|
+
"aria-hidden": "true"
|
|
284
|
+
}, null, -1)
|
|
285
|
+
], 64)) : (u(), a("div", le)),
|
|
286
|
+
o("button", {
|
|
287
|
+
type: "button",
|
|
288
|
+
"data-ds-image-viewer-rotate-left": "",
|
|
289
|
+
"aria-label": "Rotate left",
|
|
290
|
+
class: "h-11 min-w-11 px-2 flex items-center justify-center rounded-full text-sm font-600 text-white transition-colors hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/80",
|
|
291
|
+
onClick: Z
|
|
292
|
+
}, " ↺ "),
|
|
293
|
+
o("button", {
|
|
294
|
+
type: "button",
|
|
295
|
+
"data-ds-image-viewer-rotate-right": "",
|
|
296
|
+
"aria-label": "Rotate right",
|
|
297
|
+
class: "h-11 min-w-11 px-2 flex items-center justify-center rounded-full text-sm font-600 text-white transition-colors hover:bg-white/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/80",
|
|
298
|
+
onClick: Q
|
|
299
|
+
}, " ↻ ")
|
|
300
|
+
])])])])
|
|
301
|
+
]),
|
|
302
|
+
_: 3
|
|
303
|
+
})]),
|
|
304
|
+
_: 3
|
|
305
|
+
})])]),
|
|
306
|
+
_: 3
|
|
307
|
+
}, 8, ["style"])]),
|
|
308
|
+
_: 3
|
|
309
|
+
}, 8, ["show"])]));
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
//#endregion
|
|
313
|
+
export { T as t };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, mergeProps as a, nextTick as o, normalizeStyle as s, onBeforeUnmount as c, onMounted as l, onUpdated as u, openBlock as d, ref as f, renderSlot as p, useSlots as m } from "vue";
|
|
2
|
+
//#region src/components/DsInput/DsInput.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var h = { class: "relative w-full" }, g = [
|
|
4
|
+
"id",
|
|
5
|
+
"name",
|
|
6
|
+
"type",
|
|
7
|
+
"inputmode",
|
|
8
|
+
"autocomplete",
|
|
9
|
+
"placeholder",
|
|
10
|
+
"disabled",
|
|
11
|
+
"value",
|
|
12
|
+
"aria-invalid"
|
|
13
|
+
], _ = "w-full rounded-md border bg-[var(--bg)] text-[var(--fg)] placeholder:text-[var(--muted-fg)] focus:placeholder:text-transparent transition-colors duration-150 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)] disabled:opacity-50 disabled:cursor-not-allowed", v = /* @__PURE__ */ i({
|
|
14
|
+
inheritAttrs: !1,
|
|
15
|
+
__name: "DsInput",
|
|
16
|
+
props: {
|
|
17
|
+
modelValue: {},
|
|
18
|
+
type: { default: "text" },
|
|
19
|
+
placeholder: { default: void 0 },
|
|
20
|
+
autocomplete: { default: void 0 },
|
|
21
|
+
inputmode: { default: void 0 },
|
|
22
|
+
disabled: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
invalid: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
state: { default: "default" },
|
|
31
|
+
name: { default: void 0 },
|
|
32
|
+
id: { default: void 0 },
|
|
33
|
+
size: { default: "md" },
|
|
34
|
+
textAlign: { default: "left" },
|
|
35
|
+
prefixMinWidth: { default: void 0 },
|
|
36
|
+
prefixMaxWidth: { default: void 0 },
|
|
37
|
+
suffixMinWidth: { default: void 0 },
|
|
38
|
+
suffixMaxWidth: { default: void 0 }
|
|
39
|
+
},
|
|
40
|
+
emits: ["update:modelValue"],
|
|
41
|
+
setup(i, { expose: v, emit: y }) {
|
|
42
|
+
let b = i, x = y, S = f(null);
|
|
43
|
+
function C() {
|
|
44
|
+
S.value?.focus();
|
|
45
|
+
}
|
|
46
|
+
v({ focus: C });
|
|
47
|
+
let w = m(), T = e(() => !!w.prefix), E = e(() => !!w.suffix), D = e(() => ({
|
|
48
|
+
xs: "2rem",
|
|
49
|
+
sm: "2.25rem",
|
|
50
|
+
md: "2.5rem",
|
|
51
|
+
lg: "3rem"
|
|
52
|
+
})[b.size]), O = e(() => b.prefixMinWidth ?? D.value), k = e(() => b.suffixMinWidth ?? D.value), A = f(null), j = f(null), M = f(void 0), N = f(void 0), P = null, F = !1;
|
|
53
|
+
function I(e) {
|
|
54
|
+
if (!e) return;
|
|
55
|
+
let t = Math.ceil(e.getBoundingClientRect().width || 0);
|
|
56
|
+
if (!(t <= 0)) return `${t}px`;
|
|
57
|
+
}
|
|
58
|
+
function L() {
|
|
59
|
+
M.value = T.value ? I(A.value) : void 0, N.value = E.value ? I(j.value) : void 0;
|
|
60
|
+
}
|
|
61
|
+
function R() {
|
|
62
|
+
typeof ResizeObserver > "u" || (P ||= new ResizeObserver(() => L()), P.disconnect(), A.value && P.observe(A.value), j.value && P.observe(j.value));
|
|
63
|
+
}
|
|
64
|
+
function z() {
|
|
65
|
+
F || (F = !0, o(() => {
|
|
66
|
+
F = !1, L(), R();
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
l(() => z()), u(() => z()), c(() => P?.disconnect());
|
|
70
|
+
function B(e, t) {
|
|
71
|
+
if (e === "0px") return t;
|
|
72
|
+
if (t === "0px") return e;
|
|
73
|
+
let n = e.endsWith("px") ? Number(e.slice(0, -2)) : null, r = t.endsWith("px") ? Number(t.slice(0, -2)) : null;
|
|
74
|
+
return n !== null && Number.isFinite(n) && r !== null && Number.isFinite(r) ? `${n + r}px` : `calc(${e} + ${t})`;
|
|
75
|
+
}
|
|
76
|
+
let V = e(() => ({
|
|
77
|
+
xs: "10px",
|
|
78
|
+
sm: "12px",
|
|
79
|
+
md: "12px",
|
|
80
|
+
lg: "16px"
|
|
81
|
+
})[b.size]), H = e(() => {
|
|
82
|
+
let e = T.value ? M.value ?? O.value : "0px", t = E.value ? N.value ?? k.value : "0px";
|
|
83
|
+
return {
|
|
84
|
+
paddingLeft: T.value ? B(e, V.value) : void 0,
|
|
85
|
+
paddingRight: E.value ? B(t, V.value) : void 0
|
|
86
|
+
};
|
|
87
|
+
}), U = e(() => ({
|
|
88
|
+
minWidth: O.value,
|
|
89
|
+
maxWidth: b.prefixMaxWidth
|
|
90
|
+
})), W = e(() => ({
|
|
91
|
+
minWidth: k.value,
|
|
92
|
+
maxWidth: b.suffixMaxWidth
|
|
93
|
+
})), G = e(() => ({
|
|
94
|
+
xs: "h-7 px-2.5 text-[12px]",
|
|
95
|
+
sm: "h-8 px-3 text-[13px]",
|
|
96
|
+
md: "h-10 px-3 text-[14px]",
|
|
97
|
+
lg: "h-11 px-4 text-[16px]"
|
|
98
|
+
})[b.size]), K = e(() => ({
|
|
99
|
+
left: "text-left",
|
|
100
|
+
center: "text-center",
|
|
101
|
+
right: "text-right"
|
|
102
|
+
})[b.textAlign]), q = e(() => {
|
|
103
|
+
let e = b.state, t = {
|
|
104
|
+
default: "border-[var(--brd)]",
|
|
105
|
+
success: "border-[var(--ds-success)] focus-visible:ring-[var(--ds-success)]",
|
|
106
|
+
warning: "border-[var(--ds-warning)] focus-visible:ring-[var(--ds-warning)]",
|
|
107
|
+
danger: "border-[var(--ds-danger)] focus-visible:ring-[var(--ds-danger)]"
|
|
108
|
+
};
|
|
109
|
+
return [
|
|
110
|
+
_,
|
|
111
|
+
G.value,
|
|
112
|
+
K.value,
|
|
113
|
+
b.invalid ? t.danger : t[e]
|
|
114
|
+
].join(" ");
|
|
115
|
+
});
|
|
116
|
+
function J(e) {
|
|
117
|
+
x("update:modelValue", e.target.value);
|
|
118
|
+
}
|
|
119
|
+
return (e, i) => (d(), n("div", h, [
|
|
120
|
+
e.$slots.prefix ? (d(), n("div", {
|
|
121
|
+
key: 0,
|
|
122
|
+
ref_key: "prefixEl",
|
|
123
|
+
ref: A,
|
|
124
|
+
"data-testid": "ds-input-prefix",
|
|
125
|
+
class: "absolute inset-y-0 left-0 flex items-center justify-center border-r border-[var(--brd)] px-2 text-[var(--muted-fg)] pointer-events-none select-none truncate",
|
|
126
|
+
style: s(U.value),
|
|
127
|
+
"aria-hidden": "true"
|
|
128
|
+
}, [p(e.$slots, "prefix")], 4)) : t("", !0),
|
|
129
|
+
r("input", a({
|
|
130
|
+
id: b.id,
|
|
131
|
+
ref_key: "inputEl",
|
|
132
|
+
ref: S
|
|
133
|
+
}, e.$attrs, {
|
|
134
|
+
name: b.name,
|
|
135
|
+
type: b.type,
|
|
136
|
+
inputmode: b.inputmode,
|
|
137
|
+
autocomplete: b.autocomplete,
|
|
138
|
+
placeholder: b.placeholder,
|
|
139
|
+
disabled: b.disabled,
|
|
140
|
+
value: b.modelValue,
|
|
141
|
+
"aria-invalid": b.invalid ? "true" : void 0,
|
|
142
|
+
class: q.value,
|
|
143
|
+
style: H.value,
|
|
144
|
+
onInput: J
|
|
145
|
+
}), null, 16, g),
|
|
146
|
+
e.$slots.suffix ? (d(), n("div", {
|
|
147
|
+
key: 1,
|
|
148
|
+
ref_key: "suffixEl",
|
|
149
|
+
ref: j,
|
|
150
|
+
"data-testid": "ds-input-suffix",
|
|
151
|
+
class: "absolute inset-y-0 right-0 flex items-center justify-center border-l border-[var(--brd)] px-2 text-[var(--muted-fg)] pointer-events-none select-none truncate",
|
|
152
|
+
style: s(W.value),
|
|
153
|
+
"aria-hidden": "true"
|
|
154
|
+
}, [p(e.$slots, "suffix")], 4)) : t("", !0)
|
|
155
|
+
]));
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
//#endregion
|
|
159
|
+
export { v as t };
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { t as e } from "./x-dGjszOU2.js";
|
|
2
|
+
import { t } from "./DsBadge-Dnd7_I-K.js";
|
|
3
|
+
import { i as n, n as r } from "./config-qlwX-rLq.js";
|
|
4
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, openBlock as p, ref as m, renderList as h, renderSlot as g, toDisplayString as _, unref as v, withCtx as y, withModifiers as b } from "vue";
|
|
5
|
+
//#region src/components/DsInputTag/DsInputTag.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var x = { class: "truncate max-w-[18rem]" }, S = ["data-index", "onClick"], C = [
|
|
7
|
+
"value",
|
|
8
|
+
"disabled",
|
|
9
|
+
"readonly",
|
|
10
|
+
"placeholder",
|
|
11
|
+
"aria-invalid"
|
|
12
|
+
], w = /* @__PURE__ */ d({
|
|
13
|
+
__name: "DsInputTag",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {},
|
|
16
|
+
placeholder: { default: void 0 },
|
|
17
|
+
disabled: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
readonly: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
invalid: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
state: { default: "default" },
|
|
30
|
+
size: { default: "md" },
|
|
31
|
+
separators: { default: () => [","] },
|
|
32
|
+
allowDuplicates: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !1
|
|
35
|
+
},
|
|
36
|
+
trim: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !0
|
|
39
|
+
},
|
|
40
|
+
max: { default: void 0 },
|
|
41
|
+
addOnBlur: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
clearInputOnAdd: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !0
|
|
48
|
+
},
|
|
49
|
+
tagTone: { default: "neutral" },
|
|
50
|
+
tagDark: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
tagSize: { default: "md" },
|
|
55
|
+
tagRadius: { default: "round" },
|
|
56
|
+
tagClosable: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: !0
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
emits: [
|
|
62
|
+
"update:modelValue",
|
|
63
|
+
"add",
|
|
64
|
+
"remove"
|
|
65
|
+
],
|
|
66
|
+
setup(d, { expose: w, emit: T }) {
|
|
67
|
+
let E = /[.*+?^${}()|[\]\\]/g, D = d, O = T, k = m(""), A = m(null);
|
|
68
|
+
function j() {
|
|
69
|
+
A.value?.focus();
|
|
70
|
+
}
|
|
71
|
+
w({ focus: j });
|
|
72
|
+
let M = a(() => D.max !== void 0 && D.modelValue.length >= D.max), N = a(() => !D.disabled && !D.readonly), P = a(() => D.tagClosable && N.value);
|
|
73
|
+
function F(e) {
|
|
74
|
+
return e.replace(E, "\\$&");
|
|
75
|
+
}
|
|
76
|
+
let I = a(() => {
|
|
77
|
+
let e = (D.separators ?? []).filter(Boolean).map((e) => e[0]), t = [...new Set([
|
|
78
|
+
...e,
|
|
79
|
+
"\n",
|
|
80
|
+
"\r",
|
|
81
|
+
" "
|
|
82
|
+
])].map(F).join("");
|
|
83
|
+
return RegExp(`[${t}]+`, "g");
|
|
84
|
+
});
|
|
85
|
+
function L(e) {
|
|
86
|
+
return D.trim ? e.trim() : e;
|
|
87
|
+
}
|
|
88
|
+
function R(e) {
|
|
89
|
+
return e.split(I.value).map((e) => L(e)).filter(Boolean);
|
|
90
|
+
}
|
|
91
|
+
function z(e) {
|
|
92
|
+
if (!N.value || M.value) return !1;
|
|
93
|
+
let t = D.modelValue.slice(), n = !1;
|
|
94
|
+
for (let r of e) {
|
|
95
|
+
let e = L(r);
|
|
96
|
+
if (e && !(!D.allowDuplicates && t.includes(e))) {
|
|
97
|
+
if (D.max !== void 0 && t.length >= D.max) break;
|
|
98
|
+
t.push(e), n = !0, O("add", e);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return n ? (O("update:modelValue", t), !0) : !1;
|
|
102
|
+
}
|
|
103
|
+
function B() {
|
|
104
|
+
if (!N.value || M.value || !k.value) return;
|
|
105
|
+
let e = R(k.value);
|
|
106
|
+
e.length && z(e) && D.clearInputOnAdd && (k.value = "");
|
|
107
|
+
}
|
|
108
|
+
function V(e) {
|
|
109
|
+
if (!N.value) return;
|
|
110
|
+
let t = D.modelValue.slice(), n = t[e];
|
|
111
|
+
n !== void 0 && (t.splice(e, 1), O("update:modelValue", t), O("remove", n, e));
|
|
112
|
+
}
|
|
113
|
+
function H(e) {
|
|
114
|
+
k.value = e.target.value;
|
|
115
|
+
}
|
|
116
|
+
function U(e) {
|
|
117
|
+
if (N.value) {
|
|
118
|
+
if (e.key === "Enter") {
|
|
119
|
+
e.preventDefault(), B();
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if ((D.separators ?? []).includes(e.key)) {
|
|
123
|
+
e.preventDefault(), B();
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
e.key === "Backspace" && k.value.length === 0 && D.modelValue.length > 0 && (e.preventDefault(), V(D.modelValue.length - 1));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function W() {
|
|
130
|
+
D.addOnBlur && B();
|
|
131
|
+
}
|
|
132
|
+
function G(e) {
|
|
133
|
+
if (!N.value || M.value) return;
|
|
134
|
+
let t = e.clipboardData?.getData("text");
|
|
135
|
+
if (!t) return;
|
|
136
|
+
let n = R(t);
|
|
137
|
+
n.length <= 1 || (e.preventDefault(), z(n));
|
|
138
|
+
}
|
|
139
|
+
let K = a(() => n({
|
|
140
|
+
size: D.size,
|
|
141
|
+
state: D.state,
|
|
142
|
+
invalid: D.invalid,
|
|
143
|
+
disabled: D.disabled
|
|
144
|
+
})), q = a(() => r(D.size)), J = a(() => D.modelValue.length > 0 ? void 0 : D.placeholder);
|
|
145
|
+
return (n, r) => (p(), c("div", {
|
|
146
|
+
"data-testid": "ds-input-tag",
|
|
147
|
+
class: f(["w-full flex flex-wrap items-center rounded-md border bg-[var(--bg)] text-[var(--fg)] transition-colors duration-150 focus-within:ring-2 focus-within:ring-[var(--ring)]", K.value]),
|
|
148
|
+
onClick: j
|
|
149
|
+
}, [(p(!0), c(i, null, h(D.modelValue, (i, a) => (p(), o(t, {
|
|
150
|
+
key: `${i}-${a}`,
|
|
151
|
+
tone: D.tagTone,
|
|
152
|
+
dark: D.tagDark,
|
|
153
|
+
size: D.tagSize,
|
|
154
|
+
radius: D.tagRadius,
|
|
155
|
+
class: "gap-1",
|
|
156
|
+
"data-testid": "ds-input-tag-item",
|
|
157
|
+
"data-index": a
|
|
158
|
+
}, {
|
|
159
|
+
default: y(() => [g(n.$slots, "tag", {
|
|
160
|
+
tag: i,
|
|
161
|
+
index: a,
|
|
162
|
+
remove: () => V(a)
|
|
163
|
+
}, () => [l("span", x, _(i), 1)]), P.value ? (p(), c("button", {
|
|
164
|
+
key: 0,
|
|
165
|
+
type: "button",
|
|
166
|
+
class: "-mr-0.5 inline-flex items-center justify-center rounded-[6px] p-0.5 opacity-70 hover:opacity-100 focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ring)]",
|
|
167
|
+
"aria-label": "Remove tag",
|
|
168
|
+
"data-testid": "ds-input-tag-remove",
|
|
169
|
+
"data-index": a,
|
|
170
|
+
onMousedown: r[0] ||= b(() => {}, ["prevent", "stop"]),
|
|
171
|
+
onClick: b((e) => V(a), ["stop"])
|
|
172
|
+
}, [u(v(e), {
|
|
173
|
+
class: "h-3.5 w-3.5",
|
|
174
|
+
"aria-hidden": "true"
|
|
175
|
+
})], 40, S)) : s("", !0)]),
|
|
176
|
+
_: 2
|
|
177
|
+
}, 1032, [
|
|
178
|
+
"tone",
|
|
179
|
+
"dark",
|
|
180
|
+
"size",
|
|
181
|
+
"radius",
|
|
182
|
+
"data-index"
|
|
183
|
+
]))), 128)), l("input", {
|
|
184
|
+
ref_key: "inputEl",
|
|
185
|
+
ref: A,
|
|
186
|
+
"data-testid": "ds-input-tag-input",
|
|
187
|
+
value: k.value,
|
|
188
|
+
disabled: D.disabled || M.value,
|
|
189
|
+
readonly: D.readonly,
|
|
190
|
+
placeholder: J.value,
|
|
191
|
+
"aria-invalid": D.invalid ? "true" : void 0,
|
|
192
|
+
class: f(["flex-1 min-w-[120px] bg-transparent border-none outline-none placeholder:text-[var(--muted-fg)]", q.value]),
|
|
193
|
+
onInput: H,
|
|
194
|
+
onKeydown: U,
|
|
195
|
+
onBlur: W,
|
|
196
|
+
onPaste: G
|
|
197
|
+
}, null, 42, C)], 2));
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
//#endregion
|
|
201
|
+
export { w as t };
|