@vef-framework/components 1.0.64 → 1.0.65
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/es/index.js +2 -81
- package/es/internal/index.js +2 -2
- package/es/internal/modern-normalize.css.js +2 -4
- package/es/internal/utils.js +2 -6
- package/es/vef-access-denied/access-denied-icon.js +2 -928
- package/es/vef-access-denied/index.js +10 -45
- package/es/vef-action-buttons/index.js +2 -75
- package/es/vef-auto-sizer/index.js +2 -6
- package/es/vef-avatar/index.js +2 -20
- package/es/vef-avatar-group/index.js +2 -25
- package/es/vef-badge/index.js +2 -47
- package/es/vef-bool/hooks/use-bool-instance.js +2 -34
- package/es/vef-bool/index.js +2 -60
- package/es/vef-breadcrumb/index.js +2 -48
- package/es/vef-button/components/base-button.js +2 -73
- package/es/vef-button/index.js +2 -151
- package/es/vef-card/index.js +2 -25
- package/es/vef-card-meta/index.js +2 -12
- package/es/vef-checkbox/hooks/use-checkbox-instance.js +2 -20
- package/es/vef-checkbox/hooks/use-data-options.js +2 -40
- package/es/vef-checkbox/index.js +4 -88
- package/es/vef-col/index.js +2 -11
- package/es/vef-color-picker/index.js +2 -46
- package/es/vef-compact/index.js +2 -15
- package/es/vef-config-provider/global-style.js +16 -23
- package/es/vef-config-provider/hooks/use-ui-config.js +2 -125
- package/es/vef-config-provider/index.js +4 -121
- package/es/vef-config-provider/store.js +2 -21
- package/es/vef-container/index.js +2 -18
- package/es/vef-crud-page/components/crud-actions.js +2 -32
- package/es/vef-crud-page/components/crud-filter.js +2 -54
- package/es/vef-crud-page/components/crud-footer.js +4 -116
- package/es/vef-crud-page/components/crud-form-modal.js +2 -53
- package/es/vef-crud-page/components/crud-header.js +2 -29
- package/es/vef-crud-page/components/crud-table.js +2 -76
- package/es/vef-crud-page/hooks/use-action-buttons.js +2 -37
- package/es/vef-crud-page/hooks/use-crud-context.js +2 -20
- package/es/vef-crud-page/hooks/use-crud-schema.js +2 -114
- package/es/vef-crud-page/hooks/use-operation-buttons.js +2 -60
- package/es/vef-crud-page/index.js +2 -150
- package/es/vef-crud-page/store.js +2 -142
- package/es/vef-divider/index.js +2 -24
- package/es/vef-drawer/components/action-button-wrapper.js +2 -49
- package/es/vef-drawer/components/button-props.js +1 -2
- package/es/vef-drawer/components/cancel-action-button.js +2 -21
- package/es/vef-drawer/components/ok-action-button.js +2 -20
- package/es/vef-drawer/context.js +2 -15
- package/es/vef-drawer/index.js +4 -154
- package/es/vef-dropdown/index.js +2 -92
- package/es/vef-dynamic-icon/index.js +2 -46
- package/es/vef-dynamic-icon/props.js +2 -6
- package/es/vef-empty/index.js +2 -37
- package/es/vef-empty-placeholder/index.js +5 -19
- package/es/vef-error/error-icon.js +2 -757
- package/es/vef-error/index.js +10 -48
- package/es/vef-filter/components/action-buttons.js +6 -119
- package/es/vef-filter/components/advanced-filter.js +9 -71
- package/es/vef-filter/components/basic-filter.js +5 -35
- package/es/vef-filter/components/fields/index.js +2 -11
- package/es/vef-filter/components/fields/input-number.js +2 -90
- package/es/vef-filter/components/fields/input.js +2 -67
- package/es/vef-filter/components/filter-field.js +2 -19
- package/es/vef-filter/components/filter-item.js +2 -112
- package/es/vef-filter/event.js +2 -44
- package/es/vef-filter/helper.js +2 -15
- package/es/vef-filter/hooks/use-action-handlers.js +2 -70
- package/es/vef-filter/hooks/use-computed-values.js +2 -55
- package/es/vef-filter/hooks/use-filter-context.js +2 -18
- package/es/vef-filter/hooks/use-filter-initialization.js +2 -37
- package/es/vef-filter/hooks/use-filter-instance.js +2 -26
- package/es/vef-filter/hooks/use-filter-items.js +2 -23
- package/es/vef-filter/hooks/use-filter-values-change.js +2 -30
- package/es/vef-filter/hooks/use-label-config.js +2 -27
- package/es/vef-filter/index.js +3 -141
- package/es/vef-filter/store.js +2 -71
- package/es/vef-flex/index.js +2 -31
- package/es/vef-float-button/index.js +2 -49
- package/es/vef-float-button-group/index.js +2 -20
- package/es/vef-form/components/fields/index.js +2 -11
- package/es/vef-form/components/fields/input-number.js +2 -123
- package/es/vef-form/components/fields/input.js +2 -132
- package/es/vef-form/components/form-actions.js +4 -58
- package/es/vef-form/components/form-content.js +3 -144
- package/es/vef-form/components/form-field.js +2 -22
- package/es/vef-form/components/form-group.js +4 -64
- package/es/vef-form/components/form-hidden-item.js +2 -36
- package/es/vef-form/components/form-item.js +2 -79
- package/es/vef-form/components/form-row.js +2 -98
- package/es/vef-form/event.js +2 -44
- package/es/vef-form/helper.js +2 -15
- package/es/vef-form/hooks/use-action-handlers.js +2 -130
- package/es/vef-form/hooks/use-columns-layout.js +2 -122
- package/es/vef-form/hooks/use-computed-values.js +2 -55
- package/es/vef-form/hooks/use-form-context.js +2 -14
- package/es/vef-form/hooks/use-form-initialization.js +2 -45
- package/es/vef-form/hooks/use-form-instance.js +2 -26
- package/es/vef-form/hooks/use-form-values-change.js +2 -30
- package/es/vef-form/hooks/use-label-width.js +2 -18
- package/es/vef-form/index.js +4 -174
- package/es/vef-form/store.js +2 -65
- package/es/vef-form/validation-rules.js +2 -286
- package/es/vef-form-drawer/index.js +2 -98
- package/es/vef-form-modal/index.js +2 -95
- package/es/vef-generic-select/index.js +2 -81
- package/es/vef-grid/index.js +7 -83
- package/es/vef-grid/props.js +2 -4
- package/es/vef-grid-item/index.js +2 -52
- package/es/vef-icon/index.js +2 -45
- package/es/vef-icon-select/index.js +12 -146
- package/es/vef-input/hooks/use-input-instance.js +2 -15
- package/es/vef-input/index.js +2 -64
- package/es/vef-input-number/hooks/use-input-number-instance.js +2 -13
- package/es/vef-input-number/index.js +2 -148
- package/es/vef-layout/common-styles.js +5 -10
- package/es/vef-layout/components/content.js +2 -13
- package/es/vef-layout/components/font-size.js +2 -68
- package/es/vef-layout/components/fullscreen.js +2 -23
- package/es/vef-layout/components/header-action-icons.js +7 -29
- package/es/vef-layout/components/header-content.js +2 -19
- package/es/vef-layout/components/header.js +7 -69
- package/es/vef-layout/components/icon-boy.js +2 -69
- package/es/vef-layout/components/icon-girl.js +2 -76
- package/es/vef-layout/components/icon-menu-fold-left.js +2 -23
- package/es/vef-layout/components/icon-menu-unfold-left.js +2 -23
- package/es/vef-layout/components/menu-groups.js +16 -123
- package/es/vef-layout/components/message.js +2 -11
- package/es/vef-layout/components/search.js +2 -11
- package/es/vef-layout/components/sider.js +6 -54
- package/es/vef-layout/components/title.js +9 -53
- package/es/vef-layout/components/user-avatar.js +10 -80
- package/es/vef-layout/hooks/use-layout-context.js +2 -10
- package/es/vef-layout/index.js +3 -33
- package/es/vef-layout/logo.svg.js +2 -4
- package/es/vef-layout/store.js +2 -16
- package/es/vef-loading-placeholder/index.js +6 -42
- package/es/vef-login/index.js +22 -152
- package/es/vef-login/login-icon.js +2 -668
- package/es/vef-menu/index.js +5 -77
- package/es/vef-modal/components/action-button-wrapper.js +2 -49
- package/es/vef-modal/components/button-props.js +1 -2
- package/es/vef-modal/components/cancel-action-button.js +2 -18
- package/es/vef-modal/components/ok-action-button.js +2 -20
- package/es/vef-modal/context.js +2 -15
- package/es/vef-modal/index.js +3 -239
- package/es/vef-not-found/index.js +10 -45
- package/es/vef-not-found/not-found-icon.js +2 -844
- package/es/vef-page/index.js +11 -87
- package/es/vef-pagination/index.js +2 -57
- package/es/vef-pagination/props.js +2 -13
- package/es/vef-paragraph/index.js +2 -89
- package/es/vef-password/hooks/use-password-instance.js +2 -13
- package/es/vef-password/index.js +2 -67
- package/es/vef-popconfirm/index.js +2 -56
- package/es/vef-popover/index.js +2 -29
- package/es/vef-radio/hooks/use-data-options.js +2 -40
- package/es/vef-radio/hooks/use-radio-instance.js +2 -20
- package/es/vef-radio/index.js +4 -88
- package/es/vef-rate/hooks/use-rate-instance.js +2 -13
- package/es/vef-rate/index.js +2 -30
- package/es/vef-responsive-container/index.js +3 -54
- package/es/vef-responsive-item/index.js +3 -23
- package/es/vef-ribbon/index.js +2 -38
- package/es/vef-row/index.js +2 -12
- package/es/vef-scroll-area/components/scrollbar.js +8 -34
- package/es/vef-scroll-area/index.js +4 -69
- package/es/vef-select/components/option.js +4 -23
- package/es/vef-select/hooks/use-data-options.js +2 -47
- package/es/vef-select/hooks/use-field-names.js +2 -21
- package/es/vef-select/hooks/use-render-label.js +3 -23
- package/es/vef-select/hooks/use-render-option.js +2 -19
- package/es/vef-select/hooks/use-select-instance.js +2 -20
- package/es/vef-select/index.js +2 -100
- package/es/vef-slider/hooks/use-slider-instance.js +2 -13
- package/es/vef-slider/index.js +2 -34
- package/es/vef-sortable-list/components/overlay-item.js +3 -31
- package/es/vef-sortable-list/components/sortable-item.js +3 -75
- package/es/vef-sortable-list/hooks/use-merged-items.js +2 -21
- package/es/vef-sortable-list/index.js +2 -114
- package/es/vef-space/index.js +2 -25
- package/es/vef-spin/index.js +2 -12
- package/es/vef-splitter/index.js +2 -20
- package/es/vef-splitter-panel/index.js +2 -12
- package/es/vef-status/index.js +2 -37
- package/es/vef-table/components/columns/bool.js +2 -91
- package/es/vef-table/components/columns/code.js +2 -10
- package/es/vef-table/components/columns/data-dictionary.js +2 -92
- package/es/vef-table/components/columns/enum.js +2 -101
- package/es/vef-table/components/columns/file.js +2 -10
- package/es/vef-table/components/columns/icon.js +2 -10
- package/es/vef-table/components/columns/id.js +2 -82
- package/es/vef-table/components/columns/image.js +2 -11
- package/es/vef-table/components/columns/index.js +2 -33
- package/es/vef-table/components/columns/markdown.js +2 -10
- package/es/vef-table/components/columns/number.js +2 -83
- package/es/vef-table/components/columns/render.js +2 -28
- package/es/vef-table/components/columns/rich-text.js +2 -10
- package/es/vef-table/components/columns/text.js +2 -88
- package/es/vef-table/components/columns-settings.js +11 -195
- package/es/vef-table/components/operation-buttons.js +3 -230
- package/es/vef-table/components/settings-icon.js +4 -19
- package/es/vef-table/components/table-footer.js +4 -102
- package/es/vef-table/helper.js +2 -15
- package/es/vef-table/hooks/use-computed-batch-buttons.js +2 -33
- package/es/vef-table/hooks/use-computed-columns.js +2 -20
- package/es/vef-table/hooks/use-computed-values.js +2 -38
- package/es/vef-table/hooks/use-data.js +2 -53
- package/es/vef-table/hooks/use-default-column-configs.js +2 -27
- package/es/vef-table/hooks/use-display-value.js +2 -36
- package/es/vef-table/hooks/use-helper-columns.js +2 -67
- package/es/vef-table/hooks/use-operation-column-width.js +2 -50
- package/es/vef-table/hooks/use-pagination-props.js +2 -44
- package/es/vef-table/hooks/use-row-props.js +2 -39
- package/es/vef-table/hooks/use-row-selection-config.js +2 -112
- package/es/vef-table/hooks/use-selected-rows.js +2 -26
- package/es/vef-table/hooks/use-table-columns.js +2 -56
- package/es/vef-table/hooks/use-table-context.js +2 -21
- package/es/vef-table/hooks/use-table-instance.js +2 -15
- package/es/vef-table/hooks/use-table-summary.js +2 -42
- package/es/vef-table/hooks/use-table-width.js +2 -13
- package/es/vef-table/index.js +6 -227
- package/es/vef-table/store.js +2 -17
- package/es/vef-tabs/index.js +2 -25
- package/es/vef-tag/index.js +2 -28
- package/es/vef-temporal-picker/helper.js +2 -57
- package/es/vef-temporal-picker/hooks/use-dayjs-value.js +2 -18
- package/es/vef-temporal-picker/hooks/use-temporal-limit.js +2 -34
- package/es/vef-temporal-picker/hooks/use-temporal-picker-instance.js +2 -19
- package/es/vef-temporal-picker/index.js +2 -125
- package/es/vef-temporal-range-picker/helper.js +2 -57
- package/es/vef-temporal-range-picker/hooks/use-dayjs-values.js +2 -23
- package/es/vef-temporal-range-picker/hooks/use-temporal-limit.js +2 -34
- package/es/vef-temporal-range-picker/hooks/use-temporal-range-picker-instance.js +2 -19
- package/es/vef-temporal-range-picker/index.js +2 -128
- package/es/vef-temporal-range-picker/props.js +2 -4
- package/es/vef-text/index.js +2 -80
- package/es/vef-textarea/hooks/use-textarea-instance.js +2 -13
- package/es/vef-textarea/index.js +2 -67
- package/es/vef-title/index.js +7 -89
- package/es/vef-tooltip/index.js +2 -35
- package/es/vef-tree-select/hooks/use-change-handler.js +2 -33
- package/es/vef-tree-select/hooks/use-data-options.js +2 -45
- package/es/vef-tree-select/hooks/use-tree-select-instance.js +2 -20
- package/es/vef-tree-select/index.js +2 -86
- package/es/vef-virtual-grid/index.js +4 -107
- package/es/vef-virtual-list/index.js +5 -215
- package/lib/index.cjs +2 -168
- package/lib/internal/index.cjs +2 -10
- package/lib/internal/modern-normalize.css.cjs +2 -8
- package/lib/internal/utils.cjs +2 -10
- package/lib/vef-access-denied/access-denied-icon.cjs +2 -932
- package/lib/vef-access-denied/index.cjs +10 -49
- package/lib/vef-access-denied/props.cjs +2 -4
- package/lib/vef-action-buttons/index.cjs +2 -79
- package/lib/vef-action-buttons/props.cjs +2 -4
- package/lib/vef-auto-sizer/index.cjs +2 -10
- package/lib/vef-auto-sizer/props.cjs +2 -4
- package/lib/vef-avatar/index.cjs +2 -24
- package/lib/vef-avatar/props.cjs +2 -4
- package/lib/vef-avatar-group/index.cjs +2 -29
- package/lib/vef-avatar-group/props.cjs +2 -4
- package/lib/vef-badge/index.cjs +2 -51
- package/lib/vef-badge/props.cjs +2 -4
- package/lib/vef-bool/hooks/use-bool-instance.cjs +2 -38
- package/lib/vef-bool/index.cjs +2 -64
- package/lib/vef-bool/props.cjs +2 -4
- package/lib/vef-breadcrumb/index.cjs +2 -52
- package/lib/vef-breadcrumb/props.cjs +2 -4
- package/lib/vef-button/components/base-button.cjs +2 -77
- package/lib/vef-button/index.cjs +2 -155
- package/lib/vef-button/props.cjs +2 -4
- package/lib/vef-card/index.cjs +2 -29
- package/lib/vef-card/props.cjs +2 -4
- package/lib/vef-card-meta/index.cjs +2 -16
- package/lib/vef-card-meta/props.cjs +2 -4
- package/lib/vef-checkbox/hooks/use-checkbox-instance.cjs +2 -24
- package/lib/vef-checkbox/hooks/use-data-options.cjs +2 -44
- package/lib/vef-checkbox/index.cjs +4 -92
- package/lib/vef-checkbox/props.cjs +2 -4
- package/lib/vef-col/index.cjs +2 -15
- package/lib/vef-col/props.cjs +2 -4
- package/lib/vef-color-picker/index.cjs +2 -50
- package/lib/vef-color-picker/props.cjs +2 -4
- package/lib/vef-compact/index.cjs +2 -19
- package/lib/vef-compact/props.cjs +2 -4
- package/lib/vef-config-provider/global-style.cjs +16 -28
- package/lib/vef-config-provider/hooks/use-ui-config.cjs +2 -129
- package/lib/vef-config-provider/index.cjs +4 -125
- package/lib/vef-config-provider/props.cjs +2 -4
- package/lib/vef-config-provider/store.cjs +2 -27
- package/lib/vef-container/index.cjs +2 -22
- package/lib/vef-container/props.cjs +2 -4
- package/lib/vef-crud-page/components/crud-actions.cjs +2 -36
- package/lib/vef-crud-page/components/crud-filter.cjs +2 -58
- package/lib/vef-crud-page/components/crud-footer.cjs +4 -120
- package/lib/vef-crud-page/components/crud-form-modal.cjs +2 -57
- package/lib/vef-crud-page/components/crud-header.cjs +2 -33
- package/lib/vef-crud-page/components/crud-table.cjs +2 -80
- package/lib/vef-crud-page/hooks/use-action-buttons.cjs +2 -41
- package/lib/vef-crud-page/hooks/use-crud-context.cjs +2 -24
- package/lib/vef-crud-page/hooks/use-crud-schema.cjs +2 -118
- package/lib/vef-crud-page/hooks/use-operation-buttons.cjs +2 -64
- package/lib/vef-crud-page/index.cjs +2 -154
- package/lib/vef-crud-page/props.cjs +2 -4
- package/lib/vef-crud-page/store.cjs +2 -148
- package/lib/vef-crud-page/types.cjs +2 -4
- package/lib/vef-divider/index.cjs +2 -28
- package/lib/vef-divider/props.cjs +2 -4
- package/lib/vef-drawer/components/action-button-wrapper.cjs +2 -53
- package/lib/vef-drawer/components/button-props.cjs +2 -4
- package/lib/vef-drawer/components/cancel-action-button.cjs +2 -25
- package/lib/vef-drawer/components/ok-action-button.cjs +2 -24
- package/lib/vef-drawer/context.cjs +2 -21
- package/lib/vef-drawer/index.cjs +4 -159
- package/lib/vef-drawer/props.cjs +2 -4
- package/lib/vef-dropdown/index.cjs +2 -96
- package/lib/vef-dropdown/props.cjs +2 -4
- package/lib/vef-dynamic-icon/index.cjs +2 -50
- package/lib/vef-dynamic-icon/props.cjs +2 -10
- package/lib/vef-empty/index.cjs +2 -41
- package/lib/vef-empty/props.cjs +2 -4
- package/lib/vef-empty-placeholder/index.cjs +5 -23
- package/lib/vef-empty-placeholder/props.cjs +2 -4
- package/lib/vef-error/error-icon.cjs +2 -761
- package/lib/vef-error/index.cjs +10 -52
- package/lib/vef-error/props.cjs +2 -4
- package/lib/vef-filter/components/action-buttons.cjs +6 -123
- package/lib/vef-filter/components/advanced-filter.cjs +9 -75
- package/lib/vef-filter/components/basic-filter.cjs +5 -39
- package/lib/vef-filter/components/fields/index.cjs +2 -15
- package/lib/vef-filter/components/fields/input-number.cjs +2 -94
- package/lib/vef-filter/components/fields/input.cjs +2 -71
- package/lib/vef-filter/components/fields/props.cjs +2 -4
- package/lib/vef-filter/components/filter-field.cjs +2 -23
- package/lib/vef-filter/components/filter-item.cjs +2 -116
- package/lib/vef-filter/event.cjs +2 -48
- package/lib/vef-filter/helper.cjs +2 -19
- package/lib/vef-filter/hooks/use-action-handlers.cjs +2 -74
- package/lib/vef-filter/hooks/use-computed-values.cjs +2 -59
- package/lib/vef-filter/hooks/use-filter-context.cjs +2 -24
- package/lib/vef-filter/hooks/use-filter-initialization.cjs +2 -41
- package/lib/vef-filter/hooks/use-filter-instance.cjs +2 -30
- package/lib/vef-filter/hooks/use-filter-items.cjs +2 -27
- package/lib/vef-filter/hooks/use-filter-values-change.cjs +2 -34
- package/lib/vef-filter/hooks/use-label-config.cjs +2 -31
- package/lib/vef-filter/index.cjs +3 -145
- package/lib/vef-filter/props.cjs +2 -4
- package/lib/vef-filter/store.cjs +2 -77
- package/lib/vef-filter/types.cjs +2 -4
- package/lib/vef-flex/index.cjs +2 -35
- package/lib/vef-flex/props.cjs +2 -4
- package/lib/vef-float-button/index.cjs +2 -53
- package/lib/vef-float-button/props.cjs +2 -4
- package/lib/vef-float-button-group/index.cjs +2 -24
- package/lib/vef-float-button-group/props.cjs +2 -4
- package/lib/vef-form/components/fields/index.cjs +2 -15
- package/lib/vef-form/components/fields/input-number.cjs +2 -127
- package/lib/vef-form/components/fields/input.cjs +2 -136
- package/lib/vef-form/components/fields/props.cjs +2 -4
- package/lib/vef-form/components/form-actions.cjs +4 -62
- package/lib/vef-form/components/form-content.cjs +3 -148
- package/lib/vef-form/components/form-field.cjs +2 -26
- package/lib/vef-form/components/form-group.cjs +4 -68
- package/lib/vef-form/components/form-hidden-item.cjs +2 -40
- package/lib/vef-form/components/form-item.cjs +2 -83
- package/lib/vef-form/components/form-row.cjs +2 -102
- package/lib/vef-form/event.cjs +2 -48
- package/lib/vef-form/helper.cjs +2 -19
- package/lib/vef-form/hooks/use-action-handlers.cjs +2 -134
- package/lib/vef-form/hooks/use-columns-layout.cjs +2 -126
- package/lib/vef-form/hooks/use-computed-values.cjs +2 -59
- package/lib/vef-form/hooks/use-form-context.cjs +2 -20
- package/lib/vef-form/hooks/use-form-initialization.cjs +2 -49
- package/lib/vef-form/hooks/use-form-instance.cjs +2 -30
- package/lib/vef-form/hooks/use-form-values-change.cjs +2 -34
- package/lib/vef-form/hooks/use-label-width.cjs +2 -22
- package/lib/vef-form/index.cjs +4 -178
- package/lib/vef-form/props.cjs +2 -4
- package/lib/vef-form/store.cjs +2 -71
- package/lib/vef-form/types.cjs +2 -4
- package/lib/vef-form/validation-rules.cjs +2 -312
- package/lib/vef-form-drawer/index.cjs +2 -102
- package/lib/vef-form-drawer/props.cjs +2 -4
- package/lib/vef-form-modal/index.cjs +2 -99
- package/lib/vef-form-modal/props.cjs +2 -4
- package/lib/vef-generic-select/index.cjs +2 -85
- package/lib/vef-generic-select/props.cjs +2 -4
- package/lib/vef-grid/index.cjs +7 -87
- package/lib/vef-grid/props.cjs +2 -8
- package/lib/vef-grid-item/index.cjs +2 -56
- package/lib/vef-grid-item/props.cjs +2 -4
- package/lib/vef-icon/index.cjs +2 -49
- package/lib/vef-icon/props.cjs +2 -4
- package/lib/vef-icon-select/index.cjs +12 -150
- package/lib/vef-icon-select/props.cjs +2 -4
- package/lib/vef-input/hooks/use-input-instance.cjs +2 -19
- package/lib/vef-input/index.cjs +2 -68
- package/lib/vef-input/props.cjs +2 -4
- package/lib/vef-input-number/hooks/use-input-number-instance.cjs +2 -17
- package/lib/vef-input-number/index.cjs +2 -152
- package/lib/vef-input-number/props.cjs +2 -4
- package/lib/vef-layout/common-styles.cjs +5 -14
- package/lib/vef-layout/components/content.cjs +2 -17
- package/lib/vef-layout/components/font-size.cjs +2 -72
- package/lib/vef-layout/components/fullscreen.cjs +2 -27
- package/lib/vef-layout/components/header-action-icons.cjs +7 -33
- package/lib/vef-layout/components/header-content.cjs +2 -23
- package/lib/vef-layout/components/header.cjs +7 -73
- package/lib/vef-layout/components/icon-boy.cjs +2 -73
- package/lib/vef-layout/components/icon-girl.cjs +2 -80
- package/lib/vef-layout/components/icon-menu-fold-left.cjs +2 -27
- package/lib/vef-layout/components/icon-menu-unfold-left.cjs +2 -27
- package/lib/vef-layout/components/menu-groups.cjs +16 -127
- package/lib/vef-layout/components/message.cjs +2 -15
- package/lib/vef-layout/components/search.cjs +2 -15
- package/lib/vef-layout/components/sider.cjs +6 -58
- package/lib/vef-layout/components/title.cjs +9 -57
- package/lib/vef-layout/components/user-avatar.cjs +10 -84
- package/lib/vef-layout/hooks/use-layout-context.cjs +2 -16
- package/lib/vef-layout/index.cjs +3 -37
- package/lib/vef-layout/logo.svg.cjs +2 -8
- package/lib/vef-layout/props.cjs +2 -4
- package/lib/vef-layout/store.cjs +2 -22
- package/lib/vef-loading-placeholder/index.cjs +6 -46
- package/lib/vef-loading-placeholder/props.cjs +2 -4
- package/lib/vef-login/index.cjs +22 -156
- package/lib/vef-login/login-icon.cjs +2 -672
- package/lib/vef-login/props.cjs +2 -4
- package/lib/vef-menu/index.cjs +5 -81
- package/lib/vef-menu/props.cjs +2 -4
- package/lib/vef-modal/components/action-button-wrapper.cjs +2 -53
- package/lib/vef-modal/components/button-props.cjs +2 -4
- package/lib/vef-modal/components/cancel-action-button.cjs +2 -22
- package/lib/vef-modal/components/ok-action-button.cjs +2 -24
- package/lib/vef-modal/context.cjs +2 -21
- package/lib/vef-modal/index.cjs +3 -244
- package/lib/vef-modal/props.cjs +2 -4
- package/lib/vef-not-found/index.cjs +10 -49
- package/lib/vef-not-found/not-found-icon.cjs +2 -848
- package/lib/vef-not-found/props.cjs +2 -4
- package/lib/vef-page/index.cjs +11 -91
- package/lib/vef-page/props.cjs +2 -4
- package/lib/vef-pagination/index.cjs +2 -61
- package/lib/vef-pagination/props.cjs +2 -17
- package/lib/vef-paragraph/index.cjs +2 -93
- package/lib/vef-paragraph/props.cjs +2 -4
- package/lib/vef-password/hooks/use-password-instance.cjs +2 -17
- package/lib/vef-password/index.cjs +2 -71
- package/lib/vef-password/props.cjs +2 -4
- package/lib/vef-popconfirm/index.cjs +2 -60
- package/lib/vef-popconfirm/props.cjs +2 -4
- package/lib/vef-popover/index.cjs +2 -33
- package/lib/vef-popover/props.cjs +2 -4
- package/lib/vef-radio/hooks/use-data-options.cjs +2 -44
- package/lib/vef-radio/hooks/use-radio-instance.cjs +2 -24
- package/lib/vef-radio/index.cjs +4 -92
- package/lib/vef-radio/props.cjs +2 -4
- package/lib/vef-rate/hooks/use-rate-instance.cjs +2 -17
- package/lib/vef-rate/index.cjs +2 -34
- package/lib/vef-rate/props.cjs +2 -4
- package/lib/vef-responsive-container/index.cjs +3 -58
- package/lib/vef-responsive-container/props.cjs +2 -4
- package/lib/vef-responsive-item/index.cjs +3 -27
- package/lib/vef-responsive-item/props.cjs +2 -4
- package/lib/vef-ribbon/index.cjs +2 -42
- package/lib/vef-ribbon/props.cjs +2 -4
- package/lib/vef-row/index.cjs +2 -16
- package/lib/vef-row/props.cjs +2 -4
- package/lib/vef-scroll-area/components/scrollbar.cjs +8 -38
- package/lib/vef-scroll-area/index.cjs +4 -73
- package/lib/vef-scroll-area/props.cjs +2 -4
- package/lib/vef-select/components/option.cjs +4 -27
- package/lib/vef-select/hooks/use-data-options.cjs +2 -51
- package/lib/vef-select/hooks/use-field-names.cjs +2 -25
- package/lib/vef-select/hooks/use-render-label.cjs +3 -27
- package/lib/vef-select/hooks/use-render-option.cjs +2 -23
- package/lib/vef-select/hooks/use-select-instance.cjs +2 -24
- package/lib/vef-select/index.cjs +2 -104
- package/lib/vef-select/props.cjs +2 -4
- package/lib/vef-slider/hooks/use-slider-instance.cjs +2 -17
- package/lib/vef-slider/index.cjs +2 -38
- package/lib/vef-slider/props.cjs +2 -4
- package/lib/vef-sortable-list/components/overlay-item.cjs +3 -35
- package/lib/vef-sortable-list/components/sortable-item.cjs +3 -79
- package/lib/vef-sortable-list/hooks/use-merged-items.cjs +2 -25
- package/lib/vef-sortable-list/index.cjs +2 -118
- package/lib/vef-sortable-list/props.cjs +2 -4
- package/lib/vef-space/index.cjs +2 -29
- package/lib/vef-space/props.cjs +2 -4
- package/lib/vef-spin/index.cjs +2 -16
- package/lib/vef-spin/props.cjs +2 -4
- package/lib/vef-splitter/index.cjs +2 -24
- package/lib/vef-splitter/props.cjs +2 -4
- package/lib/vef-splitter-panel/index.cjs +2 -16
- package/lib/vef-splitter-panel/props.cjs +2 -4
- package/lib/vef-status/index.cjs +2 -41
- package/lib/vef-status/props.cjs +2 -4
- package/lib/vef-table/components/columns/bool.cjs +2 -95
- package/lib/vef-table/components/columns/code.cjs +2 -14
- package/lib/vef-table/components/columns/data-dictionary.cjs +2 -96
- package/lib/vef-table/components/columns/enum.cjs +2 -105
- package/lib/vef-table/components/columns/file.cjs +2 -14
- package/lib/vef-table/components/columns/icon.cjs +2 -14
- package/lib/vef-table/components/columns/id.cjs +2 -86
- package/lib/vef-table/components/columns/image.cjs +2 -15
- package/lib/vef-table/components/columns/index.cjs +2 -37
- package/lib/vef-table/components/columns/markdown.cjs +2 -14
- package/lib/vef-table/components/columns/number.cjs +2 -87
- package/lib/vef-table/components/columns/props.cjs +2 -4
- package/lib/vef-table/components/columns/render.cjs +2 -32
- package/lib/vef-table/components/columns/rich-text.cjs +2 -14
- package/lib/vef-table/components/columns/text.cjs +2 -92
- package/lib/vef-table/components/columns-settings.cjs +11 -199
- package/lib/vef-table/components/operation-buttons.cjs +3 -234
- package/lib/vef-table/components/settings-icon.cjs +4 -23
- package/lib/vef-table/components/table-footer.cjs +4 -106
- package/lib/vef-table/helper.cjs +2 -19
- package/lib/vef-table/hooks/use-computed-batch-buttons.cjs +2 -37
- package/lib/vef-table/hooks/use-computed-columns.cjs +2 -24
- package/lib/vef-table/hooks/use-computed-values.cjs +2 -42
- package/lib/vef-table/hooks/use-data.cjs +2 -57
- package/lib/vef-table/hooks/use-default-column-configs.cjs +2 -31
- package/lib/vef-table/hooks/use-display-value.cjs +2 -40
- package/lib/vef-table/hooks/use-helper-columns.cjs +2 -71
- package/lib/vef-table/hooks/use-operation-column-width.cjs +2 -54
- package/lib/vef-table/hooks/use-pagination-props.cjs +2 -48
- package/lib/vef-table/hooks/use-row-props.cjs +2 -43
- package/lib/vef-table/hooks/use-row-selection-config.cjs +2 -116
- package/lib/vef-table/hooks/use-selected-rows.cjs +2 -30
- package/lib/vef-table/hooks/use-table-columns.cjs +2 -60
- package/lib/vef-table/hooks/use-table-context.cjs +2 -27
- package/lib/vef-table/hooks/use-table-instance.cjs +2 -19
- package/lib/vef-table/hooks/use-table-summary.cjs +2 -46
- package/lib/vef-table/hooks/use-table-width.cjs +2 -17
- package/lib/vef-table/index.cjs +6 -231
- package/lib/vef-table/props.cjs +2 -4
- package/lib/vef-table/store.cjs +2 -23
- package/lib/vef-table/types.cjs +2 -4
- package/lib/vef-tabs/index.cjs +2 -29
- package/lib/vef-tabs/props.cjs +2 -4
- package/lib/vef-tag/index.cjs +2 -32
- package/lib/vef-tag/props.cjs +2 -4
- package/lib/vef-temporal-picker/helper.cjs +2 -61
- package/lib/vef-temporal-picker/hooks/use-dayjs-value.cjs +2 -22
- package/lib/vef-temporal-picker/hooks/use-temporal-limit.cjs +2 -38
- package/lib/vef-temporal-picker/hooks/use-temporal-picker-instance.cjs +2 -23
- package/lib/vef-temporal-picker/index.cjs +2 -129
- package/lib/vef-temporal-picker/props.cjs +2 -4
- package/lib/vef-temporal-range-picker/helper.cjs +2 -61
- package/lib/vef-temporal-range-picker/hooks/use-dayjs-values.cjs +2 -27
- package/lib/vef-temporal-range-picker/hooks/use-temporal-limit.cjs +2 -38
- package/lib/vef-temporal-range-picker/hooks/use-temporal-range-picker-instance.cjs +2 -23
- package/lib/vef-temporal-range-picker/index.cjs +2 -132
- package/lib/vef-temporal-range-picker/props.cjs +2 -8
- package/lib/vef-text/index.cjs +2 -84
- package/lib/vef-text/props.cjs +2 -4
- package/lib/vef-textarea/hooks/use-textarea-instance.cjs +2 -17
- package/lib/vef-textarea/index.cjs +2 -71
- package/lib/vef-textarea/props.cjs +2 -4
- package/lib/vef-title/index.cjs +7 -93
- package/lib/vef-title/props.cjs +2 -4
- package/lib/vef-tooltip/index.cjs +2 -39
- package/lib/vef-tooltip/props.cjs +2 -4
- package/lib/vef-tree-select/hooks/use-change-handler.cjs +2 -37
- package/lib/vef-tree-select/hooks/use-data-options.cjs +2 -49
- package/lib/vef-tree-select/hooks/use-tree-select-instance.cjs +2 -24
- package/lib/vef-tree-select/index.cjs +2 -90
- package/lib/vef-tree-select/props.cjs +2 -4
- package/lib/vef-virtual-grid/index.cjs +4 -111
- package/lib/vef-virtual-grid/props.cjs +2 -4
- package/lib/vef-virtual-list/index.cjs +5 -219
- package/lib/vef-virtual-list/props.cjs +2 -4
- package/package.json +4 -4
- package/types/vef-config-provider/hooks/use-ui-config.d.ts +0 -1
|
@@ -1,113 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
import { useContextDisabled } from '@vef-framework/hooks';
|
|
4
|
-
import { isDeepEqual, omit } from '@vef-framework/shared';
|
|
5
|
-
import { Form } from 'antd';
|
|
6
|
-
import { useMemo, memo } from 'react';
|
|
7
|
-
import { useComputedValues } from '../hooks/use-computed-values.js';
|
|
8
|
-
import VefFilterField from './filter-field.js';
|
|
9
|
-
|
|
10
|
-
const { Item } = Form;
|
|
11
|
-
const defaultBasicItemWidth = 180;
|
|
12
|
-
const defaultBasicItemWithLabelWidth = 220;
|
|
13
|
-
function VefFilterItemBase({
|
|
14
|
-
item: {
|
|
15
|
-
name,
|
|
16
|
-
show,
|
|
17
|
-
disabled,
|
|
18
|
-
label,
|
|
19
|
-
tip,
|
|
20
|
-
required,
|
|
21
|
-
width,
|
|
22
|
-
advanced = false,
|
|
23
|
-
span: _,
|
|
24
|
-
virtual: __,
|
|
25
|
-
...componentProps
|
|
26
|
-
},
|
|
27
|
-
...restProps
|
|
28
|
-
}) {
|
|
29
|
-
const formDisabled = useContextDisabled();
|
|
30
|
-
const [showValue, disabledValue, labelValue, tipValue, requiredValue, widthValue] = useComputedValues([
|
|
31
|
-
{
|
|
32
|
-
key: "show",
|
|
33
|
-
rawValue: show,
|
|
34
|
-
defaultValue: true
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
key: "disabled",
|
|
38
|
-
rawValue: disabled,
|
|
39
|
-
defaultValue: false
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
key: "label",
|
|
43
|
-
rawValue: label
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: "tip",
|
|
47
|
-
rawValue: tip
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
key: "required",
|
|
51
|
-
rawValue: required,
|
|
52
|
-
defaultValue: false
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
key: "width",
|
|
56
|
-
rawValue: width,
|
|
57
|
-
defaultValue: label ? defaultBasicItemWithLabelWidth : defaultBasicItemWidth
|
|
58
|
-
}
|
|
59
|
-
]);
|
|
60
|
-
const requiredRuleObject = useMemo(() => {
|
|
61
|
-
if (!requiredValue) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
return [
|
|
65
|
-
{
|
|
66
|
-
required: true
|
|
67
|
-
}
|
|
68
|
-
];
|
|
69
|
-
}, [requiredValue]);
|
|
70
|
-
const itemCss = useMemo(() => {
|
|
71
|
-
if (advanced) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
width: widthValue
|
|
76
|
-
};
|
|
77
|
-
}, [advanced, widthValue]);
|
|
78
|
-
if (!showValue) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
return /* @__PURE__ */ jsx(
|
|
82
|
-
Item,
|
|
83
|
-
{
|
|
84
|
-
css: itemCss,
|
|
85
|
-
help: false,
|
|
86
|
-
label: labelValue,
|
|
87
|
-
name,
|
|
88
|
-
preserve: false,
|
|
89
|
-
rules: requiredRuleObject,
|
|
90
|
-
tooltip: tipValue,
|
|
91
|
-
...restProps,
|
|
92
|
-
children: /* @__PURE__ */ jsx(
|
|
93
|
-
VefFilterField,
|
|
94
|
-
{
|
|
95
|
-
componentProps,
|
|
96
|
-
disabled: formDisabled || disabledValue,
|
|
97
|
-
label: labelValue,
|
|
98
|
-
name
|
|
99
|
-
}
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
const VefFilterItem = memo(
|
|
105
|
-
VefFilterItemBase,
|
|
106
|
-
(prevProps, nextProps) => isDeepEqual(
|
|
107
|
-
omit(prevProps, ["item"]),
|
|
108
|
-
omit(nextProps, ["item"])
|
|
109
|
-
)
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
export { VefFilterItem as default };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{jsx as e}from"@emotion/react/jsx-runtime";import{useContextDisabled as r}from"@vef-framework/hooks";import{isDeepEqual as a,omit as t}from"@vef-framework/shared";import{Form as l}from"antd";import{useMemo as o,memo as i}from"react";import{useComputedValues as u}from"../hooks/use-computed-values.js";import m from"./filter-field.js";const{Item:d}=l;const s=i((function VefFilterItemBase({item:{name:a,show:t,disabled:l,label:i,tip:s,required:f,width:n,advanced:p=!1,span:w,virtual:c,...V},...h}){const k=r(),[b,v,y,j,q,x]=u([{key:"show",rawValue:t,defaultValue:!0},{key:"disabled",rawValue:l,defaultValue:!1},{key:"label",rawValue:i},{key:"tip",rawValue:s},{key:"required",rawValue:f,defaultValue:!1},{key:"width",rawValue:n,defaultValue:i?220:180}]),I=o((()=>{if(q)return[{required:!0}]}),[q]),B=o((()=>{if(!p)return{width:x}}),[p,x]);return b?e(d,{css:B,help:!1,label:y,name:a,preserve:!1,rules:I,tooltip:j,...h,children:e(m,{componentProps:V,disabled:k||v,label:y,name:a})}):null}),((e,r)=>a(t(e,["item"]),t(r,["item"]))));export{s as default};
|
|
113
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/vef-filter/event.js
CHANGED
|
@@ -1,45 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
var __typeError = (msg) => {
|
|
5
|
-
throw TypeError(msg);
|
|
6
|
-
};
|
|
7
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
8
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
|
-
var _emitter;
|
|
11
|
-
const changeEvent = Symbol("change");
|
|
12
|
-
const submitResultEvent = Symbol("submitResult");
|
|
13
|
-
class FilterEventBus {
|
|
14
|
-
constructor() {
|
|
15
|
-
/**
|
|
16
|
-
* The emitter.
|
|
17
|
-
*/
|
|
18
|
-
__privateAdd(this, _emitter, createEventEmitter());
|
|
19
|
-
}
|
|
20
|
-
clear() {
|
|
21
|
-
__privateGet(this, _emitter).all.clear();
|
|
22
|
-
}
|
|
23
|
-
onChange(handler) {
|
|
24
|
-
__privateGet(this, _emitter).on(changeEvent, handler);
|
|
25
|
-
}
|
|
26
|
-
offChange(handler) {
|
|
27
|
-
__privateGet(this, _emitter).off(changeEvent, handler);
|
|
28
|
-
}
|
|
29
|
-
emitChange(value) {
|
|
30
|
-
__privateGet(this, _emitter).emit(changeEvent, value);
|
|
31
|
-
}
|
|
32
|
-
onSubmitResult(handler) {
|
|
33
|
-
__privateGet(this, _emitter).on(submitResultEvent, handler);
|
|
34
|
-
}
|
|
35
|
-
offSubmitResult(handler) {
|
|
36
|
-
__privateGet(this, _emitter).off(submitResultEvent, handler);
|
|
37
|
-
}
|
|
38
|
-
emitSubmitResult(value) {
|
|
39
|
-
__privateGet(this, _emitter).emit(submitResultEvent, value);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
_emitter = new WeakMap();
|
|
43
|
-
|
|
44
|
-
export { FilterEventBus };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{createEventEmitter as e}from"@vef-framework/shared";var t,__typeError=e=>{throw TypeError(e)},__privateGet=(e,t,a)=>(((e,t,a)=>{t.has(e)||__typeError("Cannot "+a)})(e,t,"read from private field"),a?a.call(e):t.get(e));const a=Symbol("change"),o=Symbol("submitResult");class FilterEventBus{constructor(){var a,o,s;a=this,o=t,s=e(),o.has(a)?__typeError("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(a):o.set(a,s)}clear(){__privateGet(this,t).all.clear()}onChange(e){__privateGet(this,t).on(a,e)}offChange(e){__privateGet(this,t).off(a,e)}emitChange(e){__privateGet(this,t).emit(a,e)}onSubmitResult(e){__privateGet(this,t).on(o,e)}offSubmitResult(e){__privateGet(this,t).off(o,e)}emitSubmitResult(e){__privateGet(this,t).emit(o,e)}}t=new WeakMap;export{FilterEventBus};
|
|
45
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/vef-filter/helper.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
function computeValue(value, values, defaultValue) {
|
|
5
|
-
if (isFunction(value)) {
|
|
6
|
-
return value(values);
|
|
7
|
-
}
|
|
8
|
-
if (isExpression(value)) {
|
|
9
|
-
const fn = compileDynamicFn(value, "values", `return ${value.expression}`);
|
|
10
|
-
return fn(values);
|
|
11
|
-
}
|
|
12
|
-
return value ?? defaultValue;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { computeValue };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{isFunction as e,isExpression as r,compileDynamicFn as u}from"@vef-framework/shared";function computeValue(t,o,n){if(e(t))return t(o);if(r(t)){return u(t,"values",`return ${t.expression}`)(o)}return t??n}export{computeValue};
|
|
16
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,71 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
import { useCallback, useMemo } from 'react';
|
|
4
|
-
import { useFilterStore } from '../store.js';
|
|
5
|
-
|
|
6
|
-
function useActionHandlers({
|
|
7
|
-
onBeforeConfirm,
|
|
8
|
-
onConfirm,
|
|
9
|
-
onReset
|
|
10
|
-
}) {
|
|
11
|
-
const [
|
|
12
|
-
form,
|
|
13
|
-
eventBus,
|
|
14
|
-
getValues,
|
|
15
|
-
initialValues,
|
|
16
|
-
invokeValueChangeHandlers,
|
|
17
|
-
virtualFieldNames,
|
|
18
|
-
setIsLoading
|
|
19
|
-
] = useFilterStore((state) => [
|
|
20
|
-
state.form,
|
|
21
|
-
state.eventBus,
|
|
22
|
-
state.getValues,
|
|
23
|
-
state.initialValues,
|
|
24
|
-
state.invokeValueChangeHandlers,
|
|
25
|
-
state.virtualFieldNames,
|
|
26
|
-
state.setIsLoading
|
|
27
|
-
]);
|
|
28
|
-
const handleReset = useCallback(() => {
|
|
29
|
-
const values = getValues();
|
|
30
|
-
form.resetFields();
|
|
31
|
-
invokeValueChangeHandlers();
|
|
32
|
-
eventBus.emitChange(initialValues);
|
|
33
|
-
onReset?.(values);
|
|
34
|
-
}, [eventBus, form, getValues, initialValues, invokeValueChangeHandlers, onReset]);
|
|
35
|
-
const handleConfirm = useMemo(() => {
|
|
36
|
-
if (!isFunction(onConfirm)) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
return async (values) => {
|
|
40
|
-
setIsLoading(true);
|
|
41
|
-
let valuesToUse = values;
|
|
42
|
-
try {
|
|
43
|
-
if (isFunction(onBeforeConfirm)) {
|
|
44
|
-
valuesToUse = await onBeforeConfirm(valuesToUse);
|
|
45
|
-
}
|
|
46
|
-
const valuesToConfirm = omit(valuesToUse, virtualFieldNames);
|
|
47
|
-
await onConfirm(valuesToConfirm);
|
|
48
|
-
eventBus.emitSubmitResult(true);
|
|
49
|
-
} catch (error) {
|
|
50
|
-
eventBus.emitSubmitResult(false);
|
|
51
|
-
throw error;
|
|
52
|
-
} finally {
|
|
53
|
-
setIsLoading(false);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
}, [onBeforeConfirm, onConfirm, eventBus, setIsLoading, virtualFieldNames]);
|
|
57
|
-
const handleConfirmFailed = useCallback(({ errorFields }) => {
|
|
58
|
-
eventBus.emitSubmitResult(false);
|
|
59
|
-
if (errorFields.length > 0) {
|
|
60
|
-
showWarningMessage(errorFields.flatMap((field) => field.errors).join(", "));
|
|
61
|
-
}
|
|
62
|
-
}, [eventBus]);
|
|
63
|
-
return {
|
|
64
|
-
handleReset,
|
|
65
|
-
handleConfirm,
|
|
66
|
-
handleConfirmFailed
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export { useActionHandlers };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{isFunction as e,omit as t,showWarningMessage as r}from"@vef-framework/shared";import{useCallback as i,useMemo as n}from"react";import{useFilterStore as o}from"../store.js";function useActionHandlers({onBeforeConfirm:a,onConfirm:s,onReset:l}){const[m,u,f,d,c,h,C]=o((e=>[e.form,e.eventBus,e.getValues,e.initialValues,e.invokeValueChangeHandlers,e.virtualFieldNames,e.setIsLoading]));return{handleReset:i((()=>{const e=f();m.resetFields(),c(),u.emitChange(d),l?.(e)}),[u,m,f,d,c,l]),handleConfirm:n((()=>{if(e(s))return async r=>{C(!0);let i=r;try{e(a)&&(i=await a(i));const r=t(i,h);await s(r),u.emitSubmitResult(!0)}catch(e){throw u.emitSubmitResult(!1),e}finally{C(!1)}}}),[a,s,u,C,h]),handleConfirmFailed:i((({errorFields:e})=>{u.emitSubmitResult(!1),e.length>0&&r(e.flatMap((e=>e.errors)).join(", "))}),[u])}}export{useActionHandlers};
|
|
71
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,56 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
import { isFunctionOrExpression, isDeepEqual } from '@vef-framework/shared';
|
|
4
|
-
import { computeValue } from '../helper.js';
|
|
5
|
-
import { useFilterStore } from '../store.js';
|
|
6
|
-
|
|
7
|
-
function useComputedValues(values, returnAsObject = false) {
|
|
8
|
-
const [eventBus, getValues] = useFilterStore((state) => [state.eventBus, state.getValues]);
|
|
9
|
-
const forceUpdate = useUpdater();
|
|
10
|
-
const currentValues = getValues();
|
|
11
|
-
const computedValues = useDeepMemo(() => values.reduce((acc, it) => {
|
|
12
|
-
const {
|
|
13
|
-
key,
|
|
14
|
-
rawValue,
|
|
15
|
-
defaultValue
|
|
16
|
-
} = it;
|
|
17
|
-
const computedValue = computeValue(rawValue, currentValues, defaultValue);
|
|
18
|
-
acc[key] = computedValue;
|
|
19
|
-
return acc;
|
|
20
|
-
}, {}), [currentValues, values]);
|
|
21
|
-
useDeepLayoutEffect(() => {
|
|
22
|
-
const realComputedValues = values.filter(({ rawValue }) => isFunctionOrExpression(rawValue));
|
|
23
|
-
const shouldListenChangeEvent = realComputedValues.length > 0;
|
|
24
|
-
if (shouldListenChangeEvent) {
|
|
25
|
-
const handleChange = (newValues) => {
|
|
26
|
-
for (const value of realComputedValues) {
|
|
27
|
-
const {
|
|
28
|
-
key,
|
|
29
|
-
rawValue,
|
|
30
|
-
defaultValue
|
|
31
|
-
} = value;
|
|
32
|
-
const computedValue = computedValues[key];
|
|
33
|
-
const refreshedValue = computeValue(rawValue, newValues, defaultValue);
|
|
34
|
-
if (!isDeepEqual(refreshedValue, computedValue)) {
|
|
35
|
-
forceUpdate();
|
|
36
|
-
break;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
eventBus.onChange(handleChange);
|
|
41
|
-
return () => {
|
|
42
|
-
eventBus.offChange(handleChange);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}, [computedValues, eventBus, forceUpdate, values]);
|
|
46
|
-
if (returnAsObject) {
|
|
47
|
-
return values.reduce((acc, { key }) => {
|
|
48
|
-
acc[key] = computedValues[key];
|
|
49
|
-
return acc;
|
|
50
|
-
}, {});
|
|
51
|
-
}
|
|
52
|
-
return values.map(({ key }) => computedValues[key]);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export { useComputedValues };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{useUpdater as e,useDeepMemo as r,useDeepLayoutEffect as o}from"@vef-framework/hooks";import{isFunctionOrExpression as t,isDeepEqual as u}from"@vef-framework/shared";import{computeValue as a}from"../helper.js";import{useFilterStore as f}from"../store.js";function useComputedValues(s,n=!1){const[l,m]=f((e=>[e.eventBus,e.getValues])),c=e(),p=m(),i=r((()=>s.reduce(((e,r)=>{const{key:o,rawValue:t,defaultValue:u}=r,f=a(t,p,u);return e[o]=f,e}),{})),[p,s]);return o((()=>{const e=s.filter((({rawValue:e})=>t(e)));if(e.length>0){const handleChange=r=>{for(const o of e){const{key:e,rawValue:t,defaultValue:f}=o,s=i[e],n=a(t,r,f);if(!u(n,s)){c();break}}};return l.onChange(handleChange),()=>{l.offChange(handleChange)}}}),[i,l,c,s]),n?s.reduce(((e,{key:r})=>(e[r]=i[r],e)),{}):s.map((({key:e})=>i[e]))}export{useComputedValues};
|
|
56
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const {
|
|
5
|
-
useContextSelector,
|
|
6
|
-
useContext,
|
|
7
|
-
ContextProvider: FilterContextProvider
|
|
8
|
-
} = createSelectableContext({
|
|
9
|
-
labelPosition: "top",
|
|
10
|
-
labelAlign: "right",
|
|
11
|
-
externalLoading: false,
|
|
12
|
-
showCollapseButton: false,
|
|
13
|
-
handleReset: noop
|
|
14
|
-
});
|
|
15
|
-
const useFilterContextSelector = useContextSelector;
|
|
16
|
-
const useFilterContext = useContext;
|
|
17
|
-
|
|
18
|
-
export { FilterContextProvider, useFilterContext, useFilterContextSelector };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{createSelectableContext as e,noop as o}from"@vef-framework/shared";const{useContextSelector:t,useContext:r,ContextProvider:l}=e({labelPosition:"top",labelAlign:"right",externalLoading:!1,showCollapseButton:!1,handleReset:o}),n=t,a=r;export{l as FilterContextProvider,a as useFilterContext,n as useFilterContextSelector};
|
|
19
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,38 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
function useFilterInitialization(schema, initialValues) {
|
|
6
|
-
return useMemo(() => {
|
|
7
|
-
const mergedInitialValues = {
|
|
8
|
-
...initialValues
|
|
9
|
-
};
|
|
10
|
-
const valueChangeHandlers = {};
|
|
11
|
-
const virtualFieldNames = [];
|
|
12
|
-
for (const item of schema) {
|
|
13
|
-
const {
|
|
14
|
-
name,
|
|
15
|
-
onChange,
|
|
16
|
-
defaultValue,
|
|
17
|
-
virtual
|
|
18
|
-
} = item;
|
|
19
|
-
if (!isNullish(defaultValue) && isNullish(mergedInitialValues[name])) {
|
|
20
|
-
mergedInitialValues[name] = defaultValue;
|
|
21
|
-
}
|
|
22
|
-
if (isFunction(onChange)) {
|
|
23
|
-
valueChangeHandlers[name] = onChange;
|
|
24
|
-
}
|
|
25
|
-
if (virtual === true) {
|
|
26
|
-
virtualFieldNames.push(name);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
mergedInitialValues,
|
|
31
|
-
valueChangeHandlers,
|
|
32
|
-
virtualFieldNames
|
|
33
|
-
};
|
|
34
|
-
}, []);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export { useFilterInitialization };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{isNullish as e,isFunction as r}from"@vef-framework/shared";import{useMemo as t}from"react";function useFilterInitialization(a,i){return t((()=>{const t={...i},n={},o=[];for(const i of a){const{name:a,onChange:l,defaultValue:u,virtual:s}=i;!e(u)&&e(t[a])&&(t[a]=u),r(l)&&(n[a]=l),!0===s&&o.push(a)}return{mergedInitialValues:t,valueChangeHandlers:n,virtualFieldNames:o}}),[])}export{useFilterInitialization};
|
|
38
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import {
|
|
3
|
-
import { useFilterStore } from '../store.js';
|
|
4
|
-
|
|
5
|
-
function useFilterInstance(ref, reset) {
|
|
6
|
-
const [form, eventBus, getValues, setValues] = useFilterStore((state) => [state.form, state.eventBus, state.getValues, state.setValues]);
|
|
7
|
-
useImperativeHandle(ref, () => ({
|
|
8
|
-
confirm: () => new Promise((resolve, reject) => {
|
|
9
|
-
const handleResult = (result) => {
|
|
10
|
-
eventBus.offSubmitResult(handleResult);
|
|
11
|
-
if (result) {
|
|
12
|
-
resolve();
|
|
13
|
-
} else {
|
|
14
|
-
reject(result);
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
eventBus.onSubmitResult(handleResult);
|
|
18
|
-
form.submit();
|
|
19
|
-
}),
|
|
20
|
-
reset,
|
|
21
|
-
getValues,
|
|
22
|
-
setValues
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { useFilterInstance };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{useImperativeHandle as e}from"react";import{useFilterStore as t}from"../store.js";function useFilterInstance(s,o){const[r,u,n,i]=t((e=>[e.form,e.eventBus,e.getValues,e.setValues]));e(s,(()=>({confirm:()=>new Promise(((e,t)=>{const handleResult=s=>{u.offSubmitResult(handleResult),s?e():t(s)};u.onSubmitResult(handleResult),r.submit()})),reset:o,getValues:n,setValues:i})))}export{useFilterInstance};
|
|
27
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,24 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
function useFilterItems(schema) {
|
|
5
|
-
return useMemo(() => {
|
|
6
|
-
const basicItems = [];
|
|
7
|
-
const advancedItems = [];
|
|
8
|
-
for (const item of schema) {
|
|
9
|
-
const { advanced = false } = item;
|
|
10
|
-
if (advanced) {
|
|
11
|
-
advancedItems.push(item);
|
|
12
|
-
} else {
|
|
13
|
-
basicItems.push(item);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return {
|
|
17
|
-
basicItems,
|
|
18
|
-
advancedItems
|
|
19
|
-
};
|
|
20
|
-
}, []);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export { useFilterItems };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{useMemo as t}from"react";function useFilterItems(e){return t((()=>{const t=[],s=[];for(const r of e){const{advanced:e=!1}=r;e?s.push(r):t.push(r)}return{basicItems:t,advancedItems:s}}),[])}export{useFilterItems};
|
|
24
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,31 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
import { useMemo, useEffect, useLayoutEffect } from 'react';
|
|
4
|
-
import { useFilterStore } from '../store.js';
|
|
5
|
-
|
|
6
|
-
function useFilterValuesChange(onChange) {
|
|
7
|
-
const [eventBus, invokeValueChangeHandlers] = useFilterStore((state) => [state.eventBus, state.invokeValueChangeHandlers]);
|
|
8
|
-
const handleValuesChange = useMemo(() => (_, values) => {
|
|
9
|
-
eventBus.emitChange(values);
|
|
10
|
-
}, [eventBus]);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (isFunction(onChange)) {
|
|
13
|
-
const handleChange = (values) => {
|
|
14
|
-
onChange(values);
|
|
15
|
-
};
|
|
16
|
-
eventBus.onChange(handleChange);
|
|
17
|
-
return () => {
|
|
18
|
-
eventBus.offChange(handleChange);
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
}, [eventBus, onChange]);
|
|
22
|
-
useLayoutEffect(() => {
|
|
23
|
-
invokeValueChangeHandlers();
|
|
24
|
-
}, []);
|
|
25
|
-
return {
|
|
26
|
-
handleValuesChange
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export { useFilterValuesChange };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{isFunction as e}from"@vef-framework/shared";import{useMemo as r,useEffect as n,useLayoutEffect as a}from"react";import{useFilterStore as o}from"../store.js";function useFilterValuesChange(t){const[s,u]=o((e=>[e.eventBus,e.invokeValueChangeHandlers])),f=r((()=>(e,r)=>{s.emitChange(r)}),[s]);return n((()=>{if(e(t)){const handleChange=e=>{t(e)};return s.onChange(handleChange),()=>{s.offChange(handleChange)}}}),[s,t]),a((()=>{u()}),[]),{handleValuesChange:f}}export{useFilterValuesChange};
|
|
31
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
|
@@ -1,28 +1,3 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
import { useMemo } from 'react';
|
|
4
|
-
|
|
5
|
-
function useLabelConfig(labelPosition, labelWidth) {
|
|
6
|
-
const labelWidthToUse = useMemo(() => {
|
|
7
|
-
if (labelPosition === "top" || !labelWidth) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
if (labelWidth < 60 || labelWidth > 120) {
|
|
11
|
-
showWarningMessage("The labelWidth of VefFilter component must be between 60 and 120, otherwise it will be 60 or 120.");
|
|
12
|
-
}
|
|
13
|
-
return Math.min(Math.max(labelWidth, 60), 120);
|
|
14
|
-
}, [labelPosition, labelWidth]);
|
|
15
|
-
const labelCol = useMemo(() => {
|
|
16
|
-
if (!labelWidthToUse) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
return { flex: `0 0 ${labelWidthToUse}px` };
|
|
20
|
-
}, [labelWidthToUse]);
|
|
21
|
-
return {
|
|
22
|
-
labelCol,
|
|
23
|
-
labelWidthToUse
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { useLabelConfig };
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{showWarningMessage as e}from"@vef-framework/shared";import{useMemo as t}from"react";function useLabelConfig(o,r){const i=t((()=>{if("top"!==o&&r)return(r<60||r>120)&&e("The labelWidth of VefFilter component must be between 60 and 120, otherwise it will be 60 or 120."),Math.min(Math.max(r,60),120)}),[o,r]);return{labelCol:t((()=>{if(i)return{flex:`0 0 ${i}px`}}),[i]),labelWidthToUse:i}}export{useLabelConfig};
|
|
28
3
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|
package/es/vef-filter/index.js
CHANGED
|
@@ -1,148 +1,10 @@
|
|
|
1
|
-
/*! VefFramework version: 1.0.
|
|
2
|
-
import
|
|
3
|
-
import { css } from '@emotion/react';
|
|
4
|
-
import { useContextDisabled, DisabledContextProvider, useSingleton, useUnmount } from '@vef-framework/hooks';
|
|
5
|
-
import { isDeepEqual, omit } from '@vef-framework/shared';
|
|
6
|
-
import { Form } from 'antd';
|
|
7
|
-
import { AnimatePresence } from 'motion/react';
|
|
8
|
-
import { useMemo, forwardRef, memo } from 'react';
|
|
9
|
-
import '../internal/index.js';
|
|
10
|
-
import VefAdvancedFilter from './components/advanced-filter.js';
|
|
11
|
-
import VefBasicFilter from './components/basic-filter.js';
|
|
12
|
-
import { FilterEventBus } from './event.js';
|
|
13
|
-
import { useActionHandlers } from './hooks/use-action-handlers.js';
|
|
14
|
-
import { FilterContextProvider } from './hooks/use-filter-context.js';
|
|
15
|
-
import { useFilterInitialization } from './hooks/use-filter-initialization.js';
|
|
16
|
-
import { useFilterInstance } from './hooks/use-filter-instance.js';
|
|
17
|
-
import { useFilterItems } from './hooks/use-filter-items.js';
|
|
18
|
-
import { useFilterValuesChange } from './hooks/use-filter-values-change.js';
|
|
19
|
-
import { useFilterStore, FilterStoreProvider } from './store.js';
|
|
20
|
-
import { convertBasicSizeToUiSize } from '../internal/utils.js';
|
|
21
|
-
|
|
22
|
-
const { useForm } = Form;
|
|
23
|
-
const formStyle = css`
|
|
1
|
+
/*! VefFramework version: 1.0.65, build time: 2025-01-10T02:44:47.916Z, made by Venus. */
|
|
2
|
+
import{jsx as e,jsxs as i}from"@emotion/react/jsx-runtime";import{css as o}from"@emotion/react";import{useContextDisabled as t,DisabledContextProvider as n,useSingleton as r,useUnmount as a}from"@vef-framework/hooks";import{isDeepEqual as s,omit as l}from"@vef-framework/shared";import{Form as m}from"antd";import{AnimatePresence as f}from"motion/react";import{useMemo as c,forwardRef as d,memo as u}from"react";import"../internal/index.js";import h from"./components/advanced-filter.js";import p from"./components/basic-filter.js";import{FilterEventBus as g}from"./event.js";import{useActionHandlers as v}from"./hooks/use-action-handlers.js";import{FilterContextProvider as V}from"./hooks/use-filter-context.js";import{useFilterInitialization as j}from"./hooks/use-filter-initialization.js";import{useFilterInstance as b}from"./hooks/use-filter-instance.js";import{useFilterItems as B}from"./hooks/use-filter-items.js";import{useFilterValuesChange as C}from"./hooks/use-filter-values-change.js";import{useFilterStore as F,FilterStoreProvider as k}from"./store.js";import{convertBasicSizeToUiSize as x}from"../internal/utils.js";const{useForm:w}=m,A=o`
|
|
24
3
|
display: block;
|
|
25
4
|
flex-wrap: unset;
|
|
26
5
|
|
|
27
6
|
.vef-form-item {
|
|
28
7
|
margin-inline-end: 0;
|
|
29
8
|
}
|
|
30
|
-
`;
|
|
31
|
-
function VefFilterBase({
|
|
32
|
-
schema,
|
|
33
|
-
labelPosition = "top",
|
|
34
|
-
labelAlign = "right",
|
|
35
|
-
labelWidth,
|
|
36
|
-
disabled = false,
|
|
37
|
-
loading = false,
|
|
38
|
-
size,
|
|
39
|
-
variant,
|
|
40
|
-
prefix,
|
|
41
|
-
confirmationButton,
|
|
42
|
-
resetButton,
|
|
43
|
-
extraActionButtons,
|
|
44
|
-
onBeforeConfirm,
|
|
45
|
-
onConfirm,
|
|
46
|
-
onReset,
|
|
47
|
-
onChange
|
|
48
|
-
}, ref) {
|
|
49
|
-
const [form, initialValues, isLoading, isAdvancedFilterVisible] = useFilterStore((state) => [state.form, state.initialValues, state.isLoading, state.isAdvancedFilterVisible]);
|
|
50
|
-
const {
|
|
51
|
-
handleReset,
|
|
52
|
-
handleConfirm,
|
|
53
|
-
handleConfirmFailed
|
|
54
|
-
} = useActionHandlers({
|
|
55
|
-
onBeforeConfirm,
|
|
56
|
-
onConfirm,
|
|
57
|
-
onReset
|
|
58
|
-
});
|
|
59
|
-
const { basicItems, advancedItems } = useFilterItems(schema);
|
|
60
|
-
const filterContext = useMemo(() => ({
|
|
61
|
-
labelPosition,
|
|
62
|
-
labelAlign,
|
|
63
|
-
labelWidth,
|
|
64
|
-
confirmationButton,
|
|
65
|
-
externalLoading: loading,
|
|
66
|
-
showCollapseButton: advancedItems.length > 0,
|
|
67
|
-
handleReset,
|
|
68
|
-
resetButton,
|
|
69
|
-
extraActionButtons
|
|
70
|
-
}), [
|
|
71
|
-
advancedItems.length,
|
|
72
|
-
confirmationButton,
|
|
73
|
-
extraActionButtons,
|
|
74
|
-
handleReset,
|
|
75
|
-
labelAlign,
|
|
76
|
-
labelPosition,
|
|
77
|
-
labelWidth,
|
|
78
|
-
loading,
|
|
79
|
-
resetButton
|
|
80
|
-
]);
|
|
81
|
-
const { handleValuesChange } = useFilterValuesChange(onChange);
|
|
82
|
-
useFilterInstance(ref, handleReset);
|
|
83
|
-
const contextDisabled = useContextDisabled();
|
|
84
|
-
const formDisabled = contextDisabled || disabled || loading || isLoading;
|
|
85
|
-
return /* @__PURE__ */ jsx(
|
|
86
|
-
Form,
|
|
87
|
-
{
|
|
88
|
-
colon: false,
|
|
89
|
-
css: formStyle,
|
|
90
|
-
disabled: formDisabled,
|
|
91
|
-
form,
|
|
92
|
-
initialValues,
|
|
93
|
-
layout: "inline",
|
|
94
|
-
size: convertBasicSizeToUiSize(size),
|
|
95
|
-
variant,
|
|
96
|
-
onFinish: handleConfirm,
|
|
97
|
-
onFinishFailed: handleConfirmFailed,
|
|
98
|
-
onValuesChange: handleValuesChange,
|
|
99
|
-
children: /* @__PURE__ */ jsx(DisabledContextProvider, { value: formDisabled, children: /* @__PURE__ */ jsxs(FilterContextProvider, { value: filterContext, children: [
|
|
100
|
-
/* @__PURE__ */ jsx(VefBasicFilter, { items: basicItems, prefix }),
|
|
101
|
-
/* @__PURE__ */ jsx(AnimatePresence, { children: isAdvancedFilterVisible && advancedItems.length > 0 && /* @__PURE__ */ jsx(VefAdvancedFilter, { items: advancedItems }) })
|
|
102
|
-
] }) })
|
|
103
|
-
}
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
const VefFilterBaseForwarded = forwardRef(VefFilterBase);
|
|
107
|
-
VefFilterBaseForwarded.displayName = "VefFilterBase";
|
|
108
|
-
function VefFilterWrapper({
|
|
109
|
-
initialValues,
|
|
110
|
-
...restProps
|
|
111
|
-
}, ref) {
|
|
112
|
-
const { schema } = restProps;
|
|
113
|
-
const [form] = useForm();
|
|
114
|
-
const filterEventBus = useSingleton(() => new FilterEventBus());
|
|
115
|
-
useUnmount(() => {
|
|
116
|
-
filterEventBus.clear();
|
|
117
|
-
});
|
|
118
|
-
const {
|
|
119
|
-
mergedInitialValues,
|
|
120
|
-
valueChangeHandlers,
|
|
121
|
-
virtualFieldNames
|
|
122
|
-
} = useFilterInitialization(schema, initialValues);
|
|
123
|
-
const initialState = useMemo(() => ({
|
|
124
|
-
eventBus: filterEventBus,
|
|
125
|
-
form,
|
|
126
|
-
initialValues: mergedInitialValues,
|
|
127
|
-
valueChangeHandlers,
|
|
128
|
-
virtualFieldNames
|
|
129
|
-
}), [
|
|
130
|
-
filterEventBus,
|
|
131
|
-
form,
|
|
132
|
-
mergedInitialValues,
|
|
133
|
-
valueChangeHandlers,
|
|
134
|
-
virtualFieldNames
|
|
135
|
-
]);
|
|
136
|
-
return /* @__PURE__ */ jsx(FilterStoreProvider, { initialState, children: /* @__PURE__ */ jsx(VefFilterBaseForwarded, { ref, ...restProps }) });
|
|
137
|
-
}
|
|
138
|
-
const VefFilter = memo(
|
|
139
|
-
forwardRef(VefFilterWrapper),
|
|
140
|
-
(prevProps, nextProps) => isDeepEqual(
|
|
141
|
-
omit(prevProps, ["initialValues", "schema"]),
|
|
142
|
-
omit(nextProps, ["initialValues", "schema"])
|
|
143
|
-
)
|
|
144
|
-
);
|
|
145
|
-
VefFilter.displayName = "VefFilter";
|
|
146
|
-
|
|
147
|
-
export { VefFilter as default };
|
|
9
|
+
`;const y=d((function VefFilterBase({schema:o,labelPosition:r="top",labelAlign:a="right",labelWidth:s,disabled:l=!1,loading:d=!1,size:u,variant:g,prefix:j,confirmationButton:k,resetButton:w,extraActionButtons:y,onBeforeConfirm:N,onConfirm:R,onReset:z,onChange:I},W){const[H,L,P,S]=F((e=>[e.form,e.initialValues,e.isLoading,e.isAdvancedFilterVisible])),{handleReset:q,handleConfirm:D,handleConfirmFailed:E}=v({onBeforeConfirm:N,onConfirm:R,onReset:z}),{basicItems:G,advancedItems:J}=B(o),K=c((()=>({labelPosition:r,labelAlign:a,labelWidth:s,confirmationButton:k,externalLoading:d,showCollapseButton:J.length>0,handleReset:q,resetButton:w,extraActionButtons:y})),[J.length,k,y,q,a,r,s,d,w]),{handleValuesChange:M}=C(I);b(W,q);const O=t()||l||d||P;return e(m,{colon:!1,css:A,disabled:O,form:H,initialValues:L,layout:"inline",size:x(u),variant:g,onFinish:D,onFinishFailed:E,onValuesChange:M,children:e(n,{value:O,children:i(V,{value:K,children:[e(p,{items:G,prefix:j}),e(f,{children:S&&J.length>0&&e(h,{items:J})})]})})})}));y.displayName="VefFilterBase";const N=u(d((function VefFilterWrapper({initialValues:i,...o},t){const{schema:n}=o,[s]=w(),l=r((()=>new g));a((()=>{l.clear()}));const{mergedInitialValues:m,valueChangeHandlers:f,virtualFieldNames:d}=j(n,i),u=c((()=>({eventBus:l,form:s,initialValues:m,valueChangeHandlers:f,virtualFieldNames:d})),[l,s,m,f,d]);return e(k,{initialState:u,children:e(y,{ref:t,...o})})})),((e,i)=>s(l(e,["initialValues","schema"]),l(i,["initialValues","schema"]))));N.displayName="VefFilter";export{N as default};
|
|
148
10
|
/*! VefFramework is a blazingly high-level, modern, flexible, easy-to-use UI framework made by Venus. Follow me on Github: https://github.com/ilxqx! @ilxqx */
|