@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
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CLASSES } from './vars';
|
|
3
|
+
import type { ButtonProps } from '../button';
|
|
4
|
+
import type { BaseProps, CloneHTMLElement, PopupPlacement } from '../types';
|
|
5
|
+
import type { RefExtra } from '@laser-ui/hooks/useRefExtra';
|
|
6
|
+
export {};
|
|
7
|
+
export interface PopoverRef {
|
|
8
|
+
updatePosition: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface PopoverProps extends BaseProps<'popover', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'content'> {
|
|
11
|
+
children: React.ReactElement | ((render: CloneHTMLElement) => React.ReactNode);
|
|
12
|
+
content: React.ReactNode;
|
|
13
|
+
header?: React.ReactElement | string;
|
|
14
|
+
footer?: React.ReactElement;
|
|
15
|
+
visible?: boolean;
|
|
16
|
+
defaultVisible?: boolean;
|
|
17
|
+
trigger?: 'hover' | 'click';
|
|
18
|
+
placement?: PopupPlacement;
|
|
19
|
+
placementFixed?: boolean;
|
|
20
|
+
arrow?: boolean;
|
|
21
|
+
escClosable?: boolean;
|
|
22
|
+
gap?: number;
|
|
23
|
+
inWindow?: number | false;
|
|
24
|
+
mouseEnterDelay?: number;
|
|
25
|
+
mouseLeaveDelay?: number;
|
|
26
|
+
modal?: boolean;
|
|
27
|
+
skipFirstTransition?: boolean;
|
|
28
|
+
destroyAfterClose?: boolean;
|
|
29
|
+
zIndex?: number | string;
|
|
30
|
+
scrolling?: RefExtra;
|
|
31
|
+
onVisibleChange?: (visible: boolean) => void;
|
|
32
|
+
afterVisibleChange?: (visible: boolean) => void;
|
|
33
|
+
}
|
|
34
|
+
export interface PopoverHeaderProps extends BaseProps<'popover', typeof CLASSES>, React.HTMLAttributes<HTMLDivElement> {
|
|
35
|
+
actions?: React.ReactNode[];
|
|
36
|
+
closeProps?: ButtonProps;
|
|
37
|
+
onCloseClick?: () => any | Promise<any>;
|
|
38
|
+
}
|
|
39
|
+
export interface PopoverFooterProps extends BaseProps<'popover', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
40
|
+
align?: 'left' | 'center' | 'right';
|
|
41
|
+
actions?: React.ReactNode[];
|
|
42
|
+
cancelProps?: ButtonProps;
|
|
43
|
+
okProps?: ButtonProps;
|
|
44
|
+
onCancelClick?: () => any | Promise<any>;
|
|
45
|
+
onOkClick?: () => any | Promise<any>;
|
|
46
|
+
}
|
package/popover/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const CLASSES: {
|
|
2
|
+
popover: string;
|
|
3
|
+
'popover--top': string;
|
|
4
|
+
'popover--top-left': string;
|
|
5
|
+
'popover--top-right': string;
|
|
6
|
+
'popover--right': string;
|
|
7
|
+
'popover--right-top': string;
|
|
8
|
+
'popover--right-bottom': string;
|
|
9
|
+
'popover--bottom': string;
|
|
10
|
+
'popover--bottom-left': string;
|
|
11
|
+
'popover--bottom-right': string;
|
|
12
|
+
'popover--left': string;
|
|
13
|
+
'popover--left-top': string;
|
|
14
|
+
'popover--left-bottom': string;
|
|
15
|
+
popover__mask: string;
|
|
16
|
+
popover__content: string;
|
|
17
|
+
popover__arrow: string;
|
|
18
|
+
popover__header: string;
|
|
19
|
+
'popover__header-title': string;
|
|
20
|
+
'popover__header-actions': string;
|
|
21
|
+
popover__body: string;
|
|
22
|
+
popover__footer: string;
|
|
23
|
+
'popover__footer--left': string;
|
|
24
|
+
'popover__footer--center': string;
|
|
25
|
+
'popover__footer--right': string;
|
|
26
|
+
};
|
|
27
|
+
export declare const TTANSITION_DURING: {
|
|
28
|
+
enter: number;
|
|
29
|
+
leave: number;
|
|
30
|
+
};
|
package/popover/vars.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const CLASSES = {
|
|
2
|
+
popover: '^popover',
|
|
3
|
+
'popover--top': '^popover--top',
|
|
4
|
+
'popover--top-left': '^popover--top-left',
|
|
5
|
+
'popover--top-right': '^popover--top-right',
|
|
6
|
+
'popover--right': '^popover--right',
|
|
7
|
+
'popover--right-top': '^popover--right-top',
|
|
8
|
+
'popover--right-bottom': '^popover--right-bottom',
|
|
9
|
+
'popover--bottom': '^popover--bottom',
|
|
10
|
+
'popover--bottom-left': '^popover--bottom-left',
|
|
11
|
+
'popover--bottom-right': '^popover--bottom-right',
|
|
12
|
+
'popover--left': '^popover--left',
|
|
13
|
+
'popover--left-top': '^popover--left-top',
|
|
14
|
+
'popover--left-bottom': '^popover--left-bottom',
|
|
15
|
+
popover__mask: '^popover__mask',
|
|
16
|
+
popover__content: '^popover__content',
|
|
17
|
+
popover__arrow: '^popover__arrow',
|
|
18
|
+
popover__header: '^popover__header',
|
|
19
|
+
'popover__header-title': '^popover__header-title',
|
|
20
|
+
'popover__header-actions': '^popover__header-actions',
|
|
21
|
+
popover__body: '^popover__body',
|
|
22
|
+
popover__footer: '^popover__footer',
|
|
23
|
+
'popover__footer--left': '^popover__footer--left',
|
|
24
|
+
'popover__footer--center': '^popover__footer--center',
|
|
25
|
+
'popover__footer--right': '^popover__footer--right',
|
|
26
|
+
};
|
|
27
|
+
export const TTANSITION_DURING = { enter: 86, leave: 100 };
|
|
@@ -0,0 +1,45 @@
|
|
|
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 { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
|
|
5
|
+
import { ReactComponent as CheckCircleFilled } from '@material-design-icons/svg/filled/check_circle.svg';
|
|
6
|
+
import { ReactComponent as WarningFilled } from '@material-design-icons/svg/filled/warning.svg';
|
|
7
|
+
import { ReactComponent as CheckOutlined } from '@material-design-icons/svg/outlined/check.svg';
|
|
8
|
+
import { ReactComponent as CloseOutlined } from '@material-design-icons/svg/outlined/close.svg';
|
|
9
|
+
import { ReactComponent as WarningAmberOutlined } from '@material-design-icons/svg/outlined/warning_amber.svg';
|
|
10
|
+
import { isUndefined } from 'lodash';
|
|
11
|
+
import { useId } from 'react';
|
|
12
|
+
import { CLASSES } from './vars';
|
|
13
|
+
import { useComponentProps, useNamespace, useStyled } from '../hooks';
|
|
14
|
+
import { Icon } from '../icon';
|
|
15
|
+
import { mergeCS } from '../utils';
|
|
16
|
+
export function Progress(props) {
|
|
17
|
+
const _a = useComponentProps('Progress', props), { styleOverrides, styleProvider, percent, pattern = 'line', state: stateProp, label, size = 120, wave = false, lineCap = 'round', lineWidth = 8, gapDegree = 75, linearGradient } = _a, restProps = __rest(_a, ["styleOverrides", "styleProvider", "percent", "pattern", "state", "label", "size", "wave", "lineCap", "lineWidth", "gapDegree", "linearGradient"]);
|
|
18
|
+
const namespace = useNamespace();
|
|
19
|
+
const styled = useStyled(CLASSES, { progress: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.progress }, styleOverrides);
|
|
20
|
+
const uniqueId = useId();
|
|
21
|
+
const state = isUndefined(stateProp) ? (percent === 100 ? 'success' : 'process') : stateProp;
|
|
22
|
+
return (_jsxs("div", Object.assign({}, restProps, mergeCS(styled('progress', `progress--${pattern}`, `progress--${state}`), {
|
|
23
|
+
className: restProps.className,
|
|
24
|
+
style: restProps.style,
|
|
25
|
+
}), { role: "progressbar", "aria-valuenow": percent, "aria-valuemin": 0, "aria-valuemax": 100, children: [pattern === 'line' ? (_jsx("div", Object.assign({}, mergeCS(styled('progress__line-track'), {
|
|
26
|
+
style: { height: lineWidth, borderRadius: lineCap === 'round' ? lineWidth / 2 : 0 },
|
|
27
|
+
}), { children: _jsx("div", Object.assign({}, mergeCS(styled('progress__line-bar'), {
|
|
28
|
+
style: {
|
|
29
|
+
opacity: percent === 0 ? 0 : 1,
|
|
30
|
+
width: `${percent}%`,
|
|
31
|
+
backgroundImage: linearGradient
|
|
32
|
+
? `linear-gradient(to right, ${linearGradient[0]} 0%, ${linearGradient[100]} 100%)`
|
|
33
|
+
: undefined,
|
|
34
|
+
},
|
|
35
|
+
}), { children: wave && percent > 0 && _jsx("div", Object.assign({}, styled('progress__line-wave'))) })) }))) : ((() => {
|
|
36
|
+
const r = 60 - lineWidth / 2;
|
|
37
|
+
const c = 2 * Math.PI * r;
|
|
38
|
+
const dash = c - (pattern === 'circle' ? 0 : (gapDegree / 360) * c);
|
|
39
|
+
return (_jsx(Icon, { size: size, children: _jsxs("svg", Object.assign({}, mergeCS(styled('progress__svg'), {
|
|
40
|
+
style: { transform: pattern === 'circle' ? 'rotate(-90deg)' : `rotate(${90 + gapDegree / 2}deg)` },
|
|
41
|
+
}), { viewBox: "0 0 120 120", children: [linearGradient && (_jsx("defs", { children: _jsxs("linearGradient", { id: `${namespace}-progress-gradient-${uniqueId}-1`, gradientUnits: "userSpaceOnUse", children: [_jsx("stop", { offset: "0%", stopColor: linearGradient[0] }), _jsx("stop", { offset: "100%", stopColor: linearGradient[100] })] }) })), _jsx("circle", { cx: 60, cy: 60, r: r, strokeLinecap: lineCap, strokeWidth: lineWidth, stroke: "var(--background-color)", fill: "none", strokeDasharray: `${dash} ${c}` }), _jsx("circle", { style: { opacity: percent === 0 ? 0 : 1 }, cx: 60, cy: 60, r: r, strokeLinecap: lineCap, strokeWidth: lineWidth, stroke: isUndefined(linearGradient) ? 'var(--color)' : `url(#${namespace}-progress-gradient-${uniqueId}-1)`, fill: "none", strokeDasharray: `${dash * (percent / 100)} ${c}` })] })) }));
|
|
42
|
+
})()), label !== false && (_jsx("div", Object.assign({}, mergeCS(styled('progress__label'), {
|
|
43
|
+
style: { fontSize: pattern === 'line' ? undefined : `calc(${size}px / 5)` },
|
|
44
|
+
}), { children: checkNodeExist(label) ? (label) : state === 'process' ? (`${percent}%`) : (_jsx(Icon, { size: "1.25em", children: state === 'success' ? (pattern === 'line' ? (_jsx(CheckCircleFilled, {})) : (_jsx(CheckOutlined, {}))) : state === 'warning' ? (pattern === 'line' ? (_jsx(WarningFilled, {})) : (_jsx(WarningAmberOutlined, {}))) : pattern === 'line' ? (_jsx(CancelFilled, {})) : (_jsx(CloseOutlined, {})) })) })))] })));
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Progress } from './Progress';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CLASSES } from './vars';
|
|
3
|
+
import type { BaseProps } from '../types';
|
|
4
|
+
export {};
|
|
5
|
+
export interface ProgressProps extends BaseProps<'progress', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
6
|
+
percent: number;
|
|
7
|
+
pattern?: 'line' | 'circle' | 'dashboard';
|
|
8
|
+
state?: 'success' | 'warning' | 'error' | 'process';
|
|
9
|
+
label?: React.ReactNode;
|
|
10
|
+
size?: number;
|
|
11
|
+
wave?: boolean;
|
|
12
|
+
lineCap?: 'butt' | 'round';
|
|
13
|
+
lineWidth?: number;
|
|
14
|
+
gapDegree?: number;
|
|
15
|
+
linearGradient?: {
|
|
16
|
+
0: string;
|
|
17
|
+
100: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const CLASSES: {
|
|
2
|
+
progress: string;
|
|
3
|
+
'progress--line': string;
|
|
4
|
+
'progress--circle': string;
|
|
5
|
+
'progress--dashboard': string;
|
|
6
|
+
'progress--success': string;
|
|
7
|
+
'progress--warning': string;
|
|
8
|
+
'progress--error': string;
|
|
9
|
+
'progress--process': string;
|
|
10
|
+
'progress__line-track': string;
|
|
11
|
+
'progress__line-bar': string;
|
|
12
|
+
'progress__line-wave': string;
|
|
13
|
+
progress__svg: string;
|
|
14
|
+
progress__label: string;
|
|
15
|
+
};
|
package/progress/vars.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const CLASSES = {
|
|
2
|
+
progress: '^progress',
|
|
3
|
+
'progress--line': '^progress--line',
|
|
4
|
+
'progress--circle': '^progress--circle',
|
|
5
|
+
'progress--dashboard': '^progress--dashboard',
|
|
6
|
+
'progress--success': '^progress--success',
|
|
7
|
+
'progress--warning': '^progress--warning',
|
|
8
|
+
'progress--error': '^progress--error',
|
|
9
|
+
'progress--process': '^progress--process',
|
|
10
|
+
'progress__line-track': '^progress__line-track',
|
|
11
|
+
'progress__line-bar': '^progress__line-bar',
|
|
12
|
+
'progress__line-wave': '^progress__line-wave',
|
|
13
|
+
progress__svg: '^progress__svg',
|
|
14
|
+
progress__label: '^progress__label',
|
|
15
|
+
};
|
package/radio/Radio.d.ts
ADDED
package/radio/Radio.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
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 { useRef } from 'react';
|
|
5
|
+
import { RadioGroup } from './RadioGroup';
|
|
6
|
+
import { CLASSES } from './vars';
|
|
7
|
+
import { useComponentProps, useControlled, useDesign, useNamespace, useScopedProps, useStyled } from '../hooks';
|
|
8
|
+
import { Wave } from '../internal/wave';
|
|
9
|
+
import { mergeCS } from '../utils';
|
|
10
|
+
export const Radio = (props) => {
|
|
11
|
+
const _a = useComponentProps('Radio', props), { children, styleOverrides, styleProvider, formControl, model, defaultModel, disabled: disabledProp = false, inputRef, inputRender, onModelChange, _pattern, _size } = _a, restProps = __rest(_a, ["children", "styleOverrides", "styleProvider", "formControl", "model", "defaultModel", "disabled", "inputRef", "inputRender", "onModelChange", "_pattern", "_size"]);
|
|
12
|
+
const namespace = useNamespace();
|
|
13
|
+
const styled = useStyled(CLASSES, { radio: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.radio }, styleOverrides);
|
|
14
|
+
const waveRef = useRef(null);
|
|
15
|
+
const [checked, changeChecked] = useControlled(defaultModel !== null && defaultModel !== void 0 ? defaultModel : false, model, onModelChange, undefined, formControl === null || formControl === void 0 ? void 0 : formControl.control);
|
|
16
|
+
const { disabled } = useScopedProps({ disabled: disabledProp || (formControl === null || formControl === void 0 ? void 0 : formControl.control.disabled) });
|
|
17
|
+
const designProps = useDesign({ compose: _pattern ? { active: checked, disabled } : undefined });
|
|
18
|
+
const inputNode = (_jsx("input", Object.assign({}, styled('radio__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: inputRef, type: "radio", checked: checked, disabled: disabled, "aria-checked": checked, onChange: () => {
|
|
19
|
+
changeChecked(true);
|
|
20
|
+
} })));
|
|
21
|
+
return (_jsxs("label", Object.assign({}, restProps, mergeCS(styled('radio', {
|
|
22
|
+
'radio.is-checked': checked,
|
|
23
|
+
'radio.is-disabled': disabled,
|
|
24
|
+
'radio--button': _pattern,
|
|
25
|
+
[`radio--button-${_pattern}`]: _pattern,
|
|
26
|
+
[`radio--button-${_size}`]: _size,
|
|
27
|
+
}), {
|
|
28
|
+
className: restProps.className,
|
|
29
|
+
style: restProps.style,
|
|
30
|
+
}), designProps, { onClick: (e) => {
|
|
31
|
+
var _a, _b;
|
|
32
|
+
(_a = restProps.onClick) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
33
|
+
if (_pattern) {
|
|
34
|
+
(_b = waveRef.current) === null || _b === void 0 ? void 0 : _b.call(waveRef);
|
|
35
|
+
}
|
|
36
|
+
}, children: [_jsx(Wave, { ref: waveRef, color: `var(--${namespace}-color-primary)` }), _jsx("div", Object.assign({}, styled('radio__input-wrapper'), { children: inputRender ? inputRender(inputNode) : inputNode })), checkNodeExist(children) && _jsx("div", Object.assign({}, styled('radio__label'), { children: children }))] })));
|
|
37
|
+
};
|
|
38
|
+
Radio.Group = RadioGroup;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { nth } from 'lodash';
|
|
3
|
+
import { cloneElement, useId } from 'react';
|
|
4
|
+
import { Radio } from './Radio';
|
|
5
|
+
import { useComponentProps, useControlled, useScopedProps } from '../hooks';
|
|
6
|
+
export function RadioGroup(props) {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
const { children, formControl, list, model, defaultModel, pattern, size: sizeProp, name: nameProp, disabled: disabledProp = false, onModelChange, } = useComponentProps('RadioGroup', props);
|
|
9
|
+
const uniqueId = useId();
|
|
10
|
+
const name = nameProp !== null && nameProp !== void 0 ? nameProp : uniqueId;
|
|
11
|
+
const [value, changeValue] = useControlled((_b = defaultModel !== null && defaultModel !== void 0 ? defaultModel : (_a = nth(list, 0)) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : null, model, (val) => {
|
|
12
|
+
if (onModelChange) {
|
|
13
|
+
onModelChange(val, list.find((o) => o.value === val));
|
|
14
|
+
}
|
|
15
|
+
}, undefined, formControl === null || formControl === void 0 ? void 0 : formControl.control);
|
|
16
|
+
const { size, disabled } = useScopedProps({ size: sizeProp, disabled: disabledProp || (formControl === null || formControl === void 0 ? void 0 : formControl.control.disabled) });
|
|
17
|
+
const childrenNode = children(list.map((option) => (_jsx(Radio, { _pattern: pattern, _size: size, model: option.value === value, disabled: option.disabled || disabled, inputRender: (el) => cloneElement(el, Object.assign(Object.assign({}, formControl === null || formControl === void 0 ? void 0 : formControl.inputAria), { value: option.value, name })), onModelChange: () => {
|
|
18
|
+
changeValue(option.value);
|
|
19
|
+
}, children: option.label }, option.value))));
|
|
20
|
+
return cloneElement(childrenNode, { role: (_c = childrenNode.props.role) !== null && _c !== void 0 ? _c : 'radiogroup' });
|
|
21
|
+
}
|
package/radio/index.d.ts
ADDED
package/radio/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Radio } from './Radio';
|
package/radio/types.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CLASSES } from './vars';
|
|
3
|
+
import type { FormControlProvider } from '../form/types';
|
|
4
|
+
import type { BaseProps, CloneHTMLElement, Size } from '../types';
|
|
5
|
+
export {};
|
|
6
|
+
export interface RadioProps extends BaseProps<'radio', typeof CLASSES>, React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
7
|
+
formControl?: FormControlProvider;
|
|
8
|
+
model?: boolean;
|
|
9
|
+
defaultModel?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
inputRef?: React.ForwardedRef<HTMLInputElement>;
|
|
12
|
+
inputRender?: CloneHTMLElement;
|
|
13
|
+
onModelChange?: (checked: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
export interface RadioGroupItem<V extends React.Key> {
|
|
16
|
+
label: React.ReactNode;
|
|
17
|
+
value: V;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface RadioGroupProps<V extends React.Key, T extends RadioGroupItem<V>> {
|
|
21
|
+
children: (nodes: React.ReactElement[]) => React.ReactElement;
|
|
22
|
+
formControl?: FormControlProvider;
|
|
23
|
+
list: T[];
|
|
24
|
+
model?: V | null;
|
|
25
|
+
defaultModel?: V;
|
|
26
|
+
pattern?: 'outline' | 'fill';
|
|
27
|
+
size?: Size;
|
|
28
|
+
name?: string;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
onModelChange?: (value: V, origin: T) => void;
|
|
31
|
+
}
|
package/radio/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/radio/vars.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const CLASSES: {
|
|
2
|
+
radio: string;
|
|
3
|
+
'radio.is-checked': string;
|
|
4
|
+
'radio.is-disabled': string;
|
|
5
|
+
'radio--button': string;
|
|
6
|
+
'radio--button-outline': string;
|
|
7
|
+
'radio--button-fill': string;
|
|
8
|
+
'radio--button-small': string;
|
|
9
|
+
'radio--button-medium': string;
|
|
10
|
+
'radio--button-large': string;
|
|
11
|
+
'radio__input-wrapper': string;
|
|
12
|
+
radio__input: string;
|
|
13
|
+
radio__label: string;
|
|
14
|
+
};
|
package/radio/vars.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const CLASSES = {
|
|
2
|
+
radio: '^radio',
|
|
3
|
+
'radio.is-checked': 'is-checked',
|
|
4
|
+
'radio.is-disabled': 'is-disabled',
|
|
5
|
+
'radio--button': '^radio--button',
|
|
6
|
+
'radio--button-outline': '^radio--button-outline',
|
|
7
|
+
'radio--button-fill': '^radio--button-fill',
|
|
8
|
+
'radio--button-small': '^radio--button-small',
|
|
9
|
+
'radio--button-medium': '^radio--button-medium',
|
|
10
|
+
'radio--button-large': '^radio--button-large',
|
|
11
|
+
'radio__input-wrapper': '^radio__input-wrapper',
|
|
12
|
+
radio__input: '^radio__input',
|
|
13
|
+
radio__label: '^radio__label',
|
|
14
|
+
};
|
package/rating/Rating.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { checkNodeExist } from '@laser-ui/utils';
|
|
4
|
+
import { ReactComponent as StarFilled } from '@material-design-icons/svg/filled/star.svg';
|
|
5
|
+
import { isFunction } from 'lodash';
|
|
6
|
+
import { useId, useState } from 'react';
|
|
7
|
+
import { RatingStar } from './internal/RatingStar';
|
|
8
|
+
import { CLASSES } from './vars';
|
|
9
|
+
import { useComponentProps, useControlled, useScopedProps, useStyled } from '../hooks';
|
|
10
|
+
import { Icon } from '../icon';
|
|
11
|
+
import { mergeCS } from '../utils';
|
|
12
|
+
export function Rating(props) {
|
|
13
|
+
const _a = useComponentProps('Rating', props), { styleOverrides, styleProvider, formControl, model, defaultModel, total = 5, icon, tooltip, name, half = false, readOnly = false, disabled: disabledProp = false, onModelChange } = _a, restProps = __rest(_a, ["styleOverrides", "styleProvider", "formControl", "model", "defaultModel", "total", "icon", "tooltip", "name", "half", "readOnly", "disabled", "onModelChange"]);
|
|
14
|
+
const styled = useStyled(CLASSES, { rating: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.rating }, styleOverrides);
|
|
15
|
+
const uniqueId = useId();
|
|
16
|
+
const [hover, setHover] = useState(null);
|
|
17
|
+
const [value, changeValue] = useControlled(defaultModel !== null && defaultModel !== void 0 ? defaultModel : null, model, onModelChange, undefined, formControl === null || formControl === void 0 ? void 0 : formControl.control);
|
|
18
|
+
const { disabled } = useScopedProps({ disabled: disabledProp || (formControl === null || formControl === void 0 ? void 0 : formControl.control.disabled) });
|
|
19
|
+
return (_jsx("div", Object.assign({}, restProps, mergeCS(styled('rating', {
|
|
20
|
+
'rating.is-disabled': disabled,
|
|
21
|
+
'rating--read-only': readOnly,
|
|
22
|
+
}), {
|
|
23
|
+
className: restProps.className,
|
|
24
|
+
style: restProps.style,
|
|
25
|
+
}), { role: "radiogroup", onMouseLeave: (e) => {
|
|
26
|
+
var _a;
|
|
27
|
+
(_a = restProps.onMouseLeave) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
28
|
+
setHover(null);
|
|
29
|
+
}, children: Array.from({ length: total }).map((_, i) => (_jsx(RatingStar, { styled: styled, value: i + 1, hover: hover, checked: value, icon: isFunction(icon) ? (icon(i + 1)) : checkNodeExist(icon) ? (icon) : (_jsx(Icon, { children: _jsx(StarFilled, {}) })), tooltip: tooltip, name: name !== null && name !== void 0 ? name : uniqueId, half: half, disabled: disabled || readOnly, inputProps: formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, onCheck: (v) => {
|
|
30
|
+
changeValue(v);
|
|
31
|
+
}, onHoverChange: (v) => {
|
|
32
|
+
setHover(v);
|
|
33
|
+
} }, i + 1))) })));
|
|
34
|
+
}
|
package/rating/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Rating } from './Rating';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { Styled } from '../../hooks/useStyled';
|
|
3
|
+
import type { CLASSES } from '../vars';
|
|
4
|
+
interface RatingStarProps {
|
|
5
|
+
styled: Styled<typeof CLASSES>;
|
|
6
|
+
value: number;
|
|
7
|
+
hover: number | null;
|
|
8
|
+
checked: number | null;
|
|
9
|
+
icon: React.ReactNode;
|
|
10
|
+
tooltip: ((value: number) => React.ReactNode) | undefined;
|
|
11
|
+
name: string;
|
|
12
|
+
half: boolean;
|
|
13
|
+
disabled: boolean;
|
|
14
|
+
inputProps: any;
|
|
15
|
+
onCheck: (value: number) => void;
|
|
16
|
+
onHoverChange: (value: number) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function RatingStar(props: RatingStarProps): JSX.Element | null;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { isUndefined } from 'lodash';
|
|
3
|
+
import { useId, useState } from 'react';
|
|
4
|
+
import { useNamespace } from '../../hooks';
|
|
5
|
+
import { Tooltip } from '../../tooltip';
|
|
6
|
+
export function RatingStar(props) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const { styled, value, hover, checked: checkedProp, icon, tooltip, name, half, disabled, inputProps, onCheck, onHoverChange } = props;
|
|
9
|
+
const namespace = useNamespace();
|
|
10
|
+
const uniqueId = useId();
|
|
11
|
+
const inputId = `${namespace}-rating-star-input-${uniqueId}`;
|
|
12
|
+
const halfInputId = `${namespace}-rating-star-half-input-${uniqueId}`;
|
|
13
|
+
const checked = value === checkedProp;
|
|
14
|
+
const halfValue = value - 0.5;
|
|
15
|
+
const halfChecked = halfValue === checkedProp;
|
|
16
|
+
const [tooltipValue, setTooltipValue] = useState(value);
|
|
17
|
+
const node = (_jsxs("div", Object.assign({}, styled('rating__star'), { children: [half && (_jsxs(_Fragment, { children: [_jsx("input", Object.assign({}, styled('rating__input', 'rating__input--half'), inputProps, { id: halfInputId, type: "radio", name: name, checked: halfChecked, disabled: disabled, "aria-checked": halfChecked, onChange: () => {
|
|
18
|
+
onCheck(halfValue);
|
|
19
|
+
}, onMouseEnter: () => {
|
|
20
|
+
if (!isUndefined(tooltip)) {
|
|
21
|
+
setTooltipValue(halfValue);
|
|
22
|
+
}
|
|
23
|
+
onHoverChange(halfValue);
|
|
24
|
+
} })), _jsx("label", Object.assign({}, styled('rating__icon', 'rating__icon--half', {
|
|
25
|
+
'rating__icon.is-checked': halfValue <= ((_a = hover !== null && hover !== void 0 ? hover : checkedProp) !== null && _a !== void 0 ? _a : 0),
|
|
26
|
+
}), { htmlFor: halfInputId, children: icon }))] })), _jsxs("label", Object.assign({}, styled('rating__icon', {
|
|
27
|
+
'rating__icon.is-checked': value <= ((_b = hover !== null && hover !== void 0 ? hover : checkedProp) !== null && _b !== void 0 ? _b : 0),
|
|
28
|
+
}), { children: [_jsx("input", Object.assign({}, styled('rating__input'), { id: inputId, type: "radio", name: name, checked: checked, disabled: disabled, "aria-checked": checked, onChange: () => {
|
|
29
|
+
onCheck(value);
|
|
30
|
+
}, onMouseEnter: () => {
|
|
31
|
+
if (!isUndefined(tooltip)) {
|
|
32
|
+
setTooltipValue(value);
|
|
33
|
+
}
|
|
34
|
+
onHoverChange(value);
|
|
35
|
+
} })), icon] }))] })));
|
|
36
|
+
return isUndefined(tooltip) ? node : _jsx(Tooltip, { title: tooltip === null || tooltip === void 0 ? void 0 : tooltip(tooltipValue), children: node });
|
|
37
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CLASSES } from './vars';
|
|
3
|
+
import type { FormControlProvider } from '../form/types';
|
|
4
|
+
import type { BaseProps } from '../types';
|
|
5
|
+
export {};
|
|
6
|
+
export interface RatingProps extends BaseProps<'rating', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
7
|
+
formControl?: FormControlProvider;
|
|
8
|
+
model?: number;
|
|
9
|
+
defaultModel?: number;
|
|
10
|
+
total?: number;
|
|
11
|
+
icon?: React.ReactNode | ((value: number) => React.ReactNode);
|
|
12
|
+
tooltip?: (value: number) => React.ReactNode;
|
|
13
|
+
name?: string;
|
|
14
|
+
half?: boolean;
|
|
15
|
+
readOnly?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
onModelChange?: (value: number) => void;
|
|
18
|
+
}
|
package/rating/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/rating/vars.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const CLASSES: {
|
|
2
|
+
rating: string;
|
|
3
|
+
'rating.is-disabled': string;
|
|
4
|
+
'rating--read-only': string;
|
|
5
|
+
rating__star: string;
|
|
6
|
+
rating__input: string;
|
|
7
|
+
'rating__input--half': string;
|
|
8
|
+
rating__icon: string;
|
|
9
|
+
'rating__icon.is-checked': string;
|
|
10
|
+
'rating__icon--half': string;
|
|
11
|
+
};
|
package/rating/vars.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const CLASSES = {
|
|
2
|
+
rating: '^rating',
|
|
3
|
+
'rating.is-disabled': 'is-disabled',
|
|
4
|
+
'rating--read-only': '^rating--read-only',
|
|
5
|
+
rating__star: '^rating__star',
|
|
6
|
+
rating__input: '^rating__input',
|
|
7
|
+
'rating__input--half': '^rating__input--half',
|
|
8
|
+
rating__icon: '^rating__icon',
|
|
9
|
+
'rating__icon.is-checked': 'is-checked',
|
|
10
|
+
'rating__icon--half': '^rating__icon--half',
|
|
11
|
+
};
|