@apia/validations 0.3.6 → 1.0.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/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { customEvents, propsStore, usePropsSelector, useUpdateEffect, useUnmount, useMount, PropsSelectorUndefinedObject, formatMessage, toBoolean } from '@apia/util';
2
+ import { customEvents, propsStore, usePropsSelector, useUpdateEffect, useUnmount, useMount, PropsSelectorUndefinedObject, formatMessage, toBoolean, getLabel, EventEmitter } from '@apia/util';
3
3
  import { uniqueId } from 'lodash';
4
- import React from 'react';
4
+ import React, { useState } from 'react';
5
5
  import { shallowEqual } from 'react-redux';
6
- import { injectStyles, Box, getVariant, Input as Input$1, Label, Radio as Radio$1, Select as Select$1, Switch, Textarea as Textarea$1 } from '@apia/theme';
6
+ import { injectStyles, Box, getVariant, Input as Input$1, Label, Radio as Radio$1, Select as Select$1, Switch, Textarea as Textarea$1, Button } from '@apia/theme';
7
7
  import { notify } from '@apia/notifications';
8
- import { RequiredMark, Captcha, Checkbox as Checkbox$1, IconButton, getFieldErrorStyles, DateInput, parseNumberInputValueToNumber, NumberInput } from '@apia/components';
8
+ import { RequiredMark, Captcha, Checkbox as Checkbox$1, IconButton, getFieldErrorStyles, DateInput, parseNumberInputValueToNumber, NumberInput, ApiaUtil } from '@apia/components';
9
9
 
