@rjsf/chakra-ui 6.2.4 → 6.3.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/dist/chakra-ui.esm.js +13 -14
- package/dist/chakra-ui.esm.js.map +4 -4
- package/dist/chakra-ui.umd.js +7 -9
- package/dist/index.cjs +15 -16
- package/dist/index.cjs.map +4 -4
- package/lib/BaseInputTemplate/BaseInputTemplate.js +2 -5
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/{SelectNativeWidget → NativeSelectWidget}/NativeSelectWidget.js +3 -6
- package/lib/NativeSelectWidget/NativeSelectWidget.js.map +1 -0
- package/lib/NativeSelectWidget/index.js.map +1 -0
- package/lib/Widgets/Widgets.js +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +2 -9
- package/src/{SelectNativeWidget → NativeSelectWidget}/NativeSelectWidget.tsx +12 -10
- package/src/Widgets/Widgets.ts +1 -1
- package/lib/SelectNativeWidget/NativeSelectWidget.js.map +0 -1
- package/lib/SelectNativeWidget/index.js.map +0 -1
- /package/lib/{SelectNativeWidget → NativeSelectWidget}/NativeSelectWidget.d.ts +0 -0
- /package/lib/{SelectNativeWidget → NativeSelectWidget}/index.d.ts +0 -0
- /package/lib/{SelectNativeWidget → NativeSelectWidget}/index.js +0 -0
- /package/src/{SelectNativeWidget → NativeSelectWidget}/index.ts +0 -0
package/dist/chakra-ui.esm.js
CHANGED
|
@@ -128,6 +128,7 @@ import {
|
|
|
128
128
|
labelValue,
|
|
129
129
|
getInputProps
|
|
130
130
|
} from "@rjsf/utils";
|
|
131
|
+
import { SchemaExamples } from "@rjsf/core";
|
|
131
132
|
|
|
132
133
|
// src/components/ui/field.tsx
|
|
133
134
|
import { forwardRef } from "react";
|
|
@@ -227,9 +228,7 @@ function BaseInputTemplate(props) {
|
|
|
227
228
|
}
|
|
228
229
|
),
|
|
229
230
|
options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ jsx5(ClearButton2, { registry, onClick: onClear }),
|
|
230
|
-
|
|
231
|
-
return /* @__PURE__ */ jsx5("option", { value: example }, example);
|
|
232
|
-
}) }) : null
|
|
231
|
+
/* @__PURE__ */ jsx5(SchemaExamples, { id, schema })
|
|
233
232
|
]
|
|
234
233
|
}
|
|
235
234
|
);
|
|
@@ -1304,7 +1303,7 @@ function SelectWidget(props) {
|
|
|
1304
1303
|
);
|
|
1305
1304
|
}
|
|
1306
1305
|
|
|
1307
|
-
// src/
|
|
1306
|
+
// src/NativeSelectWidget/NativeSelectWidget.tsx
|
|
1308
1307
|
import { useMemo as useMemo2 } from "react";
|
|
1309
1308
|
import {
|
|
1310
1309
|
ariaDescribedByIds as ariaDescribedByIds7,
|
|
@@ -1312,7 +1311,7 @@ import {
|
|
|
1312
1311
|
enumOptionsValueForIndex as enumOptionsValueForIndex4,
|
|
1313
1312
|
labelValue as labelValue7
|
|
1314
1313
|
} from "@rjsf/utils";
|
|
1315
|
-
import { createListCollection as createListCollection2, NativeSelect
|
|
1314
|
+
import { createListCollection as createListCollection2, NativeSelect } from "@chakra-ui/react";
|
|
1316
1315
|
import { jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1317
1316
|
function NativeSelectWidget(props) {
|
|
1318
1317
|
const {
|
|
@@ -1354,12 +1353,9 @@ function NativeSelectWidget(props) {
|
|
|
1354
1353
|
disabled: Array.isArray(enumDisabled) && enumDisabled.indexOf(value2) !== -1
|
|
1355
1354
|
};
|
|
1356
1355
|
});
|
|
1357
|
-
if (showPlaceholderOption) {
|
|
1358
|
-
displayEnumOptions2.unshift({ value: "", label: placeholder || "" });
|
|
1359
|
-
}
|
|
1360
1356
|
}
|
|
1361
1357
|
return { valueLabelMap: valueLabelMap2, displayEnumOptions: displayEnumOptions2 };
|
|
1362
|
-
}, [enumDisabled, enumOptions
|
|
1358
|
+
}, [enumDisabled, enumOptions]);
|
|
1363
1359
|
const selectedIndex = enumOptionsIndexForValue4(value, enumOptions, false);
|
|
1364
1360
|
const getSingleValue = () => typeof selectedIndex !== "undefined" ? [
|
|
1365
1361
|
{
|
|
@@ -1382,9 +1378,9 @@ function NativeSelectWidget(props) {
|
|
|
1382
1378
|
invalid: rawErrors && rawErrors.length > 0,
|
|
1383
1379
|
label: labelValue7(label, hideLabel || !label),
|
|
1384
1380
|
...chakraProps,
|
|
1385
|
-
children: /* @__PURE__ */ jsxs20(
|
|
1386
|
-
/* @__PURE__ */
|
|
1387
|
-
|
|
1381
|
+
children: /* @__PURE__ */ jsxs20(NativeSelect.Root, { children: [
|
|
1382
|
+
/* @__PURE__ */ jsxs20(
|
|
1383
|
+
NativeSelect.Field,
|
|
1388
1384
|
{
|
|
1389
1385
|
id,
|
|
1390
1386
|
onBlur: _onBlur,
|
|
@@ -1393,10 +1389,13 @@ function NativeSelectWidget(props) {
|
|
|
1393
1389
|
autoFocus: autofocus,
|
|
1394
1390
|
value: formValue,
|
|
1395
1391
|
"aria-describedby": ariaDescribedByIds7(id),
|
|
1396
|
-
children:
|
|
1392
|
+
children: [
|
|
1393
|
+
showPlaceholderOption ? /* @__PURE__ */ jsx33("option", { value: "", disabled: true, hidden: true, children: placeholder || "" }) : void 0,
|
|
1394
|
+
selectOptions.items.map((item) => /* @__PURE__ */ jsx33("option", { value: item.value, children: item.label }, item.value))
|
|
1395
|
+
]
|
|
1397
1396
|
}
|
|
1398
1397
|
),
|
|
1399
|
-
/* @__PURE__ */ jsx33(
|
|
1398
|
+
/* @__PURE__ */ jsx33(NativeSelect.Indicator, {})
|
|
1400
1399
|
] })
|
|
1401
1400
|
}
|
|
1402
1401
|
);
|