@indielayer/ui 2.0.0 → 2.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/docs/App.vue +19 -4
- package/docs/assets/css/tailwind.css +7 -1
- package/docs/components/Cookies.vue +3 -1
- package/docs/components/common/CodePreview.vue +1 -1
- package/docs/components/common/DocsCopyPage.vue +200 -0
- package/docs/components/common/DocumentPage.vue +76 -23
- package/docs/components/toolbar/ToolbarColorToggle.vue +29 -18
- package/docs/components/toolbar/ToolbarSearch.vue +4 -4
- package/docs/composables/useDocMeta.ts +63 -4
- package/docs/icons.ts +3 -0
- package/docs/main.ts +25 -26
- package/docs/pages/component/accordion/index.vue +2 -2
- package/docs/pages/component/alert/index.vue +2 -2
- package/docs/pages/component/avatar/index.vue +4 -4
- package/docs/pages/component/badge/index.vue +2 -2
- package/docs/pages/component/breadcrumbs/index.vue +2 -2
- package/docs/pages/component/button/button-group.vue +3 -3
- package/docs/pages/component/button/index.vue +14 -7
- package/docs/pages/component/button/tooltip.vue +10 -0
- package/docs/pages/component/card/index.vue +2 -2
- package/docs/pages/component/carousel/index.vue +2 -2
- package/docs/pages/component/checkbox/index.vue +5 -5
- package/docs/pages/component/container/index.vue +2 -2
- package/docs/pages/component/datepicker/index.vue +2 -2
- package/docs/pages/component/divider/index.vue +4 -4
- package/docs/pages/component/drawer/index.vue +2 -2
- package/docs/pages/component/empty/index.vue +3 -3
- package/docs/pages/component/form/index.vue +2 -2
- package/docs/pages/component/formGroup/index.vue +2 -2
- package/docs/pages/component/infiniteLoader/index.vue +3 -3
- package/docs/pages/component/input/index.vue +5 -5
- package/docs/pages/component/inputGroup/index.vue +3 -3
- package/docs/pages/component/inputGroup/validation.vue +6 -1
- package/docs/pages/component/link/index.vue +2 -2
- package/docs/pages/component/loader/index.vue +2 -2
- package/docs/pages/component/menu/index.vue +2 -2
- package/docs/pages/component/modal/index.vue +3 -3
- package/docs/pages/component/notifications/index.vue +2 -2
- package/docs/pages/component/pagination/index.vue +2 -2
- package/docs/pages/component/popover/index.vue +2 -2
- package/docs/pages/component/popover/usage.vue +14 -0
- package/docs/pages/component/progress/index.vue +3 -3
- package/docs/pages/component/qrCode/index.vue +2 -2
- package/docs/pages/component/radio/index.vue +3 -3
- package/docs/pages/component/scroll/index.vue +3 -3
- package/docs/pages/component/select/index.vue +5 -5
- package/docs/pages/component/skeleton/index.vue +2 -2
- package/docs/pages/component/slider/index.vue +2 -2
- package/docs/pages/component/spacer/index.vue +2 -2
- package/docs/pages/component/spinner/index.vue +3 -3
- package/docs/pages/component/table/index.vue +4 -4
- package/docs/pages/component/tabs/index.vue +2 -2
- package/docs/pages/component/tabs/usage.vue +26 -0
- package/docs/pages/component/tag/index.vue +2 -2
- package/docs/pages/component/textarea/index.vue +4 -4
- package/docs/pages/component/toggle/index.vue +4 -4
- package/docs/pages/component/upload/index.vue +2 -2
- package/docs/pages/component/upload/usage.vue +1 -0
- package/docs/pages/component/virtualGrid/index.vue +2 -2
- package/docs/pages/component/virtualList/index.vue +3 -3
- package/docs/pages/icons.vue +2 -2
- package/docs/router/index.ts +39 -44
- package/docs/search/components.json +1 -1
- package/docs/search/index.json +1 -1
- package/lib/common/buttonGroupRadius.d.ts +3 -0
- package/lib/common/buttonGroupRadius.js +6 -0
- package/lib/common/props.d.ts +1 -1
- package/lib/common/props.js +10 -9
- package/lib/components/accordion/Accordion.vue.d.ts +42 -9
- package/lib/components/accordion/Accordion.vue_vue_type_script_setup_true_lang.js +18 -6
- package/lib/components/accordion/AccordionItem.vue.d.ts +33 -6
- package/lib/components/accordion/AccordionItem.vue_vue_type_script_setup_true_lang.js +31 -6
- package/lib/components/alert/Alert.vue.d.ts +27 -6
- package/lib/components/alert/Alert.vue_vue_type_script_setup_true_lang.js +20 -6
- package/lib/components/avatar/Avatar.vue.d.ts +45 -9
- package/lib/components/avatar/Avatar.vue_vue_type_script_setup_true_lang.js +17 -6
- package/lib/components/badge/Badge.vue.d.ts +54 -9
- package/lib/components/badge/Badge.vue_vue_type_script_setup_true_lang.js +26 -9
- package/lib/components/breadcrumbs/Breadcrumbs.vue.d.ts +30 -6
- package/lib/components/breadcrumbs/Breadcrumbs.vue_vue_type_script_setup_true_lang.js +13 -5
- package/lib/components/button/Button.js +2 -2
- package/lib/components/button/Button.vue.d.ts +138 -28
- package/lib/components/button/Button.vue_vue_type_script_setup_true_lang.js +192 -70
- package/lib/components/button/ButtonGroup.js +4 -5
- package/lib/components/button/ButtonGroup.vue.d.ts +54 -10
- package/lib/components/button/ButtonGroup.vue_vue_type_script_setup_true_lang.js +30 -19
- package/lib/components/button/theme/Button.base.theme.js +6 -5
- package/lib/components/button/theme/Button.carbon.theme.js +6 -5
- package/lib/components/card/Card.vue.d.ts +3 -0
- package/lib/components/card/Card.vue_vue_type_script_setup_true_lang.js +4 -2
- package/lib/components/carousel/Carousel.vue.d.ts +21 -3
- package/lib/components/carousel/Carousel.vue_vue_type_script_setup_true_lang.js +23 -5
- package/lib/components/carousel/CarouselSlide.js +2 -2
- package/lib/components/carousel/CarouselSlide.vue.d.ts +3 -0
- package/lib/components/carousel/CarouselSlide.vue_vue_type_script_setup_true_lang.js +3 -1
- package/lib/components/carousel/{CarouselSlide.vue_vue_type_style_index_0_scoped_e90d2127_lang.module.js → CarouselSlide.vue_vue_type_style_index_0_scoped_4f559831_lang.module.js} +1 -1
- package/lib/components/checkbox/Checkbox.vue.d.ts +198 -45
- package/lib/components/checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +20 -3
- package/lib/components/container/Container.vue.d.ts +6 -0
- package/lib/components/container/Container.vue_vue_type_script_setup_true_lang.js +5 -2
- package/lib/components/datepicker/Datepicker.vue.d.ts +462 -36
- package/lib/components/datepicker/Datepicker.vue_vue_type_script_setup_true_lang.js +294 -153
- package/lib/components/divider/Divider.vue.d.ts +12 -3
- package/lib/components/divider/Divider.vue_vue_type_script_setup_true_lang.js +6 -2
- package/lib/components/drawer/Drawer.vue.d.ts +39 -6
- package/lib/components/drawer/Drawer.vue_vue_type_script_setup_true_lang.js +30 -7
- package/lib/components/empty/Empty.vue.d.ts +30 -6
- package/lib/components/empty/Empty.vue_vue_type_script_setup_true_lang.js +17 -4
- package/lib/components/form/Form.vue.d.ts +48 -9
- package/lib/components/form/Form.vue_vue_type_script_setup_true_lang.js +34 -7
- package/lib/components/formGroup/FormGroup.vue.d.ts +171 -39
- package/lib/components/formGroup/FormGroup.vue_vue_type_script_setup_true_lang.js +15 -9
- package/lib/components/icon/Icon.vue.d.ts +9 -0
- package/lib/components/icon/Icon.vue_vue_type_script_setup_true_lang.js +6 -3
- package/lib/components/image/Image.vue.d.ts +12 -3
- package/lib/components/image/Image.vue_vue_type_script_setup_true_lang.js +5 -1
- package/lib/components/index.js +18 -18
- package/lib/components/input/Input.vue.d.ts +291 -66
- package/lib/components/input/Input.vue_vue_type_script_setup_true_lang.js +53 -15
- package/lib/components/inputFooter/InputFooter.vue.d.ts +48 -12
- package/lib/components/inputFooter/InputFooter.vue_vue_type_script_setup_true_lang.js +18 -5
- package/lib/components/inputGroup/InputGroup.vue.d.ts +171 -39
- package/lib/components/inputGroup/InputGroup.vue_vue_type_script_setup_true_lang.js +6 -1
- package/lib/components/label/Label.vue.d.ts +78 -18
- package/lib/components/label/Label.vue_vue_type_script_setup_true_lang.js +28 -8
- package/lib/components/link/Link.js +2 -2
- package/lib/components/link/Link.vue.d.ts +18 -3
- package/lib/components/link/Link.vue_vue_type_script_setup_true_lang.js +10 -5
- package/lib/components/loader/Loader.vue.d.ts +30 -6
- package/lib/components/loader/Loader.vue_vue_type_script_setup_true_lang.js +11 -3
- package/lib/components/menu/Menu.vue.d.ts +51 -9
- package/lib/components/menu/Menu.vue_vue_type_script_setup_true_lang.js +24 -8
- package/lib/components/menu/MenuItem.js +2 -2
- package/lib/components/menu/MenuItem.vue.d.ts +198 -45
- package/lib/components/menu/MenuItem.vue_vue_type_script_setup_true_lang.js +84 -23
- package/lib/components/menu/{MenuItem.vue_vue_type_style_index_0_scoped_2a6b7341_lang.module.js → MenuItem.vue_vue_type_style_index_0_scoped_5aebaff3_lang.module.js} +1 -1
- package/lib/components/modal/Modal.vue.d.ts +177 -39
- package/lib/components/modal/Modal.vue_vue_type_script_setup_true_lang.js +104 -23
- package/lib/components/notifications/Notifications.vue.d.ts +24 -0
- package/lib/components/notifications/Notifications.vue_vue_type_script_setup_true_lang.js +39 -12
- package/lib/components/pagination/Pagination.vue.d.ts +12 -0
- package/lib/components/pagination/Pagination.vue_vue_type_script_setup_true_lang.js +8 -4
- package/lib/components/pagination/PaginationItem.vue.d.ts +18 -3
- package/lib/components/pagination/PaginationItem.vue_vue_type_script_setup_true_lang.js +8 -3
- package/lib/components/popover/Popover.vue.d.ts +204 -45
- package/lib/components/popover/Popover.vue_vue_type_script_setup_true_lang.js +157 -66
- package/lib/components/popover/PopoverContainer.vue.d.ts +3 -0
- package/lib/components/popover/PopoverContainer.vue_vue_type_script_setup_true_lang.js +3 -1
- package/lib/components/popover/PopoverContentBoundary.js +5 -0
- package/lib/components/popover/PopoverContentBoundary.vue.d.ts +9 -0
- package/lib/components/popover/PopoverContentBoundary.vue_vue_type_script_setup_true_lang.js +18 -0
- package/lib/components/popover/theme/PopoverContainer.base.theme.js +1 -1
- package/lib/components/progress/Progress.vue.d.ts +9 -0
- package/lib/components/progress/Progress.vue_vue_type_script_setup_true_lang.js +7 -4
- package/lib/components/qrCode/QrCode.vue.d.ts +24 -3
- package/lib/components/qrCode/QrCode.vue_vue_type_script_setup_true_lang.js +13 -5
- package/lib/components/radio/Radio.vue.d.ts +186 -42
- package/lib/components/radio/Radio.vue_vue_type_script_setup_true_lang.js +10 -2
- package/lib/components/radioButton/RadioButton.vue.d.ts +186 -42
- package/lib/components/radioButton/RadioButton.vue_vue_type_script_setup_true_lang.js +9 -1
- package/lib/components/scroll/Scroll.vue.d.ts +3 -0
- package/lib/components/scroll/Scroll.vue_vue_type_script_setup_true_lang.js +9 -4
- package/lib/components/select/Select.vue.d.ts +633 -144
- package/lib/components/select/Select.vue_vue_type_script_setup_true_lang.js +224 -189
- package/lib/components/skeleton/Skeleton.vue.d.ts +6 -0
- package/lib/components/skeleton/Skeleton.vue_vue_type_script_setup_true_lang.js +5 -2
- package/lib/components/slider/Slider.js +1 -1
- package/lib/components/slider/Slider.vue.d.ts +180 -39
- package/lib/components/slider/Slider.vue_vue_type_script_setup_true_lang.js +14 -3
- package/lib/components/spinner/Spinner.vue.d.ts +6 -0
- package/lib/components/spinner/Spinner.vue_vue_type_script_setup_true_lang.js +3 -1
- package/lib/components/stepper/Stepper.vue.d.ts +120 -24
- package/lib/components/stepper/Stepper.vue_vue_type_script_setup_true_lang.js +63 -15
- package/lib/components/tab/Tab.vue.d.ts +112 -31
- package/lib/components/tab/Tab.vue_vue_type_script_setup_true_lang.js +166 -95
- package/lib/components/tab/TabGroup.vue.d.ts +47 -12
- package/lib/components/tab/TabGroup.vue_vue_type_script_setup_true_lang.js +93 -49
- package/lib/components/tab/theme/Tab.base.theme.js +6 -6
- package/lib/components/tab/theme/Tab.carbon.theme.js +6 -6
- package/lib/components/tab/theme/TabGroup.base.theme.js +7 -7
- package/lib/components/tab/theme/TabGroup.carbon.theme.js +3 -3
- package/lib/components/table/Table.vue.d.ts +45 -9
- package/lib/components/table/Table.vue_vue_type_script_setup_true_lang.js +82 -27
- package/lib/components/table/TableCell.vue.d.ts +54 -12
- package/lib/components/table/TableCell.vue_vue_type_script_setup_true_lang.js +23 -8
- package/lib/components/table/TableHead.vue_vue_type_script_setup_true_lang.js +2 -1
- package/lib/components/table/TableHeader.vue.d.ts +18 -3
- package/lib/components/table/TableHeader.vue_vue_type_script_setup_true_lang.js +10 -4
- package/lib/components/table/TableRow.vue.d.ts +15 -3
- package/lib/components/table/TableRow.vue_vue_type_script_setup_true_lang.js +10 -5
- package/lib/components/tag/Tag.vue.d.ts +33 -6
- package/lib/components/tag/Tag.vue_vue_type_script_setup_true_lang.js +21 -7
- package/lib/components/textarea/Textarea.vue.d.ts +237 -54
- package/lib/components/textarea/Textarea.vue_vue_type_script_setup_true_lang.js +38 -13
- package/lib/components/themeProvider/ThemeProvider.vue.d.ts +10 -4
- package/lib/components/themeProvider/ThemeProvider.vue_vue_type_script_setup_true_lang.js +6 -1
- package/lib/components/toggle/Toggle.vue.d.ts +174 -39
- package/lib/components/toggle/Toggle.vue_vue_type_script_setup_true_lang.js +5 -1
- package/lib/components/tooltip/ToggleTip.vue.d.ts +24 -6
- package/lib/components/tooltip/ToggleTip.vue_vue_type_script_setup_true_lang.js +9 -2
- package/lib/components/tooltip/Tooltip.vue.d.ts +30 -6
- package/lib/components/tooltip/Tooltip.vue_vue_type_script_setup_true_lang.js +16 -4
- package/lib/components/upload/Upload.vue.d.ts +249 -57
- package/lib/components/upload/Upload.vue_vue_type_script_setup_true_lang.js +156 -125
- package/lib/components/upload/fileAccept.d.ts +6 -0
- package/lib/components/upload/fileAccept.js +17 -0
- package/lib/composables/useColors.d.ts +1 -0
- package/lib/composables/useColors.js +2 -1
- package/lib/composables/useCommon.d.ts +1 -0
- package/lib/composables/useCommon.js +2 -1
- package/lib/composables/useFocusTrap.js +1 -1
- package/lib/composables/useInputtable.d.ts +45 -10
- package/lib/composables/useInputtable.js +56 -14
- package/lib/composables/useInteractive.d.ts +13 -3
- package/lib/composables/useInteractive.js +14 -4
- package/lib/index.js +12 -12
- package/lib/index.umd.js +9 -10
- package/lib/themes/base/styles.d.ts +1 -1
- package/lib/themes/base/styles.js +1 -1
- package/lib/themes/carbon/styles.d.ts +1 -1
- package/lib/themes/carbon/styles.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/virtual/components/infiniteLoader/InfiniteLoader.vue.d.ts +27 -16
- package/lib/virtual/components/infiniteLoader/InfiniteLoader.vue_vue_type_script_setup_true_lang.js +25 -5
- package/lib/virtual/components/virtualGrid/VirtualGrid.vue.d.ts +108 -86
- package/lib/virtual/components/virtualGrid/VirtualGrid.vue_vue_type_script_setup_true_lang.js +91 -21
- package/lib/virtual/components/virtualList/VirtualList.vue.d.ts +62 -48
- package/lib/virtual/components/virtualList/VirtualList.vue_vue_type_script_setup_true_lang.js +64 -13
- package/lib/virtual/components/virtualList/useDynamicRowHeight.js +4 -3
- package/package.json +5 -3
- package/src/common/buttonGroupRadius.ts +16 -0
- package/src/common/props.ts +10 -9
- package/src/components/accordion/Accordion.vue +20 -4
- package/src/components/accordion/AccordionItem.vue +28 -3
- package/src/components/alert/Alert.vue +22 -6
- package/src/components/avatar/Avatar.vue +20 -5
- package/src/components/badge/Badge.vue +24 -5
- package/src/components/breadcrumbs/Breadcrumbs.vue +15 -5
- package/src/components/button/Button.vue +140 -5
- package/src/components/button/ButtonGroup.vue +41 -25
- package/src/components/button/__tests__/ Button.spec.ts +41 -0
- package/src/components/button/__tests__/ ButtonGroup.spec.ts +32 -0
- package/src/components/button/theme/Button.base.theme.ts +4 -1
- package/src/components/button/theme/Button.carbon.theme.ts +5 -4
- package/src/components/card/Card.vue +10 -2
- package/src/components/carousel/Carousel.vue +22 -2
- package/src/components/carousel/CarouselSlide.vue +6 -0
- package/src/components/checkbox/Checkbox.vue +22 -3
- package/src/components/container/Container.vue +10 -1
- package/src/components/datepicker/Datepicker.vue +466 -101
- package/src/components/datepicker/__tests__/Datepicker.spec.ts +31 -0
- package/src/components/divider/Divider.vue +9 -3
- package/src/components/drawer/Drawer.vue +27 -2
- package/src/components/empty/Empty.vue +18 -3
- package/src/components/form/Form.vue +32 -3
- package/src/components/formGroup/FormGroup.vue +12 -0
- package/src/components/icon/Icon.vue +4 -1
- package/src/components/image/Image.vue +8 -2
- package/src/components/input/Input.vue +54 -12
- package/src/components/inputFooter/InputFooter.vue +21 -6
- package/src/components/inputGroup/InputGroup.vue +12 -1
- package/src/components/label/Label.vue +31 -7
- package/src/components/link/Link.vue +16 -5
- package/src/components/loader/Loader.vue +10 -2
- package/src/components/menu/Menu.vue +23 -5
- package/src/components/menu/MenuItem.vue +78 -17
- package/src/components/modal/Modal.vue +90 -15
- package/src/components/notifications/Notifications.vue +23 -0
- package/src/components/notifications/__tests__/Notifications.spec.ts +44 -4
- package/src/components/pagination/Pagination.vue +9 -1
- package/src/components/pagination/PaginationItem.vue +11 -2
- package/src/components/popover/Popover.vue +113 -18
- package/src/components/popover/PopoverContainer.vue +9 -1
- package/src/components/popover/PopoverContentBoundary.vue +32 -0
- package/src/components/popover/__tests__/Popover.spec.ts +51 -0
- package/src/components/popover/theme/PopoverContainer.base.theme.ts +1 -1
- package/src/components/progress/Progress.vue +8 -3
- package/src/components/qrCode/QrCode.vue +9 -1
- package/src/components/radio/Radio.vue +16 -2
- package/src/components/radioButton/RadioButton.vue +15 -1
- package/src/components/scroll/Scroll.vue +15 -4
- package/src/components/select/Select.vue +53 -16
- package/src/components/skeleton/Skeleton.vue +3 -0
- package/src/components/slider/Slider.vue +15 -0
- package/src/components/spinner/Spinner.vue +2 -0
- package/src/components/stepper/Stepper.vue +57 -9
- package/src/components/tab/Tab.vue +153 -63
- package/src/components/tab/TabGroup.vue +110 -26
- package/src/components/tab/__tests__/Tab.spec.ts +53 -0
- package/src/components/tab/__tests__/TabGroup.spec.ts +113 -0
- package/src/components/tab/theme/Tab.base.theme.ts +24 -2
- package/src/components/tab/theme/Tab.carbon.theme.ts +30 -7
- package/src/components/tab/theme/TabGroup.base.theme.ts +12 -9
- package/src/components/tab/theme/TabGroup.carbon.theme.ts +6 -2
- package/src/components/table/Table.vue +76 -19
- package/src/components/table/TableCell.vue +25 -6
- package/src/components/table/TableHead.vue +9 -2
- package/src/components/table/TableHeader.vue +16 -3
- package/src/components/table/TableRow.vue +17 -5
- package/src/components/tag/Tag.vue +22 -6
- package/src/components/textarea/Textarea.vue +40 -11
- package/src/components/themeProvider/ThemeProvider.vue +22 -7
- package/src/components/toggle/Toggle.vue +9 -1
- package/src/components/tooltip/ToggleTip.vue +12 -3
- package/src/components/tooltip/Tooltip.vue +19 -3
- package/src/components/upload/Upload.vue +46 -16
- package/src/components/upload/__tests__/fileAccept.spec.ts +39 -0
- package/src/components/upload/fileAccept.ts +29 -0
- package/src/composables/useColors.ts +1 -0
- package/src/composables/useCommon.ts +1 -0
- package/src/composables/useFocusTrap.ts +3 -1
- package/src/composables/useInputtable.ts +66 -10
- package/src/composables/useInteractive.ts +13 -3
- package/src/themes/base/styles.ts +2 -3
- package/src/themes/carbon/styles.ts +2 -3
- package/src/version.ts +1 -1
- package/src/virtual/components/infiniteLoader/InfiniteLoader.vue +33 -1
- package/src/virtual/components/virtualGrid/VirtualGrid.vue +104 -10
- package/src/virtual/components/virtualList/VirtualList.vue +73 -8
- package/src/virtual/components/virtualList/useDynamicRowHeight.ts +9 -2
- package/volar.d.ts +3 -0
- package/docs/layouts/simple.vue +0 -5
- package/lib/components/button/ButtonGroup.vue_vue_type_style_index_0_lang.module.js +0 -7
- /package/lib/components/button/{Button.vue_vue_type_style_index_0_scoped_4402fde2_lang.module.js → Button.vue_vue_type_style_index_0_scoped_486cb9c0_lang.module.js} +0 -0
- /package/lib/components/link/{Link.vue_vue_type_style_index_0_scoped_8e0e4d08_lang.module.js → Link.vue_vue_type_style_index_0_scoped_3ee61e03_lang.module.js} +0 -0
|
@@ -6,32 +6,82 @@ import { useCommon as i } from "../../composables/useCommon.js";
|
|
|
6
6
|
import a from "../icon/Icon.js";
|
|
7
7
|
import { closeIcon as o } from "../../common/icons.js";
|
|
8
8
|
import s from "../link/Link.js";
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
9
|
+
import c from "../tooltip/Tooltip.js";
|
|
10
|
+
import { useMutationObserver as l } from "../../node_modules/.pnpm/@vueuse_core@11.1.0_vue@3.5.34_typescript@5.2.2_/node_modules/@vueuse/core/index.js";
|
|
11
|
+
import { Teleport as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createSlots as g, createTextVNode as _, defineComponent as v, inject as y, normalizeClass as b, normalizeStyle as x, onBeforeUnmount as S, onMounted as C, openBlock as w, reactive as T, ref as E, renderSlot as D, resolveDynamicComponent as O, toDisplayString as k, unref as A, withCtx as j } from "vue";
|
|
11
12
|
//#region src/components/tab/Tab.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
13
|
+
var M = {
|
|
13
14
|
...i.props(),
|
|
14
|
-
|
|
15
|
+
size: {
|
|
16
|
+
type: String,
|
|
17
|
+
validator: (e) => i.validators().size.includes(e),
|
|
18
|
+
description: "Tab size. Falls back to the parent tab group size when omitted."
|
|
19
|
+
},
|
|
20
|
+
value: {
|
|
21
|
+
type: [String, Number],
|
|
22
|
+
description: "Value used to select this tab in the group."
|
|
23
|
+
},
|
|
15
24
|
tag: {
|
|
16
25
|
type: String,
|
|
17
|
-
default: "button"
|
|
26
|
+
default: "button",
|
|
27
|
+
description: "Root element tag when not using `to`."
|
|
18
28
|
},
|
|
19
|
-
to:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
to: {
|
|
30
|
+
type: [String, Object],
|
|
31
|
+
description: "Vue Router location; renders as a link when set."
|
|
32
|
+
},
|
|
33
|
+
label: {
|
|
34
|
+
type: String,
|
|
35
|
+
description: "Visible label. Defaults to `value` when omitted."
|
|
36
|
+
},
|
|
37
|
+
icon: {
|
|
38
|
+
type: String,
|
|
39
|
+
description: "Icon name shown before the label."
|
|
40
|
+
},
|
|
41
|
+
tooltip: {
|
|
42
|
+
type: String,
|
|
43
|
+
description: "Tooltip text. Prefer the tooltip slot for custom content."
|
|
44
|
+
},
|
|
45
|
+
tooltipPosition: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "top",
|
|
48
|
+
description: "Tooltip placement relative to the tab."
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
description: "Prevents selecting this tab."
|
|
53
|
+
},
|
|
54
|
+
exact: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
description: "Requires exact route match when using `to`."
|
|
57
|
+
},
|
|
58
|
+
removable: r("Shows a remove control that emits `remove`.")
|
|
59
|
+
}, N = /* @__PURE__ */ v({
|
|
26
60
|
name: "XTab",
|
|
27
61
|
validators: { ...i.validators() },
|
|
28
|
-
|
|
62
|
+
docs: {
|
|
63
|
+
slots: {
|
|
64
|
+
default: "Tab panel content shown when this tab is selected.",
|
|
65
|
+
tab: "Custom tab trigger content. Slot props: label, value, size, icon.",
|
|
66
|
+
tooltip: "Custom tooltip content; overrides the `tooltip` prop."
|
|
67
|
+
},
|
|
68
|
+
emits: { remove: "Emitted when the remove control is clicked." }
|
|
69
|
+
},
|
|
70
|
+
props: M,
|
|
29
71
|
emits: ["remove"],
|
|
30
72
|
setup(r) {
|
|
31
|
-
let i = r,
|
|
32
|
-
|
|
73
|
+
let i = r, v = t("Tab", i), M = d(() => L.value?.$el?.href || i.value), N = d(() => !(i.icon && (i.label === void 0 || i.label === ""))), P = d(() => i.label || i.value), F = d(() => {
|
|
74
|
+
if (!N.value) {
|
|
75
|
+
if (i.tooltip) return i.tooltip;
|
|
76
|
+
if (i.label) return i.label;
|
|
77
|
+
if (M.value !== void 0 && M.value !== null) return String(M.value);
|
|
78
|
+
}
|
|
79
|
+
}), I = E(null), L = E(null), R = y(e, {
|
|
80
|
+
tabsContentRef: E(null),
|
|
33
81
|
activateTab: () => {},
|
|
34
|
-
|
|
82
|
+
registerTab: () => {},
|
|
83
|
+
unregisterTab: () => {},
|
|
84
|
+
state: T({
|
|
35
85
|
active: void 0,
|
|
36
86
|
variant: "line",
|
|
37
87
|
ghost: !1,
|
|
@@ -40,100 +90,121 @@ var O = {
|
|
|
40
90
|
size: "md",
|
|
41
91
|
color: "primary"
|
|
42
92
|
})
|
|
43
|
-
}),
|
|
44
|
-
|
|
45
|
-
|
|
93
|
+
}), z = d(() => R.state.exact || i.exact), B = d(() => i.size ?? R.state.size ?? "md");
|
|
94
|
+
C(() => {
|
|
95
|
+
I.value = R.tabsContentRef.value, M.value !== void 0 && R.registerTab(M.value), i.to && L.value && (V(), l(L.value.$el, V, {
|
|
46
96
|
attributes: !0,
|
|
47
97
|
attributeFilter: ["class"]
|
|
48
98
|
}));
|
|
99
|
+
}), S(() => {
|
|
100
|
+
M.value !== void 0 && R.unregisterTab(M.value);
|
|
49
101
|
});
|
|
50
|
-
function
|
|
51
|
-
|
|
102
|
+
function V() {
|
|
103
|
+
L.value && L.value.$el && i.to && L.value.$el.classList.contains(z.value ? "router-link-exact-active" : "router-link-active") && R.activateTab(M.value);
|
|
52
104
|
}
|
|
53
|
-
let
|
|
54
|
-
function
|
|
105
|
+
let H = d(() => R.state.active === M.value), U = d(() => R.state.color);
|
|
106
|
+
function W(e) {
|
|
55
107
|
if (i.disabled) {
|
|
56
108
|
e.preventDefault(), e.stopPropagation();
|
|
57
109
|
return;
|
|
58
110
|
}
|
|
59
|
-
!i.to &&
|
|
111
|
+
!i.to && M.value !== void 0 && R.activateTab(M.value);
|
|
60
112
|
}
|
|
61
|
-
let { styles:
|
|
113
|
+
let G = d(() => R.state.variant === "block" || R.state.variant === "compact"), { styles: K, classes: q, className: J } = n("Tab", {}, d(() => ({
|
|
62
114
|
...i,
|
|
63
|
-
size:
|
|
64
|
-
exact:
|
|
65
|
-
}), {
|
|
66
|
-
...
|
|
67
|
-
selected:
|
|
115
|
+
size: B.value,
|
|
116
|
+
exact: z.value
|
|
117
|
+
})), {
|
|
118
|
+
...R.state,
|
|
119
|
+
selected: H,
|
|
120
|
+
showLabel: N
|
|
68
121
|
});
|
|
69
|
-
return (e, t) => (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
to: e.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
122
|
+
return (e, t) => (w(), f(c, {
|
|
123
|
+
position: e.tooltipPosition,
|
|
124
|
+
"data-value": M.value,
|
|
125
|
+
class: b(["shrink-0", { "flex-1": A(R).state.grow }])
|
|
126
|
+
}, g({
|
|
127
|
+
default: j(() => [(w(), f(O(e.to ? s : e.tag), {
|
|
128
|
+
ref_key: "elRef",
|
|
129
|
+
ref: L,
|
|
130
|
+
type: e.tag === "button" ? "button" : void 0,
|
|
131
|
+
to: e.to,
|
|
132
|
+
color: H.value ? U.value : void 0,
|
|
133
|
+
style: x([A(K), e.to && H.value && G.value ? "--x-link-text: var(--x-tab-group-text); --x-link-text-hover: var(--x-tab-group-text);" : ""]),
|
|
134
|
+
class: b([
|
|
135
|
+
A(J),
|
|
136
|
+
A(q).wrapper,
|
|
137
|
+
"flex items-center justify-center",
|
|
138
|
+
{
|
|
139
|
+
"w-full": A(R).state.grow,
|
|
140
|
+
"text-[color:var(--x-tab-group-text)] dark:text-[color:var(--x-tab-group-dark-text)]": H.value,
|
|
141
|
+
"cursor-pointer": !e.disabled,
|
|
142
|
+
"cursor-not-allowed": e.disabled,
|
|
143
|
+
"cursor-not-allowed text-secondary-500": e.disabled && !H.value
|
|
144
|
+
}
|
|
145
|
+
]),
|
|
146
|
+
"aria-label": F.value,
|
|
147
|
+
"aria-disabled": e.disabled ? "true" : void 0,
|
|
148
|
+
"aria-selected": H.value ? "true" : "false",
|
|
149
|
+
onClick: W
|
|
150
|
+
}, {
|
|
151
|
+
default: j(() => [D(e.$slots, "tab", {
|
|
152
|
+
label: e.label,
|
|
153
|
+
value: e.value,
|
|
154
|
+
size: B.value,
|
|
155
|
+
icon: e.icon
|
|
156
|
+
}, () => [h("div", { class: b(A(q).content) }, [
|
|
157
|
+
e.icon ? (w(), f(a, {
|
|
158
|
+
key: 0,
|
|
159
|
+
icon: e.icon,
|
|
160
|
+
size: B.value,
|
|
161
|
+
class: b(A(q).icon)
|
|
162
|
+
}, null, 8, [
|
|
163
|
+
"icon",
|
|
164
|
+
"size",
|
|
165
|
+
"class"
|
|
166
|
+
])) : p("", !0),
|
|
167
|
+
N.value ? (w(), m("div", {
|
|
168
|
+
key: 1,
|
|
169
|
+
class: b(A(q).label)
|
|
170
|
+
}, k(P.value), 3)) : p("", !0),
|
|
171
|
+
A(v).removable ? (w(), f(a, {
|
|
172
|
+
key: 2,
|
|
173
|
+
size: "sm",
|
|
174
|
+
icon: A(o),
|
|
175
|
+
class: "ml-2 cursor-pointer hover:text-secondary-700 dark:hover:text-secondary-500 transition-colors duration-150",
|
|
176
|
+
onClick: t[0] ||= (t) => e.$emit("remove", t)
|
|
177
|
+
}, null, 8, ["icon"])) : p("", !0)
|
|
178
|
+
], 2)]), H.value && I.value ? (w(), f(u, {
|
|
179
|
+
key: 0,
|
|
180
|
+
to: I.value
|
|
181
|
+
}, [e.$slots.default ? (w(), m("div", {
|
|
100
182
|
key: 0,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
role: "tabpanel",
|
|
123
|
-
class: _(E(B).tabpanel)
|
|
124
|
-
}, [C(e.$slots, "default")], 2)) : f("", !0)], 8, ["to"])) : f("", !0)]),
|
|
125
|
-
_: 3
|
|
126
|
-
}, 8, [
|
|
127
|
-
"type",
|
|
183
|
+
role: "tabpanel",
|
|
184
|
+
class: b(A(q).tabpanel)
|
|
185
|
+
}, [D(e.$slots, "default")], 2)) : p("", !0)], 8, ["to"])) : p("", !0)]),
|
|
186
|
+
_: 3
|
|
187
|
+
}, 8, [
|
|
188
|
+
"type",
|
|
189
|
+
"to",
|
|
190
|
+
"color",
|
|
191
|
+
"style",
|
|
192
|
+
"class",
|
|
193
|
+
"aria-label",
|
|
194
|
+
"aria-disabled",
|
|
195
|
+
"aria-selected"
|
|
196
|
+
]))]),
|
|
197
|
+
_: 2
|
|
198
|
+
}, [e.$slots.tooltip || e.tooltip ? {
|
|
199
|
+
name: "tooltip",
|
|
200
|
+
fn: j(() => [D(e.$slots, "tooltip", {}, () => [_(k(e.tooltip), 1)])]),
|
|
201
|
+
key: "0"
|
|
202
|
+
} : void 0]), 1032, [
|
|
203
|
+
"position",
|
|
128
204
|
"data-value",
|
|
129
|
-
"
|
|
130
|
-
"color",
|
|
131
|
-
"style",
|
|
132
|
-
"class",
|
|
133
|
-
"aria-disabled",
|
|
134
|
-
"aria-selected"
|
|
205
|
+
"class"
|
|
135
206
|
]));
|
|
136
207
|
}
|
|
137
208
|
});
|
|
138
209
|
//#endregion
|
|
139
|
-
export {
|
|
210
|
+
export { N as default };
|
|
@@ -2,40 +2,53 @@ import { type PropType, type ExtractPublicPropTypes, type Ref } from 'vue';
|
|
|
2
2
|
import { type Size } from '../../composables/useCommon';
|
|
3
3
|
import { type ThemeComponent } from '../../composables/useTheme';
|
|
4
4
|
declare const validators: {
|
|
5
|
-
variant: readonly ["line", "block"];
|
|
5
|
+
variant: readonly ["line", "block", "compact"];
|
|
6
6
|
align: readonly ["left", "center", "right"];
|
|
7
7
|
size: string[];
|
|
8
8
|
};
|
|
9
9
|
declare const tabGroupProps: {
|
|
10
|
-
modelValue:
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
12
|
+
description: string;
|
|
13
|
+
};
|
|
11
14
|
variant: {
|
|
12
|
-
type: PropType<"block" | "line">;
|
|
15
|
+
type: PropType<"block" | "line" | "compact">;
|
|
13
16
|
default: string;
|
|
17
|
+
description: string;
|
|
14
18
|
};
|
|
15
19
|
align: {
|
|
16
20
|
type: PropType<"left" | "right" | "center">;
|
|
17
21
|
default: string;
|
|
22
|
+
description: string;
|
|
18
23
|
};
|
|
19
24
|
ghost: import("vue").Prop<boolean | undefined>;
|
|
20
25
|
grow: import("vue").Prop<boolean | undefined>;
|
|
21
|
-
exact:
|
|
26
|
+
exact: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
description: string;
|
|
29
|
+
};
|
|
22
30
|
fullWidth: {
|
|
23
31
|
type: BooleanConstructor;
|
|
24
32
|
default: boolean;
|
|
33
|
+
description: string;
|
|
25
34
|
};
|
|
26
35
|
color: {
|
|
27
36
|
readonly type: StringConstructor;
|
|
28
37
|
readonly default: string | undefined;
|
|
38
|
+
readonly description: "Theme or CSS color used for the control accents.";
|
|
29
39
|
};
|
|
30
40
|
size: {
|
|
31
41
|
readonly type: PropType<Size>;
|
|
32
42
|
readonly default: "md";
|
|
33
43
|
readonly validator: (value: string) => boolean;
|
|
44
|
+
readonly description: "Control size. One of xs, sm, md, lg, xl.";
|
|
34
45
|
};
|
|
35
46
|
};
|
|
36
47
|
export type TabGroupInjection = {
|
|
37
48
|
tabsContentRef: Ref<HTMLElement | null>;
|
|
38
|
-
activateTab: (tab: string | number) => void;
|
|
49
|
+
activateTab: (tab: string | number | null) => void;
|
|
50
|
+
registerTab: (tab: string | number) => void;
|
|
51
|
+
unregisterTab: (tab: string | number) => void;
|
|
39
52
|
state: {
|
|
40
53
|
active: string | number | undefined;
|
|
41
54
|
variant: TabGroupVariant;
|
|
@@ -53,56 +66,78 @@ type InternalClasses = 'wrapper' | 'list' | 'tracker' | 'scroller';
|
|
|
53
66
|
export interface TabGroupTheme extends ThemeComponent<TabGroupProps, InternalClasses> {
|
|
54
67
|
}
|
|
55
68
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
56
|
-
modelValue:
|
|
69
|
+
modelValue: {
|
|
70
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
57
73
|
variant: {
|
|
58
|
-
type: PropType<"block" | "line">;
|
|
74
|
+
type: PropType<"block" | "line" | "compact">;
|
|
59
75
|
default: string;
|
|
76
|
+
description: string;
|
|
60
77
|
};
|
|
61
78
|
align: {
|
|
62
79
|
type: PropType<"left" | "right" | "center">;
|
|
63
80
|
default: string;
|
|
81
|
+
description: string;
|
|
64
82
|
};
|
|
65
83
|
ghost: import("vue").Prop<boolean | undefined>;
|
|
66
84
|
grow: import("vue").Prop<boolean | undefined>;
|
|
67
|
-
exact:
|
|
85
|
+
exact: {
|
|
86
|
+
type: BooleanConstructor;
|
|
87
|
+
description: string;
|
|
88
|
+
};
|
|
68
89
|
fullWidth: {
|
|
69
90
|
type: BooleanConstructor;
|
|
70
91
|
default: boolean;
|
|
92
|
+
description: string;
|
|
71
93
|
};
|
|
72
94
|
color: {
|
|
73
95
|
readonly type: StringConstructor;
|
|
74
96
|
readonly default: string | undefined;
|
|
97
|
+
readonly description: "Theme or CSS color used for the control accents.";
|
|
75
98
|
};
|
|
76
99
|
size: {
|
|
77
100
|
readonly type: PropType<Size>;
|
|
78
101
|
readonly default: "md";
|
|
79
102
|
readonly validator: (value: string) => boolean;
|
|
103
|
+
readonly description: "Control size. One of xs, sm, md, lg, xl.";
|
|
80
104
|
};
|
|
81
105
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
82
|
-
modelValue:
|
|
106
|
+
modelValue: {
|
|
107
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
108
|
+
description: string;
|
|
109
|
+
};
|
|
83
110
|
variant: {
|
|
84
|
-
type: PropType<"block" | "line">;
|
|
111
|
+
type: PropType<"block" | "line" | "compact">;
|
|
85
112
|
default: string;
|
|
113
|
+
description: string;
|
|
86
114
|
};
|
|
87
115
|
align: {
|
|
88
116
|
type: PropType<"left" | "right" | "center">;
|
|
89
117
|
default: string;
|
|
118
|
+
description: string;
|
|
90
119
|
};
|
|
91
120
|
ghost: import("vue").Prop<boolean | undefined>;
|
|
92
121
|
grow: import("vue").Prop<boolean | undefined>;
|
|
93
|
-
exact:
|
|
122
|
+
exact: {
|
|
123
|
+
type: BooleanConstructor;
|
|
124
|
+
description: string;
|
|
125
|
+
};
|
|
94
126
|
fullWidth: {
|
|
95
127
|
type: BooleanConstructor;
|
|
96
128
|
default: boolean;
|
|
129
|
+
description: string;
|
|
97
130
|
};
|
|
98
131
|
color: {
|
|
99
132
|
readonly type: StringConstructor;
|
|
100
133
|
readonly default: string | undefined;
|
|
134
|
+
readonly description: "Theme or CSS color used for the control accents.";
|
|
101
135
|
};
|
|
102
136
|
size: {
|
|
103
137
|
readonly type: PropType<Size>;
|
|
104
138
|
readonly default: "md";
|
|
105
139
|
readonly validator: (value: string) => boolean;
|
|
140
|
+
readonly description: "Control size. One of xs, sm, md, lg, xl.";
|
|
106
141
|
};
|
|
107
142
|
}>> & Readonly<{
|
|
108
143
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -111,7 +146,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
111
146
|
size: Size;
|
|
112
147
|
align: "left" | "right" | "center";
|
|
113
148
|
exact: boolean;
|
|
114
|
-
variant: "block" | "line";
|
|
149
|
+
variant: "block" | "line" | "compact";
|
|
115
150
|
fullWidth: boolean;
|
|
116
151
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
117
152
|
default?(_: {}): any;
|
|
@@ -9,114 +9,158 @@ import { useMutationObserver as s, useResizeObserver as c } from "../../node_mod
|
|
|
9
9
|
import l from "../scroll/Scroll.js";
|
|
10
10
|
import { computed as u, createElementBlock as d, createElementVNode as f, createVNode as p, defineComponent as m, nextTick as h, normalizeClass as g, normalizeStyle as _, onMounted as v, openBlock as y, provide as b, reactive as x, ref as S, renderSlot as C, unref as w, vShow as T, watch as E, watchEffect as D, withCtx as O, withDirectives as k } from "vue";
|
|
11
11
|
//#region src/components/tab/TabGroup.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var A = /* @__PURE__ */ m({
|
|
12
|
+
var A = { class: "relative overflow-x-clip" }, j = /* @__PURE__ */ m({
|
|
13
13
|
name: "XTabGroup",
|
|
14
14
|
validators: {
|
|
15
15
|
...a.validators(),
|
|
16
|
-
variant: [
|
|
16
|
+
variant: [
|
|
17
|
+
"line",
|
|
18
|
+
"block",
|
|
19
|
+
"compact"
|
|
20
|
+
],
|
|
17
21
|
align: [
|
|
18
22
|
"left",
|
|
19
23
|
"center",
|
|
20
24
|
"right"
|
|
21
25
|
]
|
|
22
26
|
},
|
|
27
|
+
docs: {
|
|
28
|
+
slots: { default: "Tab triggers (typically x-tab children)." },
|
|
29
|
+
emits: { "update:modelValue": "Emitted when the active tab changes (v-model)." }
|
|
30
|
+
},
|
|
23
31
|
props: {
|
|
24
32
|
...a.props(),
|
|
25
33
|
...n.props("primary"),
|
|
26
|
-
modelValue:
|
|
34
|
+
modelValue: {
|
|
35
|
+
type: [String, Number],
|
|
36
|
+
description: "Active tab value (v-model)."
|
|
37
|
+
},
|
|
27
38
|
variant: {
|
|
28
39
|
type: String,
|
|
29
|
-
default: "line"
|
|
40
|
+
default: "line",
|
|
41
|
+
description: "Visual style of the tab list (line, block, or compact)."
|
|
30
42
|
},
|
|
31
43
|
align: {
|
|
32
44
|
type: String,
|
|
33
|
-
default: "left"
|
|
45
|
+
default: "left",
|
|
46
|
+
description: "Horizontal alignment of tabs in the list."
|
|
47
|
+
},
|
|
48
|
+
ghost: i("Subtle styling with less background emphasis."),
|
|
49
|
+
grow: i("Stretches tabs to fill the list width."),
|
|
50
|
+
exact: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
description: "Default exact route matching for linked tabs."
|
|
34
53
|
},
|
|
35
|
-
ghost: i(),
|
|
36
|
-
grow: i(),
|
|
37
|
-
exact: Boolean,
|
|
38
54
|
fullWidth: {
|
|
39
55
|
type: Boolean,
|
|
40
|
-
default: !0
|
|
56
|
+
default: !0,
|
|
57
|
+
description: "Stretches the tab list to the container width."
|
|
41
58
|
}
|
|
42
59
|
},
|
|
43
60
|
emits: ["update:modelValue"],
|
|
44
61
|
setup(n, { emit: i }) {
|
|
45
|
-
let a = n, m = t("TabGroup", a),
|
|
62
|
+
let a = n, m = t("TabGroup", a), j = i, M = S(null), N = S(null), P = S(null), F = S(null), I = S(null), L = S();
|
|
46
63
|
D(() => {
|
|
47
|
-
|
|
64
|
+
L.value = a.modelValue;
|
|
48
65
|
});
|
|
49
|
-
let
|
|
50
|
-
active: u(() =>
|
|
66
|
+
let R = x({
|
|
67
|
+
active: u(() => L.value),
|
|
51
68
|
variant: u(() => a.variant),
|
|
52
69
|
ghost: u(() => m.value.ghost ?? !1),
|
|
53
70
|
grow: u(() => m.value.grow ?? !1),
|
|
54
71
|
exact: u(() => a.exact),
|
|
55
72
|
size: u(() => a.size),
|
|
56
73
|
color: u(() => a.color)
|
|
57
|
-
});
|
|
58
|
-
function
|
|
59
|
-
|
|
74
|
+
}), z = S(!0), B = [];
|
|
75
|
+
function V(e) {
|
|
76
|
+
L.value = e, j("update:modelValue", e);
|
|
77
|
+
}
|
|
78
|
+
function H(e) {
|
|
79
|
+
B.includes(e) || B.push(e);
|
|
80
|
+
}
|
|
81
|
+
function U(e) {
|
|
82
|
+
let t = B.indexOf(e);
|
|
83
|
+
if (t === -1 || (B.splice(t, 1), L.value !== e)) return;
|
|
84
|
+
let n = B[Math.min(t, B.length - 1)];
|
|
85
|
+
n === void 0 ? (V(null), z.value = !1) : V(n);
|
|
60
86
|
}
|
|
61
87
|
b(e, {
|
|
62
|
-
tabsContentRef:
|
|
63
|
-
activateTab:
|
|
64
|
-
|
|
88
|
+
tabsContentRef: I,
|
|
89
|
+
activateTab: V,
|
|
90
|
+
registerTab: H,
|
|
91
|
+
unregisterTab: U,
|
|
92
|
+
state: R
|
|
65
93
|
});
|
|
66
|
-
let
|
|
67
|
-
if (e
|
|
94
|
+
let W = o(async (e) => {
|
|
95
|
+
if (e == null) {
|
|
96
|
+
z.value = !1;
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
68
99
|
await h();
|
|
69
|
-
let t =
|
|
70
|
-
if (!t || !
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
100
|
+
let t = F.value?.querySelector(`[data-value="${e}"]`);
|
|
101
|
+
if (!t || !P.value) {
|
|
102
|
+
z.value = !1;
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (z.value = !0, P.value.style.left = `${t.offsetLeft}px`, P.value.style.width = `${t.offsetWidth}px`, !F.value || !M.value?.scrollEl) return;
|
|
106
|
+
let n = M.value.scrollEl, r = Math.max(0, F.value.scrollWidth - n.clientWidth), i = n.scrollLeft, a = i + n.clientWidth, o = t.offsetLeft, s = o + t.offsetWidth, c = o >= i && s <= a;
|
|
107
|
+
if (r <= 0) {
|
|
108
|
+
n.scrollLeft !== 0 && n.scrollTo({ left: 0 }), n.dispatchEvent(new CustomEvent("scroll"));
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (c) {
|
|
112
|
+
n.dispatchEvent(new CustomEvent("scroll"));
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
let l = i;
|
|
116
|
+
o < i ? l = o : s > a && (l = s - n.clientWidth), l = Math.max(0, Math.min(l, r)), l === i ? n.dispatchEvent(new CustomEvent("scroll")) : n.scrollTo({
|
|
117
|
+
left: l,
|
|
74
118
|
behavior: "smooth"
|
|
75
119
|
});
|
|
76
|
-
}, 100, !0)
|
|
77
|
-
function
|
|
78
|
-
|
|
120
|
+
}, 100, !0);
|
|
121
|
+
function G() {
|
|
122
|
+
F.value?.querySelector(".router-link-active") ? z.value = !0 : (V(null), z.value = !1);
|
|
79
123
|
}
|
|
80
|
-
E(() =>
|
|
81
|
-
|
|
124
|
+
E(() => L.value, (e) => {
|
|
125
|
+
W(e);
|
|
82
126
|
}), v(() => {
|
|
83
|
-
|
|
127
|
+
F.value?.querySelector(".x-link") && s(F.value, G, {
|
|
84
128
|
attributes: !0,
|
|
85
129
|
subtree: !0,
|
|
86
130
|
attributeFilter: ["class"]
|
|
87
|
-
}),
|
|
88
|
-
}), c(
|
|
89
|
-
|
|
131
|
+
}), W(L.value);
|
|
132
|
+
}), c(F, () => {
|
|
133
|
+
W(L.value);
|
|
90
134
|
});
|
|
91
|
-
let { styles:
|
|
135
|
+
let { styles: K, classes: q, className: J } = r("TabGroup", {}, a);
|
|
92
136
|
return (e, t) => (y(), d("div", null, [f("div", {
|
|
93
137
|
ref_key: "wrapperRef",
|
|
94
|
-
ref:
|
|
95
|
-
class: g(["relative", [w(
|
|
96
|
-
style: _(w(
|
|
138
|
+
ref: N,
|
|
139
|
+
class: g(["relative", [w(J), w(q).wrapper]]),
|
|
140
|
+
style: _(w(K))
|
|
97
141
|
}, [p(l, {
|
|
98
142
|
ref_key: "scrollRef",
|
|
99
|
-
ref:
|
|
143
|
+
ref: M,
|
|
100
144
|
scrollbar: !1,
|
|
101
145
|
horizontal: "",
|
|
102
146
|
mousewheel: "",
|
|
103
|
-
class: g(w(
|
|
147
|
+
class: g(w(q).scroller)
|
|
104
148
|
}, {
|
|
105
|
-
default: O(() => [f("div", {
|
|
149
|
+
default: O(() => [f("div", A, [f("div", {
|
|
106
150
|
ref_key: "tabsRef",
|
|
107
|
-
ref:
|
|
108
|
-
class: g(["relative", w(
|
|
151
|
+
ref: F,
|
|
152
|
+
class: g(["relative", w(q).list])
|
|
109
153
|
}, [C(e.$slots, "default")], 2), k(f("div", {
|
|
110
154
|
ref_key: "trackerRef",
|
|
111
|
-
ref:
|
|
112
|
-
class: g(w(
|
|
113
|
-
}, null, 2), [[T,
|
|
155
|
+
ref: P,
|
|
156
|
+
class: g(["pointer-events-none", w(q).tracker])
|
|
157
|
+
}, null, 2), [[T, z.value]])])]),
|
|
114
158
|
_: 3
|
|
115
159
|
}, 8, ["class"])], 6), f("div", {
|
|
116
160
|
ref_key: "tabsContentRef",
|
|
117
|
-
ref:
|
|
161
|
+
ref: I
|
|
118
162
|
}, null, 512)]));
|
|
119
163
|
}
|
|
120
164
|
});
|
|
121
165
|
//#endregion
|
|
122
|
-
export {
|
|
166
|
+
export { j as default };
|