x25 17.5.3 → 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
- props.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
@@ -1 +1 @@
1
- {"version":3,"file":"DateInput.js","sourceRoot":"","sources":["../../src/Inputs/DateInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,0DAAoC;AACpC,gDAA0B;AAC1B,sCAA8D;AAC9D,oDAAoD;AAkBpD,IACE,eAAe,GAAG,UAAC,GAAY;IAC7B,IACE,YAAY,GAAG,CAAC,EAChB,UAAU,GAAG,CACX,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC;QACzB,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,YAAY,CAAC,CACzC,CAAC;IAEJ,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,IACE,OAAO,GAAG,UAAC,KAAc,IAAK,OAAA,CAC5B,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,WAAI,KAAK,CAAE,CAAC,CAAC,CAAC,KAAK,CACzC,EAF6B,CAE7B,EACD,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EACtB,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACzB,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACpB,KAAK,GAAI,KAAK,GAAT,EAEV,QAAQ,GAAG,CAAC,KAAK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E,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,WAAW,IAClB,CACH,CAAC;AACJ,CAAC,CAAC;AArDW,QAAA,SAAS,aAqDpB"}
@@ -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
- props.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;
@@ -1 +1 @@
1
- {"version":3,"file":"DateTemplate.js","sourceRoot":"","sources":["../../src/Inputs/DateTemplate.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,0DAAoC;AACpC,gDAA0B;AAC1B,sCAA8D;AAC9D,oDAAoD;AAqBpD,IACE,eAAe,GAAG,UAAC,GAAY;IAC7B,IACE,YAAY,GAAG,CAAC,EAChB,UAAU,GAAG,CACX,CAAC,OAAO,GAAG,KAAK,QAAQ,CAAC;QAC3B,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,YAAY,CAAC,CACvC,CAAC;IAEJ,IAA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CAAC,CAAC,UAAU;YAC/D,oDACM,KAAK,kBACG,KAAK,EACjB,SAAS,EAAE,IAAA,oBAAU,EAAC,uBAAgB,WAAW,IAAI,EAAE,CAAE,EAAE;oBACzD,YAAY,EAAE,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK;iBACzC,CAAC,EACF,QAAQ,EAAE,IAAI,CAAC,UAAU,EACzB,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,EACtB,WAAW,EAAE,WAAW,IAAI,eAAK,CAAC,UAAU,EAC5C,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,WAAW,IAClB;YACF,uCACE,SAAS,EAAC,kBAAkB,IAC3B,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAC5B,4CACG,IAAI,CAAC,KAAK,CACN,CACR,CAAC,CAAC,CAAC,IAAI,CACJ,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AAxEW,QAAA,YAAY,gBAwEvB"}
@@ -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;
@@ -1,13 +1,12 @@
1
1
  import React from "react";
2
- import { MetaProps } from "src/types";
3
2
  type NumericPropTypes = {
4
3
  readonly autoFocus?: boolean;
5
4
  readonly currency?: boolean;
6
5
  readonly customClass?: any;
7
6
  readonly disabled?: boolean;
8
- readonly field: any;
7
+ readonly input: any;
9
8
  readonly label?: string;
10
- readonly meta: MetaProps;
9
+ readonly meta: any;
11
10
  readonly onRegisterRef?: any;
12
11
  readonly optional?: boolean;
13
12
  readonly placeholder?: string;
@@ -15,10 +14,11 @@ type NumericPropTypes = {
15
14
  readonly size?: number;
16
15
  readonly tabIndex?: number;
17
16
  readonly value?: string;
17
+ readonly form: any;
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,39 +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, customClass = props.customClass, _b = props.field, field = _b === void 0 ? {} : _b, label = props.label, disabled = props.disabled, currency = props.currency, tabIndex = props.tabIndex, onRegisterRef = props.onRegisterRef, _c = props.formatValue, formatValue = _c === void 0 ? utility_1.formatZeroValue : _c, size = props.size, placeholder = props.placeholder, _d = props.meta, _e = _d === void 0 ? {} : _d, submitting = _e.submitting, touched = _e.touched, error = _e.error, _f = react_1.default.useState(field.value), value = _f[0], setValue = _f[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
- field.onChange(valueToStore);
19
- }, handleBlur = function (event) {
18
+ input.onChange(valueToStore);
19
+ }, handleBlur = function (_a) {
20
+ var targetValue = _a.target.value;
20
21
  var newValue = (0, common_1.clearFloatOnBlur)(value, precision), hasChanged = value !== newValue;
21
22
  if (hasChanged) {
22
23
  updateValue(newValue);
23
24
  }
24
- if (typeof field.onBlur === "function") {
25
- field.onBlur(event);
25
+ if (typeof input.onBlur === "function") {
26
+ input.onBlur(targetValue);
26
27
  }
27
28
  }, handleChange = function (_a) {
28
29
  var targetValue = _a.target.value;
29
30
  updateValue(targetValue);
30
31
  }, handleFocus = function (event) {
31
- if (typeof field.onFocus === "function") {
32
- field.onFocus(event);
32
+ if (typeof input.onFocus === "function") {
33
+ input.onFocus(event);
33
34
  }
34
35
  if (typeof props.onFocus === "function") {
35
36
  props.onFocus(event);
36
37
  }
37
38
  }, inputComponent = (react_1.default.createElement("input", { "aria-label": label, autoFocus: props.autoFocus, className: (0, classnames_1.default)("form-control ".concat(customClass || ""), {
38
39
  "is-invalid": touched && error,
39
- }), 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 }));
40
41
  react_1.default.useEffect(function () {
41
- if ((0, common_1.isFloat)(field.value) || field.value === "") {
42
- updateValue(field.value);
42
+ if ((0, common_1.isFloat)(input.value) || input.value === "") {
43
+ updateValue(input.value);
43
44
  }
44
- }, [field.value]);
45
+ }, [input.value]);
45
46
  if (noCurrency) {
46
47
  return inputComponent;
47
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,EACb,WAAW,GAET,KAAK,YAFI,EAAE,KAEX,KAAK,MAFgB,EAAV,KAAK,mBAAG,EAAE,KAAA,EAAE,KAAK,GAE5B,KAAK,MAFuB,EAAE,QAAQ,GAEtC,KAAK,SAFiC,EAAE,QAAQ,GAEhD,KAAK,SAF2C,EAAE,QAAQ,GAE1D,KAAK,SAFqD,EAAE,aAAa,GAEzE,KAAK,cAFoE,EAAE,KAE3E,KAAK,YAFmG,EAA7B,WAAW,mBAAG,yBAAe,KAAA,EAC1G,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,CAAC,KAAK,CAAC,EAA9C,KAAK,QAAA,EAAE,QAAQ,QAAA,EAEhB,UAAU,GAAG,CAAC,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,KAAK,CAAC,EACpE,WAAW,GAAG,WAA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AAE,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;
@@ -1 +1 @@
1
- {"version":3,"file":"NumericTemplate.js","sourceRoot":"","sources":["../../src/Inputs/NumericTemplate.tsx"],"names":[],"mappings":";;;;;;AA2BA,0DAAoC;AACpC,gDAA0B;AAC1B,sCAA6C;AAC7C,mCAAgG;AAGzF,IACL,eAAe,GAAG,UAAC,KAAwB;IAGrC,IAAA,KAKE,KAAK,UALM,EAAb,SAAS,mBAAG,CAAC,KAAA,EACb,KAIE,KAAK,MAJG,EAAV,KAAK,mBAAG,EAAE,KAAA,EAAE,KAAK,GAIf,KAAK,MAJU,EAAE,QAAQ,GAIzB,KAAK,SAJoB,EAAE,QAAQ,GAInC,KAAK,SAJ8B,EAAE,KAAK,GAI1C,KAAK,MAJqC,EAC5C,aAAa,GAGX,KAAK,cAHM,EACb,KAEE,KAAK,KAFkC,EAAzC,qBAAuC,EAAE,KAAA,EAAjC,UAAU,gBAAA,EAAE,OAAO,aAAA,EAAE,KAAK,WAAA,EAAS,KAEzC,KAAK,YA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;YAC/C,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAElB,OAAO,CACL,uCAAK,SAAS,EAAE,IAAA,oBAAU,EAAC,UAAG,WAAW,YAAS,EAAE;YAClD,YAAY,EAAE,OAAO,IAAI,KAAK;SAC/B,CAAC;QACA,yCACE,SAAS,EAAE,UAAG,IAAI,CAAC,CAAC,CAAC,UAAG,IAAI,uBAAoB,CAAC,CAAC,CAAC,sBAAsB,0CAAuC,EAChH,OAAO,EAAE,KAAK,CAAC,IAAI,IAClB,KAAK,CACA;QACR,uCAAK,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,UAAG,KAAK,uBAAoB,CAAC,CAAC,CAAC,4BAA4B;YACjF,uDACc,KAAK,EACjB,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,aAAa,EACxB,QAAQ,EAAE,UAAU,IAAI,QAAQ,EAChC,EAAE,EAAE,KAAK,CAAC,IAAI,EACd,SAAS,EAAC,SAAS,EACnB,SAAS,EAAE,IAAI,EACf,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,aAAa,EAClB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,WAAW,GAClB;YACF,uCAAK,SAAS,EAAC,kBAAkB,IAC9B,OAAO,IAAI,KAAK,CAAC,CAAC,CAAC,CAClB,4CACG,KAAK,CACD,CACR,CAAC,CAAC,CAAC,IAAI,CACJ,CACF,CACF,CACP,CAAC;AACJ,CAAC,CAAC;AA1FF,QAAA,eAAe,mBA0Fb"}
@@ -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))));
@@ -1 +1 @@
1
- export declare const floatToEnglishComma: (raw: any) => string, isFloat: (raw: string) => boolean, getFloatValueToStore: (raw: any) => number, clearFloatOnBlur: (value: any, precision: number) => any;
1
+ export declare const floatToEnglishComma: (raw: any) => string, isFloat: (raw: string) => boolean, getFloatValueToStore: (raw: any) => number, clearFloatOnBlur: (value: any, precision: number) => string;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "17.5.3",
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
  }