hys-ui 0.5.0 → 0.7.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 +16 -0
- package/LICENSE +19 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1055 -753
- package/dist/components/HysDataGrid/gridColumnLayout.js +46 -0
- package/dist/components/HysDataGrid/gridPresentation.js +17 -0
- package/dist/components/HysDataGrid/useGridContextMenu.js +33 -0
- package/dist/components/HysDescriptions/HysDescriptions.vue.js +7 -0
- package/dist/components/HysDescriptions/HysDescriptions2.vue.js +146 -0
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +2 -2
- package/dist/components/HysForm/HysForm2.vue.js +9 -8
- package/dist/components/HysIcon/HysIcon.vue.js +373 -0
- package/dist/components/HysIcon/HysIcon2.vue.js +5 -0
- package/dist/components/HysIcon/IconGraphic/IconGraphic.vue.js +147 -0
- package/dist/components/HysIcon/IconGraphic/IconGraphic2.vue.js +4 -0
- package/dist/components/HysIcon/IconPickerPanel/IconPickerPanel.vue.js +7 -0
- package/dist/components/HysIcon/IconPickerPanel/IconPickerPanel2.vue.js +440 -0
- package/dist/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic.vue.js +29 -0
- package/dist/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic2.vue.js +4 -0
- package/dist/components/HysIcon/IconTooltip/IconTooltip.vue.js +19 -0
- package/dist/components/HysIcon/IconTooltip/IconTooltip2.vue.js +4 -0
- package/dist/components/HysIcon/builtins/access.js +180 -0
- package/dist/components/HysIcon/builtins/actions.js +327 -0
- package/dist/components/HysIcon/builtins/business.js +364 -0
- package/dist/components/HysIcon/builtins/catalog/access-1.json.js +51 -0
- package/dist/components/HysIcon/builtins/catalog/access-2.json.js +35 -0
- package/dist/components/HysIcon/builtins/catalog/accessibility.json.js +26 -0
- package/dist/components/HysIcon/builtins/catalog/arrows-1.json.js +45 -0
- package/dist/components/HysIcon/builtins/catalog/arrows-2.json.js +46 -0
- package/dist/components/HysIcon/builtins/catalog/arrows-3.json.js +42 -0
- package/dist/components/HysIcon/builtins/catalog/charts-1.json.js +50 -0
- package/dist/components/HysIcon/builtins/catalog/charts-2.json.js +13 -0
- package/dist/components/HysIcon/builtins/catalog/commerce.json.js +43 -0
- package/dist/components/HysIcon/builtins/catalog/communication-1.json.js +49 -0
- package/dist/components/HysIcon/builtins/catalog/communication-2.json.js +37 -0
- package/dist/components/HysIcon/builtins/catalog/design-1.json.js +61 -0
- package/dist/components/HysIcon/builtins/catalog/design-2.json.js +27 -0
- package/dist/components/HysIcon/builtins/catalog/development-1.json.js +58 -0
- package/dist/components/HysIcon/builtins/catalog/development-2.json.js +60 -0
- package/dist/components/HysIcon/builtins/catalog/development-3.json.js +25 -0
- package/dist/components/HysIcon/builtins/catalog/devices-1.json.js +52 -0
- package/dist/components/HysIcon/builtins/catalog/devices-2.json.js +55 -0
- package/dist/components/HysIcon/builtins/catalog/devices-3.json.js +23 -0
- package/dist/components/HysIcon/builtins/catalog/education.json.js +34 -0
- package/dist/components/HysIcon/builtins/catalog/emoji.json.js +24 -0
- package/dist/components/HysIcon/builtins/catalog/files-1.json.js +45 -0
- package/dist/components/HysIcon/builtins/catalog/files-2.json.js +47 -0
- package/dist/components/HysIcon/builtins/catalog/files-3.json.js +8 -0
- package/dist/components/HysIcon/builtins/catalog/food-1.json.js +67 -0
- package/dist/components/HysIcon/builtins/catalog/food-2.json.js +40 -0
- package/dist/components/HysIcon/builtins/catalog/home.json.js +36 -0
- package/dist/components/HysIcon/builtins/catalog/layout-1.json.js +46 -0
- package/dist/components/HysIcon/builtins/catalog/layout-2.json.js +45 -0
- package/dist/components/HysIcon/builtins/catalog/manifest.json.js +4 -0
- package/dist/components/HysIcon/builtins/catalog/maps-1.json.js +61 -0
- package/dist/components/HysIcon/builtins/catalog/maps-2.json.js +24 -0
- package/dist/components/HysIcon/builtins/catalog/media-1.json.js +57 -0
- package/dist/components/HysIcon/builtins/catalog/media-2.json.js +13 -0
- package/dist/components/HysIcon/builtins/catalog/medical.json.js +30 -0
- package/dist/components/HysIcon/builtins/catalog/nature.json.js +54 -0
- package/dist/components/HysIcon/builtins/catalog/recreation.json.js +51 -0
- package/dist/components/HysIcon/builtins/catalog/shapes.json.js +54 -0
- package/dist/components/HysIcon/builtins/catalog/text-1.json.js +52 -0
- package/dist/components/HysIcon/builtins/catalog/text-2.json.js +54 -0
- package/dist/components/HysIcon/builtins/catalog/text-3.json.js +58 -0
- package/dist/components/HysIcon/builtins/catalog/text-4.json.js +41 -0
- package/dist/components/HysIcon/builtins/catalog/time.json.js +39 -0
- package/dist/components/HysIcon/builtins/catalog/transport-1.json.js +57 -0
- package/dist/components/HysIcon/builtins/catalog/transport-2.json.js +7 -0
- package/dist/components/HysIcon/builtins/catalog/weather.json.js +46 -0
- package/dist/components/HysIcon/builtins/communication.js +314 -0
- package/dist/components/HysIcon/builtins/documents.js +315 -0
- package/dist/components/HysIcon/builtins/extendedCatalog.js +75 -0
- package/dist/components/HysIcon/builtins/iconInCategory.js +11 -0
- package/dist/components/HysIcon/builtins/media.js +255 -0
- package/dist/components/HysIcon/builtins/navigation.js +276 -0
- package/dist/components/HysIcon/builtins/technology.js +189 -0
- package/dist/components/HysIcon/iconBuiltins.js +228 -0
- package/dist/components/HysIcon/iconConfig.js +30 -0
- package/dist/components/HysIcon/iconRegistry.js +183 -0
- package/dist/components/HysIcon/iconSafety.js +191 -0
- package/dist/components/HysIcon/iconStyle.js +70 -0
- package/dist/components/HysIcon/useIconResource.js +75 -0
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +38 -38
- package/dist/components/HysPopconfirm/HysPopconfirm.vue.js +7 -0
- package/dist/components/HysPopconfirm/HysPopconfirm2.vue.js +346 -0
- package/dist/components/HysPopconfirm/usePopconfirmAction.js +32 -0
- package/dist/components/HysResult/HysResult.vue.js +7 -0
- package/dist/components/HysResult/HysResult2.vue.js +124 -0
- package/dist/components/HysSearch/HysSearch.vue.js +2 -2
- package/dist/components/HysSortableList/HysSortableList.vue.js +2 -2
- package/dist/components/HysSortableList/HysSortableList2.vue.js +498 -129
- package/dist/components/HysSortableList/SortableGhost/SortableGhost.vue.js +7 -0
- package/dist/components/HysSortableList/SortableGhost/SortableGhost2.vue.js +43 -0
- package/dist/components/HysSortableList/SortableGhost/useSortGhost.js +54 -0
- package/dist/components/HysSortableList/geometry.js +230 -0
- package/dist/components/HysSortableList/model.js +254 -0
- package/dist/components/HysSortableList/transactions.js +281 -0
- package/dist/components/HysSortableList/useSortDrag.js +270 -0
- package/dist/components/HysSortableList/useSortKeyboard.js +72 -0
- package/dist/components/HysSortableList/useSortWindow.js +144 -0
- package/dist/components/HysSpace/HysSpace.vue.js +7 -0
- package/dist/components/HysSpace/HysSpace2.vue.js +79 -0
- package/dist/components/HysSpace/spaceItems.js +17 -0
- package/dist/components/HysSpin/HysSpin.vue.js +7 -0
- package/dist/components/HysSpin/HysSpin2.vue.js +427 -0
- package/dist/components/HysSpin/SpinGlyph/SpinGlyph.vue.js +334 -0
- package/dist/components/HysSpin/SpinGlyph/SpinGlyph2.vue.js +5 -0
- package/dist/components/HysSpin/SpinPortal/SpinPortal.vue.js +7 -0
- package/dist/components/HysSpin/SpinPortal/SpinPortal2.vue.js +66 -0
- package/dist/components/HysSpin/SpinPortal/spinTarget.js +57 -0
- package/dist/components/HysSpin/spinCatalog.js +35 -0
- package/dist/components/HysSpin/spinConfig.js +32 -0
- package/dist/components/HysSpin/spinService.js +160 -0
- package/dist/components/HysSpin/spinStyle.js +39 -0
- package/dist/components/HysSpin/useHysSpinTask.js +92 -0
- package/dist/components/HysSpin/useSpinFullscreen.js +60 -0
- package/dist/components/HysSpin/useSpinVisibility.js +59 -0
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +285 -204
- package/dist/components/HysSplitPane/splitPaneResize.js +75 -0
- package/dist/components/HysTabPane/HysTabPane.vue.js +49 -0
- package/dist/components/HysTabPane/HysTabPane2.vue.js +4 -0
- package/dist/components/HysTable/HysTable.vue.js +3 -3
- package/dist/components/HysTable/HysTable2.vue.js +412 -383
- package/dist/components/HysTable/tableSearch.js +24 -0
- package/dist/components/HysTabs/HysTabs.vue.js +172 -5
- package/dist/components/HysTabs/HysTabs2.vue.js +2 -275
- package/dist/components/HysTabs/TabsMore/TabsMore.vue.js +7 -0
- package/dist/components/HysTabs/TabsMore/TabsMore2.vue.js +133 -0
- package/dist/components/HysTabs/TabsPanels/TabsPanels.vue.js +161 -0
- package/dist/components/HysTabs/TabsPanels/TabsPanels2.vue.js +4 -0
- package/dist/components/HysTabs/TabsPrompts/TabsPrompts.vue.js +4 -0
- package/dist/components/HysTabs/TabsPrompts/TabsPrompts2.vue.js +88 -0
- package/dist/components/HysTabs/TabsSlot/TabsSlot.js +13 -0
- package/dist/components/HysTabs/TabsWorkbench/TabsWorkbench.vue.js +7 -0
- package/dist/components/HysTabs/TabsWorkbench/TabsWorkbench2.vue.js +687 -0
- package/dist/components/HysTabs/tabsConfig.js +35 -0
- package/dist/components/HysTabs/tabsItems.js +79 -0
- package/dist/components/HysTabs/tabsPersistence.js +118 -0
- package/dist/components/HysTabs/useHysRouteTabs.js +77 -0
- package/dist/components/HysTabs/useTabsDragGhost.js +47 -0
- package/dist/components/HysTabs/useTabsNav.js +127 -0
- package/dist/components/HysTabs/useTabsOverlays.js +52 -0
- package/dist/components/HysTabs/useTabsPanels.js +101 -0
- package/dist/components/HysTabs/useTabsPointer.js +131 -0
- package/dist/components/HysTabs/useTabsState.js +263 -0
- package/dist/components/HysToast/HysToast.vue.js +3 -3
- package/dist/components/HysToast/HysToast2.vue.js +379 -107
- package/dist/components/HysToast/ToastViewport/ToastViewport.vue.js +7 -0
- package/dist/components/HysToast/ToastViewport/ToastViewport2.vue.js +211 -0
- package/dist/components/HysToast/ToastViewport/useToastStackDisclosure.js +71 -0
- package/dist/components/HysToast/toastPresentation.js +98 -0
- package/dist/components/HysToast/useToastActions.js +62 -0
- package/dist/components/HysToast/useToastSwipe.js +48 -0
- package/dist/components/HysToast/useToastTimer.js +90 -0
- package/dist/composables/formLayout.js +20 -42
- package/dist/composables/popupReferenceBinding.js +41 -0
- package/dist/composables/popupSurfaceStyle.js +30 -0
- package/dist/composables/toastEscape.js +18 -10
- package/dist/composables/toastQueue.js +276 -0
- package/dist/composables/toastQueueModel.js +86 -0
- package/dist/composables/toastTasks.js +58 -0
- package/dist/composables/useContainerWidth.js +24 -0
- package/dist/composables/useFloating.js +28 -28
- package/dist/composables/useHysToast.js +117 -135
- package/dist/composables/usePageVisibility.js +19 -0
- package/dist/composables/usePopupSurface.js +181 -356
- package/dist/composables/usePopupSurfaceInteractions.js +173 -0
- package/dist/composables/useSplitPaneDrag.js +29 -26
- package/dist/composables/useSvgInstanceId.js +15 -0
- package/dist/composables/useTable.js +321 -306
- package/dist/composables/useTabularRowNavigation.js +46 -0
- package/dist/index.js +231 -185
- package/dist/internal/MultiSplitPane.vue.js +246 -205
- package/dist/internal/PopupSurfacePanel.vue.js +2 -2
- package/dist/internal/PopupSurfacePanel2.vue.js +35 -30
- package/dist/style.css +1 -1
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +40 -2
- package/dist/types/components/HysDataGrid/gridColumnLayout.d.ts +22 -0
- package/dist/types/components/HysDataGrid/gridPresentation.d.ts +47 -0
- package/dist/types/components/HysDataGrid/useGridContextMenu.d.ts +14 -0
- package/dist/types/components/HysDescriptions/HysDescriptions.vue.d.ts +20 -0
- package/dist/types/components/HysDescriptions/descriptionsTypes.d.ts +54 -0
- package/dist/types/components/HysForm/HysForm.vue.d.ts +1 -1
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +1 -1
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +1 -1
- package/dist/types/components/HysIcon/HysIcon.vue.d.ts +76 -0
- package/dist/types/components/HysIcon/IconGraphic/IconGraphic.vue.d.ts +43 -0
- package/dist/types/components/HysIcon/IconPickerPanel/IconPickerPanel.vue.d.ts +17 -0
- package/dist/types/components/HysIcon/IconReferenceGraphic/IconReferenceGraphic.vue.d.ts +10 -0
- package/dist/types/components/HysIcon/IconTooltip/IconTooltip.vue.d.ts +11 -0
- package/dist/types/components/HysIcon/builtins/access.d.ts +15 -0
- package/dist/types/components/HysIcon/builtins/actions.d.ts +30 -0
- package/dist/types/components/HysIcon/builtins/business.d.ts +31 -0
- package/dist/types/components/HysIcon/builtins/communication.d.ts +27 -0
- package/dist/types/components/HysIcon/builtins/documents.d.ts +29 -0
- package/dist/types/components/HysIcon/builtins/extendedCatalog.d.ts +2 -0
- package/dist/types/components/HysIcon/builtins/iconInCategory.d.ts +2 -0
- package/dist/types/components/HysIcon/builtins/media.d.ts +24 -0
- package/dist/types/components/HysIcon/builtins/navigation.d.ts +30 -0
- package/dist/types/components/HysIcon/builtins/technology.d.ts +18 -0
- package/dist/types/components/HysIcon/iconBuiltins.d.ts +2 -0
- package/dist/types/components/HysIcon/iconConfig.d.ts +10 -0
- package/dist/types/components/HysIcon/iconRegistry.d.ts +5 -0
- package/dist/types/components/HysIcon/iconSafety.d.ts +8 -0
- package/dist/types/components/HysIcon/iconStyle.d.ts +6 -0
- package/dist/types/components/HysIcon/iconTypes.d.ts +192 -0
- package/dist/types/components/HysIcon/useIconResource.d.ts +14 -0
- package/dist/types/components/HysModal/HysModal.vue.d.ts +1 -1
- package/dist/types/components/HysPopconfirm/HysPopconfirm.vue.d.ts +85 -0
- package/dist/types/components/HysPopconfirm/popconfirmTypes.d.ts +72 -0
- package/dist/types/components/HysPopconfirm/usePopconfirmAction.d.ts +6 -0
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysResult/HysResult.vue.d.ts +22 -0
- package/dist/types/components/HysResult/resultTypes.d.ts +32 -0
- package/dist/types/components/HysSortableList/HysSortableList.vue.d.ts +48 -25
- package/dist/types/components/HysSortableList/SortableGhost/SortableGhost.vue.d.ts +31 -0
- package/dist/types/components/HysSortableList/SortableGhost/useSortGhost.d.ts +23 -0
- package/dist/types/components/HysSortableList/geometry.d.ts +35 -0
- package/dist/types/components/HysSortableList/model.d.ts +61 -0
- package/dist/types/components/HysSortableList/sortableList.d.ts +151 -0
- package/dist/types/components/HysSortableList/transactions.d.ts +10 -0
- package/dist/types/components/HysSortableList/useSortDrag.d.ts +25 -0
- package/dist/types/components/HysSortableList/useSortKeyboard.d.ts +17 -0
- package/dist/types/components/HysSortableList/useSortWindow.d.ts +16 -0
- package/dist/types/components/HysSpace/HysSpace.vue.d.ts +15 -0
- package/dist/types/components/HysSpace/spaceItems.d.ts +9 -0
- package/dist/types/components/HysSpace/spaceTypes.d.ts +20 -0
- package/dist/types/components/HysSpin/HysSpin.vue.d.ts +84 -0
- package/dist/types/components/HysSpin/SpinGlyph/SpinGlyph.vue.d.ts +16 -0
- package/dist/types/components/HysSpin/SpinPortal/SpinPortal.vue.d.ts +21 -0
- package/dist/types/components/HysSpin/SpinPortal/spinTarget.d.ts +3 -0
- package/dist/types/components/HysSpin/spinCatalog.d.ts +122 -0
- package/dist/types/components/HysSpin/spinConfig.d.ts +10 -0
- package/dist/types/components/HysSpin/spinService.d.ts +7 -0
- package/dist/types/components/HysSpin/spinStyle.d.ts +5 -0
- package/dist/types/components/HysSpin/spinTypes.d.ts +133 -0
- package/dist/types/components/HysSpin/useHysSpinTask.d.ts +4 -0
- package/dist/types/components/HysSpin/useSpinFullscreen.d.ts +17 -0
- package/dist/types/components/HysSpin/useSpinVisibility.d.ts +10 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +25 -2
- package/dist/types/components/HysSplitPane/splitPaneResize.d.ts +17 -0
- package/dist/types/components/HysTabPane/HysTabPane.vue.d.ts +11 -0
- package/dist/types/components/HysTable/HysTable.vue.d.ts +16 -10
- package/dist/types/components/HysTable/tableSearch.d.ts +2 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +83 -74
- package/dist/types/components/HysTabs/TabsMore/TabsMore.vue.d.ts +14 -0
- package/dist/types/components/HysTabs/TabsPanels/TabsPanels.vue.d.ts +17 -0
- package/dist/types/components/HysTabs/TabsPrompts/TabsPrompts.vue.d.ts +7 -0
- package/dist/types/components/HysTabs/TabsSlot/TabsSlot.d.ts +9 -0
- package/dist/types/components/HysTabs/TabsWorkbench/TabsWorkbench.vue.d.ts +32 -0
- package/dist/types/components/HysTabs/tabsConfig.d.ts +4 -0
- package/dist/types/components/HysTabs/tabsItems.d.ts +14 -0
- package/dist/types/components/HysTabs/tabsPersistence.d.ts +6 -0
- package/dist/types/components/HysTabs/tabsTypes.d.ts +236 -0
- package/dist/types/components/HysTabs/useHysRouteTabs.d.ts +22 -0
- package/dist/types/components/HysTabs/useTabsDragGhost.d.ts +22 -0
- package/dist/types/components/HysTabs/useTabsNav.d.ts +20 -0
- package/dist/types/components/HysTabs/useTabsOverlays.d.ts +54 -0
- package/dist/types/components/HysTabs/useTabsPanels.d.ts +14 -0
- package/dist/types/components/HysTabs/useTabsPointer.d.ts +30 -0
- package/dist/types/components/HysTabs/useTabsState.d.ts +32 -0
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +2 -2
- package/dist/types/components/HysToast/HysToast.vue.d.ts +44 -46
- package/dist/types/components/HysToast/ToastViewport/ToastViewport.vue.d.ts +25 -0
- package/dist/types/components/HysToast/ToastViewport/useToastStackDisclosure.d.ts +16 -0
- package/dist/types/components/HysToast/toastPresentation.d.ts +8 -0
- package/dist/types/components/HysToast/toastTypes.d.ts +212 -0
- package/dist/types/components/HysToast/useToastActions.d.ts +18 -0
- package/dist/types/components/HysToast/useToastSwipe.d.ts +11 -0
- package/dist/types/components/HysToast/useToastTimer.d.ts +22 -0
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +2 -2
- package/dist/types/composables/dataGrid.d.ts +34 -0
- package/dist/types/composables/formLayout.d.ts +1 -2
- package/dist/types/composables/popupReferenceBinding.d.ts +9 -0
- package/dist/types/composables/popupSurfaceStyle.d.ts +7 -0
- package/dist/types/composables/table.d.ts +10 -1
- package/dist/types/composables/toastEscape.d.ts +1 -1
- package/dist/types/composables/toastQueue.d.ts +121 -0
- package/dist/types/composables/toastQueueModel.d.ts +116 -0
- package/dist/types/composables/toastTasks.d.ts +2 -0
- package/dist/types/composables/useColorPicker.d.ts +1 -1
- package/dist/types/composables/useContainerWidth.d.ts +2 -0
- package/dist/types/composables/useContextMenu.d.ts +1 -1
- package/dist/types/composables/useFloating.d.ts +2 -2
- package/dist/types/composables/useHysToast.d.ts +4 -48
- package/dist/types/composables/usePageVisibility.d.ts +1 -0
- package/dist/types/composables/usePopupSurface.d.ts +28 -22
- package/dist/types/composables/usePopupSurfaceInteractions.d.ts +35 -0
- package/dist/types/composables/useSplitPaneDrag.d.ts +2 -2
- package/dist/types/composables/useSvgInstanceId.d.ts +1 -0
- package/dist/types/composables/useTable.d.ts +2 -0
- package/dist/types/composables/useTabularRowNavigation.d.ts +18 -0
- package/dist/types/index.d.ts +33 -6
- package/dist/types/internal/MultiSplitPane.vue.d.ts +10 -1
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { tableValue as p } from "../../composables/table.js";
|
|
2
|
+
function u(r) {
|
|
3
|
+
return r.normalize("NFKD").replace(new RegExp("\\p{M}", "gu"), "").toLowerCase();
|
|
4
|
+
}
|
|
5
|
+
function v(r, d, i, a) {
|
|
6
|
+
const n = r.trim();
|
|
7
|
+
if (!n) return;
|
|
8
|
+
if (a) return (e) => a(n, e);
|
|
9
|
+
const s = u(n).split(/\s+/).filter(Boolean);
|
|
10
|
+
if (!s.length) return;
|
|
11
|
+
const l = i ? new Set(i) : void 0, c = d.filter(
|
|
12
|
+
(e) => (!e.type || e.type === "default") && (!l || l.has(e.key))
|
|
13
|
+
).map((e) => e.dataIndex ?? e.key);
|
|
14
|
+
return (e) => {
|
|
15
|
+
const f = c.map((o) => {
|
|
16
|
+
const t = p(e, o);
|
|
17
|
+
return t instanceof Date || ["string", "number", "bigint", "boolean"].includes(typeof t) ? u(String(t)) : "";
|
|
18
|
+
});
|
|
19
|
+
return s.every((o) => f.some((t) => t.includes(o)));
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
v as tableSearchPredicate
|
|
24
|
+
};
|
|
@@ -1,7 +1,174 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as B, useSlots as b, ref as g, computed as i, openBlock as h, createBlock as k, mergeProps as T, unref as n } from "vue";
|
|
2
|
+
import w from "./TabsWorkbench/TabsWorkbench.vue.js";
|
|
3
|
+
import { useTabsOptions as C } from "./tabsConfig.js";
|
|
4
|
+
import { collectTabPanes as x } from "./tabsItems.js";
|
|
5
|
+
const L = /* @__PURE__ */ B({
|
|
6
|
+
inheritAttrs: !1,
|
|
7
|
+
__name: "HysTabs",
|
|
8
|
+
props: {
|
|
9
|
+
modelValue: {},
|
|
10
|
+
defaultValue: {},
|
|
11
|
+
items: {},
|
|
12
|
+
defaultItems: {},
|
|
13
|
+
workbench: { type: Boolean, default: void 0 },
|
|
14
|
+
disabled: { type: Boolean, default: void 0 },
|
|
15
|
+
readonly: { type: Boolean, default: void 0 },
|
|
16
|
+
type: {},
|
|
17
|
+
vertical: { type: Boolean, default: void 0 },
|
|
18
|
+
placement: {},
|
|
19
|
+
responsive: { type: Boolean, default: void 0 },
|
|
20
|
+
breakpoint: {},
|
|
21
|
+
size: {},
|
|
22
|
+
stretch: { type: Boolean, default: void 0 },
|
|
23
|
+
centered: { type: Boolean, default: void 0 },
|
|
24
|
+
align: {},
|
|
25
|
+
tabWidth: {},
|
|
26
|
+
tabHeight: {},
|
|
27
|
+
tabMaxWidth: {},
|
|
28
|
+
gap: {},
|
|
29
|
+
radius: {},
|
|
30
|
+
separator: { type: Boolean, default: void 0 },
|
|
31
|
+
sticky: { type: Boolean, default: void 0 },
|
|
32
|
+
fixed: { type: Boolean, default: void 0 },
|
|
33
|
+
barOffset: {},
|
|
34
|
+
panelHeight: {},
|
|
35
|
+
panelMaxHeight: {},
|
|
36
|
+
closable: { type: Boolean, default: void 0 },
|
|
37
|
+
addable: { type: Boolean, default: void 0 },
|
|
38
|
+
editable: { type: Boolean, default: void 0 },
|
|
39
|
+
autoActivate: { type: Boolean, default: void 0 },
|
|
40
|
+
trigger: {},
|
|
41
|
+
hoverDelay: {},
|
|
42
|
+
preview: { type: Boolean, default: void 0 },
|
|
43
|
+
activation: {},
|
|
44
|
+
lazy: { type: Boolean, default: void 0 },
|
|
45
|
+
preload: { type: [Boolean, Array], default: void 0 },
|
|
46
|
+
destroyOnHide: { type: Boolean, default: void 0 },
|
|
47
|
+
cacheLimit: {},
|
|
48
|
+
animated: { type: Boolean, default: void 0 },
|
|
49
|
+
animation: {},
|
|
50
|
+
animationName: { default: void 0 },
|
|
51
|
+
duration: {},
|
|
52
|
+
easing: {},
|
|
53
|
+
overflow: {},
|
|
54
|
+
showScrollButtons: { type: Boolean, default: void 0 },
|
|
55
|
+
scrollAlign: {},
|
|
56
|
+
wheel: {},
|
|
57
|
+
dragScroll: { type: Boolean, default: void 0 },
|
|
58
|
+
swipe: { type: Boolean, default: void 0 },
|
|
59
|
+
draggable: { type: Boolean, default: void 0 },
|
|
60
|
+
dragHandle: { type: Boolean, default: void 0 },
|
|
61
|
+
longPress: {},
|
|
62
|
+
contextMenu: { type: Boolean, default: void 0 },
|
|
63
|
+
shortcuts: { type: Boolean, default: void 0 },
|
|
64
|
+
titleTooltip: { type: Boolean, default: void 0 },
|
|
65
|
+
moreSearch: { type: Boolean, default: void 0 },
|
|
66
|
+
confirmDirty: { type: Boolean, default: void 0 },
|
|
67
|
+
historyLimit: {},
|
|
68
|
+
storageKey: {},
|
|
69
|
+
storage: {},
|
|
70
|
+
persistScroll: { type: Boolean, default: void 0 },
|
|
71
|
+
restoreItem: {},
|
|
72
|
+
createTab: {},
|
|
73
|
+
ariaLabel: {},
|
|
74
|
+
beforeLeave: {},
|
|
75
|
+
beforeClose: {},
|
|
76
|
+
beforeReorder: {}
|
|
77
|
+
},
|
|
78
|
+
emits: ["update:modelValue", "update:items", "change", "selectionChange", "tabClick", "tabDblclick", "tabContextmenu", "tabLongpress", "previewChange", "close", "closeBatch", "add", "edit", "reorder", "restore", "rename", "pinChange", "favoriteChange", "loadStart", "load", "loadError", "guardError", "storageError"],
|
|
79
|
+
setup(v, { expose: c, emit: p }) {
|
|
80
|
+
const f = v, m = p, r = b(), d = C(f), a = g(), s = i(
|
|
81
|
+
() => {
|
|
82
|
+
var e;
|
|
83
|
+
return ((e = a.value) == null ? void 0 : e.active) ?? d.value.modelValue ?? d.value.defaultValue ?? "";
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
function y() {
|
|
87
|
+
var o;
|
|
88
|
+
const e = d.value;
|
|
89
|
+
return e.items !== void 0 || e.defaultItems !== void 0 ? [] : x(
|
|
90
|
+
r.panes ? r.panes() : e.workbench || (o = r.default) == null ? void 0 : o.call(r, { active: s.value })
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
const l = () => Promise.resolve(!1);
|
|
94
|
+
return c({
|
|
95
|
+
active: s,
|
|
96
|
+
recent: i(() => {
|
|
97
|
+
var e;
|
|
98
|
+
return ((e = a.value) == null ? void 0 : e.recent) ?? [];
|
|
99
|
+
}),
|
|
100
|
+
closed: i(() => {
|
|
101
|
+
var e;
|
|
102
|
+
return ((e = a.value) == null ? void 0 : e.closed) ?? [];
|
|
103
|
+
}),
|
|
104
|
+
select: (e) => {
|
|
105
|
+
var o;
|
|
106
|
+
return ((o = a.value) == null ? void 0 : o.select(e)) ?? l();
|
|
107
|
+
},
|
|
108
|
+
focus: (e) => {
|
|
109
|
+
var o;
|
|
110
|
+
return (o = a.value) == null ? void 0 : o.focus(e);
|
|
111
|
+
},
|
|
112
|
+
scrollToActiveTab: () => {
|
|
113
|
+
var e;
|
|
114
|
+
return (e = a.value) == null ? void 0 : e.scrollToActiveTab();
|
|
115
|
+
},
|
|
116
|
+
add: (e) => {
|
|
117
|
+
var o;
|
|
118
|
+
return ((o = a.value) == null ? void 0 : o.add(e)) ?? l();
|
|
119
|
+
},
|
|
120
|
+
close: (e) => {
|
|
121
|
+
var o;
|
|
122
|
+
return ((o = a.value) == null ? void 0 : o.close(e)) ?? l();
|
|
123
|
+
},
|
|
124
|
+
closeMany: (e, o) => {
|
|
125
|
+
var t;
|
|
126
|
+
return ((t = a.value) == null ? void 0 : t.closeMany(e, o)) ?? Promise.resolve([]);
|
|
127
|
+
},
|
|
128
|
+
rename: (e, o) => {
|
|
129
|
+
var t;
|
|
130
|
+
return ((t = a.value) == null ? void 0 : t.rename(e, o)) ?? l();
|
|
131
|
+
},
|
|
132
|
+
move: (e, o, t) => {
|
|
133
|
+
var u;
|
|
134
|
+
return ((u = a.value) == null ? void 0 : u.move(e, o, t)) ?? l();
|
|
135
|
+
},
|
|
136
|
+
pin: (e, o) => {
|
|
137
|
+
var t;
|
|
138
|
+
return ((t = a.value) == null ? void 0 : t.pin(e, o)) ?? l();
|
|
139
|
+
},
|
|
140
|
+
favorite: (e, o) => {
|
|
141
|
+
var t;
|
|
142
|
+
return ((t = a.value) == null ? void 0 : t.favorite(e, o)) ?? l();
|
|
143
|
+
},
|
|
144
|
+
restore: () => {
|
|
145
|
+
var e;
|
|
146
|
+
return ((e = a.value) == null ? void 0 : e.restore()) ?? l();
|
|
147
|
+
},
|
|
148
|
+
preload: (e) => {
|
|
149
|
+
var o;
|
|
150
|
+
return ((o = a.value) == null ? void 0 : o.preload(e)) ?? l();
|
|
151
|
+
},
|
|
152
|
+
reload: (e) => {
|
|
153
|
+
var o;
|
|
154
|
+
return ((o = a.value) == null ? void 0 : o.reload(e)) ?? l();
|
|
155
|
+
},
|
|
156
|
+
save: () => {
|
|
157
|
+
var e;
|
|
158
|
+
return ((e = a.value) == null ? void 0 : e.save()) ?? !1;
|
|
159
|
+
}
|
|
160
|
+
}), (e, o) => (h(), k(w, T({
|
|
161
|
+
ref_key: "controller",
|
|
162
|
+
ref: a
|
|
163
|
+
}, e.$attrs, {
|
|
164
|
+
options: n(d),
|
|
165
|
+
declarations: y(),
|
|
166
|
+
declarative: !!r.panes && n(d).items === void 0 && n(d).defaultItems === void 0,
|
|
167
|
+
slots: r,
|
|
168
|
+
emit: m
|
|
169
|
+
}), null, 16, ["options", "declarations", "declarative", "emit"]));
|
|
170
|
+
}
|
|
171
|
+
});
|
|
5
172
|
export {
|
|
6
|
-
|
|
173
|
+
L as default
|
|
7
174
|
};
|
|
@@ -1,277 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ChevronUp as ze, ChevronLeft as Se, X as Te, ChevronDown as Le, ChevronRight as Ve, Plus as Ae } from "lucide-vue-next";
|
|
3
|
-
import { useHysRootAttrs as Re } from "../../config.js";
|
|
4
|
-
import { useMotion as He } from "../../motion/useMotion.js";
|
|
5
|
-
const De = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "hys-ui-tabs-extra"
|
|
8
|
-
}, Ee = ["aria-label"], xe = ["aria-label", "aria-busy", "aria-orientation"], Ie = ["id", "data-tab-key", "aria-selected", "aria-controls", "disabled", "tabindex", "onFocus", "onClick", "onMouseenter"], Me = ["aria-label", "aria-busy", "disabled", "onClick"], Ne = ["aria-label"], Oe = ["disabled"], qe = {
|
|
9
|
-
key: 4,
|
|
10
|
-
class: "hys-ui-tabs-extra"
|
|
11
|
-
}, Fe = ["id", "data-active", "aria-labelledby"], Ke = ["id", "aria-labelledby"], je = /* @__PURE__ */ he({
|
|
12
|
-
__name: "HysTabs",
|
|
13
|
-
props: {
|
|
14
|
-
modelValue: {},
|
|
15
|
-
defaultValue: {},
|
|
16
|
-
items: {},
|
|
17
|
-
disabled: { type: Boolean },
|
|
18
|
-
type: { default: "line" },
|
|
19
|
-
vertical: { type: Boolean },
|
|
20
|
-
placement: {},
|
|
21
|
-
size: { default: "md" },
|
|
22
|
-
stretch: { type: Boolean },
|
|
23
|
-
centered: { type: Boolean },
|
|
24
|
-
closable: { type: Boolean },
|
|
25
|
-
addable: { type: Boolean },
|
|
26
|
-
editable: { type: Boolean },
|
|
27
|
-
trigger: { default: "click" },
|
|
28
|
-
activation: { default: "auto" },
|
|
29
|
-
lazy: { type: Boolean, default: !0 },
|
|
30
|
-
destroyOnHide: { type: Boolean, default: !1 },
|
|
31
|
-
animated: { type: Boolean, default: !0 },
|
|
32
|
-
showScrollButtons: { type: Boolean, default: !0 },
|
|
33
|
-
ariaLabel: {},
|
|
34
|
-
beforeLeave: {},
|
|
35
|
-
beforeClose: {}
|
|
36
|
-
},
|
|
37
|
-
emits: ["update:modelValue", "change", "tabClick", "close", "add", "edit", "guardError"],
|
|
38
|
-
setup(s, { expose: ie, emit: ne }) {
|
|
39
|
-
const t = s, c = ne, re = Re(), { effectiveMotion: X } = He(), j = ke(), g = y(), N = y(t.defaultValue), u = M(() => {
|
|
40
|
-
var e;
|
|
41
|
-
return t.modelValue ?? (t.items.some((l) => l.value === N.value) ? N.value : ((e = t.items.find((l) => !l.disabled)) == null ? void 0 : e.value) ?? "");
|
|
42
|
-
}), H = M(() => t.placement ?? (t.vertical ? "left" : "top")), n = M(() => H.value === "left" || H.value === "right"), r = M(() => t.items.filter((e) => !t.disabled && !e.disabled)), m = y(), D = y(/* @__PURE__ */ new Set()), p = y(!1), $ = y(/* @__PURE__ */ new Set()), G = y(!1), J = y(!1);
|
|
43
|
-
let z = 0, w = 0, de = 0, b = !0, S;
|
|
44
|
-
const E = /* @__PURE__ */ new Map(), L = (e) => typeof e + ":" + e, O = (e) => j + "-tab-" + e, q = (e) => j + "-panel-" + e, F = (e) => e.closable ?? (t.closable || t.editable), Q = (e) => {
|
|
45
|
-
var l;
|
|
46
|
-
return Array.from(((l = g.value) == null ? void 0 : l.querySelectorAll('[role="tab"]')) || []).find((a) => a.dataset.tabKey === L(e));
|
|
47
|
-
}, ve = (e) => e.forceRender || !t.destroyOnHide && (!t.lazy || D.value.has(e.value)) || u.value === e.value;
|
|
48
|
-
function C() {
|
|
49
|
-
const e = g.value;
|
|
50
|
-
if (!e) return;
|
|
51
|
-
const l = n.value ? e.scrollTop : e.scrollLeft, a = n.value ? e.clientHeight : e.clientWidth, o = n.value ? e.scrollHeight : e.scrollWidth;
|
|
52
|
-
G.value = l > 1, J.value = l + a < o - 1;
|
|
53
|
-
}
|
|
54
|
-
function V() {
|
|
55
|
-
const e = g.value, l = Q(u.value);
|
|
56
|
-
if (!e || !l) return;
|
|
57
|
-
const a = e.getBoundingClientRect(), o = l.getBoundingClientRect();
|
|
58
|
-
n.value ? o.top < a.top ? e.scrollTop -= a.top - o.top : o.bottom > a.bottom && (e.scrollTop += o.bottom - a.bottom) : o.left < a.left ? e.scrollLeft -= a.left - o.left : o.right > a.right && (e.scrollLeft += o.right - a.right), C();
|
|
59
|
-
}
|
|
60
|
-
function Y(e) {
|
|
61
|
-
const l = g.value;
|
|
62
|
-
if (!l) return;
|
|
63
|
-
const a = (n.value ? l.clientHeight : l.clientWidth) * 0.8 * e;
|
|
64
|
-
l.scrollBy({ [n.value ? "top" : "left"]: a, behavior: X.value === "off" ? "auto" : "smooth" });
|
|
65
|
-
}
|
|
66
|
-
function Z(e) {
|
|
67
|
-
var l;
|
|
68
|
-
m.value = e, (l = Q(e)) == null || l.focus();
|
|
69
|
-
}
|
|
70
|
-
async function x(e) {
|
|
71
|
-
const l = ++z, a = u.value, o = w;
|
|
72
|
-
if (p.value = !1, !(!b || !r.value.some((d) => d.value === e) || e === a))
|
|
73
|
-
try {
|
|
74
|
-
if (t.beforeLeave && (p.value = !0, await t.beforeLeave(e, a) === !1) || !b || o !== w || l !== z || u.value !== a || !r.value.some((d) => d.value === e)) return;
|
|
75
|
-
p.value = !1, N.value = e, c("update:modelValue", e), c("change", e), await T(), V();
|
|
76
|
-
} catch (d) {
|
|
77
|
-
b && o === w && l === z && c("guardError", d);
|
|
78
|
-
} finally {
|
|
79
|
-
l === z && (p.value = !1);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
function ce(e, l) {
|
|
83
|
-
t.disabled || e.disabled || (c("tabClick", e.value, l), x(e.value));
|
|
84
|
-
}
|
|
85
|
-
async function be(e) {
|
|
86
|
-
if (!b || t.disabled || e.disabled || !F(e) || $.value.has(e.value)) return;
|
|
87
|
-
const l = w, a = ++de;
|
|
88
|
-
E.set(e.value, a);
|
|
89
|
-
try {
|
|
90
|
-
if ($.value.add(e.value), t.beforeClose && await t.beforeClose(e.value) === !1) return;
|
|
91
|
-
const o = t.items.find((d) => d.value === e.value);
|
|
92
|
-
if (!b || l !== w || E.get(e.value) !== a || t.disabled || !o || o.disabled || !F(o)) return;
|
|
93
|
-
c("close", e.value), c("edit", e.value, "remove");
|
|
94
|
-
} catch (o) {
|
|
95
|
-
b && l === w && c("guardError", o);
|
|
96
|
-
} finally {
|
|
97
|
-
E.get(e.value) === a && $.value.delete(e.value);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
function fe() {
|
|
101
|
-
t.disabled || (c("add"), c("edit", void 0, "add"));
|
|
102
|
-
}
|
|
103
|
-
function ye(e) {
|
|
104
|
-
var ee;
|
|
105
|
-
if (e.target.closest(".hys-ui-tab-close")) return;
|
|
106
|
-
const l = n.value ? ["ArrowUp", "ArrowDown"] : ["ArrowLeft", "ArrowRight"], a = e.target.closest('[role="tab"]'), o = ((ee = r.value.find((P) => L(P.value) === (a == null ? void 0 : a.dataset.tabKey))) == null ? void 0 : ee.value) ?? m.value ?? u.value;
|
|
107
|
-
if (["Enter", " "].includes(e.key) && t.activation === "manual" && a) {
|
|
108
|
-
e.preventDefault(), x(o);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
if (![...l, "Home", "End"].includes(e.key) || !r.value.length) return;
|
|
112
|
-
e.preventDefault();
|
|
113
|
-
const d = r.value.findIndex((P) => P.value === o), f = e.key === "Home" ? 0 : e.key === "End" ? r.value.length - 1 : d < 0 ? e.key === l[0] ? r.value.length - 1 : 0 : (d + (e.key === l[0] ? -1 : 1) + r.value.length) % r.value.length;
|
|
114
|
-
Z(r.value[f].value), t.activation === "auto" && x(r.value[f].value);
|
|
115
|
-
}
|
|
116
|
-
function I() {
|
|
117
|
-
z++, p.value = !1, w++, $.value.clear(), E.clear();
|
|
118
|
-
}
|
|
119
|
-
function K() {
|
|
120
|
-
S == null || S.disconnect(), S = void 0;
|
|
121
|
-
}
|
|
122
|
-
function _() {
|
|
123
|
-
K(), typeof ResizeObserver < "u" && g.value && (S = new ResizeObserver(C), S.observe(g.value)), T().then(C);
|
|
124
|
-
}
|
|
125
|
-
return A(u, (e) => {
|
|
126
|
-
D.value.add(e), z++, p.value = !1, T().then(V);
|
|
127
|
-
}, { immediate: !0 }), A(() => t.items.map((e) => [e.value, e.disabled, e.closable]), () => {
|
|
128
|
-
I(), D.value = new Set([...D.value].filter((e) => t.items.some((l) => l.value === e))), m.value !== void 0 && !r.value.some((e) => e.value === m.value) && (m.value = void 0), T().then(C);
|
|
129
|
-
}, { deep: !0 }), A(() => t.disabled, () => I()), A(() => [t.size, t.type, t.stretch, t.centered, ...t.items.map((e) => e.label)], () => void T().then(() => {
|
|
130
|
-
C(), V();
|
|
131
|
-
})), A(H, () => void T().then(() => {
|
|
132
|
-
C(), V();
|
|
133
|
-
})), ge(_), me(() => {
|
|
134
|
-
b = !0, _();
|
|
135
|
-
}), pe(() => {
|
|
136
|
-
b = !1, I(), K();
|
|
137
|
-
}), we(() => {
|
|
138
|
-
b = !1, I(), K();
|
|
139
|
-
}), ie({ scrollToActiveTab: V, focus: (e = u.value) => Z(e) }), (e, l) => (i(), v("div", Ce(h(re), {
|
|
140
|
-
class: ["hys-ui-tabs-root", ["hys-ui-tabs-placement-" + H.value, "hys-ui-tabs-size-" + s.size, { "hys-ui-tabs-bordered": s.type === "border-card" }]]
|
|
141
|
-
}), [
|
|
142
|
-
U("div", {
|
|
143
|
-
class: R(["hys-ui-tabs-header", { "hys-ui-tabs-header-vertical": n.value }])
|
|
144
|
-
}, [
|
|
145
|
-
e.$slots.prefix ? (i(), v("div", De, [
|
|
146
|
-
B(e.$slots, "prefix", {}, void 0, !0)
|
|
147
|
-
])) : k("", !0),
|
|
148
|
-
s.showScrollButtons && G.value ? (i(), v("button", {
|
|
149
|
-
key: 1,
|
|
150
|
-
class: "hys-ui-tab-scroll",
|
|
151
|
-
type: "button",
|
|
152
|
-
"aria-label": n.value ? "向上滚动页签" : "向左滚动页签",
|
|
153
|
-
onClick: l[0] || (l[0] = (a) => Y(-1))
|
|
154
|
-
}, [
|
|
155
|
-
(i(), ae(le(n.value ? h(ze) : h(Se)), { size: 16 }))
|
|
156
|
-
], 8, Ee)) : k("", !0),
|
|
157
|
-
U("div", {
|
|
158
|
-
ref_key: "nav",
|
|
159
|
-
ref: g,
|
|
160
|
-
class: R(["hys-ui-tabs", ["hys-ui-tabs-" + s.type, { "hys-ui-tabs-vertical": n.value, "hys-ui-tabs-stretch": s.stretch, "hys-ui-tabs-centered": s.centered }]]),
|
|
161
|
-
role: "tablist",
|
|
162
|
-
"aria-label": s.ariaLabel || "页签",
|
|
163
|
-
"aria-busy": p.value || void 0,
|
|
164
|
-
"aria-orientation": n.value ? "vertical" : "horizontal",
|
|
165
|
-
onKeydown: ye,
|
|
166
|
-
onScrollPassive: C
|
|
167
|
-
}, [
|
|
168
|
-
(i(!0), v(W, null, te(s.items, (a, o) => {
|
|
169
|
-
var d;
|
|
170
|
-
return i(), v("div", {
|
|
171
|
-
key: L(a.value),
|
|
172
|
-
class: R(["hys-ui-tab-item", { "hys-ui-tab-selected": u.value === a.value }])
|
|
173
|
-
}, [
|
|
174
|
-
U("button", {
|
|
175
|
-
id: O(o),
|
|
176
|
-
type: "button",
|
|
177
|
-
role: "tab",
|
|
178
|
-
"data-tab-key": L(a.value),
|
|
179
|
-
"aria-selected": u.value === a.value,
|
|
180
|
-
"aria-controls": e.$slots.panel || a.content !== void 0 || e.$slots.default && u.value === a.value ? q(o) : void 0,
|
|
181
|
-
disabled: s.disabled || a.disabled,
|
|
182
|
-
tabindex: (m.value ?? (r.value.some((f) => f.value === u.value) ? u.value : (d = r.value[0]) == null ? void 0 : d.value)) === a.value ? 0 : -1,
|
|
183
|
-
class: R({ "hys-ui-active": u.value === a.value }),
|
|
184
|
-
onFocus: (f) => m.value = a.value,
|
|
185
|
-
onClick: (f) => ce(a, f),
|
|
186
|
-
onMouseenter: (f) => s.trigger === "hover" && x(a.value)
|
|
187
|
-
}, [
|
|
188
|
-
B(e.$slots, "label", {
|
|
189
|
-
item: a,
|
|
190
|
-
active: u.value === a.value
|
|
191
|
-
}, () => [
|
|
192
|
-
oe(se(a.label), 1)
|
|
193
|
-
], !0)
|
|
194
|
-
], 42, Ie),
|
|
195
|
-
F(a) ? (i(), v("button", {
|
|
196
|
-
key: 0,
|
|
197
|
-
type: "button",
|
|
198
|
-
class: "hys-ui-tab-close",
|
|
199
|
-
"aria-label": "关闭" + a.label,
|
|
200
|
-
"aria-busy": $.value.has(a.value) || void 0,
|
|
201
|
-
disabled: s.disabled || a.disabled || $.value.has(a.value),
|
|
202
|
-
onClick: (f) => be(a)
|
|
203
|
-
}, [
|
|
204
|
-
B(e.$slots, "close-icon", { item: a }, () => [
|
|
205
|
-
ue(h(Te), { size: 13 })
|
|
206
|
-
], !0)
|
|
207
|
-
], 8, Me)) : k("", !0)
|
|
208
|
-
], 2);
|
|
209
|
-
}), 128))
|
|
210
|
-
], 42, xe),
|
|
211
|
-
s.showScrollButtons && J.value ? (i(), v("button", {
|
|
212
|
-
key: 2,
|
|
213
|
-
class: "hys-ui-tab-scroll",
|
|
214
|
-
type: "button",
|
|
215
|
-
"aria-label": n.value ? "向下滚动页签" : "向右滚动页签",
|
|
216
|
-
onClick: l[1] || (l[1] = (a) => Y(1))
|
|
217
|
-
}, [
|
|
218
|
-
(i(), ae(le(n.value ? h(Le) : h(Ve)), { size: 16 }))
|
|
219
|
-
], 8, Ne)) : k("", !0),
|
|
220
|
-
s.addable || s.editable ? (i(), v("button", {
|
|
221
|
-
key: 3,
|
|
222
|
-
type: "button",
|
|
223
|
-
class: "hys-ui-tab-add",
|
|
224
|
-
"aria-label": "添加页签",
|
|
225
|
-
disabled: s.disabled,
|
|
226
|
-
onClick: fe
|
|
227
|
-
}, [
|
|
228
|
-
B(e.$slots, "add-icon", {}, () => [
|
|
229
|
-
ue(h(Ae), { size: 16 })
|
|
230
|
-
], !0)
|
|
231
|
-
], 8, Oe)) : k("", !0),
|
|
232
|
-
e.$slots.suffix ? (i(), v("div", qe, [
|
|
233
|
-
B(e.$slots, "suffix", {}, void 0, !0)
|
|
234
|
-
])) : k("", !0)
|
|
235
|
-
], 2),
|
|
236
|
-
e.$slots.panel || s.items.some((a) => a.content !== void 0) ? (i(), v("div", {
|
|
237
|
-
key: 0,
|
|
238
|
-
class: R(["hys-ui-tabs-content", { "hys-ui-tabs-animated": s.animated && h(X) !== "off" }])
|
|
239
|
-
}, [
|
|
240
|
-
(i(!0), v(W, null, te(s.items, (a, o) => (i(), v(W, {
|
|
241
|
-
key: L(a.value)
|
|
242
|
-
}, [
|
|
243
|
-
ve(a) ? Be((i(), v("div", {
|
|
244
|
-
key: 0,
|
|
245
|
-
id: q(o),
|
|
246
|
-
class: "hys-ui-tab-panel",
|
|
247
|
-
"data-active": u.value === a.value,
|
|
248
|
-
role: "tabpanel",
|
|
249
|
-
"aria-labelledby": O(o),
|
|
250
|
-
tabindex: "0"
|
|
251
|
-
}, [
|
|
252
|
-
B(e.$slots, "panel", {
|
|
253
|
-
item: a,
|
|
254
|
-
active: u.value === a.value
|
|
255
|
-
}, () => [
|
|
256
|
-
oe(se(a.content), 1)
|
|
257
|
-
], !0)
|
|
258
|
-
], 8, Fe)), [
|
|
259
|
-
[$e, u.value === a.value]
|
|
260
|
-
]) : k("", !0)
|
|
261
|
-
], 64))), 128))
|
|
262
|
-
], 2)) : e.$slots.default ? (i(), v("div", {
|
|
263
|
-
key: 1,
|
|
264
|
-
id: q(s.items.findIndex((a) => a.value === u.value)),
|
|
265
|
-
class: "hys-ui-tabs-content",
|
|
266
|
-
role: "tabpanel",
|
|
267
|
-
"aria-labelledby": s.items.some((a) => a.value === u.value) ? O(s.items.findIndex((a) => a.value === u.value)) : void 0,
|
|
268
|
-
tabindex: "0"
|
|
269
|
-
}, [
|
|
270
|
-
B(e.$slots, "default", { active: u.value }, void 0, !0)
|
|
271
|
-
], 8, Ke)) : k("", !0)
|
|
272
|
-
], 16));
|
|
273
|
-
}
|
|
274
|
-
});
|
|
1
|
+
import f from "./HysTabs.vue.js";
|
|
275
2
|
export {
|
|
276
|
-
|
|
3
|
+
f as default
|
|
277
4
|
};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { defineComponent as M, ref as v, computed as p, watch as S, openBlock as s, createBlock as V, withCtx as f, createVNode as b, unref as m, createElementVNode as n, withDirectives as D, createElementBlock as i, vModelText as N, createCommentVNode as h, Fragment as C, renderList as g, toDisplayString as x } from "vue";
|
|
2
|
+
import { ChevronDown as T } from "lucide-vue-next";
|
|
3
|
+
import $ from "../../HysPopover/HysPopover.vue.js";
|
|
4
|
+
import B from "../TabsSlot/TabsSlot.js";
|
|
5
|
+
const E = ["disabled"], F = { class: "hys-tab-more-panel" }, U = { class: "hys-tab-more-filters" }, q = ["aria-pressed", "onClick"], z = { class: "hys-tab-more-list" }, H = ["disabled", "aria-current", "onClick"], K = { key: 0 }, O = { key: 0 }, J = /* @__PURE__ */ M({
|
|
6
|
+
__name: "TabsMore",
|
|
7
|
+
props: {
|
|
8
|
+
items: {},
|
|
9
|
+
overflow: {},
|
|
10
|
+
recent: {},
|
|
11
|
+
active: {},
|
|
12
|
+
disabled: { type: Boolean },
|
|
13
|
+
search: { type: Boolean },
|
|
14
|
+
slots: {},
|
|
15
|
+
select: { type: Function }
|
|
16
|
+
},
|
|
17
|
+
setup(o) {
|
|
18
|
+
const r = o, c = v(!1), d = v(""), y = v(), u = v("all"), _ = p(() => {
|
|
19
|
+
const a = new Set(r.overflow);
|
|
20
|
+
return r.items.filter((t) => a.has(t.value));
|
|
21
|
+
}), w = p(() => {
|
|
22
|
+
let a = r.items;
|
|
23
|
+
if (u.value === "favorite" && (a = a.filter((e) => e.favorite)), u.value === "recent") {
|
|
24
|
+
const e = new Map(a.map((l) => [l.value, l]));
|
|
25
|
+
a = r.recent.flatMap((l) => e.get(l) ?? []);
|
|
26
|
+
}
|
|
27
|
+
const t = d.value.trim().toLocaleLowerCase();
|
|
28
|
+
return t ? a.filter((e) => e.label.toLocaleLowerCase().includes(t)) : a;
|
|
29
|
+
});
|
|
30
|
+
async function k(a) {
|
|
31
|
+
const t = await r.select(a);
|
|
32
|
+
return t && (c.value = !1), t;
|
|
33
|
+
}
|
|
34
|
+
S(c, (a) => {
|
|
35
|
+
a || (d.value = "", u.value = "all");
|
|
36
|
+
});
|
|
37
|
+
const L = p(() => ({
|
|
38
|
+
items: r.items,
|
|
39
|
+
overflowed: _.value,
|
|
40
|
+
active: r.active,
|
|
41
|
+
select: k,
|
|
42
|
+
close: () => {
|
|
43
|
+
c.value = !1;
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
return (a, t) => (s(), V($, {
|
|
47
|
+
open: c.value,
|
|
48
|
+
"onUpdate:open": t[1] || (t[1] = (e) => c.value = e),
|
|
49
|
+
placement: "bottom-end",
|
|
50
|
+
width: 248,
|
|
51
|
+
"max-height": 360,
|
|
52
|
+
"aria-label": "更多页签",
|
|
53
|
+
disabled: o.disabled,
|
|
54
|
+
onOpened: t[2] || (t[2] = (e) => {
|
|
55
|
+
var l;
|
|
56
|
+
return (l = y.value) == null ? void 0 : l.focus({ preventScroll: !0 });
|
|
57
|
+
})
|
|
58
|
+
}, {
|
|
59
|
+
trigger: f(() => [
|
|
60
|
+
n("button", {
|
|
61
|
+
type: "button",
|
|
62
|
+
class: "hys-ui-tab-control hys-tab-more",
|
|
63
|
+
"aria-label": "更多页签",
|
|
64
|
+
disabled: o.disabled
|
|
65
|
+
}, [
|
|
66
|
+
b(m(B), {
|
|
67
|
+
render: o.slots["more-icon"]
|
|
68
|
+
}, {
|
|
69
|
+
default: f(() => [
|
|
70
|
+
b(m(T), {
|
|
71
|
+
size: 16,
|
|
72
|
+
"aria-hidden": "true"
|
|
73
|
+
})
|
|
74
|
+
]),
|
|
75
|
+
_: 1
|
|
76
|
+
}, 8, ["render"])
|
|
77
|
+
], 8, E)
|
|
78
|
+
]),
|
|
79
|
+
default: f(() => [
|
|
80
|
+
b(m(B), {
|
|
81
|
+
render: o.slots.more,
|
|
82
|
+
scope: L.value
|
|
83
|
+
}, {
|
|
84
|
+
default: f(() => [
|
|
85
|
+
n("div", F, [
|
|
86
|
+
o.search !== !1 ? D((s(), i("input", {
|
|
87
|
+
key: 0,
|
|
88
|
+
ref_key: "searchBox",
|
|
89
|
+
ref: y,
|
|
90
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => d.value = e),
|
|
91
|
+
type: "search",
|
|
92
|
+
"aria-label": "搜索页签",
|
|
93
|
+
placeholder: "搜索页签"
|
|
94
|
+
}, null, 512)), [
|
|
95
|
+
[N, d.value]
|
|
96
|
+
]) : h("", !0),
|
|
97
|
+
n("div", U, [
|
|
98
|
+
(s(), i(C, null, g([
|
|
99
|
+
["all", "全部"],
|
|
100
|
+
["recent", "最近"],
|
|
101
|
+
["favorite", "收藏"]
|
|
102
|
+
], ([e, l]) => n("button", {
|
|
103
|
+
key: e,
|
|
104
|
+
type: "button",
|
|
105
|
+
"aria-pressed": u.value === e,
|
|
106
|
+
onClick: (P) => u.value = e
|
|
107
|
+
}, x(l), 9, q)), 64))
|
|
108
|
+
]),
|
|
109
|
+
n("div", z, [
|
|
110
|
+
(s(!0), i(C, null, g(w.value, (e) => (s(), i("button", {
|
|
111
|
+
key: e.value,
|
|
112
|
+
type: "button",
|
|
113
|
+
disabled: e.disabled,
|
|
114
|
+
"aria-current": e.value === o.active ? "true" : void 0,
|
|
115
|
+
onClick: (l) => k(e.value)
|
|
116
|
+
}, [
|
|
117
|
+
n("span", null, x(e.label), 1),
|
|
118
|
+
e.value === o.active ? (s(), i("small", K, "当前")) : h("", !0)
|
|
119
|
+
], 8, H))), 128)),
|
|
120
|
+
w.value.length ? h("", !0) : (s(), i("p", O, "没有符合条件的页签"))
|
|
121
|
+
])
|
|
122
|
+
])
|
|
123
|
+
]),
|
|
124
|
+
_: 1
|
|
125
|
+
}, 8, ["render", "scope"])
|
|
126
|
+
]),
|
|
127
|
+
_: 1
|
|
128
|
+
}, 8, ["open", "disabled"]));
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
export {
|
|
132
|
+
J as default
|
|
133
|
+
};
|