@rjsf/chakra-ui 6.1.2 → 6.2.5
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 +52 -32
- package/dist/chakra-ui.esm.js.map +4 -4
- package/dist/chakra-ui.umd.js +42 -23
- package/dist/index.cjs +201 -181
- package/dist/index.cjs.map +4 -4
- package/lib/AltDateTimeWidget/AltDateTimeWidget.d.ts +1 -12
- package/lib/AltDateTimeWidget/AltDateTimeWidget.js +2 -7
- package/lib/AltDateTimeWidget/AltDateTimeWidget.js.map +1 -1
- package/lib/AltDateWidget/AltDateWidget.d.ts +1 -12
- package/lib/AltDateWidget/AltDateWidget.js +7 -12
- package/lib/AltDateWidget/AltDateWidget.js.map +1 -1
- package/lib/BaseInputTemplate/BaseInputTemplate.js +10 -2
- package/lib/BaseInputTemplate/BaseInputTemplate.js.map +1 -1
- package/lib/IconButton/IconButton.d.ts +1 -0
- package/lib/IconButton/IconButton.js +5 -1
- package/lib/IconButton/IconButton.js.map +1 -1
- package/lib/Templates/Templates.js +2 -1
- package/lib/Templates/Templates.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -7
- package/src/AltDateTimeWidget/AltDateTimeWidget.tsx +5 -10
- package/src/AltDateWidget/AltDateWidget.tsx +14 -15
- package/src/BaseInputTemplate/BaseInputTemplate.tsx +14 -1
- package/src/IconButton/IconButton.tsx +10 -1
- package/src/Templates/Templates.ts +2 -1
package/dist/index.cjs
CHANGED
|
@@ -159,7 +159,8 @@ function ArrayFieldTemplate(props) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
// src/BaseInputTemplate/BaseInputTemplate.tsx
|
|
162
|
-
var import_react7 = require("
|
|
162
|
+
var import_react7 = require("react");
|
|
163
|
+
var import_react8 = require("@chakra-ui/react");
|
|
163
164
|
var import_utils4 = require("@rjsf/utils");
|
|
164
165
|
|
|
165
166
|
// src/components/ui/field.tsx
|
|
@@ -215,12 +216,22 @@ function BaseInputTemplate(props) {
|
|
|
215
216
|
autofocus,
|
|
216
217
|
placeholder,
|
|
217
218
|
disabled,
|
|
218
|
-
uiSchema
|
|
219
|
+
uiSchema,
|
|
220
|
+
registry
|
|
219
221
|
} = props;
|
|
220
222
|
const inputProps = (0, import_utils4.getInputProps)(schema, type, options);
|
|
223
|
+
const { ClearButton: ClearButton2 } = registry.templates.ButtonTemplates;
|
|
221
224
|
const _onChange = ({ target: { value: value2 } }) => onChange(value2 === "" ? options.emptyValue : value2);
|
|
222
225
|
const _onBlur = ({ target }) => onBlur(id, target && target.value);
|
|
223
226
|
const _onFocus = ({ target }) => onFocus(id, target && target.value);
|
|
227
|
+
const onClear = (0, import_react7.useCallback)(
|
|
228
|
+
(e) => {
|
|
229
|
+
e.preventDefault();
|
|
230
|
+
e.stopPropagation();
|
|
231
|
+
onChange(options.emptyValue ?? "");
|
|
232
|
+
},
|
|
233
|
+
[onChange, options.emptyValue]
|
|
234
|
+
);
|
|
224
235
|
const chakraProps = getChakra({ uiSchema });
|
|
225
236
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
226
237
|
Field,
|
|
@@ -234,7 +245,7 @@ function BaseInputTemplate(props) {
|
|
|
234
245
|
...chakraProps,
|
|
235
246
|
children: [
|
|
236
247
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
237
|
-
|
|
248
|
+
import_react8.Input,
|
|
238
249
|
{
|
|
239
250
|
id,
|
|
240
251
|
name: htmlName || id,
|
|
@@ -249,6 +260,7 @@ function BaseInputTemplate(props) {
|
|
|
249
260
|
"aria-describedby": (0, import_utils4.ariaDescribedByIds)(id, !!schema.examples)
|
|
250
261
|
}
|
|
251
262
|
),
|
|
263
|
+
options.allowClearTextInputs && !readonly && !disabled && value && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ClearButton2, { registry, onClick: onClear }),
|
|
252
264
|
Array.isArray(schema.examples) ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("datalist", { id: (0, import_utils4.examplesId)(id), children: schema.examples.concat(schema.default && !schema.examples.includes(schema.default) ? [schema.default] : []).map((example) => {
|
|
253
265
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: example }, example);
|
|
254
266
|
}) }) : null
|
|
@@ -259,42 +271,42 @@ function BaseInputTemplate(props) {
|
|
|
259
271
|
|
|
260
272
|
// src/DescriptionField/DescriptionField.tsx
|
|
261
273
|
var import_core = require("@rjsf/core");
|
|
262
|
-
var
|
|
274
|
+
var import_react9 = require("@chakra-ui/react");
|
|
263
275
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
264
276
|
function DescriptionField({ description, id, registry, uiSchema }) {
|
|
265
277
|
if (!description) {
|
|
266
278
|
return null;
|
|
267
279
|
}
|
|
268
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react9.Text, { as: "sup", fontSize: "md", id, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core.RichDescription, { description, registry, uiSchema }) });
|
|
269
281
|
}
|
|
270
282
|
|
|
271
283
|
// src/ErrorList/ErrorList.tsx
|
|
272
284
|
var import_utils6 = require("@rjsf/utils");
|
|
273
|
-
var
|
|
285
|
+
var import_react14 = require("@chakra-ui/react");
|
|
274
286
|
|
|
275
287
|
// src/components/ui/alert.tsx
|
|
276
|
-
var
|
|
277
|
-
var
|
|
288
|
+
var import_react12 = require("react");
|
|
289
|
+
var import_react13 = require("@chakra-ui/react");
|
|
278
290
|
|
|
279
291
|
// src/components/ui/close-button.tsx
|
|
280
|
-
var
|
|
281
|
-
var
|
|
292
|
+
var import_react10 = require("react");
|
|
293
|
+
var import_react11 = require("@chakra-ui/react");
|
|
282
294
|
var import_lu = require("react-icons/lu");
|
|
283
295
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
284
|
-
var CloseButton = (0,
|
|
285
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
296
|
+
var CloseButton = (0, import_react10.forwardRef)(function CloseButton2(props, ref) {
|
|
297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react11.IconButton, { variant: "ghost", "aria-label": "Close", ref, ...props, children: props.children ?? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lu.LuX, {}) });
|
|
286
298
|
});
|
|
287
299
|
|
|
288
300
|
// src/components/ui/alert.tsx
|
|
289
301
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
290
|
-
var Alert = (0,
|
|
302
|
+
var Alert = (0, import_react12.forwardRef)(function Alert2(props, ref) {
|
|
291
303
|
const { title, children, closable, onClose, startElement, endElement, ...rest } = props;
|
|
292
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
293
|
-
startElement || /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
294
|
-
children ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
295
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
296
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
297
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react13.Alert.Root, { ref, ...rest, children: [
|
|
305
|
+
startElement || /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react13.Alert.Indicator, {}),
|
|
306
|
+
children ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react13.Alert.Content, { children: [
|
|
307
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react13.Alert.Title, { children: title }),
|
|
308
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react13.Alert.Description, { children })
|
|
309
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react13.Alert.Title, { flex: "1", children: title }),
|
|
298
310
|
endElement,
|
|
299
311
|
closable && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(CloseButton, { size: "sm", pos: "relative", top: "-2", insetEnd: "-2", alignSelf: "flex-start", onClick: onClose })
|
|
300
312
|
] });
|
|
@@ -307,19 +319,19 @@ function ErrorList({
|
|
|
307
319
|
registry
|
|
308
320
|
}) {
|
|
309
321
|
const { translateString } = registry;
|
|
310
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Alert, { status: "error", title: translateString(import_utils6.TranslatableString.ErrorsLabel), mb: 3, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Alert, { status: "error", title: translateString(import_utils6.TranslatableString.ErrorsLabel), mb: 3, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react14.ListRoot, { listStylePosition: "inside", children: errors.map((error, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_react14.ListItem, { children: error.stack }, i)) }) });
|
|
311
323
|
}
|
|
312
324
|
|
|
313
325
|
// src/IconButton/ChakraIconButton.tsx
|
|
314
|
-
var
|
|
315
|
-
var
|
|
326
|
+
var import_react15 = require("react");
|
|
327
|
+
var import_react16 = require("@chakra-ui/react");
|
|
316
328
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
317
329
|
function ChakraIconButton2(props) {
|
|
318
330
|
const { icon, iconType, uiSchema, registry, ...otherProps } = props;
|
|
319
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react16.IconButton, { "aria-label": props.title, ...otherProps, children: icon });
|
|
320
332
|
}
|
|
321
333
|
ChakraIconButton2.displayName = "ChakraIconButton";
|
|
322
|
-
var ChakraIconButton_default = (0,
|
|
334
|
+
var ChakraIconButton_default = (0, import_react15.memo)(ChakraIconButton2);
|
|
323
335
|
|
|
324
336
|
// src/IconButton/IconButton.tsx
|
|
325
337
|
var import_utils7 = require("@rjsf/utils");
|
|
@@ -370,10 +382,16 @@ function RemoveButton(props) {
|
|
|
370
382
|
}
|
|
371
383
|
);
|
|
372
384
|
}
|
|
385
|
+
function ClearButton(props) {
|
|
386
|
+
const {
|
|
387
|
+
registry: { translateString }
|
|
388
|
+
} = props;
|
|
389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ChakraIconButton_default, { title: translateString(import_utils7.TranslatableString.ClearButton), ...props, icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react2.X, {}) });
|
|
390
|
+
}
|
|
373
391
|
|
|
374
392
|
// src/FieldErrorTemplate/FieldErrorTemplate.tsx
|
|
375
393
|
var import_utils8 = require("@rjsf/utils");
|
|
376
|
-
var
|
|
394
|
+
var import_react17 = require("@chakra-ui/react");
|
|
377
395
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
378
396
|
function FieldErrorTemplate(props) {
|
|
379
397
|
const { errors = [], fieldPathId } = props;
|
|
@@ -382,12 +400,12 @@ function FieldErrorTemplate(props) {
|
|
|
382
400
|
}
|
|
383
401
|
const id = (0, import_utils8.errorId)(fieldPathId);
|
|
384
402
|
return errors.map((error, i) => {
|
|
385
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react17.Fieldset.ErrorText, { mt: 0, id, children: error }, i);
|
|
386
404
|
});
|
|
387
405
|
}
|
|
388
406
|
|
|
389
407
|
// src/FieldHelpTemplate/FieldHelpTemplate.tsx
|
|
390
|
-
var
|
|
408
|
+
var import_react18 = require("@chakra-ui/react");
|
|
391
409
|
var import_utils9 = require("@rjsf/utils");
|
|
392
410
|
var import_core2 = require("@rjsf/core");
|
|
393
411
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
@@ -396,11 +414,11 @@ function FieldHelpTemplate(props) {
|
|
|
396
414
|
if (!help) {
|
|
397
415
|
return null;
|
|
398
416
|
}
|
|
399
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
417
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react18.Text, { as: "sup", fontSize: "md", id: (0, import_utils9.helpId)(fieldPathId), children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_core2.RichHelp, { help, registry, uiSchema }) });
|
|
400
418
|
}
|
|
401
419
|
|
|
402
420
|
// src/FieldTemplate/FieldTemplate.tsx
|
|
403
|
-
var
|
|
421
|
+
var import_react19 = require("@chakra-ui/react");
|
|
404
422
|
var import_utils10 = require("@rjsf/utils");
|
|
405
423
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
406
424
|
function FieldTemplate(props) {
|
|
@@ -454,10 +472,10 @@ function FieldTemplate(props) {
|
|
|
454
472
|
schema,
|
|
455
473
|
uiSchema,
|
|
456
474
|
registry,
|
|
457
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
458
|
-
displayLabel && rawDescription ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
475
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react19.Fieldset.Root, { disabled, invalid: rawErrors && rawErrors.length > 0, children: [
|
|
476
|
+
displayLabel && rawDescription ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react19.Fieldset.Legend, { mt: 2, children: description }) : null,
|
|
459
477
|
help,
|
|
460
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
478
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react19.Fieldset.Content, { children }),
|
|
461
479
|
errors
|
|
462
480
|
] })
|
|
463
481
|
}
|
|
@@ -465,29 +483,29 @@ function FieldTemplate(props) {
|
|
|
465
483
|
}
|
|
466
484
|
|
|
467
485
|
// src/GridTemplate/GridTemplate.tsx
|
|
468
|
-
var
|
|
486
|
+
var import_react20 = require("@chakra-ui/react");
|
|
469
487
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
470
488
|
function GridTemplate(props) {
|
|
471
489
|
const { children, column, ...rest } = props;
|
|
472
490
|
if (column) {
|
|
473
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react20.GridItem, { ...rest, children });
|
|
474
492
|
}
|
|
475
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
493
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react20.Grid, { ...rest, children });
|
|
476
494
|
}
|
|
477
495
|
|
|
478
496
|
// src/MultiSchemaFieldTemplate/MultiSchemaFieldTemplate.tsx
|
|
479
|
-
var
|
|
497
|
+
var import_react21 = require("@chakra-ui/react");
|
|
480
498
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
481
499
|
function MultiSchemaFieldTemplate(props) {
|
|
482
500
|
const { optionSchemaField, selector } = props;
|
|
483
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
484
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react21.Card.Root, { mb: 2, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react21.Card.Body, { pb: 2, children: [
|
|
502
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react21.Box, { mb: 4, children: selector }),
|
|
485
503
|
optionSchemaField
|
|
486
504
|
] }) });
|
|
487
505
|
}
|
|
488
506
|
|
|
489
507
|
// src/ObjectFieldTemplate/ObjectFieldTemplate.tsx
|
|
490
|
-
var
|
|
508
|
+
var import_react22 = require("@chakra-ui/react");
|
|
491
509
|
var import_utils11 = require("@rjsf/utils");
|
|
492
510
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
493
511
|
function ObjectFieldTemplate(props) {
|
|
@@ -540,12 +558,12 @@ function ObjectFieldTemplate(props) {
|
|
|
540
558
|
registry
|
|
541
559
|
}
|
|
542
560
|
),
|
|
543
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
544
|
-
!showOptionalDataControlInTitle ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
561
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react22.Grid, { gap: description ? 2 : 4, mb: 4, children: [
|
|
562
|
+
!showOptionalDataControlInTitle ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react22.GridItem, { children: optionalDataControl }) : void 0,
|
|
545
563
|
properties.map(
|
|
546
|
-
(element, index) => element.hidden ? element.content : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
564
|
+
(element, index) => element.hidden ? element.content : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react22.GridItem, { children: element.content }, `${fieldPathId.$id}-${element.name}-${index}`)
|
|
547
565
|
),
|
|
548
|
-
(0, import_utils11.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
566
|
+
(0, import_utils11.canExpand)(schema, uiSchema, formData) && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react22.GridItem, { justifySelf: "flex-end", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
549
567
|
AddButton2,
|
|
550
568
|
{
|
|
551
569
|
id: (0, import_utils11.buttonId)(fieldPathId, "add"),
|
|
@@ -597,7 +615,7 @@ function OptionalDataControlsTemplate(props) {
|
|
|
597
615
|
}
|
|
598
616
|
|
|
599
617
|
// src/SubmitButton/SubmitButton.tsx
|
|
600
|
-
var
|
|
618
|
+
var import_react23 = require("@chakra-ui/react");
|
|
601
619
|
var import_utils12 = require("@rjsf/utils");
|
|
602
620
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
603
621
|
function SubmitButton({ uiSchema }) {
|
|
@@ -605,34 +623,34 @@ function SubmitButton({ uiSchema }) {
|
|
|
605
623
|
if (norender) {
|
|
606
624
|
return null;
|
|
607
625
|
}
|
|
608
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
626
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react23.Box, { marginTop: 3, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react23.Button, { type: "submit", variant: "solid", ...submitButtonProps, children: submitText }) });
|
|
609
627
|
}
|
|
610
628
|
|
|
611
629
|
// src/TitleField/TitleField.tsx
|
|
612
|
-
var
|
|
630
|
+
var import_react24 = require("@chakra-ui/react");
|
|
613
631
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
614
632
|
function TitleField({
|
|
615
633
|
id,
|
|
616
634
|
title,
|
|
617
635
|
optionalDataControl
|
|
618
636
|
}) {
|
|
619
|
-
let heading = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
637
|
+
let heading = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react24.Heading, { as: "h5", children: title });
|
|
620
638
|
if (optionalDataControl) {
|
|
621
|
-
heading = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
639
|
+
heading = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react24.Flex, { children: [
|
|
622
640
|
heading,
|
|
623
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
641
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react24.Spacer, {}),
|
|
624
642
|
optionalDataControl
|
|
625
643
|
] });
|
|
626
644
|
}
|
|
627
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react24.Box, { id, mt: 1, mb: 4, children: [
|
|
628
646
|
heading,
|
|
629
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
647
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react24.Separator, {})
|
|
630
648
|
] });
|
|
631
649
|
}
|
|
632
650
|
|
|
633
651
|
// src/WrapIfAdditionalTemplate/WrapIfAdditionalTemplate.tsx
|
|
634
652
|
var import_utils13 = require("@rjsf/utils");
|
|
635
|
-
var
|
|
653
|
+
var import_react25 = require("@chakra-ui/react");
|
|
636
654
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
637
655
|
function WrapIfAdditionalTemplate(props) {
|
|
638
656
|
const {
|
|
@@ -662,7 +680,7 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
662
680
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: classNames, style, children });
|
|
663
681
|
}
|
|
664
682
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
665
|
-
|
|
683
|
+
import_react25.Grid,
|
|
666
684
|
{
|
|
667
685
|
templateColumns: "repeat(11, 1fr)",
|
|
668
686
|
className: classNames,
|
|
@@ -670,8 +688,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
670
688
|
alignItems: "center",
|
|
671
689
|
gap: 2,
|
|
672
690
|
children: [
|
|
673
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
674
|
-
|
|
691
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react25.GridItem, { colSpan: 5, style: { marginTop: hasDescription ? "36px" : void 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Field, { required, label: keyLabel, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
692
|
+
import_react25.Input,
|
|
675
693
|
{
|
|
676
694
|
defaultValue: label,
|
|
677
695
|
disabled: disabled || readonly,
|
|
@@ -682,8 +700,8 @@ function WrapIfAdditionalTemplate(props) {
|
|
|
682
700
|
mb: 1
|
|
683
701
|
}
|
|
684
702
|
) }) }),
|
|
685
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
686
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
703
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react25.GridItem, { colSpan: 5, children }),
|
|
704
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react25.GridItem, { justifySelf: "flex-end", style: { marginTop: displayLabel ? `${margin}px` : void 0 }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
687
705
|
RemoveButton2,
|
|
688
706
|
{
|
|
689
707
|
id: (0, import_utils13.buttonId)(id, "remove"),
|
|
@@ -712,7 +730,8 @@ function generateTemplates() {
|
|
|
712
730
|
MoveDownButton,
|
|
713
731
|
MoveUpButton,
|
|
714
732
|
RemoveButton,
|
|
715
|
-
SubmitButton
|
|
733
|
+
SubmitButton,
|
|
734
|
+
ClearButton
|
|
716
735
|
},
|
|
717
736
|
DescriptionFieldTemplate: DescriptionField,
|
|
718
737
|
ErrorListTemplate: ErrorList,
|
|
@@ -729,19 +748,41 @@ function generateTemplates() {
|
|
|
729
748
|
}
|
|
730
749
|
var Templates_default = generateTemplates();
|
|
731
750
|
|
|
751
|
+
// src/AltDateTimeWidget/AltDateTimeWidget.tsx
|
|
752
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
753
|
+
function AltDateTimeWidget({
|
|
754
|
+
time = true,
|
|
755
|
+
...props
|
|
756
|
+
}) {
|
|
757
|
+
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(AltDateWidget2, { ...props, time });
|
|
759
|
+
}
|
|
760
|
+
var AltDateTimeWidget_default = AltDateTimeWidget;
|
|
761
|
+
|
|
732
762
|
// src/AltDateWidget/AltDateWidget.tsx
|
|
733
|
-
var
|
|
763
|
+
var import_react26 = require("@chakra-ui/react");
|
|
734
764
|
var import_utils14 = require("@rjsf/utils");
|
|
735
|
-
var
|
|
736
|
-
function AltDateWidget(
|
|
737
|
-
|
|
765
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
766
|
+
function AltDateWidget({
|
|
767
|
+
autofocus = false,
|
|
768
|
+
disabled = false,
|
|
769
|
+
readonly = false,
|
|
770
|
+
time = false,
|
|
771
|
+
options,
|
|
772
|
+
...props
|
|
773
|
+
}) {
|
|
774
|
+
const { id, onBlur, onFocus, registry } = props;
|
|
738
775
|
const { translateString } = registry;
|
|
739
|
-
const {
|
|
776
|
+
const realOptions = { yearsRange: [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2], ...options };
|
|
777
|
+
const { elements, handleChange, handleClear, handleSetNow } = (0, import_utils14.useAltDateWidgetProps)({
|
|
778
|
+
...props,
|
|
779
|
+
options: realOptions
|
|
780
|
+
});
|
|
740
781
|
const chakraProps = getChakra({ uiSchema: props.uiSchema });
|
|
741
|
-
return /* @__PURE__ */ (0,
|
|
742
|
-
/* @__PURE__ */ (0,
|
|
782
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react26.FieldsetRoot, { ...chakraProps, children: [
|
|
783
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react26.Box, { display: "flex", flexWrap: "wrap", alignItems: "center", children: elements.map((elemProps, i) => {
|
|
743
784
|
const elemId = `${id}_${elemProps.type}`;
|
|
744
|
-
return /* @__PURE__ */ (0,
|
|
785
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react26.Box, { mr: "2", mb: "2", width: "20", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
745
786
|
import_utils14.DateElement,
|
|
746
787
|
{
|
|
747
788
|
...props,
|
|
@@ -759,49 +800,28 @@ function AltDateWidget(props) {
|
|
|
759
800
|
}
|
|
760
801
|
) }, elemId);
|
|
761
802
|
}) }),
|
|
762
|
-
/* @__PURE__ */ (0,
|
|
763
|
-
!options.hideNowButton && /* @__PURE__ */ (0,
|
|
764
|
-
!options.hideClearButton && /* @__PURE__ */ (0,
|
|
803
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_react26.Box, { display: "flex", children: [
|
|
804
|
+
!options.hideNowButton && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react26.Button, { onClick: handleSetNow, mr: "2", children: translateString(import_utils14.TranslatableString.NowLabel) }),
|
|
805
|
+
!options.hideClearButton && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react26.Button, { onClick: handleClear, children: translateString(import_utils14.TranslatableString.ClearLabel) })
|
|
765
806
|
] })
|
|
766
807
|
] });
|
|
767
808
|
}
|
|
768
|
-
AltDateWidget.defaultProps = {
|
|
769
|
-
autofocus: false,
|
|
770
|
-
disabled: false,
|
|
771
|
-
readonly: false,
|
|
772
|
-
time: false,
|
|
773
|
-
options: {
|
|
774
|
-
yearsRange: [1900, (/* @__PURE__ */ new Date()).getFullYear() + 2]
|
|
775
|
-
}
|
|
776
|
-
};
|
|
777
809
|
var AltDateWidget_default = AltDateWidget;
|
|
778
810
|
|
|
779
|
-
// src/AltDateTimeWidget/AltDateTimeWidget.tsx
|
|
780
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
781
|
-
function AltDateTimeWidget(props) {
|
|
782
|
-
const { AltDateWidget: AltDateWidget2 } = props.registry.widgets;
|
|
783
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(AltDateWidget2, { ...props, time: true });
|
|
784
|
-
}
|
|
785
|
-
AltDateTimeWidget.defaultProps = {
|
|
786
|
-
...AltDateWidget_default.defaultProps,
|
|
787
|
-
time: true
|
|
788
|
-
};
|
|
789
|
-
var AltDateTimeWidget_default = AltDateTimeWidget;
|
|
790
|
-
|
|
791
811
|
// src/CheckboxWidget/CheckboxWidget.tsx
|
|
792
|
-
var
|
|
812
|
+
var import_react29 = require("@chakra-ui/react");
|
|
793
813
|
var import_utils16 = require("@rjsf/utils");
|
|
794
814
|
|
|
795
815
|
// src/components/ui/checkbox.tsx
|
|
796
|
-
var
|
|
797
|
-
var
|
|
816
|
+
var import_react27 = require("react");
|
|
817
|
+
var import_react28 = require("@chakra-ui/react");
|
|
798
818
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
799
|
-
var Checkbox = (0,
|
|
819
|
+
var Checkbox = (0, import_react27.forwardRef)(function Checkbox2(props, ref) {
|
|
800
820
|
const { icon, children, inputProps, rootRef, ...rest } = props;
|
|
801
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
802
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
803
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
804
|
-
children != null && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
821
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_react28.Checkbox.Root, { ref: rootRef, ...rest, children: [
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react28.Checkbox.HiddenInput, { ref, ...inputProps }),
|
|
823
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react28.Checkbox.Control, { children: icon || /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react28.Checkbox.Indicator, {}) }),
|
|
824
|
+
children != null && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react28.Checkbox.Label, { children })
|
|
805
825
|
] });
|
|
806
826
|
});
|
|
807
827
|
|
|
@@ -859,14 +879,14 @@ function CheckboxWidget(props) {
|
|
|
859
879
|
onBlur: _onBlur,
|
|
860
880
|
onFocus: _onFocus,
|
|
861
881
|
"aria-describedby": (0, import_utils16.ariaDescribedByIds)(id),
|
|
862
|
-
children: (0, import_utils16.labelValue)(/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
882
|
+
children: (0, import_utils16.labelValue)(/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_react29.Text, { children: label }), hideLabel || !label)
|
|
863
883
|
}
|
|
864
884
|
)
|
|
865
885
|
] });
|
|
866
886
|
}
|
|
867
887
|
|
|
868
888
|
// src/CheckboxesWidget/CheckboxesWidget.tsx
|
|
869
|
-
var
|
|
889
|
+
var import_react30 = require("@chakra-ui/react");
|
|
870
890
|
var import_utils18 = require("@rjsf/utils");
|
|
871
891
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
872
892
|
function CheckboxesWidget(props) {
|
|
@@ -893,23 +913,23 @@ function CheckboxesWidget(props) {
|
|
|
893
913
|
const selectedIndexes = (0, import_utils18.enumOptionsIndexForValue)(value, enumOptions, true);
|
|
894
914
|
const chakraProps = getChakra({ uiSchema });
|
|
895
915
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
896
|
-
|
|
916
|
+
import_react30.FieldsetRoot,
|
|
897
917
|
{
|
|
898
918
|
mb: 1,
|
|
899
919
|
disabled: disabled || readonly,
|
|
900
920
|
invalid: rawErrors && rawErrors.length > 0,
|
|
901
921
|
...chakraProps,
|
|
902
922
|
children: [
|
|
903
|
-
!hideLabel && label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
923
|
+
!hideLabel && label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react30.FieldsetLegend, { children: (0, import_utils18.labelValue)(label) }),
|
|
904
924
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
905
|
-
|
|
925
|
+
import_react30.CheckboxGroup,
|
|
906
926
|
{
|
|
907
927
|
onValueChange: (option) => onChange((0, import_utils18.enumOptionsValueForIndex)(option, enumOptions, emptyValue)),
|
|
908
928
|
value: selectedIndexes,
|
|
909
929
|
"aria-describedby": (0, import_utils18.ariaDescribedByIds)(id),
|
|
910
930
|
readOnly: readonly,
|
|
911
931
|
required,
|
|
912
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
932
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react30.Stack, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
913
933
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
914
934
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
915
935
|
Checkbox,
|
|
@@ -920,7 +940,7 @@ function CheckboxesWidget(props) {
|
|
|
920
940
|
disabled: disabled || itemDisabled || readonly,
|
|
921
941
|
onBlur: _onBlur,
|
|
922
942
|
onFocus: _onFocus,
|
|
923
|
-
children: option.label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
943
|
+
children: option.label && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react30.Text, { children: option.label })
|
|
924
944
|
},
|
|
925
945
|
index
|
|
926
946
|
);
|
|
@@ -933,22 +953,22 @@ function CheckboxesWidget(props) {
|
|
|
933
953
|
}
|
|
934
954
|
|
|
935
955
|
// src/RadioWidget/RadioWidget.tsx
|
|
936
|
-
var
|
|
956
|
+
var import_react33 = require("@chakra-ui/react");
|
|
937
957
|
var import_utils20 = require("@rjsf/utils");
|
|
938
958
|
|
|
939
959
|
// src/components/ui/radio.tsx
|
|
940
|
-
var
|
|
941
|
-
var
|
|
960
|
+
var import_react31 = require("react");
|
|
961
|
+
var import_react32 = require("@chakra-ui/react");
|
|
942
962
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
943
|
-
var Radio = (0,
|
|
963
|
+
var Radio = (0, import_react31.forwardRef)(function Radio2(props, ref) {
|
|
944
964
|
const { children, inputProps, rootRef, ...rest } = props;
|
|
945
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
946
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
947
|
-
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
948
|
-
children && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
965
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_react32.RadioGroup.Item, { ref: rootRef, ...rest, children: [
|
|
966
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react32.RadioGroup.ItemHiddenInput, { ref, ...inputProps }),
|
|
967
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react32.RadioGroup.ItemIndicator, {}),
|
|
968
|
+
children && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_react32.RadioGroup.ItemText, { children })
|
|
949
969
|
] });
|
|
950
970
|
});
|
|
951
|
-
var RadioGroup =
|
|
971
|
+
var RadioGroup = import_react32.RadioGroup.Root;
|
|
952
972
|
|
|
953
973
|
// src/RadioWidget/RadioWidget.tsx
|
|
954
974
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
@@ -992,7 +1012,7 @@ function RadioWidget({
|
|
|
992
1012
|
value: selectedIndex,
|
|
993
1013
|
name: htmlName || id,
|
|
994
1014
|
"aria-describedby": (0, import_utils20.ariaDescribedByIds)(id),
|
|
995
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
1015
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react33.Stack, { direction: row ? "row" : "column", children: Array.isArray(enumOptions) && enumOptions.map((option, index) => {
|
|
996
1016
|
const itemDisabled = Array.isArray(enumDisabled) && enumDisabled.indexOf(option.value) !== -1;
|
|
997
1017
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
998
1018
|
Radio,
|
|
@@ -1015,10 +1035,10 @@ function RadioWidget({
|
|
|
1015
1035
|
var import_utils22 = require("@rjsf/utils");
|
|
1016
1036
|
|
|
1017
1037
|
// src/components/ui/slider.tsx
|
|
1018
|
-
var
|
|
1019
|
-
var
|
|
1038
|
+
var import_react34 = require("react");
|
|
1039
|
+
var import_react35 = require("@chakra-ui/react");
|
|
1020
1040
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1021
|
-
var Slider = (0,
|
|
1041
|
+
var Slider = (0, import_react34.forwardRef)(function Slider2(props, ref) {
|
|
1022
1042
|
const { marks: marksProp, showValue, ...rest } = props;
|
|
1023
1043
|
const value = props.defaultValue ?? props.value;
|
|
1024
1044
|
const marks = marksProp?.map((mark) => {
|
|
@@ -1028,10 +1048,10 @@ var Slider = (0, import_react33.forwardRef)(function Slider2(props, ref) {
|
|
|
1028
1048
|
return mark;
|
|
1029
1049
|
});
|
|
1030
1050
|
const hasMarkLabel = !!marks?.some((mark) => mark.label);
|
|
1031
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1032
|
-
showValue && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1033
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1034
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react35.Slider.Root, { ref, width: "200px", thumbAlignment: "center", ...rest, children: [
|
|
1052
|
+
showValue && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react35.HStack, { justify: "space-between", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react35.Slider.ValueText, {}) }),
|
|
1053
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react35.Slider.Control, { "data-has-mark-label": hasMarkLabel || void 0, children: [
|
|
1054
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react35.Slider.Track, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react35.Slider.Range, {}) }),
|
|
1035
1055
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SliderThumbs, { value }),
|
|
1036
1056
|
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(SliderMarks, { marks })
|
|
1037
1057
|
] })
|
|
@@ -1039,18 +1059,18 @@ var Slider = (0, import_react33.forwardRef)(function Slider2(props, ref) {
|
|
|
1039
1059
|
});
|
|
1040
1060
|
function SliderThumbs(props) {
|
|
1041
1061
|
const { value } = props;
|
|
1042
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: value?.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_jsx_runtime29.Fragment, { children: value?.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react35.Slider.Thumb, { index, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react35.Slider.HiddenInput, {}) }, index)) });
|
|
1043
1063
|
}
|
|
1044
|
-
var SliderMarks = (0,
|
|
1064
|
+
var SliderMarks = (0, import_react34.forwardRef)(function SliderMarks2(props, ref) {
|
|
1045
1065
|
const { marks } = props;
|
|
1046
1066
|
if (!marks?.length) {
|
|
1047
1067
|
return null;
|
|
1048
1068
|
}
|
|
1049
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react35.Slider.MarkerGroup, { ref, children: marks.map((mark, index) => {
|
|
1050
1070
|
const value = typeof mark === "number" ? mark : mark.value;
|
|
1051
1071
|
const label = typeof mark === "number" ? void 0 : mark.label;
|
|
1052
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1053
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_react35.Slider.Marker, { value, children: [
|
|
1073
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_react35.Slider.MarkerIndicator, {}),
|
|
1054
1074
|
label
|
|
1055
1075
|
] }, index);
|
|
1056
1076
|
}) });
|
|
@@ -1093,43 +1113,43 @@ function RangeWidget({
|
|
|
1093
1113
|
}
|
|
1094
1114
|
|
|
1095
1115
|
// src/SelectWidget/SelectWidget.tsx
|
|
1096
|
-
var
|
|
1116
|
+
var import_react38 = require("react");
|
|
1097
1117
|
var import_utils24 = require("@rjsf/utils");
|
|
1098
|
-
var
|
|
1118
|
+
var import_react39 = require("@chakra-ui/react");
|
|
1099
1119
|
|
|
1100
1120
|
// src/components/ui/select.tsx
|
|
1101
|
-
var
|
|
1102
|
-
var
|
|
1121
|
+
var import_react36 = require("react");
|
|
1122
|
+
var import_react37 = require("@chakra-ui/react");
|
|
1103
1123
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1104
|
-
var SelectTrigger = (0,
|
|
1124
|
+
var SelectTrigger = (0, import_react36.forwardRef)(function SelectTrigger2(props, ref) {
|
|
1105
1125
|
const { children, clearable, ...rest } = props;
|
|
1106
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1107
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1108
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1126
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react37.Select.Control, { ...rest, children: [
|
|
1127
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.Trigger, { ref, children }),
|
|
1128
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react37.Select.IndicatorGroup, { children: [
|
|
1109
1129
|
clearable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(SelectClearTrigger, {}),
|
|
1110
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1130
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.Indicator, {})
|
|
1111
1131
|
] })
|
|
1112
1132
|
] });
|
|
1113
1133
|
});
|
|
1114
|
-
var SelectClearTrigger = (0,
|
|
1134
|
+
var SelectClearTrigger = (0, import_react36.forwardRef)(
|
|
1115
1135
|
function SelectClearTrigger2(props, ref) {
|
|
1116
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.ClearTrigger, { asChild: true, ...props, ref, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CloseButton, { size: "xs", variant: "plain", focusVisibleRing: "inside", focusRingWidth: "2px", pointerEvents: "auto" }) });
|
|
1117
1137
|
}
|
|
1118
1138
|
);
|
|
1119
|
-
var SelectContent = (0,
|
|
1139
|
+
var SelectContent = (0, import_react36.forwardRef)(function SelectContent2(props, ref) {
|
|
1120
1140
|
const { portalled = true, portalRef, ...rest } = props;
|
|
1121
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Portal, { disabled: !portalled, container: portalRef, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.Positioner, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.Content, { ...rest, ref }) }) });
|
|
1122
1142
|
});
|
|
1123
|
-
var SelectItem = (0,
|
|
1143
|
+
var SelectItem = (0, import_react36.forwardRef)(function SelectItem2(props, ref) {
|
|
1124
1144
|
const { item, children, ...rest } = props;
|
|
1125
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react37.Select.Item, { item, ...rest, ref, children: [
|
|
1126
1146
|
children,
|
|
1127
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1147
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.ItemIndicator, {})
|
|
1128
1148
|
] }, item.value);
|
|
1129
1149
|
});
|
|
1130
|
-
var SelectValueText = (0,
|
|
1150
|
+
var SelectValueText = (0, import_react36.forwardRef)(function SelectValueText2(props, ref) {
|
|
1131
1151
|
const { children, ...rest } = props;
|
|
1132
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1152
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.ValueText, { ...rest, ref, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.Context, { children: (select) => {
|
|
1133
1153
|
const items = select.selectedItems;
|
|
1134
1154
|
if (items.length === 0) {
|
|
1135
1155
|
return props.placeholder;
|
|
@@ -1143,21 +1163,21 @@ var SelectValueText = (0, import_react35.forwardRef)(function SelectValueText2(p
|
|
|
1143
1163
|
return `${items.length} selected`;
|
|
1144
1164
|
} }) });
|
|
1145
1165
|
});
|
|
1146
|
-
var SelectRoot = (0,
|
|
1147
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1148
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1166
|
+
var SelectRoot = (0, import_react36.forwardRef)(function SelectRoot2(props, ref) {
|
|
1167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.Root, { ...props, ref, positioning: { sameWidth: true, ...props.positioning }, children: props.asChild ? props.children : /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
|
|
1168
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.HiddenSelect, {}),
|
|
1149
1169
|
props.children
|
|
1150
1170
|
] }) });
|
|
1151
1171
|
});
|
|
1152
|
-
var SelectItemGroup = (0,
|
|
1172
|
+
var SelectItemGroup = (0, import_react36.forwardRef)(function SelectItemGroup2(props, ref) {
|
|
1153
1173
|
const { children, label, ...rest } = props;
|
|
1154
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
1155
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_react37.Select.ItemGroup, { ...rest, ref, children: [
|
|
1175
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react37.Select.ItemGroupLabel, { children: label }),
|
|
1156
1176
|
children
|
|
1157
1177
|
] });
|
|
1158
1178
|
});
|
|
1159
|
-
var SelectLabel =
|
|
1160
|
-
var SelectItemText =
|
|
1179
|
+
var SelectLabel = import_react37.Select.Label;
|
|
1180
|
+
var SelectItemText = import_react37.Select.ItemText;
|
|
1161
1181
|
|
|
1162
1182
|
// src/SelectWidget/SelectWidget.tsx
|
|
1163
1183
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
@@ -1193,7 +1213,7 @@ function SelectWidget(props) {
|
|
|
1193
1213
|
const _onBlur = ({ target }) => onBlur(id, (0, import_utils24.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1194
1214
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils24.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1195
1215
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
1196
|
-
const { valueLabelMap, displayEnumOptions } = (0,
|
|
1216
|
+
const { valueLabelMap, displayEnumOptions } = (0, import_react38.useMemo)(() => {
|
|
1197
1217
|
const valueLabelMap2 = {};
|
|
1198
1218
|
let displayEnumOptions2 = [];
|
|
1199
1219
|
if (Array.isArray(enumOptions)) {
|
|
@@ -1227,10 +1247,10 @@ function SelectWidget(props) {
|
|
|
1227
1247
|
}
|
|
1228
1248
|
] : [];
|
|
1229
1249
|
const formValue = (isMultiple ? getMultiValue() : getSingleValue()).map((item) => item.value);
|
|
1230
|
-
const selectOptions = (0,
|
|
1250
|
+
const selectOptions = (0, import_react39.createListCollection)({
|
|
1231
1251
|
items: displayEnumOptions.filter((item) => item.value)
|
|
1232
1252
|
});
|
|
1233
|
-
const containerRef = (0,
|
|
1253
|
+
const containerRef = (0, import_react38.useRef)(null);
|
|
1234
1254
|
const chakraProps = getChakra({ uiSchema });
|
|
1235
1255
|
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1236
1256
|
Field,
|
|
@@ -1260,10 +1280,10 @@ function SelectWidget(props) {
|
|
|
1260
1280
|
"aria-describedby": (0, import_utils24.ariaDescribedByIds)(id),
|
|
1261
1281
|
positioning: { placement: "bottom" },
|
|
1262
1282
|
children: [
|
|
1263
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1264
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1283
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react39.Select.Control, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectTrigger, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SelectValueText, { placeholder }) }) }),
|
|
1284
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react39.Select.Positioner, { minWidth: "100% !important", zIndex: "2 !important", top: "calc(100% + 5px) !important", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react39.Select.Content, { children: selectOptions.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react39.Select.Item, { item, children: [
|
|
1265
1285
|
item.label,
|
|
1266
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1286
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react39.Select.ItemIndicator, {})
|
|
1267
1287
|
] }, item.value)) }) })
|
|
1268
1288
|
]
|
|
1269
1289
|
}
|
|
@@ -1273,9 +1293,9 @@ function SelectWidget(props) {
|
|
|
1273
1293
|
}
|
|
1274
1294
|
|
|
1275
1295
|
// src/SelectNativeWidget/NativeSelectWidget.tsx
|
|
1276
|
-
var
|
|
1296
|
+
var import_react40 = require("react");
|
|
1277
1297
|
var import_utils26 = require("@rjsf/utils");
|
|
1278
|
-
var
|
|
1298
|
+
var import_react41 = require("@chakra-ui/react");
|
|
1279
1299
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1280
1300
|
function NativeSelectWidget(props) {
|
|
1281
1301
|
const {
|
|
@@ -1304,7 +1324,7 @@ function NativeSelectWidget(props) {
|
|
|
1304
1324
|
const _onBlur = ({ target }) => onBlur(id, (0, import_utils26.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1305
1325
|
const _onFocus = ({ target }) => onFocus(id, (0, import_utils26.enumOptionsValueForIndex)(target && target.value, enumOptions, emptyValue));
|
|
1306
1326
|
const showPlaceholderOption = !multiple && schema.default === void 0;
|
|
1307
|
-
const { valueLabelMap, displayEnumOptions } = (0,
|
|
1327
|
+
const { valueLabelMap, displayEnumOptions } = (0, import_react40.useMemo)(() => {
|
|
1308
1328
|
const valueLabelMap2 = {};
|
|
1309
1329
|
let displayEnumOptions2 = [];
|
|
1310
1330
|
if (Array.isArray(enumOptions)) {
|
|
@@ -1331,7 +1351,7 @@ function NativeSelectWidget(props) {
|
|
|
1331
1351
|
}
|
|
1332
1352
|
] : [];
|
|
1333
1353
|
const formValue = getSingleValue()[0]?.value || "";
|
|
1334
|
-
const selectOptions = (0,
|
|
1354
|
+
const selectOptions = (0, import_react41.createListCollection)({
|
|
1335
1355
|
items: displayEnumOptions.filter((item) => item.value)
|
|
1336
1356
|
});
|
|
1337
1357
|
const chakraProps = getChakra({ uiSchema });
|
|
@@ -1345,9 +1365,9 @@ function NativeSelectWidget(props) {
|
|
|
1345
1365
|
invalid: rawErrors && rawErrors.length > 0,
|
|
1346
1366
|
label: (0, import_utils26.labelValue)(label, hideLabel || !label),
|
|
1347
1367
|
...chakraProps,
|
|
1348
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1368
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_react41.NativeSelect.Root, { children: [
|
|
1349
1369
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1350
|
-
|
|
1370
|
+
import_react41.NativeSelect.Field,
|
|
1351
1371
|
{
|
|
1352
1372
|
id,
|
|
1353
1373
|
onBlur: _onBlur,
|
|
@@ -1359,14 +1379,14 @@ function NativeSelectWidget(props) {
|
|
|
1359
1379
|
children: selectOptions.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("option", { value: item.value, children: item.label }, item.value))
|
|
1360
1380
|
}
|
|
1361
1381
|
),
|
|
1362
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1382
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react41.NativeSelect.Indicator, {})
|
|
1363
1383
|
] })
|
|
1364
1384
|
}
|
|
1365
1385
|
);
|
|
1366
1386
|
}
|
|
1367
1387
|
|
|
1368
1388
|
// src/TextareaWidget/TextareaWidget.tsx
|
|
1369
|
-
var
|
|
1389
|
+
var import_react42 = require("@chakra-ui/react");
|
|
1370
1390
|
var import_utils28 = require("@rjsf/utils");
|
|
1371
1391
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1372
1392
|
function TextareaWidget({
|
|
@@ -1402,7 +1422,7 @@ function TextareaWidget({
|
|
|
1402
1422
|
label: (0, import_utils28.labelValue)(label, hideLabel || !label),
|
|
1403
1423
|
...chakraProps,
|
|
1404
1424
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1405
|
-
|
|
1425
|
+
import_react42.Textarea,
|
|
1406
1426
|
{
|
|
1407
1427
|
id,
|
|
1408
1428
|
name: htmlName || id,
|
|
@@ -1424,22 +1444,22 @@ function TextareaWidget({
|
|
|
1424
1444
|
var import_utils30 = require("@rjsf/utils");
|
|
1425
1445
|
|
|
1426
1446
|
// src/components/ui/number-input.tsx
|
|
1427
|
-
var
|
|
1428
|
-
var
|
|
1447
|
+
var import_react43 = require("react");
|
|
1448
|
+
var import_react44 = require("@chakra-ui/react");
|
|
1429
1449
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1430
|
-
var NumberInputRoot = (0,
|
|
1431
|
-
const inputRef = (0,
|
|
1432
|
-
(0,
|
|
1450
|
+
var NumberInputRoot = (0, import_react43.forwardRef)(function NumberInput(props, ref) {
|
|
1451
|
+
const inputRef = (0, import_react43.useRef)(null);
|
|
1452
|
+
(0, import_react43.useEffect)(() => {
|
|
1433
1453
|
if (inputRef.current) {
|
|
1434
1454
|
inputRef.current.value = props.value || "";
|
|
1435
1455
|
}
|
|
1436
1456
|
}, [props.value]);
|
|
1437
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1438
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
1439
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1440
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1457
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react44.NumberInput.Root, { ref, variant: "outline", ...props, children: [
|
|
1458
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react44.NumberInput.Control, { children: [
|
|
1459
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react44.NumberInput.IncrementTrigger, {}),
|
|
1460
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react44.NumberInput.DecrementTrigger, {})
|
|
1441
1461
|
] }),
|
|
1442
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
1462
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react44.NumberInput.Input, { ref: inputRef })
|
|
1443
1463
|
] });
|
|
1444
1464
|
});
|
|
1445
1465
|
|
|
@@ -1510,17 +1530,17 @@ function generateForm() {
|
|
|
1510
1530
|
var Form_default = generateForm();
|
|
1511
1531
|
|
|
1512
1532
|
// src/ChakraFrameProvider.tsx
|
|
1513
|
-
var
|
|
1533
|
+
var import_react45 = require("@emotion/react");
|
|
1514
1534
|
var import_cache = __toESM(require("@emotion/cache"), 1);
|
|
1515
1535
|
var import_weak_memoize = __toESM(require("@emotion/weak-memoize"), 1);
|
|
1516
|
-
var
|
|
1536
|
+
var import_react46 = require("@chakra-ui/react");
|
|
1517
1537
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1518
1538
|
var memoizedCreateCacheWithContainer = (0, import_weak_memoize.default)((container) => {
|
|
1519
1539
|
const newCache = (0, import_cache.default)({ container, key: "rjsf" });
|
|
1520
1540
|
return newCache;
|
|
1521
1541
|
});
|
|
1522
1542
|
var __createChakraFrameProvider = (props) => ({ document }) => {
|
|
1523
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { margin: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1543
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { style: { margin: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react45.CacheProvider, { value: memoizedCreateCacheWithContainer(document.head), children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_react46.ChakraProvider, { value: import_react46.defaultSystem, children: props.children }) }) });
|
|
1524
1544
|
};
|
|
1525
1545
|
|
|
1526
1546
|
// src/index.ts
|