@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/image/types.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { CLASSES, PREVIEW_CLASSES } from './vars';
|
|
3
|
+
import type { BaseProps } from '../types';
|
|
4
|
+
export {};
|
|
5
|
+
export interface ImageProps extends BaseProps<'image', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
6
|
+
src: string;
|
|
7
|
+
loading?: React.ReactNode;
|
|
8
|
+
error?: React.ReactNode;
|
|
9
|
+
actions?: React.ReactElement[];
|
|
10
|
+
imgProps?: React.ImgHTMLAttributes<HTMLImageElement>;
|
|
11
|
+
}
|
|
12
|
+
export interface ImageActionProps extends BaseProps<'image', typeof CLASSES>, React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
13
|
+
}
|
|
14
|
+
export interface ImagePreviewProps extends BaseProps<'image-preview', typeof PREVIEW_CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
15
|
+
list: React.ImgHTMLAttributes<HTMLImageElement>[];
|
|
16
|
+
visible: boolean;
|
|
17
|
+
active?: number;
|
|
18
|
+
defaultActive?: number;
|
|
19
|
+
escClosable?: boolean;
|
|
20
|
+
zIndex?: number | string;
|
|
21
|
+
onActiveChange?: (index: number) => void;
|
|
22
|
+
onClose?: () => void;
|
|
23
|
+
afterVisibleChange?: (visible: boolean) => void;
|
|
24
|
+
}
|
package/image/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/image/vars.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const CLASSES: {
|
|
2
|
+
image: string;
|
|
3
|
+
image__img: string;
|
|
4
|
+
image__actions: string;
|
|
5
|
+
image__action: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const PREVIEW_CLASSES: {
|
|
8
|
+
'image-preview': string;
|
|
9
|
+
'image-preview__navigation-button': string;
|
|
10
|
+
'image-preview__navigation-button--prev': string;
|
|
11
|
+
'image-preview__navigation-button--next': string;
|
|
12
|
+
'image-preview__toolbar': string;
|
|
13
|
+
'image-preview__toolbar-page': string;
|
|
14
|
+
'image-preview__toolbar-page-input': string;
|
|
15
|
+
'image-preview__toolbar-rotate': string;
|
|
16
|
+
'image-preview__toolbar-zoom-out': string;
|
|
17
|
+
'image-preview__toolbar-zoom': string;
|
|
18
|
+
'image-preview__toolbar-zoom-input': string;
|
|
19
|
+
'image-preview__toolbar-zoom-in': string;
|
|
20
|
+
'image-preview__toolbar-close': string;
|
|
21
|
+
'image-preview__img': string;
|
|
22
|
+
'image-preview__thumbnail-list': string;
|
|
23
|
+
'image-preview__thumbnail': string;
|
|
24
|
+
'image-preview__thumbnail.is-active': string;
|
|
25
|
+
'image-preview__thumbnail-img': string;
|
|
26
|
+
};
|
package/image/vars.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const CLASSES = {
|
|
2
|
+
image: '^image',
|
|
3
|
+
image__img: '^image__img',
|
|
4
|
+
image__actions: '^image__actions',
|
|
5
|
+
image__action: '^image__action',
|
|
6
|
+
};
|
|
7
|
+
export const PREVIEW_CLASSES = {
|
|
8
|
+
'image-preview': '^image-preview',
|
|
9
|
+
'image-preview__navigation-button': '^image-preview__navigation-button',
|
|
10
|
+
'image-preview__navigation-button--prev': '^image-preview__navigation-button--prev',
|
|
11
|
+
'image-preview__navigation-button--next': '^image-preview__navigation-button--next',
|
|
12
|
+
'image-preview__toolbar': '^image-preview__toolbar',
|
|
13
|
+
'image-preview__toolbar-page': '^image-preview__toolbar-page',
|
|
14
|
+
'image-preview__toolbar-page-input': '^image-preview__toolbar-page-input',
|
|
15
|
+
'image-preview__toolbar-rotate': '^image-preview__toolbar-rotate',
|
|
16
|
+
'image-preview__toolbar-zoom-out': '^image-preview__toolbar-zoom-out',
|
|
17
|
+
'image-preview__toolbar-zoom': '^image-preview__toolbar-zoom',
|
|
18
|
+
'image-preview__toolbar-zoom-input': '^image-preview__toolbar-zoom-input',
|
|
19
|
+
'image-preview__toolbar-zoom-in': '^image-preview__toolbar-zoom-in',
|
|
20
|
+
'image-preview__toolbar-close': '^image-preview__toolbar-close',
|
|
21
|
+
'image-preview__img': '^image-preview__img',
|
|
22
|
+
'image-preview__thumbnail-list': '^image-preview__thumbnail-list',
|
|
23
|
+
'image-preview__thumbnail': '^image-preview__thumbnail',
|
|
24
|
+
'image-preview__thumbnail.is-active': 'is-active',
|
|
25
|
+
'image-preview__thumbnail-img': '^image-preview__thumbnail-img',
|
|
26
|
+
};
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { Root, DialogService } from './root';
|
|
2
|
+
export { ConfigProvider } from './config-provider';
|
|
3
|
+
export { Accordion } from './accordion';
|
|
4
|
+
export { Affix } from './affix';
|
|
5
|
+
export { Alert } from './alert';
|
|
6
|
+
export { Anchor } from './anchor';
|
|
7
|
+
export { Avatar } from './avatar';
|
|
8
|
+
export { Badge } from './badge';
|
|
9
|
+
export { Breadcrumb } from './breadcrumb';
|
|
10
|
+
export { Button } from './button';
|
|
11
|
+
export { Card } from './card';
|
|
12
|
+
export { Cascader } from './cascader';
|
|
13
|
+
export { Checkbox } from './checkbox';
|
|
14
|
+
export { Compose } from './compose';
|
|
15
|
+
export { DatePicker } from './date-picker';
|
|
16
|
+
export { Drawer } from './drawer';
|
|
17
|
+
export { Dropdown } from './dropdown';
|
|
18
|
+
export { Empty } from './empty';
|
|
19
|
+
export { Fab } from './fab';
|
|
20
|
+
export { AbstractControl, FormControl, FormGroup, Validators, Form, useForm, FormGroupContext } from './form';
|
|
21
|
+
export { Icon } from './icon';
|
|
22
|
+
export { Image } from './image';
|
|
23
|
+
export { Input } from './input';
|
|
24
|
+
export { Menu } from './menu';
|
|
25
|
+
export { Modal } from './modal';
|
|
26
|
+
export { Notification } from './notification';
|
|
27
|
+
export { Pagination } from './pagination';
|
|
28
|
+
export { Popover } from './popover';
|
|
29
|
+
export { Progress } from './progress';
|
|
30
|
+
export { Radio } from './radio';
|
|
31
|
+
export { Rating } from './rating';
|
|
32
|
+
export { Select } from './select';
|
|
33
|
+
export { Separator } from './separator';
|
|
34
|
+
export { Skeleton } from './skeleton';
|
|
35
|
+
export { Slider } from './slider';
|
|
36
|
+
export { Slides } from './slides';
|
|
37
|
+
export { Spinner } from './spinner';
|
|
38
|
+
export { Stepper } from './stepper';
|
|
39
|
+
export { Switch } from './switch';
|
|
40
|
+
export { Table } from './table';
|
|
41
|
+
export { Tabs } from './tabs';
|
|
42
|
+
export { Tag } from './tag';
|
|
43
|
+
export { Textarea } from './textarea';
|
|
44
|
+
export { TimePicker } from './time-picker';
|
|
45
|
+
export { Timeline } from './timeline';
|
|
46
|
+
export { Toast } from './toast';
|
|
47
|
+
export { Tooltip } from './tooltip';
|
|
48
|
+
export { Transfer } from './transfer';
|
|
49
|
+
export { Tree } from './tree';
|
|
50
|
+
export { TreeSelect } from './tree-select';
|
|
51
|
+
export { Upload } from './upload';
|
|
52
|
+
export { VirtualScroll } from './virtual-scroll';
|
package/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export { Root, DialogService } from './root';
|
|
2
|
+
export { ConfigProvider } from './config-provider';
|
|
3
|
+
export { Accordion } from './accordion';
|
|
4
|
+
export { Affix } from './affix';
|
|
5
|
+
export { Alert } from './alert';
|
|
6
|
+
export { Anchor } from './anchor';
|
|
7
|
+
export { Avatar } from './avatar';
|
|
8
|
+
export { Badge } from './badge';
|
|
9
|
+
export { Breadcrumb } from './breadcrumb';
|
|
10
|
+
export { Button } from './button';
|
|
11
|
+
export { Card } from './card';
|
|
12
|
+
export { Cascader } from './cascader';
|
|
13
|
+
export { Checkbox } from './checkbox';
|
|
14
|
+
export { Compose } from './compose';
|
|
15
|
+
export { DatePicker } from './date-picker';
|
|
16
|
+
export { Drawer } from './drawer';
|
|
17
|
+
export { Dropdown } from './dropdown';
|
|
18
|
+
export { Empty } from './empty';
|
|
19
|
+
export { Fab } from './fab';
|
|
20
|
+
export { AbstractControl, FormControl, FormGroup, Validators, Form, useForm, FormGroupContext } from './form';
|
|
21
|
+
export { Icon } from './icon';
|
|
22
|
+
export { Image } from './image';
|
|
23
|
+
export { Input } from './input';
|
|
24
|
+
export { Menu } from './menu';
|
|
25
|
+
export { Modal } from './modal';
|
|
26
|
+
export { Notification } from './notification';
|
|
27
|
+
export { Pagination } from './pagination';
|
|
28
|
+
export { Popover } from './popover';
|
|
29
|
+
export { Progress } from './progress';
|
|
30
|
+
export { Radio } from './radio';
|
|
31
|
+
export { Rating } from './rating';
|
|
32
|
+
export { Select } from './select';
|
|
33
|
+
export { Separator } from './separator';
|
|
34
|
+
export { Skeleton } from './skeleton';
|
|
35
|
+
export { Slider } from './slider';
|
|
36
|
+
export { Slides } from './slides';
|
|
37
|
+
export { Spinner } from './spinner';
|
|
38
|
+
export { Stepper } from './stepper';
|
|
39
|
+
export { Switch } from './switch';
|
|
40
|
+
export { Table } from './table';
|
|
41
|
+
export { Tabs } from './tabs';
|
|
42
|
+
export { Tag } from './tag';
|
|
43
|
+
export { Textarea } from './textarea';
|
|
44
|
+
export { TimePicker } from './time-picker';
|
|
45
|
+
export { Timeline } from './timeline';
|
|
46
|
+
export { Toast } from './toast';
|
|
47
|
+
export { Tooltip } from './tooltip';
|
|
48
|
+
export { Transfer } from './transfer';
|
|
49
|
+
export { Tree } from './tree';
|
|
50
|
+
export { TreeSelect } from './tree-select';
|
|
51
|
+
export { Upload } from './upload';
|
|
52
|
+
export { VirtualScroll } from './virtual-scroll';
|
package/input/Input.d.ts
ADDED
package/input/Input.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useForkRef } from '@laser-ui/hooks';
|
|
4
|
+
import { checkNodeExist } from '@laser-ui/utils';
|
|
5
|
+
import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
|
|
6
|
+
import { ReactComponent as VisibilityOutlined } from '@material-design-icons/svg/outlined/visibility.svg';
|
|
7
|
+
import { ReactComponent as VisibilityOffOutlined } from '@material-design-icons/svg/outlined/visibility_off.svg';
|
|
8
|
+
import { useRef } from 'react';
|
|
9
|
+
import { InputNumber } from './InputNumber';
|
|
10
|
+
import { CLASSES } from './vars';
|
|
11
|
+
import { useComponentProps, useControlled, useDesign, useScopedProps, useStyled, useTranslation } from '../hooks';
|
|
12
|
+
import { Icon } from '../icon';
|
|
13
|
+
import { mergeCS } from '../utils';
|
|
14
|
+
export const Input = (props) => {
|
|
15
|
+
const _a = useComponentProps('Input', props), { styleOverrides, styleProvider, formControl, model, defaultModel, type, prefix, suffix, password: passwordProp, defaultPassword, clearable, placeholder, size: sizeProp, disabled: disabledProp = false, inputRef: inputRefProp, inputRender, onModelChange, onClear, onPasswordChange } = _a, restProps = __rest(_a, ["styleOverrides", "styleProvider", "formControl", "model", "defaultModel", "type", "prefix", "suffix", "password", "defaultPassword", "clearable", "placeholder", "size", "disabled", "inputRef", "inputRender", "onModelChange", "onClear", "onPasswordChange"]);
|
|
16
|
+
const styled = useStyled(CLASSES, { input: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.input }, styleOverrides);
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const inputRef = useRef(null);
|
|
19
|
+
const combineInputRef = useForkRef(inputRef, inputRefProp);
|
|
20
|
+
const [value, changeValue] = useControlled(defaultModel !== null && defaultModel !== void 0 ? defaultModel : '', model, onModelChange, undefined, formControl === null || formControl === void 0 ? void 0 : formControl.control);
|
|
21
|
+
const [password, changePassword] = useControlled(defaultPassword !== null && defaultPassword !== void 0 ? defaultPassword : true, passwordProp, onPasswordChange);
|
|
22
|
+
const { size, disabled } = useScopedProps({ size: sizeProp, disabled: disabledProp || (formControl === null || formControl === void 0 ? void 0 : formControl.control.disabled) });
|
|
23
|
+
const preventBlur = (e) => {
|
|
24
|
+
if (document.activeElement === inputRef.current && e.target !== inputRef.current && e.button === 0) {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
const designProps = useDesign({ compose: { disabled }, form: formControl });
|
|
29
|
+
const inputNode = (_jsx("input", Object.assign({}, styled('input__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: combineInputRef, value: value, type: type === 'password' ? (password ? 'password' : 'text') : type, placeholder: placeholder, disabled: disabled, onChange: (e) => {
|
|
30
|
+
changeValue(e.currentTarget.value);
|
|
31
|
+
} })));
|
|
32
|
+
return (_jsxs("div", Object.assign({}, restProps, mergeCS(styled('input', `input--${size}`, {
|
|
33
|
+
'input.is-disabled': disabled,
|
|
34
|
+
}), {
|
|
35
|
+
className: restProps.className,
|
|
36
|
+
style: restProps.style,
|
|
37
|
+
}), designProps, { onMouseDown: (e) => {
|
|
38
|
+
var _a;
|
|
39
|
+
(_a = restProps.onMouseDown) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
40
|
+
preventBlur(e);
|
|
41
|
+
}, onMouseUp: (e) => {
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = restProps.onMouseUp) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
44
|
+
preventBlur(e);
|
|
45
|
+
}, onClick: (e) => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
(_a = restProps.onClick) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
48
|
+
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus({ preventScroll: true });
|
|
49
|
+
}, children: [checkNodeExist(prefix) && _jsx("div", Object.assign({}, styled('input__prefix'), { children: prefix })), inputRender ? inputRender(inputNode) : inputNode, clearable && !disabled && (_jsx("div", Object.assign({}, mergeCS(styled('input__clear'), { style: { opacity: value.length > 0 ? 1 : 0 } }), { role: "button", "aria-label": t('Clear'), onClick: () => {
|
|
50
|
+
changeValue('');
|
|
51
|
+
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
52
|
+
}, children: _jsx(Icon, { children: _jsx(CancelFilled, {}) }) }))), type === 'password' && !disabled && (_jsx("div", Object.assign({}, styled('input__password'), { role: "button", "aria-label": t('Input', password ? 'Password is not visible' : 'Password is visible'), onClick: () => {
|
|
53
|
+
changePassword((prevPassword) => !prevPassword);
|
|
54
|
+
}, children: password ? (_jsx(Icon, { children: _jsx(VisibilityOffOutlined, {}) })) : (_jsx(Icon, { children: _jsx(VisibilityOutlined, {}) })) }))), checkNodeExist(suffix) && _jsx("div", Object.assign({}, styled('input__suffix'), { children: suffix }))] })));
|
|
55
|
+
};
|
|
56
|
+
Input.Number = InputNumber;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useAsync, useEvent, useForceUpdate, useForkRef, useRefExtra } from '@laser-ui/hooks';
|
|
4
|
+
import { checkNodeExist } from '@laser-ui/utils';
|
|
5
|
+
import { ReactComponent as CancelFilled } from '@material-design-icons/svg/filled/cancel.svg';
|
|
6
|
+
import { ReactComponent as KeyboardArrowDownOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_down.svg';
|
|
7
|
+
import { ReactComponent as KeyboardArrowUpOutlined } from '@material-design-icons/svg/outlined/keyboard_arrow_up.svg';
|
|
8
|
+
import { isNull, isUndefined } from 'lodash';
|
|
9
|
+
import { useRef } from 'react';
|
|
10
|
+
import { CLASSES } from './vars';
|
|
11
|
+
import { useComponentProps, useControlled, useDesign, useScopedProps, useStyled, useTranslation } from '../hooks';
|
|
12
|
+
import { Icon } from '../icon';
|
|
13
|
+
import { mergeCS } from '../utils';
|
|
14
|
+
export function InputNumber(props) {
|
|
15
|
+
const _a = useComponentProps('InputNumber', props), { styleOverrides, styleProvider, formControl, model, defaultModel, max, min, step = 1, integer = false, prefix, suffix, clearable, placeholder, size: sizeProp, numberButton = true, disabled: disabledProp = false, inputRef: inputRefProp, inputRender, onModelChange, onClear } = _a, restProps = __rest(_a, ["styleOverrides", "styleProvider", "formControl", "model", "defaultModel", "max", "min", "step", "integer", "prefix", "suffix", "clearable", "placeholder", "size", "numberButton", "disabled", "inputRef", "inputRender", "onModelChange", "onClear"]);
|
|
16
|
+
const styled = useStyled(CLASSES, { input: styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider.input }, styleOverrides);
|
|
17
|
+
const async = useAsync();
|
|
18
|
+
const { t } = useTranslation();
|
|
19
|
+
const forceUpdate = useForceUpdate();
|
|
20
|
+
const dataRef = useRef({
|
|
21
|
+
inputFocused: false,
|
|
22
|
+
});
|
|
23
|
+
const inputRef = useRef(null);
|
|
24
|
+
const combineInputRef = useForkRef(inputRef, inputRefProp);
|
|
25
|
+
const windowRef = useRefExtra(() => window);
|
|
26
|
+
const [value, _changeValue] = useControlled(defaultModel !== null && defaultModel !== void 0 ? defaultModel : null, model, onModelChange, undefined, formControl === null || formControl === void 0 ? void 0 : formControl.control);
|
|
27
|
+
const inputValue = dataRef.current.inputFocused && !isUndefined(dataRef.current.inputValue)
|
|
28
|
+
? dataRef.current.inputValue
|
|
29
|
+
: isNull(value)
|
|
30
|
+
? ''
|
|
31
|
+
: value.toString();
|
|
32
|
+
const changeValue = (val) => {
|
|
33
|
+
if ((isNull(val) ? '' : val.toString()) !== inputValue) {
|
|
34
|
+
forceUpdate();
|
|
35
|
+
}
|
|
36
|
+
dataRef.current.inputValue = undefined;
|
|
37
|
+
_changeValue(val);
|
|
38
|
+
};
|
|
39
|
+
const { size, disabled } = useScopedProps({ size: sizeProp, disabled: disabledProp || (formControl === null || formControl === void 0 ? void 0 : formControl.control.disabled) });
|
|
40
|
+
const getValue = (val) => { var _a, _b; return Number(Math.max(min !== null && min !== void 0 ? min : -Infinity, Math.min(max !== null && max !== void 0 ? max : Infinity, val)).toFixed((_b = (_a = step.toString().split('.')[1]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0)); };
|
|
41
|
+
const handleNumberButtonMouseDown = (increase = true) => {
|
|
42
|
+
changeValue(getValue((() => {
|
|
43
|
+
let val = inputValue.length > 0 ? Number(inputValue) : null;
|
|
44
|
+
if (isNull(val)) {
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
if (integer && !Number.isInteger(val)) {
|
|
48
|
+
val = Math.round(val);
|
|
49
|
+
}
|
|
50
|
+
return increase ? val + step : val - step;
|
|
51
|
+
})()));
|
|
52
|
+
const loop = (prev) => {
|
|
53
|
+
const val = getValue(increase ? prev + step : prev - step);
|
|
54
|
+
changeValue(val);
|
|
55
|
+
dataRef.current.clearLoop = async.setTimeout(() => loop(val), 50);
|
|
56
|
+
};
|
|
57
|
+
dataRef.current.clearTid = async.setTimeout(() => loop(Number(inputValue)), 400);
|
|
58
|
+
};
|
|
59
|
+
const handleNumberButtonMouseUp = () => {
|
|
60
|
+
var _a, _b, _c, _d;
|
|
61
|
+
(_b = (_a = dataRef.current).clearLoop) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
62
|
+
(_d = (_c = dataRef.current).clearTid) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
63
|
+
};
|
|
64
|
+
useEvent(windowRef, 'mouseup', handleNumberButtonMouseUp);
|
|
65
|
+
const preventBlur = (e) => {
|
|
66
|
+
if (document.activeElement === inputRef.current && e.target !== inputRef.current && e.button === 0) {
|
|
67
|
+
e.preventDefault();
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const designProps = useDesign({ compose: { disabled }, form: formControl });
|
|
71
|
+
const inputNode = (_jsx("input", Object.assign({}, styled('input__input'), formControl === null || formControl === void 0 ? void 0 : formControl.inputAria, { ref: combineInputRef, value: inputValue, max: max, min: min, step: step, type: "number", placeholder: placeholder, disabled: disabled, onChange: (e) => {
|
|
72
|
+
forceUpdate();
|
|
73
|
+
dataRef.current.inputValue = e.currentTarget.value;
|
|
74
|
+
if (e.currentTarget.value.length === 0) {
|
|
75
|
+
changeValue(null);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
const val = Number(e.currentTarget.value);
|
|
79
|
+
if ((isUndefined(max) || val <= max) && (isUndefined(min) || val >= min) && (!integer || Number.isInteger(val))) {
|
|
80
|
+
changeValue(val);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, onFocus: () => {
|
|
84
|
+
dataRef.current.inputFocused = true;
|
|
85
|
+
dataRef.current.inputValue = undefined;
|
|
86
|
+
}, onBlur: () => {
|
|
87
|
+
dataRef.current.inputFocused = false;
|
|
88
|
+
if (inputValue.length === 0) {
|
|
89
|
+
changeValue(null);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
let val = Number(inputValue);
|
|
93
|
+
if (!isUndefined(max) && val > max) {
|
|
94
|
+
val = max;
|
|
95
|
+
}
|
|
96
|
+
if (!isUndefined(min) && val < min) {
|
|
97
|
+
val = min;
|
|
98
|
+
}
|
|
99
|
+
if (integer && !Number.isInteger(val)) {
|
|
100
|
+
val = Math.round(val);
|
|
101
|
+
}
|
|
102
|
+
changeValue(val);
|
|
103
|
+
}
|
|
104
|
+
} })));
|
|
105
|
+
return (_jsxs("div", Object.assign({}, restProps, mergeCS(styled('input', `input--${size}`, {
|
|
106
|
+
'input.is-disabled': disabled,
|
|
107
|
+
}), {
|
|
108
|
+
className: restProps.className,
|
|
109
|
+
style: Object.assign(Object.assign({}, restProps.style), { paddingRight: numberButton && !disabled && !checkNodeExist(suffix) ? 0 : undefined }),
|
|
110
|
+
}), designProps, { onMouseDown: (e) => {
|
|
111
|
+
var _a;
|
|
112
|
+
(_a = restProps.onMouseDown) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
113
|
+
preventBlur(e);
|
|
114
|
+
}, onMouseUp: (e) => {
|
|
115
|
+
var _a;
|
|
116
|
+
(_a = restProps.onMouseUp) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
117
|
+
preventBlur(e);
|
|
118
|
+
}, onClick: (e) => {
|
|
119
|
+
var _a, _b;
|
|
120
|
+
(_a = restProps.onClick) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
121
|
+
(_b = inputRef.current) === null || _b === void 0 ? void 0 : _b.focus({ preventScroll: true });
|
|
122
|
+
}, children: [checkNodeExist(prefix) && _jsx("div", Object.assign({}, styled('input__prefix'), { children: prefix })), inputRender ? inputRender(inputNode) : inputNode, clearable && !disabled && (_jsx("div", Object.assign({}, mergeCS(styled('input__clear'), { style: { opacity: inputValue.length > 0 ? 1 : 0 } }), { role: "button", "aria-label": t('Clear'), onClick: () => {
|
|
123
|
+
changeValue(null);
|
|
124
|
+
onClear === null || onClear === void 0 ? void 0 : onClear();
|
|
125
|
+
}, children: _jsx(Icon, { children: _jsx(CancelFilled, {}) }) }))), numberButton && !disabled && (_jsxs("div", Object.assign({}, styled('input__number-container'), { children: [_jsx("div", Object.assign({}, styled('input__number'), { role: "button", "aria-label": t('Input', 'Increase number'), onMouseDown: (e) => {
|
|
126
|
+
if (e.button === 0) {
|
|
127
|
+
handleNumberButtonMouseDown();
|
|
128
|
+
}
|
|
129
|
+
}, onTouchStart: () => {
|
|
130
|
+
handleNumberButtonMouseDown();
|
|
131
|
+
}, onTouchEnd: () => {
|
|
132
|
+
handleNumberButtonMouseUp();
|
|
133
|
+
}, children: _jsx(Icon, { children: _jsx(KeyboardArrowUpOutlined, {}) }) })), _jsx("div", Object.assign({}, styled('input__number'), { role: "button", "aria-label": t('Input', 'Decrease number'), onMouseDown: (e) => {
|
|
134
|
+
if (e.button === 0) {
|
|
135
|
+
handleNumberButtonMouseDown(false);
|
|
136
|
+
}
|
|
137
|
+
}, onTouchStart: () => {
|
|
138
|
+
handleNumberButtonMouseDown(false);
|
|
139
|
+
}, onTouchEnd: () => {
|
|
140
|
+
handleNumberButtonMouseUp();
|
|
141
|
+
}, children: _jsx(Icon, { children: _jsx(KeyboardArrowDownOutlined, {}) }) }))] }))), checkNodeExist(suffix) && _jsx("div", Object.assign({}, styled('input__suffix'), { children: suffix }))] })));
|
|
142
|
+
}
|
package/input/index.d.ts
ADDED
package/input/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input } from './Input';
|
package/input/types.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
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 InputProps extends BaseProps<'input', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'prefix'> {
|
|
7
|
+
formControl?: FormControlProvider;
|
|
8
|
+
model?: string;
|
|
9
|
+
defaultModel?: string;
|
|
10
|
+
type?: React.HTMLInputTypeAttribute;
|
|
11
|
+
prefix?: React.ReactNode;
|
|
12
|
+
suffix?: React.ReactNode;
|
|
13
|
+
password?: boolean;
|
|
14
|
+
defaultPassword?: boolean;
|
|
15
|
+
clearable?: boolean;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
size?: Size;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
inputRef?: React.ForwardedRef<HTMLInputElement>;
|
|
20
|
+
inputRender?: CloneHTMLElement;
|
|
21
|
+
onModelChange?: (value: string) => void;
|
|
22
|
+
onClear?: () => void;
|
|
23
|
+
onPasswordChange?: (value: boolean) => void;
|
|
24
|
+
}
|
|
25
|
+
export interface InputNumberProps extends BaseProps<'input', typeof CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children' | 'prefix'> {
|
|
26
|
+
formControl?: FormControlProvider;
|
|
27
|
+
model?: number | null;
|
|
28
|
+
defaultModel?: number | null;
|
|
29
|
+
max?: number;
|
|
30
|
+
min?: number;
|
|
31
|
+
step?: number;
|
|
32
|
+
integer?: boolean;
|
|
33
|
+
prefix?: React.ReactNode;
|
|
34
|
+
suffix?: React.ReactNode;
|
|
35
|
+
clearable?: boolean;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
size?: Size;
|
|
38
|
+
numberButton?: boolean;
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
inputRef?: React.ForwardedRef<HTMLInputElement>;
|
|
41
|
+
inputRender?: CloneHTMLElement;
|
|
42
|
+
onModelChange?: (value: number | null) => void;
|
|
43
|
+
onClear?: () => void;
|
|
44
|
+
}
|
package/input/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/input/vars.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const CLASSES: {
|
|
2
|
+
input: string;
|
|
3
|
+
'input.is-disabled': string;
|
|
4
|
+
'input--small': string;
|
|
5
|
+
'input--medium': string;
|
|
6
|
+
'input--large': string;
|
|
7
|
+
input__prefix: string;
|
|
8
|
+
input__input: string;
|
|
9
|
+
input__clear: string;
|
|
10
|
+
input__password: string;
|
|
11
|
+
input__suffix: string;
|
|
12
|
+
'input__number-container': string;
|
|
13
|
+
input__number: string;
|
|
14
|
+
};
|
package/input/vars.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const CLASSES = {
|
|
2
|
+
input: '^input',
|
|
3
|
+
'input.is-disabled': 'is-disabled',
|
|
4
|
+
'input--small': '^input--small',
|
|
5
|
+
'input--medium': '^input--medium',
|
|
6
|
+
'input--large': '^input--large',
|
|
7
|
+
input__prefix: '^input__prefix',
|
|
8
|
+
input__input: '^input__input',
|
|
9
|
+
input__clear: '^input__clear',
|
|
10
|
+
input__password: '^input__password',
|
|
11
|
+
input__suffix: '^input__suffix',
|
|
12
|
+
'input__number-container': '^input__number-container',
|
|
13
|
+
input__number: '^input__number',
|
|
14
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { CLASSES } from './vars';
|
|
3
|
+
import { useStyled } from '../../hooks';
|
|
4
|
+
import { mergeCS } from '../../utils';
|
|
5
|
+
export function CircularProgress(props) {
|
|
6
|
+
const styled = useStyled(CLASSES, { 'circular-progress': undefined });
|
|
7
|
+
return (_jsx("svg", Object.assign({}, props, mergeCS(styled('circular-progress'), {
|
|
8
|
+
className: props.className,
|
|
9
|
+
style: props.style,
|
|
10
|
+
}), { viewBox: "22 22 44 44", children: _jsx("circle", Object.assign({}, styled('circular-progress__circle'), { cx: 44, cy: 44, r: 18.337, strokeWidth: 3.6, fill: "none" })) })));
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CircularProgress } from './CircularProgress';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CircularProgress } from './CircularProgress';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { CLASSES } from './vars';
|
|
4
|
+
import { useStyled } from '../../hooks';
|
|
5
|
+
import { mergeCS } from '../../utils';
|
|
6
|
+
import { TTANSITION_DURING_FAST } from '../../vars';
|
|
7
|
+
import { Transition } from '../transition';
|
|
8
|
+
export function Mask(props) {
|
|
9
|
+
const { visible, onClose, afterVisibleChange } = props, restProps = __rest(props, ["visible", "onClose", "afterVisibleChange"]);
|
|
10
|
+
const styled = useStyled(CLASSES, { mask: undefined });
|
|
11
|
+
const transitionStyles = {
|
|
12
|
+
enter: { opacity: 0 },
|
|
13
|
+
entering: {
|
|
14
|
+
transition: ['opacity'].map((attr) => `${attr} ${TTANSITION_DURING_FAST}ms linear`).join(', '),
|
|
15
|
+
},
|
|
16
|
+
leaving: {
|
|
17
|
+
opacity: 0,
|
|
18
|
+
transition: ['opacity'].map((attr) => `${attr} ${TTANSITION_DURING_FAST}ms linear`).join(', '),
|
|
19
|
+
},
|
|
20
|
+
leaved: { display: 'none' },
|
|
21
|
+
};
|
|
22
|
+
return (_jsx(Transition, { enter: visible, during: TTANSITION_DURING_FAST,
|
|
23
|
+
// TODO: Should it be controllable?
|
|
24
|
+
skipFirstTransition: false, afterEnter: () => {
|
|
25
|
+
afterVisibleChange === null || afterVisibleChange === void 0 ? void 0 : afterVisibleChange(true);
|
|
26
|
+
}, afterLeave: () => {
|
|
27
|
+
afterVisibleChange === null || afterVisibleChange === void 0 ? void 0 : afterVisibleChange(false);
|
|
28
|
+
}, children: (state) => (_jsx("div", Object.assign({}, restProps, mergeCS(styled('mask'), {
|
|
29
|
+
className: restProps.className,
|
|
30
|
+
style: Object.assign(Object.assign({}, restProps.style), transitionStyles[state]),
|
|
31
|
+
}), { onClick: (e) => {
|
|
32
|
+
var _a;
|
|
33
|
+
(_a = restProps.onClick) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
34
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
35
|
+
} }))) }));
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Mask } from './Mask';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|