@wordpress/dataviews 4.22.0 → 5.0.1-next.719a03cbe.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 +39 -0
- package/README.md +146 -32
- package/build/components/dataviews/index.js +71 -37
- package/build/components/dataviews/index.js.map +1 -1
- package/build/components/dataviews-context/index.js +15 -1
- package/build/components/dataviews-context/index.js.map +1 -1
- package/build/components/dataviews-filters/{filter-summary.js → filter.js} +108 -17
- package/build/components/dataviews-filters/filter.js.map +1 -0
- package/build/components/dataviews-filters/index.js +21 -20
- package/build/components/dataviews-filters/index.js.map +1 -1
- package/build/components/dataviews-filters/input-widget.js +76 -0
- package/build/components/dataviews-filters/input-widget.js.map +1 -0
- package/build/components/dataviews-filters/search-widget.js +33 -39
- package/build/components/dataviews-filters/search-widget.js.map +1 -1
- package/build/components/dataviews-filters/utils.js +25 -0
- package/build/components/dataviews-filters/utils.js.map +1 -0
- package/build/components/dataviews-item-actions/index.js +1 -1
- package/build/components/dataviews-item-actions/index.js.map +1 -1
- package/build/components/dataviews-layout/index.js +7 -2
- package/build/components/dataviews-layout/index.js.map +1 -1
- package/build/components/dataviews-pagination/index.js +4 -3
- package/build/components/dataviews-pagination/index.js.map +1 -1
- package/build/components/dataviews-selection-checkbox/index.js.map +1 -1
- package/build/components/dataviews-view-config/index.js +10 -19
- package/build/components/dataviews-view-config/index.js.map +1 -1
- package/build/constants.js +83 -2
- package/build/constants.js.map +1 -1
- package/build/dataform-controls/boolean.js +42 -0
- package/build/dataform-controls/boolean.js.map +1 -0
- package/build/dataform-controls/checkbox.js +44 -0
- package/build/dataform-controls/checkbox.js.map +1 -0
- package/build/dataform-controls/datetime.js +96 -2
- package/build/dataform-controls/datetime.js.map +1 -1
- package/build/dataform-controls/email.js +48 -0
- package/build/dataform-controls/email.js.map +1 -0
- package/build/dataform-controls/index.js +9 -1
- package/build/dataform-controls/index.js.map +1 -1
- package/build/dataform-controls/integer.js +49 -1
- package/build/dataform-controls/integer.js.map +1 -1
- package/build/dataform-controls/select.js +1 -0
- package/build/dataform-controls/select.js.map +1 -1
- package/build/dataform-controls/text.js +3 -1
- package/build/dataform-controls/text.js.map +1 -1
- package/build/dataform-controls/toggle-group.js +52 -0
- package/build/dataform-controls/toggle-group.js.map +1 -0
- package/build/dataforms-layouts/data-form-layout.js +1 -1
- package/build/dataforms-layouts/data-form-layout.js.map +1 -1
- package/build/dataforms-layouts/panel/index.js +14 -5
- package/build/dataforms-layouts/panel/index.js.map +1 -1
- package/build/dataforms-layouts/regular/index.js +23 -4
- package/build/dataforms-layouts/regular/index.js.map +1 -1
- package/build/dataviews-layouts/grid/index.js +31 -25
- package/build/dataviews-layouts/grid/index.js.map +1 -1
- package/build/dataviews-layouts/list/index.js +11 -6
- package/build/dataviews-layouts/list/index.js.map +1 -1
- package/build/dataviews-layouts/table/column-header-menu.js +9 -7
- package/build/dataviews-layouts/table/column-header-menu.js.map +1 -1
- package/build/dataviews-layouts/table/column-primary.js +18 -13
- package/build/dataviews-layouts/table/column-primary.js.map +1 -1
- package/build/dataviews-layouts/table/index.js +46 -14
- package/build/dataviews-layouts/table/index.js.map +1 -1
- package/build/dataviews-layouts/table/use-is-horizontal-scroll-end.js +65 -0
- package/build/dataviews-layouts/table/use-is-horizontal-scroll-end.js.map +1 -0
- package/build/dataviews-layouts/utils/item-click-wrapper.js +77 -0
- package/build/dataviews-layouts/utils/item-click-wrapper.js.map +1 -0
- package/build/field-types/array.js +62 -0
- package/build/field-types/array.js.map +1 -0
- package/build/field-types/boolean.js +71 -0
- package/build/field-types/boolean.js.map +1 -0
- package/build/field-types/datetime.js +19 -1
- package/build/field-types/datetime.js.map +1 -1
- package/build/field-types/email.js +60 -0
- package/build/field-types/email.js.map +1 -0
- package/build/field-types/index.js +38 -1
- package/build/field-types/index.js.map +1 -1
- package/build/field-types/integer.js +23 -1
- package/build/field-types/integer.js.map +1 -1
- package/build/field-types/media.js +31 -0
- package/build/field-types/media.js.map +1 -0
- package/build/field-types/text.js +23 -1
- package/build/field-types/text.js.map +1 -1
- package/build/filter-and-sort-data-view.js +152 -1
- package/build/filter-and-sort-data-view.js.map +1 -1
- package/build/normalize-fields.js +72 -11
- package/build/normalize-fields.js.map +1 -1
- package/build/types.js.map +1 -1
- package/build/utils.js +11 -19
- package/build/utils.js.map +1 -1
- package/build-module/components/dataviews/index.js +74 -40
- package/build-module/components/dataviews/index.js.map +1 -1
- package/build-module/components/dataviews-context/index.js +16 -2
- package/build-module/components/dataviews-context/index.js.map +1 -1
- package/build-module/components/dataviews-filters/filter.js +309 -0
- package/build-module/components/dataviews-filters/filter.js.map +1 -0
- package/build-module/components/dataviews-filters/index.js +22 -21
- package/build-module/components/dataviews-filters/index.js.map +1 -1
- package/build-module/components/dataviews-filters/input-widget.js +69 -0
- package/build-module/components/dataviews-filters/input-widget.js.map +1 -0
- package/build-module/components/dataviews-filters/search-widget.js +31 -37
- package/build-module/components/dataviews-filters/search-widget.js.map +1 -1
- package/build-module/components/dataviews-filters/utils.js +18 -0
- package/build-module/components/dataviews-filters/utils.js.map +1 -0
- package/build-module/components/dataviews-item-actions/index.js +1 -1
- package/build-module/components/dataviews-item-actions/index.js.map +1 -1
- package/build-module/components/dataviews-layout/index.js +7 -2
- package/build-module/components/dataviews-layout/index.js.map +1 -1
- package/build-module/components/dataviews-pagination/index.js +4 -4
- package/build-module/components/dataviews-pagination/index.js.map +1 -1
- package/build-module/components/dataviews-selection-checkbox/index.js.map +1 -1
- package/build-module/components/dataviews-view-config/index.js +9 -20
- package/build-module/components/dataviews-view-config/index.js.map +1 -1
- package/build-module/constants.js +82 -1
- package/build-module/constants.js.map +1 -1
- package/build-module/dataform-controls/boolean.js +35 -0
- package/build-module/dataform-controls/boolean.js.map +1 -0
- package/build-module/dataform-controls/checkbox.js +37 -0
- package/build-module/dataform-controls/checkbox.js.map +1 -0
- package/build-module/dataform-controls/datetime.js +98 -3
- package/build-module/dataform-controls/datetime.js.map +1 -1
- package/build-module/dataform-controls/email.js +41 -0
- package/build-module/dataform-controls/email.js.map +1 -0
- package/build-module/dataform-controls/index.js +9 -1
- package/build-module/dataform-controls/index.js.map +1 -1
- package/build-module/dataform-controls/integer.js +51 -3
- package/build-module/dataform-controls/integer.js.map +1 -1
- package/build-module/dataform-controls/select.js +1 -0
- package/build-module/dataform-controls/select.js.map +1 -1
- package/build-module/dataform-controls/text.js +3 -1
- package/build-module/dataform-controls/text.js.map +1 -1
- package/build-module/dataform-controls/toggle-group.js +45 -0
- package/build-module/dataform-controls/toggle-group.js.map +1 -0
- package/build-module/dataforms-layouts/data-form-layout.js +1 -1
- package/build-module/dataforms-layouts/data-form-layout.js.map +1 -1
- package/build-module/dataforms-layouts/panel/index.js +14 -5
- package/build-module/dataforms-layouts/panel/index.js.map +1 -1
- package/build-module/dataforms-layouts/regular/index.js +23 -4
- package/build-module/dataforms-layouts/regular/index.js.map +1 -1
- package/build-module/dataviews-layouts/grid/index.js +31 -26
- package/build-module/dataviews-layouts/grid/index.js.map +1 -1
- package/build-module/dataviews-layouts/list/index.js +11 -6
- package/build-module/dataviews-layouts/list/index.js.map +1 -1
- package/build-module/dataviews-layouts/table/column-header-menu.js +9 -7
- package/build-module/dataviews-layouts/table/column-header-menu.js.map +1 -1
- package/build-module/dataviews-layouts/table/column-primary.js +18 -12
- package/build-module/dataviews-layouts/table/column-primary.js.map +1 -1
- package/build-module/dataviews-layouts/table/index.js +47 -16
- package/build-module/dataviews-layouts/table/index.js.map +1 -1
- package/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js +58 -0
- package/build-module/dataviews-layouts/table/use-is-horizontal-scroll-end.js.map +1 -0
- package/build-module/dataviews-layouts/utils/item-click-wrapper.js +71 -0
- package/build-module/dataviews-layouts/utils/item-click-wrapper.js.map +1 -0
- package/build-module/field-types/array.js +57 -0
- package/build-module/field-types/array.js.map +1 -0
- package/build-module/field-types/boolean.js +65 -0
- package/build-module/field-types/boolean.js.map +1 -0
- package/build-module/field-types/datetime.js +19 -1
- package/build-module/field-types/datetime.js.map +1 -1
- package/build-module/field-types/email.js +54 -0
- package/build-module/field-types/email.js.map +1 -0
- package/build-module/field-types/index.js +38 -1
- package/build-module/field-types/index.js.map +1 -1
- package/build-module/field-types/integer.js +23 -1
- package/build-module/field-types/integer.js.map +1 -1
- package/build-module/field-types/media.js +25 -0
- package/build-module/field-types/media.js.map +1 -0
- package/build-module/field-types/text.js +23 -1
- package/build-module/field-types/text.js.map +1 -1
- package/build-module/filter-and-sort-data-view.js +153 -2
- package/build-module/filter-and-sort-data-view.js.map +1 -1
- package/build-module/normalize-fields.js +72 -11
- package/build-module/normalize-fields.js.map +1 -1
- package/build-module/types.js.map +1 -1
- package/build-module/utils.js +10 -17
- package/build-module/utils.js.map +1 -1
- package/build-style/style-rtl.css +307 -13
- package/build-style/style.css +307 -13
- package/build-types/components/dataform/stories/index.story.d.ts.map +1 -1
- package/build-types/components/dataviews/index.d.ts +24 -3
- package/build-types/components/dataviews/index.d.ts.map +1 -1
- package/build-types/components/dataviews/stories/fixtures.d.ts +9 -1
- package/build-types/components/dataviews/stories/fixtures.d.ts.map +1 -1
- package/build-types/components/dataviews/stories/index.story.d.ts +22 -4
- package/build-types/components/dataviews/stories/index.story.d.ts.map +1 -1
- package/build-types/components/dataviews-context/index.d.ts +14 -1
- package/build-types/components/dataviews-context/index.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/filter.d.ts +15 -0
- package/build-types/components/dataviews-filters/filter.d.ts.map +1 -0
- package/build-types/components/dataviews-filters/index.d.ts +3 -8
- package/build-types/components/dataviews-filters/index.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/input-widget.d.ts +13 -0
- package/build-types/components/dataviews-filters/input-widget.d.ts.map +1 -0
- package/build-types/components/dataviews-filters/search-widget.d.ts +4 -5
- package/build-types/components/dataviews-filters/search-widget.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/utils.d.ts +6 -0
- package/build-types/components/dataviews-filters/utils.d.ts.map +1 -0
- package/build-types/components/dataviews-layout/index.d.ts +5 -1
- package/build-types/components/dataviews-layout/index.d.ts.map +1 -1
- package/build-types/components/dataviews-pagination/index.d.ts +1 -1
- package/build-types/components/dataviews-pagination/index.d.ts.map +1 -1
- package/build-types/components/dataviews-selection-checkbox/index.d.ts +2 -2
- package/build-types/components/dataviews-selection-checkbox/index.d.ts.map +1 -1
- package/build-types/components/dataviews-view-config/index.d.ts +3 -4
- package/build-types/components/dataviews-view-config/index.d.ts.map +1 -1
- package/build-types/components/stories/index.story.d.ts +59 -0
- package/build-types/components/stories/index.story.d.ts.map +1 -0
- package/build-types/constants.d.ts +20 -3
- package/build-types/constants.d.ts.map +1 -1
- package/build-types/dataform-controls/boolean.d.ts +6 -0
- package/build-types/dataform-controls/boolean.d.ts.map +1 -0
- package/build-types/dataform-controls/checkbox.d.ts +6 -0
- package/build-types/dataform-controls/checkbox.d.ts.map +1 -0
- package/build-types/dataform-controls/datetime.d.ts +1 -1
- package/build-types/dataform-controls/datetime.d.ts.map +1 -1
- package/build-types/dataform-controls/email.d.ts +6 -0
- package/build-types/dataform-controls/email.d.ts.map +1 -0
- package/build-types/dataform-controls/index.d.ts +1 -1
- package/build-types/dataform-controls/index.d.ts.map +1 -1
- package/build-types/dataform-controls/integer.d.ts +1 -4
- package/build-types/dataform-controls/integer.d.ts.map +1 -1
- package/build-types/dataform-controls/select.d.ts.map +1 -1
- package/build-types/dataform-controls/text.d.ts.map +1 -1
- package/build-types/dataform-controls/toggle-group.d.ts +6 -0
- package/build-types/dataform-controls/toggle-group.d.ts.map +1 -0
- package/build-types/dataforms-layouts/panel/index.d.ts.map +1 -1
- package/build-types/dataforms-layouts/regular/index.d.ts.map +1 -1
- package/build-types/dataviews-layouts/grid/index.d.ts +2 -1
- package/build-types/dataviews-layouts/grid/index.d.ts.map +1 -1
- package/build-types/dataviews-layouts/index.d.ts +3 -3
- package/build-types/dataviews-layouts/list/index.d.ts.map +1 -1
- package/build-types/dataviews-layouts/table/column-header-menu.d.ts.map +1 -1
- package/build-types/dataviews-layouts/table/column-primary.d.ts +8 -1
- package/build-types/dataviews-layouts/table/column-primary.d.ts.map +1 -1
- package/build-types/dataviews-layouts/table/index.d.ts +1 -1
- package/build-types/dataviews-layouts/table/index.d.ts.map +1 -1
- package/build-types/dataviews-layouts/table/use-is-horizontal-scroll-end.d.ts +19 -0
- package/build-types/dataviews-layouts/table/use-is-horizontal-scroll-end.d.ts.map +1 -0
- package/build-types/dataviews-layouts/utils/item-click-wrapper.d.ts +15 -0
- package/build-types/dataviews-layouts/utils/item-click-wrapper.d.ts.map +1 -0
- package/build-types/field-types/array.d.ts +7 -0
- package/build-types/field-types/array.d.ts.map +1 -0
- package/build-types/field-types/boolean.d.ts +19 -0
- package/build-types/field-types/boolean.d.ts.map +1 -0
- package/build-types/field-types/datetime.d.ts +7 -1
- package/build-types/field-types/datetime.d.ts.map +1 -1
- package/build-types/field-types/email.d.ts +19 -0
- package/build-types/field-types/email.d.ts.map +1 -0
- package/build-types/field-types/index.d.ts +2 -10
- package/build-types/field-types/index.d.ts.map +1 -1
- package/build-types/field-types/integer.d.ts +7 -1
- package/build-types/field-types/integer.d.ts.map +1 -1
- package/build-types/field-types/media.d.ts +16 -0
- package/build-types/field-types/media.d.ts.map +1 -0
- package/build-types/field-types/text.d.ts +7 -1
- package/build-types/field-types/text.d.ts.map +1 -1
- package/build-types/filter-and-sort-data-view.d.ts.map +1 -1
- package/build-types/normalize-fields.d.ts.map +1 -1
- package/build-types/types.d.ts +70 -8
- package/build-types/types.d.ts.map +1 -1
- package/build-types/utils.d.ts +5 -2
- package/build-types/utils.d.ts.map +1 -1
- package/build-wp/index.js +2545 -994
- package/package.json +18 -12
- package/src/components/dataform/stories/index.story.tsx +41 -20
- package/src/components/dataviews/index.tsx +108 -43
- package/src/components/dataviews/stories/fixtures.tsx +58 -13
- package/src/components/dataviews/stories/index.story.tsx +228 -7
- package/src/components/dataviews/stories/style.css +24 -3
- package/src/components/dataviews/style.scss +27 -0
- package/src/components/dataviews-context/index.ts +30 -2
- package/src/components/dataviews-filters/filter.tsx +603 -0
- package/src/components/dataviews-filters/index.tsx +23 -29
- package/src/components/dataviews-filters/input-widget.tsx +91 -0
- package/src/components/dataviews-filters/search-widget.tsx +51 -48
- package/src/components/dataviews-filters/style.scss +117 -14
- package/src/components/dataviews-filters/utils.ts +25 -0
- package/src/components/dataviews-item-actions/index.tsx +1 -1
- package/src/components/dataviews-layout/index.tsx +8 -1
- package/src/components/dataviews-pagination/index.tsx +4 -4
- package/src/components/dataviews-selection-checkbox/index.tsx +2 -2
- package/src/components/dataviews-view-config/index.tsx +10 -18
- package/src/components/stories/index.story.tsx +351 -0
- package/src/constants.ts +116 -1
- package/src/dataform-controls/boolean.tsx +30 -0
- package/src/dataform-controls/checkbox.tsx +31 -0
- package/src/dataform-controls/datetime.tsx +106 -2
- package/src/dataform-controls/email.tsx +42 -0
- package/src/dataform-controls/index.tsx +8 -0
- package/src/dataform-controls/integer.tsx +75 -1
- package/src/dataform-controls/select.tsx +1 -0
- package/src/dataform-controls/style.scss +5 -0
- package/src/dataform-controls/text.tsx +2 -1
- package/src/dataform-controls/toggle-group.tsx +59 -0
- package/src/dataforms-layouts/data-form-layout.tsx +1 -1
- package/src/dataforms-layouts/panel/index.tsx +19 -7
- package/src/dataforms-layouts/panel/style.scss +8 -1
- package/src/dataforms-layouts/regular/index.tsx +50 -17
- package/src/dataforms-layouts/regular/style.scss +4 -1
- package/src/dataviews-layouts/grid/index.tsx +47 -26
- package/src/dataviews-layouts/list/index.tsx +12 -5
- package/src/dataviews-layouts/table/column-header-menu.tsx +10 -8
- package/src/dataviews-layouts/table/column-primary.tsx +26 -13
- package/src/dataviews-layouts/table/index.tsx +74 -10
- package/src/dataviews-layouts/table/style.scss +37 -1
- package/src/dataviews-layouts/table/use-is-horizontal-scroll-end.ts +82 -0
- package/src/dataviews-layouts/utils/item-click-wrapper.tsx +93 -0
- package/src/field-types/array.tsx +75 -0
- package/src/field-types/boolean.tsx +66 -0
- package/src/field-types/datetime.tsx +46 -2
- package/src/field-types/email.tsx +79 -0
- package/src/field-types/index.tsx +45 -3
- package/src/field-types/integer.tsx +53 -2
- package/src/field-types/media.tsx +28 -0
- package/src/field-types/text.tsx +41 -2
- package/src/filter-and-sort-data-view.ts +243 -1
- package/src/normalize-fields.ts +116 -13
- package/src/test/dataviews.tsx +20 -2
- package/src/test/filter-and-sort-data-view.js +507 -0
- package/src/test/normalize-fields.ts +155 -0
- package/src/types.ts +106 -9
- package/src/utils.ts +10 -33
- package/tsconfig.json +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/components/dataviews-filters/filter-summary.js.map +0 -1
- package/build/dataviews-layouts/utils/get-clickable-item-props.js +0 -36
- package/build/dataviews-layouts/utils/get-clickable-item-props.js.map +0 -1
- package/build-module/components/dataviews-filters/filter-summary.js +0 -218
- package/build-module/components/dataviews-filters/filter-summary.js.map +0 -1
- package/build-module/dataviews-layouts/utils/get-clickable-item-props.js +0 -30
- package/build-module/dataviews-layouts/utils/get-clickable-item-props.js.map +0 -1
- package/build-types/components/dataviews-filters/filter-summary.d.ts +0 -14
- package/build-types/components/dataviews-filters/filter-summary.d.ts.map +0 -1
- package/build-types/dataviews-layouts/utils/get-clickable-item-props.d.ts +0 -19
- package/build-types/dataviews-layouts/utils/get-clickable-item-props.d.ts.map +0 -1
- package/src/components/dataviews-filters/filter-summary.tsx +0 -338
- package/src/dataviews-layouts/utils/get-clickable-item-props.ts +0 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["@wordpress/dataviews/src/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ComponentType } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { SetSelection } from './private-types';\n\n/**\n * WordPress dependencies\n */\nimport type { useFocusOnMount } from '@wordpress/compose';\n\nexport type SortDirection = 'asc' | 'desc';\n\n/**\n * Generic option type.\n */\nexport interface Option< Value extends any = any > {\n\tvalue: Value;\n\tlabel: string;\n\tdescription?: string;\n}\n\ninterface FilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators?: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\nexport type Operator =\n\t| 'is'\n\t| 'isNot'\n\t| 'isAny'\n\t| 'isNone'\n\t| 'isAll'\n\t| 'isNotAll';\n\nexport type FieldType = 'text' | 'integer' | 'datetime' | 'media';\n\nexport type ValidationContext = {\n\telements?: Option[];\n};\n\n/**\n * An abstract interface for Field based on the field type.\n */\nexport type FieldTypeDefinition< Item > = {\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to render an edit control for the field or control name.\n\t */\n\tEdit: ComponentType< DataFormControlProps< Item > > | string;\n};\n\n/**\n * A dataview field for a specific property of a data type.\n */\nexport type Field< Item > = {\n\t/**\n\t * Type of the fields.\n\t */\n\ttype?: FieldType;\n\n\t/**\n\t * The unique identifier of the field.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the field. Defaults to the id.\n\t */\n\tlabel?: string;\n\n\t/**\n\t * The header of the field. Defaults to the label.\n\t * It allows the usage of a React Element to render the field labels.\n\t */\n\theader?: string | ReactElement;\n\n\t/**\n\t * A description of the field.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Placeholder for the field.\n\t */\n\tplaceholder?: string;\n\n\t/**\n\t * Callback used to render the field. Defaults to `field.getValue`.\n\t */\n\trender?: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * Callback used to render an edit control for the field.\n\t */\n\tEdit?: ComponentType< DataFormControlProps< Item > > | string;\n\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort?: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid?: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to decide if a field should be displayed.\n\t */\n\tisVisible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting?: boolean;\n\n\t/**\n\t * Whether the field is searchable.\n\t */\n\tenableGlobalSearch?: boolean;\n\n\t/**\n\t * Whether the field is filterable.\n\t */\n\tenableHiding?: boolean;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements?: Option[];\n\n\t/**\n\t * Filter config for the field.\n\t */\n\tfilterBy?: FilterByConfig | undefined;\n\n\t/**\n\t * Callback used to retrieve the value of the field from the item.\n\t * Defaults to `item[ field.id ]`.\n\t */\n\tgetValue?: ( args: { item: Item } ) => any;\n};\n\nexport type NormalizedField< Item > = Field< Item > & {\n\tlabel: string;\n\theader: string | ReactElement;\n\tgetValue: ( args: { item: Item } ) => any;\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\tEdit: ComponentType< DataFormControlProps< Item > >;\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\tenableHiding: boolean;\n\tenableSorting: boolean;\n};\n\n/**\n * A collection of dataview fields for a data type.\n */\nexport type Fields< Item > = Field< Item >[];\n\nexport type Data< Item > = Item[];\n\nexport type DataFormControlProps< Item > = {\n\tdata: Item;\n\tfield: NormalizedField< Item >;\n\tonChange: ( value: Record< string, any > ) => void;\n\thideLabelFromVision?: boolean;\n};\n\nexport type DataViewRenderFieldProps< Item > = {\n\titem: Item;\n};\n\n/**\n * The filters applied to the dataset.\n */\nexport interface Filter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The operator to use.\n\t */\n\toperator: Operator;\n\n\t/**\n\t * The value to filter by.\n\t */\n\tvalue: any;\n}\n\nexport interface NormalizedFilter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The field name.\n\t */\n\tname: string;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements: Option[];\n\n\t/**\n\t * Is a single selection filter.\n\t */\n\tsingleSelection: boolean;\n\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether the filter is visible.\n\t */\n\tisVisible: boolean;\n\n\t/**\n\t * Whether it is a primary filter.\n\t */\n\tisPrimary: boolean;\n}\n\ninterface ViewBase {\n\t/**\n\t * The layout of the view.\n\t */\n\ttype: string;\n\n\t/**\n\t * The global search term.\n\t */\n\tsearch?: string;\n\n\t/**\n\t * The filters to apply.\n\t */\n\tfilters?: Filter[];\n\n\t/**\n\t * The sorting configuration.\n\t */\n\tsort?: {\n\t\t/**\n\t\t * The field to sort by.\n\t\t */\n\t\tfield: string;\n\n\t\t/**\n\t\t * The direction to sort by.\n\t\t */\n\t\tdirection: SortDirection;\n\t};\n\n\t/**\n\t * The active page\n\t */\n\tpage?: number;\n\n\t/**\n\t * The number of items per page\n\t */\n\tperPage?: number;\n\n\t/**\n\t * The fields to render\n\t */\n\tfields?: string[];\n\n\t/**\n\t * Title field\n\t */\n\ttitleField?: string;\n\n\t/**\n\t * Media field\n\t */\n\tmediaField?: string;\n\n\t/**\n\t * Description field\n\t */\n\tdescriptionField?: string;\n\n\t/**\n\t * Whether to show the title\n\t */\n\tshowTitle?: boolean;\n\n\t/**\n\t * Whether to show the media\n\t */\n\tshowMedia?: boolean;\n\n\t/**\n\t * Whether to show the description\n\t */\n\tshowDescription?: boolean;\n\n\t/**\n\t * Whether to show the hierarchical levels.\n\t */\n\tshowLevels?: boolean;\n}\n\nexport interface ColumnStyle {\n\t/**\n\t * The width of the field column.\n\t */\n\twidth?: string | number;\n\n\t/**\n\t * The minimum width of the field column.\n\t */\n\tmaxWidth?: string | number;\n\n\t/**\n\t * The maximum width of the field column.\n\t */\n\tminWidth?: string | number;\n}\n\nexport type Density = 'compact' | 'balanced' | 'comfortable';\n\nexport interface ViewTable extends ViewBase {\n\ttype: 'table';\n\n\tlayout?: {\n\t\t/**\n\t\t * The styles for the columns.\n\t\t */\n\t\tstyles?: Record< string, ColumnStyle >;\n\n\t\t/**\n\t\t * The density of the view.\n\t\t */\n\t\tdensity?: Density;\n\t};\n}\n\nexport interface ViewList extends ViewBase {\n\ttype: 'list';\n}\n\nexport interface ViewGrid extends ViewBase {\n\ttype: 'grid';\n\n\tlayout?: {\n\t\t/**\n\t\t * The fields to use as badge fields.\n\t\t */\n\t\tbadgeFields?: string[];\n\n\t\t/**\n\t\t * The preview size of the grid.\n\t\t */\n\t\tpreviewSize?: number;\n\t};\n}\n\nexport type View = ViewList | ViewGrid | ViewTable;\n\ninterface ActionBase< Item > {\n\t/**\n\t * The unique identifier of the action.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the action.\n\t * In case we want to adjust the label based on the selected items,\n\t * a function can be provided.\n\t */\n\tlabel: string | ( ( items: Item[] ) => string );\n\n\t/**\n\t * The icon of the action. (Either a string or an SVG element)\n\t * This should be IconType from the components package\n\t * but that import is breaking typescript build for the moment.\n\t */\n\ticon?: any;\n\n\t/**\n\t * Whether the action is disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the action is destructive.\n\t */\n\tisDestructive?: boolean;\n\n\t/**\n\t * Whether the action is a primary action.\n\t */\n\tisPrimary?: boolean;\n\n\t/**\n\t * Whether the item passed as an argument supports the current action.\n\t */\n\tisEligible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the action can be used as a bulk action.\n\t */\n\tsupportsBulk?: boolean;\n\n\t/**\n\t * The context in which the action is visible.\n\t * This is only a \"meta\" information for now.\n\t */\n\tcontext?: 'list' | 'single';\n}\n\nexport interface RenderModalProps< Item > {\n\titems: Item[];\n\tcloseModal?: () => void;\n\tonActionPerformed?: ( items: Item[] ) => void;\n}\n\nexport interface ActionModal< Item > extends ActionBase< Item > {\n\t/**\n\t * Modal to render when the action is triggered.\n\t */\n\tRenderModal: ( {\n\t\titems,\n\t\tcloseModal,\n\t\tonActionPerformed,\n\t}: RenderModalProps< Item > ) => ReactElement;\n\n\t/**\n\t * Whether to hide the modal header.\n\t */\n\thideModalHeader?: boolean;\n\n\t/**\n\t * The header of the modal.\n\t */\n\tmodalHeader?: string;\n\n\t/**\n\t * The size of the modal.\n\t *\n\t * @default 'medium'\n\t */\n\tmodalSize?: 'small' | 'medium' | 'large' | 'fill';\n\n\t/**\n\t * The focus on mount property of the modal.\n\t */\n\tmodalFocusOnMount?:\n\t\t| Parameters< typeof useFocusOnMount >[ 0 ]\n\t\t| 'firstContentElement';\n}\n\nexport interface ActionButton< Item > extends ActionBase< Item > {\n\t/**\n\t * The callback to execute when the action is triggered.\n\t */\n\tcallback: (\n\t\titems: Item[],\n\t\tcontext: {\n\t\t\tregistry: any;\n\t\t\tonActionPerformed?: ( items: Item[] ) => void;\n\t\t}\n\t) => void;\n}\n\nexport type Action< Item > = ActionModal< Item > | ActionButton< Item >;\n\nexport interface ViewBaseProps< Item > {\n\tactions: Action< Item >[];\n\tdata: Item[];\n\tfields: NormalizedField< Item >[];\n\tgetItemId: ( item: Item ) => string;\n\tgetItemLevel?: ( item: Item ) => number;\n\tisLoading?: boolean;\n\tonChangeView: ( view: View ) => void;\n\tonChangeSelection: SetSelection;\n\tselection: string[];\n\tsetOpenedFilter: ( fieldId: string ) => void;\n\tonClickItem?: ( item: Item ) => void;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n}\n\nexport interface ViewTableProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewTable;\n}\n\nexport interface ViewListProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewList;\n}\n\nexport interface ViewGridProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n}\n\nexport type SimpleFormField = {\n\tid: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport type CombinedFormField = {\n\tid: string;\n\tlabel?: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n\tchildren: Array< FormField | string >;\n};\n\nexport type FormField = SimpleFormField | CombinedFormField;\n\n/**\n * The form configuration.\n */\nexport type Form = {\n\ttype?: 'regular' | 'panel';\n\tfields?: Array< FormField | string >;\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport interface DataFormProps< Item > {\n\tdata: Item;\n\tfields: Field< Item >[];\n\tform: Form;\n\tonChange: ( value: Record< string, any > ) => void;\n}\n\nexport interface FieldLayoutProps< Item > {\n\tdata: Item;\n\tfield: FormField;\n\tonChange: ( value: any ) => void;\n\thideLabelFromVision?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["@wordpress/dataviews/src/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactElement, ComponentType, ComponentProps } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { SetSelection } from './private-types';\n\n/**\n * WordPress dependencies\n */\nimport type { useFocusOnMount } from '@wordpress/compose';\n\nexport type SortDirection = 'asc' | 'desc';\n\n/**\n * Generic option type.\n */\nexport interface Option< Value extends any = any > {\n\tvalue: Value;\n\tlabel: string;\n\tdescription?: string;\n}\n\nexport interface FilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators?: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\nexport interface NormalizedFilterByConfig {\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether it is a primary filter.\n\t *\n\t * A primary filter is always visible and is not listed in the \"Add filter\" component,\n\t * except for the list layout where it behaves like a secondary filter.\n\t */\n\tisPrimary?: boolean;\n}\n\ninterface FilterConfigForType {\n\t/**\n\t * What operators are used by default.\n\t */\n\tdefaultOperators: Operator[];\n\n\t/**\n\t * What operators are supported by the field.\n\t */\n\tvalidOperators: Operator[];\n}\n\nexport type Operator =\n\t| 'is'\n\t| 'isNot'\n\t| 'isAny'\n\t| 'isNone'\n\t| 'isAll'\n\t| 'isNotAll'\n\t| 'lessThan'\n\t| 'greaterThan'\n\t| 'lessThanOrEqual'\n\t| 'greaterThanOrEqual'\n\t| 'before'\n\t| 'after'\n\t| 'beforeInc'\n\t| 'afterInc'\n\t| 'contains'\n\t| 'notContains'\n\t| 'startsWith'\n\t| 'between'\n\t| 'on'\n\t| 'notOn'\n\t| 'inThePast'\n\t| 'over';\n\nexport type FieldType =\n\t| 'text'\n\t| 'integer'\n\t| 'datetime'\n\t| 'media'\n\t| 'boolean'\n\t| 'email'\n\t| 'array';\n\nexport type ValidationContext = {\n\telements?: Option[];\n};\n\n/**\n * An abstract interface for Field based on the field type.\n */\nexport type FieldTypeDefinition< Item > = {\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to render an edit control for the field or control name.\n\t */\n\tEdit: ComponentType< DataFormControlProps< Item > > | string | null;\n\n\t/**\n\t * Callback used to render the field.\n\t */\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * The filter config for the field.\n\t */\n\tfilterBy: FilterConfigForType | false;\n\n\t/**\n\t * Whether the field is readOnly.\n\t * If `true`, the value will be rendered using the `render` callback.\n\t */\n\treadOnly?: boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting: boolean;\n};\n\n/**\n * A dataview field for a specific property of a data type.\n */\nexport type Field< Item > = {\n\t/**\n\t * Type of the fields.\n\t */\n\ttype?: FieldType;\n\n\t/**\n\t * The unique identifier of the field.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the field. Defaults to the id.\n\t */\n\tlabel?: string;\n\n\t/**\n\t * The header of the field. Defaults to the label.\n\t * It allows the usage of a React Element to render the field labels.\n\t */\n\theader?: string | ReactElement;\n\n\t/**\n\t * A description of the field.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * Placeholder for the field.\n\t */\n\tplaceholder?: string;\n\n\t/**\n\t * Callback used to render the field. Defaults to `field.getValue`.\n\t */\n\trender?: ComponentType< DataViewRenderFieldProps< Item > >;\n\n\t/**\n\t * Callback used to render an edit control for the field.\n\t */\n\tEdit?: ComponentType< DataFormControlProps< Item > > | string;\n\n\t/**\n\t * Callback used to sort the field.\n\t */\n\tsort?: ( a: Item, b: Item, direction: SortDirection ) => number;\n\n\t/**\n\t * Callback used to validate the field.\n\t */\n\tisValid?: ( item: Item, context?: ValidationContext ) => boolean;\n\n\t/**\n\t * Callback used to decide if a field should be displayed.\n\t */\n\tisVisible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the field is sortable.\n\t */\n\tenableSorting?: boolean;\n\n\t/**\n\t * Whether the field is searchable.\n\t */\n\tenableGlobalSearch?: boolean;\n\n\t/**\n\t * Whether the field is filterable.\n\t */\n\tenableHiding?: boolean;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements?: Option[];\n\n\t/**\n\t * Filter config for the field.\n\t */\n\tfilterBy?: FilterByConfig | false;\n\n\t/**\n\t * Whether the field is readOnly.\n\t * If `true`, the value will be rendered using the `render` callback.\n\t */\n\treadOnly?: boolean;\n\n\t/**\n\t * Callback used to retrieve the value of the field from the item.\n\t * Defaults to `item[ field.id ]`.\n\t */\n\tgetValue?: ( args: { item: Item } ) => any;\n};\n\nexport type NormalizedField< Item > = Omit< Field< Item >, 'Edit' > & {\n\tlabel: string;\n\theader: string | ReactElement;\n\tgetValue: ( args: { item: Item } ) => any;\n\trender: ComponentType< DataViewRenderFieldProps< Item > >;\n\tEdit: ComponentType< DataFormControlProps< Item > > | null;\n\tsort: ( a: Item, b: Item, direction: SortDirection ) => number;\n\tisValid: ( item: Item, context?: ValidationContext ) => boolean;\n\tenableHiding: boolean;\n\tenableSorting: boolean;\n\tfilterBy: NormalizedFilterByConfig | false;\n\treadOnly: boolean;\n};\n\n/**\n * A collection of dataview fields for a data type.\n */\nexport type Fields< Item > = Field< Item >[];\n\nexport type Data< Item > = Item[];\n\nexport type DataFormControlProps< Item > = {\n\tdata: Item;\n\tfield: NormalizedField< Item >;\n\tonChange: ( value: Record< string, any > ) => void;\n\thideLabelFromVision?: boolean;\n\t/**\n\t * The currently selected filter operator for this field.\n\t *\n\t * Used by DataViews filters to determine which control to render based on the operator type.\n\t */\n\toperator?: Operator;\n};\n\nexport type DataViewRenderFieldProps< Item > = {\n\titem: Item;\n\tfield: NormalizedField< Item >;\n};\n\n/**\n * The filters applied to the dataset.\n */\nexport interface Filter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The operator to use.\n\t */\n\toperator: Operator;\n\n\t/**\n\t * The value to filter by.\n\t */\n\tvalue: any;\n}\n\nexport interface NormalizedFilter {\n\t/**\n\t * The field to filter by.\n\t */\n\tfield: string;\n\n\t/**\n\t * The field name.\n\t */\n\tname: string;\n\n\t/**\n\t * The list of options to pick from when using the field as a filter.\n\t */\n\telements: Option[];\n\n\t/**\n\t * Is a single selection filter.\n\t */\n\tsingleSelection: boolean;\n\n\t/**\n\t * The list of operators supported by the field.\n\t */\n\toperators: Operator[];\n\n\t/**\n\t * Whether the filter is visible.\n\t */\n\tisVisible: boolean;\n\n\t/**\n\t * Whether it is a primary filter.\n\t */\n\tisPrimary: boolean;\n}\n\ninterface ViewBase {\n\t/**\n\t * The layout of the view.\n\t */\n\ttype: string;\n\n\t/**\n\t * The global search term.\n\t */\n\tsearch?: string;\n\n\t/**\n\t * The filters to apply.\n\t */\n\tfilters?: Filter[];\n\n\t/**\n\t * The sorting configuration.\n\t */\n\tsort?: {\n\t\t/**\n\t\t * The field to sort by.\n\t\t */\n\t\tfield: string;\n\n\t\t/**\n\t\t * The direction to sort by.\n\t\t */\n\t\tdirection: SortDirection;\n\t};\n\n\t/**\n\t * The active page\n\t */\n\tpage?: number;\n\n\t/**\n\t * The number of items per page\n\t */\n\tperPage?: number;\n\n\t/**\n\t * The fields to render\n\t */\n\tfields?: string[];\n\n\t/**\n\t * Title field\n\t */\n\ttitleField?: string;\n\n\t/**\n\t * Media field\n\t */\n\tmediaField?: string;\n\n\t/**\n\t * Description field\n\t */\n\tdescriptionField?: string;\n\n\t/**\n\t * Whether to show the title\n\t */\n\tshowTitle?: boolean;\n\n\t/**\n\t * Whether to show the media\n\t */\n\tshowMedia?: boolean;\n\n\t/**\n\t * Whether to show the description\n\t */\n\tshowDescription?: boolean;\n\n\t/**\n\t * Whether to show the hierarchical levels.\n\t */\n\tshowLevels?: boolean;\n}\n\nexport interface ColumnStyle {\n\t/**\n\t * The width of the field column.\n\t */\n\twidth?: string | number;\n\n\t/**\n\t * The minimum width of the field column.\n\t */\n\tmaxWidth?: string | number;\n\n\t/**\n\t * The maximum width of the field column.\n\t */\n\tminWidth?: string | number;\n\n\t/**\n\t * The alignment of the field column, defaults to left.\n\t */\n\talign?: 'start' | 'center' | 'end';\n}\n\nexport type Density = 'compact' | 'balanced' | 'comfortable';\n\nexport interface ViewTable extends ViewBase {\n\ttype: 'table';\n\n\tlayout?: {\n\t\t/**\n\t\t * The styles for the columns.\n\t\t */\n\t\tstyles?: Record< string, ColumnStyle >;\n\n\t\t/**\n\t\t * The density of the view.\n\t\t */\n\t\tdensity?: Density;\n\t};\n}\n\nexport interface ViewList extends ViewBase {\n\ttype: 'list';\n}\n\nexport interface ViewGrid extends ViewBase {\n\ttype: 'grid';\n\n\tlayout?: {\n\t\t/**\n\t\t * The fields to use as badge fields.\n\t\t */\n\t\tbadgeFields?: string[];\n\n\t\t/**\n\t\t * The preview size of the grid.\n\t\t */\n\t\tpreviewSize?: number;\n\t};\n}\n\nexport type View = ViewList | ViewGrid | ViewTable;\n\ninterface ActionBase< Item > {\n\t/**\n\t * The unique identifier of the action.\n\t */\n\tid: string;\n\n\t/**\n\t * The label of the action.\n\t * In case we want to adjust the label based on the selected items,\n\t * a function can be provided.\n\t */\n\tlabel: string | ( ( items: Item[] ) => string );\n\n\t/**\n\t * The icon of the action. (Either a string or an SVG element)\n\t * This should be IconType from the components package\n\t * but that import is breaking typescript build for the moment.\n\t */\n\ticon?: any;\n\n\t/**\n\t * Whether the action is disabled.\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Whether the action is destructive.\n\t */\n\tisDestructive?: boolean;\n\n\t/**\n\t * Whether the action is a primary action.\n\t */\n\tisPrimary?: boolean;\n\n\t/**\n\t * Whether the item passed as an argument supports the current action.\n\t */\n\tisEligible?: ( item: Item ) => boolean;\n\n\t/**\n\t * Whether the action can be used as a bulk action.\n\t */\n\tsupportsBulk?: boolean;\n\n\t/**\n\t * The context in which the action is visible.\n\t * This is only a \"meta\" information for now.\n\t */\n\tcontext?: 'list' | 'single';\n}\n\nexport interface RenderModalProps< Item > {\n\titems: Item[];\n\tcloseModal?: () => void;\n\tonActionPerformed?: ( items: Item[] ) => void;\n}\n\nexport interface ActionModal< Item > extends ActionBase< Item > {\n\t/**\n\t * Modal to render when the action is triggered.\n\t */\n\tRenderModal: ( {\n\t\titems,\n\t\tcloseModal,\n\t\tonActionPerformed,\n\t}: RenderModalProps< Item > ) => ReactElement;\n\n\t/**\n\t * Whether to hide the modal header.\n\t */\n\thideModalHeader?: boolean;\n\n\t/**\n\t * The header of the modal.\n\t */\n\tmodalHeader?: string;\n\n\t/**\n\t * The size of the modal.\n\t *\n\t * @default 'medium'\n\t */\n\tmodalSize?: 'small' | 'medium' | 'large' | 'fill';\n\n\t/**\n\t * The focus on mount property of the modal.\n\t */\n\tmodalFocusOnMount?:\n\t\t| Parameters< typeof useFocusOnMount >[ 0 ]\n\t\t| 'firstContentElement';\n}\n\nexport interface ActionButton< Item > extends ActionBase< Item > {\n\t/**\n\t * The callback to execute when the action is triggered.\n\t */\n\tcallback: (\n\t\titems: Item[],\n\t\tcontext: {\n\t\t\tregistry: any;\n\t\t\tonActionPerformed?: ( items: Item[] ) => void;\n\t\t}\n\t) => void;\n}\n\nexport type Action< Item > = ActionModal< Item > | ActionButton< Item >;\n\nexport interface ViewBaseProps< Item > {\n\tclassName?: string;\n\tactions: Action< Item >[];\n\tdata: Item[];\n\tfields: NormalizedField< Item >[];\n\tgetItemId: ( item: Item ) => string;\n\tgetItemLevel?: ( item: Item ) => number;\n\tisLoading?: boolean;\n\tonChangeView: ( view: View ) => void;\n\tonChangeSelection: SetSelection;\n\tselection: string[];\n\tsetOpenedFilter: ( fieldId: string ) => void;\n\tonClickItem?: ( item: Item ) => void;\n\trenderItemLink?: (\n\t\tprops: {\n\t\t\titem: Item;\n\t\t} & ComponentProps< 'a' >\n\t) => ReactElement;\n\tisItemClickable: ( item: Item ) => boolean;\n\tview: View;\n}\n\nexport interface ViewTableProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewTable;\n}\n\nexport interface ViewListProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewList;\n}\n\nexport interface ViewGridProps< Item > extends ViewBaseProps< Item > {\n\tview: ViewGrid;\n}\n\nexport type ViewProps< Item > =\n\t| ViewTableProps< Item >\n\t| ViewGridProps< Item >\n\t| ViewListProps< Item >;\n\nexport interface SupportedLayouts {\n\tlist?: Omit< ViewList, 'type' >;\n\tgrid?: Omit< ViewGrid, 'type' >;\n\ttable?: Omit< ViewTable, 'type' >;\n}\n\nexport type SimpleFormField = {\n\tid: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport type CombinedFormField = {\n\tid: string;\n\tlabel?: string;\n\tlayout?: 'regular' | 'panel';\n\tlabelPosition?: 'side' | 'top' | 'none';\n\tchildren: Array< FormField | string >;\n};\n\nexport type FormField = SimpleFormField | CombinedFormField;\n\n/**\n * The form configuration.\n */\nexport type Form = {\n\ttype?: 'regular' | 'panel';\n\tfields?: Array< FormField | string >;\n\tlabelPosition?: 'side' | 'top' | 'none';\n};\n\nexport interface DataFormProps< Item > {\n\tdata: Item;\n\tfields: Field< Item >[];\n\tform: Form;\n\tonChange: ( value: Record< string, any > ) => void;\n}\n\nexport interface FieldLayoutProps< Item > {\n\tdata: Item;\n\tfield: FormField;\n\tonChange: ( value: any ) => void;\n\thideLabelFromVision?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
package/build-module/utils.js
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Internal dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { ALL_OPERATORS, OPERATOR_IS, OPERATOR_IS_NOT, OPERATOR_IS_ANY, OPERATOR_IS_NONE } from './constants';
|
|
5
|
-
export function sanitizeOperators(field) {
|
|
6
|
-
let operators = field.filterBy?.operators;
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (operators.includes(OPERATOR_IS) || operators.includes(OPERATOR_IS_NOT)) {
|
|
19
|
-
operators = operators.filter(operator => [OPERATOR_IS, OPERATOR_IS_NOT].includes(operator));
|
|
20
|
-
}
|
|
21
|
-
return operators;
|
|
5
|
+
export function renderFromElements({
|
|
6
|
+
item,
|
|
7
|
+
field
|
|
8
|
+
}) {
|
|
9
|
+
const value = field.getValue({
|
|
10
|
+
item
|
|
11
|
+
});
|
|
12
|
+
return field?.elements?.find(element => element.value === value)?.label || field.getValue({
|
|
13
|
+
item
|
|
14
|
+
});
|
|
22
15
|
}
|
|
23
16
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["renderFromElements","item","field","value","getValue","elements","find","element","label"],"sources":["@wordpress/dataviews/src/utils.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { DataViewRenderFieldProps } from './types';\n\nexport function renderFromElements< Item >( {\n\titem,\n\tfield,\n}: DataViewRenderFieldProps< Item > ) {\n\tconst value = field.getValue( { item } );\n\treturn (\n\t\tfield?.elements?.find( ( element ) => element.value === value )\n\t\t\t?.label || field.getValue( { item } )\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;;AAGA,OAAO,SAASA,kBAAkBA,CAAU;EAC3CC,IAAI;EACJC;AACiC,CAAC,EAAG;EACrC,MAAMC,KAAK,GAAGD,KAAK,CAACE,QAAQ,CAAE;IAAEH;EAAK,CAAE,CAAC;EACxC,OACCC,KAAK,EAAEG,QAAQ,EAAEC,IAAI,CAAIC,OAAO,IAAMA,OAAO,CAACJ,KAAK,KAAKA,KAAM,CAAC,EAC5DK,KAAK,IAAIN,KAAK,CAACE,QAAQ,CAAE;IAAEH;EAAK,CAAE,CAAC;AAExC","ignoreList":[]}
|
|
@@ -343,6 +343,30 @@
|
|
|
343
343
|
border-radius: 2px;
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
/**
|
|
347
|
+
* Applying a consistent 24px padding when DataViews are placed within cards.
|
|
348
|
+
*/
|
|
349
|
+
.components-card__body:has(> .dataviews-wrapper) {
|
|
350
|
+
padding: 8px 0 0;
|
|
351
|
+
overflow: hidden;
|
|
352
|
+
}
|
|
353
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews__view-actions,
|
|
354
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews-filters__container,
|
|
355
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews-footer,
|
|
356
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews-view-grid,
|
|
357
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews-loading,
|
|
358
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews-no-results {
|
|
359
|
+
padding-inline: 24px;
|
|
360
|
+
}
|
|
361
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews-view-table tr td:first-child,
|
|
362
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews-view-table tr th:first-child {
|
|
363
|
+
padding-inline-start: 24px;
|
|
364
|
+
}
|
|
365
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews-view-table tr td:last-child,
|
|
366
|
+
.components-card__body:has(> .dataviews-wrapper) .dataviews-view-table tr th:last-child {
|
|
367
|
+
padding-inline-end: 24px;
|
|
368
|
+
}
|
|
369
|
+
|
|
346
370
|
.dataviews-bulk-actions-footer__item-count {
|
|
347
371
|
color: #1e1e1e;
|
|
348
372
|
font-weight: 500;
|
|
@@ -383,17 +407,26 @@
|
|
|
383
407
|
}
|
|
384
408
|
|
|
385
409
|
.dataviews-filters__summary-operators-container {
|
|
386
|
-
padding: 8px
|
|
410
|
+
padding: 8px 16px;
|
|
387
411
|
}
|
|
388
|
-
.dataviews-filters__summary-operators-container:has(+ .dataviews-filters__search-widget-listbox) {
|
|
412
|
+
.dataviews-filters__summary-operators-container:has(+ .dataviews-filters__search-widget-listbox), .dataviews-filters__summary-operators-container:has(+ .dataviews-filters__user-input-widget) {
|
|
389
413
|
border-bottom: 1px solid #e0e0e0;
|
|
390
|
-
padding-bottom: 8px;
|
|
391
414
|
}
|
|
392
415
|
.dataviews-filters__summary-operators-container:empty {
|
|
393
416
|
display: none;
|
|
394
417
|
}
|
|
395
418
|
.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-name {
|
|
396
419
|
color: #757575;
|
|
420
|
+
white-space: nowrap;
|
|
421
|
+
overflow: hidden;
|
|
422
|
+
text-overflow: ellipsis;
|
|
423
|
+
flex-shrink: 0; /* Prevents this element from shrinking */
|
|
424
|
+
max-width: calc(100% - 55px);
|
|
425
|
+
}
|
|
426
|
+
.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-select {
|
|
427
|
+
width: 100%;
|
|
428
|
+
white-space: nowrap;
|
|
429
|
+
overflow: hidden;
|
|
397
430
|
}
|
|
398
431
|
|
|
399
432
|
.dataviews-filters__summary-chip-container {
|
|
@@ -491,9 +524,13 @@
|
|
|
491
524
|
gap: 8px;
|
|
492
525
|
border-radius: 2px;
|
|
493
526
|
box-sizing: border-box;
|
|
494
|
-
padding:
|
|
527
|
+
padding: 4px 12px;
|
|
495
528
|
cursor: default;
|
|
496
|
-
|
|
529
|
+
min-height: 32px;
|
|
530
|
+
font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
531
|
+
font-weight: 400;
|
|
532
|
+
font-size: 13px;
|
|
533
|
+
line-height: 20px;
|
|
497
534
|
}
|
|
498
535
|
.dataviews-filters__search-widget-listitem:last-child {
|
|
499
536
|
margin-block-end: 0;
|
|
@@ -502,16 +539,23 @@
|
|
|
502
539
|
background-color: var(--wp-admin-theme-color);
|
|
503
540
|
color: #fff;
|
|
504
541
|
}
|
|
505
|
-
.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-check, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-check, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-check {
|
|
506
|
-
fill: #fff;
|
|
507
|
-
}
|
|
508
542
|
.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-description, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-description, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-description {
|
|
509
543
|
color: #fff;
|
|
510
544
|
}
|
|
511
|
-
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
545
|
+
.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection {
|
|
546
|
+
border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
|
|
547
|
+
background: #fff;
|
|
548
|
+
}
|
|
549
|
+
.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection.is-selected, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection.is-selected, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection.is-selected {
|
|
550
|
+
border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
|
|
551
|
+
background: var(--wp-admin-theme-color-darker-20, #183ad6);
|
|
552
|
+
}
|
|
553
|
+
.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection {
|
|
554
|
+
border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
|
|
555
|
+
}
|
|
556
|
+
.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection.is-selected, .dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection.is-selected, .dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection.is-selected {
|
|
557
|
+
border-color: var(--wp-admin-theme-color-darker-20, #183ad6);
|
|
558
|
+
background: var(--wp-admin-theme-color-darker-20, #183ad6);
|
|
515
559
|
}
|
|
516
560
|
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-description {
|
|
517
561
|
display: block;
|
|
@@ -521,6 +565,208 @@
|
|
|
521
565
|
line-height: 16px;
|
|
522
566
|
color: #757575;
|
|
523
567
|
}
|
|
568
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection {
|
|
569
|
+
border: 1px solid #1e1e1e;
|
|
570
|
+
margin-left: 12px;
|
|
571
|
+
transition: none;
|
|
572
|
+
border-radius: 50%;
|
|
573
|
+
width: 24px;
|
|
574
|
+
height: 24px;
|
|
575
|
+
min-width: 24px;
|
|
576
|
+
max-width: 24px;
|
|
577
|
+
position: relative;
|
|
578
|
+
margin: 0;
|
|
579
|
+
padding: 0;
|
|
580
|
+
}
|
|
581
|
+
@media not (prefers-reduced-motion) {
|
|
582
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection {
|
|
583
|
+
transition: box-shadow 0.1s linear;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
@media (min-width: 600px) {
|
|
587
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection {
|
|
588
|
+
height: 16px;
|
|
589
|
+
width: 16px;
|
|
590
|
+
min-width: 16px;
|
|
591
|
+
max-width: 16px;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked::before {
|
|
595
|
+
box-sizing: inherit;
|
|
596
|
+
width: 12px;
|
|
597
|
+
height: 12px;
|
|
598
|
+
position: absolute;
|
|
599
|
+
top: 50%;
|
|
600
|
+
right: 50%;
|
|
601
|
+
transform: translate(50%, -50%);
|
|
602
|
+
margin: 0;
|
|
603
|
+
background-color: #fff;
|
|
604
|
+
border: 4px solid #fff;
|
|
605
|
+
}
|
|
606
|
+
@media (min-width: 600px) {
|
|
607
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked::before {
|
|
608
|
+
width: 8px;
|
|
609
|
+
height: 8px;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:focus {
|
|
613
|
+
box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-admin-theme-color);
|
|
614
|
+
outline: 2px solid transparent;
|
|
615
|
+
}
|
|
616
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked {
|
|
617
|
+
background: var(--wp-admin-theme-color);
|
|
618
|
+
border: none;
|
|
619
|
+
}
|
|
620
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected {
|
|
621
|
+
background: var(--wp-admin-theme-color, #3858e9);
|
|
622
|
+
border-color: var(--wp-admin-theme-color, #3858e9);
|
|
623
|
+
}
|
|
624
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected::before {
|
|
625
|
+
content: "";
|
|
626
|
+
border-radius: 50%;
|
|
627
|
+
box-sizing: inherit;
|
|
628
|
+
width: 12px;
|
|
629
|
+
height: 12px;
|
|
630
|
+
position: absolute;
|
|
631
|
+
top: 50%;
|
|
632
|
+
right: 50%;
|
|
633
|
+
transform: translate(50%, -50%);
|
|
634
|
+
margin: 0;
|
|
635
|
+
background-color: #fff;
|
|
636
|
+
border: 4px solid #fff;
|
|
637
|
+
}
|
|
638
|
+
@media (min-width: 600px) {
|
|
639
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected::before {
|
|
640
|
+
width: 8px;
|
|
641
|
+
height: 8px;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
|
|
645
|
+
--checkbox-size: 24px;
|
|
646
|
+
border: 1px solid #1e1e1e;
|
|
647
|
+
margin-left: 12px;
|
|
648
|
+
transition: none;
|
|
649
|
+
border-radius: 2px;
|
|
650
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
|
651
|
+
padding: 6px 8px;
|
|
652
|
+
/* Fonts smaller than 16px causes mobile safari to zoom. */
|
|
653
|
+
font-size: 16px;
|
|
654
|
+
/* Override core line-height. To be reviewed. */
|
|
655
|
+
line-height: normal;
|
|
656
|
+
box-shadow: 0 0 0 transparent;
|
|
657
|
+
border-radius: 2px;
|
|
658
|
+
border: 1px solid #949494;
|
|
659
|
+
position: relative;
|
|
660
|
+
background: #fff;
|
|
661
|
+
color: #1e1e1e;
|
|
662
|
+
margin: 0;
|
|
663
|
+
padding: 0;
|
|
664
|
+
width: var(--checkbox-size);
|
|
665
|
+
height: var(--checkbox-size);
|
|
666
|
+
}
|
|
667
|
+
@media not (prefers-reduced-motion) {
|
|
668
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
|
|
669
|
+
transition: box-shadow 0.1s linear;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
@media (min-width: 600px) {
|
|
673
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
|
|
674
|
+
font-size: 13px;
|
|
675
|
+
/* Override core line-height. To be reviewed. */
|
|
676
|
+
line-height: normal;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus {
|
|
680
|
+
border-color: var(--wp-admin-theme-color);
|
|
681
|
+
box-shadow: 0 0 0 0.5px var(--wp-admin-theme-color);
|
|
682
|
+
outline: 2px solid transparent;
|
|
683
|
+
}
|
|
684
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::-webkit-input-placeholder {
|
|
685
|
+
color: rgba(30, 30, 30, 0.62);
|
|
686
|
+
}
|
|
687
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::-moz-placeholder {
|
|
688
|
+
color: rgba(30, 30, 30, 0.62);
|
|
689
|
+
}
|
|
690
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:-ms-input-placeholder {
|
|
691
|
+
color: rgba(30, 30, 30, 0.62);
|
|
692
|
+
}
|
|
693
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus {
|
|
694
|
+
box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--wp-admin-theme-color);
|
|
695
|
+
outline: 2px solid transparent;
|
|
696
|
+
}
|
|
697
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked {
|
|
698
|
+
background: var(--wp-admin-theme-color);
|
|
699
|
+
border-color: var(--wp-admin-theme-color);
|
|
700
|
+
}
|
|
701
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked::-ms-check {
|
|
702
|
+
opacity: 0;
|
|
703
|
+
}
|
|
704
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked::before, .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]::before {
|
|
705
|
+
margin: -3px -5px;
|
|
706
|
+
color: #fff;
|
|
707
|
+
}
|
|
708
|
+
@media (min-width: 782px) {
|
|
709
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked::before, .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]::before {
|
|
710
|
+
margin: -4px -5px 0 0;
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed] {
|
|
714
|
+
background: var(--wp-admin-theme-color);
|
|
715
|
+
border-color: var(--wp-admin-theme-color);
|
|
716
|
+
}
|
|
717
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]::before {
|
|
718
|
+
content: "\f460";
|
|
719
|
+
float: right;
|
|
720
|
+
display: inline-block;
|
|
721
|
+
vertical-align: middle;
|
|
722
|
+
width: 16px;
|
|
723
|
+
/* stylelint-disable-next-line font-family-no-missing-generic-family-keyword -- dashicons don't need a generic family keyword. */
|
|
724
|
+
font: normal 30px/1 dashicons;
|
|
725
|
+
speak: none;
|
|
726
|
+
-webkit-font-smoothing: antialiased;
|
|
727
|
+
-moz-osx-font-smoothing: grayscale;
|
|
728
|
+
}
|
|
729
|
+
@media (min-width: 782px) {
|
|
730
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]::before {
|
|
731
|
+
float: none;
|
|
732
|
+
font-size: 21px;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-disabled=true], .dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:disabled {
|
|
736
|
+
background: #f0f0f0;
|
|
737
|
+
border-color: #ddd;
|
|
738
|
+
cursor: default;
|
|
739
|
+
opacity: 1;
|
|
740
|
+
}
|
|
741
|
+
@media (min-width: 600px) {
|
|
742
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
|
|
743
|
+
--checkbox-size: 16px;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
@media not (prefers-reduced-motion) {
|
|
747
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection {
|
|
748
|
+
transition: 0.1s border-color ease-in-out;
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected {
|
|
752
|
+
background: var(--wp-admin-theme-color, #3858e9);
|
|
753
|
+
border-color: var(--wp-admin-theme-color, #3858e9);
|
|
754
|
+
}
|
|
755
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg {
|
|
756
|
+
--checkmark-size: var(--checkbox-size);
|
|
757
|
+
fill: #fff;
|
|
758
|
+
position: absolute;
|
|
759
|
+
right: 50%;
|
|
760
|
+
top: 50%;
|
|
761
|
+
transform: translate(50%, -50%);
|
|
762
|
+
width: var(--checkmark-size);
|
|
763
|
+
height: var(--checkmark-size);
|
|
764
|
+
}
|
|
765
|
+
@media (min-width: 600px) {
|
|
766
|
+
.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg {
|
|
767
|
+
--checkmark-size: calc(var(--checkbox-size) + 4px);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
524
770
|
|
|
525
771
|
.dataviews-filters__search-widget-filter-combobox__wrapper {
|
|
526
772
|
position: relative;
|
|
@@ -626,6 +872,13 @@
|
|
|
626
872
|
width: fit-content;
|
|
627
873
|
}
|
|
628
874
|
|
|
875
|
+
.dataviews-filters__user-input-widget {
|
|
876
|
+
padding: 16px;
|
|
877
|
+
}
|
|
878
|
+
.dataviews-filters__user-input-widget .components-input-control__prefix {
|
|
879
|
+
padding-right: 8px;
|
|
880
|
+
}
|
|
881
|
+
|
|
629
882
|
.dataviews-footer {
|
|
630
883
|
position: sticky;
|
|
631
884
|
bottom: 0;
|
|
@@ -1131,6 +1384,23 @@ div.dataviews-view-list {
|
|
|
1131
1384
|
.dataviews-view-table th.dataviews-view-table__actions-column {
|
|
1132
1385
|
text-align: left;
|
|
1133
1386
|
}
|
|
1387
|
+
.dataviews-view-table td.dataviews-view-table__actions-column--sticky,
|
|
1388
|
+
.dataviews-view-table th.dataviews-view-table__actions-column--sticky {
|
|
1389
|
+
position: sticky;
|
|
1390
|
+
left: 0;
|
|
1391
|
+
background-color: #fff;
|
|
1392
|
+
}
|
|
1393
|
+
.dataviews-view-table td.dataviews-view-table__actions-column--stuck::after,
|
|
1394
|
+
.dataviews-view-table th.dataviews-view-table__actions-column--stuck::after {
|
|
1395
|
+
display: block;
|
|
1396
|
+
content: "";
|
|
1397
|
+
position: absolute;
|
|
1398
|
+
top: 0;
|
|
1399
|
+
bottom: 0;
|
|
1400
|
+
right: 0;
|
|
1401
|
+
width: 1px;
|
|
1402
|
+
background-color: #f0f0f0;
|
|
1403
|
+
}
|
|
1134
1404
|
.dataviews-view-table td.dataviews-view-table__checkbox-column,
|
|
1135
1405
|
.dataviews-view-table th.dataviews-view-table__checkbox-column {
|
|
1136
1406
|
padding-left: 0;
|
|
@@ -1157,7 +1427,7 @@ div.dataviews-view-list {
|
|
|
1157
1427
|
.dataviews-view-table tr:last-child {
|
|
1158
1428
|
border-bottom: 0;
|
|
1159
1429
|
}
|
|
1160
|
-
.dataviews-view-table tr.is-hovered {
|
|
1430
|
+
.dataviews-view-table tr.is-hovered, .dataviews-view-table tr.is-hovered .dataviews-view-table__actions-column--sticky {
|
|
1161
1431
|
background-color: #f8f8f8;
|
|
1162
1432
|
}
|
|
1163
1433
|
.dataviews-view-table tr .components-checkbox-control__input.components-checkbox-control__input {
|
|
@@ -1191,6 +1461,12 @@ div.dataviews-view-list {
|
|
|
1191
1461
|
.dataviews-view-table tr.is-selected:hover {
|
|
1192
1462
|
background-color: rgba(var(--wp-admin-theme-color--rgb), 0.08);
|
|
1193
1463
|
}
|
|
1464
|
+
.dataviews-view-table tr.is-selected .dataviews-view-table__actions-column--sticky {
|
|
1465
|
+
background-color: color-mix(in srgb, rgb(var(--wp-admin-theme-color--rgb)) 4%, #fff);
|
|
1466
|
+
}
|
|
1467
|
+
.dataviews-view-table tr.is-selected:hover .dataviews-view-table__actions-column--sticky {
|
|
1468
|
+
background-color: color-mix(in srgb, rgb(var(--wp-admin-theme-color--rgb)) 8%, #fff);
|
|
1469
|
+
}
|
|
1194
1470
|
.dataviews-view-table thead {
|
|
1195
1471
|
position: sticky;
|
|
1196
1472
|
inset-block-start: 0;
|
|
@@ -1219,6 +1495,12 @@ div.dataviews-view-list {
|
|
|
1219
1495
|
display: flex;
|
|
1220
1496
|
align-items: center;
|
|
1221
1497
|
}
|
|
1498
|
+
.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-end {
|
|
1499
|
+
justify-content: flex-end;
|
|
1500
|
+
}
|
|
1501
|
+
.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-center {
|
|
1502
|
+
justify-content: center;
|
|
1503
|
+
}
|
|
1222
1504
|
.dataviews-view-table tbody .components-v-stack > .dataviews-view-table__cell-content-wrapper:not(:first-child) {
|
|
1223
1505
|
min-height: 0;
|
|
1224
1506
|
}
|
|
@@ -1291,6 +1573,11 @@ div.dataviews-view-list {
|
|
|
1291
1573
|
padding: 0;
|
|
1292
1574
|
}
|
|
1293
1575
|
|
|
1576
|
+
.dataviews-controls__datetime-number,
|
|
1577
|
+
.dataviews-controls__datetime-unit {
|
|
1578
|
+
flex: 1 1 50%;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1294
1581
|
.dataforms-layouts-panel__field {
|
|
1295
1582
|
width: 100%;
|
|
1296
1583
|
min-height: 32px;
|
|
@@ -1306,6 +1593,8 @@ div.dataviews-view-list {
|
|
|
1306
1593
|
align-items: center;
|
|
1307
1594
|
line-height: 20px;
|
|
1308
1595
|
hyphens: auto;
|
|
1596
|
+
}
|
|
1597
|
+
.dataforms-layouts-panel__field-label--label-position-side {
|
|
1309
1598
|
align-self: center;
|
|
1310
1599
|
}
|
|
1311
1600
|
|
|
@@ -1323,6 +1612,9 @@ div.dataviews-view-list {
|
|
|
1323
1612
|
text-wrap: pretty;
|
|
1324
1613
|
min-height: 32px;
|
|
1325
1614
|
}
|
|
1615
|
+
.dataforms-layouts-panel__field-control.components-button.is-link[aria-disabled=true] {
|
|
1616
|
+
text-decoration: none;
|
|
1617
|
+
}
|
|
1326
1618
|
.dataforms-layouts-panel__field-control .components-dropdown {
|
|
1327
1619
|
max-width: 100%;
|
|
1328
1620
|
}
|
|
@@ -1361,6 +1653,8 @@ div.dataviews-view-list {
|
|
|
1361
1653
|
align-items: center;
|
|
1362
1654
|
line-height: 20px;
|
|
1363
1655
|
hyphens: auto;
|
|
1656
|
+
}
|
|
1657
|
+
.dataforms-layouts-regular__field-label--label-position-side {
|
|
1364
1658
|
align-self: center;
|
|
1365
1659
|
}
|
|
1366
1660
|
|