@rainbow-oh/yee-c 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Alert/alert.js +10 -4
- package/dist/cjs/Alert/style/index.less +3 -0
- package/dist/cjs/Anchor/anchor-item.js +6 -4
- package/dist/cjs/Anchor/anchor.js +38 -22
- package/dist/cjs/Anchor/demo/auto.d.ts +11 -0
- package/dist/cjs/Anchor/demo/auto.js +85 -0
- package/dist/cjs/Anchor/demo/basic.js +7 -1
- package/dist/cjs/Anchor/demo/controlled.js +42 -30
- package/dist/cjs/Anchor/interface.d.ts +2 -0
- package/dist/cjs/Anchor/style/index.less +2 -2
- package/dist/cjs/Button/button.d.ts +1 -1
- package/dist/cjs/Button/button.js +2 -2
- package/dist/cjs/Button/style/index.less +23 -8
- package/dist/cjs/Card/demo/collapsible.js +2 -1
- package/dist/cjs/Carousel/demo/arrows.js +1 -1
- package/dist/cjs/Carousel/demo/autoplay.js +1 -1
- package/dist/cjs/Carousel/demo/effect.js +1 -1
- package/dist/cjs/Carousel/demo/position.js +1 -1
- package/dist/cjs/Checkbox/checkbox-group.js +4 -1
- package/dist/cjs/Checkbox/demo/group.js +1 -0
- package/dist/cjs/Checkbox/interface.d.ts +5 -0
- package/dist/cjs/Checkbox/style/index.less +21 -1
- package/dist/cjs/Config-Provider/interface.d.ts +4 -0
- package/dist/cjs/Dropdown/demo/placement.js +2 -1
- package/dist/cjs/Dropdown/dropdown.js +3 -0
- package/dist/cjs/Dropdown/style/index.less +6 -0
- package/dist/cjs/Form/Field.js +64 -12
- package/dist/cjs/Form/Group.js +3 -2
- package/dist/cjs/Form/demo/form-table.js +1 -8
- package/dist/cjs/Form/demo/tooltip.d.ts +3 -0
- package/dist/cjs/Form/demo/tooltip.js +84 -0
- package/dist/cjs/Form/interface.d.ts +51 -2
- package/dist/cjs/Form/style/index.less +22 -7
- package/dist/cjs/Menu/style/index.less +2 -2
- package/dist/cjs/Popconfirm/popconfirm.js +1 -1
- package/dist/cjs/Popconfirm/style/index.less +6 -0
- package/dist/cjs/Popover/popover.js +1 -1
- package/dist/cjs/Popover/style/index.less +6 -0
- package/dist/cjs/Progress/progress.js +2 -2
- package/dist/cjs/Radio/demo/button.js +1 -0
- package/dist/cjs/Radio/interface.d.ts +4 -0
- package/dist/cjs/Radio/radio-group.js +28 -14
- package/dist/cjs/Radio/radio.js +3 -1
- package/dist/cjs/Radio/style/index.less +26 -5
- package/dist/cjs/Segmented/demo/basic.d.ts +3 -0
- package/dist/cjs/Segmented/demo/basic.js +51 -0
- package/dist/cjs/Segmented/demo/block.d.ts +3 -0
- package/dist/cjs/Segmented/demo/block.js +49 -0
- package/dist/cjs/Segmented/demo/disabled.d.ts +3 -0
- package/dist/cjs/Segmented/demo/disabled.js +47 -0
- package/dist/cjs/Segmented/demo/size.d.ts +3 -0
- package/dist/cjs/Segmented/demo/size.js +37 -0
- package/dist/cjs/Segmented/index.d.ts +3 -0
- package/dist/cjs/Segmented/index.js +36 -0
- package/dist/cjs/Segmented/interface.d.ts +82 -0
- package/dist/cjs/Segmented/interface.js +17 -0
- package/dist/cjs/Segmented/segmented.d.ts +5 -0
- package/dist/cjs/Segmented/segmented.js +177 -0
- package/dist/cjs/Segmented/style/index.less +104 -0
- package/dist/cjs/Select/option.js +3 -2
- package/dist/cjs/Select/options.js +9 -1
- package/dist/cjs/Select/select.js +1 -0
- package/dist/cjs/Skeleton/demo/basic.js +1 -1
- package/dist/cjs/Space/interface.d.ts +4 -0
- package/dist/cjs/Space/space.js +36 -16
- package/dist/cjs/Spin/spin.js +2 -1
- package/dist/cjs/Splitter/demo/basic.js +1 -1
- package/dist/cjs/Splitter/demo/vertical.js +23 -1
- package/dist/cjs/Splitter/index.d.ts +1 -1
- package/dist/cjs/Splitter/interface.d.ts +9 -3
- package/dist/cjs/Splitter/splitter-handler.d.ts +1 -1
- package/dist/cjs/Splitter/splitter-handler.js +2 -1
- package/dist/cjs/Splitter/splitter.d.ts +2 -9
- package/dist/cjs/Splitter/splitter.js +53 -50
- package/dist/cjs/Splitter/style/index.less +21 -0
- package/dist/cjs/Steps/step.js +1 -1
- package/dist/cjs/Steps/style/index.less +8 -2
- package/dist/cjs/Switch/demo/content.js +22 -1
- package/dist/cjs/Switch/style/index.less +16 -0
- package/dist/cjs/Switch/switch.js +9 -2
- package/dist/cjs/Table/demo/size.js +1 -1
- package/dist/cjs/Table/interface.d.ts +5 -1
- package/dist/cjs/Table/theader/cell.js +4 -5
- package/dist/cjs/Tabs/hooks/useTabScroll.d.ts +1 -1
- package/dist/cjs/Tabs/interface.d.ts +1 -1
- package/dist/cjs/Tabs/style/index.less +4 -0
- package/dist/cjs/Tabs/tab-header/index.js +56 -25
- package/dist/cjs/Tag/demo/size.js +1 -1
- package/dist/cjs/Tag/style/index.less +1 -0
- package/dist/cjs/Tooltip/interface.d.ts +4 -0
- package/dist/cjs/Tooltip/style/index.less +8 -8
- package/dist/cjs/Tooltip/tooltip.js +11 -3
- package/dist/cjs/Tour/demo/basic.d.ts +3 -0
- package/dist/cjs/Tour/demo/basic.js +69 -0
- package/dist/cjs/Tour/demo/indicators.d.ts +3 -0
- package/dist/cjs/Tour/demo/indicators.js +76 -0
- package/dist/cjs/Tour/demo/placement.d.ts +3 -0
- package/dist/cjs/Tour/demo/placement.js +80 -0
- package/dist/cjs/Tour/demo/scroll.d.ts +3 -0
- package/dist/cjs/Tour/demo/scroll.js +72 -0
- package/dist/cjs/Tour/index.d.ts +3 -0
- package/dist/cjs/Tour/index.js +36 -0
- package/dist/cjs/Tour/interface.d.ts +118 -0
- package/dist/cjs/Tour/interface.js +17 -0
- package/dist/cjs/Tour/style/index.less +103 -0
- package/dist/cjs/Tour/tour.d.ts +5 -0
- package/dist/cjs/Tour/tour.js +403 -0
- package/dist/cjs/Tree/demo/checkable.js +6 -6
- package/dist/cjs/Tree/demo/draggable.d.ts +3 -0
- package/dist/cjs/Tree/demo/draggable.js +88 -0
- package/dist/cjs/Tree/demo/expanded.js +6 -6
- package/dist/cjs/Tree/index.d.ts +1 -0
- package/dist/cjs/Tree/index.js +3 -1
- package/dist/cjs/Tree/interface.d.ts +26 -0
- package/dist/cjs/Tree/style/index.less +25 -0
- package/dist/cjs/Tree/tree-node.js +38 -4
- package/dist/cjs/Tree/tree.d.ts +12 -1
- package/dist/cjs/Tree/tree.js +174 -18
- package/dist/cjs/Tree/utils/tree-tools.d.ts +21 -0
- package/dist/cjs/Tree/utils/tree-tools.js +88 -0
- package/dist/cjs/Trigger/style/index.less +17 -0
- package/dist/cjs/Trigger/trigger.js +3 -1
- package/dist/cjs/hooks/useDebounceFunction.d.ts +1 -1
- package/dist/cjs/hooks/useLayoutEffect.d.ts +1 -1
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/locale/interface.d.ts +7 -0
- package/dist/cjs/locale/lang/en_US.js +6 -0
- package/dist/cjs/locale/lang/ja_JP.js +6 -0
- package/dist/cjs/locale/lang/zh_CN.js +6 -0
- package/dist/cjs/locale/lang/zh_TW.js +6 -0
- package/dist/cjs/style/color.blue.css +1 -1
- package/dist/cjs/style/color.crimson.css +1 -1
- package/dist/cjs/style/color.css +18 -1
- package/dist/cjs/style/size.css +51 -4
- package/dist/cjs/style/themes.css +3 -3
- package/dist/cjs/style/variables.css +70 -6
- package/dist/cjs/utils/debounce.d.ts +6 -1
- package/dist/cjs/utils/debounce.js +9 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Alert/alert.js +24 -8
- package/dist/esm/Alert/style/index.less +3 -0
- package/dist/esm/Anchor/anchor-item.js +6 -3
- package/dist/esm/Anchor/anchor.js +38 -19
- package/dist/esm/Anchor/demo/auto.d.ts +11 -0
- package/dist/esm/Anchor/demo/auto.js +62 -0
- package/dist/esm/Anchor/demo/basic.js +3 -1
- package/dist/esm/Anchor/demo/controlled.js +14 -9
- package/dist/esm/Anchor/interface.d.ts +2 -0
- package/dist/esm/Anchor/style/index.less +2 -2
- package/dist/esm/Button/button.d.ts +1 -1
- package/dist/esm/Button/button.js +2 -2
- package/dist/esm/Button/style/index.less +23 -8
- package/dist/esm/Card/demo/collapsible.js +2 -1
- package/dist/esm/Carousel/demo/arrows.js +1 -1
- package/dist/esm/Carousel/demo/autoplay.js +1 -1
- package/dist/esm/Carousel/demo/effect.js +1 -1
- package/dist/esm/Carousel/demo/position.js +1 -1
- package/dist/esm/Checkbox/checkbox-group.js +4 -2
- package/dist/esm/Checkbox/demo/group.js +1 -0
- package/dist/esm/Checkbox/interface.d.ts +5 -0
- package/dist/esm/Checkbox/style/index.less +21 -1
- package/dist/esm/Config-Provider/interface.d.ts +4 -0
- package/dist/esm/Dropdown/demo/placement.js +2 -1
- package/dist/esm/Dropdown/dropdown.js +6 -1
- package/dist/esm/Dropdown/style/index.less +6 -0
- package/dist/esm/Form/Field.js +53 -8
- package/dist/esm/Form/Group.js +4 -2
- package/dist/esm/Form/demo/form-table.js +8 -6
- package/dist/esm/Form/demo/tooltip.d.ts +3 -0
- package/dist/esm/Form/demo/tooltip.js +59 -0
- package/dist/esm/Form/interface.d.ts +51 -2
- package/dist/esm/Form/style/index.less +22 -7
- package/dist/esm/Menu/style/index.less +2 -2
- package/dist/esm/Popconfirm/popconfirm.js +3 -1
- package/dist/esm/Popconfirm/style/index.less +6 -0
- package/dist/esm/Popover/popover.js +3 -1
- package/dist/esm/Popover/style/index.less +6 -0
- package/dist/esm/Progress/progress.js +5 -5
- package/dist/esm/Radio/demo/button.js +1 -0
- package/dist/esm/Radio/interface.d.ts +4 -0
- package/dist/esm/Radio/radio-group.js +9 -2
- package/dist/esm/Radio/radio.js +3 -1
- package/dist/esm/Radio/style/index.less +26 -5
- package/dist/esm/Segmented/demo/basic.d.ts +3 -0
- package/dist/esm/Segmented/demo/basic.js +33 -0
- package/dist/esm/Segmented/demo/block.d.ts +3 -0
- package/dist/esm/Segmented/demo/block.js +29 -0
- package/dist/esm/Segmented/demo/disabled.d.ts +3 -0
- package/dist/esm/Segmented/demo/disabled.js +22 -0
- package/dist/esm/Segmented/demo/size.d.ts +3 -0
- package/dist/esm/Segmented/demo/size.js +15 -0
- package/dist/esm/Segmented/index.d.ts +3 -0
- package/dist/esm/Segmented/index.js +2 -0
- package/dist/esm/Segmented/interface.d.ts +82 -0
- package/dist/esm/Segmented/interface.js +1 -0
- package/dist/esm/Segmented/segmented.d.ts +5 -0
- package/dist/esm/Segmented/segmented.js +110 -0
- package/dist/esm/Segmented/style/index.less +104 -0
- package/dist/esm/Select/option.js +4 -2
- package/dist/esm/Select/options.js +5 -3
- package/dist/esm/Select/select.js +1 -0
- package/dist/esm/Skeleton/demo/basic.js +2 -8
- package/dist/esm/Space/interface.d.ts +4 -0
- package/dist/esm/Space/space.js +24 -13
- package/dist/esm/Spin/spin.js +2 -1
- package/dist/esm/Splitter/demo/basic.js +2 -0
- package/dist/esm/Splitter/demo/vertical.js +13 -5
- package/dist/esm/Splitter/index.d.ts +1 -1
- package/dist/esm/Splitter/interface.d.ts +9 -3
- package/dist/esm/Splitter/splitter-handler.d.ts +1 -1
- package/dist/esm/Splitter/splitter-handler.js +3 -1
- package/dist/esm/Splitter/splitter.d.ts +2 -9
- package/dist/esm/Splitter/splitter.js +59 -56
- package/dist/esm/Splitter/style/index.less +21 -0
- package/dist/esm/Steps/step.js +4 -1
- package/dist/esm/Steps/style/index.less +8 -2
- package/dist/esm/Switch/demo/content.js +12 -3
- package/dist/esm/Switch/style/index.less +16 -0
- package/dist/esm/Switch/switch.js +7 -5
- package/dist/esm/Table/demo/size.js +2 -7
- package/dist/esm/Table/interface.d.ts +5 -1
- package/dist/esm/Table/theader/cell.js +2 -3
- package/dist/esm/Tabs/hooks/useTabScroll.d.ts +1 -1
- package/dist/esm/Tabs/interface.d.ts +1 -1
- package/dist/esm/Tabs/style/index.less +4 -0
- package/dist/esm/Tabs/tab-header/index.js +11 -5
- package/dist/esm/Tag/demo/size.js +6 -2
- package/dist/esm/Tag/style/index.less +1 -0
- package/dist/esm/Tooltip/interface.d.ts +4 -0
- package/dist/esm/Tooltip/style/index.less +8 -8
- package/dist/esm/Tooltip/tooltip.js +14 -2
- package/dist/esm/Tour/demo/basic.d.ts +3 -0
- package/dist/esm/Tour/demo/basic.js +69 -0
- package/dist/esm/Tour/demo/indicators.d.ts +3 -0
- package/dist/esm/Tour/demo/indicators.js +73 -0
- package/dist/esm/Tour/demo/placement.d.ts +3 -0
- package/dist/esm/Tour/demo/placement.js +53 -0
- package/dist/esm/Tour/demo/scroll.d.ts +3 -0
- package/dist/esm/Tour/demo/scroll.js +58 -0
- package/dist/esm/Tour/index.d.ts +3 -0
- package/dist/esm/Tour/index.js +2 -0
- package/dist/esm/Tour/interface.d.ts +118 -0
- package/dist/esm/Tour/interface.js +1 -0
- package/dist/esm/Tour/style/index.less +103 -0
- package/dist/esm/Tour/tour.d.ts +5 -0
- package/dist/esm/Tour/tour.js +383 -0
- package/dist/esm/Tree/demo/checkable.js +6 -6
- package/dist/esm/Tree/demo/draggable.d.ts +3 -0
- package/dist/esm/Tree/demo/draggable.js +61 -0
- package/dist/esm/Tree/demo/expanded.js +6 -6
- package/dist/esm/Tree/index.d.ts +1 -0
- package/dist/esm/Tree/index.js +1 -0
- package/dist/esm/Tree/interface.d.ts +26 -0
- package/dist/esm/Tree/style/index.less +25 -0
- package/dist/esm/Tree/tree-node.js +29 -4
- package/dist/esm/Tree/tree.d.ts +12 -1
- package/dist/esm/Tree/tree.js +135 -4
- package/dist/esm/Tree/utils/tree-tools.d.ts +21 -0
- package/dist/esm/Tree/utils/tree-tools.js +128 -1
- package/dist/esm/Trigger/style/index.less +17 -0
- package/dist/esm/Trigger/trigger.js +4 -3
- package/dist/esm/hooks/useDebounceFunction.d.ts +1 -1
- package/dist/esm/hooks/useLayoutEffect.d.ts +1 -1
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/locale/interface.d.ts +7 -0
- package/dist/esm/locale/lang/en_US.js +6 -0
- package/dist/esm/locale/lang/ja_JP.js +6 -0
- package/dist/esm/locale/lang/zh_CN.js +6 -0
- package/dist/esm/locale/lang/zh_TW.js +6 -0
- package/dist/esm/style/color.blue.css +1 -1
- package/dist/esm/style/color.crimson.css +1 -1
- package/dist/esm/style/color.css +18 -1
- package/dist/esm/style/size.css +51 -4
- package/dist/esm/style/themes.css +3 -3
- package/dist/esm/style/variables.css +70 -6
- package/dist/esm/utils/debounce.d.ts +6 -1
- package/dist/esm/utils/debounce.js +9 -2
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/yee-c.min.css +3 -3
- package/dist/umd/yee-c.min.js +1 -1
- package/package.json +21 -23
- package/src/Alert/alert.tsx +10 -4
- package/src/Alert/style/index.less +3 -0
- package/src/Anchor/anchor-item.tsx +7 -2
- package/src/Anchor/anchor.tsx +49 -23
- package/src/Anchor/demo/auto.tsx +55 -0
- package/src/Anchor/demo/basic.tsx +7 -1
- package/src/Anchor/demo/controlled.tsx +18 -14
- package/src/Anchor/index.en-US.md +17 -0
- package/src/Anchor/index.zh-CN.md +17 -0
- package/src/Anchor/interface.ts +2 -0
- package/src/Anchor/style/index.less +2 -2
- package/src/Button/button.tsx +2 -2
- package/src/Button/style/index.less +23 -8
- package/src/Card/demo/collapsible.tsx +1 -0
- package/src/Carousel/demo/arrows.tsx +1 -1
- package/src/Carousel/demo/autoplay.tsx +1 -1
- package/src/Carousel/demo/effect.tsx +1 -1
- package/src/Carousel/demo/position.tsx +1 -1
- package/src/Checkbox/checkbox-group.tsx +5 -1
- package/src/Checkbox/demo/group.tsx +1 -0
- package/src/Checkbox/interface.ts +5 -0
- package/src/Checkbox/style/index.less +21 -1
- package/src/Config-Provider/index.en-US.md +2 -0
- package/src/Config-Provider/index.zh-CN.md +2 -0
- package/src/Config-Provider/interface.ts +4 -0
- package/src/Dropdown/demo/placement.tsx +1 -0
- package/src/Dropdown/dropdown.tsx +2 -0
- package/src/Dropdown/style/index.less +6 -0
- package/src/Form/Field.tsx +70 -9
- package/src/Form/Group.tsx +4 -1
- package/src/Form/demo/form-table.tsx +7 -7
- package/src/Form/demo/tooltip.tsx +72 -0
- package/src/Form/form-store.ts +1 -1
- package/src/Form/index.en-US.md +6 -0
- package/src/Form/index.zh-CN.md +87 -85
- package/src/Form/interface.ts +53 -2
- package/src/Form/style/index.less +22 -7
- package/src/Menu/style/index.less +2 -2
- package/src/Popconfirm/popconfirm.tsx +1 -1
- package/src/Popconfirm/style/index.less +6 -0
- package/src/Popover/popover.tsx +1 -1
- package/src/Popover/style/index.less +6 -0
- package/src/Progress/progress.tsx +2 -2
- package/src/Radio/demo/button.tsx +1 -0
- package/src/Radio/index.en-US.md +2 -0
- package/src/Radio/index.zh-CN.md +2 -0
- package/src/Radio/interface.ts +4 -0
- package/src/Radio/radio-group.tsx +9 -1
- package/src/Radio/radio.tsx +2 -1
- package/src/Radio/style/index.less +26 -5
- package/src/Segmented/demo/basic.tsx +24 -0
- package/src/Segmented/demo/block.tsx +17 -0
- package/src/Segmented/demo/disabled.tsx +18 -0
- package/src/Segmented/demo/size.tsx +10 -0
- package/src/Segmented/index.en-US.md +47 -0
- package/src/Segmented/index.ts +12 -0
- package/src/Segmented/index.zh-CN.md +47 -0
- package/src/Segmented/interface.ts +87 -0
- package/src/Segmented/segmented.tsx +134 -0
- package/src/Segmented/style/index.less +104 -0
- package/src/Select/option.tsx +2 -1
- package/src/Select/options.tsx +7 -2
- package/src/Select/select.tsx +1 -0
- package/src/Skeleton/demo/basic.tsx +3 -3
- package/src/Space/interface.ts +4 -0
- package/src/Space/space.tsx +40 -16
- package/src/Spin/spin.tsx +1 -0
- package/src/Splitter/demo/basic.tsx +2 -2
- package/src/Splitter/demo/vertical.tsx +19 -5
- package/src/Splitter/index.ts +5 -1
- package/src/Splitter/interface.ts +10 -3
- package/src/Splitter/splitter-handler.tsx +4 -2
- package/src/Splitter/splitter.tsx +55 -60
- package/src/Splitter/style/index.less +21 -0
- package/src/Steps/step.tsx +1 -1
- package/src/Steps/style/index.less +8 -2
- package/src/Switch/demo/content.tsx +15 -5
- package/src/Switch/style/index.less +16 -0
- package/src/Switch/switch.tsx +14 -6
- package/src/Table/demo/size.tsx +3 -3
- package/src/Table/index.en-US.md +1 -0
- package/src/Table/index.zh-CN.md +51 -50
- package/src/Table/interface.ts +5 -1
- package/src/Table/theader/cell.tsx +2 -9
- package/src/Tabs/interface.ts +1 -1
- package/src/Tabs/style/index.less +4 -0
- package/src/Tabs/tab-header/index.tsx +26 -5
- package/src/Tag/demo/size.tsx +2 -2
- package/src/Tag/style/index.less +1 -0
- package/src/Tooltip/index.en-US.md +1 -0
- package/src/Tooltip/index.zh-CN.md +1 -0
- package/src/Tooltip/interface.ts +4 -0
- package/src/Tooltip/style/index.less +8 -8
- package/src/Tooltip/tooltip.tsx +10 -1
- package/src/Tour/demo/basic.tsx +52 -0
- package/src/Tour/demo/indicators.tsx +63 -0
- package/src/Tour/demo/placement.tsx +55 -0
- package/src/Tour/demo/scroll.tsx +49 -0
- package/src/Tour/index.en-US.md +61 -0
- package/src/Tour/index.ts +10 -0
- package/src/Tour/index.zh-CN.md +61 -0
- package/src/Tour/interface.ts +126 -0
- package/src/Tour/style/index.less +103 -0
- package/src/Tour/tour.tsx +399 -0
- package/src/Tree/demo/checkable.tsx +6 -6
- package/src/Tree/demo/draggable.tsx +58 -0
- package/src/Tree/demo/expanded.tsx +7 -7
- package/src/Tree/index.en-US.md +3 -0
- package/src/Tree/index.ts +1 -0
- package/src/Tree/index.zh-CN.md +3 -0
- package/src/Tree/interface.ts +28 -0
- package/src/Tree/style/index.less +25 -0
- package/src/Tree/tree-node.tsx +26 -0
- package/src/Tree/tree.tsx +183 -2
- package/src/Tree/utils/tree-tools.ts +107 -0
- package/src/Trigger/style/index.less +17 -0
- package/src/Trigger/trigger.tsx +3 -1
- package/src/index.ts +6 -0
- package/src/locale/interface.ts +9 -0
- package/src/locale/lang/en_US.ts +7 -0
- package/src/locale/lang/ja_JP.ts +7 -0
- package/src/locale/lang/zh_CN.ts +7 -0
- package/src/locale/lang/zh_TW.ts +7 -0
- package/src/style/color.blue.css +1 -1
- package/src/style/color.crimson.css +1 -1
- package/src/style/color.css +18 -1
- package/src/style/size.css +51 -4
- package/src/utils/debounce.ts +22 -3
- package/src/version.ts +1 -1
- package/dist/cjs/utils/x.d.ts +0 -11
- package/dist/cjs/utils/x.js +0 -51
- package/dist/esm/utils/x.d.ts +0 -11
- package/dist/esm/utils/x.js +0 -49
- package/src/utils/x.ts +0 -33
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { Segmented, Space } from "../..";
|
|
8
|
+
import React, { useState } from 'react';
|
|
9
|
+
export default (function () {
|
|
10
|
+
var _useState = useState('daily'),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
value = _useState2[0],
|
|
13
|
+
setValue = _useState2[1];
|
|
14
|
+
return /*#__PURE__*/React.createElement(Space, {
|
|
15
|
+
direction: "vertical"
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
17
|
+
options: [{
|
|
18
|
+
label: 'Daily',
|
|
19
|
+
value: 'daily'
|
|
20
|
+
}, {
|
|
21
|
+
label: 'Weekly',
|
|
22
|
+
value: 'weekly'
|
|
23
|
+
}, {
|
|
24
|
+
label: 'Monthly',
|
|
25
|
+
value: 'monthly'
|
|
26
|
+
}],
|
|
27
|
+
value: value,
|
|
28
|
+
onChange: setValue
|
|
29
|
+
}), /*#__PURE__*/React.createElement(Segmented, {
|
|
30
|
+
options: ['List', 'Table', 'Chart'],
|
|
31
|
+
defaultValue: "List"
|
|
32
|
+
}), /*#__PURE__*/React.createElement("div", null, "Selected: ", value));
|
|
33
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Segmented } from "../..";
|
|
2
|
+
import { LayoutGrid, List } from 'lucide-react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export default (function () {
|
|
5
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
6
|
+
style: {
|
|
7
|
+
width: 480
|
|
8
|
+
}
|
|
9
|
+
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
10
|
+
block: true,
|
|
11
|
+
defaultValue: "list",
|
|
12
|
+
options: [{
|
|
13
|
+
label: 'List',
|
|
14
|
+
value: 'list',
|
|
15
|
+
icon: /*#__PURE__*/React.createElement(List, {
|
|
16
|
+
size: 16
|
|
17
|
+
})
|
|
18
|
+
}, {
|
|
19
|
+
label: 'Grid',
|
|
20
|
+
value: 'grid',
|
|
21
|
+
icon: /*#__PURE__*/React.createElement(LayoutGrid, {
|
|
22
|
+
size: 16
|
|
23
|
+
})
|
|
24
|
+
}, {
|
|
25
|
+
label: 'Detail',
|
|
26
|
+
value: 'detail'
|
|
27
|
+
}]
|
|
28
|
+
}));
|
|
29
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Segmented } from "../..";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export default (function () {
|
|
4
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Segmented, {
|
|
5
|
+
options: [{
|
|
6
|
+
label: 'A',
|
|
7
|
+
value: 'a'
|
|
8
|
+
}, {
|
|
9
|
+
label: 'B',
|
|
10
|
+
value: 'b',
|
|
11
|
+
disabled: true
|
|
12
|
+
}, {
|
|
13
|
+
label: 'C',
|
|
14
|
+
value: 'c'
|
|
15
|
+
}],
|
|
16
|
+
defaultValue: "a"
|
|
17
|
+
}), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(Segmented, {
|
|
18
|
+
disabled: true,
|
|
19
|
+
options: ['A', 'B', 'C'],
|
|
20
|
+
defaultValue: "A"
|
|
21
|
+
}));
|
|
22
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Segmented, Space } from "../..";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export default (function () {
|
|
4
|
+
return /*#__PURE__*/React.createElement(Space, {
|
|
5
|
+
direction: "vertical"
|
|
6
|
+
}, /*#__PURE__*/React.createElement(Segmented, {
|
|
7
|
+
size: "small",
|
|
8
|
+
options: ['Small', 'B', 'C']
|
|
9
|
+
}), /*#__PURE__*/React.createElement(Segmented, {
|
|
10
|
+
options: ['Default', 'B', 'C']
|
|
11
|
+
}), /*#__PURE__*/React.createElement(Segmented, {
|
|
12
|
+
size: "large",
|
|
13
|
+
options: ['Large', 'B', 'C']
|
|
14
|
+
}));
|
|
15
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DataAttributeProps } from '../utils/types';
|
|
3
|
+
export type SegmentedValue = string | number;
|
|
4
|
+
export type SegmentedSemanticDOM = 'item' | 'thumb';
|
|
5
|
+
export interface SegmentedLabeledOption {
|
|
6
|
+
/**
|
|
7
|
+
* Custom item class name
|
|
8
|
+
*/
|
|
9
|
+
className?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Item label
|
|
12
|
+
*/
|
|
13
|
+
label?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Item value
|
|
16
|
+
*/
|
|
17
|
+
value: SegmentedValue;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the item is disabled
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Item icon
|
|
24
|
+
*/
|
|
25
|
+
icon?: React.ReactNode;
|
|
26
|
+
}
|
|
27
|
+
export type SegmentedRawOption = SegmentedValue;
|
|
28
|
+
export type SegmentedOption = SegmentedLabeledOption | SegmentedRawOption;
|
|
29
|
+
export interface SegmentedProps extends DataAttributeProps {
|
|
30
|
+
/**
|
|
31
|
+
* Custom prefix class name
|
|
32
|
+
*/
|
|
33
|
+
prefixCls?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Custom root class name
|
|
36
|
+
*/
|
|
37
|
+
className?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Custom root style
|
|
40
|
+
*/
|
|
41
|
+
style?: React.CSSProperties;
|
|
42
|
+
/**
|
|
43
|
+
* Semantic structure class names
|
|
44
|
+
*/
|
|
45
|
+
classNames?: Partial<Record<SegmentedSemanticDOM, string>>;
|
|
46
|
+
/**
|
|
47
|
+
* Semantic structure styles
|
|
48
|
+
*/
|
|
49
|
+
styles?: Partial<Record<SegmentedSemanticDOM, React.CSSProperties>>;
|
|
50
|
+
/**
|
|
51
|
+
* Options, supports config objects or primitive shorthand (string/number)
|
|
52
|
+
*/
|
|
53
|
+
options?: SegmentedOption[];
|
|
54
|
+
/**
|
|
55
|
+
* Controlled selected value
|
|
56
|
+
*/
|
|
57
|
+
value?: SegmentedValue;
|
|
58
|
+
/**
|
|
59
|
+
* Default selected value
|
|
60
|
+
*/
|
|
61
|
+
defaultValue?: SegmentedValue;
|
|
62
|
+
/**
|
|
63
|
+
* Callback when selected value changes
|
|
64
|
+
*/
|
|
65
|
+
onChange?: (value: SegmentedValue) => void;
|
|
66
|
+
/**
|
|
67
|
+
* Whether to disable all options
|
|
68
|
+
*/
|
|
69
|
+
disabled?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Size
|
|
72
|
+
*/
|
|
73
|
+
size?: 'small' | 'default' | 'large';
|
|
74
|
+
/**
|
|
75
|
+
* Whether to fill the container width, options share the space equally
|
|
76
|
+
*/
|
|
77
|
+
block?: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Group name for the underlying radio inputs
|
|
80
|
+
*/
|
|
81
|
+
name?: string;
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["prefixCls", "className", "style", "classNames", "styles", "options", "value", "defaultValue", "disabled", "size", "block", "name", "onChange"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
|
+
import clsx from 'clsx';
|
|
16
|
+
import React, { useContext, useId, useMemo } from 'react';
|
|
17
|
+
import { motion } from 'motion/react';
|
|
18
|
+
import { GlobalContext } from "../Config-Provider";
|
|
19
|
+
import useMergedState from "../hooks/useMergedState";
|
|
20
|
+
import mergeContextToProps from "../utils/mergeContextToProps";
|
|
21
|
+
import "./style/index.less";
|
|
22
|
+
var normalizeOption = function normalizeOption(option) {
|
|
23
|
+
if (typeof option === 'string' || typeof option === 'number') {
|
|
24
|
+
return {
|
|
25
|
+
label: String(option),
|
|
26
|
+
value: option
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return option;
|
|
30
|
+
};
|
|
31
|
+
var Segmented = /*#__PURE__*/React.forwardRef(function (baseprops, ref) {
|
|
32
|
+
var _items$;
|
|
33
|
+
var _useContext = useContext(GlobalContext),
|
|
34
|
+
segmented = _useContext.segmented;
|
|
35
|
+
var props = mergeContextToProps(baseprops, segmented);
|
|
36
|
+
var uid = useId();
|
|
37
|
+
var _props$prefixCls = props.prefixCls,
|
|
38
|
+
prefixCls = _props$prefixCls === void 0 ? 'yee-segmented' : _props$prefixCls,
|
|
39
|
+
className = props.className,
|
|
40
|
+
style = props.style,
|
|
41
|
+
classNames = props.classNames,
|
|
42
|
+
styles = props.styles,
|
|
43
|
+
_props$options = props.options,
|
|
44
|
+
options = _props$options === void 0 ? [] : _props$options,
|
|
45
|
+
value = props.value,
|
|
46
|
+
defaultValue = props.defaultValue,
|
|
47
|
+
disabled = props.disabled,
|
|
48
|
+
size = props.size,
|
|
49
|
+
block = props.block,
|
|
50
|
+
_props$name = props.name,
|
|
51
|
+
name = _props$name === void 0 ? uid : _props$name,
|
|
52
|
+
onChange = props.onChange,
|
|
53
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
54
|
+
var items = useMemo(function () {
|
|
55
|
+
return options.map(normalizeOption);
|
|
56
|
+
}, [options]);
|
|
57
|
+
var firstValue = (_items$ = items[0]) === null || _items$ === void 0 ? void 0 : _items$.value;
|
|
58
|
+
var _useMergedState = useMergedState(firstValue, {
|
|
59
|
+
value: value,
|
|
60
|
+
defaultValue: defaultValue
|
|
61
|
+
}),
|
|
62
|
+
_useMergedState2 = _slicedToArray(_useMergedState, 2),
|
|
63
|
+
mergedValue = _useMergedState2[0],
|
|
64
|
+
setMergedValue = _useMergedState2[1];
|
|
65
|
+
var cls = clsx(prefixCls, _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(size), size), "".concat(prefixCls, "-block"), block), "".concat(prefixCls, "-disabled"), disabled), className);
|
|
66
|
+
var handleChange = function handleChange(itemValue) {
|
|
67
|
+
setMergedValue(itemValue);
|
|
68
|
+
onChange === null || onChange === void 0 || onChange(itemValue);
|
|
69
|
+
};
|
|
70
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
|
71
|
+
ref: ref,
|
|
72
|
+
className: cls,
|
|
73
|
+
style: style,
|
|
74
|
+
role: "radiogroup"
|
|
75
|
+
}), items.map(function (item) {
|
|
76
|
+
var selected = item.value === mergedValue;
|
|
77
|
+
var itemDisabled = disabled || item.disabled;
|
|
78
|
+
return /*#__PURE__*/React.createElement("label", {
|
|
79
|
+
key: item.value,
|
|
80
|
+
className: clsx("".concat(prefixCls, "-item"), item.className, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-item-selected"), selected), "".concat(prefixCls, "-item-disabled"), itemDisabled))
|
|
81
|
+
}, selected ? /*#__PURE__*/React.createElement(motion.span, {
|
|
82
|
+
layoutId: "".concat(prefixCls, "-thumb-").concat(uid),
|
|
83
|
+
className: clsx("".concat(prefixCls, "-thumb"), classNames === null || classNames === void 0 ? void 0 : classNames.thumb),
|
|
84
|
+
style: styles === null || styles === void 0 ? void 0 : styles.thumb,
|
|
85
|
+
transition: {
|
|
86
|
+
type: 'spring',
|
|
87
|
+
visualDuration: 0.3,
|
|
88
|
+
bounce: 0.2
|
|
89
|
+
}
|
|
90
|
+
}) : null, /*#__PURE__*/React.createElement("span", {
|
|
91
|
+
className: "".concat(prefixCls, "-item-inner")
|
|
92
|
+
}, item.icon ? /*#__PURE__*/React.createElement("span", {
|
|
93
|
+
className: "".concat(prefixCls, "-item-icon")
|
|
94
|
+
}, item.icon) : null, item.label !== undefined && item.label !== null ? /*#__PURE__*/React.createElement("span", {
|
|
95
|
+
className: "".concat(prefixCls, "-item-label")
|
|
96
|
+
}, item.label) : null), /*#__PURE__*/React.createElement("input", {
|
|
97
|
+
type: "radio",
|
|
98
|
+
className: "".concat(prefixCls, "-input"),
|
|
99
|
+
name: name,
|
|
100
|
+
value: item.value,
|
|
101
|
+
checked: selected,
|
|
102
|
+
disabled: itemDisabled,
|
|
103
|
+
onChange: function onChange() {
|
|
104
|
+
return handleChange(item.value);
|
|
105
|
+
}
|
|
106
|
+
}));
|
|
107
|
+
}));
|
|
108
|
+
});
|
|
109
|
+
Segmented.displayName = 'Segmented';
|
|
110
|
+
export default Segmented;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
@pls: .yee-segmented;
|
|
2
|
+
|
|
3
|
+
@{pls} {
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
padding: var(--yee-segmented-padding);
|
|
7
|
+
border-radius: var(--yee-segmented-border-radius);
|
|
8
|
+
background-color: var(--yee-segmented-bg-color);
|
|
9
|
+
|
|
10
|
+
&-block {
|
|
11
|
+
display: flex;
|
|
12
|
+
width: 100%;
|
|
13
|
+
|
|
14
|
+
@{pls}-item {
|
|
15
|
+
flex: 1;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-disabled {
|
|
21
|
+
cursor: not-allowed;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&-item {
|
|
25
|
+
position: relative;
|
|
26
|
+
display: inline-flex;
|
|
27
|
+
flex: none;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
padding: var(--yee-segmented-item-padding);
|
|
32
|
+
border-radius: var(--yee-segmented-item-border-radius);
|
|
33
|
+
font-size: var(--yee-segmented-font-size);
|
|
34
|
+
color: var(--yee-segmented-item-color);
|
|
35
|
+
white-space: nowrap;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
user-select: none;
|
|
38
|
+
transition: color var(--yee-segmented-transition-duration) linear;
|
|
39
|
+
|
|
40
|
+
&:hover:not(&-disabled):not(&-selected) {
|
|
41
|
+
color: var(--yee-segmented-item-hover-color);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
&-item-inner {
|
|
46
|
+
position: relative;
|
|
47
|
+
z-index: 1;
|
|
48
|
+
display: inline-flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
gap: var(--yee-segmented-item-gap);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&-item-icon {
|
|
54
|
+
display: inline-flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&-item-selected {
|
|
59
|
+
color: var(--yee-segmented-item-selected-color);
|
|
60
|
+
cursor: default;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&-item-disabled {
|
|
64
|
+
color: var(--yee-segmented-item-disabled-color);
|
|
65
|
+
cursor: not-allowed;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&-thumb {
|
|
69
|
+
position: absolute;
|
|
70
|
+
inset: 0;
|
|
71
|
+
z-index: 0;
|
|
72
|
+
border-radius: var(--yee-segmented-thumb-border-radius);
|
|
73
|
+
background-color: var(--yee-segmented-thumb-bg-color);
|
|
74
|
+
box-shadow: var(--yee-segmented-thumb-box-shadow);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&-input {
|
|
78
|
+
position: absolute;
|
|
79
|
+
inset: 0;
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100%;
|
|
82
|
+
margin: 0;
|
|
83
|
+
opacity: 0;
|
|
84
|
+
cursor: inherit;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&-item:has(&-input:focus-visible) {
|
|
88
|
+
box-shadow: 0 0 0 2px var(--yee-primary-color);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&-small {
|
|
92
|
+
@{pls}-item {
|
|
93
|
+
padding: var(--yee-segmented-item-small-padding);
|
|
94
|
+
font-size: var(--yee-segmented-font-small-size);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&-large {
|
|
99
|
+
@{pls}-item {
|
|
100
|
+
padding: var(--yee-segmented-item-large-padding);
|
|
101
|
+
font-size: var(--yee-segmented-font-large-size);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
@@ -9,7 +9,8 @@ var Option = function Option(props) {
|
|
|
9
9
|
var label = props.label,
|
|
10
10
|
value = props.value,
|
|
11
11
|
disabled = props.disabled,
|
|
12
|
-
title = props.title
|
|
12
|
+
title = props.title,
|
|
13
|
+
dataTestId = props.dataTestId;
|
|
13
14
|
var _useContext = useContext(OptionsCtx),
|
|
14
15
|
prefixCls = _useContext.prefixCls,
|
|
15
16
|
selectedKeys = _useContext.selectedKeys,
|
|
@@ -32,7 +33,8 @@ var Option = function Option(props) {
|
|
|
32
33
|
},
|
|
33
34
|
role: "option",
|
|
34
35
|
tabIndex: disabled ? undefined : 0,
|
|
35
|
-
title: htmlTitle
|
|
36
|
+
title: htmlTitle,
|
|
37
|
+
"data-testid": dataTestId
|
|
36
38
|
}, label);
|
|
37
39
|
};
|
|
38
40
|
export default Option;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["prefixCls", "options", "popupClassName", "popupStyle", "selectedKeys", "focusedKey", "onSelect"];
|
|
1
|
+
var _excluded = ["prefixCls", "options", "popupClassName", "popupStyle", "selectedKeys", "focusedKey", "dataTestId", "onSelect"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -17,6 +17,7 @@ var Options = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
17
17
|
popupStyle = props.popupStyle,
|
|
18
18
|
selectedKeys = props.selectedKeys,
|
|
19
19
|
focusedKey = props.focusedKey,
|
|
20
|
+
dataTestId = props.dataTestId,
|
|
20
21
|
onSelect = props.onSelect,
|
|
21
22
|
rest = _objectWithoutProperties(props, _excluded);
|
|
22
23
|
|
|
@@ -36,9 +37,10 @@ var Options = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
36
37
|
focusedKey: focusedKey,
|
|
37
38
|
onSelect: onSelect
|
|
38
39
|
}
|
|
39
|
-
}, options.map(function (option) {
|
|
40
|
+
}, options.map(function (option, index) {
|
|
40
41
|
return /*#__PURE__*/React.createElement(Option, _extends({}, option, {
|
|
41
|
-
key: option.value
|
|
42
|
+
key: option.value,
|
|
43
|
+
dataTestId: "".concat(dataTestId, "-").concat(index)
|
|
42
44
|
}));
|
|
43
45
|
})));
|
|
44
46
|
});
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { Card, Skeleton
|
|
1
|
+
import { Card, Skeleton } from "../..";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
export default (function () {
|
|
4
|
-
return /*#__PURE__*/React.createElement(
|
|
5
|
-
direction: "vertical",
|
|
6
|
-
gap: 16,
|
|
7
|
-
style: {
|
|
8
|
-
width: '100%'
|
|
9
|
-
}
|
|
10
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
4
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Card, {
|
|
11
5
|
title: "Basic Placeholder"
|
|
12
6
|
}, /*#__PURE__*/React.createElement(Skeleton, null)), /*#__PURE__*/React.createElement(Card, {
|
|
13
7
|
title: "With Avatar"
|
|
@@ -26,6 +26,10 @@ export interface SpaceProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
26
26
|
* Alignment
|
|
27
27
|
*/
|
|
28
28
|
align?: 'center' | 'start' | 'end' | 'baseline' | 'flex-start';
|
|
29
|
+
/***
|
|
30
|
+
* Justify content
|
|
31
|
+
* */
|
|
32
|
+
justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between';
|
|
29
33
|
/**
|
|
30
34
|
* Whether to take up the entire row
|
|
31
35
|
*/
|
package/dist/esm/Space/space.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["prefixCls", "children", "gap", "direction", "align", "wrap", "className", "style", "classNames", "styles", "block"];
|
|
2
|
+
var _excluded = ["prefixCls", "children", "gap", "direction", "align", "justify", "wrap", "className", "style", "classNames", "styles", "block"];
|
|
3
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -26,6 +26,7 @@ var Space = /*#__PURE__*/forwardRef(function (baseprops, ref) {
|
|
|
26
26
|
direction = _props$direction === void 0 ? 'horizontal' : _props$direction,
|
|
27
27
|
_props$align = props.align,
|
|
28
28
|
align = _props$align === void 0 ? direction === 'horizontal' ? 'center' : undefined : _props$align,
|
|
29
|
+
justify = props.justify,
|
|
29
30
|
wrap = props.wrap,
|
|
30
31
|
className = props.className,
|
|
31
32
|
style = props.style,
|
|
@@ -45,20 +46,29 @@ var Space = /*#__PURE__*/forwardRef(function (baseprops, ref) {
|
|
|
45
46
|
if (!children) {
|
|
46
47
|
return null;
|
|
47
48
|
}
|
|
49
|
+
var loop = function loop(childs) {
|
|
50
|
+
var res = [];
|
|
51
|
+
childs.forEach(function (child, index) {
|
|
52
|
+
var isItem = /*#__PURE__*/React.isValidElement(child) && child.type.isSpaceItem;
|
|
53
|
+
var itemClassName = isItem ? child.props.className : undefined;
|
|
54
|
+
var itemStyle = isItem ? child.props.style : undefined;
|
|
55
|
+
var itemChildren = isItem ? child.props.children : child;
|
|
56
|
+
if ( /*#__PURE__*/React.isValidElement(child) && child.type === React.Fragment) {
|
|
57
|
+
res = res.concat(loop(React.Children.toArray(child.props.children)));
|
|
58
|
+
} else {
|
|
59
|
+
res.push( /*#__PURE__*/React.createElement("div", {
|
|
60
|
+
className: clsx("".concat(prefixCls, "-item"), classNames === null || classNames === void 0 ? void 0 : classNames.item, itemClassName),
|
|
61
|
+
style: _objectSpread(_objectSpread({}, styles === null || styles === void 0 ? void 0 : styles.item), itemStyle),
|
|
62
|
+
key: index
|
|
63
|
+
}, itemChildren));
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return res;
|
|
67
|
+
};
|
|
48
68
|
var childs = React.Children.toArray(children).filter(function (child) {
|
|
49
69
|
return child !== null && child !== undefined;
|
|
50
70
|
});
|
|
51
|
-
return childs
|
|
52
|
-
var isItem = /*#__PURE__*/React.isValidElement(child) && child.type.isSpaceItem;
|
|
53
|
-
var itemClassName = isItem ? child.props.className : undefined;
|
|
54
|
-
var itemStyle = isItem ? child.props.style : undefined;
|
|
55
|
-
var itemChildren = isItem ? child.props.children : child;
|
|
56
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
-
className: clsx("".concat(prefixCls, "-item"), classNames === null || classNames === void 0 ? void 0 : classNames.item, itemClassName),
|
|
58
|
-
style: _objectSpread(_objectSpread({}, styles === null || styles === void 0 ? void 0 : styles.item), itemStyle),
|
|
59
|
-
key: index
|
|
60
|
-
}, itemChildren);
|
|
61
|
-
});
|
|
71
|
+
return loop(childs);
|
|
62
72
|
};
|
|
63
73
|
var packed = pack();
|
|
64
74
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
|
@@ -66,7 +76,8 @@ var Space = /*#__PURE__*/forwardRef(function (baseprops, ref) {
|
|
|
66
76
|
style: _objectSpread({
|
|
67
77
|
width: block ? '100%' : undefined,
|
|
68
78
|
gap: gap + 'px',
|
|
69
|
-
alignItems: getAlign()
|
|
79
|
+
alignItems: getAlign(),
|
|
80
|
+
justifyContent: justify
|
|
70
81
|
}, style),
|
|
71
82
|
ref: componentRef
|
|
72
83
|
}), packed);
|
package/dist/esm/Spin/spin.js
CHANGED
|
@@ -45,7 +45,8 @@ var Spin = function Spin(baseprops) {
|
|
|
45
45
|
classNames: classNames,
|
|
46
46
|
styles: styles,
|
|
47
47
|
size: size,
|
|
48
|
-
variant: variant
|
|
48
|
+
variant: variant,
|
|
49
|
+
color: color
|
|
49
50
|
}), tip && /*#__PURE__*/React.createElement("span", {
|
|
50
51
|
className: clsx("".concat(prefixCls, "-tip"), classNames === null || classNames === void 0 ? void 0 : classNames.tip),
|
|
51
52
|
style: styles === null || styles === void 0 ? void 0 : styles.tip
|
|
@@ -7,11 +7,13 @@ export default (function () {
|
|
|
7
7
|
}
|
|
8
8
|
}, /*#__PURE__*/React.createElement(Splitter, null, /*#__PURE__*/React.createElement(Splitter.Item, null, /*#__PURE__*/React.createElement("div", {
|
|
9
9
|
style: {
|
|
10
|
+
margin: 8,
|
|
10
11
|
padding: 16,
|
|
11
12
|
backgroundColor: '#f0f0f0'
|
|
12
13
|
}
|
|
13
14
|
}, "Left Panel")), /*#__PURE__*/React.createElement(Splitter.Item, null, /*#__PURE__*/React.createElement("div", {
|
|
14
15
|
style: {
|
|
16
|
+
margin: 8,
|
|
15
17
|
padding: 16,
|
|
16
18
|
backgroundColor: '#e0e0e0'
|
|
17
19
|
}
|
|
@@ -3,19 +3,27 @@ import React from 'react';
|
|
|
3
3
|
export default (function () {
|
|
4
4
|
return /*#__PURE__*/React.createElement("div", {
|
|
5
5
|
style: {
|
|
6
|
-
height:
|
|
6
|
+
height: 500
|
|
7
7
|
}
|
|
8
8
|
}, /*#__PURE__*/React.createElement(Splitter, {
|
|
9
9
|
layout: "vertical"
|
|
10
|
-
}, /*#__PURE__*/React.createElement(Splitter.Item,
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Splitter.Item, {
|
|
11
|
+
size: 250
|
|
12
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
11
13
|
style: {
|
|
14
|
+
marginBottom: 8,
|
|
12
15
|
padding: 16,
|
|
13
|
-
backgroundColor: '#f0f0f0'
|
|
16
|
+
backgroundColor: '#f0f0f0',
|
|
17
|
+
height: '100%'
|
|
14
18
|
}
|
|
15
|
-
}, "Top Panel")), /*#__PURE__*/React.createElement(Splitter.Item,
|
|
19
|
+
}, "Top Panel")), /*#__PURE__*/React.createElement(Splitter.Item, {
|
|
20
|
+
size: 250
|
|
21
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
16
22
|
style: {
|
|
23
|
+
marginTop: 8,
|
|
17
24
|
padding: 16,
|
|
18
|
-
backgroundColor: '#e0e0e0'
|
|
25
|
+
backgroundColor: '#e0e0e0',
|
|
26
|
+
height: '100%'
|
|
19
27
|
}
|
|
20
28
|
}, "Bottom Panel"))));
|
|
21
29
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import InternalSplitter from './splitter';
|
|
2
2
|
import Item from './splitter-item';
|
|
3
|
-
export type { SplitterItemProps, SplitterProps } from './interface';
|
|
3
|
+
export type { SplitterItemProps, PanelRect as SplitterPanelRect, SplitterProps, } from './interface';
|
|
4
4
|
type SplitterType = typeof InternalSplitter & {
|
|
5
5
|
Item: typeof Item;
|
|
6
6
|
};
|