@wordpress/dataviews 9.0.1-next.6f42e1382.0 → 9.0.1-next.a730c9c8c.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 +7 -1
- package/README.md +106 -11
- package/build/components/dataviews-filters/input-widget.js +48 -4
- package/build/components/dataviews-filters/input-widget.js.map +1 -1
- package/build/dataform-controls/array.js +9 -7
- package/build/dataform-controls/array.js.map +1 -1
- package/build/dataform-controls/checkbox.js +31 -20
- package/build/dataform-controls/checkbox.js.map +1 -1
- package/build/dataform-controls/color.js +29 -24
- package/build/dataform-controls/color.js.map +1 -1
- package/build/dataform-controls/date.js +32 -24
- package/build/dataform-controls/date.js.map +1 -1
- package/build/dataform-controls/datetime.js +133 -19
- package/build/dataform-controls/datetime.js.map +1 -1
- package/build/dataform-controls/email.js +7 -1
- package/build/dataform-controls/email.js.map +1 -1
- package/build/dataform-controls/index.js +23 -0
- package/build/dataform-controls/index.js.map +1 -1
- package/build/dataform-controls/integer.js +47 -34
- package/build/dataform-controls/integer.js.map +1 -1
- package/build/dataform-controls/radio.js +42 -9
- package/build/dataform-controls/radio.js.map +1 -1
- package/build/dataform-controls/relative-date-control.js +6 -10
- package/build/dataform-controls/relative-date-control.js.map +1 -1
- package/build/dataform-controls/select.js +41 -10
- package/build/dataform-controls/select.js.map +1 -1
- package/build/dataform-controls/telephone.js +7 -1
- package/build/dataform-controls/telephone.js.map +1 -1
- package/build/dataform-controls/text.js +14 -2
- package/build/dataform-controls/text.js.map +1 -1
- package/build/dataform-controls/textarea.js +33 -20
- package/build/dataform-controls/textarea.js.map +1 -1
- package/build/dataform-controls/toggle-group.js +36 -6
- package/build/dataform-controls/toggle-group.js.map +1 -1
- package/build/dataform-controls/toggle.js +33 -22
- package/build/dataform-controls/toggle.js.map +1 -1
- package/build/dataform-controls/url.js +7 -1
- package/build/dataform-controls/url.js.map +1 -1
- package/build/dataform-controls/utils/validated-input.js +34 -32
- package/build/dataform-controls/utils/validated-input.js.map +1 -1
- package/build/dataforms-layouts/panel/dropdown.js +10 -14
- package/build/dataforms-layouts/panel/dropdown.js.map +1 -1
- package/build/dataforms-layouts/panel/index.js +24 -11
- package/build/dataforms-layouts/panel/index.js.map +1 -1
- package/build/dataforms-layouts/panel/modal.js +22 -27
- package/build/dataforms-layouts/panel/modal.js.map +1 -1
- package/build/dataforms-layouts/panel/summary-button.js +67 -0
- package/build/dataforms-layouts/panel/summary-button.js.map +1 -0
- package/build/normalize-fields.js +17 -0
- package/build/normalize-fields.js.map +1 -1
- package/build/types.js.map +1 -1
- package/build-module/components/dataviews-filters/input-widget.js +48 -4
- package/build-module/components/dataviews-filters/input-widget.js.map +1 -1
- package/build-module/dataform-controls/array.js +9 -7
- package/build-module/dataform-controls/array.js.map +1 -1
- package/build-module/dataform-controls/checkbox.js +31 -21
- package/build-module/dataform-controls/checkbox.js.map +1 -1
- package/build-module/dataform-controls/color.js +28 -24
- package/build-module/dataform-controls/color.js.map +1 -1
- package/build-module/dataform-controls/date.js +32 -24
- package/build-module/dataform-controls/date.js.map +1 -1
- package/build-module/dataform-controls/datetime.js +135 -21
- package/build-module/dataform-controls/datetime.js.map +1 -1
- package/build-module/dataform-controls/email.js +7 -1
- package/build-module/dataform-controls/email.js.map +1 -1
- package/build-module/dataform-controls/index.js +23 -0
- package/build-module/dataform-controls/index.js.map +1 -1
- package/build-module/dataform-controls/integer.js +46 -34
- package/build-module/dataform-controls/integer.js.map +1 -1
- package/build-module/dataform-controls/radio.js +44 -11
- package/build-module/dataform-controls/radio.js.map +1 -1
- package/build-module/dataform-controls/relative-date-control.js +6 -10
- package/build-module/dataform-controls/relative-date-control.js.map +1 -1
- package/build-module/dataform-controls/select.js +43 -12
- package/build-module/dataform-controls/select.js.map +1 -1
- package/build-module/dataform-controls/telephone.js +7 -1
- package/build-module/dataform-controls/telephone.js.map +1 -1
- package/build-module/dataform-controls/text.js +14 -2
- package/build-module/dataform-controls/text.js.map +1 -1
- package/build-module/dataform-controls/textarea.js +32 -20
- package/build-module/dataform-controls/textarea.js.map +1 -1
- package/build-module/dataform-controls/toggle-group.js +38 -8
- package/build-module/dataform-controls/toggle-group.js.map +1 -1
- package/build-module/dataform-controls/toggle.js +33 -23
- package/build-module/dataform-controls/toggle.js.map +1 -1
- package/build-module/dataform-controls/url.js +7 -1
- package/build-module/dataform-controls/url.js.map +1 -1
- package/build-module/dataform-controls/utils/validated-input.js +34 -33
- package/build-module/dataform-controls/utils/validated-input.js.map +1 -1
- package/build-module/dataforms-layouts/panel/dropdown.js +10 -15
- package/build-module/dataforms-layouts/panel/dropdown.js.map +1 -1
- package/build-module/dataforms-layouts/panel/index.js +24 -11
- package/build-module/dataforms-layouts/panel/index.js.map +1 -1
- package/build-module/dataforms-layouts/panel/modal.js +22 -28
- package/build-module/dataforms-layouts/panel/modal.js.map +1 -1
- package/build-module/dataforms-layouts/panel/summary-button.js +60 -0
- package/build-module/dataforms-layouts/panel/summary-button.js.map +1 -0
- package/build-module/normalize-fields.js +15 -0
- package/build-module/normalize-fields.js.map +1 -1
- package/build-module/types.js.map +1 -1
- package/build-types/components/dataform/stories/index.story.d.ts +3 -0
- package/build-types/components/dataform/stories/index.story.d.ts.map +1 -1
- package/build-types/components/dataviews/stories/fixtures.d.ts +4 -2
- package/build-types/components/dataviews/stories/fixtures.d.ts.map +1 -1
- package/build-types/components/dataviews-filters/input-widget.d.ts.map +1 -1
- package/build-types/dataform-controls/array.d.ts.map +1 -1
- package/build-types/dataform-controls/checkbox.d.ts.map +1 -1
- package/build-types/dataform-controls/color.d.ts.map +1 -1
- package/build-types/dataform-controls/date.d.ts.map +1 -1
- package/build-types/dataform-controls/datetime.d.ts.map +1 -1
- package/build-types/dataform-controls/email.d.ts.map +1 -1
- 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.map +1 -1
- package/build-types/dataform-controls/radio.d.ts.map +1 -1
- package/build-types/dataform-controls/relative-date-control.d.ts +6 -5
- package/build-types/dataform-controls/relative-date-control.d.ts.map +1 -1
- package/build-types/dataform-controls/select.d.ts.map +1 -1
- package/build-types/dataform-controls/telephone.d.ts.map +1 -1
- package/build-types/dataform-controls/text.d.ts +1 -1
- package/build-types/dataform-controls/text.d.ts.map +1 -1
- package/build-types/dataform-controls/textarea.d.ts +1 -1
- package/build-types/dataform-controls/textarea.d.ts.map +1 -1
- package/build-types/dataform-controls/toggle-group.d.ts.map +1 -1
- package/build-types/dataform-controls/toggle.d.ts.map +1 -1
- package/build-types/dataform-controls/url.d.ts.map +1 -1
- package/build-types/dataform-controls/utils/validated-input.d.ts +4 -4
- package/build-types/dataform-controls/utils/validated-input.d.ts.map +1 -1
- package/build-types/dataforms-layouts/panel/dropdown.d.ts +2 -1
- package/build-types/dataforms-layouts/panel/dropdown.d.ts.map +1 -1
- package/build-types/dataforms-layouts/panel/index.d.ts.map +1 -1
- package/build-types/dataforms-layouts/panel/modal.d.ts +2 -1
- package/build-types/dataforms-layouts/panel/modal.d.ts.map +1 -1
- package/build-types/dataforms-layouts/panel/summary-button.d.ts +15 -0
- package/build-types/dataforms-layouts/panel/summary-button.d.ts.map +1 -0
- package/build-types/field-types/stories/index.story.d.ts.map +1 -1
- package/build-types/normalize-fields.d.ts +3 -0
- package/build-types/normalize-fields.d.ts.map +1 -1
- package/build-types/types.d.ts +66 -3
- package/build-types/types.d.ts.map +1 -1
- package/build-wp/index.js +1468 -1422
- package/package.json +16 -15
- package/src/components/dataform/stories/index.story.tsx +436 -7
- package/src/components/dataviews/stories/fixtures.tsx +99 -41
- package/src/components/dataviews/stories/index.story.tsx +1 -1
- package/src/components/dataviews-filters/input-widget.tsx +44 -5
- package/src/components/dataviews-picker/stories/index.story.tsx +1 -1
- package/src/dataform-controls/array.tsx +4 -6
- package/src/dataform-controls/checkbox.tsx +41 -24
- package/src/dataform-controls/color.tsx +33 -24
- package/src/dataform-controls/date.tsx +47 -21
- package/src/dataform-controls/datetime.tsx +171 -23
- package/src/dataform-controls/email.tsx +9 -1
- package/src/dataform-controls/index.tsx +26 -0
- package/src/dataform-controls/integer.tsx +82 -49
- package/src/dataform-controls/radio.tsx +53 -11
- package/src/dataform-controls/relative-date-control.tsx +11 -10
- package/src/dataform-controls/select.tsx +53 -10
- package/src/dataform-controls/telephone.tsx +9 -1
- package/src/dataform-controls/text.tsx +18 -1
- package/src/dataform-controls/textarea.tsx +38 -24
- package/src/dataform-controls/toggle-group.tsx +50 -10
- package/src/dataform-controls/toggle.tsx +41 -24
- package/src/dataform-controls/url.tsx +9 -1
- package/src/dataform-controls/utils/validated-input.tsx +50 -50
- package/src/dataforms-layouts/panel/dropdown.tsx +12 -23
- package/src/dataforms-layouts/panel/index.tsx +39 -16
- package/src/dataforms-layouts/panel/modal.tsx +24 -30
- package/src/dataforms-layouts/panel/summary-button.tsx +92 -0
- package/src/field-types/stories/index.story.tsx +89 -1
- package/src/normalize-fields.ts +18 -0
- package/src/test/filter-and-sort-data-view.js +148 -138
- package/src/test/normalize-fields.ts +114 -0
- package/src/types.ts +73 -3
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = Textarea;
|
|
8
|
+
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
|
7
9
|
var _components = require("@wordpress/components");
|
|
8
10
|
var _element = require("@wordpress/element");
|
|
9
11
|
var _lockUnlock = require("../lock-unlock");
|
|
10
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* External dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
11
17
|
/**
|
|
12
18
|
* WordPress dependencies
|
|
13
19
|
*/
|
|
@@ -23,43 +29,50 @@ function Textarea({
|
|
|
23
29
|
data,
|
|
24
30
|
field,
|
|
25
31
|
onChange,
|
|
26
|
-
hideLabelFromVision
|
|
32
|
+
hideLabelFromVision,
|
|
33
|
+
config
|
|
27
34
|
}) {
|
|
28
35
|
const {
|
|
29
|
-
|
|
36
|
+
rows = 4
|
|
37
|
+
} = config || {};
|
|
38
|
+
const {
|
|
30
39
|
label,
|
|
31
40
|
placeholder,
|
|
32
|
-
description
|
|
41
|
+
description,
|
|
42
|
+
setValue
|
|
33
43
|
} = field;
|
|
34
44
|
const value = field.getValue({
|
|
35
45
|
item: data
|
|
36
46
|
});
|
|
37
47
|
const [customValidity, setCustomValidity] = (0, _element.useState)(undefined);
|
|
38
|
-
const onChangeControl = (0, _element.useCallback)(newValue => onChange({
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
const onChangeControl = (0, _element.useCallback)(newValue => onChange(setValue({
|
|
49
|
+
item: data,
|
|
50
|
+
value: newValue
|
|
51
|
+
})), [data, onChange, setValue]);
|
|
52
|
+
const onValidateControl = (0, _element.useCallback)(newValue => {
|
|
53
|
+
const message = field.isValid?.custom?.((0, _deepmerge.default)(data, setValue({
|
|
54
|
+
item: data,
|
|
55
|
+
value: newValue
|
|
56
|
+
})), field);
|
|
57
|
+
if (message) {
|
|
58
|
+
setCustomValidity({
|
|
59
|
+
type: 'invalid',
|
|
60
|
+
message
|
|
61
|
+
});
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
setCustomValidity(undefined);
|
|
65
|
+
}, [data, field, setValue]);
|
|
41
66
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ValidatedTextareaControl, {
|
|
42
67
|
required: !!field.isValid?.required,
|
|
43
|
-
onValidate:
|
|
44
|
-
const message = field.isValid?.custom?.({
|
|
45
|
-
...data,
|
|
46
|
-
[id]: newValue
|
|
47
|
-
}, field);
|
|
48
|
-
if (message) {
|
|
49
|
-
setCustomValidity({
|
|
50
|
-
type: 'invalid',
|
|
51
|
-
message
|
|
52
|
-
});
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
setCustomValidity(undefined);
|
|
56
|
-
},
|
|
68
|
+
onValidate: onValidateControl,
|
|
57
69
|
customValidity: customValidity,
|
|
58
70
|
label: label,
|
|
59
71
|
placeholder: placeholder,
|
|
60
72
|
value: value !== null && value !== void 0 ? value : '',
|
|
61
73
|
help: description,
|
|
62
74
|
onChange: onChangeControl,
|
|
75
|
+
rows: rows,
|
|
63
76
|
__next40pxDefaultSize: true,
|
|
64
77
|
__nextHasNoMarginBottom: true,
|
|
65
78
|
hideLabelFromVision: hideLabelFromVision
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_deepmerge","_interopRequireDefault","require","_components","_element","_lockUnlock","_jsxRuntime","ValidatedTextareaControl","unlock","privateApis","Textarea","data","field","onChange","hideLabelFromVision","config","rows","label","placeholder","description","setValue","value","getValue","item","customValidity","setCustomValidity","useState","undefined","onChangeControl","useCallback","newValue","onValidateControl","message","isValid","custom","deepMerge","type","jsx","required","onValidate","help","__next40pxDefaultSize","__nextHasNoMarginBottom"],"sources":["@wordpress/dataviews/src/dataform-controls/textarea.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepMerge from 'deepmerge';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis } from '@wordpress/components';\nimport { useCallback, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DataFormControlProps } from '../types';\nimport { unlock } from '../lock-unlock';\n\nconst { ValidatedTextareaControl } = unlock( privateApis );\n\nexport default function Textarea< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\tconfig,\n}: DataFormControlProps< Item > ) {\n\tconst { rows = 4 } = config || {};\n\tconst { label, placeholder, description, setValue } = field;\n\tconst value = field.getValue( { item: data } );\n\tconst [ customValidity, setCustomValidity ] =\n\t\tuseState<\n\t\t\tReact.ComponentProps<\n\t\t\t\ttypeof ValidatedTextareaControl\n\t\t\t>[ 'customValidity' ]\n\t\t>( undefined );\n\n\tconst onChangeControl = useCallback(\n\t\t( newValue: string ) =>\n\t\t\tonChange( setValue( { item: data, value: newValue } ) ),\n\t\t[ data, onChange, setValue ]\n\t);\n\n\tconst onValidateControl = useCallback(\n\t\t( newValue: any ) => {\n\t\t\tconst message = field.isValid?.custom?.(\n\t\t\t\tdeepMerge(\n\t\t\t\t\tdata,\n\t\t\t\t\tsetValue( {\n\t\t\t\t\t\titem: data,\n\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t} ) as Partial< Item >\n\t\t\t\t),\n\t\t\t\tfield\n\t\t\t);\n\n\t\t\tif ( message ) {\n\t\t\t\tsetCustomValidity( {\n\t\t\t\t\ttype: 'invalid',\n\t\t\t\t\tmessage,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetCustomValidity( undefined );\n\t\t},\n\t\t[ data, field, setValue ]\n\t);\n\n\treturn (\n\t\t<ValidatedTextareaControl\n\t\t\trequired={ !! field.isValid?.required }\n\t\t\tonValidate={ onValidateControl }\n\t\t\tcustomValidity={ customValidity }\n\t\t\tlabel={ label }\n\t\t\tplaceholder={ placeholder }\n\t\t\tvalue={ value ?? '' }\n\t\t\thelp={ description }\n\t\t\tonChange={ onChangeControl }\n\t\t\trows={ rows }\n\t\t\t__next40pxDefaultSize\n\t\t\t__nextHasNoMarginBottom\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAMA,IAAAG,WAAA,GAAAH,OAAA;AAAwC,IAAAI,WAAA,GAAAJ,OAAA;AAfxC;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAM;EAAEK;AAAyB,CAAC,GAAG,IAAAC,kB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Q,EAAG,CAAC,CAAE1B,KAAK,CAACqB,OAAO,EAAEK,QAAU;IACvCC,UAAU,EAAGR,iBAAmB;IAChCP,cAAc,EAAGA,cAAgB;IACjCP,KAAK,EAAGA,KAAO;IACfC,WAAW,EAAGA,WAAa;IAC3BG,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAI;IACrBmB,IAAI,EAAGrB,WAAa;IACpBN,QAAQ,EAAGe,eAAiB;IAC5BZ,IAAI,EAAGA,IAAM;IACbyB,qBAAqB;IACrBC,uBAAuB;IACvB5B,mBAAmB,EAAGA;EAAqB,CAC3C,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = ToggleGroup;
|
|
8
|
+
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
|
7
9
|
var _components = require("@wordpress/components");
|
|
8
10
|
var _element = require("@wordpress/element");
|
|
11
|
+
var _lockUnlock = require("../lock-unlock");
|
|
9
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* External dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
10
17
|
/**
|
|
11
18
|
* WordPress dependencies
|
|
12
19
|
*/
|
|
@@ -15,6 +22,9 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
22
|
* Internal dependencies
|
|
16
23
|
*/
|
|
17
24
|
|
|
25
|
+
const {
|
|
26
|
+
ValidatedToggleGroupControl
|
|
27
|
+
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
18
28
|
function ToggleGroup({
|
|
19
29
|
data,
|
|
20
30
|
field,
|
|
@@ -22,17 +32,37 @@ function ToggleGroup({
|
|
|
22
32
|
hideLabelFromVision
|
|
23
33
|
}) {
|
|
24
34
|
const {
|
|
25
|
-
|
|
35
|
+
getValue,
|
|
36
|
+
setValue
|
|
26
37
|
} = field;
|
|
27
|
-
const
|
|
38
|
+
const [customValidity, setCustomValidity] = (0, _element.useState)(undefined);
|
|
39
|
+
const value = getValue({
|
|
28
40
|
item: data
|
|
29
41
|
});
|
|
30
|
-
const onChangeControl = (0, _element.useCallback)(newValue => onChange({
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
const onChangeControl = (0, _element.useCallback)(newValue => onChange(setValue({
|
|
43
|
+
item: data,
|
|
44
|
+
value: newValue
|
|
45
|
+
})), [data, onChange, setValue]);
|
|
46
|
+
const onValidateControl = (0, _element.useCallback)(newValue => {
|
|
47
|
+
const message = field.isValid?.custom?.((0, _deepmerge.default)(data, setValue({
|
|
48
|
+
item: data,
|
|
49
|
+
value: newValue
|
|
50
|
+
})), field);
|
|
51
|
+
if (message) {
|
|
52
|
+
setCustomValidity({
|
|
53
|
+
type: 'invalid',
|
|
54
|
+
message
|
|
55
|
+
});
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
setCustomValidity(undefined);
|
|
59
|
+
}, [data, field, setValue]);
|
|
33
60
|
if (field.elements) {
|
|
34
61
|
const selectedOption = field.elements.find(el => el.value === value);
|
|
35
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
62
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ValidatedToggleGroupControl, {
|
|
63
|
+
required: !!field.isValid?.required,
|
|
64
|
+
onValidate: onValidateControl,
|
|
65
|
+
customValidity: customValidity,
|
|
36
66
|
__next40pxDefaultSize: true,
|
|
37
67
|
__nextHasNoMarginBottom: true,
|
|
38
68
|
isBlock: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_deepmerge","_interopRequireDefault","require","_components","_element","_lockUnlock","_jsxRuntime","ValidatedToggleGroupControl","unlock","privateApis","ToggleGroup","data","field","onChange","hideLabelFromVision","getValue","setValue","customValidity","setCustomValidity","useState","undefined","value","item","onChangeControl","useCallback","newValue","onValidateControl","message","isValid","custom","deepMerge","type","elements","selectedOption","find","el","jsx","required","onValidate","__next40pxDefaultSize","__nextHasNoMarginBottom","isBlock","label","help","description","children","map","__experimentalToggleGroupControlOption"],"sources":["@wordpress/dataviews/src/dataform-controls/toggle-group.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepMerge from 'deepmerge';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { useCallback, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DataFormControlProps } from '../types';\nimport { unlock } from '../lock-unlock';\n\nconst { ValidatedToggleGroupControl } = unlock( privateApis );\n\nexport default function ToggleGroup< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n}: DataFormControlProps< Item > ) {\n\tconst { getValue, setValue } = field;\n\tconst [ customValidity, setCustomValidity ] =\n\t\tuseState<\n\t\t\tReact.ComponentProps<\n\t\t\t\ttypeof ValidatedToggleGroupControl\n\t\t\t>[ 'customValidity' ]\n\t\t>( undefined );\n\tconst value = getValue( { item: data } );\n\n\tconst onChangeControl = useCallback(\n\t\t( newValue: string | number | undefined ) =>\n\t\t\tonChange( setValue( { item: data, value: newValue } ) ),\n\t\t[ data, onChange, setValue ]\n\t);\n\tconst onValidateControl = useCallback(\n\t\t( newValue: any ) => {\n\t\t\tconst message = field.isValid?.custom?.(\n\t\t\t\tdeepMerge(\n\t\t\t\t\tdata,\n\t\t\t\t\tsetValue( {\n\t\t\t\t\t\titem: data,\n\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t} ) as Partial< Item >\n\t\t\t\t),\n\t\t\t\tfield\n\t\t\t);\n\n\t\t\tif ( message ) {\n\t\t\t\tsetCustomValidity( {\n\t\t\t\t\ttype: 'invalid',\n\t\t\t\t\tmessage,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetCustomValidity( undefined );\n\t\t},\n\t\t[ data, field, setValue ]\n\t);\n\n\tif ( field.elements ) {\n\t\tconst selectedOption = field.elements.find(\n\t\t\t( el ) => el.value === value\n\t\t);\n\t\treturn (\n\t\t\t<ValidatedToggleGroupControl\n\t\t\t\trequired={ !! field.isValid?.required }\n\t\t\t\tonValidate={ onValidateControl }\n\t\t\t\tcustomValidity={ customValidity }\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tisBlock\n\t\t\t\tlabel={ field.label }\n\t\t\t\thelp={ selectedOption?.description || field.description }\n\t\t\t\tonChange={ onChangeControl }\n\t\t\t\tvalue={ value }\n\t\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\t>\n\t\t\t\t{ field.elements.map( ( el ) => (\n\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\tkey={ el.value }\n\t\t\t\t\t\tlabel={ el.label }\n\t\t\t\t\t\tvalue={ el.value }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t</ValidatedToggleGroupControl>\n\t\t);\n\t}\n\n\treturn null;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AAMA,IAAAG,WAAA,GAAAH,OAAA;AAAwC,IAAAI,WAAA,GAAAJ,OAAA;AAlBxC;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;;AAIA,MAAM;EAAEK;AAA4B,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAY,CAAC;AAE9C,SAASC,WAAWA,CAAU;EAC5CC,IAAI;EACJC,KAAK;EACLC,QAAQ;EACRC;AAC6B,CAAC,EAAG;EACjC,MAAM;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GA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;MACvBC,OAAO;MACPC,KAAK,EAAG9B,KAAK,CAAC8B,KAAO;MACrBC,IAAI,EAAGV,cAAc,EAAEW,WAAW,IAAIhC,KAAK,CAACgC,WAAa;MACzD/B,QAAQ,EAAGU,eAAiB;MAC5BF,KAAK,EAAGA,KAAO;MACfP,mBAAmB,EAAGA,mBAAqB;MAAA+B,QAAA,EAEzCjC,KAAK,CAACoB,QAAQ,CAACc,GAAG,CAAIX,EAAE,iBACzB,IAAA7B,WAAA,CAAA8B,GAAA,EAACjC,WAAA,CAAA4C,sCAAwB;QAExBL,KAAK,EAAGP,EAAE,CAACO,KAAO;QAClBrB,KAAK,EAAGc,EAAE,CAACd;MAAO,GAFZc,EAAE,CAACd,KAGT,CACA;IAAC,CACyB,CAAC;EAEhC;EAEA,OAAO,IAAI;AACZ","ignoreList":[]}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = Toggle;
|
|
8
|
+
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
|
7
9
|
var _components = require("@wordpress/components");
|
|
8
10
|
var _element = require("@wordpress/element");
|
|
9
11
|
var _lockUnlock = require("../lock-unlock");
|
|
10
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* External dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
11
17
|
/**
|
|
12
18
|
* WordPress dependencies
|
|
13
19
|
*/
|
|
@@ -26,28 +32,37 @@ function Toggle({
|
|
|
26
32
|
hideLabelFromVision
|
|
27
33
|
}) {
|
|
28
34
|
const {
|
|
29
|
-
id,
|
|
30
|
-
getValue,
|
|
31
35
|
label,
|
|
32
|
-
description
|
|
36
|
+
description,
|
|
37
|
+
getValue,
|
|
38
|
+
setValue
|
|
33
39
|
} = field;
|
|
34
40
|
const [customValidity, setCustomValidity] = (0, _element.useState)(undefined);
|
|
41
|
+
const onChangeControl = (0, _element.useCallback)(() => {
|
|
42
|
+
onChange(setValue({
|
|
43
|
+
item: data,
|
|
44
|
+
value: !getValue({
|
|
45
|
+
item: data
|
|
46
|
+
})
|
|
47
|
+
}));
|
|
48
|
+
}, [onChange, setValue, data, getValue]);
|
|
49
|
+
const onValidateControl = (0, _element.useCallback)(newValue => {
|
|
50
|
+
const message = field.isValid?.custom?.((0, _deepmerge.default)(data, setValue({
|
|
51
|
+
item: data,
|
|
52
|
+
value: newValue
|
|
53
|
+
})), field);
|
|
54
|
+
if (message) {
|
|
55
|
+
setCustomValidity({
|
|
56
|
+
type: 'invalid',
|
|
57
|
+
message
|
|
58
|
+
});
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
setCustomValidity(undefined);
|
|
62
|
+
}, [data, field, setValue]);
|
|
35
63
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ValidatedToggleControl, {
|
|
36
64
|
required: !!field.isValid.required,
|
|
37
|
-
onValidate:
|
|
38
|
-
const message = field.isValid?.custom?.({
|
|
39
|
-
...data,
|
|
40
|
-
[id]: newValue
|
|
41
|
-
}, field);
|
|
42
|
-
if (message) {
|
|
43
|
-
setCustomValidity({
|
|
44
|
-
type: 'invalid',
|
|
45
|
-
message
|
|
46
|
-
});
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
setCustomValidity(undefined);
|
|
50
|
-
},
|
|
65
|
+
onValidate: onValidateControl,
|
|
51
66
|
customValidity: customValidity,
|
|
52
67
|
hidden: hideLabelFromVision,
|
|
53
68
|
__nextHasNoMarginBottom: true,
|
|
@@ -56,11 +71,7 @@ function Toggle({
|
|
|
56
71
|
checked: getValue({
|
|
57
72
|
item: data
|
|
58
73
|
}),
|
|
59
|
-
onChange:
|
|
60
|
-
[id]: !getValue({
|
|
61
|
-
item: data
|
|
62
|
-
})
|
|
63
|
-
})
|
|
74
|
+
onChange: onChangeControl
|
|
64
75
|
});
|
|
65
76
|
}
|
|
66
77
|
//# sourceMappingURL=toggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_deepmerge","_interopRequireDefault","require","_components","_element","_lockUnlock","_jsxRuntime","ValidatedToggleControl","unlock","privateApis","Toggle","field","onChange","data","hideLabelFromVision","label","description","getValue","setValue","customValidity","setCustomValidity","useState","undefined","onChangeControl","useCallback","item","value","onValidateControl","newValue","message","isValid","custom","deepMerge","type","jsx","required","onValidate","hidden","__nextHasNoMarginBottom","help","checked"],"sources":["@wordpress/dataviews/src/dataform-controls/toggle.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepMerge from 'deepmerge';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis } from '@wordpress/components';\nimport { useCallback, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DataFormControlProps } from '../types';\nimport { unlock } from '../lock-unlock';\n\nconst { ValidatedToggleControl } = unlock( privateApis );\n\nexport default function Toggle< Item >( {\n\tfield,\n\tonChange,\n\tdata,\n\thideLabelFromVision,\n}: DataFormControlProps< Item > ) {\n\tconst { label, description, getValue, setValue } = field;\n\tconst [ customValidity, setCustomValidity ] =\n\t\tuseState<\n\t\t\tReact.ComponentProps<\n\t\t\t\ttypeof ValidatedToggleControl\n\t\t\t>[ 'customValidity' ]\n\t\t>( undefined );\n\n\tconst onChangeControl = useCallback( () => {\n\t\tonChange(\n\t\t\tsetValue( { item: data, value: ! getValue( { item: data } ) } )\n\t\t);\n\t}, [ onChange, setValue, data, getValue ] );\n\n\tconst onValidateControl = useCallback(\n\t\t( newValue: any ) => {\n\t\t\tconst message = field.isValid?.custom?.(\n\t\t\t\tdeepMerge(\n\t\t\t\t\tdata,\n\t\t\t\t\tsetValue( {\n\t\t\t\t\t\titem: data,\n\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t} ) as Partial< Item >\n\t\t\t\t),\n\t\t\t\tfield\n\t\t\t);\n\n\t\t\tif ( message ) {\n\t\t\t\tsetCustomValidity( {\n\t\t\t\t\ttype: 'invalid',\n\t\t\t\t\tmessage,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetCustomValidity( undefined );\n\t\t},\n\t\t[ data, field, setValue ]\n\t);\n\n\treturn (\n\t\t<ValidatedToggleControl\n\t\t\trequired={ !! field.isValid.required }\n\t\t\tonValidate={ onValidateControl }\n\t\t\tcustomValidity={ customValidity }\n\t\t\thidden={ hideLabelFromVision }\n\t\t\t__nextHasNoMarginBottom\n\t\t\tlabel={ label }\n\t\t\thelp={ description }\n\t\t\tchecked={ getValue( { item: data } ) }\n\t\t\tonChange={ onChangeControl }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAMA,IAAAG,WAAA,GAAAH,OAAA;AAAwC,IAAAI,WAAA,GAAAJ,OAAA;AAfxC;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAM;EAAEK;AAAuB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAY,CAAC;AAEzC,SAASC,MAAMA,CAAU;EACvCC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC;AAC6B,CAAC,EAAG;EACjC,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC,QAAQ;IAAEC;EAAS,CAAC,GAAGP,KAAK;EACxD,MAAM,CAAEQ,cAAc,EAAEC,iBAAiB,CAAE,GAC1C,IAAAC,iBAAQ,EAILC,SAAU,CAAC;EAEf,MAAMC,eAAe,GAAG,IAAAC,oBAAW,EAAE,MAAM;IAC1CZ,QAAQ,CACPM,QAAQ,CAAE;MAAEO,IAAI,EAAEZ,IAAI;MAAEa,KAAK,EAAE,CAAET,QAAQ,CAAE;QAAEQ,IAAI,EAAEZ;MAAK,CAAE;IAAE,CAAE,CAC/D,CAAC;EACF,CAAC,EAAE,CAAED,QAAQ,EAAEM,QAAQ,EAAEL,IAAI,EAAEI,QAAQ,CAAG,CAAC;EAE3C,MAAMU,iBAAiB,GAAG,IAAAH,oBAAW,EAClCI,QAAa,IAAM;IACpB,MAAMC,OAAO,GAAGlB,KAAK,CAACmB,OAAO,EAAEC,MAAM,GACpC,IAAAC,kBAAS,EACRnB,IAAI,EACJK,QAAQ,CAAE;MACTO,IAAI,EAAEZ,IAAI;MACVa,KAAK,EAAEE;IACR,CAAE,CACH,CAAC,EACDjB,KACD,CAAC;IAED,IAAKkB,OAAO,EAAG;MACdT,iBAAiB,CAAE;QAClBa,IAAI,EAAE,SAAS;QACfJ;MACD,CAAE,CAAC;MACH;IACD;IAEAT,iBAAiB,CAAEE,SAAU,CAAC;EAC/B,CAAC,EACD,CAAET,IAAI,EAAEF,KAAK,EAAEO,QAAQ,CACxB,CAAC;EAED,oBACC,IAAAZ,WAAA,CAAA4B,GAAA,EAAC3B,sBAAsB;IACtB4B,QAAQ,EAAG,CAAC,CAAExB,KAAK,CAACmB,OAAO,CAACK,QAAU;IACtCC,UAAU,EAAGT,iBAAmB;IAChCR,cAAc,EAAGA,cAAgB;IACjCkB,MAAM,EAAGvB,mBAAqB;IAC9BwB,uBAAuB;IACvBvB,KAAK,EAAGA,KAAO;IACfwB,IAAI,EAAGvB,WAAa;IACpBwB,OAAO,EAAGvB,QAAQ,CAAE;MAAEQ,IAAI,EAAEZ;IAAK,CAAE,CAAG;IACtCD,QAAQ,EAAGW;EAAiB,CAC5B,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = Url;
|
|
8
|
+
var _components = require("@wordpress/components");
|
|
8
9
|
var _icons = require("@wordpress/icons");
|
|
9
10
|
var _validatedInput = _interopRequireDefault(require("./utils/validated-input"));
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
@@ -28,7 +29,12 @@ function Url({
|
|
|
28
29
|
onChange,
|
|
29
30
|
hideLabelFromVision,
|
|
30
31
|
type: 'url',
|
|
31
|
-
|
|
32
|
+
prefix: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControlPrefixWrapper, {
|
|
33
|
+
variant: "icon",
|
|
34
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
35
|
+
icon: _icons.link
|
|
36
|
+
})
|
|
37
|
+
})
|
|
32
38
|
});
|
|
33
39
|
}
|
|
34
40
|
//# sourceMappingURL=url.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_components","require","_icons","_validatedInput","_interopRequireDefault","_jsxRuntime","Url","data","field","onChange","hideLabelFromVision","jsx","default","type","prefix","__experimentalInputControlPrefixWrapper","variant","children","Icon","icon","link"],"sources":["@wordpress/dataviews/src/dataform-controls/url.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalInputControlPrefixWrapper as InputControlPrefixWrapper,\n} from '@wordpress/components';\nimport { link } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { DataFormControlProps } from '../types';\nimport ValidatedText from './utils/validated-input';\n\nexport default function Url< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n}: DataFormControlProps< Item > ) {\n\treturn (\n\t\t<ValidatedText\n\t\t\t{ ...{\n\t\t\t\tdata,\n\t\t\t\tfield,\n\t\t\t\tonChange,\n\t\t\t\thideLabelFromVision,\n\t\t\t\ttype: 'url',\n\t\t\t\tprefix: (\n\t\t\t\t\t<InputControlPrefixWrapper variant=\"icon\">\n\t\t\t\t\t\t<Icon icon={ link } />\n\t\t\t\t\t</InputControlPrefixWrapper>\n\t\t\t\t),\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAMA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AAAoD,IAAAI,WAAA,GAAAJ,OAAA;AAbpD;AACA;AACA;;AAOA;AACA;AACA;;AAIe,SAASK,GAAGA,CAAU;EACpCC,IAAI;EACJC,KAAK;EACLC,QAAQ;EACRC;AAC6B,CAAC,EAAG;EACjC,oBACC,IAAAL,WAAA,CAAAM,GAAA,EAACR,eAAA,CAAAS,OAAa;IAEZL,IAAI;IACJC,KAAK;IACLC,QAAQ;IACRC,mBAAmB;IACnBG,IAAI,EAAE,KAAK;IACXC,MAAM,eACL,IAAAT,WAAA,CAAAM,GAAA,EAACX,WAAA,CAAAe,uCAAyB;MAACC,OAAO,EAAC,MAAM;MAAAC,QAAA,eACxC,IAAAZ,WAAA,CAAAM,GAAA,EAACX,WAAA,CAAAkB,IAAI;QAACC,IAAI,EAAGC;MAAM,CAAE;IAAC,CACI;EAC3B,CAEF,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.default = ValidatedText;
|
|
8
|
+
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
|
7
9
|
var _components = require("@wordpress/components");
|
|
8
10
|
var _element = require("@wordpress/element");
|
|
9
11
|
var _lockUnlock = require("../../lock-unlock");
|
|
10
12
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
/**
|
|
14
|
+
* External dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
11
17
|
/**
|
|
12
18
|
* WordPress dependencies
|
|
13
19
|
*/
|
|
@@ -25,38 +31,42 @@ function ValidatedText({
|
|
|
25
31
|
onChange,
|
|
26
32
|
hideLabelFromVision,
|
|
27
33
|
type,
|
|
28
|
-
|
|
34
|
+
prefix,
|
|
29
35
|
suffix
|
|
30
36
|
}) {
|
|
31
37
|
const {
|
|
32
|
-
id,
|
|
33
38
|
label,
|
|
34
39
|
placeholder,
|
|
35
|
-
description
|
|
40
|
+
description,
|
|
41
|
+
getValue,
|
|
42
|
+
setValue,
|
|
43
|
+
isValid
|
|
36
44
|
} = field;
|
|
37
|
-
const value =
|
|
45
|
+
const value = getValue({
|
|
38
46
|
item: data
|
|
39
47
|
});
|
|
40
48
|
const [customValidity, setCustomValidity] = (0, _element.useState)(undefined);
|
|
41
|
-
const onChangeControl = (0, _element.useCallback)(newValue => onChange({
|
|
42
|
-
|
|
43
|
-
|
|
49
|
+
const onChangeControl = (0, _element.useCallback)(newValue => onChange(setValue({
|
|
50
|
+
item: data,
|
|
51
|
+
value: newValue
|
|
52
|
+
})), [data, setValue, onChange]);
|
|
53
|
+
const onValidateControl = (0, _element.useCallback)(newValue => {
|
|
54
|
+
const message = isValid?.custom?.((0, _deepmerge.default)(data, setValue({
|
|
55
|
+
item: data,
|
|
56
|
+
value: newValue
|
|
57
|
+
})), field);
|
|
58
|
+
if (message) {
|
|
59
|
+
setCustomValidity({
|
|
60
|
+
type: 'invalid',
|
|
61
|
+
message
|
|
62
|
+
});
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
setCustomValidity(undefined);
|
|
66
|
+
}, [data, field, isValid, setValue]);
|
|
44
67
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ValidatedInputControl, {
|
|
45
|
-
required: !!
|
|
46
|
-
onValidate:
|
|
47
|
-
const message = field.isValid?.custom?.({
|
|
48
|
-
...data,
|
|
49
|
-
[id]: newValue
|
|
50
|
-
}, field);
|
|
51
|
-
if (message) {
|
|
52
|
-
setCustomValidity({
|
|
53
|
-
type: 'invalid',
|
|
54
|
-
message
|
|
55
|
-
});
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
setCustomValidity(undefined);
|
|
59
|
-
},
|
|
68
|
+
required: !!isValid?.required,
|
|
69
|
+
onValidate: onValidateControl,
|
|
60
70
|
customValidity: customValidity,
|
|
61
71
|
label: label,
|
|
62
72
|
placeholder: placeholder,
|
|
@@ -65,16 +75,8 @@ function ValidatedText({
|
|
|
65
75
|
onChange: onChangeControl,
|
|
66
76
|
hideLabelFromVision: hideLabelFromVision,
|
|
67
77
|
type: type,
|
|
68
|
-
prefix:
|
|
69
|
-
|
|
70
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
71
|
-
icon: icon
|
|
72
|
-
})
|
|
73
|
-
}) : undefined,
|
|
74
|
-
suffix: suffix ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalInputControlSuffixWrapper, {
|
|
75
|
-
variant: "control",
|
|
76
|
-
children: suffix
|
|
77
|
-
}) : undefined,
|
|
78
|
+
prefix: prefix,
|
|
79
|
+
suffix: suffix,
|
|
78
80
|
__next40pxDefaultSize: true
|
|
79
81
|
});
|
|
80
82
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_deepmerge","_interopRequireDefault","require","_components","_element","_lockUnlock","_jsxRuntime","ValidatedInputControl","unlock","privateApis","ValidatedText","data","field","onChange","hideLabelFromVision","type","prefix","suffix","label","placeholder","description","getValue","setValue","isValid","value","item","customValidity","setCustomValidity","useState","undefined","onChangeControl","useCallback","newValue","onValidateControl","message","custom","deepMerge","jsx","required","onValidate","help","__next40pxDefaultSize"],"sources":["@wordpress/dataviews/src/dataform-controls/utils/validated-input.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepMerge from 'deepmerge';\n\n/**\n * WordPress dependencies\n */\nimport { privateApis } from '@wordpress/components';\nimport { useCallback, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport type { DataFormControlProps } from '../../types';\nimport { unlock } from '../../lock-unlock';\n\nconst { ValidatedInputControl } = unlock( privateApis );\n\nexport type DataFormValidatedTextControlProps< Item > =\n\tDataFormControlProps< Item > & {\n\t\t/**\n\t\t * The input type of the control.\n\t\t */\n\t\ttype?: 'text' | 'email' | 'tel' | 'url' | 'password';\n\t\t/**\n\t\t * Optional prefix element to display before the input.\n\t\t */\n\t\tprefix?: React.ReactElement;\n\t\t/**\n\t\t * Optional suffix element to display after the input.\n\t\t */\n\t\tsuffix?: React.ReactElement;\n\t};\n\nexport default function ValidatedText< Item >( {\n\tdata,\n\tfield,\n\tonChange,\n\thideLabelFromVision,\n\ttype,\n\tprefix,\n\tsuffix,\n}: DataFormValidatedTextControlProps< Item > ) {\n\tconst { label, placeholder, description, getValue, setValue, isValid } =\n\t\tfield;\n\tconst value = getValue( { item: data } );\n\tconst [ customValidity, setCustomValidity ] =\n\t\tuseState<\n\t\t\tReact.ComponentProps<\n\t\t\t\ttypeof ValidatedInputControl\n\t\t\t>[ 'customValidity' ]\n\t\t>( undefined );\n\n\tconst onChangeControl = useCallback(\n\t\t( newValue: string ) =>\n\t\t\tonChange(\n\t\t\t\tsetValue( {\n\t\t\t\t\titem: data,\n\t\t\t\t\tvalue: newValue,\n\t\t\t\t} )\n\t\t\t),\n\t\t[ data, setValue, onChange ]\n\t);\n\n\tconst onValidateControl = useCallback(\n\t\t( newValue: any ) => {\n\t\t\tconst message = isValid?.custom?.(\n\t\t\t\tdeepMerge(\n\t\t\t\t\tdata,\n\t\t\t\t\tsetValue( {\n\t\t\t\t\t\titem: data,\n\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t} ) as Partial< Item >\n\t\t\t\t),\n\t\t\t\tfield\n\t\t\t);\n\n\t\t\tif ( message ) {\n\t\t\t\tsetCustomValidity( {\n\t\t\t\t\ttype: 'invalid',\n\t\t\t\t\tmessage,\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetCustomValidity( undefined );\n\t\t},\n\t\t[ data, field, isValid, setValue ]\n\t);\n\n\treturn (\n\t\t<ValidatedInputControl\n\t\t\trequired={ !! isValid?.required }\n\t\t\tonValidate={ onValidateControl }\n\t\t\tcustomValidity={ customValidity }\n\t\t\tlabel={ label }\n\t\t\tplaceholder={ placeholder }\n\t\t\tvalue={ value ?? '' }\n\t\t\thelp={ description }\n\t\t\tonChange={ onChangeControl }\n\t\t\thideLabelFromVision={ hideLabelFromVision }\n\t\t\ttype={ type }\n\t\t\tprefix={ prefix }\n\t\t\tsuffix={ suffix }\n\t\t\t__next40pxDefaultSize\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAMA,IAAAG,WAAA,GAAAH,OAAA;AAA2C,IAAAI,WAAA,GAAAJ,OAAA;AAf3C;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,MAAM;EAAEK;AAAsB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAY,CAAC;AAkBxC,SAASC,aAAaA,CAAU;EAC9CC,IAAI;EACJC,KAAK;EACLC,QAAQ;EACRC,mBAAmB;EACnBC,IAAI;EACJC,MAAM;EACNC;AAC0C,CAAC,EAAG;EAC9C,MAAM;IAAEC,KAAK;IAAEC,WAAW;IAAEC,WAAW;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC;EAAQ,CAAC,GACrEX,KAAK;EACN,MAAMY,KAAK,GAAGH,QAAQ,CAAE;IAAEI,IAAI,EAAEd;EAAK,CAAE,CAAC;EACxC,MAAM,CAAEe,cAAc,EAAEC,iBAAiB,CAAE,GAC1C,IAAAC,iBAAQ,EAILC,SAAU,CAAC;EAEf,MAAMC,eAAe,GAAG,IAAAC,oBAAW,EAChCC,QAAgB,IACjBnB,QAAQ,CACPS,QAAQ,CAAE;IACTG,IAAI,EAAEd,IAAI;IACVa,KAAK,EAAEQ;EACR,CAAE,CACH,CAAC,EACF,CAAErB,IAAI,EAAEW,QAAQ,EAAET,QAAQ,CAC3B,CAAC;EAED,MAAMoB,iBAAiB,GAAG,IAAAF,oBAAW,EAClCC,QAAa,IAAM;IACpB,MAAME,OAAO,GAAGX,OAAO,EAAEY,MAAM,GAC9B,IAAAC,kBAAS,EACRzB,IAAI,EACJW,QAAQ,CAAE;MACTG,IAAI,EAAEd,IAAI;MACVa,KAAK,EAAEQ;IACR,CAAE,CACH,CAAC,EACDpB,KACD,CAAC;IAED,IAAKsB,OAAO,EAAG;MACdP,iBAAiB,CAAE;QAClBZ,IAAI,EAAE,SAAS;QACfmB;MACD,CAAE,CAAC;MACH;IACD;IAEAP,iBAAiB,CAAEE,SAAU,CAAC;EAC/B,CAAC,EACD,CAAElB,IAAI,EAAEC,KAAK,EAAEW,OAAO,EAAED,QAAQ,CACjC,CAAC;EAED,oBACC,IAAAhB,WAAA,CAAA+B,GAAA,EAAC9B,qBAAqB;IACrB+B,QAAQ,EAAG,CAAC,CAAEf,OAAO,EAAEe,QAAU;IACjCC,UAAU,EAAGN,iBAAmB;IAChCP,cAAc,EAAGA,cAAgB;IACjCR,KAAK,EAAGA,KAAO;IACfC,WAAW,EAAGA,WAAa;IAC3BK,KAAK,EAAGA,KAAK,aAALA,KAAK,cAALA,KAAK,GAAI,EAAI;IACrBgB,IAAI,EAAGpB,WAAa;IACpBP,QAAQ,EAAGiB,eAAiB;IAC5BhB,mBAAmB,EAAGA,mBAAqB;IAC3CC,IAAI,EAAGA,IAAM;IACbC,MAAM,EAAGA,MAAQ;IACjBC,MAAM,EAAGA,MAAQ;IACjBwB,qBAAqB;EAAA,CACrB,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -11,6 +12,7 @@ var _icons = require("@wordpress/icons");
|
|
|
11
12
|
var _dataFormLayout = require("../data-form-layout");
|
|
12
13
|
var _isCombinedField = require("../is-combined-field");
|
|
13
14
|
var _normalizeFormFields = require("../../normalize-form-fields");
|
|
15
|
+
var _summaryButton = _interopRequireDefault(require("./summary-button"));
|
|
14
16
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
17
|
/**
|
|
16
18
|
* WordPress dependencies
|
|
@@ -44,6 +46,7 @@ function DropdownHeader({
|
|
|
44
46
|
}
|
|
45
47
|
function PanelDropdown({
|
|
46
48
|
fieldDefinition,
|
|
49
|
+
summaryFields,
|
|
47
50
|
popoverAnchor,
|
|
48
51
|
labelPosition = 'side',
|
|
49
52
|
data,
|
|
@@ -81,21 +84,14 @@ function PanelDropdown({
|
|
|
81
84
|
renderToggle: ({
|
|
82
85
|
isOpen,
|
|
83
86
|
onToggle
|
|
84
|
-
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"aria-label": (0, _i18n.sprintf)(
|
|
90
|
-
// translators: %s: Field name.
|
|
91
|
-
(0, _i18n._x)('Edit %s', 'field'), fieldLabel || ''),
|
|
92
|
-
onClick: onToggle,
|
|
87
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_summaryButton.default, {
|
|
88
|
+
summaryFields: summaryFields,
|
|
89
|
+
data: data,
|
|
90
|
+
labelPosition: labelPosition,
|
|
91
|
+
fieldLabel: fieldLabel,
|
|
93
92
|
disabled: fieldDefinition.readOnly === true,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
item: data,
|
|
97
|
-
field: fieldDefinition
|
|
98
|
-
})
|
|
93
|
+
onClick: onToggle,
|
|
94
|
+
"aria-expanded": isOpen
|
|
99
95
|
}),
|
|
100
96
|
renderContent: ({
|
|
101
97
|
onClose
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_element","_icons","_dataFormLayout","_isCombinedField","_normalizeFormFields","_jsxRuntime","DropdownHeader","title","onClose","jsx","__experimentalVStack","className","spacing","children","jsxs","__experimentalHStack","alignment","__experimentalHeading","level","size","__experimentalSpacer","Button","label","__","icon","closeSmall","onClick","PanelDropdown","fieldDefinition","popoverAnchor","labelPosition","data","onChange","field","fieldLabel","isCombinedField","form","useMemo","layout","DEFAULT_LAYOUT","fields","id","popoverProps","anchor","placement","offset","shift","Dropdown","contentClassName","focusOnMount","toggleProps","variant","tooltipPosition","renderToggle","isOpen","onToggle","
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_element","_icons","_dataFormLayout","_isCombinedField","_normalizeFormFields","_summaryButton","_interopRequireDefault","_jsxRuntime","DropdownHeader","title","onClose","jsx","__experimentalVStack","className","spacing","children","jsxs","__experimentalHStack","alignment","__experimentalHeading","level","size","__experimentalSpacer","Button","label","__","icon","closeSmall","onClick","PanelDropdown","fieldDefinition","summaryFields","popoverAnchor","labelPosition","data","onChange","field","fieldLabel","isCombinedField","form","useMemo","layout","DEFAULT_LAYOUT","fields","id","popoverProps","anchor","placement","offset","shift","Dropdown","contentClassName","focusOnMount","toggleProps","variant","tooltipPosition","renderToggle","isOpen","onToggle","default","disabled","readOnly","renderContent","Fragment","DataFormLayout","FieldLayout","nestedField","_form$fields","hideLabelFromVision","length","_default","exports"],"sources":["@wordpress/dataviews/src/dataforms-layouts/panel/dropdown.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalSpacer as Spacer,\n\tDropdown,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { closeSmall } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport type { Form, FormField, NormalizedField } from '../../types';\nimport { DataFormLayout } from '../data-form-layout';\nimport { isCombinedField } from '../is-combined-field';\nimport { DEFAULT_LAYOUT } from '../../normalize-form-fields';\nimport SummaryButton from './summary-button';\n\nfunction DropdownHeader( {\n\ttitle,\n\tonClose,\n}: {\n\ttitle?: string;\n\tonClose: () => void;\n} ) {\n\treturn (\n\t\t<VStack\n\t\t\tclassName=\"dataforms-layouts-panel__dropdown-header\"\n\t\t\tspacing={ 4 }\n\t\t>\n\t\t\t<HStack alignment=\"center\">\n\t\t\t\t{ title && (\n\t\t\t\t\t<Heading level={ 2 } size={ 13 }>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</Heading>\n\t\t\t\t) }\n\t\t\t\t<Spacer />\n\t\t\t\t{ onClose && (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tlabel={ __( 'Close' ) }\n\t\t\t\t\t\ticon={ closeSmall }\n\t\t\t\t\t\tonClick={ onClose }\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</HStack>\n\t\t</VStack>\n\t);\n}\n\nfunction PanelDropdown< Item >( {\n\tfieldDefinition,\n\tsummaryFields,\n\tpopoverAnchor,\n\tlabelPosition = 'side',\n\tdata,\n\tonChange,\n\tfield,\n}: {\n\tfieldDefinition: NormalizedField< Item >;\n\tsummaryFields: NormalizedField< Item >[];\n\tpopoverAnchor: HTMLElement | null;\n\tlabelPosition: 'side' | 'top' | 'none';\n\tdata: Item;\n\tonChange: ( value: any ) => void;\n\tfield: FormField;\n} ) {\n\tconst fieldLabel = isCombinedField( field )\n\t\t? field.label\n\t\t: fieldDefinition?.label;\n\n\tconst form: Form = useMemo(\n\t\t(): Form => ( {\n\t\t\tlayout: DEFAULT_LAYOUT,\n\t\t\tfields: isCombinedField( field )\n\t\t\t\t? field.children\n\t\t\t\t: // If not explicit children return the field id itself.\n\t\t\t\t [ { id: field.id } ],\n\t\t} ),\n\t\t[ field ]\n\t);\n\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<Dropdown\n\t\t\tcontentClassName=\"dataforms-layouts-panel__field-dropdown\"\n\t\t\tpopoverProps={ popoverProps }\n\t\t\tfocusOnMount\n\t\t\ttoggleProps={ {\n\t\t\t\tsize: 'compact',\n\t\t\t\tvariant: 'tertiary',\n\t\t\t\ttooltipPosition: 'middle left',\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<SummaryButton\n\t\t\t\t\tsummaryFields={ summaryFields }\n\t\t\t\t\tdata={ data }\n\t\t\t\t\tlabelPosition={ labelPosition }\n\t\t\t\t\tfieldLabel={ fieldLabel }\n\t\t\t\t\tdisabled={ fieldDefinition.readOnly === true }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<DropdownHeader title={ fieldLabel } onClose={ onClose } />\n\t\t\t\t\t<DataFormLayout\n\t\t\t\t\t\tdata={ data }\n\t\t\t\t\t\tform={ form }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ( FieldLayout, nestedField ) => (\n\t\t\t\t\t\t\t<FieldLayout\n\t\t\t\t\t\t\t\tkey={ nestedField.id }\n\t\t\t\t\t\t\t\tdata={ data }\n\t\t\t\t\t\t\t\tfield={ nestedField }\n\t\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\t\thideLabelFromVision={\n\t\t\t\t\t\t\t\t\t( form?.fields ?? [] ).length < 2\n\t\t\t\t\t\t\t\t}\n\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