@paolojulian.dev/design-system 4.5.1 → 4.6.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/constants.cjs.js.map +1 -1
- package/dist/constants.d.ts +3 -3
- package/dist/constants.es.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +214 -3
- package/dist/index.es.js +1642 -1040
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme.css +3 -3
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,640 +1,701 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { cn as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { C as
|
|
5
|
-
const
|
|
1
|
+
import { jsx as a, jsxs as _, Fragment as wt } from "react/jsx-runtime";
|
|
2
|
+
import { cn as h } from "./utils.es.js";
|
|
3
|
+
import { forwardRef as oe, useId as Oe, useRef as me, useState as re, useMemo as tt, useEffect as Ce, Children as Xt } from "react";
|
|
4
|
+
import { C as qt, a as Pt, b as Ft } from "./chevron-right-icon-CDCRryr1.js";
|
|
5
|
+
const en = ({
|
|
6
6
|
children: e,
|
|
7
7
|
gap: t = void 0,
|
|
8
|
-
alignItems:
|
|
8
|
+
alignItems: n = void 0,
|
|
9
9
|
justifyContent: r = void 0,
|
|
10
|
-
className:
|
|
11
|
-
}) => /* @__PURE__ */
|
|
10
|
+
className: l = ""
|
|
11
|
+
}) => /* @__PURE__ */ a(
|
|
12
12
|
"div",
|
|
13
13
|
{
|
|
14
|
-
className:
|
|
14
|
+
className: h("p-row", l),
|
|
15
15
|
style: {
|
|
16
16
|
gap: t,
|
|
17
|
-
alignItems:
|
|
17
|
+
alignItems: n,
|
|
18
18
|
justifyContent: r
|
|
19
19
|
},
|
|
20
20
|
children: e
|
|
21
21
|
}
|
|
22
|
-
),
|
|
22
|
+
), Zt = ({
|
|
23
23
|
children: e,
|
|
24
24
|
gap: t = void 0,
|
|
25
|
-
alignItems:
|
|
25
|
+
alignItems: n = void 0,
|
|
26
26
|
justifyContent: r = void 0,
|
|
27
|
-
className:
|
|
28
|
-
}) => /* @__PURE__ */
|
|
27
|
+
className: l = ""
|
|
28
|
+
}) => /* @__PURE__ */ a(
|
|
29
29
|
"div",
|
|
30
30
|
{
|
|
31
|
-
className:
|
|
31
|
+
className: h("p-stack", l),
|
|
32
32
|
style: {
|
|
33
33
|
gap: t,
|
|
34
|
-
alignItems:
|
|
34
|
+
alignItems: n,
|
|
35
35
|
justifyContent: r
|
|
36
36
|
},
|
|
37
37
|
children: e
|
|
38
38
|
}
|
|
39
|
-
),
|
|
39
|
+
), Jt = oe(
|
|
40
40
|
({
|
|
41
41
|
as: e = "span",
|
|
42
42
|
variant: t = "neutral",
|
|
43
|
-
size:
|
|
43
|
+
size: n = "sm",
|
|
44
44
|
appearance: r = "subtle",
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
isPinging: l = !1,
|
|
46
|
+
leftIcon: s,
|
|
47
|
+
rightIcon: d,
|
|
48
|
+
children: m,
|
|
49
|
+
className: y,
|
|
50
|
+
...b
|
|
50
51
|
}, u) => /* @__PURE__ */ _(
|
|
51
52
|
e,
|
|
52
53
|
{
|
|
53
|
-
...
|
|
54
|
+
...b,
|
|
54
55
|
ref: u,
|
|
55
|
-
className:
|
|
56
|
+
className: h(
|
|
56
57
|
"p-badge",
|
|
57
58
|
`p-badge--${t}`,
|
|
58
|
-
`p-badge--${
|
|
59
|
+
`p-badge--${n}`,
|
|
59
60
|
`p-badge--${r}`,
|
|
60
|
-
|
|
61
|
+
l && "p-badge--pinging",
|
|
62
|
+
y
|
|
61
63
|
),
|
|
62
64
|
children: [
|
|
63
|
-
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
|
|
65
|
+
s && /* @__PURE__ */ a("span", { className: "p-badge__icon", "aria-hidden": "true", children: s }),
|
|
66
|
+
/* @__PURE__ */ a("span", { className: "p-badge__label", children: m }),
|
|
67
|
+
d && /* @__PURE__ */ a("span", { className: "p-badge__icon", "aria-hidden": "true", children: d })
|
|
66
68
|
]
|
|
67
69
|
}
|
|
68
70
|
)
|
|
69
71
|
);
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
+
Jt.displayName = "PBadge";
|
|
73
|
+
const Qt = oe(
|
|
72
74
|
({
|
|
73
75
|
variant: e = "primary",
|
|
74
76
|
size: t = "md",
|
|
75
|
-
fullWidth:
|
|
77
|
+
fullWidth: n = !1,
|
|
76
78
|
isActive: r = !1,
|
|
77
|
-
isLoading:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
isLoading: l = !1,
|
|
80
|
+
isPinging: s = !1,
|
|
81
|
+
leftIcon: d,
|
|
82
|
+
rightIcon: m,
|
|
83
|
+
children: y,
|
|
84
|
+
className: b,
|
|
82
85
|
...u
|
|
83
|
-
},
|
|
84
|
-
const
|
|
86
|
+
}, v) => {
|
|
87
|
+
const N = !!("disabled" in u && u.disabled || l), F = h(
|
|
85
88
|
"p-button",
|
|
86
89
|
`p-button--${e}`,
|
|
87
90
|
`p-button--${t}`,
|
|
88
|
-
|
|
91
|
+
n && "p-button--full-width",
|
|
89
92
|
r && "p-button--active",
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
93
|
+
s && "p-button--pinging",
|
|
94
|
+
b
|
|
95
|
+
), k = /* @__PURE__ */ _(wt, { children: [
|
|
96
|
+
l ? /* @__PURE__ */ a("span", { className: "p-button__spinner", "aria-hidden": "true" }) : d && /* @__PURE__ */ a("span", { className: "p-button__icon", "aria-hidden": "true", children: d }),
|
|
97
|
+
/* @__PURE__ */ a("span", { className: "p-button__label", children: y }),
|
|
98
|
+
!l && m && /* @__PURE__ */ a("span", { className: "p-button__icon", "aria-hidden": "true", children: m })
|
|
95
99
|
] });
|
|
96
100
|
if ("href" in u && typeof u.href == "string") {
|
|
97
|
-
const { disabled:
|
|
98
|
-
if (
|
|
99
|
-
|
|
101
|
+
const { disabled: B, onClick: A, ...I } = u, T = (V) => {
|
|
102
|
+
if (N) {
|
|
103
|
+
V.preventDefault();
|
|
100
104
|
return;
|
|
101
105
|
}
|
|
102
|
-
|
|
106
|
+
A == null || A(V);
|
|
103
107
|
};
|
|
104
|
-
return /* @__PURE__ */
|
|
108
|
+
return /* @__PURE__ */ a(
|
|
105
109
|
"a",
|
|
106
110
|
{
|
|
107
|
-
...
|
|
108
|
-
ref:
|
|
109
|
-
className:
|
|
110
|
-
"aria-disabled":
|
|
111
|
-
"aria-busy":
|
|
111
|
+
...I,
|
|
112
|
+
ref: v,
|
|
113
|
+
className: F,
|
|
114
|
+
"aria-disabled": N || void 0,
|
|
115
|
+
"aria-busy": l || void 0,
|
|
112
116
|
"data-active": r || void 0,
|
|
113
|
-
"data-disabled":
|
|
114
|
-
tabIndex:
|
|
115
|
-
onClick:
|
|
116
|
-
children:
|
|
117
|
+
"data-disabled": B || void 0,
|
|
118
|
+
tabIndex: N ? -1 : I.tabIndex,
|
|
119
|
+
onClick: T,
|
|
120
|
+
children: k
|
|
117
121
|
}
|
|
118
122
|
);
|
|
119
123
|
}
|
|
120
|
-
const { type:
|
|
121
|
-
return /* @__PURE__ */
|
|
124
|
+
const { type: g = "button", disabled: $, ...j } = u;
|
|
125
|
+
return /* @__PURE__ */ a(
|
|
122
126
|
"button",
|
|
123
127
|
{
|
|
124
|
-
...
|
|
125
|
-
ref:
|
|
126
|
-
type:
|
|
127
|
-
disabled: !!(
|
|
128
|
-
className:
|
|
129
|
-
"aria-busy":
|
|
128
|
+
...j,
|
|
129
|
+
ref: v,
|
|
130
|
+
type: g,
|
|
131
|
+
disabled: !!($ || l),
|
|
132
|
+
className: F,
|
|
133
|
+
"aria-busy": l || void 0,
|
|
130
134
|
"data-active": r || void 0,
|
|
131
|
-
children:
|
|
135
|
+
children: k
|
|
132
136
|
}
|
|
133
137
|
);
|
|
134
138
|
}
|
|
135
139
|
);
|
|
136
|
-
|
|
137
|
-
function
|
|
138
|
-
var t,
|
|
140
|
+
Qt.displayName = "PButton";
|
|
141
|
+
function zt(e) {
|
|
142
|
+
var t, n, r = "";
|
|
139
143
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
140
|
-
else if (typeof e == "object") if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (
|
|
144
|
+
else if (typeof e == "object") if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (n = zt(e[t])) && (r && (r += " "), r += n);
|
|
141
145
|
else for (t in e) e[t] && (r && (r += " "), r += t);
|
|
142
146
|
return r;
|
|
143
147
|
}
|
|
144
|
-
function
|
|
145
|
-
for (var e, t,
|
|
148
|
+
function Et() {
|
|
149
|
+
for (var e, t, n = 0, r = ""; n < arguments.length; ) (e = arguments[n++]) && (t = zt(e)) && (r && (r += " "), r += t);
|
|
146
150
|
return r;
|
|
147
151
|
}
|
|
148
|
-
const
|
|
152
|
+
const Yt = (e) => typeof e == "boolean" ? "".concat(e) : e === 0 ? "0" : e, Ct = Et, ea = (e, t) => (n) => {
|
|
149
153
|
var r;
|
|
150
|
-
if ((t == null ? void 0 : t.variants) == null) return
|
|
151
|
-
const { variants:
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
154
|
-
const
|
|
155
|
-
return
|
|
156
|
-
}),
|
|
157
|
-
let [
|
|
158
|
-
return
|
|
159
|
-
}, {}),
|
|
160
|
-
let { class:
|
|
161
|
-
return Object.entries(
|
|
162
|
-
let [
|
|
163
|
-
return Array.isArray(
|
|
164
|
-
...
|
|
165
|
-
...
|
|
166
|
-
}[
|
|
167
|
-
...
|
|
168
|
-
...
|
|
169
|
-
}[
|
|
154
|
+
if ((t == null ? void 0 : t.variants) == null) return Ct(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
155
|
+
const { variants: l, defaultVariants: s } = t, d = Object.keys(l).map((b) => {
|
|
156
|
+
const u = n == null ? void 0 : n[b], v = s == null ? void 0 : s[b];
|
|
157
|
+
if (u === null) return null;
|
|
158
|
+
const N = Yt(u) || Yt(v);
|
|
159
|
+
return l[b][N];
|
|
160
|
+
}), m = n && Object.entries(n).reduce((b, u) => {
|
|
161
|
+
let [v, N] = u;
|
|
162
|
+
return N === void 0 || (b[v] = N), b;
|
|
163
|
+
}, {}), y = t == null || (r = t.compoundVariants) === null || r === void 0 ? void 0 : r.reduce((b, u) => {
|
|
164
|
+
let { class: v, className: N, ...F } = u;
|
|
165
|
+
return Object.entries(F).every((k) => {
|
|
166
|
+
let [g, $] = k;
|
|
167
|
+
return Array.isArray($) ? $.includes({
|
|
168
|
+
...s,
|
|
169
|
+
...m
|
|
170
|
+
}[g]) : {
|
|
171
|
+
...s,
|
|
172
|
+
...m
|
|
173
|
+
}[g] === $;
|
|
170
174
|
}) ? [
|
|
171
|
-
...
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
] :
|
|
175
|
+
...b,
|
|
176
|
+
v,
|
|
177
|
+
N
|
|
178
|
+
] : b;
|
|
175
179
|
}, []);
|
|
176
|
-
return
|
|
177
|
-
},
|
|
180
|
+
return Ct(e, d, y, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
181
|
+
}, ta = {
|
|
178
182
|
serif: "p-typography--serif",
|
|
179
183
|
body: "p-typography--body",
|
|
184
|
+
"body-medium": "p-typography--body-medium",
|
|
180
185
|
"body-wide": "p-typography--body-wide",
|
|
181
186
|
heading: "p-typography--heading",
|
|
182
187
|
"heading-lg": "p-typography--heading-lg",
|
|
183
188
|
"heading-xl": "p-typography--heading-xl"
|
|
184
|
-
},
|
|
189
|
+
}, aa = ea("p-typography", {
|
|
185
190
|
variants: {
|
|
186
|
-
variant:
|
|
191
|
+
variant: ta
|
|
187
192
|
},
|
|
188
193
|
defaultVariants: {
|
|
189
194
|
variant: "body"
|
|
190
195
|
}
|
|
191
196
|
});
|
|
192
|
-
function
|
|
197
|
+
function Ke({
|
|
193
198
|
as: e = "p",
|
|
194
199
|
children: t,
|
|
195
|
-
className:
|
|
200
|
+
className: n = "",
|
|
196
201
|
variant: r,
|
|
197
|
-
...
|
|
202
|
+
...l
|
|
198
203
|
}) {
|
|
199
|
-
return /* @__PURE__ */
|
|
204
|
+
return /* @__PURE__ */ a(
|
|
200
205
|
e,
|
|
201
206
|
{
|
|
202
|
-
className:
|
|
203
|
-
...
|
|
207
|
+
className: h(aa({ variant: r, className: n })),
|
|
208
|
+
...l,
|
|
204
209
|
children: t
|
|
205
210
|
}
|
|
206
211
|
);
|
|
207
212
|
}
|
|
208
|
-
function
|
|
213
|
+
function Ge(e) {
|
|
209
214
|
return e != null && e !== !1 && e !== "";
|
|
210
215
|
}
|
|
211
|
-
function
|
|
212
|
-
return
|
|
216
|
+
function St(e, t) {
|
|
217
|
+
return Ge(e) ? typeof e == "string" || typeof e == "number" ? /* @__PURE__ */ a(Ke, { className: t, variant: "body-wide", children: e }) : /* @__PURE__ */ a("span", { className: h(t, "p-card__meta-custom"), children: e }) : null;
|
|
213
218
|
}
|
|
214
|
-
function
|
|
219
|
+
function at(e) {
|
|
215
220
|
return typeof e == "number" ? `${e}px` : e;
|
|
216
221
|
}
|
|
217
|
-
const
|
|
222
|
+
const na = oe(
|
|
218
223
|
({
|
|
219
224
|
prefix: e,
|
|
220
225
|
eyebrow: t,
|
|
221
|
-
title:
|
|
226
|
+
title: n,
|
|
222
227
|
description: r,
|
|
223
|
-
media:
|
|
224
|
-
actions:
|
|
228
|
+
media: l,
|
|
229
|
+
actions: s,
|
|
225
230
|
density: d = "default",
|
|
226
|
-
fullWidth:
|
|
227
|
-
width:
|
|
228
|
-
minWidth:
|
|
229
|
-
height:
|
|
230
|
-
minHeight:
|
|
231
|
-
className:
|
|
232
|
-
style:
|
|
233
|
-
children:
|
|
234
|
-
...
|
|
235
|
-
},
|
|
236
|
-
const
|
|
231
|
+
fullWidth: m = !1,
|
|
232
|
+
width: y,
|
|
233
|
+
minWidth: b,
|
|
234
|
+
height: u,
|
|
235
|
+
minHeight: v,
|
|
236
|
+
className: N,
|
|
237
|
+
style: F,
|
|
238
|
+
children: k,
|
|
239
|
+
...g
|
|
240
|
+
}, $) => {
|
|
241
|
+
const j = "href" in g && typeof g.href == "string", B = h(
|
|
237
242
|
"p-card",
|
|
238
243
|
d !== "default" && `p-card--${d}`,
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
),
|
|
247
|
-
...
|
|
248
|
-
...
|
|
249
|
-
...
|
|
250
|
-
...
|
|
251
|
-
...
|
|
252
|
-
},
|
|
253
|
-
|
|
254
|
-
(
|
|
255
|
-
|
|
256
|
-
|
|
244
|
+
m && "p-card--full-width",
|
|
245
|
+
y !== void 0 && "p-card--custom-width",
|
|
246
|
+
b !== void 0 && "p-card--custom-min-width",
|
|
247
|
+
u !== void 0 && "p-card--custom-height",
|
|
248
|
+
v !== void 0 && "p-card--custom-min-height",
|
|
249
|
+
j && "p-card--interactive",
|
|
250
|
+
N
|
|
251
|
+
), A = {
|
|
252
|
+
...F,
|
|
253
|
+
...y !== void 0 ? { "--p-card-width": at(y) } : {},
|
|
254
|
+
...b !== void 0 ? { "--p-card-min-width": at(b) } : {},
|
|
255
|
+
...u !== void 0 ? { "--p-card-height": at(u) } : {},
|
|
256
|
+
...v !== void 0 ? { "--p-card-min-height": at(v) } : {}
|
|
257
|
+
}, I = /* @__PURE__ */ _(wt, { children: [
|
|
258
|
+
Ge(l) && /* @__PURE__ */ a("div", { className: "p-card__media", children: l }),
|
|
259
|
+
(Ge(e) || Ge(t)) && /* @__PURE__ */ _("div", { className: "p-card__meta", children: [
|
|
260
|
+
St(e, "p-card__prefix"),
|
|
261
|
+
St(t, "p-card__eyebrow")
|
|
257
262
|
] }),
|
|
258
263
|
/* @__PURE__ */ _("div", { className: "p-card__body", children: [
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
|
|
264
|
+
/* @__PURE__ */ a(Ke, { as: "h3", className: "p-card__title", variant: "heading", children: j ? /* @__PURE__ */ a("a", { ...g, className: "p-card__link", children: n }) : n }),
|
|
265
|
+
Ge(r) ? /* @__PURE__ */ a(Ke, { className: "p-card__description", variant: "body", children: r }) : null
|
|
261
266
|
] }),
|
|
262
|
-
|
|
263
|
-
|
|
267
|
+
Ge(k) && /* @__PURE__ */ a("div", { className: "p-card__content", children: k }),
|
|
268
|
+
Ge(s) && /* @__PURE__ */ a("div", { className: "p-card__actions", children: s })
|
|
264
269
|
] });
|
|
265
|
-
return
|
|
270
|
+
return j ? /* @__PURE__ */ a("article", { ref: $, className: B, style: A, children: I }) : /* @__PURE__ */ a(
|
|
266
271
|
"article",
|
|
267
272
|
{
|
|
268
|
-
...
|
|
269
|
-
ref:
|
|
270
|
-
className:
|
|
271
|
-
style:
|
|
272
|
-
children:
|
|
273
|
+
...g,
|
|
274
|
+
ref: $,
|
|
275
|
+
className: B,
|
|
276
|
+
style: A,
|
|
277
|
+
children: I
|
|
278
|
+
}
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
na.displayName = "PCard";
|
|
283
|
+
function ra(e) {
|
|
284
|
+
return typeof e == "number" ? `${e}px` : e;
|
|
285
|
+
}
|
|
286
|
+
function la(e) {
|
|
287
|
+
return e ? typeof e == "number" ? {
|
|
288
|
+
mobile: 1,
|
|
289
|
+
tablet: Math.min(e, 2),
|
|
290
|
+
desktop: e
|
|
291
|
+
} : {
|
|
292
|
+
mobile: e.mobile ?? 1,
|
|
293
|
+
tablet: e.tablet ?? e.mobile ?? 2,
|
|
294
|
+
desktop: e.desktop ?? e.tablet ?? e.mobile ?? 2
|
|
295
|
+
} : {
|
|
296
|
+
mobile: 1,
|
|
297
|
+
tablet: 2,
|
|
298
|
+
desktop: 2
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
const ia = oe(
|
|
302
|
+
({
|
|
303
|
+
as: e = "div",
|
|
304
|
+
columns: t,
|
|
305
|
+
minCardWidth: n,
|
|
306
|
+
gap: r = "none",
|
|
307
|
+
align: l = "stretch",
|
|
308
|
+
className: s,
|
|
309
|
+
style: d,
|
|
310
|
+
children: m,
|
|
311
|
+
...y
|
|
312
|
+
}, b) => {
|
|
313
|
+
const u = la(t), v = {
|
|
314
|
+
...d,
|
|
315
|
+
"--p-card-grid-mobile-columns": u.mobile,
|
|
316
|
+
"--p-card-grid-tablet-columns": u.tablet,
|
|
317
|
+
"--p-card-grid-desktop-columns": u.desktop,
|
|
318
|
+
...n !== void 0 ? { "--p-card-grid-min-card-width": ra(n) } : {}
|
|
319
|
+
};
|
|
320
|
+
return /* @__PURE__ */ a(
|
|
321
|
+
e,
|
|
322
|
+
{
|
|
323
|
+
...y,
|
|
324
|
+
ref: b,
|
|
325
|
+
className: h(
|
|
326
|
+
"p-card-grid",
|
|
327
|
+
`p-card-grid--gap-${r}`,
|
|
328
|
+
l === "start" && "p-card-grid--align-start",
|
|
329
|
+
n !== void 0 && "p-card-grid--auto-fit",
|
|
330
|
+
s
|
|
331
|
+
),
|
|
332
|
+
style: v,
|
|
333
|
+
children: m
|
|
273
334
|
}
|
|
274
335
|
);
|
|
275
336
|
}
|
|
276
337
|
);
|
|
277
|
-
|
|
278
|
-
function
|
|
279
|
-
return /* @__PURE__ */
|
|
338
|
+
ia.displayName = "PCardGrid";
|
|
339
|
+
function sa() {
|
|
340
|
+
return /* @__PURE__ */ a("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m5 8 5 5 5-5" }) });
|
|
280
341
|
}
|
|
281
|
-
function
|
|
282
|
-
return /* @__PURE__ */
|
|
342
|
+
function oa() {
|
|
343
|
+
return /* @__PURE__ */ a("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m4 10 4 4 8-8" }) });
|
|
283
344
|
}
|
|
284
|
-
function
|
|
345
|
+
function Tt() {
|
|
285
346
|
return /* @__PURE__ */ _("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: [
|
|
286
|
-
/* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
347
|
+
/* @__PURE__ */ a("path", { d: "m5 5 10 10" }),
|
|
348
|
+
/* @__PURE__ */ a("path", { d: "m15 5-10 10" })
|
|
288
349
|
] });
|
|
289
350
|
}
|
|
290
|
-
function
|
|
351
|
+
function Bt(e) {
|
|
291
352
|
return e.trim().toLocaleLowerCase();
|
|
292
353
|
}
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
return
|
|
296
|
-
const
|
|
354
|
+
function ht(e, t) {
|
|
355
|
+
const n = Bt(t);
|
|
356
|
+
return n ? e.filter((r) => {
|
|
357
|
+
const l = [
|
|
297
358
|
r.label,
|
|
298
359
|
r.value,
|
|
299
360
|
r.description,
|
|
300
361
|
r.group,
|
|
301
362
|
...r.keywords ?? []
|
|
302
363
|
].filter(Boolean).join(" ");
|
|
303
|
-
return
|
|
364
|
+
return Bt(l).includes(n);
|
|
304
365
|
}) : e;
|
|
305
366
|
}
|
|
306
|
-
function
|
|
367
|
+
function Rt(e) {
|
|
307
368
|
return e.findIndex((t) => !t.disabled);
|
|
308
369
|
}
|
|
309
|
-
function
|
|
310
|
-
const
|
|
311
|
-
return
|
|
370
|
+
function bt(e, t) {
|
|
371
|
+
const n = e.findIndex((r) => r.value === t && !r.disabled);
|
|
372
|
+
return n >= 0 ? n : Rt(e);
|
|
312
373
|
}
|
|
313
|
-
function
|
|
314
|
-
var
|
|
374
|
+
function At(e, t, n) {
|
|
375
|
+
var l;
|
|
315
376
|
if (!e.length)
|
|
316
377
|
return -1;
|
|
317
378
|
let r = t;
|
|
318
|
-
for (let
|
|
319
|
-
if (r = (r +
|
|
379
|
+
for (let s = 0; s < e.length; s += 1)
|
|
380
|
+
if (r = (r + n + e.length) % e.length, !((l = e[r]) != null && l.disabled))
|
|
320
381
|
return r;
|
|
321
382
|
return -1;
|
|
322
383
|
}
|
|
323
|
-
function
|
|
384
|
+
function ca(e, t) {
|
|
324
385
|
if (typeof e == "function") {
|
|
325
386
|
e(t);
|
|
326
387
|
return;
|
|
327
388
|
}
|
|
328
389
|
e && (e.current = t);
|
|
329
390
|
}
|
|
330
|
-
const
|
|
391
|
+
const da = oe(
|
|
331
392
|
({
|
|
332
393
|
label: e,
|
|
333
394
|
options: t,
|
|
334
|
-
value:
|
|
395
|
+
value: n,
|
|
335
396
|
defaultValue: r,
|
|
336
|
-
selectedOption:
|
|
337
|
-
onValueChange:
|
|
397
|
+
selectedOption: l,
|
|
398
|
+
onValueChange: s,
|
|
338
399
|
query: d,
|
|
339
|
-
defaultQuery:
|
|
340
|
-
onQueryChange:
|
|
341
|
-
filterMode:
|
|
342
|
-
isLoading:
|
|
343
|
-
isLoadingMore:
|
|
344
|
-
hasMore:
|
|
345
|
-
onLoadMore:
|
|
346
|
-
placeholder:
|
|
347
|
-
searchPlaceholder:
|
|
348
|
-
emptyText:
|
|
349
|
-
loadingText:
|
|
350
|
-
loadingMoreText:
|
|
351
|
-
loadMoreText:
|
|
352
|
-
helperText:
|
|
353
|
-
isError:
|
|
354
|
-
errorMessage:
|
|
355
|
-
name:
|
|
356
|
-
disabled:
|
|
357
|
-
readOnly:
|
|
358
|
-
required:
|
|
359
|
-
clearable:
|
|
360
|
-
className:
|
|
361
|
-
inputClassName:
|
|
362
|
-
id:
|
|
363
|
-
style:
|
|
364
|
-
...
|
|
365
|
-
},
|
|
366
|
-
const
|
|
367
|
-
() =>
|
|
368
|
-
[
|
|
369
|
-
), [
|
|
370
|
-
|
|
371
|
-
!
|
|
372
|
-
}, [
|
|
373
|
-
|
|
374
|
-
}, [
|
|
375
|
-
var
|
|
376
|
-
|
|
377
|
-
}, [
|
|
378
|
-
var
|
|
379
|
-
const
|
|
380
|
-
if (!
|
|
400
|
+
defaultQuery: m,
|
|
401
|
+
onQueryChange: y,
|
|
402
|
+
filterMode: b = "local",
|
|
403
|
+
isLoading: u = !1,
|
|
404
|
+
isLoadingMore: v = !1,
|
|
405
|
+
hasMore: N = !1,
|
|
406
|
+
onLoadMore: F,
|
|
407
|
+
placeholder: k = "Select an option",
|
|
408
|
+
searchPlaceholder: g = "Search options",
|
|
409
|
+
emptyText: $ = "No options found.",
|
|
410
|
+
loadingText: j = "Loading options...",
|
|
411
|
+
loadingMoreText: B = "Loading more options...",
|
|
412
|
+
loadMoreText: A = "Load more options",
|
|
413
|
+
helperText: I,
|
|
414
|
+
isError: T = !1,
|
|
415
|
+
errorMessage: V,
|
|
416
|
+
name: S,
|
|
417
|
+
disabled: z = !1,
|
|
418
|
+
readOnly: ee = !1,
|
|
419
|
+
required: O = !1,
|
|
420
|
+
clearable: X = !0,
|
|
421
|
+
className: p,
|
|
422
|
+
inputClassName: M,
|
|
423
|
+
id: x,
|
|
424
|
+
style: W,
|
|
425
|
+
...pe
|
|
426
|
+
}, w) => {
|
|
427
|
+
const D = Oe(), H = x ?? D, he = `${H}-label`, Y = `${H}-input`, R = `${H}-listbox`, te = `${H}-helper`, Z = `${H}-error`, G = me(null), J = me(null), q = me(null), ce = me(null), De = me(null), be = me(null), xe = n !== void 0, Fe = d !== void 0, [Se, Xe] = re(r ?? ""), le = xe ? n : Se, U = (l == null ? void 0 : l.value) === le ? l : t.find((c) => c.value === le) ?? null, [Ze, ge] = re(m ?? (U == null ? void 0 : U.label) ?? ""), de = Fe ? d : Ze, [L, ue] = re(!1), [ye, Te] = re(!1), Q = tt(
|
|
428
|
+
() => b === "local" ? ht(t, de) : t,
|
|
429
|
+
[b, t, de]
|
|
430
|
+
), [Ie, Me] = re(() => bt(t, le)), $e = L ? Q[Ie] : void 0, je = $e ? `${R}-option-${Ie}` : void 0, ve = `${H}-modal-title`, we = T && V ? Z : I ? te : void 0, He = !!U, Ne = X && He && !z && !ee, Be = L ? de : (U == null ? void 0 : U.label) ?? de, We = u && Q.length === 0, Je = v || u && Q.length > 0, Qe = !!(N && F && !u && !v);
|
|
431
|
+
Ce(() => {
|
|
432
|
+
!L && !Fe && ge((U == null ? void 0 : U.label) ?? "");
|
|
433
|
+
}, [L, Fe, U]), Ce(() => {
|
|
434
|
+
L && Me((c) => Q[c] && !Q[c].disabled ? c : bt(Q, le));
|
|
435
|
+
}, [Q, L, le]), Ce(() => {
|
|
436
|
+
var c;
|
|
437
|
+
L && ((c = De.current) == null || c.scrollIntoView({ block: "nearest" }));
|
|
438
|
+
}, [Ie, L]), Ce(() => {
|
|
439
|
+
var Ve, Le;
|
|
440
|
+
const c = globalThis, f = (Ve = c.matchMedia) == null ? void 0 : Ve.call(c, "(max-width: 64rem)");
|
|
441
|
+
if (!f)
|
|
381
442
|
return;
|
|
382
|
-
const
|
|
383
|
-
return
|
|
384
|
-
var
|
|
385
|
-
return (
|
|
443
|
+
const ne = () => Te(f.matches);
|
|
444
|
+
return ne(), (Le = f.addEventListener) == null || Le.call(f, "change", ne), () => {
|
|
445
|
+
var Ue;
|
|
446
|
+
return (Ue = f.removeEventListener) == null ? void 0 : Ue.call(f, "change", ne);
|
|
386
447
|
};
|
|
387
|
-
}, []),
|
|
388
|
-
var
|
|
389
|
-
!
|
|
390
|
-
}, [
|
|
391
|
-
|
|
392
|
-
}, [
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
|
|
397
|
-
},
|
|
398
|
-
!
|
|
448
|
+
}, []), Ce(() => {
|
|
449
|
+
var c;
|
|
450
|
+
!L || !ye || (c = q.current) == null || c.focus();
|
|
451
|
+
}, [ye, L]), Ce(() => {
|
|
452
|
+
ce.current && ce.current.setCustomValidity(O && !le ? "Select an option." : "");
|
|
453
|
+
}, [O, le]);
|
|
454
|
+
const o = (c) => {
|
|
455
|
+
G.current = c, ca(w, c);
|
|
456
|
+
}, C = (c, f) => {
|
|
457
|
+
Fe || ge(c), y == null || y(c, { source: f });
|
|
458
|
+
}, ae = () => {
|
|
459
|
+
!N || !F || u || v || F({ query: de, optionCount: Q.length });
|
|
399
460
|
};
|
|
400
|
-
|
|
401
|
-
if (!
|
|
461
|
+
Ce(() => {
|
|
462
|
+
if (!L || !be.current)
|
|
402
463
|
return;
|
|
403
|
-
const { scrollHeight:
|
|
404
|
-
|
|
464
|
+
const { scrollHeight: c, clientHeight: f } = be.current;
|
|
465
|
+
c <= f + 48 && ae();
|
|
405
466
|
});
|
|
406
|
-
const
|
|
407
|
-
const
|
|
408
|
-
|
|
409
|
-
},
|
|
410
|
-
if (
|
|
467
|
+
const i = (c) => {
|
|
468
|
+
const f = (c == null ? void 0 : c.value) ?? "";
|
|
469
|
+
xe || Xe(f), C((c == null ? void 0 : c.label) ?? "", c ? "selection" : "clear"), s == null || s(f, c);
|
|
470
|
+
}, P = (c = de) => {
|
|
471
|
+
if (z || ee)
|
|
411
472
|
return;
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
},
|
|
415
|
-
|
|
416
|
-
},
|
|
417
|
-
const
|
|
418
|
-
|
|
419
|
-
},
|
|
420
|
-
if (
|
|
421
|
-
if (
|
|
422
|
-
|
|
473
|
+
const f = b === "local" ? ht(t, c) : t;
|
|
474
|
+
C(c, "open"), Me(bt(f, le)), ue(!0);
|
|
475
|
+
}, E = () => {
|
|
476
|
+
ue(!1), C((U == null ? void 0 : U.label) ?? "", "reset");
|
|
477
|
+
}, Pe = (c) => {
|
|
478
|
+
const f = c.currentTarget.value, ne = b === "local" ? ht(t, f) : t;
|
|
479
|
+
C(f, "input"), Me(Rt(ne)), ue(!0);
|
|
480
|
+
}, _e = (c) => {
|
|
481
|
+
if (c.key === "ArrowDown") {
|
|
482
|
+
if (c.preventDefault(), !L) {
|
|
483
|
+
P("");
|
|
423
484
|
return;
|
|
424
485
|
}
|
|
425
|
-
|
|
486
|
+
Me((f) => At(Q, f, 1));
|
|
426
487
|
return;
|
|
427
488
|
}
|
|
428
|
-
if (
|
|
429
|
-
if (
|
|
430
|
-
|
|
489
|
+
if (c.key === "ArrowUp") {
|
|
490
|
+
if (c.preventDefault(), !L) {
|
|
491
|
+
P("");
|
|
431
492
|
return;
|
|
432
493
|
}
|
|
433
|
-
|
|
494
|
+
Me((f) => At(Q, f, -1));
|
|
434
495
|
return;
|
|
435
496
|
}
|
|
436
|
-
if (
|
|
437
|
-
if (!
|
|
438
|
-
|
|
497
|
+
if (c.key === "Enter") {
|
|
498
|
+
if (!L) {
|
|
499
|
+
P(de);
|
|
439
500
|
return;
|
|
440
501
|
}
|
|
441
|
-
|
|
502
|
+
$e && !$e.disabled && (c.preventDefault(), i($e), ue(!1));
|
|
442
503
|
return;
|
|
443
504
|
}
|
|
444
|
-
if (
|
|
445
|
-
|
|
505
|
+
if (c.key === "Escape" && L) {
|
|
506
|
+
c.preventDefault(), E();
|
|
446
507
|
return;
|
|
447
508
|
}
|
|
448
|
-
|
|
449
|
-
},
|
|
450
|
-
var
|
|
451
|
-
|
|
452
|
-
},
|
|
453
|
-
var
|
|
454
|
-
|
|
455
|
-
},
|
|
456
|
-
const
|
|
457
|
-
|
|
458
|
-
},
|
|
459
|
-
if (!
|
|
509
|
+
c.key === "Tab" && E();
|
|
510
|
+
}, Ae = (c, f) => {
|
|
511
|
+
var ne;
|
|
512
|
+
c.preventDefault(), !f.disabled && (i(f), ue(!1), (ne = J.current) == null || ne.focus());
|
|
513
|
+
}, dt = (c) => {
|
|
514
|
+
var f;
|
|
515
|
+
c.preventDefault(), c.stopPropagation(), i(null), ue(!1), (f = J.current) == null || f.focus();
|
|
516
|
+
}, ut = (c) => {
|
|
517
|
+
const f = c.currentTarget;
|
|
518
|
+
f.scrollHeight - f.scrollTop - f.clientHeight <= 48 && ae();
|
|
519
|
+
}, pt = (c) => {
|
|
520
|
+
if (!L)
|
|
460
521
|
return;
|
|
461
|
-
|
|
462
|
-
},
|
|
463
|
-
(
|
|
464
|
-
const
|
|
465
|
-
return
|
|
522
|
+
c.currentTarget.contains(c.relatedTarget) || E();
|
|
523
|
+
}, It = Q.reduce(
|
|
524
|
+
(c, f) => {
|
|
525
|
+
const ne = f.group ?? null, Ve = c.find((Le) => Le.group === ne);
|
|
526
|
+
return Ve ? (Ve.options.push(f), c) : (c.push({ group: ne, options: [f] }), c);
|
|
466
527
|
},
|
|
467
528
|
[]
|
|
468
529
|
);
|
|
469
530
|
return /* @__PURE__ */ _(
|
|
470
531
|
"div",
|
|
471
532
|
{
|
|
472
|
-
...
|
|
473
|
-
ref:
|
|
474
|
-
id:
|
|
475
|
-
style:
|
|
476
|
-
onBlur:
|
|
477
|
-
className:
|
|
533
|
+
...pe,
|
|
534
|
+
ref: o,
|
|
535
|
+
id: H,
|
|
536
|
+
style: W,
|
|
537
|
+
onBlur: pt,
|
|
538
|
+
className: h(
|
|
478
539
|
"p-combobox",
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
540
|
+
L && "p-combobox--open",
|
|
541
|
+
T && "p-combobox--error",
|
|
542
|
+
z && "p-combobox--disabled",
|
|
543
|
+
ee && "p-combobox--readonly",
|
|
544
|
+
p
|
|
484
545
|
),
|
|
485
546
|
children: [
|
|
486
547
|
/* @__PURE__ */ _("div", { className: "p-combobox__field", children: [
|
|
487
|
-
/* @__PURE__ */
|
|
548
|
+
/* @__PURE__ */ a(
|
|
488
549
|
"input",
|
|
489
550
|
{
|
|
490
|
-
ref:
|
|
491
|
-
id:
|
|
551
|
+
ref: J,
|
|
552
|
+
id: Y,
|
|
492
553
|
role: "combobox",
|
|
493
554
|
type: "text",
|
|
494
|
-
value:
|
|
495
|
-
placeholder:
|
|
496
|
-
disabled:
|
|
497
|
-
readOnly:
|
|
555
|
+
value: Be,
|
|
556
|
+
placeholder: L ? g : " ",
|
|
557
|
+
disabled: z,
|
|
558
|
+
readOnly: ee,
|
|
498
559
|
required: !1,
|
|
499
560
|
"aria-autocomplete": "list",
|
|
500
|
-
"aria-controls":
|
|
501
|
-
"aria-describedby":
|
|
502
|
-
"aria-activedescendant":
|
|
503
|
-
"aria-expanded":
|
|
561
|
+
"aria-controls": R,
|
|
562
|
+
"aria-describedby": we,
|
|
563
|
+
"aria-activedescendant": je,
|
|
564
|
+
"aria-expanded": L,
|
|
504
565
|
"aria-haspopup": "listbox",
|
|
505
|
-
"aria-invalid":
|
|
506
|
-
"aria-labelledby":
|
|
566
|
+
"aria-invalid": T || void 0,
|
|
567
|
+
"aria-labelledby": he,
|
|
507
568
|
autoComplete: "off",
|
|
508
|
-
className:
|
|
509
|
-
onChange:
|
|
510
|
-
onClick: () =>
|
|
511
|
-
onKeyDown:
|
|
569
|
+
className: h("p-combobox__input", (Ne || He) && "p-combobox__input--adorned", M),
|
|
570
|
+
onChange: Pe,
|
|
571
|
+
onClick: () => P(""),
|
|
572
|
+
onKeyDown: _e
|
|
512
573
|
}
|
|
513
574
|
),
|
|
514
|
-
/* @__PURE__ */
|
|
575
|
+
/* @__PURE__ */ a(
|
|
515
576
|
"label",
|
|
516
577
|
{
|
|
517
|
-
id:
|
|
518
|
-
htmlFor:
|
|
519
|
-
className:
|
|
578
|
+
id: he,
|
|
579
|
+
htmlFor: Y,
|
|
580
|
+
className: h("p-combobox__label p-combobox__floating-label", T && "p-combobox__label--error"),
|
|
520
581
|
children: e
|
|
521
582
|
}
|
|
522
583
|
),
|
|
523
|
-
/* @__PURE__ */
|
|
524
|
-
|
|
584
|
+
/* @__PURE__ */ a("span", { "aria-hidden": "true", className: "p-combobox__label p-combobox__placeholder-label", children: k || e }),
|
|
585
|
+
Ne ? /* @__PURE__ */ a(
|
|
525
586
|
"button",
|
|
526
587
|
{
|
|
527
588
|
type: "button",
|
|
528
589
|
className: "p-combobox__clear",
|
|
529
590
|
"aria-label": `Clear ${e}`,
|
|
530
|
-
onMouseDown:
|
|
531
|
-
children: /* @__PURE__ */
|
|
591
|
+
onMouseDown: dt,
|
|
592
|
+
children: /* @__PURE__ */ a(Tt, {})
|
|
532
593
|
}
|
|
533
594
|
) : null,
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
|
|
595
|
+
/* @__PURE__ */ a("span", { className: "p-combobox__chevron", "aria-hidden": "true", children: /* @__PURE__ */ a(sa, {}) }),
|
|
596
|
+
L ? /* @__PURE__ */ _(
|
|
536
597
|
"div",
|
|
537
598
|
{
|
|
538
599
|
className: "p-combobox__panel",
|
|
539
|
-
role:
|
|
540
|
-
"aria-modal":
|
|
541
|
-
"aria-labelledby":
|
|
600
|
+
role: ye ? "dialog" : void 0,
|
|
601
|
+
"aria-modal": ye || void 0,
|
|
602
|
+
"aria-labelledby": ye ? ve : void 0,
|
|
542
603
|
children: [
|
|
543
604
|
/* @__PURE__ */ _("div", { className: "p-combobox__modal-header", children: [
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
605
|
+
/* @__PURE__ */ a("div", { id: ve, className: "p-combobox__modal-title", children: e }),
|
|
606
|
+
/* @__PURE__ */ a("button", { type: "button", className: "p-combobox__modal-close", "aria-label": `Close ${e}`, onClick: E, children: /* @__PURE__ */ a(Tt, {}) })
|
|
546
607
|
] }),
|
|
547
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ a("div", { className: "p-combobox__modal-search", children: /* @__PURE__ */ a(
|
|
548
609
|
"input",
|
|
549
610
|
{
|
|
550
|
-
ref:
|
|
611
|
+
ref: q,
|
|
551
612
|
role: "combobox",
|
|
552
613
|
type: "search",
|
|
553
|
-
value:
|
|
554
|
-
placeholder:
|
|
555
|
-
"aria-activedescendant":
|
|
614
|
+
value: de,
|
|
615
|
+
placeholder: g,
|
|
616
|
+
"aria-activedescendant": je,
|
|
556
617
|
"aria-autocomplete": "list",
|
|
557
|
-
"aria-controls":
|
|
558
|
-
"aria-expanded":
|
|
618
|
+
"aria-controls": R,
|
|
619
|
+
"aria-expanded": L,
|
|
559
620
|
"aria-haspopup": "listbox",
|
|
560
621
|
"aria-label": `Search ${e}`,
|
|
561
622
|
autoComplete: "off",
|
|
562
623
|
className: "p-combobox__modal-input",
|
|
563
|
-
onChange:
|
|
564
|
-
onKeyDown:
|
|
624
|
+
onChange: Pe,
|
|
625
|
+
onKeyDown: _e
|
|
565
626
|
}
|
|
566
627
|
) }),
|
|
567
628
|
/* @__PURE__ */ _(
|
|
568
629
|
"div",
|
|
569
630
|
{
|
|
570
|
-
id:
|
|
571
|
-
ref: (
|
|
572
|
-
|
|
631
|
+
id: R,
|
|
632
|
+
ref: (c) => {
|
|
633
|
+
be.current = c;
|
|
573
634
|
},
|
|
574
635
|
role: "listbox",
|
|
575
|
-
"aria-busy":
|
|
576
|
-
"aria-labelledby":
|
|
636
|
+
"aria-busy": u || v || void 0,
|
|
637
|
+
"aria-labelledby": he,
|
|
577
638
|
className: "p-combobox__list",
|
|
578
|
-
onScroll:
|
|
639
|
+
onScroll: ut,
|
|
579
640
|
children: [
|
|
580
|
-
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
641
|
+
We ? /* @__PURE__ */ _("div", { className: "p-combobox__status", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
|
|
642
|
+
/* @__PURE__ */ a("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
|
|
643
|
+
/* @__PURE__ */ a("span", { children: j })
|
|
583
644
|
] }) : null,
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
const
|
|
645
|
+
It.length ? It.map((c) => /* @__PURE__ */ _("div", { className: "p-combobox__group", children: [
|
|
646
|
+
c.group ? /* @__PURE__ */ a("div", { className: "p-combobox__group-label", children: c.group }) : null,
|
|
647
|
+
c.options.map((f) => {
|
|
648
|
+
const ne = Q.indexOf(f), Ve = ne === Ie, Le = f.value === le;
|
|
588
649
|
return /* @__PURE__ */ _(
|
|
589
650
|
"div",
|
|
590
651
|
{
|
|
591
|
-
ref:
|
|
592
|
-
|
|
652
|
+
ref: Ve ? (Ue) => {
|
|
653
|
+
De.current = Ue;
|
|
593
654
|
} : void 0,
|
|
594
|
-
id: `${
|
|
655
|
+
id: `${R}-option-${ne}`,
|
|
595
656
|
role: "option",
|
|
596
|
-
"aria-disabled":
|
|
597
|
-
"aria-selected":
|
|
598
|
-
className:
|
|
657
|
+
"aria-disabled": f.disabled || void 0,
|
|
658
|
+
"aria-selected": Le,
|
|
659
|
+
className: h(
|
|
599
660
|
"p-combobox__option",
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
661
|
+
Ve && "p-combobox__option--active",
|
|
662
|
+
Le && "p-combobox__option--selected",
|
|
663
|
+
f.disabled && "p-combobox__option--disabled"
|
|
603
664
|
),
|
|
604
|
-
onMouseDown: (
|
|
665
|
+
onMouseDown: (Ue) => Ae(Ue, f),
|
|
605
666
|
children: [
|
|
606
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ a("span", { className: "p-combobox__option-check", children: Le ? /* @__PURE__ */ a(oa, {}) : null }),
|
|
607
668
|
/* @__PURE__ */ _("span", { className: "p-combobox__option-content", children: [
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
-
|
|
669
|
+
/* @__PURE__ */ a("span", { className: "p-combobox__option-label", children: f.label }),
|
|
670
|
+
f.description ? /* @__PURE__ */ a("span", { className: "p-combobox__option-description", children: f.description }) : null
|
|
610
671
|
] }),
|
|
611
|
-
|
|
672
|
+
f.meta ? /* @__PURE__ */ a("span", { className: "p-combobox__option-meta", children: f.meta }) : null
|
|
612
673
|
]
|
|
613
674
|
},
|
|
614
|
-
|
|
675
|
+
f.value
|
|
615
676
|
);
|
|
616
677
|
})
|
|
617
|
-
] },
|
|
618
|
-
|
|
619
|
-
/* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
678
|
+
] }, c.group ?? "ungrouped")) : We ? null : /* @__PURE__ */ a("div", { className: "p-combobox__empty", role: "option", "aria-disabled": "true", "aria-selected": "false", children: $ }),
|
|
679
|
+
Je ? /* @__PURE__ */ _("div", { className: "p-combobox__status p-combobox__status--footer", role: "option", "aria-disabled": "true", "aria-selected": "false", children: [
|
|
680
|
+
/* @__PURE__ */ a("span", { className: "p-combobox__spinner", "aria-hidden": "true" }),
|
|
681
|
+
/* @__PURE__ */ a("span", { children: B })
|
|
621
682
|
] }) : null
|
|
622
683
|
]
|
|
623
684
|
}
|
|
624
685
|
),
|
|
625
|
-
|
|
686
|
+
Qe ? /* @__PURE__ */ a("div", { className: "p-combobox__footer", children: /* @__PURE__ */ a("button", { type: "button", className: "p-combobox__load-more", onMouseDown: (c) => c.preventDefault(), onClick: ae, children: A }) }) : null
|
|
626
687
|
]
|
|
627
688
|
}
|
|
628
689
|
) : null
|
|
629
690
|
] }),
|
|
630
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ a(
|
|
631
692
|
"input",
|
|
632
693
|
{
|
|
633
|
-
ref:
|
|
694
|
+
ref: ce,
|
|
634
695
|
type: "text",
|
|
635
|
-
name:
|
|
636
|
-
value:
|
|
637
|
-
required:
|
|
696
|
+
name: S,
|
|
697
|
+
value: le ?? "",
|
|
698
|
+
required: O,
|
|
638
699
|
tabIndex: -1,
|
|
639
700
|
"aria-hidden": "true",
|
|
640
701
|
className: "p-combobox__hidden-input",
|
|
@@ -642,17 +703,17 @@ const Qt = Ne(
|
|
|
642
703
|
}
|
|
643
704
|
}
|
|
644
705
|
),
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
!
|
|
706
|
+
L ? /* @__PURE__ */ a("div", { className: "p-combobox__backdrop", "aria-hidden": "true", onMouseDown: E }) : null,
|
|
707
|
+
T && V ? /* @__PURE__ */ a("p", { id: Z, role: "alert", className: "p-combobox__message p-combobox__message--error", children: V }) : null,
|
|
708
|
+
!T && I ? /* @__PURE__ */ a("p", { id: te, className: "p-combobox__message", children: I }) : null
|
|
648
709
|
]
|
|
649
710
|
}
|
|
650
711
|
);
|
|
651
712
|
}
|
|
652
713
|
);
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
function
|
|
714
|
+
da.displayName = "PCombobox";
|
|
715
|
+
const ua = new Intl.DateTimeFormat(void 0, { weekday: "short" });
|
|
716
|
+
function lt(e) {
|
|
656
717
|
if (!e)
|
|
657
718
|
return null;
|
|
658
719
|
if (e instanceof Date)
|
|
@@ -660,63 +721,63 @@ function nt(e) {
|
|
|
660
721
|
const t = e.split("-").map(Number);
|
|
661
722
|
if (t.length !== 3 || t.some(Number.isNaN))
|
|
662
723
|
return null;
|
|
663
|
-
const [
|
|
664
|
-
return
|
|
724
|
+
const [n, r, l] = t, s = new Date(n, r - 1, l);
|
|
725
|
+
return s.getFullYear() !== n || s.getMonth() !== r - 1 || s.getDate() !== l ? null : s;
|
|
665
726
|
}
|
|
666
|
-
function
|
|
727
|
+
function et(e) {
|
|
667
728
|
if (!e)
|
|
668
729
|
return "";
|
|
669
|
-
const t = e.getFullYear(),
|
|
670
|
-
return `${t}-${
|
|
730
|
+
const t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
731
|
+
return `${t}-${n}-${r}`;
|
|
671
732
|
}
|
|
672
|
-
function
|
|
733
|
+
function fe(e) {
|
|
673
734
|
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
674
735
|
}
|
|
675
|
-
function
|
|
736
|
+
function ct(e) {
|
|
676
737
|
return new Date(e.getFullYear(), e.getMonth() + 1, 0);
|
|
677
738
|
}
|
|
678
|
-
function
|
|
739
|
+
function Mt(e, t) {
|
|
679
740
|
return new Date(e.getFullYear(), e.getMonth() + t, 1);
|
|
680
741
|
}
|
|
681
|
-
function
|
|
682
|
-
const
|
|
683
|
-
return new Date(
|
|
742
|
+
function Vt(e, t) {
|
|
743
|
+
const n = Mt(e, t), r = ct(n).getDate();
|
|
744
|
+
return new Date(n.getFullYear(), n.getMonth(), Math.min(e.getDate(), r));
|
|
684
745
|
}
|
|
685
|
-
function
|
|
746
|
+
function ke(e, t) {
|
|
686
747
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
|
|
687
748
|
}
|
|
688
|
-
function
|
|
689
|
-
return !!(e && t &&
|
|
749
|
+
function Ee(e, t) {
|
|
750
|
+
return !!(e && t && et(e) === et(t));
|
|
690
751
|
}
|
|
691
|
-
function
|
|
752
|
+
function ze() {
|
|
692
753
|
const e = /* @__PURE__ */ new Date();
|
|
693
754
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
694
755
|
}
|
|
695
|
-
function
|
|
696
|
-
const
|
|
697
|
-
return Array.from({ length: 42 }, (
|
|
756
|
+
function pa(e, t) {
|
|
757
|
+
const n = fe(e), r = (n.getDay() - t + 7) % 7, l = ke(n, -r);
|
|
758
|
+
return Array.from({ length: 42 }, (s, d) => ke(l, d));
|
|
698
759
|
}
|
|
699
|
-
function
|
|
760
|
+
function _t(e) {
|
|
700
761
|
const t = typeof e.value == "function" ? e.value() : e.value;
|
|
701
|
-
return
|
|
762
|
+
return lt(t);
|
|
702
763
|
}
|
|
703
|
-
function
|
|
764
|
+
function ha(e, t) {
|
|
704
765
|
return new Intl.DateTimeFormat(t, { month: "long", year: "numeric" }).format(e);
|
|
705
766
|
}
|
|
706
|
-
function
|
|
707
|
-
return Array.from({ length: 12 }, (t,
|
|
708
|
-
label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024,
|
|
709
|
-
value:
|
|
767
|
+
function ba(e) {
|
|
768
|
+
return Array.from({ length: 12 }, (t, n) => ({
|
|
769
|
+
label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, n, 1)),
|
|
770
|
+
value: n
|
|
710
771
|
}));
|
|
711
772
|
}
|
|
712
|
-
function
|
|
773
|
+
function _a(e, t) {
|
|
713
774
|
return new Intl.DateTimeFormat(t, {
|
|
714
775
|
month: "short",
|
|
715
776
|
day: "numeric",
|
|
716
777
|
year: "numeric"
|
|
717
778
|
}).format(e);
|
|
718
779
|
}
|
|
719
|
-
function
|
|
780
|
+
function ma(e, t) {
|
|
720
781
|
return new Intl.DateTimeFormat(t, {
|
|
721
782
|
weekday: "long",
|
|
722
783
|
month: "long",
|
|
@@ -724,181 +785,181 @@ function oa(e, t) {
|
|
|
724
785
|
year: "numeric"
|
|
725
786
|
}).format(e);
|
|
726
787
|
}
|
|
727
|
-
function
|
|
728
|
-
const
|
|
729
|
-
return Array.from({ length: 7 }, (r,
|
|
730
|
-
const
|
|
731
|
-
return
|
|
788
|
+
function fa(e, t) {
|
|
789
|
+
const n = new Date(2024, 0, 7);
|
|
790
|
+
return Array.from({ length: 7 }, (r, l) => {
|
|
791
|
+
const s = ke(n, e + l);
|
|
792
|
+
return ua.formatToParts(s).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(s) : "";
|
|
732
793
|
});
|
|
733
794
|
}
|
|
734
|
-
function
|
|
795
|
+
function mt(e, t) {
|
|
735
796
|
return !!(t && e.getTime() < t.getTime());
|
|
736
797
|
}
|
|
737
798
|
function ft(e, t) {
|
|
738
799
|
return !!(t && e.getTime() > t.getTime());
|
|
739
800
|
}
|
|
740
|
-
function
|
|
801
|
+
function Lt(e, t) {
|
|
741
802
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
|
|
742
803
|
}
|
|
743
|
-
function
|
|
744
|
-
const r =
|
|
745
|
-
return !!(t &&
|
|
804
|
+
function gt(e, t, n) {
|
|
805
|
+
const r = fe(e), l = ct(e);
|
|
806
|
+
return !!(t && l < t || n && r > n);
|
|
746
807
|
}
|
|
747
|
-
function
|
|
748
|
-
return t &&
|
|
808
|
+
function ga(e, t, n) {
|
|
809
|
+
return t && ct(e) < t ? fe(t) : n && fe(e) > n ? fe(n) : fe(e);
|
|
749
810
|
}
|
|
750
|
-
function
|
|
751
|
-
const
|
|
811
|
+
function ya(e, t, n, r) {
|
|
812
|
+
const l = fe(e), s = ct(e);
|
|
752
813
|
let d = new Date(
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
Math.min(t.getDate(),
|
|
814
|
+
l.getFullYear(),
|
|
815
|
+
l.getMonth(),
|
|
816
|
+
Math.min(t.getDate(), s.getDate())
|
|
756
817
|
);
|
|
757
|
-
return
|
|
818
|
+
return n && d < n && (d = Lt(n, l) ? n : l), r && d > r && (d = Lt(r, l) ? r : s), d;
|
|
758
819
|
}
|
|
759
|
-
function
|
|
760
|
-
const
|
|
761
|
-
return Array.from({ length:
|
|
820
|
+
function va(e, t, n, r) {
|
|
821
|
+
const l = e.getFullYear(), s = Math.min(l, r.getFullYear() - 100), d = Math.max(l, r.getFullYear() + 20), m = (t == null ? void 0 : t.getFullYear()) ?? s, y = (n == null ? void 0 : n.getFullYear()) ?? d, b = Math.min(m, y, l), u = Math.max(m, y, l);
|
|
822
|
+
return Array.from({ length: u - b + 1 }, (v, N) => b + N);
|
|
762
823
|
}
|
|
763
|
-
const
|
|
824
|
+
const Na = oe(
|
|
764
825
|
({
|
|
765
826
|
label: e,
|
|
766
827
|
value: t,
|
|
767
|
-
defaultValue:
|
|
828
|
+
defaultValue: n,
|
|
768
829
|
onValueChange: r,
|
|
769
|
-
presets:
|
|
770
|
-
customLabel:
|
|
830
|
+
presets: l = [],
|
|
831
|
+
customLabel: s = "Custom",
|
|
771
832
|
showCustom: d = !0,
|
|
772
|
-
presetColumns:
|
|
773
|
-
placeholder:
|
|
774
|
-
helperText:
|
|
775
|
-
isError:
|
|
776
|
-
errorMessage:
|
|
777
|
-
min:
|
|
778
|
-
max:
|
|
779
|
-
name:
|
|
780
|
-
disabled:
|
|
781
|
-
readOnly:
|
|
782
|
-
required:
|
|
783
|
-
locale:
|
|
784
|
-
weekStartsOn:
|
|
785
|
-
className:
|
|
786
|
-
id:
|
|
787
|
-
style:
|
|
788
|
-
...
|
|
789
|
-
},
|
|
790
|
-
const
|
|
791
|
-
"--p-date-picker-preset-columns": String(
|
|
792
|
-
},
|
|
793
|
-
|
|
794
|
-
var
|
|
795
|
-
|
|
796
|
-
}, [
|
|
797
|
-
const
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
},
|
|
801
|
-
if (
|
|
833
|
+
presetColumns: m = "auto",
|
|
834
|
+
placeholder: y = "Select date",
|
|
835
|
+
helperText: b,
|
|
836
|
+
isError: u = !1,
|
|
837
|
+
errorMessage: v,
|
|
838
|
+
min: N,
|
|
839
|
+
max: F,
|
|
840
|
+
name: k,
|
|
841
|
+
disabled: g = !1,
|
|
842
|
+
readOnly: $ = !1,
|
|
843
|
+
required: j = !1,
|
|
844
|
+
locale: B,
|
|
845
|
+
weekStartsOn: A = 0,
|
|
846
|
+
className: I,
|
|
847
|
+
id: T,
|
|
848
|
+
style: V,
|
|
849
|
+
...S
|
|
850
|
+
}, z) => {
|
|
851
|
+
const ee = Oe(), O = T ?? ee, X = `${O}-label`, p = `${O}-panel`, M = `${O}-helper`, x = `${O}-error`, W = t !== void 0, [pe, w] = re(n ?? ""), [D, H] = re(!1), he = W ? t : pe, Y = lt(he), R = tt(ze, []), te = lt(N), Z = lt(F), [G, J] = re(() => fe(Y ?? R)), [q, ce] = re(() => Y ?? R), De = me(null), be = me({}), xe = me(!1), Fe = pa(G, A), Se = fa(A, B), Xe = tt(() => ba(B), [B]), le = va(G, te, Z, R), U = l.length > 0, Ze = U ? d : !0, ge = m === "auto" ? void 0 : {
|
|
852
|
+
"--p-date-picker-preset-columns": String(m)
|
|
853
|
+
}, de = u && v ? x : b ? M : void 0, L = Y ? _a(Y, B) : y, ue = U ? l.some((o) => Ee(_t(o), Y)) : !1, ye = D || !!(Y && !ue), Te = Mt(G, -1), Q = Mt(G, 1), Ie = gt(Te, te, Z), Me = gt(Q, te, Z);
|
|
854
|
+
Ce(() => {
|
|
855
|
+
var o;
|
|
856
|
+
D && xe.current && ((o = be.current[et(q)]) == null || o.focus(), xe.current = !1);
|
|
857
|
+
}, [q, D, G]);
|
|
858
|
+
const $e = (o, C) => {
|
|
859
|
+
const ae = et(o);
|
|
860
|
+
W || w(ae), o && J(fe(o)), r == null || r(ae, { date: o, source: C });
|
|
861
|
+
}, je = (o) => {
|
|
862
|
+
if (g || $)
|
|
802
863
|
return;
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
},
|
|
806
|
-
var
|
|
807
|
-
|
|
808
|
-
},
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
},
|
|
812
|
-
const { value:
|
|
813
|
-
|
|
814
|
-
},
|
|
815
|
-
const { value:
|
|
816
|
-
|
|
817
|
-
},
|
|
818
|
-
if (
|
|
864
|
+
const C = Y ?? R;
|
|
865
|
+
De.current = o, xe.current = !0, ce(C), J(fe(C)), H(!0);
|
|
866
|
+
}, ve = (o = !1) => {
|
|
867
|
+
var C;
|
|
868
|
+
H(!1), o && ((C = De.current) == null || C.focus());
|
|
869
|
+
}, we = (o) => {
|
|
870
|
+
const C = ga(o, te, Z);
|
|
871
|
+
J(C), ce(ya(C, q, te, Z));
|
|
872
|
+
}, He = (o) => {
|
|
873
|
+
const { value: C } = o.currentTarget;
|
|
874
|
+
we(new Date(G.getFullYear(), Number(C), 1));
|
|
875
|
+
}, Ne = (o) => {
|
|
876
|
+
const { value: C } = o.currentTarget;
|
|
877
|
+
we(new Date(Number(C), G.getMonth(), 1));
|
|
878
|
+
}, Be = (o) => {
|
|
879
|
+
if (g || $)
|
|
819
880
|
return;
|
|
820
|
-
const
|
|
821
|
-
|
|
822
|
-
},
|
|
823
|
-
|
|
824
|
-
},
|
|
825
|
-
|
|
826
|
-
},
|
|
827
|
-
if (
|
|
828
|
-
|
|
881
|
+
const C = _t(o);
|
|
882
|
+
$e(C, "preset"), ve();
|
|
883
|
+
}, We = (o) => {
|
|
884
|
+
g || $ || mt(o, te) || ft(o, Z) || (ce(o), $e(o, "calendar"), ve(!0));
|
|
885
|
+
}, Je = (o) => {
|
|
886
|
+
mt(o, te) || ft(o, Z) || (xe.current = !0, ce(o), J(fe(o)));
|
|
887
|
+
}, Qe = (o) => (C) => {
|
|
888
|
+
if (C.key === "Escape") {
|
|
889
|
+
C.preventDefault(), ve(!0);
|
|
829
890
|
return;
|
|
830
891
|
}
|
|
831
|
-
const
|
|
832
|
-
ArrowLeft:
|
|
833
|
-
ArrowRight:
|
|
834
|
-
ArrowUp:
|
|
835
|
-
ArrowDown:
|
|
836
|
-
Home:
|
|
837
|
-
End:
|
|
838
|
-
PageUp:
|
|
839
|
-
PageDown:
|
|
840
|
-
}[
|
|
841
|
-
|
|
892
|
+
const ae = (o.getDay() - A + 7) % 7, P = {
|
|
893
|
+
ArrowLeft: ke(o, -1),
|
|
894
|
+
ArrowRight: ke(o, 1),
|
|
895
|
+
ArrowUp: ke(o, -7),
|
|
896
|
+
ArrowDown: ke(o, 7),
|
|
897
|
+
Home: ke(o, -ae),
|
|
898
|
+
End: ke(o, 6 - ae),
|
|
899
|
+
PageUp: Vt(o, -1),
|
|
900
|
+
PageDown: Vt(o, 1)
|
|
901
|
+
}[C.key];
|
|
902
|
+
P && (C.preventDefault(), Je(P));
|
|
842
903
|
};
|
|
843
904
|
return /* @__PURE__ */ _(
|
|
844
905
|
"div",
|
|
845
906
|
{
|
|
846
|
-
...
|
|
847
|
-
ref:
|
|
848
|
-
id:
|
|
849
|
-
style:
|
|
850
|
-
className:
|
|
907
|
+
...S,
|
|
908
|
+
ref: z,
|
|
909
|
+
id: O,
|
|
910
|
+
style: ge ? { ...V, ...ge } : V,
|
|
911
|
+
className: h(
|
|
851
912
|
"p-date-picker",
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
913
|
+
U && "p-date-picker--with-presets",
|
|
914
|
+
u && "p-date-picker--error",
|
|
915
|
+
g && "p-date-picker--disabled",
|
|
916
|
+
I
|
|
856
917
|
),
|
|
857
918
|
children: [
|
|
858
|
-
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
/* @__PURE__ */
|
|
919
|
+
U ? /* @__PURE__ */ _("div", { id: X, className: "p-date-picker__label", children: [
|
|
920
|
+
/* @__PURE__ */ a("span", { children: e }),
|
|
921
|
+
/* @__PURE__ */ a("span", { className: h("p-date-picker__label-value", !Y && "p-date-picker__label-value--empty"), children: L })
|
|
861
922
|
] }) : null,
|
|
862
|
-
|
|
923
|
+
U ? /* @__PURE__ */ _(
|
|
863
924
|
"div",
|
|
864
925
|
{
|
|
865
|
-
"aria-describedby":
|
|
866
|
-
"aria-labelledby":
|
|
867
|
-
className:
|
|
926
|
+
"aria-describedby": de,
|
|
927
|
+
"aria-labelledby": X,
|
|
928
|
+
className: h(
|
|
868
929
|
"p-date-picker__presets",
|
|
869
|
-
|
|
930
|
+
m !== "auto" && "p-date-picker__presets--fixed"
|
|
870
931
|
),
|
|
871
932
|
role: "group",
|
|
872
933
|
children: [
|
|
873
|
-
|
|
874
|
-
const
|
|
875
|
-
return /* @__PURE__ */
|
|
934
|
+
l.map((o) => {
|
|
935
|
+
const C = _t(o), ae = Ee(C, Y);
|
|
936
|
+
return /* @__PURE__ */ a(
|
|
876
937
|
"button",
|
|
877
938
|
{
|
|
878
939
|
type: "button",
|
|
879
|
-
className:
|
|
880
|
-
disabled:
|
|
881
|
-
"aria-pressed":
|
|
882
|
-
onClick: () =>
|
|
883
|
-
children:
|
|
940
|
+
className: h("p-date-picker__preset", ae && "p-date-picker__preset--active"),
|
|
941
|
+
disabled: g,
|
|
942
|
+
"aria-pressed": ae,
|
|
943
|
+
onClick: () => Be(o),
|
|
944
|
+
children: o.label
|
|
884
945
|
},
|
|
885
|
-
|
|
946
|
+
o.label
|
|
886
947
|
);
|
|
887
948
|
}),
|
|
888
|
-
|
|
949
|
+
Ze ? /* @__PURE__ */ a(
|
|
889
950
|
"button",
|
|
890
951
|
{
|
|
891
952
|
type: "button",
|
|
892
|
-
className:
|
|
953
|
+
className: h(
|
|
893
954
|
"p-date-picker__preset",
|
|
894
|
-
|
|
955
|
+
ye && "p-date-picker__preset--active"
|
|
895
956
|
),
|
|
896
|
-
disabled:
|
|
897
|
-
"aria-controls":
|
|
898
|
-
"aria-expanded":
|
|
899
|
-
"aria-pressed":
|
|
900
|
-
onClick: (
|
|
901
|
-
children:
|
|
957
|
+
disabled: g,
|
|
958
|
+
"aria-controls": p,
|
|
959
|
+
"aria-expanded": D,
|
|
960
|
+
"aria-pressed": ye,
|
|
961
|
+
onClick: (o) => D ? ve(!0) : je(o.currentTarget),
|
|
962
|
+
children: s
|
|
902
963
|
}
|
|
903
964
|
) : null
|
|
904
965
|
]
|
|
@@ -907,169 +968,169 @@ const da = Ne(
|
|
|
907
968
|
"button",
|
|
908
969
|
{
|
|
909
970
|
type: "button",
|
|
910
|
-
className:
|
|
971
|
+
className: h(
|
|
911
972
|
"p-date-picker__trigger",
|
|
912
|
-
!
|
|
913
|
-
|
|
914
|
-
|
|
973
|
+
!Y && "p-date-picker__trigger--empty",
|
|
974
|
+
Y && "p-date-picker__trigger--filled",
|
|
975
|
+
D && "p-date-picker__trigger--open"
|
|
915
976
|
),
|
|
916
|
-
disabled:
|
|
917
|
-
"aria-controls":
|
|
918
|
-
"aria-describedby":
|
|
919
|
-
"aria-expanded":
|
|
977
|
+
disabled: g,
|
|
978
|
+
"aria-controls": p,
|
|
979
|
+
"aria-describedby": de,
|
|
980
|
+
"aria-expanded": D,
|
|
920
981
|
"aria-haspopup": "dialog",
|
|
921
|
-
"aria-label": `${e}: ${
|
|
922
|
-
onClick: (
|
|
982
|
+
"aria-label": `${e}: ${L}`,
|
|
983
|
+
onClick: (o) => D ? ve(!0) : je(o.currentTarget),
|
|
923
984
|
children: [
|
|
924
|
-
/* @__PURE__ */
|
|
985
|
+
/* @__PURE__ */ a(
|
|
925
986
|
"span",
|
|
926
987
|
{
|
|
927
|
-
id:
|
|
928
|
-
className:
|
|
988
|
+
id: X,
|
|
989
|
+
className: h(
|
|
929
990
|
"p-date-picker__trigger-label p-date-picker__trigger-floating-label",
|
|
930
|
-
|
|
991
|
+
u && "p-date-picker__trigger-label--error"
|
|
931
992
|
),
|
|
932
993
|
"aria-hidden": "true",
|
|
933
994
|
children: e
|
|
934
995
|
}
|
|
935
996
|
),
|
|
936
|
-
/* @__PURE__ */
|
|
997
|
+
/* @__PURE__ */ a(
|
|
937
998
|
"span",
|
|
938
999
|
{
|
|
939
|
-
className:
|
|
1000
|
+
className: h(
|
|
940
1001
|
"p-date-picker__trigger-label p-date-picker__trigger-placeholder-label",
|
|
941
|
-
|
|
1002
|
+
u && "p-date-picker__trigger-label--error"
|
|
942
1003
|
),
|
|
943
1004
|
"aria-hidden": "true",
|
|
944
1005
|
children: e
|
|
945
1006
|
}
|
|
946
1007
|
),
|
|
947
|
-
/* @__PURE__ */
|
|
948
|
-
/* @__PURE__ */
|
|
1008
|
+
/* @__PURE__ */ a("span", { className: "p-date-picker__trigger-value", children: L }),
|
|
1009
|
+
/* @__PURE__ */ a("span", { className: "p-date-picker__trigger-icon", children: /* @__PURE__ */ a(qt, {}) })
|
|
949
1010
|
]
|
|
950
1011
|
}
|
|
951
1012
|
),
|
|
952
|
-
/* @__PURE__ */
|
|
953
|
-
|
|
1013
|
+
/* @__PURE__ */ a("input", { type: "hidden", name: k, value: he ?? "", required: j }),
|
|
1014
|
+
D && /* @__PURE__ */ _(
|
|
954
1015
|
"div",
|
|
955
1016
|
{
|
|
956
|
-
id:
|
|
1017
|
+
id: p,
|
|
957
1018
|
className: "p-date-picker__panel",
|
|
958
1019
|
role: "dialog",
|
|
959
|
-
"aria-labelledby": `${
|
|
960
|
-
onKeyDown: (
|
|
961
|
-
|
|
1020
|
+
"aria-labelledby": `${p}-title`,
|
|
1021
|
+
onKeyDown: (o) => {
|
|
1022
|
+
o.key === "Escape" && ve();
|
|
962
1023
|
},
|
|
963
1024
|
children: [
|
|
964
1025
|
/* @__PURE__ */ _("div", { className: "p-date-picker__calendar-header", children: [
|
|
965
|
-
/* @__PURE__ */
|
|
1026
|
+
/* @__PURE__ */ a(
|
|
966
1027
|
"button",
|
|
967
1028
|
{
|
|
968
1029
|
type: "button",
|
|
969
1030
|
className: "p-date-picker__nav",
|
|
970
1031
|
"aria-label": "Previous month",
|
|
971
|
-
disabled:
|
|
972
|
-
onClick: () =>
|
|
973
|
-
children: /* @__PURE__ */
|
|
1032
|
+
disabled: Ie,
|
|
1033
|
+
onClick: () => we(Te),
|
|
1034
|
+
children: /* @__PURE__ */ a(Pt, {})
|
|
974
1035
|
}
|
|
975
1036
|
),
|
|
976
1037
|
/* @__PURE__ */ _("div", { className: "p-date-picker__month", children: [
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
1038
|
+
/* @__PURE__ */ a("span", { id: `${p}-title`, className: "p-date-picker__month-label", children: ha(G, B) }),
|
|
1039
|
+
/* @__PURE__ */ a(
|
|
979
1040
|
"select",
|
|
980
1041
|
{
|
|
981
1042
|
className: "p-date-picker__month-select p-date-picker__calendar-select",
|
|
982
1043
|
"aria-label": "Month",
|
|
983
|
-
value:
|
|
984
|
-
onChange:
|
|
985
|
-
children:
|
|
1044
|
+
value: G.getMonth(),
|
|
1045
|
+
onChange: He,
|
|
1046
|
+
children: Xe.map((o) => /* @__PURE__ */ a(
|
|
986
1047
|
"option",
|
|
987
1048
|
{
|
|
988
|
-
value:
|
|
989
|
-
disabled:
|
|
990
|
-
children:
|
|
1049
|
+
value: o.value,
|
|
1050
|
+
disabled: gt(new Date(G.getFullYear(), o.value, 1), te, Z),
|
|
1051
|
+
children: o.label
|
|
991
1052
|
},
|
|
992
|
-
|
|
1053
|
+
o.value
|
|
993
1054
|
))
|
|
994
1055
|
}
|
|
995
1056
|
),
|
|
996
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ a(
|
|
997
1058
|
"select",
|
|
998
1059
|
{
|
|
999
1060
|
className: "p-date-picker__year-select p-date-picker__calendar-select",
|
|
1000
1061
|
"aria-label": "Year",
|
|
1001
|
-
value:
|
|
1002
|
-
onChange:
|
|
1003
|
-
children:
|
|
1062
|
+
value: G.getFullYear(),
|
|
1063
|
+
onChange: Ne,
|
|
1064
|
+
children: le.map((o) => /* @__PURE__ */ a("option", { value: o, children: o }, o))
|
|
1004
1065
|
}
|
|
1005
1066
|
)
|
|
1006
1067
|
] }),
|
|
1007
|
-
/* @__PURE__ */
|
|
1068
|
+
/* @__PURE__ */ a(
|
|
1008
1069
|
"button",
|
|
1009
1070
|
{
|
|
1010
1071
|
type: "button",
|
|
1011
1072
|
className: "p-date-picker__nav",
|
|
1012
1073
|
"aria-label": "Next month",
|
|
1013
|
-
disabled:
|
|
1014
|
-
onClick: () =>
|
|
1015
|
-
children: /* @__PURE__ */
|
|
1074
|
+
disabled: Me,
|
|
1075
|
+
onClick: () => we(Q),
|
|
1076
|
+
children: /* @__PURE__ */ a(Ft, {})
|
|
1016
1077
|
}
|
|
1017
1078
|
)
|
|
1018
1079
|
] }),
|
|
1019
|
-
/* @__PURE__ */
|
|
1020
|
-
/* @__PURE__ */
|
|
1021
|
-
const
|
|
1022
|
-
return /* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ a("div", { className: "p-date-picker__weekdays", "aria-hidden": "true", children: Se.map((o) => /* @__PURE__ */ a("span", { children: o }, o)) }),
|
|
1081
|
+
/* @__PURE__ */ a("div", { className: "p-date-picker__grid", role: "grid", "aria-labelledby": `${p}-title`, children: Fe.map((o) => {
|
|
1082
|
+
const C = et(o), ae = o.getMonth() !== G.getMonth(), i = Ee(o, Y), P = Ee(o, R), E = mt(o, te) || ft(o, Z);
|
|
1083
|
+
return /* @__PURE__ */ a(
|
|
1023
1084
|
"button",
|
|
1024
1085
|
{
|
|
1025
|
-
ref: (
|
|
1026
|
-
|
|
1086
|
+
ref: (Pe) => {
|
|
1087
|
+
be.current[C] = Pe;
|
|
1027
1088
|
},
|
|
1028
1089
|
type: "button",
|
|
1029
1090
|
role: "gridcell",
|
|
1030
|
-
"data-date":
|
|
1031
|
-
className:
|
|
1091
|
+
"data-date": C,
|
|
1092
|
+
className: h(
|
|
1032
1093
|
"p-date-picker__day",
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1094
|
+
ae && "p-date-picker__day--outside",
|
|
1095
|
+
P && "p-date-picker__day--today",
|
|
1096
|
+
i && "p-date-picker__day--selected"
|
|
1036
1097
|
),
|
|
1037
|
-
disabled:
|
|
1038
|
-
"aria-label":
|
|
1039
|
-
"aria-selected":
|
|
1040
|
-
tabIndex:
|
|
1041
|
-
onClick: () =>
|
|
1042
|
-
onKeyDown:
|
|
1043
|
-
children:
|
|
1098
|
+
disabled: E,
|
|
1099
|
+
"aria-label": ma(o, B),
|
|
1100
|
+
"aria-selected": i,
|
|
1101
|
+
tabIndex: Ee(o, q) ? 0 : -1,
|
|
1102
|
+
onClick: () => We(o),
|
|
1103
|
+
onKeyDown: Qe(o),
|
|
1104
|
+
children: o.getDate()
|
|
1044
1105
|
},
|
|
1045
|
-
|
|
1106
|
+
C
|
|
1046
1107
|
);
|
|
1047
1108
|
}) })
|
|
1048
1109
|
]
|
|
1049
1110
|
}
|
|
1050
1111
|
),
|
|
1051
|
-
|
|
1052
|
-
!
|
|
1112
|
+
u && v ? /* @__PURE__ */ a("p", { id: x, role: "alert", className: "p-date-picker__message p-date-picker__message--error", children: v }) : null,
|
|
1113
|
+
!u && b ? /* @__PURE__ */ a("p", { id: M, className: "p-date-picker__message", children: b }) : null
|
|
1053
1114
|
]
|
|
1054
1115
|
}
|
|
1055
1116
|
);
|
|
1056
1117
|
}
|
|
1057
1118
|
);
|
|
1058
|
-
|
|
1059
|
-
const
|
|
1060
|
-
today: { label: "Today", value: () =>
|
|
1061
|
-
yesterday: { label: "Yesterday", value: () =>
|
|
1062
|
-
tomorrow: { label: "Tomorrow", value: () =>
|
|
1063
|
-
startOfMonth: { label: "Start of month", value: () =>
|
|
1119
|
+
Na.displayName = "PDatePicker";
|
|
1120
|
+
const tn = {
|
|
1121
|
+
today: { label: "Today", value: () => ze() },
|
|
1122
|
+
yesterday: { label: "Yesterday", value: () => ke(ze(), -1) },
|
|
1123
|
+
tomorrow: { label: "Tomorrow", value: () => ke(ze(), 1) },
|
|
1124
|
+
startOfMonth: { label: "Start of month", value: () => fe(ze()) },
|
|
1064
1125
|
endOfMonth: {
|
|
1065
1126
|
label: "End of month",
|
|
1066
1127
|
value: () => {
|
|
1067
|
-
const e =
|
|
1128
|
+
const e = ze();
|
|
1068
1129
|
return new Date(e.getFullYear(), e.getMonth() + 1, 0);
|
|
1069
1130
|
}
|
|
1070
1131
|
}
|
|
1071
|
-
},
|
|
1072
|
-
function
|
|
1132
|
+
}, ka = new Intl.DateTimeFormat(void 0, { weekday: "short" });
|
|
1133
|
+
function st(e) {
|
|
1073
1134
|
if (!e)
|
|
1074
1135
|
return null;
|
|
1075
1136
|
if (e instanceof Date)
|
|
@@ -1077,56 +1138,56 @@ function lt(e) {
|
|
|
1077
1138
|
const t = e.split("-").map(Number);
|
|
1078
1139
|
if (t.length !== 3 || t.some(Number.isNaN))
|
|
1079
1140
|
return null;
|
|
1080
|
-
const [
|
|
1081
|
-
return
|
|
1141
|
+
const [n, r, l] = t, s = new Date(n, r - 1, l);
|
|
1142
|
+
return s.getFullYear() !== n || s.getMonth() !== r - 1 || s.getDate() !== l ? null : s;
|
|
1082
1143
|
}
|
|
1083
|
-
function
|
|
1144
|
+
function K(e) {
|
|
1084
1145
|
if (!e)
|
|
1085
1146
|
return "";
|
|
1086
|
-
const t = e.getFullYear(),
|
|
1087
|
-
return `${t}-${
|
|
1147
|
+
const t = e.getFullYear(), n = String(e.getMonth() + 1).padStart(2, "0"), r = String(e.getDate()).padStart(2, "0");
|
|
1148
|
+
return `${t}-${n}-${r}`;
|
|
1088
1149
|
}
|
|
1089
|
-
function
|
|
1150
|
+
function se(e) {
|
|
1090
1151
|
return new Date(e.getFullYear(), e.getMonth(), 1);
|
|
1091
1152
|
}
|
|
1092
|
-
function
|
|
1153
|
+
function Re(e) {
|
|
1093
1154
|
return new Date(e.getFullYear(), e.getMonth() + 1, 0);
|
|
1094
1155
|
}
|
|
1095
|
-
function
|
|
1156
|
+
function ot(e, t) {
|
|
1096
1157
|
return new Date(e.getFullYear(), e.getMonth() + t, 1);
|
|
1097
1158
|
}
|
|
1098
|
-
function
|
|
1099
|
-
const
|
|
1100
|
-
return new Date(
|
|
1159
|
+
function Kt(e, t) {
|
|
1160
|
+
const n = ot(e, t), r = Re(n).getDate();
|
|
1161
|
+
return new Date(n.getFullYear(), n.getMonth(), Math.min(e.getDate(), r));
|
|
1101
1162
|
}
|
|
1102
|
-
function
|
|
1163
|
+
function ie(e, t) {
|
|
1103
1164
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
|
|
1104
1165
|
}
|
|
1105
|
-
function
|
|
1166
|
+
function Ye() {
|
|
1106
1167
|
const e = /* @__PURE__ */ new Date();
|
|
1107
1168
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
1108
1169
|
}
|
|
1109
|
-
function
|
|
1110
|
-
const
|
|
1111
|
-
return Array.from({ length: 42 }, (
|
|
1170
|
+
function Da(e, t) {
|
|
1171
|
+
const n = se(e), r = (n.getDay() - t + 7) % 7, l = ie(n, -r);
|
|
1172
|
+
return Array.from({ length: 42 }, (s, d) => ie(l, d));
|
|
1112
1173
|
}
|
|
1113
|
-
function
|
|
1174
|
+
function xa(e, t) {
|
|
1114
1175
|
return new Intl.DateTimeFormat(t, { month: "long", year: "numeric" }).format(e);
|
|
1115
1176
|
}
|
|
1116
|
-
function
|
|
1117
|
-
return Array.from({ length: 12 }, (t,
|
|
1118
|
-
label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024,
|
|
1119
|
-
value:
|
|
1177
|
+
function Ma(e) {
|
|
1178
|
+
return Array.from({ length: 12 }, (t, n) => ({
|
|
1179
|
+
label: new Intl.DateTimeFormat(e, { month: "long" }).format(new Date(2024, n, 1)),
|
|
1180
|
+
value: n
|
|
1120
1181
|
}));
|
|
1121
1182
|
}
|
|
1122
|
-
function
|
|
1183
|
+
function nt(e, t) {
|
|
1123
1184
|
return new Intl.DateTimeFormat(t, {
|
|
1124
1185
|
month: "short",
|
|
1125
1186
|
day: "numeric",
|
|
1126
1187
|
year: "numeric"
|
|
1127
1188
|
}).format(e);
|
|
1128
1189
|
}
|
|
1129
|
-
function
|
|
1190
|
+
function $a(e, t) {
|
|
1130
1191
|
return new Intl.DateTimeFormat(t, {
|
|
1131
1192
|
weekday: "long",
|
|
1132
1193
|
month: "long",
|
|
@@ -1134,231 +1195,231 @@ function ga(e, t) {
|
|
|
1134
1195
|
year: "numeric"
|
|
1135
1196
|
}).format(e);
|
|
1136
1197
|
}
|
|
1137
|
-
function
|
|
1138
|
-
const
|
|
1139
|
-
return Array.from({ length: 7 }, (r,
|
|
1140
|
-
const
|
|
1141
|
-
return
|
|
1198
|
+
function wa(e, t) {
|
|
1199
|
+
const n = new Date(2024, 0, 7);
|
|
1200
|
+
return Array.from({ length: 7 }, (r, l) => {
|
|
1201
|
+
const s = ie(n, e + l);
|
|
1202
|
+
return ka.formatToParts(s).length ? new Intl.DateTimeFormat(t, { weekday: "short" }).format(s) : "";
|
|
1142
1203
|
});
|
|
1143
1204
|
}
|
|
1144
|
-
function
|
|
1145
|
-
return !!(e && t &&
|
|
1205
|
+
function rt(e, t) {
|
|
1206
|
+
return !!(e && t && K(e) === K(t));
|
|
1146
1207
|
}
|
|
1147
|
-
function
|
|
1208
|
+
function yt(e, t) {
|
|
1148
1209
|
return !!(t && e.getTime() < t.getTime());
|
|
1149
1210
|
}
|
|
1150
|
-
function
|
|
1211
|
+
function vt(e, t) {
|
|
1151
1212
|
return !!(t && e.getTime() > t.getTime());
|
|
1152
1213
|
}
|
|
1153
|
-
function
|
|
1214
|
+
function jt(e, t) {
|
|
1154
1215
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
|
|
1155
1216
|
}
|
|
1156
|
-
function
|
|
1157
|
-
const r =
|
|
1158
|
-
return !!(t &&
|
|
1217
|
+
function Nt(e, t, n) {
|
|
1218
|
+
const r = se(e), l = Re(e);
|
|
1219
|
+
return !!(t && l < t || n && r > n);
|
|
1159
1220
|
}
|
|
1160
|
-
function
|
|
1161
|
-
return t &&
|
|
1221
|
+
function Pa(e, t, n) {
|
|
1222
|
+
return t && Re(e) < t ? se(t) : n && se(e) > n ? se(n) : se(e);
|
|
1162
1223
|
}
|
|
1163
|
-
function
|
|
1164
|
-
const
|
|
1224
|
+
function Fa(e, t, n, r) {
|
|
1225
|
+
const l = se(e), s = Re(e);
|
|
1165
1226
|
let d = new Date(
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
Math.min(t.getDate(),
|
|
1227
|
+
l.getFullYear(),
|
|
1228
|
+
l.getMonth(),
|
|
1229
|
+
Math.min(t.getDate(), s.getDate())
|
|
1169
1230
|
);
|
|
1170
|
-
return
|
|
1231
|
+
return n && d < n && (d = jt(n, l) ? n : l), r && d > r && (d = jt(r, l) ? r : s), d;
|
|
1171
1232
|
}
|
|
1172
|
-
function
|
|
1173
|
-
const
|
|
1174
|
-
return Array.from({ length:
|
|
1233
|
+
function Ia(e, t, n, r) {
|
|
1234
|
+
const l = e.getFullYear(), s = Math.min(l, r.getFullYear() - 100), d = Math.max(l, r.getFullYear() + 20), m = (t == null ? void 0 : t.getFullYear()) ?? s, y = (n == null ? void 0 : n.getFullYear()) ?? d, b = Math.min(m, y, l), u = Math.max(m, y, l);
|
|
1235
|
+
return Array.from({ length: u - b + 1 }, (v, N) => b + N);
|
|
1175
1236
|
}
|
|
1176
|
-
function
|
|
1177
|
-
return !!(t &&
|
|
1237
|
+
function Ya(e, t, n) {
|
|
1238
|
+
return !!(t && n && e > t && e < n);
|
|
1178
1239
|
}
|
|
1179
|
-
function
|
|
1240
|
+
function Ca(e, t) {
|
|
1180
1241
|
return !e && !t ? {} : e && t && t < e ? {
|
|
1181
|
-
start:
|
|
1182
|
-
end:
|
|
1242
|
+
start: K(t),
|
|
1243
|
+
end: K(e)
|
|
1183
1244
|
} : {
|
|
1184
|
-
start:
|
|
1185
|
-
end:
|
|
1245
|
+
start: K(e),
|
|
1246
|
+
end: K(t)
|
|
1186
1247
|
};
|
|
1187
1248
|
}
|
|
1188
|
-
function
|
|
1249
|
+
function kt(e) {
|
|
1189
1250
|
return typeof e.value == "function" ? e.value() : e.value;
|
|
1190
1251
|
}
|
|
1191
|
-
function
|
|
1252
|
+
function it(e) {
|
|
1192
1253
|
return {
|
|
1193
|
-
startDate:
|
|
1194
|
-
endDate:
|
|
1254
|
+
startDate: st(e == null ? void 0 : e.start),
|
|
1255
|
+
endDate: st(e == null ? void 0 : e.end)
|
|
1195
1256
|
};
|
|
1196
1257
|
}
|
|
1197
|
-
function
|
|
1258
|
+
function Ht(e, t) {
|
|
1198
1259
|
return !!(e != null && e.start && (e != null && e.end) && e.start === (t == null ? void 0 : t.start) && e.end === (t == null ? void 0 : t.end));
|
|
1199
1260
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const { startDate: r, endDate:
|
|
1202
|
-
return r &&
|
|
1261
|
+
function Sa(e, t, n) {
|
|
1262
|
+
const { startDate: r, endDate: l } = it(e);
|
|
1263
|
+
return r && l ? `${nt(r, n)} - ${nt(l, n)}` : r ? `${nt(r, n)} -` : l ? `- ${nt(l, n)}` : t;
|
|
1203
1264
|
}
|
|
1204
|
-
const
|
|
1265
|
+
const Ta = oe(
|
|
1205
1266
|
({
|
|
1206
1267
|
label: e,
|
|
1207
1268
|
value: t,
|
|
1208
|
-
defaultValue:
|
|
1269
|
+
defaultValue: n,
|
|
1209
1270
|
onValueChange: r,
|
|
1210
|
-
presets:
|
|
1211
|
-
customLabel:
|
|
1271
|
+
presets: l = [],
|
|
1272
|
+
customLabel: s = "Custom",
|
|
1212
1273
|
showCustom: d = !0,
|
|
1213
|
-
presetColumns:
|
|
1214
|
-
placeholder:
|
|
1215
|
-
helperText:
|
|
1216
|
-
isError:
|
|
1217
|
-
errorMessage:
|
|
1218
|
-
min:
|
|
1219
|
-
max:
|
|
1220
|
-
nameStart:
|
|
1221
|
-
nameEnd:
|
|
1222
|
-
disabled:
|
|
1223
|
-
readOnly:
|
|
1224
|
-
required:
|
|
1225
|
-
locale:
|
|
1226
|
-
weekStartsOn:
|
|
1227
|
-
className:
|
|
1228
|
-
id:
|
|
1229
|
-
style:
|
|
1230
|
-
...
|
|
1231
|
-
},
|
|
1232
|
-
const
|
|
1233
|
-
"--p-date-range-picker-preset-columns": String(
|
|
1234
|
-
},
|
|
1235
|
-
|
|
1236
|
-
var
|
|
1237
|
-
|
|
1238
|
-
}, [
|
|
1239
|
-
const
|
|
1240
|
-
const { startDate:
|
|
1241
|
-
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
-
startDate:
|
|
1245
|
-
endDate:
|
|
1246
|
-
source:
|
|
1274
|
+
presetColumns: m = "auto",
|
|
1275
|
+
placeholder: y = "Select range",
|
|
1276
|
+
helperText: b,
|
|
1277
|
+
isError: u = !1,
|
|
1278
|
+
errorMessage: v,
|
|
1279
|
+
min: N,
|
|
1280
|
+
max: F,
|
|
1281
|
+
nameStart: k,
|
|
1282
|
+
nameEnd: g,
|
|
1283
|
+
disabled: $ = !1,
|
|
1284
|
+
readOnly: j = !1,
|
|
1285
|
+
required: B = !1,
|
|
1286
|
+
locale: A,
|
|
1287
|
+
weekStartsOn: I = 0,
|
|
1288
|
+
className: T,
|
|
1289
|
+
id: V,
|
|
1290
|
+
style: S,
|
|
1291
|
+
...z
|
|
1292
|
+
}, ee) => {
|
|
1293
|
+
const O = Oe(), X = V ?? O, p = `${X}-label`, M = `${X}-panel`, x = `${X}-helper`, W = `${X}-error`, pe = t !== void 0, [w, D] = re(n ?? {}), [H, he] = re(!1), Y = pe ? t : w, { startDate: R, endDate: te } = it(Y), Z = tt(Ye, []), G = st(N), J = st(F), [q, ce] = re(() => se(R ?? Z)), [De, be] = re(() => R ?? Z), xe = me(null), Fe = me({}), Se = me(!1), Xe = Da(q, I), le = wa(I, A), U = tt(() => Ma(A), [A]), Ze = Ia(q, G, J, Z), ge = l.length > 0, de = ge ? d : !0, L = m === "auto" ? void 0 : {
|
|
1294
|
+
"--p-date-range-picker-preset-columns": String(m)
|
|
1295
|
+
}, ue = !!(Y != null && Y.start && (Y != null && Y.end)), ye = u && v ? W : b ? x : void 0, Te = Sa(Y, y, A), Q = ge ? l.some((i) => Ht(kt(i), Y)) : !1, Ie = H || !!(ue && !Q), Me = ot(q, -1), $e = ot(q, 1), je = Nt(Me, G, J), ve = Nt($e, G, J);
|
|
1296
|
+
Ce(() => {
|
|
1297
|
+
var i;
|
|
1298
|
+
H && Se.current && ((i = Fe.current[K(De)]) == null || i.focus(), Se.current = !1);
|
|
1299
|
+
}, [De, H, q]);
|
|
1300
|
+
const we = (i, P) => {
|
|
1301
|
+
const { startDate: E, endDate: Pe } = it(i), _e = Ca(E, Pe);
|
|
1302
|
+
pe || D(_e);
|
|
1303
|
+
const Ae = it(_e);
|
|
1304
|
+
Ae.startDate && ce(se(Ae.startDate)), r == null || r(_e, {
|
|
1305
|
+
startDate: Ae.startDate,
|
|
1306
|
+
endDate: Ae.endDate,
|
|
1307
|
+
source: P
|
|
1247
1308
|
});
|
|
1248
|
-
},
|
|
1249
|
-
if (
|
|
1309
|
+
}, He = (i) => {
|
|
1310
|
+
if ($ || j)
|
|
1250
1311
|
return;
|
|
1251
|
-
const
|
|
1252
|
-
|
|
1253
|
-
},
|
|
1254
|
-
var
|
|
1255
|
-
|
|
1256
|
-
},
|
|
1257
|
-
const
|
|
1258
|
-
|
|
1259
|
-
},
|
|
1260
|
-
const { value:
|
|
1261
|
-
|
|
1262
|
-
},
|
|
1263
|
-
const { value:
|
|
1264
|
-
|
|
1265
|
-
},
|
|
1266
|
-
|
|
1267
|
-
},
|
|
1268
|
-
if (!(
|
|
1269
|
-
if (!
|
|
1270
|
-
|
|
1312
|
+
const P = R ?? Z;
|
|
1313
|
+
xe.current = i, Se.current = !0, be(P), ce(se(P)), he(!0);
|
|
1314
|
+
}, Ne = (i = !1) => {
|
|
1315
|
+
var P;
|
|
1316
|
+
he(!1), i && ((P = xe.current) == null || P.focus());
|
|
1317
|
+
}, Be = (i) => {
|
|
1318
|
+
const P = Pa(i, G, J);
|
|
1319
|
+
ce(P), be(Fa(P, De, G, J));
|
|
1320
|
+
}, We = (i) => {
|
|
1321
|
+
const { value: P } = i.currentTarget;
|
|
1322
|
+
Be(new Date(q.getFullYear(), Number(P), 1));
|
|
1323
|
+
}, Je = (i) => {
|
|
1324
|
+
const { value: P } = i.currentTarget;
|
|
1325
|
+
Be(new Date(Number(P), q.getMonth(), 1));
|
|
1326
|
+
}, Qe = (i) => {
|
|
1327
|
+
$ || j || (we(kt(i), "preset"), Ne());
|
|
1328
|
+
}, o = (i) => {
|
|
1329
|
+
if (!($ || j || yt(i, G) || vt(i, J))) {
|
|
1330
|
+
if (!R || te) {
|
|
1331
|
+
be(i), we({ start: K(i), end: "" }, "calendar");
|
|
1271
1332
|
return;
|
|
1272
1333
|
}
|
|
1273
|
-
|
|
1334
|
+
be(i), we({ start: K(R), end: K(i) }, "calendar"), Ne(!0);
|
|
1274
1335
|
}
|
|
1275
|
-
},
|
|
1276
|
-
|
|
1277
|
-
},
|
|
1278
|
-
if (
|
|
1279
|
-
|
|
1336
|
+
}, C = (i) => {
|
|
1337
|
+
yt(i, G) || vt(i, J) || (Se.current = !0, be(i), ce(se(i)));
|
|
1338
|
+
}, ae = (i) => (P) => {
|
|
1339
|
+
if (P.key === "Escape") {
|
|
1340
|
+
P.preventDefault(), Ne(!0);
|
|
1280
1341
|
return;
|
|
1281
1342
|
}
|
|
1282
|
-
const
|
|
1283
|
-
ArrowLeft:
|
|
1284
|
-
ArrowRight:
|
|
1285
|
-
ArrowUp:
|
|
1286
|
-
ArrowDown:
|
|
1287
|
-
Home:
|
|
1288
|
-
End:
|
|
1289
|
-
PageUp:
|
|
1290
|
-
PageDown:
|
|
1291
|
-
}[
|
|
1292
|
-
|
|
1343
|
+
const E = (i.getDay() - I + 7) % 7, _e = {
|
|
1344
|
+
ArrowLeft: ie(i, -1),
|
|
1345
|
+
ArrowRight: ie(i, 1),
|
|
1346
|
+
ArrowUp: ie(i, -7),
|
|
1347
|
+
ArrowDown: ie(i, 7),
|
|
1348
|
+
Home: ie(i, -E),
|
|
1349
|
+
End: ie(i, 6 - E),
|
|
1350
|
+
PageUp: Kt(i, -1),
|
|
1351
|
+
PageDown: Kt(i, 1)
|
|
1352
|
+
}[P.key];
|
|
1353
|
+
_e && (P.preventDefault(), C(_e));
|
|
1293
1354
|
};
|
|
1294
1355
|
return /* @__PURE__ */ _(
|
|
1295
1356
|
"div",
|
|
1296
1357
|
{
|
|
1297
|
-
...
|
|
1298
|
-
ref:
|
|
1299
|
-
id:
|
|
1300
|
-
style:
|
|
1301
|
-
className:
|
|
1358
|
+
...z,
|
|
1359
|
+
ref: ee,
|
|
1360
|
+
id: X,
|
|
1361
|
+
style: L ? { ...S, ...L } : S,
|
|
1362
|
+
className: h(
|
|
1302
1363
|
"p-date-range-picker",
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1364
|
+
ge && "p-date-range-picker--with-presets",
|
|
1365
|
+
u && "p-date-range-picker--error",
|
|
1366
|
+
$ && "p-date-range-picker--disabled",
|
|
1367
|
+
T
|
|
1307
1368
|
),
|
|
1308
1369
|
children: [
|
|
1309
|
-
|
|
1310
|
-
/* @__PURE__ */
|
|
1311
|
-
/* @__PURE__ */
|
|
1370
|
+
ge ? /* @__PURE__ */ _("div", { id: p, className: "p-date-range-picker__label", children: [
|
|
1371
|
+
/* @__PURE__ */ a("span", { children: e }),
|
|
1372
|
+
/* @__PURE__ */ a(
|
|
1312
1373
|
"span",
|
|
1313
1374
|
{
|
|
1314
|
-
className:
|
|
1375
|
+
className: h(
|
|
1315
1376
|
"p-date-range-picker__label-value",
|
|
1316
|
-
!
|
|
1377
|
+
!ue && "p-date-range-picker__label-value--empty"
|
|
1317
1378
|
),
|
|
1318
|
-
children:
|
|
1379
|
+
children: Te
|
|
1319
1380
|
}
|
|
1320
1381
|
)
|
|
1321
1382
|
] }) : null,
|
|
1322
|
-
|
|
1383
|
+
ge ? /* @__PURE__ */ _(
|
|
1323
1384
|
"div",
|
|
1324
1385
|
{
|
|
1325
|
-
"aria-describedby":
|
|
1326
|
-
"aria-labelledby":
|
|
1327
|
-
className:
|
|
1386
|
+
"aria-describedby": ye,
|
|
1387
|
+
"aria-labelledby": p,
|
|
1388
|
+
className: h(
|
|
1328
1389
|
"p-date-range-picker__presets",
|
|
1329
|
-
|
|
1390
|
+
m !== "auto" && "p-date-range-picker__presets--fixed"
|
|
1330
1391
|
),
|
|
1331
1392
|
role: "group",
|
|
1332
1393
|
children: [
|
|
1333
|
-
|
|
1334
|
-
const
|
|
1335
|
-
return /* @__PURE__ */
|
|
1394
|
+
l.map((i) => {
|
|
1395
|
+
const P = kt(i), E = Ht(P, Y);
|
|
1396
|
+
return /* @__PURE__ */ a(
|
|
1336
1397
|
"button",
|
|
1337
1398
|
{
|
|
1338
1399
|
type: "button",
|
|
1339
|
-
className:
|
|
1340
|
-
disabled:
|
|
1341
|
-
"aria-pressed":
|
|
1342
|
-
onClick: () =>
|
|
1343
|
-
children:
|
|
1400
|
+
className: h("p-date-range-picker__preset", E && "p-date-range-picker__preset--active"),
|
|
1401
|
+
disabled: $,
|
|
1402
|
+
"aria-pressed": E,
|
|
1403
|
+
onClick: () => Qe(i),
|
|
1404
|
+
children: i.label
|
|
1344
1405
|
},
|
|
1345
|
-
|
|
1406
|
+
i.label
|
|
1346
1407
|
);
|
|
1347
1408
|
}),
|
|
1348
|
-
|
|
1409
|
+
de ? /* @__PURE__ */ a(
|
|
1349
1410
|
"button",
|
|
1350
1411
|
{
|
|
1351
1412
|
type: "button",
|
|
1352
|
-
className:
|
|
1413
|
+
className: h(
|
|
1353
1414
|
"p-date-range-picker__preset",
|
|
1354
|
-
|
|
1415
|
+
Ie && "p-date-range-picker__preset--active"
|
|
1355
1416
|
),
|
|
1356
|
-
disabled:
|
|
1357
|
-
"aria-controls":
|
|
1358
|
-
"aria-expanded":
|
|
1359
|
-
"aria-pressed":
|
|
1360
|
-
onClick: (
|
|
1361
|
-
children:
|
|
1417
|
+
disabled: $,
|
|
1418
|
+
"aria-controls": M,
|
|
1419
|
+
"aria-expanded": H,
|
|
1420
|
+
"aria-pressed": Ie,
|
|
1421
|
+
onClick: (i) => H ? Ne(!0) : He(i.currentTarget),
|
|
1422
|
+
children: s
|
|
1362
1423
|
}
|
|
1363
1424
|
) : null
|
|
1364
1425
|
]
|
|
@@ -1367,316 +1428,853 @@ const xa = Ne(
|
|
|
1367
1428
|
"button",
|
|
1368
1429
|
{
|
|
1369
1430
|
type: "button",
|
|
1370
|
-
className:
|
|
1431
|
+
className: h(
|
|
1371
1432
|
"p-date-range-picker__trigger",
|
|
1372
|
-
!
|
|
1373
|
-
|
|
1374
|
-
|
|
1433
|
+
!ue && "p-date-range-picker__trigger--empty",
|
|
1434
|
+
ue && "p-date-range-picker__trigger--filled",
|
|
1435
|
+
H && "p-date-range-picker__trigger--open"
|
|
1375
1436
|
),
|
|
1376
|
-
disabled:
|
|
1377
|
-
"aria-controls":
|
|
1378
|
-
"aria-describedby":
|
|
1379
|
-
"aria-expanded":
|
|
1437
|
+
disabled: $,
|
|
1438
|
+
"aria-controls": M,
|
|
1439
|
+
"aria-describedby": ye,
|
|
1440
|
+
"aria-expanded": H,
|
|
1380
1441
|
"aria-haspopup": "dialog",
|
|
1381
|
-
"aria-label": `${e}: ${
|
|
1382
|
-
onClick: (
|
|
1442
|
+
"aria-label": `${e}: ${Te}`,
|
|
1443
|
+
onClick: (i) => H ? Ne(!0) : He(i.currentTarget),
|
|
1383
1444
|
children: [
|
|
1384
|
-
/* @__PURE__ */
|
|
1445
|
+
/* @__PURE__ */ a(
|
|
1385
1446
|
"span",
|
|
1386
1447
|
{
|
|
1387
|
-
id:
|
|
1388
|
-
className:
|
|
1448
|
+
id: p,
|
|
1449
|
+
className: h(
|
|
1389
1450
|
"p-date-range-picker__trigger-label p-date-range-picker__trigger-floating-label",
|
|
1390
|
-
|
|
1451
|
+
u && "p-date-range-picker__trigger-label--error"
|
|
1391
1452
|
),
|
|
1392
1453
|
"aria-hidden": "true",
|
|
1393
1454
|
children: e
|
|
1394
1455
|
}
|
|
1395
1456
|
),
|
|
1396
|
-
/* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ a(
|
|
1397
1458
|
"span",
|
|
1398
1459
|
{
|
|
1399
|
-
className:
|
|
1460
|
+
className: h(
|
|
1400
1461
|
"p-date-range-picker__trigger-label p-date-range-picker__trigger-placeholder-label",
|
|
1401
|
-
|
|
1462
|
+
u && "p-date-range-picker__trigger-label--error"
|
|
1402
1463
|
),
|
|
1403
1464
|
"aria-hidden": "true",
|
|
1404
1465
|
children: e
|
|
1405
1466
|
}
|
|
1406
1467
|
),
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ a("span", { className: "p-date-range-picker__trigger-value", children: Te }),
|
|
1469
|
+
/* @__PURE__ */ a("span", { className: "p-date-range-picker__trigger-icon", children: /* @__PURE__ */ a(qt, {}) })
|
|
1409
1470
|
]
|
|
1410
1471
|
}
|
|
1411
1472
|
),
|
|
1412
|
-
/* @__PURE__ */
|
|
1413
|
-
/* @__PURE__ */
|
|
1414
|
-
|
|
1473
|
+
/* @__PURE__ */ a("input", { type: "hidden", name: k, value: (Y == null ? void 0 : Y.start) ?? "", required: B }),
|
|
1474
|
+
/* @__PURE__ */ a("input", { type: "hidden", name: g, value: (Y == null ? void 0 : Y.end) ?? "", required: B }),
|
|
1475
|
+
H && /* @__PURE__ */ _(
|
|
1415
1476
|
"div",
|
|
1416
1477
|
{
|
|
1417
|
-
id:
|
|
1478
|
+
id: M,
|
|
1418
1479
|
className: "p-date-range-picker__panel",
|
|
1419
1480
|
role: "dialog",
|
|
1420
|
-
"aria-labelledby": `${
|
|
1421
|
-
onKeyDown: (
|
|
1422
|
-
|
|
1481
|
+
"aria-labelledby": `${M}-title`,
|
|
1482
|
+
onKeyDown: (i) => {
|
|
1483
|
+
i.key === "Escape" && Ne();
|
|
1423
1484
|
},
|
|
1424
1485
|
children: [
|
|
1425
1486
|
/* @__PURE__ */ _("div", { className: "p-date-range-picker__calendar-header", children: [
|
|
1426
|
-
/* @__PURE__ */
|
|
1487
|
+
/* @__PURE__ */ a(
|
|
1427
1488
|
"button",
|
|
1428
1489
|
{
|
|
1429
1490
|
type: "button",
|
|
1430
1491
|
className: "p-date-range-picker__nav",
|
|
1431
1492
|
"aria-label": "Previous month",
|
|
1432
|
-
disabled:
|
|
1433
|
-
onClick: () =>
|
|
1434
|
-
children: /* @__PURE__ */
|
|
1493
|
+
disabled: je,
|
|
1494
|
+
onClick: () => Be(Me),
|
|
1495
|
+
children: /* @__PURE__ */ a(Pt, {})
|
|
1435
1496
|
}
|
|
1436
1497
|
),
|
|
1437
1498
|
/* @__PURE__ */ _("div", { className: "p-date-range-picker__month", children: [
|
|
1438
|
-
/* @__PURE__ */
|
|
1439
|
-
/* @__PURE__ */
|
|
1499
|
+
/* @__PURE__ */ a("span", { id: `${M}-title`, className: "p-date-range-picker__month-label", children: xa(q, A) }),
|
|
1500
|
+
/* @__PURE__ */ a(
|
|
1440
1501
|
"select",
|
|
1441
1502
|
{
|
|
1442
1503
|
className: "p-date-range-picker__month-select p-date-range-picker__calendar-select",
|
|
1443
1504
|
"aria-label": "Month",
|
|
1444
|
-
value:
|
|
1445
|
-
onChange:
|
|
1446
|
-
children:
|
|
1505
|
+
value: q.getMonth(),
|
|
1506
|
+
onChange: We,
|
|
1507
|
+
children: U.map((i) => /* @__PURE__ */ a(
|
|
1447
1508
|
"option",
|
|
1448
1509
|
{
|
|
1449
|
-
value:
|
|
1450
|
-
disabled:
|
|
1451
|
-
children:
|
|
1510
|
+
value: i.value,
|
|
1511
|
+
disabled: Nt(new Date(q.getFullYear(), i.value, 1), G, J),
|
|
1512
|
+
children: i.label
|
|
1452
1513
|
},
|
|
1453
|
-
|
|
1514
|
+
i.value
|
|
1454
1515
|
))
|
|
1455
1516
|
}
|
|
1456
1517
|
),
|
|
1457
|
-
/* @__PURE__ */
|
|
1518
|
+
/* @__PURE__ */ a(
|
|
1458
1519
|
"select",
|
|
1459
1520
|
{
|
|
1460
1521
|
className: "p-date-range-picker__year-select p-date-range-picker__calendar-select",
|
|
1461
1522
|
"aria-label": "Year",
|
|
1462
|
-
value:
|
|
1463
|
-
onChange:
|
|
1464
|
-
children:
|
|
1523
|
+
value: q.getFullYear(),
|
|
1524
|
+
onChange: Je,
|
|
1525
|
+
children: Ze.map((i) => /* @__PURE__ */ a("option", { value: i, children: i }, i))
|
|
1465
1526
|
}
|
|
1466
1527
|
)
|
|
1467
1528
|
] }),
|
|
1468
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ a(
|
|
1469
1530
|
"button",
|
|
1470
1531
|
{
|
|
1471
1532
|
type: "button",
|
|
1472
1533
|
className: "p-date-range-picker__nav",
|
|
1473
1534
|
"aria-label": "Next month",
|
|
1474
|
-
disabled:
|
|
1475
|
-
onClick: () =>
|
|
1476
|
-
children: /* @__PURE__ */
|
|
1535
|
+
disabled: ve,
|
|
1536
|
+
onClick: () => Be($e),
|
|
1537
|
+
children: /* @__PURE__ */ a(Ft, {})
|
|
1477
1538
|
}
|
|
1478
1539
|
)
|
|
1479
1540
|
] }),
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
const
|
|
1483
|
-
return /* @__PURE__ */
|
|
1541
|
+
/* @__PURE__ */ a("div", { className: "p-date-range-picker__weekdays", "aria-hidden": "true", children: le.map((i) => /* @__PURE__ */ a("span", { children: i }, i)) }),
|
|
1542
|
+
/* @__PURE__ */ a("div", { className: "p-date-range-picker__grid", role: "grid", "aria-labelledby": `${M}-title`, children: Xe.map((i) => {
|
|
1543
|
+
const P = K(i), E = i.getMonth() !== q.getMonth(), Pe = rt(i, R), _e = rt(i, te), Ae = Ya(i, R, te), dt = rt(i, Z), ut = yt(i, G) || vt(i, J);
|
|
1544
|
+
return /* @__PURE__ */ a(
|
|
1484
1545
|
"button",
|
|
1485
1546
|
{
|
|
1486
|
-
ref: (
|
|
1487
|
-
|
|
1547
|
+
ref: (pt) => {
|
|
1548
|
+
Fe.current[P] = pt;
|
|
1488
1549
|
},
|
|
1489
1550
|
type: "button",
|
|
1490
1551
|
role: "gridcell",
|
|
1491
|
-
"data-date":
|
|
1492
|
-
className:
|
|
1552
|
+
"data-date": P,
|
|
1553
|
+
className: h(
|
|
1493
1554
|
"p-date-range-picker__day",
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
(
|
|
1555
|
+
E && "p-date-range-picker__day--outside",
|
|
1556
|
+
dt && "p-date-range-picker__day--today",
|
|
1557
|
+
Ae && "p-date-range-picker__day--in-range",
|
|
1558
|
+
(Pe || _e) && "p-date-range-picker__day--selected"
|
|
1498
1559
|
),
|
|
1499
|
-
disabled:
|
|
1500
|
-
"aria-label":
|
|
1501
|
-
"aria-selected":
|
|
1502
|
-
tabIndex:
|
|
1503
|
-
onClick: () =>
|
|
1504
|
-
onKeyDown:
|
|
1505
|
-
children:
|
|
1560
|
+
disabled: ut,
|
|
1561
|
+
"aria-label": $a(i, A),
|
|
1562
|
+
"aria-selected": Pe || _e,
|
|
1563
|
+
tabIndex: rt(i, De) ? 0 : -1,
|
|
1564
|
+
onClick: () => o(i),
|
|
1565
|
+
onKeyDown: ae(i),
|
|
1566
|
+
children: i.getDate()
|
|
1506
1567
|
},
|
|
1507
|
-
|
|
1568
|
+
P
|
|
1508
1569
|
);
|
|
1509
1570
|
}) })
|
|
1510
1571
|
]
|
|
1511
1572
|
}
|
|
1512
1573
|
),
|
|
1513
|
-
|
|
1514
|
-
!
|
|
1574
|
+
u && v ? /* @__PURE__ */ a("p", { id: W, role: "alert", className: "p-date-range-picker__message p-date-range-picker__message--error", children: v }) : null,
|
|
1575
|
+
!u && b ? /* @__PURE__ */ a("p", { id: x, className: "p-date-range-picker__message", children: b }) : null
|
|
1515
1576
|
]
|
|
1516
1577
|
}
|
|
1517
1578
|
);
|
|
1518
1579
|
}
|
|
1519
1580
|
);
|
|
1520
|
-
|
|
1521
|
-
const
|
|
1581
|
+
Ta.displayName = "PDateRangePicker";
|
|
1582
|
+
const an = {
|
|
1522
1583
|
thisWeek: {
|
|
1523
1584
|
label: "This week",
|
|
1524
1585
|
value: () => {
|
|
1525
|
-
const e =
|
|
1586
|
+
const e = Ye(), t = ie(e, -e.getDay());
|
|
1526
1587
|
return {
|
|
1527
|
-
start:
|
|
1528
|
-
end:
|
|
1588
|
+
start: K(t),
|
|
1589
|
+
end: K(ie(t, 6))
|
|
1529
1590
|
};
|
|
1530
1591
|
}
|
|
1531
1592
|
},
|
|
1532
1593
|
last7Days: {
|
|
1533
1594
|
label: "Last 7 days",
|
|
1534
1595
|
value: () => {
|
|
1535
|
-
const e =
|
|
1596
|
+
const e = Ye();
|
|
1536
1597
|
return {
|
|
1537
|
-
start:
|
|
1538
|
-
end:
|
|
1598
|
+
start: K(ie(e, -6)),
|
|
1599
|
+
end: K(e)
|
|
1539
1600
|
};
|
|
1540
1601
|
}
|
|
1541
1602
|
},
|
|
1542
1603
|
last14Days: {
|
|
1543
1604
|
label: "Last 14 days",
|
|
1544
1605
|
value: () => {
|
|
1545
|
-
const e =
|
|
1606
|
+
const e = Ye();
|
|
1546
1607
|
return {
|
|
1547
|
-
start:
|
|
1548
|
-
end:
|
|
1608
|
+
start: K(ie(e, -13)),
|
|
1609
|
+
end: K(e)
|
|
1549
1610
|
};
|
|
1550
1611
|
}
|
|
1551
1612
|
},
|
|
1552
1613
|
last30Days: {
|
|
1553
1614
|
label: "Last 30 days",
|
|
1554
1615
|
value: () => {
|
|
1555
|
-
const e =
|
|
1616
|
+
const e = Ye();
|
|
1556
1617
|
return {
|
|
1557
|
-
start:
|
|
1558
|
-
end:
|
|
1618
|
+
start: K(ie(e, -29)),
|
|
1619
|
+
end: K(e)
|
|
1559
1620
|
};
|
|
1560
1621
|
}
|
|
1561
1622
|
},
|
|
1562
1623
|
thisMonth: {
|
|
1563
1624
|
label: "This month",
|
|
1564
1625
|
value: () => {
|
|
1565
|
-
const e =
|
|
1626
|
+
const e = Ye(), t = se(e), n = Re(e);
|
|
1566
1627
|
return {
|
|
1567
|
-
start:
|
|
1568
|
-
end:
|
|
1628
|
+
start: K(t),
|
|
1629
|
+
end: K(n)
|
|
1569
1630
|
};
|
|
1570
1631
|
}
|
|
1571
1632
|
},
|
|
1572
1633
|
lastMonth: {
|
|
1573
1634
|
label: "Last month",
|
|
1574
1635
|
value: () => {
|
|
1575
|
-
const e =
|
|
1636
|
+
const e = Ye(), t = ot(e, -1);
|
|
1576
1637
|
return {
|
|
1577
|
-
start:
|
|
1578
|
-
end:
|
|
1638
|
+
start: K(se(t)),
|
|
1639
|
+
end: K(Re(t))
|
|
1579
1640
|
};
|
|
1580
1641
|
}
|
|
1581
1642
|
},
|
|
1582
1643
|
monthToDate: {
|
|
1583
1644
|
label: "Month to date",
|
|
1584
1645
|
value: () => {
|
|
1585
|
-
const e =
|
|
1646
|
+
const e = Ye(), t = se(e);
|
|
1586
1647
|
return {
|
|
1587
|
-
start:
|
|
1588
|
-
end:
|
|
1648
|
+
start: K(t),
|
|
1649
|
+
end: K(e)
|
|
1589
1650
|
};
|
|
1590
1651
|
}
|
|
1591
1652
|
},
|
|
1592
1653
|
yearToDate: {
|
|
1593
1654
|
label: "Year to date",
|
|
1594
1655
|
value: () => {
|
|
1595
|
-
const e =
|
|
1656
|
+
const e = Ye();
|
|
1596
1657
|
return {
|
|
1597
|
-
start:
|
|
1598
|
-
end:
|
|
1658
|
+
start: K(new Date(e.getFullYear(), 0, 1)),
|
|
1659
|
+
end: K(e)
|
|
1599
1660
|
};
|
|
1600
1661
|
}
|
|
1601
1662
|
}
|
|
1602
|
-
},
|
|
1663
|
+
}, Ba = oe(
|
|
1603
1664
|
({
|
|
1604
1665
|
as: e = "span",
|
|
1605
1666
|
variant: t = "primary",
|
|
1606
|
-
appearance:
|
|
1667
|
+
appearance: n = "text",
|
|
1607
1668
|
color: r,
|
|
1608
|
-
textColor:
|
|
1609
|
-
children:
|
|
1669
|
+
textColor: l,
|
|
1670
|
+
children: s,
|
|
1610
1671
|
className: d,
|
|
1611
|
-
style:
|
|
1612
|
-
...
|
|
1613
|
-
},
|
|
1614
|
-
const
|
|
1615
|
-
...
|
|
1672
|
+
style: m,
|
|
1673
|
+
...y
|
|
1674
|
+
}, b) => {
|
|
1675
|
+
const u = {
|
|
1676
|
+
...m,
|
|
1616
1677
|
...r ? { "--p-highlight-color": r, "--p-highlight-bg": r } : {},
|
|
1617
|
-
...
|
|
1678
|
+
...l ? { "--p-highlight-text": l } : {}
|
|
1618
1679
|
};
|
|
1619
|
-
return /* @__PURE__ */
|
|
1680
|
+
return /* @__PURE__ */ a(
|
|
1620
1681
|
e,
|
|
1621
1682
|
{
|
|
1622
|
-
...
|
|
1623
|
-
ref:
|
|
1624
|
-
className:
|
|
1683
|
+
...y,
|
|
1684
|
+
ref: b,
|
|
1685
|
+
className: h(
|
|
1625
1686
|
"p-highlight",
|
|
1626
1687
|
`p-highlight--${t}`,
|
|
1627
|
-
|
|
1688
|
+
n === "background" && "p-highlight--background",
|
|
1628
1689
|
d
|
|
1629
1690
|
),
|
|
1630
|
-
style:
|
|
1631
|
-
children:
|
|
1691
|
+
style: u,
|
|
1692
|
+
children: s
|
|
1632
1693
|
}
|
|
1633
1694
|
);
|
|
1634
1695
|
}
|
|
1635
1696
|
);
|
|
1636
|
-
|
|
1637
|
-
const
|
|
1697
|
+
Ba.displayName = "PHighlight";
|
|
1698
|
+
const Aa = oe(
|
|
1638
1699
|
({
|
|
1639
1700
|
children: e,
|
|
1640
1701
|
ariaLabel: t = "Horizontal content",
|
|
1641
|
-
gap:
|
|
1702
|
+
gap: n,
|
|
1642
1703
|
snap: r = !0,
|
|
1643
|
-
className:
|
|
1644
|
-
scrollerClassName:
|
|
1704
|
+
className: l,
|
|
1705
|
+
scrollerClassName: s,
|
|
1645
1706
|
listClassName: d,
|
|
1646
|
-
itemClassName:
|
|
1647
|
-
style:
|
|
1648
|
-
...
|
|
1649
|
-
},
|
|
1650
|
-
const
|
|
1651
|
-
...
|
|
1652
|
-
...
|
|
1707
|
+
itemClassName: m,
|
|
1708
|
+
style: y,
|
|
1709
|
+
...b
|
|
1710
|
+
}, u) => {
|
|
1711
|
+
const v = {
|
|
1712
|
+
...y,
|
|
1713
|
+
...n ? { "--p-horizontal-slider-gap": n } : {}
|
|
1653
1714
|
};
|
|
1654
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ a(
|
|
1655
1716
|
"div",
|
|
1656
1717
|
{
|
|
1657
|
-
...
|
|
1658
|
-
ref:
|
|
1659
|
-
className:
|
|
1660
|
-
style:
|
|
1661
|
-
children: /* @__PURE__ */
|
|
1718
|
+
...b,
|
|
1719
|
+
ref: u,
|
|
1720
|
+
className: h("p-horizontal-slider", !r && "p-horizontal-slider--no-snap", l),
|
|
1721
|
+
style: v,
|
|
1722
|
+
children: /* @__PURE__ */ a(
|
|
1662
1723
|
"div",
|
|
1663
1724
|
{
|
|
1664
1725
|
"aria-label": t,
|
|
1665
|
-
className:
|
|
1726
|
+
className: h("p-horizontal-slider__scroller", s),
|
|
1666
1727
|
role: "region",
|
|
1667
1728
|
tabIndex: 0,
|
|
1668
|
-
children: /* @__PURE__ */
|
|
1729
|
+
children: /* @__PURE__ */ a("ul", { className: h("p-horizontal-slider__list", d), children: Xt.map(e, (N) => /* @__PURE__ */ a("li", { className: h("p-horizontal-slider__item", m), children: N })) })
|
|
1669
1730
|
}
|
|
1670
1731
|
)
|
|
1671
1732
|
}
|
|
1672
1733
|
);
|
|
1673
1734
|
}
|
|
1674
1735
|
);
|
|
1675
|
-
|
|
1676
|
-
function
|
|
1677
|
-
return /* @__PURE__ */
|
|
1736
|
+
Aa.displayName = "PHorizontalSlider";
|
|
1737
|
+
function Va() {
|
|
1738
|
+
return /* @__PURE__ */ a("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: "1.75", "aria-hidden": "true", children: /* @__PURE__ */ a("path", { d: "m5 8 5 5 5-5" }) });
|
|
1739
|
+
}
|
|
1740
|
+
function Gt(e) {
|
|
1741
|
+
return Array.isArray(e) ? e[0] ?? "" : e ?? "";
|
|
1742
|
+
}
|
|
1743
|
+
const Ot = oe(
|
|
1744
|
+
({
|
|
1745
|
+
className: e,
|
|
1746
|
+
selectClassName: t,
|
|
1747
|
+
label: n,
|
|
1748
|
+
options: r,
|
|
1749
|
+
placeholder: l = "Select an option",
|
|
1750
|
+
helperText: s,
|
|
1751
|
+
id: d,
|
|
1752
|
+
isError: m = !1,
|
|
1753
|
+
errorMessage: y,
|
|
1754
|
+
density: b = "standard",
|
|
1755
|
+
variant: u = "floating",
|
|
1756
|
+
hideLabel: v = !1,
|
|
1757
|
+
disabled: N,
|
|
1758
|
+
required: F,
|
|
1759
|
+
value: k,
|
|
1760
|
+
defaultValue: g,
|
|
1761
|
+
onChange: $,
|
|
1762
|
+
onValueChange: j,
|
|
1763
|
+
style: B,
|
|
1764
|
+
...A
|
|
1765
|
+
}, I) => {
|
|
1766
|
+
const T = Oe(), V = d ?? T, S = `${V}-error`, z = `${V}-helper`, ee = k !== void 0, [O, X] = re(Gt(g)), M = Gt(ee ? k : O) !== "", x = [
|
|
1767
|
+
m && y ? S : null,
|
|
1768
|
+
!m && s ? z : null
|
|
1769
|
+
].filter(Boolean).join(" ") || void 0, W = r.reduce(
|
|
1770
|
+
(w, D) => {
|
|
1771
|
+
const H = D.group ?? null, he = w.find((Y) => Y.group === H);
|
|
1772
|
+
return he ? (he.options.push(D), w) : (w.push({ group: H, options: [D] }), w);
|
|
1773
|
+
},
|
|
1774
|
+
[]
|
|
1775
|
+
), pe = (w) => {
|
|
1776
|
+
const { value: D } = w.currentTarget;
|
|
1777
|
+
ee || X(D), $ == null || $(w), j == null || j(
|
|
1778
|
+
D,
|
|
1779
|
+
r.find((H) => String(H.value) === D) ?? null
|
|
1780
|
+
);
|
|
1781
|
+
};
|
|
1782
|
+
return /* @__PURE__ */ _(
|
|
1783
|
+
"div",
|
|
1784
|
+
{
|
|
1785
|
+
className: h(
|
|
1786
|
+
"p-select",
|
|
1787
|
+
`p-select--${b}`,
|
|
1788
|
+
`p-select--${u}`,
|
|
1789
|
+
M && "p-select--filled",
|
|
1790
|
+
m && "p-select--error",
|
|
1791
|
+
N && "p-select--disabled",
|
|
1792
|
+
e
|
|
1793
|
+
),
|
|
1794
|
+
style: B,
|
|
1795
|
+
children: [
|
|
1796
|
+
/* @__PURE__ */ _("div", { className: "p-select__field", children: [
|
|
1797
|
+
/* @__PURE__ */ _(
|
|
1798
|
+
"select",
|
|
1799
|
+
{
|
|
1800
|
+
...A,
|
|
1801
|
+
id: V,
|
|
1802
|
+
ref: I,
|
|
1803
|
+
value: k,
|
|
1804
|
+
defaultValue: k === void 0 ? g ?? "" : void 0,
|
|
1805
|
+
disabled: N,
|
|
1806
|
+
required: F,
|
|
1807
|
+
"aria-invalid": m || void 0,
|
|
1808
|
+
"aria-describedby": x,
|
|
1809
|
+
"aria-required": F,
|
|
1810
|
+
"aria-disabled": N,
|
|
1811
|
+
className: h("p-select__control", m && "p-select__control--error", t),
|
|
1812
|
+
onChange: pe,
|
|
1813
|
+
children: [
|
|
1814
|
+
l ? /* @__PURE__ */ a("option", { value: "", disabled: F, "aria-label": l, children: "" }) : null,
|
|
1815
|
+
W.map(
|
|
1816
|
+
(w) => w.group ? /* @__PURE__ */ a("optgroup", { label: w.group, children: w.options.map((D) => /* @__PURE__ */ a("option", { value: D.value, disabled: D.disabled, children: D.label }, String(D.value))) }, w.group) : w.options.map((D) => /* @__PURE__ */ a("option", { value: D.value, disabled: D.disabled, children: D.label }, String(D.value)))
|
|
1817
|
+
)
|
|
1818
|
+
]
|
|
1819
|
+
}
|
|
1820
|
+
),
|
|
1821
|
+
u === "floating" ? /* @__PURE__ */ _(wt, { children: [
|
|
1822
|
+
/* @__PURE__ */ a(
|
|
1823
|
+
"span",
|
|
1824
|
+
{
|
|
1825
|
+
"aria-hidden": "true",
|
|
1826
|
+
className: h(
|
|
1827
|
+
"p-select__label p-select__floating-label",
|
|
1828
|
+
v && "p-select__label--hidden",
|
|
1829
|
+
m && "p-select__label--error"
|
|
1830
|
+
),
|
|
1831
|
+
children: n
|
|
1832
|
+
}
|
|
1833
|
+
),
|
|
1834
|
+
/* @__PURE__ */ a(
|
|
1835
|
+
"label",
|
|
1836
|
+
{
|
|
1837
|
+
htmlFor: V,
|
|
1838
|
+
className: h("p-select__label p-select__placeholder-label", v && "p-select__label--hidden"),
|
|
1839
|
+
children: l || n
|
|
1840
|
+
}
|
|
1841
|
+
)
|
|
1842
|
+
] }) : /* @__PURE__ */ a(
|
|
1843
|
+
"label",
|
|
1844
|
+
{
|
|
1845
|
+
htmlFor: V,
|
|
1846
|
+
className: h("p-select__label p-select__inline-label", v && "p-select__label--hidden"),
|
|
1847
|
+
children: n
|
|
1848
|
+
}
|
|
1849
|
+
),
|
|
1850
|
+
/* @__PURE__ */ a("span", { className: "p-select__chevron", "aria-hidden": "true", children: /* @__PURE__ */ a(Va, {}) })
|
|
1851
|
+
] }),
|
|
1852
|
+
m && y ? /* @__PURE__ */ a("p", { id: S, role: "alert", className: "p-select__message p-select__message--error", children: y }) : null,
|
|
1853
|
+
!m && s ? /* @__PURE__ */ a("p", { id: z, className: "p-select__message", children: s }) : null
|
|
1854
|
+
]
|
|
1855
|
+
}
|
|
1856
|
+
);
|
|
1857
|
+
}
|
|
1858
|
+
);
|
|
1859
|
+
Ot.displayName = "PSelect";
|
|
1860
|
+
function $t(e, t) {
|
|
1861
|
+
return Number.isFinite(e) ? t ? Math.min(Math.max(1, Math.trunc(e)), Math.max(1, t)) : Math.max(1, Math.trunc(e)) : 1;
|
|
1862
|
+
}
|
|
1863
|
+
function qe(e, t) {
|
|
1864
|
+
return Array.from({ length: t - e + 1 }, (n, r) => e + r);
|
|
1865
|
+
}
|
|
1866
|
+
function La(e, t, n, r) {
|
|
1867
|
+
const l = Math.max(1, t), s = $t(e, l), d = Math.max(0, Math.trunc(n)), m = Math.max(1, Math.trunc(r)), y = m * 2 + d * 2 + 3;
|
|
1868
|
+
if (l <= y)
|
|
1869
|
+
return qe(1, l);
|
|
1870
|
+
const b = y - m - 1, u = qe(1, m), v = qe(l - m + 1, l), N = b, F = l - b + 1;
|
|
1871
|
+
if (s <= N - d)
|
|
1872
|
+
return [...qe(1, N), "ellipsis", ...v];
|
|
1873
|
+
if (s >= F + d)
|
|
1874
|
+
return [...u, "ellipsis", ...qe(F, l)];
|
|
1875
|
+
const k = s - d, g = s + d;
|
|
1876
|
+
return [
|
|
1877
|
+
...u,
|
|
1878
|
+
"ellipsis",
|
|
1879
|
+
...qe(k, g),
|
|
1880
|
+
"ellipsis",
|
|
1881
|
+
...v
|
|
1882
|
+
];
|
|
1883
|
+
}
|
|
1884
|
+
function Ka(e, t, n, r, l) {
|
|
1885
|
+
if (n !== void 0 && r) {
|
|
1886
|
+
if (n <= 0)
|
|
1887
|
+
return `No ${l}`;
|
|
1888
|
+
const s = (e - 1) * r + 1, d = Math.min(n, e * r);
|
|
1889
|
+
return `Showing ${s}-${d} of ${n} ${l}`;
|
|
1890
|
+
}
|
|
1891
|
+
return t ? `Page ${e} of ${t}` : `Page ${e}`;
|
|
1892
|
+
}
|
|
1893
|
+
function Dt({
|
|
1894
|
+
className: e,
|
|
1895
|
+
children: t,
|
|
1896
|
+
...n
|
|
1897
|
+
}) {
|
|
1898
|
+
return /* @__PURE__ */ a("button", { ...n, type: "button", className: h("p-pagination__button", e), children: t });
|
|
1899
|
+
}
|
|
1900
|
+
const ja = oe(
|
|
1901
|
+
({
|
|
1902
|
+
page: e,
|
|
1903
|
+
pageCount: t,
|
|
1904
|
+
totalItems: n,
|
|
1905
|
+
pageSize: r,
|
|
1906
|
+
pageSizeOptions: l,
|
|
1907
|
+
itemLabel: s = "items",
|
|
1908
|
+
density: d = "standard",
|
|
1909
|
+
siblingCount: m = 1,
|
|
1910
|
+
boundaryCount: y = 1,
|
|
1911
|
+
disabled: b = !1,
|
|
1912
|
+
isLoading: u = !1,
|
|
1913
|
+
hasPreviousPage: v,
|
|
1914
|
+
hasNextPage: N,
|
|
1915
|
+
showRowsPerPage: F = !0,
|
|
1916
|
+
onPageChange: k,
|
|
1917
|
+
onPageSizeChange: g,
|
|
1918
|
+
className: $,
|
|
1919
|
+
summary: j,
|
|
1920
|
+
...B
|
|
1921
|
+
}, A) => {
|
|
1922
|
+
const I = t ? Math.max(1, Math.trunc(t)) : void 0, T = $t(e, I), V = b || u, S = !V && !!k, z = S && (v ?? T > 1), ee = S && (N ?? (I ? T < I : !0)), O = I ? La(T, I, m, y) : [], X = !!(F && r && (l != null && l.length) && g), p = j ?? Ka(T, I, n, r, s), M = (x) => {
|
|
1923
|
+
if (V)
|
|
1924
|
+
return;
|
|
1925
|
+
const W = $t(x, I);
|
|
1926
|
+
W === T && I || k == null || k(W);
|
|
1927
|
+
};
|
|
1928
|
+
return /* @__PURE__ */ _(
|
|
1929
|
+
"nav",
|
|
1930
|
+
{
|
|
1931
|
+
...B,
|
|
1932
|
+
ref: A,
|
|
1933
|
+
className: h(
|
|
1934
|
+
"p-pagination",
|
|
1935
|
+
`p-pagination--${d}`,
|
|
1936
|
+
u && "p-pagination--loading",
|
|
1937
|
+
$
|
|
1938
|
+
),
|
|
1939
|
+
"aria-label": B["aria-label"] ?? "Pagination",
|
|
1940
|
+
"aria-busy": u || void 0,
|
|
1941
|
+
children: [
|
|
1942
|
+
/* @__PURE__ */ a("div", { className: "p-pagination__summary", "aria-live": "polite", children: p }),
|
|
1943
|
+
/* @__PURE__ */ _("div", { className: "p-pagination__controls", children: [
|
|
1944
|
+
/* @__PURE__ */ _(
|
|
1945
|
+
Dt,
|
|
1946
|
+
{
|
|
1947
|
+
className: "p-pagination__button--previous",
|
|
1948
|
+
disabled: !z,
|
|
1949
|
+
"aria-label": "Go to previous page",
|
|
1950
|
+
onClick: () => M(T - 1),
|
|
1951
|
+
children: [
|
|
1952
|
+
/* @__PURE__ */ a(Pt, {}),
|
|
1953
|
+
/* @__PURE__ */ a("span", { children: "Previous" })
|
|
1954
|
+
]
|
|
1955
|
+
}
|
|
1956
|
+
),
|
|
1957
|
+
I ? /* @__PURE__ */ a("div", { className: "p-pagination__pages", "aria-label": "Pages", children: O.map(
|
|
1958
|
+
(x, W) => x === "ellipsis" ? /* @__PURE__ */ a("span", { className: "p-pagination__ellipsis", "aria-hidden": "true", children: "..." }, `ellipsis-${W}`) : /* @__PURE__ */ a(
|
|
1959
|
+
Dt,
|
|
1960
|
+
{
|
|
1961
|
+
className: h("p-pagination__page", x === T && "p-pagination__page--current"),
|
|
1962
|
+
"aria-label": `Go to page ${x}`,
|
|
1963
|
+
"aria-current": x === T ? "page" : void 0,
|
|
1964
|
+
disabled: !S || x === T,
|
|
1965
|
+
onClick: () => M(x),
|
|
1966
|
+
children: x
|
|
1967
|
+
},
|
|
1968
|
+
x
|
|
1969
|
+
)
|
|
1970
|
+
) }) : /* @__PURE__ */ _("div", { className: "p-pagination__cursor-page", "aria-live": "polite", children: [
|
|
1971
|
+
"Page ",
|
|
1972
|
+
T
|
|
1973
|
+
] }),
|
|
1974
|
+
/* @__PURE__ */ _(
|
|
1975
|
+
Dt,
|
|
1976
|
+
{
|
|
1977
|
+
className: "p-pagination__button--next",
|
|
1978
|
+
disabled: !ee,
|
|
1979
|
+
"aria-label": "Go to next page",
|
|
1980
|
+
onClick: () => M(T + 1),
|
|
1981
|
+
children: [
|
|
1982
|
+
/* @__PURE__ */ a("span", { children: "Next" }),
|
|
1983
|
+
/* @__PURE__ */ a(Ft, {})
|
|
1984
|
+
]
|
|
1985
|
+
}
|
|
1986
|
+
)
|
|
1987
|
+
] }),
|
|
1988
|
+
X ? /* @__PURE__ */ a(
|
|
1989
|
+
Ot,
|
|
1990
|
+
{
|
|
1991
|
+
className: "p-pagination__page-size",
|
|
1992
|
+
label: "Rows per page",
|
|
1993
|
+
placeholder: "",
|
|
1994
|
+
density: "compact",
|
|
1995
|
+
variant: "inline",
|
|
1996
|
+
hideLabel: !0,
|
|
1997
|
+
value: r,
|
|
1998
|
+
disabled: V,
|
|
1999
|
+
options: (l == null ? void 0 : l.map((x) => ({ value: x, label: `${x} / page` }))) ?? [],
|
|
2000
|
+
onValueChange: (x) => g == null ? void 0 : g(Number(x))
|
|
2001
|
+
}
|
|
2002
|
+
) : null
|
|
2003
|
+
]
|
|
2004
|
+
}
|
|
2005
|
+
);
|
|
2006
|
+
}
|
|
2007
|
+
);
|
|
2008
|
+
ja.displayName = "PPagination";
|
|
2009
|
+
function Wt(e) {
|
|
2010
|
+
return e.label ? e.label : e.mobileLabel ? e.mobileLabel : typeof e.header == "string" ? e.header : e.id;
|
|
2011
|
+
}
|
|
2012
|
+
function xt(e, t, n) {
|
|
2013
|
+
return t.cell ? t.cell(e, n) : typeof t.accessor == "function" ? t.accessor(e) : t.accessor ? e[t.accessor] : null;
|
|
2014
|
+
}
|
|
2015
|
+
function Ha(e) {
|
|
2016
|
+
return e === "ascending" ? "descending" : "ascending";
|
|
2017
|
+
}
|
|
2018
|
+
function Ga(e) {
|
|
2019
|
+
return !!(e && typeof e == "object" && "closest" in e && typeof e.closest == "function");
|
|
2020
|
+
}
|
|
2021
|
+
function Wa(e) {
|
|
2022
|
+
return !!(e && typeof e == "object" && "contains" in e && typeof e.contains == "function");
|
|
2023
|
+
}
|
|
2024
|
+
function Ut(e, t) {
|
|
2025
|
+
if (!Wa(t) || !Ga(e))
|
|
2026
|
+
return !1;
|
|
2027
|
+
const n = e.closest(
|
|
2028
|
+
[
|
|
2029
|
+
"a",
|
|
2030
|
+
"button",
|
|
2031
|
+
"input",
|
|
2032
|
+
"select",
|
|
2033
|
+
"textarea",
|
|
2034
|
+
"summary",
|
|
2035
|
+
'[contenteditable="true"]',
|
|
2036
|
+
'[role="button"]',
|
|
2037
|
+
'[role="link"]',
|
|
2038
|
+
'[role="menuitem"]',
|
|
2039
|
+
"[data-p-table-ignore-row-click]"
|
|
2040
|
+
].join(",")
|
|
2041
|
+
);
|
|
2042
|
+
return !!(n && n !== t && t.contains(n));
|
|
2043
|
+
}
|
|
2044
|
+
function Ua({
|
|
2045
|
+
columns: e,
|
|
2046
|
+
rows: t,
|
|
2047
|
+
caption: n,
|
|
2048
|
+
captionHidden: r = !1,
|
|
2049
|
+
summary: l,
|
|
2050
|
+
density: s = "standard",
|
|
2051
|
+
stickyHeader: d = !0,
|
|
2052
|
+
stickyFirstColumn: m = !0,
|
|
2053
|
+
isLoading: y = !1,
|
|
2054
|
+
loadingLabel: b = "Loading table data...",
|
|
2055
|
+
emptyState: u = {
|
|
2056
|
+
title: "No records found",
|
|
2057
|
+
description: "Try adjusting the filters or checking back later."
|
|
2058
|
+
},
|
|
2059
|
+
errorState: v,
|
|
2060
|
+
getRowId: N,
|
|
2061
|
+
getRowTone: F,
|
|
2062
|
+
onRowClick: k,
|
|
2063
|
+
renderRowActions: g,
|
|
2064
|
+
onSortChange: $,
|
|
2065
|
+
className: j,
|
|
2066
|
+
tableClassName: B,
|
|
2067
|
+
...A
|
|
2068
|
+
}, I) {
|
|
2069
|
+
const T = t.length > 0, V = !!g, S = v ?? (!y && !T ? u : null), z = e.filter((p) => !p.hideOnMobile), ee = e.length + (V ? 1 : 0), O = (p, M, x) => {
|
|
2070
|
+
Ut(x.target, x.currentTarget) || k == null || k(p, M, x);
|
|
2071
|
+
}, X = (p, M, x) => {
|
|
2072
|
+
Ut(x.target, x.currentTarget) || x.key !== "Enter" && x.key !== " " || (x.preventDefault(), k == null || k(p, M, x));
|
|
2073
|
+
};
|
|
2074
|
+
return /* @__PURE__ */ _(
|
|
2075
|
+
"div",
|
|
2076
|
+
{
|
|
2077
|
+
...A,
|
|
2078
|
+
ref: I,
|
|
2079
|
+
className: h(
|
|
2080
|
+
"p-table",
|
|
2081
|
+
`p-table--${s}`,
|
|
2082
|
+
d && "p-table--sticky-header",
|
|
2083
|
+
m && "p-table--sticky-first-column",
|
|
2084
|
+
k && "p-table--interactive",
|
|
2085
|
+
j
|
|
2086
|
+
),
|
|
2087
|
+
children: [
|
|
2088
|
+
/* @__PURE__ */ a("div", { className: "p-table__header", children: /* @__PURE__ */ _("div", { className: "p-table__header-copy", children: [
|
|
2089
|
+
/* @__PURE__ */ a("h3", { className: h("p-table__caption", r && "p-table__caption--hidden"), children: n }),
|
|
2090
|
+
l ? /* @__PURE__ */ a("div", { className: "p-table__summary", children: l }) : null
|
|
2091
|
+
] }) }),
|
|
2092
|
+
/* @__PURE__ */ a("div", { className: "p-table__viewport", children: /* @__PURE__ */ _("table", { className: h("p-table__table", B), children: [
|
|
2093
|
+
/* @__PURE__ */ a("caption", { className: "p-table__native-caption", children: n }),
|
|
2094
|
+
/* @__PURE__ */ _("colgroup", { children: [
|
|
2095
|
+
e.map((p) => /* @__PURE__ */ a(
|
|
2096
|
+
"col",
|
|
2097
|
+
{
|
|
2098
|
+
className: h(
|
|
2099
|
+
"p-table__col",
|
|
2100
|
+
p.priority && `p-table__col--priority-${p.priority}`,
|
|
2101
|
+
p.hideOnTablet && "p-table__col--hide-tablet",
|
|
2102
|
+
p.hideOnMobile && "p-table__col--hide-mobile"
|
|
2103
|
+
),
|
|
2104
|
+
style: p.width ? { width: p.width } : void 0
|
|
2105
|
+
},
|
|
2106
|
+
p.id
|
|
2107
|
+
)),
|
|
2108
|
+
V ? /* @__PURE__ */ a("col", { className: "p-table__actions-col" }) : null
|
|
2109
|
+
] }),
|
|
2110
|
+
/* @__PURE__ */ a("thead", { className: "p-table__head", children: /* @__PURE__ */ _("tr", { children: [
|
|
2111
|
+
e.map((p) => {
|
|
2112
|
+
const M = Ha(p.sortDirection), x = p.sortDirection ?? (p.sortable ? "none" : void 0);
|
|
2113
|
+
return /* @__PURE__ */ a(
|
|
2114
|
+
"th",
|
|
2115
|
+
{
|
|
2116
|
+
scope: "col",
|
|
2117
|
+
"aria-sort": x,
|
|
2118
|
+
className: h(
|
|
2119
|
+
"p-table__cell p-table__head-cell",
|
|
2120
|
+
p.align && `p-table__cell--${p.align}`,
|
|
2121
|
+
p.priority && `p-table__cell--priority-${p.priority}`,
|
|
2122
|
+
p.hideOnTablet && "p-table__cell--hide-tablet",
|
|
2123
|
+
p.hideOnMobile && "p-table__cell--hide-mobile"
|
|
2124
|
+
),
|
|
2125
|
+
children: p.sortable ? /* @__PURE__ */ _(
|
|
2126
|
+
"button",
|
|
2127
|
+
{
|
|
2128
|
+
type: "button",
|
|
2129
|
+
className: "p-table__sort-button",
|
|
2130
|
+
"aria-label": `Sort by ${Wt(p)}`,
|
|
2131
|
+
onClick: () => $ == null ? void 0 : $(p.id, M),
|
|
2132
|
+
children: [
|
|
2133
|
+
/* @__PURE__ */ a("span", { children: p.header }),
|
|
2134
|
+
/* @__PURE__ */ a(
|
|
2135
|
+
"span",
|
|
2136
|
+
{
|
|
2137
|
+
className: h(
|
|
2138
|
+
"p-table__sort-mark",
|
|
2139
|
+
p.sortDirection && `p-table__sort-mark--${p.sortDirection}`
|
|
2140
|
+
),
|
|
2141
|
+
"aria-hidden": "true"
|
|
2142
|
+
}
|
|
2143
|
+
)
|
|
2144
|
+
]
|
|
2145
|
+
}
|
|
2146
|
+
) : p.header
|
|
2147
|
+
},
|
|
2148
|
+
p.id
|
|
2149
|
+
);
|
|
2150
|
+
}),
|
|
2151
|
+
V ? /* @__PURE__ */ a("th", { scope: "col", className: "p-table__cell p-table__head-cell p-table__actions-head", children: /* @__PURE__ */ a("span", { className: "p-table__sr-only", children: "Actions" }) }) : null
|
|
2152
|
+
] }) }),
|
|
2153
|
+
/* @__PURE__ */ a("tbody", { className: "p-table__body", children: y ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ _("td", { className: "p-table__state-cell", colSpan: ee, children: [
|
|
2154
|
+
/* @__PURE__ */ a("span", { className: "p-table__loading-mark", "aria-hidden": "true" }),
|
|
2155
|
+
/* @__PURE__ */ a("span", { children: b })
|
|
2156
|
+
] }) }) : S ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { className: "p-table__state-cell", colSpan: ee, children: /* @__PURE__ */ _("div", { className: h("p-table__state", S.tone && `p-table__state--${S.tone}`), children: [
|
|
2157
|
+
/* @__PURE__ */ a("strong", { children: S.title }),
|
|
2158
|
+
S.description ? /* @__PURE__ */ a("span", { children: S.description }) : null,
|
|
2159
|
+
S.action ? /* @__PURE__ */ a("div", { className: "p-table__state-action", children: S.action }) : null
|
|
2160
|
+
] }) }) }) : t.map((p, M) => {
|
|
2161
|
+
const x = (N == null ? void 0 : N(p, M)) ?? String(M), W = F == null ? void 0 : F(p, M), pe = e.map((w) => /* @__PURE__ */ a(
|
|
2162
|
+
"td",
|
|
2163
|
+
{
|
|
2164
|
+
className: h(
|
|
2165
|
+
"p-table__cell p-table__body-cell",
|
|
2166
|
+
w.align && `p-table__cell--${w.align}`,
|
|
2167
|
+
w.priority && `p-table__cell--priority-${w.priority}`,
|
|
2168
|
+
w.hideOnTablet && "p-table__cell--hide-tablet",
|
|
2169
|
+
w.hideOnMobile && "p-table__cell--hide-mobile"
|
|
2170
|
+
),
|
|
2171
|
+
children: xt(p, w, M)
|
|
2172
|
+
},
|
|
2173
|
+
w.id
|
|
2174
|
+
));
|
|
2175
|
+
return /* @__PURE__ */ _(
|
|
2176
|
+
"tr",
|
|
2177
|
+
{
|
|
2178
|
+
className: h("p-table__row", W && `p-table__row--${W}`),
|
|
2179
|
+
tabIndex: k ? 0 : void 0,
|
|
2180
|
+
onClick: k ? (w) => O(p, M, w) : void 0,
|
|
2181
|
+
onKeyDown: k ? (w) => X(p, M, w) : void 0,
|
|
2182
|
+
children: [
|
|
2183
|
+
pe,
|
|
2184
|
+
V ? /* @__PURE__ */ a("td", { className: "p-table__cell p-table__body-cell p-table__actions-cell", children: g == null ? void 0 : g(p, M) }) : null
|
|
2185
|
+
]
|
|
2186
|
+
},
|
|
2187
|
+
x
|
|
2188
|
+
);
|
|
2189
|
+
}) })
|
|
2190
|
+
] }) }),
|
|
2191
|
+
/* @__PURE__ */ a("ul", { className: "p-table__mobile-list", "aria-label": `${n} rows`, children: y ? /* @__PURE__ */ _("li", { className: "p-table__mobile-state", children: [
|
|
2192
|
+
/* @__PURE__ */ a("span", { className: "p-table__loading-mark", "aria-hidden": "true" }),
|
|
2193
|
+
/* @__PURE__ */ a("span", { children: b })
|
|
2194
|
+
] }) : S ? /* @__PURE__ */ a("li", { className: "p-table__mobile-state", children: /* @__PURE__ */ _("div", { className: h("p-table__state", S.tone && `p-table__state--${S.tone}`), children: [
|
|
2195
|
+
/* @__PURE__ */ a("strong", { children: S.title }),
|
|
2196
|
+
S.description ? /* @__PURE__ */ a("span", { children: S.description }) : null,
|
|
2197
|
+
S.action ? /* @__PURE__ */ a("div", { className: "p-table__state-action", children: S.action }) : null
|
|
2198
|
+
] }) }) : t.map((p, M) => {
|
|
2199
|
+
const x = (N == null ? void 0 : N(p, M)) ?? String(M), W = z.find((D) => D.priority === "primary") ?? z[0], pe = z.filter((D) => D.id !== (W == null ? void 0 : W.id)), w = F == null ? void 0 : F(p, M);
|
|
2200
|
+
return /* @__PURE__ */ _(
|
|
2201
|
+
"li",
|
|
2202
|
+
{
|
|
2203
|
+
className: h("p-table__mobile-row", w && `p-table__mobile-row--${w}`),
|
|
2204
|
+
role: k ? "button" : void 0,
|
|
2205
|
+
tabIndex: k ? 0 : void 0,
|
|
2206
|
+
onClick: k ? (D) => O(p, M, D) : void 0,
|
|
2207
|
+
onKeyDown: k ? (D) => X(p, M, D) : void 0,
|
|
2208
|
+
children: [
|
|
2209
|
+
W ? /* @__PURE__ */ a("div", { className: "p-table__mobile-title", children: xt(p, W, M) }) : null,
|
|
2210
|
+
/* @__PURE__ */ a("dl", { className: "p-table__mobile-fields", children: pe.map((D) => /* @__PURE__ */ _("div", { className: "p-table__mobile-field", children: [
|
|
2211
|
+
/* @__PURE__ */ a("dt", { children: Wt(D) }),
|
|
2212
|
+
/* @__PURE__ */ a("dd", { children: xt(p, D, M) })
|
|
2213
|
+
] }, D.id)) }),
|
|
2214
|
+
V ? /* @__PURE__ */ a("div", { className: "p-table__mobile-actions", children: g == null ? void 0 : g(p, M) }) : null
|
|
2215
|
+
]
|
|
2216
|
+
},
|
|
2217
|
+
x
|
|
2218
|
+
);
|
|
2219
|
+
}) })
|
|
2220
|
+
]
|
|
2221
|
+
}
|
|
2222
|
+
);
|
|
2223
|
+
}
|
|
2224
|
+
const qa = oe(Ua);
|
|
2225
|
+
qa.displayName = "PTable";
|
|
2226
|
+
function nn({
|
|
2227
|
+
title: e,
|
|
2228
|
+
index: t = "01",
|
|
2229
|
+
variant: n = "default",
|
|
2230
|
+
className: r
|
|
2231
|
+
}) {
|
|
2232
|
+
return n === "indexed" ? /* @__PURE__ */ _(
|
|
2233
|
+
"div",
|
|
2234
|
+
{
|
|
2235
|
+
className: h("p-section-header p-section-header--indexed", r),
|
|
2236
|
+
children: [
|
|
2237
|
+
/* @__PURE__ */ a(
|
|
2238
|
+
Ke,
|
|
2239
|
+
{
|
|
2240
|
+
as: "span",
|
|
2241
|
+
className: "p-section-header__mark",
|
|
2242
|
+
variant: "body",
|
|
2243
|
+
"aria-hidden": "true",
|
|
2244
|
+
children: "—"
|
|
2245
|
+
}
|
|
2246
|
+
),
|
|
2247
|
+
/* @__PURE__ */ a(
|
|
2248
|
+
Ke,
|
|
2249
|
+
{
|
|
2250
|
+
as: "span",
|
|
2251
|
+
className: "p-section-header__index",
|
|
2252
|
+
variant: "body",
|
|
2253
|
+
children: t
|
|
2254
|
+
}
|
|
2255
|
+
),
|
|
2256
|
+
/* @__PURE__ */ a(
|
|
2257
|
+
Ke,
|
|
2258
|
+
{
|
|
2259
|
+
as: "span",
|
|
2260
|
+
className: "p-section-header__divider",
|
|
2261
|
+
variant: "body",
|
|
2262
|
+
"aria-hidden": "true",
|
|
2263
|
+
children: "\\"
|
|
2264
|
+
}
|
|
2265
|
+
),
|
|
2266
|
+
/* @__PURE__ */ a(Ke, { as: "h2", className: "p-section-header__title", variant: "body", children: e })
|
|
2267
|
+
]
|
|
2268
|
+
}
|
|
2269
|
+
) : /* @__PURE__ */ a(
|
|
2270
|
+
Zt,
|
|
2271
|
+
{
|
|
2272
|
+
className: h("p-section-header p-section-header--default", r),
|
|
2273
|
+
children: /* @__PURE__ */ a(Ke, { className: "p-section-header__title", variant: "body-wide", children: e })
|
|
2274
|
+
}
|
|
2275
|
+
);
|
|
1678
2276
|
}
|
|
1679
|
-
function
|
|
2277
|
+
function za() {
|
|
1680
2278
|
return /* @__PURE__ */ _(
|
|
1681
2279
|
"svg",
|
|
1682
2280
|
{
|
|
@@ -1691,13 +2289,13 @@ function Ma() {
|
|
|
1691
2289
|
focusable: "false",
|
|
1692
2290
|
className: "p-text-input__icon",
|
|
1693
2291
|
children: [
|
|
1694
|
-
/* @__PURE__ */
|
|
1695
|
-
/* @__PURE__ */
|
|
2292
|
+
/* @__PURE__ */ a("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }),
|
|
2293
|
+
/* @__PURE__ */ a("circle", { cx: "12", cy: "12", r: "3" })
|
|
1696
2294
|
]
|
|
1697
2295
|
}
|
|
1698
2296
|
);
|
|
1699
2297
|
}
|
|
1700
|
-
function
|
|
2298
|
+
function Ra() {
|
|
1701
2299
|
return /* @__PURE__ */ _(
|
|
1702
2300
|
"svg",
|
|
1703
2301
|
{
|
|
@@ -1712,190 +2310,190 @@ function Ia() {
|
|
|
1712
2310
|
focusable: "false",
|
|
1713
2311
|
className: "p-text-input__icon",
|
|
1714
2312
|
children: [
|
|
1715
|
-
/* @__PURE__ */
|
|
1716
|
-
/* @__PURE__ */
|
|
1717
|
-
/* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ a("path", { d: "M9.88 9.88a3 3 0 1 0 4.24 4.24" }),
|
|
2314
|
+
/* @__PURE__ */ a("path", { d: "M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" }),
|
|
2315
|
+
/* @__PURE__ */ a("path", { d: "M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" }),
|
|
2316
|
+
/* @__PURE__ */ a("line", { x1: "2", x2: "22", y1: "2", y2: "22" })
|
|
1719
2317
|
]
|
|
1720
2318
|
}
|
|
1721
2319
|
);
|
|
1722
2320
|
}
|
|
1723
|
-
const
|
|
2321
|
+
const Oa = oe(
|
|
1724
2322
|
({
|
|
1725
2323
|
className: e,
|
|
1726
2324
|
inputClassName: t,
|
|
1727
|
-
type:
|
|
2325
|
+
type: n,
|
|
1728
2326
|
label: r,
|
|
1729
|
-
helperText:
|
|
1730
|
-
id:
|
|
2327
|
+
helperText: l,
|
|
2328
|
+
id: s,
|
|
1731
2329
|
isError: d = !1,
|
|
1732
|
-
errorMessage:
|
|
1733
|
-
rightAdornment:
|
|
1734
|
-
disabled:
|
|
1735
|
-
readOnly:
|
|
1736
|
-
style:
|
|
1737
|
-
...
|
|
1738
|
-
},
|
|
1739
|
-
const
|
|
1740
|
-
d &&
|
|
1741
|
-
!d &&
|
|
2330
|
+
errorMessage: m,
|
|
2331
|
+
rightAdornment: y,
|
|
2332
|
+
disabled: b,
|
|
2333
|
+
readOnly: u,
|
|
2334
|
+
style: v,
|
|
2335
|
+
...N
|
|
2336
|
+
}, F) => {
|
|
2337
|
+
const k = Oe(), g = s ?? k, $ = `${g}-error`, j = `${g}-helper`, B = n === "password", A = !!y && !B, [I, T] = re(!1), V = B ? I ? "text" : "password" : n ?? "text", S = [
|
|
2338
|
+
d && m ? $ : null,
|
|
2339
|
+
!d && l ? j : null
|
|
1742
2340
|
].filter(Boolean).join(" ") || void 0;
|
|
1743
|
-
return /* @__PURE__ */ _("div", { className:
|
|
2341
|
+
return /* @__PURE__ */ _("div", { className: h("p-text-input", e), style: v, children: [
|
|
1744
2342
|
/* @__PURE__ */ _("div", { className: "p-text-input__field", children: [
|
|
1745
|
-
/* @__PURE__ */
|
|
2343
|
+
/* @__PURE__ */ a(
|
|
1746
2344
|
"input",
|
|
1747
2345
|
{
|
|
1748
|
-
...
|
|
1749
|
-
id:
|
|
1750
|
-
ref:
|
|
1751
|
-
type:
|
|
1752
|
-
disabled:
|
|
1753
|
-
readOnly:
|
|
2346
|
+
...N,
|
|
2347
|
+
id: g,
|
|
2348
|
+
ref: F,
|
|
2349
|
+
type: V,
|
|
2350
|
+
disabled: b,
|
|
2351
|
+
readOnly: u,
|
|
1754
2352
|
placeholder: " ",
|
|
1755
2353
|
"aria-invalid": d || void 0,
|
|
1756
|
-
"aria-describedby":
|
|
1757
|
-
"aria-required":
|
|
1758
|
-
"aria-disabled":
|
|
1759
|
-
"aria-readonly":
|
|
1760
|
-
autoComplete:
|
|
1761
|
-
className:
|
|
2354
|
+
"aria-describedby": S,
|
|
2355
|
+
"aria-required": N.required,
|
|
2356
|
+
"aria-disabled": b,
|
|
2357
|
+
"aria-readonly": u,
|
|
2358
|
+
autoComplete: N.autoComplete ?? (B ? "current-password" : void 0),
|
|
2359
|
+
className: h(
|
|
1762
2360
|
"p-text-input__control",
|
|
1763
|
-
(
|
|
2361
|
+
(B || A) && "p-text-input__control--adorned",
|
|
1764
2362
|
d && "p-text-input__control--error",
|
|
1765
|
-
|
|
2363
|
+
A && n === "date" && "p-text-input__control--date-adorned",
|
|
1766
2364
|
t
|
|
1767
2365
|
)
|
|
1768
2366
|
}
|
|
1769
2367
|
),
|
|
1770
|
-
/* @__PURE__ */
|
|
2368
|
+
/* @__PURE__ */ a(
|
|
1771
2369
|
"span",
|
|
1772
2370
|
{
|
|
1773
2371
|
"aria-hidden": "true",
|
|
1774
|
-
className:
|
|
2372
|
+
className: h(
|
|
1775
2373
|
"p-text-input__label p-text-input__floating-label",
|
|
1776
2374
|
d && "p-text-input__label--error"
|
|
1777
2375
|
),
|
|
1778
2376
|
children: r
|
|
1779
2377
|
}
|
|
1780
2378
|
),
|
|
1781
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ a(
|
|
1782
2380
|
"label",
|
|
1783
2381
|
{
|
|
1784
|
-
htmlFor:
|
|
2382
|
+
htmlFor: g,
|
|
1785
2383
|
className: "p-text-input__label p-text-input__placeholder-label",
|
|
1786
2384
|
children: r
|
|
1787
2385
|
}
|
|
1788
2386
|
),
|
|
1789
|
-
|
|
2387
|
+
B && /* @__PURE__ */ a(
|
|
1790
2388
|
"button",
|
|
1791
2389
|
{
|
|
1792
2390
|
type: "button",
|
|
1793
|
-
onClick: () =>
|
|
1794
|
-
disabled:
|
|
2391
|
+
onClick: () => T((z) => !z),
|
|
2392
|
+
disabled: b,
|
|
1795
2393
|
className: "p-text-input__action",
|
|
1796
|
-
"aria-label":
|
|
1797
|
-
"aria-pressed":
|
|
1798
|
-
"aria-controls":
|
|
1799
|
-
children:
|
|
2394
|
+
"aria-label": I ? "Hide password" : "Show password",
|
|
2395
|
+
"aria-pressed": I,
|
|
2396
|
+
"aria-controls": g,
|
|
2397
|
+
children: I ? /* @__PURE__ */ a(za, {}) : /* @__PURE__ */ a(Ra, {})
|
|
1800
2398
|
}
|
|
1801
2399
|
),
|
|
1802
|
-
|
|
2400
|
+
A && /* @__PURE__ */ a("span", { "aria-hidden": "true", className: "p-text-input__adornment", children: y })
|
|
1803
2401
|
] }),
|
|
1804
|
-
d &&
|
|
2402
|
+
d && m && /* @__PURE__ */ a(
|
|
1805
2403
|
"p",
|
|
1806
2404
|
{
|
|
1807
|
-
id:
|
|
2405
|
+
id: $,
|
|
1808
2406
|
role: "alert",
|
|
1809
2407
|
className: "p-text-input__message p-text-input__message--error",
|
|
1810
|
-
children:
|
|
2408
|
+
children: m
|
|
1811
2409
|
}
|
|
1812
2410
|
),
|
|
1813
|
-
!d &&
|
|
2411
|
+
!d && l && /* @__PURE__ */ a(
|
|
1814
2412
|
"p",
|
|
1815
2413
|
{
|
|
1816
|
-
id:
|
|
2414
|
+
id: j,
|
|
1817
2415
|
className: "p-text-input__message p-text-input__message--helper",
|
|
1818
|
-
children:
|
|
2416
|
+
children: l
|
|
1819
2417
|
}
|
|
1820
2418
|
)
|
|
1821
2419
|
] });
|
|
1822
2420
|
}
|
|
1823
2421
|
);
|
|
1824
|
-
|
|
1825
|
-
const
|
|
2422
|
+
Oa.displayName = "PTextInput";
|
|
2423
|
+
const Xa = oe(
|
|
1826
2424
|
({
|
|
1827
2425
|
className: e,
|
|
1828
2426
|
textareaClassName: t,
|
|
1829
|
-
label:
|
|
2427
|
+
label: n,
|
|
1830
2428
|
helperText: r,
|
|
1831
|
-
id:
|
|
1832
|
-
isError:
|
|
2429
|
+
id: l,
|
|
2430
|
+
isError: s = !1,
|
|
1833
2431
|
errorMessage: d,
|
|
1834
|
-
disabled:
|
|
1835
|
-
readOnly:
|
|
1836
|
-
rows:
|
|
1837
|
-
style:
|
|
1838
|
-
...
|
|
1839
|
-
},
|
|
1840
|
-
const
|
|
1841
|
-
|
|
1842
|
-
!
|
|
2432
|
+
disabled: m,
|
|
2433
|
+
readOnly: y,
|
|
2434
|
+
rows: b = 4,
|
|
2435
|
+
style: u,
|
|
2436
|
+
...v
|
|
2437
|
+
}, N) => {
|
|
2438
|
+
const F = Oe(), k = l ?? F, g = `${k}-error`, $ = `${k}-helper`, j = [
|
|
2439
|
+
s && d ? g : null,
|
|
2440
|
+
!s && r ? $ : null
|
|
1843
2441
|
].filter(Boolean).join(" ") || void 0;
|
|
1844
|
-
return /* @__PURE__ */ _("div", { className:
|
|
1845
|
-
/* @__PURE__ */
|
|
2442
|
+
return /* @__PURE__ */ _("div", { className: h("p-text-area", e), style: u, children: [
|
|
2443
|
+
/* @__PURE__ */ a(
|
|
1846
2444
|
"textarea",
|
|
1847
2445
|
{
|
|
1848
|
-
...
|
|
1849
|
-
id:
|
|
1850
|
-
ref:
|
|
1851
|
-
rows:
|
|
1852
|
-
disabled:
|
|
1853
|
-
readOnly:
|
|
2446
|
+
...v,
|
|
2447
|
+
id: k,
|
|
2448
|
+
ref: N,
|
|
2449
|
+
rows: b,
|
|
2450
|
+
disabled: m,
|
|
2451
|
+
readOnly: y,
|
|
1854
2452
|
placeholder: " ",
|
|
1855
|
-
"aria-invalid":
|
|
1856
|
-
"aria-describedby":
|
|
1857
|
-
"aria-required":
|
|
1858
|
-
"aria-disabled":
|
|
1859
|
-
"aria-readonly":
|
|
1860
|
-
className:
|
|
2453
|
+
"aria-invalid": s || void 0,
|
|
2454
|
+
"aria-describedby": j,
|
|
2455
|
+
"aria-required": v.required,
|
|
2456
|
+
"aria-disabled": m,
|
|
2457
|
+
"aria-readonly": y,
|
|
2458
|
+
className: h(
|
|
1861
2459
|
"p-text-area__control",
|
|
1862
|
-
|
|
2460
|
+
s && "p-text-area__control--error",
|
|
1863
2461
|
t
|
|
1864
2462
|
)
|
|
1865
2463
|
}
|
|
1866
2464
|
),
|
|
1867
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ a(
|
|
1868
2466
|
"span",
|
|
1869
2467
|
{
|
|
1870
2468
|
"aria-hidden": "true",
|
|
1871
|
-
className:
|
|
2469
|
+
className: h(
|
|
1872
2470
|
"p-text-area__label p-text-area__floating-label",
|
|
1873
|
-
|
|
2471
|
+
s && "p-text-area__label--error"
|
|
1874
2472
|
),
|
|
1875
|
-
children:
|
|
2473
|
+
children: n
|
|
1876
2474
|
}
|
|
1877
2475
|
),
|
|
1878
|
-
/* @__PURE__ */
|
|
2476
|
+
/* @__PURE__ */ a(
|
|
1879
2477
|
"label",
|
|
1880
2478
|
{
|
|
1881
|
-
htmlFor:
|
|
2479
|
+
htmlFor: k,
|
|
1882
2480
|
className: "p-text-area__label p-text-area__placeholder-label",
|
|
1883
|
-
children:
|
|
2481
|
+
children: n
|
|
1884
2482
|
}
|
|
1885
2483
|
),
|
|
1886
|
-
|
|
2484
|
+
s && d && /* @__PURE__ */ a(
|
|
1887
2485
|
"p",
|
|
1888
2486
|
{
|
|
1889
|
-
id:
|
|
2487
|
+
id: g,
|
|
1890
2488
|
role: "alert",
|
|
1891
2489
|
className: "p-text-area__message p-text-area__message--error",
|
|
1892
2490
|
children: d
|
|
1893
2491
|
}
|
|
1894
2492
|
),
|
|
1895
|
-
!
|
|
2493
|
+
!s && r && /* @__PURE__ */ a(
|
|
1896
2494
|
"p",
|
|
1897
2495
|
{
|
|
1898
|
-
id:
|
|
2496
|
+
id: $,
|
|
1899
2497
|
className: "p-text-area__message p-text-area__message--helper",
|
|
1900
2498
|
children: r
|
|
1901
2499
|
}
|
|
@@ -1903,23 +2501,27 @@ const Ca = Ne(
|
|
|
1903
2501
|
] });
|
|
1904
2502
|
}
|
|
1905
2503
|
);
|
|
1906
|
-
|
|
2504
|
+
Xa.displayName = "PTextArea";
|
|
1907
2505
|
export {
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
da as
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
Aa as
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
2506
|
+
Jt as PBadge,
|
|
2507
|
+
Qt as PButton,
|
|
2508
|
+
na as PCard,
|
|
2509
|
+
ia as PCardGrid,
|
|
2510
|
+
da as PCombobox,
|
|
2511
|
+
Na as PDatePicker,
|
|
2512
|
+
tn as PDatePickerPresets,
|
|
2513
|
+
Ta as PDateRangePicker,
|
|
2514
|
+
an as PDateRangePickerPresets,
|
|
2515
|
+
Ba as PHighlight,
|
|
2516
|
+
Aa as PHorizontalSlider,
|
|
2517
|
+
ja as PPagination,
|
|
2518
|
+
nn as PSectionHeader,
|
|
2519
|
+
Ot as PSelect,
|
|
2520
|
+
qa as PTable,
|
|
2521
|
+
Xa as PTextArea,
|
|
2522
|
+
Oa as PTextInput,
|
|
2523
|
+
Ke as PTypography,
|
|
2524
|
+
en as Row,
|
|
2525
|
+
Zt as Stack
|
|
1924
2526
|
};
|
|
1925
2527
|
//# sourceMappingURL=index.es.js.map
|