@vef-framework/components 2.0.4 → 2.0.5
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/_base/constants/breakpoints.cjs +1 -16
- package/dist/cjs/_base/constants/common.cjs +1 -36
- package/dist/cjs/_base/constants/css-vars.cjs +1 -680
- package/dist/cjs/_base/constants/index.cjs +1 -21
- package/dist/cjs/_base/helpers/breakpoints.cjs +1 -30
- package/dist/cjs/_base/helpers/color.cjs +1 -16
- package/dist/cjs/_base/helpers/common.cjs +1 -22
- package/dist/cjs/_base/helpers/index.cjs +1 -40
- package/dist/cjs/_base/helpers/message.cjs +1 -53
- package/dist/cjs/_base/helpers/modal.cjs +1 -122
- package/dist/cjs/_base/helpers/notification.cjs +1 -72
- package/dist/cjs/_base/helpers/props.cjs +1 -19
- package/dist/cjs/_base/helpers/react.cjs +1 -12
- package/dist/cjs/_base/hooks/index.cjs +1 -10
- package/dist/cjs/_base/hooks/use-theme-tokens.cjs +1 -18
- package/dist/cjs/_base/index.cjs +1 -9
- package/dist/cjs/_base/styles/common.cjs +1 -29
- package/dist/cjs/_base/styles/index.cjs +1 -10
- package/dist/cjs/_base/types/breakpoints.cjs +1 -3
- package/dist/cjs/_base/types/common.cjs +1 -3
- package/dist/cjs/_base/types/index.cjs +1 -6
- package/dist/cjs/action-button/index.cjs +1 -50
- package/dist/cjs/action-button/props.cjs +1 -3
- package/dist/cjs/action-button/use-action-button.cjs +1 -58
- package/dist/cjs/action-group/index.cjs +1 -28
- package/dist/cjs/action-group/props.cjs +1 -3
- package/dist/cjs/action-group/use-action-group.cjs +1 -22
- package/dist/cjs/action-group/use-computed-action-buttons.cjs +1 -43
- package/dist/cjs/affix/index.cjs +1 -13
- package/dist/cjs/alert/index.cjs +1 -13
- package/dist/cjs/anchor/index.cjs +1 -13
- package/dist/cjs/auto-complete/index.cjs +1 -13
- package/dist/cjs/avatar/index.cjs +1 -13
- package/dist/cjs/badge/index.cjs +1 -13
- package/dist/cjs/bool/index.cjs +1 -61
- package/dist/cjs/breadcrumb/index.cjs +1 -14
- package/dist/cjs/button/index.cjs +1 -13
- package/dist/cjs/calendar/index.cjs +1 -13
- package/dist/cjs/card/index.cjs +1 -13
- package/dist/cjs/carousel/index.cjs +1 -14
- package/dist/cjs/cascader/index.cjs +1 -13
- package/dist/cjs/center/index.cjs +1 -19
- package/dist/cjs/center/props.cjs +1 -3
- package/dist/cjs/charts/chart.cjs +1 -30
- package/dist/cjs/charts/helpers/group.cjs +1 -35
- package/dist/cjs/charts/helpers/index.cjs +1 -11
- package/dist/cjs/charts/hooks/index.cjs +1 -10
- package/dist/cjs/charts/hooks/use-chart.cjs +1 -176
- package/dist/cjs/charts/index.cjs +1 -12
- package/dist/cjs/charts/themes/index.cjs +1 -16
- package/dist/cjs/charts/themes/walden-dark.cjs +1 -400
- package/dist/cjs/charts/themes/walden.cjs +1 -365
- package/dist/cjs/charts/themes/wonderland-dark.cjs +1 -400
- package/dist/cjs/charts/themes/wonderland.cjs +1 -365
- package/dist/cjs/checkbox/index.cjs +1 -13
- package/dist/cjs/code-highlighter/index.cjs +1 -46
- package/dist/cjs/code-highlighter/props.cjs +1 -3
- package/dist/cjs/col/index.cjs +1 -13
- package/dist/cjs/collapse/index.cjs +1 -13
- package/dist/cjs/color-picker/index.cjs +1 -13
- package/dist/cjs/compact/index.cjs +1 -12
- package/dist/cjs/config-provider/app.cjs +1 -35
- package/dist/cjs/config-provider/context-holder.cjs +1 -29
- package/dist/cjs/config-provider/dark-mode-context.cjs +1 -15
- package/dist/cjs/config-provider/error-fallback.cjs +1 -19
- package/dist/cjs/config-provider/global-style.cjs +1 -14
- package/dist/cjs/config-provider/index.cjs +1 -58
- package/dist/cjs/config-provider/props.cjs +1 -3
- package/dist/cjs/config-provider/use-config-provider.cjs +1 -182
- package/dist/cjs/date-picker/index.cjs +1 -14
- package/dist/cjs/descriptions/index.cjs +1 -13
- package/dist/cjs/divider/index.cjs +1 -13
- package/dist/cjs/drawer/index.cjs +1 -13
- package/dist/cjs/dropdown/index.cjs +1 -13
- package/dist/cjs/dynamic-icon/index.cjs +1 -33
- package/dist/cjs/dynamic-icon/placeholder-icon.cjs +1 -17
- package/dist/cjs/dynamic-icon/props.cjs +1 -5
- package/dist/cjs/dynamic-icon/unknown-icon.cjs +1 -19
- package/dist/cjs/empty/empty.cjs +1 -16
- package/dist/cjs/empty/index.cjs +1 -10
- package/dist/cjs/flex/index.cjs +1 -13
- package/dist/cjs/flip-text/index.cjs +1 -63
- package/dist/cjs/flip-text/props.cjs +1 -3
- package/dist/cjs/float-button/index.cjs +1 -13
- package/dist/cjs/form/components/form.cjs +1 -41
- package/dist/cjs/form/components/index.cjs +1 -16
- package/dist/cjs/form/components/reset-button.cjs +1 -30
- package/dist/cjs/form/components/submit-button.cjs +1 -31
- package/dist/cjs/form/contexts/form-context.cjs +1 -18
- package/dist/cjs/form/contexts/form-layout.cjs +1 -23
- package/dist/cjs/form/contexts/index.cjs +1 -17
- package/dist/cjs/form/fields/auto-complete/index.cjs +1 -39
- package/dist/cjs/form/fields/auto-complete/props.cjs +1 -3
- package/dist/cjs/form/fields/bool/index.cjs +1 -31
- package/dist/cjs/form/fields/bool/props.cjs +1 -3
- package/dist/cjs/form/fields/cascader/index.cjs +1 -34
- package/dist/cjs/form/fields/cascader/props.cjs +1 -3
- package/dist/cjs/form/fields/checkbox/index.cjs +1 -51
- package/dist/cjs/form/fields/checkbox/props.cjs +1 -3
- package/dist/cjs/form/fields/color-picker/index.cjs +1 -32
- package/dist/cjs/form/fields/color-picker/props.cjs +1 -3
- package/dist/cjs/form/fields/date-picker/index.cjs +1 -34
- package/dist/cjs/form/fields/date-picker/props.cjs +1 -3
- package/dist/cjs/form/fields/date-range-picker/index.cjs +1 -34
- package/dist/cjs/form/fields/date-range-picker/props.cjs +1 -3
- package/dist/cjs/form/fields/index.cjs +1 -53
- package/dist/cjs/form/fields/input/index.cjs +1 -38
- package/dist/cjs/form/fields/input/props.cjs +1 -3
- package/dist/cjs/form/fields/input-number/index.cjs +1 -35
- package/dist/cjs/form/fields/input-number/props.cjs +1 -3
- package/dist/cjs/form/fields/mentions/index.cjs +1 -35
- package/dist/cjs/form/fields/mentions/props.cjs +1 -3
- package/dist/cjs/form/fields/password/index.cjs +1 -38
- package/dist/cjs/form/fields/password/props.cjs +1 -3
- package/dist/cjs/form/fields/radio/index.cjs +1 -35
- package/dist/cjs/form/fields/radio/props.cjs +1 -3
- package/dist/cjs/form/fields/rate/index.cjs +1 -33
- package/dist/cjs/form/fields/rate/props.cjs +1 -3
- package/dist/cjs/form/fields/select/index.cjs +1 -33
- package/dist/cjs/form/fields/select/props.cjs +1 -3
- package/dist/cjs/form/fields/slider/index.cjs +1 -32
- package/dist/cjs/form/fields/slider/props.cjs +1 -3
- package/dist/cjs/form/fields/textarea/index.cjs +1 -38
- package/dist/cjs/form/fields/textarea/props.cjs +1 -3
- package/dist/cjs/form/fields/time-picker/index.cjs +1 -34
- package/dist/cjs/form/fields/time-picker/props.cjs +1 -3
- package/dist/cjs/form/fields/time-range-picker/index.cjs +1 -34
- package/dist/cjs/form/fields/time-range-picker/props.cjs +1 -3
- package/dist/cjs/form/fields/transfer/index.cjs +1 -34
- package/dist/cjs/form/fields/transfer/props.cjs +1 -3
- package/dist/cjs/form/fields/tree-select/index.cjs +1 -32
- package/dist/cjs/form/fields/tree-select/props.cjs +1 -3
- package/dist/cjs/form/fields/upload/index.cjs +1 -61
- package/dist/cjs/form/fields/upload/props.cjs +1 -3
- package/dist/cjs/form/form.cjs +1 -35
- package/dist/cjs/form/helpers/index.cjs +1 -10
- package/dist/cjs/form/helpers/with-form-item.cjs +1 -50
- package/dist/cjs/form/hooks/use-form-item-props.cjs +1 -47
- package/dist/cjs/form/hooks/use-label-width.cjs +1 -23
- package/dist/cjs/form/index.cjs +1 -14
- package/dist/cjs/form/use-form.cjs +1 -29
- package/dist/cjs/grid/context.cjs +1 -19
- package/dist/cjs/grid/grid-item.cjs +1 -43
- package/dist/cjs/grid/hooks/index.cjs +1 -21
- package/dist/cjs/grid/hooks/use-container-breakpoints.cjs +1 -23
- package/dist/cjs/grid/hooks/use-container-width.cjs +1 -48
- package/dist/cjs/grid/hooks/use-grid-collapsed.cjs +1 -19
- package/dist/cjs/grid/hooks/use-normalized-gap.cjs +1 -47
- package/dist/cjs/grid/hooks/use-responsive-breakpoint.cjs +1 -19
- package/dist/cjs/grid/hooks/use-responsive-value.cjs +1 -35
- package/dist/cjs/grid/index.cjs +1 -140
- package/dist/cjs/grid/props.cjs +1 -3
- package/dist/cjs/grid/styles.cjs +1 -30
- package/dist/cjs/group/index.cjs +1 -20
- package/dist/cjs/group/props.cjs +1 -3
- package/dist/cjs/icon/index.cjs +1 -30
- package/dist/cjs/icon/props.cjs +1 -3
- package/dist/cjs/icon-button/index.cjs +1 -40
- package/dist/cjs/icon-button/props.cjs +1 -3
- package/dist/cjs/image/index.cjs +1 -13
- package/dist/cjs/index.cjs +1 -440
- package/dist/cjs/input/index.cjs +1 -13
- package/dist/cjs/input-number/index.cjs +1 -13
- package/dist/cjs/keyboard/index.cjs +1 -48
- package/dist/cjs/keyboard/props.cjs +1 -3
- package/dist/cjs/list/index.cjs +1 -13
- package/dist/cjs/loader/index.cjs +1 -48
- package/dist/cjs/loader/props.cjs +1 -3
- package/dist/cjs/mentions/index.cjs +1 -13
- package/dist/cjs/menu/index.cjs +1 -14
- package/dist/cjs/modal/index.cjs +1 -13
- package/dist/cjs/operation-button/index.cjs +1 -33
- package/dist/cjs/operation-button/props.cjs +1 -3
- package/dist/cjs/pagination/index.cjs +1 -13
- package/dist/cjs/permission-gate/index.cjs +1 -22
- package/dist/cjs/permission-gate/props.cjs +1 -3
- package/dist/cjs/popconfirm/index.cjs +1 -13
- package/dist/cjs/popover/index.cjs +1 -13
- package/dist/cjs/progress/index.cjs +1 -13
- package/dist/cjs/qrcode/index.cjs +1 -13
- package/dist/cjs/radio/index.cjs +1 -13
- package/dist/cjs/rate/index.cjs +1 -13
- package/dist/cjs/result/index.cjs +1 -13
- package/dist/cjs/row/index.cjs +1 -13
- package/dist/cjs/scroll-area/index.cjs +1 -69
- package/dist/cjs/scroll-area/props.cjs +1 -3
- package/dist/cjs/scroll-area/styles.cjs +1 -47
- package/dist/cjs/segmented/index.cjs +1 -13
- package/dist/cjs/select/hooks/index.cjs +1 -10
- package/dist/cjs/select/hooks/use-data-options-select.cjs +1 -70
- package/dist/cjs/select/index.cjs +1 -14
- package/dist/cjs/skeleton/index.cjs +1 -13
- package/dist/cjs/slider/index.cjs +1 -13
- package/dist/cjs/space/index.cjs +1 -10
- package/dist/cjs/space/space.cjs +1 -17
- package/dist/cjs/sparkles-text/index.cjs +1 -70
- package/dist/cjs/sparkles-text/props.cjs +1 -3
- package/dist/cjs/sparkles-text/sparkle.cjs +1 -44
- package/dist/cjs/spin/index.cjs +1 -13
- package/dist/cjs/split-text/index.cjs +1 -212
- package/dist/cjs/split-text/props.cjs +1 -3
- package/dist/cjs/splitter/index.cjs +1 -13
- package/dist/cjs/stack/index.cjs +1 -19
- package/dist/cjs/stack/props.cjs +1 -3
- package/dist/cjs/statistic/index.cjs +1 -13
- package/dist/cjs/steps/index.cjs +1 -13
- package/dist/cjs/switch/index.cjs +1 -13
- package/dist/cjs/table/index.cjs +1 -59
- package/dist/cjs/table/props.cjs +1 -3
- package/dist/cjs/table/use-pagination-props.cjs +1 -52
- package/dist/cjs/tabs/index.cjs +1 -13
- package/dist/cjs/tag/index.cjs +1 -13
- package/dist/cjs/time-picker/index.cjs +1 -13
- package/dist/cjs/timeline/index.cjs +1 -13
- package/dist/cjs/tooltip/index.cjs +1 -13
- package/dist/cjs/tour/index.cjs +1 -13
- package/dist/cjs/transfer/index.cjs +1 -13
- package/dist/cjs/tree/hooks/index.cjs +1 -10
- package/dist/cjs/tree/hooks/use-data-options-tree.cjs +1 -76
- package/dist/cjs/tree/index.cjs +1 -14
- package/dist/cjs/tree-select/hooks/index.cjs +1 -10
- package/dist/cjs/tree-select/hooks/use-data-options-tree-select.cjs +1 -70
- package/dist/cjs/tree-select/index.cjs +1 -14
- package/dist/cjs/typing-animation/index.cjs +1 -61
- package/dist/cjs/typing-animation/props.cjs +1 -3
- package/dist/cjs/typography/index.cjs +1 -22
- package/dist/cjs/upload/index.cjs +1 -83
- package/dist/cjs/upload/props.cjs +1 -3
- package/dist/cjs/watermark/index.cjs +1 -13
- package/dist/es/_base/constants/breakpoints.js +4 -4
- package/dist/es/_base/constants/common.js +19 -20
- package/dist/es/_base/constants/css-vars.js +4 -4
- package/dist/es/_base/constants/index.js +15 -4
- package/dist/es/_base/helpers/breakpoints.js +19 -23
- package/dist/es/_base/helpers/color.js +9 -9
- package/dist/es/_base/helpers/common.js +10 -15
- package/dist/es/_base/helpers/index.js +34 -9
- package/dist/es/_base/helpers/message.js +32 -29
- package/dist/es/_base/helpers/modal.js +82 -87
- package/dist/es/_base/helpers/notification.js +46 -44
- package/dist/es/_base/helpers/props.js +10 -10
- package/dist/es/_base/helpers/react.js +6 -7
- package/dist/es/_base/hooks/index.js +4 -2
- package/dist/es/_base/hooks/use-theme-tokens.js +10 -11
- package/dist/es/_base/index.js +5 -6
- package/dist/es/_base/styles/common.js +10 -11
- package/dist/es/_base/styles/index.js +4 -3
- package/dist/es/_base/types/breakpoints.js +1 -1
- package/dist/es/_base/types/common.js +1 -1
- package/dist/es/_base/types/index.js +2 -3
- package/dist/es/action-button/index.js +32 -38
- package/dist/es/action-button/props.js +1 -1
- package/dist/es/action-button/use-action-button.js +31 -39
- package/dist/es/action-group/index.js +14 -22
- package/dist/es/action-group/props.js +1 -1
- package/dist/es/action-group/use-action-group.js +10 -14
- package/dist/es/action-group/use-computed-action-buttons.js +25 -38
- package/dist/es/affix/index.js +4 -2
- package/dist/es/alert/index.js +4 -2
- package/dist/es/anchor/index.js +4 -2
- package/dist/es/auto-complete/index.js +4 -2
- package/dist/es/avatar/index.js +4 -2
- package/dist/es/badge/index.js +4 -2
- package/dist/es/bool/index.js +46 -53
- package/dist/es/breadcrumb/index.js +5 -3
- package/dist/es/button/index.js +4 -2
- package/dist/es/calendar/index.js +4 -2
- package/dist/es/card/index.js +4 -2
- package/dist/es/carousel/index.js +5 -3
- package/dist/es/cascader/index.js +4 -2
- package/dist/es/center/index.js +12 -13
- package/dist/es/center/props.js +1 -1
- package/dist/es/charts/chart.js +18 -25
- package/dist/es/charts/helpers/group.js +9 -9
- package/dist/es/charts/helpers/index.js +5 -2
- package/dist/es/charts/hooks/index.js +4 -2
- package/dist/es/charts/hooks/use-chart.js +97 -139
- package/dist/es/charts/index.js +6 -4
- package/dist/es/charts/themes/index.js +10 -5
- package/dist/es/charts/themes/walden-dark.js +29 -30
- package/dist/es/charts/themes/walden.js +29 -30
- package/dist/es/charts/themes/wonderland-dark.js +29 -30
- package/dist/es/charts/themes/wonderland.js +29 -30
- package/dist/es/checkbox/index.js +4 -2
- package/dist/es/code-highlighter/index.js +30 -34
- package/dist/es/code-highlighter/props.js +1 -1
- package/dist/es/col/index.js +4 -2
- package/dist/es/collapse/index.js +4 -2
- package/dist/es/color-picker/index.js +4 -2
- package/dist/es/compact/index.js +6 -7
- package/dist/es/config-provider/app.js +20 -26
- package/dist/es/config-provider/context-holder.js +18 -20
- package/dist/es/config-provider/dark-mode-context.js +8 -9
- package/dist/es/config-provider/error-fallback.js +10 -11
- package/dist/es/config-provider/global-style.js +9 -10
- package/dist/es/config-provider/index.js +36 -37
- package/dist/es/config-provider/props.js +1 -1
- package/dist/es/config-provider/use-config-provider.js +56 -75
- package/dist/es/date-picker/index.js +5 -3
- package/dist/es/descriptions/index.js +4 -2
- package/dist/es/divider/index.js +4 -2
- package/dist/es/drawer/index.js +4 -2
- package/dist/es/dropdown/index.js +4 -2
- package/dist/es/dynamic-icon/index.js +22 -25
- package/dist/es/dynamic-icon/placeholder-icon.js +10 -11
- package/dist/es/dynamic-icon/props.js +1 -2
- package/dist/es/dynamic-icon/unknown-icon.js +11 -12
- package/dist/es/empty/empty.js +9 -10
- package/dist/es/empty/index.js +4 -2
- package/dist/es/flex/index.js +4 -2
- package/dist/es/flip-text/index.js +30 -32
- package/dist/es/flip-text/props.js +1 -1
- package/dist/es/float-button/index.js +4 -2
- package/dist/es/form/components/form.js +28 -34
- package/dist/es/form/components/index.js +10 -11
- package/dist/es/form/components/reset-button.js +18 -23
- package/dist/es/form/components/submit-button.js +20 -23
- package/dist/es/form/contexts/form-context.js +12 -10
- package/dist/es/form/contexts/form-layout.js +12 -12
- package/dist/es/form/contexts/index.js +11 -3
- package/dist/es/form/fields/auto-complete/index.js +26 -29
- package/dist/es/form/fields/auto-complete/props.js +1 -1
- package/dist/es/form/fields/bool/index.js +19 -22
- package/dist/es/form/fields/bool/props.js +1 -1
- package/dist/es/form/fields/cascader/index.js +22 -25
- package/dist/es/form/fields/cascader/props.js +1 -1
- package/dist/es/form/fields/checkbox/index.js +30 -35
- package/dist/es/form/fields/checkbox/props.js +1 -1
- package/dist/es/form/fields/color-picker/index.js +20 -23
- package/dist/es/form/fields/color-picker/props.js +1 -1
- package/dist/es/form/fields/date-picker/index.js +22 -25
- package/dist/es/form/fields/date-picker/props.js +1 -1
- package/dist/es/form/fields/date-range-picker/index.js +22 -25
- package/dist/es/form/fields/date-range-picker/props.js +1 -1
- package/dist/es/form/fields/index.js +47 -48
- package/dist/es/form/fields/input/index.js +25 -28
- package/dist/es/form/fields/input/props.js +1 -1
- package/dist/es/form/fields/input-number/index.js +23 -26
- package/dist/es/form/fields/input-number/props.js +1 -1
- package/dist/es/form/fields/mentions/index.js +23 -26
- package/dist/es/form/fields/mentions/props.js +1 -1
- package/dist/es/form/fields/password/index.js +25 -28
- package/dist/es/form/fields/password/props.js +1 -1
- package/dist/es/form/fields/radio/index.js +22 -25
- package/dist/es/form/fields/radio/props.js +1 -1
- package/dist/es/form/fields/rate/index.js +21 -24
- package/dist/es/form/fields/rate/props.js +1 -1
- package/dist/es/form/fields/select/index.js +21 -24
- package/dist/es/form/fields/select/props.js +1 -1
- package/dist/es/form/fields/slider/index.js +20 -23
- package/dist/es/form/fields/slider/props.js +1 -1
- package/dist/es/form/fields/textarea/index.js +25 -28
- package/dist/es/form/fields/textarea/props.js +1 -1
- package/dist/es/form/fields/time-picker/index.js +22 -25
- package/dist/es/form/fields/time-picker/props.js +1 -1
- package/dist/es/form/fields/time-range-picker/index.js +22 -25
- package/dist/es/form/fields/time-range-picker/props.js +1 -1
- package/dist/es/form/fields/transfer/index.js +21 -24
- package/dist/es/form/fields/transfer/props.js +1 -1
- package/dist/es/form/fields/tree-select/index.js +20 -23
- package/dist/es/form/fields/tree-select/props.js +1 -1
- package/dist/es/form/fields/upload/index.js +39 -50
- package/dist/es/form/fields/upload/props.js +1 -1
- package/dist/es/form/form.js +23 -20
- package/dist/es/form/helpers/index.js +4 -2
- package/dist/es/form/helpers/with-form-item.js +33 -37
- package/dist/es/form/hooks/use-form-item-props.js +32 -39
- package/dist/es/form/hooks/use-label-width.js +11 -18
- package/dist/es/form/index.js +8 -3
- package/dist/es/form/use-form.js +16 -21
- package/dist/es/grid/context.js +10 -12
- package/dist/es/grid/grid-item.js +29 -32
- package/dist/es/grid/hooks/index.js +15 -7
- package/dist/es/grid/hooks/use-container-breakpoints.js +14 -18
- package/dist/es/grid/hooks/use-container-width.js +22 -38
- package/dist/es/grid/hooks/use-grid-collapsed.js +10 -11
- package/dist/es/grid/hooks/use-normalized-gap.js +30 -38
- package/dist/es/grid/hooks/use-responsive-breakpoint.js +10 -13
- package/dist/es/grid/hooks/use-responsive-value.js +22 -25
- package/dist/es/grid/index.js +86 -123
- package/dist/es/grid/props.js +1 -1
- package/dist/es/grid/styles.js +11 -12
- package/dist/es/group/index.js +13 -14
- package/dist/es/group/props.js +1 -1
- package/dist/es/icon/index.js +15 -16
- package/dist/es/icon/props.js +1 -1
- package/dist/es/icon-button/index.js +25 -26
- package/dist/es/icon-button/props.js +1 -1
- package/dist/es/image/index.js +4 -2
- package/dist/es/index.js +254 -115
- package/dist/es/input/index.js +4 -2
- package/dist/es/input-number/index.js +4 -2
- package/dist/es/keyboard/index.js +26 -29
- package/dist/es/keyboard/props.js +1 -1
- package/dist/es/list/index.js +4 -2
- package/dist/es/loader/index.js +31 -39
- package/dist/es/loader/props.js +1 -1
- package/dist/es/mentions/index.js +4 -2
- package/dist/es/menu/index.js +5 -3
- package/dist/es/modal/index.js +4 -2
- package/dist/es/operation-button/index.js +19 -23
- package/dist/es/operation-button/props.js +1 -1
- package/dist/es/pagination/index.js +4 -2
- package/dist/es/permission-gate/index.js +12 -16
- package/dist/es/permission-gate/props.js +1 -1
- package/dist/es/popconfirm/index.js +4 -2
- package/dist/es/popover/index.js +4 -2
- package/dist/es/progress/index.js +4 -2
- package/dist/es/qrcode/index.js +4 -2
- package/dist/es/radio/index.js +4 -2
- package/dist/es/rate/index.js +4 -2
- package/dist/es/result/index.js +4 -2
- package/dist/es/row/index.js +4 -2
- package/dist/es/scroll-area/index.js +47 -59
- package/dist/es/scroll-area/props.js +1 -1
- package/dist/es/scroll-area/styles.js +16 -17
- package/dist/es/segmented/index.js +4 -2
- package/dist/es/select/hooks/index.js +4 -2
- package/dist/es/select/hooks/use-data-options-select.js +47 -56
- package/dist/es/select/index.js +5 -3
- package/dist/es/skeleton/index.js +4 -2
- package/dist/es/slider/index.js +4 -2
- package/dist/es/space/index.js +4 -2
- package/dist/es/space/space.js +10 -11
- package/dist/es/sparkles-text/index.js +41 -50
- package/dist/es/sparkles-text/props.js +1 -1
- package/dist/es/sparkles-text/sparkle.js +23 -24
- package/dist/es/spin/index.js +4 -2
- package/dist/es/split-text/index.js +114 -158
- package/dist/es/split-text/props.js +1 -1
- package/dist/es/splitter/index.js +4 -2
- package/dist/es/stack/index.js +12 -13
- package/dist/es/stack/props.js +1 -1
- package/dist/es/statistic/index.js +4 -2
- package/dist/es/steps/index.js +4 -2
- package/dist/es/switch/index.js +4 -2
- package/dist/es/table/index.js +41 -46
- package/dist/es/table/props.js +1 -1
- package/dist/es/table/use-pagination-props.js +26 -28
- package/dist/es/tabs/index.js +4 -2
- package/dist/es/tag/index.js +4 -2
- package/dist/es/time-picker/index.js +4 -2
- package/dist/es/timeline/index.js +4 -2
- package/dist/es/tooltip/index.js +4 -2
- package/dist/es/tour/index.js +4 -2
- package/dist/es/transfer/index.js +4 -2
- package/dist/es/tree/hooks/index.js +4 -2
- package/dist/es/tree/hooks/use-data-options-tree.js +47 -63
- package/dist/es/tree/index.js +5 -3
- package/dist/es/tree-select/hooks/index.js +4 -2
- package/dist/es/tree-select/hooks/use-data-options-tree-select.js +45 -58
- package/dist/es/tree-select/index.js +5 -3
- package/dist/es/typing-animation/index.js +35 -48
- package/dist/es/typing-animation/props.js +1 -1
- package/dist/es/typography/index.js +16 -14
- package/dist/es/upload/index.js +44 -69
- package/dist/es/upload/props.js +1 -1
- package/dist/es/watermark/index.js +4 -2
- package/package.json +6 -6
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const withFormItem = require('./with-form-item.cjs');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.withFormItem = withFormItem.withFormItem;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./with-form-item.cjs");exports.withFormItem=t.withFormItem;
|
|
@@ -1,50 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
7
|
-
const antd = require('antd');
|
|
8
|
-
require('../contexts/index.cjs');
|
|
9
|
-
const useFormItemProps = require('../hooks/use-form-item-props.cjs');
|
|
10
|
-
const formContext = require('../contexts/form-context.cjs');
|
|
11
|
-
|
|
12
|
-
function withFormItem(displayName, PureField) {
|
|
13
|
-
const FieldComponent = ({
|
|
14
|
-
// form item props
|
|
15
|
-
layout,
|
|
16
|
-
label,
|
|
17
|
-
labelAlign,
|
|
18
|
-
labelWidth,
|
|
19
|
-
extra,
|
|
20
|
-
noWrapper,
|
|
21
|
-
required,
|
|
22
|
-
// field props
|
|
23
|
-
...fieldProps
|
|
24
|
-
}) => {
|
|
25
|
-
const formItemProps = useFormItemProps.useFormItemProps({
|
|
26
|
-
layout,
|
|
27
|
-
label,
|
|
28
|
-
labelAlign,
|
|
29
|
-
labelWidth,
|
|
30
|
-
extra,
|
|
31
|
-
required,
|
|
32
|
-
noWrapper
|
|
33
|
-
});
|
|
34
|
-
const {
|
|
35
|
-
state: {
|
|
36
|
-
meta: {
|
|
37
|
-
errors,
|
|
38
|
-
isValid,
|
|
39
|
-
isValidating
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
} = formContext.useFieldContext();
|
|
43
|
-
const errorMessage = errors.length > 0 ? errors[0].message : null;
|
|
44
|
-
return /* @__PURE__ */ jsxRuntime.jsx(antd.Form.Item, { ...formItemProps, hasFeedback: isValidating, help: errorMessage, validateStatus: isValidating ? "validating" : isValid ? void 0 : "error", children: /* @__PURE__ */ jsxRuntime.jsx(PureField, { ...fieldProps }) });
|
|
45
|
-
};
|
|
46
|
-
FieldComponent.displayName = displayName;
|
|
47
|
-
return FieldComponent;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
exports.withFormItem = withFormItem;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@emotion/react/jsx-runtime"),I=require("antd");require("../contexts/index.cjs");const q=require("../hooks/use-form-item-props.cjs"),x=require("../contexts/form-context.cjs");function f(s,i){const e=({layout:n,label:a,labelAlign:m,labelWidth:u,extra:l,noWrapper:c,required:d,...F})=>{const g=q.useFormItemProps({layout:n,label:a,labelAlign:m,labelWidth:u,extra:l,required:d,noWrapper:c}),{state:{meta:{errors:t,isValid:p,isValidating:r}}}=x.useFieldContext(),h=t.length>0?t[0].message:null;return o.jsx(I.Form.Item,{...g,hasFeedback:r,help:h,validateStatus:r?"validating":p?void 0:"error",children:o.jsx(i,{...F})})};return e.displayName=s,e}exports.withFormItem=f;
|
|
@@ -1,47 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const react = require('react');
|
|
7
|
-
require('../contexts/index.cjs');
|
|
8
|
-
const useLabelWidth = require('./use-label-width.cjs');
|
|
9
|
-
const formLayout = require('../contexts/form-layout.cjs');
|
|
10
|
-
|
|
11
|
-
function useFormItemProps(props) {
|
|
12
|
-
const {
|
|
13
|
-
layout,
|
|
14
|
-
label,
|
|
15
|
-
labelAlign,
|
|
16
|
-
labelWidth,
|
|
17
|
-
extra,
|
|
18
|
-
noWrapper,
|
|
19
|
-
required
|
|
20
|
-
} = props;
|
|
21
|
-
const {
|
|
22
|
-
layout: formLayout$1,
|
|
23
|
-
labelAlign: formLabelAlign,
|
|
24
|
-
labelWidth: formLabelWidth
|
|
25
|
-
} = formLayout.useFormLayout();
|
|
26
|
-
const labelWidthToUse = useLabelWidth.useLabelWidth(layout, labelWidth ?? formLabelWidth);
|
|
27
|
-
const layoutToUse = layout ?? formLayout$1;
|
|
28
|
-
const labelCol = react.useMemo(() => {
|
|
29
|
-
if (layoutToUse === "vertical" || !labelWidthToUse) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
flex: `0 0 ${labelWidthToUse}px`
|
|
34
|
-
};
|
|
35
|
-
}, [labelWidthToUse, layoutToUse]);
|
|
36
|
-
return {
|
|
37
|
-
layout: layoutToUse,
|
|
38
|
-
label,
|
|
39
|
-
labelAlign: labelAlign ?? formLabelAlign,
|
|
40
|
-
labelCol,
|
|
41
|
-
extra,
|
|
42
|
-
noStyle: noWrapper,
|
|
43
|
-
required
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
exports.useFormItemProps = useFormItemProps;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");require("../contexts/index.cjs");const f=require("./use-label-width.cjs"),L=require("../contexts/form-layout.cjs");function W(o){const{layout:l,label:r,labelAlign:a,labelWidth:u,extra:i,noWrapper:n,required:s}=o,{layout:b,labelAlign:c,labelWidth:m}=L.useFormLayout(),e=f.useLabelWidth(l,u??m),t=l??b,y=d.useMemo(()=>{if(!(t==="vertical"||!e))return{flex:`0 0 ${e}px`}},[e,t]);return{layout:t,label:r,labelAlign:a??c,labelCol:y,extra:i,noStyle:n,required:s}}exports.useFormItemProps=W;
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const react = require('react');
|
|
7
|
-
require('../../_base/index.cjs');
|
|
8
|
-
const message = require('../../_base/helpers/message.cjs');
|
|
9
|
-
|
|
10
|
-
function useLabelWidth(layout, labelWidth) {
|
|
11
|
-
const labelWidthToUse = react.useMemo(() => {
|
|
12
|
-
if (layout === "vertical" || !labelWidth) {
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (labelWidth < 60 || labelWidth > 120) {
|
|
16
|
-
message.showWarningMessage("The labelWidth of Form component must be between 60 and 120, otherwise it will be 60 or 120.");
|
|
17
|
-
}
|
|
18
|
-
return Math.min(Math.max(labelWidth, 60), 120);
|
|
19
|
-
}, [layout, labelWidth]);
|
|
20
|
-
return labelWidthToUse;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.useLabelWidth = useLabelWidth;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react");require("../../_base/index.cjs");const n=require("../../_base/helpers/message.cjs");function o(r,e){return t.useMemo(()=>{if(!(r==="vertical"||!e))return(e<60||e>120)&&n.showWarningMessage("The labelWidth of Form component must be between 60 and 120, otherwise it will be 60 or 120."),Math.min(Math.max(e,60),120)},[r,e])}exports.useLabelWidth=o;
|
package/dist/cjs/form/index.cjs
CHANGED
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const form = require('./form.cjs');
|
|
7
|
-
const useForm = require('./use-form.cjs');
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
exports.useFormContext = form.useFormContext;
|
|
12
|
-
exports.withFieldGroup = form.withFieldGroup;
|
|
13
|
-
exports.withForm = form.withForm;
|
|
14
|
-
exports.useForm = useForm.useForm;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./form.cjs"),o=require("./use-form.cjs");exports.useFormContext=e.useFormContext;exports.withFieldGroup=e.withFieldGroup;exports.withForm=e.withForm;exports.useForm=o.useForm;
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
7
|
-
const react = require('react');
|
|
8
|
-
const form = require('./form.cjs');
|
|
9
|
-
|
|
10
|
-
function useForm(options) {
|
|
11
|
-
const formApi = form.useAppForm(options);
|
|
12
|
-
return react.useMemo(() => {
|
|
13
|
-
const {
|
|
14
|
-
AppForm,
|
|
15
|
-
Form
|
|
16
|
-
} = formApi;
|
|
17
|
-
const FormComponent = (props) => /* @__PURE__ */ jsxRuntime.jsx(AppForm, { children: /* @__PURE__ */ jsxRuntime.jsx(Form, { ...props }) });
|
|
18
|
-
return new Proxy(formApi, {
|
|
19
|
-
get(target, prop, receiver) {
|
|
20
|
-
if (prop === "Form") {
|
|
21
|
-
return FormComponent;
|
|
22
|
-
}
|
|
23
|
-
return Reflect.get(target, prop, receiver);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}, [formApi]);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
exports.useForm = useForm;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@emotion/react/jsx-runtime"),i=require("react"),F=require("./form.cjs");function f(n){const e=F.useAppForm(n);return i.useMemo(()=>{const{AppForm:u,Form:s}=e,m=r=>t.jsx(u,{children:t.jsx(s,{...r})});return new Proxy(e,{get(r,o,c){return o==="Form"?m:Reflect.get(r,o,c)}})},[e])}exports.useForm=f;
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const react = require('react');
|
|
7
|
-
|
|
8
|
-
const Context = react.createContext(null);
|
|
9
|
-
const GridContextProvider = Context.Provider;
|
|
10
|
-
function useGridContext() {
|
|
11
|
-
const context = react.use(Context);
|
|
12
|
-
if (!context) {
|
|
13
|
-
throw new Error("GridItem must be used as direct child of Grid");
|
|
14
|
-
}
|
|
15
|
-
return context;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
exports.GridContextProvider = GridContextProvider;
|
|
19
|
-
exports.useGridContext = useGridContext;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=e.createContext(null),o=r.Provider;function n(){const t=e.use(r);if(!t)throw new Error("GridItem must be used as direct child of Grid");return t}exports.GridContextProvider=o;exports.useGridContext=n;
|
|
@@ -1,43 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
7
|
-
const react = require('react');
|
|
8
|
-
const context = require('./context.cjs');
|
|
9
|
-
const styles = require('./styles.cjs');
|
|
10
|
-
require('./props.cjs');
|
|
11
|
-
|
|
12
|
-
const defaultSpan = 1;
|
|
13
|
-
const defaultOffset = 0;
|
|
14
|
-
function GridItem({
|
|
15
|
-
span = defaultSpan,
|
|
16
|
-
offset = defaultOffset,
|
|
17
|
-
suffix = false,
|
|
18
|
-
style,
|
|
19
|
-
...props
|
|
20
|
-
}) {
|
|
21
|
-
const {
|
|
22
|
-
gridColumns
|
|
23
|
-
} = context.useGridContext();
|
|
24
|
-
const itemStyle = react.useMemo(() => {
|
|
25
|
-
const childSpan = span;
|
|
26
|
-
const childOffset = offset;
|
|
27
|
-
const baseStyle = {
|
|
28
|
-
"--vef-grid-item-column": suffix ? `${gridColumns + 1 - childSpan} / span ${childSpan}` : `span ${childSpan}`,
|
|
29
|
-
...childOffset > 0 && !suffix ? {
|
|
30
|
-
"--vef-grid-item-margin-left": `calc(100% * ${childOffset} / ${childSpan})`
|
|
31
|
-
} : {}
|
|
32
|
-
};
|
|
33
|
-
return {
|
|
34
|
-
...baseStyle,
|
|
35
|
-
...style
|
|
36
|
-
};
|
|
37
|
-
}, [span, offset, suffix, gridColumns, style]);
|
|
38
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, css: styles.gridItem, style: itemStyle });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
exports.GridItem = GridItem;
|
|
42
|
-
exports.defaultOffset = defaultOffset;
|
|
43
|
-
exports.defaultSpan = defaultSpan;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@emotion/react/jsx-runtime"),m=require("react"),f=require("./context.cjs"),S=require("./styles.cjs");require("./props.cjs");const o=1,l=0;function g({span:n=o,offset:r=l,suffix:t=!1,style:s,...u}){const{gridColumns:c}=f.useGridContext(),a=m.useMemo(()=>{const e=n,i=r;return{...{"--vef-grid-item-column":t?`${c+1-e} / span ${e}`:`span ${e}`,...i>0&&!t?{"--vef-grid-item-margin-left":`calc(100% * ${i} / ${e})`}:{}},...s}},[n,r,t,c,s]);return d.jsx("div",{...u,css:S.gridItem,style:a})}exports.GridItem=g;exports.defaultOffset=l;exports.defaultSpan=o;
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const useContainerBreakpoints = require('./use-container-breakpoints.cjs');
|
|
7
|
-
const useContainerWidth = require('./use-container-width.cjs');
|
|
8
|
-
const useGridCollapsed = require('./use-grid-collapsed.cjs');
|
|
9
|
-
const useNormalizedGap = require('./use-normalized-gap.cjs');
|
|
10
|
-
const useResponsiveBreakpoint = require('./use-responsive-breakpoint.cjs');
|
|
11
|
-
const useResponsiveValue = require('./use-responsive-value.cjs');
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
exports.useContainerBreakpoints = useContainerBreakpoints.useContainerBreakpoints;
|
|
16
|
-
exports.useContainerWidth = useContainerWidth.useContainerWidth;
|
|
17
|
-
exports.useGridCollapsed = useGridCollapsed.useGridCollapsed;
|
|
18
|
-
exports.useNormalizedGap = useNormalizedGap.useNormalizedGap;
|
|
19
|
-
exports.useResponsiveBreakpoint = useResponsiveBreakpoint.useResponsiveBreakpoint;
|
|
20
|
-
exports.getResponsiveValue = useResponsiveValue.getResponsiveValue;
|
|
21
|
-
exports.useResponsiveValue = useResponsiveValue.useResponsiveValue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./use-container-breakpoints.cjs"),i=require("./use-container-width.cjs"),o=require("./use-grid-collapsed.cjs"),n=require("./use-normalized-gap.cjs"),r=require("./use-responsive-breakpoint.cjs"),e=require("./use-responsive-value.cjs");exports.useContainerBreakpoints=s.useContainerBreakpoints;exports.useContainerWidth=i.useContainerWidth;exports.useGridCollapsed=o.useGridCollapsed;exports.useNormalizedGap=n.useNormalizedGap;exports.useResponsiveBreakpoint=r.useResponsiveBreakpoint;exports.getResponsiveValue=e.getResponsiveValue;exports.useResponsiveValue=e.useResponsiveValue;
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const react = require('react');
|
|
7
|
-
|
|
8
|
-
function useContainerBreakpoints(baseWidth) {
|
|
9
|
-
return react.useMemo(() => {
|
|
10
|
-
const breakpoints = {
|
|
11
|
-
xxs: baseWidth,
|
|
12
|
-
xs: baseWidth * 2,
|
|
13
|
-
sm: baseWidth * 3,
|
|
14
|
-
md: baseWidth * 4,
|
|
15
|
-
lg: baseWidth * 5,
|
|
16
|
-
xl: baseWidth * 6,
|
|
17
|
-
xxl: baseWidth * 7
|
|
18
|
-
};
|
|
19
|
-
return breakpoints;
|
|
20
|
-
}, [baseWidth]);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.useContainerBreakpoints = useContainerBreakpoints;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react");function e(r){return n.useMemo(()=>({xxs:r,xs:r*2,sm:r*3,md:r*4,lg:r*5,xl:r*6,xxl:r*7}),[r])}exports.useContainerBreakpoints=e;
|
|
@@ -1,48 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const hooks = require('@vef-framework/hooks');
|
|
7
|
-
const react = require('react');
|
|
8
|
-
|
|
9
|
-
function useContainerWidth() {
|
|
10
|
-
const rafIdRef = react.useRef(0);
|
|
11
|
-
const containerRef = react.useRef(null);
|
|
12
|
-
const [containerWidth, setContainerWidth] = react.useState(0);
|
|
13
|
-
hooks.useIsomorphicEffect(() => {
|
|
14
|
-
if (containerRef.current) {
|
|
15
|
-
setContainerWidth(containerRef.current.getBoundingClientRect().width);
|
|
16
|
-
}
|
|
17
|
-
}, []);
|
|
18
|
-
react.useEffect(() => {
|
|
19
|
-
if (containerRef.current) {
|
|
20
|
-
const observer = new ResizeObserver(([entry]) => {
|
|
21
|
-
if (entry) {
|
|
22
|
-
if (rafIdRef.current) {
|
|
23
|
-
cancelAnimationFrame(rafIdRef.current);
|
|
24
|
-
}
|
|
25
|
-
rafIdRef.current = requestAnimationFrame(() => {
|
|
26
|
-
const width = entry.contentBoxSize.at(0)?.inlineSize ?? entry.contentRect.width;
|
|
27
|
-
setContainerWidth(width);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
observer.observe(containerRef.current, {
|
|
32
|
-
box: "content-box"
|
|
33
|
-
});
|
|
34
|
-
return () => {
|
|
35
|
-
observer.disconnect();
|
|
36
|
-
if (rafIdRef.current) {
|
|
37
|
-
cancelAnimationFrame(rafIdRef.current);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
}, []);
|
|
42
|
-
return {
|
|
43
|
-
containerWidth,
|
|
44
|
-
containerRef
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
exports.useContainerWidth = useContainerWidth;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@vef-framework/hooks"),n=require("react");function a(){const e=n.useRef(0),t=n.useRef(null),[o,i]=n.useState(0);return s.useIsomorphicEffect(()=>{t.current&&i(t.current.getBoundingClientRect().width)},[]),n.useEffect(()=>{if(t.current){const c=new ResizeObserver(([r])=>{r&&(e.current&&cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{const u=r.contentBoxSize.at(0)?.inlineSize??r.contentRect.width;i(u)}))});return c.observe(t.current,{box:"content-box"}),()=>{c.disconnect(),e.current&&cancelAnimationFrame(e.current)}}},[]),{containerWidth:o,containerRef:t}}exports.useContainerWidth=a;
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const context = require('../context.cjs');
|
|
7
|
-
|
|
8
|
-
function useGridCollapsed() {
|
|
9
|
-
const {
|
|
10
|
-
isCollapsed,
|
|
11
|
-
setCollapsed
|
|
12
|
-
} = context.useGridContext();
|
|
13
|
-
return {
|
|
14
|
-
isCollapsed,
|
|
15
|
-
setCollapsed
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
exports.useGridCollapsed = useGridCollapsed;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../context.cjs");function s(){const{isCollapsed:e,setCollapsed:t}=o.useGridContext();return{isCollapsed:e,setCollapsed:t}}exports.useGridCollapsed=s;
|
|
@@ -1,47 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const shared = require('@vef-framework/shared');
|
|
7
|
-
const react = require('react');
|
|
8
|
-
require('../../_base/index.cjs');
|
|
9
|
-
const useThemeTokens = require('../../_base/hooks/use-theme-tokens.cjs');
|
|
10
|
-
|
|
11
|
-
function useNormalizedGap([rowGap, columnGap]) {
|
|
12
|
-
const tokens = useThemeTokens.useThemeTokens();
|
|
13
|
-
return react.useMemo(() => [normalizeGap(rowGap, tokens), normalizeGap(columnGap, tokens)], [columnGap, rowGap, tokens]);
|
|
14
|
-
}
|
|
15
|
-
function normalizeGap(gap, {
|
|
16
|
-
margin,
|
|
17
|
-
marginSM,
|
|
18
|
-
marginXS,
|
|
19
|
-
marginMD,
|
|
20
|
-
marginLG
|
|
21
|
-
}) {
|
|
22
|
-
if (shared.isNumber(gap)) {
|
|
23
|
-
return gap;
|
|
24
|
-
}
|
|
25
|
-
if (shared.isString(gap)) {
|
|
26
|
-
switch (gap) {
|
|
27
|
-
case "extra-small": {
|
|
28
|
-
return marginXS;
|
|
29
|
-
}
|
|
30
|
-
case "small": {
|
|
31
|
-
return marginSM;
|
|
32
|
-
}
|
|
33
|
-
case "medium": {
|
|
34
|
-
return margin;
|
|
35
|
-
}
|
|
36
|
-
case "large": {
|
|
37
|
-
return marginMD;
|
|
38
|
-
}
|
|
39
|
-
case "extra-large": {
|
|
40
|
-
return marginLG;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return 0;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
exports.useNormalizedGap = useNormalizedGap;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@vef-framework/shared"),o=require("react");require("../../_base/index.cjs");const c=require("../../_base/hooks/use-theme-tokens.cjs");function l([e,t]){const r=c.useThemeTokens();return o.useMemo(()=>[u(e,r),u(t,r)],[t,e,r])}function u(e,{margin:t,marginSM:r,marginXS:n,marginMD:i,marginLG:a}){if(s.isNumber(e))return e;if(s.isString(e))switch(e){case"extra-small":return n;case"small":return r;case"medium":return t;case"large":return i;case"extra-large":return a}return 0}exports.useNormalizedGap=l;
|
|
@@ -1,19 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const react = require('react');
|
|
7
|
-
|
|
8
|
-
function useResponsiveBreakpoint(breakpoints, width) {
|
|
9
|
-
return react.useMemo(() => {
|
|
10
|
-
for (const [breakpoint, breakpointWidth] of Object.entries(breakpoints)) {
|
|
11
|
-
if (width <= breakpointWidth) {
|
|
12
|
-
return breakpoint;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return "xxl";
|
|
16
|
-
}, [width, breakpoints]);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
exports.useResponsiveBreakpoint = useResponsiveBreakpoint;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react");function i(e,r){return o.useMemo(()=>{for(const[t,n]of Object.entries(e))if(r<=n)return t;return"xxl"},[r,e])}exports.useResponsiveBreakpoint=i;
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const shared = require('@vef-framework/shared');
|
|
7
|
-
const react = require('react');
|
|
8
|
-
require('../../_base/index.cjs');
|
|
9
|
-
const breakpoints = require('../../_base/constants/breakpoints.cjs');
|
|
10
|
-
|
|
11
|
-
function useResponsiveValue(value, breakpoint) {
|
|
12
|
-
const resolvedValue = react.useMemo(() => getResponsiveValue(value, breakpoint), [value, breakpoint]);
|
|
13
|
-
return resolvedValue;
|
|
14
|
-
}
|
|
15
|
-
function getResponsiveValue(value, breakpoint) {
|
|
16
|
-
if (shared.isPlainObject(value)) {
|
|
17
|
-
const resolvedValue = value[breakpoint];
|
|
18
|
-
if (resolvedValue) {
|
|
19
|
-
return resolvedValue;
|
|
20
|
-
}
|
|
21
|
-
const breakpointArr = Object.keys(breakpoints.breakpoints);
|
|
22
|
-
let breakpointIndex = breakpointArr.indexOf(breakpoint);
|
|
23
|
-
while (breakpointIndex--) {
|
|
24
|
-
const fallbackValue = value[breakpointArr[breakpointIndex]];
|
|
25
|
-
if (fallbackValue) {
|
|
26
|
-
return fallbackValue;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
return value;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
exports.getResponsiveValue = getResponsiveValue;
|
|
35
|
-
exports.useResponsiveValue = useResponsiveValue;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@vef-framework/shared"),c=require("react");require("../../_base/index.cjs");const l=require("../../_base/constants/breakpoints.cjs");function a(e,r){return c.useMemo(()=>i(e,r),[e,r])}function i(e,r){if(u.isPlainObject(e)){const s=e[r];if(s)return s;const t=Object.keys(l.breakpoints);let n=t.indexOf(r);for(;n--;){const o=e[t[n]];if(o)return o}return}return e}exports.getResponsiveValue=i;exports.useResponsiveValue=a;
|
package/dist/cjs/grid/index.cjs
CHANGED
|
@@ -1,140 +1 @@
|
|
|
1
|
-
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
5
|
-
|
|
6
|
-
const jsxRuntime = require('@emotion/react/jsx-runtime');
|
|
7
|
-
const core = require('@vef-framework/core');
|
|
8
|
-
const hooks = require('@vef-framework/hooks');
|
|
9
|
-
const react = require('react');
|
|
10
|
-
const context = require('./context.cjs');
|
|
11
|
-
const gridItem = require('./grid-item.cjs');
|
|
12
|
-
require('./hooks/index.cjs');
|
|
13
|
-
const styles = require('./styles.cjs');
|
|
14
|
-
require('./props.cjs');
|
|
15
|
-
const useResponsiveValue = require('./hooks/use-responsive-value.cjs');
|
|
16
|
-
const useContainerWidth = require('./hooks/use-container-width.cjs');
|
|
17
|
-
const useContainerBreakpoints = require('./hooks/use-container-breakpoints.cjs');
|
|
18
|
-
const useResponsiveBreakpoint = require('./hooks/use-responsive-breakpoint.cjs');
|
|
19
|
-
const useNormalizedGap = require('./hooks/use-normalized-gap.cjs');
|
|
20
|
-
|
|
21
|
-
function calculateItemVisibility(children, columns, collapsed, collapsedRows, breakpoint) {
|
|
22
|
-
const items = [];
|
|
23
|
-
react.Children.forEach(children, (child) => {
|
|
24
|
-
if (!react.isValidElement(child) || child.type !== gridItem.GridItem) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const childElement = child;
|
|
28
|
-
const childProps = childElement.props;
|
|
29
|
-
const childSpan = useResponsiveValue.getResponsiveValue(childProps.span ?? gridItem.defaultSpan, breakpoint) ?? gridItem.defaultSpan;
|
|
30
|
-
if (childSpan === 0) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const childOffset = useResponsiveValue.getResponsiveValue(childProps.offset ?? gridItem.defaultOffset, breakpoint) ?? gridItem.defaultOffset;
|
|
34
|
-
items.push({
|
|
35
|
-
element: childElement,
|
|
36
|
-
span: childSpan,
|
|
37
|
-
offset: childOffset
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
let suffixItemSpan = 0;
|
|
41
|
-
const maybeSuffixItem = items.at(-1);
|
|
42
|
-
if (maybeSuffixItem?.element.props.suffix === true) {
|
|
43
|
-
suffixItemSpan = maybeSuffixItem.span;
|
|
44
|
-
}
|
|
45
|
-
let spanCount = 0;
|
|
46
|
-
let reachedCollapsedLimit = false;
|
|
47
|
-
const itemNodes = items.map(({
|
|
48
|
-
element,
|
|
49
|
-
span,
|
|
50
|
-
offset
|
|
51
|
-
}, index) => {
|
|
52
|
-
const actualSpan = Math.min(span + offset, columns);
|
|
53
|
-
if (!reachedCollapsedLimit && collapsed) {
|
|
54
|
-
const remaining = spanCount % columns;
|
|
55
|
-
if (actualSpan + remaining > columns) {
|
|
56
|
-
spanCount += columns - remaining;
|
|
57
|
-
}
|
|
58
|
-
if (actualSpan + spanCount + suffixItemSpan > collapsedRows * columns) {
|
|
59
|
-
reachedCollapsedLimit = true;
|
|
60
|
-
} else {
|
|
61
|
-
spanCount += actualSpan;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (reachedCollapsedLimit) {
|
|
65
|
-
const {
|
|
66
|
-
props
|
|
67
|
-
} = element;
|
|
68
|
-
return react.cloneElement(element, {
|
|
69
|
-
className: index === items.length - 1 && props.suffix === true ? props.className : core.clsx(props.className, "hidden"),
|
|
70
|
-
span,
|
|
71
|
-
offset
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return react.cloneElement(element, {
|
|
75
|
-
key: element.key || index,
|
|
76
|
-
span: actualSpan,
|
|
77
|
-
offset
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
return itemNodes;
|
|
81
|
-
}
|
|
82
|
-
function Grid({
|
|
83
|
-
baseWidth = 240,
|
|
84
|
-
gap = 0,
|
|
85
|
-
columnGap,
|
|
86
|
-
rowGap,
|
|
87
|
-
defaultIsCollapsed = false,
|
|
88
|
-
isCollapsed,
|
|
89
|
-
collapsedRows = 1,
|
|
90
|
-
onCollapseChange,
|
|
91
|
-
style,
|
|
92
|
-
children,
|
|
93
|
-
ref,
|
|
94
|
-
...props
|
|
95
|
-
}) {
|
|
96
|
-
const [isCollapsedInternal, setIsCollapsedInternal] = react.useState(defaultIsCollapsed);
|
|
97
|
-
const isControlled = isCollapsed !== void 0;
|
|
98
|
-
const mergedIsCollapsed = isControlled ? isCollapsed : isCollapsedInternal;
|
|
99
|
-
const setCollapsed = react.useCallback((isCollapsed2) => {
|
|
100
|
-
const state = isCollapsed2 || !mergedIsCollapsed;
|
|
101
|
-
if (!isControlled) {
|
|
102
|
-
setIsCollapsedInternal(state);
|
|
103
|
-
}
|
|
104
|
-
onCollapseChange?.(state);
|
|
105
|
-
}, [isControlled, mergedIsCollapsed, onCollapseChange]);
|
|
106
|
-
const {
|
|
107
|
-
containerRef,
|
|
108
|
-
containerWidth
|
|
109
|
-
} = useContainerWidth.useContainerWidth();
|
|
110
|
-
const mergedContainerRef = hooks.useMergedRef(containerRef, ref);
|
|
111
|
-
const breakpoints = useContainerBreakpoints.useContainerBreakpoints(baseWidth);
|
|
112
|
-
const breakpoint = useResponsiveBreakpoint.useResponsiveBreakpoint(breakpoints, containerWidth);
|
|
113
|
-
const [normalizedRowGap, normalizedColumnGap] = useNormalizedGap.useNormalizedGap([rowGap ?? gap, columnGap ?? gap]);
|
|
114
|
-
const gridStyle = react.useMemo(() => {
|
|
115
|
-
if (containerWidth > styles.gridColumns * normalizedColumnGap) {
|
|
116
|
-
return {
|
|
117
|
-
"--vef-grid-row-gap": `${normalizedRowGap}px`,
|
|
118
|
-
"--vef-grid-column-gap": `${normalizedColumnGap}px`,
|
|
119
|
-
...style
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
"--vef-grid-row-gap": `${normalizedRowGap}px`,
|
|
124
|
-
"--vef-grid-column-gap": `${Math.floor(containerWidth / styles.gridColumns)}px`,
|
|
125
|
-
...style
|
|
126
|
-
};
|
|
127
|
-
}, [containerWidth, normalizedColumnGap, normalizedRowGap, style]);
|
|
128
|
-
const context$1 = react.useMemo(() => {
|
|
129
|
-
return {
|
|
130
|
-
gridColumns: styles.gridColumns,
|
|
131
|
-
isCollapsed: mergedIsCollapsed,
|
|
132
|
-
setCollapsed
|
|
133
|
-
};
|
|
134
|
-
}, [mergedIsCollapsed, setCollapsed]);
|
|
135
|
-
const processedGridItems = react.useMemo(() => calculateItemVisibility(children, styles.gridColumns, mergedIsCollapsed, collapsedRows, breakpoint), [children, mergedIsCollapsed, collapsedRows, breakpoint]);
|
|
136
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { ...props, ref: mergedContainerRef, css: styles.grid, style: gridStyle, children: /* @__PURE__ */ jsxRuntime.jsx(context.GridContextProvider, { value: context$1, children: processedGridItems }) });
|
|
137
|
-
}
|
|
138
|
-
Grid.Item = gridItem.GridItem;
|
|
139
|
-
|
|
140
|
-
exports.Grid = Grid;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("@emotion/react/jsx-runtime"),B=require("@vef-framework/core"),O=require("@vef-framework/hooks"),n=require("react"),P=require("./context.cjs"),d=require("./grid-item.cjs");require("./hooks/index.cjs");const m=require("./styles.cjs");require("./props.cjs");const y=require("./hooks/use-responsive-value.cjs"),W=require("./hooks/use-container-width.cjs"),w=require("./hooks/use-container-breakpoints.cjs"),L=require("./hooks/use-responsive-breakpoint.cjs"),T=require("./hooks/use-normalized-gap.cjs");function A(h,i,q,v,g){const u=[];n.Children.forEach(h,t=>{if(!n.isValidElement(t)||t.type!==d.GridItem)return;const c=t,a=c.props,s=y.getResponsiveValue(a.span??d.defaultSpan,g)??d.defaultSpan;if(s===0)return;const e=y.getResponsiveValue(a.offset??d.defaultOffset,g)??d.defaultOffset;u.push({element:c,span:s,offset:e})});let p=0;const f=u.at(-1);f?.element.props.suffix===!0&&(p=f.span);let o=0,l=!1;return u.map(({element:t,span:c,offset:a},s)=>{const e=Math.min(c+a,i);if(!l&&q){const r=o%i;e+r>i&&(o+=i-r),e+o+p>v*i?l=!0:o+=e}if(l){const{props:r}=t;return n.cloneElement(t,{className:s===u.length-1&&r.suffix===!0?r.className:B.clsx(r.className,"hidden"),span:c,offset:a})}return n.cloneElement(t,{key:t.key||s,span:e,offset:a})})}function M({baseWidth:h=240,gap:i=0,columnGap:q,rowGap:v,defaultIsCollapsed:g=!1,isCollapsed:u,collapsedRows:p=1,onCollapseChange:f,style:o,children:l,ref:G,...t}){const[c,a]=n.useState(g),s=u!==void 0,e=s?u:c,r=n.useCallback(z=>{const k=z||!e;s||a(k),f?.(k)},[s,e,f]),{containerRef:N,containerWidth:C}=W.useContainerWidth(),b=O.useMergedRef(N,G),E=w.useContainerBreakpoints(h),S=L.useResponsiveBreakpoint(E,C),[x,I]=T.useNormalizedGap([v??i,q??i]),V=n.useMemo(()=>C>m.gridColumns*I?{"--vef-grid-row-gap":`${x}px`,"--vef-grid-column-gap":`${I}px`,...o}:{"--vef-grid-row-gap":`${x}px`,"--vef-grid-column-gap":`${Math.floor(C/m.gridColumns)}px`,...o},[C,I,x,o]),$=n.useMemo(()=>({gridColumns:m.gridColumns,isCollapsed:e,setCollapsed:r}),[e,r]),j=n.useMemo(()=>A(l,m.gridColumns,e,p,S),[l,e,p,S]);return R.jsx("div",{...t,ref:b,css:m.grid,style:V,children:R.jsx(P.GridContextProvider,{value:$,children:j})})}M.Item=d.GridItem;exports.Grid=M;
|
package/dist/cjs/grid/props.cjs
CHANGED