@laser-ui/components 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/accordion/Accordion.d.ts +3 -0
- package/accordion/Accordion.js +162 -0
- package/accordion/index.d.ts +2 -0
- package/accordion/index.js +1 -0
- package/accordion/types.d.ts +20 -0
- package/accordion/types.js +1 -0
- package/accordion/vars.d.ts +10 -0
- package/accordion/vars.js +10 -0
- package/affix/Affix.d.ts +3 -0
- package/affix/Affix.js +56 -0
- package/affix/index.d.ts +2 -0
- package/affix/index.js +1 -0
- package/affix/types.d.ts +14 -0
- package/affix/types.js +1 -0
- package/alert/Alert.d.ts +3 -0
- package/alert/Alert.js +53 -0
- package/alert/index.d.ts +2 -0
- package/alert/index.js +1 -0
- package/alert/types.d.ts +13 -0
- package/alert/types.js +1 -0
- package/alert/vars.d.ts +14 -0
- package/alert/vars.js +14 -0
- package/anchor/Anchor.d.ts +10 -0
- package/anchor/Anchor.js +112 -0
- package/anchor/index.d.ts +2 -0
- package/anchor/index.js +1 -0
- package/anchor/types.d.ts +23 -0
- package/anchor/types.js +1 -0
- package/anchor/vars.d.ts +11 -0
- package/anchor/vars.js +11 -0
- package/avatar/Avatar.d.ts +3 -0
- package/avatar/Avatar.js +43 -0
- package/avatar/index.d.ts +2 -0
- package/avatar/index.js +1 -0
- package/avatar/types.d.ts +11 -0
- package/avatar/types.js +1 -0
- package/avatar/vars.d.ts +9 -0
- package/avatar/vars.js +9 -0
- package/badge/Badge.d.ts +7 -0
- package/badge/Badge.js +61 -0
- package/badge/BadgeText.d.ts +2 -0
- package/badge/BadgeText.js +40 -0
- package/badge/index.d.ts +2 -0
- package/badge/index.js +1 -0
- package/badge/internal/BadgeNumber.d.ts +10 -0
- package/badge/internal/BadgeNumber.js +37 -0
- package/badge/types.d.ts +19 -0
- package/badge/types.js +1 -0
- package/badge/vars.d.ts +12 -0
- package/badge/vars.js +12 -0
- package/breadcrumb/Breadcrumb.d.ts +3 -0
- package/breadcrumb/Breadcrumb.js +22 -0
- package/breadcrumb/index.d.ts +2 -0
- package/breadcrumb/index.js +1 -0
- package/breadcrumb/types.d.ts +15 -0
- package/breadcrumb/types.js +1 -0
- package/breadcrumb/vars.d.ts +8 -0
- package/breadcrumb/vars.js +8 -0
- package/button/Button.d.ts +3 -0
- package/button/Button.js +50 -0
- package/button/index.d.ts +2 -0
- package/button/index.js +1 -0
- package/button/types.d.ts +14 -0
- package/button/types.js +1 -0
- package/button/vars.d.ts +23 -0
- package/button/vars.js +23 -0
- package/card/Card.d.ts +11 -0
- package/card/Card.js +30 -0
- package/card/CardAction.d.ts +3 -0
- package/card/CardAction.js +17 -0
- package/card/CardContent.d.ts +3 -0
- package/card/CardContent.js +13 -0
- package/card/CardHeader.d.ts +3 -0
- package/card/CardHeader.js +13 -0
- package/card/index.d.ts +2 -0
- package/card/index.js +1 -0
- package/card/types.d.ts +17 -0
- package/card/types.js +1 -0
- package/card/vars.d.ts +12 -0
- package/card/vars.js +12 -0
- package/cascader/Cascader.d.ts +5 -0
- package/cascader/Cascader.js +487 -0
- package/cascader/index.d.ts +2 -0
- package/cascader/index.js +1 -0
- package/cascader/internal/CascaderPanel.d.ts +23 -0
- package/cascader/internal/CascaderPanel.js +135 -0
- package/cascader/internal/CascaderSearchPanel.d.ts +22 -0
- package/cascader/internal/CascaderSearchPanel.js +73 -0
- package/cascader/internal/types.d.ts +8 -0
- package/cascader/internal/types.js +1 -0
- package/cascader/types.d.ts +49 -0
- package/cascader/types.js +1 -0
- package/cascader/vars.d.ts +32 -0
- package/cascader/vars.js +32 -0
- package/checkbox/Checkbox.d.ts +7 -0
- package/checkbox/Checkbox.js +25 -0
- package/checkbox/CheckboxGroup.d.ts +3 -0
- package/checkbox/CheckboxGroup.js +25 -0
- package/checkbox/index.d.ts +2 -0
- package/checkbox/index.js +1 -0
- package/checkbox/types.d.ts +29 -0
- package/checkbox/types.js +1 -0
- package/checkbox/vars.d.ts +11 -0
- package/checkbox/vars.js +11 -0
- package/compose/Compose.d.ts +7 -0
- package/compose/Compose.js +24 -0
- package/compose/ComposeItem.d.ts +3 -0
- package/compose/ComposeItem.js +18 -0
- package/compose/index.d.ts +2 -0
- package/compose/index.js +1 -0
- package/compose/types.d.ts +12 -0
- package/compose/types.js +1 -0
- package/compose/vars.d.ts +10 -0
- package/compose/vars.js +10 -0
- package/config-provider/ConfigProvider.d.ts +3 -0
- package/config-provider/ConfigProvider.js +14 -0
- package/config-provider/index.d.ts +2 -0
- package/config-provider/index.js +1 -0
- package/config-provider/types.d.ts +7 -0
- package/config-provider/types.js +1 -0
- package/context/index.d.ts +33 -0
- package/context/index.js +106 -0
- package/context/props.d.ts +134 -0
- package/context/props.js +1 -0
- package/date-picker/DatePicker.d.ts +3 -0
- package/date-picker/DatePicker.js +376 -0
- package/date-picker/index.d.ts +2 -0
- package/date-picker/index.js +1 -0
- package/date-picker/internal/DatePickerPanel.d.ts +15 -0
- package/date-picker/internal/DatePickerPanel.js +104 -0
- package/date-picker/types.d.ts +37 -0
- package/date-picker/types.js +1 -0
- package/date-picker/vars.d.ts +36 -0
- package/date-picker/vars.js +36 -0
- package/dayjs.d.ts +3 -0
- package/dayjs.js +11 -0
- package/drawer/Drawer.d.ts +9 -0
- package/drawer/Drawer.js +141 -0
- package/drawer/DrawerFooter.d.ts +3 -0
- package/drawer/DrawerFooter.js +51 -0
- package/drawer/DrawerHeader.d.ts +3 -0
- package/drawer/DrawerHeader.js +37 -0
- package/drawer/index.d.ts +2 -0
- package/drawer/index.js +1 -0
- package/drawer/types.d.ts +36 -0
- package/drawer/types.js +1 -0
- package/drawer/vars.d.ts +21 -0
- package/drawer/vars.js +18 -0
- package/dropdown/Dropdown.d.ts +5 -0
- package/dropdown/Dropdown.js +376 -0
- package/dropdown/index.d.ts +2 -0
- package/dropdown/index.js +1 -0
- package/dropdown/internal/DropdownGroup.d.ts +13 -0
- package/dropdown/internal/DropdownGroup.js +8 -0
- package/dropdown/internal/DropdownItem.d.ts +16 -0
- package/dropdown/internal/DropdownItem.js +9 -0
- package/dropdown/internal/DropdownSub.d.ts +22 -0
- package/dropdown/internal/DropdownSub.js +78 -0
- package/dropdown/types.d.ts +31 -0
- package/dropdown/types.js +1 -0
- package/dropdown/utils.d.ts +4 -0
- package/dropdown/utils.js +18 -0
- package/dropdown/vars.d.ts +23 -0
- package/dropdown/vars.js +23 -0
- package/empty/Empty.d.ts +7 -0
- package/empty/Empty.js +18 -0
- package/empty/index.d.ts +2 -0
- package/empty/index.js +1 -0
- package/empty/types.d.ts +8 -0
- package/empty/types.js +1 -0
- package/empty/vars.d.ts +7 -0
- package/empty/vars.js +7 -0
- package/fab/Fab.d.ts +9 -0
- package/fab/Fab.js +31 -0
- package/fab/FabBacktop.d.ts +3 -0
- package/fab/FabBacktop.js +58 -0
- package/fab/FabButton.d.ts +3 -0
- package/fab/FabButton.js +23 -0
- package/fab/index.d.ts +2 -0
- package/fab/index.js +1 -0
- package/fab/types.d.ts +26 -0
- package/fab/types.js +1 -0
- package/fab/vars.d.ts +28 -0
- package/fab/vars.js +28 -0
- package/form/Form.d.ts +7 -0
- package/form/Form.js +34 -0
- package/form/FormItem.d.ts +5 -0
- package/form/FormItem.js +201 -0
- package/form/hooks.d.ts +5 -0
- package/form/hooks.js +18 -0
- package/form/index.d.ts +8 -0
- package/form/index.js +7 -0
- package/form/internal/FormError.d.ts +12 -0
- package/form/internal/FormError.js +24 -0
- package/form/model/abstract-control.d.ts +67 -0
- package/form/model/abstract-control.js +335 -0
- package/form/model/form-control.d.ts +23 -0
- package/form/model/form-control.js +72 -0
- package/form/model/form-group.d.ts +62 -0
- package/form/model/form-group.js +165 -0
- package/form/model/types.d.ts +8 -0
- package/form/model/types.js +1 -0
- package/form/model/validators.d.ts +11 -0
- package/form/model/validators.js +83 -0
- package/form/model/vars.d.ts +1 -0
- package/form/model/vars.js +1 -0
- package/form/types.d.ts +63 -0
- package/form/types.js +1 -0
- package/form/vars.d.ts +27 -0
- package/form/vars.js +25 -0
- package/hooks/index.d.ts +14 -0
- package/hooks/index.js +14 -0
- package/hooks/useComponentProps.d.ts +2 -0
- package/hooks/useComponentProps.js +15 -0
- package/hooks/useControlled.d.ts +3 -0
- package/hooks/useControlled.js +26 -0
- package/hooks/useDesign.d.ts +12 -0
- package/hooks/useDesign.js +8 -0
- package/hooks/useFocusVisible.d.ts +2 -0
- package/hooks/useFocusVisible.js +38 -0
- package/hooks/useLayout.d.ts +5 -0
- package/hooks/useLayout.js +10 -0
- package/hooks/useListenGlobalScrolling.d.ts +1 -0
- package/hooks/useListenGlobalScrolling.js +9 -0
- package/hooks/useLockScroll.d.ts +1 -0
- package/hooks/useLockScroll.js +24 -0
- package/hooks/useMaxIndex.d.ts +1 -0
- package/hooks/useMaxIndex.js +32 -0
- package/hooks/useNamespace.d.ts +1 -0
- package/hooks/useNamespace.js +6 -0
- package/hooks/useNestedPopup.d.ts +13 -0
- package/hooks/useNestedPopup.js +37 -0
- package/hooks/useNextTick.d.ts +2 -0
- package/hooks/useNextTick.js +9 -0
- package/hooks/useScopedProps.d.ts +8 -0
- package/hooks/useScopedProps.js +7 -0
- package/hooks/useStyled.d.ts +20 -0
- package/hooks/useStyled.js +82 -0
- package/hooks/useTranslation.d.ts +4 -0
- package/hooks/useTranslation.js +17 -0
- package/icon/Icon.d.ts +3 -0
- package/icon/Icon.js +18 -0
- package/icon/index.d.ts +2 -0
- package/icon/index.js +1 -0
- package/icon/types.d.ts +12 -0
- package/icon/types.js +1 -0
- package/icon/vars.d.ts +7 -0
- package/icon/vars.js +7 -0
- package/image/Image.d.ts +9 -0
- package/image/Image.js +50 -0
- package/image/ImageAction.d.ts +3 -0
- package/image/ImageAction.js +15 -0
- package/image/ImagePreview.d.ts +3 -0
- package/image/ImagePreview.js +261 -0
- package/image/index.d.ts +2 -0
- package/image/index.js +1 -0
- package/image/types.d.ts +24 -0
- package/image/types.js +1 -0
- package/image/vars.d.ts +26 -0
- package/image/vars.js +26 -0
- package/index.d.ts +52 -0
- package/index.js +52 -0
- package/input/Input.d.ts +7 -0
- package/input/Input.js +56 -0
- package/input/InputNumber.d.ts +2 -0
- package/input/InputNumber.js +142 -0
- package/input/index.d.ts +2 -0
- package/input/index.js +1 -0
- package/input/types.d.ts +44 -0
- package/input/types.js +1 -0
- package/input/vars.d.ts +14 -0
- package/input/vars.js +14 -0
- package/internal/circular-progress/CircularProgress.d.ts +2 -0
- package/internal/circular-progress/CircularProgress.js +11 -0
- package/internal/circular-progress/index.d.ts +1 -0
- package/internal/circular-progress/index.js +1 -0
- package/internal/circular-progress/vars.d.ts +4 -0
- package/internal/circular-progress/vars.js +4 -0
- package/internal/mask/Mask.d.ts +3 -0
- package/internal/mask/Mask.js +36 -0
- package/internal/mask/index.d.ts +2 -0
- package/internal/mask/index.js +1 -0
- package/internal/mask/types.d.ts +7 -0
- package/internal/mask/types.js +1 -0
- package/internal/mask/vars.d.ts +3 -0
- package/internal/mask/vars.js +3 -0
- package/internal/popup/Popup.d.ts +3 -0
- package/internal/popup/Popup.js +132 -0
- package/internal/popup/index.d.ts +2 -0
- package/internal/popup/index.js +1 -0
- package/internal/popup/types.d.ts +21 -0
- package/internal/popup/types.js +1 -0
- package/internal/portal/Portal.d.ts +3 -0
- package/internal/portal/Portal.js +14 -0
- package/internal/portal/index.d.ts +2 -0
- package/internal/portal/index.js +1 -0
- package/internal/portal/types.d.ts +6 -0
- package/internal/portal/types.js +1 -0
- package/internal/transition/CollapseTransition.d.ts +3 -0
- package/internal/transition/CollapseTransition.js +101 -0
- package/internal/transition/Transition.d.ts +3 -0
- package/internal/transition/Transition.js +87 -0
- package/internal/transition/index.d.ts +3 -0
- package/internal/transition/index.js +2 -0
- package/internal/transition/types.d.ts +33 -0
- package/internal/transition/types.js +1 -0
- package/internal/wave/Wave.d.ts +3 -0
- package/internal/wave/Wave.js +25 -0
- package/internal/wave/index.d.ts +2 -0
- package/internal/wave/index.js +1 -0
- package/internal/wave/types.d.ts +6 -0
- package/internal/wave/types.js +1 -0
- package/internal/wave/vars.d.ts +3 -0
- package/internal/wave/vars.js +3 -0
- package/menu/Menu.d.ts +5 -0
- package/menu/Menu.js +386 -0
- package/menu/index.d.ts +2 -0
- package/menu/index.js +1 -0
- package/menu/internal/MenuGroup.d.ts +15 -0
- package/menu/internal/MenuGroup.js +8 -0
- package/menu/internal/MenuItem.d.ts +23 -0
- package/menu/internal/MenuItem.js +18 -0
- package/menu/internal/MenuSub.d.ts +31 -0
- package/menu/internal/MenuSub.js +129 -0
- package/menu/types.d.ts +30 -0
- package/menu/types.js +1 -0
- package/menu/utils.d.ts +4 -0
- package/menu/utils.js +18 -0
- package/menu/vars.d.ts +28 -0
- package/menu/vars.js +28 -0
- package/modal/Modal.d.ts +11 -0
- package/modal/Modal.js +127 -0
- package/modal/ModalAlert.d.ts +3 -0
- package/modal/ModalAlert.js +19 -0
- package/modal/ModalFooter.d.ts +3 -0
- package/modal/ModalFooter.js +51 -0
- package/modal/ModalHeader.d.ts +3 -0
- package/modal/ModalHeader.js +37 -0
- package/modal/index.d.ts +2 -0
- package/modal/index.js +1 -0
- package/modal/types.d.ts +39 -0
- package/modal/types.js +1 -0
- package/modal/vars.d.ts +23 -0
- package/modal/vars.js +23 -0
- package/notification/Notification.d.ts +3 -0
- package/notification/Notification.js +129 -0
- package/notification/index.d.ts +2 -0
- package/notification/index.js +1 -0
- package/notification/types.d.ts +18 -0
- package/notification/types.js +1 -0
- package/notification/vars.d.ts +17 -0
- package/notification/vars.js +14 -0
- package/package.json +47 -0
- package/pagination/Pagination.d.ts +3 -0
- package/pagination/Pagination.js +191 -0
- package/pagination/index.d.ts +2 -0
- package/pagination/index.js +1 -0
- package/pagination/types.d.ts +23 -0
- package/pagination/types.js +1 -0
- package/pagination/utils.d.ts +2 -0
- package/pagination/utils.js +14 -0
- package/pagination/vars.d.ts +14 -0
- package/pagination/vars.js +14 -0
- package/popover/Popover.d.ts +9 -0
- package/popover/Popover.js +173 -0
- package/popover/PopoverFooter.d.ts +3 -0
- package/popover/PopoverFooter.js +51 -0
- package/popover/PopoverHeader.d.ts +3 -0
- package/popover/PopoverHeader.js +37 -0
- package/popover/index.d.ts +2 -0
- package/popover/index.js +1 -0
- package/popover/types.d.ts +46 -0
- package/popover/types.js +1 -0
- package/popover/vars.d.ts +30 -0
- package/popover/vars.js +27 -0
- package/progress/Progress.d.ts +3 -0
- package/progress/Progress.js +45 -0
- package/progress/index.d.ts +2 -0
- package/progress/index.js +1 -0
- package/progress/types.d.ts +19 -0
- package/progress/types.js +1 -0
- package/progress/vars.d.ts +15 -0
- package/progress/vars.js +15 -0
- package/radio/Radio.d.ts +7 -0
- package/radio/Radio.js +38 -0
- package/radio/RadioGroup.d.ts +3 -0
- package/radio/RadioGroup.js +21 -0
- package/radio/index.d.ts +2 -0
- package/radio/index.js +1 -0
- package/radio/types.d.ts +31 -0
- package/radio/types.js +1 -0
- package/radio/vars.d.ts +14 -0
- package/radio/vars.js +14 -0
- package/rating/Rating.d.ts +3 -0
- package/rating/Rating.js +34 -0
- package/rating/index.d.ts +2 -0
- package/rating/index.js +1 -0
- package/rating/internal/RatingStar.d.ts +19 -0
- package/rating/internal/RatingStar.js +37 -0
- package/rating/types.d.ts +18 -0
- package/rating/types.js +1 -0
- package/rating/vars.d.ts +11 -0
- package/rating/vars.js +11 -0
- package/resources.json +128 -0
- package/root/Root.d.ts +3 -0
- package/root/Root.js +85 -0
- package/root/dialog-service.d.ts +12 -0
- package/root/dialog-service.js +62 -0
- package/root/index.d.ts +3 -0
- package/root/index.js +2 -0
- package/root/types.d.ts +16 -0
- package/root/types.js +1 -0
- package/root/vars.d.ts +25 -0
- package/root/vars.js +13 -0
- package/select/Select.d.ts +5 -0
- package/select/Select.js +528 -0
- package/select/index.d.ts +2 -0
- package/select/index.js +1 -0
- package/select/types.d.ts +50 -0
- package/select/types.js +1 -0
- package/select/vars.d.ts +31 -0
- package/select/vars.js +31 -0
- package/separator/Separator.d.ts +3 -0
- package/separator/Separator.js +19 -0
- package/separator/index.d.ts +2 -0
- package/separator/index.js +1 -0
- package/separator/types.d.ts +8 -0
- package/separator/types.js +1 -0
- package/separator/vars.d.ts +9 -0
- package/separator/vars.js +9 -0
- package/skeleton/Skeleton.d.ts +3 -0
- package/skeleton/Skeleton.js +13 -0
- package/skeleton/index.d.ts +2 -0
- package/skeleton/index.js +1 -0
- package/skeleton/types.d.ts +7 -0
- package/skeleton/types.js +1 -0
- package/skeleton/vars.d.ts +6 -0
- package/skeleton/vars.js +6 -0
- package/slider/Slider.d.ts +3 -0
- package/slider/Slider.js +324 -0
- package/slider/index.d.ts +2 -0
- package/slider/index.js +1 -0
- package/slider/types.d.ts +28 -0
- package/slider/types.js +1 -0
- package/slider/vars.d.ts +17 -0
- package/slider/vars.js +17 -0
- package/slides/Slides.d.ts +3 -0
- package/slides/Slides.js +277 -0
- package/slides/index.d.ts +2 -0
- package/slides/index.js +1 -0
- package/slides/types.d.ts +29 -0
- package/slides/types.js +1 -0
- package/slides/vars.d.ts +20 -0
- package/slides/vars.js +20 -0
- package/spinner/Spinner.d.ts +3 -0
- package/spinner/Spinner.js +66 -0
- package/spinner/index.d.ts +2 -0
- package/spinner/index.js +1 -0
- package/spinner/types.d.ts +12 -0
- package/spinner/types.js +1 -0
- package/spinner/vars.d.ts +7 -0
- package/spinner/vars.js +7 -0
- package/stepper/Stepper.d.ts +3 -0
- package/stepper/Stepper.js +87 -0
- package/stepper/index.d.ts +2 -0
- package/stepper/index.js +1 -0
- package/stepper/types.d.ts +22 -0
- package/stepper/types.js +1 -0
- package/stepper/vars.d.ts +19 -0
- package/stepper/vars.js +19 -0
- package/switch/Switch.d.ts +2 -0
- package/switch/Switch.js +48 -0
- package/switch/index.d.ts +2 -0
- package/switch/index.js +1 -0
- package/switch/types.d.ts +18 -0
- package/switch/types.js +1 -0
- package/switch/vars.d.ts +17 -0
- package/switch/vars.js +17 -0
- package/table/Table.d.ts +17 -0
- package/table/Table.js +72 -0
- package/table/TableEmpty.d.ts +3 -0
- package/table/TableEmpty.js +37 -0
- package/table/TableExpand.d.ts +3 -0
- package/table/TableExpand.js +20 -0
- package/table/TableFilter.d.ts +3 -0
- package/table/TableFilter.js +22 -0
- package/table/TableTd.d.ts +3 -0
- package/table/TableTd.js +11 -0
- package/table/TableTh.d.ts +3 -0
- package/table/TableTh.js +33 -0
- package/table/TableThAction.d.ts +3 -0
- package/table/TableThAction.js +18 -0
- package/table/index.d.ts +2 -0
- package/table/index.js +1 -0
- package/table/internal/TableCell.d.ts +19 -0
- package/table/internal/TableCell.js +61 -0
- package/table/types.d.ts +73 -0
- package/table/types.js +1 -0
- package/table/vars.d.ts +29 -0
- package/table/vars.js +28 -0
- package/tabs/Tabs.d.ts +5 -0
- package/tabs/Tabs.js +248 -0
- package/tabs/index.d.ts +2 -0
- package/tabs/index.js +1 -0
- package/tabs/types.d.ts +28 -0
- package/tabs/types.js +1 -0
- package/tabs/vars.d.ts +30 -0
- package/tabs/vars.js +30 -0
- package/tag/Tag.d.ts +3 -0
- package/tag/Tag.js +16 -0
- package/tag/index.d.ts +2 -0
- package/tag/index.js +1 -0
- package/tag/types.d.ts +9 -0
- package/tag/types.js +1 -0
- package/tag/vars.d.ts +13 -0
- package/tag/vars.js +13 -0
- package/textarea/Textarea.d.ts +3 -0
- package/textarea/Textarea.js +72 -0
- package/textarea/index.d.ts +2 -0
- package/textarea/index.js +1 -0
- package/textarea/types.d.ts +18 -0
- package/textarea/types.js +1 -0
- package/textarea/vars.d.ts +7 -0
- package/textarea/vars.js +7 -0
- package/time-picker/TimePicker.d.ts +3 -0
- package/time-picker/TimePicker.js +338 -0
- package/time-picker/index.d.ts +2 -0
- package/time-picker/index.js +1 -0
- package/time-picker/internal/TimePickerPanel.d.ts +16 -0
- package/time-picker/internal/TimePickerPanel.js +138 -0
- package/time-picker/types.d.ts +33 -0
- package/time-picker/types.js +1 -0
- package/time-picker/utils.d.ts +4 -0
- package/time-picker/utils.js +26 -0
- package/time-picker/vars.d.ts +20 -0
- package/time-picker/vars.js +20 -0
- package/timeline/Timeline.d.ts +3 -0
- package/timeline/Timeline.js +53 -0
- package/timeline/index.d.ts +2 -0
- package/timeline/index.js +1 -0
- package/timeline/types.d.ts +15 -0
- package/timeline/types.js +1 -0
- package/timeline/vars.d.ts +19 -0
- package/timeline/vars.js +19 -0
- package/toast/Toast.d.ts +3 -0
- package/toast/Toast.js +123 -0
- package/toast/index.d.ts +2 -0
- package/toast/index.js +1 -0
- package/toast/types.d.ts +17 -0
- package/toast/types.js +1 -0
- package/toast/vars.d.ts +14 -0
- package/toast/vars.js +11 -0
- package/tooltip/Tooltip.d.ts +3 -0
- package/tooltip/Tooltip.js +113 -0
- package/tooltip/index.d.ts +2 -0
- package/tooltip/index.js +1 -0
- package/tooltip/types.d.ts +29 -0
- package/tooltip/types.js +1 -0
- package/tooltip/vars.d.ts +20 -0
- package/tooltip/vars.js +17 -0
- package/transfer/Transfer.d.ts +3 -0
- package/transfer/Transfer.js +156 -0
- package/transfer/index.d.ts +2 -0
- package/transfer/index.js +1 -0
- package/transfer/internal/TransferPanel.d.ts +21 -0
- package/transfer/internal/TransferPanel.js +42 -0
- package/transfer/types.d.ts +34 -0
- package/transfer/types.js +1 -0
- package/transfer/vars.d.ts +17 -0
- package/transfer/vars.js +17 -0
- package/tree/Tree.d.ts +3 -0
- package/tree/Tree.js +165 -0
- package/tree/index.d.ts +2 -0
- package/tree/index.js +1 -0
- package/tree/internal/TreePanel.d.ts +32 -0
- package/tree/internal/TreePanel.js +167 -0
- package/tree/node/abstract-node.d.ts +25 -0
- package/tree/node/abstract-node.js +68 -0
- package/tree/node/multiple-node.d.ts +18 -0
- package/tree/node/multiple-node.js +109 -0
- package/tree/node/single-node.d.ts +16 -0
- package/tree/node/single-node.js +60 -0
- package/tree/node/types.d.ts +6 -0
- package/tree/node/types.js +1 -0
- package/tree/node/vars.d.ts +2 -0
- package/tree/node/vars.js +1 -0
- package/tree/types.d.ts +34 -0
- package/tree/types.js +1 -0
- package/tree/utils.d.ts +6 -0
- package/tree/utils.js +9 -0
- package/tree/vars.d.ts +20 -0
- package/tree/vars.js +20 -0
- package/tree-select/TreeSelect.d.ts +6 -0
- package/tree-select/TreeSelect.js +509 -0
- package/tree-select/index.d.ts +2 -0
- package/tree-select/index.js +1 -0
- package/tree-select/internal/TreeSelectSearchPanel.d.ts +22 -0
- package/tree-select/internal/TreeSelectSearchPanel.js +73 -0
- package/tree-select/internal/types.d.ts +8 -0
- package/tree-select/internal/types.js +1 -0
- package/tree-select/types.d.ts +48 -0
- package/tree-select/types.js +1 -0
- package/tree-select/vars.d.ts +37 -0
- package/tree-select/vars.js +37 -0
- package/types.d.ts +21 -0
- package/types.js +1 -0
- package/upload/Upload.d.ts +19 -0
- package/upload/Upload.js +203 -0
- package/upload/UploadAction.d.ts +3 -0
- package/upload/UploadAction.js +44 -0
- package/upload/UploadButton.d.ts +3 -0
- package/upload/UploadButton.js +31 -0
- package/upload/UploadList.d.ts +3 -0
- package/upload/UploadList.js +62 -0
- package/upload/UploadPicture.d.ts +3 -0
- package/upload/UploadPicture.js +72 -0
- package/upload/UploadPictureList.d.ts +3 -0
- package/upload/UploadPictureList.js +62 -0
- package/upload/UploadPreviewAction.d.ts +3 -0
- package/upload/UploadPreviewAction.js +32 -0
- package/upload/index.d.ts +2 -0
- package/upload/index.js +1 -0
- package/upload/types.d.ts +78 -0
- package/upload/types.js +1 -0
- package/upload/vars.d.ts +65 -0
- package/upload/vars.js +65 -0
- package/utils/handleModalKeyDown.d.ts +2 -0
- package/utils/handleModalKeyDown.js +17 -0
- package/utils/index.d.ts +6 -0
- package/utils/index.js +6 -0
- package/utils/isPrintableCharacter.d.ts +1 -0
- package/utils/isPrintableCharacter.js +3 -0
- package/utils/mergeCS.d.ts +11 -0
- package/utils/mergeCS.js +6 -0
- package/utils/position/getHorizontalSidePosition.d.ts +14 -0
- package/utils/position/getHorizontalSidePosition.js +22 -0
- package/utils/position/getPopupPosition.d.ts +18 -0
- package/utils/position/getPopupPosition.js +170 -0
- package/utils/position/getVerticalSidePosition.d.ts +17 -0
- package/utils/position/getVerticalSidePosition.js +43 -0
- package/vars.d.ts +5 -0
- package/vars.js +5 -0
- package/virtual-scroll/VirtualScroll.d.ts +5 -0
- package/virtual-scroll/VirtualScroll.js +430 -0
- package/virtual-scroll/index.d.ts +2 -0
- package/virtual-scroll/index.js +1 -0
- package/virtual-scroll/types.d.ts +34 -0
- package/virtual-scroll/types.js +1 -0
- package/virtual-scroll/vars.d.ts +1 -0
- package/virtual-scroll/vars.js +1 -0
package/empty/Empty.d.ts
ADDED
package/empty/Empty.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { checkNodeExist } from '@laser-ui/utils';
|
|
4
|
+
import { isUndefined } from 'lodash';
|
|
5
|
+
import { CLASSES, SIMPLE_IMG } from './vars';
|
|
6
|
+
import { useComponentProps, useStyled, useTranslation } from '../hooks';
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
|
+
import { mergeCS } from '../utils';
|
|
9
|
+
export const Empty = (props) => {
|
|
10
|
+
const _a = useComponentProps('Empty', props), { children, styleOverrides, styleProvider, image, description } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "image", "description"]);
|
|
11
|
+
const styled = useStyled(CLASSES, { empty: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.empty }, styleOverrides);
|
|
12
|
+
const { t } = useTranslation();
|
|
13
|
+
return (_jsxs("div", Object.assign({}, restProps, mergeCS(styled('empty'), {
|
|
14
|
+
className: restProps.className,
|
|
15
|
+
style: restProps.style,
|
|
16
|
+
}), { children: [(isUndefined(image) || image === SIMPLE_IMG || checkNodeExist(image)) && (_jsx("div", Object.assign({}, styled('empty__img'), { children: isUndefined(image) ? (_jsx(Icon, { size: [115, 95], children: _jsx("svg", { viewBox: "0 0 184 152", xmlns: "http://www.w3.org/2000/svg", children: _jsxs("g", { fill: "none", fillRule: "evenodd", children: [_jsxs("g", { transform: "translate(24 31.67)", children: [_jsx("ellipse", { fillOpacity: ".8", fill: "#F5F5F7", cx: "67.797", cy: "106.89", rx: "67.797", ry: "12.668" }), _jsx("path", { d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z", fill: "#AEB8C2" }), _jsx("path", { d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z", fill: "url(#linearGradient-1)", transform: "translate(13.56)" }), _jsx("path", { d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z", fill: "#F5F5F7" }), _jsx("path", { d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z", fill: "#DCE0E6" })] }), _jsx("path", { d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z", fill: "#DCE0E6" }), _jsxs("g", { transform: "translate(149.65 15.383)", fill: "#FFF", children: [_jsx("ellipse", { cx: "20.654", cy: "3.167", rx: "2.849", ry: "2.815" }), _jsx("path", { d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z" })] })] }) }) })) : image === SIMPLE_IMG ? (_jsx(Icon, { size: [64, 41], children: _jsx("svg", { viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: _jsxs("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [_jsx("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }), _jsxs("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [_jsx("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }), _jsx("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })] })] }) }) })) : (image) }))), (isUndefined(description) || checkNodeExist(description)) && (_jsx("div", Object.assign({}, styled('empty__description'), { children: isUndefined(description) ? t('No Data') : description }))), checkNodeExist(children) && _jsx("div", Object.assign({}, styled('empty__footer'), { children: children }))] })));
|
|
17
|
+
};
|
|
18
|
+
Empty.SIMPLE_IMG = SIMPLE_IMG;
|
package/empty/index.d.ts
ADDED
package/empty/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Empty } from './Empty';
|
package/empty/types.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CLASSES, SIMPLE_IMG } from './vars';
|
|
3
|
+
import type { BaseProps } from '../types';
|
|
4
|
+
export {};
|
|
5
|
+
export interface EmptyProps extends BaseProps<'empty', typeof CLASSES>, React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
image?: React.ReactNode | typeof SIMPLE_IMG;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
}
|
package/empty/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/empty/vars.d.ts
ADDED
package/empty/vars.js
ADDED
package/fab/Fab.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FabProps } from './types';
|
|
3
|
+
import { FabBacktop } from './FabBacktop';
|
|
4
|
+
import { FabButton } from './FabButton';
|
|
5
|
+
export declare const Fab: {
|
|
6
|
+
(props: FabProps): JSX.Element | null;
|
|
7
|
+
Button: typeof FabButton;
|
|
8
|
+
Backtop: typeof FabBacktop;
|
|
9
|
+
};
|
package/fab/Fab.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Children, cloneElement } from 'react';
|
|
4
|
+
import { FabBacktop } from './FabBacktop';
|
|
5
|
+
import { FabButton } from './FabButton';
|
|
6
|
+
import { CLASSES } from './vars';
|
|
7
|
+
import { useComponentProps, useControlled, useStyled } from '../hooks';
|
|
8
|
+
import { mergeCS } from '../utils';
|
|
9
|
+
export const Fab = (props) => {
|
|
10
|
+
const _a = useComponentProps('Fab', props), { children, styleOverrides, styleProvider, expand: expandProp, defaultExpand, list, onExpandChange } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "expand", "defaultExpand", "list", "onExpandChange"]);
|
|
11
|
+
const styled = useStyled(CLASSES, { fab: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.fab }, styleOverrides);
|
|
12
|
+
const [expand, changeExpand] = useControlled(defaultExpand !== null && defaultExpand !== void 0 ? defaultExpand : false, expandProp, onExpandChange);
|
|
13
|
+
return (_jsxs("div", Object.assign({}, restProps, mergeCS(styled('fab'), {
|
|
14
|
+
className: restProps.className,
|
|
15
|
+
style: restProps.style,
|
|
16
|
+
}), { children: [cloneElement(children, Object.assign({ _expand: expand }, { onClick: (e) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
(_b = (_a = children.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
19
|
+
if (list) {
|
|
20
|
+
changeExpand((draft) => !draft);
|
|
21
|
+
}
|
|
22
|
+
} })), expand &&
|
|
23
|
+
list &&
|
|
24
|
+
list.map(({ placement, actions }, key) => (_jsx("div", Object.assign({}, styled('fab__actions', `fab__actions--${placement}`), { children: Children.map(actions, (action, index) => cloneElement(action, Object.assign({ _action: true }, { style: Object.assign(Object.assign({}, action.props.style), { animationDelay: `${index * 33}ms` }), onClick: (e) => {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
(_b = (_a = action.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
27
|
+
changeExpand(false);
|
|
28
|
+
} }))) }), key)))] })));
|
|
29
|
+
};
|
|
30
|
+
Fab.Button = FabButton;
|
|
31
|
+
Fab.Backtop = FabBacktop;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEvent, useIsomorphicLayoutEffect, useRefExtra, useResize } from '@laser-ui/hooks';
|
|
4
|
+
import { scrollTo, toPx } from '@laser-ui/utils';
|
|
5
|
+
import { ReactComponent as VerticalAlignTopOutlined } from '@material-design-icons/svg/outlined/vertical_align_top.svg';
|
|
6
|
+
import { isString } from 'lodash';
|
|
7
|
+
import { cloneElement, useRef, useState } from 'react';
|
|
8
|
+
import { FabButton } from './FabButton';
|
|
9
|
+
import { useComponentProps, useLayout, useListenGlobalScrolling } from '../hooks';
|
|
10
|
+
import { Icon } from '../icon';
|
|
11
|
+
import { Transition } from '../internal/transition';
|
|
12
|
+
import { TTANSITION_DURING_BASE } from '../vars';
|
|
13
|
+
export function FabBacktop(props) {
|
|
14
|
+
const _a = useComponentProps('FabBacktop', props), { children, page, distance: distanceProp = 400, scrollBehavior = 'instant' } = _a, restProps = __rest(_a, ["children", "page", "distance", "scrollBehavior"]);
|
|
15
|
+
const { pageScrollRef, contentResizeRef } = useLayout();
|
|
16
|
+
const pageRef = useRefExtra(page !== null && page !== void 0 ? page : (() => pageScrollRef.current));
|
|
17
|
+
const dataRef = useRef({});
|
|
18
|
+
const [visible, setVisible] = useState(false);
|
|
19
|
+
const transitionStyles = {
|
|
20
|
+
enter: { opacity: 0 },
|
|
21
|
+
entering: {
|
|
22
|
+
transition: ['opacity'].map((attr) => `${attr} ${TTANSITION_DURING_BASE}ms linear`).join(', '),
|
|
23
|
+
},
|
|
24
|
+
leaving: {
|
|
25
|
+
opacity: 0,
|
|
26
|
+
transition: ['opacity'].map((attr) => `${attr} ${TTANSITION_DURING_BASE}ms linear`).join(', '),
|
|
27
|
+
},
|
|
28
|
+
leaved: { display: 'none' },
|
|
29
|
+
};
|
|
30
|
+
const updateBackTop = () => {
|
|
31
|
+
if (pageRef.current) {
|
|
32
|
+
const distance = isString(distanceProp) ? toPx(distanceProp, true) : distanceProp;
|
|
33
|
+
setVisible(Math.ceil(pageRef.current.scrollTop) >= distance);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
useIsomorphicLayoutEffect(() => {
|
|
37
|
+
updateBackTop();
|
|
38
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39
|
+
}, []);
|
|
40
|
+
const listenGlobalScrolling = useListenGlobalScrolling(updateBackTop);
|
|
41
|
+
useEvent(pageRef, 'scroll', updateBackTop, { passive: true }, listenGlobalScrolling);
|
|
42
|
+
useResize(contentResizeRef, updateBackTop);
|
|
43
|
+
const node = (_jsx(FabButton, Object.assign({}, restProps, { children: children !== null && children !== void 0 ? children : (_jsx(Icon, { children: _jsx(VerticalAlignTopOutlined, {}) })) })));
|
|
44
|
+
return (_jsx(Transition, { enter: visible, during: TTANSITION_DURING_BASE, children: (state) => cloneElement(node, {
|
|
45
|
+
style: Object.assign(Object.assign({}, node.props.style), transitionStyles[state]),
|
|
46
|
+
onClick: (e) => {
|
|
47
|
+
var _a, _b, _c, _d;
|
|
48
|
+
(_b = (_a = node.props).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
|
49
|
+
if (pageRef.current) {
|
|
50
|
+
(_d = (_c = dataRef.current).clearTid) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
51
|
+
dataRef.current.clearTid = scrollTo(pageRef.current, {
|
|
52
|
+
top: 0,
|
|
53
|
+
behavior: scrollBehavior,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
}) }));
|
|
58
|
+
}
|
package/fab/FabButton.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ReactComponent as AddOutlined } from '@material-design-icons/svg/outlined/add.svg';
|
|
4
|
+
import { forwardRef } from 'react';
|
|
5
|
+
import { BUTTON_CLASSES } from './vars';
|
|
6
|
+
import { useComponentProps, useStyled } from '../hooks';
|
|
7
|
+
import { Icon } from '../icon';
|
|
8
|
+
import { CircularProgress } from '../internal/circular-progress';
|
|
9
|
+
import { mergeCS } from '../utils';
|
|
10
|
+
export const FabButton = forwardRef((props, ref) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const _b = useComponentProps('FabButton', props), { children, styleOverrides, styleProvider, pattern = 'primary', theme = 'primary', loading = false, shape, _expand = false, _action = false } = _b, restProps = __rest(_b, ["children", "styleOverrides", "styleProvider", "pattern", "theme", "loading", "shape", "_expand", "_action"]);
|
|
13
|
+
const styled = useStyled(BUTTON_CLASSES, { 'fab-button': styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider['fab-button'] }, styleOverrides);
|
|
14
|
+
return (_jsxs("button", Object.assign({}, restProps, mergeCS(styled('fab-button', `fab-button.t-${theme}`, `fab-button--${pattern}`, {
|
|
15
|
+
'fab-button.is-expand': _expand,
|
|
16
|
+
'fab-button.is-loading': loading,
|
|
17
|
+
'fab-button--in-actions': _action,
|
|
18
|
+
[`fab-button--${shape}`]: shape,
|
|
19
|
+
}), {
|
|
20
|
+
className: restProps.className,
|
|
21
|
+
style: restProps.style,
|
|
22
|
+
}), { ref: ref, type: (_a = restProps.type) !== null && _a !== void 0 ? _a : 'button', children: [_jsx(Icon, Object.assign({}, styled('fab-button__icon'), { children: _jsx(AddOutlined, {}) })), _jsx("div", Object.assign({}, styled('fab-button__content'), { children: loading ? (_jsx(Icon, { children: _jsx(CircularProgress, {}) })) : (children) }))] })));
|
|
23
|
+
});
|
package/fab/index.d.ts
ADDED
package/fab/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Fab } from './Fab';
|
package/fab/types.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { BUTTON_CLASSES, CLASSES } from './vars';
|
|
3
|
+
import type { BaseProps } from '../types';
|
|
4
|
+
import type { RefExtra } from '@laser-ui/hooks/useRefExtra';
|
|
5
|
+
export {};
|
|
6
|
+
export interface FabProps extends BaseProps<'fab', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
7
|
+
children: React.ReactElement;
|
|
8
|
+
expand?: boolean;
|
|
9
|
+
defaultExpand?: boolean;
|
|
10
|
+
list: {
|
|
11
|
+
placement: 'top' | 'right' | 'bottom' | 'left';
|
|
12
|
+
actions: React.ReactElement[];
|
|
13
|
+
}[];
|
|
14
|
+
onExpandChange?: (expand: boolean) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface FabButtonProps extends BaseProps<'fab-button', typeof BUTTON_CLASSES>, React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
17
|
+
pattern?: 'primary' | 'secondary' | 'outline' | 'dashed' | 'text' | 'link';
|
|
18
|
+
theme?: 'primary' | 'success' | 'warning' | 'danger';
|
|
19
|
+
loading?: boolean;
|
|
20
|
+
shape?: 'circle' | 'round';
|
|
21
|
+
}
|
|
22
|
+
export interface FabBacktopProps extends FabButtonProps {
|
|
23
|
+
page?: RefExtra;
|
|
24
|
+
distance?: number | string;
|
|
25
|
+
scrollBehavior?: 'instant' | 'smooth';
|
|
26
|
+
}
|
package/fab/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/fab/vars.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const CLASSES: {
|
|
2
|
+
fab: string;
|
|
3
|
+
fab__actions: string;
|
|
4
|
+
'fab__actions--top': string;
|
|
5
|
+
'fab__actions--right': string;
|
|
6
|
+
'fab__actions--bottom': string;
|
|
7
|
+
'fab__actions--left': string;
|
|
8
|
+
};
|
|
9
|
+
export declare const BUTTON_CLASSES: {
|
|
10
|
+
'fab-button': string;
|
|
11
|
+
'fab-button.t-primary': string;
|
|
12
|
+
'fab-button.t-success': string;
|
|
13
|
+
'fab-button.t-warning': string;
|
|
14
|
+
'fab-button.t-danger': string;
|
|
15
|
+
'fab-button.is-expand': string;
|
|
16
|
+
'fab-button.is-loading': string;
|
|
17
|
+
'fab-button--in-actions': string;
|
|
18
|
+
'fab-button--primary': string;
|
|
19
|
+
'fab-button--secondary': string;
|
|
20
|
+
'fab-button--outline': string;
|
|
21
|
+
'fab-button--dashed': string;
|
|
22
|
+
'fab-button--text': string;
|
|
23
|
+
'fab-button--link': string;
|
|
24
|
+
'fab-button--circle': string;
|
|
25
|
+
'fab-button--round': string;
|
|
26
|
+
'fab-button__icon': string;
|
|
27
|
+
'fab-button__content': string;
|
|
28
|
+
};
|
package/fab/vars.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const CLASSES = {
|
|
2
|
+
fab: '^fab',
|
|
3
|
+
fab__actions: '^fab__actions',
|
|
4
|
+
'fab__actions--top': '^fab__actions--top',
|
|
5
|
+
'fab__actions--right': '^fab__actions--right',
|
|
6
|
+
'fab__actions--bottom': '^fab__actions--bottom',
|
|
7
|
+
'fab__actions--left': '^fab__actions--left',
|
|
8
|
+
};
|
|
9
|
+
export const BUTTON_CLASSES = {
|
|
10
|
+
'fab-button': '^fab-button',
|
|
11
|
+
'fab-button.t-primary': 't-primary',
|
|
12
|
+
'fab-button.t-success': 't-success',
|
|
13
|
+
'fab-button.t-warning': 't-warning',
|
|
14
|
+
'fab-button.t-danger': 't-danger',
|
|
15
|
+
'fab-button.is-expand': 'is-expand',
|
|
16
|
+
'fab-button.is-loading': 'is-loading',
|
|
17
|
+
'fab-button--in-actions': '^fab-button--in-actions',
|
|
18
|
+
'fab-button--primary': '^fab-button--primary',
|
|
19
|
+
'fab-button--secondary': '^fab-button--secondary',
|
|
20
|
+
'fab-button--outline': '^fab-button--outline',
|
|
21
|
+
'fab-button--dashed': '^fab-button--dashed',
|
|
22
|
+
'fab-button--text': '^fab-button--text',
|
|
23
|
+
'fab-button--link': '^fab-button--link',
|
|
24
|
+
'fab-button--circle': '^fab-button--circle',
|
|
25
|
+
'fab-button--round': '^fab-button--round',
|
|
26
|
+
'fab-button__icon': '^fab-button__icon',
|
|
27
|
+
'fab-button__content': '^fab-button__content',
|
|
28
|
+
};
|
package/form/Form.d.ts
ADDED
package/form/Form.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { FormItem } from './FormItem';
|
|
5
|
+
import { CLASSES, FormContext } from './vars';
|
|
6
|
+
import { ConfigProvider } from '../config-provider';
|
|
7
|
+
import { useComponentProps, useScopedProps, useStyled } from '../hooks';
|
|
8
|
+
import { mergeCS } from '../utils';
|
|
9
|
+
export const Form = (props) => {
|
|
10
|
+
const _a = useComponentProps('Form', props), { children, styleOverrides, styleProvider, vertical = false, labelWidth, labelColon, requiredType = 'required', feedbackIcon = false, size: sizeProp } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "vertical", "labelWidth", "labelColon", "requiredType", "feedbackIcon", "size"]);
|
|
11
|
+
const styled = useStyled(CLASSES, { form: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.form }, styleOverrides);
|
|
12
|
+
const formRef = useRef(null);
|
|
13
|
+
const { size } = useScopedProps({ size: sizeProp });
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
if (formRef.current) {
|
|
16
|
+
let maxWidth = 0;
|
|
17
|
+
formRef.current.querySelectorAll('[data-l-form-label]').forEach((el) => {
|
|
18
|
+
maxWidth = Math.max(el.offsetWidth, maxWidth);
|
|
19
|
+
});
|
|
20
|
+
formRef.current.style.setProperty('--label-width', `${maxWidth}px`);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
return (_jsx("form", Object.assign({}, restProps, mergeCS(styled('form', `form--${size}`), {
|
|
24
|
+
className: restProps.className,
|
|
25
|
+
style: restProps.style,
|
|
26
|
+
}), { ref: formRef, children: _jsx(ConfigProvider, { context: { componentSize: size }, children: _jsx(FormContext.Provider, { value: {
|
|
27
|
+
vertical,
|
|
28
|
+
labelWidth: labelWidth !== null && labelWidth !== void 0 ? labelWidth : (vertical ? undefined : 'auto'),
|
|
29
|
+
labelColon: labelColon !== null && labelColon !== void 0 ? labelColon : !vertical,
|
|
30
|
+
requiredType,
|
|
31
|
+
feedbackIcon,
|
|
32
|
+
}, children: _jsx("div", Object.assign({}, styled('form__row'), { children: children })) }) }) })));
|
|
33
|
+
};
|
|
34
|
+
Form.Item = FormItem;
|
package/form/FormItem.js
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
|
|
4
|
+
import { ReactComponent as CheckCircleFilled } from '@material-design-icons/svg/filled/check_circle.svg';
|
|
5
|
+
import { ReactComponent as ErrorFilled } from '@material-design-icons/svg/filled/error.svg';
|
|
6
|
+
import { ReactComponent as HelpOutlineOutlined } from '@material-design-icons/svg/outlined/help_outline.svg';
|
|
7
|
+
import { isBoolean, isFunction, isNull, isNumber, isString } from 'lodash';
|
|
8
|
+
import { useContext, useId, useRef } from 'react';
|
|
9
|
+
import { FormError } from './internal/FormError';
|
|
10
|
+
import { Validators } from './model/validators';
|
|
11
|
+
import { CLASSES, FormContext, FormGroupContext } from './vars';
|
|
12
|
+
import { useComponentProps, useStyled, useTranslation } from '../hooks';
|
|
13
|
+
import { Icon } from '../icon';
|
|
14
|
+
import { CircularProgress } from '../internal/circular-progress';
|
|
15
|
+
import { Tooltip } from '../tooltip';
|
|
16
|
+
import { mergeCS } from '../utils';
|
|
17
|
+
const ValidateState = {
|
|
18
|
+
Empty: 0,
|
|
19
|
+
Success: 1,
|
|
20
|
+
Warning: 2,
|
|
21
|
+
Error: 3,
|
|
22
|
+
Pending: 4,
|
|
23
|
+
};
|
|
24
|
+
export function FormItem(props) {
|
|
25
|
+
const _a = useComponentProps('FormItem', props), { children, styleOverrides, styleProvider, formControls, label, labelWidth: labelWidthProp, labelExtra: labelExtraProp, labelFor, required: requiredProp } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "formControls", "label", "labelWidth", "labelExtra", "labelFor", "required"]);
|
|
26
|
+
const styled = useStyled(CLASSES, { form: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.form }, styleOverrides);
|
|
27
|
+
const { t } = useTranslation();
|
|
28
|
+
const formContext = useContext(FormContext);
|
|
29
|
+
const formGroupContext = useContext(FormGroupContext);
|
|
30
|
+
const divRef = useRef(null);
|
|
31
|
+
const uniqueId = useId();
|
|
32
|
+
const getErrorId = (controlName) => `${controlName}-error-${uniqueId}`;
|
|
33
|
+
const labelWidth = labelWidthProp !== null && labelWidthProp !== void 0 ? labelWidthProp : formContext.labelWidth;
|
|
34
|
+
const formControlProviders = (() => {
|
|
35
|
+
const obj = {};
|
|
36
|
+
Object.keys(formControls !== null && formControls !== void 0 ? formControls : {}).forEach((controlName) => {
|
|
37
|
+
const formControl = formGroupContext.get(controlName);
|
|
38
|
+
if (isNull(formControl)) {
|
|
39
|
+
throw new Error(`Cant find '${controlName}', please check if name exists!`);
|
|
40
|
+
}
|
|
41
|
+
obj[controlName] = {
|
|
42
|
+
control: formControl,
|
|
43
|
+
invalid: false,
|
|
44
|
+
inputAria: {
|
|
45
|
+
'aria-invalid': formControl.enabled && formControl.dirty && formControl.invalid,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
return obj;
|
|
50
|
+
})();
|
|
51
|
+
const required = (() => {
|
|
52
|
+
if (isBoolean(requiredProp)) {
|
|
53
|
+
return requiredProp;
|
|
54
|
+
}
|
|
55
|
+
for (const { control } of Object.values(formControlProviders)) {
|
|
56
|
+
if (control.hasValidator(Validators.required)) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
})();
|
|
62
|
+
const errorsRef = useRef([]);
|
|
63
|
+
const validateState = (() => {
|
|
64
|
+
const errors = [];
|
|
65
|
+
let validateState = ValidateState.Empty;
|
|
66
|
+
Object.entries(formControls !== null && formControls !== void 0 ? formControls : {}).forEach(([controlName, formErrors]) => {
|
|
67
|
+
const { control } = formControlProviders[controlName];
|
|
68
|
+
let isPending = false;
|
|
69
|
+
if (control.enabled && control.dirty) {
|
|
70
|
+
switch (control.status) {
|
|
71
|
+
case 'PENDING': {
|
|
72
|
+
isPending = true;
|
|
73
|
+
validateState = ValidateState.Pending;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case 'INVALID': {
|
|
77
|
+
formControlProviders[controlName].invalid = 'warning';
|
|
78
|
+
if (validateState < ValidateState.Warning) {
|
|
79
|
+
validateState = ValidateState.Warning;
|
|
80
|
+
}
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
case 'VALID': {
|
|
84
|
+
if (validateState < ValidateState.Success) {
|
|
85
|
+
validateState = ValidateState.Success;
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
default:
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
let hasError = false;
|
|
93
|
+
if (control.invalid && control.errors) {
|
|
94
|
+
if (isString(formErrors)) {
|
|
95
|
+
errors.push({ key: controlName, controlName, message: formErrors, invalid: 'error' });
|
|
96
|
+
hasError = true;
|
|
97
|
+
}
|
|
98
|
+
else if (Object.keys(formErrors).length === 2 && 'message' in formErrors && 'invalid' in formErrors) {
|
|
99
|
+
errors.push(Object.assign({ key: controlName, controlName }, formErrors));
|
|
100
|
+
if (formErrors.invalid === 'error') {
|
|
101
|
+
hasError = true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else if (control.errors) {
|
|
105
|
+
for (const key of Object.keys(control.errors)) {
|
|
106
|
+
if (key in formErrors) {
|
|
107
|
+
if (isString(formErrors[key])) {
|
|
108
|
+
errors.push({ key: `${controlName}-${key}`, controlName, message: formErrors[key], invalid: 'error' });
|
|
109
|
+
hasError = true;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
errors.push(Object.assign({ key: `${controlName}-${key}`, controlName }, formErrors[key]));
|
|
113
|
+
if (formErrors[key].invalid === 'error') {
|
|
114
|
+
hasError = true;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (hasError) {
|
|
122
|
+
if (!isPending) {
|
|
123
|
+
formControlProviders[controlName].invalid = 'error';
|
|
124
|
+
}
|
|
125
|
+
if (validateState !== ValidateState.Pending) {
|
|
126
|
+
validateState = ValidateState.Error;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
const newErrors = [];
|
|
132
|
+
errorsRef.current.forEach((err) => {
|
|
133
|
+
const index = errors.findIndex((e) => e.key === err.key);
|
|
134
|
+
newErrors.push(Object.assign(err, { hidden: index === -1 }));
|
|
135
|
+
if (index !== -1) {
|
|
136
|
+
errors.splice(index, 1);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
errorsRef.current = newErrors.concat(errors);
|
|
140
|
+
return validateState;
|
|
141
|
+
})();
|
|
142
|
+
const labelExtra = (() => {
|
|
143
|
+
var _a;
|
|
144
|
+
if (labelExtraProp) {
|
|
145
|
+
return isString(labelExtraProp) ? (_jsx(Tooltip, { title: labelExtraProp, children: _jsx(Icon, { children: _jsx(HelpOutlineOutlined, {}) }) })) : (_jsx(Tooltip, { title: labelExtraProp.title, children: (_a = labelExtraProp.icon) !== null && _a !== void 0 ? _a : (_jsx(Icon, { children: _jsx(HelpOutlineOutlined, {}) })) }));
|
|
146
|
+
}
|
|
147
|
+
})();
|
|
148
|
+
return (_jsx("div", Object.assign({}, restProps, mergeCS(styled('form__item'), {
|
|
149
|
+
className: restProps.className,
|
|
150
|
+
style: restProps.style,
|
|
151
|
+
}), { ref: divRef, children: _jsxs("div", Object.assign({}, styled('form__item-container'), { children: [labelWidth !== 0 && (_jsx("div", Object.assign({}, mergeCS(styled('form__item-label-wrapper'), {
|
|
152
|
+
style: { width: formContext.vertical ? '100%' : labelWidth === 'auto' ? 'var(--label-width)' : labelWidth },
|
|
153
|
+
}), { children: label && (_jsxs("label", Object.assign({}, styled('form__item-label', {
|
|
154
|
+
'form__item-label--auto': !formContext.vertical && labelWidth === 'auto',
|
|
155
|
+
'form__item-label--required': formContext.requiredType === 'required' && required,
|
|
156
|
+
'form__item-label--colon': formContext.labelColon,
|
|
157
|
+
}), { htmlFor: labelFor, "data-l-form-label": true, children: [label, (labelExtra || (formContext.requiredType === 'optional' && !required)) && (_jsxs("div", Object.assign({}, styled('form__item-label-extra'), { children: [formContext.requiredType === 'optional' && !required && _jsx("span", { children: t('Form', 'Optional') }), labelExtra] })))] }))) }))), _jsxs("div", Object.assign({}, mergeCS(styled('form__item-content'), {
|
|
158
|
+
style: {
|
|
159
|
+
width: `calc(100% - ${formContext.vertical ? '0px' : labelWidth === 'auto' ? 'var(--label-width)' : labelWidth}${isNumber(labelWidth) ? 'px' : ''} - ${formContext.feedbackIcon ? 'var(--size)' : '0px'})`,
|
|
160
|
+
},
|
|
161
|
+
}), { children: [_jsx("div", Object.assign({}, styled('form__item-control'), { children: isFunction(children) ? children(formControlProviders) : children })), _jsx("div", Object.assign({}, styled('form__error-container'), { children: (() => {
|
|
162
|
+
const errorsMap = new Map();
|
|
163
|
+
errorsRef.current.forEach((err) => {
|
|
164
|
+
if (errorsMap.has(err.controlName)) {
|
|
165
|
+
errorsMap.get(err.controlName).push(err);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
errorsMap.set(err.controlName, [err]);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
const nodes = [];
|
|
172
|
+
for (const [controlName, errors] of errorsMap) {
|
|
173
|
+
const id = getErrorId(controlName);
|
|
174
|
+
formControlProviders[controlName].inputAria['aria-describedby'] = id;
|
|
175
|
+
nodes.push(_jsx("div", { id: id, children: errors.map((error) => (_jsx(FormError, { styled: styled, visible: !error.hidden, message: error.message, invalid: error.invalid, afterLeave: () => {
|
|
176
|
+
errorsRef.current = errorsRef.current.filter((err) => err.key !== error.key);
|
|
177
|
+
} }, error.key))) }, controlName));
|
|
178
|
+
}
|
|
179
|
+
return nodes;
|
|
180
|
+
})() }))] })), formContext.feedbackIcon && (_jsx("div", Object.assign({}, styled('form__item-feedback-icon'), { children: (() => {
|
|
181
|
+
var _a;
|
|
182
|
+
if (validateState === ValidateState.Empty) {
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
const icon = (state) => state === ValidateState.Pending ? (_jsx(Icon, { theme: "primary", children: _jsx(CircularProgress, {}) })) : state === ValidateState.Error ? (_jsx(Icon, { theme: "danger", children: _jsx(CancelFilled, {}) })) : state === ValidateState.Warning ? (_jsx(Icon, { theme: "warning", children: _jsx(ErrorFilled, {}) })) : (_jsx(Icon, { theme: "success", children: _jsx(CheckCircleFilled, {}) }));
|
|
187
|
+
if (isBoolean(formContext.feedbackIcon)) {
|
|
188
|
+
return icon(validateState);
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
return ((_a = formContext.feedbackIcon[validateState === ValidateState.Pending
|
|
192
|
+
? 'pending'
|
|
193
|
+
: validateState === ValidateState.Error
|
|
194
|
+
? 'error'
|
|
195
|
+
: validateState === ValidateState.Warning
|
|
196
|
+
? 'warning'
|
|
197
|
+
: 'success']) !== null && _a !== void 0 ? _a : icon(validateState));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
})() })))] })) })));
|
|
201
|
+
}
|
package/form/hooks.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AbstractControl } from './model/abstract-control';
|
|
2
|
+
import type { FormGroup } from './model/form-group';
|
|
3
|
+
export declare function useForm<T extends {
|
|
4
|
+
[K in keyof T]: AbstractControl;
|
|
5
|
+
} = any>(initForm: () => FormGroup<T>): readonly [FormGroup<T>, (form?: FormGroup) => void];
|
package/form/hooks.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useEventCallback, useForceUpdate } from '@laser-ui/hooks';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
export function useForm(initForm) {
|
|
4
|
+
const forceUpdate = useForceUpdate();
|
|
5
|
+
const [form, setForm] = useState(() => {
|
|
6
|
+
const form = initForm();
|
|
7
|
+
form._emitChange = forceUpdate;
|
|
8
|
+
return form;
|
|
9
|
+
});
|
|
10
|
+
const updateForm = useEventCallback((form) => {
|
|
11
|
+
if (form) {
|
|
12
|
+
form._emitChange = forceUpdate;
|
|
13
|
+
setForm(form);
|
|
14
|
+
}
|
|
15
|
+
forceUpdate();
|
|
16
|
+
});
|
|
17
|
+
return [form, updateForm];
|
|
18
|
+
}
|
package/form/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { FormProps, FormItemProps } from './types';
|
|
2
|
+
export { AbstractControl } from './model/abstract-control';
|
|
3
|
+
export { FormControl } from './model/form-control';
|
|
4
|
+
export { FormGroup } from './model/form-group';
|
|
5
|
+
export { Validators } from './model/validators';
|
|
6
|
+
export { Form } from './Form';
|
|
7
|
+
export { useForm } from './hooks';
|
|
8
|
+
export { FormGroupContext } from './vars';
|
package/form/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { AbstractControl } from './model/abstract-control';
|
|
2
|
+
export { FormControl } from './model/form-control';
|
|
3
|
+
export { FormGroup } from './model/form-group';
|
|
4
|
+
export { Validators } from './model/validators';
|
|
5
|
+
export { Form } from './Form';
|
|
6
|
+
export { useForm } from './hooks';
|
|
7
|
+
export { FormGroupContext } from './vars';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Styled } from '../../hooks/useStyled';
|
|
3
|
+
import type { CLASSES } from '../vars';
|
|
4
|
+
interface FormErrorProps {
|
|
5
|
+
styled: Styled<typeof CLASSES>;
|
|
6
|
+
visible: boolean;
|
|
7
|
+
message: string;
|
|
8
|
+
invalid: 'warning' | 'error';
|
|
9
|
+
afterLeave: () => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function FormError(props: FormErrorProps): JSX.Element | null;
|
|
12
|
+
export {};
|