@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,62 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useImmer } from '@laser-ui/hooks';
|
|
4
|
+
import { ReactComponent as InsertDriveFileTwoTone } from '@material-design-icons/svg/two-tone/insert_drive_file.svg';
|
|
5
|
+
import { isNumber, isUndefined } from 'lodash';
|
|
6
|
+
import { Children, cloneElement, useContext } from 'react';
|
|
7
|
+
import { UploadAction } from './UploadAction';
|
|
8
|
+
import { PICTURE_LIST_CLASSES, UploadContext } from './vars';
|
|
9
|
+
import { useComponentProps, useNextTick, useStyled } from '../hooks';
|
|
10
|
+
import { Icon } from '../icon';
|
|
11
|
+
import { CircularProgress } from '../internal/circular-progress';
|
|
12
|
+
import { CollapseTransition } from '../internal/transition';
|
|
13
|
+
import { Progress } from '../progress';
|
|
14
|
+
import { mergeCS } from '../utils';
|
|
15
|
+
import { TTANSITION_DURING_BASE } from '../vars';
|
|
16
|
+
export function UploadPictureList(props) {
|
|
17
|
+
const _a = useComponentProps('UploadPictureList', props), { styleOverrides, styleProvider, actions, defaultActions } = _a, restProps = __rest(_a, ["styleOverrides", "styleProvider", "actions", "defaultActions"]);
|
|
18
|
+
const styled = useStyled(PICTURE_LIST_CLASSES, { 'upload-picture-list': styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider['upload-picture-list'] }, styleOverrides);
|
|
19
|
+
const { files, onRemove } = useContext(UploadContext);
|
|
20
|
+
const nextTick = useNextTick();
|
|
21
|
+
const [removeUIDs, setRemoveUIDs] = useImmer([]);
|
|
22
|
+
return (_jsx("ul", Object.assign({}, restProps, mergeCS(styled('upload-picture-list'), {
|
|
23
|
+
className: restProps.className,
|
|
24
|
+
style: restProps.style,
|
|
25
|
+
}), { children: files.map((file, index) => (_jsx(CollapseTransition, { originalSize: {
|
|
26
|
+
height: 'auto',
|
|
27
|
+
}, collapsedSize: {
|
|
28
|
+
height: 0,
|
|
29
|
+
}, enter: !removeUIDs.includes(file.uid), during: TTANSITION_DURING_BASE, styles: {
|
|
30
|
+
entering: {
|
|
31
|
+
transition: ['height', 'padding', 'margin'].map((attr) => `${attr} ${TTANSITION_DURING_BASE}ms ease-out`).join(', '),
|
|
32
|
+
},
|
|
33
|
+
leaving: {
|
|
34
|
+
transition: ['height', 'padding', 'margin'].map((attr) => `${attr} ${TTANSITION_DURING_BASE}ms ease-in`).join(', '),
|
|
35
|
+
},
|
|
36
|
+
leaved: { display: 'none' },
|
|
37
|
+
}, skipFirstTransition: nextTick.current ? false : true, afterLeave: () => {
|
|
38
|
+
setRemoveUIDs((draft) => {
|
|
39
|
+
draft.splice(draft.findIndex((uid) => uid === file.uid), 1);
|
|
40
|
+
});
|
|
41
|
+
onRemove(file);
|
|
42
|
+
}, children: (collapseRef, collapseStyle) => (_jsxs("li", Object.assign({}, mergeCS(styled('upload-picture-list__item', {
|
|
43
|
+
[`upload-picture-list__item--${file.state}`]: file.state,
|
|
44
|
+
}), {
|
|
45
|
+
style: collapseStyle,
|
|
46
|
+
}), { ref: collapseRef, children: [_jsx("div", Object.assign({}, styled('upload-picture-list__thumbnail'), { children: file.state === 'progress' ? (_jsx(Icon, { size: 28, children: _jsx(CircularProgress, {}) })) : file.thumbUrl ? (_jsx("img", Object.assign({}, styled('upload-picture-list__thumbnail-img'), { src: file.thumbUrl, alt: file.name }))) : (_jsx(Icon, { size: 28, theme: file.state === 'error' ? 'danger' : 'primary', children: _jsx(InsertDriveFileTwoTone, {}) })) })), _jsx("a", Object.assign({}, styled('upload-picture-list__link', {
|
|
47
|
+
'upload-picture-list__link.is-active': file.state === 'load' && !isUndefined(file.url),
|
|
48
|
+
}), { href: file.url, target: "_blank", rel: "noreferrer", title: file.name, onClick: (e) => {
|
|
49
|
+
if (defaultActions && defaultActions.preview) {
|
|
50
|
+
e.preventDefault();
|
|
51
|
+
defaultActions.preview(file);
|
|
52
|
+
}
|
|
53
|
+
}, children: file.name })), _jsx("div", Object.assign({}, styled('upload-picture-list__actions'), { children: Children.map(actions ? actions(file, index) : [_jsx(UploadAction, { preset: "remove" })], (action) => cloneElement(action, {
|
|
54
|
+
_file: file,
|
|
55
|
+
_defaultActions: defaultActions,
|
|
56
|
+
_onRemove: () => {
|
|
57
|
+
setRemoveUIDs((draft) => {
|
|
58
|
+
draft.push(file.uid);
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
})) })), _jsx("div", Object.assign({}, styled('upload-picture-list__progress-wrapper'), { children: isNumber(file.percent) && _jsx(Progress, { percent: file.percent, label: false, lineWidth: 2 }) }))] }))) }, file.uid))) })));
|
|
62
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ReactComponent as VisibilityOutlinedIcon } from '@material-design-icons/svg/outlined/visibility.svg';
|
|
4
|
+
import { isUndefined } from 'lodash';
|
|
5
|
+
import { forwardRef } from 'react';
|
|
6
|
+
import { ACTION_CLASSES } from './vars';
|
|
7
|
+
import { useComponentProps, useStyled, useTranslation } from '../hooks';
|
|
8
|
+
import { Icon } from '../icon';
|
|
9
|
+
import { mergeCS } from '../utils';
|
|
10
|
+
export const UploadPreviewAction = forwardRef((props, ref) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const _c = useComponentProps('UploadPreviewAction', props), { styleOverrides, styleProvider, children, disabled = false, _file, _defaultActions, _light,
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
_onRemove } = _c, restProps = __rest(_c, ["styleOverrides", "styleProvider", "children", "disabled", "_file", "_defaultActions", "_light", "_onRemove"]);
|
|
15
|
+
const styled = useStyled(ACTION_CLASSES, { 'upload-action': styleProvider === null || styleProvider === void 0 ? void 0 : styleProvider['upload-action'] }, styleOverrides);
|
|
16
|
+
const { t } = useTranslation();
|
|
17
|
+
return (_jsx("a", Object.assign({}, restProps, mergeCS(styled('upload-action', 'upload-action--preview', {
|
|
18
|
+
'upload-action.is-disabled': disabled || isUndefined(_file.url),
|
|
19
|
+
'upload-action--light': _light,
|
|
20
|
+
}), {
|
|
21
|
+
className: restProps.className,
|
|
22
|
+
style: restProps.style,
|
|
23
|
+
}), { ref: ref, href: _file.url, target: (_a = restProps['target']) !== null && _a !== void 0 ? _a : '_blank', title: (_b = restProps.title) !== null && _b !== void 0 ? _b : t('Upload', 'Preview file'), onClick: (e) => {
|
|
24
|
+
var _a;
|
|
25
|
+
(_a = restProps.onClick) === null || _a === void 0 ? void 0 : _a.call(restProps, e);
|
|
26
|
+
e.stopPropagation();
|
|
27
|
+
if (_defaultActions === null || _defaultActions === void 0 ? void 0 : _defaultActions.preview) {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
_defaultActions.preview(_file);
|
|
30
|
+
}
|
|
31
|
+
}, children: children !== null && children !== void 0 ? children : (_jsx(Icon, { children: _jsx(VisibilityOutlinedIcon, {}) })) })));
|
|
32
|
+
});
|
package/upload/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Upload } from './Upload';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ACTION_CLASSES, BUTTON_CLASSES, CLASSES, LIST_CLASSES, PICTURE_CLASSES, PICTURE_LIST_CLASSES } from './vars';
|
|
3
|
+
import type { FormControlProvider } from '../form/types';
|
|
4
|
+
import type { BaseProps, CloneHTMLElement } from '../types';
|
|
5
|
+
export {};
|
|
6
|
+
export type UploadFileState = 'load' | 'error' | 'progress' | null;
|
|
7
|
+
export interface UploadFile {
|
|
8
|
+
uid: React.Key;
|
|
9
|
+
name: string;
|
|
10
|
+
state: UploadFileState;
|
|
11
|
+
url?: string;
|
|
12
|
+
thumbUrl?: string;
|
|
13
|
+
percent?: number;
|
|
14
|
+
originFile?: File;
|
|
15
|
+
response?: any;
|
|
16
|
+
}
|
|
17
|
+
export interface UploadProps extends BaseProps<'upload' | 'upload-list', typeof CLASSES>, Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children' | 'list'> {
|
|
18
|
+
children: React.ReactElement | ((render: CloneHTMLElement) => JSX.Element | null);
|
|
19
|
+
formControl?: FormControlProvider;
|
|
20
|
+
model?: UploadFile[];
|
|
21
|
+
defaultModel?: UploadFile[];
|
|
22
|
+
request?: {
|
|
23
|
+
url: string | URL;
|
|
24
|
+
method?: string;
|
|
25
|
+
responseType?: XMLHttpRequestResponseType;
|
|
26
|
+
header?: {
|
|
27
|
+
[index: string]: string;
|
|
28
|
+
};
|
|
29
|
+
body?: (file: string | Blob) => Document | XMLHttpRequestBodyInit | null | undefined;
|
|
30
|
+
custom?: (xhr: XMLHttpRequest) => void;
|
|
31
|
+
};
|
|
32
|
+
max?: number;
|
|
33
|
+
drag?: boolean;
|
|
34
|
+
customUpload?: (files: FileList) => void;
|
|
35
|
+
beforeUpload?: (file: File, files: FileList) => boolean | string | Blob | Promise<boolean | string | Blob>;
|
|
36
|
+
onModelChange?: (files: UploadFile[], data: {
|
|
37
|
+
type: 'add' | 'update' | 'remove';
|
|
38
|
+
files: UploadFile[];
|
|
39
|
+
}) => void;
|
|
40
|
+
onRemove?: (file: UploadFile) => void;
|
|
41
|
+
}
|
|
42
|
+
export interface UploadButtonProps extends BaseProps<'upload-button', typeof BUTTON_CLASSES>, Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
43
|
+
file?: UploadFile;
|
|
44
|
+
actions?: React.ReactNode[];
|
|
45
|
+
defaultActions?: {
|
|
46
|
+
preview?: (file: UploadFile) => void;
|
|
47
|
+
download?: (file: UploadFile) => void;
|
|
48
|
+
};
|
|
49
|
+
onRemove?: () => void;
|
|
50
|
+
}
|
|
51
|
+
export interface UploadActionProps extends BaseProps<'upload-action', typeof ACTION_CLASSES>, React.HTMLAttributes<HTMLDivElement> {
|
|
52
|
+
preset?: 'download' | 'remove';
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface UploadPreviewActionProps extends BaseProps<'upload-action', typeof ACTION_CLASSES>, React.AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
56
|
+
disabled?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface UploadListProps extends BaseProps<'upload-list', typeof LIST_CLASSES>, Omit<React.HTMLAttributes<HTMLUListElement>, 'children'> {
|
|
59
|
+
actions?: (file: UploadFile, index: number) => React.ReactNode[];
|
|
60
|
+
defaultActions?: {
|
|
61
|
+
preview?: (file: UploadFile) => void;
|
|
62
|
+
download?: (file: UploadFile) => void;
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface UploadPictureProps extends BaseProps<'upload-picture', typeof PICTURE_CLASSES>, React.HTMLAttributes<HTMLUListElement> {
|
|
66
|
+
actions?: (file: UploadFile, index: number) => React.ReactNode[];
|
|
67
|
+
defaultActions?: {
|
|
68
|
+
preview?: (file: UploadFile) => void;
|
|
69
|
+
download?: (file: UploadFile) => void;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export interface UploadPictureListProps extends BaseProps<'upload-picture-list', typeof PICTURE_LIST_CLASSES>, Omit<React.HTMLAttributes<HTMLUListElement>, 'children'> {
|
|
73
|
+
actions?: (file: UploadFile, index: number) => React.ReactNode[];
|
|
74
|
+
defaultActions?: {
|
|
75
|
+
preview?: (file: UploadFile) => void;
|
|
76
|
+
download?: (file: UploadFile) => void;
|
|
77
|
+
};
|
|
78
|
+
}
|
package/upload/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/upload/vars.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { UploadFile } from './types';
|
|
3
|
+
export declare const CLASSES: {
|
|
4
|
+
upload: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const BUTTON_CLASSES: {
|
|
7
|
+
'upload-button': string;
|
|
8
|
+
'upload-button.is-disabled': string;
|
|
9
|
+
'upload-button--load': string;
|
|
10
|
+
'upload-button--error': string;
|
|
11
|
+
'upload-button--progress': string;
|
|
12
|
+
'upload-button__thumbnail': string;
|
|
13
|
+
'upload-button__name': string;
|
|
14
|
+
'upload-button__actions': string;
|
|
15
|
+
'upload-button__icon': string;
|
|
16
|
+
'upload-button__text': string;
|
|
17
|
+
};
|
|
18
|
+
export declare const ACTION_CLASSES: {
|
|
19
|
+
'upload-action': string;
|
|
20
|
+
'upload-action.is-disabled': string;
|
|
21
|
+
'upload-action--light': string;
|
|
22
|
+
'upload-action--preview': string;
|
|
23
|
+
};
|
|
24
|
+
export declare const LIST_CLASSES: {
|
|
25
|
+
'upload-list': string;
|
|
26
|
+
'upload-list__item': string;
|
|
27
|
+
'upload-list__item--load': string;
|
|
28
|
+
'upload-list__item--error': string;
|
|
29
|
+
'upload-list__item--progress': string;
|
|
30
|
+
'upload-list__icon': string;
|
|
31
|
+
'upload-list__link': string;
|
|
32
|
+
'upload-list__link.is-active': string;
|
|
33
|
+
'upload-list__actions': string;
|
|
34
|
+
'upload-list__progress-wrapper': string;
|
|
35
|
+
};
|
|
36
|
+
export declare const PICTURE_CLASSES: {
|
|
37
|
+
'upload-picture': string;
|
|
38
|
+
'upload-picture__row': string;
|
|
39
|
+
'upload-picture__item': string;
|
|
40
|
+
'upload-picture__item.is-disabled': string;
|
|
41
|
+
'upload-picture__item--load': string;
|
|
42
|
+
'upload-picture__item--error': string;
|
|
43
|
+
'upload-picture__item--progress': string;
|
|
44
|
+
'upload-picture__thumbnail': string;
|
|
45
|
+
'upload-picture__name': string;
|
|
46
|
+
'upload-picture__actions': string;
|
|
47
|
+
'upload-picture__progress-text': string;
|
|
48
|
+
};
|
|
49
|
+
export declare const PICTURE_LIST_CLASSES: {
|
|
50
|
+
'upload-picture-list': string;
|
|
51
|
+
'upload-picture-list__item': string;
|
|
52
|
+
'upload-picture-list__item--load': string;
|
|
53
|
+
'upload-picture-list__item--error': string;
|
|
54
|
+
'upload-picture-list__item--progress': string;
|
|
55
|
+
'upload-picture-list__thumbnail': string;
|
|
56
|
+
'upload-picture-list__thumbnail-img': string;
|
|
57
|
+
'upload-picture-list__link': string;
|
|
58
|
+
'upload-picture-list__link.is-active': string;
|
|
59
|
+
'upload-picture-list__actions': string;
|
|
60
|
+
'upload-picture-list__progress-wrapper': string;
|
|
61
|
+
};
|
|
62
|
+
export declare const UploadContext: import("react").Context<{
|
|
63
|
+
files: UploadFile[];
|
|
64
|
+
onRemove: (file: UploadFile) => void;
|
|
65
|
+
}>;
|
package/upload/vars.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
export const CLASSES = {
|
|
3
|
+
upload: '^upload',
|
|
4
|
+
};
|
|
5
|
+
export const BUTTON_CLASSES = {
|
|
6
|
+
'upload-button': '^upload-button',
|
|
7
|
+
'upload-button.is-disabled': 'is-disabled',
|
|
8
|
+
'upload-button--load': '^upload-button--load',
|
|
9
|
+
'upload-button--error': '^upload-button--error',
|
|
10
|
+
'upload-button--progress': '^upload-button--progress',
|
|
11
|
+
'upload-button__thumbnail': '^upload-button__thumbnail',
|
|
12
|
+
'upload-button__name': '^upload-button__name',
|
|
13
|
+
'upload-button__actions': '^upload-button__actions',
|
|
14
|
+
'upload-button__icon': '^upload-button__icon',
|
|
15
|
+
'upload-button__text': '^upload-button__text',
|
|
16
|
+
};
|
|
17
|
+
export const ACTION_CLASSES = {
|
|
18
|
+
'upload-action': '^upload-action',
|
|
19
|
+
'upload-action.is-disabled': 'is-disabled',
|
|
20
|
+
'upload-action--light': '^upload-action--light',
|
|
21
|
+
'upload-action--preview': '^upload-action--preview',
|
|
22
|
+
};
|
|
23
|
+
export const LIST_CLASSES = {
|
|
24
|
+
'upload-list': '^upload-list',
|
|
25
|
+
'upload-list__item': '^upload-list__item',
|
|
26
|
+
'upload-list__item--load': '^upload-list__item--load',
|
|
27
|
+
'upload-list__item--error': '^upload-list__item--error',
|
|
28
|
+
'upload-list__item--progress': '^upload-list__item--progress',
|
|
29
|
+
'upload-list__icon': '^upload-list__icon',
|
|
30
|
+
'upload-list__link': '^upload-list__link',
|
|
31
|
+
'upload-list__link.is-active': 'is-active',
|
|
32
|
+
'upload-list__actions': '^upload-list__actions',
|
|
33
|
+
'upload-list__progress-wrapper': '^upload-list__progress-wrapper',
|
|
34
|
+
};
|
|
35
|
+
export const PICTURE_CLASSES = {
|
|
36
|
+
'upload-picture': '^upload-picture',
|
|
37
|
+
'upload-picture__row': '^upload-picture__row',
|
|
38
|
+
'upload-picture__item': '^upload-picture__item',
|
|
39
|
+
'upload-picture__item.is-disabled': 'is-disabled',
|
|
40
|
+
'upload-picture__item--load': '^upload-picture__item--load',
|
|
41
|
+
'upload-picture__item--error': '^upload-picture__item--error',
|
|
42
|
+
'upload-picture__item--progress': '^upload-picture__item--progress',
|
|
43
|
+
'upload-picture__thumbnail': '^upload-picture__thumbnail',
|
|
44
|
+
'upload-picture__name': '^upload-picture__name',
|
|
45
|
+
'upload-picture__actions': '^upload-picture__actions',
|
|
46
|
+
'upload-picture__progress-text': '^upload-picture__progress-text',
|
|
47
|
+
};
|
|
48
|
+
export const PICTURE_LIST_CLASSES = {
|
|
49
|
+
'upload-picture-list': '^upload-picture-list',
|
|
50
|
+
'upload-picture-list__item': '^upload-picture-list__item',
|
|
51
|
+
'upload-picture-list__item--load': '^upload-picture-list__item--load',
|
|
52
|
+
'upload-picture-list__item--error': '^upload-picture-list__item--error',
|
|
53
|
+
'upload-picture-list__item--progress': '^upload-picture-list__item--progress',
|
|
54
|
+
'upload-picture-list__thumbnail': '^upload-picture-list__thumbnail',
|
|
55
|
+
'upload-picture-list__thumbnail-img': '^upload-picture-list__thumbnail-img',
|
|
56
|
+
'upload-picture-list__link': '^upload-picture-list__link',
|
|
57
|
+
'upload-picture-list__link.is-active': 'is-active',
|
|
58
|
+
'upload-picture-list__actions': '^upload-picture-list__actions',
|
|
59
|
+
'upload-picture-list__progress-wrapper': '^upload-picture-list__progress-wrapper',
|
|
60
|
+
};
|
|
61
|
+
export const UploadContext = createContext({
|
|
62
|
+
files: [],
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
64
|
+
onRemove: () => { },
|
|
65
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function handleModalKeyDown(e) {
|
|
2
|
+
if (e.code === 'Tab') {
|
|
3
|
+
const focusableEls = Array.from(e.currentTarget.querySelectorAll('a[href], button, input, textarea, select, details,[tabindex]:not([tabindex="-1"])')).filter((el) => !el.hasAttribute('disabled') && !el.getAttribute('aria-hidden'));
|
|
4
|
+
if (e.shiftKey) {
|
|
5
|
+
if (document.activeElement === focusableEls[0]) {
|
|
6
|
+
e.preventDefault();
|
|
7
|
+
focusableEls[focusableEls.length - 1].focus({ preventScroll: true });
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
if (document.activeElement === focusableEls[focusableEls.length - 1]) {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
focusableEls[0].focus({ preventScroll: true });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getHorizontalSidePosition } from './position/getHorizontalSidePosition';
|
|
2
|
+
export { getPopupPosition } from './position/getPopupPosition';
|
|
3
|
+
export { getVerticalSidePosition } from './position/getVerticalSidePosition';
|
|
4
|
+
export { handleModalKeyDown } from './handleModalKeyDown';
|
|
5
|
+
export { isPrintableCharacter } from './isPrintableCharacter';
|
|
6
|
+
export { mergeCS } from './mergeCS';
|
package/utils/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getHorizontalSidePosition } from './position/getHorizontalSidePosition';
|
|
2
|
+
export { getPopupPosition } from './position/getPopupPosition';
|
|
3
|
+
export { getVerticalSidePosition } from './position/getVerticalSidePosition';
|
|
4
|
+
export { handleModalKeyDown } from './handleModalKeyDown';
|
|
5
|
+
export { isPrintableCharacter } from './isPrintableCharacter';
|
|
6
|
+
export { mergeCS } from './mergeCS';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isPrintableCharacter(c: string): false | RegExpMatchArray | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare function mergeCS(target: {
|
|
3
|
+
className: string;
|
|
4
|
+
style: React.CSSProperties;
|
|
5
|
+
}, source: {
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
}): {
|
|
9
|
+
className: string;
|
|
10
|
+
style: React.CSSProperties;
|
|
11
|
+
};
|
package/utils/mergeCS.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface HorizontalSidePosition {
|
|
2
|
+
top: number;
|
|
3
|
+
left: number;
|
|
4
|
+
transformOrigin: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function getHorizontalSidePosition(targetEl: HTMLElement, popupSize: {
|
|
7
|
+
width: number;
|
|
8
|
+
height: number;
|
|
9
|
+
}, config: {
|
|
10
|
+
placement: 'right' | 'left';
|
|
11
|
+
gap?: number;
|
|
12
|
+
inWindow?: number | false;
|
|
13
|
+
}): HorizontalSidePosition;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ROOT_DATA } from '../../root/vars';
|
|
2
|
+
export function getHorizontalSidePosition(targetEl, popupSize, config) {
|
|
3
|
+
const { width, height } = popupSize;
|
|
4
|
+
const { placement, gap = 10, inWindow = false } = config;
|
|
5
|
+
const targetRect = targetEl.getBoundingClientRect();
|
|
6
|
+
let top = targetRect.top;
|
|
7
|
+
if (inWindow !== false) {
|
|
8
|
+
top = Math.min(Math.max(top, inWindow), ROOT_DATA.windowSize.height - height - inWindow);
|
|
9
|
+
}
|
|
10
|
+
let left = placement === 'right' ? targetRect.left + targetRect.width + gap : targetRect.left - width - gap;
|
|
11
|
+
if (inWindow !== false) {
|
|
12
|
+
left = Math.min(Math.max(left, inWindow), ROOT_DATA.windowSize.width - width - inWindow);
|
|
13
|
+
}
|
|
14
|
+
const transformOrigin = placement === 'right'
|
|
15
|
+
? `left ${Math.min(targetRect.top - top + targetRect.height / 2, height)}px`
|
|
16
|
+
: `right ${Math.min(targetRect.top - top + targetRect.height / 2, height)}px`;
|
|
17
|
+
return {
|
|
18
|
+
top,
|
|
19
|
+
left,
|
|
20
|
+
transformOrigin,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PopupPlacement } from '../../types';
|
|
2
|
+
interface PopupPosition {
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
transformOrigin: string;
|
|
6
|
+
placement: PopupPlacement;
|
|
7
|
+
}
|
|
8
|
+
export declare function getPopupPosition(targetEl: HTMLElement, popupSize: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}, options: {
|
|
12
|
+
placement: PopupPlacement;
|
|
13
|
+
placementFallback: PopupPlacement;
|
|
14
|
+
placementFixed?: boolean;
|
|
15
|
+
gap?: number;
|
|
16
|
+
inWindow?: number | false;
|
|
17
|
+
}): PopupPosition;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { ROOT_DATA } from '../../root/vars';
|
|
2
|
+
export function getPopupPosition(targetEl, popupSize, options) {
|
|
3
|
+
const { width, height } = popupSize;
|
|
4
|
+
const { placement, placementFallback, placementFixed = false, gap = 10, inWindow = false } = options;
|
|
5
|
+
const bound = inWindow === false ? 0 : inWindow;
|
|
6
|
+
const targetRect = targetEl.getBoundingClientRect();
|
|
7
|
+
const updatePosition = (position) => {
|
|
8
|
+
if (inWindow !== false) {
|
|
9
|
+
position.top = Math.min(Math.max(position.top, inWindow), ROOT_DATA.windowSize.height - height - inWindow);
|
|
10
|
+
position.left = Math.min(Math.max(position.left, inWindow), ROOT_DATA.windowSize.width - width - inWindow);
|
|
11
|
+
}
|
|
12
|
+
return position;
|
|
13
|
+
};
|
|
14
|
+
const getFixedPosition = (placement) => {
|
|
15
|
+
let top = 0;
|
|
16
|
+
let left = 0;
|
|
17
|
+
let transformOrigin = 'center bottom';
|
|
18
|
+
switch (placement) {
|
|
19
|
+
case 'top':
|
|
20
|
+
top = targetRect.top - height - gap;
|
|
21
|
+
left = targetRect.left + (targetRect.width - width) / 2;
|
|
22
|
+
transformOrigin = 'center bottom';
|
|
23
|
+
break;
|
|
24
|
+
case 'top-left':
|
|
25
|
+
top = targetRect.top - height - gap;
|
|
26
|
+
left = targetRect.left;
|
|
27
|
+
transformOrigin = '20px bottom';
|
|
28
|
+
break;
|
|
29
|
+
case 'top-right':
|
|
30
|
+
top = targetRect.top - height - gap;
|
|
31
|
+
left = targetRect.left + targetRect.width - width;
|
|
32
|
+
transformOrigin = 'calc(100% - 20px) bottom';
|
|
33
|
+
break;
|
|
34
|
+
case 'right':
|
|
35
|
+
top = targetRect.top + (targetRect.height - height) / 2;
|
|
36
|
+
left = targetRect.left + targetRect.width + gap;
|
|
37
|
+
transformOrigin = 'left center';
|
|
38
|
+
break;
|
|
39
|
+
case 'right-top':
|
|
40
|
+
top = targetRect.top;
|
|
41
|
+
left = targetRect.left + targetRect.width + gap;
|
|
42
|
+
transformOrigin = 'left 12px';
|
|
43
|
+
break;
|
|
44
|
+
case 'right-bottom':
|
|
45
|
+
top = targetRect.top + targetRect.height - height;
|
|
46
|
+
left = targetRect.left + targetRect.width + gap;
|
|
47
|
+
transformOrigin = 'left calc(100% - 12px)';
|
|
48
|
+
break;
|
|
49
|
+
case 'bottom':
|
|
50
|
+
top = targetRect.top + targetRect.height + gap;
|
|
51
|
+
left = targetRect.left + (targetRect.width - width) / 2;
|
|
52
|
+
transformOrigin = 'center top';
|
|
53
|
+
break;
|
|
54
|
+
case 'bottom-left':
|
|
55
|
+
top = targetRect.top + targetRect.height + gap;
|
|
56
|
+
left = targetRect.left;
|
|
57
|
+
transformOrigin = '20px top';
|
|
58
|
+
break;
|
|
59
|
+
case 'bottom-right':
|
|
60
|
+
top = targetRect.top + targetRect.height + gap;
|
|
61
|
+
left = targetRect.left + targetRect.width - width;
|
|
62
|
+
transformOrigin = 'calc(100% - 20px) top';
|
|
63
|
+
break;
|
|
64
|
+
case 'left':
|
|
65
|
+
top = targetRect.top + (targetRect.height - height) / 2;
|
|
66
|
+
left = targetRect.left - width - gap;
|
|
67
|
+
transformOrigin = 'right center';
|
|
68
|
+
break;
|
|
69
|
+
case 'left-top':
|
|
70
|
+
top = targetRect.top;
|
|
71
|
+
left = targetRect.left - width - gap;
|
|
72
|
+
transformOrigin = 'right 12px';
|
|
73
|
+
break;
|
|
74
|
+
case 'left-bottom':
|
|
75
|
+
top = targetRect.top + targetRect.height - height;
|
|
76
|
+
left = targetRect.left - width - gap;
|
|
77
|
+
transformOrigin = 'right calc(100% - 12px)';
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
return { top, left, transformOrigin };
|
|
83
|
+
};
|
|
84
|
+
if (placementFixed) {
|
|
85
|
+
const position = getFixedPosition(placement);
|
|
86
|
+
return updatePosition(Object.assign(Object.assign({}, position), { placement }));
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const getPosition = (placements) => {
|
|
90
|
+
let position;
|
|
91
|
+
for (const placement of placements) {
|
|
92
|
+
const { top, left, transformOrigin } = getFixedPosition(placement);
|
|
93
|
+
if (placement === placementFallback) {
|
|
94
|
+
position = { top, left, transformOrigin, placement };
|
|
95
|
+
}
|
|
96
|
+
const inBound = [top, ROOT_DATA.windowSize.width - left - width, ROOT_DATA.windowSize.height - top - height, left].every((num) => num >= bound);
|
|
97
|
+
if (inBound) {
|
|
98
|
+
return { top, left, transformOrigin, placement };
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return position;
|
|
102
|
+
};
|
|
103
|
+
let position;
|
|
104
|
+
if (placement.startsWith('top')) {
|
|
105
|
+
position = getPosition([
|
|
106
|
+
placement,
|
|
107
|
+
'right',
|
|
108
|
+
'right-top',
|
|
109
|
+
'right-bottom',
|
|
110
|
+
'left',
|
|
111
|
+
'left-top',
|
|
112
|
+
'left-bottom',
|
|
113
|
+
...(placement === 'top'
|
|
114
|
+
? ['bottom', 'bottom-left', 'bottom-right']
|
|
115
|
+
: placement === 'top-left'
|
|
116
|
+
? ['bottom-left', 'bottom', 'bottom-right']
|
|
117
|
+
: ['bottom-right', 'bottom', 'bottom-left']),
|
|
118
|
+
]);
|
|
119
|
+
}
|
|
120
|
+
else if (placement.startsWith('right')) {
|
|
121
|
+
position = getPosition([
|
|
122
|
+
placement,
|
|
123
|
+
'top',
|
|
124
|
+
'top-left',
|
|
125
|
+
'top-right',
|
|
126
|
+
'bottom',
|
|
127
|
+
'bottom-left',
|
|
128
|
+
'bottom-right',
|
|
129
|
+
...(placement === 'right'
|
|
130
|
+
? ['left', 'left-top', 'left-bottom']
|
|
131
|
+
: placement === 'right-top'
|
|
132
|
+
? ['left-top', 'left', 'left-bottom']
|
|
133
|
+
: ['left-bottom', 'left', 'left-top']),
|
|
134
|
+
]);
|
|
135
|
+
}
|
|
136
|
+
else if (placement.startsWith('bottom')) {
|
|
137
|
+
position = getPosition([
|
|
138
|
+
placement,
|
|
139
|
+
'right',
|
|
140
|
+
'right-top',
|
|
141
|
+
'right-bottom',
|
|
142
|
+
'left',
|
|
143
|
+
'left-top',
|
|
144
|
+
'left-bottom',
|
|
145
|
+
...(placement === 'bottom'
|
|
146
|
+
? ['top', 'top-left', 'top-right']
|
|
147
|
+
: placement === 'bottom-left'
|
|
148
|
+
? ['top-left', 'top', 'top-right']
|
|
149
|
+
: ['top-right', 'top', 'top-left']),
|
|
150
|
+
]);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
position = getPosition([
|
|
154
|
+
placement,
|
|
155
|
+
'top',
|
|
156
|
+
'top-left',
|
|
157
|
+
'top-right',
|
|
158
|
+
'bottom',
|
|
159
|
+
'bottom-left',
|
|
160
|
+
'bottom-right',
|
|
161
|
+
...(placement === 'left'
|
|
162
|
+
? ['right', 'right-top', 'right-bottom']
|
|
163
|
+
: placement === 'left-top'
|
|
164
|
+
? ['right-top', 'right', 'right-bottom']
|
|
165
|
+
: ['right-bottom', 'right', 'right-top']),
|
|
166
|
+
]);
|
|
167
|
+
}
|
|
168
|
+
return updatePosition(position);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { VerticalSidePlacement } from '../../types';
|
|
2
|
+
interface VerticalSidePosition {
|
|
3
|
+
top: number;
|
|
4
|
+
left: number;
|
|
5
|
+
transformOrigin: string;
|
|
6
|
+
placement: VerticalSidePlacement;
|
|
7
|
+
}
|
|
8
|
+
export declare function getVerticalSidePosition(targetEl: HTMLElement, popupSize: {
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
}, config: {
|
|
12
|
+
placement: VerticalSidePlacement;
|
|
13
|
+
placementFixed?: boolean;
|
|
14
|
+
gap?: number;
|
|
15
|
+
inWindow?: number | false;
|
|
16
|
+
}): VerticalSidePosition;
|
|
17
|
+
export {};
|