@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
|
@@ -1,127 +1,249 @@
|
|
|
1
1
|
import { injectButtonGroupKey as e, injectInputGroupKey as t } from "../../composables/keys.js";
|
|
2
2
|
import { useResolvedComponentProps as n } from "../../composables/resolveComponentDefaults.js";
|
|
3
3
|
import { useColors as r } from "../../composables/useColors.js";
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import { variantBooleanProps as
|
|
6
|
-
import { useCommon as
|
|
7
|
-
import
|
|
8
|
-
import { useInteractive as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
4
|
+
import { useTheme as ee } from "../../composables/useTheme.js";
|
|
5
|
+
import { variantBooleanProps as i } from "../../common/props.js";
|
|
6
|
+
import { useCommon as a } from "../../composables/useCommon.js";
|
|
7
|
+
import o from "../icon/Icon.js";
|
|
8
|
+
import { useInteractive as s } from "../../composables/useInteractive.js";
|
|
9
|
+
import c from "../loader/Loader.js";
|
|
10
|
+
import te from "../tooltip/Tooltip.js";
|
|
11
|
+
import { computed as l, createBlock as u, createCommentVNode as d, createElementVNode as f, createTextVNode as p, defineComponent as m, inject as h, normalizeClass as g, normalizeStyle as _, onMounted as v, onUnmounted as y, openBlock as b, ref as ne, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, unref as w, useAttrs as T, useSlots as E, withCtx as D } from "vue";
|
|
11
12
|
//#region src/components/button/Button.vue?vue&type=script&setup=true&lang.ts
|
|
12
|
-
var
|
|
13
|
-
...
|
|
13
|
+
var O = {
|
|
14
|
+
...a.props(),
|
|
14
15
|
...r.props(),
|
|
15
|
-
...
|
|
16
|
-
...
|
|
16
|
+
...s.props(),
|
|
17
|
+
...i(),
|
|
17
18
|
tag: {
|
|
18
19
|
type: String,
|
|
19
|
-
default: "button"
|
|
20
|
+
default: "button",
|
|
21
|
+
description: "Root element tag. Becomes a router-link when `to` is set."
|
|
20
22
|
},
|
|
21
23
|
type: {
|
|
22
24
|
type: String,
|
|
23
|
-
default: "button"
|
|
25
|
+
default: "button",
|
|
26
|
+
description: "Native button type when `tag` is `button` (button, submit, reset)."
|
|
24
27
|
},
|
|
25
|
-
icon:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
icon: {
|
|
29
|
+
type: String,
|
|
30
|
+
description: "Shortcut for `iconLeft`."
|
|
31
|
+
},
|
|
32
|
+
iconLeft: {
|
|
33
|
+
type: String,
|
|
34
|
+
description: "Icon name shown before the label."
|
|
35
|
+
},
|
|
36
|
+
iconRight: {
|
|
37
|
+
type: String,
|
|
38
|
+
description: "Icon name shown after the label."
|
|
39
|
+
},
|
|
40
|
+
to: {
|
|
41
|
+
type: [String, Object],
|
|
42
|
+
description: "Vue Router location; renders as a link when set."
|
|
43
|
+
},
|
|
44
|
+
tooltip: {
|
|
45
|
+
type: String,
|
|
46
|
+
description: "Tooltip text shown on hover. Prefer the tooltip slot for custom content."
|
|
47
|
+
},
|
|
48
|
+
tooltipPosition: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "top",
|
|
51
|
+
description: "Tooltip placement relative to the button."
|
|
52
|
+
}
|
|
53
|
+
}, k = /* @__PURE__ */ m({
|
|
30
54
|
name: "XButton",
|
|
31
|
-
validators: { ...
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
55
|
+
validators: { ...a.validators() },
|
|
56
|
+
docs: {
|
|
57
|
+
slots: {
|
|
58
|
+
default: "Button label and content.",
|
|
59
|
+
tooltip: "Custom tooltip content; overrides the `tooltip` prop."
|
|
60
|
+
},
|
|
61
|
+
methods: {
|
|
62
|
+
focus: "Focus the underlying control.",
|
|
63
|
+
blur: "Remove focus from the underlying control."
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
props: O,
|
|
67
|
+
setup(r, { expose: i }) {
|
|
68
|
+
let a = r, m = n("Button", a), O = E(), k = ne(null), A = h(e, {
|
|
35
69
|
isButtonGroup: !1,
|
|
36
|
-
groupProps: {}
|
|
37
|
-
|
|
70
|
+
groupProps: {},
|
|
71
|
+
registerChild: () => {},
|
|
72
|
+
unregisterChild: () => {},
|
|
73
|
+
getPosition: () => "only",
|
|
74
|
+
childOrder: l(() => [])
|
|
75
|
+
}), j = h(t, {
|
|
38
76
|
registerChild: () => {},
|
|
39
77
|
unregisterChild: () => {},
|
|
40
78
|
registerInput: () => {},
|
|
41
79
|
unregisterInput: () => {},
|
|
42
80
|
getPosition: () => "only",
|
|
43
|
-
childOrder:
|
|
81
|
+
childOrder: l(() => []),
|
|
44
82
|
isInsideInputGroup: !1,
|
|
45
83
|
groupProps: {}
|
|
46
|
-
}),
|
|
84
|
+
}), M = `btn-${Math.random().toString(36).slice(2)}`;
|
|
47
85
|
v(() => {
|
|
48
|
-
|
|
86
|
+
A.isButtonGroup && A.registerChild(M), j.isInsideInputGroup && j.registerChild(M);
|
|
49
87
|
}), y(() => {
|
|
50
|
-
|
|
88
|
+
A.isButtonGroup && A.unregisterChild(M), j.isInsideInputGroup && j.unregisterChild(M);
|
|
51
89
|
});
|
|
52
|
-
let { isButtonGroup:
|
|
53
|
-
if (
|
|
54
|
-
}),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
90
|
+
let { isButtonGroup: N } = A, P = l(() => {
|
|
91
|
+
if (A.isButtonGroup) return A.childOrder.value, A.getPosition(M);
|
|
92
|
+
}), F = l(() => !!A.groupProps?.rounded), I = l(() => j.isInsideInputGroup), L = l(() => {
|
|
93
|
+
if (j.isInsideInputGroup) return j.childOrder.value, j.getPosition(M);
|
|
94
|
+
}), R = () => A.groupProps, z = l(() => j.isInsideInputGroup && j.groupProps?.size ? j.groupProps.size : R().size ?? m.value.size), B = l(() => R().flat ?? m.value.flat), V = l(() => m.value.color ?? R().color), H = l(() => R().ghost ?? m.value.ghost), U = l(() => R().light ?? m.value.light), W = l(() => R().outlined ?? m.value.outlined), G = l(() => a.disabled || R().disabled || !!j.groupProps?.disabled), K = l(() => a.icon || a.iconLeft), q = T(), J = l(() => q.href ? "a" : a.to ? "router-link" : a.tag), Y = l(() => !!(a.tooltip || O.tooltip)), X = l(() => !O.default), re = l(() => {
|
|
95
|
+
let e = q["aria-label"];
|
|
96
|
+
if (e != null) return e;
|
|
97
|
+
if (X.value && a.tooltip) return a.tooltip;
|
|
98
|
+
}), ie = l(() => {
|
|
99
|
+
if (m.value.block) return "block w-full";
|
|
100
|
+
if (N) return "inline-flex self-stretch";
|
|
101
|
+
}), { className: Z, classes: Q, styles: $ } = ee("Button", {}, l(() => ({
|
|
102
|
+
size: w(z),
|
|
103
|
+
flat: w(B),
|
|
104
|
+
color: w(V),
|
|
105
|
+
ghost: w(H),
|
|
106
|
+
light: w(U),
|
|
107
|
+
outlined: w(W),
|
|
108
|
+
disabled: w(G),
|
|
109
|
+
loading: a.loading,
|
|
63
110
|
block: m.value.block,
|
|
64
111
|
glow: m.value.glow,
|
|
65
|
-
iconLeft: w(
|
|
66
|
-
iconRight:
|
|
112
|
+
iconLeft: w(K),
|
|
113
|
+
iconRight: a.iconRight,
|
|
67
114
|
rounded: m.value.rounded
|
|
68
115
|
})), {
|
|
69
|
-
isButtonGroup:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
116
|
+
isButtonGroup: N,
|
|
117
|
+
buttonGroupPosition: P,
|
|
118
|
+
buttonGroupRounded: F,
|
|
119
|
+
isInsideInputGroup: I,
|
|
120
|
+
inputGroupPosition: L
|
|
121
|
+
}), { focus: ae, blur: oe } = s(k);
|
|
122
|
+
return i({
|
|
123
|
+
focus: ae,
|
|
124
|
+
blur: oe
|
|
125
|
+
}), (e, t) => Y.value ? (b(), u(te, {
|
|
126
|
+
key: 0,
|
|
127
|
+
position: e.tooltipPosition,
|
|
128
|
+
class: g(ie.value)
|
|
129
|
+
}, {
|
|
130
|
+
tooltip: D(() => [x(e.$slots, "tooltip", {}, () => [p(C(e.tooltip), 1)], !0)]),
|
|
131
|
+
default: D(() => [(b(), u(S(J.value), {
|
|
132
|
+
ref_key: "elRef",
|
|
133
|
+
ref: k,
|
|
134
|
+
to: e.to,
|
|
135
|
+
class: g([
|
|
136
|
+
w(Z),
|
|
137
|
+
e.$style.button,
|
|
138
|
+
w(m).glow && !G.value && !e.loading ? e.$style["button--glow"] : "",
|
|
139
|
+
w(Q).wrapper,
|
|
140
|
+
{
|
|
141
|
+
"w-full": w(m).block,
|
|
142
|
+
"h-full": w(N)
|
|
143
|
+
}
|
|
144
|
+
]),
|
|
145
|
+
style: _(w($)),
|
|
146
|
+
"aria-label": re.value,
|
|
147
|
+
"aria-busy": e.loading ? "true" : null,
|
|
148
|
+
"aria-disabled": e.tag !== "button" && G.value ? "true" : null,
|
|
149
|
+
disabled: G.value || e.loading,
|
|
150
|
+
type: e.tag === "button" ? e.type : null
|
|
151
|
+
}, {
|
|
152
|
+
default: D(() => [
|
|
153
|
+
e.loading ? (b(), u(c, {
|
|
154
|
+
key: 0,
|
|
155
|
+
class: "absolute",
|
|
156
|
+
size: z.value,
|
|
157
|
+
label: e.loadingLabel,
|
|
158
|
+
status: e.loadingStatus
|
|
159
|
+
}, null, 8, [
|
|
160
|
+
"size",
|
|
161
|
+
"label",
|
|
162
|
+
"status"
|
|
163
|
+
])) : d("", !0),
|
|
164
|
+
f("div", { class: g(["inline-flex items-center justify-center", { invisible: e.loading }]) }, [K.value ? (b(), u(o, {
|
|
165
|
+
key: 0,
|
|
166
|
+
size: z.value,
|
|
167
|
+
icon: K.value,
|
|
168
|
+
class: g([w(Q).iconLeft])
|
|
169
|
+
}, null, 8, [
|
|
170
|
+
"size",
|
|
171
|
+
"icon",
|
|
172
|
+
"class"
|
|
173
|
+
])) : d("", !0), f("span", null, [x(e.$slots, "default", {}, void 0, !0)])], 2),
|
|
174
|
+
e.iconRight ? (b(), u(o, {
|
|
175
|
+
key: 1,
|
|
176
|
+
size: z.value,
|
|
177
|
+
icon: e.iconRight,
|
|
178
|
+
class: g([w(Q).iconRight, { invisible: e.loading }])
|
|
179
|
+
}, null, 8, [
|
|
180
|
+
"size",
|
|
181
|
+
"icon",
|
|
182
|
+
"class"
|
|
183
|
+
])) : d("", !0)
|
|
184
|
+
]),
|
|
185
|
+
_: 3
|
|
186
|
+
}, 8, [
|
|
187
|
+
"to",
|
|
188
|
+
"class",
|
|
189
|
+
"style",
|
|
190
|
+
"aria-label",
|
|
191
|
+
"aria-busy",
|
|
192
|
+
"aria-disabled",
|
|
193
|
+
"disabled",
|
|
194
|
+
"type"
|
|
195
|
+
]))]),
|
|
196
|
+
_: 3
|
|
197
|
+
}, 8, ["position", "class"])) : (b(), u(S(J.value), {
|
|
198
|
+
key: 1,
|
|
77
199
|
ref_key: "elRef",
|
|
78
|
-
ref:
|
|
200
|
+
ref: k,
|
|
79
201
|
to: e.to,
|
|
80
202
|
class: g([
|
|
81
|
-
w(
|
|
203
|
+
w(Z),
|
|
82
204
|
e.$style.button,
|
|
83
|
-
w(m).glow && !
|
|
84
|
-
w(
|
|
205
|
+
w(m).glow && !G.value && !e.loading ? e.$style["button--glow"] : "",
|
|
206
|
+
w(Q).wrapper,
|
|
85
207
|
{ "w-full": w(m).block }
|
|
86
208
|
]),
|
|
87
|
-
style: _(w(
|
|
209
|
+
style: _(w($)),
|
|
88
210
|
"aria-busy": e.loading ? "true" : null,
|
|
89
|
-
"aria-disabled": e.tag !== "button" &&
|
|
90
|
-
disabled:
|
|
211
|
+
"aria-disabled": e.tag !== "button" && G.value ? "true" : null,
|
|
212
|
+
disabled: G.value || e.loading,
|
|
91
213
|
type: e.tag === "button" ? e.type : null
|
|
92
214
|
}, {
|
|
93
|
-
default:
|
|
94
|
-
e.loading ? (b(),
|
|
215
|
+
default: D(() => [
|
|
216
|
+
e.loading ? (b(), u(c, {
|
|
95
217
|
key: 0,
|
|
96
218
|
class: "absolute",
|
|
97
|
-
size:
|
|
219
|
+
size: z.value,
|
|
98
220
|
label: e.loadingLabel,
|
|
99
221
|
status: e.loadingStatus
|
|
100
222
|
}, null, 8, [
|
|
101
223
|
"size",
|
|
102
224
|
"label",
|
|
103
225
|
"status"
|
|
104
|
-
])) :
|
|
105
|
-
|
|
226
|
+
])) : d("", !0),
|
|
227
|
+
f("div", { class: g(["inline-flex items-center justify-center", { invisible: e.loading }]) }, [K.value ? (b(), u(o, {
|
|
106
228
|
key: 0,
|
|
107
|
-
size:
|
|
108
|
-
icon:
|
|
109
|
-
class: g([w(
|
|
229
|
+
size: z.value,
|
|
230
|
+
icon: K.value,
|
|
231
|
+
class: g([w(Q).iconLeft])
|
|
110
232
|
}, null, 8, [
|
|
111
233
|
"size",
|
|
112
234
|
"icon",
|
|
113
235
|
"class"
|
|
114
|
-
])) :
|
|
115
|
-
e.iconRight ? (b(),
|
|
236
|
+
])) : d("", !0), f("span", null, [x(e.$slots, "default", {}, void 0, !0)])], 2),
|
|
237
|
+
e.iconRight ? (b(), u(o, {
|
|
116
238
|
key: 1,
|
|
117
|
-
size:
|
|
239
|
+
size: z.value,
|
|
118
240
|
icon: e.iconRight,
|
|
119
|
-
class: g([w(
|
|
241
|
+
class: g([w(Q).iconRight, { invisible: e.loading }])
|
|
120
242
|
}, null, 8, [
|
|
121
243
|
"size",
|
|
122
244
|
"icon",
|
|
123
245
|
"class"
|
|
124
|
-
])) :
|
|
246
|
+
])) : d("", !0)
|
|
125
247
|
]),
|
|
126
248
|
_: 3
|
|
127
249
|
}, 8, [
|
|
@@ -136,4 +258,4 @@ var D = {
|
|
|
136
258
|
}
|
|
137
259
|
});
|
|
138
260
|
//#endregion
|
|
139
|
-
export {
|
|
261
|
+
export { k as default };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var r = /* @__PURE__ */ e(t, [["__cssModules", { $style: n }]]);
|
|
1
|
+
import e from "./ButtonGroup.vue_vue_type_script_setup_true_lang.js";
|
|
2
|
+
//#region src/components/button/ButtonGroup.vue
|
|
3
|
+
var t = e;
|
|
5
4
|
//#endregion
|
|
6
|
-
export {
|
|
5
|
+
export { t as default };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { type ExtractPublicPropTypes } from 'vue';
|
|
1
|
+
import { type ExtractPublicPropTypes, type ComputedRef } from 'vue';
|
|
2
2
|
import { type ThemeComponent } from '../../composables/useTheme';
|
|
3
|
+
import type { ButtonGroupPosition } from '../../common/buttonGroupRadius';
|
|
3
4
|
declare const buttonGroupProps: {
|
|
4
5
|
tag: {
|
|
5
6
|
type: StringConstructor;
|
|
6
7
|
default: string;
|
|
8
|
+
description: string;
|
|
7
9
|
};
|
|
8
10
|
outlined: import("vue").Prop<boolean | undefined>;
|
|
9
11
|
rounded: import("vue").Prop<boolean | undefined>;
|
|
@@ -12,27 +14,43 @@ declare const buttonGroupProps: {
|
|
|
12
14
|
light: import("vue").Prop<boolean | undefined>;
|
|
13
15
|
flat: import("vue").Prop<boolean | undefined>;
|
|
14
16
|
block: import("vue").Prop<boolean | undefined>;
|
|
15
|
-
disabled:
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
disabled: {
|
|
18
|
+
readonly type: BooleanConstructor;
|
|
19
|
+
readonly description: "Disables interaction and applies disabled styling.";
|
|
20
|
+
};
|
|
21
|
+
loading: {
|
|
22
|
+
readonly type: BooleanConstructor;
|
|
23
|
+
readonly description: "Shows a loading indicator and blocks interaction.";
|
|
24
|
+
};
|
|
25
|
+
loadingLabel: {
|
|
26
|
+
readonly type: StringConstructor;
|
|
27
|
+
readonly description: "Accessible label announced while loading.";
|
|
28
|
+
};
|
|
18
29
|
loadingStatus: {
|
|
19
30
|
readonly type: import("vue").PropType<import("../loader/Loader.vue").LoaderStatus>;
|
|
20
31
|
readonly default: "active";
|
|
32
|
+
readonly description: "Loader visual status (for example active or indeterminate).";
|
|
21
33
|
};
|
|
22
34
|
color: {
|
|
23
35
|
readonly type: StringConstructor;
|
|
24
36
|
readonly default: string | undefined;
|
|
37
|
+
readonly description: "Theme or CSS color used for the control accents.";
|
|
25
38
|
};
|
|
26
39
|
size: {
|
|
27
40
|
readonly type: import("vue").PropType<import("../../composables/useCommon").Size>;
|
|
28
41
|
readonly default: "md";
|
|
29
42
|
readonly validator: (value: string) => boolean;
|
|
43
|
+
readonly description: "Control size. One of xs, sm, md, lg, xl.";
|
|
30
44
|
};
|
|
31
45
|
};
|
|
32
46
|
export type ButtonGroupProps = ExtractPublicPropTypes<typeof buttonGroupProps>;
|
|
33
47
|
export type ButtonGroupInjection = {
|
|
34
48
|
groupProps: ButtonGroupProps;
|
|
35
49
|
isButtonGroup: boolean;
|
|
50
|
+
registerChild: (id: string) => void;
|
|
51
|
+
unregisterChild: (id: string) => void;
|
|
52
|
+
getPosition: (id: string) => ButtonGroupPosition;
|
|
53
|
+
childOrder: ComputedRef<string[]>;
|
|
36
54
|
};
|
|
37
55
|
type InternalClasses = 'wrapper';
|
|
38
56
|
type InternalExtraData = {
|
|
@@ -44,6 +62,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
44
62
|
tag: {
|
|
45
63
|
type: StringConstructor;
|
|
46
64
|
default: string;
|
|
65
|
+
description: string;
|
|
47
66
|
};
|
|
48
67
|
outlined: import("vue").Prop<boolean | undefined>;
|
|
49
68
|
rounded: import("vue").Prop<boolean | undefined>;
|
|
@@ -52,26 +71,39 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
52
71
|
light: import("vue").Prop<boolean | undefined>;
|
|
53
72
|
flat: import("vue").Prop<boolean | undefined>;
|
|
54
73
|
block: import("vue").Prop<boolean | undefined>;
|
|
55
|
-
disabled:
|
|
56
|
-
|
|
57
|
-
|
|
74
|
+
disabled: {
|
|
75
|
+
readonly type: BooleanConstructor;
|
|
76
|
+
readonly description: "Disables interaction and applies disabled styling.";
|
|
77
|
+
};
|
|
78
|
+
loading: {
|
|
79
|
+
readonly type: BooleanConstructor;
|
|
80
|
+
readonly description: "Shows a loading indicator and blocks interaction.";
|
|
81
|
+
};
|
|
82
|
+
loadingLabel: {
|
|
83
|
+
readonly type: StringConstructor;
|
|
84
|
+
readonly description: "Accessible label announced while loading.";
|
|
85
|
+
};
|
|
58
86
|
loadingStatus: {
|
|
59
87
|
readonly type: import("vue").PropType<import("../loader/Loader.vue").LoaderStatus>;
|
|
60
88
|
readonly default: "active";
|
|
89
|
+
readonly description: "Loader visual status (for example active or indeterminate).";
|
|
61
90
|
};
|
|
62
91
|
color: {
|
|
63
92
|
readonly type: StringConstructor;
|
|
64
93
|
readonly default: string | undefined;
|
|
94
|
+
readonly description: "Theme or CSS color used for the control accents.";
|
|
65
95
|
};
|
|
66
96
|
size: {
|
|
67
97
|
readonly type: import("vue").PropType<import("../../composables/useCommon").Size>;
|
|
68
98
|
readonly default: "md";
|
|
69
99
|
readonly validator: (value: string) => boolean;
|
|
100
|
+
readonly description: "Control size. One of xs, sm, md, lg, xl.";
|
|
70
101
|
};
|
|
71
102
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
72
103
|
tag: {
|
|
73
104
|
type: StringConstructor;
|
|
74
105
|
default: string;
|
|
106
|
+
description: string;
|
|
75
107
|
};
|
|
76
108
|
outlined: import("vue").Prop<boolean | undefined>;
|
|
77
109
|
rounded: import("vue").Prop<boolean | undefined>;
|
|
@@ -80,21 +112,33 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
80
112
|
light: import("vue").Prop<boolean | undefined>;
|
|
81
113
|
flat: import("vue").Prop<boolean | undefined>;
|
|
82
114
|
block: import("vue").Prop<boolean | undefined>;
|
|
83
|
-
disabled:
|
|
84
|
-
|
|
85
|
-
|
|
115
|
+
disabled: {
|
|
116
|
+
readonly type: BooleanConstructor;
|
|
117
|
+
readonly description: "Disables interaction and applies disabled styling.";
|
|
118
|
+
};
|
|
119
|
+
loading: {
|
|
120
|
+
readonly type: BooleanConstructor;
|
|
121
|
+
readonly description: "Shows a loading indicator and blocks interaction.";
|
|
122
|
+
};
|
|
123
|
+
loadingLabel: {
|
|
124
|
+
readonly type: StringConstructor;
|
|
125
|
+
readonly description: "Accessible label announced while loading.";
|
|
126
|
+
};
|
|
86
127
|
loadingStatus: {
|
|
87
128
|
readonly type: import("vue").PropType<import("../loader/Loader.vue").LoaderStatus>;
|
|
88
129
|
readonly default: "active";
|
|
130
|
+
readonly description: "Loader visual status (for example active or indeterminate).";
|
|
89
131
|
};
|
|
90
132
|
color: {
|
|
91
133
|
readonly type: StringConstructor;
|
|
92
134
|
readonly default: string | undefined;
|
|
135
|
+
readonly description: "Theme or CSS color used for the control accents.";
|
|
93
136
|
};
|
|
94
137
|
size: {
|
|
95
138
|
readonly type: import("vue").PropType<import("../../composables/useCommon").Size>;
|
|
96
139
|
readonly default: "md";
|
|
97
140
|
readonly validator: (value: string) => boolean;
|
|
141
|
+
readonly description: "Control size. One of xs, sm, md, lg, xl.";
|
|
98
142
|
};
|
|
99
143
|
}>> & Readonly<{}>, {
|
|
100
144
|
disabled: boolean;
|
|
@@ -5,41 +5,52 @@ import { useTheme as r } from "../../composables/useTheme.js";
|
|
|
5
5
|
import { variantBooleanProps as i } from "../../common/props.js";
|
|
6
6
|
import { useCommon as a } from "../../composables/useCommon.js";
|
|
7
7
|
import { useInteractive as o } from "../../composables/useInteractive.js";
|
|
8
|
-
import {
|
|
8
|
+
import { computed as s, createBlock as c, defineComponent as l, normalizeClass as u, normalizeStyle as d, openBlock as f, provide as p, ref as m, renderSlot as h, resolveDynamicComponent as g, unref as _, withCtx as v } from "vue";
|
|
9
9
|
//#region src/components/button/ButtonGroup.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var y = {
|
|
11
11
|
...a.props(),
|
|
12
12
|
...n.props(),
|
|
13
13
|
...o.props(),
|
|
14
14
|
...i(),
|
|
15
15
|
tag: {
|
|
16
16
|
type: String,
|
|
17
|
-
default: "div"
|
|
17
|
+
default: "div",
|
|
18
|
+
description: "Root element tag for the group wrapper."
|
|
18
19
|
}
|
|
19
|
-
},
|
|
20
|
+
}, b = /* @__PURE__ */ l({
|
|
20
21
|
name: "XButtonGroup",
|
|
21
22
|
validators: { ...a.validators() },
|
|
22
|
-
|
|
23
|
+
docs: { slots: { default: "Grouped buttons (typically x-button children)." } },
|
|
24
|
+
props: y,
|
|
23
25
|
setup(n) {
|
|
24
|
-
let i = n, a = t("ButtonGroup", i);
|
|
25
|
-
|
|
26
|
+
let i = n, a = t("ButtonGroup", i), o = m([]), l = s(() => o.value);
|
|
27
|
+
function y(e) {
|
|
28
|
+
let t = l.value, n = t.indexOf(e);
|
|
29
|
+
return n === -1 || t.length === 0 || t.length === 1 ? "only" : n === 0 ? "first" : n === t.length - 1 ? "last" : "middle";
|
|
30
|
+
}
|
|
31
|
+
function b(e) {
|
|
32
|
+
o.value.includes(e) || (o.value = [...o.value, e]);
|
|
33
|
+
}
|
|
34
|
+
function x(e) {
|
|
35
|
+
o.value = o.value.filter((t) => t !== e);
|
|
36
|
+
}
|
|
37
|
+
p(e, {
|
|
26
38
|
groupProps: i,
|
|
27
|
-
isButtonGroup: !0
|
|
39
|
+
isButtonGroup: !0,
|
|
40
|
+
registerChild: b,
|
|
41
|
+
unregisterChild: x,
|
|
42
|
+
getPosition: y,
|
|
43
|
+
childOrder: l
|
|
28
44
|
});
|
|
29
|
-
let { className:
|
|
30
|
-
return (e, t) => (
|
|
31
|
-
style:
|
|
32
|
-
class:
|
|
33
|
-
h(o),
|
|
34
|
-
e.$style["button-group"],
|
|
35
|
-
h(a).rounded ? e.$style["button-group--rounded"] : "",
|
|
36
|
-
h(c).wrapper
|
|
37
|
-
])
|
|
45
|
+
let { className: S, classes: C, styles: w } = r("ButtonGroup", {}, a);
|
|
46
|
+
return (e, t) => (f(), c(g(e.tag), {
|
|
47
|
+
style: d(_(w)),
|
|
48
|
+
class: u([_(S), _(C).wrapper])
|
|
38
49
|
}, {
|
|
39
|
-
default:
|
|
50
|
+
default: v(() => [h(e.$slots, "default")]),
|
|
40
51
|
_: 3
|
|
41
52
|
}, 8, ["style", "class"]));
|
|
42
53
|
}
|
|
43
54
|
});
|
|
44
55
|
//#endregion
|
|
45
|
-
export {
|
|
56
|
+
export { b as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { inputGroupRadiusClasses as e } from "../../../common/inputGroupRadius.js";
|
|
2
|
+
import { buttonGroupRadiusClasses as t } from "../../../common/buttonGroupRadius.js";
|
|
2
3
|
//#region src/components/button/theme/Button.base.theme.ts
|
|
3
|
-
var
|
|
4
|
+
var n = {
|
|
4
5
|
classes: {
|
|
5
|
-
wrapper({ props:
|
|
6
|
-
let
|
|
7
|
-
return
|
|
6
|
+
wrapper({ props: n, slots: r, data: i }) {
|
|
7
|
+
let a = ["relative transition duration-150 focus-visible:outline-secondary-300 outline-transparent outline outline-1 outline-offset-2 inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden align-middle active:!shadow-none border appearance-none shrink-0"];
|
|
8
|
+
return i.isInsideInputGroup ? a.push(...e(i.inputGroupPosition)) : i.isButtonGroup ? a.push(...t(i.buttonGroupPosition, i.buttonGroupRounded)) : a.push(n.rounded ? "rounded-full" : "rounded-md"), !n.flat && !n.light && !n.ghost && !n.disabled && !n.loading && a.push("shadow-xs"), n.size === "xs" ? a.push(r.default ? `py-1 text-xs ${n.icon, "px-2"}` : "leading-none p-1") : n.size === "sm" ? a.push(r.default ? `py-1.5 text-sm ${n.icon, "px-3"}` : "leading-none p-1.5") : n.size === "lg" ? a.push(r.default ? `py-3 text-lg ${n.icon ? "px-4" : "px-5"}` : "leading-none p-3") : n.size === "xl" ? a.push(r.default ? "py-4 text-xl px-6" : "leading-none p-3.5") : a.push(r.default ? "py-2 px-4" : "leading-none p-[0.532rem]"), n.disabled ? a.push("cursor-not-allowed") : n.loading ? a.push("cursor-default") : a.push("cursor-pointer"), a;
|
|
8
9
|
},
|
|
9
10
|
iconLeft: ({ slots: e }) => e.default ? "mr-2" : "m-0.5",
|
|
10
11
|
iconRight: ({ slots: e }) => e.default ? "ml-2" : "m-0.5"
|
|
@@ -137,4 +138,4 @@ var t = {
|
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
140
|
//#endregion
|
|
140
|
-
export {
|
|
141
|
+
export { n as default };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { inputGroupRadiusClasses as e } from "../../../common/inputGroupRadius.js";
|
|
2
|
+
import { buttonGroupRadiusClasses as t } from "../../../common/buttonGroupRadius.js";
|
|
2
3
|
//#region src/components/button/theme/Button.carbon.theme.ts
|
|
3
|
-
var
|
|
4
|
+
var n = {
|
|
4
5
|
classes: {
|
|
5
|
-
wrapper({ props:
|
|
6
|
-
let
|
|
7
|
-
return
|
|
6
|
+
wrapper({ props: n, slots: r, data: i }) {
|
|
7
|
+
let a = ["relative transition duration-150 inline-flex whitespace-nowrap overflow-hidden align-top appearance-none text-sm active:shadow-none border !leading-[1.28572] tracking-wide font-light"];
|
|
8
|
+
return i.isInsideInputGroup ? a.push(...e(i.inputGroupPosition)) : i.isButtonGroup ? a.push(...t(i.buttonGroupPosition, i.buttonGroupRounded).map((e) => `!${e}`)) : n.rounded && a.push("rounded-full"), r.default ? (a.push("min-w-[8rem] px-4 py-3.5 items-start justify-between"), n.size === "xs" ? a.push("min-h-[2rem]") : n.size === "sm" ? a.push("min-h-[2.5rem]") : n.size === "lg" ? a.push("min-h-[4rem]") : n.size === "xl" ? a.push("min-h-[5rem]") : a.push("min-h-[3rem]")) : (a.push("items-center justify-center"), n.size === "xs" ? a.push("h-6 w-6") : n.size === "sm" ? a.push("h-8 w-8") : n.size === "lg" ? a.push("h-12 w-12") : n.size === "xl" ? a.push("h-16 w-16") : a.push("h-10 w-10")), n.disabled ? a.push("cursor-not-allowed") : n.loading ? a.push("cursor-default") : a.push("cursor-pointer"), a;
|
|
8
9
|
},
|
|
9
10
|
iconLeft: ({ slots: e }) => e.default ? "mr-2" : "m-0.5",
|
|
10
11
|
iconRight: ({ slots: e }) => e.default ? "ml-2" : "m-0.5"
|
|
@@ -134,4 +135,4 @@ var t = {
|
|
|
134
135
|
}
|
|
135
136
|
};
|
|
136
137
|
//#endregion
|
|
137
|
-
export {
|
|
138
|
+
export { n as default };
|
|
@@ -4,6 +4,7 @@ declare const cardProps: {
|
|
|
4
4
|
tag: {
|
|
5
5
|
type: StringConstructor;
|
|
6
6
|
default: string;
|
|
7
|
+
description: string;
|
|
7
8
|
};
|
|
8
9
|
flat: import("vue").Prop<boolean | undefined>;
|
|
9
10
|
};
|
|
@@ -15,12 +16,14 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
15
16
|
tag: {
|
|
16
17
|
type: StringConstructor;
|
|
17
18
|
default: string;
|
|
19
|
+
description: string;
|
|
18
20
|
};
|
|
19
21
|
flat: import("vue").Prop<boolean | undefined>;
|
|
20
22
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
23
|
tag: {
|
|
22
24
|
type: StringConstructor;
|
|
23
25
|
default: string;
|
|
26
|
+
description: string;
|
|
24
27
|
};
|
|
25
28
|
flat: import("vue").Prop<boolean | undefined>;
|
|
26
29
|
}>> & Readonly<{}>, {
|
|
@@ -4,12 +4,14 @@ import { createBlock as n, defineComponent as r, normalizeClass as i, openBlock
|
|
|
4
4
|
//#region src/components/card/Card.vue?vue&type=script&setup=true&lang.ts
|
|
5
5
|
var u = /* @__PURE__ */ r({
|
|
6
6
|
name: "XCard",
|
|
7
|
+
docs: { slots: { default: "Card content." } },
|
|
7
8
|
props: {
|
|
8
9
|
tag: {
|
|
9
10
|
type: String,
|
|
10
|
-
default: "div"
|
|
11
|
+
default: "div",
|
|
12
|
+
description: "Root element tag."
|
|
11
13
|
},
|
|
12
|
-
flat: t()
|
|
14
|
+
flat: t("Removes elevation and border emphasis.")
|
|
13
15
|
},
|
|
14
16
|
setup(t) {
|
|
15
17
|
let { styles: r, classes: u, className: d } = e("Card", {}, t);
|