@indielayer/ui 1.3.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +4 -4
- package/docs/App.vue +25 -0
- package/docs/assets/css/hljs.css +302 -0
- package/docs/assets/css/tailwind.css +46 -0
- package/docs/assets/images/error.svg +1 -0
- package/docs/assets/images/logo.png +0 -0
- package/docs/assets/images/logo_mini.svg +10 -0
- package/docs/assets/images/logo_white.png +0 -0
- package/docs/assets/images/logo_word.svg +12 -0
- package/docs/assets/images/logo_word_dark.svg +12 -0
- package/docs/assets/images/photo1.jpeg +0 -0
- package/docs/assets/images/photo2.jpeg +0 -0
- package/docs/components/Cookies.vue +42 -0
- package/docs/components/common/CodePreview.vue +80 -0
- package/docs/components/common/CodeSnippet.vue +47 -0
- package/docs/components/common/CopyButton.vue +50 -0
- package/docs/components/common/DocumentPage.vue +285 -0
- package/docs/components/common/Indielayer-theme.json +702 -0
- package/docs/components/common/MultiSnippet.vue +26 -0
- package/docs/components/menu/DocsMenu.vue +96 -0
- package/docs/components/toolbar/PreToolbar.vue +16 -0
- package/docs/components/toolbar/Toolbar.vue +76 -0
- package/docs/components/toolbar/ToolbarColorToggle.vue +49 -0
- package/docs/icons.ts +61 -0
- package/docs/layouts/default.vue +33 -0
- package/docs/layouts/simple.vue +3 -0
- package/docs/main.ts +33 -0
- package/docs/pages/colors.vue +120 -0
- package/docs/pages/component/accordion/index.vue +29 -0
- package/docs/pages/component/accordion/usage.vue +30 -0
- package/docs/pages/component/alert/index.vue +29 -0
- package/docs/pages/component/alert/usage.vue +18 -0
- package/docs/pages/component/avatar/index.vue +43 -0
- package/docs/pages/component/avatar/size.vue +9 -0
- package/docs/pages/component/avatar/usage.vue +9 -0
- package/docs/pages/component/avatar/variants.vue +8 -0
- package/docs/pages/component/badge/index.vue +29 -0
- package/docs/pages/component/badge/usage.vue +50 -0
- package/docs/pages/component/breadcrumbs/index.vue +29 -0
- package/docs/pages/component/breadcrumbs/usage.vue +19 -0
- package/docs/pages/component/button/button-group.vue +22 -0
- package/docs/pages/component/button/icons.vue +9 -0
- package/docs/pages/component/button/index.vue +64 -0
- package/docs/pages/component/button/size.vue +9 -0
- package/docs/pages/component/button/states.vue +6 -0
- package/docs/pages/component/button/usage.vue +12 -0
- package/docs/pages/component/button/variants.vue +7 -0
- package/docs/pages/component/card/index.vue +29 -0
- package/docs/pages/component/card/usage.vue +6 -0
- package/docs/pages/component/carousel/index.vue +29 -0
- package/docs/pages/component/carousel/usage.vue +10 -0
- package/docs/pages/component/checkbox/index.vue +50 -0
- package/docs/pages/component/checkbox/size.vue +9 -0
- package/docs/pages/component/checkbox/states.vue +9 -0
- package/docs/pages/component/checkbox/usage.vue +15 -0
- package/docs/pages/component/checkbox/variants.vue +8 -0
- package/docs/pages/component/container/index.vue +29 -0
- package/docs/pages/component/container/usage.vue +3 -0
- package/docs/pages/component/divider/index.vue +43 -0
- package/docs/pages/component/divider/label.vue +12 -0
- package/docs/pages/component/divider/usage.vue +7 -0
- package/docs/pages/component/divider/vertical.vue +7 -0
- package/docs/pages/component/drawer/index.vue +29 -0
- package/docs/pages/component/drawer/usage.vue +56 -0
- package/docs/pages/component/form/index.vue +29 -0
- package/docs/pages/component/form/usage.vue +96 -0
- package/docs/pages/component/formGroup/index.vue +29 -0
- package/docs/pages/component/formGroup/usage.vue +47 -0
- package/docs/pages/component/icon/index.vue +36 -0
- package/docs/pages/component/icon/usage.vue +6 -0
- package/docs/pages/component/icon/variants.vue +14 -0
- package/docs/pages/component/image/index.vue +29 -0
- package/docs/pages/component/image/usage.vue +8 -0
- package/docs/pages/component/input/index.vue +50 -0
- package/docs/pages/component/input/size.vue +13 -0
- package/docs/pages/component/input/states.vue +12 -0
- package/docs/pages/component/input/usage.vue +14 -0
- package/docs/pages/component/input/variants.vue +18 -0
- package/docs/pages/component/link/index.vue +29 -0
- package/docs/pages/component/link/usage.vue +12 -0
- package/docs/pages/component/loader/index.vue +29 -0
- package/docs/pages/component/loader/usage.vue +7 -0
- package/docs/pages/component/menu/index.vue +29 -0
- package/docs/pages/component/menu/usage.vue +69 -0
- package/docs/pages/component/modal/composed.vue +71 -0
- package/docs/pages/component/modal/index.vue +36 -0
- package/docs/pages/component/modal/usage.vue +66 -0
- package/docs/pages/component/notifications/index.vue +29 -0
- package/docs/pages/component/notifications/usage.vue +56 -0
- package/docs/pages/component/pagination/index.vue +29 -0
- package/docs/pages/component/pagination/usage.vue +17 -0
- package/docs/pages/component/popover/index.vue +29 -0
- package/docs/pages/component/popover/usage.vue +21 -0
- package/docs/pages/component/progress/index.vue +36 -0
- package/docs/pages/component/progress/usage.vue +7 -0
- package/docs/pages/component/progress/variants.vue +18 -0
- package/docs/pages/component/radio/index.vue +50 -0
- package/docs/pages/component/radio/size.vue +15 -0
- package/docs/pages/component/radio/states.vue +13 -0
- package/docs/pages/component/radio/usage.vue +14 -0
- package/docs/pages/component/radio/variants.vue +39 -0
- package/docs/pages/component/scroll/horizontal.vue +14 -0
- package/docs/pages/component/scroll/index.vue +36 -0
- package/docs/pages/component/scroll/usage.vue +5 -0
- package/docs/pages/component/select/index.vue +43 -0
- package/docs/pages/component/select/states.vue +22 -0
- package/docs/pages/component/select/usage.vue +46 -0
- package/docs/pages/component/select/variants.vue +23 -0
- package/docs/pages/component/skeleton/index.vue +29 -0
- package/docs/pages/component/skeleton/usage.vue +10 -0
- package/docs/pages/component/slider/index.vue +29 -0
- package/docs/pages/component/slider/usage.vue +15 -0
- package/docs/pages/component/spacer/index.vue +29 -0
- package/docs/pages/component/spacer/usage.vue +8 -0
- package/docs/pages/component/spinner/index.vue +36 -0
- package/docs/pages/component/spinner/usage.vue +3 -0
- package/docs/pages/component/spinner/variants.vue +9 -0
- package/docs/pages/component/stepper/index.vue +29 -0
- package/docs/pages/component/stepper/usage.vue +21 -0
- package/docs/pages/component/table/index.vue +36 -0
- package/docs/pages/component/table/states.vue +28 -0
- package/docs/pages/component/table/usage.vue +107 -0
- package/docs/pages/component/tabs/index.vue +29 -0
- package/docs/pages/component/tabs/usage.vue +142 -0
- package/docs/pages/component/tag/index.vue +29 -0
- package/docs/pages/component/tag/usage.vue +27 -0
- package/docs/pages/component/textarea/index.vue +43 -0
- package/docs/pages/component/textarea/states.vue +13 -0
- package/docs/pages/component/textarea/usage.vue +19 -0
- package/docs/pages/component/textarea/variants.vue +15 -0
- package/docs/pages/component/toggle/index.vue +43 -0
- package/docs/pages/component/toggle/states.vue +13 -0
- package/docs/pages/component/toggle/usage.vue +12 -0
- package/docs/pages/component/toggle/variants.vue +15 -0
- package/docs/pages/component/tooltip/index.vue +29 -0
- package/docs/pages/component/tooltip/usage.vue +12 -0
- package/docs/pages/error.vue +6 -0
- package/docs/pages/icons.vue +101 -0
- package/docs/pages/index.vue +153 -0
- package/docs/pages/play.vue +7 -0
- package/docs/pages/typography.vue +91 -0
- package/docs/router/index.ts +77 -0
- package/lib/common/icons.d.ts +4 -1
- package/lib/common/icons.js +14 -11
- package/lib/components/accordion/Accordion.vue.d.ts +63 -0
- package/lib/components/accordion/Accordion.vue.js +40 -0
- package/lib/components/accordion/Accordion.vue2.js +4 -0
- package/lib/components/{collapse/Collapse.vue.d.ts → accordion/AccordionItem.vue.d.ts} +33 -18
- package/lib/components/accordion/AccordionItem.vue.js +140 -0
- package/lib/components/accordion/AccordionItem.vue2.js +4 -0
- package/lib/components/accordion/index.d.ts +4 -0
- package/lib/components/accordion/theme/Accordion.base.theme.d.ts +3 -0
- package/lib/components/accordion/theme/Accordion.base.theme.js +8 -0
- package/lib/components/accordion/theme/Accordion.carbon.theme.d.ts +3 -0
- package/lib/components/accordion/theme/Accordion.carbon.theme.js +5 -0
- package/lib/components/accordion/theme/AccordionItem.base.theme.d.ts +3 -0
- package/lib/components/accordion/theme/AccordionItem.base.theme.js +16 -0
- package/lib/components/accordion/theme/AccordionItem.carbon.theme.d.ts +3 -0
- package/lib/components/accordion/theme/AccordionItem.carbon.theme.js +5 -0
- package/lib/components/alert/theme/Alert.carbon.theme.js +39 -3
- package/lib/components/avatar/Avatar.vue.d.ts +2 -2
- package/lib/components/badge/Badge.vue.d.ts +2 -2
- package/lib/components/badge/Badge.vue.js +7 -7
- package/lib/components/breadcrumbs/theme/Breadcrumbs.base.theme.js +1 -1
- package/lib/components/button/Button.vue.d.ts +3 -3
- package/lib/components/button/ButtonGroup.vue.d.ts +3 -3
- package/lib/components/button/theme/Button.base.theme.js +7 -7
- package/lib/components/button/theme/Button.carbon.theme.js +1 -1
- package/lib/components/card/theme/Card.base.theme.js +1 -1
- package/lib/components/carousel/CarouselSlide.vue.d.ts +19 -8
- package/lib/components/carousel/CarouselSlide.vue.js +2 -2
- package/lib/components/carousel/CarouselSlide.vue2.js +25 -18
- package/lib/components/checkbox/Checkbox.vue.d.ts +25 -10
- package/lib/components/checkbox/Checkbox.vue2.js +106 -72
- package/lib/components/checkbox/theme/Checkbox.base.theme.js +38 -31
- package/lib/components/checkbox/theme/Checkbox.carbon.theme.js +38 -31
- package/lib/components/container/Container.vue.d.ts +13 -0
- package/lib/components/container/Container.vue.js +15 -11
- package/lib/components/container/theme/Container.base.theme.js +7 -4
- package/lib/components/divider/Divider.vue.js +14 -14
- package/lib/components/divider/theme/Divider.base.theme.js +2 -2
- package/lib/components/drawer/Drawer.vue.d.ts +4 -4
- package/lib/components/drawer/Drawer.vue.js +2 -2
- package/lib/components/drawer/theme/Drawer.base.theme.js +1 -1
- package/lib/components/form/Form.vue.d.ts +25 -2
- package/lib/components/form/Form.vue.js +67 -36
- package/lib/components/form/theme/Form.base.theme.js +7 -3
- package/lib/components/form/theme/Form.carbon.theme.js +10 -3
- package/lib/components/formGroup/FormGroup.vue.d.ts +135 -0
- package/lib/components/formGroup/FormGroup.vue.js +83 -0
- package/lib/components/formGroup/FormGroup.vue2.js +4 -0
- package/lib/components/formGroup/__tests__/FormGroup.spec.d.ts +1 -0
- package/lib/components/formGroup/index.d.ts +2 -0
- package/lib/components/formGroup/theme/FormGroup.base.theme.d.ts +3 -0
- package/lib/components/formGroup/theme/FormGroup.base.theme.js +11 -0
- package/lib/components/formGroup/theme/FormGroup.carbon.theme.d.ts +3 -0
- package/lib/components/formGroup/theme/FormGroup.carbon.theme.js +11 -0
- package/lib/components/icon/theme/Icon.base.theme.js +2 -2
- package/lib/components/icon/theme/Icon.carbon.theme.js +4 -4
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +102 -95
- package/lib/components/input/Input.vue.d.ts +15 -9
- package/lib/components/input/Input.vue.js +43 -42
- package/lib/components/input/theme/Input.base.theme.js +10 -10
- package/lib/components/input/theme/Input.carbon.theme.js +10 -10
- package/lib/components/inputFooter/theme/InputFooter.base.theme.js +3 -3
- package/lib/components/inputFooter/theme/InputFooter.carbon.theme.js +3 -3
- package/lib/components/label/Label.vue.d.ts +6 -3
- package/lib/components/label/Label.vue.js +26 -20
- package/lib/components/label/theme/Label.base.theme.js +1 -1
- package/lib/components/label/theme/Label.carbon.theme.js +8 -7
- package/lib/components/link/Link.vue.d.ts +1 -1
- package/lib/components/link/Link.vue.js +1 -1
- package/lib/components/link/Link.vue2.js +4 -4
- package/lib/components/link/theme/Link.base.theme.js +4 -4
- package/lib/components/link/theme/Link.carbon.theme.js +23 -3
- package/lib/components/loader/theme/Loader.base.theme.js +1 -1
- package/lib/components/loader/theme/Loader.carbon.theme.js +2 -2
- package/lib/components/menu/Menu.vue.d.ts +6 -5
- package/lib/components/menu/Menu.vue.js +44 -41
- package/lib/components/menu/MenuItem.vue.d.ts +4 -4
- package/lib/components/menu/MenuItem.vue.js +2 -2
- package/lib/components/menu/MenuItem.vue2.js +1 -1
- package/lib/components/menu/theme/MenuItem.base.theme.js +22 -32
- package/lib/components/modal/Modal.vue.d.ts +102 -3
- package/lib/components/modal/Modal.vue.js +157 -100
- package/lib/components/modal/theme/Modal.base.theme.js +15 -9
- package/lib/components/modal/theme/Modal.carbon.theme.js +27 -3
- package/lib/components/notifications/Notifications.vue.js +57 -54
- package/lib/components/notifications/theme/Notifications.base.theme.js +2 -2
- package/lib/components/notifications/theme/Notifications.carbon.theme.js +8 -3
- package/lib/components/pagination/Pagination.vue.js +27 -27
- package/lib/components/popover/Popover.vue.d.ts +16 -3
- package/lib/components/popover/Popover.vue.js +13 -8
- package/lib/components/popover/Popover.vue2.js +3 -2
- package/lib/components/popover/Popover.vue3.js +2 -3
- package/lib/components/popover/theme/PopoverContainer.base.theme.js +4 -4
- package/lib/components/popover/theme/PopoverContainer.carbon.theme.js +4 -4
- package/lib/components/progress/Progress.vue.js +11 -11
- package/lib/components/progress/theme/Progress.base.theme.js +10 -10
- package/lib/components/radio/Radio.vue.d.ts +20 -12
- package/lib/components/radio/Radio.vue2.js +81 -66
- package/lib/components/radio/theme/Radio.base.theme.js +34 -31
- package/lib/components/radio/theme/Radio.carbon.theme.js +33 -30
- package/lib/components/select/Select.vue.d.ts +29 -10
- package/lib/components/select/Select.vue.js +121 -119
- package/lib/components/select/theme/Select.base.theme.js +6 -6
- package/lib/components/select/theme/Select.carbon.theme.js +11 -11
- package/lib/components/skeleton/Skeleton.vue.d.ts +19 -1
- package/lib/components/skeleton/Skeleton.vue.js +25 -15
- package/lib/components/skeleton/theme/Skeleton.base.theme.js +7 -4
- package/lib/components/slider/Slider.vue.d.ts +15 -6
- package/lib/components/slider/Slider.vue.js +4 -5
- package/lib/components/slider/theme/Slider.carbon.theme.js +8 -8
- package/lib/components/spinner/Spinner.vue.d.ts +1 -1
- package/lib/components/spinner/Spinner.vue.js +16 -17
- package/lib/components/stepper/Stepper.vue.d.ts +137 -0
- package/lib/components/stepper/Stepper.vue.js +128 -0
- package/lib/components/stepper/Stepper.vue2.js +4 -0
- package/lib/components/stepper/__tests__/Stepper.spec.d.ts +1 -0
- package/lib/components/stepper/index.d.ts +2 -0
- package/lib/components/stepper/theme/Stepper.base.theme.d.ts +3 -0
- package/lib/components/stepper/theme/Stepper.base.theme.js +20 -0
- package/lib/components/stepper/theme/Stepper.carbon.theme.d.ts +3 -0
- package/lib/components/{collapse/theme/Collapse.carbon.theme.js → stepper/theme/Stepper.carbon.theme.js} +1 -1
- package/lib/components/tab/Tab.vue.d.ts +11 -5
- package/lib/components/tab/Tab.vue.js +72 -56
- package/lib/components/tab/TabGroup.vue.d.ts +1 -1
- package/lib/components/tab/TabGroup.vue.js +5 -5
- package/lib/components/tab/theme/Tab.base.theme.js +2 -1
- package/lib/components/tab/theme/Tab.carbon.theme.js +6 -5
- package/lib/components/tab/theme/TabGroup.base.theme.js +15 -15
- package/lib/components/tab/theme/TabGroup.carbon.theme.js +29 -3
- package/lib/components/table/Table.vue.d.ts +115 -9
- package/lib/components/table/Table.vue.js +188 -79
- package/lib/components/table/TableCell.vue.d.ts +4 -5
- package/lib/components/table/TableCell.vue.js +21 -22
- package/lib/components/table/TableHead.vue.d.ts +16 -0
- package/lib/components/table/TableHead.vue.js +21 -0
- package/lib/components/table/TableHead.vue2.js +4 -0
- package/lib/components/table/TableHeader.vue.d.ts +4 -0
- package/lib/components/table/TableHeader.vue.js +45 -54
- package/lib/components/table/TableRow.vue.d.ts +15 -1
- package/lib/components/table/TableRow.vue.js +21 -25
- package/lib/components/table/index.d.ts +4 -2
- package/lib/components/table/theme/Table.base.theme.js +6 -5
- package/lib/components/table/theme/Table.carbon.theme.js +11 -3
- package/lib/components/table/theme/TableCell.base.theme.js +3 -3
- package/lib/components/table/theme/TableCell.carbon.theme.js +9 -3
- package/lib/components/table/theme/TableHead.base.theme.d.ts +3 -0
- package/lib/components/table/theme/TableHead.base.theme.js +9 -0
- package/lib/components/table/theme/TableHead.carbon.theme.d.ts +3 -0
- package/lib/components/table/theme/TableHead.carbon.theme.js +9 -0
- package/lib/components/table/theme/TableHeader.base.theme.d.ts +3 -0
- package/lib/components/table/theme/TableHeader.base.theme.js +12 -0
- package/lib/components/table/theme/TableHeader.carbon.theme.d.ts +3 -0
- package/lib/components/table/theme/TableHeader.carbon.theme.js +12 -0
- package/lib/components/table/theme/TableRow.base.theme.d.ts +3 -0
- package/lib/components/table/theme/TableRow.base.theme.js +11 -0
- package/lib/components/table/theme/TableRow.carbon.theme.d.ts +3 -0
- package/lib/components/table/theme/TableRow.carbon.theme.js +11 -0
- package/lib/components/tag/Tag.vue.d.ts +3 -3
- package/lib/components/tag/Tag.vue.js +18 -18
- package/lib/components/tag/theme/Tag.base.theme.js +14 -13
- package/lib/components/tag/theme/Tag.carbon.theme.js +14 -14
- package/lib/components/textarea/Textarea.vue.d.ts +18 -8
- package/lib/components/textarea/Textarea.vue.js +44 -42
- package/lib/components/textarea/theme/Textarea.base.theme.js +6 -6
- package/lib/components/textarea/theme/Textarea.carbon.theme.js +6 -6
- package/lib/components/toggle/Toggle.vue.d.ts +15 -12
- package/lib/components/toggle/Toggle.vue.js +51 -53
- package/lib/components/toggle/theme/Toggle.base.theme.js +1 -1
- package/lib/components/tooltip/ToggleTip.vue.d.ts +14 -0
- package/lib/components/tooltip/ToggleTip.vue.js +29 -0
- package/lib/components/tooltip/ToggleTip.vue2.js +4 -0
- package/lib/components/tooltip/Tooltip.vue.d.ts +22 -3
- package/lib/components/tooltip/Tooltip.vue.js +26 -17
- package/lib/components/tooltip/__tests__/ToggleTip.spec.d.ts +1 -0
- package/lib/components/tooltip/index.d.ts +2 -0
- package/lib/composables/keys.d.ts +5 -1
- package/lib/composables/keys.js +8 -6
- package/lib/composables/useColors.js +9 -9
- package/lib/composables/useFocusTrap.d.ts +6 -0
- package/lib/composables/useFocusTrap.js +45 -0
- package/lib/composables/useInputtable.d.ts +7 -0
- package/lib/composables/useInputtable.js +64 -46
- package/lib/index.js +139 -129
- package/lib/index.umd.js +7 -3
- package/lib/nuxt.mjs +33 -0
- package/lib/nuxt.plugin.js +8 -0
- package/lib/tailwind.preset.js +40 -0
- package/lib/theme.d.ts +8 -2
- package/lib/themes/base/components.d.ts +7 -1
- package/lib/themes/base/components.js +98 -86
- package/lib/themes/base/index.js +3 -6
- package/lib/themes/base/styles.css.js +4 -0
- package/lib/themes/carbon/components.d.ts +7 -1
- package/lib/themes/carbon/components.js +98 -86
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +8 -2
- package/src/common/icons.ts +4 -1
- package/src/components/accordion/Accordion.vue +55 -0
- package/src/components/{collapse/Collapse.vue → accordion/AccordionItem.vue} +51 -32
- package/src/components/accordion/__tests__/Accordion.spec.ts +11 -0
- package/src/components/accordion/index.ts +4 -0
- package/src/components/accordion/theme/Accordion.base.theme.ts +9 -0
- package/src/components/accordion/theme/Accordion.carbon.theme.ts +7 -0
- package/src/components/accordion/theme/AccordionItem.base.theme.ts +38 -0
- package/src/components/accordion/theme/AccordionItem.carbon.theme.ts +7 -0
- package/src/components/alert/theme/Alert.carbon.theme.ts +54 -2
- package/src/components/badge/Badge.vue +1 -1
- package/src/components/breadcrumbs/theme/Breadcrumbs.base.theme.ts +1 -1
- package/src/components/button/theme/Button.base.theme.ts +2 -2
- package/src/components/button/theme/Button.carbon.theme.ts +1 -1
- package/src/components/card/theme/Card.base.theme.ts +1 -1
- package/src/components/carousel/CarouselSlide.vue +9 -4
- package/src/components/checkbox/Checkbox.vue +69 -20
- package/src/components/checkbox/theme/Checkbox.base.theme.ts +22 -8
- package/src/components/checkbox/theme/Checkbox.carbon.theme.ts +18 -4
- package/src/components/container/Container.vue +4 -0
- package/src/components/container/theme/Container.base.theme.ts +7 -1
- package/src/components/divider/Divider.vue +1 -1
- package/src/components/divider/theme/Divider.base.theme.ts +2 -2
- package/src/components/drawer/Drawer.vue +2 -2
- package/src/components/drawer/theme/Drawer.base.theme.ts +1 -1
- package/src/components/form/Form.vue +26 -5
- package/src/components/form/theme/Form.base.theme.ts +9 -1
- package/src/components/form/theme/Form.carbon.theme.ts +12 -2
- package/src/components/formGroup/FormGroup.vue +117 -0
- package/src/components/formGroup/__tests__/FormGroup.spec.ts +11 -0
- package/src/components/formGroup/index.ts +2 -0
- package/src/components/formGroup/theme/FormGroup.base.theme.ts +16 -0
- package/src/components/formGroup/theme/FormGroup.carbon.theme.ts +16 -0
- package/src/components/icon/theme/Icon.base.theme.ts +3 -3
- package/src/components/icon/theme/Icon.carbon.theme.ts +3 -4
- package/src/components/index.ts +3 -1
- package/src/components/input/Input.vue +5 -4
- package/src/components/input/theme/Input.base.theme.ts +5 -5
- package/src/components/input/theme/Input.carbon.theme.ts +6 -6
- package/src/components/inputFooter/theme/InputFooter.base.theme.ts +3 -3
- package/src/components/inputFooter/theme/InputFooter.carbon.theme.ts +3 -3
- package/src/components/label/Label.vue +4 -1
- package/src/components/label/theme/Label.base.theme.ts +1 -1
- package/src/components/label/theme/Label.carbon.theme.ts +9 -4
- package/src/components/link/Link.vue +1 -1
- package/src/components/link/theme/Link.carbon.theme.ts +23 -2
- package/src/components/loader/theme/Loader.base.theme.ts +1 -1
- package/src/components/loader/theme/Loader.carbon.theme.ts +2 -2
- package/src/components/menu/Menu.vue +11 -8
- package/src/components/menu/MenuItem.vue +1 -1
- package/src/components/menu/theme/MenuItem.base.theme.ts +32 -36
- package/src/components/modal/Modal.vue +117 -52
- package/src/components/modal/theme/Modal.base.theme.ts +31 -12
- package/src/components/modal/theme/Modal.carbon.theme.ts +55 -2
- package/src/components/notifications/Notifications.vue +6 -6
- package/src/components/notifications/theme/Notifications.base.theme.ts +2 -2
- package/src/components/notifications/theme/Notifications.carbon.theme.ts +12 -2
- package/src/components/pagination/Pagination.vue +3 -3
- package/src/components/popover/Popover.vue +77 -2
- package/src/components/popover/theme/PopoverContainer.base.theme.ts +1 -1
- package/src/components/popover/theme/PopoverContainer.carbon.theme.ts +1 -1
- package/src/components/progress/Progress.vue +1 -1
- package/src/components/progress/theme/Progress.base.theme.ts +2 -2
- package/src/components/radio/Radio.vue +39 -15
- package/src/components/radio/theme/Radio.base.theme.ts +15 -9
- package/src/components/radio/theme/Radio.carbon.theme.ts +14 -8
- package/src/components/select/Select.vue +17 -15
- package/src/components/select/theme/Select.base.theme.ts +8 -8
- package/src/components/select/theme/Select.carbon.theme.ts +9 -9
- package/src/components/skeleton/Skeleton.vue +18 -2
- package/src/components/skeleton/theme/Skeleton.base.theme.ts +8 -1
- package/src/components/slider/Slider.vue +2 -3
- package/src/components/slider/theme/Slider.carbon.theme.ts +1 -1
- package/src/components/spinner/Spinner.vue +2 -2
- package/src/components/stepper/Stepper.vue +153 -0
- package/src/components/{collapse/__tests__/Collapse.spec.ts → stepper/__tests__/Stepper.spec.ts} +3 -3
- package/src/components/stepper/index.ts +6 -0
- package/src/components/stepper/theme/Stepper.base.theme.ts +45 -0
- package/src/components/stepper/theme/Stepper.carbon.theme.ts +7 -0
- package/src/components/tab/Tab.vue +21 -7
- package/src/components/tab/TabGroup.vue +2 -2
- package/src/components/tab/theme/Tab.base.theme.ts +2 -0
- package/src/components/tab/theme/Tab.carbon.theme.ts +4 -2
- package/src/components/tab/theme/TabGroup.base.theme.ts +4 -4
- package/src/components/tab/theme/TabGroup.carbon.theme.ts +50 -2
- package/src/components/table/Table.vue +125 -27
- package/src/components/table/TableCell.vue +5 -6
- package/src/components/table/TableHead.vue +25 -0
- package/src/components/table/TableHeader.vue +35 -56
- package/src/components/table/TableRow.vue +19 -17
- package/src/components/table/index.ts +4 -2
- package/src/components/table/theme/Table.base.theme.ts +9 -7
- package/src/components/table/theme/Table.carbon.theme.ts +18 -2
- package/src/components/table/theme/TableCell.base.theme.ts +1 -1
- package/src/components/table/theme/TableCell.carbon.theme.ts +24 -2
- package/src/components/table/theme/TableHead.base.theme.ts +10 -0
- package/src/components/table/theme/TableHead.carbon.theme.ts +10 -0
- package/src/components/table/theme/TableHeader.base.theme.ts +28 -0
- package/src/components/table/theme/TableHeader.carbon.theme.ts +28 -0
- package/src/components/table/theme/TableRow.base.theme.ts +21 -0
- package/src/components/table/theme/TableRow.carbon.theme.ts +21 -0
- package/src/components/tag/Tag.vue +4 -4
- package/src/components/tag/theme/Tag.base.theme.ts +4 -4
- package/src/components/tag/theme/Tag.carbon.theme.ts +5 -6
- package/src/components/textarea/Textarea.vue +6 -4
- package/src/components/textarea/theme/Textarea.base.theme.ts +5 -4
- package/src/components/textarea/theme/Textarea.carbon.theme.ts +5 -5
- package/src/components/toggle/Toggle.vue +5 -7
- package/src/components/toggle/theme/Toggle.base.theme.ts +1 -1
- package/src/components/tooltip/ToggleTip.vue +31 -0
- package/src/components/tooltip/Tooltip.vue +14 -4
- package/src/components/tooltip/__tests__/ToggleTip.spec.ts +11 -0
- package/src/components/tooltip/index.ts +3 -0
- package/src/composables/keys.ts +5 -1
- package/src/composables/useColors.ts +1 -1
- package/src/composables/useFocusTrap.ts +106 -0
- package/src/composables/useInputtable.ts +32 -3
- package/src/theme.ts +14 -2
- package/src/themes/base/components.ts +7 -1
- package/src/themes/base/index.ts +0 -3
- package/src/themes/base/styles.css +4 -0
- package/src/themes/carbon/components.ts +7 -1
- package/src/version.ts +1 -1
- package/volar.d.ts +6 -1
- package/lib/components/collapse/Collapse.vue.js +0 -131
- package/lib/components/collapse/Collapse.vue2.js +0 -4
- package/lib/components/collapse/index.d.ts +0 -2
- package/lib/components/collapse/theme/Collapse.base.theme.d.ts +0 -3
- package/lib/components/collapse/theme/Collapse.base.theme.js +0 -10
- package/lib/components/collapse/theme/Collapse.carbon.theme.d.ts +0 -3
- package/lib/components/table/TableHead.d.ts +0 -2
- package/lib/components/table/TableHead.js +0 -19
- package/src/components/collapse/index.ts +0 -2
- package/src/components/collapse/theme/Collapse.base.theme.ts +0 -13
- package/src/components/collapse/theme/Collapse.carbon.theme.ts +0 -7
- package/src/components/table/TableHead.tsx +0 -14
- /package/lib/components/{collapse/__tests__/Collapse.spec.d.ts → accordion/__tests__/Accordion.spec.d.ts} +0 -0
|
@@ -54,7 +54,7 @@ export default {
|
|
|
54
54
|
<script setup lang="ts">
|
|
55
55
|
import { reactive, computed, provide, type PropType, ref, watch, onMounted, watchEffect, type ExtractPublicPropTypes, type Ref, nextTick } from 'vue'
|
|
56
56
|
import { useMutationObserver, useResizeObserver, useThrottleFn } from '@vueuse/core'
|
|
57
|
-
import {
|
|
57
|
+
import { injectTabGroupKey } from '../../composables/keys'
|
|
58
58
|
import { useCommon, type Size } from '../../composables/useCommon'
|
|
59
59
|
import { useColors } from '../../composables/useColors'
|
|
60
60
|
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
@@ -92,7 +92,7 @@ function activateTab(tab: string | number | null) {
|
|
|
92
92
|
emit('update:modelValue', tab)
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
provide(
|
|
95
|
+
provide(injectTabGroupKey, {
|
|
96
96
|
tabsContentRef,
|
|
97
97
|
activateTab,
|
|
98
98
|
state,
|
|
@@ -3,9 +3,9 @@ import type { TabTheme } from '../Tab.vue'
|
|
|
3
3
|
const theme: TabTheme = {
|
|
4
4
|
classes: {
|
|
5
5
|
wrapper: ({ props, data }) => {
|
|
6
|
-
const c = ['py-2 transition-colors duration-150 ease-in-out whitespace-nowrap text-left
|
|
6
|
+
const c = ['py-2 transition-colors duration-150 ease-in-out whitespace-nowrap text-left']
|
|
7
7
|
|
|
8
|
-
if (data.variant === 'block') c.push('px-
|
|
8
|
+
if (data.variant === 'block') c.push('px-4')
|
|
9
9
|
else c.push('px-4')
|
|
10
10
|
|
|
11
11
|
if (props.size === 'lg') c.push('text-lg')
|
|
@@ -26,6 +26,8 @@ const theme: TabTheme = {
|
|
|
26
26
|
},
|
|
27
27
|
|
|
28
28
|
icon: 'mr-1.5',
|
|
29
|
+
|
|
30
|
+
tabpanel: 'py-4',
|
|
29
31
|
},
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -9,7 +9,7 @@ const theme: TabGroupTheme = {
|
|
|
9
9
|
|
|
10
10
|
if (!props.fullWidth) c.push('!w-fit')
|
|
11
11
|
if (props.variant === 'block') c.push('rounded-md')
|
|
12
|
-
if (props.variant === 'block' && !props.ghost) c.push('bg-
|
|
12
|
+
if (props.variant === 'block' && !props.ghost) c.push('bg-secondary-100 dark:bg-secondary-800 p-1')
|
|
13
13
|
|
|
14
14
|
return c
|
|
15
15
|
},
|
|
@@ -17,7 +17,7 @@ const theme: TabGroupTheme = {
|
|
|
17
17
|
list: ({ props }) => {
|
|
18
18
|
const c = ['flex min-w-full w-fit']
|
|
19
19
|
|
|
20
|
-
if (props.variant === 'line') c.push('border-b border-
|
|
20
|
+
if (props.variant === 'line') c.push('border-b border-secondary-200 dark:border-secondary-700')
|
|
21
21
|
if (props.variant === 'line' && !props.grow) c.push('space-x-8')
|
|
22
22
|
if (props.variant === 'block') c.push('z-[1]')
|
|
23
23
|
if (props.align === 'center') c.push('justify-center')
|
|
@@ -38,7 +38,7 @@ const theme: TabGroupTheme = {
|
|
|
38
38
|
},
|
|
39
39
|
|
|
40
40
|
styles: ({ props, colors, css }) => {
|
|
41
|
-
const
|
|
41
|
+
const secondary = colors.getPalette('secondary')
|
|
42
42
|
const color = colors.getPalette(props.color)
|
|
43
43
|
|
|
44
44
|
return css.variables({
|
|
@@ -46,7 +46,7 @@ const theme: TabGroupTheme = {
|
|
|
46
46
|
bg: props.ghost ? color[50] : '#fff',
|
|
47
47
|
dark: {
|
|
48
48
|
text: color[400],
|
|
49
|
-
bg: props.ghost ? color[900] :
|
|
49
|
+
bg: props.ghost ? color[900] : secondary[700],
|
|
50
50
|
},
|
|
51
51
|
})
|
|
52
52
|
},
|
|
@@ -1,7 +1,55 @@
|
|
|
1
1
|
import type { TabGroupTheme } from '../TabGroup.vue'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const theme: TabGroupTheme = {
|
|
4
|
+
classes: {
|
|
5
|
+
wrapper: '',
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
scroller: ({ props }) => {
|
|
8
|
+
const c = ['']
|
|
9
|
+
|
|
10
|
+
if (!props.fullWidth) c.push('!w-fit')
|
|
11
|
+
if (props.variant === 'block') c.push('')
|
|
12
|
+
if (props.variant === 'block' && !props.ghost) c.push('bg-secondary-200 dark:bg-secondary-800')
|
|
13
|
+
|
|
14
|
+
return c
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
list: ({ props }) => {
|
|
18
|
+
const c = ['flex min-w-full w-fit']
|
|
19
|
+
|
|
20
|
+
if (props.variant === 'line') c.push('border-b border-secondary-200 dark:border-secondary-700')
|
|
21
|
+
if (props.variant === 'line' && !props.grow) c.push('')
|
|
22
|
+
if (props.variant === 'block') c.push('z-[1] py-1.5')
|
|
23
|
+
if (props.align === 'center') c.push('justify-center')
|
|
24
|
+
if (props.align === 'right') c.push('justify-end')
|
|
25
|
+
|
|
26
|
+
return c
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
tracker: ({ props }) => {
|
|
30
|
+
const c = ['absolute transition-all duration-150']
|
|
31
|
+
|
|
32
|
+
if (props.variant === 'line') c.push('h-[2px] -mt-[2px] bg-[color:var(--x-tab-group-text)] dark:bg-[color:var(--x-tab-group-dark-text)]')
|
|
33
|
+
|
|
34
|
+
if (props.variant === 'block') c.push('border-t-2 border-solid border-[color:var(--x-tab-group-text)] dark:border-[color:var(--x-tab-group-dark-text)] h-full top-0 bg-secondary-100 dark:bg-secondary-700')
|
|
35
|
+
|
|
36
|
+
return c
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
styles: ({ props, colors, css }) => {
|
|
41
|
+
const gray = colors.getPalette('gray')
|
|
42
|
+
const color = colors.getPalette(props.color)
|
|
43
|
+
|
|
44
|
+
return css.variables({
|
|
45
|
+
text: color[600],
|
|
46
|
+
bg: props.ghost ? color[50] : '#fff',
|
|
47
|
+
dark: {
|
|
48
|
+
text: color[400],
|
|
49
|
+
bg: props.ghost ? color[900] : gray[700],
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
},
|
|
53
|
+
}
|
|
6
54
|
|
|
7
55
|
export default theme
|
|
@@ -13,6 +13,12 @@ const tableProps = {
|
|
|
13
13
|
default: () => [],
|
|
14
14
|
},
|
|
15
15
|
loading: Boolean,
|
|
16
|
+
loadingSkeleton: Boolean,
|
|
17
|
+
loadingLines: {
|
|
18
|
+
type: [Number, String],
|
|
19
|
+
default: 3,
|
|
20
|
+
},
|
|
21
|
+
error: Boolean,
|
|
16
22
|
dense: Boolean,
|
|
17
23
|
fixed: Boolean,
|
|
18
24
|
striped: Boolean,
|
|
@@ -25,6 +31,7 @@ const tableProps = {
|
|
|
25
31
|
type: Boolean,
|
|
26
32
|
default: true,
|
|
27
33
|
},
|
|
34
|
+
expandable: Boolean,
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
export type TableHeader = {
|
|
@@ -34,26 +41,34 @@ export type TableHeader = {
|
|
|
34
41
|
value?: string;
|
|
35
42
|
text?: string;
|
|
36
43
|
width?: string | number;
|
|
44
|
+
truncate?: boolean;
|
|
45
|
+
skeletonShape?: SkeletonShape;
|
|
37
46
|
}
|
|
38
47
|
|
|
39
48
|
export type TableProps = ExtractPublicPropTypes<typeof tableProps>
|
|
40
49
|
|
|
41
|
-
type InternalClasses = 'wrapper' | 'loadingWrapper'
|
|
50
|
+
type InternalClasses = 'wrapper' | 'table' | 'loadingWrapper'
|
|
42
51
|
export interface TableTheme extends ThemeComponent<TableProps, InternalClasses> {}
|
|
43
52
|
|
|
44
53
|
export default { name: 'XTable' }
|
|
45
54
|
</script>
|
|
46
55
|
|
|
47
56
|
<script setup lang="ts" generic="T">
|
|
48
|
-
import type
|
|
57
|
+
import { ref, type ExtractPublicPropTypes, type PropType, watch } from 'vue'
|
|
49
58
|
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
50
59
|
|
|
51
|
-
import XTableHead from './TableHead'
|
|
60
|
+
import XTableHead from './TableHead.vue'
|
|
52
61
|
import XTableHeader, { type TableHeaderSort, type TableHeaderAlign } from './TableHeader.vue'
|
|
53
62
|
import XTableBody from './TableBody'
|
|
54
63
|
import XTableRow from './TableRow.vue'
|
|
55
64
|
import XTableCell from './TableCell.vue'
|
|
56
65
|
import XSpinner from '../spinner/Spinner.vue'
|
|
66
|
+
import XSkeleton from '../skeleton/Skeleton.vue'
|
|
67
|
+
import type { SkeletonShape } from '../skeleton/Skeleton.vue'
|
|
68
|
+
|
|
69
|
+
import XIcon from '../icon/Icon.vue'
|
|
70
|
+
|
|
71
|
+
import { chevronDownIcon } from '../../common/icons'
|
|
57
72
|
|
|
58
73
|
const props = defineProps({
|
|
59
74
|
...tableProps,
|
|
@@ -63,6 +78,24 @@ const props = defineProps({
|
|
|
63
78
|
},
|
|
64
79
|
})
|
|
65
80
|
|
|
81
|
+
type internalT = T & {
|
|
82
|
+
__expanded?: boolean;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function clone<T>(source: T[]): T[] {
|
|
86
|
+
try {
|
|
87
|
+
return JSON.parse(JSON.stringify(source))
|
|
88
|
+
} catch (e) {
|
|
89
|
+
return []
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const internalItems = ref<internalT[]>([])
|
|
94
|
+
|
|
95
|
+
watch(() => props.items, (newValue) => {
|
|
96
|
+
if (props.expandable) internalItems.value = clone(newValue as any)
|
|
97
|
+
}, { immediate: true })
|
|
98
|
+
|
|
66
99
|
const emit = defineEmits(['update:sort', 'click-row'])
|
|
67
100
|
|
|
68
101
|
function getSort(headerValue: string | undefined, sort: string[]): TableHeaderSort {
|
|
@@ -120,15 +153,16 @@ const { styles, classes, className } = useTheme('Table', {}, props)
|
|
|
120
153
|
</script>
|
|
121
154
|
|
|
122
155
|
<template>
|
|
123
|
-
<div class="
|
|
156
|
+
<div :class="[className, classes.wrapper]">
|
|
157
|
+
<slot name="title"></slot>
|
|
158
|
+
<slot name="actions"></slot>
|
|
159
|
+
|
|
124
160
|
<table
|
|
125
161
|
:style="styles"
|
|
126
|
-
:class="
|
|
127
|
-
className,
|
|
128
|
-
classes.wrapper,
|
|
129
|
-
]"
|
|
162
|
+
:class="classes.table"
|
|
130
163
|
>
|
|
131
164
|
<x-table-head>
|
|
165
|
+
<x-table-header v-if="expandable" width="48" class="!p-0" :sticky-header="stickyHeader"/>
|
|
132
166
|
<x-table-header
|
|
133
167
|
v-for="(header, index) in headers"
|
|
134
168
|
:key="index"
|
|
@@ -139,29 +173,93 @@ const { styles, classes, className } = useTheme('Table', {}, props)
|
|
|
139
173
|
:width="header.width"
|
|
140
174
|
@click="header.sortable ? sortHeader(header) : null"
|
|
141
175
|
>
|
|
142
|
-
|
|
176
|
+
<slot :name="`header-${header.value}`" :header="header">
|
|
177
|
+
{{ header.text }}
|
|
178
|
+
</slot>
|
|
143
179
|
</x-table-header>
|
|
144
180
|
</x-table-head>
|
|
145
181
|
<x-table-body>
|
|
146
|
-
<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
182
|
+
<template v-if="loading">
|
|
183
|
+
<x-table-row
|
|
184
|
+
v-for="(item, index) in Number(loadingLines)"
|
|
185
|
+
:key="index"
|
|
186
|
+
:striped="striped"
|
|
187
|
+
>
|
|
188
|
+
<x-table-cell
|
|
189
|
+
v-for="(header, index2) in headers"
|
|
190
|
+
:key="index2"
|
|
191
|
+
:text-align="header.align"
|
|
192
|
+
:width="header.width"
|
|
193
|
+
:dense="dense"
|
|
194
|
+
:fixed="fixed"
|
|
195
|
+
>
|
|
196
|
+
<slot :name="`loading-${header.value}`" :item="item">
|
|
197
|
+
<x-skeleton
|
|
198
|
+
class="max-w-[60%]"
|
|
199
|
+
:shape="header.skeletonShape || 'line'"
|
|
200
|
+
:class="{
|
|
201
|
+
'mx-auto': header.align === 'center',
|
|
202
|
+
'ml-auto': header.align === 'right',
|
|
203
|
+
}"
|
|
204
|
+
/>
|
|
205
|
+
</slot>
|
|
206
|
+
</x-table-cell>
|
|
207
|
+
</x-table-row>
|
|
208
|
+
</template>
|
|
209
|
+
<template v-else-if="error">
|
|
210
|
+
<tr>
|
|
211
|
+
<td :colspan="headers.length">
|
|
212
|
+
<slot name="error"></slot>
|
|
213
|
+
</td>
|
|
214
|
+
</tr>
|
|
215
|
+
</template>
|
|
216
|
+
<template v-else-if="!items || items.length === 0">
|
|
217
|
+
<tr>
|
|
218
|
+
<td :colspan="headers.length">
|
|
219
|
+
<slot name="empty"></slot>
|
|
220
|
+
</td>
|
|
221
|
+
</tr>
|
|
222
|
+
</template>
|
|
223
|
+
<template v-for="(item, index) in items" v-else :key="index">
|
|
224
|
+
<x-table-row
|
|
225
|
+
:pointer="pointer"
|
|
226
|
+
:striped="striped"
|
|
227
|
+
@click="$emit('click-row', item)"
|
|
159
228
|
>
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
229
|
+
<x-table-cell v-if="expandable" width="48" class="!p-1">
|
|
230
|
+
<button class="p-4" @click="internalItems[index].__expanded = !internalItems[index].__expanded">
|
|
231
|
+
<x-icon
|
|
232
|
+
:icon="chevronDownIcon"
|
|
233
|
+
:size="dense ? 'xs' : 'md'"
|
|
234
|
+
class="transition-transform"
|
|
235
|
+
:class="{
|
|
236
|
+
'rotate-180': internalItems[index]?.__expanded,
|
|
237
|
+
}"
|
|
238
|
+
/>
|
|
239
|
+
</button>
|
|
240
|
+
</x-table-cell>
|
|
241
|
+
<x-table-cell
|
|
242
|
+
v-for="(header, index2) in headers"
|
|
243
|
+
:key="index2"
|
|
244
|
+
:text-align="header.align"
|
|
245
|
+
:truncate="header.truncate"
|
|
246
|
+
:width="header.width"
|
|
247
|
+
:dense="dense"
|
|
248
|
+
:fixed="fixed"
|
|
249
|
+
>
|
|
250
|
+
<slot :name="`item-${header.value}`" :item="item">
|
|
251
|
+
{{ getValue(item, header.value) }}
|
|
252
|
+
</slot>
|
|
253
|
+
</x-table-cell>
|
|
254
|
+
</x-table-row>
|
|
255
|
+
<tr v-if="expandable">
|
|
256
|
+
<td colspan="999">
|
|
257
|
+
<div class="overflow-hidden transition-opacity" :class="[internalItems[index]?.__expanded ? '' : 'opacity-0 max-h-0']">
|
|
258
|
+
<slot name="expanded-row" :item="item"></slot>
|
|
259
|
+
</div>
|
|
260
|
+
</td>
|
|
261
|
+
</tr>
|
|
262
|
+
</template>
|
|
165
263
|
</x-table-body>
|
|
166
264
|
<div
|
|
167
265
|
v-if="loading"
|
|
@@ -10,7 +10,7 @@ const tableCellProps = {
|
|
|
10
10
|
},
|
|
11
11
|
truncate: Boolean,
|
|
12
12
|
dense: Boolean,
|
|
13
|
-
|
|
13
|
+
width: [String, Number],
|
|
14
14
|
verticalAlign: {
|
|
15
15
|
type: String as PropType<TableCellVerticalAlign>,
|
|
16
16
|
default: 'middle',
|
|
@@ -32,22 +32,21 @@ export default {
|
|
|
32
32
|
</script>
|
|
33
33
|
|
|
34
34
|
<script setup lang="ts">
|
|
35
|
-
import type
|
|
35
|
+
import { computed, type ExtractPublicPropTypes, type PropType } from 'vue'
|
|
36
36
|
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
37
37
|
|
|
38
38
|
const props = defineProps(tableCellProps)
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
console.warn('Table must have "fixed" property set to true when using TableCell "truncate" property')
|
|
42
|
-
}
|
|
40
|
+
const computedWidth = computed(() => typeof props.width === 'number' ? `${props.width}px` : props.width)
|
|
43
41
|
|
|
44
42
|
const { styles, classes, className } = useTheme('TableCell', {}, props)
|
|
45
43
|
</script>
|
|
46
44
|
|
|
47
45
|
<template>
|
|
48
46
|
<td
|
|
49
|
-
:style="styles"
|
|
47
|
+
:style="[styles, { width: computedWidth, minWidth: computedWidth, maxWidth: computedWidth }]"
|
|
50
48
|
:class="[
|
|
49
|
+
'relative',
|
|
51
50
|
className,
|
|
52
51
|
classes.wrapper,
|
|
53
52
|
]"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const tableHeadProps = {}
|
|
3
|
+
|
|
4
|
+
export type TableHeadProps = ExtractPublicPropTypes<typeof tableHeadProps>
|
|
5
|
+
|
|
6
|
+
type InternalClasses = 'thead' | 'row'
|
|
7
|
+
export interface TableHeadTheme extends ThemeComponent<TableHeadProps, InternalClasses> {}
|
|
8
|
+
|
|
9
|
+
export default { name: 'XTableHead' }
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script setup lang="ts">
|
|
13
|
+
import type { ExtractPublicPropTypes } from 'vue'
|
|
14
|
+
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
15
|
+
|
|
16
|
+
const { styles, classes, className } = useTheme('TableHead', {}, {})
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<thead :class="[className, classes.thead]" :style="styles">
|
|
21
|
+
<tr :class="classes.row">
|
|
22
|
+
<slot></slot>
|
|
23
|
+
</tr>
|
|
24
|
+
</thead>
|
|
25
|
+
</template>
|
|
@@ -22,74 +22,53 @@ export type TableHeaderSort = typeof validators.sort[number]
|
|
|
22
22
|
export type TableHeaderAlign = typeof validators.textAlign[number]
|
|
23
23
|
export type TableHeaderProps = ExtractPublicPropTypes<typeof tableHeaderProps>
|
|
24
24
|
|
|
25
|
+
type InternalClasses = 'th' | 'sortIcon'
|
|
26
|
+
export interface TableHeaderTheme extends ThemeComponent<TableHeaderProps, InternalClasses> {}
|
|
27
|
+
|
|
25
28
|
export default { name: 'XTableHeader', validators }
|
|
26
29
|
</script>
|
|
27
30
|
|
|
28
31
|
<script setup lang="ts">
|
|
29
32
|
import type { ExtractPublicPropTypes, PropType } from 'vue'
|
|
33
|
+
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
34
|
+
|
|
35
|
+
const props = defineProps(tableHeaderProps)
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
const { styles, classes, className } = useTheme('TableHeader', {}, props)
|
|
32
38
|
</script>
|
|
33
39
|
|
|
34
40
|
<template>
|
|
35
|
-
<th
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
// sort
|
|
40
|
-
'cursor-pointer hover:text-gray-800 dark:hover:text-gray-300 transition-colors duration-150 ease-in-out': sortable,
|
|
41
|
-
// stickyHeader
|
|
42
|
-
'sticky top-0': stickyHeader,
|
|
43
|
-
// textAlign
|
|
44
|
-
'text-left': textAlign === 'left',
|
|
45
|
-
'text-right': textAlign === 'right',
|
|
46
|
-
'text-center': textAlign === 'center',
|
|
47
|
-
'text-justify': textAlign === 'justify',
|
|
48
|
-
},
|
|
49
|
-
]"
|
|
50
|
-
>
|
|
51
|
-
<div
|
|
41
|
+
<th :style="styles" :class="[className, classes.th, 'group/th']">
|
|
42
|
+
<slot></slot>
|
|
43
|
+
|
|
44
|
+
<svg
|
|
52
45
|
v-if="sortable"
|
|
53
|
-
class="
|
|
46
|
+
:class="[
|
|
47
|
+
classes.sortIcon,
|
|
48
|
+
[sort && [1, -1].includes(sort) ? '' : 'invisible group-hover/th:visible']
|
|
49
|
+
]"
|
|
50
|
+
width="24"
|
|
51
|
+
height="24"
|
|
52
|
+
viewBox="0 0 24 24"
|
|
53
|
+
stroke="currentColor"
|
|
54
|
+
stroke-linejoin="round"
|
|
55
|
+
stroke-linecap="round"
|
|
56
|
+
fill="none"
|
|
57
|
+
role="presentation"
|
|
54
58
|
>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
class="absolute stroke-2 w-3 h-3 ml-0.5 -right-3 top-0.5"
|
|
60
|
-
width="24"
|
|
61
|
-
height="24"
|
|
62
|
-
viewBox="0 0 24 24"
|
|
63
|
-
stroke="currentColor"
|
|
64
|
-
stroke-linejoin="round"
|
|
65
|
-
stroke-linecap="round"
|
|
66
|
-
fill="none"
|
|
67
|
-
role="presentation"
|
|
68
|
-
>
|
|
69
|
-
<template v-if="sort === -1">
|
|
70
|
-
<line
|
|
71
|
-
x1="12"
|
|
72
|
-
y1="5"
|
|
73
|
-
x2="12"
|
|
74
|
-
y2="19"
|
|
75
|
-
/>
|
|
76
|
-
<polyline points="19 12 12 19 5 12" />
|
|
77
|
-
</template>
|
|
59
|
+
<template v-if="sort === -1">
|
|
60
|
+
<line x1="12" y1="5" x2="12" y2="19"/>
|
|
61
|
+
<polyline points="19 12 12 19 5 12" />
|
|
62
|
+
</template>
|
|
78
63
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
x2="12"
|
|
84
|
-
y2="5"
|
|
85
|
-
/>
|
|
86
|
-
<polyline points="5 12 12 5 19 12" />
|
|
87
|
-
</template>
|
|
88
|
-
</svg>
|
|
89
|
-
</div>
|
|
64
|
+
<template v-else-if="sort === 1">
|
|
65
|
+
<line x1="12" y1="19" x2="12" y2="5"/>
|
|
66
|
+
<polyline points="5 12 12 5 19 12" />
|
|
67
|
+
</template>
|
|
90
68
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
69
|
+
<template v-else>
|
|
70
|
+
<path d="m3 9l4-4l4 4M7 5v14m14-4l-4 4l-4-4m4 4V5"/>
|
|
71
|
+
</template>
|
|
72
|
+
</svg>
|
|
94
73
|
</th>
|
|
95
74
|
</template>
|
|
@@ -3,13 +3,7 @@ const validators = {
|
|
|
3
3
|
verticalAlign: ['baseline', 'bottom', 'middle', 'text-bottom', 'text-top', 'top'],
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
</script>
|
|
8
|
-
|
|
9
|
-
<script setup lang="ts">
|
|
10
|
-
import { computed, type PropType } from 'vue'
|
|
11
|
-
|
|
12
|
-
const props = defineProps({
|
|
6
|
+
const tableRowProps = {
|
|
13
7
|
pointer: Boolean,
|
|
14
8
|
striped: Boolean,
|
|
15
9
|
verticalAlign: {
|
|
@@ -17,7 +11,21 @@ const props = defineProps({
|
|
|
17
11
|
default: 'top',
|
|
18
12
|
validator: (value: string) => validators.verticalAlign.includes(value),
|
|
19
13
|
},
|
|
20
|
-
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type TableRowProps = ExtractPublicPropTypes<typeof tableRowProps>
|
|
17
|
+
|
|
18
|
+
type InternalClasses = 'row'
|
|
19
|
+
export interface TableRowTheme extends ThemeComponent<TableRowProps, InternalClasses> {}
|
|
20
|
+
|
|
21
|
+
export default { name: 'XTableRow', validators }
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import { computed, type PropType, type ExtractPublicPropTypes } from 'vue'
|
|
26
|
+
import { useTheme, type ThemeComponent } from '../../composables/useTheme'
|
|
27
|
+
|
|
28
|
+
const props = defineProps(tableRowProps)
|
|
21
29
|
|
|
22
30
|
const alignClass = computed(() => {
|
|
23
31
|
if (props.verticalAlign === 'baseline') return 'align-baseline'
|
|
@@ -29,18 +37,12 @@ const alignClass = computed(() => {
|
|
|
29
37
|
|
|
30
38
|
return ''
|
|
31
39
|
})
|
|
40
|
+
|
|
41
|
+
const { styles, classes, className } = useTheme('TableRow', {}, props)
|
|
32
42
|
</script>
|
|
33
43
|
|
|
34
44
|
<template>
|
|
35
|
-
<tr
|
|
36
|
-
:class="[
|
|
37
|
-
striped ? 'odd:bg-gray-50 dark:odd:bg-gray-800' : 'border-b border-gray-200 dark:border-gray-700',
|
|
38
|
-
{
|
|
39
|
-
'hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer': pointer,
|
|
40
|
-
},
|
|
41
|
-
alignClass
|
|
42
|
-
]"
|
|
43
|
-
>
|
|
45
|
+
<tr :style="styles" :class="[className, classes.row, alignClass]">
|
|
44
46
|
<slot></slot>
|
|
45
47
|
</tr>
|
|
46
48
|
</template>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { default as XTable } from './Table.vue'
|
|
2
2
|
export { default as XTableBody } from './TableBody'
|
|
3
3
|
export { default as XTableCell } from './TableCell.vue'
|
|
4
|
-
export { default as XTableHead } from './TableHead'
|
|
4
|
+
export { default as XTableHead } from './TableHead.vue'
|
|
5
5
|
export { default as XTableHeader } from './TableHeader.vue'
|
|
6
6
|
export { default as XTableRow } from './TableRow.vue'
|
|
7
7
|
|
|
8
8
|
export type { TableProps, TableHeader, TableTheme } from './Table.vue'
|
|
9
|
-
export type {
|
|
9
|
+
export type { TableHeadProps, TableHeadTheme } from './TableHead.vue'
|
|
10
|
+
export type { TableRowProps, TableRowTheme } from './TableRow.vue'
|
|
11
|
+
export type { TableHeaderProps, TableHeaderAlign, TableHeaderSort, TableHeaderTheme } from './TableHeader.vue'
|
|
10
12
|
export type { TableCellProps, TableCellTextAlign, TableCellVerticalAlign, TableCellTheme } from './TableCell.vue'
|
|
@@ -2,19 +2,21 @@ import type { TableTheme } from '../Table.vue'
|
|
|
2
2
|
|
|
3
3
|
const theme: TableTheme = {
|
|
4
4
|
classes: {
|
|
5
|
-
wrapper:
|
|
6
|
-
const c = ['w-full relative']
|
|
5
|
+
wrapper: 'w-full h-full overflow-x-auto',
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
table: ({ props }) => {
|
|
8
|
+
const classes = ['w-full relative']
|
|
9
9
|
|
|
10
|
-
if (props.
|
|
10
|
+
if (props.scrollable) classes.push('overflow-x-scroll sm:overflow-x-auto whitespace-wrap sm:whitespace-normal')
|
|
11
11
|
|
|
12
|
-
if (props.
|
|
12
|
+
if (props.stickyHeader) classes.push('relative')
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
if (props.fixed) classes.push('md:table-fixed')
|
|
15
|
+
|
|
16
|
+
return classes
|
|
15
17
|
},
|
|
16
18
|
|
|
17
|
-
loadingWrapper: 'absolute inset-0 flex items-center justify-center z-40 bg-
|
|
19
|
+
loadingWrapper: 'absolute inset-0 flex items-center justify-center z-40 bg-secondary-300 dark:bg-secondary-600 rounded opacity-30',
|
|
18
20
|
},
|
|
19
21
|
}
|
|
20
22
|
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import type { TableTheme } from '../Table.vue'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const theme: TableTheme = {
|
|
4
|
+
classes: {
|
|
5
|
+
wrapper: 'w-full h-full shadow-sm overflow-x-auto text-sm bg-white dark:bg-secondary-800',
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
table: ({ props }) => {
|
|
8
|
+
const classes = ['w-full relative']
|
|
9
|
+
|
|
10
|
+
if (props.scrollable) classes.push('overflow-x-scroll sm:overflow-x-auto whitespace-wrap sm:whitespace-normal')
|
|
11
|
+
|
|
12
|
+
if (props.stickyHeader) classes.push('relative')
|
|
13
|
+
|
|
14
|
+
if (props.fixed) classes.push('md:table-fixed')
|
|
15
|
+
|
|
16
|
+
return classes
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
loadingWrapper: 'absolute inset-0 flex items-center justify-center z-40 bg-secondary-300 dark:bg-secondary-600 rounded opacity-30',
|
|
20
|
+
},
|
|
21
|
+
}
|
|
6
22
|
|
|
7
23
|
export default theme
|