@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
|
@@ -9,15 +9,38 @@ const buttonProps = {
|
|
|
9
9
|
tag: {
|
|
10
10
|
type: String,
|
|
11
11
|
default: 'button',
|
|
12
|
+
description: 'Root element tag. Becomes a router-link when `to` is set.',
|
|
12
13
|
},
|
|
13
14
|
type: {
|
|
14
15
|
type: String,
|
|
15
16
|
default: 'button',
|
|
17
|
+
description: 'Native button type when `tag` is `button` (button, submit, reset).',
|
|
18
|
+
},
|
|
19
|
+
icon: {
|
|
20
|
+
type: String,
|
|
21
|
+
description: 'Shortcut for `iconLeft`.',
|
|
22
|
+
},
|
|
23
|
+
iconLeft: {
|
|
24
|
+
type: String,
|
|
25
|
+
description: 'Icon name shown before the label.',
|
|
26
|
+
},
|
|
27
|
+
iconRight: {
|
|
28
|
+
type: String,
|
|
29
|
+
description: 'Icon name shown after the label.',
|
|
30
|
+
},
|
|
31
|
+
to: {
|
|
32
|
+
type: [String, Object],
|
|
33
|
+
description: 'Vue Router location; renders as a link when set.',
|
|
34
|
+
},
|
|
35
|
+
tooltip: {
|
|
36
|
+
type: String,
|
|
37
|
+
description: 'Tooltip text shown on hover. Prefer the tooltip slot for custom content.',
|
|
38
|
+
},
|
|
39
|
+
tooltipPosition: {
|
|
40
|
+
type: String as PropType<TooltipPosition>,
|
|
41
|
+
default: 'top',
|
|
42
|
+
description: 'Tooltip placement relative to the button.',
|
|
16
43
|
},
|
|
17
|
-
icon: String,
|
|
18
|
-
iconLeft: String,
|
|
19
|
-
iconRight: String,
|
|
20
|
-
to: [String, Object],
|
|
21
44
|
}
|
|
22
45
|
|
|
23
46
|
export type ButtonProps = ExtractPublicPropTypes<typeof buttonProps>
|
|
@@ -25,6 +48,8 @@ export type ButtonProps = ExtractPublicPropTypes<typeof buttonProps>
|
|
|
25
48
|
type InternalClasses = 'wrapper' | 'iconLeft' | 'iconRight'
|
|
26
49
|
type InternalExtraData = {
|
|
27
50
|
isButtonGroup: boolean;
|
|
51
|
+
buttonGroupPosition: import('../../common/buttonGroupRadius').ButtonGroupPosition | undefined;
|
|
52
|
+
buttonGroupRounded: boolean;
|
|
28
53
|
isInsideInputGroup: boolean;
|
|
29
54
|
inputGroupPosition: import('../../common/inputGroupRadius').InputGroupPosition | undefined;
|
|
30
55
|
}
|
|
@@ -35,11 +60,21 @@ export default {
|
|
|
35
60
|
validators: {
|
|
36
61
|
...useCommon.validators(),
|
|
37
62
|
},
|
|
63
|
+
docs: {
|
|
64
|
+
slots: {
|
|
65
|
+
default: 'Button label and content.',
|
|
66
|
+
tooltip: 'Custom tooltip content; overrides the `tooltip` prop.',
|
|
67
|
+
},
|
|
68
|
+
methods: {
|
|
69
|
+
focus: 'Focus the underlying control.',
|
|
70
|
+
blur: 'Remove focus from the underlying control.',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
38
73
|
}
|
|
39
74
|
</script>
|
|
40
75
|
|
|
41
76
|
<script setup lang="ts">
|
|
42
|
-
import { computed, ref, inject, onMounted, onUnmounted, useAttrs, unref, type ExtractPublicPropTypes } from 'vue'
|
|
77
|
+
import { computed, ref, inject, onMounted, onUnmounted, useAttrs, useSlots, unref, type ExtractPublicPropTypes, type PropType } from 'vue'
|
|
43
78
|
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
44
79
|
import { useResolvedComponentProps } from '../../composables/resolveComponentDefaults'
|
|
45
80
|
import { useColors } from '../../composables/useColors'
|
|
@@ -49,15 +84,23 @@ import { injectButtonGroupKey, injectInputGroupKey } from '../../composables/key
|
|
|
49
84
|
|
|
50
85
|
import XLoader from '../loader/Loader.vue'
|
|
51
86
|
import XIcon from '../icon/Icon.vue'
|
|
87
|
+
import XTooltip from '../tooltip/Tooltip.vue'
|
|
88
|
+
|
|
89
|
+
import type { TooltipPosition } from '../tooltip/Tooltip.vue'
|
|
52
90
|
|
|
53
91
|
const props = defineProps(buttonProps)
|
|
54
92
|
const resolvedProps = useResolvedComponentProps('Button', props)
|
|
93
|
+
const slots = useSlots()
|
|
55
94
|
|
|
56
95
|
const elRef = ref<HTMLElement | null>(null)
|
|
57
96
|
|
|
58
97
|
const buttonGroup = inject(injectButtonGroupKey, {
|
|
59
98
|
isButtonGroup: false,
|
|
60
99
|
groupProps: {},
|
|
100
|
+
registerChild: () => {},
|
|
101
|
+
unregisterChild: () => {},
|
|
102
|
+
getPosition: () => 'only' as const,
|
|
103
|
+
childOrder: computed(() => []),
|
|
61
104
|
})
|
|
62
105
|
|
|
63
106
|
const inputGroup = inject(injectInputGroupKey, {
|
|
@@ -74,14 +117,24 @@ const inputGroup = inject(injectInputGroupKey, {
|
|
|
74
117
|
const childId = `btn-${Math.random().toString(36).slice(2)}`
|
|
75
118
|
|
|
76
119
|
onMounted(() => {
|
|
120
|
+
if (buttonGroup.isButtonGroup) buttonGroup.registerChild(childId)
|
|
77
121
|
if (inputGroup.isInsideInputGroup) inputGroup.registerChild(childId)
|
|
78
122
|
})
|
|
79
123
|
|
|
80
124
|
onUnmounted(() => {
|
|
125
|
+
if (buttonGroup.isButtonGroup) buttonGroup.unregisterChild(childId)
|
|
81
126
|
if (inputGroup.isInsideInputGroup) inputGroup.unregisterChild(childId)
|
|
82
127
|
})
|
|
83
128
|
|
|
84
129
|
const { isButtonGroup } = buttonGroup
|
|
130
|
+
const buttonGroupPosition = computed(() => {
|
|
131
|
+
if (!buttonGroup.isButtonGroup) return undefined
|
|
132
|
+
|
|
133
|
+
void buttonGroup.childOrder.value
|
|
134
|
+
|
|
135
|
+
return buttonGroup.getPosition(childId)
|
|
136
|
+
})
|
|
137
|
+
const buttonGroupRounded = computed(() => !!buttonGroup.groupProps?.rounded)
|
|
85
138
|
const isInsideInputGroup = computed(() => inputGroup.isInsideInputGroup)
|
|
86
139
|
const inputGroupPosition = computed(() => {
|
|
87
140
|
if (!inputGroup.isInsideInputGroup) return undefined
|
|
@@ -111,6 +164,23 @@ const computedIconLeft = computed(() => props.icon || props.iconLeft)
|
|
|
111
164
|
const attrs = useAttrs()
|
|
112
165
|
const htmlTag = computed(() => (attrs.href ? 'a' : props.to ? 'router-link' : props.tag))
|
|
113
166
|
|
|
167
|
+
const hasTooltip = computed(() => !!(props.tooltip || slots.tooltip))
|
|
168
|
+
const isIconOnly = computed(() => !slots.default)
|
|
169
|
+
const ariaLabel = computed(() => {
|
|
170
|
+
const fromAttrs = attrs['aria-label']
|
|
171
|
+
|
|
172
|
+
if (fromAttrs !== undefined && fromAttrs !== null) return fromAttrs as string
|
|
173
|
+
if (isIconOnly.value && props.tooltip) return props.tooltip
|
|
174
|
+
|
|
175
|
+
return undefined
|
|
176
|
+
})
|
|
177
|
+
const tooltipWrapperClass = computed(() => {
|
|
178
|
+
if (resolvedProps.value.block) return 'block w-full'
|
|
179
|
+
if (isButtonGroup) return 'inline-flex self-stretch'
|
|
180
|
+
|
|
181
|
+
return undefined
|
|
182
|
+
})
|
|
183
|
+
|
|
114
184
|
const computedProps = computed(() => ({
|
|
115
185
|
size: unref(computedSize),
|
|
116
186
|
flat: unref(computedFlat),
|
|
@@ -129,6 +199,8 @@ const computedProps = computed(() => ({
|
|
|
129
199
|
|
|
130
200
|
const { className, classes, styles } = useTheme('Button', {}, computedProps, {
|
|
131
201
|
isButtonGroup,
|
|
202
|
+
buttonGroupPosition,
|
|
203
|
+
buttonGroupRounded,
|
|
132
204
|
isInsideInputGroup,
|
|
133
205
|
inputGroupPosition,
|
|
134
206
|
})
|
|
@@ -139,8 +211,71 @@ defineExpose({ focus, blur })
|
|
|
139
211
|
</script>
|
|
140
212
|
|
|
141
213
|
<template>
|
|
214
|
+
<x-tooltip
|
|
215
|
+
v-if="hasTooltip"
|
|
216
|
+
:position="tooltipPosition"
|
|
217
|
+
:class="tooltipWrapperClass"
|
|
218
|
+
>
|
|
219
|
+
<template #tooltip>
|
|
220
|
+
<slot name="tooltip">
|
|
221
|
+
{{ tooltip }}
|
|
222
|
+
</slot>
|
|
223
|
+
</template>
|
|
224
|
+
<component
|
|
225
|
+
:is="htmlTag"
|
|
226
|
+
ref="elRef"
|
|
227
|
+
:to="to"
|
|
228
|
+
:class="[
|
|
229
|
+
className,
|
|
230
|
+
$style['button'],
|
|
231
|
+
(resolvedProps.glow && !computedDisabled && !loading) ? $style['button--glow'] : '',
|
|
232
|
+
classes.wrapper,
|
|
233
|
+
{
|
|
234
|
+
'w-full': resolvedProps.block,
|
|
235
|
+
'h-full': isButtonGroup,
|
|
236
|
+
}
|
|
237
|
+
]"
|
|
238
|
+
:style="styles"
|
|
239
|
+
:aria-label="ariaLabel"
|
|
240
|
+
:aria-busy="loading ? 'true' : null"
|
|
241
|
+
:aria-disabled="tag !== 'button' && computedDisabled ? 'true' : null"
|
|
242
|
+
:disabled="computedDisabled || loading"
|
|
243
|
+
:type="tag === 'button' ? type : null"
|
|
244
|
+
>
|
|
245
|
+
<x-loader
|
|
246
|
+
v-if="loading"
|
|
247
|
+
class="absolute"
|
|
248
|
+
:size="computedSize"
|
|
249
|
+
:label="loadingLabel"
|
|
250
|
+
:status="loadingStatus"
|
|
251
|
+
/>
|
|
252
|
+
<div class="inline-flex items-center justify-center" :class="{ 'invisible': loading }">
|
|
253
|
+
<x-icon
|
|
254
|
+
v-if="computedIconLeft"
|
|
255
|
+
:size="computedSize"
|
|
256
|
+
:icon="computedIconLeft"
|
|
257
|
+
:class="[
|
|
258
|
+
classes.iconLeft,
|
|
259
|
+
]"
|
|
260
|
+
/>
|
|
261
|
+
<span>
|
|
262
|
+
<slot></slot>
|
|
263
|
+
</span>
|
|
264
|
+
</div>
|
|
265
|
+
<x-icon
|
|
266
|
+
v-if="iconRight"
|
|
267
|
+
:size="computedSize"
|
|
268
|
+
:icon="iconRight"
|
|
269
|
+
:class="[
|
|
270
|
+
classes.iconRight,
|
|
271
|
+
{ 'invisible': loading },
|
|
272
|
+
]"
|
|
273
|
+
/>
|
|
274
|
+
</component>
|
|
275
|
+
</x-tooltip>
|
|
142
276
|
<component
|
|
143
277
|
:is="htmlTag"
|
|
278
|
+
v-else
|
|
144
279
|
ref="elRef"
|
|
145
280
|
:to="to"
|
|
146
281
|
:class="[
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { variantBooleanProps } from '../../common/props'
|
|
3
|
+
import type { ButtonGroupPosition } from '../../common/buttonGroupRadius'
|
|
3
4
|
|
|
4
5
|
const buttonGroupProps = {
|
|
5
6
|
...useCommon.props(),
|
|
@@ -9,6 +10,7 @@ const buttonGroupProps = {
|
|
|
9
10
|
tag: {
|
|
10
11
|
type: String,
|
|
11
12
|
default: 'div',
|
|
13
|
+
description: 'Root element tag for the group wrapper.',
|
|
12
14
|
},
|
|
13
15
|
}
|
|
14
16
|
|
|
@@ -16,6 +18,10 @@ export type ButtonGroupProps = ExtractPublicPropTypes<typeof buttonGroupProps>
|
|
|
16
18
|
export type ButtonGroupInjection = {
|
|
17
19
|
groupProps: ButtonGroupProps;
|
|
18
20
|
isButtonGroup: boolean;
|
|
21
|
+
registerChild: (id: string) => void;
|
|
22
|
+
unregisterChild: (id: string) => void;
|
|
23
|
+
getPosition: (id: string) => ButtonGroupPosition;
|
|
24
|
+
childOrder: ComputedRef<string[]>;
|
|
19
25
|
}
|
|
20
26
|
|
|
21
27
|
type InternalClasses = 'wrapper'
|
|
@@ -27,11 +33,16 @@ export default {
|
|
|
27
33
|
validators: {
|
|
28
34
|
...useCommon.validators(),
|
|
29
35
|
},
|
|
36
|
+
docs: {
|
|
37
|
+
slots: {
|
|
38
|
+
default: 'Grouped buttons (typically x-button children).',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
30
41
|
}
|
|
31
42
|
</script>
|
|
32
43
|
|
|
33
44
|
<script setup lang="ts">
|
|
34
|
-
import { provide, type ExtractPublicPropTypes } from 'vue'
|
|
45
|
+
import { provide, ref, computed, type ExtractPublicPropTypes, type ComputedRef } from 'vue'
|
|
35
46
|
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
36
47
|
import { useResolvedComponentProps } from '../../composables/resolveComponentDefaults'
|
|
37
48
|
import { useCommon } from '../../composables/useCommon'
|
|
@@ -42,9 +53,38 @@ import { injectButtonGroupKey } from '../../composables/keys'
|
|
|
42
53
|
const props = defineProps(buttonGroupProps)
|
|
43
54
|
const resolvedProps = useResolvedComponentProps('ButtonGroup', props)
|
|
44
55
|
|
|
56
|
+
const childOrder = ref<string[]>([])
|
|
57
|
+
const childOrderReadonly = computed(() => childOrder.value)
|
|
58
|
+
|
|
59
|
+
function getPosition(id: string): ButtonGroupPosition {
|
|
60
|
+
const order = childOrderReadonly.value
|
|
61
|
+
const index = order.indexOf(id)
|
|
62
|
+
|
|
63
|
+
if (index === -1 || order.length === 0) return 'only'
|
|
64
|
+
if (order.length === 1) return 'only'
|
|
65
|
+
if (index === 0) return 'first'
|
|
66
|
+
if (index === order.length - 1) return 'last'
|
|
67
|
+
|
|
68
|
+
return 'middle'
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function registerChild(id: string) {
|
|
72
|
+
if (!childOrder.value.includes(id)) {
|
|
73
|
+
childOrder.value = [...childOrder.value, id]
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function unregisterChild(id: string) {
|
|
78
|
+
childOrder.value = childOrder.value.filter((n) => n !== id)
|
|
79
|
+
}
|
|
80
|
+
|
|
45
81
|
provide(injectButtonGroupKey, {
|
|
46
82
|
groupProps: props,
|
|
47
83
|
isButtonGroup: true,
|
|
84
|
+
registerChild,
|
|
85
|
+
unregisterChild,
|
|
86
|
+
getPosition,
|
|
87
|
+
childOrder: childOrderReadonly,
|
|
48
88
|
})
|
|
49
89
|
|
|
50
90
|
const { className, classes, styles } = useTheme('ButtonGroup', {}, resolvedProps)
|
|
@@ -56,33 +96,9 @@ const { className, classes, styles } = useTheme('ButtonGroup', {}, resolvedProps
|
|
|
56
96
|
:style="styles"
|
|
57
97
|
:class="[
|
|
58
98
|
className,
|
|
59
|
-
$style['button-group'],
|
|
60
|
-
resolvedProps.rounded ? $style['button-group--rounded'] : '',
|
|
61
99
|
classes.wrapper
|
|
62
100
|
]"
|
|
63
101
|
>
|
|
64
102
|
<slot></slot>
|
|
65
103
|
</component>
|
|
66
104
|
</template>
|
|
67
|
-
|
|
68
|
-
<style module>
|
|
69
|
-
.button-group:not(.button-group--rounded) > :first-child {
|
|
70
|
-
border-start-start-radius: var(--radius-md);
|
|
71
|
-
border-end-start-radius: var(--radius-md);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.button-group:not(.button-group--rounded) > :last-child {
|
|
75
|
-
border-start-end-radius: var(--radius-md);
|
|
76
|
-
border-end-end-radius: var(--radius-md);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.button-group--rounded > :first-of-type {
|
|
80
|
-
border-start-start-radius: 9999px;
|
|
81
|
-
border-end-start-radius: 9999px;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.button-group--rounded > :last-child {
|
|
85
|
-
border-start-end-radius: 9999px;
|
|
86
|
-
border-end-end-radius: 9999px;
|
|
87
|
-
}
|
|
88
|
-
</style>
|
|
@@ -8,4 +8,45 @@ describe('Button', () => {
|
|
|
8
8
|
|
|
9
9
|
expect(wrapper.vm).toBeTruthy()
|
|
10
10
|
})
|
|
11
|
+
|
|
12
|
+
it('passes tooltip to the tooltip wrapper', () => {
|
|
13
|
+
const wrapper = mount(Button, {
|
|
14
|
+
props: { icon: 'check', tooltip: 'Save' },
|
|
15
|
+
global: {
|
|
16
|
+
stubs: {
|
|
17
|
+
XIcon: true,
|
|
18
|
+
XLoader: true,
|
|
19
|
+
XTooltip: {
|
|
20
|
+
props: ['position'],
|
|
21
|
+
template: `
|
|
22
|
+
<div class="tooltip-stub">
|
|
23
|
+
<slot />
|
|
24
|
+
<div class="tooltip-content"><slot name="tooltip" /></div>
|
|
25
|
+
</div>
|
|
26
|
+
`,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
expect(wrapper.find('.tooltip-content').text()).toBe('Save')
|
|
33
|
+
expect(wrapper.find('[aria-label="Save"]').exists()).toBe(true)
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('does not wrap in tooltip when tooltip is absent', () => {
|
|
37
|
+
const wrapper = mount(Button, {
|
|
38
|
+
props: { icon: 'check' },
|
|
39
|
+
global: {
|
|
40
|
+
stubs: {
|
|
41
|
+
XIcon: true,
|
|
42
|
+
XLoader: true,
|
|
43
|
+
XTooltip: {
|
|
44
|
+
template: '<div class="tooltip-stub"><slot /></div>',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
expect(wrapper.find('.tooltip-stub').exists()).toBe(false)
|
|
51
|
+
})
|
|
11
52
|
})
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest'
|
|
2
2
|
import { mount } from '@vue/test-utils'
|
|
3
|
+
import { h, defineComponent } from 'vue'
|
|
3
4
|
import ButtonGroup from '../ButtonGroup.vue'
|
|
5
|
+
import Button from '../Button.vue'
|
|
6
|
+
import { injectThemeKey } from '../../../composables/keys'
|
|
7
|
+
import BaseTheme from '../../../themes/base'
|
|
4
8
|
|
|
5
9
|
describe('ButtonGroup', () => {
|
|
6
10
|
it('renders without errors', () => {
|
|
@@ -8,4 +12,32 @@ describe('ButtonGroup', () => {
|
|
|
8
12
|
|
|
9
13
|
expect(wrapper.vm).toBeTruthy()
|
|
10
14
|
})
|
|
15
|
+
|
|
16
|
+
it('applies end radius to the last button even when wrapped', async () => {
|
|
17
|
+
const Wrapper = defineComponent({
|
|
18
|
+
setup() {
|
|
19
|
+
return () => h(ButtonGroup, null, {
|
|
20
|
+
default: () => [
|
|
21
|
+
h(Button, null, () => 'Add New'),
|
|
22
|
+
h('div', { class: 'wrapper' }, [h(Button, { icon: 'chevron-down' })]),
|
|
23
|
+
],
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const wrapper = mount(Wrapper, {
|
|
29
|
+
global: {
|
|
30
|
+
provide: {
|
|
31
|
+
[injectThemeKey as symbol]: BaseTheme,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
await wrapper.vm.$nextTick()
|
|
37
|
+
|
|
38
|
+
const buttons = wrapper.findAll('button')
|
|
39
|
+
|
|
40
|
+
expect(buttons[0].classes().some((c) => c.includes('rounded-s'))).toBe(true)
|
|
41
|
+
expect(buttons[1].classes().some((c) => c.includes('rounded-e'))).toBe(true)
|
|
42
|
+
})
|
|
11
43
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ButtonTheme } from '../Button.vue'
|
|
2
2
|
import { inputGroupRadiusClasses } from '../../../common/inputGroupRadius'
|
|
3
|
+
import { buttonGroupRadiusClasses } from '../../../common/buttonGroupRadius'
|
|
3
4
|
|
|
4
5
|
const theme: ButtonTheme = {
|
|
5
6
|
classes: {
|
|
@@ -9,7 +10,9 @@ const theme: ButtonTheme = {
|
|
|
9
10
|
// radius
|
|
10
11
|
if (data.isInsideInputGroup) {
|
|
11
12
|
classes.push(...inputGroupRadiusClasses(data.inputGroupPosition))
|
|
12
|
-
} else if (
|
|
13
|
+
} else if (data.isButtonGroup) {
|
|
14
|
+
classes.push(...buttonGroupRadiusClasses(data.buttonGroupPosition, data.buttonGroupRounded))
|
|
15
|
+
} else {
|
|
13
16
|
classes.push(props.rounded ? 'rounded-full' : 'rounded-md')
|
|
14
17
|
}
|
|
15
18
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ButtonTheme } from '../Button.vue'
|
|
2
2
|
import { inputGroupRadiusClasses } from '../../../common/inputGroupRadius'
|
|
3
|
+
import { buttonGroupRadiusClasses } from '../../../common/buttonGroupRadius'
|
|
3
4
|
|
|
4
5
|
const theme: ButtonTheme = {
|
|
5
6
|
classes: {
|
|
@@ -9,10 +10,10 @@ const theme: ButtonTheme = {
|
|
|
9
10
|
// radius
|
|
10
11
|
if (data.isInsideInputGroup) {
|
|
11
12
|
classes.push(...inputGroupRadiusClasses(data.inputGroupPosition))
|
|
12
|
-
} else if (
|
|
13
|
-
classes.push(
|
|
14
|
-
} else {
|
|
15
|
-
classes.push('
|
|
13
|
+
} else if (data.isButtonGroup) {
|
|
14
|
+
classes.push(...buttonGroupRadiusClasses(data.buttonGroupPosition, data.buttonGroupRounded).map((c) => `!${c}`))
|
|
15
|
+
} else if (props.rounded) {
|
|
16
|
+
classes.push('rounded-full')
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
// size
|
|
@@ -5,8 +5,9 @@ const cardProps = {
|
|
|
5
5
|
tag: {
|
|
6
6
|
type: String,
|
|
7
7
|
default: 'div',
|
|
8
|
+
description: 'Root element tag.',
|
|
8
9
|
},
|
|
9
|
-
flat: optionalBooleanProp(),
|
|
10
|
+
flat: optionalBooleanProp('Removes elevation and border emphasis.'),
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export type CardProps = ExtractPublicPropTypes<typeof cardProps>
|
|
@@ -14,7 +15,14 @@ export type CardProps = ExtractPublicPropTypes<typeof cardProps>
|
|
|
14
15
|
type InternalClasses = 'wrapper'
|
|
15
16
|
export interface CardTheme extends ThemeComponent<CardProps, InternalClasses> {}
|
|
16
17
|
|
|
17
|
-
export default {
|
|
18
|
+
export default {
|
|
19
|
+
name: 'XCard',
|
|
20
|
+
docs: {
|
|
21
|
+
slots: {
|
|
22
|
+
default: 'Card content.',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
}
|
|
18
26
|
</script>
|
|
19
27
|
|
|
20
28
|
<script setup lang="ts">
|
|
@@ -6,20 +6,26 @@ const carouselEffects = ['slide'] as const
|
|
|
6
6
|
export type CarouselEffect = typeof carouselEffects[number]
|
|
7
7
|
|
|
8
8
|
const carouselProps = {
|
|
9
|
-
autoplay: optionalBooleanProp(),
|
|
9
|
+
autoplay: optionalBooleanProp('Advances slides automatically.'),
|
|
10
10
|
delay: {
|
|
11
11
|
type: Number,
|
|
12
12
|
default: 5000,
|
|
13
|
+
description: 'Autoplay interval in milliseconds.',
|
|
13
14
|
},
|
|
14
15
|
showDots: {
|
|
15
16
|
type: Boolean,
|
|
16
17
|
default: true,
|
|
18
|
+
description: 'Shows pagination dots under the slides.',
|
|
17
19
|
},
|
|
18
20
|
effect: {
|
|
19
21
|
type: String as PropType<CarouselEffect>,
|
|
20
22
|
default: 'slide',
|
|
23
|
+
description: 'Transition effect between slides.',
|
|
24
|
+
},
|
|
25
|
+
classDots: {
|
|
26
|
+
type: [Array, String],
|
|
27
|
+
description: 'Extra class(es) on the default dots container.',
|
|
21
28
|
},
|
|
22
|
-
classDots: [Array, String],
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
export type CarouselProps = ExtractPublicPropTypes<typeof carouselProps>
|
|
@@ -34,6 +40,20 @@ export interface CarouselTheme extends ThemeComponent<CarouselProps, InternalCla
|
|
|
34
40
|
export default {
|
|
35
41
|
name: 'XCarousel',
|
|
36
42
|
validators: {},
|
|
43
|
+
docs: {
|
|
44
|
+
slots: {
|
|
45
|
+
default: 'Slides (typically x-carousel-slide). Slot props: to, next, prev, current, total.',
|
|
46
|
+
dots: 'Custom pagination dots. Slot props: to, next, prev, current, total.',
|
|
47
|
+
},
|
|
48
|
+
emits: {
|
|
49
|
+
update: 'Emitted when the current slide index changes.',
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
to: 'Go to a slide by zero-based index.',
|
|
53
|
+
next: 'Go to the next slide (wraps to the first).',
|
|
54
|
+
prev: 'Go to the previous slide (wraps to the last).',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
37
57
|
}
|
|
38
58
|
</script>
|
|
39
59
|
|
|
@@ -3,6 +3,7 @@ const carouselSlideProps = {
|
|
|
3
3
|
tag: {
|
|
4
4
|
type: String,
|
|
5
5
|
default: 'div',
|
|
6
|
+
description: 'Root element tag.',
|
|
6
7
|
},
|
|
7
8
|
}
|
|
8
9
|
|
|
@@ -13,6 +14,11 @@ export interface CarouselSlideTheme extends ThemeComponent<CarouselSlideProps, I
|
|
|
13
14
|
|
|
14
15
|
export default {
|
|
15
16
|
name: 'XCarouselSlide',
|
|
17
|
+
docs: {
|
|
18
|
+
slots: {
|
|
19
|
+
default: 'Slide content.',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
16
22
|
}
|
|
17
23
|
</script>
|
|
18
24
|
|
|
@@ -6,9 +6,15 @@ const checkboxProps = {
|
|
|
6
6
|
...useColors.props('primary'),
|
|
7
7
|
...useInteractive.props(),
|
|
8
8
|
...useInputtable.props(),
|
|
9
|
-
value:
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
value: {
|
|
10
|
+
type: [String, Number],
|
|
11
|
+
description: 'Value used when the checkbox is inside an x-form-group (array selection).',
|
|
12
|
+
},
|
|
13
|
+
indeterminate: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
description: 'Shows an indeterminate (mixed) check state.',
|
|
16
|
+
},
|
|
17
|
+
glow: optionalBooleanProp('Soft colored glow behind the control.'),
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
export type CheckboxProps = ExtractPublicPropTypes<typeof checkboxProps>
|
|
@@ -22,6 +28,19 @@ export default {
|
|
|
22
28
|
validators: {
|
|
23
29
|
...useCommon.validators(),
|
|
24
30
|
},
|
|
31
|
+
docs: {
|
|
32
|
+
slots: {
|
|
33
|
+
default: 'Label content when the `label` prop is not set.',
|
|
34
|
+
icon: 'Custom checked-state icon.',
|
|
35
|
+
},
|
|
36
|
+
emits: {
|
|
37
|
+
...useInputtable.emitDocs(false),
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
...useInputtable.methodDocs(),
|
|
41
|
+
toggle: 'Toggle the checked state (no-op when disabled, loading, or readonly).',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
25
44
|
}
|
|
26
45
|
</script>
|
|
27
46
|
|
|
@@ -3,10 +3,12 @@ const containerProps = {
|
|
|
3
3
|
tag: {
|
|
4
4
|
type: String,
|
|
5
5
|
default: 'div',
|
|
6
|
+
description: 'Root element tag.',
|
|
6
7
|
},
|
|
7
8
|
fluid: {
|
|
8
9
|
type: Boolean,
|
|
9
10
|
default: false,
|
|
11
|
+
description: 'Removes max-width constraints so the container spans the full parent width.',
|
|
10
12
|
},
|
|
11
13
|
}
|
|
12
14
|
|
|
@@ -15,7 +17,14 @@ export type ContainerProps = ExtractPublicPropTypes<typeof containerProps>
|
|
|
15
17
|
type InternalClasses = 'wrapper'
|
|
16
18
|
export interface ContainerTheme extends ThemeComponent<ContainerProps, InternalClasses> {}
|
|
17
19
|
|
|
18
|
-
export default {
|
|
20
|
+
export default {
|
|
21
|
+
name: 'XContainer',
|
|
22
|
+
docs: {
|
|
23
|
+
slots: {
|
|
24
|
+
default: 'Container content.',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
}
|
|
19
28
|
</script>
|
|
20
29
|
|
|
21
30
|
<script setup lang="ts">
|