@contentful/field-editor-checkbox 2.3.4-canary.23 → 2.3.4-canary.27
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.
|
@@ -106,10 +106,10 @@ function CheckboxEditor(props) {
|
|
|
106
106
|
const options = getOptions(field, id);
|
|
107
107
|
const misconfigured = options.length === 0;
|
|
108
108
|
if (misconfigured) {
|
|
109
|
-
return
|
|
109
|
+
return _react.createElement(_fieldeditorshared.PredefinedValuesError, null);
|
|
110
110
|
}
|
|
111
111
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
112
|
-
return
|
|
112
|
+
return _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
113
113
|
debounce: 0,
|
|
114
114
|
isEmptyValue: isEmptyListValue,
|
|
115
115
|
field: field,
|
|
@@ -132,13 +132,13 @@ function CheckboxEditor(props) {
|
|
|
132
132
|
...options,
|
|
133
133
|
...invalidValues
|
|
134
134
|
];
|
|
135
|
-
return
|
|
135
|
+
return _react.createElement(_f36components.Form, {
|
|
136
136
|
testId: "checkbox-editor",
|
|
137
137
|
className: (0, _css.cx)(_styles.form, direction === 'rtl' ? _styles.rightToLeft : '')
|
|
138
|
-
}, mergedOptions.map((item)
|
|
138
|
+
}, mergedOptions.map((item)=>_react.createElement(_f36components.Box, {
|
|
139
139
|
key: item.id,
|
|
140
140
|
marginBottom: "spacingS"
|
|
141
|
-
},
|
|
141
|
+
}, _react.createElement(_f36components.Checkbox, {
|
|
142
142
|
key: item.id,
|
|
143
143
|
id: item.id,
|
|
144
144
|
isChecked: values.includes(item.value),
|
|
@@ -152,13 +152,13 @@ function CheckboxEditor(props) {
|
|
|
152
152
|
removeValue(item.value);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
}, item.label), item.invalid &&
|
|
155
|
+
}, item.label), item.invalid && _react.createElement(_react.Fragment, null, _react.createElement("span", {
|
|
156
156
|
"data-test-id": "invalid-text",
|
|
157
157
|
className: _styles.invalidText
|
|
158
158
|
}, _core.i18n._({
|
|
159
159
|
id: "FieldEditors.Checkbox.CheckboxEditor.InvalidText",
|
|
160
160
|
message: "(invalid)"
|
|
161
|
-
})),
|
|
161
|
+
})), _react.createElement(_f36components.TextLink, {
|
|
162
162
|
as: "button",
|
|
163
163
|
className: _styles.removeBtn,
|
|
164
164
|
onClick: ()=>removeValue(item.value)
|
|
@@ -64,7 +64,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
|
-
const { getByTestId, queryByTestId } = (0, _react1.render)(
|
|
67
|
+
const { getByTestId, queryByTestId } = (0, _react1.render)(_react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
68
68
|
field: field,
|
|
69
69
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
70
70
|
isInitiallyDisabled: false
|
|
@@ -92,7 +92,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
});
|
|
95
|
-
const { container } = (0, _react1.render)(
|
|
95
|
+
const { container } = (0, _react1.render)(_react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
96
96
|
field: field,
|
|
97
97
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
98
98
|
isInitiallyDisabled: false
|
|
@@ -125,7 +125,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
127
|
});
|
|
128
|
-
const { container } = (0, _react1.render)(
|
|
128
|
+
const { container } = (0, _react1.render)(_react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
129
129
|
field: field,
|
|
130
130
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
131
131
|
isInitiallyDisabled: false
|
|
@@ -179,7 +179,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
179
179
|
field.setValue([
|
|
180
180
|
'mango'
|
|
181
181
|
]);
|
|
182
|
-
const { getByTestId } = (0, _react1.render)(
|
|
182
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
183
183
|
field: field,
|
|
184
184
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
185
185
|
isInitiallyDisabled: false
|
|
@@ -210,11 +210,11 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
210
210
|
};
|
|
211
211
|
});
|
|
212
212
|
const locales = (0, _fieldeditortestutils.createFakeLocalesAPI)();
|
|
213
|
-
const { findAllByTestId } = (0, _react1.render)(
|
|
213
|
+
const { findAllByTestId } = (0, _react1.render)(_react.createElement("div", null, _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
214
214
|
field: field,
|
|
215
215
|
locales: locales,
|
|
216
216
|
isInitiallyDisabled: false
|
|
217
|
-
}),
|
|
217
|
+
}), _react.createElement(_CheckboxEditor.CheckboxEditor, {
|
|
218
218
|
field: field,
|
|
219
219
|
locales: locales,
|
|
220
220
|
isInitiallyDisabled: false
|
package/dist/cjs/styles.js
CHANGED
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
form
|
|
12
|
+
get form () {
|
|
13
13
|
return form;
|
|
14
14
|
},
|
|
15
|
-
invalidText
|
|
15
|
+
get invalidText () {
|
|
16
16
|
return invalidText;
|
|
17
17
|
},
|
|
18
|
-
removeBtn
|
|
18
|
+
get removeBtn () {
|
|
19
19
|
return removeBtn;
|
|
20
20
|
},
|
|
21
|
-
rightToLeft
|
|
21
|
+
get rightToLeft () {
|
|
22
22
|
return rightToLeft;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -52,10 +52,10 @@ export function CheckboxEditor(props) {
|
|
|
52
52
|
const options = getOptions(field, id);
|
|
53
53
|
const misconfigured = options.length === 0;
|
|
54
54
|
if (misconfigured) {
|
|
55
|
-
return
|
|
55
|
+
return React.createElement(PredefinedValuesError, null);
|
|
56
56
|
}
|
|
57
57
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
58
|
-
return
|
|
58
|
+
return React.createElement(FieldConnector, {
|
|
59
59
|
debounce: 0,
|
|
60
60
|
isEmptyValue: isEmptyListValue,
|
|
61
61
|
field: field,
|
|
@@ -78,13 +78,13 @@ export function CheckboxEditor(props) {
|
|
|
78
78
|
...options,
|
|
79
79
|
...invalidValues
|
|
80
80
|
];
|
|
81
|
-
return
|
|
81
|
+
return React.createElement(Form, {
|
|
82
82
|
testId: "checkbox-editor",
|
|
83
83
|
className: cx(styles.form, direction === 'rtl' ? styles.rightToLeft : '')
|
|
84
|
-
}, mergedOptions.map((item)
|
|
84
|
+
}, mergedOptions.map((item)=>React.createElement(Box, {
|
|
85
85
|
key: item.id,
|
|
86
86
|
marginBottom: "spacingS"
|
|
87
|
-
},
|
|
87
|
+
}, React.createElement(Checkbox, {
|
|
88
88
|
key: item.id,
|
|
89
89
|
id: item.id,
|
|
90
90
|
isChecked: values.includes(item.value),
|
|
@@ -98,13 +98,13 @@ export function CheckboxEditor(props) {
|
|
|
98
98
|
removeValue(item.value);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
}, item.label), item.invalid &&
|
|
101
|
+
}, item.label), item.invalid && React.createElement(React.Fragment, null, React.createElement("span", {
|
|
102
102
|
"data-test-id": "invalid-text",
|
|
103
103
|
className: styles.invalidText
|
|
104
104
|
}, $_i18n._({
|
|
105
105
|
id: "FieldEditors.Checkbox.CheckboxEditor.InvalidText",
|
|
106
106
|
message: "(invalid)"
|
|
107
|
-
})),
|
|
107
|
+
})), React.createElement(TextLink, {
|
|
108
108
|
as: "button",
|
|
109
109
|
className: styles.removeBtn,
|
|
110
110
|
onClick: ()=>removeValue(item.value)
|
|
@@ -19,7 +19,7 @@ describe('CheckboxEditor', ()=>{
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
});
|
|
22
|
-
const { getByTestId, queryByTestId } = render(
|
|
22
|
+
const { getByTestId, queryByTestId } = render(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(
|
|
50
|
+
const { container } = render(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(
|
|
83
|
+
const { container } = render(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(
|
|
137
|
+
const { getByTestId } = render(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(
|
|
168
|
+
const { findAllByTestId } = render(React.createElement("div", null, React.createElement(CheckboxEditor, {
|
|
169
169
|
field: field,
|
|
170
170
|
locales: locales,
|
|
171
171
|
isInitiallyDisabled: false
|
|
172
|
-
}),
|
|
172
|
+
}), 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": "2.3.4-canary.
|
|
3
|
+
"version": "2.3.4-canary.27+0e4621f9",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@contentful/f36-components": "^6.7.1",
|
|
42
42
|
"@contentful/f36-tokens": "^6.1.2",
|
|
43
|
-
"@contentful/field-editor-shared": "^4.6.3-canary.
|
|
43
|
+
"@contentful/field-editor-shared": "^4.6.3-canary.30+0e4621f9",
|
|
44
44
|
"@emotion/css": "^11.13.5",
|
|
45
45
|
"lodash": "^4.18.1",
|
|
46
46
|
"nanoid": "^3.3.20"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@contentful/field-editor-test-utils": "^3.2.1",
|
|
50
|
-
"@lingui/core": "5.
|
|
50
|
+
"@lingui/core": "5.9.5"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@lingui/core": "^5.3.0",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"prettier --write"
|
|
64
64
|
]
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "0e4621f97b3a6b65da12df50fa740c00bcd17b1f"
|
|
67
67
|
}
|