asma-ui-core 3.130.1 → 3.130.3
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/inputs/emoji-choice/StyledEmojiChoice.js +162 -172
- package/dist/datetime/components/date-picker/components/StyledCalendarPicker.module.js +17 -18
- package/dist/datetime/components/date-picker/components/StyledDayPicker.js +10 -9
- package/dist/src/components/inputs/emoji-choice/StyledEmojiChoice.d.ts +3 -2
- package/dist/table/components/columns/action-column/components/RowActionMenu.js +71 -60
- package/dist/table/shared-components/StyledMenuItem.js +16 -16
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { cn as
|
|
2
|
-
import { ChevronDownIcon as
|
|
3
|
-
import { CloseIcon as
|
|
4
|
-
import { StyledButton as
|
|
5
|
-
import { StyledRadio as
|
|
6
|
-
import { HelperRow as
|
|
7
|
-
import { useHelperSlot as
|
|
8
|
-
import { StyledInputField as
|
|
9
|
-
import { getPickerText as
|
|
10
|
-
import { StyledSelectAutocomplete as
|
|
1
|
+
import { cn as h } from "../../../helpers/cn.js";
|
|
2
|
+
import { ChevronDownIcon as q } from "../../icons/chevron-down-icon/ChevronDownIcon.js";
|
|
3
|
+
import { CloseIcon as D } from "../../icons/close-icon/CloseIcon.js";
|
|
4
|
+
import { StyledButton as _ } from "../button/StyledButton.js";
|
|
5
|
+
import { StyledRadio as E } from "../radio-button/base-ui/StyledRadio.js";
|
|
6
|
+
import { HelperRow as L } from "../../../helpers/HelperRow.js";
|
|
7
|
+
import { useHelperSlot as F } from "../../../helpers/useHelperSlot.js";
|
|
8
|
+
import { StyledInputField as M } from "../input-field/StyledInputField.js";
|
|
9
|
+
import { getPickerText as V } from "../full-screen-picker/pickerCopy.js";
|
|
10
|
+
import { StyledSelectAutocomplete as K } from "../select-autocomplete/StyledSelectAutocomplete.js";
|
|
11
11
|
import a from "./StyledEmojiChoice.module.js";
|
|
12
|
-
import { useId as
|
|
13
|
-
import { jsx as l, jsxs as
|
|
14
|
-
var
|
|
12
|
+
import { useId as S, useRef as x, useState as P } from "react";
|
|
13
|
+
import { jsx as l, jsxs as v } from "react/jsx-runtime";
|
|
14
|
+
var X = {
|
|
15
15
|
en: {
|
|
16
16
|
noAnswer: "No answer",
|
|
17
17
|
showAllOptions: (e) => `Show all options (${e})`,
|
|
@@ -28,7 +28,7 @@ var G = {
|
|
|
28
28
|
option: (e) => `Alternativ ${e}`,
|
|
29
29
|
clearSelection: "Fjern valget"
|
|
30
30
|
}
|
|
31
|
-
},
|
|
31
|
+
}, B = 5, k = (e, n, i) => e.label ? e.label : e.emoji ? e.emoji : i.option(n), H = ({ option: e, className: n }) => e.emoji ? /* @__PURE__ */ l("span", {
|
|
32
32
|
"aria-hidden": "true",
|
|
33
33
|
className: n,
|
|
34
34
|
children: e.emoji
|
|
@@ -36,13 +36,13 @@ var G = {
|
|
|
36
36
|
alt: "",
|
|
37
37
|
src: e.emojiImageSrc,
|
|
38
38
|
className: n
|
|
39
|
-
}) : null,
|
|
40
|
-
const
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
className:
|
|
43
|
-
children: [/* @__PURE__ */
|
|
39
|
+
}) : null, C = ({ option: e, position: n, text: i, radio: p }) => {
|
|
40
|
+
const u = !!e.emoji || !!e.emojiImageSrc;
|
|
41
|
+
return /* @__PURE__ */ v("span", {
|
|
42
|
+
className: h(a.content, !u && a.noEmoji),
|
|
43
|
+
children: [/* @__PURE__ */ v("span", {
|
|
44
44
|
className: a.lead,
|
|
45
|
-
children: [
|
|
45
|
+
children: [p, u && /* @__PURE__ */ l("span", {
|
|
46
46
|
className: a.emojiSlot,
|
|
47
47
|
children: /* @__PURE__ */ l(H, {
|
|
48
48
|
option: e,
|
|
@@ -54,240 +54,230 @@ var G = {
|
|
|
54
54
|
children: e.label
|
|
55
55
|
}) : /* @__PURE__ */ l("span", {
|
|
56
56
|
className: "sr-only",
|
|
57
|
-
children:
|
|
57
|
+
children: k(e, n, i)
|
|
58
58
|
})]
|
|
59
59
|
});
|
|
60
|
-
},
|
|
60
|
+
}, G = ({ dataTest: e, text: n, onClear: i, focusAfter: p }) => /* @__PURE__ */ l(_, {
|
|
61
61
|
dataTest: `${e}-clear`,
|
|
62
62
|
variant: "text",
|
|
63
63
|
type: "button",
|
|
64
64
|
className: a.clear,
|
|
65
|
-
startIcon: /* @__PURE__ */ l(
|
|
65
|
+
startIcon: /* @__PURE__ */ l(D, {
|
|
66
66
|
width: 24,
|
|
67
67
|
height: 24
|
|
68
68
|
}),
|
|
69
69
|
onClick: () => {
|
|
70
|
-
|
|
70
|
+
i(), p()?.focus({ preventScroll: !0 });
|
|
71
71
|
},
|
|
72
72
|
children: n.clearSelection
|
|
73
|
-
}),
|
|
73
|
+
}), z = (e) => {
|
|
74
74
|
e.key === "Enter" && (e.preventDefault(), e.currentTarget.click());
|
|
75
|
-
},
|
|
76
|
-
const
|
|
77
|
-
return /* @__PURE__ */
|
|
78
|
-
ref:
|
|
75
|
+
}, J = ({ dataTest: e, options: n, value: i, onValueChange: p, onClear: u, question: w, "aria-labelledby": c, name: f, error: y, helperText: g, className: b, text: O }) => {
|
|
76
|
+
const o = S(), t = S(), N = x(null), { show: I, role: j } = F("StyledEmojiChoice", y, g), d = n.some((m) => m.value === i);
|
|
77
|
+
return /* @__PURE__ */ v("fieldset", {
|
|
78
|
+
ref: N,
|
|
79
79
|
tabIndex: -1,
|
|
80
80
|
role: "group",
|
|
81
81
|
"aria-labelledby": c,
|
|
82
|
-
"aria-describedby":
|
|
82
|
+
"aria-describedby": I ? t : void 0,
|
|
83
83
|
"data-testid": e,
|
|
84
|
-
className:
|
|
84
|
+
className: h(a.group, b),
|
|
85
85
|
children: [
|
|
86
86
|
!c && /* @__PURE__ */ l("legend", {
|
|
87
87
|
className: a.question,
|
|
88
|
-
children:
|
|
88
|
+
children: w
|
|
89
89
|
}),
|
|
90
90
|
/* @__PURE__ */ l("div", {
|
|
91
91
|
className: a.options,
|
|
92
|
-
children: n.map((
|
|
93
|
-
const
|
|
94
|
-
return /* @__PURE__ */
|
|
95
|
-
"data-testid": `${e}-option-${
|
|
96
|
-
className:
|
|
92
|
+
children: n.map((m, A) => {
|
|
93
|
+
const r = m.value === i;
|
|
94
|
+
return /* @__PURE__ */ v("label", {
|
|
95
|
+
"data-testid": `${e}-option-${A}`,
|
|
96
|
+
className: h(a.card, a.choice, !m.label && a.fit),
|
|
97
97
|
children: [/* @__PURE__ */ l("input", {
|
|
98
98
|
type: "radio",
|
|
99
99
|
className: "sr-only",
|
|
100
|
-
name:
|
|
101
|
-
value:
|
|
102
|
-
checked:
|
|
103
|
-
onChange: () =>
|
|
104
|
-
onKeyDown:
|
|
100
|
+
name: f ?? o,
|
|
101
|
+
value: m.value,
|
|
102
|
+
checked: r,
|
|
103
|
+
onChange: () => p?.(m.value, m),
|
|
104
|
+
onKeyDown: z
|
|
105
105
|
}), /* @__PURE__ */ l("span", {
|
|
106
106
|
className: a.body,
|
|
107
|
-
children: /* @__PURE__ */ l(
|
|
108
|
-
option:
|
|
109
|
-
position:
|
|
110
|
-
text:
|
|
111
|
-
radio: /* @__PURE__ */ l(
|
|
107
|
+
children: /* @__PURE__ */ l(C, {
|
|
108
|
+
option: m,
|
|
109
|
+
position: A + 1,
|
|
110
|
+
text: O,
|
|
111
|
+
radio: /* @__PURE__ */ l(E, {
|
|
112
112
|
decorative: !0,
|
|
113
|
-
checked:
|
|
113
|
+
checked: r
|
|
114
114
|
})
|
|
115
115
|
})
|
|
116
116
|
})]
|
|
117
|
-
}, `${
|
|
117
|
+
}, `${A}-${m.value}`);
|
|
118
118
|
})
|
|
119
119
|
}),
|
|
120
|
-
|
|
120
|
+
u && d && /* @__PURE__ */ l(G, {
|
|
121
121
|
dataTest: e,
|
|
122
|
-
text:
|
|
123
|
-
onClear:
|
|
124
|
-
focusAfter: () =>
|
|
122
|
+
text: O,
|
|
123
|
+
onClear: u,
|
|
124
|
+
focusAfter: () => N.current
|
|
125
125
|
}),
|
|
126
|
-
|
|
127
|
-
id:
|
|
128
|
-
role:
|
|
129
|
-
error:
|
|
130
|
-
message:
|
|
131
|
-
className:
|
|
126
|
+
I && /* @__PURE__ */ l(L, {
|
|
127
|
+
id: t,
|
|
128
|
+
role: j,
|
|
129
|
+
error: y,
|
|
130
|
+
message: g,
|
|
131
|
+
className: h("m-0", y && "font-medium")
|
|
132
132
|
})
|
|
133
133
|
]
|
|
134
134
|
});
|
|
135
|
-
},
|
|
136
|
-
const
|
|
137
|
-
return /* @__PURE__ */
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
radio: /* @__PURE__ */ l(T, {
|
|
177
|
-
decorative: !0,
|
|
178
|
-
checked: P.selected
|
|
179
|
-
})
|
|
135
|
+
}, Q = ({ dataTest: e, options: n, value: i, onValueChange: p, onClear: u, question: w, "aria-labelledby": c, error: f, helperText: y, placeholder: g, locale: b, className: O, text: o }) => {
|
|
136
|
+
const t = S(), [N, I] = P(null), j = x(!1), d = n.find((r) => r.value === i) ?? null, m = d ? k(d, n.indexOf(d) + 1, o) : "", A = N === null && d !== null && (d.label !== "" || !d.emoji);
|
|
137
|
+
return /* @__PURE__ */ v("div", {
|
|
138
|
+
className: h(a.dropdown, O),
|
|
139
|
+
children: [!c && /* @__PURE__ */ l("span", {
|
|
140
|
+
id: t,
|
|
141
|
+
className: a.question,
|
|
142
|
+
children: w
|
|
143
|
+
}), /* @__PURE__ */ l(K, {
|
|
144
|
+
dataTest: e,
|
|
145
|
+
options: n,
|
|
146
|
+
value: d,
|
|
147
|
+
onChange: (r, s) => {
|
|
148
|
+
s ? p?.(s.value, s) : u?.();
|
|
149
|
+
},
|
|
150
|
+
getOptionLabel: (r) => k(r, n.indexOf(r) + 1, o),
|
|
151
|
+
getOptionKey: (r) => r.value,
|
|
152
|
+
isOptionEqualToValue: (r, s) => r.value === s.value,
|
|
153
|
+
inputValue: N ?? m,
|
|
154
|
+
onInputChange: (r, s, $) => I($ === "input" ? s : null),
|
|
155
|
+
onClose: () => I(null),
|
|
156
|
+
disableClearable: !u,
|
|
157
|
+
error: f,
|
|
158
|
+
helperText: y,
|
|
159
|
+
pickerTitle: w,
|
|
160
|
+
locale: b,
|
|
161
|
+
noOptionsText: V(b ?? "en").noMatches,
|
|
162
|
+
maxListHeight: 322,
|
|
163
|
+
slotProps: { popper: { className: a.menu } },
|
|
164
|
+
renderOption: ({ key: r, className: s, ...$ }, R, T) => /* @__PURE__ */ l("li", {
|
|
165
|
+
...$,
|
|
166
|
+
className: h(a.menuOption, T.inPicker && a.pickerOption),
|
|
167
|
+
children: /* @__PURE__ */ l("span", {
|
|
168
|
+
className: h(a.card, a.body),
|
|
169
|
+
children: /* @__PURE__ */ l(C, {
|
|
170
|
+
option: R,
|
|
171
|
+
position: n.indexOf(R) + 1,
|
|
172
|
+
text: o,
|
|
173
|
+
radio: /* @__PURE__ */ l(E, {
|
|
174
|
+
decorative: !0,
|
|
175
|
+
checked: T.selected
|
|
180
176
|
})
|
|
181
177
|
})
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
178
|
+
})
|
|
179
|
+
}, r),
|
|
180
|
+
renderInput: (r) => /* @__PURE__ */ l(M, {
|
|
181
|
+
...r,
|
|
182
|
+
dataTest: `${e}-input`,
|
|
183
|
+
placeholder: g,
|
|
184
|
+
onFocus: (s) => {
|
|
185
|
+
r.onFocus?.(), s.currentTarget.select(), j.current = !0;
|
|
186
|
+
},
|
|
187
|
+
onClick: (s) => {
|
|
188
|
+
j.current && s.target instanceof HTMLInputElement && s.target.select(), j.current = !1;
|
|
189
|
+
},
|
|
190
|
+
slotProps: {
|
|
191
|
+
htmlInput: {
|
|
192
|
+
...r.slotProps.htmlInput,
|
|
193
|
+
"aria-labelledby": c ?? t
|
|
192
194
|
},
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
...t.slotProps.input,
|
|
200
|
-
startAdornment: r && C ? /* @__PURE__ */ l(H, {
|
|
201
|
-
option: r,
|
|
202
|
-
className: a.fieldEmoji
|
|
203
|
-
}) : void 0
|
|
204
|
-
}
|
|
195
|
+
input: {
|
|
196
|
+
...r.slotProps.input,
|
|
197
|
+
startAdornment: d && A ? /* @__PURE__ */ l(H, {
|
|
198
|
+
option: d,
|
|
199
|
+
className: a.fieldEmoji
|
|
200
|
+
}) : void 0
|
|
205
201
|
}
|
|
206
|
-
}
|
|
207
|
-
}),
|
|
208
|
-
m && r && /* @__PURE__ */ l(D, {
|
|
209
|
-
dataTest: e,
|
|
210
|
-
text: d,
|
|
211
|
-
onClear: m,
|
|
212
|
-
focusAfter: () => v.current?.querySelector("input")
|
|
202
|
+
}
|
|
213
203
|
})
|
|
214
|
-
]
|
|
204
|
+
})]
|
|
215
205
|
});
|
|
216
|
-
},
|
|
217
|
-
const [
|
|
218
|
-
return /* @__PURE__ */
|
|
206
|
+
}, U = ({ dataTest: e, options: n, value: i, question: p, "aria-labelledby": u, className: w, text: c }) => {
|
|
207
|
+
const [f, y] = P(!1), g = S(), b = S(), O = S(), o = n.find((t) => t.value === i);
|
|
208
|
+
return /* @__PURE__ */ v("dl", {
|
|
219
209
|
"data-testid": e,
|
|
220
|
-
className:
|
|
210
|
+
className: h(a.readOnly, w),
|
|
221
211
|
children: [/* @__PURE__ */ l("dt", {
|
|
222
|
-
id:
|
|
223
|
-
className:
|
|
224
|
-
children:
|
|
225
|
-
}), /* @__PURE__ */
|
|
212
|
+
id: g,
|
|
213
|
+
className: u ? "sr-only" : a.question,
|
|
214
|
+
children: p
|
|
215
|
+
}), /* @__PURE__ */ v("dd", {
|
|
226
216
|
className: a.readOnlyAnswer,
|
|
227
|
-
children: [/* @__PURE__ */
|
|
217
|
+
children: [/* @__PURE__ */ v("div", {
|
|
228
218
|
className: a.readOnlyCard,
|
|
229
|
-
children: [
|
|
230
|
-
option:
|
|
231
|
-
position: n.indexOf(
|
|
219
|
+
children: [o ? /* @__PURE__ */ l(C, {
|
|
220
|
+
option: o,
|
|
221
|
+
position: n.indexOf(o) + 1,
|
|
232
222
|
text: c
|
|
233
223
|
}) : /* @__PURE__ */ l("span", {
|
|
234
224
|
className: a.noAnswer,
|
|
235
225
|
children: c.noAnswer
|
|
236
|
-
}), n.length > 0 && /* @__PURE__ */ l(
|
|
226
|
+
}), n.length > 0 && /* @__PURE__ */ l(_, {
|
|
237
227
|
dataTest: `${e}-show-all`,
|
|
238
228
|
variant: "text",
|
|
239
229
|
type: "button",
|
|
240
230
|
className: a.showAll,
|
|
241
|
-
"aria-expanded":
|
|
242
|
-
"aria-controls":
|
|
243
|
-
"aria-labelledby": `${
|
|
244
|
-
endIcon: /* @__PURE__ */ l(
|
|
231
|
+
"aria-expanded": f,
|
|
232
|
+
"aria-controls": O,
|
|
233
|
+
"aria-labelledby": `${b} ${g}`,
|
|
234
|
+
endIcon: /* @__PURE__ */ l(q, {
|
|
245
235
|
width: 24,
|
|
246
236
|
height: 24,
|
|
247
|
-
className:
|
|
237
|
+
className: h(f && "flip-180")
|
|
248
238
|
}),
|
|
249
|
-
onClick: () =>
|
|
239
|
+
onClick: () => y(!f),
|
|
250
240
|
children: /* @__PURE__ */ l("span", {
|
|
251
|
-
id:
|
|
252
|
-
children:
|
|
241
|
+
id: b,
|
|
242
|
+
children: f ? c.hideOptions : c.showAllOptions(n.length)
|
|
253
243
|
})
|
|
254
244
|
})]
|
|
255
245
|
}), /* @__PURE__ */ l("ul", {
|
|
256
|
-
id:
|
|
257
|
-
hidden: !
|
|
246
|
+
id: O,
|
|
247
|
+
hidden: !f,
|
|
258
248
|
className: a.options,
|
|
259
|
-
children: n.map((
|
|
260
|
-
className:
|
|
261
|
-
children: [/* @__PURE__ */ l(
|
|
262
|
-
option:
|
|
263
|
-
position:
|
|
249
|
+
children: n.map((t, N) => /* @__PURE__ */ v("li", {
|
|
250
|
+
className: h(a.card, a.body, !t.label && a.fit),
|
|
251
|
+
children: [/* @__PURE__ */ l(C, {
|
|
252
|
+
option: t,
|
|
253
|
+
position: N + 1,
|
|
264
254
|
text: c,
|
|
265
|
-
radio: /* @__PURE__ */ l(
|
|
255
|
+
radio: /* @__PURE__ */ l(E, {
|
|
266
256
|
decorative: !0,
|
|
267
257
|
readOnly: !0,
|
|
268
|
-
checked:
|
|
258
|
+
checked: t === o
|
|
269
259
|
})
|
|
270
|
-
}),
|
|
260
|
+
}), t === o && /* @__PURE__ */ l("span", {
|
|
271
261
|
className: "sr-only",
|
|
272
262
|
children: `, ${c.selected}`
|
|
273
263
|
})]
|
|
274
|
-
}, `${
|
|
264
|
+
}, `${N}-${t.value}`))
|
|
275
265
|
})]
|
|
276
266
|
})]
|
|
277
267
|
});
|
|
278
|
-
},
|
|
279
|
-
const n =
|
|
280
|
-
return e.readOnly ? /* @__PURE__ */ l(
|
|
268
|
+
}, de = (e) => {
|
|
269
|
+
const n = X[e.locale ?? "en"];
|
|
270
|
+
return e.readOnly ? /* @__PURE__ */ l(U, {
|
|
281
271
|
...e,
|
|
282
272
|
text: n
|
|
283
|
-
}) : e.options.length >
|
|
273
|
+
}) : e.options.length > B ? /* @__PURE__ */ l(Q, {
|
|
284
274
|
...e,
|
|
285
275
|
text: n
|
|
286
|
-
}) : /* @__PURE__ */ l(
|
|
276
|
+
}) : /* @__PURE__ */ l(J, {
|
|
287
277
|
...e,
|
|
288
278
|
text: n
|
|
289
279
|
});
|
|
290
280
|
};
|
|
291
281
|
export {
|
|
292
|
-
|
|
282
|
+
de as StyledEmojiChoice
|
|
293
283
|
};
|
|
@@ -1,31 +1,30 @@
|
|
|
1
|
-
var _ = "
|
|
2
|
-
"styled-calendar-day-picker": "_styled-calendar-day-
|
|
1
|
+
var _ = "_months_1178a_12", a = "_month_1178a_12", e = "_caption_1178a_25", d = "_caption_label_1178a_29", r = "_nav_1178a_34", n = "_nav_button_1178a_38", t = "_nav_button_previous_1178a_44", v = "_nav_button_next_1178a_48", l = "_head_row_1178a_52", o = "_head_cell_1178a_56", y = "_row_1178a_65", i = "_cell_1178a_69", s = "_has_1178a_72", c = "_first_1178a_75", u = "_last_1178a_78", b = "_day_1178a_82", h = "_day_today_1178a_93", p = "_day_selected_1178a_99", m = "_day_outside_1178a_120", w = "_day_range_middle_1178a_126", k = "_day_disabled_1178a_134", f = "_day_hidden_1178a_172", g = "_weeknumber_1178a_176", x = "_caption_end_1178a_188", C = {
|
|
2
|
+
"styled-calendar-day-picker": "_styled-calendar-day-picker_1178a_1",
|
|
3
3
|
months: _,
|
|
4
|
-
month:
|
|
5
|
-
caption:
|
|
6
|
-
caption_label:
|
|
7
|
-
nav:
|
|
8
|
-
nav_button:
|
|
9
|
-
nav_button_previous:
|
|
10
|
-
nav_button_next:
|
|
11
|
-
head_row:
|
|
12
|
-
head_cell:
|
|
13
|
-
row:
|
|
4
|
+
month: a,
|
|
5
|
+
caption: e,
|
|
6
|
+
caption_label: d,
|
|
7
|
+
nav: r,
|
|
8
|
+
nav_button: n,
|
|
9
|
+
nav_button_previous: t,
|
|
10
|
+
nav_button_next: v,
|
|
11
|
+
head_row: l,
|
|
12
|
+
head_cell: o,
|
|
13
|
+
row: y,
|
|
14
14
|
cell: i,
|
|
15
15
|
has: s,
|
|
16
|
-
first:
|
|
17
|
-
last:
|
|
18
|
-
day:
|
|
19
|
-
"focus-visible": "_focus-visible_t2tb0_88",
|
|
16
|
+
first: c,
|
|
17
|
+
last: u,
|
|
18
|
+
day: b,
|
|
20
19
|
day_today: h,
|
|
21
20
|
day_selected: p,
|
|
22
|
-
"rdp-day_range_end": "_rdp-
|
|
21
|
+
"rdp-day_range_end": "_rdp-day_range_end_1178a_120",
|
|
23
22
|
day_outside: m,
|
|
24
23
|
day_range_middle: w,
|
|
25
24
|
day_disabled: k,
|
|
26
25
|
day_hidden: f,
|
|
27
26
|
weeknumber: g,
|
|
28
|
-
"weeknumber-header": "_weeknumber-
|
|
27
|
+
"weeknumber-header": "_weeknumber-header_1178a_180",
|
|
29
28
|
caption_end: x
|
|
30
29
|
};
|
|
31
30
|
export {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { StyledCalendarPickerFooter as C } from "./StyledCalendarPickerFooter.js";
|
|
2
2
|
import { CustomCaption as O } from "./StyledCalendarPickerCaption.js";
|
|
3
3
|
import { StyledCalendarPickerSelectMonth as x } from "./StyledCalendarPickerSelectMonth.js";
|
|
4
|
-
import { StyledCalendarPickerSelectYear as
|
|
4
|
+
import { StyledCalendarPickerSelectYear as F } from "./StyledCalendarPickerSelectYear.js";
|
|
5
5
|
import e from "./StyledCalendarPicker.module.js";
|
|
6
|
-
import { buildDisabled as
|
|
7
|
-
import { useState as
|
|
6
|
+
import { buildDisabled as N } from "../helpers.js";
|
|
7
|
+
import { useState as Y } from "react";
|
|
8
8
|
import { jsx as i } from "react/jsx-runtime";
|
|
9
9
|
import { DayPicker as W } from "react-day-picker";
|
|
10
10
|
import { endOfMonth as q, startOfToday as R } from "date-fns";
|
|
11
11
|
import { enGB as T } from "date-fns/locale";
|
|
12
12
|
var K = ({ datePickerProps: t, popoverProps: y }) => {
|
|
13
|
-
const { showOutsideDays: h = !0, locale: s = T, numberOfMonths: b, disabledDays: w, onClear: f, title: j, ...g } = t, { onClose: m } = y, [_,
|
|
13
|
+
const { showOutsideDays: h = !0, locale: s = T, numberOfMonths: b, disabledDays: w, onClear: f, title: j, ...g } = t, { onClose: m } = y, [_, u] = Y((t.mode === "range" ? t.selected?.from : t.selected) ?? /* @__PURE__ */ new Date()), c = s.code === "nb", v = (b ?? 1) < 2, D = N(w, "disallowPast" in t ? t.disallowPast : void 0, "disallowFuture" in t ? t.disallowFuture : void 0, R()), S = (n) => {
|
|
14
14
|
if (!t.selected || !t.onSelect) return;
|
|
15
15
|
const o = /* @__PURE__ */ new Date(), a = {};
|
|
16
16
|
if (t.mode === "range") {
|
|
@@ -22,11 +22,12 @@ var K = ({ datePickerProps: t, popoverProps: y }) => {
|
|
|
22
22
|
d(void 0, o, a, n);
|
|
23
23
|
};
|
|
24
24
|
return /* @__PURE__ */ i(W, {
|
|
25
|
+
autoFocus: !0,
|
|
25
26
|
...g,
|
|
26
27
|
disabled: D,
|
|
27
28
|
month: _,
|
|
28
29
|
onMonthChange: (n) => {
|
|
29
|
-
if (
|
|
30
|
+
if (u(n), !!t.onSelect && (!t.mode || t.mode === "single")) {
|
|
30
31
|
const o = t.selected;
|
|
31
32
|
if (o instanceof Date) {
|
|
32
33
|
const a = n.getFullYear(), d = n.getMonth(), l = o.getDate(), M = q(new Date(a, d, 1)).getDate(), p = Math.min(l, M), r = new Date(o);
|
|
@@ -44,7 +45,7 @@ var K = ({ datePickerProps: t, popoverProps: y }) => {
|
|
|
44
45
|
showWeekNumber: !0,
|
|
45
46
|
showOutsideDays: h,
|
|
46
47
|
fixedWeeks: !0,
|
|
47
|
-
formatters: { formatWeekNumberHeader: () =>
|
|
48
|
+
formatters: { formatWeekNumberHeader: () => c ? "U" : "W" },
|
|
48
49
|
className: e["styled-calendar-day-picker"],
|
|
49
50
|
classNames: {
|
|
50
51
|
months: e.months,
|
|
@@ -90,15 +91,15 @@ var K = ({ datePickerProps: t, popoverProps: y }) => {
|
|
|
90
91
|
onClose: m
|
|
91
92
|
}),
|
|
92
93
|
MonthsDropdown: x,
|
|
93
|
-
YearsDropdown:
|
|
94
|
+
YearsDropdown: F
|
|
94
95
|
},
|
|
95
96
|
footer: /* @__PURE__ */ i(C, {
|
|
96
97
|
onClose: m,
|
|
97
|
-
isNb:
|
|
98
|
+
isNb: c,
|
|
98
99
|
selected: t.selected,
|
|
99
100
|
removeSelection: S,
|
|
100
101
|
required: t?.required,
|
|
101
|
-
setMonth:
|
|
102
|
+
setMonth: u,
|
|
102
103
|
month: _,
|
|
103
104
|
onClear: f
|
|
104
105
|
})
|
|
@@ -16,8 +16,9 @@ export interface StyledEmojiChoiceProps {
|
|
|
16
16
|
value?: string | null;
|
|
17
17
|
onValueChange?: (value: string, option: EmojiChoiceOption) => void;
|
|
18
18
|
/**
|
|
19
|
-
* @figmaProp none — an optional question: *Clear selection* under the
|
|
20
|
-
* as on `StyledDynamicSelect
|
|
19
|
+
* @figmaProp none — an optional question: *Clear selection* under the radio list while an option is
|
|
20
|
+
* chosen, as on `StyledDynamicSelect`; the dropdown clears with the field's own clear button.
|
|
21
|
+
* Leave unset for a required question.
|
|
21
22
|
*/
|
|
22
23
|
onClear?: () => void;
|
|
23
24
|
/** The question text. Shown above the options unless `aria-labelledby` points at a heading you render. */
|