linear-react-components-ui 2.0.0-beta.4 → 2.0.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/inputs/date/helpers.js +11 -22
- package/lib/inputs/date/helpers.js.map +1 -1
- package/lib/inputs/mask/BaseMask.js +55 -65
- package/lib/inputs/mask/BaseMask.js.map +1 -1
- package/lib/inputs/number/Currency.js +35 -45
- package/lib/inputs/number/Currency.js.map +1 -1
- package/lib/inputs/number/Decimal.js +38 -48
- package/lib/inputs/number/Decimal.js.map +1 -1
- package/lib/inputs/number/index.js +38 -48
- package/lib/inputs/number/index.js.map +1 -1
- package/lib/inputs2/date/datefield/base.js +60 -70
- package/lib/inputs2/date/datefield/base.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/base.js +79 -89
- package/lib/inputs2/date/dateperiodfield/base.js.map +1 -1
- package/lib/inputs2/mask/Cnpj.js +58 -68
- package/lib/inputs2/mask/Cnpj.js.map +1 -1
- package/lib/inputs2/mask/Cpf.js +38 -48
- package/lib/inputs2/mask/Cpf.js.map +1 -1
- package/lib/inputs2/mask/index.js +50 -60
- package/lib/inputs2/mask/index.js.map +1 -1
- package/lib/inputs2/numberfield/currency.js +51 -61
- package/lib/inputs2/numberfield/currency.js.map +1 -1
- package/lib/inputs2/numberfield/decimal.js +25 -35
- package/lib/inputs2/numberfield/decimal.js.map +1 -1
- package/lib/inputs2/numberfield/index.js +46 -56
- package/lib/inputs2/numberfield/index.js.map +1 -1
- package/package.json +9 -6
- package/lib/node_modules/imask/esm/controls/html-contenteditable-mask-element.js +0 -35
- package/lib/node_modules/imask/esm/controls/html-contenteditable-mask-element.js.map +0 -1
- package/lib/node_modules/imask/esm/controls/html-input-mask-element.js +0 -32
- package/lib/node_modules/imask/esm/controls/html-input-mask-element.js.map +0 -1
- package/lib/node_modules/imask/esm/controls/html-mask-element.js +0 -49
- package/lib/node_modules/imask/esm/controls/html-mask-element.js.map +0 -1
- package/lib/node_modules/imask/esm/controls/input-history.js +0 -31
- package/lib/node_modules/imask/esm/controls/input-history.js.map +0 -1
- package/lib/node_modules/imask/esm/controls/input.js +0 -223
- package/lib/node_modules/imask/esm/controls/input.js.map +0 -1
- package/lib/node_modules/imask/esm/controls/mask-element.js +0 -44
- package/lib/node_modules/imask/esm/controls/mask-element.js.map +0 -1
- package/lib/node_modules/imask/esm/core/action-details.js +0 -52
- package/lib/node_modules/imask/esm/core/action-details.js.map +0 -1
- package/lib/node_modules/imask/esm/core/change-details.js +0 -37
- package/lib/node_modules/imask/esm/core/change-details.js.map +0 -1
- package/lib/node_modules/imask/esm/core/continuous-tail-details.js +0 -43
- package/lib/node_modules/imask/esm/core/continuous-tail-details.js.map +0 -1
- package/lib/node_modules/imask/esm/core/holder.js +0 -7
- package/lib/node_modules/imask/esm/core/holder.js.map +0 -1
- package/lib/node_modules/imask/esm/core/utils.js +0 -68
- package/lib/node_modules/imask/esm/core/utils.js.map +0 -1
- package/lib/node_modules/imask/esm/index.js +0 -51
- package/lib/node_modules/imask/esm/index.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/base.js +0 -253
- package/lib/node_modules/imask/esm/masked/base.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/date.js +0 -118
- package/lib/node_modules/imask/esm/masked/date.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/dynamic.js +0 -223
- package/lib/node_modules/imask/esm/masked/dynamic.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/enum.js +0 -70
- package/lib/node_modules/imask/esm/masked/enum.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/factory.js +0 -47
- package/lib/node_modules/imask/esm/masked/factory.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/function.js +0 -24
- package/lib/node_modules/imask/esm/masked/function.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/number.js +0 -213
- package/lib/node_modules/imask/esm/masked/number.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/pattern/chunk-tail-details.js +0 -104
- package/lib/node_modules/imask/esm/masked/pattern/chunk-tail-details.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/pattern/cursor.js +0 -101
- package/lib/node_modules/imask/esm/masked/pattern/cursor.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/pattern/fixed-definition.js +0 -103
- package/lib/node_modules/imask/esm/masked/pattern/fixed-definition.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/pattern/input-definition.js +0 -134
- package/lib/node_modules/imask/esm/masked/pattern/input-definition.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/pattern.js +0 -323
- package/lib/node_modules/imask/esm/masked/pattern.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/pipe.js +0 -24
- package/lib/node_modules/imask/esm/masked/pipe.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/range.js +0 -79
- package/lib/node_modules/imask/esm/masked/range.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/regexp.js +0 -22
- package/lib/node_modules/imask/esm/masked/regexp.js.map +0 -1
- package/lib/node_modules/imask/esm/masked/repeat.js +0 -105
- package/lib/node_modules/imask/esm/masked/repeat.js.map +0 -1
- package/lib/node_modules/react-imask/esm/hook.js +0 -76
- package/lib/node_modules/react-imask/esm/hook.js.map +0 -1
- package/lib/node_modules/react-imask/esm/input.js +0 -24
- package/lib/node_modules/react-imask/esm/input.js.map +0 -1
- package/lib/node_modules/react-imask/esm/mixin.js +0 -132
- package/lib/node_modules/react-imask/esm/mixin.js.map +0 -1
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
2
2
|
import '../../assets/styles/numbers.css';/* empty css */
|
|
3
|
-
import { useRef as
|
|
4
|
-
import
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import "
|
|
9
|
-
import "../../
|
|
10
|
-
|
|
11
|
-
import "../../node_modules/imask/esm/controls/html-contenteditable-mask-element.js";
|
|
12
|
-
import "../../node_modules/imask/esm/controls/input-history.js";
|
|
13
|
-
import "../../node_modules/react-imask/esm/input.js";
|
|
14
|
-
import h from "../../node_modules/react-imask/esm/hook.js";
|
|
15
|
-
import "../../node_modules/react-imask/esm/mixin.js";
|
|
16
|
-
import { default as G } from "./Decimal.js";
|
|
17
|
-
import { default as J } from "./Currency.js";
|
|
18
|
-
import k from "../base/InputTextBase.js";
|
|
19
|
-
import { mergeRefs as b } from "../../form2/helpers.js";
|
|
20
|
-
const U = (e) => {
|
|
3
|
+
import { useRef as V, useEffect as h } from "react";
|
|
4
|
+
import t from "../../_virtual/lodash.js";
|
|
5
|
+
import { useIMask as k } from "react-imask";
|
|
6
|
+
import { default as Z } from "./Decimal.js";
|
|
7
|
+
import { default as p } from "./Currency.js";
|
|
8
|
+
import b from "../base/InputTextBase.js";
|
|
9
|
+
import { mergeRefs as I } from "../../form2/helpers.js";
|
|
10
|
+
const y = (e) => {
|
|
21
11
|
const {
|
|
22
|
-
textAlign:
|
|
12
|
+
textAlign: m = "left",
|
|
23
13
|
themePopover: f = "light",
|
|
24
14
|
popoverAlign: s = "left",
|
|
25
|
-
min:
|
|
15
|
+
min: l = void 0,
|
|
26
16
|
max: d = void 0,
|
|
27
17
|
inputRef: c = void 0
|
|
28
|
-
} = e,
|
|
18
|
+
} = e, n = V(null), {
|
|
29
19
|
value: v,
|
|
30
|
-
setValue:
|
|
31
|
-
unmaskedValue:
|
|
32
|
-
} =
|
|
20
|
+
setValue: o,
|
|
21
|
+
unmaskedValue: r
|
|
22
|
+
} = k({
|
|
33
23
|
mask: Number,
|
|
34
24
|
max: d,
|
|
35
|
-
min:
|
|
25
|
+
min: l,
|
|
36
26
|
scale: 0,
|
|
37
27
|
enum: void 0,
|
|
38
28
|
to: void 0,
|
|
@@ -40,41 +30,41 @@ const U = (e) => {
|
|
|
40
30
|
normalizeZeros: !0,
|
|
41
31
|
padFractionalZeros: !1
|
|
42
32
|
}, {
|
|
43
|
-
ref:
|
|
44
|
-
onAccept: (
|
|
45
|
-
const
|
|
33
|
+
ref: n,
|
|
34
|
+
onAccept: (a, u, i) => {
|
|
35
|
+
const x = parseInt(a, 10);
|
|
46
36
|
e?.onChange?.({
|
|
47
|
-
...
|
|
37
|
+
...i,
|
|
48
38
|
target: {
|
|
49
|
-
...
|
|
39
|
+
...i?.target,
|
|
50
40
|
name: e?.name,
|
|
51
|
-
value:
|
|
41
|
+
value: x
|
|
52
42
|
}
|
|
53
43
|
});
|
|
54
44
|
}
|
|
55
|
-
}), g = (
|
|
56
|
-
if (!
|
|
57
|
-
const
|
|
58
|
-
(
|
|
59
|
-
...
|
|
45
|
+
}), g = (a) => {
|
|
46
|
+
if (!t.isNil(l)) {
|
|
47
|
+
const u = parseInt(r, 10);
|
|
48
|
+
(t.isNaN(u) || u < l) && (o(t.toString(l)), e?.onChange?.({
|
|
49
|
+
...a,
|
|
60
50
|
target: {
|
|
61
|
-
...
|
|
51
|
+
...a?.target,
|
|
62
52
|
name: e?.name,
|
|
63
|
-
value:
|
|
53
|
+
value: l
|
|
64
54
|
}
|
|
65
55
|
}));
|
|
66
56
|
}
|
|
67
|
-
e?.onBlur?.(
|
|
57
|
+
e?.onBlur?.(a);
|
|
68
58
|
};
|
|
69
|
-
return
|
|
70
|
-
const
|
|
71
|
-
!
|
|
72
|
-
}, [e?.value]), /* @__PURE__ */
|
|
73
|
-
}, onBlur: g, value: v, textAlign:
|
|
59
|
+
return h(() => {
|
|
60
|
+
const a = Number(r || "0");
|
|
61
|
+
!t.isNil(e?.value) && (!t.isEqual(e?.value, a) || t.isEqual(e?.value, 0)) && o(t.toString(e?.value));
|
|
62
|
+
}, [e?.value]), /* @__PURE__ */ N(b, { ...e, inputRef: I(n, c), type: "number", onChange: () => {
|
|
63
|
+
}, onBlur: g, value: v, textAlign: m, themePopover: f, popoverAlign: s });
|
|
74
64
|
};
|
|
75
65
|
export {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
66
|
+
p as CurrencyField,
|
|
67
|
+
Z as DecimalField,
|
|
68
|
+
y as default
|
|
79
69
|
};
|
|
80
70
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/lib/inputs/number/index.tsx"],"sourcesContent":["import '../../assets/styles/numbers.scss';\n\nimport React, { useEffect, useRef } from 'react';\nimport _ from 'lodash';\nimport { useIMask } from 'react-imask';\nimport DecimalField from './Decimal';\nimport CurrencyField from './Currency';\nimport { INumberFieldProps } from './types';\nimport InputTextBase from '../base/InputTextBase';\nimport { CustomInputEvent } from '../base/types';\nimport { mergeRefs } from '../../form2/helpers';\n\nconst NumberField = (props: INumberFieldProps) => {\n const {\n textAlign = 'left', themePopover = 'light', popoverAlign = 'left', min = undefined, \n max = undefined, inputRef = undefined,\n } = props;\n const numberInputRef = useRef<HTMLInputElement | null>(null);\n\n const { value: maskedValue, setValue: setMaskedValue, unmaskedValue } = useIMask({\n mask: Number,\n max,\n min,\n scale: 0,\n enum: undefined,\n to: undefined,\n from: undefined,\n normalizeZeros: true,\n padFractionalZeros: false,\n }, {\n ref: numberInputRef,\n onAccept: (value, __, event) => {\n const parsedValue = parseInt(value, 10);\n props?.onChange?.({\n ...event,\n target: {\n ...event?.target,\n name: props?.name,\n value: parsedValue as any,\n },\n } as CustomInputEvent);\n },\n });\n\n /**\n * Função sobrescrevendo o evento onBlur para tratar o valor mínimo ao sair do campo, \n * garantindo que o valor não seja menor que o mínimo definido.\n */\n const handleBlur = (event: CustomInputEvent) => {\n if (!_.isNil(min)) {\n const currentValue = parseInt(unmaskedValue, 10) as number;\n if (_.isNaN(currentValue) || currentValue < min) {\n setMaskedValue(_.toString(min));\n props?.onChange?.({\n ...event,\n target: {\n ...event?.target,\n name: props?.name,\n value: min as any,\n },\n } as CustomInputEvent);\n }\n }\n props?.onBlur?.(event);\n };\n\n useEffect(() => {\n const floatUnmaskedValue = Number(unmaskedValue || '0');\n if (!_.isNil(props?.value) && (!_.isEqual(props?.value,\n floatUnmaskedValue) || _.isEqual(props?.value, 0))) {\n setMaskedValue(_.toString(props?.value));\n }\n }, [props?.value]);\n\n return (\n <InputTextBase\n {...props}\n inputRef={mergeRefs(numberInputRef, inputRef) as any}\n type=\"number\"\n onChange={() => {}}\n onBlur={handleBlur}\n value={maskedValue}\n textAlign={textAlign}\n themePopover={themePopover}\n popoverAlign={popoverAlign} />\n );\n};\n\nexport default NumberField;\nexport {\n CurrencyField,\n DecimalField,\n};\n"],"names":["NumberField","props","textAlign","themePopover","popoverAlign","min","undefined","max","inputRef","numberInputRef","useRef","value","maskedValue","setValue","setMaskedValue","unmaskedValue","useIMask","mask","Number","scale","enum","to","from","normalizeZeros","padFractionalZeros","ref","onAccept","__","event","parsedValue","parseInt","onChange","target","name","handleBlur","_","isNil","currentValue","isNaN","toString","onBlur","useEffect","floatUnmaskedValue","isEqual","jsx","InputTextBase","mergeRefs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/lib/inputs/number/index.tsx"],"sourcesContent":["import '../../assets/styles/numbers.scss';\n\nimport React, { useEffect, useRef } from 'react';\nimport _ from 'lodash';\nimport { useIMask } from 'react-imask';\nimport DecimalField from './Decimal';\nimport CurrencyField from './Currency';\nimport { INumberFieldProps } from './types';\nimport InputTextBase from '../base/InputTextBase';\nimport { CustomInputEvent } from '../base/types';\nimport { mergeRefs } from '../../form2/helpers';\n\nconst NumberField = (props: INumberFieldProps) => {\n const {\n textAlign = 'left', themePopover = 'light', popoverAlign = 'left', min = undefined, \n max = undefined, inputRef = undefined,\n } = props;\n const numberInputRef = useRef<HTMLInputElement | null>(null);\n\n const { value: maskedValue, setValue: setMaskedValue, unmaskedValue } = useIMask({\n mask: Number,\n max,\n min,\n scale: 0,\n enum: undefined,\n to: undefined,\n from: undefined,\n normalizeZeros: true,\n padFractionalZeros: false,\n }, {\n ref: numberInputRef,\n onAccept: (value, __, event) => {\n const parsedValue = parseInt(value, 10);\n props?.onChange?.({\n ...event,\n target: {\n ...event?.target,\n name: props?.name,\n value: parsedValue as any,\n },\n } as CustomInputEvent);\n },\n });\n\n /**\n * Função sobrescrevendo o evento onBlur para tratar o valor mínimo ao sair do campo, \n * garantindo que o valor não seja menor que o mínimo definido.\n */\n const handleBlur = (event: CustomInputEvent) => {\n if (!_.isNil(min)) {\n const currentValue = parseInt(unmaskedValue, 10) as number;\n if (_.isNaN(currentValue) || currentValue < min) {\n setMaskedValue(_.toString(min));\n props?.onChange?.({\n ...event,\n target: {\n ...event?.target,\n name: props?.name,\n value: min as any,\n },\n } as CustomInputEvent);\n }\n }\n props?.onBlur?.(event);\n };\n\n useEffect(() => {\n const floatUnmaskedValue = Number(unmaskedValue || '0');\n if (!_.isNil(props?.value) && (!_.isEqual(props?.value,\n floatUnmaskedValue) || _.isEqual(props?.value, 0))) {\n setMaskedValue(_.toString(props?.value));\n }\n }, [props?.value]);\n\n return (\n <InputTextBase\n {...props}\n inputRef={mergeRefs(numberInputRef, inputRef) as any}\n type=\"number\"\n onChange={() => {}}\n onBlur={handleBlur}\n value={maskedValue}\n textAlign={textAlign}\n themePopover={themePopover}\n popoverAlign={popoverAlign} />\n );\n};\n\nexport default NumberField;\nexport {\n CurrencyField,\n DecimalField,\n};\n"],"names":["NumberField","props","textAlign","themePopover","popoverAlign","min","undefined","max","inputRef","numberInputRef","useRef","value","maskedValue","setValue","setMaskedValue","unmaskedValue","useIMask","mask","Number","scale","enum","to","from","normalizeZeros","padFractionalZeros","ref","onAccept","__","event","parsedValue","parseInt","onChange","target","name","handleBlur","_","isNil","currentValue","isNaN","toString","onBlur","useEffect","floatUnmaskedValue","isEqual","jsx","InputTextBase","mergeRefs"],"mappings":";;;;;;;;;AAYA,MAAMA,IAAcA,CAACC,MAA6B;AAChD,QAAM;AAAA,IACJC,WAAAA,IAAY;AAAA,IAAQC,cAAAA,IAAe;AAAA,IAASC,cAAAA,IAAe;AAAA,IAAQC,KAAAA,IAAMC;AAAAA,IACzEC,KAAAA,IAAMD;AAAAA,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AAEC,MAAMnC,GAAOU,KAAK,MAAM,CAACwB,EAAEQ,QAAQ1C,GAAOU,OAC/C+B,CAAkB,KAAKP,EAAEQ,QAAQ1C,GAAOU,OAAO,CAAC,MAChDG,EAAeqB,EAAEI,SAAStC,GAAOU,KAAK,CAAC;AAAA,EAE3C,GAAG,CAACV,GAAOU,KAAK,CAAC,GAGf,gBAAAiC,EAACC,GAAA,EACC,GAAI5C,GACJ,UAAU6C,EAAUrC,GAAgBD,CAAQ,GAC5C,MAAK,UACL,UAAU,MAAM;AAAA,EAAC,GACjB,QAAQ0B,GACR,OAAOtB,GACP,WAAAV,GACA,cAAAC,GACA,cAAAC,GAA2B;AAEjC;"}
|
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
import { jsxs as O, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import a from "react";
|
|
3
|
-
import
|
|
4
|
-
import "
|
|
5
|
-
import "../../../node_modules/imask/esm/controls/input.js";
|
|
6
|
-
import "../../../node_modules/imask/esm/masked/factory.js";
|
|
7
|
-
import "../../../node_modules/imask/esm/controls/mask-element.js";
|
|
8
|
-
import "../../../node_modules/imask/esm/controls/html-input-mask-element.js";
|
|
9
|
-
import "../../../node_modules/imask/esm/controls/html-mask-element.js";
|
|
10
|
-
import "../../../node_modules/imask/esm/controls/html-contenteditable-mask-element.js";
|
|
11
|
-
import "../../../node_modules/imask/esm/controls/input-history.js";
|
|
12
|
-
import "../../../node_modules/react-imask/esm/input.js";
|
|
13
|
-
import De from "../../../node_modules/react-imask/esm/hook.js";
|
|
14
|
-
import "../../../node_modules/react-imask/esm/mixin.js";
|
|
3
|
+
import m from "../../../_virtual/lodash.js";
|
|
4
|
+
import { useIMask as De } from "react-imask";
|
|
15
5
|
import { createPortal as ye } from "react-dom";
|
|
16
|
-
import
|
|
6
|
+
import l from "../../../node_modules/moment/dist/moment.js";
|
|
17
7
|
import Oe from "../../../hint/index.js";
|
|
18
8
|
import { Tooltip as Se } from "../../../tooltip/index.js";
|
|
19
|
-
import { mergeRefs as
|
|
20
|
-
import { Keys as
|
|
21
|
-
import { Root as
|
|
22
|
-
import { TOKEN_PTBR_FORMAT as S, TOKEN_ISO_FORMAT as r, TOKEN_MASK as
|
|
23
|
-
import { Triggers as
|
|
24
|
-
import { CalendarBox as
|
|
9
|
+
import { mergeRefs as Re } from "../../../form2/helpers.js";
|
|
10
|
+
import { Keys as o } from "../types.js";
|
|
11
|
+
import { Root as Be, Label as we, Container as Ie, Input as xe } from "../base/index.js";
|
|
12
|
+
import { TOKEN_PTBR_FORMAT as S, TOKEN_ISO_FORMAT as r, TOKEN_MASK as ve, NAVIGATION_KEYS as Ve } from "../helpers.js";
|
|
13
|
+
import { Triggers as Fe } from "./triggers.js";
|
|
14
|
+
import { CalendarBox as pe } from "./calendarbox.js";
|
|
25
15
|
import { DateFieldContext as Ke } from "./context.js";
|
|
26
16
|
import Me from "../../../node_modules/uuid/dist/v1.js";
|
|
27
17
|
const Ne = a.forwardRef((t, j) => {
|
|
28
18
|
const {
|
|
29
|
-
label:
|
|
30
|
-
errors:
|
|
19
|
+
label: F,
|
|
20
|
+
errors: p,
|
|
31
21
|
tooltip: q,
|
|
32
22
|
tooltipPosition: H,
|
|
33
23
|
tooltipWidth: $,
|
|
@@ -44,38 +34,38 @@ const Ne = a.forwardRef((t, j) => {
|
|
|
44
34
|
themePopover: te = "light",
|
|
45
35
|
popoverAlign: ae = "left",
|
|
46
36
|
showCalendarButton: ne = !0,
|
|
47
|
-
openCalendarOnFocus:
|
|
48
|
-
undigitable:
|
|
49
|
-
showClearDateButton:
|
|
37
|
+
openCalendarOnFocus: le = !0,
|
|
38
|
+
undigitable: R = !1,
|
|
39
|
+
showClearDateButton: oe = !0,
|
|
50
40
|
placeholder: se = S,
|
|
51
|
-
readOnly:
|
|
41
|
+
readOnly: f,
|
|
52
42
|
disabled: k,
|
|
53
43
|
...re
|
|
54
|
-
} = t, [g,
|
|
55
|
-
setValue:
|
|
44
|
+
} = t, [g, B] = a.useState(!1), [w, D] = a.useState(l().format(r)), [i, I] = a.useState(null), [ie, u] = a.useState(i ?? l()), N = a.useRef(null), P = a.useRef(null), h = a.useRef(null), T = a.useRef(null), {
|
|
45
|
+
setValue: x,
|
|
56
46
|
unmaskedValue: E,
|
|
57
47
|
value: A
|
|
58
48
|
} = De({
|
|
59
|
-
mask:
|
|
49
|
+
mask: ve,
|
|
60
50
|
lazy: !1,
|
|
61
51
|
placeholderChar: "_"
|
|
62
52
|
}, {
|
|
63
53
|
ref: h,
|
|
64
54
|
defaultValue: i?.format(S),
|
|
65
55
|
onComplete: (e) => {
|
|
66
|
-
const n =
|
|
67
|
-
n.isValid() &&
|
|
56
|
+
const n = l(e, S);
|
|
57
|
+
n.isValid() && V(n);
|
|
68
58
|
}
|
|
69
|
-
}), b = a.useMemo(() => t.id || t.name || Me(), [t.id, t.name]), de = !
|
|
59
|
+
}), b = a.useMemo(() => t.id || t.name || Me(), [t.id, t.name]), de = !m.isEmpty(t?.label), z = !!t.hint?.length, v = !!p?.length, ce = !m.isEmpty(t?.value), V = a.useCallback((e) => {
|
|
70
60
|
const n = e.format(r), s = e.toISOString();
|
|
71
|
-
|
|
61
|
+
I(e.clone()), u(e.clone()), t.onChange?.({
|
|
72
62
|
target: {
|
|
73
63
|
name: t.name,
|
|
74
64
|
value: G === "default" ? n : s
|
|
75
65
|
}
|
|
76
66
|
}), K && C();
|
|
77
|
-
}, [i, t.name, t.onChange, K]), W = a.useCallback(() =>
|
|
78
|
-
|
|
67
|
+
}, [i, t.name, t.onChange, K]), W = a.useCallback(() => B(!0), []), C = a.useCallback(() => B(!1), []), Y = a.useCallback(() => u((e) => e.clone().add(1, "month")), []), L = a.useCallback(() => u((e) => e.clone().subtract(1, "month")), []), ue = a.useCallback(() => {
|
|
68
|
+
B((e) => (h.current !== document.activeElement && h?.current?.focus?.(), !e));
|
|
79
69
|
}, []), y = a.useCallback((e) => {
|
|
80
70
|
u((n) => {
|
|
81
71
|
const s = n.clone().add(e, "day");
|
|
@@ -86,69 +76,69 @@ const Ne = a.forwardRef((t, j) => {
|
|
|
86
76
|
let s = n;
|
|
87
77
|
return e === "end" && (s = n.clone().endOf("week")), e === "start" && (s = n.clone().startOf("week")), D(s.format(r)), s;
|
|
88
78
|
});
|
|
89
|
-
}, []),
|
|
79
|
+
}, []), fe = a.useCallback(() => {
|
|
90
80
|
t.onChange?.({
|
|
91
81
|
target: {
|
|
92
82
|
name: t.name,
|
|
93
83
|
value: ""
|
|
94
84
|
}
|
|
95
|
-
}),
|
|
96
|
-
}, [t.onChange]),
|
|
97
|
-
if (t?.onBlur?.(e), C(), D((i ??
|
|
98
|
-
const n =
|
|
99
|
-
n.isValid() &&
|
|
85
|
+
}), I(null), x(""), C();
|
|
86
|
+
}, [t.onChange]), me = (e) => {
|
|
87
|
+
if (t?.onBlur?.(e), C(), D((i ?? l()).format(r)), u(i ?? l()), m.size(E) !== 8) {
|
|
88
|
+
const n = l(m.toString(t?.value), r);
|
|
89
|
+
n.isValid() && x(n.format("DD/MM/YYYY"));
|
|
100
90
|
}
|
|
101
91
|
}, he = (e) => {
|
|
102
|
-
t?.onFocus?.(e), D((i ??
|
|
92
|
+
t?.onFocus?.(e), D((i ?? l()).format(r)), u(i ?? l()), !f && le && W();
|
|
103
93
|
}, be = (e) => {
|
|
104
|
-
|
|
94
|
+
R ? e.preventDefault() : t.onPaste?.(e);
|
|
105
95
|
}, Ce = (e) => {
|
|
106
|
-
|
|
96
|
+
R ? e.preventDefault() : t.onBeforeInput?.(e);
|
|
107
97
|
}, ke = (e) => {
|
|
108
|
-
if (t?.onKeyDown?.(e), g && e.key && !e.shiftKey && !e.altKey &&
|
|
98
|
+
if (t?.onKeyDown?.(e), g && e.key && !e.shiftKey && !e.altKey && Ve.includes(e.key))
|
|
109
99
|
switch (e.preventDefault(), e.key) {
|
|
110
|
-
case
|
|
100
|
+
case o.arrowLeft:
|
|
111
101
|
y(-1);
|
|
112
102
|
break;
|
|
113
|
-
case
|
|
103
|
+
case o.arrowRight:
|
|
114
104
|
y(1);
|
|
115
105
|
break;
|
|
116
|
-
case
|
|
106
|
+
case o.arrowUp:
|
|
117
107
|
y(-7);
|
|
118
108
|
break;
|
|
119
|
-
case
|
|
109
|
+
case o.arrowDown:
|
|
120
110
|
y(7);
|
|
121
111
|
break;
|
|
122
|
-
case
|
|
112
|
+
case o.pageUp:
|
|
123
113
|
Y();
|
|
124
114
|
break;
|
|
125
|
-
case
|
|
115
|
+
case o.pageDown:
|
|
126
116
|
L();
|
|
127
117
|
break;
|
|
128
|
-
case
|
|
118
|
+
case o.home:
|
|
129
119
|
U("start");
|
|
130
120
|
break;
|
|
131
|
-
case
|
|
121
|
+
case o.end:
|
|
132
122
|
U("end");
|
|
133
123
|
break;
|
|
134
|
-
case
|
|
124
|
+
case o.escape:
|
|
135
125
|
C();
|
|
136
126
|
break;
|
|
137
|
-
case
|
|
138
|
-
|
|
127
|
+
case o.enter:
|
|
128
|
+
V(l(m.toString(w), r));
|
|
139
129
|
break;
|
|
140
130
|
}
|
|
141
131
|
};
|
|
142
132
|
a.useEffect(() => {
|
|
143
|
-
const e = t?.value ?? null, n =
|
|
144
|
-
|
|
133
|
+
const e = t?.value ?? null, n = l(m.toString(e), r);
|
|
134
|
+
I(n.isValid() ? n : null), x(n.format(S));
|
|
145
135
|
}, [t?.value]);
|
|
146
136
|
const ge = {
|
|
147
|
-
label:
|
|
137
|
+
label: F,
|
|
148
138
|
inputFieldId: b,
|
|
149
|
-
activeDescendant:
|
|
139
|
+
activeDescendant: w,
|
|
150
140
|
calendarBoxOpen: g,
|
|
151
|
-
isReadOnly: !!
|
|
141
|
+
isReadOnly: !!f,
|
|
152
142
|
isDisabled: !!k,
|
|
153
143
|
skeletonize: c,
|
|
154
144
|
showCalendarButton: ne,
|
|
@@ -159,26 +149,26 @@ const Ne = a.forwardRef((t, j) => {
|
|
|
159
149
|
handleCloseCalendar: C,
|
|
160
150
|
handleNextMonth: Y,
|
|
161
151
|
handlePreviousMonth: L,
|
|
162
|
-
handleSelectDate:
|
|
152
|
+
handleSelectDate: V,
|
|
163
153
|
selectedDate: i,
|
|
164
154
|
unmaskedValue: E,
|
|
165
155
|
maskedValue: A,
|
|
166
|
-
showClearDateButton:
|
|
156
|
+
showClearDateButton: oe,
|
|
167
157
|
handleChangeCalendarBoxState: ue,
|
|
168
|
-
handleOnClickClearSelectedDate:
|
|
158
|
+
handleOnClickClearSelectedDate: fe,
|
|
169
159
|
calendarDisplayDate: ie,
|
|
170
160
|
calendarRef: N
|
|
171
161
|
};
|
|
172
162
|
return /* @__PURE__ */ O(a.Fragment, { children: [
|
|
173
|
-
/* @__PURE__ */ d(Ke.Provider, { value: ge, children: /* @__PURE__ */ O(
|
|
174
|
-
de && /* @__PURE__ */ d(
|
|
175
|
-
/* @__PURE__ */ O(
|
|
176
|
-
/* @__PURE__ */ d(
|
|
177
|
-
/* @__PURE__ */ d(
|
|
163
|
+
/* @__PURE__ */ d(Ke.Provider, { value: ge, children: /* @__PURE__ */ O(Be, { ref: P, "data-testid": "test-date-field-root", customClassWrapper: X, hasValidationErrors: v, children: [
|
|
164
|
+
de && /* @__PURE__ */ d(we, { "data-testid": "test-date-field-label", label: F, inputId: b, hint: t?.hint, isDisabled: k, isReadOnly: f, skeletonize: c, required: t?.required, hintPosition: M, themePopover: te, popoverAlign: ae, labelUppercase: ee, hasHintMessages: z, customClassLabel: Q }),
|
|
165
|
+
/* @__PURE__ */ O(Ie, { ref: T, skeletonize: c, customClassInputContainer: Z, children: [
|
|
166
|
+
/* @__PURE__ */ d(xe, { ...re, ref: Re(j, h), id: b, name: t?.name, value: A, readOnly: f, disabled: k, customClass: J, tabIndex: !f && !c ? 0 : -1, placeholder: se, "aria-activedescendant": w, "aria-expanded": g, "aria-controls": b, "aria-labelledby": b, "data-state-is-period-input": !1, "data-testid": "test-date-field-input", "data-state-error": v, "data-state-read-only": f, "data-state-text-align": _, "data-state-undigitable": R, "data-state-skeletonize": c, onBlur: me, onFocus: he, onPaste: be, onKeyDown: ke, onBeforeInput: Ce }),
|
|
167
|
+
/* @__PURE__ */ d(Fe, {})
|
|
178
168
|
] }),
|
|
179
|
-
g && ye(/* @__PURE__ */ d(
|
|
169
|
+
g && ye(/* @__PURE__ */ d(pe, { ref: N }), document.body),
|
|
180
170
|
M === "below" && /* @__PURE__ */ d(Oe, { customClass: "hint", description: t.hint, disabled: k, skeletonize: c, visible: z }),
|
|
181
|
-
|
|
171
|
+
v && /* @__PURE__ */ d("span", { "data-testid": "test-date-field-list-errors", className: "error", "data-state-skeletonize": c, "aria-describedby": String(t.name).concat("-errors"), children: p?.map((e, n) => /* @__PURE__ */ O(a.Fragment, { children: [
|
|
182
172
|
e,
|
|
183
173
|
" "
|
|
184
174
|
] }, `${n + 1}-${e}`)) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../src/lib/inputs2/date/datefield/base.tsx"],"sourcesContent":["import React from 'react';\nimport _ from 'lodash';\nimport { useIMask } from 'react-imask';\nimport { v1 as uuid } from 'uuid';\nimport { createPortal } from 'react-dom';\nimport moment, { type Moment } from 'moment';\nimport Hint from '../../../hint';\nimport { Tooltip } from '../../../tooltip';\nimport { mergeRefs } from '../../../form2/helpers';\nimport { Keys } from '../types';\nimport * as BaseDate from '../base';\nimport { NAVIGATION_KEYS, TOKEN_ISO_FORMAT, TOKEN_MASK, TOKEN_PTBR_FORMAT } from '../helpers';\nimport { Triggers } from './triggers';\nimport { CalendarBox } from './calendarbox';\nimport { DateFieldContext } from './context';\nimport type { DateFieldInputBaseProps } from './types';\n\nexport const InputBase = \n React.forwardRef<HTMLInputElement, DateFieldInputBaseProps>((props, ref) => {\n const {\n label, errors, tooltip, tooltipPosition, tooltipWidth, shouldCloseOnSelect = true, returnValueType = 'default',\n customClass = '', customClassLabel = '', customClassWrapper = '', customClassInputContainer = '', textAlign = 'left',\n labelUppercase = false, skeletonize = false, hintPosition = 'below', themePopover = 'light',\n popoverAlign = 'left', showCalendarButton = true, openCalendarOnFocus = true, undigitable = false, \n showClearDateButton = true, placeholder = TOKEN_PTBR_FORMAT, readOnly, disabled, ...rest\n } = props;\n const [calendarBoxOpen, setCalendarBoxOpen] = React.useState(false);\n const [activeDescendant, setActiveDescendant] = React.useState<string>(\n moment().format(TOKEN_ISO_FORMAT),\n );\n const [selectedDate, setSelectedDate] = React.useState<Moment | null>(null);\n const [calendarDisplayDate, setCalendarDisplayDate] = React.useState<Moment>(\n selectedDate ?? moment(),\n );\n const calendarRef = React.useRef<HTMLDivElement | null>(null);\n const inputRootRef = React.useRef<HTMLInputElement | null>(null);\n const dateInputRef = React.useRef<HTMLInputElement | null>(null);\n const dateContainerRef = React.useRef<HTMLDivElement | null>(null);\n\n const { setValue: setMaskValue, unmaskedValue, value: maskedValue } = useIMask(\n { mask: TOKEN_MASK, lazy: false, placeholderChar: '_' },\n {\n ref: dateInputRef,\n defaultValue: selectedDate?.format(TOKEN_PTBR_FORMAT),\n onComplete: (value) => {\n const date = moment(value, TOKEN_PTBR_FORMAT);\n if (date.isValid()) { handleUpdateDateState(date); }\n },\n },\n );\n\n const inputId = React.useMemo(() => props.id || props.name || uuid(), [props.id, props.name]);\n const hasLabel = !_.isEmpty(props?.label);\n const hasHintMessages = Boolean(props.hint?.length);\n const hasValidationErrors = Boolean(errors?.length);\n const hasValidDateSelected = !_.isEmpty(props?.value);\n\n const handleUpdateDateState = React.useCallback((date: Moment) => {\n const nonIsoDateFormat = date.format(TOKEN_ISO_FORMAT);\n const isoDateFormat = date.toISOString();\n setSelectedDate(date.clone());\n setCalendarDisplayDate(date.clone());\n props.onChange?.({\n target: {\n name: props.name,\n value: returnValueType === 'default' ? nonIsoDateFormat : isoDateFormat,\n },\n } as React.ChangeEvent<HTMLInputElement>);\n if (shouldCloseOnSelect) handleCloseCalendar();\n }, [selectedDate, props.name, props.onChange, shouldCloseOnSelect]);\n\n const handleOpenCalendar = React.useCallback(() => setCalendarBoxOpen(true), []);\n const handleCloseCalendar = React.useCallback(() => setCalendarBoxOpen(false), []);\n const handleNextMonth = React.useCallback(() => setCalendarDisplayDate(prevDisplayDate =>\n prevDisplayDate.clone().add(1, 'month')), []);\n const handlePreviousMonth = React.useCallback(() => setCalendarDisplayDate(prevDisplayDate =>\n prevDisplayDate.clone().subtract(1, 'month')), []);\n const handleChangeCalendarBoxState = React.useCallback(() => {\n setCalendarBoxOpen((prevState) => {\n if (dateInputRef.current !== document.activeElement) {\n dateInputRef?.current?.focus?.();\n }\n return !prevState;\n });\n }, []);\n const handleNavigateWithDays = React.useCallback((offset: number) => {\n setCalendarDisplayDate((prevDisplayDate) => {\n const daySelected = prevDisplayDate.clone().add(offset, 'day');\n setActiveDescendant(daySelected.format(TOKEN_ISO_FORMAT));\n return daySelected;\n });\n }, []);\n const handleNavigateWithWeeks = React.useCallback((when: 'start' | 'end') => {\n setCalendarDisplayDate((prevDisplayDate) => {\n let daySelected = prevDisplayDate;\n if (when === 'end') daySelected = prevDisplayDate.clone().endOf('week');\n if (when === 'start') daySelected = prevDisplayDate.clone().startOf('week');\n setActiveDescendant(daySelected.format(TOKEN_ISO_FORMAT));\n return daySelected;\n });\n }, []);\n\n const handleOnClickClearSelectedDate = React.useCallback(() => {\n props.onChange?.({\n target: { name: props.name, value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n setSelectedDate(null);\n setMaskValue('');\n handleCloseCalendar();\n }, [props.onChange]);\n\n const handleOnBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n props?.onBlur?.(event);\n handleCloseCalendar();\n setActiveDescendant((selectedDate ?? moment()).format(TOKEN_ISO_FORMAT));\n setCalendarDisplayDate(selectedDate ?? moment());\n if (_.size(unmaskedValue) !== 8) {\n const date = moment(_.toString(props?.value), TOKEN_ISO_FORMAT);\n if (date.isValid()) { setMaskValue(date.format('DD/MM/YYYY')); }\n }\n };\n\n const handleOnFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n props?.onFocus?.(event);\n setActiveDescendant((selectedDate ?? moment()).format(TOKEN_ISO_FORMAT));\n setCalendarDisplayDate(selectedDate ?? moment());\n if (!readOnly && openCalendarOnFocus) {\n handleOpenCalendar();\n }\n };\n\n const handleOnPaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n if (undigitable) {\n event.preventDefault();\n } else {\n props.onPaste?.(event);\n }\n };\n\n const handleOnBeforeInput = (event: React.InputEvent<HTMLInputElement>) => {\n if (undigitable) {\n event.preventDefault();\n } else {\n props.onBeforeInput?.(event);\n }\n };\n\n const handleOnKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n props?.onKeyDown?.(event);\n if (calendarBoxOpen && event.key && !event.shiftKey && \n !event.altKey && NAVIGATION_KEYS.includes(event.key)) {\n event.preventDefault();\n switch (event.key) {\n case Keys.arrowLeft: handleNavigateWithDays(-1);\n break;\n case Keys.arrowRight: handleNavigateWithDays(1);\n break;\n case Keys.arrowUp: handleNavigateWithDays(-7);\n break;\n case Keys.arrowDown: handleNavigateWithDays(7);\n break;\n case Keys.pageUp: handleNextMonth();\n break;\n case Keys.pageDown: handlePreviousMonth();\n break;\n case Keys.home: handleNavigateWithWeeks('start');\n break;\n case Keys.end: handleNavigateWithWeeks('end');\n break;\n case Keys.escape: handleCloseCalendar();\n break;\n case Keys.enter: handleUpdateDateState(\n moment(_.toString(activeDescendant), TOKEN_ISO_FORMAT),\n );\n break;\n default:\n break;\n }\n }\n };\n\n React.useEffect(() => {\n const currentValue = props?.value ?? null;\n const date = moment(_.toString(currentValue), TOKEN_ISO_FORMAT);\n setSelectedDate(date.isValid() ? date : null);\n setMaskValue(date.format(TOKEN_PTBR_FORMAT));\n }, [props?.value]);\n\n const contextValues = ({\n label, inputFieldId: inputId, activeDescendant, calendarBoxOpen, \n isReadOnly: Boolean(readOnly), isDisabled: Boolean(disabled), skeletonize, showCalendarButton,\n hasValidDateSelected, dateInputRef, dateContainerRef, handleOpenCalendar, \n handleCloseCalendar, handleNextMonth, handlePreviousMonth, \n handleSelectDate: handleUpdateDateState, selectedDate, unmaskedValue, maskedValue, \n showClearDateButton, handleChangeCalendarBoxState, handleOnClickClearSelectedDate,\n calendarDisplayDate, calendarRef,\n });\n\n return (\n <React.Fragment>\n <DateFieldContext.Provider value={contextValues}>\n <BaseDate.Root\n ref={inputRootRef}\n data-testid=\"test-date-field-root\"\n customClassWrapper={customClassWrapper}\n hasValidationErrors={hasValidationErrors}>\n {hasLabel && (\n <BaseDate.Label\n data-testid=\"test-date-field-label\"\n label={label}\n inputId={inputId}\n hint={props?.hint}\n isDisabled={disabled}\n isReadOnly={readOnly}\n skeletonize={skeletonize}\n required={props?.required}\n hintPosition={hintPosition}\n themePopover={themePopover}\n popoverAlign={popoverAlign}\n labelUppercase={labelUppercase}\n hasHintMessages={hasHintMessages}\n customClassLabel={customClassLabel} />\n )}\n <BaseDate.Container\n ref={dateContainerRef}\n skeletonize={skeletonize}\n customClassInputContainer={customClassInputContainer}>\n <BaseDate.Input\n {...rest}\n ref={mergeRefs(ref, dateInputRef)}\n id={inputId}\n name={props?.name}\n value={maskedValue}\n readOnly={readOnly}\n disabled={disabled}\n customClass={customClass}\n tabIndex={(!readOnly && !skeletonize) ? 0 : -1}\n placeholder={placeholder}\n aria-activedescendant={activeDescendant}\n aria-expanded={calendarBoxOpen}\n aria-controls={inputId}\n aria-labelledby={inputId}\n data-state-is-period-input={false}\n data-testid=\"test-date-field-input\"\n data-state-error={hasValidationErrors}\n data-state-read-only={readOnly}\n data-state-text-align={textAlign}\n data-state-undigitable={undigitable}\n data-state-skeletonize={skeletonize}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n onPaste={handleOnPaste}\n onKeyDown={handleOnKeyDown}\n onBeforeInput={handleOnBeforeInput} />\n <Triggers />\n </BaseDate.Container>\n {calendarBoxOpen &&\n createPortal(<CalendarBox ref={calendarRef} />, document.body)\n }\n {hintPosition === 'below' && (\n <Hint\n customClass=\"hint\"\n description={props.hint}\n disabled={disabled}\n skeletonize={skeletonize}\n visible={hasHintMessages} />\n )}\n {hasValidationErrors && (\n <span\n data-testid=\"test-date-field-list-errors\"\n className=\"error\"\n data-state-skeletonize={skeletonize}\n aria-describedby={String(props.name).concat('-errors')}>\n {errors?.map((error, index) => (\n <React.Fragment key={`${index + 1}-${error}`}>\n {error}\n {' '}\n </React.Fragment>\n ))}\n </span>\n )}\n </BaseDate.Root>\n </DateFieldContext.Provider>\n <Tooltip\n targetRef={inputRootRef}\n text={tooltip}\n width={tooltipWidth}\n position={tooltipPosition} />\n </React.Fragment>\n );\n });\n\nInputBase.displayName = 'DateFieldInputBase';\n"],"names":["InputBase","React","forwardRef","props","ref","label","errors","tooltip","tooltipPosition","tooltipWidth","shouldCloseOnSelect","returnValueType","customClass","customClassLabel","customClassWrapper","customClassInputContainer","textAlign","labelUppercase","skeletonize","hintPosition","themePopover","popoverAlign","showCalendarButton","openCalendarOnFocus","undigitable","showClearDateButton","placeholder","TOKEN_PTBR_FORMAT","readOnly","disabled","rest","calendarBoxOpen","setCalendarBoxOpen","useState","activeDescendant","setActiveDescendant","moment","format","TOKEN_ISO_FORMAT","selectedDate","setSelectedDate","calendarDisplayDate","setCalendarDisplayDate","calendarRef","useRef","inputRootRef","dateInputRef","dateContainerRef","setValue","setMaskValue","unmaskedValue","value","maskedValue","useIMask","mask","TOKEN_MASK","lazy","placeholderChar","defaultValue","onComplete","date","isValid","handleUpdateDateState","inputId","useMemo","id","name","uuid","hasLabel","_","isEmpty","hasHintMessages","Boolean","hint","length","hasValidationErrors","hasValidDateSelected","useCallback","nonIsoDateFormat","isoDateFormat","toISOString","clone","onChange","target","handleCloseCalendar","handleOpenCalendar","handleNextMonth","prevDisplayDate","add","handlePreviousMonth","subtract","handleChangeCalendarBoxState","prevState","current","document","activeElement","focus","handleNavigateWithDays","offset","daySelected","handleNavigateWithWeeks","when","endOf","startOf","handleOnClickClearSelectedDate","handleOnBlur","event","onBlur","size","toString","handleOnFocus","onFocus","handleOnPaste","preventDefault","onPaste","handleOnBeforeInput","onBeforeInput","handleOnKeyDown","onKeyDown","key","shiftKey","altKey","NAVIGATION_KEYS","includes","Keys","arrowLeft","arrowRight","arrowUp","arrowDown","pageUp","pageDown","home","end","escape","enter","useEffect","currentValue","contextValues","inputFieldId","isReadOnly","isDisabled","handleSelectDate","jsxs","jsx","DateFieldContext","BaseDate.Root","BaseDate.Label","required","BaseDate.Container","BaseDate.Input","mergeRefs","Triggers","createPortal","CalendarBox","body","Hint","String","concat","map","error","index","Tooltip","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAiBO,MAAMA,KACXC,EAAMC,WAAsD,CAACC,GAAOC,MAAQ;AAC1E,QAAM;AAAA,IACJC,OAAAA;AAAAA,IAAOC,QAAAA;AAAAA,IAAQC,SAAAA;AAAAA,IAASC,iBAAAA;AAAAA,IAAiBC,cAAAA;AAAAA,IAAcC,qBAAAA,IAAsB;AAAA,IAAMC,iBAAAA,IAAkB;AAAA,IACrGC,aAAAA,IAAc;AAAA,IAAIC,kBAAAA,IAAmB;AAAA,IAAIC,oBAAAA,IAAqB;AAAA,IAAIC,2BAAAA,IAA4B;AAAA,IAAIC,WAAAA,IAAY;AAAA,IAC9GC,gBAAAA,KAAiB;AAAA,IAAOC,aAAAA,IAAc;AAAA,IAAOC,cAAAA,IAAe;AAAA,IAASC,cAAAA,KAAe;AAAA,IACpFC,cAAAA,KAAe;AAAA,IAAQC,oBAAAA,KAAqB;AAAA,IAAMC,qBAAAA,KAAsB;AAAA,IAAMC,aAAAA,IAAc;AAAA,IAC5FC,qBAAAA,KAAsB;AAAA,IAAMC,aAAAA,KAAcC;AAAAA,IAAmBC,UAAAA;AAAAA,IAAUC,UAAAA;AAAAA,IAAU,GAAGC;AAAAA,EAAAA,IAClF3B,GACE,CAAC4B,GAAiBC,CAAkB,IAAI/B,EAAMgC,SAAS,EAAK,GAC5D,CAACC,GAAkBC,CAAmB,IAAIlC,EAAMgC,SACpDG,EAAAA,EAASC,OAAOC,CAAgB,CAClC,GACM,CAACC,GAAcC,CAAe,IAAIvC,EAAMgC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,GACA,UAAW,CAACgB,KAAY,CAACV,IAAe,IAAI,IAC5C,aAAAQ,IACA,yBAAuBQ,GACvB,iBAAeH,GACf,iBAAegC,GACf,mBAAiBA,GACjB,8BAA4B,IAC5B,eAAY,yBACZ,oBAAkBY,GAClB,wBAAsB/C,GACtB,yBAAuBZ,GACvB,0BAAwBQ,GACxB,0BAAwBN,GACxB,QAAQuF,IACR,SAASK,IACT,SAASE,IACT,WAAWK,IACX,eAAeF,GAAAA,CAAoB;AAAA,0BACpCoC,IAAA,CAAA,CAAQ;AAAA,MAAA,GACX;AAAA,MACCxH,KACCyH,GAAa,gBAAAT,EAACU,IAAA,EAAY,KAAK9G,EAAAA,CAAY,GAAKmD,SAAS4D,IAAI;AAAA,MAE9DvI,MAAiB,WAClB,gBAAA4H,EAACY,IAAA,EACC,aAAY,QACZ,aAAaxJ,EAAMsE,MACnB,UAAA5C,GACA,aAAAX,GACA,SAASqD,EAAAA,CAAgB;AAAA,MAE1BI,KACD,gBAAAoE,EAAC,QAAA,EACC,eAAY,+BACZ,WAAU,SACV,0BAAwB7H,GACxB,oBAAkB0I,OAAOzJ,EAAM+D,IAAI,EAAE2F,OAAO,SAAS,GACpDvJ,UAAAA,GAAQwJ,IAAI,CAACC,GAAOC,MACnB,gBAAAlB,EAAC7I,EAAM,UAAN,EACE8J,UAAAA;AAAAA,QAAAA;AAAAA,QACA;AAAA,MAAA,EAAA,GAFkB,GAAGC,IAAQ,CAAC,IAAID,CAAK,EAG1C,CACD,EAAA,CACH;AAAA,IAAA,EAAA,CAEF,EAAA,CACF;AAAA,IACA,gBAAAhB,EAACkB,MACC,WAAWpH,GACX,MAAMtC,GACN,OAAOE,GACP,UAAUD,EAAAA,CAAgB;AAAA,EAAA,GAC9B;AAEJ,CAAC;AAEHR,GAAUkK,cAAc;"}
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../src/lib/inputs2/date/datefield/base.tsx"],"sourcesContent":["import React from 'react';\nimport _ from 'lodash';\nimport { useIMask } from 'react-imask';\nimport { v1 as uuid } from 'uuid';\nimport { createPortal } from 'react-dom';\nimport moment, { type Moment } from 'moment';\nimport Hint from '../../../hint';\nimport { Tooltip } from '../../../tooltip';\nimport { mergeRefs } from '../../../form2/helpers';\nimport { Keys } from '../types';\nimport * as BaseDate from '../base';\nimport { NAVIGATION_KEYS, TOKEN_ISO_FORMAT, TOKEN_MASK, TOKEN_PTBR_FORMAT } from '../helpers';\nimport { Triggers } from './triggers';\nimport { CalendarBox } from './calendarbox';\nimport { DateFieldContext } from './context';\nimport type { DateFieldInputBaseProps } from './types';\n\nexport const InputBase = \n React.forwardRef<HTMLInputElement, DateFieldInputBaseProps>((props, ref) => {\n const {\n label, errors, tooltip, tooltipPosition, tooltipWidth, shouldCloseOnSelect = true, returnValueType = 'default',\n customClass = '', customClassLabel = '', customClassWrapper = '', customClassInputContainer = '', textAlign = 'left',\n labelUppercase = false, skeletonize = false, hintPosition = 'below', themePopover = 'light',\n popoverAlign = 'left', showCalendarButton = true, openCalendarOnFocus = true, undigitable = false, \n showClearDateButton = true, placeholder = TOKEN_PTBR_FORMAT, readOnly, disabled, ...rest\n } = props;\n const [calendarBoxOpen, setCalendarBoxOpen] = React.useState(false);\n const [activeDescendant, setActiveDescendant] = React.useState<string>(\n moment().format(TOKEN_ISO_FORMAT),\n );\n const [selectedDate, setSelectedDate] = React.useState<Moment | null>(null);\n const [calendarDisplayDate, setCalendarDisplayDate] = React.useState<Moment>(\n selectedDate ?? moment(),\n );\n const calendarRef = React.useRef<HTMLDivElement | null>(null);\n const inputRootRef = React.useRef<HTMLInputElement | null>(null);\n const dateInputRef = React.useRef<HTMLInputElement | null>(null);\n const dateContainerRef = React.useRef<HTMLDivElement | null>(null);\n\n const { setValue: setMaskValue, unmaskedValue, value: maskedValue } = useIMask(\n { mask: TOKEN_MASK, lazy: false, placeholderChar: '_' },\n {\n ref: dateInputRef,\n defaultValue: selectedDate?.format(TOKEN_PTBR_FORMAT),\n onComplete: (value) => {\n const date = moment(value, TOKEN_PTBR_FORMAT);\n if (date.isValid()) { handleUpdateDateState(date); }\n },\n },\n );\n\n const inputId = React.useMemo(() => props.id || props.name || uuid(), [props.id, props.name]);\n const hasLabel = !_.isEmpty(props?.label);\n const hasHintMessages = Boolean(props.hint?.length);\n const hasValidationErrors = Boolean(errors?.length);\n const hasValidDateSelected = !_.isEmpty(props?.value);\n\n const handleUpdateDateState = React.useCallback((date: Moment) => {\n const nonIsoDateFormat = date.format(TOKEN_ISO_FORMAT);\n const isoDateFormat = date.toISOString();\n setSelectedDate(date.clone());\n setCalendarDisplayDate(date.clone());\n props.onChange?.({\n target: {\n name: props.name,\n value: returnValueType === 'default' ? nonIsoDateFormat : isoDateFormat,\n },\n } as React.ChangeEvent<HTMLInputElement>);\n if (shouldCloseOnSelect) handleCloseCalendar();\n }, [selectedDate, props.name, props.onChange, shouldCloseOnSelect]);\n\n const handleOpenCalendar = React.useCallback(() => setCalendarBoxOpen(true), []);\n const handleCloseCalendar = React.useCallback(() => setCalendarBoxOpen(false), []);\n const handleNextMonth = React.useCallback(() => setCalendarDisplayDate(prevDisplayDate =>\n prevDisplayDate.clone().add(1, 'month')), []);\n const handlePreviousMonth = React.useCallback(() => setCalendarDisplayDate(prevDisplayDate =>\n prevDisplayDate.clone().subtract(1, 'month')), []);\n const handleChangeCalendarBoxState = React.useCallback(() => {\n setCalendarBoxOpen((prevState) => {\n if (dateInputRef.current !== document.activeElement) {\n dateInputRef?.current?.focus?.();\n }\n return !prevState;\n });\n }, []);\n const handleNavigateWithDays = React.useCallback((offset: number) => {\n setCalendarDisplayDate((prevDisplayDate) => {\n const daySelected = prevDisplayDate.clone().add(offset, 'day');\n setActiveDescendant(daySelected.format(TOKEN_ISO_FORMAT));\n return daySelected;\n });\n }, []);\n const handleNavigateWithWeeks = React.useCallback((when: 'start' | 'end') => {\n setCalendarDisplayDate((prevDisplayDate) => {\n let daySelected = prevDisplayDate;\n if (when === 'end') daySelected = prevDisplayDate.clone().endOf('week');\n if (when === 'start') daySelected = prevDisplayDate.clone().startOf('week');\n setActiveDescendant(daySelected.format(TOKEN_ISO_FORMAT));\n return daySelected;\n });\n }, []);\n\n const handleOnClickClearSelectedDate = React.useCallback(() => {\n props.onChange?.({\n target: { name: props.name, value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n setSelectedDate(null);\n setMaskValue('');\n handleCloseCalendar();\n }, [props.onChange]);\n\n const handleOnBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n props?.onBlur?.(event);\n handleCloseCalendar();\n setActiveDescendant((selectedDate ?? moment()).format(TOKEN_ISO_FORMAT));\n setCalendarDisplayDate(selectedDate ?? moment());\n if (_.size(unmaskedValue) !== 8) {\n const date = moment(_.toString(props?.value), TOKEN_ISO_FORMAT);\n if (date.isValid()) { setMaskValue(date.format('DD/MM/YYYY')); }\n }\n };\n\n const handleOnFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n props?.onFocus?.(event);\n setActiveDescendant((selectedDate ?? moment()).format(TOKEN_ISO_FORMAT));\n setCalendarDisplayDate(selectedDate ?? moment());\n if (!readOnly && openCalendarOnFocus) {\n handleOpenCalendar();\n }\n };\n\n const handleOnPaste = (event: React.ClipboardEvent<HTMLInputElement>) => {\n if (undigitable) {\n event.preventDefault();\n } else {\n props.onPaste?.(event);\n }\n };\n\n const handleOnBeforeInput = (event: React.InputEvent<HTMLInputElement>) => {\n if (undigitable) {\n event.preventDefault();\n } else {\n props.onBeforeInput?.(event);\n }\n };\n\n const handleOnKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n props?.onKeyDown?.(event);\n if (calendarBoxOpen && event.key && !event.shiftKey && \n !event.altKey && NAVIGATION_KEYS.includes(event.key)) {\n event.preventDefault();\n switch (event.key) {\n case Keys.arrowLeft: handleNavigateWithDays(-1);\n break;\n case Keys.arrowRight: handleNavigateWithDays(1);\n break;\n case Keys.arrowUp: handleNavigateWithDays(-7);\n break;\n case Keys.arrowDown: handleNavigateWithDays(7);\n break;\n case Keys.pageUp: handleNextMonth();\n break;\n case Keys.pageDown: handlePreviousMonth();\n break;\n case Keys.home: handleNavigateWithWeeks('start');\n break;\n case Keys.end: handleNavigateWithWeeks('end');\n break;\n case Keys.escape: handleCloseCalendar();\n break;\n case Keys.enter: handleUpdateDateState(\n moment(_.toString(activeDescendant), TOKEN_ISO_FORMAT),\n );\n break;\n default:\n break;\n }\n }\n };\n\n React.useEffect(() => {\n const currentValue = props?.value ?? null;\n const date = moment(_.toString(currentValue), TOKEN_ISO_FORMAT);\n setSelectedDate(date.isValid() ? date : null);\n setMaskValue(date.format(TOKEN_PTBR_FORMAT));\n }, [props?.value]);\n\n const contextValues = ({\n label, inputFieldId: inputId, activeDescendant, calendarBoxOpen, \n isReadOnly: Boolean(readOnly), isDisabled: Boolean(disabled), skeletonize, showCalendarButton,\n hasValidDateSelected, dateInputRef, dateContainerRef, handleOpenCalendar, \n handleCloseCalendar, handleNextMonth, handlePreviousMonth, \n handleSelectDate: handleUpdateDateState, selectedDate, unmaskedValue, maskedValue, \n showClearDateButton, handleChangeCalendarBoxState, handleOnClickClearSelectedDate,\n calendarDisplayDate, calendarRef,\n });\n\n return (\n <React.Fragment>\n <DateFieldContext.Provider value={contextValues}>\n <BaseDate.Root\n ref={inputRootRef}\n data-testid=\"test-date-field-root\"\n customClassWrapper={customClassWrapper}\n hasValidationErrors={hasValidationErrors}>\n {hasLabel && (\n <BaseDate.Label\n data-testid=\"test-date-field-label\"\n label={label}\n inputId={inputId}\n hint={props?.hint}\n isDisabled={disabled}\n isReadOnly={readOnly}\n skeletonize={skeletonize}\n required={props?.required}\n hintPosition={hintPosition}\n themePopover={themePopover}\n popoverAlign={popoverAlign}\n labelUppercase={labelUppercase}\n hasHintMessages={hasHintMessages}\n customClassLabel={customClassLabel} />\n )}\n <BaseDate.Container\n ref={dateContainerRef}\n skeletonize={skeletonize}\n customClassInputContainer={customClassInputContainer}>\n <BaseDate.Input\n {...rest}\n ref={mergeRefs(ref, dateInputRef)}\n id={inputId}\n name={props?.name}\n value={maskedValue}\n readOnly={readOnly}\n disabled={disabled}\n customClass={customClass}\n tabIndex={(!readOnly && !skeletonize) ? 0 : -1}\n placeholder={placeholder}\n aria-activedescendant={activeDescendant}\n aria-expanded={calendarBoxOpen}\n aria-controls={inputId}\n aria-labelledby={inputId}\n data-state-is-period-input={false}\n data-testid=\"test-date-field-input\"\n data-state-error={hasValidationErrors}\n data-state-read-only={readOnly}\n data-state-text-align={textAlign}\n data-state-undigitable={undigitable}\n data-state-skeletonize={skeletonize}\n onBlur={handleOnBlur}\n onFocus={handleOnFocus}\n onPaste={handleOnPaste}\n onKeyDown={handleOnKeyDown}\n onBeforeInput={handleOnBeforeInput} />\n <Triggers />\n </BaseDate.Container>\n {calendarBoxOpen &&\n createPortal(<CalendarBox ref={calendarRef} />, document.body)\n }\n {hintPosition === 'below' && (\n <Hint\n customClass=\"hint\"\n description={props.hint}\n disabled={disabled}\n skeletonize={skeletonize}\n visible={hasHintMessages} />\n )}\n {hasValidationErrors && (\n <span\n data-testid=\"test-date-field-list-errors\"\n className=\"error\"\n data-state-skeletonize={skeletonize}\n aria-describedby={String(props.name).concat('-errors')}>\n {errors?.map((error, index) => (\n <React.Fragment key={`${index + 1}-${error}`}>\n {error}\n {' '}\n </React.Fragment>\n ))}\n </span>\n )}\n </BaseDate.Root>\n </DateFieldContext.Provider>\n <Tooltip\n targetRef={inputRootRef}\n text={tooltip}\n width={tooltipWidth}\n position={tooltipPosition} />\n </React.Fragment>\n );\n });\n\nInputBase.displayName = 'DateFieldInputBase';\n"],"names":["InputBase","React","forwardRef","props","ref","label","errors","tooltip","tooltipPosition","tooltipWidth","shouldCloseOnSelect","returnValueType","customClass","customClassLabel","customClassWrapper","customClassInputContainer","textAlign","labelUppercase","skeletonize","hintPosition","themePopover","popoverAlign","showCalendarButton","openCalendarOnFocus","undigitable","showClearDateButton","placeholder","TOKEN_PTBR_FORMAT","readOnly","disabled","rest","calendarBoxOpen","setCalendarBoxOpen","useState","activeDescendant","setActiveDescendant","moment","format","TOKEN_ISO_FORMAT","selectedDate","setSelectedDate","calendarDisplayDate","setCalendarDisplayDate","calendarRef","useRef","inputRootRef","dateInputRef","dateContainerRef","setValue","setMaskValue","unmaskedValue","value","maskedValue","useIMask","mask","TOKEN_MASK","lazy","placeholderChar","defaultValue","onComplete","date","isValid","handleUpdateDateState","inputId","useMemo","id","name","uuid","hasLabel","_","isEmpty","hasHintMessages","Boolean","hint","length","hasValidationErrors","hasValidDateSelected","useCallback","nonIsoDateFormat","isoDateFormat","toISOString","clone","onChange","target","handleCloseCalendar","handleOpenCalendar","handleNextMonth","prevDisplayDate","add","handlePreviousMonth","subtract","handleChangeCalendarBoxState","prevState","current","document","activeElement","focus","handleNavigateWithDays","offset","daySelected","handleNavigateWithWeeks","when","endOf","startOf","handleOnClickClearSelectedDate","handleOnBlur","event","onBlur","size","toString","handleOnFocus","onFocus","handleOnPaste","preventDefault","onPaste","handleOnBeforeInput","onBeforeInput","handleOnKeyDown","onKeyDown","key","shiftKey","altKey","NAVIGATION_KEYS","includes","Keys","arrowLeft","arrowRight","arrowUp","arrowDown","pageUp","pageDown","home","end","escape","enter","useEffect","currentValue","contextValues","inputFieldId","isReadOnly","isDisabled","handleSelectDate","jsxs","jsx","DateFieldContext","BaseDate.Root","BaseDate.Label","required","BaseDate.Container","BaseDate.Input","mergeRefs","Triggers","createPortal","CalendarBox","body","Hint","String","concat","map","error","index","Tooltip","displayName"],"mappings":";;;;;;;;;;;;;;;;AAiBO,MAAMA,KACXC,EAAMC,WAAsD,CAACC,GAAOC,MAAQ;AAC1E,QAAM;AAAA,IACJC,OAAAA;AAAAA,IAAOC,QAAAA;AAAAA,IAAQC,SAAAA;AAAAA,IAASC,iBAAAA;AAAAA,IAAiBC,cAAAA;AAAAA,IAAcC,qBAAAA,IAAsB;AAAA,IAAMC,iBAAAA,IAAkB;AAAA,IACrGC,aAAAA,IAAc;AAAA,IAAIC,kBAAAA,IAAmB;AAAA,IAAIC,oBAAA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