x25 17.5.4 → 17.5.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.
@@ -3,7 +3,7 @@ import { MetaProps } from "src/types";
3
3
  type DateInputPropTypes = {
4
4
  readonly currency?: boolean;
5
5
  readonly customClass?: any;
6
- readonly field: any;
6
+ readonly input: any;
7
7
  readonly meta: MetaProps;
8
8
  readonly placeholder?: string;
9
9
  readonly tabIndex?: string;
@@ -42,23 +42,23 @@ var addZeroIfNeeded = function (raw) {
42
42
  return "";
43
43
  };
44
44
  var DateInput = function (props) {
45
- var customClass = props.customClass, _a = props.field, field = _a === void 0 ? {} : _a, onRegisterRef = props.onRegisterRef, tabIndex = props.tabIndex, placeholder = props.placeholder, _b = props.meta, meta = _b === void 0 ? {} : _b, _c = react_1.default.useState(field.value), value = _c[0], setValue = _c[1], valueToShow = formatRawDate(value), updateValue = function (targetValue) {
45
+ var customClass = props.customClass, _a = props.input, input = _a === void 0 ? {} : _a, onRegisterRef = props.onRegisterRef, tabIndex = props.tabIndex, placeholder = props.placeholder, _b = props.meta, meta = _b === void 0 ? {} : _b, _c = react_1.default.useState(input.value), value = _c[0], setValue = _c[1], valueToShow = formatRawDate(value), updateValue = function (targetValue) {
46
46
  var normalizedValue = normalizeRawDate(addZeroIfNeeded(targetValue));
47
47
  setValue(targetValue);
48
- field.onChange(normalizedValue);
48
+ input.onChange(normalizedValue);
49
49
  }, handleBlur = function (event) {
50
50
  var targetValue = event.target.value, newValue = addZeroIfNeeded(targetValue), hasChanged = targetValue !== newValue;
51
51
  if (hasChanged) {
52
52
  updateValue(newValue);
53
53
  }
54
- field.onBlur(event);
54
+ input.onBlur(event);
55
55
  }, handleChange = function (_a) {
56
56
  var targetValue = _a.target.value;
57
57
  updateValue(targetValue);
58
58
  };
59
- return (react_1.default.createElement("input", __assign({}, field, { className: (0, classnames_1.default)("form-control ".concat(customClass || ""), {
59
+ return (react_1.default.createElement("input", __assign({}, input, { className: (0, classnames_1.default)("form-control ".concat(customClass || ""), {
60
60
  "is-invalid": meta.touched && meta.error,
61
- }), disabled: meta.submitting, id: field.name, onBlur: handleBlur, onChange: handleChange, placeholder: placeholder || utility_1.words.DateFormat, ref: onRegisterRef, tabIndex: tabIndex, type: "text", value: valueToShow })));
61
+ }), disabled: meta.submitting, id: input.name, onBlur: handleBlur, onChange: handleChange, placeholder: placeholder || utility_1.words.DateFormat, ref: onRegisterRef, tabIndex: tabIndex, type: "text", value: valueToShow })));
62
62
  };
63
63
  exports.DateInput = DateInput;
64
64
  //# sourceMappingURL=DateInput.js.map
@@ -3,7 +3,7 @@ import { MetaProps } from "src/types";
3
3
  type DateInputPropTypes = {
4
4
  readonly currency?: boolean;
5
5
  readonly customClass?: any;
6
- readonly field: any;
6
+ readonly input: any;
7
7
  readonly label: string;
8
8
  readonly left?: string;
9
9
  readonly meta: MetaProps;
@@ -42,26 +42,26 @@ var addZeroIfNeeded = function (raw) {
42
42
  return "";
43
43
  };
44
44
  var DateTemplate = function (props) {
45
- var customClass = props.customClass, _a = props.field, field = _a === void 0 ? {} : _a, onRegisterRef = props.onRegisterRef, tabIndex = props.tabIndex, placeholder = props.placeholder, _b = props.meta, meta = _b === void 0 ? {} : _b, right = props.right, left = props.left, label = props.label, _c = react_1.default.useState(field.value), value = _c[0], setValue = _c[1], valueToShow = formatRawDate(value), updateValue = function (targetValue) {
45
+ var customClass = props.customClass, _a = props.input, input = _a === void 0 ? {} : _a, onRegisterRef = props.onRegisterRef, tabIndex = props.tabIndex, placeholder = props.placeholder, _b = props.meta, meta = _b === void 0 ? {} : _b, right = props.right, left = props.left, label = props.label, _c = react_1.default.useState(input.value), value = _c[0], setValue = _c[1], valueToShow = formatRawDate(value), updateValue = function (targetValue) {
46
46
  var normalizedValue = normalizeRawDate(addZeroIfNeeded(targetValue));
47
47
  setValue(targetValue);
48
- field.onChange(normalizedValue);
48
+ input.onChange(normalizedValue);
49
49
  }, handleBlur = function (event) {
50
50
  var targetValue = event.target.value, newValue = addZeroIfNeeded(targetValue), hasChanged = targetValue !== newValue;
51
51
  if (hasChanged) {
52
52
  updateValue(newValue);
53
53
  }
54
- field.onBlur(event);
54
+ input.onBlur(event);
55
55
  }, handleChange = function (_a) {
56
56
  var targetValue = _a.target.value;
57
57
  updateValue(targetValue);
58
58
  };
59
59
  return (react_1.default.createElement("div", { className: (0, classnames_1.default)("form-group mt-md-2 row d-flex", { "is-invalid": meta.touched && meta.error }) },
60
- react_1.default.createElement("label", { className: "".concat(left ? "".concat(left, " align-self-center") : "col-md-4 text-md-end", " form-control-label"), htmlFor: field.name }, label),
60
+ react_1.default.createElement("label", { className: "".concat(left ? "".concat(left, " align-self-center") : "col-md-4 text-md-end", " form-control-label"), htmlFor: input.name }, label),
61
61
  react_1.default.createElement("div", { className: right ? "".concat(right, " align-self-center") : "col-md-8" },
62
- react_1.default.createElement("input", __assign({}, field, { "aria-label": label, className: (0, classnames_1.default)("form-control ".concat(customClass || ""), {
62
+ react_1.default.createElement("input", __assign({}, input, { "aria-label": label, className: (0, classnames_1.default)("form-control ".concat(customClass || ""), {
63
63
  "is-invalid": meta.touched && meta.error,
64
- }), disabled: meta.submitting, id: field.name, onBlur: handleBlur, onChange: handleChange, placeholder: placeholder || utility_1.words.DateFormat, ref: onRegisterRef, tabIndex: tabIndex, type: "text", value: valueToShow })),
64
+ }), disabled: meta.submitting, id: input.name, onBlur: handleBlur, onChange: handleChange, placeholder: placeholder || utility_1.words.DateFormat, ref: onRegisterRef, tabIndex: tabIndex, type: "text", value: valueToShow })),
65
65
  react_1.default.createElement("div", { className: "invalid-feedback" }, meta.touched && meta.error ? (react_1.default.createElement("span", null, meta.error)) : null))));
66
66
  };
67
67
  exports.DateTemplate = DateTemplate;
@@ -5,7 +5,7 @@ type InputTemplatePropTypes = {
5
5
  readonly autoFocus?: boolean;
6
6
  readonly disabled?: boolean;
7
7
  readonly divClass?: string;
8
- readonly field: any;
8
+ readonly input: any;
9
9
  readonly inputClass?: string;
10
10
  readonly label: string;
11
11
  readonly left?: string;
@@ -18,13 +18,13 @@ exports.InputTemplate = void 0;
18
18
  var classnames_1 = __importDefault(require("classnames"));
19
19
  var react_1 = __importDefault(require("react"));
20
20
  var InputTemplate = function (props) {
21
- var _a = props.field, field = _a === void 0 ? {} : _a, theType = props.theType, label = props.label, inputRef = props.inputRef, autoFocus = props.autoFocus, inputClass = props.inputClass, divClass = props.divClass, placeholder = props.placeholder, left = props.left, tabIndex = props.tabIndex, right = props.right, autoComplete = props.autoComplete, disabled = props.disabled, _b = props.meta, _c = _b === void 0 ? {} : _b, submitting = _c.submitting, touched = _c.touched, error = _c.error, warningClass = "".concat(touched && error ? " is-invalid" : ""), customClass = "".concat(inputClass ? " ".concat(inputClass) : ""), classForInput = "form-control ".concat(warningClass).concat(customClass), classForDiv = "form-group row mt-md-2 ".concat(divClass ? divClass : "");
21
+ var _a = props.input, input = _a === void 0 ? {} : _a, theType = props.theType, label = props.label, inputRef = props.inputRef, autoFocus = props.autoFocus, inputClass = props.inputClass, divClass = props.divClass, placeholder = props.placeholder, left = props.left, tabIndex = props.tabIndex, right = props.right, autoComplete = props.autoComplete, disabled = props.disabled, _b = props.meta, _c = _b === void 0 ? {} : _b, submitting = _c.submitting, touched = _c.touched, error = _c.error, warningClass = "".concat(touched && error ? " is-invalid" : ""), customClass = "".concat(inputClass ? " ".concat(inputClass) : ""), classForInput = "form-control ".concat(warningClass).concat(customClass), classForDiv = "form-group row mt-md-2 ".concat(divClass ? divClass : "");
22
22
  return (react_1.default.createElement("div", { className: (0, classnames_1.default)("".concat(classForDiv, " d-flex"), {
23
23
  "is-invalid": touched && error,
24
24
  }) },
25
- react_1.default.createElement("label", { className: "".concat(left ? left : "col-md-4 text-md-end", " form-control-label align-self-center"), htmlFor: field.name }, label),
25
+ react_1.default.createElement("label", { className: "".concat(left ? left : "col-md-4 text-md-end", " form-control-label align-self-center"), htmlFor: input.name }, label),
26
26
  react_1.default.createElement("div", { className: "".concat(right ? right : "col-md-8", " align-self-center") },
27
- react_1.default.createElement("input", __assign({}, field, { "aria-label": label, autoComplete: autoComplete, autoFocus: autoFocus, className: classForInput, disabled: submitting || disabled, id: field.name, placeholder: placeholder, ref: inputRef ? inputRef : null, tabIndex: tabIndex, type: theType })),
27
+ react_1.default.createElement("input", __assign({}, input, { "aria-label": label, autoComplete: autoComplete, autoFocus: autoFocus, className: classForInput, disabled: submitting || disabled, id: input.name, placeholder: placeholder, ref: inputRef ? inputRef : null, tabIndex: tabIndex, type: theType })),
28
28
  react_1.default.createElement("div", { className: "invalid-feedback" }, touched && error ? (react_1.default.createElement("span", null, error)) : null))));
29
29
  };
30
30
  exports.InputTemplate = InputTemplate;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { MetaProps } from "src/types";
3
3
  type LabelTemplatePropTypes = {
4
- readonly field: any;
4
+ readonly input: any;
5
5
  readonly label: string;
6
6
  readonly tabIndex?: string;
7
7
  readonly offset?: string;
@@ -17,12 +17,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.LabelTemplate = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
19
  var LabelTemplate = function (props) {
20
- var _a = props.field, field = _a === void 0 ? {} : _a, tabIndex = props.tabIndex, label = props.label, offset = props.offset, _b = props.meta, _c = _b === void 0 ? {} : _b, submitting = _c.submitting, touched = _c.touched, error = _c.error;
20
+ var _a = props.input, input = _a === void 0 ? {} : _a, tabIndex = props.tabIndex, label = props.label, offset = props.offset, _b = props.meta, _c = _b === void 0 ? {} : _b, submitting = _c.submitting, touched = _c.touched, error = _c.error;
21
21
  return (react_1.default.createElement("div", { className: "container" },
22
22
  react_1.default.createElement("div", { className: "form-group mt-md-2 row mb-1" },
23
23
  react_1.default.createElement("div", { className: "".concat(offset || "", " col custom-control custom-checkbox") },
24
- react_1.default.createElement("input", __assign({}, field, { "aria-label": label, className: "custom-control-input", disabled: submitting, id: field.name, tabIndex: tabIndex, type: "checkbox" })),
25
- react_1.default.createElement("label", { className: "custom-control-label", htmlFor: field.name }, label),
24
+ react_1.default.createElement("input", __assign({}, input, { "aria-label": label, className: "custom-control-input", disabled: submitting, id: input.name, tabIndex: tabIndex, type: "checkbox" })),
25
+ react_1.default.createElement("label", { className: "custom-control-label", htmlFor: input.name }, label),
26
26
  react_1.default.createElement("div", { className: "invalid-feedback" }, touched && error ? (react_1.default.createElement("span", null, error)) : null)))));
27
27
  };
28
28
  exports.LabelTemplate = LabelTemplate;
@@ -4,7 +4,7 @@ type NumericPropTypes = {
4
4
  readonly currency?: boolean;
5
5
  readonly customClass?: any;
6
6
  readonly disabled?: boolean;
7
- readonly field: any;
7
+ readonly input: any;
8
8
  readonly label?: string;
9
9
  readonly meta: any;
10
10
  readonly onRegisterRef?: any;
@@ -18,7 +18,7 @@ type NumericPropTypes = {
18
18
  readonly formatValue: (raw: any, optional?: boolean) => string;
19
19
  readonly normalizeValue: (raw: any) => any;
20
20
  readonly onBlur?: () => void;
21
- readonly onChange?: (event: any) => void;
21
+ readonly onChange: (event: any) => void;
22
22
  readonly onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
23
23
  readonly onKeyDown?: (event: any) => void;
24
24
  };
@@ -9,40 +9,40 @@ var react_1 = __importDefault(require("react"));
9
9
  var utility_1 = require("../utility");
10
10
  var common_1 = require("./common");
11
11
  var NumericInput = function (props) {
12
- var _a = props.precision, precision = _a === void 0 ? 2 : _a, form = props.form, customClass = props.customClass, field = props.field, label = props.label, disabled = props.disabled, currency = props.currency, tabIndex = props.tabIndex, onRegisterRef = props.onRegisterRef, _b = props.formatValue, formatValue = _b === void 0 ? utility_1.formatZeroValue : _b, size = props.size, placeholder = props.placeholder, _c = props.meta, _d = _c === void 0 ? {} : _c, submitting = _d.submitting, touched = _d.touched, error = _d.error, _e = react_1.default.useState(field.value || ""), value = _e[0], setValue = _e[1], noCurrency = (typeof currency === "undefined" || currency === false), valueToShow = formatValue(value, props.optional), updateValue = function (targetValue) {
12
+ var _a = props.precision, precision = _a === void 0 ? 2 : _a, customClass = props.customClass, input = props.input, label = props.label, disabled = props.disabled, currency = props.currency, tabIndex = props.tabIndex, onRegisterRef = props.onRegisterRef, _b = props.formatValue, formatValue = _b === void 0 ? utility_1.formatZeroValue : _b, size = props.size, placeholder = props.placeholder, _c = props.meta, _d = _c === void 0 ? {} : _c, submitting = _d.submitting, touched = _d.touched, error = _d.error, _e = react_1.default.useState(input.value || ""), value = _e[0], setValue = _e[1], noCurrency = (typeof currency === "undefined" || currency === false), valueToShow = formatValue(value, props.optional), updateValue = function (targetValue) {
13
13
  setValue(targetValue);
14
14
  var valueToStore = targetValue;
15
15
  if ((0, common_1.isFloat)((0, common_1.floatToEnglishComma)(targetValue))) {
16
16
  valueToStore = (0, common_1.getFloatValueToStore)(targetValue);
17
17
  }
18
- form.setFieldValue(valueToStore);
18
+ input.onChange(valueToStore);
19
19
  }, handleBlur = function (_a) {
20
20
  var targetValue = _a.target.value;
21
21
  var newValue = (0, common_1.clearFloatOnBlur)(value, precision), hasChanged = value !== newValue;
22
22
  if (hasChanged) {
23
23
  updateValue(newValue);
24
24
  }
25
- if (typeof field.onBlur === "function") {
26
- field.onBlur(targetValue);
25
+ if (typeof input.onBlur === "function") {
26
+ input.onBlur(targetValue);
27
27
  }
28
28
  }, handleChange = function (_a) {
29
29
  var targetValue = _a.target.value;
30
30
  updateValue(targetValue);
31
31
  }, handleFocus = function (event) {
32
- if (typeof field.onFocus === "function") {
33
- field.onFocus(event);
32
+ if (typeof input.onFocus === "function") {
33
+ input.onFocus(event);
34
34
  }
35
35
  if (typeof props.onFocus === "function") {
36
36
  props.onFocus(event);
37
37
  }
38
38
  }, inputComponent = (react_1.default.createElement("input", { "aria-label": label, autoFocus: props.autoFocus, className: (0, classnames_1.default)("form-control ".concat(customClass || ""), {
39
39
  "is-invalid": touched && error,
40
- }), disabled: submitting || disabled, id: field.name, inputMode: "decimal", maxLength: size, onBlur: handleBlur, onChange: handleChange, onFocus: handleFocus, onKeyDown: props.onKeyDown, placeholder: placeholder || label, ref: onRegisterRef, tabIndex: tabIndex, type: "text", value: valueToShow }));
40
+ }), disabled: submitting || disabled, id: input.name, inputMode: "decimal", maxLength: size, onBlur: handleBlur, onChange: handleChange, onFocus: handleFocus, onKeyDown: props.onKeyDown, placeholder: placeholder || label, ref: onRegisterRef, tabIndex: tabIndex, type: "text", value: valueToShow }));
41
41
  react_1.default.useEffect(function () {
42
- if ((0, common_1.isFloat)(field.value) || field.value === "") {
43
- updateValue(field.value);
42
+ if ((0, common_1.isFloat)(input.value) || input.value === "") {
43
+ updateValue(input.value);
44
44
  }
45
- }, [field.value]);
45
+ }, [input.value]);
46
46
  if (noCurrency) {
47
47
  return inputComponent;
48
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NumericInput.js","sourceRoot":"","sources":["../../src/Inputs/NumericInput.tsx"],"names":[],"mappings":";;;;;;AAGA,0DAAoC;AACpC,gDAA0B;AAC1B,sCAA6C;AAC7C,mCAAgG;AA0BzF,IACL,YAAY,GAAG,UAAC,KAAwB;IAGlC,IAAA,KAGE,KAAK,UAHM,EAAb,SAAS,mBAAG,CAAC,KAAA,EAAE,IAAI,GAGjB,KAAK,KAHY,EACnB,WAAW,GAET,KAAK,YAFI,EAAE,KAAK,GAEhB,KAAK,MAFW,EAAE,KAAK,GAEvB,KAAK,MAFkB,EAAE,QAAQ,GAEjC,KAAK,SAF4B,EAAE,QAAQ,GAE3C,KAAK,SAFsC,EAAE,QAAQ,GAErD,KAAK,SAFgD,EAAE,aAAa,GAEpE,KAAK,cAF+D,EAAE,KAEtE,KAAK,YAF8F,EAA7B,WAAW,mBAAG,yBAAe,KAAA,EACrG,IAAI,GACF,KAAK,KADH,EAAE,WAAW,GACf,KAAK,YADU,EAAE,KACjB,KAAK,KADqD,EAAzC,qBAAuC,EAAE,KAAA,EAAjC,UAAU,gBAAA,EAAE,OAAO,aAAA,EAAE,KAAK,WAAA,EAGvD,KAAoB,eAAK,CAAC,QAAQ,CAAC,KAAK,CAA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QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,WAAW,GAClB,CACH,CAAC;IAEJ,eAAK,CAAC,SAAS,CAAC;QACd,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC;YAC/C,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAElB,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,OAAO,CACL,uCAAK,SAAS,EAAC,aAAa;QACzB,cAAc;QACf,uCAAK,SAAS,EAAC,oBAAoB;YACjC,wCAAM,SAAS,EAAC,kBAAkB,IAC/B,QAAQ,CACJ,CACH,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAhGF,QAAA,YAAY,gBAgGV"}
@@ -4,7 +4,7 @@ type NumericPropTypes = {
4
4
  readonly customClass?: any;
5
5
  readonly disabled?: boolean;
6
6
  readonly divClass?: any;
7
- readonly field: any;
7
+ readonly input: any;
8
8
  readonly inputClass?: string;
9
9
  readonly label?: string;
10
10
  readonly left?: string;
@@ -9,34 +9,34 @@ var react_1 = __importDefault(require("react"));
9
9
  var utility_1 = require("../utility");
10
10
  var common_1 = require("./common");
11
11
  var NumericTemplate = function (props) {
12
- var _a = props.precision, precision = _a === void 0 ? 2 : _a, _b = props.field, field = _b === void 0 ? {} : _b, right = props.right, tabIndex = props.tabIndex, divClass = props.divClass, label = props.label, onRegisterRef = props.onRegisterRef, _c = props.meta, _d = _c === void 0 ? {} : _c, submitting = _d.submitting, touched = _d.touched, error = _d.error, _e = props.formatValue, formatValue = _e === void 0 ? utility_1.formatZeroValue : _e, type = props.type, autoFocus = props.autoFocus, inputClass = props.inputClass, placeholder = props.placeholder, left = props.left, size = props.size, disabled = props.disabled, _f = react_1.default.useState(props.field.value || ""), value = _f[0], setValue = _f[1], valueToShow = formatValue(value, props.optional), updateValue = function (targetValue) {
12
+ var _a = props.precision, precision = _a === void 0 ? 2 : _a, _b = props.input, input = _b === void 0 ? {} : _b, right = props.right, tabIndex = props.tabIndex, divClass = props.divClass, label = props.label, onRegisterRef = props.onRegisterRef, _c = props.meta, _d = _c === void 0 ? {} : _c, submitting = _d.submitting, touched = _d.touched, error = _d.error, _e = props.formatValue, formatValue = _e === void 0 ? utility_1.formatZeroValue : _e, type = props.type, autoFocus = props.autoFocus, inputClass = props.inputClass, placeholder = props.placeholder, left = props.left, size = props.size, disabled = props.disabled, _f = react_1.default.useState(props.input.value || ""), value = _f[0], setValue = _f[1], valueToShow = formatValue(value, props.optional), updateValue = function (targetValue) {
13
13
  setValue(targetValue);
14
14
  var valueToStore = targetValue;
15
15
  if ((0, common_1.isFloat)((0, common_1.floatToEnglishComma)(targetValue))) {
16
16
  valueToStore = (0, common_1.getFloatValueToStore)(targetValue);
17
17
  }
18
- field.onChange(valueToStore);
18
+ input.onChange(valueToStore);
19
19
  }, handleBlur = function (event) {
20
20
  var newValue = (0, common_1.clearFloatOnBlur)(value, precision), hasChanged = value !== newValue;
21
21
  if (hasChanged) {
22
22
  updateValue(newValue);
23
23
  }
24
- field.onBlur(event);
24
+ input.onBlur(event);
25
25
  }, handleChange = function (_a) {
26
26
  var targetValue = _a.target.value;
27
27
  updateValue(targetValue);
28
28
  }, warningClass = "".concat(touched && error ? " is-invalid" : ""), customClass = "".concat(inputClass ? " ".concat(inputClass) : ""), classForInput = "form-control ".concat(warningClass).concat(customClass), classForDiv = "form-group mt-md-2 row ".concat(divClass ? divClass : "");
29
29
  react_1.default.useEffect(function () {
30
- if ((0, common_1.isFloat)(field.value) || field.value === "") {
31
- updateValue(field.value);
30
+ if ((0, common_1.isFloat)(input.value) || input.value === "") {
31
+ updateValue(input.value);
32
32
  }
33
- }, [field.value]);
33
+ }, [input.value]);
34
34
  return (react_1.default.createElement("div", { className: (0, classnames_1.default)("".concat(classForDiv, " d-flex"), {
35
35
  "is-invalid": touched && error,
36
36
  }) },
37
- react_1.default.createElement("label", { className: "".concat(left ? "".concat(left, " align-self-center") : "col-md-4 text-md-end", " form-control-label align-self-center"), htmlFor: field.name }, label),
37
+ react_1.default.createElement("label", { className: "".concat(left ? "".concat(left, " align-self-center") : "col-md-4 text-md-end", " form-control-label align-self-center"), htmlFor: input.name }, label),
38
38
  react_1.default.createElement("div", { className: right ? "".concat(right, " align-self-center") : "col-md-8 align-self-center" },
39
- react_1.default.createElement("input", { "aria-label": label, autoFocus: autoFocus, className: classForInput, disabled: submitting || disabled, id: field.name, inputMode: "decimal", maxLength: size, onBlur: handleBlur, onChange: handleChange, onKeyDown: props.onKeyDown, placeholder: placeholder, ref: onRegisterRef, tabIndex: tabIndex, type: type, value: valueToShow }),
39
+ react_1.default.createElement("input", { "aria-label": label, autoFocus: autoFocus, className: classForInput, disabled: submitting || disabled, id: input.name, inputMode: "decimal", maxLength: size, onBlur: handleBlur, onChange: handleChange, onKeyDown: props.onKeyDown, placeholder: placeholder, ref: onRegisterRef, tabIndex: tabIndex, type: type, value: valueToShow }),
40
40
  react_1.default.createElement("div", { className: "invalid-feedback" }, touched && error ? (react_1.default.createElement("span", null, error)) : null))));
41
41
  };
42
42
  exports.NumericTemplate = NumericTemplate;
@@ -2,7 +2,7 @@
2
2
  import { MetaProps } from "src/types";
3
3
  type SelectMonthPropTypes = {
4
4
  readonly disabled: boolean;
5
- readonly field: any;
5
+ readonly input: any;
6
6
  readonly valueKey?: string;
7
7
  readonly nameKey?: string;
8
8
  readonly label?: string;
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var react_1 = __importDefault(require("react"));
18
18
  var Simple_1 = __importDefault(require("./Simple"));
19
19
  var CustomSelect = function (props) {
20
- var _a = props.field, field = _a === void 0 ? {} : _a, _b = props.meta, meta = _b === void 0 ? {} : _b, left = props.left, right = props.right, label = props.label, id = props.id, customID = "custom-select-".concat(field.name).concat(id || "");
20
+ var _a = props.input, input = _a === void 0 ? {} : _a, _b = props.meta, meta = _b === void 0 ? {} : _b, left = props.left, right = props.right, label = props.label, id = props.id, customID = "custom-select-".concat(input.name).concat(id || "");
21
21
  return (react_1.default.createElement("div", { className: "form-group row d-flex" },
22
22
  react_1.default.createElement("label", { className: "".concat(left ? "".concat(left, " align-self-center") : "col-md-4 text-md-end", " form-control-label align-self-center"), htmlFor: customID }, label),
23
23
  react_1.default.createElement("div", { className: right ? "".concat(right, " align-self-center") : "col-md-8 align-self-center" },
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  type SelectMonthPropTypes = {
3
3
  readonly disabled: boolean;
4
- readonly field: any;
4
+ readonly input: any;
5
5
  readonly autoFocus?: boolean;
6
6
  readonly valueKey?: string;
7
7
  readonly nameKey?: string;
@@ -18,10 +18,10 @@ var classnames_1 = __importDefault(require("classnames"));
18
18
  var react_1 = __importDefault(require("react"));
19
19
  var utility_1 = require("../../utility");
20
20
  var SimpleCustomSelect = function (props) {
21
- var autoFocus = props.autoFocus, isImmutable = props.isImmutable, showEmptyOption = props.showEmptyOption, _a = props.valueKey, valueKey = _a === void 0 ? "value" : _a, _b = props.nameKey, nameKey = _b === void 0 ? "name" : _b, data = props.data, tabIndex = props.tabIndex, _c = props.field, field = _c === void 0 ? {} : _c, id = props.id, inputClass = props.inputClass, disabled = props.disabled, _d = props.meta, _e = _d === void 0 ? {} : _d, touched = _e.touched, error = _e.error, submitting = _e.submitting, theClasses = (0, classnames_1.default)("custom-select ".concat(inputClass || ""), {
21
+ var autoFocus = props.autoFocus, isImmutable = props.isImmutable, showEmptyOption = props.showEmptyOption, _a = props.valueKey, valueKey = _a === void 0 ? "value" : _a, _b = props.nameKey, nameKey = _b === void 0 ? "name" : _b, data = props.data, tabIndex = props.tabIndex, _c = props.input, input = _c === void 0 ? {} : _c, id = props.id, inputClass = props.inputClass, disabled = props.disabled, _d = props.meta, _e = _d === void 0 ? {} : _d, touched = _e.touched, error = _e.error, submitting = _e.submitting, theClasses = (0, classnames_1.default)("custom-select ".concat(inputClass || ""), {
22
22
  "is-invalid": touched && error,
23
- }), customID = "custom-select-".concat(field.name).concat(id || "");
24
- return (react_1.default.createElement("select", __assign({}, field, { autoFocus: autoFocus, className: theClasses, disabled: submitting || disabled, id: customID, tabIndex: tabIndex }),
23
+ }), customID = "custom-select-".concat(input.name).concat(id || "");
24
+ return (react_1.default.createElement("select", __assign({}, input, { autoFocus: autoFocus, className: theClasses, disabled: submitting || disabled, id: customID, tabIndex: tabIndex }),
25
25
  showEmptyOption ? react_1.default.createElement("option", { value: "" }, utility_1.words.Select) : null,
26
26
  isImmutable ? data.map(function (current) {
27
27
  var value = current.get(valueKey), name = current.get(nameKey);
@@ -5,7 +5,7 @@ export type SimpleInputPropTypes = {
5
5
  readonly autoFocus?: boolean;
6
6
  readonly customClass?: any;
7
7
  readonly disabled?: boolean;
8
- readonly field: any;
8
+ readonly input: any;
9
9
  readonly label?: string;
10
10
  readonly meta: MetaProps;
11
11
  readonly placeholder?: string;
@@ -18,10 +18,10 @@ exports.SimpleInput = void 0;
18
18
  var classnames_1 = __importDefault(require("classnames"));
19
19
  var react_1 = __importDefault(require("react"));
20
20
  var SimpleInput = function (props) {
21
- var customClass = props.customClass, _a = props.field, field = _a === void 0 ? {} : _a, label = props.label, autoFocus = props.autoFocus, tabIndex = props.tabIndex, placeholder = props.placeholder, theType = props.theType, inputRef = props.inputRef, autoComplete = props.autoComplete, disabled = props.disabled, _b = props.meta, _c = _b === void 0 ? {} : _b, submitting = _c.submitting, touched = _c.touched, error = _c.error;
22
- return (react_1.default.createElement("input", __assign({}, field, { "aria-label": label, autoComplete: autoComplete, autoFocus: autoFocus, className: (0, classnames_1.default)("form-control ".concat(customClass || ""), {
21
+ var customClass = props.customClass, _a = props.input, input = _a === void 0 ? {} : _a, label = props.label, autoFocus = props.autoFocus, tabIndex = props.tabIndex, placeholder = props.placeholder, theType = props.theType, inputRef = props.inputRef, autoComplete = props.autoComplete, disabled = props.disabled, _b = props.meta, _c = _b === void 0 ? {} : _b, submitting = _c.submitting, touched = _c.touched, error = _c.error;
22
+ return (react_1.default.createElement("input", __assign({}, input, { "aria-label": label, autoComplete: autoComplete, autoFocus: autoFocus, className: (0, classnames_1.default)("form-control ".concat(customClass || ""), {
23
23
  "is-invalid": touched && error,
24
- }), disabled: submitting || disabled, id: field.name, placeholder: placeholder || label, ref: inputRef ? inputRef : null, tabIndex: tabIndex, type: theType })));
24
+ }), disabled: submitting || disabled, id: input.name, placeholder: placeholder || label, ref: inputRef ? inputRef : null, tabIndex: tabIndex, type: theType })));
25
25
  };
26
26
  exports.SimpleInput = SimpleInput;
27
27
  //# sourceMappingURL=SimpleInput.js.map
@@ -3,7 +3,7 @@ import { MetaProps } from "src/types";
3
3
  type TextareaPropTypes = {
4
4
  readonly autoFocus?: boolean;
5
5
  readonly disabled?: boolean;
6
- readonly field: any;
6
+ readonly input: any;
7
7
  readonly inputClass?: string;
8
8
  readonly label: string;
9
9
  readonly meta: MetaProps;
@@ -17,8 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.SimpleTextarea = void 0;
18
18
  var react_1 = __importDefault(require("react"));
19
19
  var SimpleTextarea = function (props) {
20
- var disabled = props.disabled, _a = props.field, field = _a === void 0 ? {} : _a, label = props.label, onRegisterRef = props.onRegisterRef, autoFocus = props.autoFocus, inputClass = props.inputClass, placeholder = props.placeholder, tabIndex = props.tabIndex, rows = props.rows, _b = props.meta, _c = _b === void 0 ? {} : _b, submitting = _c.submitting, touched = _c.touched, error = _c.error, warningClass = "".concat(touched && error ? " is-invalid" : ""), customClass = "".concat(inputClass ? " ".concat(inputClass) : ""), classForInput = "form-control ".concat(warningClass).concat(customClass);
21
- return (react_1.default.createElement("textarea", __assign({}, field, { "aria-label": label, autoFocus: autoFocus, className: classForInput, disabled: disabled || submitting, id: field.name, placeholder: placeholder, ref: onRegisterRef ? onRegisterRef : null, rows: rows, tabIndex: tabIndex })));
20
+ var disabled = props.disabled, _a = props.input, input = _a === void 0 ? {} : _a, label = props.label, onRegisterRef = props.onRegisterRef, autoFocus = props.autoFocus, inputClass = props.inputClass, placeholder = props.placeholder, tabIndex = props.tabIndex, rows = props.rows, _b = props.meta, _c = _b === void 0 ? {} : _b, submitting = _c.submitting, touched = _c.touched, error = _c.error, warningClass = "".concat(touched && error ? " is-invalid" : ""), customClass = "".concat(inputClass ? " ".concat(inputClass) : ""), classForInput = "form-control ".concat(warningClass).concat(customClass);
21
+ return (react_1.default.createElement("textarea", __assign({}, input, { "aria-label": label, autoFocus: autoFocus, className: classForInput, disabled: disabled || submitting, id: input.name, placeholder: placeholder, ref: onRegisterRef ? onRegisterRef : null, rows: rows, tabIndex: tabIndex })));
22
22
  };
23
23
  exports.SimpleTextarea = SimpleTextarea;
24
24
  //# sourceMappingURL=SimpleTextarea.js.map
@@ -3,7 +3,7 @@ import { MetaProps } from "src/types";
3
3
  type InputTemplatePropTypes = {
4
4
  readonly autoFocus?: boolean;
5
5
  readonly disabled?: boolean;
6
- readonly field: any;
6
+ readonly input: any;
7
7
  readonly inputClass?: string;
8
8
  readonly label: string;
9
9
  readonly left?: string;
@@ -19,11 +19,11 @@ var classnames_1 = __importDefault(require("classnames"));
19
19
  var react_1 = __importDefault(require("react"));
20
20
  var SimpleTextarea_1 = require("./SimpleTextarea");
21
21
  var TextareaTemplate = function (props) {
22
- var _a = props.field, field = _a === void 0 ? {} : _a, label = props.label, left = props.left, right = props.right, _b = props.meta, _c = _b === void 0 ? {} : _b, touched = _c.touched, error = _c.error;
22
+ var _a = props.input, input = _a === void 0 ? {} : _a, label = props.label, left = props.left, right = props.right, _b = props.meta, _c = _b === void 0 ? {} : _b, touched = _c.touched, error = _c.error;
23
23
  return (react_1.default.createElement("div", { className: (0, classnames_1.default)("form-group mt-md-2 row d-flex", {
24
24
  "is-invalid": touched && error,
25
25
  }) },
26
- react_1.default.createElement("label", { className: "".concat(left ? "".concat(left, " align-self-center") : "col-md-4", " text-md-end form-control-label align-self-center"), htmlFor: field.name }, label),
26
+ react_1.default.createElement("label", { className: "".concat(left ? "".concat(left, " align-self-center") : "col-md-4", " text-md-end form-control-label align-self-center"), htmlFor: input.name }, label),
27
27
  react_1.default.createElement("div", { className: right ? "".concat(right, " align-self-center") : "col-md-8 align-self-center" },
28
28
  react_1.default.createElement(SimpleTextarea_1.SimpleTextarea, __assign({}, props)),
29
29
  react_1.default.createElement("div", { className: "invalid-feedback" }, touched && error ? (react_1.default.createElement("span", null, error)) : null))));
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "17.5.4",
2
+ "version": "17.5.5",
3
3
  "name": "x25",
4
4
  "description": "x25",
5
5
  "types": "./dist/index.d.ts",
@@ -120,6 +120,7 @@
120
120
  "redux": "^4.2.1",
121
121
  "reselect": "^4.1.8",
122
122
  "superagent": "^8.1.2",
123
- "vitest": "^0.34.6"
123
+ "vitest": "^1.4.0",
124
+ "x25": "^17.4.70"
124
125
  }
125
126
  }