@contentful/field-editor-checkbox 1.4.38 → 1.5.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.
|
@@ -105,10 +105,10 @@ function CheckboxEditor(props) {
|
|
|
105
105
|
const options = getOptions(field, id);
|
|
106
106
|
const misconfigured = options.length === 0;
|
|
107
107
|
if (misconfigured) {
|
|
108
|
-
return _react.createElement(_fieldeditorshared.PredefinedValuesError, null);
|
|
108
|
+
return /*#__PURE__*/ _react.createElement(_fieldeditorshared.PredefinedValuesError, null);
|
|
109
109
|
}
|
|
110
110
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
111
|
-
return _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
111
|
+
return /*#__PURE__*/ _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
112
112
|
debounce: 0,
|
|
113
113
|
isEmptyValue: isEmptyListValue,
|
|
114
114
|
field: field,
|
|
@@ -131,13 +131,13 @@ function CheckboxEditor(props) {
|
|
|
131
131
|
...options,
|
|
132
132
|
...invalidValues
|
|
133
133
|
];
|
|
134
|
-
return _react.createElement(_f36components.Form, {
|
|
134
|
+
return /*#__PURE__*/ _react.createElement(_f36components.Form, {
|
|
135
135
|
testId: "checkbox-editor",
|
|
136
136
|
className: (0, _emotion.cx)(_styles.form, direction === 'rtl' ? _styles.rightToLeft : '')
|
|
137
|
-
}, mergedOptions.map((item)
|
|
137
|
+
}, mergedOptions.map((item)=>/*#__PURE__*/ _react.createElement(_f36components.Box, {
|
|
138
138
|
key: item.id,
|
|
139
139
|
marginBottom: "spacingS"
|
|
140
|
-
}, _react.createElement(_f36components.Checkbox, {
|
|
140
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Checkbox, {
|
|
141
141
|
key: item.id,
|
|
142
142
|
id: item.id,
|
|
143
143
|
isChecked: values.includes(item.value),
|
|
@@ -151,10 +151,10 @@ function CheckboxEditor(props) {
|
|
|
151
151
|
removeValue(item.value);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
}, item.label), item.invalid && _react.createElement(_react.Fragment, null, _react.createElement("span", {
|
|
154
|
+
}, item.label), item.invalid && /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement("span", {
|
|
155
155
|
"data-test-id": "invalid-text",
|
|
156
156
|
className: _styles.invalidText
|
|
157
|
-
}, "(invalid)"), _react.createElement(_f36components.TextLink, {
|
|
157
|
+
}, "(invalid)"), /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
|
|
158
158
|
as: "button",
|
|
159
159
|
className: _styles.removeBtn,
|
|
160
160
|
onClick: ()=>removeValue(item.value)
|
|
@@ -64,7 +64,7 @@ describe('CheckboxEditor', ()=>{
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
|
-
const { getByTestId, queryByTestId } = (0, _react1.render)(_react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
67
|
+
const { getByTestId, queryByTestId } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
68
68
|
field: field,
|
|
69
69
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
70
70
|
isInitiallyDisabled: false
|
|
@@ -92,7 +92,7 @@ describe('CheckboxEditor', ()=>{
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
});
|
|
95
|
-
const { container } = (0, _react1.render)(_react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
95
|
+
const { container } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
96
96
|
field: field,
|
|
97
97
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
98
98
|
isInitiallyDisabled: false
|
|
@@ -125,7 +125,7 @@ describe('CheckboxEditor', ()=>{
|
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
});
|
|
128
|
-
const { container } = (0, _react1.render)(_react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
128
|
+
const { container } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
129
129
|
field: field,
|
|
130
130
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
131
131
|
isInitiallyDisabled: false
|
|
@@ -179,7 +179,7 @@ describe('CheckboxEditor', ()=>{
|
|
|
179
179
|
field.setValue([
|
|
180
180
|
'mango'
|
|
181
181
|
]);
|
|
182
|
-
const { getByTestId } = (0, _react1.render)(_react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
182
|
+
const { getByTestId } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
183
183
|
field: field,
|
|
184
184
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
185
185
|
isInitiallyDisabled: false
|
|
@@ -210,11 +210,11 @@ describe('CheckboxEditor', ()=>{
|
|
|
210
210
|
};
|
|
211
211
|
});
|
|
212
212
|
const locales = (0, _fieldeditortestutils.createFakeLocalesAPI)();
|
|
213
|
-
const { findAllByTestId } = (0, _react1.render)(_react.createElement("div", null, _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
213
|
+
const { findAllByTestId } = (0, _react1.render)(/*#__PURE__*/ _react.createElement("div", null, /*#__PURE__*/ _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
214
214
|
field: field,
|
|
215
215
|
locales: locales,
|
|
216
216
|
isInitiallyDisabled: false
|
|
217
|
-
}), _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
217
|
+
}), /*#__PURE__*/ _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
218
218
|
field: field,
|
|
219
219
|
locales: locales,
|
|
220
220
|
isInitiallyDisabled: false
|
|
@@ -51,10 +51,10 @@ export function CheckboxEditor(props) {
|
|
|
51
51
|
const options = getOptions(field, id);
|
|
52
52
|
const misconfigured = options.length === 0;
|
|
53
53
|
if (misconfigured) {
|
|
54
|
-
return React.createElement(PredefinedValuesError, null);
|
|
54
|
+
return /*#__PURE__*/ React.createElement(PredefinedValuesError, null);
|
|
55
55
|
}
|
|
56
56
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
57
|
-
return React.createElement(FieldConnector, {
|
|
57
|
+
return /*#__PURE__*/ React.createElement(FieldConnector, {
|
|
58
58
|
debounce: 0,
|
|
59
59
|
isEmptyValue: isEmptyListValue,
|
|
60
60
|
field: field,
|
|
@@ -77,13 +77,13 @@ export function CheckboxEditor(props) {
|
|
|
77
77
|
...options,
|
|
78
78
|
...invalidValues
|
|
79
79
|
];
|
|
80
|
-
return React.createElement(Form, {
|
|
80
|
+
return /*#__PURE__*/ React.createElement(Form, {
|
|
81
81
|
testId: "checkbox-editor",
|
|
82
82
|
className: cx(styles.form, direction === 'rtl' ? styles.rightToLeft : '')
|
|
83
|
-
}, mergedOptions.map((item)
|
|
83
|
+
}, mergedOptions.map((item)=>/*#__PURE__*/ React.createElement(Box, {
|
|
84
84
|
key: item.id,
|
|
85
85
|
marginBottom: "spacingS"
|
|
86
|
-
}, React.createElement(Checkbox, {
|
|
86
|
+
}, /*#__PURE__*/ React.createElement(Checkbox, {
|
|
87
87
|
key: item.id,
|
|
88
88
|
id: item.id,
|
|
89
89
|
isChecked: values.includes(item.value),
|
|
@@ -97,10 +97,10 @@ export function CheckboxEditor(props) {
|
|
|
97
97
|
removeValue(item.value);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
}, item.label), item.invalid && React.createElement(React.Fragment, null, React.createElement("span", {
|
|
100
|
+
}, item.label), item.invalid && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement("span", {
|
|
101
101
|
"data-test-id": "invalid-text",
|
|
102
102
|
className: styles.invalidText
|
|
103
|
-
}, "(invalid)"), React.createElement(TextLink, {
|
|
103
|
+
}, "(invalid)"), /*#__PURE__*/ React.createElement(TextLink, {
|
|
104
104
|
as: "button",
|
|
105
105
|
className: styles.removeBtn,
|
|
106
106
|
onClick: ()=>removeValue(item.value)
|
|
@@ -19,7 +19,7 @@ describe('CheckboxEditor', ()=>{
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
|
-
const { getByTestId, queryByTestId } = render(React.createElement(CheckboxEditor, {
|
|
22
|
+
const { getByTestId, queryByTestId } = render(/*#__PURE__*/ React.createElement(CheckboxEditor, {
|
|
23
23
|
field: field,
|
|
24
24
|
locales: createFakeLocalesAPI(),
|
|
25
25
|
isInitiallyDisabled: false
|
|
@@ -47,7 +47,7 @@ describe('CheckboxEditor', ()=>{
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
});
|
|
50
|
-
const { container } = render(React.createElement(CheckboxEditor, {
|
|
50
|
+
const { container } = render(/*#__PURE__*/ React.createElement(CheckboxEditor, {
|
|
51
51
|
field: field,
|
|
52
52
|
locales: createFakeLocalesAPI(),
|
|
53
53
|
isInitiallyDisabled: false
|
|
@@ -80,7 +80,7 @@ describe('CheckboxEditor', ()=>{
|
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
82
|
});
|
|
83
|
-
const { container } = render(React.createElement(CheckboxEditor, {
|
|
83
|
+
const { container } = render(/*#__PURE__*/ React.createElement(CheckboxEditor, {
|
|
84
84
|
field: field,
|
|
85
85
|
locales: createFakeLocalesAPI(),
|
|
86
86
|
isInitiallyDisabled: false
|
|
@@ -134,7 +134,7 @@ describe('CheckboxEditor', ()=>{
|
|
|
134
134
|
field.setValue([
|
|
135
135
|
'mango'
|
|
136
136
|
]);
|
|
137
|
-
const { getByTestId } = render(React.createElement(CheckboxEditor, {
|
|
137
|
+
const { getByTestId } = render(/*#__PURE__*/ React.createElement(CheckboxEditor, {
|
|
138
138
|
field: field,
|
|
139
139
|
locales: createFakeLocalesAPI(),
|
|
140
140
|
isInitiallyDisabled: false
|
|
@@ -165,11 +165,11 @@ describe('CheckboxEditor', ()=>{
|
|
|
165
165
|
};
|
|
166
166
|
});
|
|
167
167
|
const locales = createFakeLocalesAPI();
|
|
168
|
-
const { findAllByTestId } = render(React.createElement("div", null, React.createElement(CheckboxEditor, {
|
|
168
|
+
const { findAllByTestId } = render(/*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement(CheckboxEditor, {
|
|
169
169
|
field: field,
|
|
170
170
|
locales: locales,
|
|
171
171
|
isInitiallyDisabled: false
|
|
172
|
-
}), React.createElement(CheckboxEditor, {
|
|
172
|
+
}), /*#__PURE__*/ React.createElement(CheckboxEditor, {
|
|
173
173
|
field: field,
|
|
174
174
|
locales: locales,
|
|
175
175
|
isInitiallyDisabled: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-checkbox",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -37,18 +37,20 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@contentful/f36-components": "^4.70.0",
|
|
39
39
|
"@contentful/f36-tokens": "^4.0.5",
|
|
40
|
-
"@contentful/field-editor-shared": "^2.
|
|
40
|
+
"@contentful/field-editor-shared": "^2.8.0",
|
|
41
41
|
"emotion": "^10.0.17",
|
|
42
42
|
"lodash": "^4.17.15"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@contentful/field-editor-test-utils": "^1.5.2"
|
|
45
|
+
"@contentful/field-editor-test-utils": "^1.5.2",
|
|
46
|
+
"@lingui/core": "5.3.0"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
49
|
+
"@lingui/core": "^5.3.0",
|
|
48
50
|
"react": ">=16.8.0"
|
|
49
51
|
},
|
|
50
52
|
"publishConfig": {
|
|
51
53
|
"registry": "https://npm.pkg.github.com/"
|
|
52
54
|
},
|
|
53
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "a86f67a6d507eb7c8c7a38b4312380361bdbebbb"
|
|
54
56
|
}
|