asma-ui-core 3.109.0 → 3.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/asma-ui-core.css +1 -1
- package/dist/components/feedback/minimizable-dialog/MinimizableDialog.js +17 -15
- package/dist/components/feedback/minimizable-dialog/v2/MinimizableDialogV2.js +26 -24
- package/dist/components/inputs/dynamic-select/components/DynamicInteractiveChipGroup.js +61 -58
- package/dist/components/inputs/dynamic-select/components/DynamicSelectAutocomplete.js +74 -71
- package/dist/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.js +13 -10
- package/dist/components/inputs/field-styles.js +16 -6
- package/dist/components/inputs/form-layout/StyledFieldPair.js +22 -0
- package/dist/components/inputs/form-layout/StyledFieldPair.module.js +8 -0
- package/dist/components/inputs/form-layout/StyledFormColumn.js +13 -0
- package/dist/components/inputs/input-field/StyledInputField.js +235 -198
- package/dist/components/inputs/phone-field/StyledPhoneField.js +41 -39
- package/dist/components/inputs/search-field/StyledSearchField.js +22 -20
- package/dist/components/inputs/select/StyledSelect.js +110 -108
- package/dist/components/inputs/select-autocomplete/StyledSelectAutocomplete.js +111 -108
- package/dist/components/inputs/slider/StyledSlider.js +2 -2
- package/dist/components/inputs/textarea/StyledTextarea.js +50 -52
- package/dist/components/inputs/textarea/StyledTextarea.module.js +3 -3
- package/dist/components/miscellaneous/StyledFormControl.js +29 -25
- package/dist/components/miscellaneous/StyledInputLabel.js +28 -18
- package/dist/datetime/components/date-picker/components/BaseDatePickerInput.js +137 -122
- package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.js +17 -15
- package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.module.js +2 -2
- package/dist/datetime/components/date-picker/components/DatePickerInputSingle.js +9 -8
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectMonth.js +17 -14
- package/dist/datetime/components/date-picker/components/StyledCalendarPickerSelectYear.js +14 -9
- package/dist/datetime/components/time-picker/StyledTimePicker.js +78 -74
- package/dist/datetime/components/time-picker/TimePickerInput.js +43 -41
- package/dist/datetime/components/time-picker/helpers/timePickerWidth.js +12 -0
- package/dist/helpers/CharacterCounter.js +21 -0
- package/dist/index.js +219 -211
- package/dist/src/components/inputs/dynamic-select/components/DynamicSelectReadOnlyValue.d.ts +2 -2
- package/dist/src/components/inputs/dynamic-select/types.d.ts +3 -0
- package/dist/src/components/inputs/field-styles.d.ts +22 -0
- package/dist/src/components/inputs/form-layout/StyledFieldPair.d.ts +18 -0
- package/dist/src/components/inputs/form-layout/StyledFormColumn.d.ts +12 -0
- package/dist/src/components/inputs/form-layout/index.d.ts +4 -0
- package/dist/src/components/inputs/input-field/StyledInputField.d.ts +19 -4
- package/dist/src/components/inputs/select/StyledSelect.d.ts +7 -2
- package/dist/src/components/inputs/select-autocomplete/StyledSelectAutocomplete.d.ts +5 -1
- package/dist/src/components/inputs/textarea/StyledTextarea.d.ts +6 -0
- package/dist/src/components/miscellaneous/StyledFormControl.d.ts +5 -2
- package/dist/src/components/miscellaneous/StyledInputLabel.d.ts +7 -5
- package/dist/src/datetime/components/date-picker/components/BaseDatePickerInput.d.ts +2 -0
- package/dist/src/datetime/components/date-picker/types.d.ts +3 -0
- package/dist/src/datetime/components/time-picker/helpers/timePickerWidth.d.ts +7 -0
- package/dist/src/datetime/components/time-picker/types.d.ts +3 -1
- package/dist/src/helpers/CharacterCounter.d.ts +16 -0
- package/dist/src/helpers/CharacterCounter.test.d.ts +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/tailwind.config.d.ts +14 -0
- package/package.json +1 -1
- package/src/styles/fieldWidthTokens.css +8 -0
- package/src/styles/index.css +1 -0
- package/tw-configs/twConfigs.json +14 -0
|
@@ -1,44 +1,48 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { resolveSx as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { cn as C } from "../../helpers/cn.js";
|
|
2
|
+
import { resolveSx as I } from "../../helpers/sx.js";
|
|
3
|
+
import { fieldWidthStyle as W } from "../inputs/field-styles.js";
|
|
4
|
+
import { FormControlContext as g } from "./FormControlContext.js";
|
|
5
|
+
import { useId as j, useMemo as M, useState as a } from "react";
|
|
6
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
7
|
+
var B = ({ children: n, error: e = !1, disabled: l = !1, required: t = !1, size: o = "medium", width: r = "full", fullWidth: N, className: c, style: u, sx: p, id: f, onFocus: x, onBlur: v, onClick: h }) => {
|
|
8
|
+
const s = j(), [m, y] = a(!1), [d, F] = a(!1), S = M(() => ({
|
|
8
9
|
focused: m,
|
|
9
|
-
filled:
|
|
10
|
+
filled: d,
|
|
10
11
|
error: e,
|
|
11
|
-
disabled:
|
|
12
|
-
required:
|
|
13
|
-
size:
|
|
14
|
-
labelId:
|
|
15
|
-
setFocused:
|
|
16
|
-
setFilled:
|
|
12
|
+
disabled: l,
|
|
13
|
+
required: t,
|
|
14
|
+
size: o,
|
|
15
|
+
labelId: f ?? s,
|
|
16
|
+
setFocused: y,
|
|
17
|
+
setFilled: F
|
|
17
18
|
}), [
|
|
18
19
|
m,
|
|
19
|
-
|
|
20
|
+
d,
|
|
20
21
|
e,
|
|
21
|
-
o,
|
|
22
22
|
l,
|
|
23
23
|
t,
|
|
24
|
-
|
|
24
|
+
o,
|
|
25
|
+
f,
|
|
25
26
|
s
|
|
26
27
|
]);
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
+
return /* @__PURE__ */ i(g.Provider, {
|
|
28
29
|
value: S,
|
|
29
|
-
children: /* @__PURE__ */
|
|
30
|
-
className:
|
|
30
|
+
children: /* @__PURE__ */ i("div", {
|
|
31
|
+
className: C("relative flex-col", c),
|
|
32
|
+
"data-field-width": r,
|
|
31
33
|
style: {
|
|
32
|
-
|
|
34
|
+
display: "flex",
|
|
35
|
+
...W(r),
|
|
36
|
+
...I(p),
|
|
33
37
|
...u
|
|
34
38
|
},
|
|
35
|
-
onFocus:
|
|
39
|
+
onFocus: x,
|
|
36
40
|
onBlur: v,
|
|
37
|
-
onClick:
|
|
38
|
-
children:
|
|
41
|
+
onClick: h,
|
|
42
|
+
children: n
|
|
39
43
|
})
|
|
40
44
|
});
|
|
41
45
|
};
|
|
42
46
|
export {
|
|
43
|
-
|
|
47
|
+
B as StyledFormControl
|
|
44
48
|
};
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { floatingLabelClass as
|
|
3
|
-
import { useFormControlContext as
|
|
4
|
-
import { jsxs as
|
|
5
|
-
var
|
|
6
|
-
const e =
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { cn as t } from "../../helpers/cn.js";
|
|
2
|
+
import { fieldLabelAboveClass as x, floatingLabelClass as h, floatingLabelLayoutStyle as v } from "../inputs/field-styles.js";
|
|
3
|
+
import { useFormControlContext as L } from "./FormControlContext.js";
|
|
4
|
+
import { jsx as n, jsxs as b } from "react/jsx-runtime";
|
|
5
|
+
var g = ({ children: l, htmlFor: r, id: s, required: f, disabled: a, error: c, size: u, shrink: m, labelPlacement: p = "above", className: i }) => {
|
|
6
|
+
const e = L(), o = m ?? (e ? e.focused || e.filled : !1), d = f ?? e?.required ?? !1;
|
|
7
|
+
return p === "above" ? /* @__PURE__ */ n("div", {
|
|
8
|
+
className: t(x({ disabled: a ?? e?.disabled }), i),
|
|
9
|
+
children: /* @__PURE__ */ b("label", {
|
|
10
|
+
htmlFor: r,
|
|
11
|
+
id: s ?? e?.labelId,
|
|
12
|
+
children: [l, d && /* @__PURE__ */ n("span", {
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
children: " *"
|
|
15
|
+
})]
|
|
16
|
+
})
|
|
17
|
+
}) : /* @__PURE__ */ b("label", {
|
|
18
|
+
htmlFor: r,
|
|
19
|
+
id: s ?? e?.labelId,
|
|
20
|
+
className: t(h({
|
|
21
|
+
shrink: o,
|
|
12
22
|
focused: e?.focused,
|
|
13
|
-
error:
|
|
14
|
-
disabled:
|
|
15
|
-
size:
|
|
16
|
-
}),
|
|
17
|
-
style:
|
|
18
|
-
children: [
|
|
23
|
+
error: c ?? e?.error,
|
|
24
|
+
disabled: a ?? e?.disabled,
|
|
25
|
+
size: u ?? e?.size
|
|
26
|
+
}), i),
|
|
27
|
+
style: v(o),
|
|
28
|
+
children: [l, d && " *"]
|
|
19
29
|
});
|
|
20
30
|
};
|
|
21
31
|
export {
|
|
22
|
-
|
|
32
|
+
g as StyledInputLabel
|
|
23
33
|
};
|
|
@@ -1,150 +1,165 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { fieldLabelAboveClass as w, fieldWidthStyle as Z } from "../../../../components/inputs/field-styles.js";
|
|
2
|
+
import { StyledInputField as $ } from "../../../../components/inputs/input-field/StyledInputField.js";
|
|
3
|
+
import { getValue as v } from "../helpers.js";
|
|
4
|
+
import { DatePickerButton as ee } from "./DatePickerButton.js";
|
|
5
|
+
import { getTitleLabelling as te } from "../../../helpers/getTitleLabelling.js";
|
|
6
|
+
import { DATE_INPUT_FONT_FAMILY as ae } from "../../../../helpers/inputMask.js";
|
|
7
|
+
import { useDatePickerMask as re } from "../hooks/useDatePickerMask.js";
|
|
8
|
+
import { defaultDatePickerValidationMessages as le, useDatePickerValidation as ie } from "../hooks/useDatePickerValidation.js";
|
|
9
|
+
import { useEffect as F, useId as V, useState as A } from "react";
|
|
10
|
+
import { jsx as d, jsxs as D } from "react/jsx-runtime";
|
|
11
|
+
import { isValid as de, parse as oe } from "date-fns";
|
|
12
|
+
var xe = (H) => {
|
|
13
|
+
const { onClick: Y, inputClassName: B, dateFormat: a, selected: e, error: E, helperText: L, errorText: O, onInputChange: g, hideCalendar: S, locale: r, disabledDays: o, label: f, title: h, inputAriaProps: R, readOnly: l, disallowPast: s, disallowFuture: n, validateOnCalendarClose: x, onValidatedOnce: b, hideDefaultHelperText: _, required: i, minDate: c, width: y = "s", ...m } = H, { validationError: j, handleValidation: p, errHelperText: q, clearValidation: C } = ie(le), { maskRef: W } = re(), T = V(), P = V(), [t, M] = A(e ? v(e, a) : ""), [N, z] = A({
|
|
13
14
|
selected: e,
|
|
14
|
-
dateFormat:
|
|
15
|
+
dateFormat: a
|
|
15
16
|
});
|
|
16
|
-
(e !==
|
|
17
|
+
(e !== N.selected || a !== N.dateFormat) && (z({
|
|
17
18
|
selected: e,
|
|
18
|
-
dateFormat:
|
|
19
|
-
}),
|
|
20
|
-
const
|
|
21
|
-
|
|
19
|
+
dateFormat: a
|
|
20
|
+
}), M(e ? v(e, a) : ""));
|
|
21
|
+
const U = r?.code?.startsWith("nb") ? "DD/MM/ÅÅÅÅ" : "DD/MM/YYYY", G = _ ? void 0 : U, I = !!(j || E), J = I ? O ?? q : L ?? G;
|
|
22
|
+
F(() => {
|
|
22
23
|
if (!e) {
|
|
23
|
-
|
|
24
|
+
C();
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
value:
|
|
28
|
-
disabledDays:
|
|
29
|
-
localeCode:
|
|
30
|
-
disallowPast:
|
|
31
|
-
disallowFuture:
|
|
32
|
-
required:
|
|
33
|
-
minDate:
|
|
27
|
+
p({
|
|
28
|
+
value: v(e, a),
|
|
29
|
+
disabledDays: o,
|
|
30
|
+
localeCode: r?.code,
|
|
31
|
+
disallowPast: s,
|
|
32
|
+
disallowFuture: n,
|
|
33
|
+
required: i,
|
|
34
|
+
minDate: c
|
|
34
35
|
});
|
|
35
36
|
}, [
|
|
36
37
|
e,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
i,
|
|
38
|
+
a,
|
|
39
|
+
o,
|
|
40
|
+
r?.code,
|
|
41
41
|
s,
|
|
42
|
-
d,
|
|
43
42
|
n,
|
|
43
|
+
i,
|
|
44
44
|
c,
|
|
45
|
-
|
|
45
|
+
p,
|
|
46
|
+
C
|
|
46
47
|
]);
|
|
47
|
-
const
|
|
48
|
-
const k =
|
|
49
|
-
|
|
48
|
+
const K = /\d/.test(t), Q = (u) => {
|
|
49
|
+
const k = u.target.value;
|
|
50
|
+
M(k.replace(/\D/g, "").length ? k : "");
|
|
50
51
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
value:
|
|
54
|
-
disabledDays:
|
|
55
|
-
localeCode:
|
|
56
|
-
disallowPast:
|
|
57
|
-
disallowFuture:
|
|
58
|
-
required:
|
|
59
|
-
minDate:
|
|
60
|
-
}),
|
|
52
|
+
F(() => {
|
|
53
|
+
x && (p({
|
|
54
|
+
value: t,
|
|
55
|
+
disabledDays: o,
|
|
56
|
+
localeCode: r?.code,
|
|
57
|
+
disallowPast: s,
|
|
58
|
+
disallowFuture: n,
|
|
59
|
+
required: i,
|
|
60
|
+
minDate: c
|
|
61
|
+
}), b?.());
|
|
61
62
|
}, [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
i,
|
|
63
|
+
x,
|
|
64
|
+
t,
|
|
65
|
+
o,
|
|
66
|
+
r?.code,
|
|
67
67
|
s,
|
|
68
|
-
d,
|
|
69
68
|
n,
|
|
70
|
-
|
|
71
|
-
c
|
|
69
|
+
i,
|
|
70
|
+
c,
|
|
71
|
+
b,
|
|
72
|
+
p
|
|
72
73
|
]);
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
value:
|
|
76
|
-
disabledDays:
|
|
77
|
-
localeCode:
|
|
78
|
-
disallowPast:
|
|
79
|
-
disallowFuture:
|
|
80
|
-
required:
|
|
81
|
-
minDate:
|
|
74
|
+
const X = () => {
|
|
75
|
+
if (p({
|
|
76
|
+
value: t,
|
|
77
|
+
disabledDays: o,
|
|
78
|
+
localeCode: r?.code,
|
|
79
|
+
disallowPast: s,
|
|
80
|
+
disallowFuture: n,
|
|
81
|
+
required: i,
|
|
82
|
+
minDate: c
|
|
82
83
|
})) return;
|
|
83
|
-
if (!
|
|
84
|
-
|
|
84
|
+
if (!t.replace(/\D/g, "").length) {
|
|
85
|
+
g?.(void 0);
|
|
85
86
|
return;
|
|
86
87
|
}
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
return /* @__PURE__ */
|
|
88
|
+
const u = oe(t, "dd/MM/yyyy", /* @__PURE__ */ new Date());
|
|
89
|
+
g?.(de(u) ? u : void 0);
|
|
90
|
+
};
|
|
91
|
+
return /* @__PURE__ */ D("div", {
|
|
91
92
|
className: "cursor-default",
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
93
|
+
"data-field-width": y,
|
|
94
|
+
style: Z(y),
|
|
95
|
+
children: [
|
|
96
|
+
h && /* @__PURE__ */ d("div", {
|
|
97
|
+
id: T,
|
|
98
|
+
className: w({ disabled: m.disabled }),
|
|
99
|
+
children: h
|
|
100
|
+
}),
|
|
101
|
+
f && /* @__PURE__ */ d("div", {
|
|
102
|
+
className: w({ disabled: m.disabled }),
|
|
103
|
+
children: /* @__PURE__ */ D("label", {
|
|
104
|
+
htmlFor: P,
|
|
105
|
+
children: [f, i && /* @__PURE__ */ d("span", {
|
|
106
|
+
"aria-hidden": "true",
|
|
107
|
+
children: " *"
|
|
108
|
+
})]
|
|
109
|
+
})
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ D("div", {
|
|
112
|
+
className: "flex items-start gap-1",
|
|
113
|
+
children: [/* @__PURE__ */ d("div", {
|
|
114
|
+
className: "min-w-0 flex-1",
|
|
115
|
+
children: /* @__PURE__ */ d("div", {
|
|
116
|
+
className: "relative",
|
|
117
|
+
children: /* @__PURE__ */ d($, {
|
|
118
|
+
...m,
|
|
119
|
+
id: P,
|
|
120
|
+
readOnly: l,
|
|
121
|
+
"data-testid": m.dataTest,
|
|
122
|
+
autoComplete: "off",
|
|
123
|
+
inputRef: l ? void 0 : W,
|
|
124
|
+
placeholder: !l && !K ? " / / " : void 0,
|
|
125
|
+
size: "small",
|
|
126
|
+
value: l ? t.replaceAll("/", ".") : t,
|
|
127
|
+
className: B,
|
|
128
|
+
error: I,
|
|
129
|
+
onBlur: l ? void 0 : X,
|
|
130
|
+
helperText: J,
|
|
131
|
+
slotProps: {
|
|
132
|
+
formHelperText: { sx: {
|
|
133
|
+
marginTop: "4px",
|
|
134
|
+
marginLeft: 0,
|
|
135
|
+
marginRight: 0
|
|
136
|
+
} },
|
|
137
|
+
htmlInput: {
|
|
138
|
+
"aria-required": i ? !0 : void 0,
|
|
139
|
+
...te({
|
|
140
|
+
title: h,
|
|
141
|
+
titleId: T,
|
|
142
|
+
label: f,
|
|
143
|
+
inputAriaProps: R
|
|
144
|
+
}),
|
|
145
|
+
...l ? {} : {
|
|
146
|
+
inputMode: "numeric",
|
|
147
|
+
style: { fontFamily: ae }
|
|
148
|
+
}
|
|
134
149
|
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
150
|
+
},
|
|
151
|
+
onChange: Q
|
|
152
|
+
})
|
|
138
153
|
})
|
|
139
|
-
})
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
})
|
|
145
|
-
|
|
154
|
+
}), !S && !l && /* @__PURE__ */ d(ee, {
|
|
155
|
+
onClick: Y,
|
|
156
|
+
disabled: !!m.disabled,
|
|
157
|
+
localeCode: r?.code
|
|
158
|
+
})]
|
|
159
|
+
})
|
|
160
|
+
]
|
|
146
161
|
});
|
|
147
162
|
};
|
|
148
163
|
export {
|
|
149
|
-
|
|
164
|
+
xe as BaseDatePickerInput
|
|
150
165
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { BaseDatePickerInput as
|
|
3
|
-
import
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { addDays as
|
|
6
|
-
var
|
|
7
|
-
const { dataTest:
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
"data-testid":
|
|
10
|
-
className: C
|
|
11
|
-
children: [/* @__PURE__ */ x
|
|
1
|
+
import u from "./DatePickerInputRangeCompact.module.js";
|
|
2
|
+
import { BaseDatePickerInput as x } from "./BaseDatePickerInput.js";
|
|
3
|
+
import F from "clsx";
|
|
4
|
+
import { jsx as g, jsxs as y } from "react/jsx-runtime";
|
|
5
|
+
import { addDays as h } from "date-fns";
|
|
6
|
+
var N = ({ datePickerProps: b, onClick: l }) => {
|
|
7
|
+
const { dataTest: D, className: C, inputClassName: i, disabled: a, readOnly: m, dateFormat: d, onInputChange: o, hideCalendar: s, locale: p, selected: t, disabledDays: n, validateOnCalendarClose: T, onValidatedOnce: c, width: f, ...e } = b;
|
|
8
|
+
return /* @__PURE__ */ y("div", {
|
|
9
|
+
"data-testid": D,
|
|
10
|
+
className: F(C, u["styled-date-picker-input-range-compact"], a && u["range-compact-disabled"]),
|
|
11
|
+
children: [/* @__PURE__ */ g(x, {
|
|
12
12
|
dataTest: "styled-date-picker-input-range-from",
|
|
13
13
|
dateFormat: d,
|
|
14
14
|
selected: t?.from,
|
|
@@ -19,7 +19,7 @@ var v = ({ datePickerProps: h, onClick: l }) => {
|
|
|
19
19
|
onInputChange: (r) => {
|
|
20
20
|
r && t?.to && r.getTime() > t?.to.getTime() ? o?.({
|
|
21
21
|
from: r,
|
|
22
|
-
to:
|
|
22
|
+
to: h(r, 1)
|
|
23
23
|
}) : o?.({
|
|
24
24
|
from: r,
|
|
25
25
|
to: t?.to
|
|
@@ -30,13 +30,14 @@ var v = ({ datePickerProps: h, onClick: l }) => {
|
|
|
30
30
|
disabledDays: n,
|
|
31
31
|
validateOnCalendarClose: T,
|
|
32
32
|
onValidatedOnce: c,
|
|
33
|
+
width: f,
|
|
33
34
|
label: e.labelFrom,
|
|
34
35
|
error: e.errorFrom,
|
|
35
36
|
helperText: e.helperTextFrom,
|
|
36
37
|
errorText: e.errorTextFrom,
|
|
37
38
|
title: e.titleFrom,
|
|
38
39
|
hideDefaultHelperText: e.hideDefaultHelperTextFrom
|
|
39
|
-
}), /* @__PURE__ */ x
|
|
40
|
+
}), /* @__PURE__ */ g(x, {
|
|
40
41
|
dataTest: "styled-date-picker-input-range-to",
|
|
41
42
|
dateFormat: d,
|
|
42
43
|
selected: t?.to,
|
|
@@ -46,7 +47,7 @@ var v = ({ datePickerProps: h, onClick: l }) => {
|
|
|
46
47
|
onClick: l,
|
|
47
48
|
onInputChange: (r) => {
|
|
48
49
|
r && t?.from && r.getTime() < t?.from.getTime() ? o?.({
|
|
49
|
-
from:
|
|
50
|
+
from: h(r, -1),
|
|
50
51
|
to: r
|
|
51
52
|
}) : o?.({
|
|
52
53
|
from: t?.from,
|
|
@@ -58,6 +59,7 @@ var v = ({ datePickerProps: h, onClick: l }) => {
|
|
|
58
59
|
disabledDays: n,
|
|
59
60
|
validateOnCalendarClose: T,
|
|
60
61
|
onValidatedOnce: c,
|
|
62
|
+
width: f,
|
|
61
63
|
label: e.labelTo,
|
|
62
64
|
error: e.errorTo,
|
|
63
65
|
helperText: e.helperTextTo,
|
|
@@ -68,5 +70,5 @@ var v = ({ datePickerProps: h, onClick: l }) => {
|
|
|
68
70
|
});
|
|
69
71
|
};
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
N as DatePickerInputRangeCompact
|
|
72
74
|
};
|
package/dist/datetime/components/date-picker/components/DatePickerInputRangeCompact.module.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var a = {
|
|
2
|
-
"styled-date-picker-input-range-compact": "_styled-date-picker-input-range-
|
|
3
|
-
"range-compact-disabled": "_range-compact-
|
|
2
|
+
"styled-date-picker-input-range-compact": "_styled-date-picker-input-range-compact_1asiz_1",
|
|
3
|
+
"range-compact-disabled": "_range-compact-disabled_1asiz_4"
|
|
4
4
|
};
|
|
5
5
|
export {
|
|
6
6
|
a as default
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BaseDatePickerInput as v } from "./BaseDatePickerInput.js";
|
|
2
|
-
import { jsx as
|
|
3
|
-
var
|
|
4
|
-
const { inputClassName: r, disabled: t, helperText: l, label: d, error: i, locale: n, hideCalendar: o, dateFormat: s, disabledDays: p, dataTest: u, readOnly: m, errorText: c, disallowFuture:
|
|
5
|
-
return /* @__PURE__ */
|
|
2
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
3
|
+
var q = ({ datePickerProps: e, onClick: a }) => {
|
|
4
|
+
const { inputClassName: r, disabled: t, helperText: l, label: d, error: i, locale: n, hideCalendar: o, dateFormat: s, disabledDays: p, dataTest: u, readOnly: m, errorText: c, disallowFuture: h, disallowPast: C, required: x, minDate: D, validateOnCalendarClose: b, onValidatedOnce: I, onInputChange: P, selected: T, title: f, hideDefaultHelperText: g, inputAriaProps: w, width: O } = e;
|
|
5
|
+
return /* @__PURE__ */ y(v, {
|
|
6
6
|
dataTest: u,
|
|
7
7
|
inputClassName: r,
|
|
8
8
|
readOnly: m,
|
|
@@ -18,17 +18,18 @@ var j = ({ datePickerProps: e, onClick: a }) => {
|
|
|
18
18
|
disabledDays: p,
|
|
19
19
|
label: d,
|
|
20
20
|
errorText: c,
|
|
21
|
-
disallowFuture:
|
|
22
|
-
disallowPast:
|
|
21
|
+
disallowFuture: h,
|
|
22
|
+
disallowPast: C,
|
|
23
23
|
required: x,
|
|
24
24
|
minDate: D,
|
|
25
25
|
validateOnCalendarClose: b,
|
|
26
26
|
onValidatedOnce: I,
|
|
27
27
|
title: f,
|
|
28
28
|
hideDefaultHelperText: g,
|
|
29
|
-
inputAriaProps:
|
|
29
|
+
inputAriaProps: w,
|
|
30
|
+
width: O
|
|
30
31
|
});
|
|
31
32
|
};
|
|
32
33
|
export {
|
|
33
|
-
|
|
34
|
+
q as DatePickerInputSingle
|
|
34
35
|
};
|
|
@@ -1,35 +1,38 @@
|
|
|
1
|
-
import { StyledSelect as
|
|
1
|
+
import { StyledSelect as c } from "../../../../components/inputs/select/StyledSelect.js";
|
|
2
2
|
import { StyledSelectItem as p } from "../../../../components/inputs/select/StyledSelectItem.js";
|
|
3
|
-
import { StyledFormControl as
|
|
3
|
+
import { StyledFormControl as h } from "../../../../components/miscellaneous/StyledFormControl.js";
|
|
4
4
|
import u from "./StyledCalendarPickerSelectPeriod.module.js";
|
|
5
5
|
import { jsx as l } from "react/jsx-runtime";
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
const { options:
|
|
9
|
-
return /* @__PURE__ */ l(
|
|
6
|
+
var S = (a) => a.charAt(0).toUpperCase() + a.slice(1).toLowerCase();
|
|
7
|
+
function x(a) {
|
|
8
|
+
const { options: t = [], onChange: r, value: i, disabled: d, className: n, style: o, name: m } = a, s = a["aria-label"];
|
|
9
|
+
return /* @__PURE__ */ l(h, {
|
|
10
10
|
style: {
|
|
11
|
+
display: "inline-flex",
|
|
12
|
+
width: "auto",
|
|
13
|
+
maxWidth: "none",
|
|
11
14
|
marginLeft: "-2px",
|
|
12
15
|
marginRight: "4px"
|
|
13
16
|
},
|
|
14
|
-
children: /* @__PURE__ */ l(
|
|
17
|
+
children: /* @__PURE__ */ l(c, {
|
|
15
18
|
dataTest: "StyledCalendarPickerSelectMonth",
|
|
16
19
|
size: "small",
|
|
17
20
|
variant: "standard",
|
|
18
|
-
name:
|
|
19
|
-
disabled:
|
|
21
|
+
name: s ?? m,
|
|
22
|
+
disabled: d,
|
|
20
23
|
className: n,
|
|
21
24
|
style: o,
|
|
22
|
-
value:
|
|
23
|
-
onChange: (e) =>
|
|
25
|
+
value: i ?? "",
|
|
26
|
+
onChange: (e) => r?.(e),
|
|
24
27
|
MenuProps: { className: u["styled-calendar-picker-select-period-menu"] },
|
|
25
|
-
children:
|
|
28
|
+
children: t.map((e) => /* @__PURE__ */ l(p, {
|
|
26
29
|
value: e.value,
|
|
27
30
|
disabled: e.disabled,
|
|
28
|
-
children:
|
|
31
|
+
children: S(e.label)
|
|
29
32
|
}, e.value))
|
|
30
33
|
})
|
|
31
34
|
});
|
|
32
35
|
}
|
|
33
36
|
export {
|
|
34
|
-
|
|
37
|
+
x as StyledCalendarPickerSelectMonth
|
|
35
38
|
};
|
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { StyledSelect as
|
|
1
|
+
import { StyledSelect as c } from "../../../../components/inputs/select/StyledSelect.js";
|
|
2
2
|
import { StyledSelectItem as u } from "../../../../components/inputs/select/StyledSelectItem.js";
|
|
3
3
|
import { StyledFormControl as S } from "../../../../components/miscellaneous/StyledFormControl.js";
|
|
4
4
|
import y from "./StyledCalendarPickerSelectPeriod.module.js";
|
|
5
5
|
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
-
function
|
|
7
|
-
const { options: r = [], onChange: t, value: d, disabled:
|
|
6
|
+
function C(l) {
|
|
7
|
+
const { options: r = [], onChange: t, value: d, disabled: i, className: n, style: m, name: o } = l, s = l["aria-label"];
|
|
8
8
|
return /* @__PURE__ */ a(S, {
|
|
9
|
-
style: {
|
|
10
|
-
|
|
9
|
+
style: {
|
|
10
|
+
display: "inline-flex",
|
|
11
|
+
width: "auto",
|
|
12
|
+
maxWidth: "none",
|
|
13
|
+
marginLeft: "4px"
|
|
14
|
+
},
|
|
15
|
+
children: /* @__PURE__ */ a(c, {
|
|
11
16
|
dataTest: "StyledCalendarPickerSelectYear",
|
|
12
17
|
size: "small",
|
|
13
18
|
variant: "standard",
|
|
14
|
-
name: s ??
|
|
15
|
-
disabled:
|
|
16
|
-
className:
|
|
19
|
+
name: s ?? o,
|
|
20
|
+
disabled: i,
|
|
21
|
+
className: n,
|
|
17
22
|
style: m,
|
|
18
23
|
value: d ?? "",
|
|
19
24
|
onChange: (e) => t?.(e),
|
|
@@ -27,5 +32,5 @@ function h(l) {
|
|
|
27
32
|
});
|
|
28
33
|
}
|
|
29
34
|
export {
|
|
30
|
-
|
|
35
|
+
C as StyledCalendarPickerSelectYear
|
|
31
36
|
};
|