linear-react-components-ui 1.1.26-beta.21 → 1.1.26-beta.22
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/assets/styles/datepicker2.css +1 -1
- package/lib/assets/styles/dialog.css +1 -1
- package/lib/assets/styles/drawers.css +1 -1
- package/lib/assets/styles/gridlayout.css +1 -1
- package/lib/assets/styles/selectfield.css +1 -1
- package/lib/assets/styles/textfield.css +1 -1
- package/lib/assets/styles/tooltip.css +1 -1
- package/lib/dialog/base/index.js +53 -55
- package/lib/dialog/base/index.js.map +1 -1
- package/lib/dialog/form/index.js +56 -55
- package/lib/dialog/form/index.js.map +1 -1
- package/lib/drawer/Drawer.js +7 -7
- package/lib/drawer/Drawer.js.map +1 -1
- package/lib/drawer/index.js +1 -1
- package/lib/drawer/index.js.map +1 -1
- package/lib/form2/types.d.ts +9 -4
- package/lib/form2/useForm/index.js +96 -89
- package/lib/form2/useForm/index.js.map +1 -1
- package/lib/icons/helper.d.ts +12 -0
- package/lib/icons/helper.js +12 -0
- package/lib/icons/helper.js.map +1 -1
- package/lib/inputs/date/index.js +59 -61
- package/lib/inputs/date/index.js.map +1 -1
- package/lib/inputs2/checkboxfield/base.d.ts +27 -0
- package/lib/inputs2/checkboxfield/base.js +100 -0
- package/lib/inputs2/checkboxfield/base.js.map +1 -0
- package/lib/inputs2/checkboxfield/index.d.ts +4 -25
- package/lib/inputs2/checkboxfield/index.js +41 -108
- package/lib/inputs2/checkboxfield/index.js.map +1 -1
- package/lib/inputs2/date/datefield/base.d.ts +3 -0
- package/lib/inputs2/date/datefield/base.js +193 -0
- package/lib/inputs2/date/datefield/base.js.map +1 -0
- package/lib/inputs2/date/datefield/index.d.ts +2 -1
- package/lib/inputs2/date/datefield/index.js +42 -312
- package/lib/inputs2/date/datefield/index.js.map +1 -1
- package/lib/inputs2/date/datefield/types.d.ts +6 -4
- package/lib/inputs2/date/dateperiodfield/base.d.ts +3 -0
- package/lib/inputs2/date/dateperiodfield/base.js +511 -0
- package/lib/inputs2/date/dateperiodfield/base.js.map +1 -0
- package/lib/inputs2/date/dateperiodfield/index.d.ts +2 -1
- package/lib/inputs2/date/dateperiodfield/index.js +42 -517
- package/lib/inputs2/date/dateperiodfield/index.js.map +1 -1
- package/lib/inputs2/date/dateperiodfield/types.d.ts +6 -4
- package/lib/inputs2/mask/Cnpj.d.ts +1 -3
- package/lib/inputs2/mask/Cnpj.js +38 -44
- package/lib/inputs2/mask/Cnpj.js.map +1 -1
- package/lib/inputs2/mask/Cpf.d.ts +0 -1
- package/lib/inputs2/mask/Cpf.js +32 -42
- package/lib/inputs2/mask/Cpf.js.map +1 -1
- package/lib/inputs2/numberfield/index.js +85 -68
- package/lib/inputs2/numberfield/index.js.map +1 -1
- package/lib/inputs2/radiofield/base.d.ts +3 -0
- package/lib/inputs2/radiofield/base.js +115 -0
- package/lib/inputs2/radiofield/base.js.map +1 -0
- package/lib/inputs2/radiofield/index.d.ts +2 -1
- package/lib/inputs2/radiofield/index.js +41 -108
- package/lib/inputs2/radiofield/index.js.map +1 -1
- package/lib/inputs2/radiofield/types.d.ts +5 -2
- package/lib/inputs2/selectfield/base.d.ts +3 -0
- package/lib/inputs2/selectfield/base.js +411 -0
- package/lib/inputs2/selectfield/base.js.map +1 -0
- package/lib/inputs2/selectfield/index.d.ts +3 -3
- package/lib/inputs2/selectfield/index.js +49 -404
- package/lib/inputs2/selectfield/index.js.map +1 -1
- package/lib/inputs2/selectfield/listbox.d.ts +0 -1
- package/lib/inputs2/selectfield/listbox.js +33 -34
- package/lib/inputs2/selectfield/listbox.js.map +1 -1
- package/lib/inputs2/selectfield/types.d.ts +8 -7
- package/lib/inputs2/selectfield/types.js.map +1 -1
- package/lib/inputs2/textareafield/base.d.ts +23 -0
- package/lib/inputs2/textareafield/base.js +137 -0
- package/lib/inputs2/textareafield/base.js.map +1 -0
- package/lib/inputs2/textareafield/index.d.ts +4 -22
- package/lib/inputs2/textareafield/index.js +45 -130
- package/lib/inputs2/textareafield/index.js.map +1 -1
- package/lib/inputs2/textfield/base.d.ts +23 -0
- package/lib/inputs2/textfield/base.js +107 -0
- package/lib/inputs2/textfield/base.js.map +1 -0
- package/lib/inputs2/textfield/index.d.ts +4 -22
- package/lib/inputs2/textfield/index.js +45 -103
- package/lib/inputs2/textfield/index.js.map +1 -1
- package/lib/tooltip/types.d.ts +4 -1
- package/lib/tooltip/useTooltip.js +68 -86
- package/lib/tooltip/useTooltip.js.map +1 -1
- package/package.json +1 -1
- package/lib/inputs2/selectfield/simple.d.ts +0 -9
- package/lib/inputs2/selectfield/simple.js +0 -24
- package/lib/inputs2/selectfield/simple.js.map +0 -1
|
@@ -1,114 +1,47 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
1
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
2
|
+
import { c as N } from "../../_virtual/compiler-runtime.js";
|
|
3
3
|
import '../../assets/styles/checkbox2.css';/* empty css */
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
gridLayout: w,
|
|
34
|
-
themePopover: B,
|
|
35
|
-
popoverAlign: E,
|
|
36
|
-
tooltip: u,
|
|
37
|
-
tooltipPosition: h,
|
|
38
|
-
tooltipWidth: f,
|
|
39
|
-
tabIndex: q,
|
|
40
|
-
...m
|
|
41
|
-
} = t, e[0] = t, e[1] = d, e[2] = r, e[3] = a, e[4] = c, e[5] = m, e[6] = D, e[7] = A, e[8] = L, e[9] = _, e[10] = w, e[11] = B, e[12] = E, e[13] = q, e[14] = S, e[15] = j, e[16] = F, e[17] = T, e[18] = W, e[19] = H, e[20] = U, e[21] = G, e[22] = u, e[23] = h, e[24] = f) : (d = e[1], r = e[2], a = e[3], c = e[4], m = e[5], D = e[6], A = e[7], L = e[8], _ = e[9], w = e[10], B = e[11], E = e[12], q = e[13], S = e[14], j = e[15], F = e[16], T = e[17], W = e[18], H = e[19], U = e[20], G = e[21], u = e[22], h = e[23], f = e[24]);
|
|
42
|
-
const Z = D === void 0 ? "default" : D, ee = A === void 0 ? void 0 : A, te = S === void 0 ? void 0 : S, ie = j === void 0 ? "default" : j, ke = F === void 0 ? "" : F, oe = T === void 0 ? "" : T, ge = W === void 0 ? "" : W, le = H === void 0 ? !1 : H, ae = U === void 0 ? !1 : U, xe = G === void 0 ? "" : G, i = L === void 0 ? !1 : L, b = _ === void 0 ? "below" : _, se = w === void 0 ? void 0 : w, ne = B === void 0 ? "light" : B, de = E === void 0 ? "left" : E, ye = q === void 0 ? 0 : q;
|
|
43
|
-
let V;
|
|
44
|
-
e[25] !== ee || e[26] !== te ? (V = ee || we(Ee, te), e[25] = ee, e[26] = te, e[27] = V) : V = e[27];
|
|
45
|
-
const re = V, {
|
|
46
|
-
hideContent: Ie,
|
|
47
|
-
unvisible: Oe
|
|
48
|
-
} = re, v = t.id || `checkboxfield-${a}`, pe = Re(null), ce = t.checked ?? !!t.value;
|
|
49
|
-
let J;
|
|
50
|
-
e[28] !== t.label ? (J = Pe.isEmpty(t?.label), e[28] = t.label, e[29] = J) : J = e[29];
|
|
51
|
-
const p = !J, l = !!(t.readOnly || re.readOnly), o = !!(t.disabled || re.disabled), C = !!t.hint?.length, s = !!d?.length;
|
|
52
|
-
let K;
|
|
53
|
-
e[30] !== o || e[31] !== l || e[32] !== c ? (K = (ve) => {
|
|
54
|
-
l || o || (Object.defineProperty(ve.target, "value", {
|
|
55
|
-
value: ve.target.checked,
|
|
56
|
-
writable: !0,
|
|
57
|
-
enumerable: !0,
|
|
58
|
-
configurable: !0
|
|
59
|
-
}), c?.(ve));
|
|
60
|
-
}, e[30] = o, e[31] = l, e[32] = c, e[33] = K) : K = e[33];
|
|
61
|
-
const me = K;
|
|
62
|
-
if (Oe || Ie)
|
|
4
|
+
import R from "react";
|
|
5
|
+
import B from "../../gridlayout/GridCol.js";
|
|
6
|
+
import { actionsOnPermissionDenied as E, OPTIONS_ON_DENIED as f } from "../../permissionValidations.js";
|
|
7
|
+
import { InputBase as h } from "./base.js";
|
|
8
|
+
const P = [f.disabled, f.unvisible, f.readOnly, f.hideContent], v = R.forwardRef((O, i) => {
|
|
9
|
+
const e = N.c(23);
|
|
10
|
+
let d, t, o, n, l, a;
|
|
11
|
+
e[0] !== O ? ({
|
|
12
|
+
onDeniedActions: o,
|
|
13
|
+
permissionAttr: n,
|
|
14
|
+
gridLayout: t,
|
|
15
|
+
readOnly: a,
|
|
16
|
+
disabled: d,
|
|
17
|
+
...l
|
|
18
|
+
} = O, e[0] = O, e[1] = d, e[2] = t, e[3] = o, e[4] = n, e[5] = l, e[6] = a) : (d = e[1], t = e[2], o = e[3], n = e[4], l = e[5], a = e[6]);
|
|
19
|
+
let p;
|
|
20
|
+
e[7] !== o || e[8] !== n ? (p = o || E(P, n), e[7] = o, e[8] = n, e[9] = p) : p = e[9];
|
|
21
|
+
const b = p, {
|
|
22
|
+
hideContent: x,
|
|
23
|
+
unvisible: C
|
|
24
|
+
} = b, y = !!(a || b.readOnly), D = !!(d || b.disabled);
|
|
25
|
+
let m;
|
|
26
|
+
e[10] !== D || e[11] !== y || e[12] !== l ? (m = {
|
|
27
|
+
readOnly: y,
|
|
28
|
+
disabled: D,
|
|
29
|
+
...l
|
|
30
|
+
}, e[10] = D, e[11] = y, e[12] = l, e[13] = m) : m = e[13];
|
|
31
|
+
const s = m;
|
|
32
|
+
if (C || x)
|
|
63
33
|
return null;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Q
|
|
73
|
-
] }), e[51] = k, e[52] = g) : g = e[52];
|
|
74
|
-
let x;
|
|
75
|
-
e[53] !== oe || e[54] !== p || e[55] !== v || e[56] !== o || e[57] !== l || e[58] !== r || e[59] !== le || e[60] !== t.required || e[61] !== i ? (x = p && /* @__PURE__ */ n("label", { className: `label ${oe}`, title: r, htmlFor: v, "aria-readonly": l, "aria-disabled": o, "data-testid": "test-checkbox-field-label", "data-state-skeletonize": i, "data-state-disabled": o, "data-state-read-only": l, "data-state-uppercase": le, "data-state-input-required": t.required, children: r }), e[53] = oe, e[54] = p, e[55] = v, e[56] = o, e[57] = l, e[58] = r, e[59] = le, e[60] = t.required, e[61] = i, e[62] = x) : x = e[62];
|
|
76
|
-
let y;
|
|
77
|
-
e[63] !== C || e[64] !== p || e[65] !== b || e[66] !== de || e[67] !== t.hint || e[68] !== i || e[69] !== ne ? (y = p && C && b === "onLabelRight" && !i && /* @__PURE__ */ n(Le, { customClass: "label-popover", theme: ne, align: de, iconColor: "#03bde2", children: /* @__PURE__ */ n(Be, { text: t?.hint }) }), e[63] = C, e[64] = p, e[65] = b, e[66] = de, e[67] = t.hint, e[68] = i, e[69] = ne, e[70] = y) : y = e[70];
|
|
78
|
-
let I;
|
|
79
|
-
e[71] !== i || e[72] !== he || e[73] !== g || e[74] !== x || e[75] !== y ? (I = /* @__PURE__ */ M("div", { "data-state-skeletonize": i, className: he, children: [
|
|
80
|
-
g,
|
|
81
|
-
x,
|
|
82
|
-
y
|
|
83
|
-
] }), e[71] = i, e[72] = he, e[73] = g, e[74] = x, e[75] = y, e[76] = I) : I = e[76];
|
|
84
|
-
let O;
|
|
85
|
-
e[77] !== C || e[78] !== b || e[79] !== o || e[80] !== t.hint || e[81] !== i ? (O = b === "below" && /* @__PURE__ */ n($e, { customClass: "hint", description: t.hint, disabled: o, skeletonize: i, visible: C }), e[77] = C, e[78] = b, e[79] = o, e[80] = t.hint, e[81] = i, e[82] = O) : O = e[82];
|
|
86
|
-
let N;
|
|
87
|
-
e[83] !== d || e[84] !== s || e[85] !== a || e[86] !== i ? (N = s && /* @__PURE__ */ n("span", { className: "error", "data-state-skeletonize": i, "aria-describedby": String(a).concat("-errors"), children: d?.map(Se) }), e[83] = d, e[84] = s, e[85] = a, e[86] = i, e[87] = N) : N = e[87];
|
|
88
|
-
let P;
|
|
89
|
-
e[88] !== s || e[89] !== ue || e[90] !== I || e[91] !== O || e[92] !== N ? (P = /* @__PURE__ */ M("div", { ref: pe, "data-testid": "test-chebox-field-root", className: ue, "data-state-error": s, children: [
|
|
90
|
-
I,
|
|
91
|
-
O,
|
|
92
|
-
N
|
|
93
|
-
] }), e[88] = s, e[89] = ue, e[90] = I, e[91] = O, e[92] = N, e[93] = P) : P = e[93];
|
|
94
|
-
let z;
|
|
95
|
-
e[94] !== se || e[95] !== P ? (z = /* @__PURE__ */ n(Ae, { cols: se, children: P }), e[94] = se, e[95] = P, e[96] = z) : z = e[96];
|
|
96
|
-
let R;
|
|
97
|
-
e[97] !== u || e[98] !== h || e[99] !== f ? (R = /* @__PURE__ */ n(_e, { targetRef: pe, text: u, width: f, position: h }), e[97] = u, e[98] = h, e[99] = f, e[100] = R) : R = e[100];
|
|
98
|
-
let X;
|
|
99
|
-
return e[101] !== z || e[102] !== R ? (X = /* @__PURE__ */ M(Ce, { children: [
|
|
100
|
-
z,
|
|
101
|
-
R
|
|
102
|
-
] }), e[101] = z, e[102] = R, e[103] = X) : X = e[103], X;
|
|
34
|
+
if (t) {
|
|
35
|
+
let r;
|
|
36
|
+
e[14] !== s || e[15] !== i ? (r = /* @__PURE__ */ I(h, { ref: i, ...s }), e[14] = s, e[15] = i, e[16] = r) : r = e[16];
|
|
37
|
+
let u;
|
|
38
|
+
return e[17] !== t || e[18] !== r ? (u = /* @__PURE__ */ I(B, { cols: t, children: r }), e[17] = t, e[18] = r, e[19] = u) : u = e[19], u;
|
|
39
|
+
}
|
|
40
|
+
let c;
|
|
41
|
+
return e[20] !== s || e[21] !== i ? (c = /* @__PURE__ */ I(h, { ref: i, ...s }), e[20] = s, e[21] = i, e[22] = c) : c = e[22], c;
|
|
103
42
|
});
|
|
104
|
-
|
|
105
|
-
function Se(t, $) {
|
|
106
|
-
return /* @__PURE__ */ M(Ce, { children: [
|
|
107
|
-
t,
|
|
108
|
-
" "
|
|
109
|
-
] }, `${$ + 1}-${t}`);
|
|
110
|
-
}
|
|
43
|
+
v.displayName = "CheckboxFieldInput";
|
|
111
44
|
export {
|
|
112
|
-
|
|
45
|
+
v as Input
|
|
113
46
|
};
|
|
114
47
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/lib/inputs2/checkboxfield/index.tsx"],"sourcesContent":["import '../../assets/styles/checkbox2.scss';\n\nimport _ from 'lodash';\nimport { ChangeEvent, ComponentProps, forwardRef, Fragment, useRef } from 'react';\nimport Hint from '../../hint';\nimport Icon from '../../icons';\nimport GridCol from '../../gridlayout';\nimport Popover, { PopoverText } from '../../popover';\nimport { Tooltip } from '../../tooltip';\nimport type { Size } from '../../@types/Size';\nimport type { ColorTheme } from '../../@types/ColorStyles';\nimport type { ITooltipCommonProps } from '../../tooltip/types';\nimport type { Position, HintPosition } from '../../@types/Position';\nimport type { OnDenied, PermissionAttr } from '../../@types/PermissionAttr';\nimport { actionsOnPermissionDenied, OPTIONS_ON_DENIED } from '../../permissionValidations';\n\ntype InputHTMLProps = Omit<ComponentProps<'input'>, 'size' | 'type'>;\ninterface CheckboxFieldInputProps extends InputHTMLProps, ITooltipCommonProps {\n hint?: string;\n label?: string;\n size?: Exclude<Size, 'mini'>;\n variant?: 'default' | 'secondary';\n errors?: string[];\n gridLayout?: string;\n customClass?: string;\n customClassLabel?: string;\n customClassWrapper?: string;\n customClassInputContainer?: string;\n rounded?: boolean;\n readOnly?: boolean;\n skeletonize?: boolean\n labelUppercase?: boolean;\n hintPosition?: HintPosition;\n themePopover?: ColorTheme;\n popoverAlign?: Extract<Position, 'left' | 'right'>;\n permissionAttr?: PermissionAttr;\n onDeniedActions?: OnDenied;\n tabIndex?: number;\n}\n\nconst options = [\n OPTIONS_ON_DENIED.disabled,\n OPTIONS_ON_DENIED.unvisible,\n OPTIONS_ON_DENIED.readOnly,\n OPTIONS_ON_DENIED.hideContent,\n];\nconst Input = forwardRef<HTMLInputElement, CheckboxFieldInputProps>((props, ref) => {\n const {\n name, label, errors, onChange, size = 'default', onDeniedActions = undefined, permissionAttr = undefined,\n variant = 'default', customClass = '', customClassLabel = '', customClassWrapper = '', labelUppercase = false,\n rounded = false, customClassInputContainer = '', skeletonize = false, hintPosition = 'below', gridLayout = undefined,\n themePopover = 'light', popoverAlign = 'left', tooltip, tooltipPosition, tooltipWidth, tabIndex = 0, ...rest\n } = props;\n const onDenied: OnDenied = onDeniedActions || actionsOnPermissionDenied(options, permissionAttr);\n const { hideContent, unvisible } = onDenied;\n const inputId = props.id || `checkboxfield-${name}`;\n const inputRootRef = useRef<HTMLInputElement | null>(null);\n\n const isChecked = props.checked ?? Boolean(props.value);\n const hasLabel = !_.isEmpty(props?.label);\n const isReadOnly = Boolean(props.readOnly || onDenied.readOnly);\n const isDisabled = Boolean(props.disabled || onDenied.disabled);\n const hasHintMessages = Boolean(props.hint?.length);\n const hasValidationErrors = Boolean(errors?.length);\n\n const handleOnChange = (event: ChangeEvent<HTMLInputElement>) => {\n if (isReadOnly || isDisabled) return;\n Object.defineProperty(event.target, 'value', {\n value: event.target.checked,\n writable: true,\n enumerable: true,\n configurable: true,\n });\n onChange?.(event);\n };\n\n if (unvisible || hideContent) return null;\n\n return (\n <Fragment>\n <GridCol cols={gridLayout}>\n <div\n ref={inputRootRef}\n data-testid=\"test-chebox-field-root\"\n className={`checkbox-field-root ${customClassWrapper}`}\n data-state-error={hasValidationErrors}>\n <div\n data-state-skeletonize={skeletonize}\n className={`container ${customClassInputContainer}`}>\n <div className='input-root'>\n <input\n ref={ref}\n id={inputId}\n name={name}\n readOnly={isReadOnly}\n disabled={isDisabled}\n className={`input ${customClass}`}\n tabIndex={!isReadOnly && !tabIndex ? 0 : -1}\n data-testid=\"test-checkbox-field-input\"\n data-state-size={size}\n data-state-error={hasValidationErrors}\n data-state-variant={variant}\n data-state-rounded={rounded}\n data-state-read-only={isReadOnly}\n data-state-skeletonize={skeletonize}\n {...rest}\n type=\"checkbox\"\n checked={isChecked}\n onChange={handleOnChange} />\n <Icon customClass=\"checkmark\" name=\"checkmark\" colorStyle=\"default\" />\n </div>\n {hasLabel && (\n <label\n className={`label ${customClassLabel}`}\n title={label}\n htmlFor={inputId}\n aria-readonly={isReadOnly}\n aria-disabled={isDisabled}\n data-testid=\"test-checkbox-field-label\"\n data-state-skeletonize={skeletonize}\n data-state-disabled={isDisabled}\n data-state-read-only={isReadOnly}\n data-state-uppercase={labelUppercase}\n data-state-input-required={props.required}>\n {label}\n </label>\n )}\n {hasLabel && hasHintMessages && hintPosition === 'onLabelRight' && !skeletonize && (\n <Popover\n customClass=\"label-popover\"\n theme={themePopover}\n align={popoverAlign}\n iconColor=\"#03bde2\">\n <PopoverText text={props?.hint} />\n </Popover>\n )}\n </div>\n {hintPosition === 'below' && (\n <Hint\n customClass=\"hint\"\n description={props.hint}\n disabled={isDisabled}\n skeletonize={skeletonize}\n visible={hasHintMessages} />\n )}\n {hasValidationErrors && (\n <span\n className=\"error\"\n data-state-skeletonize={skeletonize}\n aria-describedby={String(name).concat('-errors')}>\n {errors?.map((error, index) => (\n <Fragment key={`${index + 1}-${error}`}>\n {error}\n \n </Fragment>\n ))}\n </span>\n )}\n </div>\n </GridCol>\n <Tooltip\n targetRef={inputRootRef}\n text={tooltip}\n width={tooltipWidth}\n position={tooltipPosition} />\n </Fragment>\n );\n});\n\nInput.displayName = 'CheckboxFieldInput';\n\nexport { Input };\nexport type { CheckboxFieldInputProps };\n"],"names":["options","OPTIONS_ON_DENIED","disabled","unvisible","readOnly","hideContent","Input","forwardRef","props","ref","$","_c","errors","label","name","onChange","rest","t0","t1","t10","t11","t12","t13","t14","t15","t2","t3","t4","t5","t6","t7","t8","t9","tooltip","tooltipPosition","tooltipWidth","size","onDeniedActions","permissionAttr","variant","customClass","customClassLabel","customClassWrapper","labelUppercase","rounded","customClassInputContainer","skeletonize","hintPosition","gridLayout","themePopover","popoverAlign","tabIndex","undefined","t16","actionsOnPermissionDenied","onDenied","inputId","id","inputRootRef","useRef","isChecked","checked","Boolean","value","t17","_","isEmpty","hasLabel","isReadOnly","isDisabled","hasHintMessages","hint","length","hasValidationErrors","t18","event","Object","defineProperty","target","writable","enumerable","configurable","handleOnChange","t19","t20","t21","t22","t23","t24","Symbol","for","Icon","t25","jsxs","t26","required","jsx","t27","Popover","PopoverText","t28","t29","Hint","t30","String","concat","map","_temp","t31","t32","GridCol","t33","Tooltip","t34","Fragment","displayName","error","index"],"mappings":";;;;;;;;;;;;AAwCA,MAAMA,KAAU,CACdC,EAAkBC,UAClBD,EAAkBE,WAClBF,EAAkBG,UAClBH,EAAkBI,WAAW,GAEzBC,KAAQC,GAAsD,CAAAC,GAAAC,MAAA;AAAA,QAAAC,IAAAC,GAAAA,EAAA,GAAA;AAAA,MAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC,GAAAC;AAAA,EAAAzB,SAAAF,KAClE;AAAA,IAAAM,MAAAA;AAAAA,IAAAD,OAAAA;AAAAA,IAAAD,QAAAA;AAAAA,IAAAG,UAAAA;AAAAA,IAAAqB,MAAAnB;AAAAA,IAAAoB,iBAAAnB;AAAAA,IAAAoB,gBAAAb;AAAAA,IAAAc,SAAAb;AAAAA,IAAAc,aAAAb;AAAAA,IAAAc,kBAAAb;AAAAA,IAAAc,oBAAAb;AAAAA,IAAAc,gBAAAb;AAAAA,IAAAc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K,EAGpC;AAAW;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/lib/inputs2/checkboxfield/index.tsx"],"sourcesContent":["import '../../assets/styles/checkbox2.scss';\n\nimport React from 'react';\nimport GridCol from '../../gridlayout';\nimport type { OnDenied, PermissionAttr } from '../../@types/PermissionAttr';\nimport { actionsOnPermissionDenied, OPTIONS_ON_DENIED } from '../../permissionValidations';\nimport { CheckboxFieldInputBaseProps, InputBase } from './base';\n\ninterface CheckboxFieldInputProps extends CheckboxFieldInputBaseProps {\n gridLayout?: string;\n permissionAttr?: PermissionAttr;\n onDeniedActions?: OnDenied;\n}\n\nconst options = [\n OPTIONS_ON_DENIED.disabled,\n OPTIONS_ON_DENIED.unvisible,\n OPTIONS_ON_DENIED.readOnly,\n OPTIONS_ON_DENIED.hideContent,\n];\nconst Input = React.forwardRef<HTMLInputElement, CheckboxFieldInputProps>(({\n onDeniedActions, permissionAttr, gridLayout, readOnly, disabled, ...props\n}, ref) => {\n const onDenied: OnDenied = React.useMemo(() => {\n return onDeniedActions || actionsOnPermissionDenied(options, permissionAttr);\n }, [onDeniedActions, permissionAttr]);\n const { hideContent, unvisible } = onDenied;\n const isReadOnly = Boolean(readOnly || onDenied.readOnly);\n const isDisabled = Boolean(disabled || onDenied.disabled);\n const inputProps = { \n readOnly: isReadOnly, disabled: isDisabled, ...props, \n } satisfies CheckboxFieldInputBaseProps;\n\n if (unvisible || hideContent) return null;\n\n if (gridLayout) {\n return (\n <GridCol cols={gridLayout}>\n <InputBase ref={ref} {...inputProps} />\n </GridCol>\n );\n }\n\n return (\n <InputBase ref={ref} {...inputProps} />\n );\n});\n\nInput.displayName = 'CheckboxFieldInput';\n\nexport { Input };\nexport type { CheckboxFieldInputProps };\n"],"names":["options","OPTIONS_ON_DENIED","disabled","unvisible","readOnly","hideContent","Input","React","forwardRef","t0","ref","$","_c","gridLayout","onDeniedActions","permissionAttr","props","t1","actionsOnPermissionDenied","onDenied","isReadOnly","Boolean","isDisabled","t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AU,GAAKN;AAAAA,EAAAA,GAChDL,QAAAW,GAAAX,QAAAS,GAAAT,QAAAK,GAAAL,QAAAY,KAAAA,IAAAZ,EAAA,EAAA;AAFD,QAAAa,IAAmBD;AAInB,MAAIpB,KAAAE;AAAwB,WAAS;AAErC,MAAIQ,GAAU;AAAA,QAAAY;AAAA,IAAAd,EAAA,EAAA,MAAAa,KAAAb,UAAAD,KAGRe,IAAA,gBAAAC,EAACC,GAAA,EAAejB,KAAAA,GAAG,GAAMc,EAAAA,CAAU,GAAIb,QAAAa,GAAAb,QAAAD,GAAAC,QAAAc,KAAAA,IAAAd,EAAA,EAAA;AAAA,QAAAiB;AAAA,WAAAjB,EAAA,EAAA,MAAAE,KAAAF,UAAAc,KADzCG,IAAA,gBAAAF,EAACG,GAAA,EAAchB,MAAAA,GACbY,UAAAA,GACF,GAAUd,QAAAE,GAAAF,QAAAc,GAAAd,QAAAiB,KAAAA,IAAAjB,EAAA,EAAA,GAFViB;AAAAA,EAEU;AAEb,MAAAH;AAAA,SAAAd,EAAA,EAAA,MAAAa,KAAAb,UAAAD,KAGCe,IAAA,gBAAAC,EAACC,GAAA,EAAejB,KAAAA,GAAG,GAAMc,EAAAA,CAAU,GAAIb,QAAAa,GAAAb,QAAAD,GAAAC,QAAAc,KAAAA,IAAAd,EAAA,EAAA,GAAvCc;AAAuC,CAE1C;AAEDnB,EAAMwB,cAAc;"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { jsxs as O, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import a from "react";
|
|
3
|
+
import f from "../../../_virtual/lodash.js";
|
|
4
|
+
import "../../../node_modules/imask/esm/index.js";
|
|
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";
|
|
15
|
+
import { createPortal as ye } from "react-dom";
|
|
16
|
+
import o from "../../../node_modules/moment/dist/moment.js";
|
|
17
|
+
import Oe from "../../../hint/index.js";
|
|
18
|
+
import Se from "../../../tooltip/index.js";
|
|
19
|
+
import { mergeRefs as pe } from "../../../form2/helpers.js";
|
|
20
|
+
import { Keys as l } from "../types.js";
|
|
21
|
+
import { Root as Re, Label as Be, Container as we, Input as Ie } from "../base/index.js";
|
|
22
|
+
import { TOKEN_PTBR_FORMAT as S, TOKEN_ISO_FORMAT as r, TOKEN_MASK as xe, NAVIGATION_KEYS as ve } from "../helpers.js";
|
|
23
|
+
import { Triggers as Ve } from "./triggers.js";
|
|
24
|
+
import { CalendarBox as Fe } from "./calendarbox.js";
|
|
25
|
+
import { DateFieldContext as Ke } from "./context.js";
|
|
26
|
+
import Me from "../../../node_modules/uuid/dist/v1.js";
|
|
27
|
+
const Ne = a.forwardRef((t, j) => {
|
|
28
|
+
const {
|
|
29
|
+
label: V,
|
|
30
|
+
errors: F,
|
|
31
|
+
tooltip: q,
|
|
32
|
+
tooltipPosition: H,
|
|
33
|
+
tooltipWidth: $,
|
|
34
|
+
shouldCloseOnSelect: K = !0,
|
|
35
|
+
returnValueType: G = "default",
|
|
36
|
+
customClass: J = "",
|
|
37
|
+
customClassLabel: Q = "",
|
|
38
|
+
customClassWrapper: X = "",
|
|
39
|
+
customClassInputContainer: Z = "",
|
|
40
|
+
textAlign: _ = "left",
|
|
41
|
+
labelUppercase: ee = !1,
|
|
42
|
+
skeletonize: c = !1,
|
|
43
|
+
hintPosition: M = "below",
|
|
44
|
+
themePopover: te = "light",
|
|
45
|
+
popoverAlign: ae = "left",
|
|
46
|
+
showCalendarButton: ne = !0,
|
|
47
|
+
openCalendarOnFocus: oe = !0,
|
|
48
|
+
undigitable: p = !1,
|
|
49
|
+
showClearDateButton: le = !0,
|
|
50
|
+
placeholder: se = S,
|
|
51
|
+
readOnly: m,
|
|
52
|
+
disabled: k,
|
|
53
|
+
...re
|
|
54
|
+
} = t, [g, R] = a.useState(!1), [B, D] = a.useState(o().format(r)), [i, w] = a.useState(null), [ie, u] = a.useState(i ?? o()), N = a.useRef(null), P = a.useRef(null), h = a.useRef(null), T = a.useRef(null), {
|
|
55
|
+
setValue: I,
|
|
56
|
+
unmaskedValue: E,
|
|
57
|
+
value: A
|
|
58
|
+
} = De({
|
|
59
|
+
mask: xe,
|
|
60
|
+
lazy: !1,
|
|
61
|
+
placeholderChar: "_"
|
|
62
|
+
}, {
|
|
63
|
+
ref: h,
|
|
64
|
+
defaultValue: i?.format(S),
|
|
65
|
+
onComplete: (e) => {
|
|
66
|
+
const n = o(e, S);
|
|
67
|
+
n.isValid() && v(n);
|
|
68
|
+
}
|
|
69
|
+
}), b = a.useMemo(() => t.id || t.name || Me(), [t.id, t.name]), de = !f.isEmpty(t?.label), z = !!t.hint?.length, x = !!F?.length, ce = !f.isEmpty(t?.value), v = a.useCallback((e) => {
|
|
70
|
+
const n = e.format(r), s = e.toISOString();
|
|
71
|
+
w(e.clone()), u(e.clone()), t.onChange?.({
|
|
72
|
+
target: {
|
|
73
|
+
name: t.name,
|
|
74
|
+
value: G === "default" ? n : s
|
|
75
|
+
}
|
|
76
|
+
}), K && C();
|
|
77
|
+
}, [i, t.name, t.onChange, K]), W = a.useCallback(() => R(!0), []), C = a.useCallback(() => R(!1), []), Y = a.useCallback(() => u((e) => e.clone().add(1, "month")), []), L = a.useCallback(() => u((e) => e.clone().subtract(1, "month")), []), ue = a.useCallback(() => {
|
|
78
|
+
R((e) => (h.current !== document.activeElement && h?.current?.focus?.(), !e));
|
|
79
|
+
}, []), y = a.useCallback((e) => {
|
|
80
|
+
u((n) => {
|
|
81
|
+
const s = n.clone().add(e, "day");
|
|
82
|
+
return D(s.format(r)), s;
|
|
83
|
+
});
|
|
84
|
+
}, []), U = a.useCallback((e) => {
|
|
85
|
+
u((n) => {
|
|
86
|
+
let s = n;
|
|
87
|
+
return e === "end" && (s = n.clone().endOf("week")), e === "start" && (s = n.clone().startOf("week")), D(s.format(r)), s;
|
|
88
|
+
});
|
|
89
|
+
}, []), me = a.useCallback(() => {
|
|
90
|
+
t.onChange?.({
|
|
91
|
+
target: {
|
|
92
|
+
name: t.name,
|
|
93
|
+
value: ""
|
|
94
|
+
}
|
|
95
|
+
}), w(null), I(""), C();
|
|
96
|
+
}, [t.onChange]), fe = (e) => {
|
|
97
|
+
if (t?.onBlur?.(e), C(), D((i ?? o()).format(r)), u(i ?? o()), f.size(E) !== 8) {
|
|
98
|
+
const n = o(f.toString(t?.value), r);
|
|
99
|
+
n.isValid() && I(n.format("DD/MM/YYYY"));
|
|
100
|
+
}
|
|
101
|
+
}, he = (e) => {
|
|
102
|
+
t?.onFocus?.(e), D((i ?? o()).format(r)), u(i ?? o()), !m && oe && W();
|
|
103
|
+
}, be = (e) => {
|
|
104
|
+
p ? e.preventDefault() : t.onPaste?.(e);
|
|
105
|
+
}, Ce = (e) => {
|
|
106
|
+
p ? e.preventDefault() : t.onBeforeInput?.(e);
|
|
107
|
+
}, ke = (e) => {
|
|
108
|
+
if (t?.onKeyDown?.(e), g && e.key && !e.shiftKey && !e.altKey && ve.includes(e.key))
|
|
109
|
+
switch (e.preventDefault(), e.key) {
|
|
110
|
+
case l.arrowLeft:
|
|
111
|
+
y(-1);
|
|
112
|
+
break;
|
|
113
|
+
case l.arrowRight:
|
|
114
|
+
y(1);
|
|
115
|
+
break;
|
|
116
|
+
case l.arrowUp:
|
|
117
|
+
y(-7);
|
|
118
|
+
break;
|
|
119
|
+
case l.arrowDown:
|
|
120
|
+
y(7);
|
|
121
|
+
break;
|
|
122
|
+
case l.pageUp:
|
|
123
|
+
Y();
|
|
124
|
+
break;
|
|
125
|
+
case l.pageDown:
|
|
126
|
+
L();
|
|
127
|
+
break;
|
|
128
|
+
case l.home:
|
|
129
|
+
U("start");
|
|
130
|
+
break;
|
|
131
|
+
case l.end:
|
|
132
|
+
U("end");
|
|
133
|
+
break;
|
|
134
|
+
case l.escape:
|
|
135
|
+
C();
|
|
136
|
+
break;
|
|
137
|
+
case l.enter:
|
|
138
|
+
v(o(f.toString(B), r));
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
a.useEffect(() => {
|
|
143
|
+
const e = t?.value ?? null, n = o(f.toString(e), r);
|
|
144
|
+
w(n.isValid() ? n : null), I(n.format(S));
|
|
145
|
+
}, [t?.value]);
|
|
146
|
+
const ge = {
|
|
147
|
+
label: V,
|
|
148
|
+
inputFieldId: b,
|
|
149
|
+
activeDescendant: B,
|
|
150
|
+
calendarBoxOpen: g,
|
|
151
|
+
isReadOnly: !!m,
|
|
152
|
+
isDisabled: !!k,
|
|
153
|
+
skeletonize: c,
|
|
154
|
+
showCalendarButton: ne,
|
|
155
|
+
hasValidDateSelected: ce,
|
|
156
|
+
dateInputRef: h,
|
|
157
|
+
dateContainerRef: T,
|
|
158
|
+
handleOpenCalendar: W,
|
|
159
|
+
handleCloseCalendar: C,
|
|
160
|
+
handleNextMonth: Y,
|
|
161
|
+
handlePreviousMonth: L,
|
|
162
|
+
handleSelectDate: v,
|
|
163
|
+
selectedDate: i,
|
|
164
|
+
unmaskedValue: E,
|
|
165
|
+
maskedValue: A,
|
|
166
|
+
showClearDateButton: le,
|
|
167
|
+
handleChangeCalendarBoxState: ue,
|
|
168
|
+
handleOnClickClearSelectedDate: me,
|
|
169
|
+
calendarDisplayDate: ie,
|
|
170
|
+
calendarRef: N
|
|
171
|
+
};
|
|
172
|
+
return /* @__PURE__ */ O(a.Fragment, { children: [
|
|
173
|
+
/* @__PURE__ */ d(Ke.Provider, { value: ge, children: /* @__PURE__ */ O(Re, { ref: P, "data-testid": "test-date-field-root", customClassWrapper: X, hasValidationErrors: x, children: [
|
|
174
|
+
de && /* @__PURE__ */ d(Be, { "data-testid": "test-date-field-label", label: V, inputId: b, hint: t?.hint, isDisabled: k, isReadOnly: m, skeletonize: c, required: t?.required, hintPosition: M, themePopover: te, popoverAlign: ae, labelUppercase: ee, hasHintMessages: z, customClassLabel: Q }),
|
|
175
|
+
/* @__PURE__ */ O(we, { ref: T, skeletonize: c, customClassInputContainer: Z, children: [
|
|
176
|
+
/* @__PURE__ */ d(Ie, { ...re, ref: pe(j, h), id: b, name: t?.name, value: A, readOnly: m, disabled: k, customClass: J, tabIndex: !m && !c ? 0 : -1, placeholder: se, "aria-activedescendant": B, "aria-expanded": g, "aria-controls": b, "aria-labelledby": b, "data-state-is-period-input": !1, "data-testid": "test-date-field-input", "data-state-error": x, "data-state-read-only": m, "data-state-text-align": _, "data-state-undigitable": p, "data-state-skeletonize": c, onBlur: fe, onFocus: he, onPaste: be, onKeyDown: ke, onBeforeInput: Ce }),
|
|
177
|
+
/* @__PURE__ */ d(Ve, {})
|
|
178
|
+
] }),
|
|
179
|
+
g && ye(/* @__PURE__ */ d(Fe, { ref: N }), document.body),
|
|
180
|
+
M === "below" && /* @__PURE__ */ d(Oe, { customClass: "hint", description: t.hint, disabled: k, skeletonize: c, visible: z }),
|
|
181
|
+
x && /* @__PURE__ */ d("span", { "data-testid": "test-date-field-list-errors", className: "error", "data-state-skeletonize": c, "aria-describedby": String(t.name).concat("-errors"), children: F?.map((e, n) => /* @__PURE__ */ O(a.Fragment, { children: [
|
|
182
|
+
e,
|
|
183
|
+
" "
|
|
184
|
+
] }, `${n + 1}-${e}`)) })
|
|
185
|
+
] }) }),
|
|
186
|
+
/* @__PURE__ */ d(Se, { targetRef: P, text: q, width: $, position: H })
|
|
187
|
+
] });
|
|
188
|
+
});
|
|
189
|
+
Ne.displayName = "DateFieldInputBase";
|
|
190
|
+
export {
|
|
191
|
+
Ne as InputBase
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +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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AY,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,4 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
1
2
|
import { DateFieldInputProps } from './types';
|
|
2
|
-
declare const Input:
|
|
3
|
+
declare const Input: React.ForwardRefExoticComponent<DateFieldInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
3
4
|
export { Input };
|
|
4
5
|
export type { DateFieldInputProps };
|