@floegence/floe-webapp-core 0.86.76 → 0.87.1
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/components/index.d.ts +2 -0
- package/dist/components/ui/Accordion.d.ts +16 -0
- package/dist/components/ui/Accordion.js +59 -0
- package/dist/components/ui/Breadcrumb.d.ts +14 -0
- package/dist/components/ui/Breadcrumb.js +72 -0
- package/dist/components/ui/Calendar.d.ts +17 -0
- package/dist/components/ui/Calendar.js +151 -0
- package/dist/components/ui/Checkbox.js +137 -130
- package/dist/components/ui/DataTable.d.ts +33 -0
- package/dist/components/ui/DataTable.js +269 -0
- package/dist/components/ui/DatePicker.d.ts +35 -0
- package/dist/components/ui/DatePicker.js +198 -0
- package/dist/components/ui/Dropdown.d.ts +4 -20
- package/dist/components/ui/Dropdown.js +195 -231
- package/dist/components/ui/Form.d.ts +24 -5
- package/dist/components/ui/Form.js +179 -128
- package/dist/components/ui/Input.d.ts +6 -0
- package/dist/components/ui/Input.js +237 -189
- package/dist/components/ui/Pagination.js +211 -162
- package/dist/components/ui/Popover.d.ts +6 -1
- package/dist/components/ui/Popover.js +75 -56
- package/dist/components/ui/Select.d.ts +46 -0
- package/dist/components/ui/Select.js +414 -0
- package/dist/components/ui/Slider.d.ts +7 -0
- package/dist/components/ui/Slider.js +28 -0
- package/dist/components/ui/Switch.js +41 -32
- package/dist/components/ui/Table.d.ts +9 -0
- package/dist/components/ui/Table.js +97 -0
- package/dist/components/ui/calendarModel.d.ts +6 -0
- package/dist/components/ui/calendarModel.js +37 -0
- package/dist/components/ui/controllable.d.ts +7 -0
- package/dist/components/ui/controllable.js +10 -0
- package/dist/components/ui/dataTableModel.d.ts +18 -0
- package/dist/components/ui/dataTableModel.js +18 -0
- package/dist/components/ui/formFieldContext.d.ts +26 -0
- package/dist/components/ui/formFieldContext.js +40 -0
- package/dist/components/ui/index.d.ts +13 -1
- package/dist/components/ui/picker/PickerBase.js +106 -112
- package/dist/context/LocaleContext.d.ts +55 -0
- package/dist/context/LocaleContext.js +80 -0
- package/dist/context/index.d.ts +1 -0
- package/dist/floe.css +1 -0
- package/dist/full.d.ts +2 -0
- package/dist/full.js +776 -737
- package/dist/index.js +111 -107
- package/dist/standalone.css +1 -0
- package/dist/styles/themes/presets.d.ts +7 -3
- package/dist/styles/themes/presets.js +91 -39
- package/dist/styles.css +1 -1
- package/dist/themes/porcelain-light.css +19 -0
- package/dist/themes/shell-presets.generated.css +62 -49
- package/dist/ui.js +223 -184
- package/dist/workbench-themes.css +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import { insert as a, createComponent as r, memo as d, effect as B, className as D, setAttribute as w, template as m, use as H } from "solid-js/web";
|
|
2
|
+
import { createMemo as K, Show as o, For as y } from "solid-js";
|
|
3
|
+
import { useFloeLocale as j } from "../../context/LocaleContext.js";
|
|
4
|
+
import { Button as C } from "./Button.js";
|
|
5
|
+
import { FeedbackIndicator as z } from "./FeedbackIndicator.js";
|
|
6
|
+
import { Checkbox as L } from "./Checkbox.js";
|
|
7
|
+
import { Table as E, TableCaption as I, TableHeader as M, TableRow as x, TableHead as F, TableBody as N, TableCell as S } from "./Table.js";
|
|
8
|
+
var q = /* @__PURE__ */ m('<div role=alert class="flex flex-wrap items-center gap-2 py-2 text-error">'), G = /* @__PURE__ */ m('<span role=status class="text-caption text-muted-foreground">'), J = /* @__PURE__ */ m('<section><div class="max-w-full overflow-x-auto rounded-panel border border-border"tabindex=0 role=region data-floe-local-interaction-surface=true></div><div class="mt-2 flex min-h-[var(--floe-control-height-md)] flex-wrap items-center justify-between gap-2"><span role=status class=sr-only>'), O = /* @__PURE__ */ m("<span aria-hidden=true>");
|
|
9
|
+
function Z(e) {
|
|
10
|
+
const l = j();
|
|
11
|
+
let f;
|
|
12
|
+
const v = K(() => e.columns.filter((n) => !e.hiddenColumns?.includes(n.id))), u = K(() => e.rows.filter((n) => e.isRowSelectable?.(n) !== !1).map(e.rowKey)), h = () => new Set(e.selectedKeys ?? []), _ = () => u().length > 0 && u().every((n) => h().has(n)), A = () => !_() && u().some((n) => h().has(n)), $ = (n, c) => {
|
|
13
|
+
const g = h();
|
|
14
|
+
n.forEach((s) => c ? g.add(s) : g.delete(s)), e.onSelectionChange?.([...g]);
|
|
15
|
+
};
|
|
16
|
+
return (() => {
|
|
17
|
+
var n = J(), c = n.firstChild, g = c.nextSibling, s = g.firstChild;
|
|
18
|
+
a(n, () => e.toolbar, c), a(n, r(o, {
|
|
19
|
+
get when() {
|
|
20
|
+
return d(() => !!e.error)() && !e.rows.length;
|
|
21
|
+
},
|
|
22
|
+
get children() {
|
|
23
|
+
var t = q();
|
|
24
|
+
return a(t, () => e.error, null), a(t, r(o, {
|
|
25
|
+
get when() {
|
|
26
|
+
return e.onRetry;
|
|
27
|
+
},
|
|
28
|
+
get children() {
|
|
29
|
+
return r(C, {
|
|
30
|
+
variant: "outline",
|
|
31
|
+
onClick: () => e.onRetry?.(),
|
|
32
|
+
get children() {
|
|
33
|
+
return l.t("retry");
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}), null), t;
|
|
38
|
+
}
|
|
39
|
+
}), c);
|
|
40
|
+
var T = f;
|
|
41
|
+
return typeof T == "function" ? H(T, c) : f = c, a(c, r(E, {
|
|
42
|
+
get "aria-label"() {
|
|
43
|
+
return e.ariaLabel;
|
|
44
|
+
},
|
|
45
|
+
get "aria-busy"() {
|
|
46
|
+
return e.loading || void 0;
|
|
47
|
+
},
|
|
48
|
+
get children() {
|
|
49
|
+
return [r(o, {
|
|
50
|
+
get when() {
|
|
51
|
+
return e.caption;
|
|
52
|
+
},
|
|
53
|
+
get children() {
|
|
54
|
+
return r(I, {
|
|
55
|
+
get children() {
|
|
56
|
+
return e.caption;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}), r(M, {
|
|
61
|
+
get children() {
|
|
62
|
+
return r(x, {
|
|
63
|
+
get children() {
|
|
64
|
+
return [r(o, {
|
|
65
|
+
get when() {
|
|
66
|
+
return e.onSelectionChange;
|
|
67
|
+
},
|
|
68
|
+
get children() {
|
|
69
|
+
return r(F, {
|
|
70
|
+
class: "w-10",
|
|
71
|
+
get children() {
|
|
72
|
+
return r(L, {
|
|
73
|
+
get "aria-label"() {
|
|
74
|
+
return l.t("selectAll");
|
|
75
|
+
},
|
|
76
|
+
get checked() {
|
|
77
|
+
return _();
|
|
78
|
+
},
|
|
79
|
+
get indeterminate() {
|
|
80
|
+
return A();
|
|
81
|
+
},
|
|
82
|
+
get disabled() {
|
|
83
|
+
return !u().length;
|
|
84
|
+
},
|
|
85
|
+
onChange: (t) => $(u(), t)
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}), r(y, {
|
|
91
|
+
get each() {
|
|
92
|
+
return v();
|
|
93
|
+
},
|
|
94
|
+
children: (t) => r(F, {
|
|
95
|
+
get class() {
|
|
96
|
+
return t.class;
|
|
97
|
+
},
|
|
98
|
+
get "aria-sort"() {
|
|
99
|
+
return d(() => e.sort?.column === t.id)() ? e.sort.direction === "asc" ? "ascending" : "descending" : t.sortable ? "none" : void 0;
|
|
100
|
+
},
|
|
101
|
+
get children() {
|
|
102
|
+
return r(o, {
|
|
103
|
+
get when() {
|
|
104
|
+
return d(() => !!t.sortable)() && e.onSortChange;
|
|
105
|
+
},
|
|
106
|
+
get fallback() {
|
|
107
|
+
return t.header;
|
|
108
|
+
},
|
|
109
|
+
get children() {
|
|
110
|
+
return r(C, {
|
|
111
|
+
variant: "ghost",
|
|
112
|
+
size: "sm",
|
|
113
|
+
class: "-ms-2",
|
|
114
|
+
get "aria-label"() {
|
|
115
|
+
return l.t(e.sort?.column === t.id && e.sort.direction === "asc" ? "sortDescending" : "sortAscending", {
|
|
116
|
+
column: t.header
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
onClick: () => e.onSortChange?.({
|
|
120
|
+
column: t.id,
|
|
121
|
+
direction: e.sort?.column === t.id && e.sort.direction === "asc" ? "desc" : "asc"
|
|
122
|
+
}),
|
|
123
|
+
get children() {
|
|
124
|
+
return [d(() => t.header), (() => {
|
|
125
|
+
var i = O();
|
|
126
|
+
return a(i, (() => {
|
|
127
|
+
var b = d(() => e.sort?.column === t.id);
|
|
128
|
+
return () => b() ? e.sort.direction === "asc" ? "↑" : "↓" : "↕";
|
|
129
|
+
})()), i;
|
|
130
|
+
})()];
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
})
|
|
137
|
+
})];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}), r(N, {
|
|
142
|
+
get children() {
|
|
143
|
+
return [r(y, {
|
|
144
|
+
get each() {
|
|
145
|
+
return e.rows;
|
|
146
|
+
},
|
|
147
|
+
children: (t) => r(x, {
|
|
148
|
+
get "data-selected"() {
|
|
149
|
+
return h().has(e.rowKey(t)) ? "true" : void 0;
|
|
150
|
+
},
|
|
151
|
+
get children() {
|
|
152
|
+
return [r(o, {
|
|
153
|
+
get when() {
|
|
154
|
+
return e.onSelectionChange;
|
|
155
|
+
},
|
|
156
|
+
get children() {
|
|
157
|
+
return r(S, {
|
|
158
|
+
get children() {
|
|
159
|
+
return r(L, {
|
|
160
|
+
get "aria-label"() {
|
|
161
|
+
return l.t("selectRow", {
|
|
162
|
+
row: e.rowLabel?.(t) ?? e.rowKey(t)
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
get checked() {
|
|
166
|
+
return h().has(e.rowKey(t));
|
|
167
|
+
},
|
|
168
|
+
get disabled() {
|
|
169
|
+
return e.isRowSelectable?.(t) === !1;
|
|
170
|
+
},
|
|
171
|
+
onChange: (i) => $([e.rowKey(t)], i)
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}), r(y, {
|
|
177
|
+
get each() {
|
|
178
|
+
return v();
|
|
179
|
+
},
|
|
180
|
+
children: (i) => r(S, {
|
|
181
|
+
get class() {
|
|
182
|
+
return i.class;
|
|
183
|
+
},
|
|
184
|
+
get children() {
|
|
185
|
+
return i.cell(t);
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
})];
|
|
189
|
+
}
|
|
190
|
+
})
|
|
191
|
+
}), r(o, {
|
|
192
|
+
get when() {
|
|
193
|
+
return !e.rows.length;
|
|
194
|
+
},
|
|
195
|
+
get children() {
|
|
196
|
+
return r(x, {
|
|
197
|
+
get children() {
|
|
198
|
+
return r(S, {
|
|
199
|
+
get colSpan() {
|
|
200
|
+
return v().length + (e.onSelectionChange ? 1 : 0);
|
|
201
|
+
},
|
|
202
|
+
class: "py-8 text-center text-muted-foreground",
|
|
203
|
+
get children() {
|
|
204
|
+
return d(() => !!e.loading)() ? l.t("loading") : d(() => !!e.error)() ? "" : e.empty ?? l.t("emptyTable");
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
})];
|
|
211
|
+
}
|
|
212
|
+
})];
|
|
213
|
+
}
|
|
214
|
+
})), a(g, r(o, {
|
|
215
|
+
get when() {
|
|
216
|
+
return d(() => !!e.error)() && e.rows.length;
|
|
217
|
+
},
|
|
218
|
+
get children() {
|
|
219
|
+
return r(z, {
|
|
220
|
+
get label() {
|
|
221
|
+
return e.error;
|
|
222
|
+
},
|
|
223
|
+
get closeLabel() {
|
|
224
|
+
return l.t("close");
|
|
225
|
+
},
|
|
226
|
+
restoreFocus: () => f,
|
|
227
|
+
get entries() {
|
|
228
|
+
return [{
|
|
229
|
+
id: "refresh",
|
|
230
|
+
severity: "error",
|
|
231
|
+
summary: e.error,
|
|
232
|
+
actions: e.onRetry ? r(C, {
|
|
233
|
+
variant: "outline",
|
|
234
|
+
onClick: () => e.onRetry?.(),
|
|
235
|
+
get children() {
|
|
236
|
+
return l.t("retry");
|
|
237
|
+
}
|
|
238
|
+
}) : void 0
|
|
239
|
+
}];
|
|
240
|
+
}
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}), s), a(s, (() => {
|
|
244
|
+
var t = d(() => !!e.loading);
|
|
245
|
+
return () => t() ? l.t("loading") : "";
|
|
246
|
+
})()), a(g, r(o, {
|
|
247
|
+
get when() {
|
|
248
|
+
return e.onSelectionChange;
|
|
249
|
+
},
|
|
250
|
+
get children() {
|
|
251
|
+
var t = G();
|
|
252
|
+
return a(t, () => l.t("selectedCount", {
|
|
253
|
+
count: e.selectedKeys?.length ?? 0
|
|
254
|
+
})), t;
|
|
255
|
+
}
|
|
256
|
+
}), null), a(g, () => e.pagination, null), B((t) => {
|
|
257
|
+
var i = e.class, b = l.direction, R = e.ariaLabel, k = e.ariaLabel;
|
|
258
|
+
return i !== t.e && D(n, t.e = i), b !== t.t && w(n, "dir", t.t = b), R !== t.a && w(n, "aria-label", t.a = R), k !== t.o && w(c, "aria-label", t.o = k), t;
|
|
259
|
+
}, {
|
|
260
|
+
e: void 0,
|
|
261
|
+
t: void 0,
|
|
262
|
+
a: void 0,
|
|
263
|
+
o: void 0
|
|
264
|
+
}), n;
|
|
265
|
+
})();
|
|
266
|
+
}
|
|
267
|
+
export {
|
|
268
|
+
Z as DataTable
|
|
269
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface DatePickerProps {
|
|
2
|
+
id?: string;
|
|
3
|
+
name?: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
defaultValue?: string;
|
|
6
|
+
onChange?: (value: string) => void;
|
|
7
|
+
min?: string;
|
|
8
|
+
max?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
ariaLabel?: string;
|
|
13
|
+
class?: string;
|
|
14
|
+
clearable?: boolean;
|
|
15
|
+
weekStartsOn?: number;
|
|
16
|
+
}
|
|
17
|
+
/** YYYY-MM-DD civil date. Hosts explicitly convert it to instants when needed. */
|
|
18
|
+
export declare function DatePicker(props: DatePickerProps): import("solid-js").JSX.Element;
|
|
19
|
+
export interface DateRange {
|
|
20
|
+
start: string;
|
|
21
|
+
end: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DateRangePickerProps {
|
|
24
|
+
value: DateRange;
|
|
25
|
+
onChange: (value: DateRange) => void;
|
|
26
|
+
min?: string;
|
|
27
|
+
max?: string;
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
startName?: string;
|
|
30
|
+
endName?: string;
|
|
31
|
+
startLabel?: string;
|
|
32
|
+
endLabel?: string;
|
|
33
|
+
class?: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function DateRangePicker(props: DateRangePickerProps): import("solid-js").JSX.Element;
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { insert as g, createComponent as d, mergeProps as w, memo as f, effect as L, className as y, setAttribute as s, template as h } from "solid-js/web";
|
|
2
|
+
import { createUniqueId as O, createSignal as _, onMount as k, onCleanup as P, Show as S } from "solid-js";
|
|
3
|
+
import { useFloeLocale as D } from "../../context/LocaleContext.js";
|
|
4
|
+
import { useFormControl as T } from "./formFieldContext.js";
|
|
5
|
+
import { createControllableValue as V } from "./controllable.js";
|
|
6
|
+
import { Calendar as $ } from "./Calendar.js";
|
|
7
|
+
import { Popover as q } from "./Popover.js";
|
|
8
|
+
import { Button as x } from "./Button.js";
|
|
9
|
+
import { Input as F } from "./Input.js";
|
|
10
|
+
var I = /* @__PURE__ */ h("<div>"), N = /* @__PURE__ */ h("<span aria-hidden=true>▦"), z = /* @__PURE__ */ h('<div><div class="space-y-1 text-caption"><label></label></div><div class="space-y-1 text-caption"><label>');
|
|
11
|
+
function C(e) {
|
|
12
|
+
const l = D(), n = T(), c = O(), [i, m] = V({
|
|
13
|
+
value: () => e.value,
|
|
14
|
+
defaultValue: e.defaultValue ?? "",
|
|
15
|
+
onChange: (r) => e.onChange?.(r)
|
|
16
|
+
}), [o, v] = _(!1);
|
|
17
|
+
let a;
|
|
18
|
+
return k(() => {
|
|
19
|
+
const r = a?.form;
|
|
20
|
+
let t;
|
|
21
|
+
const u = (b) => {
|
|
22
|
+
clearTimeout(t), t = setTimeout(() => {
|
|
23
|
+
b.defaultPrevented || (m(e.defaultValue ?? ""), v(!1), a && (a.value = i()));
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
r?.addEventListener("reset", u), P(() => {
|
|
27
|
+
clearTimeout(t), r?.removeEventListener("reset", u);
|
|
28
|
+
});
|
|
29
|
+
}), (() => {
|
|
30
|
+
var r = I();
|
|
31
|
+
return g(r, d(F, {
|
|
32
|
+
ref(t) {
|
|
33
|
+
var u = a;
|
|
34
|
+
typeof u == "function" ? u(t) : a = t;
|
|
35
|
+
},
|
|
36
|
+
get id() {
|
|
37
|
+
return e.id ?? n.id ?? "date-" + c;
|
|
38
|
+
},
|
|
39
|
+
get name() {
|
|
40
|
+
return e.name ?? n.name;
|
|
41
|
+
},
|
|
42
|
+
type: "date",
|
|
43
|
+
get value() {
|
|
44
|
+
return i();
|
|
45
|
+
},
|
|
46
|
+
get min() {
|
|
47
|
+
return e.min;
|
|
48
|
+
},
|
|
49
|
+
get max() {
|
|
50
|
+
return e.max;
|
|
51
|
+
},
|
|
52
|
+
get disabled() {
|
|
53
|
+
return e.disabled ?? n.disabled;
|
|
54
|
+
},
|
|
55
|
+
get readOnly() {
|
|
56
|
+
return e.readOnly ?? n.readOnly;
|
|
57
|
+
},
|
|
58
|
+
get required() {
|
|
59
|
+
return e.required ?? n.required;
|
|
60
|
+
},
|
|
61
|
+
get "aria-label"() {
|
|
62
|
+
return e.ariaLabel;
|
|
63
|
+
},
|
|
64
|
+
onInput: (t) => m(t.currentTarget.value)
|
|
65
|
+
}), null), g(r, d(q, {
|
|
66
|
+
get open() {
|
|
67
|
+
return o();
|
|
68
|
+
},
|
|
69
|
+
onOpenChange: v,
|
|
70
|
+
get ariaLabel() {
|
|
71
|
+
return e.ariaLabel ?? l.t("chooseDate");
|
|
72
|
+
},
|
|
73
|
+
trigger: (t) => d(x, w(t, {
|
|
74
|
+
variant: "outline",
|
|
75
|
+
size: "icon",
|
|
76
|
+
get "aria-label"() {
|
|
77
|
+
return l.t("chooseDate");
|
|
78
|
+
},
|
|
79
|
+
get disabled() {
|
|
80
|
+
return (e.disabled ?? n.disabled) || (e.readOnly ?? n.readOnly);
|
|
81
|
+
},
|
|
82
|
+
get children() {
|
|
83
|
+
return N();
|
|
84
|
+
}
|
|
85
|
+
})),
|
|
86
|
+
get children() {
|
|
87
|
+
return d($, {
|
|
88
|
+
autoFocus: !0,
|
|
89
|
+
get value() {
|
|
90
|
+
return i();
|
|
91
|
+
},
|
|
92
|
+
onChange: (t) => {
|
|
93
|
+
m(t), v(!1), a?.focus();
|
|
94
|
+
},
|
|
95
|
+
get min() {
|
|
96
|
+
return e.min;
|
|
97
|
+
},
|
|
98
|
+
get max() {
|
|
99
|
+
return e.max;
|
|
100
|
+
},
|
|
101
|
+
get weekStartsOn() {
|
|
102
|
+
return e.weekStartsOn;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}), null), g(r, d(S, {
|
|
107
|
+
get when() {
|
|
108
|
+
return f(() => !!e.clearable)() && i();
|
|
109
|
+
},
|
|
110
|
+
get children() {
|
|
111
|
+
return d(x, {
|
|
112
|
+
variant: "ghost",
|
|
113
|
+
size: "sm",
|
|
114
|
+
get disabled() {
|
|
115
|
+
return (e.disabled ?? n.disabled) || (e.readOnly ?? n.readOnly);
|
|
116
|
+
},
|
|
117
|
+
onClick: () => {
|
|
118
|
+
m(""), a?.focus();
|
|
119
|
+
},
|
|
120
|
+
get children() {
|
|
121
|
+
return l.t("clear");
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}), null), L((t) => {
|
|
126
|
+
var u = "flex min-w-0 items-center gap-1 " + (e.class ?? ""), b = l.direction;
|
|
127
|
+
return u !== t.e && y(r, t.e = u), b !== t.t && s(r, "dir", t.t = b), t;
|
|
128
|
+
}, {
|
|
129
|
+
e: void 0,
|
|
130
|
+
t: void 0
|
|
131
|
+
}), r;
|
|
132
|
+
})();
|
|
133
|
+
}
|
|
134
|
+
function J(e) {
|
|
135
|
+
const l = D(), n = O();
|
|
136
|
+
return (() => {
|
|
137
|
+
var c = z(), i = c.firstChild, m = i.firstChild, o = i.nextSibling, v = o.firstChild;
|
|
138
|
+
return s(m, "for", n + "-start"), g(m, () => e.startLabel ?? l.t("startDate")), g(i, d(C, {
|
|
139
|
+
id: n + "-start",
|
|
140
|
+
get name() {
|
|
141
|
+
return e.startName;
|
|
142
|
+
},
|
|
143
|
+
get ariaLabel() {
|
|
144
|
+
return e.startLabel ?? l.t("startDate");
|
|
145
|
+
},
|
|
146
|
+
get value() {
|
|
147
|
+
return e.value.start;
|
|
148
|
+
},
|
|
149
|
+
get min() {
|
|
150
|
+
return e.min;
|
|
151
|
+
},
|
|
152
|
+
get max() {
|
|
153
|
+
return f(() => !!(e.value.end && e.max))() ? f(() => e.value.end < e.max)() ? e.value.end : e.max : e.value.end || e.max;
|
|
154
|
+
},
|
|
155
|
+
get disabled() {
|
|
156
|
+
return e.disabled;
|
|
157
|
+
},
|
|
158
|
+
onChange: (a) => e.onChange({
|
|
159
|
+
...e.value,
|
|
160
|
+
start: a
|
|
161
|
+
})
|
|
162
|
+
}), null), s(v, "for", n + "-end"), g(v, () => e.endLabel ?? l.t("endDate")), g(o, d(C, {
|
|
163
|
+
id: n + "-end",
|
|
164
|
+
get name() {
|
|
165
|
+
return e.endName;
|
|
166
|
+
},
|
|
167
|
+
get ariaLabel() {
|
|
168
|
+
return e.endLabel ?? l.t("endDate");
|
|
169
|
+
},
|
|
170
|
+
get value() {
|
|
171
|
+
return e.value.end;
|
|
172
|
+
},
|
|
173
|
+
get min() {
|
|
174
|
+
return f(() => !!(e.value.start && e.min))() ? f(() => e.value.start > e.min)() ? e.value.start : e.min : e.value.start || e.min;
|
|
175
|
+
},
|
|
176
|
+
get max() {
|
|
177
|
+
return e.max;
|
|
178
|
+
},
|
|
179
|
+
get disabled() {
|
|
180
|
+
return e.disabled;
|
|
181
|
+
},
|
|
182
|
+
onChange: (a) => e.onChange({
|
|
183
|
+
...e.value,
|
|
184
|
+
end: a
|
|
185
|
+
})
|
|
186
|
+
}), null), L((a) => {
|
|
187
|
+
var r = "flex flex-wrap items-end gap-3 " + (e.class ?? ""), t = l.direction;
|
|
188
|
+
return r !== a.e && y(c, a.e = r), t !== a.t && s(c, "dir", a.t = t), a;
|
|
189
|
+
}, {
|
|
190
|
+
e: void 0,
|
|
191
|
+
t: void 0
|
|
192
|
+
}), c;
|
|
193
|
+
})();
|
|
194
|
+
}
|
|
195
|
+
export {
|
|
196
|
+
C as DatePicker,
|
|
197
|
+
J as DateRangePicker
|
|
198
|
+
};
|
|
@@ -15,6 +15,9 @@ export interface DropdownItem {
|
|
|
15
15
|
keepOpen?: boolean;
|
|
16
16
|
}
|
|
17
17
|
export interface DropdownProps {
|
|
18
|
+
open?: boolean;
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
21
|
trigger: JSX.Element;
|
|
19
22
|
triggerClass?: string;
|
|
20
23
|
triggerAriaLabel?: string;
|
|
@@ -42,23 +45,4 @@ export declare function resolveDropdownTriggerKeyAction(key: string, options: {
|
|
|
42
45
|
* Dropdown menu component with cascade submenu support
|
|
43
46
|
*/
|
|
44
47
|
export declare function Dropdown(props: DropdownProps): JSX.Element;
|
|
45
|
-
|
|
46
|
-
* Simple select dropdown
|
|
47
|
-
*/
|
|
48
|
-
export interface SelectProps {
|
|
49
|
-
/** Localized field name, independent of the currently selected value. */
|
|
50
|
-
ariaLabel?: string;
|
|
51
|
-
/** Prefer a visible field label when one is available. */
|
|
52
|
-
ariaLabelledBy?: string;
|
|
53
|
-
ariaDescribedBy?: string;
|
|
54
|
-
value: string;
|
|
55
|
-
onChange: (value: string) => void;
|
|
56
|
-
options: {
|
|
57
|
-
value: string;
|
|
58
|
-
label: string;
|
|
59
|
-
}[];
|
|
60
|
-
placeholder?: string;
|
|
61
|
-
disabled?: boolean;
|
|
62
|
-
class?: string;
|
|
63
|
-
}
|
|
64
|
-
export declare function Select(props: SelectProps): JSX.Element;
|
|
48
|
+
export { Select, type SelectProps } from './Select';
|