10
10
  const FormContext = React.createContext(
11
11
  {}
@@ -25,19 +25,19 @@ function validateByRules({
25
25
  return validationResult;
26
26
  }
27
27
 
28
- var __defProp$e = Object.defineProperty;
29
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
30
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
31
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
32
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
33
- var __spreadValues$e = (a, b) => {
28
+ var __defProp$f = Object.defineProperty;
29
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
30
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
31
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
32
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
33
+ var __spreadValues$f = (a, b) => {
34
34
  for (var prop in b || (b = {}))
35
- if (__hasOwnProp$f.call(b, prop))
36
- __defNormalProp$e(a, prop, b[prop]);
37
- if (__getOwnPropSymbols$f)
38
- for (var prop of __getOwnPropSymbols$f(b)) {
39
- if (__propIsEnum$f.call(b, prop))
40
- __defNormalProp$e(a, prop, b[prop]);
35
+ if (__hasOwnProp$g.call(b, prop))
36
+ __defNormalProp$f(a, prop, b[prop]);
37
+ if (__getOwnPropSymbols$g)
38
+ for (var prop of __getOwnPropSymbols$g(b)) {
39
+ if (__propIsEnum$g.call(b, prop))
40
+ __defNormalProp$f(a, prop, b[prop]);
41
41
  }
42
42
  return a;
43
43
  };
@@ -172,7 +172,7 @@ function initValidations() {
172
172
  });
173
173
  }
174
174
  function getValidations(outerValidation) {
175
- const validation = __spreadValues$e({}, outerValidation);
175
+ const validation = __spreadValues$f({}, outerValidation);
176
176
  if (!validation)
177
177
  return {
178
178
  validate: () => {
@@ -249,33 +249,33 @@ function getValidations(outerValidation) {
249
249
  };
250
250
  }
251
251
 
252
- var __defProp$d = Object.defineProperty;
253
- var __defProps$b = Object.defineProperties;
254
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
255
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
256
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
257
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
258
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
259
- var __spreadValues$d = (a, b) => {
252
+ var __defProp$e = Object.defineProperty;
253
+ var __defProps$c = Object.defineProperties;
254
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
255
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
256
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
257
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
258
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
259
+ var __spreadValues$e = (a, b) => {
260
260
  for (var prop in b || (b = {}))
261
- if (__hasOwnProp$e.call(b, prop))
262
- __defNormalProp$d(a, prop, b[prop]);
263
- if (__getOwnPropSymbols$e)
264
- for (var prop of __getOwnPropSymbols$e(b)) {
265
- if (__propIsEnum$e.call(b, prop))
266
- __defNormalProp$d(a, prop, b[prop]);
261
+ if (__hasOwnProp$f.call(b, prop))
262
+ __defNormalProp$e(a, prop, b[prop]);
263
+ if (__getOwnPropSymbols$f)
264
+ for (var prop of __getOwnPropSymbols$f(b)) {
265
+ if (__propIsEnum$f.call(b, prop))
266
+ __defNormalProp$e(a, prop, b[prop]);
267
267
  }
268
268
  return a;
269
269
  };
270
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
270
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
271
271
  var __objRest$b = (source, exclude) => {
272
272
  var target = {};
273
273
  for (var prop in source)
274
- if (__hasOwnProp$e.call(source, prop) && exclude.indexOf(prop) < 0)
274
+ if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
275
275
  target[prop] = source[prop];
276
- if (source != null && __getOwnPropSymbols$e)
277
- for (var prop of __getOwnPropSymbols$e(source)) {
278
- if (exclude.indexOf(prop) < 0 && __propIsEnum$e.call(source, prop))
276
+ if (source != null && __getOwnPropSymbols$f)
277
+ for (var prop of __getOwnPropSymbols$f(source)) {
278
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
279
279
  target[prop] = source[prop];
280
280
  }
281
281
  return target;
@@ -348,7 +348,7 @@ const validationsStore = new class {
348
348
  if (props.initialValues)
349
349
  Object.entries(props.initialValues).forEach(([fieldId, fieldProps]) => {
350
350
  if (fieldProps instanceof Object)
351
- this.updateField(formName, __spreadValues$d({ name: fieldId }, fieldProps));
351
+ this.updateField(formName, __spreadValues$e({ name: fieldId }, fieldProps));
352
352
  });
353
353
  return;
354
354
  }
@@ -436,7 +436,7 @@ const validationsStore = new class {
436
436
  this.updateFieldStore(
437
437
  formName,
438
438
  field.name,
439
- __spreadProps$b(__spreadValues$d({}, field), {
439
+ __spreadProps$c(__spreadValues$e({}, field), {
440
440
  isTouched: isTouched || ((_b = this.getFieldStore(formName, field.name)) == null ? void 0 : _b.isTouched)
441
441
  }),
442
442
  options == null ? void 0 : options.avoidPropagation
@@ -543,7 +543,7 @@ const validationsStore = new class {
543
543
  updateFieldStore(formName, fieldName, props, noEmit) {
544
544
  propsStore.updateField(
545
545
  this.makeFieldName(formName, fieldName),
546
- __spreadValues$d(__spreadValues$d({}, this.getFieldStore(formName, fieldName)), props),
546
+ __spreadValues$e(__spreadValues$e({}, this.getFieldStore(formName, fieldName)), props),
547
547
  { noEmit }
548
548
  );
549
549
  }
@@ -593,25 +593,25 @@ const formStyles = {
593
593
  }
594
594
  };
595
595
 
596
- var __defProp$c = Object.defineProperty;
597
- var __defProps$a = Object.defineProperties;
598
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
599
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
600
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
601
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
602
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
603
- var __spreadValues$c = (a, b) => {
596
+ var __defProp$d = Object.defineProperty;
597
+ var __defProps$b = Object.defineProperties;
598
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
599
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
600
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
601
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
602
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
603
+ var __spreadValues$d = (a, b) => {
604
604
  for (var prop in b || (b = {}))
605
- if (__hasOwnProp$d.call(b, prop))
606
- __defNormalProp$c(a, prop, b[prop]);
607
- if (__getOwnPropSymbols$d)
608
- for (var prop of __getOwnPropSymbols$d(b)) {
609
- if (__propIsEnum$d.call(b, prop))
610
- __defNormalProp$c(a, prop, b[prop]);
605
+ if (__hasOwnProp$e.call(b, prop))
606
+ __defNormalProp$d(a, prop, b[prop]);
607
+ if (__getOwnPropSymbols$e)
608
+ for (var prop of __getOwnPropSymbols$e(b)) {
609
+ if (__propIsEnum$e.call(b, prop))
610
+ __defNormalProp$d(a, prop, b[prop]);
611
611
  }
612
612
  return a;
613
613
  };
614
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
614
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
615
615
  var __async = (__this, __arguments, generator) => {
616
616
  return new Promise((resolve, reject) => {
617
617
  var fulfilled = (value) => {
@@ -691,7 +691,7 @@ const Form = ({
691
691
  return null;
692
692
  return /* @__PURE__ */ jsx(FormContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
693
693
  Box,
694
- __spreadProps$a(__spreadValues$c(__spreadProps$a(__spreadValues$c({
694
+ __spreadProps$b(__spreadValues$d(__spreadProps$b(__spreadValues$d({
695
695
  as: "form"
696
696
  }, getVariant("layout.common.validations.form")), {
697
697
  className,
@@ -704,19 +704,19 @@ const Form = ({
704
704
  };
705
705
  injectStyles("layout.common.validations.form", formStyles);
706
706
 
707
- var __defProp$b = Object.defineProperty;
708
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
709
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
710
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
711
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
712
- var __spreadValues$b = (a, b) => {
707
+ var __defProp$c = Object.defineProperty;
708
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
709
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
710
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
711
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
712
+ var __spreadValues$c = (a, b) => {
713
713
  for (var prop in b || (b = {}))
714
- if (__hasOwnProp$c.call(b, prop))
715
- __defNormalProp$b(a, prop, b[prop]);
716
- if (__getOwnPropSymbols$c)
717
- for (var prop of __getOwnPropSymbols$c(b)) {
718
- if (__propIsEnum$c.call(b, prop))
719
- __defNormalProp$b(a, prop, b[prop]);
714
+ if (__hasOwnProp$d.call(b, prop))
715
+ __defNormalProp$c(a, prop, b[prop]);
716
+ if (__getOwnPropSymbols$d)
717
+ for (var prop of __getOwnPropSymbols$d(b)) {
718
+ if (__propIsEnum$d.call(b, prop))
719
+ __defNormalProp$c(a, prop, b[prop]);
720
720
  }
721
721
  return a;
722
722
  };
@@ -733,7 +733,7 @@ function useField(fieldDefinition) {
733
733
  React.useMemo(() => {
734
734
  validationsStore.registerField(
735
735
  formName,
736
- __spreadValues$b(__spreadValues$b({}, fieldDefinition), fieldDefinition.initialValue !== void 0 ? { value: fieldDefinition.initialValue } : null),
736
+ __spreadValues$c(__spreadValues$c({}, fieldDefinition), fieldDefinition.initialValue !== void 0 ? { value: fieldDefinition.initialValue } : null),
737
737
  {
738
738
  avoidPropagation: true,
739
739
  registerIfExists: !fieldDefinition.avoidRegisterIfExists
@@ -848,19 +848,19 @@ function useFieldValue({ formName, name }) {
848
848
  return value;
849
849
  }
850
850
 
851
- var __defProp$a = Object.defineProperty;
852
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
853
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
854
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
855
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
856
- var __spreadValues$a = (a, b) => {
851
+ var __defProp$b = Object.defineProperty;
852
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
853
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
854
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
855
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
856
+ var __spreadValues$b = (a, b) => {
857
857
  for (var prop in b || (b = {}))
858
- if (__hasOwnProp$b.call(b, prop))
859
- __defNormalProp$a(a, prop, b[prop]);
860
- if (__getOwnPropSymbols$b)
861
- for (var prop of __getOwnPropSymbols$b(b)) {
862
- if (__propIsEnum$b.call(b, prop))
863
- __defNormalProp$a(a, prop, b[prop]);
858
+ if (__hasOwnProp$c.call(b, prop))
859
+ __defNormalProp$b(a, prop, b[prop]);
860
+ if (__getOwnPropSymbols$c)
861
+ for (var prop of __getOwnPropSymbols$c(b)) {
862
+ if (__propIsEnum$c.call(b, prop))
863
+ __defNormalProp$b(a, prop, b[prop]);
864
864
  }
865
865
  return a;
866
866
  };
@@ -907,7 +907,7 @@ function useValidationClass({
907
907
  ]
908
908
  );
909
909
  const actualValidationRules = React.useMemo(() => {
910
- return __spreadValues$a(__spreadValues$a({}, validationRules), validationClass !== void 0 ? classToValidate(validationClass) : {});
910
+ return __spreadValues$b(__spreadValues$b({}, validationRules), validationClass !== void 0 ? classToValidate(validationClass) : {});
911
911
  }, [validationClass, validationRules]);
912
912
  return {
913
913
  actualValidationFunction,
@@ -933,33 +933,33 @@ const ValidationError = ({ name }) => {
933
933
  ) : null;
934
934
  };
935
935
 
936
- var __defProp$9 = Object.defineProperty;
937
- var __defProps$9 = Object.defineProperties;
938
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
939
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
940
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
941
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
942
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
943
- var __spreadValues$9 = (a, b) => {
936
+ var __defProp$a = Object.defineProperty;
937
+ var __defProps$a = Object.defineProperties;
938
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
939
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
940
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
941
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
942
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
943
+ var __spreadValues$a = (a, b) => {
944
944
  for (var prop in b || (b = {}))
945
- if (__hasOwnProp$a.call(b, prop))
946
- __defNormalProp$9(a, prop, b[prop]);
947
- if (__getOwnPropSymbols$a)
948
- for (var prop of __getOwnPropSymbols$a(b)) {
949
- if (__propIsEnum$a.call(b, prop))
950
- __defNormalProp$9(a, prop, b[prop]);
945
+ if (__hasOwnProp$b.call(b, prop))
946
+ __defNormalProp$a(a, prop, b[prop]);
947
+ if (__getOwnPropSymbols$b)
948
+ for (var prop of __getOwnPropSymbols$b(b)) {
949
+ if (__propIsEnum$b.call(b, prop))
950
+ __defNormalProp$a(a, prop, b[prop]);
951
951
  }
952
952
  return a;
953
953
  };
954
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
954
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
955
955
  var __objRest$a = (source, exclude) => {
956
956
  var target = {};
957
957
  for (var prop in source)
958
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
958
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
959
959
  target[prop] = source[prop];
960
- if (source != null && __getOwnPropSymbols$a)
961
- for (var prop of __getOwnPropSymbols$a(source)) {
962
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
960
+ if (source != null && __getOwnPropSymbols$b)
961
+ for (var prop of __getOwnPropSymbols$b(source)) {
962
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
963
963
  target[prop] = source[prop];
964
964
  }
965
965
  return target;
@@ -994,7 +994,7 @@ const FieldWrapper = (_a) => {
994
994
  if (type === "checkbox") {
995
995
  return /* @__PURE__ */ jsxs(
996
996
  Box,
997
- __spreadProps$9(__spreadValues$9({
997
+ __spreadProps$a(__spreadValues$a({
998
998
  className: `fieldWrapper checkboxWrapper ${className != null ? className : ""}`
999
999
  }, props), {
1000
1000
  as,
@@ -1010,7 +1010,13 @@ const FieldWrapper = (_a) => {
1010
1010
  })
1011
1011
  );
1012
1012
  }
1013
- return /* @__PURE__ */ jsxs(Box, __spreadProps$9(__spreadValues$9({ className: `fieldWrapper ${className != null ? className : ""}` }, props), { as, children: [
1013
+ if (!label) {
1014
+ return /* @__PURE__ */ jsxs(Box, { className: "fieldWrapper", as: "span", children: [
1015
+ children,
1016
+ /* @__PURE__ */ jsx(ValidationError, { name })
1017
+ ] });
1018
+ }
1019
+ return /* @__PURE__ */ jsxs(Box, __spreadProps$a(__spreadValues$a({ className: `fieldWrapper ${className != null ? className : ""}` }, props), { as, children: [
1014
1020
  /* @__PURE__ */ jsxs(Box, { as: "span", children: [
1015
1021
  window.SHOW_REQUIRED_POSITION !== "0" && label && /* @__PURE__ */ jsx(RequiredMark, { isRequired }),
1016
1022
  label,
@@ -1022,17 +1028,17 @@ const FieldWrapper = (_a) => {
1022
1028
  ] }));
1023
1029
  };
1024
1030
 
1025
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1026
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1027
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1031
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
1032
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
1033
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
1028
1034
  var __objRest$9 = (source, exclude) => {
1029
1035
  var target = {};
1030
1036
  for (var prop in source)
1031
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
1037
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
1032
1038
  target[prop] = source[prop];
1033
- if (source != null && __getOwnPropSymbols$9)
1034
- for (var prop of __getOwnPropSymbols$9(source)) {
1035
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
1039
+ if (source != null && __getOwnPropSymbols$a)
1040
+ for (var prop of __getOwnPropSymbols$a(source)) {
1041
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
1036
1042
  target[prop] = source[prop];
1037
1043
  }
1038
1044
  return target;
@@ -1092,33 +1098,33 @@ const InnerCaptcha = ({
1092
1098
  );
1093
1099
  };
1094
1100
 
1095
- var __defProp$8 = Object.defineProperty;
1096
- var __defProps$8 = Object.defineProperties;
1097
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1098
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1099
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1100
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1101
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1102
- var __spreadValues$8 = (a, b) => {
1101
+ var __defProp$9 = Object.defineProperty;
1102
+ var __defProps$9 = Object.defineProperties;
1103
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
1104
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
1105
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
1106
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
1107
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1108
+ var __spreadValues$9 = (a, b) => {
1103
1109
  for (var prop in b || (b = {}))
1104
- if (__hasOwnProp$8.call(b, prop))
1105
- __defNormalProp$8(a, prop, b[prop]);
1106
- if (__getOwnPropSymbols$8)
1107
- for (var prop of __getOwnPropSymbols$8(b)) {
1108
- if (__propIsEnum$8.call(b, prop))
1109
- __defNormalProp$8(a, prop, b[prop]);
1110
+ if (__hasOwnProp$9.call(b, prop))
1111
+ __defNormalProp$9(a, prop, b[prop]);
1112
+ if (__getOwnPropSymbols$9)
1113
+ for (var prop of __getOwnPropSymbols$9(b)) {
1114
+ if (__propIsEnum$9.call(b, prop))
1115
+ __defNormalProp$9(a, prop, b[prop]);
1110
1116
  }
1111
1117
  return a;
1112
1118
  };
1113
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1119
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
1114
1120
  var __objRest$8 = (source, exclude) => {
1115
1121
  var target = {};
1116
1122
  for (var prop in source)
1117
- if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
1123
+ if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
1118
1124
  target[prop] = source[prop];
1119
- if (source != null && __getOwnPropSymbols$8)
1120
- for (var prop of __getOwnPropSymbols$8(source)) {
1121
- if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
1125
+ if (source != null && __getOwnPropSymbols$9)
1126
+ for (var prop of __getOwnPropSymbols$9(source)) {
1127
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
1122
1128
  target[prop] = source[prop];
1123
1129
  }
1124
1130
  return target;
@@ -1200,7 +1206,7 @@ const Checkbox = React.forwardRef(
1200
1206
  avoidSemicolon,
1201
1207
  children: /* @__PURE__ */ jsx(
1202
1208
  Checkbox$1,
1203
- __spreadProps$8(__spreadValues$8(__spreadValues$8({}, props), inputProps), {
1209
+ __spreadProps$9(__spreadValues$9(__spreadValues$9({}, props), inputProps), {
1204
1210
  native,
1205
1211
  "aria-label": (_c = props["aria-label"]) != null ? _c : label,
1206
1212
  onChange: (ev) => {
@@ -1218,33 +1224,33 @@ const Checkbox = React.forwardRef(
1218
1224
  );
1219
1225
  Checkbox.displayName = "Checkbox";
1220
1226
 
1221
- var __defProp$7 = Object.defineProperty;
1222
- var __defProps$7 = Object.defineProperties;
1223
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1224
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1225
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1226
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1227
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1228
- var __spreadValues$7 = (a, b) => {
1227
+ var __defProp$8 = Object.defineProperty;
1228
+ var __defProps$8 = Object.defineProperties;
1229
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
1230
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
1231
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
1232
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
1233
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1234
+ var __spreadValues$8 = (a, b) => {
1229
1235
  for (var prop in b || (b = {}))
1230
- if (__hasOwnProp$7.call(b, prop))
1231
- __defNormalProp$7(a, prop, b[prop]);
1232
- if (__getOwnPropSymbols$7)
1233
- for (var prop of __getOwnPropSymbols$7(b)) {
1234
- if (__propIsEnum$7.call(b, prop))
1235
- __defNormalProp$7(a, prop, b[prop]);
1236
+ if (__hasOwnProp$8.call(b, prop))
1237
+ __defNormalProp$8(a, prop, b[prop]);
1238
+ if (__getOwnPropSymbols$8)
1239
+ for (var prop of __getOwnPropSymbols$8(b)) {
1240
+ if (__propIsEnum$8.call(b, prop))
1241
+ __defNormalProp$8(a, prop, b[prop]);
1236
1242
  }
1237
1243
  return a;
1238
1244
  };
1239
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1245
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
1240
1246
  var __objRest$7 = (source, exclude) => {
1241
1247
  var target = {};
1242
1248
  for (var prop in source)
1243
- if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
1249
+ if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)
1244
1250
  target[prop] = source[prop];
1245
- if (source != null && __getOwnPropSymbols$7)
1246
- for (var prop of __getOwnPropSymbols$7(source)) {
1247
- if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
1251
+ if (source != null && __getOwnPropSymbols$8)
1252
+ for (var prop of __getOwnPropSymbols$8(source)) {
1253
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))
1248
1254
  target[prop] = source[prop];
1249
1255
  }
1250
1256
  return target;
@@ -1342,7 +1348,7 @@ const DeletableInput = React.forwardRef(
1342
1348
  children: [
1343
1349
  /* @__PURE__ */ jsx(
1344
1350
  Input$1,
1345
- __spreadProps$7(__spreadValues$7(__spreadValues$7({
1351
+ __spreadProps$8(__spreadValues$8(__spreadValues$8({
1346
1352
  type
1347
1353
  }, props), validationProps), {
1348
1354
  "aria-label": (_e = props["aria-label"]) != null ? _e : label,
@@ -1367,33 +1373,33 @@ const DeletableInput = React.forwardRef(
1367
1373
  );
1368
1374
  DeletableInput.displayName = "DeletableInput";
1369
1375
 
1370
- var __defProp$6 = Object.defineProperty;
1371
- var __defProps$6 = Object.defineProperties;
1372
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1373
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1374
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1375
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1376
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1377
- var __spreadValues$6 = (a, b) => {
1376
+ var __defProp$7 = Object.defineProperty;
1377
+ var __defProps$7 = Object.defineProperties;
1378
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
1379
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
1380
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
1381
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
1382
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1383
+ var __spreadValues$7 = (a, b) => {
1378
1384
  for (var prop in b || (b = {}))
1379
- if (__hasOwnProp$6.call(b, prop))
1380
- __defNormalProp$6(a, prop, b[prop]);
1381
- if (__getOwnPropSymbols$6)
1382
- for (var prop of __getOwnPropSymbols$6(b)) {
1383
- if (__propIsEnum$6.call(b, prop))
1384
- __defNormalProp$6(a, prop, b[prop]);
1385
+ if (__hasOwnProp$7.call(b, prop))
1386
+ __defNormalProp$7(a, prop, b[prop]);
1387
+ if (__getOwnPropSymbols$7)
1388
+ for (var prop of __getOwnPropSymbols$7(b)) {
1389
+ if (__propIsEnum$7.call(b, prop))
1390
+ __defNormalProp$7(a, prop, b[prop]);
1385
1391
  }
1386
1392
  return a;
1387
1393
  };
1388
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1394
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
1389
1395
  var __objRest$6 = (source, exclude) => {
1390
1396
  var target = {};
1391
1397
  for (var prop in source)
1392
- if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1398
+ if (__hasOwnProp$7.call(source, prop) && exclude.indexOf(prop) < 0)
1393
1399
  target[prop] = source[prop];
1394
- if (source != null && __getOwnPropSymbols$6)
1395
- for (var prop of __getOwnPropSymbols$6(source)) {
1396
- if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1400
+ if (source != null && __getOwnPropSymbols$7)
1401
+ for (var prop of __getOwnPropSymbols$7(source)) {
1402
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$7.call(source, prop))
1397
1403
  target[prop] = source[prop];
1398
1404
  }
1399
1405
  return target;
@@ -1472,7 +1478,7 @@ const FileInput = React.memo(
1472
1478
  avoidSemicolon,
1473
1479
  children: /* @__PURE__ */ jsx(
1474
1480
  Input$1,
1475
- __spreadProps$6(__spreadValues$6(__spreadValues$6({}, props), validationProps), {
1481
+ __spreadProps$7(__spreadValues$7(__spreadValues$7({}, props), validationProps), {
1476
1482
  type: "file",
1477
1483
  "aria-label": (_b2 = props["aria-label"]) != null ? _b2 : label,
1478
1484
  ref,
@@ -1493,33 +1499,33 @@ const FileInput = React.memo(
1493
1499
  );
1494
1500
  FileInput.displayName = "FileInput";
1495
1501
 
1496
- var __defProp$5 = Object.defineProperty;
1497
- var __defProps$5 = Object.defineProperties;
1498
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1499
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1500
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1501
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1502
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1503
- var __spreadValues$5 = (a, b) => {
1502
+ var __defProp$6 = Object.defineProperty;
1503
+ var __defProps$6 = Object.defineProperties;
1504
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
1505
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
1506
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
1507
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
1508
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1509
+ var __spreadValues$6 = (a, b) => {
1504
1510
  for (var prop in b || (b = {}))
1505
- if (__hasOwnProp$5.call(b, prop))
1506
- __defNormalProp$5(a, prop, b[prop]);
1507
- if (__getOwnPropSymbols$5)
1508
- for (var prop of __getOwnPropSymbols$5(b)) {
1509
- if (__propIsEnum$5.call(b, prop))
1510
- __defNormalProp$5(a, prop, b[prop]);
1511
+ if (__hasOwnProp$6.call(b, prop))
1512
+ __defNormalProp$6(a, prop, b[prop]);
1513
+ if (__getOwnPropSymbols$6)
1514
+ for (var prop of __getOwnPropSymbols$6(b)) {
1515
+ if (__propIsEnum$6.call(b, prop))
1516
+ __defNormalProp$6(a, prop, b[prop]);
1511
1517
  }
1512
1518
  return a;
1513
1519
  };
1514
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1520
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
1515
1521
  var __objRest$5 = (source, exclude) => {
1516
1522
  var target = {};
1517
1523
  for (var prop in source)
1518
- if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1524
+ if (__hasOwnProp$6.call(source, prop) && exclude.indexOf(prop) < 0)
1519
1525
  target[prop] = source[prop];
1520
- if (source != null && __getOwnPropSymbols$5)
1521
- for (var prop of __getOwnPropSymbols$5(source)) {
1522
- if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1526
+ if (source != null && __getOwnPropSymbols$6)
1527
+ for (var prop of __getOwnPropSymbols$6(source)) {
1528
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$6.call(source, prop))
1523
1529
  target[prop] = source[prop];
1524
1530
  }
1525
1531
  return target;
@@ -1615,7 +1621,7 @@ const Input = React.memo(
1615
1621
  avoidSemicolon,
1616
1622
  children: type === "date" ? /* @__PURE__ */ jsx(
1617
1623
  DateInput,
1618
- __spreadProps$5(__spreadValues$5(__spreadValues$5({}, props), validationProps), {
1624
+ __spreadProps$6(__spreadValues$6(__spreadValues$6({}, props), validationProps), {
1619
1625
  "aria-label": (_e = props["aria-label"]) != null ? _e : label,
1620
1626
  onError: void 0,
1621
1627
  ref,
@@ -1625,7 +1631,7 @@ const Input = React.memo(
1625
1631
  })
1626
1632
  ) : /* @__PURE__ */ jsx(
1627
1633
  Input$1,
1628
- __spreadProps$5(__spreadValues$5(__spreadValues$5({
1634
+ __spreadProps$6(__spreadValues$6(__spreadValues$6({
1629
1635
  type
1630
1636
  }, props), validationProps), {
1631
1637
  "aria-label": (_g = props["aria-label"]) != null ? _g : label,
@@ -1642,33 +1648,33 @@ const Input = React.memo(
1642
1648
  );
1643
1649
  Input.displayName = "Input";
1644
1650
 
1645
- var __defProp$4 = Object.defineProperty;
1646
- var __defProps$4 = Object.defineProperties;
1647
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1648
- var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1649
- var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1650
- var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1651
- var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1652
- var __spreadValues$4 = (a, b) => {
1651
+ var __defProp$5 = Object.defineProperty;
1652
+ var __defProps$5 = Object.defineProperties;
1653
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
1654
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
1655
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
1656
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
1657
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1658
+ var __spreadValues$5 = (a, b) => {
1653
1659
  for (var prop in b || (b = {}))
1654
- if (__hasOwnProp$4.call(b, prop))
1655
- __defNormalProp$4(a, prop, b[prop]);
1656
- if (__getOwnPropSymbols$4)
1657
- for (var prop of __getOwnPropSymbols$4(b)) {
1658
- if (__propIsEnum$4.call(b, prop))
1659
- __defNormalProp$4(a, prop, b[prop]);
1660
+ if (__hasOwnProp$5.call(b, prop))
1661
+ __defNormalProp$5(a, prop, b[prop]);
1662
+ if (__getOwnPropSymbols$5)
1663
+ for (var prop of __getOwnPropSymbols$5(b)) {
1664
+ if (__propIsEnum$5.call(b, prop))
1665
+ __defNormalProp$5(a, prop, b[prop]);
1660
1666
  }
1661
1667
  return a;
1662
1668
  };
1663
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1669
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
1664
1670
  var __objRest$4 = (source, exclude) => {
1665
1671
  var target = {};
1666
1672
  for (var prop in source)
1667
- if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1673
+ if (__hasOwnProp$5.call(source, prop) && exclude.indexOf(prop) < 0)
1668
1674
  target[prop] = source[prop];
1669
- if (source != null && __getOwnPropSymbols$4)
1670
- for (var prop of __getOwnPropSymbols$4(source)) {
1671
- if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1675
+ if (source != null && __getOwnPropSymbols$5)
1676
+ for (var prop of __getOwnPropSymbols$5(source)) {
1677
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$5.call(source, prop))
1672
1678
  target[prop] = source[prop];
1673
1679
  }
1674
1680
  return target;
@@ -1739,7 +1745,7 @@ const NumberInputf = React.memo(
1739
1745
  const handleOnChange = React.useCallback(
1740
1746
  (ev) => {
1741
1747
  if (ev.error) {
1742
- outerOnChange == null ? void 0 : outerOnChange(__spreadProps$4(__spreadValues$4({}, ev), { value: "" }));
1748
+ outerOnChange == null ? void 0 : outerOnChange(__spreadProps$5(__spreadValues$5({}, ev), { value: "" }));
1743
1749
  onChange("");
1744
1750
  validationsStore.updateField(formName, {
1745
1751
  name,
@@ -1771,7 +1777,7 @@ const NumberInputf = React.memo(
1771
1777
  avoidSemicolon,
1772
1778
  children: /* @__PURE__ */ jsx(
1773
1779
  NumberInput,
1774
- __spreadProps$4(__spreadValues$4({
1780
+ __spreadProps$5(__spreadValues$5({
1775
1781
  ref
1776
1782
  }, props), {
1777
1783
  name,
@@ -1787,33 +1793,33 @@ const NumberInputf = React.memo(
1787
1793
  );
1788
1794
  NumberInputf.displayName = "NumberInputf";
1789
1795
 
1790
- var __defProp$3 = Object.defineProperty;
1791
- var __defProps$3 = Object.defineProperties;
1792
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1793
- var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1794
- var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1795
- var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1796
- var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1797
- var __spreadValues$3 = (a, b) => {
1796
+ var __defProp$4 = Object.defineProperty;
1797
+ var __defProps$4 = Object.defineProperties;
1798
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
1799
+ var __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;
1800
+ var __hasOwnProp$4 = Object.prototype.hasOwnProperty;
1801
+ var __propIsEnum$4 = Object.prototype.propertyIsEnumerable;
1802
+ var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1803
+ var __spreadValues$4 = (a, b) => {
1798
1804
  for (var prop in b || (b = {}))
1799
- if (__hasOwnProp$3.call(b, prop))
1800
- __defNormalProp$3(a, prop, b[prop]);
1801
- if (__getOwnPropSymbols$3)
1802
- for (var prop of __getOwnPropSymbols$3(b)) {
1803
- if (__propIsEnum$3.call(b, prop))
1804
- __defNormalProp$3(a, prop, b[prop]);
1805
+ if (__hasOwnProp$4.call(b, prop))
1806
+ __defNormalProp$4(a, prop, b[prop]);
1807
+ if (__getOwnPropSymbols$4)
1808
+ for (var prop of __getOwnPropSymbols$4(b)) {
1809
+ if (__propIsEnum$4.call(b, prop))
1810
+ __defNormalProp$4(a, prop, b[prop]);
1805
1811
  }
1806
1812
  return a;
1807
1813
  };
1808
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1814
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
1809
1815
  var __objRest$3 = (source, exclude) => {
1810
1816
  var target = {};
1811
1817
  for (var prop in source)
1812
- if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
1818
+ if (__hasOwnProp$4.call(source, prop) && exclude.indexOf(prop) < 0)
1813
1819
  target[prop] = source[prop];
1814
- if (source != null && __getOwnPropSymbols$3)
1815
- for (var prop of __getOwnPropSymbols$3(source)) {
1816
- if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
1820
+ if (source != null && __getOwnPropSymbols$4)
1821
+ for (var prop of __getOwnPropSymbols$4(source)) {
1822
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$4.call(source, prop))
1817
1823
  target[prop] = source[prop];
1818
1824
  }
1819
1825
  return target;
@@ -1892,7 +1898,7 @@ const Radio = React.forwardRef(
1892
1898
  children: options == null ? void 0 : options.map((option) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(Label, { title: option.label, className: "radio-label", children: [
1893
1899
  /* @__PURE__ */ jsx(
1894
1900
  Radio$1,
1895
- __spreadProps$3(__spreadValues$3(__spreadValues$3({}, props), inputProps), {
1901
+ __spreadProps$4(__spreadValues$4(__spreadValues$4({}, props), inputProps), {
1896
1902
  role: "radio",
1897
1903
  className: "radio-button",
1898
1904
  "aria-label": option.label,
@@ -1910,33 +1916,33 @@ const Radio = React.forwardRef(
1910
1916
  );
1911
1917
  Radio.displayName = "Radio";
1912
1918
 
1913
- var __defProp$2 = Object.defineProperty;
1914
- var __defProps$2 = Object.defineProperties;
1915
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
1916
- var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
1917
- var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
1918
- var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
1919
- var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1920
- var __spreadValues$2 = (a, b) => {
1919
+ var __defProp$3 = Object.defineProperty;
1920
+ var __defProps$3 = Object.defineProperties;
1921
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
1922
+ var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
1923
+ var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
1924
+ var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
1925
+ var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1926
+ var __spreadValues$3 = (a, b) => {
1921
1927
  for (var prop in b || (b = {}))
1922
- if (__hasOwnProp$2.call(b, prop))
1923
- __defNormalProp$2(a, prop, b[prop]);
1924
- if (__getOwnPropSymbols$2)
1925
- for (var prop of __getOwnPropSymbols$2(b)) {
1926
- if (__propIsEnum$2.call(b, prop))
1927
- __defNormalProp$2(a, prop, b[prop]);
1928
+ if (__hasOwnProp$3.call(b, prop))
1929
+ __defNormalProp$3(a, prop, b[prop]);
1930
+ if (__getOwnPropSymbols$3)
1931
+ for (var prop of __getOwnPropSymbols$3(b)) {
1932
+ if (__propIsEnum$3.call(b, prop))
1933
+ __defNormalProp$3(a, prop, b[prop]);
1928
1934
  }
1929
1935
  return a;
1930
1936
  };
1931
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
1937
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
1932
1938
  var __objRest$2 = (source, exclude) => {
1933
1939
  var target = {};
1934
1940
  for (var prop in source)
1935
- if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
1941
+ if (__hasOwnProp$3.call(source, prop) && exclude.indexOf(prop) < 0)
1936
1942
  target[prop] = source[prop];
1937
- if (source != null && __getOwnPropSymbols$2)
1938
- for (var prop of __getOwnPropSymbols$2(source)) {
1939
- if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
1943
+ if (source != null && __getOwnPropSymbols$3)
1944
+ for (var prop of __getOwnPropSymbols$3(source)) {
1945
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$3.call(source, prop))
1940
1946
  target[prop] = source[prop];
1941
1947
  }
1942
1948
  return target;
@@ -2005,7 +2011,7 @@ const Select = React.forwardRef(
2005
2011
  avoidSemicolon,
2006
2012
  children: /* @__PURE__ */ jsxs(
2007
2013
  Select$1,
2008
- __spreadProps$2(__spreadValues$2(__spreadValues$2(__spreadValues$2({}, getVariant("forms.select")), props), inputProps), {
2014
+ __spreadProps$3(__spreadValues$3(__spreadValues$3(__spreadValues$3({}, getVariant("forms.select")), props), inputProps), {
2009
2015
  onChange: React.useCallback(
2010
2016
  (ev) => {
2011
2017
  onChange(ev);
@@ -2030,33 +2036,33 @@ const Select = React.forwardRef(
2030
2036
  );
2031
2037
  Select.displayName = "Select";
2032
2038
 
2033
- var __defProp$1 = Object.defineProperty;
2034
- var __defProps$1 = Object.defineProperties;
2035
- var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
2036
- var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
2037
- var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
2038
- var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
2039
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2040
- var __spreadValues$1 = (a, b) => {
2039
+ var __defProp$2 = Object.defineProperty;
2040
+ var __defProps$2 = Object.defineProperties;
2041
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
2042
+ var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
2043
+ var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
2044
+ var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
2045
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2046
+ var __spreadValues$2 = (a, b) => {
2041
2047
  for (var prop in b || (b = {}))
2042
- if (__hasOwnProp$1.call(b, prop))
2043
- __defNormalProp$1(a, prop, b[prop]);
2044
- if (__getOwnPropSymbols$1)
2045
- for (var prop of __getOwnPropSymbols$1(b)) {
2046
- if (__propIsEnum$1.call(b, prop))
2047
- __defNormalProp$1(a, prop, b[prop]);
2048
+ if (__hasOwnProp$2.call(b, prop))
2049
+ __defNormalProp$2(a, prop, b[prop]);
2050
+ if (__getOwnPropSymbols$2)
2051
+ for (var prop of __getOwnPropSymbols$2(b)) {
2052
+ if (__propIsEnum$2.call(b, prop))
2053
+ __defNormalProp$2(a, prop, b[prop]);
2048
2054
  }
2049
2055
  return a;
2050
2056
  };
2051
- var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
2057
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
2052
2058
  var __objRest$1 = (source, exclude) => {
2053
2059
  var target = {};
2054
2060
  for (var prop in source)
2055
- if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
2061
+ if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)
2056
2062
  target[prop] = source[prop];
2057
- if (source != null && __getOwnPropSymbols$1)
2058
- for (var prop of __getOwnPropSymbols$1(source)) {
2059
- if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
2063
+ if (source != null && __getOwnPropSymbols$2)
2064
+ for (var prop of __getOwnPropSymbols$2(source)) {
2065
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))
2060
2066
  target[prop] = source[prop];
2061
2067
  }
2062
2068
  return target;
@@ -2125,7 +2131,7 @@ const Switchbox = React.forwardRef(
2125
2131
  avoidSemicolon,
2126
2132
  children: /* @__PURE__ */ jsx(
2127
2133
  Switch,
2128
- __spreadProps$1(__spreadValues$1(__spreadValues$1({}, props), inputProps), {
2134
+ __spreadProps$2(__spreadValues$2(__spreadValues$2({}, props), inputProps), {
2129
2135
  "aria-label": (_b2 = props["aria-label"]) != null ? _b2 : label,
2130
2136
  onChange: (ev) => {
2131
2137
  onChange(ev.target.checked !== reverse ? "on" : "off");
@@ -2143,33 +2149,33 @@ const Switchbox = React.forwardRef(
2143
2149
  );
2144
2150
  Switchbox.displayName = "Switchbox";
2145
2151
 
2146
- var __defProp = Object.defineProperty;
2147
- var __defProps = Object.defineProperties;
2148
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2149
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2150
- var __hasOwnProp = Object.prototype.hasOwnProperty;
2151
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
2152
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2153
- var __spreadValues = (a, b) => {
2152
+ var __defProp$1 = Object.defineProperty;
2153
+ var __defProps$1 = Object.defineProperties;
2154
+ var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
2155
+ var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
2156
+ var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
2157
+ var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
2158
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2159
+ var __spreadValues$1 = (a, b) => {
2154
2160
  for (var prop in b || (b = {}))
2155
- if (__hasOwnProp.call(b, prop))
2156
- __defNormalProp(a, prop, b[prop]);
2157
- if (__getOwnPropSymbols)
2158
- for (var prop of __getOwnPropSymbols(b)) {
2159
- if (__propIsEnum.call(b, prop))
2160
- __defNormalProp(a, prop, b[prop]);
2161
+ if (__hasOwnProp$1.call(b, prop))
2162
+ __defNormalProp$1(a, prop, b[prop]);
2163
+ if (__getOwnPropSymbols$1)
2164
+ for (var prop of __getOwnPropSymbols$1(b)) {
2165
+ if (__propIsEnum$1.call(b, prop))
2166
+ __defNormalProp$1(a, prop, b[prop]);
2161
2167
  }
2162
2168
  return a;
2163
2169
  };
2164
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2170
+ var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
2165
2171
  var __objRest = (source, exclude) => {
2166
2172
  var target = {};
2167
2173
  for (var prop in source)
2168
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
2174
+ if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
2169
2175
  target[prop] = source[prop];
2170
- if (source != null && __getOwnPropSymbols)
2171
- for (var prop of __getOwnPropSymbols(source)) {
2172
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
2176
+ if (source != null && __getOwnPropSymbols$1)
2177
+ for (var prop of __getOwnPropSymbols$1(source)) {
2178
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
2173
2179
  target[prop] = source[prop];
2174
2180
  }
2175
2181
  return target;
@@ -2246,7 +2252,7 @@ const Textarea = React.forwardRef(
2246
2252
  avoidSemicolon,
2247
2253
  children: /* @__PURE__ */ jsx(
2248
2254
  Textarea$1,
2249
- __spreadProps(__spreadValues(__spreadValues({}, props), inputProps), {
2255
+ __spreadProps$1(__spreadValues$1(__spreadValues$1({}, props), inputProps), {
2250
2256
  "aria-label": (_b2 = props["aria-label"]) != null ? _b2 : label,
2251
2257
  ref,
2252
2258
  value: (_c = inputProps.value) != null ? _c : "",
@@ -2259,4 +2265,174 @@ const Textarea = React.forwardRef(
2259
2265
  );
2260
2266
  Textarea.displayName = "Textarea";
2261
2267
 
2262
- export { InnerCaptcha as Captcha, Checkbox, DeletableInput, FieldWrapper, FileInput, Form, FormContext, Input, NumberInputf, Radio, Select, Switchbox, Textarea, ValidationError, classToValidate, classToValidationFunction, hasSucceedFieldValidation, hasSucceedFormValidation, initValidations, useField, useFieldSelector, useFieldStatesClassNames, useFieldValue, useFormContext, useFormSelector, useValidationClass, validationsStore };
2268
+ var __defProp = Object.defineProperty;
2269
+ var __defProps = Object.defineProperties;
2270
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
2271
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2272
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2273
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
2274
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2275
+ var __spreadValues = (a, b) => {
2276
+ for (var prop in b || (b = {}))
2277
+ if (__hasOwnProp.call(b, prop))
2278
+ __defNormalProp(a, prop, b[prop]);
2279
+ if (__getOwnPropSymbols)
2280
+ for (var prop of __getOwnPropSymbols(b)) {
2281
+ if (__propIsEnum.call(b, prop))
2282
+ __defNormalProp(a, prop, b[prop]);
2283
+ }
2284
+ return a;
2285
+ };
2286
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
2287
+ var __accessCheck = (obj, member, msg) => {
2288
+ if (!member.has(obj))
2289
+ throw TypeError("Cannot " + msg);
2290
+ };
2291
+ var __privateGet = (obj, member, getter) => {
2292
+ __accessCheck(obj, member, "read from private field");
2293
+ return getter ? getter.call(obj) : member.get(obj);
2294
+ };
2295
+ var __privateAdd = (obj, member, value) => {
2296
+ if (member.has(obj))
2297
+ throw TypeError("Cannot add the same private member more than once");
2298
+ member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
2299
+ };
2300
+ var __privateSet = (obj, member, value, setter) => {
2301
+ __accessCheck(obj, member, "write to private field");
2302
+ setter ? setter.call(obj, value) : member.set(obj, value);
2303
+ return value;
2304
+ };
2305
+ var _rules, _fields;
2306
+ try {
2307
+ void initValidations().catch(() => {
2308
+ });
2309
+ } catch (e) {
2310
+ }
2311
+ class CollectorField extends EventEmitter {
2312
+ constructor(_name, label) {
2313
+ super();
2314
+ this._name = _name;
2315
+ this.label = label;
2316
+ this.initialValue = void 0;
2317
+ __privateAdd(this, _rules, {});
2318
+ this.setInitialValue = (newValue) => {
2319
+ this.initialValue = newValue;
2320
+ };
2321
+ this.setValidationRules = (newRules) => {
2322
+ __privateSet(this, _rules, newRules);
2323
+ this.emit("rulesUpdate", __spreadValues({}, __privateGet(this, _rules)));
2324
+ };
2325
+ this.useValidationRules = () => {
2326
+ const [validationRules, setValidationRules] = useState(__privateGet(this, _rules));
2327
+ useMount(() => {
2328
+ return this.on("rulesUpdate", setValidationRules);
2329
+ });
2330
+ return validationRules;
2331
+ };
2332
+ }
2333
+ get name() {
2334
+ return this._name;
2335
+ }
2336
+ }
2337
+ _rules = new WeakMap();
2338
+ class CollectorInput extends CollectorField {
2339
+ constructor() {
2340
+ super(...arguments);
2341
+ this.type = "input";
2342
+ this.Component = () => {
2343
+ const rules = this.useValidationRules();
2344
+ return /* @__PURE__ */ jsx(
2345
+ Input,
2346
+ {
2347
+ initialValue: this.initialValue,
2348
+ name: this.name,
2349
+ label: this.label,
2350
+ validationRules: rules
2351
+ }
2352
+ );
2353
+ };
2354
+ }
2355
+ }
2356
+ const _CollectorLabel = class extends CollectorField {
2357
+ constructor(label, kind = "label") {
2358
+ super(`label${_CollectorLabel.maxId++}`, label);
2359
+ this.kind = kind;
2360
+ this.type = "label";
2361
+ this.Component = () => {
2362
+ return /* @__PURE__ */ jsx(Box, { as: this.kind, children: this.label });
2363
+ };
2364
+ }
2365
+ };
2366
+ let CollectorLabel = _CollectorLabel;
2367
+ CollectorLabel.maxId = 0;
2368
+ class CollectorTextarea extends CollectorField {
2369
+ constructor() {
2370
+ super(...arguments);
2371
+ this.type = "textarea";
2372
+ this.Component = () => {
2373
+ const rules = this.useValidationRules();
2374
+ return /* @__PURE__ */ jsx(
2375
+ Textarea,
2376
+ {
2377
+ initialValue: this.initialValue,
2378
+ name: this.name,
2379
+ validationRules: rules,
2380
+ label: this.label
2381
+ }
2382
+ );
2383
+ };
2384
+ }
2385
+ }
2386
+ let maxId = 0;
2387
+ class Collector {
2388
+ constructor() {
2389
+ this.fields = {
2390
+ input: CollectorInput,
2391
+ label: CollectorLabel,
2392
+ textarea: CollectorTextarea
2393
+ };
2394
+ this.id = `Collector${maxId++}`;
2395
+ __privateAdd(this, _fields, {});
2396
+ this.add = (field) => {
2397
+ __privateGet(this, _fields)[field.name] = field;
2398
+ };
2399
+ this.show = (modalProps) => {
2400
+ return new Promise((resolve) => {
2401
+ const modal = new ApiaUtil().modals.open(__spreadValues({
2402
+ children: /* @__PURE__ */ jsx(Box, __spreadProps(__spreadValues({}, getVariant("layout.util.collector.formContainer")), { children: /* @__PURE__ */ jsxs(
2403
+ Form,
2404
+ {
2405
+ name: this.id,
2406
+ onValidate: (result) => {
2407
+ if (hasSucceedFormValidation(result)) {
2408
+ resolve(result.submitValues);
2409
+ modal.close();
2410
+ }
2411
+ },
2412
+ children: [
2413
+ Object.values(__privateGet(this, _fields)).map((current) => /* @__PURE__ */ jsx(
2414
+ Box,
2415
+ {
2416
+ className: `collector__field ${current.type}`,
2417
+ children: /* @__PURE__ */ jsx(current.Component, {})
2418
+ },
2419
+ current.name
2420
+ )),
2421
+ /* @__PURE__ */ jsx(Box, { className: "collector__buttons", children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: getLabel("btnCon").text }) })
2422
+ ]
2423
+ }
2424
+ ) })),
2425
+ variant: "layout.util.collector.modal",
2426
+ initialFocusGetter(modalInnerRef) {
2427
+ return modalInnerRef.querySelector(
2428
+ "input,textarea,select,button:not(.modal__closeButton)"
2429
+ );
2430
+ }
2431
+ }, modalProps));
2432
+ });
2433
+ };
2434
+ }
2435
+ }
2436
+ _fields = new WeakMap();
2437
+
2438
+ export { InnerCaptcha as Captcha, Checkbox, Collector, DeletableInput, FieldWrapper, FileInput, Form, FormContext, Input, NumberInputf, Radio, Select, Switchbox, Textarea, ValidationError, classToValidate, classToValidationFunction, hasSucceedFieldValidation, hasSucceedFormValidation, initValidations, lang, useField, useFieldSelector, useFieldStatesClassNames, useFieldValue, useFormContext, useFormSelector, useValidationClass, validationsStore };