@wordpress/dataviews 11.4.1-next.v.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -1
- package/README.md +44 -2
- package/build/components/dataform-controls/adaptive-select.cjs +52 -0
- package/build/components/dataform-controls/adaptive-select.cjs.map +7 -0
- package/build/components/dataform-controls/array.cjs +2 -0
- package/build/components/dataform-controls/array.cjs.map +2 -2
- package/build/components/dataform-controls/checkbox.cjs +2 -0
- package/build/components/dataform-controls/checkbox.cjs.map +2 -2
- package/build/components/dataform-controls/color.cjs +21 -30
- package/build/components/dataform-controls/color.cjs.map +3 -3
- package/build/components/dataform-controls/date.cjs +23 -9
- package/build/components/dataform-controls/date.cjs.map +2 -2
- package/build/components/dataform-controls/datetime.cjs +11 -3
- package/build/components/dataform-controls/datetime.cjs.map +2 -2
- package/build/components/dataform-controls/email.cjs +2 -0
- package/build/components/dataform-controls/email.cjs.map +2 -2
- package/build/components/dataform-controls/index.cjs +3 -1
- package/build/components/dataform-controls/index.cjs.map +3 -3
- package/build/components/dataform-controls/password.cjs +2 -0
- package/build/components/dataform-controls/password.cjs.map +2 -2
- package/build/components/dataform-controls/radio.cjs +2 -0
- package/build/components/dataform-controls/radio.cjs.map +2 -2
- package/build/components/dataform-controls/select.cjs +2 -0
- package/build/components/dataform-controls/select.cjs.map +2 -2
- package/build/components/dataform-controls/telephone.cjs +2 -0
- package/build/components/dataform-controls/telephone.cjs.map +2 -2
- package/build/components/dataform-controls/text.cjs +2 -0
- package/build/components/dataform-controls/text.cjs.map +2 -2
- package/build/components/dataform-controls/textarea.cjs +2 -0
- package/build/components/dataform-controls/textarea.cjs.map +2 -2
- package/build/components/dataform-controls/toggle-group.cjs +2 -0
- package/build/components/dataform-controls/toggle-group.cjs.map +2 -2
- package/build/components/dataform-controls/toggle.cjs +2 -0
- package/build/components/dataform-controls/toggle.cjs.map +2 -2
- package/build/components/dataform-controls/url.cjs +2 -0
- package/build/components/dataform-controls/url.cjs.map +2 -2
- package/build/components/dataform-controls/utils/relative-date-control.cjs +1 -1
- package/build/components/dataform-controls/utils/relative-date-control.cjs.map +1 -1
- package/build/components/dataform-controls/utils/validated-input.cjs +2 -0
- package/build/components/dataform-controls/utils/validated-input.cjs.map +2 -2
- package/build/components/dataform-controls/utils/validated-number.cjs +2 -0
- package/build/components/dataform-controls/utils/validated-number.cjs.map +2 -2
- package/build/components/dataform-layouts/card/index.cjs +2 -0
- package/build/components/dataform-layouts/card/index.cjs.map +2 -2
- package/build/components/dataform-layouts/data-form-layout.cjs +11 -2
- package/build/components/dataform-layouts/data-form-layout.cjs.map +2 -2
- package/build/components/dataform-layouts/details/index.cjs +1 -1
- package/build/components/dataform-layouts/details/index.cjs.map +1 -1
- package/build/components/dataform-layouts/index.cjs +5 -5
- package/build/components/dataform-layouts/index.cjs.map +1 -1
- package/build/components/dataform-layouts/normalize-form.cjs +2 -1
- package/build/components/dataform-layouts/normalize-form.cjs.map +2 -2
- package/build/components/dataform-layouts/panel/dropdown.cjs +81 -66
- package/build/components/dataform-layouts/panel/dropdown.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/index.cjs +13 -177
- package/build/components/dataform-layouts/panel/index.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/modal.cjs +15 -11
- package/build/components/dataform-layouts/panel/modal.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/summary-button.cjs +125 -56
- package/build/components/dataform-layouts/panel/summary-button.cjs.map +3 -3
- package/build/components/dataform-layouts/panel/utils/get-first-validation-error.cjs +59 -0
- package/build/components/dataform-layouts/panel/utils/get-first-validation-error.cjs.map +7 -0
- package/build/components/dataform-layouts/panel/utils/get-label-classname.cjs +45 -0
- package/build/components/dataform-layouts/panel/utils/get-label-classname.cjs.map +7 -0
- package/build/components/dataform-layouts/panel/utils/get-label-content.cjs +36 -0
- package/build/components/dataform-layouts/panel/utils/get-label-content.cjs.map +7 -0
- package/build/components/dataform-layouts/panel/utils/use-field-from-form-field.cjs +77 -0
- package/build/components/dataform-layouts/panel/utils/use-field-from-form-field.cjs.map +7 -0
- package/build/components/dataform-layouts/regular/index.cjs +6 -3
- package/build/components/dataform-layouts/regular/index.cjs.map +2 -2
- package/build/components/dataform-layouts/row/index.cjs +5 -2
- package/build/components/dataform-layouts/row/index.cjs.map +2 -2
- package/build/components/dataviews-bulk-actions/index.cjs +4 -4
- package/build/components/dataviews-bulk-actions/index.cjs.map +2 -2
- package/build/components/dataviews-context/index.cjs.map +2 -2
- package/build/components/dataviews-filters/filter.cjs +1 -1
- package/build/components/dataviews-filters/filter.cjs.map +1 -1
- package/build/components/dataviews-filters/filters.cjs +1 -1
- package/build/components/dataviews-filters/filters.cjs.map +1 -1
- package/build/components/dataviews-filters/search-widget.cjs +25 -11
- package/build/components/dataviews-filters/search-widget.cjs.map +2 -2
- package/build/components/dataviews-filters/toggle.cjs.map +1 -1
- package/build/components/dataviews-footer/index.cjs +1 -1
- package/build/components/dataviews-footer/index.cjs.map +1 -1
- package/build/components/dataviews-layouts/activity/activity-item.cjs +4 -4
- package/build/components/dataviews-layouts/activity/activity-item.cjs.map +1 -1
- package/build/components/dataviews-layouts/activity/index.cjs +1 -1
- package/build/components/dataviews-layouts/activity/index.cjs.map +1 -1
- package/build/components/dataviews-layouts/grid/composite-grid.cjs +27 -38
- package/build/components/dataviews-layouts/grid/composite-grid.cjs.map +2 -2
- package/build/components/dataviews-layouts/grid/index.cjs +2 -2
- package/build/components/dataviews-layouts/grid/index.cjs.map +1 -1
- package/build/components/dataviews-layouts/list/index.cjs +7 -8
- package/build/components/dataviews-layouts/list/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/picker-grid/index.cjs +5 -5
- package/build/components/dataviews-layouts/picker-grid/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/picker-table/index.cjs +1 -1
- package/build/components/dataviews-layouts/picker-table/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/table/column-primary.cjs +1 -1
- package/build/components/dataviews-layouts/table/column-primary.cjs.map +1 -1
- package/build/components/dataviews-layouts/table/index.cjs +1 -1
- package/build/components/dataviews-layouts/table/index.cjs.map +2 -2
- package/build/components/dataviews-layouts/utils/item-click-wrapper.cjs.map +2 -2
- package/build/components/dataviews-pagination/index.cjs +3 -3
- package/build/components/dataviews-pagination/index.cjs.map +2 -2
- package/build/components/dataviews-picker-footer/index.cjs +3 -3
- package/build/components/dataviews-picker-footer/index.cjs.map +2 -2
- package/build/components/dataviews-view-config/index.cjs +74 -57
- package/build/components/dataviews-view-config/index.cjs.map +3 -3
- package/build/components/dataviews-view-config/properties-section.cjs +1 -1
- package/build/components/dataviews-view-config/properties-section.cjs.map +1 -1
- package/build/dataviews/index.cjs +7 -5
- package/build/dataviews/index.cjs.map +2 -2
- package/build/dataviews-picker/index.cjs +3 -3
- package/build/dataviews-picker/index.cjs.map +2 -2
- package/build/hooks/use-form-validity.cjs +61 -28
- package/build/hooks/use-form-validity.cjs.map +2 -2
- package/build/types/dataform.cjs.map +1 -1
- package/build/types/field-api.cjs.map +1 -1
- package/build-module/components/dataform-controls/adaptive-select.mjs +21 -0
- package/build-module/components/dataform-controls/adaptive-select.mjs.map +7 -0
- package/build-module/components/dataform-controls/array.mjs +2 -0
- package/build-module/components/dataform-controls/array.mjs.map +2 -2
- package/build-module/components/dataform-controls/checkbox.mjs +2 -0
- package/build-module/components/dataform-controls/checkbox.mjs.map +2 -2
- package/build-module/components/dataform-controls/color.mjs +26 -31
- package/build-module/components/dataform-controls/color.mjs.map +2 -2
- package/build-module/components/dataform-controls/date.mjs +23 -9
- package/build-module/components/dataform-controls/date.mjs.map +2 -2
- package/build-module/components/dataform-controls/datetime.mjs +11 -3
- package/build-module/components/dataform-controls/datetime.mjs.map +2 -2
- package/build-module/components/dataform-controls/email.mjs +2 -0
- package/build-module/components/dataform-controls/email.mjs.map +2 -2
- package/build-module/components/dataform-controls/index.mjs +3 -1
- package/build-module/components/dataform-controls/index.mjs.map +2 -2
- package/build-module/components/dataform-controls/password.mjs +2 -0
- package/build-module/components/dataform-controls/password.mjs.map +2 -2
- package/build-module/components/dataform-controls/radio.mjs +2 -0
- package/build-module/components/dataform-controls/radio.mjs.map +2 -2
- package/build-module/components/dataform-controls/select.mjs +2 -0
- package/build-module/components/dataform-controls/select.mjs.map +2 -2
- package/build-module/components/dataform-controls/telephone.mjs +2 -0
- package/build-module/components/dataform-controls/telephone.mjs.map +2 -2
- package/build-module/components/dataform-controls/text.mjs +2 -0
- package/build-module/components/dataform-controls/text.mjs.map +2 -2
- package/build-module/components/dataform-controls/textarea.mjs +2 -0
- package/build-module/components/dataform-controls/textarea.mjs.map +2 -2
- package/build-module/components/dataform-controls/toggle-group.mjs +2 -0
- package/build-module/components/dataform-controls/toggle-group.mjs.map +2 -2
- package/build-module/components/dataform-controls/toggle.mjs +2 -0
- package/build-module/components/dataform-controls/toggle.mjs.map +2 -2
- package/build-module/components/dataform-controls/url.mjs +2 -0
- package/build-module/components/dataform-controls/url.mjs.map +2 -2
- package/build-module/components/dataform-controls/utils/relative-date-control.mjs +1 -1
- package/build-module/components/dataform-controls/utils/relative-date-control.mjs.map +1 -1
- package/build-module/components/dataform-controls/utils/validated-input.mjs +2 -0
- package/build-module/components/dataform-controls/utils/validated-input.mjs.map +2 -2
- package/build-module/components/dataform-controls/utils/validated-number.mjs +2 -0
- package/build-module/components/dataform-controls/utils/validated-number.mjs.map +2 -2
- package/build-module/components/dataform-layouts/card/index.mjs +2 -0
- package/build-module/components/dataform-layouts/card/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/data-form-layout.mjs +12 -3
- package/build-module/components/dataform-layouts/data-form-layout.mjs.map +2 -2
- package/build-module/components/dataform-layouts/details/index.mjs +1 -1
- package/build-module/components/dataform-layouts/details/index.mjs.map +1 -1
- package/build-module/components/dataform-layouts/index.mjs +5 -5
- package/build-module/components/dataform-layouts/index.mjs.map +1 -1
- package/build-module/components/dataform-layouts/normalize-form.mjs +2 -1
- package/build-module/components/dataform-layouts/normalize-form.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/dropdown.mjs +83 -68
- package/build-module/components/dataform-layouts/panel/dropdown.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/index.mjs +14 -178
- package/build-module/components/dataform-layouts/panel/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/modal.mjs +15 -11
- package/build-module/components/dataform-layouts/panel/modal.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/summary-button.mjs +117 -58
- package/build-module/components/dataform-layouts/panel/summary-button.mjs.map +2 -2
- package/build-module/components/dataform-layouts/panel/utils/get-first-validation-error.mjs +38 -0
- package/build-module/components/dataform-layouts/panel/utils/get-first-validation-error.mjs.map +7 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-classname.mjs +14 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-classname.mjs.map +7 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs +15 -0
- package/build-module/components/dataform-layouts/panel/utils/get-label-content.mjs.map +7 -0
- package/build-module/components/dataform-layouts/panel/utils/use-field-from-form-field.mjs +46 -0
- package/build-module/components/dataform-layouts/panel/utils/use-field-from-form-field.mjs.map +7 -0
- package/build-module/components/dataform-layouts/regular/index.mjs +6 -3
- package/build-module/components/dataform-layouts/regular/index.mjs.map +2 -2
- package/build-module/components/dataform-layouts/row/index.mjs +5 -2
- package/build-module/components/dataform-layouts/row/index.mjs.map +2 -2
- package/build-module/components/dataviews-bulk-actions/index.mjs +4 -4
- package/build-module/components/dataviews-bulk-actions/index.mjs.map +2 -2
- package/build-module/components/dataviews-context/index.mjs.map +2 -2
- package/build-module/components/dataviews-filters/filter.mjs +1 -1
- package/build-module/components/dataviews-filters/filter.mjs.map +1 -1
- package/build-module/components/dataviews-filters/filters.mjs +1 -1
- package/build-module/components/dataviews-filters/filters.mjs.map +1 -1
- package/build-module/components/dataviews-filters/search-widget.mjs +25 -11
- package/build-module/components/dataviews-filters/search-widget.mjs.map +2 -2
- package/build-module/components/dataviews-filters/toggle.mjs.map +1 -1
- package/build-module/components/dataviews-footer/index.mjs +1 -1
- package/build-module/components/dataviews-footer/index.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/activity/activity-item.mjs +4 -4
- package/build-module/components/dataviews-layouts/activity/activity-item.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/activity/index.mjs +1 -1
- package/build-module/components/dataviews-layouts/activity/index.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs +27 -38
- package/build-module/components/dataviews-layouts/grid/composite-grid.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/grid/index.mjs +2 -2
- package/build-module/components/dataviews-layouts/grid/index.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/list/index.mjs +7 -8
- package/build-module/components/dataviews-layouts/list/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/picker-grid/index.mjs +5 -5
- package/build-module/components/dataviews-layouts/picker-grid/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/picker-table/index.mjs +1 -1
- package/build-module/components/dataviews-layouts/picker-table/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/table/column-primary.mjs +1 -1
- package/build-module/components/dataviews-layouts/table/column-primary.mjs.map +1 -1
- package/build-module/components/dataviews-layouts/table/index.mjs +1 -1
- package/build-module/components/dataviews-layouts/table/index.mjs.map +2 -2
- package/build-module/components/dataviews-layouts/utils/item-click-wrapper.mjs.map +2 -2
- package/build-module/components/dataviews-pagination/index.mjs +3 -3
- package/build-module/components/dataviews-pagination/index.mjs.map +2 -2
- package/build-module/components/dataviews-picker-footer/index.mjs +3 -3
- package/build-module/components/dataviews-picker-footer/index.mjs.map +2 -2
- package/build-module/components/dataviews-view-config/index.mjs +74 -59
- package/build-module/components/dataviews-view-config/index.mjs.map +2 -2
- package/build-module/components/dataviews-view-config/properties-section.mjs +1 -1
- package/build-module/components/dataviews-view-config/properties-section.mjs.map +1 -1
- package/build-module/dataviews/index.mjs +7 -5
- package/build-module/dataviews/index.mjs.map +2 -2
- package/build-module/dataviews-picker/index.mjs +3 -3
- package/build-module/dataviews-picker/index.mjs.map +2 -2
- package/build-module/hooks/use-form-validity.mjs +61 -28
- package/build-module/hooks/use-form-validity.mjs.map +2 -2
- package/build-style/style-rtl.css +144 -217
- package/build-style/style.css +144 -217
- package/build-types/components/dataform-controls/adaptive-select.d.ts +6 -0
- package/build-types/components/dataform-controls/adaptive-select.d.ts.map +1 -0
- package/build-types/components/dataform-controls/array.d.ts +1 -1
- package/build-types/components/dataform-controls/array.d.ts.map +1 -1
- package/build-types/components/dataform-controls/checkbox.d.ts +1 -1
- package/build-types/components/dataform-controls/checkbox.d.ts.map +1 -1
- package/build-types/components/dataform-controls/color.d.ts +1 -1
- package/build-types/components/dataform-controls/color.d.ts.map +1 -1
- package/build-types/components/dataform-controls/date.d.ts +1 -1
- package/build-types/components/dataform-controls/date.d.ts.map +1 -1
- package/build-types/components/dataform-controls/datetime.d.ts +1 -1
- package/build-types/components/dataform-controls/datetime.d.ts.map +1 -1
- package/build-types/components/dataform-controls/email.d.ts +1 -1
- package/build-types/components/dataform-controls/email.d.ts.map +1 -1
- package/build-types/components/dataform-controls/index.d.ts.map +1 -1
- package/build-types/components/dataform-controls/password.d.ts +1 -1
- package/build-types/components/dataform-controls/password.d.ts.map +1 -1
- package/build-types/components/dataform-controls/radio.d.ts +1 -1
- package/build-types/components/dataform-controls/radio.d.ts.map +1 -1
- package/build-types/components/dataform-controls/select.d.ts +1 -1
- package/build-types/components/dataform-controls/select.d.ts.map +1 -1
- package/build-types/components/dataform-controls/telephone.d.ts +1 -1
- package/build-types/components/dataform-controls/telephone.d.ts.map +1 -1
- package/build-types/components/dataform-controls/text.d.ts +1 -1
- package/build-types/components/dataform-controls/text.d.ts.map +1 -1
- package/build-types/components/dataform-controls/textarea.d.ts +1 -1
- package/build-types/components/dataform-controls/textarea.d.ts.map +1 -1
- package/build-types/components/dataform-controls/toggle-group.d.ts +1 -1
- package/build-types/components/dataform-controls/toggle-group.d.ts.map +1 -1
- package/build-types/components/dataform-controls/toggle.d.ts +1 -1
- package/build-types/components/dataform-controls/toggle.d.ts.map +1 -1
- package/build-types/components/dataform-controls/url.d.ts +1 -1
- package/build-types/components/dataform-controls/url.d.ts.map +1 -1
- package/build-types/components/dataform-controls/utils/validated-input.d.ts +1 -1
- package/build-types/components/dataform-controls/utils/validated-input.d.ts.map +1 -1
- package/build-types/components/dataform-controls/utils/validated-number.d.ts +1 -1
- package/build-types/components/dataform-controls/utils/validated-number.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/card/index.d.ts +1 -1
- package/build-types/components/dataform-layouts/card/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/data-form-layout.d.ts +2 -1
- package/build-types/components/dataform-layouts/data-form-layout.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/normalize-form.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/dropdown.d.ts +2 -13
- package/build-types/components/dataform-layouts/panel/dropdown.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/index.d.ts +1 -1
- package/build-types/components/dataform-layouts/panel/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/modal.d.ts +2 -11
- package/build-types/components/dataform-layouts/panel/modal.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/summary-button.d.ts +6 -5
- package/build-types/components/dataform-layouts/panel/summary-button.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/panel/utils/get-first-validation-error.d.ts +4 -0
- package/build-types/components/dataform-layouts/panel/utils/get-first-validation-error.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-classname.d.ts +4 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-classname.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-content.d.ts +3 -0
- package/build-types/components/dataform-layouts/panel/utils/get-label-content.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/panel/utils/use-field-from-form-field.d.ts +23 -0
- package/build-types/components/dataform-layouts/panel/utils/use-field-from-form-field.d.ts.map +1 -0
- package/build-types/components/dataform-layouts/regular/index.d.ts +1 -1
- package/build-types/components/dataform-layouts/regular/index.d.ts.map +1 -1
- package/build-types/components/dataform-layouts/row/index.d.ts +1 -1
- package/build-types/components/dataform-layouts/row/index.d.ts.map +1 -1
- package/build-types/components/dataviews-context/index.d.ts +1 -0
- package/build-types/components/dataviews-context/index.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/filter.d.ts +1 -1
- package/build-types/components/dataviews-filters/filter.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/search-widget.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/list/index.d.ts.map +1 -1
- package/build-types/components/dataviews-layouts/utils/item-click-wrapper.d.ts +1 -0
- package/build-types/components/dataviews-layouts/utils/item-click-wrapper.d.ts.map +1 -1
- package/build-types/components/dataviews-view-config/index.d.ts.map +1 -1
- package/build-types/dataform/stories/index.story.d.ts +9 -1
- package/build-types/dataform/stories/index.story.d.ts.map +1 -1
- package/build-types/dataform/stories/layout-panel.d.ts +3 -1
- package/build-types/dataform/stories/layout-panel.d.ts.map +1 -1
- package/build-types/dataviews/index.d.ts +2 -1
- package/build-types/dataviews/index.d.ts.map +1 -1
- package/build-types/dataviews/stories/fixtures.d.ts +1 -0
- package/build-types/dataviews/stories/fixtures.d.ts.map +1 -1
- package/build-types/dataviews/stories/index.story.d.ts +14 -2
- package/build-types/dataviews/stories/index.story.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-activity.d.ts +2 -1
- package/build-types/dataviews/stories/layout-activity.d.ts.map +1 -1
- package/build-types/dataviews/stories/layout-list.d.ts +2 -1
- package/build-types/dataviews/stories/layout-list.d.ts.map +1 -1
- package/build-types/field-types/stories/index.story.d.ts +42 -16
- package/build-types/field-types/stories/index.story.d.ts.map +1 -1
- package/build-types/hooks/use-form-validity.d.ts.map +1 -1
- package/build-types/types/dataform.d.ts +4 -0
- package/build-types/types/dataform.d.ts.map +1 -1
- package/build-types/types/field-api.d.ts +4 -0
- package/build-types/types/field-api.d.ts.map +1 -1
- package/build-wp/index.js +2689 -2167
- package/package.json +21 -21
- package/src/components/dataform-controls/adaptive-select.tsx +23 -0
- package/src/components/dataform-controls/array.tsx +2 -0
- package/src/components/dataform-controls/checkbox.tsx +2 -0
- package/src/components/dataform-controls/color.tsx +31 -36
- package/src/components/dataform-controls/date.tsx +24 -16
- package/src/components/dataform-controls/datetime.tsx +16 -6
- package/src/components/dataform-controls/email.tsx +2 -0
- package/src/components/dataform-controls/index.tsx +3 -1
- package/src/components/dataform-controls/password.tsx +2 -0
- package/src/components/dataform-controls/radio.tsx +2 -0
- package/src/components/dataform-controls/select.tsx +2 -0
- package/src/components/dataform-controls/style.scss +4 -0
- package/src/components/dataform-controls/telephone.tsx +2 -0
- package/src/components/dataform-controls/text.tsx +2 -0
- package/src/components/dataform-controls/textarea.tsx +2 -0
- package/src/components/dataform-controls/toggle-group.tsx +2 -0
- package/src/components/dataform-controls/toggle.tsx +2 -0
- package/src/components/dataform-controls/url.tsx +2 -0
- package/src/components/dataform-controls/utils/relative-date-control.tsx +1 -1
- package/src/components/dataform-controls/utils/validated-input.tsx +2 -0
- package/src/components/dataform-controls/utils/validated-number.tsx +2 -0
- package/src/components/dataform-layouts/card/index.tsx +2 -0
- package/src/components/dataform-layouts/data-form-layout.tsx +18 -4
- package/src/components/dataform-layouts/details/index.tsx +1 -1
- package/src/components/dataform-layouts/index.tsx +5 -5
- package/src/components/dataform-layouts/normalize-form.ts +1 -0
- package/src/components/dataform-layouts/panel/dropdown.tsx +97 -96
- package/src/components/dataform-layouts/panel/index.tsx +10 -245
- package/src/components/dataform-layouts/panel/modal.tsx +24 -22
- package/src/components/dataform-layouts/panel/style.scss +109 -27
- package/src/components/dataform-layouts/panel/summary-button.tsx +140 -62
- package/src/components/dataform-layouts/panel/utils/get-first-validation-error.ts +47 -0
- package/src/components/dataform-layouts/panel/utils/get-label-classname.ts +18 -0
- package/src/components/dataform-layouts/panel/utils/get-label-content.tsx +26 -0
- package/src/components/dataform-layouts/panel/utils/use-field-from-form-field.ts +78 -0
- package/src/components/dataform-layouts/regular/index.tsx +8 -3
- package/src/components/dataform-layouts/regular/style.scss +10 -0
- package/src/components/dataform-layouts/row/index.tsx +5 -2
- package/src/components/dataform-layouts/test/normalize-form.ts +5 -0
- package/src/components/dataviews-bulk-actions/index.tsx +4 -4
- package/src/components/dataviews-context/index.ts +1 -0
- package/src/components/dataviews-filters/filter.tsx +2 -2
- package/src/components/dataviews-filters/filters.tsx +1 -1
- package/src/components/dataviews-filters/search-widget.tsx +10 -2
- package/src/components/dataviews-filters/style.scss +8 -0
- package/src/components/dataviews-filters/toggle.tsx +1 -1
- package/src/components/dataviews-footer/index.tsx +1 -1
- package/src/components/dataviews-layouts/activity/activity-item.tsx +4 -4
- package/src/components/dataviews-layouts/activity/index.tsx +1 -1
- package/src/components/dataviews-layouts/grid/composite-grid.tsx +35 -35
- package/src/components/dataviews-layouts/grid/index.tsx +2 -2
- package/src/components/dataviews-layouts/grid/style.scss +15 -1
- package/src/components/dataviews-layouts/list/index.tsx +7 -8
- package/src/components/dataviews-layouts/list/style.scss +1 -0
- package/src/components/dataviews-layouts/picker-grid/index.tsx +5 -5
- package/src/components/dataviews-layouts/picker-table/index.tsx +1 -1
- package/src/components/dataviews-layouts/table/column-primary.tsx +1 -1
- package/src/components/dataviews-layouts/table/index.tsx +1 -1
- package/src/components/dataviews-layouts/utils/item-click-wrapper.tsx +1 -0
- package/src/components/dataviews-pagination/index.tsx +3 -3
- package/src/components/dataviews-picker-footer/index.tsx +3 -3
- package/src/components/dataviews-view-config/index.tsx +61 -50
- package/src/components/dataviews-view-config/properties-section.tsx +1 -1
- package/src/components/dataviews-view-config/style.scss +21 -0
- package/src/dataform/stories/content.story.tsx +5 -5
- package/src/dataform/stories/index.story.tsx +6 -1
- package/src/dataform/stories/layout-panel.tsx +19 -2
- package/src/dataform/stories/validation.tsx +2 -2
- package/src/dataform/test/dataform.tsx +2 -2
- package/src/dataviews/index.tsx +7 -4
- package/src/dataviews/stories/empty.tsx +1 -1
- package/src/dataviews/stories/fixtures.tsx +93 -4
- package/src/dataviews/stories/free-composition.tsx +6 -6
- package/src/dataviews/stories/index.story.tsx +12 -0
- package/src/dataviews/stories/layout-activity.tsx +6 -3
- package/src/dataviews/stories/layout-list.tsx +3 -0
- package/src/dataviews-picker/index.tsx +4 -4
- package/src/dataviews-picker/stories/fixtures.tsx +2 -2
- package/src/dataviews-picker/stories/index.story.tsx +1 -1
- package/src/field-types/stories/index.story.tsx +99 -5
- package/src/hooks/test/use-form-validity.ts +303 -178
- package/src/hooks/use-form-validity.ts +85 -36
- package/src/style.scss +0 -2
- package/src/types/dataform.ts +5 -0
- package/src/types/field-api.ts +4 -0
|
@@ -51,13 +51,13 @@ export function DataViewsPagination() {
|
|
|
51
51
|
className="dataviews-pagination"
|
|
52
52
|
justify="end"
|
|
53
53
|
align="center"
|
|
54
|
-
gap="
|
|
54
|
+
gap="xl"
|
|
55
55
|
>
|
|
56
56
|
<Stack
|
|
57
57
|
direction="row"
|
|
58
58
|
justify="flex-start"
|
|
59
59
|
align="center"
|
|
60
|
-
gap="
|
|
60
|
+
gap="xs"
|
|
61
61
|
className="dataviews-pagination__page-select"
|
|
62
62
|
>
|
|
63
63
|
{ createInterpolateElement(
|
|
@@ -90,7 +90,7 @@ export function DataViewsPagination() {
|
|
|
90
90
|
}
|
|
91
91
|
) }
|
|
92
92
|
</Stack>
|
|
93
|
-
<Stack direction="row" gap="
|
|
93
|
+
<Stack direction="row" gap="xs" align="center">
|
|
94
94
|
<Button
|
|
95
95
|
onClick={ () =>
|
|
96
96
|
onChangeView( {
|
|
@@ -88,7 +88,7 @@ function ActionButtons< Item >( {
|
|
|
88
88
|
);
|
|
89
89
|
|
|
90
90
|
return (
|
|
91
|
-
<Stack direction="row" gap="
|
|
91
|
+
<Stack direction="row" gap="xs">
|
|
92
92
|
{ actions.map( ( action ) => {
|
|
93
93
|
// Only support actions with callbacks for DataViewsPicker.
|
|
94
94
|
// This is because many use cases of the picker will be already within modals.
|
|
@@ -158,12 +158,12 @@ export function DataViewsPickerFooter() {
|
|
|
158
158
|
justify="space-between"
|
|
159
159
|
align="center"
|
|
160
160
|
className="dataviews-footer"
|
|
161
|
-
gap="
|
|
161
|
+
gap="sm"
|
|
162
162
|
>
|
|
163
163
|
<Stack
|
|
164
164
|
direction="row"
|
|
165
165
|
className="dataviews-picker-footer__bulk-selection"
|
|
166
|
-
gap="
|
|
166
|
+
gap="md"
|
|
167
167
|
align="center"
|
|
168
168
|
>
|
|
169
169
|
{ isMultiselect && (
|
|
@@ -14,9 +14,7 @@ import {
|
|
|
14
14
|
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
15
15
|
__experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
|
|
16
16
|
SelectControl,
|
|
17
|
-
__experimentalGrid as Grid,
|
|
18
17
|
__experimentalHeading as Heading,
|
|
19
|
-
__experimentalText as Text,
|
|
20
18
|
privateApis as componentsPrivateApis,
|
|
21
19
|
} from '@wordpress/components';
|
|
22
20
|
import { __, _x } from '@wordpress/i18n';
|
|
@@ -247,46 +245,36 @@ function ItemsPerPageControl() {
|
|
|
247
245
|
);
|
|
248
246
|
}
|
|
249
247
|
|
|
250
|
-
function
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
248
|
+
function ResetViewButton() {
|
|
249
|
+
const { onReset } = useContext( DataViewsContext );
|
|
250
|
+
|
|
251
|
+
// Don't render if no persistence support (onReset is undefined)
|
|
252
|
+
if ( onReset === undefined ) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const isDisabled = onReset === false;
|
|
257
|
+
|
|
259
258
|
return (
|
|
260
|
-
<
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
</Text>
|
|
275
|
-
) }
|
|
276
|
-
</div>
|
|
277
|
-
<Grid
|
|
278
|
-
columns={ 8 }
|
|
279
|
-
gap={ 4 }
|
|
280
|
-
className="dataviews-settings-section__content"
|
|
281
|
-
>
|
|
282
|
-
{ children }
|
|
283
|
-
</Grid>
|
|
284
|
-
</Grid>
|
|
259
|
+
<Button
|
|
260
|
+
variant="tertiary"
|
|
261
|
+
size="compact"
|
|
262
|
+
disabled={ isDisabled }
|
|
263
|
+
accessibleWhenDisabled
|
|
264
|
+
className="dataviews-view-config__reset-button"
|
|
265
|
+
onClick={ () => {
|
|
266
|
+
if ( typeof onReset === 'function' ) {
|
|
267
|
+
onReset();
|
|
268
|
+
}
|
|
269
|
+
} }
|
|
270
|
+
>
|
|
271
|
+
{ __( 'Reset view' ) }
|
|
272
|
+
</Button>
|
|
285
273
|
);
|
|
286
274
|
}
|
|
287
275
|
|
|
288
276
|
export function DataviewsViewConfigDropdown() {
|
|
289
|
-
const { view } = useContext( DataViewsContext );
|
|
277
|
+
const { view, onReset } = useContext( DataViewsContext );
|
|
290
278
|
const popoverId = useInstanceId(
|
|
291
279
|
_DataViewsViewConfig,
|
|
292
280
|
'dataviews-view-config-dropdown'
|
|
@@ -294,6 +282,7 @@ export function DataviewsViewConfigDropdown() {
|
|
|
294
282
|
const activeLayout = VIEW_LAYOUTS.find(
|
|
295
283
|
( layout ) => layout.type === view.type
|
|
296
284
|
);
|
|
285
|
+
const isModified = typeof onReset === 'function';
|
|
297
286
|
return (
|
|
298
287
|
<Dropdown
|
|
299
288
|
expandOnMobile
|
|
@@ -303,14 +292,22 @@ export function DataviewsViewConfigDropdown() {
|
|
|
303
292
|
} }
|
|
304
293
|
renderToggle={ ( { onToggle, isOpen } ) => {
|
|
305
294
|
return (
|
|
306
|
-
<
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
295
|
+
<div className="dataviews-view-config__toggle-wrapper">
|
|
296
|
+
<Button
|
|
297
|
+
size="compact"
|
|
298
|
+
icon={ cog }
|
|
299
|
+
label={ _x(
|
|
300
|
+
'View options',
|
|
301
|
+
'View is used as a noun'
|
|
302
|
+
) }
|
|
303
|
+
onClick={ onToggle }
|
|
304
|
+
aria-expanded={ isOpen ? 'true' : 'false' }
|
|
305
|
+
aria-controls={ popoverId }
|
|
306
|
+
/>
|
|
307
|
+
{ isModified && (
|
|
308
|
+
<span className="dataviews-view-config__modified-indicator" />
|
|
309
|
+
) }
|
|
310
|
+
</div>
|
|
314
311
|
);
|
|
315
312
|
} }
|
|
316
313
|
renderContent={ () => (
|
|
@@ -321,13 +318,27 @@ export function DataviewsViewConfigDropdown() {
|
|
|
321
318
|
<Stack
|
|
322
319
|
direction="column"
|
|
323
320
|
className="dataviews-view-config"
|
|
324
|
-
gap="
|
|
321
|
+
gap="xl"
|
|
325
322
|
>
|
|
326
|
-
<
|
|
323
|
+
<Stack
|
|
324
|
+
direction="row"
|
|
325
|
+
justify="space-between"
|
|
326
|
+
align="center"
|
|
327
|
+
className="dataviews-view-config__header"
|
|
328
|
+
>
|
|
329
|
+
<Heading
|
|
330
|
+
level={ 2 }
|
|
331
|
+
className="dataviews-settings-section__title"
|
|
332
|
+
>
|
|
333
|
+
{ __( 'Appearance' ) }
|
|
334
|
+
</Heading>
|
|
335
|
+
<ResetViewButton />
|
|
336
|
+
</Stack>
|
|
337
|
+
<Stack direction="column" gap="lg">
|
|
327
338
|
<Stack
|
|
328
339
|
direction="row"
|
|
329
|
-
gap="
|
|
330
|
-
className="
|
|
340
|
+
gap="sm"
|
|
341
|
+
className="dataviews-view-config__sort-controls"
|
|
331
342
|
>
|
|
332
343
|
<SortFieldControl />
|
|
333
344
|
<SortDirectionControl />
|
|
@@ -338,7 +349,7 @@ export function DataviewsViewConfigDropdown() {
|
|
|
338
349
|
<InfiniteScrollToggle />
|
|
339
350
|
<ItemsPerPageControl />
|
|
340
351
|
<PropertiesSection />
|
|
341
|
-
</
|
|
352
|
+
</Stack>
|
|
342
353
|
</Stack>
|
|
343
354
|
</DropdownContentWrapper>
|
|
344
355
|
) }
|
|
@@ -30,7 +30,7 @@ function FieldItem( {
|
|
|
30
30
|
} ) {
|
|
31
31
|
return (
|
|
32
32
|
<Item onClick={ field.enableHiding ? onToggleVisibility : undefined }>
|
|
33
|
-
<Stack direction="row" gap="
|
|
33
|
+
<Stack direction="row" gap="sm" justify="flex-start" align="center">
|
|
34
34
|
<div style={ { height: 24, width: 24 } }>
|
|
35
35
|
{ isVisible && <Icon icon={ check } /> }
|
|
36
36
|
</div>
|
|
@@ -59,6 +59,27 @@
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
.dataviews-view-config__sort-controls > * {
|
|
63
|
+
flex: 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
62
66
|
.dataviews-view-config__label {
|
|
63
67
|
text-wrap: nowrap;
|
|
64
68
|
}
|
|
69
|
+
|
|
70
|
+
.dataviews-view-config__toggle-wrapper {
|
|
71
|
+
position: relative;
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.dataviews-view-config__modified-indicator {
|
|
76
|
+
position: absolute;
|
|
77
|
+
top: $grid-unit-05;
|
|
78
|
+
right: $grid-unit-05;
|
|
79
|
+
width: $grid-unit-05;
|
|
80
|
+
height: $grid-unit-05;
|
|
81
|
+
background: var(--wp-admin-theme-color, #3858e9);
|
|
82
|
+
border-radius: 50%;
|
|
83
|
+
pointer-events: none;
|
|
84
|
+
}
|
|
85
|
+
|
|
@@ -68,7 +68,7 @@ export const Labels: Story = {
|
|
|
68
68
|
);
|
|
69
69
|
|
|
70
70
|
return (
|
|
71
|
-
<Stack direction="column" gap="
|
|
71
|
+
<Stack direction="column" gap="lg">
|
|
72
72
|
<DataForm< SampleData >
|
|
73
73
|
data={ data }
|
|
74
74
|
fields={ fields }
|
|
@@ -135,7 +135,7 @@ export const HelpText: Story = {
|
|
|
135
135
|
);
|
|
136
136
|
|
|
137
137
|
return (
|
|
138
|
-
<Stack direction="column" gap="
|
|
138
|
+
<Stack direction="column" gap="lg">
|
|
139
139
|
<DataForm< HelpTextData >
|
|
140
140
|
data={ data }
|
|
141
141
|
fields={ fields }
|
|
@@ -240,7 +240,7 @@ export const ValidationMessages: Story = {
|
|
|
240
240
|
|
|
241
241
|
return (
|
|
242
242
|
<div ref={ containerRef }>
|
|
243
|
-
<Stack direction="column" gap="
|
|
243
|
+
<Stack direction="column" gap="xl">
|
|
244
244
|
<DataForm< ValidationMessagesData >
|
|
245
245
|
data={ data }
|
|
246
246
|
fields={ fields }
|
|
@@ -314,7 +314,7 @@ export const HighLevelHelpText: Story = {
|
|
|
314
314
|
);
|
|
315
315
|
|
|
316
316
|
return (
|
|
317
|
-
<Stack direction="column" gap="
|
|
317
|
+
<Stack direction="column" gap="lg">
|
|
318
318
|
<DataForm< HighLevelHelpTextData >
|
|
319
319
|
data={ data }
|
|
320
320
|
fields={ fields }
|
|
@@ -375,7 +375,7 @@ export const Placeholders: Story = {
|
|
|
375
375
|
);
|
|
376
376
|
|
|
377
377
|
return (
|
|
378
|
-
<Stack direction="column" gap="
|
|
378
|
+
<Stack direction="column" gap="lg">
|
|
379
379
|
<DataForm< PlaceholdersData >
|
|
380
380
|
data={ data }
|
|
381
381
|
fields={ fields }
|
|
@@ -62,6 +62,11 @@ export const LayoutPanel = {
|
|
|
62
62
|
description: 'Chooses how to open the panel.',
|
|
63
63
|
options: [ 'default', 'dropdown', 'modal' ],
|
|
64
64
|
},
|
|
65
|
+
editVisibility: {
|
|
66
|
+
control: { type: 'select' },
|
|
67
|
+
description: 'Chooses when the edit icon is visible.',
|
|
68
|
+
options: [ 'default', 'always', 'on-hover' ],
|
|
69
|
+
},
|
|
65
70
|
},
|
|
66
71
|
};
|
|
67
72
|
|
|
@@ -112,7 +117,7 @@ export const Validation = {
|
|
|
112
117
|
required: {
|
|
113
118
|
control: { type: 'boolean' },
|
|
114
119
|
description:
|
|
115
|
-
'Whether or not the required validation rule is active.',
|
|
120
|
+
'Whether or not the required validation rule is active (only applies when fieldDistribution is allSame).',
|
|
116
121
|
},
|
|
117
122
|
elements: {
|
|
118
123
|
control: { type: 'select' },
|
|
@@ -7,7 +7,13 @@ import { useMemo, useState } from '@wordpress/element';
|
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
9
|
import DataForm from '../index';
|
|
10
|
-
import type {
|
|
10
|
+
import type {
|
|
11
|
+
Field,
|
|
12
|
+
Form,
|
|
13
|
+
Layout,
|
|
14
|
+
PanelLayout,
|
|
15
|
+
EditVisibility,
|
|
16
|
+
} from '../../types';
|
|
11
17
|
|
|
12
18
|
type SamplePost = {
|
|
13
19
|
title: string;
|
|
@@ -261,10 +267,12 @@ const getPanelLayoutFromStoryArgs = ( {
|
|
|
261
267
|
summary,
|
|
262
268
|
labelPosition,
|
|
263
269
|
openAs,
|
|
270
|
+
editVisibility,
|
|
264
271
|
}: {
|
|
265
272
|
summary?: string[];
|
|
266
273
|
labelPosition?: 'default' | 'top' | 'side' | 'none';
|
|
267
274
|
openAs?: 'default' | 'dropdown' | 'modal';
|
|
275
|
+
editVisibility?: 'default' | EditVisibility;
|
|
268
276
|
} ): Layout | undefined => {
|
|
269
277
|
const panelLayout: PanelLayout = {
|
|
270
278
|
type: 'panel',
|
|
@@ -282,16 +290,22 @@ const getPanelLayoutFromStoryArgs = ( {
|
|
|
282
290
|
panelLayout.summary = summary;
|
|
283
291
|
}
|
|
284
292
|
|
|
293
|
+
if ( editVisibility !== 'default' ) {
|
|
294
|
+
panelLayout.editVisibility = editVisibility;
|
|
295
|
+
}
|
|
296
|
+
|
|
285
297
|
return panelLayout;
|
|
286
298
|
};
|
|
287
299
|
|
|
288
300
|
const LayoutPanelComponent = ( {
|
|
289
301
|
labelPosition,
|
|
290
302
|
openAs,
|
|
303
|
+
editVisibility,
|
|
291
304
|
}: {
|
|
292
305
|
type: 'default' | 'regular' | 'panel' | 'card';
|
|
293
306
|
labelPosition: 'default' | 'top' | 'side' | 'none';
|
|
294
307
|
openAs: 'default' | 'dropdown' | 'modal';
|
|
308
|
+
editVisibility: 'default' | EditVisibility;
|
|
295
309
|
} ) => {
|
|
296
310
|
const [ post, setPost ] = useState< SamplePost >( {
|
|
297
311
|
title: 'Hello, World!',
|
|
@@ -321,6 +335,7 @@ const LayoutPanelComponent = ( {
|
|
|
321
335
|
layout: getPanelLayoutFromStoryArgs( {
|
|
322
336
|
labelPosition,
|
|
323
337
|
openAs,
|
|
338
|
+
editVisibility,
|
|
324
339
|
} ),
|
|
325
340
|
fields: [
|
|
326
341
|
'title',
|
|
@@ -357,6 +372,7 @@ const LayoutPanelComponent = ( {
|
|
|
357
372
|
summary: [ 'origin', 'destination', 'flight_status' ],
|
|
358
373
|
labelPosition,
|
|
359
374
|
openAs,
|
|
375
|
+
editVisibility,
|
|
360
376
|
} ),
|
|
361
377
|
},
|
|
362
378
|
{
|
|
@@ -367,11 +383,12 @@ const LayoutPanelComponent = ( {
|
|
|
367
383
|
summary: [ 'author', 'seat' ],
|
|
368
384
|
labelPosition,
|
|
369
385
|
openAs,
|
|
386
|
+
editVisibility,
|
|
370
387
|
} ),
|
|
371
388
|
},
|
|
372
389
|
],
|
|
373
390
|
};
|
|
374
|
-
}, [ labelPosition, openAs ] );
|
|
391
|
+
}, [ labelPosition, openAs, editVisibility ] );
|
|
375
392
|
|
|
376
393
|
return (
|
|
377
394
|
<DataForm< SamplePost >
|
|
@@ -877,7 +877,7 @@ const ValidationComponent = ( {
|
|
|
877
877
|
},
|
|
878
878
|
},
|
|
879
879
|
];
|
|
880
|
-
}, [ elements, custom,
|
|
880
|
+
}, [ elements, custom, pattern, minMax, getElements, required ] );
|
|
881
881
|
|
|
882
882
|
const form = useMemo( () => {
|
|
883
883
|
if ( layout === 'regular' ) {
|
|
@@ -1018,7 +1018,7 @@ const ValidationComponent = ( {
|
|
|
1018
1018
|
|
|
1019
1019
|
return (
|
|
1020
1020
|
<form>
|
|
1021
|
-
<Stack direction="column" align="start" gap="
|
|
1021
|
+
<Stack direction="column" align="start" gap="3xl">
|
|
1022
1022
|
<DataForm< ValidatedItem >
|
|
1023
1023
|
data={ post }
|
|
1024
1024
|
fields={ _fields }
|
|
@@ -511,9 +511,9 @@ describe( 'DataForm component', () => {
|
|
|
511
511
|
/>
|
|
512
512
|
);
|
|
513
513
|
|
|
514
|
-
const
|
|
514
|
+
const titleButton = fieldsSelector.title.view();
|
|
515
515
|
const user = await userEvent.setup();
|
|
516
|
-
await user.click(
|
|
516
|
+
await user.click( titleButton );
|
|
517
517
|
const titleEditField = screen.getByText(
|
|
518
518
|
'This is the Title Field'
|
|
519
519
|
);
|
package/src/dataviews/index.tsx
CHANGED
|
@@ -66,6 +66,7 @@ type DataViewsProps< Item > = {
|
|
|
66
66
|
perPageSizes: number[];
|
|
67
67
|
};
|
|
68
68
|
empty?: ReactNode;
|
|
69
|
+
onReset?: ( () => void ) | false;
|
|
69
70
|
} & ( Item extends ItemWithId
|
|
70
71
|
? { getItemId?: ( item: Item ) => string }
|
|
71
72
|
: { getItemId: ( item: Item ) => string } );
|
|
@@ -95,18 +96,18 @@ function DefaultUI( {
|
|
|
95
96
|
align="top"
|
|
96
97
|
justify="space-between"
|
|
97
98
|
className="dataviews__view-actions"
|
|
98
|
-
gap="
|
|
99
|
+
gap="xs"
|
|
99
100
|
>
|
|
100
101
|
<Stack
|
|
101
102
|
direction="row"
|
|
102
103
|
justify="start"
|
|
103
|
-
gap="
|
|
104
|
+
gap="sm"
|
|
104
105
|
className="dataviews__search"
|
|
105
106
|
>
|
|
106
107
|
{ search && <DataViewsSearch label={ searchLabel } /> }
|
|
107
108
|
<FiltersToggle />
|
|
108
109
|
</Stack>
|
|
109
|
-
<Stack direction="row" gap="
|
|
110
|
+
<Stack direction="row" gap="xs" style={ { flexShrink: 0 } }>
|
|
110
111
|
<DataViewsViewConfig />
|
|
111
112
|
{ header }
|
|
112
113
|
</Stack>
|
|
@@ -140,9 +141,10 @@ function DataViews< Item >( {
|
|
|
140
141
|
children,
|
|
141
142
|
config = { perPageSizes: [ 10, 20, 50, 100 ] },
|
|
142
143
|
empty,
|
|
144
|
+
onReset,
|
|
143
145
|
}: DataViewsProps< Item > ) {
|
|
144
146
|
const { infiniteScrollHandler } = paginationInfo;
|
|
145
|
-
const containerRef = useRef< HTMLDivElement
|
|
147
|
+
const containerRef = useRef< HTMLDivElement >( null );
|
|
146
148
|
const [ containerWidth, setContainerWidth ] = useState( 0 );
|
|
147
149
|
const resizeObserverRef = useResizeObserver(
|
|
148
150
|
( resizeObserverEntries: any ) => {
|
|
@@ -267,6 +269,7 @@ function DataViews< Item >( {
|
|
|
267
269
|
config,
|
|
268
270
|
empty,
|
|
269
271
|
hasInfiniteScrollHandler: !! infiniteScrollHandler,
|
|
272
|
+
onReset,
|
|
270
273
|
} }
|
|
271
274
|
>
|
|
272
275
|
<div className="dataviews-wrapper" ref={ containerRef }>
|
|
@@ -39,7 +39,7 @@ const PlanetIllustration = () => (
|
|
|
39
39
|
</svg>
|
|
40
40
|
);
|
|
41
41
|
const CustomEmptyComponent = () => (
|
|
42
|
-
<Stack direction="column" align="center" justify="center" gap="
|
|
42
|
+
<Stack direction="column" align="center" justify="center" gap="md">
|
|
43
43
|
<PlanetIllustration />
|
|
44
44
|
<Text>No celestial bodies found</Text>
|
|
45
45
|
</Stack>
|