@vef-framework/components 1.0.127 → 1.0.129
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/cjs/index.cjs +1 -193
- package/cjs/internal/base.css.cjs +488 -4
- package/cjs/internal/chart.cjs +1 -20
- package/cjs/internal/index.cjs +1 -9
- package/cjs/internal/modern-normalize.css.cjs +211 -4
- package/cjs/internal/utils.cjs +1 -8
- package/cjs/vef-access-denied/access-denied-icon.cjs +1 -932
- package/cjs/vef-access-denied/index.cjs +9 -49
- package/cjs/vef-access-denied/props.cjs +0 -2
- package/cjs/vef-action-buttons/index.cjs +1 -79
- package/cjs/vef-action-buttons/props.cjs +0 -2
- package/cjs/vef-approval-flow-editor/components/edge.cjs +2 -87
- package/cjs/vef-approval-flow-editor/components/label-value.cjs +8 -31
- package/cjs/vef-approval-flow-editor/components/node-content.cjs +10 -49
- package/cjs/vef-approval-flow-editor/components/node-selector.cjs +4 -37
- package/cjs/vef-approval-flow-editor/components/node-toolbar.cjs +1 -25
- package/cjs/vef-approval-flow-editor/components/nodes/approval.cjs +1 -28
- package/cjs/vef-approval-flow-editor/components/nodes/condition.cjs +1 -28
- package/cjs/vef-approval-flow-editor/components/nodes/end.cjs +1 -28
- package/cjs/vef-approval-flow-editor/components/nodes/handle.cjs +1 -28
- package/cjs/vef-approval-flow-editor/components/nodes/index.cjs +1 -19
- package/cjs/vef-approval-flow-editor/components/nodes/submit.cjs +1 -28
- package/cjs/vef-approval-flow-editor/components/selector-content.cjs +9 -52
- package/cjs/vef-approval-flow-editor/components/source-handle.cjs +1 -44
- package/cjs/vef-approval-flow-editor/components/target-handle.cjs +1 -13
- package/cjs/vef-approval-flow-editor/constants.cjs +1 -225
- package/cjs/vef-approval-flow-editor/helper.cjs +1 -88
- package/cjs/vef-approval-flow-editor/hooks/use-edges-interaction.cjs +1 -27
- package/cjs/vef-approval-flow-editor/hooks/use-element-selection.cjs +1 -26
- package/cjs/vef-approval-flow-editor/hooks/use-nodes-interaction.cjs +1 -53
- package/cjs/vef-approval-flow-editor/index.cjs +1 -79
- package/cjs/vef-approval-flow-editor/models/edge-node.cjs +1 -23
- package/cjs/vef-approval-flow-editor/models/flow-node.cjs +1 -112
- package/cjs/vef-approval-flow-editor/props.cjs +0 -2
- package/cjs/vef-approval-flow-editor/store.cjs +1 -20
- package/cjs/vef-approval-flow-editor/styles.cjs +12 -23
- package/cjs/vef-approval-flow-editor/types.cjs +1 -18
- package/cjs/vef-area-chart/index.cjs +1 -45
- package/cjs/vef-area-chart/props.cjs +0 -2
- package/cjs/vef-auto-sizer/index.cjs +1 -10
- package/cjs/vef-auto-sizer/props.cjs +0 -2
- package/cjs/vef-avatar/index.cjs +1 -24
- package/cjs/vef-avatar/props.cjs +0 -2
- package/cjs/vef-avatar-group/index.cjs +1 -29
- package/cjs/vef-avatar-group/props.cjs +0 -2
- package/cjs/vef-badge/index.cjs +1 -51
- package/cjs/vef-badge/props.cjs +0 -2
- package/cjs/vef-bar-chart/index.cjs +1 -45
- package/cjs/vef-bar-chart/props.cjs +0 -2
- package/cjs/vef-bool/hooks/use-bool-instance.cjs +1 -36
- package/cjs/vef-bool/index.cjs +1 -64
- package/cjs/vef-bool/props.cjs +0 -2
- package/cjs/vef-breadcrumb/index.cjs +1 -52
- package/cjs/vef-breadcrumb/props.cjs +0 -2
- package/cjs/vef-button/components/base-button.cjs +1 -77
- package/cjs/vef-button/index.cjs +1 -155
- package/cjs/vef-button/props.cjs +0 -2
- package/cjs/vef-card/index.cjs +1 -29
- package/cjs/vef-card/props.cjs +0 -2
- package/cjs/vef-card-meta/index.cjs +1 -16
- package/cjs/vef-card-meta/props.cjs +0 -2
- package/cjs/vef-chart-container/hooks/use-chart-container-context.cjs +1 -16
- package/cjs/vef-chart-container/index.cjs +13 -83
- package/cjs/vef-chart-container/props.cjs +0 -2
- package/cjs/vef-chart-legend-content/index.cjs +10 -48
- package/cjs/vef-chart-legend-content/props.cjs +0 -2
- package/cjs/vef-chart-tooltip-content/index.cjs +22 -89
- package/cjs/vef-chart-tooltip-content/props.cjs +0 -2
- package/cjs/vef-checkbox/hooks/use-checkbox-instance.cjs +1 -22
- package/cjs/vef-checkbox/hooks/use-data-options.cjs +1 -42
- package/cjs/vef-checkbox/index.cjs +3 -92
- package/cjs/vef-checkbox/props.cjs +0 -2
- package/cjs/vef-code-editor/hooks/use-change-handler.cjs +1 -12
- package/cjs/vef-code-editor/hooks/use-config-extensions.cjs +1 -50
- package/cjs/vef-code-editor/hooks/use-height-props.cjs +1 -22
- package/cjs/vef-code-editor/hooks/use-language-extensions.cjs +1 -119
- package/cjs/vef-code-editor/hooks/use-setup-options.cjs +1 -39
- package/cjs/vef-code-editor/index.cjs +1 -61
- package/cjs/vef-code-editor/props.cjs +0 -2
- package/cjs/vef-code-editor/styles.cjs +46 -54
- package/cjs/vef-col/index.cjs +1 -15
- package/cjs/vef-col/props.cjs +0 -2
- package/cjs/vef-color-picker/index.cjs +1 -50
- package/cjs/vef-color-picker/props.cjs +0 -2
- package/cjs/vef-compact/index.cjs +1 -19
- package/cjs/vef-compact/props.cjs +0 -2
- package/cjs/vef-config-provider/global-style.cjs +15 -26
- package/cjs/vef-config-provider/hooks/use-ui-config.cjs +1 -128
- package/cjs/vef-config-provider/index.cjs +3 -125
- package/cjs/vef-config-provider/props.cjs +0 -2
- package/cjs/vef-config-provider/store.cjs +1 -25
- package/cjs/vef-container/index.cjs +1 -22
- package/cjs/vef-container/props.cjs +0 -2
- package/cjs/vef-crud-page/components/crud-actions.cjs +1 -36
- package/cjs/vef-crud-page/components/crud-filter.cjs +1 -58
- package/cjs/vef-crud-page/components/crud-footer.cjs +3 -120
- package/cjs/vef-crud-page/components/crud-form-modal.cjs +1 -57
- package/cjs/vef-crud-page/components/crud-header.cjs +1 -33
- package/cjs/vef-crud-page/components/crud-table.cjs +1 -80
- package/cjs/vef-crud-page/hooks/use-action-buttons.cjs +1 -39
- package/cjs/vef-crud-page/hooks/use-crud-context.cjs +1 -22
- package/cjs/vef-crud-page/hooks/use-crud-schema.cjs +1 -118
- package/cjs/vef-crud-page/hooks/use-operation-buttons.cjs +1 -62
- package/cjs/vef-crud-page/index.cjs +1 -154
- package/cjs/vef-crud-page/props.cjs +0 -2
- package/cjs/vef-crud-page/store.cjs +1 -146
- package/cjs/vef-crud-page/types.cjs +0 -2
- package/cjs/vef-data-grid/index.cjs +1 -89
- package/cjs/vef-data-grid/props.cjs +0 -2
- package/cjs/vef-data-table/index.cjs +1 -13
- package/cjs/vef-data-table/props.cjs +0 -2
- package/cjs/vef-divider/index.cjs +1 -28
- package/cjs/vef-divider/props.cjs +0 -2
- package/cjs/vef-drawer/components/action-button-wrapper.cjs +1 -53
- package/cjs/vef-drawer/components/button-props.cjs +0 -2
- package/cjs/vef-drawer/components/cancel-action-button.cjs +1 -25
- package/cjs/vef-drawer/components/ok-action-button.cjs +1 -24
- package/cjs/vef-drawer/context.cjs +1 -19
- package/cjs/vef-drawer/index.cjs +3 -159
- package/cjs/vef-drawer/props.cjs +0 -2
- package/cjs/vef-dropdown/index.cjs +1 -96
- package/cjs/vef-dropdown/props.cjs +0 -2
- package/cjs/vef-dynamic-icon/index.cjs +1 -50
- package/cjs/vef-dynamic-icon/props.cjs +1 -8
- package/cjs/vef-empty/index.cjs +1 -41
- package/cjs/vef-empty/props.cjs +0 -2
- package/cjs/vef-empty-placeholder/index.cjs +4 -23
- package/cjs/vef-empty-placeholder/props.cjs +0 -2
- package/cjs/vef-error/error-icon.cjs +1 -761
- package/cjs/vef-error/index.cjs +9 -52
- package/cjs/vef-error/props.cjs +0 -2
- package/cjs/vef-filter/components/action-buttons.cjs +5 -125
- package/cjs/vef-filter/components/advanced-filter.cjs +8 -75
- package/cjs/vef-filter/components/basic-filter.cjs +4 -39
- package/cjs/vef-filter/components/fields/index.cjs +1 -21
- package/cjs/vef-filter/components/fields/input-number.cjs +1 -94
- package/cjs/vef-filter/components/fields/input.cjs +1 -71
- package/cjs/vef-filter/components/fields/props.cjs +0 -2
- package/cjs/vef-filter/components/fields/radio.cjs +1 -113
- package/cjs/vef-filter/components/fields/select.cjs +1 -144
- package/cjs/vef-filter/components/fields/tree-select.cjs +1 -140
- package/cjs/vef-filter/components/filter-field.cjs +1 -23
- package/cjs/vef-filter/components/filter-item.cjs +1 -116
- package/cjs/vef-filter/event.cjs +1 -46
- package/cjs/vef-filter/helper.cjs +1 -17
- package/cjs/vef-filter/hooks/use-action-handlers.cjs +1 -72
- package/cjs/vef-filter/hooks/use-computed-values.cjs +1 -57
- package/cjs/vef-filter/hooks/use-filter-context.cjs +1 -22
- package/cjs/vef-filter/hooks/use-filter-initialization.cjs +1 -39
- package/cjs/vef-filter/hooks/use-filter-instance.cjs +1 -28
- package/cjs/vef-filter/hooks/use-filter-items.cjs +1 -25
- package/cjs/vef-filter/hooks/use-filter-values-change.cjs +1 -32
- package/cjs/vef-filter/hooks/use-label-config.cjs +1 -29
- package/cjs/vef-filter/index.cjs +2 -145
- package/cjs/vef-filter/props.cjs +0 -2
- package/cjs/vef-filter/store.cjs +1 -75
- package/cjs/vef-filter/types.cjs +0 -2
- package/cjs/vef-flex/index.cjs +1 -35
- package/cjs/vef-flex/props.cjs +0 -2
- package/cjs/vef-float-button/index.cjs +1 -53
- package/cjs/vef-float-button/props.cjs +0 -2
- package/cjs/vef-float-button-group/index.cjs +1 -24
- package/cjs/vef-float-button-group/props.cjs +0 -2
- package/cjs/vef-form/components/fields/icon-select.cjs +1 -69
- package/cjs/vef-form/components/fields/index.cjs +1 -27
- package/cjs/vef-form/components/fields/input-number.cjs +1 -127
- package/cjs/vef-form/components/fields/input.cjs +1 -136
- package/cjs/vef-form/components/fields/password.cjs +1 -119
- package/cjs/vef-form/components/fields/props.cjs +0 -2
- package/cjs/vef-form/components/fields/radio.cjs +1 -110
- package/cjs/vef-form/components/fields/select.cjs +1 -242
- package/cjs/vef-form/components/fields/textarea.cjs +1 -113
- package/cjs/vef-form/components/fields/tree-select.cjs +1 -238
- package/cjs/vef-form/components/form-actions.cjs +3 -62
- package/cjs/vef-form/components/form-content.cjs +2 -148
- package/cjs/vef-form/components/form-field.cjs +1 -26
- package/cjs/vef-form/components/form-group.cjs +3 -68
- package/cjs/vef-form/components/form-hidden-item.cjs +1 -40
- package/cjs/vef-form/components/form-item.cjs +1 -83
- package/cjs/vef-form/components/form-row.cjs +1 -102
- package/cjs/vef-form/event.cjs +1 -46
- package/cjs/vef-form/helper.cjs +1 -17
- package/cjs/vef-form/hooks/use-action-handlers.cjs +1 -132
- package/cjs/vef-form/hooks/use-columns-layout.cjs +1 -124
- package/cjs/vef-form/hooks/use-computed-values.cjs +1 -57
- package/cjs/vef-form/hooks/use-form-context.cjs +1 -18
- package/cjs/vef-form/hooks/use-form-initialization.cjs +1 -47
- package/cjs/vef-form/hooks/use-form-instance.cjs +1 -28
- package/cjs/vef-form/hooks/use-form-values-change.cjs +1 -32
- package/cjs/vef-form/hooks/use-label-width.cjs +1 -20
- package/cjs/vef-form/index.cjs +3 -178
- package/cjs/vef-form/props.cjs +0 -2
- package/cjs/vef-form/store.cjs +1 -69
- package/cjs/vef-form/types.cjs +0 -2
- package/cjs/vef-form/validation-rules.cjs +1 -310
- package/cjs/vef-form-drawer/index.cjs +1 -102
- package/cjs/vef-form-drawer/props.cjs +0 -2
- package/cjs/vef-form-modal/index.cjs +1 -99
- package/cjs/vef-form-modal/props.cjs +0 -2
- package/cjs/vef-generic-select/index.cjs +1 -85
- package/cjs/vef-generic-select/props.cjs +0 -2
- package/cjs/vef-grid/index.cjs +12 -81
- package/cjs/vef-grid/props.cjs +1 -6
- package/cjs/vef-grid-item/index.cjs +1 -56
- package/cjs/vef-grid-item/props.cjs +0 -2
- package/cjs/vef-icon/index.cjs +1 -54
- package/cjs/vef-icon/props.cjs +0 -2
- package/cjs/vef-icon-select/index.cjs +11 -150
- package/cjs/vef-icon-select/props.cjs +0 -2
- package/cjs/vef-input/hooks/use-input-instance.cjs +1 -17
- package/cjs/vef-input/index.cjs +1 -68
- package/cjs/vef-input/props.cjs +0 -2
- package/cjs/vef-input-number/hooks/use-input-number-instance.cjs +1 -15
- package/cjs/vef-input-number/index.cjs +1 -152
- package/cjs/vef-input-number/props.cjs +0 -2
- package/cjs/vef-intellisense-code-editor/hooks/use-change-handler.cjs +1 -12
- package/cjs/vef-intellisense-code-editor/hooks/use-editor-options.cjs +1 -33
- package/cjs/vef-intellisense-code-editor/hooks/use-path.cjs +1 -32
- package/cjs/vef-intellisense-code-editor/index.cjs +1 -46
- package/cjs/vef-intellisense-code-editor/loader.cjs +1 -141
- package/cjs/vef-intellisense-code-editor/props.cjs +0 -2
- package/cjs/vef-intellisense-code-editor/styles.cjs +9 -17
- package/cjs/vef-intellisense-code-editor/themes/github-light.json.cjs +349 -7
- package/cjs/vef-json-viewer/index.cjs +1 -40
- package/cjs/vef-json-viewer/props.cjs +0 -2
- package/cjs/vef-layout/common-styles.cjs +4 -12
- package/cjs/vef-layout/components/content.cjs +1 -17
- package/cjs/vef-layout/components/font-size.cjs +1 -72
- package/cjs/vef-layout/components/fullscreen.cjs +1 -27
- package/cjs/vef-layout/components/header-action-icons.cjs +6 -33
- package/cjs/vef-layout/components/header-content.cjs +1 -23
- package/cjs/vef-layout/components/header.cjs +6 -73
- package/cjs/vef-layout/components/icon-boy.cjs +1 -73
- package/cjs/vef-layout/components/icon-girl.cjs +1 -80
- package/cjs/vef-layout/components/icon-menu-fold-left.cjs +1 -27
- package/cjs/vef-layout/components/icon-menu-unfold-left.cjs +1 -27
- package/cjs/vef-layout/components/menu-groups.cjs +15 -127
- package/cjs/vef-layout/components/message.cjs +1 -15
- package/cjs/vef-layout/components/search.cjs +1 -15
- package/cjs/vef-layout/components/sider.cjs +5 -58
- package/cjs/vef-layout/components/title.cjs +8 -57
- package/cjs/vef-layout/components/user-avatar.cjs +9 -84
- package/cjs/vef-layout/hooks/use-layout-context.cjs +1 -14
- package/cjs/vef-layout/index.cjs +2 -37
- package/cjs/vef-layout/logo.svg.cjs +1 -7
- package/cjs/vef-layout/props.cjs +0 -2
- package/cjs/vef-layout/store.cjs +1 -20
- package/cjs/vef-line-chart/index.cjs +1 -42
- package/cjs/vef-line-chart/props.cjs +0 -2
- package/cjs/vef-loading-placeholder/index.cjs +5 -46
- package/cjs/vef-loading-placeholder/props.cjs +0 -2
- package/cjs/vef-login/index.cjs +21 -156
- package/cjs/vef-login/login-icon.cjs +1 -672
- package/cjs/vef-login/props.cjs +0 -2
- package/cjs/vef-menu/index.cjs +4 -81
- package/cjs/vef-menu/props.cjs +0 -2
- package/cjs/vef-modal/components/action-button-wrapper.cjs +1 -53
- package/cjs/vef-modal/components/button-props.cjs +0 -2
- package/cjs/vef-modal/components/cancel-action-button.cjs +1 -22
- package/cjs/vef-modal/components/ok-action-button.cjs +1 -24
- package/cjs/vef-modal/context.cjs +1 -19
- package/cjs/vef-modal/index.cjs +2 -244
- package/cjs/vef-modal/props.cjs +0 -2
- package/cjs/vef-not-found/index.cjs +9 -49
- package/cjs/vef-not-found/not-found-icon.cjs +1 -848
- package/cjs/vef-not-found/props.cjs +0 -2
- package/cjs/vef-page/index.cjs +10 -91
- package/cjs/vef-page/props.cjs +0 -2
- package/cjs/vef-pagination/index.cjs +1 -61
- package/cjs/vef-pagination/props.cjs +1 -15
- package/cjs/vef-paragraph/index.cjs +1 -93
- package/cjs/vef-paragraph/props.cjs +0 -2
- package/cjs/vef-password/hooks/use-password-instance.cjs +1 -15
- package/cjs/vef-password/index.cjs +1 -71
- package/cjs/vef-password/props.cjs +0 -2
- package/cjs/vef-pie-chart/index.cjs +8 -74
- package/cjs/vef-pie-chart/props.cjs +0 -2
- package/cjs/vef-popconfirm/index.cjs +1 -60
- package/cjs/vef-popconfirm/props.cjs +0 -2
- package/cjs/vef-popover/index.cjs +1 -38
- package/cjs/vef-popover/props.cjs +0 -2
- package/cjs/vef-radio/hooks/use-data-options.cjs +1 -42
- package/cjs/vef-radio/hooks/use-radio-instance.cjs +1 -22
- package/cjs/vef-radio/index.cjs +3 -92
- package/cjs/vef-radio/props.cjs +0 -2
- package/cjs/vef-rate/hooks/use-rate-instance.cjs +1 -15
- package/cjs/vef-rate/index.cjs +1 -34
- package/cjs/vef-rate/props.cjs +0 -2
- package/cjs/vef-responsive-container/index.cjs +2 -58
- package/cjs/vef-responsive-container/props.cjs +0 -2
- package/cjs/vef-responsive-item/index.cjs +2 -27
- package/cjs/vef-responsive-item/props.cjs +0 -2
- package/cjs/vef-ribbon/index.cjs +1 -42
- package/cjs/vef-ribbon/props.cjs +0 -2
- package/cjs/vef-row/index.cjs +1 -16
- package/cjs/vef-row/props.cjs +0 -2
- package/cjs/vef-scroll-area/components/scrollbar.cjs +7 -38
- package/cjs/vef-scroll-area/index.cjs +3 -73
- package/cjs/vef-scroll-area/props.cjs +0 -2
- package/cjs/vef-segment/index.cjs +1 -40
- package/cjs/vef-segment/props.cjs +0 -2
- package/cjs/vef-select/components/option.cjs +3 -27
- package/cjs/vef-select/hooks/use-data-options.cjs +1 -49
- package/cjs/vef-select/hooks/use-field-names.cjs +1 -23
- package/cjs/vef-select/hooks/use-render-label.cjs +2 -25
- package/cjs/vef-select/hooks/use-render-option.cjs +1 -21
- package/cjs/vef-select/hooks/use-select-instance.cjs +1 -22
- package/cjs/vef-select/index.cjs +1 -104
- package/cjs/vef-select/props.cjs +0 -2
- package/cjs/vef-slider/hooks/use-slider-instance.cjs +1 -15
- package/cjs/vef-slider/index.cjs +1 -38
- package/cjs/vef-slider/props.cjs +0 -2
- package/cjs/vef-sortable-list/components/overlay-item.cjs +2 -35
- package/cjs/vef-sortable-list/components/sortable-item.cjs +2 -79
- package/cjs/vef-sortable-list/hooks/use-merged-items.cjs +1 -23
- package/cjs/vef-sortable-list/index.cjs +1 -118
- package/cjs/vef-sortable-list/props.cjs +0 -2
- package/cjs/vef-space/index.cjs +1 -29
- package/cjs/vef-space/props.cjs +0 -2
- package/cjs/vef-spin/index.cjs +1 -16
- package/cjs/vef-spin/props.cjs +0 -2
- package/cjs/vef-splitter/index.cjs +1 -24
- package/cjs/vef-splitter/props.cjs +0 -2
- package/cjs/vef-splitter-panel/index.cjs +1 -16
- package/cjs/vef-splitter-panel/props.cjs +0 -2
- package/cjs/vef-status/index.cjs +1 -41
- package/cjs/vef-status/props.cjs +0 -2
- package/cjs/vef-table/components/columns/bool.cjs +1 -95
- package/cjs/vef-table/components/columns/code.cjs +1 -14
- package/cjs/vef-table/components/columns/data-dictionary.cjs +1 -96
- package/cjs/vef-table/components/columns/enum.cjs +1 -105
- package/cjs/vef-table/components/columns/file.cjs +1 -14
- package/cjs/vef-table/components/columns/icon.cjs +1 -14
- package/cjs/vef-table/components/columns/id.cjs +1 -86
- package/cjs/vef-table/components/columns/image.cjs +1 -15
- package/cjs/vef-table/components/columns/index.cjs +1 -35
- package/cjs/vef-table/components/columns/markdown.cjs +1 -14
- package/cjs/vef-table/components/columns/number.cjs +1 -87
- package/cjs/vef-table/components/columns/props.cjs +0 -2
- package/cjs/vef-table/components/columns/render.cjs +1 -32
- package/cjs/vef-table/components/columns/rich-text.cjs +1 -14
- package/cjs/vef-table/components/columns/text.cjs +1 -92
- package/cjs/vef-table/components/columns-settings.cjs +10 -199
- package/cjs/vef-table/components/operation-buttons.cjs +2 -234
- package/cjs/vef-table/components/settings-icon.cjs +3 -23
- package/cjs/vef-table/components/table-footer.cjs +3 -106
- package/cjs/vef-table/helper.cjs +1 -17
- package/cjs/vef-table/hooks/use-computed-batch-buttons.cjs +1 -35
- package/cjs/vef-table/hooks/use-computed-columns.cjs +1 -22
- package/cjs/vef-table/hooks/use-computed-values.cjs +1 -40
- package/cjs/vef-table/hooks/use-data.cjs +1 -59
- package/cjs/vef-table/hooks/use-default-column-configs.cjs +1 -29
- package/cjs/vef-table/hooks/use-display-value.cjs +1 -38
- package/cjs/vef-table/hooks/use-helper-columns.cjs +1 -69
- package/cjs/vef-table/hooks/use-operation-column-width.cjs +1 -52
- package/cjs/vef-table/hooks/use-pagination-props.cjs +1 -46
- package/cjs/vef-table/hooks/use-row-props.cjs +1 -41
- package/cjs/vef-table/hooks/use-row-selection-config.cjs +1 -114
- package/cjs/vef-table/hooks/use-selected-rows.cjs +1 -28
- package/cjs/vef-table/hooks/use-table-columns.cjs +1 -58
- package/cjs/vef-table/hooks/use-table-context.cjs +1 -25
- package/cjs/vef-table/hooks/use-table-instance.cjs +1 -17
- package/cjs/vef-table/hooks/use-table-summary.cjs +1 -44
- package/cjs/vef-table/hooks/use-table-width.cjs +1 -15
- package/cjs/vef-table/index.cjs +5 -231
- package/cjs/vef-table/props.cjs +0 -2
- package/cjs/vef-table/store.cjs +1 -21
- package/cjs/vef-table/types.cjs +0 -2
- package/cjs/vef-tabs/index.cjs +1 -29
- package/cjs/vef-tabs/props.cjs +0 -2
- package/cjs/vef-tag/index.cjs +1 -32
- package/cjs/vef-tag/props.cjs +0 -2
- package/cjs/vef-temporal-picker/helper.cjs +1 -59
- package/cjs/vef-temporal-picker/hooks/use-dayjs-value.cjs +1 -20
- package/cjs/vef-temporal-picker/hooks/use-temporal-limit.cjs +1 -36
- package/cjs/vef-temporal-picker/hooks/use-temporal-picker-instance.cjs +1 -21
- package/cjs/vef-temporal-picker/index.cjs +1 -129
- package/cjs/vef-temporal-picker/props.cjs +0 -2
- package/cjs/vef-temporal-range-picker/helper.cjs +1 -59
- package/cjs/vef-temporal-range-picker/hooks/use-dayjs-values.cjs +1 -25
- package/cjs/vef-temporal-range-picker/hooks/use-temporal-limit.cjs +1 -36
- package/cjs/vef-temporal-range-picker/hooks/use-temporal-range-picker-instance.cjs +1 -21
- package/cjs/vef-temporal-range-picker/index.cjs +1 -132
- package/cjs/vef-temporal-range-picker/props.cjs +1 -6
- package/cjs/vef-text/index.cjs +1 -84
- package/cjs/vef-text/props.cjs +0 -2
- package/cjs/vef-textarea/hooks/use-textarea-instance.cjs +1 -15
- package/cjs/vef-textarea/index.cjs +1 -71
- package/cjs/vef-textarea/props.cjs +0 -2
- package/cjs/vef-title/index.cjs +6 -93
- package/cjs/vef-title/props.cjs +0 -2
- package/cjs/vef-tooltip/index.cjs +1 -39
- package/cjs/vef-tooltip/props.cjs +0 -2
- package/cjs/vef-tree-select/hooks/use-change-handler.cjs +1 -35
- package/cjs/vef-tree-select/hooks/use-data-options.cjs +1 -47
- package/cjs/vef-tree-select/hooks/use-tree-select-instance.cjs +1 -22
- package/cjs/vef-tree-select/index.cjs +1 -93
- package/cjs/vef-tree-select/props.cjs +0 -2
- package/cjs/vef-virtual-grid/index.cjs +3 -111
- package/cjs/vef-virtual-grid/props.cjs +0 -2
- package/cjs/vef-virtual-list/index.cjs +4 -219
- package/cjs/vef-virtual-list/props.cjs +0 -2
- package/esm/index.js +1 -96
- package/esm/internal/base.css.js +490 -2
- package/esm/internal/chart.js +1 -18
- package/esm/internal/index.js +1 -4
- package/esm/internal/modern-normalize.css.js +213 -2
- package/esm/internal/utils.js +1 -6
- package/esm/vef-access-denied/access-denied-icon.js +1 -928
- package/esm/vef-access-denied/index.js +9 -45
- package/esm/vef-action-buttons/index.js +1 -75
- package/esm/vef-approval-flow-editor/components/edge.js +2 -83
- package/esm/vef-approval-flow-editor/components/label-value.js +8 -27
- package/esm/vef-approval-flow-editor/components/node-content.js +10 -45
- package/esm/vef-approval-flow-editor/components/node-selector.js +4 -33
- package/esm/vef-approval-flow-editor/components/node-toolbar.js +1 -21
- package/esm/vef-approval-flow-editor/components/nodes/approval.js +1 -24
- package/esm/vef-approval-flow-editor/components/nodes/condition.js +1 -24
- package/esm/vef-approval-flow-editor/components/nodes/end.js +1 -24
- package/esm/vef-approval-flow-editor/components/nodes/handle.js +1 -24
- package/esm/vef-approval-flow-editor/components/nodes/index.js +1 -17
- package/esm/vef-approval-flow-editor/components/nodes/submit.js +1 -24
- package/esm/vef-approval-flow-editor/components/selector-content.js +9 -48
- package/esm/vef-approval-flow-editor/components/source-handle.js +1 -40
- package/esm/vef-approval-flow-editor/components/target-handle.js +1 -9
- package/esm/vef-approval-flow-editor/constants.js +1 -218
- package/esm/vef-approval-flow-editor/helper.js +1 -83
- package/esm/vef-approval-flow-editor/hooks/use-edges-interaction.js +1 -25
- package/esm/vef-approval-flow-editor/hooks/use-element-selection.js +1 -24
- package/esm/vef-approval-flow-editor/hooks/use-nodes-interaction.js +1 -51
- package/esm/vef-approval-flow-editor/index.js +1 -75
- package/esm/vef-approval-flow-editor/models/edge-node.js +1 -20
- package/esm/vef-approval-flow-editor/models/flow-node.js +1 -105
- package/esm/vef-approval-flow-editor/store.js +1 -16
- package/esm/vef-approval-flow-editor/styles.js +12 -20
- package/esm/vef-approval-flow-editor/types.js +1 -15
- package/esm/vef-area-chart/index.js +1 -41
- package/esm/vef-auto-sizer/index.js +1 -6
- package/esm/vef-avatar/index.js +1 -20
- package/esm/vef-avatar-group/index.js +1 -25
- package/esm/vef-badge/index.js +1 -47
- package/esm/vef-bar-chart/index.js +1 -41
- package/esm/vef-bool/hooks/use-bool-instance.js +1 -34
- package/esm/vef-bool/index.js +1 -60
- package/esm/vef-breadcrumb/index.js +1 -48
- package/esm/vef-button/components/base-button.js +1 -73
- package/esm/vef-button/index.js +1 -151
- package/esm/vef-card/index.js +1 -25
- package/esm/vef-card-meta/index.js +1 -12
- package/esm/vef-chart-container/hooks/use-chart-container-context.js +1 -12
- package/esm/vef-chart-container/index.js +13 -79
- package/esm/vef-chart-legend-content/index.js +10 -43
- package/esm/vef-chart-tooltip-content/index.js +22 -85
- package/esm/vef-checkbox/hooks/use-checkbox-instance.js +1 -20
- package/esm/vef-checkbox/hooks/use-data-options.js +1 -40
- package/esm/vef-checkbox/index.js +3 -88
- package/esm/vef-code-editor/hooks/use-change-handler.js +1 -10
- package/esm/vef-code-editor/hooks/use-config-extensions.js +1 -48
- package/esm/vef-code-editor/hooks/use-height-props.js +1 -20
- package/esm/vef-code-editor/hooks/use-language-extensions.js +1 -117
- package/esm/vef-code-editor/hooks/use-setup-options.js +1 -37
- package/esm/vef-code-editor/index.js +1 -57
- package/esm/vef-code-editor/styles.js +46 -52
- package/esm/vef-col/index.js +1 -11
- package/esm/vef-color-picker/index.js +1 -46
- package/esm/vef-compact/index.js +1 -15
- package/esm/vef-config-provider/global-style.js +15 -23
- package/esm/vef-config-provider/hooks/use-ui-config.js +1 -126
- package/esm/vef-config-provider/index.js +3 -121
- package/esm/vef-config-provider/store.js +1 -21
- package/esm/vef-container/index.js +1 -18
- package/esm/vef-crud-page/components/crud-actions.js +1 -32
- package/esm/vef-crud-page/components/crud-filter.js +1 -54
- package/esm/vef-crud-page/components/crud-footer.js +3 -116
- package/esm/vef-crud-page/components/crud-form-modal.js +1 -53
- package/esm/vef-crud-page/components/crud-header.js +1 -29
- package/esm/vef-crud-page/components/crud-table.js +1 -76
- package/esm/vef-crud-page/hooks/use-action-buttons.js +1 -37
- package/esm/vef-crud-page/hooks/use-crud-context.js +1 -20
- package/esm/vef-crud-page/hooks/use-crud-schema.js +1 -116
- package/esm/vef-crud-page/hooks/use-operation-buttons.js +1 -60
- package/esm/vef-crud-page/index.js +1 -150
- package/esm/vef-crud-page/store.js +1 -142
- package/esm/vef-data-grid/index.js +1 -85
- package/esm/vef-data-table/index.js +1 -9
- package/esm/vef-divider/index.js +1 -24
- package/esm/vef-drawer/components/action-button-wrapper.js +1 -49
- package/esm/vef-drawer/components/cancel-action-button.js +1 -21
- package/esm/vef-drawer/components/ok-action-button.js +1 -20
- package/esm/vef-drawer/context.js +1 -15
- package/esm/vef-drawer/index.js +3 -154
- package/esm/vef-dropdown/index.js +1 -92
- package/esm/vef-dynamic-icon/index.js +1 -46
- package/esm/vef-dynamic-icon/props.js +1 -6
- package/esm/vef-empty/index.js +1 -37
- package/esm/vef-empty-placeholder/index.js +4 -19
- package/esm/vef-error/error-icon.js +1 -757
- package/esm/vef-error/index.js +9 -48
- package/esm/vef-filter/components/action-buttons.js +5 -121
- package/esm/vef-filter/components/advanced-filter.js +8 -71
- package/esm/vef-filter/components/basic-filter.js +4 -35
- package/esm/vef-filter/components/fields/index.js +1 -19
- package/esm/vef-filter/components/fields/input-number.js +1 -90
- package/esm/vef-filter/components/fields/input.js +1 -67
- package/esm/vef-filter/components/fields/radio.js +1 -109
- package/esm/vef-filter/components/fields/select.js +1 -140
- package/esm/vef-filter/components/fields/tree-select.js +1 -136
- package/esm/vef-filter/components/filter-field.js +1 -19
- package/esm/vef-filter/components/filter-item.js +1 -112
- package/esm/vef-filter/event.js +1 -44
- package/esm/vef-filter/helper.js +1 -15
- package/esm/vef-filter/hooks/use-action-handlers.js +1 -70
- package/esm/vef-filter/hooks/use-computed-values.js +1 -55
- package/esm/vef-filter/hooks/use-filter-context.js +1 -18
- package/esm/vef-filter/hooks/use-filter-initialization.js +1 -37
- package/esm/vef-filter/hooks/use-filter-instance.js +1 -26
- package/esm/vef-filter/hooks/use-filter-items.js +1 -23
- package/esm/vef-filter/hooks/use-filter-values-change.js +1 -30
- package/esm/vef-filter/hooks/use-label-config.js +1 -27
- package/esm/vef-filter/index.js +2 -141
- package/esm/vef-filter/store.js +1 -71
- package/esm/vef-flex/index.js +1 -31
- package/esm/vef-float-button/index.js +1 -49
- package/esm/vef-float-button-group/index.js +1 -20
- package/esm/vef-form/components/fields/icon-select.js +1 -65
- package/esm/vef-form/components/fields/index.js +1 -25
- package/esm/vef-form/components/fields/input-number.js +1 -123
- package/esm/vef-form/components/fields/input.js +1 -132
- package/esm/vef-form/components/fields/password.js +1 -115
- package/esm/vef-form/components/fields/radio.js +1 -106
- package/esm/vef-form/components/fields/select.js +1 -238
- package/esm/vef-form/components/fields/textarea.js +1 -109
- package/esm/vef-form/components/fields/tree-select.js +1 -234
- package/esm/vef-form/components/form-actions.js +3 -58
- package/esm/vef-form/components/form-content.js +2 -144
- package/esm/vef-form/components/form-field.js +1 -22
- package/esm/vef-form/components/form-group.js +3 -64
- package/esm/vef-form/components/form-hidden-item.js +1 -36
- package/esm/vef-form/components/form-item.js +1 -79
- package/esm/vef-form/components/form-row.js +1 -98
- package/esm/vef-form/event.js +1 -44
- package/esm/vef-form/helper.js +1 -15
- package/esm/vef-form/hooks/use-action-handlers.js +1 -130
- package/esm/vef-form/hooks/use-columns-layout.js +1 -122
- package/esm/vef-form/hooks/use-computed-values.js +1 -55
- package/esm/vef-form/hooks/use-form-context.js +1 -14
- package/esm/vef-form/hooks/use-form-initialization.js +1 -45
- package/esm/vef-form/hooks/use-form-instance.js +1 -26
- package/esm/vef-form/hooks/use-form-values-change.js +1 -30
- package/esm/vef-form/hooks/use-label-width.js +1 -18
- package/esm/vef-form/index.js +3 -174
- package/esm/vef-form/store.js +1 -65
- package/esm/vef-form/validation-rules.js +1 -286
- package/esm/vef-form-drawer/index.js +1 -98
- package/esm/vef-form-modal/index.js +1 -95
- package/esm/vef-generic-select/index.js +1 -81
- package/esm/vef-grid/index.js +12 -77
- package/esm/vef-grid/props.js +1 -4
- package/esm/vef-grid-item/index.js +1 -52
- package/esm/vef-icon/index.js +1 -50
- package/esm/vef-icon-select/index.js +11 -146
- package/esm/vef-input/hooks/use-input-instance.js +1 -15
- package/esm/vef-input/index.js +1 -64
- package/esm/vef-input-number/hooks/use-input-number-instance.js +1 -13
- package/esm/vef-input-number/index.js +1 -148
- package/esm/vef-intellisense-code-editor/hooks/use-change-handler.js +1 -10
- package/esm/vef-intellisense-code-editor/hooks/use-editor-options.js +1 -31
- package/esm/vef-intellisense-code-editor/hooks/use-path.js +1 -30
- package/esm/vef-intellisense-code-editor/index.js +1 -42
- package/esm/vef-intellisense-code-editor/loader.js +1 -120
- package/esm/vef-intellisense-code-editor/styles.js +9 -15
- package/esm/vef-intellisense-code-editor/themes/github-light.json.js +349 -3
- package/esm/vef-json-viewer/index.js +1 -36
- package/esm/vef-layout/common-styles.js +4 -10
- package/esm/vef-layout/components/content.js +1 -13
- package/esm/vef-layout/components/font-size.js +1 -68
- package/esm/vef-layout/components/fullscreen.js +1 -23
- package/esm/vef-layout/components/header-action-icons.js +6 -29
- package/esm/vef-layout/components/header-content.js +1 -19
- package/esm/vef-layout/components/header.js +6 -69
- package/esm/vef-layout/components/icon-boy.js +1 -69
- package/esm/vef-layout/components/icon-girl.js +1 -76
- package/esm/vef-layout/components/icon-menu-fold-left.js +1 -23
- package/esm/vef-layout/components/icon-menu-unfold-left.js +1 -23
- package/esm/vef-layout/components/menu-groups.js +15 -123
- package/esm/vef-layout/components/message.js +1 -11
- package/esm/vef-layout/components/search.js +1 -11
- package/esm/vef-layout/components/sider.js +5 -54
- package/esm/vef-layout/components/title.js +8 -53
- package/esm/vef-layout/components/user-avatar.js +9 -80
- package/esm/vef-layout/hooks/use-layout-context.js +1 -10
- package/esm/vef-layout/index.js +2 -33
- package/esm/vef-layout/logo.svg.js +1 -3
- package/esm/vef-layout/store.js +1 -16
- package/esm/vef-line-chart/index.js +1 -38
- package/esm/vef-loading-placeholder/index.js +5 -42
- package/esm/vef-login/index.js +21 -152
- package/esm/vef-login/login-icon.js +1 -668
- package/esm/vef-menu/index.js +4 -77
- package/esm/vef-modal/components/action-button-wrapper.js +1 -49
- package/esm/vef-modal/components/cancel-action-button.js +1 -18
- package/esm/vef-modal/components/ok-action-button.js +1 -20
- package/esm/vef-modal/context.js +1 -15
- package/esm/vef-modal/index.js +2 -239
- package/esm/vef-not-found/index.js +9 -45
- package/esm/vef-not-found/not-found-icon.js +1 -844
- package/esm/vef-page/index.js +10 -87
- package/esm/vef-pagination/index.js +1 -57
- package/esm/vef-pagination/props.js +1 -13
- package/esm/vef-paragraph/index.js +1 -89
- package/esm/vef-password/hooks/use-password-instance.js +1 -13
- package/esm/vef-password/index.js +1 -67
- package/esm/vef-pie-chart/index.js +8 -70
- package/esm/vef-popconfirm/index.js +1 -56
- package/esm/vef-popover/index.js +1 -34
- package/esm/vef-radio/hooks/use-data-options.js +1 -40
- package/esm/vef-radio/hooks/use-radio-instance.js +1 -20
- package/esm/vef-radio/index.js +3 -88
- package/esm/vef-rate/hooks/use-rate-instance.js +1 -13
- package/esm/vef-rate/index.js +1 -30
- package/esm/vef-responsive-container/index.js +2 -54
- package/esm/vef-responsive-item/index.js +2 -23
- package/esm/vef-ribbon/index.js +1 -38
- package/esm/vef-row/index.js +1 -12
- package/esm/vef-scroll-area/components/scrollbar.js +7 -34
- package/esm/vef-scroll-area/index.js +3 -69
- package/esm/vef-segment/index.js +1 -36
- package/esm/vef-select/components/option.js +3 -23
- package/esm/vef-select/hooks/use-data-options.js +1 -47
- package/esm/vef-select/hooks/use-field-names.js +1 -21
- package/esm/vef-select/hooks/use-render-label.js +2 -23
- package/esm/vef-select/hooks/use-render-option.js +1 -19
- package/esm/vef-select/hooks/use-select-instance.js +1 -20
- package/esm/vef-select/index.js +1 -100
- package/esm/vef-slider/hooks/use-slider-instance.js +1 -13
- package/esm/vef-slider/index.js +1 -34
- package/esm/vef-sortable-list/components/overlay-item.js +2 -31
- package/esm/vef-sortable-list/components/sortable-item.js +2 -75
- package/esm/vef-sortable-list/hooks/use-merged-items.js +1 -21
- package/esm/vef-sortable-list/index.js +1 -114
- package/esm/vef-space/index.js +1 -25
- package/esm/vef-spin/index.js +1 -12
- package/esm/vef-splitter/index.js +1 -20
- package/esm/vef-splitter-panel/index.js +1 -12
- package/esm/vef-status/index.js +1 -37
- package/esm/vef-table/components/columns/bool.js +1 -91
- package/esm/vef-table/components/columns/code.js +1 -10
- package/esm/vef-table/components/columns/data-dictionary.js +1 -92
- package/esm/vef-table/components/columns/enum.js +1 -101
- package/esm/vef-table/components/columns/file.js +1 -10
- package/esm/vef-table/components/columns/icon.js +1 -10
- package/esm/vef-table/components/columns/id.js +1 -82
- package/esm/vef-table/components/columns/image.js +1 -11
- package/esm/vef-table/components/columns/index.js +1 -33
- package/esm/vef-table/components/columns/markdown.js +1 -10
- package/esm/vef-table/components/columns/number.js +1 -83
- package/esm/vef-table/components/columns/render.js +1 -28
- package/esm/vef-table/components/columns/rich-text.js +1 -10
- package/esm/vef-table/components/columns/text.js +1 -88
- package/esm/vef-table/components/columns-settings.js +10 -195
- package/esm/vef-table/components/operation-buttons.js +2 -230
- package/esm/vef-table/components/settings-icon.js +3 -19
- package/esm/vef-table/components/table-footer.js +3 -102
- package/esm/vef-table/helper.js +1 -15
- package/esm/vef-table/hooks/use-computed-batch-buttons.js +1 -33
- package/esm/vef-table/hooks/use-computed-columns.js +1 -20
- package/esm/vef-table/hooks/use-computed-values.js +1 -38
- package/esm/vef-table/hooks/use-data.js +1 -57
- package/esm/vef-table/hooks/use-default-column-configs.js +1 -27
- package/esm/vef-table/hooks/use-display-value.js +1 -36
- package/esm/vef-table/hooks/use-helper-columns.js +1 -67
- package/esm/vef-table/hooks/use-operation-column-width.js +1 -50
- package/esm/vef-table/hooks/use-pagination-props.js +1 -44
- package/esm/vef-table/hooks/use-row-props.js +1 -39
- package/esm/vef-table/hooks/use-row-selection-config.js +1 -112
- package/esm/vef-table/hooks/use-selected-rows.js +1 -26
- package/esm/vef-table/hooks/use-table-columns.js +1 -56
- package/esm/vef-table/hooks/use-table-context.js +1 -21
- package/esm/vef-table/hooks/use-table-instance.js +1 -15
- package/esm/vef-table/hooks/use-table-summary.js +1 -42
- package/esm/vef-table/hooks/use-table-width.js +1 -13
- package/esm/vef-table/index.js +5 -227
- package/esm/vef-table/store.js +1 -17
- package/esm/vef-tabs/index.js +1 -25
- package/esm/vef-tag/index.js +1 -28
- package/esm/vef-temporal-picker/helper.js +1 -57
- package/esm/vef-temporal-picker/hooks/use-dayjs-value.js +1 -18
- package/esm/vef-temporal-picker/hooks/use-temporal-limit.js +1 -34
- package/esm/vef-temporal-picker/hooks/use-temporal-picker-instance.js +1 -19
- package/esm/vef-temporal-picker/index.js +1 -125
- package/esm/vef-temporal-range-picker/helper.js +1 -57
- package/esm/vef-temporal-range-picker/hooks/use-dayjs-values.js +1 -23
- package/esm/vef-temporal-range-picker/hooks/use-temporal-limit.js +1 -34
- package/esm/vef-temporal-range-picker/hooks/use-temporal-range-picker-instance.js +1 -19
- package/esm/vef-temporal-range-picker/index.js +1 -128
- package/esm/vef-temporal-range-picker/props.js +1 -4
- package/esm/vef-text/index.js +1 -80
- package/esm/vef-textarea/hooks/use-textarea-instance.js +1 -13
- package/esm/vef-textarea/index.js +1 -67
- package/esm/vef-title/index.js +6 -89
- package/esm/vef-tooltip/index.js +1 -35
- package/esm/vef-tree-select/hooks/use-change-handler.js +1 -33
- package/esm/vef-tree-select/hooks/use-data-options.js +1 -45
- package/esm/vef-tree-select/hooks/use-tree-select-instance.js +1 -20
- package/esm/vef-tree-select/index.js +1 -89
- package/esm/vef-virtual-grid/index.js +3 -107
- package/esm/vef-virtual-list/index.js +4 -215
- package/package.json +4 -4
|
@@ -1,43 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import { isFunction } from '@vef-framework/shared';
|
|
4
|
-
import { Table } from 'antd';
|
|
5
|
-
import { useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
"use strict";
|
|
8
|
-
const { Summary } = Table;
|
|
9
|
-
const { Row, Cell } = Summary;
|
|
10
|
-
function useTableSummary(columns) {
|
|
11
|
-
const summaryColumns = useMemo(() => columns.filter((column) => isFunction(column.summary)).map((column) => {
|
|
12
|
-
const {
|
|
13
|
-
name,
|
|
14
|
-
summary,
|
|
15
|
-
summaryColSpan
|
|
16
|
-
} = column;
|
|
17
|
-
return {
|
|
18
|
-
name,
|
|
19
|
-
summary,
|
|
20
|
-
summaryColSpan: summaryColSpan ?? 1
|
|
21
|
-
};
|
|
22
|
-
}), [columns]);
|
|
23
|
-
return useMemo(() => {
|
|
24
|
-
if (summaryColumns.length === 0) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
return (records) => /* @__PURE__ */ jsx(Summary, { fixed: "bottom", children: /* @__PURE__ */ jsx(Row, { children: summaryColumns.map(({
|
|
28
|
-
name,
|
|
29
|
-
summary,
|
|
30
|
-
summaryColSpan
|
|
31
|
-
}, index) => /* @__PURE__ */ jsx(
|
|
32
|
-
Cell,
|
|
33
|
-
{
|
|
34
|
-
colSpan: summaryColSpan,
|
|
35
|
-
index,
|
|
36
|
-
children: summary(records)
|
|
37
|
-
},
|
|
38
|
-
name
|
|
39
|
-
)) }) });
|
|
40
|
-
}, [summaryColumns]);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { useTableSummary };
|
|
2
|
+
import{jsx as n}from"@emotion/react/jsx-runtime";import{isFunction as l}from"@vef-framework/shared";import{Table as p}from"antd";import{useMemo as u}from"react";const{Summary:i}=p,{Row:c,Cell:y}=i;function f(t){const r=u(()=>t.filter(m=>l(m.summary)).map(m=>{const{name:o,summary:a,summaryColSpan:e}=m;return{name:o,summary:a,summaryColSpan:e??1}}),[t]);return u(()=>{if(r.length!==0)return m=>n(i,{fixed:"bottom",children:n(c,{children:r.map(({name:o,summary:a,summaryColSpan:e},s)=>n(y,{colSpan:e,index:s,children:a(m)},o))})})},[r])}export{f as useTableSummary};
|
|
@@ -1,14 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
"use strict";
|
|
5
|
-
const defaultColumnWidth = 160;
|
|
6
|
-
const selectionColumnWidth = 40;
|
|
7
|
-
function useTableWidth(columns, selectable) {
|
|
8
|
-
return useMemo(() => {
|
|
9
|
-
const width = columns.filter((column) => column.hidden !== true).map((column) => column.width ?? column.minWidth ?? defaultColumnWidth).reduce((acc, w) => acc + w, 0);
|
|
10
|
-
return selectable ? width + selectionColumnWidth : width;
|
|
11
|
-
}, [columns, selectable]);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export { useTableWidth };
|
|
2
|
+
import{useMemo as d}from"react";const u=160,m=40;function o(e,r){return d(()=>{const i=e.filter(t=>t.hidden!==!0).map(t=>t.width??t.minWidth??u).reduce((t,n)=>t+n,0);return r?i+m:i},[e,r])}export{o as useTableWidth};
|
package/esm/vef-table/index.js
CHANGED
|
@@ -1,29 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { themeVariables, isDeepEqual, isNumber } from '@vef-framework/shared';
|
|
5
|
-
import { Table } from 'antd';
|
|
6
|
-
import { useMemo, useState, useDeferredValue, forwardRef, memo } from 'react';
|
|
7
|
-
import '../internal/index.js';
|
|
8
|
-
import VefTableFooter from './components/table-footer.js';
|
|
9
|
-
import { useComputedBatchActionButtons } from './hooks/use-computed-batch-buttons.js';
|
|
10
|
-
import { useComputedColumns } from './hooks/use-computed-columns.js';
|
|
11
|
-
import { useData } from './hooks/use-data.js';
|
|
12
|
-
import { useDefaultColumnConfigs } from './hooks/use-default-column-configs.js';
|
|
13
|
-
import { useHelperColumns } from './hooks/use-helper-columns.js';
|
|
14
|
-
import { usePaginationProps } from './hooks/use-pagination-props.js';
|
|
15
|
-
import { useRowProps } from './hooks/use-row-props.js';
|
|
16
|
-
import { useRowSelectionConfig } from './hooks/use-row-selection-config.js';
|
|
17
|
-
import { useTableColumns } from './hooks/use-table-columns.js';
|
|
18
|
-
import { TableContextProvider } from './hooks/use-table-context.js';
|
|
19
|
-
import { useTableInstance } from './hooks/use-table-instance.js';
|
|
20
|
-
import { useTableSummary } from './hooks/use-table-summary.js';
|
|
21
|
-
import { useTableWidth } from './hooks/use-table-width.js';
|
|
22
|
-
import { convertBasicSizeToUiSize } from '../internal/utils.js';
|
|
23
|
-
|
|
24
|
-
"use strict";
|
|
25
|
-
const DEFAULT_ROW_KEY = "id";
|
|
26
|
-
const autoHeightTableStyle = css`
|
|
2
|
+
import{jsx as u}from"@emotion/react/jsx-runtime";import{css as P}from"@emotion/react";import{themeVariables as E,isDeepEqual as O,isNumber as se}from"@vef-framework/shared";import{Table as ce}from"antd";import{useMemo as l,useState as me,useDeferredValue as ue,forwardRef as H,memo as fe}from"react";import"../internal/index.js";import de from"./components/table-footer.js";import{useComputedBatchActionButtons as pe}from"./hooks/use-computed-batch-buttons.js";import{useComputedColumns as be}from"./hooks/use-computed-columns.js";import{useData as he}from"./hooks/use-data.js";import{useDefaultColumnConfigs as Ce}from"./hooks/use-default-column-configs.js";import{useHelperColumns as ge}from"./hooks/use-helper-columns.js";import{usePaginationProps as we}from"./hooks/use-pagination-props.js";import{useRowProps as Se}from"./hooks/use-row-props.js";import{useRowSelectionConfig as xe}from"./hooks/use-row-selection-config.js";import{useTableColumns as ye}from"./hooks/use-table-columns.js";import{TableContextProvider as Re}from"./hooks/use-table-context.js";import{useTableInstance as ve}from"./hooks/use-table-instance.js";import{useTableSummary as Be}from"./hooks/use-table-summary.js";import{useTableWidth as ke}from"./hooks/use-table-width.js";import{convertBasicSizeToUiSize as Te}from"../internal/utils.js";const Ne="id",Ae=P`
|
|
27
3
|
height: 100%;
|
|
28
4
|
|
|
29
5
|
> .vef-spin-nested-loading {
|
|
@@ -57,12 +33,12 @@ const autoHeightTableStyle = css`
|
|
|
57
33
|
|
|
58
34
|
> .vef-table-title {
|
|
59
35
|
flex-shrink: 0;
|
|
60
|
-
padding: ${
|
|
36
|
+
padding: ${E.paddingSm};
|
|
61
37
|
}
|
|
62
38
|
|
|
63
39
|
> .vef-table-footer {
|
|
64
40
|
flex-shrink: 0;
|
|
65
|
-
padding: ${
|
|
41
|
+
padding: ${E.paddingXs}
|
|
66
42
|
}
|
|
67
43
|
|
|
68
44
|
&.vef-table-empty > .vef-table-container > .vef-table-body > table {
|
|
@@ -71,207 +47,9 @@ const autoHeightTableStyle = css`
|
|
|
71
47
|
}
|
|
72
48
|
}
|
|
73
49
|
}
|
|
74
|
-
|
|
75
|
-
const unlimitedHeightTableStyle = css`
|
|
50
|
+
`,Ke=P`
|
|
76
51
|
.vef-table-content {
|
|
77
52
|
scrollbar-width: thin;
|
|
78
53
|
scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
|
|
79
54
|
}
|
|
80
|
-
`;
|
|
81
|
-
function VefTableBase({
|
|
82
|
-
columns,
|
|
83
|
-
defaultColumnConfigMap,
|
|
84
|
-
rowNumberColumn,
|
|
85
|
-
operationColumn,
|
|
86
|
-
bordered = false,
|
|
87
|
-
size = "medium",
|
|
88
|
-
rowKey = DEFAULT_ROW_KEY,
|
|
89
|
-
height,
|
|
90
|
-
virtual = false,
|
|
91
|
-
selectedKeys,
|
|
92
|
-
defaultSelectedKeys,
|
|
93
|
-
selectable = false,
|
|
94
|
-
multipleSelection,
|
|
95
|
-
showSelectAllCheckbox,
|
|
96
|
-
disabledSelection,
|
|
97
|
-
enableRowClick,
|
|
98
|
-
enableRowClickForSelection,
|
|
99
|
-
rowBackgroundColor,
|
|
100
|
-
batchActionButtons,
|
|
101
|
-
selectionSummary,
|
|
102
|
-
externalContext,
|
|
103
|
-
onRowSelectionChange,
|
|
104
|
-
onRowSelect,
|
|
105
|
-
onRowDeselect,
|
|
106
|
-
onRowClick,
|
|
107
|
-
...restProps
|
|
108
|
-
}, ref) {
|
|
109
|
-
const { paginated = false, ...queryConfig } = restProps;
|
|
110
|
-
const { paginationProps, paginationParams } = usePaginationProps(paginated, size);
|
|
111
|
-
const {
|
|
112
|
-
data,
|
|
113
|
-
isFetching,
|
|
114
|
-
isLoading,
|
|
115
|
-
total,
|
|
116
|
-
refetch
|
|
117
|
-
} = useData(queryConfig, paginated, paginationParams);
|
|
118
|
-
const mergedPaginationProps = useMemo(() => ({
|
|
119
|
-
...paginationProps,
|
|
120
|
-
total
|
|
121
|
-
}), [paginationProps, total]);
|
|
122
|
-
const [columnConfigMap, setColumnConfigMap] = useState(() => new Map(defaultColumnConfigMap));
|
|
123
|
-
const deferredColumnConfigMap = useDeferredValue(columnConfigMap);
|
|
124
|
-
const computedColumns = useComputedColumns(columns, deferredColumnConfigMap);
|
|
125
|
-
const {
|
|
126
|
-
rowSelectionConfig,
|
|
127
|
-
handleRowClickSelection,
|
|
128
|
-
selectedKeys: selectedKeysToUse,
|
|
129
|
-
selectedRecords
|
|
130
|
-
} = useRowSelectionConfig({
|
|
131
|
-
selectedKeys,
|
|
132
|
-
defaultSelectedKeys,
|
|
133
|
-
selectable,
|
|
134
|
-
multipleSelection,
|
|
135
|
-
disabledSelection,
|
|
136
|
-
enableRowClick,
|
|
137
|
-
enableRowClickForSelection,
|
|
138
|
-
onRowSelect,
|
|
139
|
-
onRowDeselect,
|
|
140
|
-
onRowSelectionChange,
|
|
141
|
-
rowKey
|
|
142
|
-
});
|
|
143
|
-
const onRow = useRowProps({
|
|
144
|
-
enableRowClick,
|
|
145
|
-
enableRowClickForSelection,
|
|
146
|
-
onRowClick,
|
|
147
|
-
disabledSelection,
|
|
148
|
-
handleRowClickSelection
|
|
149
|
-
});
|
|
150
|
-
const tableContext = useMemo(() => ({
|
|
151
|
-
externalContext,
|
|
152
|
-
isFetching,
|
|
153
|
-
refetch,
|
|
154
|
-
selectedKeys: selectedKeysToUse,
|
|
155
|
-
selectedRecords: selectedRecords.current,
|
|
156
|
-
defaultColumnConfigMap,
|
|
157
|
-
columnConfigMap,
|
|
158
|
-
setColumnConfigMap,
|
|
159
|
-
columnConfigMapHasChanged: !isDeepEqual(defaultColumnConfigMap, columnConfigMap)
|
|
160
|
-
}), [
|
|
161
|
-
externalContext,
|
|
162
|
-
isFetching,
|
|
163
|
-
refetch,
|
|
164
|
-
selectedKeysToUse,
|
|
165
|
-
selectedRecords,
|
|
166
|
-
defaultColumnConfigMap,
|
|
167
|
-
columnConfigMap
|
|
168
|
-
]);
|
|
169
|
-
const columnsToUse = useTableColumns(
|
|
170
|
-
computedColumns,
|
|
171
|
-
rowNumberColumn,
|
|
172
|
-
operationColumn
|
|
173
|
-
);
|
|
174
|
-
const tableWidth = useTableWidth(columnsToUse, selectable);
|
|
175
|
-
const scrollConfig = useMemo(() => ({
|
|
176
|
-
x: tableWidth,
|
|
177
|
-
y: height === "auto" ? "auto" : height,
|
|
178
|
-
scrollToFirstRowOnChange: true
|
|
179
|
-
}), [height, tableWidth]);
|
|
180
|
-
const tableRef = useTableInstance(ref, data ?? [], refetch);
|
|
181
|
-
const tableSummary = useTableSummary(computedColumns);
|
|
182
|
-
const { computedBatchActionButtons, batchActionButtonContext } = useComputedBatchActionButtons(batchActionButtons ?? [], tableContext);
|
|
183
|
-
const footer = useMemo(() => {
|
|
184
|
-
if (isLoading || data?.length === 0 || !paginated && selectionSummary === false && computedBatchActionButtons.length === 0) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
const footerNode = /* @__PURE__ */ jsx(
|
|
188
|
-
VefTableFooter,
|
|
189
|
-
{
|
|
190
|
-
batchActionButtonContext,
|
|
191
|
-
batchActionButtons: computedBatchActionButtons,
|
|
192
|
-
paginationProps: mergedPaginationProps,
|
|
193
|
-
selectionSummary,
|
|
194
|
-
size
|
|
195
|
-
}
|
|
196
|
-
);
|
|
197
|
-
return () => footerNode;
|
|
198
|
-
}, [
|
|
199
|
-
batchActionButtonContext,
|
|
200
|
-
computedBatchActionButtons,
|
|
201
|
-
data?.length,
|
|
202
|
-
isLoading,
|
|
203
|
-
mergedPaginationProps,
|
|
204
|
-
paginated,
|
|
205
|
-
selectionSummary,
|
|
206
|
-
size
|
|
207
|
-
]);
|
|
208
|
-
return /* @__PURE__ */ jsx(TableContextProvider, { value: tableContext, children: /* @__PURE__ */ jsx(
|
|
209
|
-
Table,
|
|
210
|
-
{
|
|
211
|
-
ref: tableRef,
|
|
212
|
-
bordered,
|
|
213
|
-
columns: columnsToUse,
|
|
214
|
-
css: height === "auto" ? autoHeightTableStyle : unlimitedHeightTableStyle,
|
|
215
|
-
dataSource: data,
|
|
216
|
-
footer,
|
|
217
|
-
loading: isFetching,
|
|
218
|
-
pagination: false,
|
|
219
|
-
rowKey,
|
|
220
|
-
rowSelection: rowSelectionConfig,
|
|
221
|
-
scroll: scrollConfig,
|
|
222
|
-
size: convertBasicSizeToUiSize(size),
|
|
223
|
-
summary: tableSummary,
|
|
224
|
-
tableLayout: "fixed",
|
|
225
|
-
virtual: isNumber(height) && height > 0 && virtual,
|
|
226
|
-
onRow
|
|
227
|
-
}
|
|
228
|
-
) });
|
|
229
|
-
}
|
|
230
|
-
const VefTableBaseForwarded = forwardRef(VefTableBase);
|
|
231
|
-
VefTableBaseForwarded.displayName = "VefTableBase";
|
|
232
|
-
function VefTableWrapper({
|
|
233
|
-
schema,
|
|
234
|
-
showRowNumber,
|
|
235
|
-
operationButtons,
|
|
236
|
-
maxVisibleOperationButtons,
|
|
237
|
-
...restProps
|
|
238
|
-
}, ref) {
|
|
239
|
-
const { size } = restProps;
|
|
240
|
-
const showedColumns = useMemo(() => schema.filter((column) => column.show ?? true).map((column) => ({
|
|
241
|
-
...column,
|
|
242
|
-
dependentColumnNames: [
|
|
243
|
-
.../* @__PURE__ */ new Set([
|
|
244
|
-
column.name,
|
|
245
|
-
...column.dependentColumnNames ?? []
|
|
246
|
-
])
|
|
247
|
-
]
|
|
248
|
-
})), [schema]);
|
|
249
|
-
if (showedColumns.length === 0) {
|
|
250
|
-
throw new Error("The showed columns of VefTable component cannot be empty");
|
|
251
|
-
}
|
|
252
|
-
const defaultColumnConfigMap = useDefaultColumnConfigs(showedColumns);
|
|
253
|
-
const { rowNumberColumn, operationColumn } = useHelperColumns({
|
|
254
|
-
showRowNumber,
|
|
255
|
-
operationButtons,
|
|
256
|
-
maxVisibleOperationButtons,
|
|
257
|
-
size
|
|
258
|
-
});
|
|
259
|
-
return /* @__PURE__ */ jsx(
|
|
260
|
-
VefTableBaseForwarded,
|
|
261
|
-
{
|
|
262
|
-
ref,
|
|
263
|
-
columns: showedColumns,
|
|
264
|
-
defaultColumnConfigMap,
|
|
265
|
-
operationColumn,
|
|
266
|
-
rowNumberColumn,
|
|
267
|
-
...restProps
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
const VefTable = memo(
|
|
272
|
-
forwardRef(VefTableWrapper),
|
|
273
|
-
isDeepEqual
|
|
274
|
-
);
|
|
275
|
-
VefTable.displayName = "VefTable";
|
|
276
|
-
|
|
277
|
-
export { VefTable as default };
|
|
55
|
+
`;function Fe({columns:i,defaultColumnConfigMap:t,rowNumberColumn:f,operationColumn:d,bordered:a=!1,size:n="medium",rowKey:r=Ne,height:e,virtual:p=!1,selectedKeys:b,defaultSelectedKeys:h,selectable:o=!1,multipleSelection:L,showSelectAllCheckbox:Ve,disabledSelection:x,enableRowClick:y,enableRowClickForSelection:R,rowBackgroundColor:ze,batchActionButtons:U,selectionSummary:C,externalContext:v,onRowSelectionChange:$,onRowSelect:q,onRowDeselect:G,onRowClick:J,...Q},W){const{paginated:s=!1,...X}=Q,{paginationProps:B,paginationParams:Z}=we(s,n),{data:c,isFetching:g,isLoading:k,total:T,refetch:w}=he(X,s,Z),N=l(()=>({...B,total:T}),[B,T]),[m,Y]=me(()=>new Map(t)),_=ue(m),A=be(i,_),{rowSelectionConfig:ee,handleRowClickSelection:oe,selectedKeys:K,selectedRecords:F}=xe({selectedKeys:b,defaultSelectedKeys:h,selectable:o,multipleSelection:L,disabledSelection:x,enableRowClick:y,enableRowClickForSelection:R,onRowSelect:q,onRowDeselect:G,onRowSelectionChange:$,rowKey:r}),te=Se({enableRowClick:y,enableRowClickForSelection:R,onRowClick:J,disabledSelection:x,handleRowClickSelection:oe}),M=l(()=>({externalContext:v,isFetching:g,refetch:w,selectedKeys:K,selectedRecords:F.current,defaultColumnConfigMap:t,columnConfigMap:m,setColumnConfigMap:Y,columnConfigMapHasChanged:!O(t,m)}),[v,g,w,K,F,t,m]),V=ye(A,f,d),z=ke(V,o),ne=l(()=>({x:z,y:e==="auto"?"auto":e,scrollToFirstRowOnChange:!0}),[e,z]),le=ve(W,c??[],w),ie=Be(A),{computedBatchActionButtons:S,batchActionButtonContext:D}=pe(U??[],M),ae=l(()=>{if(k||c?.length===0||!s&&C===!1&&S.length===0)return;const re=u(de,{batchActionButtonContext:D,batchActionButtons:S,paginationProps:N,selectionSummary:C,size:n});return()=>re},[D,S,c?.length,k,N,s,C,n]);return u(Re,{value:M,children:u(ce,{ref:le,bordered:a,columns:V,css:e==="auto"?Ae:Ke,dataSource:c,footer:ae,loading:g,pagination:!1,rowKey:r,rowSelection:ee,scroll:ne,size:Te(n),summary:ie,tableLayout:"fixed",virtual:se(e)&&e>0&&p,onRow:te})})}const j=H(Fe);j.displayName="VefTableBase";function Me({schema:i,showRowNumber:t,operationButtons:f,maxVisibleOperationButtons:d,...a},n){const{size:r}=a,e=l(()=>i.filter(o=>o.show??!0).map(o=>({...o,dependentColumnNames:[...new Set([o.name,...o.dependentColumnNames??[]])]})),[i]);if(e.length===0)throw new Error("The showed columns of VefTable component cannot be empty");const p=Ce(e),{rowNumberColumn:b,operationColumn:h}=ge({showRowNumber:t,operationButtons:f,maxVisibleOperationButtons:d,size:r});return u(j,{ref:n,columns:e,defaultColumnConfigMap:p,operationColumn:h,rowNumberColumn:b,...a})}const I=fe(H(Me),O);I.displayName="VefTable";export{I as default};
|
package/esm/vef-table/store.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
"use strict";
|
|
5
|
-
const {
|
|
6
|
-
StoreProvider: TableStoreProvider,
|
|
7
|
-
useStore: useTableStore,
|
|
8
|
-
useStoreApi: useTableStoreApi
|
|
9
|
-
} = createComponentStore(
|
|
10
|
-
"Table",
|
|
11
|
-
(initialState) => (set) => ({
|
|
12
|
-
changeSize: (size) => set({ size }),
|
|
13
|
-
columnConfigMap: /* @__PURE__ */ new Map(),
|
|
14
|
-
...initialState
|
|
15
|
-
})
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
export { TableStoreProvider, useTableStore, useTableStoreApi };
|
|
2
|
+
import{createComponentStore as t}from"@vef-framework/shared";const{StoreProvider:a,useStore:s,useStoreApi:i}=t("Table",e=>o=>({changeSize:r=>o({size:r}),columnConfigMap:new Map,...e}));export{a as TableStoreProvider,s as useTableStore,i as useTableStoreApi};
|
package/esm/vef-tabs/index.js
CHANGED
|
@@ -1,26 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import { Tabs } from 'antd';
|
|
4
|
-
import '../internal/index.js';
|
|
5
|
-
import { convertBasicSizeToUiSize } from '../internal/utils.js';
|
|
6
|
-
|
|
7
|
-
"use strict";
|
|
8
|
-
const animatedConfig = {
|
|
9
|
-
inkBar: true,
|
|
10
|
-
tabPane: true
|
|
11
|
-
};
|
|
12
|
-
function VefTabs({
|
|
13
|
-
size,
|
|
14
|
-
...props
|
|
15
|
-
}) {
|
|
16
|
-
return /* @__PURE__ */ jsx(
|
|
17
|
-
Tabs,
|
|
18
|
-
{
|
|
19
|
-
animated: animatedConfig,
|
|
20
|
-
size: convertBasicSizeToUiSize(size),
|
|
21
|
-
...props
|
|
22
|
-
}
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { VefTabs as default };
|
|
2
|
+
import{jsx as r}from"@emotion/react/jsx-runtime";import{Tabs as o}from"antd";import"../internal/index.js";import{convertBasicSizeToUiSize as e}from"../internal/utils.js";const a={inkBar:!0,tabPane:!0};function s({size:t,...i}){return r(o,{animated:a,size:e(t),...i})}export{s as default};
|
package/esm/vef-tag/index.js
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import { Tag } from 'antd';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
-
|
|
6
|
-
"use strict";
|
|
7
|
-
function VefTag({
|
|
8
|
-
closable = false,
|
|
9
|
-
color,
|
|
10
|
-
inverse = false,
|
|
11
|
-
...restProps
|
|
12
|
-
}) {
|
|
13
|
-
const colorToUse = useMemo(() => {
|
|
14
|
-
if (!inverse) {
|
|
15
|
-
return color;
|
|
16
|
-
}
|
|
17
|
-
return `${color}-inverse`;
|
|
18
|
-
}, [color, inverse]);
|
|
19
|
-
return /* @__PURE__ */ jsx(
|
|
20
|
-
Tag,
|
|
21
|
-
{
|
|
22
|
-
closeIcon: closable ? null : void 0,
|
|
23
|
-
color: colorToUse,
|
|
24
|
-
...restProps
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { VefTag as default };
|
|
2
|
+
import{jsx as n}from"@emotion/react/jsx-runtime";import{Tag as c}from"antd";import{useMemo as i}from"react";function l({closable:e=!1,color:o,inverse:r=!1,...s}){const t=i(()=>r?`${o}-inverse`:o,[o,r]);return n(c,{closeIcon:e?null:void 0,color:t,...s})}export{l as default};
|
|
@@ -1,58 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
"
|
|
3
|
-
const yearFormats = ["YYYY"];
|
|
4
|
-
const quarterFormats = ["YYYY-Q季度"];
|
|
5
|
-
const monthFormats = [
|
|
6
|
-
"YYYY-MM",
|
|
7
|
-
"YYYY/MM",
|
|
8
|
-
"YYYY.MM",
|
|
9
|
-
"YYYYMM"
|
|
10
|
-
];
|
|
11
|
-
const weekFormats = ["YYYY-wo"];
|
|
12
|
-
const dateFormats = [
|
|
13
|
-
"YYYY-MM-DD",
|
|
14
|
-
"YYYY/MM/DD",
|
|
15
|
-
"YYYY.MM.DD",
|
|
16
|
-
"YYYYMMDD",
|
|
17
|
-
"YY/MM/DD",
|
|
18
|
-
"YY.MM.DD",
|
|
19
|
-
"YYMMDD"
|
|
20
|
-
];
|
|
21
|
-
const timeFormats = ["HH:mm:ss", "HH.mm.ss", "HHmmss"];
|
|
22
|
-
const hourFormats = ["HH"];
|
|
23
|
-
const minuteFormats = ["HH:mm", "HH.mm", "HHmm"];
|
|
24
|
-
const datetimeFormats = [
|
|
25
|
-
"YYYY-MM-DD HH:mm:ss",
|
|
26
|
-
"YYYY/MM/DD HH:mm:ss",
|
|
27
|
-
"YYYY.MM.DD HH.mm.ss",
|
|
28
|
-
"YYYYMMDDHHmmss",
|
|
29
|
-
"YY/MM/DD HH:mm:ss",
|
|
30
|
-
"YY.MM.DD HH:mm:ss",
|
|
31
|
-
"YY.MM.DD HH.mm.ss",
|
|
32
|
-
"YYMMDDHHmmss"
|
|
33
|
-
];
|
|
34
|
-
function getTemporalFormats(mode) {
|
|
35
|
-
if (mode === "year") {
|
|
36
|
-
return yearFormats;
|
|
37
|
-
} else if (mode === "quarter") {
|
|
38
|
-
return quarterFormats;
|
|
39
|
-
} else if (mode === "month") {
|
|
40
|
-
return monthFormats;
|
|
41
|
-
} else if (mode === "week") {
|
|
42
|
-
return weekFormats;
|
|
43
|
-
} else if (mode === "datetime") {
|
|
44
|
-
return datetimeFormats;
|
|
45
|
-
} else if (mode === "date") {
|
|
46
|
-
return dateFormats;
|
|
47
|
-
} else if (mode === "time") {
|
|
48
|
-
return timeFormats;
|
|
49
|
-
} else if (mode === "hour") {
|
|
50
|
-
return hourFormats;
|
|
51
|
-
} else if (mode === "minute") {
|
|
52
|
-
return minuteFormats;
|
|
53
|
-
} else {
|
|
54
|
-
return [];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export { getTemporalFormats };
|
|
2
|
+
const M=["YYYY"],m=["YYYY-Q季度"],D=["YYYY-MM","YYYY/MM","YYYY.MM","YYYYMM"],H=["YYYY-wo"],s=["YYYY-MM-DD","YYYY/MM/DD","YYYY.MM.DD","YYYYMMDD","YY/MM/DD","YY.MM.DD","YYMMDD"],t=["HH:mm:ss","HH.mm.ss","HHmmss"],e=["HH"],r=["HH:mm","HH.mm","HHmm"],o=["YYYY-MM-DD HH:mm:ss","YYYY/MM/DD HH:mm:ss","YYYY.MM.DD HH.mm.ss","YYYYMMDDHHmmss","YY/MM/DD HH:mm:ss","YY.MM.DD HH:mm:ss","YY.MM.DD HH.mm.ss","YYMMDDHHmmss"];function a(Y){return Y==="year"?M:Y==="quarter"?m:Y==="month"?D:Y==="week"?H:Y==="datetime"?o:Y==="date"?s:Y==="time"?t:Y==="hour"?e:Y==="minute"?r:[]}export{a as getTemporalFormats};
|
|
@@ -1,19 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import dayjs from 'dayjs';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
-
|
|
6
|
-
"use strict";
|
|
7
|
-
function useDayjsValue(value, formats) {
|
|
8
|
-
return useMemo(() => {
|
|
9
|
-
if (isNullish(value)) {
|
|
10
|
-
return value;
|
|
11
|
-
}
|
|
12
|
-
if (isArray(value)) {
|
|
13
|
-
return value.map((it) => dayjs(it, formats));
|
|
14
|
-
}
|
|
15
|
-
return dayjs(value, formats);
|
|
16
|
-
}, [value, formats]);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export { useDayjsValue };
|
|
2
|
+
import{isNullish as t,isArray as r}from"@vef-framework/shared";import i from"dayjs";import{useMemo as u}from"react";function e(o,s){return u(()=>t(o)?o:r(o)?o.map(m=>i(m,s)):i(o,s),[o,s])}export{e as useDayjsValue};
|
|
@@ -1,35 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import dayjs from 'dayjs';
|
|
4
|
-
import { useMemo } from 'react';
|
|
5
|
-
|
|
6
|
-
"use strict";
|
|
7
|
-
function useTemporalLimit({
|
|
8
|
-
maxDate,
|
|
9
|
-
minDate,
|
|
10
|
-
disabledDate,
|
|
11
|
-
disabledTime
|
|
12
|
-
}) {
|
|
13
|
-
const [minDateValue, maxDateValue] = useMemo(() => [
|
|
14
|
-
minDate ? dayjs(minDate) : void 0,
|
|
15
|
-
maxDate ? dayjs(maxDate) : void 0
|
|
16
|
-
], [minDate, maxDate]);
|
|
17
|
-
const disabledTimeValue = useMemo(() => {
|
|
18
|
-
if (isFunction(disabledTime)) {
|
|
19
|
-
return (now) => disabledTime(now.toDate());
|
|
20
|
-
}
|
|
21
|
-
}, [disabledTime]);
|
|
22
|
-
const disabledDateValue = useMemo(() => {
|
|
23
|
-
if (isFunction(disabledDate)) {
|
|
24
|
-
return (now, { from }) => disabledDate(now.toDate(), from?.toDate());
|
|
25
|
-
}
|
|
26
|
-
}, [disabledDate]);
|
|
27
|
-
return {
|
|
28
|
-
minDateValue,
|
|
29
|
-
maxDateValue,
|
|
30
|
-
disabledTimeValue,
|
|
31
|
-
disabledDateValue
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { useTemporalLimit };
|
|
2
|
+
import{isFunction as r}from"@vef-framework/shared";import u from"dayjs";import{useMemo as o}from"react";function f({maxDate:e,minDate:t,disabledDate:i,disabledTime:a}){const[s,n]=o(()=>[t?u(t):void 0,e?u(e):void 0],[t,e]),d=o(()=>{if(r(a))return m=>a(m.toDate())},[a]),l=o(()=>{if(r(i))return(m,{from:D})=>i(m.toDate(),D?.toDate())},[i]);return{minDateValue:s,maxDateValue:n,disabledTimeValue:d,disabledDateValue:l}}export{f as useTemporalLimit};
|
|
@@ -1,20 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
"use strict";
|
|
5
|
-
function useTemporalPickerInstance(ref) {
|
|
6
|
-
const temporalPickerRef = useRef(null);
|
|
7
|
-
useImperativeHandle(ref, () => ({
|
|
8
|
-
blur: () => {
|
|
9
|
-
temporalPickerRef.current?.blur();
|
|
10
|
-
},
|
|
11
|
-
focus: () => {
|
|
12
|
-
temporalPickerRef.current?.focus({
|
|
13
|
-
preventScroll: true
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}));
|
|
17
|
-
return temporalPickerRef;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { useTemporalPickerInstance };
|
|
2
|
+
import{useRef as u,useImperativeHandle as t}from"react";function n(r){const e=u(null);return t(r,()=>({blur:()=>{e.current?.blur()},focus:()=>{e.current?.focus({preventScroll:!0})}})),e}export{n as useTemporalPickerInstance};
|
|
@@ -1,126 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
import
|
|
3
|
-
import { isFunction, isArray } from '@vef-framework/shared';
|
|
4
|
-
import { TimePicker, DatePicker } from 'antd';
|
|
5
|
-
import { useMemo, memo, forwardRef } from 'react';
|
|
6
|
-
import '../internal/index.js';
|
|
7
|
-
import { getTemporalFormats } from './helper.js';
|
|
8
|
-
import { useDayjsValue } from './hooks/use-dayjs-value.js';
|
|
9
|
-
import { useTemporalLimit } from './hooks/use-temporal-limit.js';
|
|
10
|
-
import { useTemporalPickerInstance } from './hooks/use-temporal-picker-instance.js';
|
|
11
|
-
import { convertBasicSizeToUiSize } from '../internal/utils.js';
|
|
12
|
-
|
|
13
|
-
"use strict";
|
|
14
|
-
function VefTemporalPickerBase({
|
|
15
|
-
defaultValue,
|
|
16
|
-
value,
|
|
17
|
-
clearable,
|
|
18
|
-
size,
|
|
19
|
-
mode = "date",
|
|
20
|
-
multiple = false,
|
|
21
|
-
minDate,
|
|
22
|
-
maxDate,
|
|
23
|
-
disabledTime,
|
|
24
|
-
disabledDate,
|
|
25
|
-
hourStep,
|
|
26
|
-
minuteStep,
|
|
27
|
-
secondStep,
|
|
28
|
-
onChange,
|
|
29
|
-
...restProps
|
|
30
|
-
}, ref) {
|
|
31
|
-
const formats = getTemporalFormats(mode);
|
|
32
|
-
const valueToUse = useDayjsValue(value, formats);
|
|
33
|
-
const defaultValueToUse = useDayjsValue(defaultValue, formats);
|
|
34
|
-
const {
|
|
35
|
-
minDateValue,
|
|
36
|
-
maxDateValue,
|
|
37
|
-
disabledTimeValue,
|
|
38
|
-
disabledDateValue
|
|
39
|
-
} = useTemporalLimit({
|
|
40
|
-
maxDate,
|
|
41
|
-
minDate,
|
|
42
|
-
disabledTime,
|
|
43
|
-
disabledDate
|
|
44
|
-
});
|
|
45
|
-
const temporalPickerRef = useTemporalPickerInstance(ref);
|
|
46
|
-
const handleChange = useMemo(() => {
|
|
47
|
-
if (isFunction(onChange)) {
|
|
48
|
-
return (value2, valueFormat) => {
|
|
49
|
-
if (!value2) {
|
|
50
|
-
onChange(null, null);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const dates = isArray(value2) ? value2.map((it) => it.toDate()) : value2.toDate();
|
|
54
|
-
onChange(valueFormat, dates);
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
}, [onChange]);
|
|
58
|
-
if (mode === "time" || mode === "hour" || mode === "minute") {
|
|
59
|
-
return /* @__PURE__ */ jsx(
|
|
60
|
-
TimePicker,
|
|
61
|
-
{
|
|
62
|
-
ref: temporalPickerRef,
|
|
63
|
-
allowClear: clearable,
|
|
64
|
-
defaultValue: defaultValueToUse,
|
|
65
|
-
disabledTime: disabledTimeValue,
|
|
66
|
-
format: formats,
|
|
67
|
-
hourStep,
|
|
68
|
-
minuteStep,
|
|
69
|
-
multiple,
|
|
70
|
-
secondStep,
|
|
71
|
-
showNow: mode !== "hour",
|
|
72
|
-
size: convertBasicSizeToUiSize(size),
|
|
73
|
-
value: valueToUse,
|
|
74
|
-
onChange: handleChange,
|
|
75
|
-
...restProps
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
if (mode === "datetime") {
|
|
80
|
-
return /* @__PURE__ */ jsx(
|
|
81
|
-
DatePicker,
|
|
82
|
-
{
|
|
83
|
-
ref: temporalPickerRef,
|
|
84
|
-
allowClear: clearable,
|
|
85
|
-
defaultValue: defaultValueToUse,
|
|
86
|
-
disabledDate: disabledDateValue,
|
|
87
|
-
disabledTime: disabledTimeValue,
|
|
88
|
-
format: formats,
|
|
89
|
-
hourStep,
|
|
90
|
-
maxDate: maxDateValue,
|
|
91
|
-
minDate: minDateValue,
|
|
92
|
-
minuteStep,
|
|
93
|
-
multiple,
|
|
94
|
-
picker: "date",
|
|
95
|
-
size: convertBasicSizeToUiSize(size),
|
|
96
|
-
value: valueToUse,
|
|
97
|
-
onChange: handleChange,
|
|
98
|
-
...restProps
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
return /* @__PURE__ */ jsx(
|
|
103
|
-
DatePicker,
|
|
104
|
-
{
|
|
105
|
-
ref: temporalPickerRef,
|
|
106
|
-
allowClear: clearable,
|
|
107
|
-
defaultValue: defaultValueToUse,
|
|
108
|
-
disabledDate: disabledDateValue,
|
|
109
|
-
format: formats,
|
|
110
|
-
maxDate: maxDateValue,
|
|
111
|
-
minDate: minDateValue,
|
|
112
|
-
multiple,
|
|
113
|
-
picker: mode,
|
|
114
|
-
size: convertBasicSizeToUiSize(size),
|
|
115
|
-
value: valueToUse,
|
|
116
|
-
onChange: handleChange,
|
|
117
|
-
...restProps
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
}
|
|
121
|
-
const VefTemporalPicker = memo(
|
|
122
|
-
forwardRef(VefTemporalPickerBase)
|
|
123
|
-
);
|
|
124
|
-
VefTemporalPicker.displayName = "VefTemporalPicker";
|
|
125
|
-
|
|
126
|
-
export { VefTemporalPicker as default };
|
|
2
|
+
import{jsx as p}from"@emotion/react/jsx-runtime";import{isFunction as B,isArray as H}from"@vef-framework/shared";import{TimePicker as I,DatePicker as S}from"antd";import{useMemo as L,memo as M,forwardRef as R}from"react";import"../internal/index.js";import{getTemporalFormats as U}from"./helper.js";import{useDayjsValue as x}from"./hooks/use-dayjs-value.js";import{useTemporalLimit as q}from"./hooks/use-temporal-limit.js";import{useTemporalPickerInstance as E}from"./hooks/use-temporal-picker-instance.js";import{convertBasicSizeToUiSize as f}from"../internal/utils.js";function G({defaultValue:k,value:w,clearable:m,size:r,mode:e="date",multiple:l=!1,minDate:z,maxDate:g,disabledTime:v,disabledDate:P,hourStep:D,minuteStep:c,secondStep:y,onChange:t,...o},j){const a=U(e),u=x(w,a),s=x(k,a),{minDateValue:b,maxDateValue:T,disabledTimeValue:V,disabledDateValue:h}=q({maxDate:g,minDate:z,disabledTime:v,disabledDate:P}),n=E(j),d=L(()=>{if(B(t))return(i,A)=>{if(!i){t(null,null);return}const F=H(i)?i.map(N=>N.toDate()):i.toDate();t(A,F)}},[t]);return e==="time"||e==="hour"||e==="minute"?p(I,{ref:n,allowClear:m,defaultValue:s,disabledTime:V,format:a,hourStep:D,minuteStep:c,multiple:l,secondStep:y,showNow:e!=="hour",size:f(r),value:u,onChange:d,...o}):e==="datetime"?p(S,{ref:n,allowClear:m,defaultValue:s,disabledDate:h,disabledTime:V,format:a,hourStep:D,maxDate:T,minDate:b,minuteStep:c,multiple:l,picker:"date",size:f(r),value:u,onChange:d,...o}):p(S,{ref:n,allowClear:m,defaultValue:s,disabledDate:h,format:a,maxDate:T,minDate:b,multiple:l,picker:e,size:f(r),value:u,onChange:d,...o})}const C=M(R(G));C.displayName="VefTemporalPicker";export{C as default};
|