@jirawatpyk/aura-react 5.33.0 → 5.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/aura.bundle.js +831 -412
- package/dist/cjs/index.cjs +830 -411
- package/dist/esm/ActionBar.js +1 -0
- package/dist/esm/AppShell.js +16 -2
- package/dist/esm/BottomNav.js +26 -2
- package/dist/esm/StatusTile.js +53 -0
- package/dist/esm/autoTip.js +5 -0
- package/dist/esm/breakpoints.js +18 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/responsive.js +1 -15
- package/dist/esm/scrollHide.js +96 -0
- package/dist/esm/strings.js +5 -0
- package/dist/esm/strings.sv.js +5 -0
- package/dist/esm/strings.th.js +5 -0
- package/dist/esm/tiles.js +220 -0
- package/dist/index.d.cts +126 -36
- package/dist/index.d.ts +126 -36
- package/dist/locales/sv.cjs +5 -0
- package/dist/locales/sv.d.cts +7 -0
- package/dist/locales/sv.d.ts +7 -0
- package/dist/locales/th.cjs +5 -0
- package/dist/locales/th.d.cts +7 -0
- package/dist/locales/th.d.ts +7 -0
- package/dist/server/index.cjs +274 -27
- package/dist/server/index.d.cts +78 -0
- package/dist/server/index.d.ts +78 -0
- package/dist/server/index.js +274 -27
- package/dist/styles.css +86 -5
- package/dist/styles.layer.css +86 -5
- package/package.json +1 -1
package/dist/aura.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"FilterSelect"},{"name":"FilterDateRange"},{"name":"RadioGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"PageHeader"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
1
|
+
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"FilterSelect"},{"name":"FilterDateRange"},{"name":"RadioGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"PageHeader"},{"name":"StatusTile"},{"name":"TileGrid"},{"name":"Sparkline"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
2
2
|
window.Aura = (() => {
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -99,9 +99,11 @@ window.Aura = (() => {
|
|
|
99
99
|
Separator: () => Separator,
|
|
100
100
|
SideNav: () => SideNav,
|
|
101
101
|
Skeleton: () => Skeleton,
|
|
102
|
+
Sparkline: () => Sparkline,
|
|
102
103
|
Stack: () => Stack,
|
|
103
104
|
Stat: () => Stat,
|
|
104
105
|
StatusPill: () => StatusPill,
|
|
106
|
+
StatusTile: () => StatusTile,
|
|
105
107
|
Stepper: () => Stepper,
|
|
106
108
|
Surface: () => Surface,
|
|
107
109
|
Switch: () => Switch,
|
|
@@ -116,6 +118,7 @@ window.Aura = (() => {
|
|
|
116
118
|
Textarea: () => Textarea,
|
|
117
119
|
Th: () => Th,
|
|
118
120
|
ThemeStyle: () => ThemeStyle,
|
|
121
|
+
TileGrid: () => TileGrid,
|
|
119
122
|
TimePicker: () => TimePicker,
|
|
120
123
|
Toaster: () => Toaster,
|
|
121
124
|
Tooltip: () => Tooltip,
|
|
@@ -207,9 +210,9 @@ window.Aura = (() => {
|
|
|
207
210
|
...a11y
|
|
208
211
|
},
|
|
209
212
|
shapes.map(function(s, i) {
|
|
210
|
-
const
|
|
211
|
-
for (const k in s[1])
|
|
212
|
-
return h(s[0],
|
|
213
|
+
const attrs2 = { key: i };
|
|
214
|
+
for (const k in s[1]) attrs2[k === "stroke-width" ? "strokeWidth" : k] = s[1][k];
|
|
215
|
+
return h(s[0], attrs2);
|
|
213
216
|
})
|
|
214
217
|
);
|
|
215
218
|
}
|
|
@@ -322,9 +325,9 @@ window.Aura = (() => {
|
|
|
322
325
|
return collator ? collator.compare(String(a), String(b)) : String(a).localeCompare(String(b));
|
|
323
326
|
}
|
|
324
327
|
var uid = React3.useId || function() {
|
|
325
|
-
const
|
|
326
|
-
if (!
|
|
327
|
-
return
|
|
328
|
+
const r2 = React3.useRef(null);
|
|
329
|
+
if (!r2.current) r2.current = "aura-" + Math.random().toString(36).slice(2, 9);
|
|
330
|
+
return r2.current;
|
|
328
331
|
};
|
|
329
332
|
var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
330
333
|
function noopSubscribe() {
|
|
@@ -362,10 +365,10 @@ window.Aura = (() => {
|
|
|
362
365
|
function useMergedRef(a, b) {
|
|
363
366
|
return React3.useCallback(
|
|
364
367
|
function(node) {
|
|
365
|
-
[a, b].forEach(function(
|
|
366
|
-
if (!
|
|
367
|
-
if (typeof
|
|
368
|
-
else
|
|
368
|
+
[a, b].forEach(function(r2) {
|
|
369
|
+
if (!r2) return;
|
|
370
|
+
if (typeof r2 === "function") r2(node);
|
|
371
|
+
else r2.current = node;
|
|
369
372
|
});
|
|
370
373
|
},
|
|
371
374
|
[a, b]
|
|
@@ -590,6 +593,14 @@ window.Aura = (() => {
|
|
|
590
593
|
["path", { d: "M9 3v18" }],
|
|
591
594
|
["path", { d: "m14 9 3 3-3 3" }]
|
|
592
595
|
]);
|
|
596
|
+
var IconWrench = /* @__PURE__ */ defineIcon("wrench", [
|
|
597
|
+
[
|
|
598
|
+
"path",
|
|
599
|
+
{
|
|
600
|
+
d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z"
|
|
601
|
+
}
|
|
602
|
+
]
|
|
603
|
+
]);
|
|
593
604
|
|
|
594
605
|
// src/display.tsx
|
|
595
606
|
var h2 = React4.createElement;
|
|
@@ -929,11 +940,16 @@ window.Aura = (() => {
|
|
|
929
940
|
pageN: function(p) {
|
|
930
941
|
return "\u0E2B\u0E19\u0E49\u0E32 " + p;
|
|
931
942
|
},
|
|
932
|
-
progressReserved: function(v,
|
|
933
|
-
return "\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27 " + n(v) + " \u0E08\u0E32\u0E01 " + n(max) + " \u0E08\u0E2D\u0E07\u0E44\u0E27\u0E49 " + n(
|
|
943
|
+
progressReserved: function(v, r2, max) {
|
|
944
|
+
return "\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27 " + n(v) + " \u0E08\u0E32\u0E01 " + n(max) + " \u0E08\u0E2D\u0E07\u0E44\u0E27\u0E49 " + n(r2);
|
|
934
945
|
},
|
|
935
946
|
breadcrumbMore: "\u0E41\u0E2A\u0E14\u0E07\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
|
|
936
947
|
stepError: "\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14",
|
|
948
|
+
statusDown: "\u0E25\u0E48\u0E21",
|
|
949
|
+
statusProblem: "\u0E21\u0E35\u0E1B\u0E31\u0E0D\u0E2B\u0E32",
|
|
950
|
+
statusMaintenance: "\u0E1B\u0E34\u0E14\u0E1B\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E38\u0E07",
|
|
951
|
+
statusOk: "\u0E1B\u0E01\u0E15\u0E34",
|
|
952
|
+
statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
937
953
|
accepts: function(list, max) {
|
|
938
954
|
return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
|
|
939
955
|
}
|
|
@@ -1060,11 +1076,16 @@ window.Aura = (() => {
|
|
|
1060
1076
|
pageN: function(p) {
|
|
1061
1077
|
return "Sida " + p;
|
|
1062
1078
|
},
|
|
1063
|
-
progressReserved: function(v,
|
|
1064
|
-
return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(
|
|
1079
|
+
progressReserved: function(v, r2, max) {
|
|
1080
|
+
return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(r2) + " reserverade";
|
|
1065
1081
|
},
|
|
1066
1082
|
breadcrumbMore: "Visa hela s\xF6kv\xE4gen",
|
|
1067
1083
|
stepError: "har fel",
|
|
1084
|
+
statusDown: "Nere",
|
|
1085
|
+
statusProblem: "Problem",
|
|
1086
|
+
statusMaintenance: "Underh\xE5ll",
|
|
1087
|
+
statusOk: "OK",
|
|
1088
|
+
statusUnknown: "Ingen data",
|
|
1068
1089
|
accepts: function(list, max) {
|
|
1069
1090
|
return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
|
|
1070
1091
|
}
|
|
@@ -1192,11 +1213,16 @@ window.Aura = (() => {
|
|
|
1192
1213
|
pageN: function(p) {
|
|
1193
1214
|
return "Page " + p;
|
|
1194
1215
|
},
|
|
1195
|
-
progressReserved: function(v,
|
|
1196
|
-
return n2(v) + " of " + n2(max) + " used, " + n2(
|
|
1216
|
+
progressReserved: function(v, r2, max) {
|
|
1217
|
+
return n2(v) + " of " + n2(max) + " used, " + n2(r2) + " reserved";
|
|
1197
1218
|
},
|
|
1198
1219
|
breadcrumbMore: "Show the full path",
|
|
1199
1220
|
stepError: "has errors",
|
|
1221
|
+
statusDown: "Down",
|
|
1222
|
+
statusProblem: "Problem",
|
|
1223
|
+
statusMaintenance: "Maintenance",
|
|
1224
|
+
statusOk: "OK",
|
|
1225
|
+
statusUnknown: "No data",
|
|
1200
1226
|
accepts: function(list, max) {
|
|
1201
1227
|
return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
|
|
1202
1228
|
}
|
|
@@ -1368,6 +1394,11 @@ window.Aura = (() => {
|
|
|
1368
1394
|
const tag = el.closest(".aura-tag");
|
|
1369
1395
|
if (tag) s = tag.querySelector(".aura-tag__text[" + ATTR + "]");
|
|
1370
1396
|
}
|
|
1397
|
+
if (!s) {
|
|
1398
|
+
const tile = el.closest(".aura-status-tile");
|
|
1399
|
+
const control = el.closest("a, button, input, select, textarea, [tabindex]");
|
|
1400
|
+
if (tile && (!control || control === tile)) s = tile.querySelector(".aura-status-tile__title[" + ATTR + "]");
|
|
1401
|
+
}
|
|
1371
1402
|
if (!s || !s.getAttribute(ATTR) || !s.isConnected) return null;
|
|
1372
1403
|
if (s.getAttribute("aria-expanded") === "true") return null;
|
|
1373
1404
|
return s;
|
|
@@ -1378,11 +1409,11 @@ window.Aura = (() => {
|
|
|
1378
1409
|
hide();
|
|
1379
1410
|
return;
|
|
1380
1411
|
}
|
|
1381
|
-
const
|
|
1382
|
-
let top =
|
|
1383
|
-
if (top < m &&
|
|
1412
|
+
const r2 = cur.getBoundingClientRect(), t = tip.getBoundingClientRect(), vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
1413
|
+
let top = r2.top - t.height - gap;
|
|
1414
|
+
if (top < m && r2.bottom + gap + t.height <= vh - m) top = r2.bottom + gap;
|
|
1384
1415
|
top = Math.max(m, Math.min(top, vh - t.height - m));
|
|
1385
|
-
const left = Math.max(m, Math.min(
|
|
1416
|
+
const left = Math.max(m, Math.min(r2.left + r2.width / 2 - t.width / 2, vw - t.width - m));
|
|
1386
1417
|
tip.style.top = top + "px";
|
|
1387
1418
|
tip.style.left = left + "px";
|
|
1388
1419
|
}
|
|
@@ -1556,9 +1587,9 @@ window.Aura = (() => {
|
|
|
1556
1587
|
}
|
|
1557
1588
|
function inView(el) {
|
|
1558
1589
|
if (!el.isConnected) return false;
|
|
1559
|
-
const
|
|
1560
|
-
if (
|
|
1561
|
-
let top =
|
|
1590
|
+
const r2 = el.getBoundingClientRect();
|
|
1591
|
+
if (r2.width === 0 && r2.height === 0) return false;
|
|
1592
|
+
let top = r2.top, bottom = r2.bottom, left = r2.left, right = r2.right;
|
|
1562
1593
|
let pos = getComputedStyle(el).position;
|
|
1563
1594
|
for (let p = el.parentElement; p && p !== document.body && p !== document.documentElement; p = p.parentElement) {
|
|
1564
1595
|
const s = getComputedStyle(p);
|
|
@@ -1596,16 +1627,16 @@ window.Aura = (() => {
|
|
|
1596
1627
|
function place2() {
|
|
1597
1628
|
const a = props.anchor, m = own.current;
|
|
1598
1629
|
if (!a || !m) return;
|
|
1599
|
-
const
|
|
1600
|
-
let top =
|
|
1630
|
+
const r2 = a.getBoundingClientRect(), mh = m.scrollHeight, mw = m.offsetWidth, below2 = window.innerHeight - r2.bottom - 12, above = r2.top - 12;
|
|
1631
|
+
let top = r2.bottom + 4, maxHeight;
|
|
1601
1632
|
if (mh > below2) {
|
|
1602
|
-
if (mh <= above) top =
|
|
1633
|
+
if (mh <= above) top = r2.top - mh - 4;
|
|
1603
1634
|
else if (above > below2) {
|
|
1604
1635
|
maxHeight = above;
|
|
1605
|
-
top =
|
|
1636
|
+
top = r2.top - above - 4;
|
|
1606
1637
|
} else maxHeight = below2;
|
|
1607
1638
|
}
|
|
1608
|
-
const left = Math.max(8, Math.min(
|
|
1639
|
+
const left = Math.max(8, Math.min(r2.right - mw, window.innerWidth - mw - 8));
|
|
1609
1640
|
setPos(function(p) {
|
|
1610
1641
|
return p && p.top === top && p.left === left && p.maxHeight === maxHeight ? p : { top, left, maxHeight };
|
|
1611
1642
|
});
|
|
@@ -2069,9 +2100,9 @@ window.Aura = (() => {
|
|
|
2069
2100
|
"size"
|
|
2070
2101
|
]);
|
|
2071
2102
|
function pick(o, keys) {
|
|
2072
|
-
const
|
|
2073
|
-
for (const k of keys) if (k in o)
|
|
2074
|
-
return
|
|
2103
|
+
const r2 = {};
|
|
2104
|
+
for (const k of keys) if (k in o) r2[k] = o[k];
|
|
2105
|
+
return r2;
|
|
2075
2106
|
}
|
|
2076
2107
|
function readItems(el) {
|
|
2077
2108
|
if (!el) return [];
|
|
@@ -2370,15 +2401,15 @@ window.Aura = (() => {
|
|
|
2370
2401
|
function place2() {
|
|
2371
2402
|
const t = trigRef.current && trigRef.current.parentElement;
|
|
2372
2403
|
if (!t) return;
|
|
2373
|
-
const
|
|
2374
|
-
const lw = listRef.current ? Math.max(
|
|
2404
|
+
const r2 = t.getBoundingClientRect(), below2 = window.innerHeight - r2.bottom - 8, above = r2.top - 8, want = listRef.current ? listRef.current.scrollHeight : 320, up2 = below2 < Math.min(want, 200) && above > below2;
|
|
2405
|
+
const lw = listRef.current ? Math.max(r2.width, listRef.current.offsetWidth) : r2.width;
|
|
2375
2406
|
const rtl = getComputedStyle(t).direction === "rtl";
|
|
2376
|
-
const left = lw <=
|
|
2407
|
+
const left = lw <= r2.width ? r2.left : Math.max(8, Math.min(rtl ? r2.right - lw : r2.left, window.innerWidth - lw - 8));
|
|
2377
2408
|
pos[1]({
|
|
2378
2409
|
left,
|
|
2379
|
-
width:
|
|
2380
|
-
top: up2 ? void 0 :
|
|
2381
|
-
bottom: up2 ? window.innerHeight -
|
|
2410
|
+
width: r2.width,
|
|
2411
|
+
top: up2 ? void 0 : r2.bottom + 4,
|
|
2412
|
+
bottom: up2 ? window.innerHeight - r2.top + 4 : void 0,
|
|
2382
2413
|
maxHeight: Math.min(320, (up2 ? above : below2) - 4),
|
|
2383
2414
|
rtl
|
|
2384
2415
|
});
|
|
@@ -2573,10 +2604,10 @@ window.Aura = (() => {
|
|
|
2573
2604
|
"aria-label": labelledBy ? void 0 : rest["aria-label"],
|
|
2574
2605
|
className: "aura-combo__list"
|
|
2575
2606
|
},
|
|
2576
|
-
runs.map(function(
|
|
2577
|
-
if (
|
|
2607
|
+
runs.map(function(r2, n3) {
|
|
2608
|
+
if (r2.group === null) return /* @__PURE__ */ React16.createElement(React16.Fragment, { key: "r" + n3 }, r2.items.map(option));
|
|
2578
2609
|
const gid = id + "-group-" + n3;
|
|
2579
|
-
return /* @__PURE__ */ React16.createElement("div", { key: "r" + n3, role: "group", "aria-labelledby": gid }, /* @__PURE__ */ React16.createElement("div", { id: gid, className: "aura-select__group" },
|
|
2610
|
+
return /* @__PURE__ */ React16.createElement("div", { key: "r" + n3, role: "group", "aria-labelledby": gid }, /* @__PURE__ */ React16.createElement("div", { id: gid, className: "aura-select__group" }, r2.group), r2.items.map(option));
|
|
2580
2611
|
})
|
|
2581
2612
|
)
|
|
2582
2613
|
),
|
|
@@ -3158,10 +3189,10 @@ window.Aura = (() => {
|
|
|
3158
3189
|
const pos = React18.useState(null), popRef = React18.useRef(null), mounted = useMounted();
|
|
3159
3190
|
function place2() {
|
|
3160
3191
|
if (!boxRef.current) return;
|
|
3161
|
-
const el = popRef.current,
|
|
3162
|
-
const up2 = window.innerHeight -
|
|
3163
|
-
const left = Math.max(8, Math.min(
|
|
3164
|
-
pos[1](up2 ? { left, bottom: window.innerHeight -
|
|
3192
|
+
const el = popRef.current, r2 = boxRef.current.getBoundingClientRect(), W = el ? el.offsetWidth : 320, H = el ? el.offsetHeight : 380;
|
|
3193
|
+
const up2 = window.innerHeight - r2.bottom < H + 12 && r2.top > H + 12;
|
|
3194
|
+
const left = Math.max(8, Math.min(r2.left, window.innerWidth - W - 8));
|
|
3195
|
+
pos[1](up2 ? { left, bottom: window.innerHeight - r2.top + 4 } : { left, top: r2.bottom + 4 });
|
|
3165
3196
|
}
|
|
3166
3197
|
useIsoLayoutEffect(
|
|
3167
3198
|
function() {
|
|
@@ -3407,10 +3438,10 @@ window.Aura = (() => {
|
|
|
3407
3438
|
isDateDisabled: props.isDateDisabled
|
|
3408
3439
|
};
|
|
3409
3440
|
const o = { locale, calendar };
|
|
3410
|
-
function show3(
|
|
3411
|
-
if (!
|
|
3412
|
-
if (!
|
|
3413
|
-
return formatDate(
|
|
3441
|
+
function show3(r2) {
|
|
3442
|
+
if (!r2.start) return "";
|
|
3443
|
+
if (!r2.end) return formatDate(r2.start, o) + " \u2013";
|
|
3444
|
+
return formatDate(r2.start, o) + " \u2013 " + formatDate(r2.end, o);
|
|
3414
3445
|
}
|
|
3415
3446
|
const bad = React18.useState(null);
|
|
3416
3447
|
React18.useEffect(
|
|
@@ -3550,8 +3581,8 @@ window.Aura = (() => {
|
|
|
3550
3581
|
draft[1](null);
|
|
3551
3582
|
if (faceRef.current) faceRef.current.focus();
|
|
3552
3583
|
}
|
|
3553
|
-
function choose(
|
|
3554
|
-
if (
|
|
3584
|
+
function choose(r2) {
|
|
3585
|
+
if (r2.start !== raw.start || r2.end !== raw.end) st[1](r2);
|
|
3555
3586
|
close();
|
|
3556
3587
|
}
|
|
3557
3588
|
function pick2(iso) {
|
|
@@ -3565,12 +3596,12 @@ window.Aura = (() => {
|
|
|
3565
3596
|
}
|
|
3566
3597
|
const isAny = !v.start || !v.end;
|
|
3567
3598
|
const own = props["aria-label"] || void 0;
|
|
3568
|
-
const
|
|
3599
|
+
const attrs2 = {};
|
|
3569
3600
|
Object.keys(props).forEach(function(k) {
|
|
3570
3601
|
if (k === "style" || /^(aria|data)-/.test(k) && k !== "aria-label")
|
|
3571
|
-
|
|
3602
|
+
attrs2[k] = props[k];
|
|
3572
3603
|
});
|
|
3573
|
-
const presetBtn = function(label,
|
|
3604
|
+
const presetBtn = function(label, r2, on, key) {
|
|
3574
3605
|
return /* @__PURE__ */ React19.createElement(
|
|
3575
3606
|
Button,
|
|
3576
3607
|
{
|
|
@@ -3578,11 +3609,11 @@ window.Aura = (() => {
|
|
|
3578
3609
|
size: "sm",
|
|
3579
3610
|
variant: "ghost",
|
|
3580
3611
|
touchHeight: true,
|
|
3581
|
-
disabled: !!
|
|
3612
|
+
disabled: !!r2.start && !!r2.end && !(allowedDate(r2.start, limits) && allowedDate(r2.end, limits)),
|
|
3582
3613
|
className: cx("aura-filterdate__preset", on && "is-selected"),
|
|
3583
3614
|
"aria-pressed": on,
|
|
3584
3615
|
onClick: function() {
|
|
3585
|
-
choose(
|
|
3616
|
+
choose(r2);
|
|
3586
3617
|
}
|
|
3587
3618
|
},
|
|
3588
3619
|
label
|
|
@@ -3647,7 +3678,7 @@ window.Aura = (() => {
|
|
|
3647
3678
|
/* @__PURE__ */ React19.createElement(
|
|
3648
3679
|
"button",
|
|
3649
3680
|
{
|
|
3650
|
-
...
|
|
3681
|
+
...attrs2,
|
|
3651
3682
|
ref: setFace,
|
|
3652
3683
|
id,
|
|
3653
3684
|
type: "button",
|
|
@@ -3685,8 +3716,8 @@ window.Aura = (() => {
|
|
|
3685
3716
|
function(el) {
|
|
3686
3717
|
if (el)
|
|
3687
3718
|
el.focus = function(opts) {
|
|
3688
|
-
const
|
|
3689
|
-
if (
|
|
3719
|
+
const r2 = el.querySelector('input[type="radio"]:checked') || el.querySelector('input[type="radio"]:not(:disabled)');
|
|
3720
|
+
if (r2) r2.focus(opts);
|
|
3690
3721
|
};
|
|
3691
3722
|
if (typeof ref === "function") ref(el);
|
|
3692
3723
|
else if (ref) ref.current = el;
|
|
@@ -3852,14 +3883,14 @@ window.Aura = (() => {
|
|
|
3852
3883
|
}) : -1 : Math.min(active, shown.length - 1);
|
|
3853
3884
|
function place2() {
|
|
3854
3885
|
if (!boxRef.current) return;
|
|
3855
|
-
const
|
|
3856
|
-
const maxH = 320, below2 = window.innerHeight -
|
|
3886
|
+
const r2 = boxRef.current.getBoundingClientRect();
|
|
3887
|
+
const maxH = 320, below2 = window.innerHeight - r2.bottom - 8, up2 = below2 < 200 && r2.top > below2;
|
|
3857
3888
|
posState[1]({
|
|
3858
|
-
left:
|
|
3859
|
-
width:
|
|
3860
|
-
top: up2 ? void 0 :
|
|
3861
|
-
bottom: up2 ? window.innerHeight -
|
|
3862
|
-
maxHeight: Math.min(maxH, (up2 ?
|
|
3889
|
+
left: r2.left,
|
|
3890
|
+
width: r2.width,
|
|
3891
|
+
top: up2 ? void 0 : r2.bottom + 4,
|
|
3892
|
+
bottom: up2 ? window.innerHeight - r2.top + 4 : void 0,
|
|
3893
|
+
maxHeight: Math.min(maxH, (up2 ? r2.top : below2) - 8)
|
|
3863
3894
|
});
|
|
3864
3895
|
}
|
|
3865
3896
|
useIsoLayoutEffect(
|
|
@@ -4696,13 +4727,13 @@ window.Aura = (() => {
|
|
|
4696
4727
|
}, []);
|
|
4697
4728
|
function place2() {
|
|
4698
4729
|
if (!anchor.current || !tip2.current) return;
|
|
4699
|
-
const
|
|
4730
|
+
const r2 = anchor.current.getBoundingClientRect(), t = tip2.current.getBoundingClientRect();
|
|
4700
4731
|
const vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
4701
4732
|
let side = props.side || "top";
|
|
4702
|
-
if (side === "top" &&
|
|
4703
|
-
else if (side === "bottom" &&
|
|
4704
|
-
else if (side === "left" &&
|
|
4705
|
-
else if (side === "right" &&
|
|
4733
|
+
if (side === "top" && r2.top - t.height - gap < m && r2.bottom + gap + t.height <= vh - m) side = "bottom";
|
|
4734
|
+
else if (side === "bottom" && r2.bottom + gap + t.height > vh - m && r2.top - t.height - gap >= m) side = "top";
|
|
4735
|
+
else if (side === "left" && r2.left - t.width - gap < m && r2.right + gap + t.width <= vw - m) side = "right";
|
|
4736
|
+
else if (side === "right" && r2.right + gap + t.width > vw - m && r2.left - t.width - gap >= m) side = "left";
|
|
4706
4737
|
const clampX = function(x) {
|
|
4707
4738
|
return Math.max(m, Math.min(x, vw - t.width - m));
|
|
4708
4739
|
};
|
|
@@ -4711,12 +4742,12 @@ window.Aura = (() => {
|
|
|
4711
4742
|
};
|
|
4712
4743
|
let top, left;
|
|
4713
4744
|
if (side === "top" || side === "bottom") {
|
|
4714
|
-
top = clampY(side === "top" ?
|
|
4715
|
-
left = clampX(
|
|
4745
|
+
top = clampY(side === "top" ? r2.top - t.height - gap : r2.bottom + gap);
|
|
4746
|
+
left = clampX(r2.left + r2.width / 2 - t.width / 2);
|
|
4716
4747
|
} else {
|
|
4717
|
-
left = side === "left" ?
|
|
4748
|
+
left = side === "left" ? r2.left - t.width - gap : r2.right + gap;
|
|
4718
4749
|
left = clampX(left);
|
|
4719
|
-
top = clampY(
|
|
4750
|
+
top = clampY(r2.top + r2.height / 2 - t.height / 2);
|
|
4720
4751
|
}
|
|
4721
4752
|
pos[1]({ top, left });
|
|
4722
4753
|
}
|
|
@@ -5137,18 +5168,18 @@ window.Aura = (() => {
|
|
|
5137
5168
|
if (!g) groups.push(g = { name, items: [] });
|
|
5138
5169
|
g.items.push(it);
|
|
5139
5170
|
});
|
|
5140
|
-
const
|
|
5171
|
+
const flat3 = [];
|
|
5141
5172
|
groups.forEach(function(g) {
|
|
5142
5173
|
g.items.forEach(function(it) {
|
|
5143
|
-
|
|
5174
|
+
flat3.push(it);
|
|
5144
5175
|
});
|
|
5145
5176
|
});
|
|
5146
|
-
const enabled =
|
|
5177
|
+
const enabled = flat3.map(function(it, i2) {
|
|
5147
5178
|
return it.disabled ? -1 : i2;
|
|
5148
5179
|
}).filter(function(i2) {
|
|
5149
5180
|
return i2 >= 0;
|
|
5150
5181
|
});
|
|
5151
|
-
const byId = act[0] == null ? -1 :
|
|
5182
|
+
const byId = act[0] == null ? -1 : flat3.findIndex(function(it) {
|
|
5152
5183
|
return it.id === act[0];
|
|
5153
5184
|
});
|
|
5154
5185
|
const active = enabled.indexOf(byId) >= 0 ? byId : enabled.length ? enabled[0] : -1;
|
|
@@ -5176,7 +5207,7 @@ window.Aura = (() => {
|
|
|
5176
5207
|
if (dir === "first") n3 = 0;
|
|
5177
5208
|
else if (dir === "last") n3 = enabled.length - 1;
|
|
5178
5209
|
else n3 = (at + dir + enabled.length) % enabled.length;
|
|
5179
|
-
act[1](
|
|
5210
|
+
act[1](flat3[enabled[n3]].id);
|
|
5180
5211
|
}
|
|
5181
5212
|
function onKey(e) {
|
|
5182
5213
|
if (e.key === "ArrowDown") {
|
|
@@ -5194,7 +5225,7 @@ window.Aura = (() => {
|
|
|
5194
5225
|
} else if (e.key === "Enter") {
|
|
5195
5226
|
if (e.nativeEvent.isComposing || e.keyCode === 229) return;
|
|
5196
5227
|
e.preventDefault();
|
|
5197
|
-
if (active >= 0) run(
|
|
5228
|
+
if (active >= 0) run(flat3[active]);
|
|
5198
5229
|
}
|
|
5199
5230
|
}
|
|
5200
5231
|
if (!modal.ready) return null;
|
|
@@ -5228,8 +5259,8 @@ window.Aura = (() => {
|
|
|
5228
5259
|
"data-autofocus": "",
|
|
5229
5260
|
type: "text",
|
|
5230
5261
|
role: "combobox",
|
|
5231
|
-
"aria-expanded":
|
|
5232
|
-
"aria-controls":
|
|
5262
|
+
"aria-expanded": flat3.length > 0,
|
|
5263
|
+
"aria-controls": flat3.length ? listId : void 0,
|
|
5233
5264
|
"aria-autocomplete": "list",
|
|
5234
5265
|
"aria-activedescendant": active >= 0 ? optId(active) : void 0,
|
|
5235
5266
|
"aria-label": props.label || t.commandMenu,
|
|
@@ -5245,7 +5276,7 @@ window.Aura = (() => {
|
|
|
5245
5276
|
onKeyDown: onKey
|
|
5246
5277
|
}
|
|
5247
5278
|
), /* @__PURE__ */ React31.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
5248
|
-
/* @__PURE__ */ React31.createElement("div", { className: "aura-command__list", "aria-busy": props.loading || void 0 }, props.loading ? /* @__PURE__ */ React31.createElement("div", { className: "aura-command__loading" }, /* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconLoaderCircle, null), className: "aura-spin" }), t.searching) : null, !
|
|
5279
|
+
/* @__PURE__ */ React31.createElement("div", { className: "aura-command__list", "aria-busy": props.loading || void 0 }, props.loading ? /* @__PURE__ */ React31.createElement("div", { className: "aura-command__loading" }, /* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconLoaderCircle, null), className: "aura-spin" }), t.searching) : null, !flat3.length ? props.loading ? null : /* @__PURE__ */ React31.createElement("div", { className: "aura-command__empty" }, props.empty != null ? props.empty : props.emptyText || t.noMatches) : /* @__PURE__ */ React31.createElement(
|
|
5249
5280
|
"div",
|
|
5250
5281
|
{
|
|
5251
5282
|
id: listId,
|
|
@@ -5299,7 +5330,7 @@ window.Aura = (() => {
|
|
|
5299
5330
|
);
|
|
5300
5331
|
})
|
|
5301
5332
|
)),
|
|
5302
|
-
/* @__PURE__ */ React31.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !
|
|
5333
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !flat3.length ? t.noMatches : props.loading === false && query ? t.results(flat3.length) : ""),
|
|
5303
5334
|
/* @__PURE__ */ React31.createElement("div", { className: "aura-command__foot", "aria-hidden": true }, t.commandHint, /* @__PURE__ */ React31.createElement("span", { className: "aura-command__mod" }, isMac() ? "\u2318K" : "Ctrl K"))
|
|
5304
5335
|
)
|
|
5305
5336
|
),
|
|
@@ -5546,13 +5577,13 @@ window.Aura = (() => {
|
|
|
5546
5577
|
const selState = useMaybeControlled(props.selected, props.defaultSelected || [], null);
|
|
5547
5578
|
const onSel = React33.useRef(props.onSelectionChange);
|
|
5548
5579
|
onSel.current = props.onSelectionChange;
|
|
5549
|
-
const canSelect = function(
|
|
5550
|
-
return !!
|
|
5580
|
+
const canSelect = function(r2) {
|
|
5581
|
+
return !!r2 && (!props.isRowSelectable || !!props.isRowSelectable(r2));
|
|
5551
5582
|
};
|
|
5552
5583
|
const rejected = {};
|
|
5553
5584
|
if (props.isRowSelectable)
|
|
5554
|
-
rows.forEach(function(
|
|
5555
|
-
if (!canSelect(
|
|
5585
|
+
rows.forEach(function(r2) {
|
|
5586
|
+
if (!canSelect(r2)) rejected[String(r2[rowKey])] = true;
|
|
5556
5587
|
});
|
|
5557
5588
|
const selected = selState[0].filter(function(k) {
|
|
5558
5589
|
return !rejected[String(k)];
|
|
@@ -5697,8 +5728,8 @@ window.Aura = (() => {
|
|
|
5697
5728
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
5698
5729
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
5699
5730
|
return setTip(null);
|
|
5700
|
-
const
|
|
5701
|
-
setTip({ text: (el.textContent || "").trim(), left:
|
|
5731
|
+
const r2 = el.getBoundingClientRect();
|
|
5732
|
+
setTip({ text: (el.textContent || "").trim(), left: r2.left, top: r2.top });
|
|
5702
5733
|
}
|
|
5703
5734
|
function hideFull() {
|
|
5704
5735
|
setTip(null);
|
|
@@ -5843,14 +5874,14 @@ window.Aura = (() => {
|
|
|
5843
5874
|
function() {
|
|
5844
5875
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
5845
5876
|
const col = byKey[sort.key];
|
|
5846
|
-
const val = col.sortValue || (col.pill ? function(
|
|
5847
|
-
return TONE_ORDER[col.tones && col.tones[
|
|
5848
|
-
} : function(
|
|
5849
|
-
return
|
|
5877
|
+
const val = col.sortValue || (col.pill ? function(r2) {
|
|
5878
|
+
return TONE_ORDER[col.tones && col.tones[r2[col.key]] || toneFor(r2[col.key])];
|
|
5879
|
+
} : function(r2) {
|
|
5880
|
+
return r2[col.key];
|
|
5850
5881
|
});
|
|
5851
5882
|
const dir = sort.dir === "desc" ? -1 : 1;
|
|
5852
|
-
return rows.map(function(
|
|
5853
|
-
return [
|
|
5883
|
+
return rows.map(function(r2, i) {
|
|
5884
|
+
return [r2, i];
|
|
5854
5885
|
}).sort(function(a, b) {
|
|
5855
5886
|
return compare(val(a[0]), val(b[0])) * dir || a[1] - b[1];
|
|
5856
5887
|
}).map(function(p) {
|
|
@@ -5948,8 +5979,8 @@ window.Aura = (() => {
|
|
|
5948
5979
|
})
|
|
5949
5980
|
);
|
|
5950
5981
|
}
|
|
5951
|
-
function rowLinkWrap(
|
|
5952
|
-
return rowHref ? /* @__PURE__ */ React33.createElement(Link, { href: rowHref(
|
|
5982
|
+
function rowLinkWrap(r2, content) {
|
|
5983
|
+
return rowHref ? /* @__PURE__ */ React33.createElement(Link, { href: rowHref(r2), className: "aura-table__row-link" }, content) : content;
|
|
5953
5984
|
}
|
|
5954
5985
|
const height = props.height || 0;
|
|
5955
5986
|
const autoRows = props.rowHeight === "auto" && !height;
|
|
@@ -6004,9 +6035,9 @@ window.Aura = (() => {
|
|
|
6004
6035
|
},
|
|
6005
6036
|
[stacked]
|
|
6006
6037
|
);
|
|
6007
|
-
function tabFor(
|
|
6008
|
-
if (!activeRendered) return
|
|
6009
|
-
return
|
|
6038
|
+
function tabFor(r2, c) {
|
|
6039
|
+
if (!activeRendered) return r2 === 0 && c === ac ? 0 : -1;
|
|
6040
|
+
return r2 === ar && c === acShown ? 0 : -1;
|
|
6010
6041
|
}
|
|
6011
6042
|
React33.useEffect(function() {
|
|
6012
6043
|
const p = pending.current;
|
|
@@ -6030,38 +6061,38 @@ window.Aura = (() => {
|
|
|
6030
6061
|
el.focus();
|
|
6031
6062
|
}
|
|
6032
6063
|
});
|
|
6033
|
-
function focusCell(
|
|
6034
|
-
|
|
6064
|
+
function focusCell(r2, c, dir) {
|
|
6065
|
+
r2 = Math.max(0, Math.min(r2, lastR));
|
|
6035
6066
|
c = Math.max(0, Math.min(c, nCols - 1));
|
|
6036
|
-
if (stacked &&
|
|
6037
|
-
if (gridRef.current && (
|
|
6067
|
+
if (stacked && r2 === 0 && nRows > 0 && (!(selectable && c === 0) || noCardSel)) r2 = 1;
|
|
6068
|
+
if (gridRef.current && (r2 === T && hasTotal || stacked)) {
|
|
6038
6069
|
const shown2 = function(cc) {
|
|
6039
6070
|
if (cardHidden[cc]) return false;
|
|
6040
|
-
const e = gridRef.current.querySelector('[data-rc="' +
|
|
6071
|
+
const e = gridRef.current.querySelector('[data-rc="' + r2 + ":" + cc + '"]');
|
|
6041
6072
|
return !!e && e.getClientRects().length > 0;
|
|
6042
6073
|
};
|
|
6043
6074
|
c = nearestShown(c, dir || 1, shown2);
|
|
6044
6075
|
}
|
|
6045
|
-
activeState[1]({ r, c });
|
|
6046
|
-
pending.current = { r, c };
|
|
6047
|
-
if (virtual && hasTotal &&
|
|
6076
|
+
activeState[1]({ r: r2, c });
|
|
6077
|
+
pending.current = { r: r2, c };
|
|
6078
|
+
if (virtual && hasTotal && r2 === T && !props.stickyFooter) {
|
|
6048
6079
|
const sc = scrollRef.current;
|
|
6049
6080
|
sc.scrollTop = sc.scrollHeight;
|
|
6050
6081
|
setScrollTop(sc.scrollTop);
|
|
6051
|
-
} else if (virtual &&
|
|
6052
|
-
const sc = scrollRef.current, top = (
|
|
6082
|
+
} else if (virtual && r2 > 0 && r2 <= nRows) {
|
|
6083
|
+
const sc = scrollRef.current, top = (r2 - 1) * ROW_H;
|
|
6053
6084
|
if (top < sc.scrollTop) sc.scrollTop = top;
|
|
6054
6085
|
else if (top + ROW_H > sc.scrollTop + bodyH) sc.scrollTop = top + ROW_H - bodyH;
|
|
6055
6086
|
setScrollTop(sc.scrollTop);
|
|
6056
6087
|
}
|
|
6057
|
-
const el = gridRef.current && gridRef.current.querySelector('[data-rc="' +
|
|
6088
|
+
const el = gridRef.current && gridRef.current.querySelector('[data-rc="' + r2 + ":" + c + '"]');
|
|
6058
6089
|
if (el) {
|
|
6059
6090
|
pending.current = null;
|
|
6060
6091
|
el.focus();
|
|
6061
6092
|
}
|
|
6062
6093
|
}
|
|
6063
|
-
const pageKeys = pageRows.filter(canSelect).map(function(
|
|
6064
|
-
return
|
|
6094
|
+
const pageKeys = pageRows.filter(canSelect).map(function(r2) {
|
|
6095
|
+
return r2[rowKey];
|
|
6065
6096
|
});
|
|
6066
6097
|
const selSet = {};
|
|
6067
6098
|
selected.forEach(function(k) {
|
|
@@ -6319,51 +6350,51 @@ window.Aura = (() => {
|
|
|
6319
6350
|
}
|
|
6320
6351
|
return;
|
|
6321
6352
|
}
|
|
6322
|
-
const p = rc.split(":"),
|
|
6323
|
-
const row =
|
|
6353
|
+
const p = rc.split(":"), r2 = +p[0], c = +p[1], k = e.key, col = colAt(c);
|
|
6354
|
+
const row = r2 > 0 && r2 <= nRows ? pageRows[r2 - 1] : null, isTotal = hasTotal && r2 === T;
|
|
6324
6355
|
let handled = true;
|
|
6325
|
-
if (
|
|
6356
|
+
if (r2 === 0 && col && e.altKey && (k === "ArrowLeft" || k === "ArrowRight") && canResize(col))
|
|
6326
6357
|
setW(col, widthOf(col) + (k === "ArrowLeft" ? -1 : 1) * (e.shiftKey ? 48 : 16), true);
|
|
6327
|
-
else if (
|
|
6358
|
+
else if (r2 === 0 && col && e.ctrlKey && e.shiftKey && (k === "ArrowLeft" || k === "ArrowRight") && reorderable) {
|
|
6328
6359
|
if (moveCol(col.key, k === "ArrowLeft" ? -1 : 1)) pending.current = { r: 0, key: col.key, c };
|
|
6329
|
-
} else if (
|
|
6360
|
+
} else if (r2 === 0 && col && (e.altKey && k === "ArrowDown" || k === "ContextMenu" || e.shiftKey && k === "F10") && controls)
|
|
6330
6361
|
openMenu("col", col.key, target, { r: 0, c });
|
|
6331
|
-
else if (k === "ArrowRight") focusCell(
|
|
6332
|
-
else if (k === "ArrowLeft") focusCell(
|
|
6362
|
+
else if (k === "ArrowRight") focusCell(r2, c + 1);
|
|
6363
|
+
else if (k === "ArrowLeft") focusCell(r2, c - 1, -1);
|
|
6333
6364
|
else if (k === "ArrowDown") {
|
|
6334
|
-
if (
|
|
6365
|
+
if (r2 < lastR) focusCell(r2 + 1, c);
|
|
6335
6366
|
else if (pageSize && page < pageCount && goPage(page + 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
6336
6367
|
} else if (k === "ArrowUp") {
|
|
6337
|
-
if (
|
|
6338
|
-
else if (
|
|
6339
|
-
} else if (k === "Home") focusCell(e.ctrlKey ? 1 :
|
|
6340
|
-
else if (k === "End") focusCell(e.ctrlKey ? lastR :
|
|
6368
|
+
if (r2 > 1 || r2 === 1 && !(pageSize && page > 1)) focusCell(r2 - 1, c);
|
|
6369
|
+
else if (r2 === 1 && goPage(page - 1, { r: pageSize, c })) activeState[1]({ r: pageSize, c });
|
|
6370
|
+
} else if (k === "Home") focusCell(e.ctrlKey ? 1 : r2, 0);
|
|
6371
|
+
else if (k === "End") focusCell(e.ctrlKey ? lastR : r2, nCols - 1, -1);
|
|
6341
6372
|
else if (k === "PageDown") {
|
|
6342
6373
|
if (pageSize) {
|
|
6343
6374
|
if (goPage(page + 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
6344
|
-
} else focusCell(Math.min(lastR,
|
|
6375
|
+
} else focusCell(Math.min(lastR, r2 + visibleRows), c);
|
|
6345
6376
|
} else if (k === "PageUp") {
|
|
6346
6377
|
if (pageSize) {
|
|
6347
6378
|
if (goPage(page - 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
6348
|
-
} else focusCell(Math.max(1,
|
|
6379
|
+
} else focusCell(Math.max(1, r2 - visibleRows), c);
|
|
6349
6380
|
} else if (isTotal && (k === " " || k === "Enter" || k === "F2")) {
|
|
6350
6381
|
handled = false;
|
|
6351
|
-
} else if (k === "F2" &&
|
|
6382
|
+
} else if (k === "F2" && r2 > 0) {
|
|
6352
6383
|
const inner = target.querySelector("button, a[href], input, select, textarea");
|
|
6353
6384
|
if (inner) inner.focus();
|
|
6354
6385
|
else handled = false;
|
|
6355
6386
|
} else if (k === " " || k === "Enter") {
|
|
6356
|
-
if (
|
|
6387
|
+
if (r2 === 0 && !col && selectable && nRows) {
|
|
6357
6388
|
if (pageKeys.length) toggleAll();
|
|
6358
|
-
} else if (
|
|
6359
|
-
else if (
|
|
6389
|
+
} else if (r2 === 0 && col && col.sortable && canSortAny) sortBy(col.key);
|
|
6390
|
+
else if (r2 > 0 && k === " " && selectable) {
|
|
6360
6391
|
if (canSelect(row) && !(stacked && noCardSel))
|
|
6361
6392
|
toggle(row[rowKey], !selSet[row[rowKey]], { shiftKey: e.shiftKey, source: "keyboard" });
|
|
6362
|
-
} else if (
|
|
6393
|
+
} else if (r2 > 0 && k === "Enter" && rowHref && !target.querySelector("button, a[href]:not(.aura-table__row-link), input, select, textarea"))
|
|
6363
6394
|
followRow(target.closest('[role="row"]'), e);
|
|
6364
|
-
else if (
|
|
6395
|
+
else if (r2 > 0 && k === "Enter" && target.querySelector("button, a[href], input, select, textarea"))
|
|
6365
6396
|
target.querySelector("button, a[href], input, select, textarea").focus();
|
|
6366
|
-
else if (
|
|
6397
|
+
else if (r2 > 0 && k === "Enter" && props.onRowActivate) props.onRowActivate(row);
|
|
6367
6398
|
else handled = false;
|
|
6368
6399
|
} else handled = false;
|
|
6369
6400
|
if (handled) {
|
|
@@ -6526,13 +6557,13 @@ window.Aura = (() => {
|
|
|
6526
6557
|
}
|
|
6527
6558
|
)
|
|
6528
6559
|
);
|
|
6529
|
-
function cellContent(c,
|
|
6530
|
-
const v =
|
|
6531
|
-
return c.render ? c.render(
|
|
6560
|
+
function cellContent(c, r2) {
|
|
6561
|
+
const v = r2[c.key];
|
|
6562
|
+
return c.render ? c.render(r2) : c.pill ? /* @__PURE__ */ React33.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
6532
6563
|
}
|
|
6533
|
-
function rowCells(
|
|
6564
|
+
function rowCells(r2, i, k, isSel) {
|
|
6534
6565
|
const ri = i + 1;
|
|
6535
|
-
const selLabel = selectable && canSelect(
|
|
6566
|
+
const selLabel = selectable && canSelect(r2) ? props.rowSelectLabel && props.rowSelectLabel(r2) || t.selectRow(k) : void 0;
|
|
6536
6567
|
const cells = [/* @__PURE__ */ React33.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
6537
6568
|
if (selectable)
|
|
6538
6569
|
cells.push(
|
|
@@ -6545,7 +6576,7 @@ window.Aura = (() => {
|
|
|
6545
6576
|
className: cx("aura-table__sel", nPinned && "is-pinned"),
|
|
6546
6577
|
tabIndex: tabFor(ri, 0),
|
|
6547
6578
|
"data-rc": ri + ":0",
|
|
6548
|
-
"aria-label": canSelect(
|
|
6579
|
+
"aria-label": canSelect(r2) ? selLabel : props.rowSelectDisabledLabel ? props.rowSelectDisabledLabel(r2) : void 0,
|
|
6549
6580
|
onFocus: function(e) {
|
|
6550
6581
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
6551
6582
|
},
|
|
@@ -6553,7 +6584,7 @@ window.Aura = (() => {
|
|
|
6553
6584
|
shiftClick.current = e.shiftKey;
|
|
6554
6585
|
}
|
|
6555
6586
|
},
|
|
6556
|
-
canSelect(
|
|
6587
|
+
canSelect(r2) ? /* @__PURE__ */ React33.createElement(
|
|
6557
6588
|
Checkbox,
|
|
6558
6589
|
{
|
|
6559
6590
|
hideLabel: true,
|
|
@@ -6570,7 +6601,7 @@ window.Aura = (() => {
|
|
|
6570
6601
|
)
|
|
6571
6602
|
);
|
|
6572
6603
|
vis.forEach(function(c, j) {
|
|
6573
|
-
const ci = j + (selectable ? 1 : 0), v =
|
|
6604
|
+
const ci = j + (selectable ? 1 : 0), v = r2[c.key], pin = isPinned(c);
|
|
6574
6605
|
cells.push(
|
|
6575
6606
|
/* @__PURE__ */ React33.createElement(
|
|
6576
6607
|
"span",
|
|
@@ -6594,7 +6625,7 @@ window.Aura = (() => {
|
|
|
6594
6625
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
6595
6626
|
}
|
|
6596
6627
|
},
|
|
6597
|
-
autoRows ? /* @__PURE__ */ React33.createElement("span", { className: "aura-table__cell" }, j === 0 ? rowLinkWrap(
|
|
6628
|
+
autoRows ? /* @__PURE__ */ React33.createElement("span", { className: "aura-table__cell" }, j === 0 ? rowLinkWrap(r2, cellContent(c, r2)) : cellContent(c, r2)) : j === 0 ? rowLinkWrap(r2, cellContent(c, r2)) : cellContent(c, r2)
|
|
6598
6629
|
)
|
|
6599
6630
|
);
|
|
6600
6631
|
});
|
|
@@ -6692,8 +6723,8 @@ window.Aura = (() => {
|
|
|
6692
6723
|
/* @__PURE__ */ React33.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
6693
6724
|
);
|
|
6694
6725
|
for (let ri = start; ri < end; ri++) {
|
|
6695
|
-
(function(
|
|
6696
|
-
const k =
|
|
6726
|
+
(function(r2, i) {
|
|
6727
|
+
const k = r2[rowKey], isSel = !!selSet[k];
|
|
6697
6728
|
bodyRows.push(
|
|
6698
6729
|
/* @__PURE__ */ React33.createElement(
|
|
6699
6730
|
"div",
|
|
@@ -6701,7 +6732,7 @@ window.Aura = (() => {
|
|
|
6701
6732
|
key: k,
|
|
6702
6733
|
role: "row",
|
|
6703
6734
|
"aria-rowindex": first + i + 2,
|
|
6704
|
-
"aria-selected": selectable && canSelect(
|
|
6735
|
+
"aria-selected": selectable && canSelect(r2) ? isSel : void 0,
|
|
6705
6736
|
className: cx(
|
|
6706
6737
|
"aura-table__row",
|
|
6707
6738
|
autoRows && "aura-table__row--auto",
|
|
@@ -6713,10 +6744,10 @@ window.Aura = (() => {
|
|
|
6713
6744
|
const el = e.target;
|
|
6714
6745
|
if (el.closest && el.closest(".aura-check, button, a, input")) return;
|
|
6715
6746
|
if (rowHref) followRow(e.currentTarget, e);
|
|
6716
|
-
else if (props.onRowActivate) props.onRowActivate(
|
|
6747
|
+
else if (props.onRowActivate) props.onRowActivate(r2);
|
|
6717
6748
|
}
|
|
6718
6749
|
},
|
|
6719
|
-
rowCells(
|
|
6750
|
+
rowCells(r2, i, k, isSel)
|
|
6720
6751
|
)
|
|
6721
6752
|
);
|
|
6722
6753
|
})(pageRows[ri], ri);
|
|
@@ -7234,8 +7265,8 @@ window.Aura = (() => {
|
|
|
7234
7265
|
function tipHandlers(label) {
|
|
7235
7266
|
if (!collapsed) return {};
|
|
7236
7267
|
function show3(e) {
|
|
7237
|
-
const
|
|
7238
|
-
setTip({ text: label, top:
|
|
7268
|
+
const r2 = e.currentTarget.getBoundingClientRect();
|
|
7269
|
+
setTip({ text: label, top: r2.top + r2.height / 2, left: r2.right + 8 });
|
|
7239
7270
|
}
|
|
7240
7271
|
function hide2() {
|
|
7241
7272
|
setTip(null);
|
|
@@ -7521,9 +7552,24 @@ window.Aura = (() => {
|
|
|
7521
7552
|
|
|
7522
7553
|
// src/breakpoints.ts
|
|
7523
7554
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
7555
|
+
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
7556
|
+
function respVars(prefix, value, map2) {
|
|
7557
|
+
const style = {};
|
|
7558
|
+
if (value == null) return style;
|
|
7559
|
+
if (typeof value !== "object") value = { base: value };
|
|
7560
|
+
let byBp = value, cur2;
|
|
7561
|
+
ORDER.forEach(function(k) {
|
|
7562
|
+
if (byBp[k] !== void 0) cur2 = map2 ? map2(byBp[k]) : byBp[k];
|
|
7563
|
+
if (cur2 !== void 0) style["--" + prefix + "-" + k] = cur2;
|
|
7564
|
+
});
|
|
7565
|
+
return style;
|
|
7566
|
+
}
|
|
7567
|
+
var space = function(v) {
|
|
7568
|
+
return typeof v === "number" ? "var(--aura-space-" + v + ")" : v;
|
|
7569
|
+
};
|
|
7524
7570
|
|
|
7525
7571
|
// src/responsive.tsx
|
|
7526
|
-
var
|
|
7572
|
+
var ORDER2 = ["base", "sm", "md", "lg", "xl"];
|
|
7527
7573
|
function useBreakpoint() {
|
|
7528
7574
|
return React39.useSyncExternalStore(subscribe, current, function() {
|
|
7529
7575
|
return "lg";
|
|
@@ -7531,7 +7577,7 @@ window.Aura = (() => {
|
|
|
7531
7577
|
}
|
|
7532
7578
|
function current() {
|
|
7533
7579
|
let w = window.innerWidth, bp = "base";
|
|
7534
|
-
|
|
7580
|
+
ORDER2.slice(1).forEach(function(k) {
|
|
7535
7581
|
if (w >= breakpoints[k]) bp = k;
|
|
7536
7582
|
});
|
|
7537
7583
|
return bp;
|
|
@@ -7546,23 +7592,9 @@ window.Aura = (() => {
|
|
|
7546
7592
|
const bp = useBreakpoint();
|
|
7547
7593
|
if (value == null || typeof value !== "object") return value;
|
|
7548
7594
|
const map2 = value;
|
|
7549
|
-
for (let i =
|
|
7595
|
+
for (let i = ORDER2.indexOf(bp); i >= 0; i--) if (map2[ORDER2[i]] !== void 0) return map2[ORDER2[i]];
|
|
7550
7596
|
return void 0;
|
|
7551
7597
|
}
|
|
7552
|
-
function respVars(prefix, value, map2) {
|
|
7553
|
-
const style = {};
|
|
7554
|
-
if (value == null) return style;
|
|
7555
|
-
if (typeof value !== "object") value = { base: value };
|
|
7556
|
-
let byBp = value, cur2;
|
|
7557
|
-
ORDER.forEach(function(k) {
|
|
7558
|
-
if (byBp[k] !== void 0) cur2 = map2 ? map2(byBp[k]) : byBp[k];
|
|
7559
|
-
if (cur2 !== void 0) style["--" + prefix + "-" + k] = cur2;
|
|
7560
|
-
});
|
|
7561
|
-
return style;
|
|
7562
|
-
}
|
|
7563
|
-
var space = function(v) {
|
|
7564
|
-
return typeof v === "number" ? "var(--aura-space-" + v + ")" : v;
|
|
7565
|
-
};
|
|
7566
7598
|
|
|
7567
7599
|
// src/Stack.tsx
|
|
7568
7600
|
var h5 = React40.createElement;
|
|
@@ -7600,14 +7632,14 @@ window.Aura = (() => {
|
|
|
7600
7632
|
var React42 = __toESM(require_react(), 1);
|
|
7601
7633
|
var h7 = React42.createElement;
|
|
7602
7634
|
var Container = React42.forwardRef(function Container2(props, ref) {
|
|
7603
|
-
const
|
|
7635
|
+
const attrs2 = {};
|
|
7604
7636
|
Object.keys(props).forEach(function(k) {
|
|
7605
7637
|
if (k === "id" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
7606
|
-
|
|
7638
|
+
attrs2[k] = props[k];
|
|
7607
7639
|
});
|
|
7608
7640
|
return h7(
|
|
7609
7641
|
props.as || "div",
|
|
7610
|
-
Object.assign(
|
|
7642
|
+
Object.assign(attrs2, {
|
|
7611
7643
|
ref,
|
|
7612
7644
|
className: cx(
|
|
7613
7645
|
"aura-container",
|
|
@@ -7625,15 +7657,15 @@ window.Aura = (() => {
|
|
|
7625
7657
|
var React43 = __toESM(require_react(), 1);
|
|
7626
7658
|
var h8 = React43.createElement;
|
|
7627
7659
|
var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
7628
|
-
const
|
|
7660
|
+
const attrs2 = {};
|
|
7629
7661
|
Object.keys(props).forEach(function(k) {
|
|
7630
7662
|
if (k === "id" || k === "lang" || k === "dir" || k === "role" || /^(aria|data)-/.test(k))
|
|
7631
|
-
|
|
7663
|
+
attrs2[k] = props[k];
|
|
7632
7664
|
});
|
|
7633
7665
|
const level = props.headingLevel || 1;
|
|
7634
7666
|
return h8(
|
|
7635
7667
|
"div",
|
|
7636
|
-
Object.assign(
|
|
7668
|
+
Object.assign(attrs2, { ref, className: cx("aura-page-header", props.className), style: props.style }),
|
|
7637
7669
|
h8(
|
|
7638
7670
|
"div",
|
|
7639
7671
|
{ className: "aura-page-header__text" },
|
|
@@ -7646,39 +7678,401 @@ window.Aura = (() => {
|
|
|
7646
7678
|
);
|
|
7647
7679
|
});
|
|
7648
7680
|
|
|
7649
|
-
// src/
|
|
7681
|
+
// src/StatusTile.tsx
|
|
7682
|
+
var React45 = __toESM(require_react(), 1);
|
|
7683
|
+
|
|
7684
|
+
// src/tiles.tsx
|
|
7650
7685
|
var React44 = __toESM(require_react(), 1);
|
|
7651
|
-
var
|
|
7686
|
+
var h9 = React44.createElement;
|
|
7687
|
+
var STATUS_ICON = {
|
|
7688
|
+
down: IconCircleAlert,
|
|
7689
|
+
problem: IconTriangleAlert,
|
|
7690
|
+
maintenance: IconWrench,
|
|
7691
|
+
ok: IconCircleCheck,
|
|
7692
|
+
unknown: IconCircleDotDashed
|
|
7693
|
+
};
|
|
7694
|
+
var STATUS_TONE = {
|
|
7695
|
+
down: "danger",
|
|
7696
|
+
problem: "warning",
|
|
7697
|
+
maintenance: "accent",
|
|
7698
|
+
ok: "default",
|
|
7699
|
+
unknown: "default"
|
|
7700
|
+
};
|
|
7701
|
+
var STATUS_WORD = {
|
|
7702
|
+
down: "statusDown",
|
|
7703
|
+
problem: "statusProblem",
|
|
7704
|
+
maintenance: "statusMaintenance",
|
|
7705
|
+
ok: "statusOk",
|
|
7706
|
+
unknown: "statusUnknown"
|
|
7707
|
+
};
|
|
7708
|
+
function statusWord(status, t) {
|
|
7709
|
+
return String(t[STATUS_WORD[status]] || STATUS_WORD[status]);
|
|
7710
|
+
}
|
|
7711
|
+
function attrs(props) {
|
|
7712
|
+
const out = {};
|
|
7713
|
+
Object.keys(props).forEach(function(k) {
|
|
7714
|
+
if (k === "id" || k === "style" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
7715
|
+
out[k] = props[k];
|
|
7716
|
+
});
|
|
7717
|
+
return out;
|
|
7718
|
+
}
|
|
7719
|
+
var comma = h9("span", { className: "aura-status-tile__sep" }, ",");
|
|
7720
|
+
function statusTileElement(props, ref, Link, t, titleRef) {
|
|
7721
|
+
const status = STATUS_ICON[props.status] ? props.status : "unknown";
|
|
7722
|
+
if (status !== props.status)
|
|
7723
|
+
devWarnOnce(
|
|
7724
|
+
"status-tile-status-" + String(props.status),
|
|
7725
|
+
'StatusTile status="' + String(props.status) + '" is not down, problem, maintenance, ok or unknown: it shows as unknown ("No data"). Map your value first.'
|
|
7726
|
+
);
|
|
7727
|
+
const valueTone = props.valueTone || STATUS_TONE[status];
|
|
7728
|
+
const word = props.statusLabel || statusWord(status, t);
|
|
7729
|
+
const markers = (props.markers || []).filter(Boolean);
|
|
7730
|
+
const has = function(v) {
|
|
7731
|
+
return v != null && v !== false && v !== "";
|
|
7732
|
+
};
|
|
7733
|
+
const hasValue = has(props.value), hasMeta = has(props.meta);
|
|
7734
|
+
const Tag3 = props.href ? Link : "div";
|
|
7735
|
+
return h9(
|
|
7736
|
+
Tag3,
|
|
7737
|
+
Object.assign(attrs(props), {
|
|
7738
|
+
ref,
|
|
7739
|
+
href: props.href,
|
|
7740
|
+
className: cx("aura-status-tile", "aura-status-tile--" + status, props.href && "is-interactive", props.className)
|
|
7741
|
+
}),
|
|
7742
|
+
h9(
|
|
7743
|
+
"span",
|
|
7744
|
+
{ className: "aura-status-tile__head" },
|
|
7745
|
+
h9(Icon, { name: h9(STATUS_ICON[status]), size: 16, className: "aura-status-tile__icon" }),
|
|
7746
|
+
h9("span", { className: "aura-status-tile__title", ref: titleRef }, props.title, comma),
|
|
7747
|
+
h9("span", { className: "aura-sr-only" }, word + (hasValue || hasMeta || markers.length ? "," : "")),
|
|
7748
|
+
hasValue ? h9(
|
|
7749
|
+
"span",
|
|
7750
|
+
{ className: cx("aura-status-tile__value", "is-" + valueTone) },
|
|
7751
|
+
props.value,
|
|
7752
|
+
hasMeta || markers.length ? comma : null
|
|
7753
|
+
) : null
|
|
7754
|
+
),
|
|
7755
|
+
hasMeta || markers.length ? h9(
|
|
7756
|
+
"span",
|
|
7757
|
+
{ className: "aura-status-tile__foot" },
|
|
7758
|
+
hasMeta ? h9("span", { className: "aura-status-tile__meta" }, props.meta, markers.length ? comma : null) : null,
|
|
7759
|
+
markers.length ? h9(
|
|
7760
|
+
"span",
|
|
7761
|
+
{ className: "aura-status-tile__markers" },
|
|
7762
|
+
markers.map(function(m, i) {
|
|
7763
|
+
return h9(
|
|
7764
|
+
"span",
|
|
7765
|
+
{
|
|
7766
|
+
key: i,
|
|
7767
|
+
className: cx("aura-status-tile__marker", "is-" + (m.tone || "neutral")),
|
|
7768
|
+
"data-aura-tip": m.label
|
|
7769
|
+
},
|
|
7770
|
+
h9(Icon, { name: m.icon, size: 14 }),
|
|
7771
|
+
h9("span", { className: "aura-sr-only" }, m.label + (i < markers.length - 1 ? "," : ""))
|
|
7772
|
+
);
|
|
7773
|
+
})
|
|
7774
|
+
) : null
|
|
7775
|
+
) : null
|
|
7776
|
+
);
|
|
7777
|
+
}
|
|
7778
|
+
var TileGrid = React44.forwardRef(function TileGrid2(props, ref) {
|
|
7779
|
+
const style = Object.assign(
|
|
7780
|
+
{},
|
|
7781
|
+
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
7782
|
+
props.style
|
|
7783
|
+
);
|
|
7784
|
+
return h9(
|
|
7785
|
+
"ul",
|
|
7786
|
+
Object.assign(attrs(props), {
|
|
7787
|
+
ref,
|
|
7788
|
+
role: "list",
|
|
7789
|
+
className: cx("aura-grid-layout", "aura-tile-grid", props.className),
|
|
7790
|
+
style
|
|
7791
|
+
}),
|
|
7792
|
+
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
7793
|
+
flat(props.children).map(function(c, i) {
|
|
7794
|
+
return h9("li", { key: React44.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
7795
|
+
})
|
|
7796
|
+
);
|
|
7797
|
+
});
|
|
7798
|
+
function flat(children) {
|
|
7799
|
+
const out = [];
|
|
7800
|
+
React44.Children.toArray(children).forEach(function(c) {
|
|
7801
|
+
if (React44.isValidElement(c) && c.type === React44.Fragment)
|
|
7802
|
+
flat(c.props.children).forEach(function(x) {
|
|
7803
|
+
out.push(React44.isValidElement(x) ? React44.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
7804
|
+
});
|
|
7805
|
+
else if (c !== "") out.push(c);
|
|
7806
|
+
});
|
|
7807
|
+
return out;
|
|
7808
|
+
}
|
|
7809
|
+
var SIZES2 = { sm: [80, 24], md: [120, 32] };
|
|
7810
|
+
var PAD = 2;
|
|
7811
|
+
function r(n3) {
|
|
7812
|
+
return Math.round(n3 * 100) / 100;
|
|
7813
|
+
}
|
|
7814
|
+
function num(v) {
|
|
7815
|
+
return typeof v === "number" && isFinite(v) ? v : null;
|
|
7816
|
+
}
|
|
7817
|
+
var Sparkline = React44.forwardRef(function Sparkline2(props, ref) {
|
|
7818
|
+
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
7819
|
+
const W = wh[0], H = wh[1];
|
|
7820
|
+
const data = (props.data || []).map(num);
|
|
7821
|
+
const n3 = data.length;
|
|
7822
|
+
const vals = data.filter(function(v) {
|
|
7823
|
+
return v != null;
|
|
7824
|
+
});
|
|
7825
|
+
let lo = num(props.min), hi = num(props.max);
|
|
7826
|
+
if (lo == null) lo = vals.length ? Math.min.apply(null, vals) : 0;
|
|
7827
|
+
if (hi == null) hi = vals.length ? Math.max.apply(null, vals) : 0;
|
|
7828
|
+
if (lo > hi) {
|
|
7829
|
+
const s = lo;
|
|
7830
|
+
lo = hi;
|
|
7831
|
+
hi = s;
|
|
7832
|
+
}
|
|
7833
|
+
const step = n3 > 1 ? (W - 2 * PAD) / (n3 - 1) : 0;
|
|
7834
|
+
const x = function(i) {
|
|
7835
|
+
return n3 > 1 ? PAD + i * step : W / 2;
|
|
7836
|
+
};
|
|
7837
|
+
const y = function(v) {
|
|
7838
|
+
if (hi === lo) return H / 2;
|
|
7839
|
+
const k = Math.max(0, Math.min(1, (v - lo) / (hi - lo)));
|
|
7840
|
+
return H - PAD - k * (H - 2 * PAD);
|
|
7841
|
+
};
|
|
7842
|
+
let d = "";
|
|
7843
|
+
const dots = [];
|
|
7844
|
+
data.forEach(function(v, i) {
|
|
7845
|
+
if (v == null) return;
|
|
7846
|
+
const prev = i > 0 && data[i - 1] != null, next = i < n3 - 1 && data[i + 1] != null;
|
|
7847
|
+
if (!prev && !next) dots.push(h9("circle", { key: "d" + i, cx: r(x(i)), cy: r(y(v)), r: 1.5 }));
|
|
7848
|
+
else d += (prev ? "L" : "M") + r(x(i)) + " " + r(y(v));
|
|
7849
|
+
});
|
|
7850
|
+
const mode = props.failures || "none";
|
|
7851
|
+
const fails = [];
|
|
7852
|
+
if (mode !== "none" && props.failed)
|
|
7853
|
+
data.forEach(function(_v, i) {
|
|
7854
|
+
if (!props.failed[i]) return;
|
|
7855
|
+
if (mode === "band") {
|
|
7856
|
+
const w = Math.max(2, step || W), left = Math.max(0, x(i) - w / 2), right = Math.min(W, x(i) + w / 2);
|
|
7857
|
+
fails.push(h9("rect", { key: "f" + i, x: r(left), y: 0, width: r(right - left), height: H }));
|
|
7858
|
+
} else
|
|
7859
|
+
fails.push(
|
|
7860
|
+
h9("rect", {
|
|
7861
|
+
key: "f" + i,
|
|
7862
|
+
x: r(Math.max(0, Math.min(W - 1.5, x(i) - 0.75))),
|
|
7863
|
+
y: H - 6,
|
|
7864
|
+
width: 1.5,
|
|
7865
|
+
height: 6
|
|
7866
|
+
})
|
|
7867
|
+
);
|
|
7868
|
+
});
|
|
7869
|
+
const named = !!props.label;
|
|
7870
|
+
return h9(
|
|
7871
|
+
"svg",
|
|
7872
|
+
Object.assign(attrs(props), {
|
|
7873
|
+
ref,
|
|
7874
|
+
className: cx("aura-sparkline", "is-" + (props.tone || "neutral"), props.className),
|
|
7875
|
+
width: W,
|
|
7876
|
+
height: H,
|
|
7877
|
+
viewBox: "0 0 " + W + " " + H,
|
|
7878
|
+
role: named ? "img" : void 0,
|
|
7879
|
+
"aria-label": named ? props.label : void 0,
|
|
7880
|
+
"aria-hidden": named ? void 0 : true,
|
|
7881
|
+
focusable: "false"
|
|
7882
|
+
}),
|
|
7883
|
+
fails.length && mode === "band" ? h9("g", { className: "aura-sparkline__band" }, fails) : null,
|
|
7884
|
+
d ? h9("path", { className: "aura-sparkline__line", d }) : null,
|
|
7885
|
+
dots.length ? h9("g", { className: "aura-sparkline__dots" }, dots) : null,
|
|
7886
|
+
fails.length && mode === "ticks" ? h9("g", { className: "aura-sparkline__ticks" }, fails) : null
|
|
7887
|
+
);
|
|
7888
|
+
});
|
|
7889
|
+
|
|
7890
|
+
// src/StatusTile.tsx
|
|
7891
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React45.useLayoutEffect : React45.useEffect;
|
|
7892
|
+
var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
7893
|
+
const Link = useLinkComponent(props.linkComponent);
|
|
7894
|
+
const t = useStrings();
|
|
7895
|
+
useAutoTip();
|
|
7896
|
+
if (!props.href && (props["aria-label"] || props["aria-labelledby"]))
|
|
7897
|
+
devWarnOnce(
|
|
7898
|
+
"status-tile-label",
|
|
7899
|
+
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
7900
|
+
);
|
|
7901
|
+
const titleRef = React45.useRef(null);
|
|
7902
|
+
const check = React45.useCallback(function() {
|
|
7903
|
+
const el = titleRef.current;
|
|
7904
|
+
if (!el) return;
|
|
7905
|
+
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
7906
|
+
const text2 = (el.textContent || "").replace(/,$/, "").trim();
|
|
7907
|
+
if (cut && text2) el.setAttribute("data-aura-tip", text2);
|
|
7908
|
+
else el.removeAttribute("data-aura-tip");
|
|
7909
|
+
}, []);
|
|
7910
|
+
useIsoLayoutEffect2(check, [props.title, check]);
|
|
7911
|
+
const linked = !!props.href;
|
|
7912
|
+
React45.useEffect(
|
|
7913
|
+
function() {
|
|
7914
|
+
const el = titleRef.current;
|
|
7915
|
+
if (!el) return;
|
|
7916
|
+
let live = true;
|
|
7917
|
+
const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(check) : null;
|
|
7918
|
+
const mo = typeof MutationObserver !== "undefined" ? new MutationObserver(check) : null;
|
|
7919
|
+
if (ro) ro.observe(el);
|
|
7920
|
+
if (mo) mo.observe(el, { characterData: true, childList: true, subtree: true });
|
|
7921
|
+
if (document.fonts && document.fonts.ready)
|
|
7922
|
+
document.fonts.ready.then(function() {
|
|
7923
|
+
if (live) check();
|
|
7924
|
+
});
|
|
7925
|
+
return function() {
|
|
7926
|
+
live = false;
|
|
7927
|
+
if (ro) ro.disconnect();
|
|
7928
|
+
if (mo) mo.disconnect();
|
|
7929
|
+
};
|
|
7930
|
+
},
|
|
7931
|
+
[check, linked]
|
|
7932
|
+
);
|
|
7933
|
+
return statusTileElement(props, ref, Link, t, titleRef);
|
|
7934
|
+
});
|
|
7935
|
+
|
|
7936
|
+
// src/AppShell.tsx
|
|
7937
|
+
var React47 = __toESM(require_react(), 1);
|
|
7938
|
+
|
|
7939
|
+
// src/scrollHide.ts
|
|
7940
|
+
var React46 = __toESM(require_react(), 1);
|
|
7941
|
+
var STEP = 8;
|
|
7942
|
+
function useHideOnScroll(enabled, el, media, from) {
|
|
7943
|
+
const st = React46.useState(false), hidden = st[0], setHidden = st[1];
|
|
7944
|
+
React46.useEffect(
|
|
7945
|
+
function() {
|
|
7946
|
+
if (!enabled || typeof window === "undefined") {
|
|
7947
|
+
setHidden(false);
|
|
7948
|
+
return;
|
|
7949
|
+
}
|
|
7950
|
+
const mq = window.matchMedia ? window.matchMedia(media) : null;
|
|
7951
|
+
let last = window.scrollY, lastH = window.innerHeight, resizedAt = -1e9, run = 0;
|
|
7952
|
+
let restore = null;
|
|
7953
|
+
function update() {
|
|
7954
|
+
if (restore) {
|
|
7955
|
+
const r2 = restore;
|
|
7956
|
+
if (performance.now() > r2.until || window.scrollY >= r2.y - 1) restore = null;
|
|
7957
|
+
else {
|
|
7958
|
+
restore = null;
|
|
7959
|
+
last = r2.y;
|
|
7960
|
+
window.scrollTo(window.scrollX, r2.y);
|
|
7961
|
+
return;
|
|
7962
|
+
}
|
|
7963
|
+
}
|
|
7964
|
+
const y = window.scrollY, dy = y - last;
|
|
7965
|
+
last = y;
|
|
7966
|
+
const node2 = el.current;
|
|
7967
|
+
if (mq && !mq.matches || y <= from || node2 && document.activeElement && node2.contains(document.activeElement)) {
|
|
7968
|
+
run = 0;
|
|
7969
|
+
setHidden(false);
|
|
7970
|
+
return;
|
|
7971
|
+
}
|
|
7972
|
+
if (window.innerHeight !== lastH || performance.now() - resizedAt < 150) {
|
|
7973
|
+
lastH = window.innerHeight;
|
|
7974
|
+
resizedAt = performance.now();
|
|
7975
|
+
run = 0;
|
|
7976
|
+
return;
|
|
7977
|
+
}
|
|
7978
|
+
if (y + window.innerHeight > document.documentElement.scrollHeight + 1) return;
|
|
7979
|
+
run = dy > 0 === run > 0 ? run + dy : dy;
|
|
7980
|
+
if (run > STEP) setHidden(true);
|
|
7981
|
+
else if (run < -STEP) setHidden(false);
|
|
7982
|
+
}
|
|
7983
|
+
let tabbing = false;
|
|
7984
|
+
function disarm() {
|
|
7985
|
+
restore = null;
|
|
7986
|
+
}
|
|
7987
|
+
function onKey(e) {
|
|
7988
|
+
if (e.key !== "Tab" && e.code !== "Tab") {
|
|
7989
|
+
if (e.key !== "Shift") restore = null;
|
|
7990
|
+
return;
|
|
7991
|
+
}
|
|
7992
|
+
tabbing = true;
|
|
7993
|
+
requestAnimationFrame(function() {
|
|
7994
|
+
tabbing = false;
|
|
7995
|
+
});
|
|
7996
|
+
}
|
|
7997
|
+
function reveal() {
|
|
7998
|
+
const n3 = el.current;
|
|
7999
|
+
if (n3 && n3.classList.contains("is-away")) {
|
|
8000
|
+
n3.classList.remove("is-away");
|
|
8001
|
+
if (tabbing) {
|
|
8002
|
+
if (window.scrollY < last) window.scrollTo(window.scrollX, last);
|
|
8003
|
+
else restore = { y: last, until: performance.now() + 400 };
|
|
8004
|
+
}
|
|
8005
|
+
}
|
|
8006
|
+
setHidden(false);
|
|
8007
|
+
}
|
|
8008
|
+
window.addEventListener("scroll", update, { passive: true });
|
|
8009
|
+
window.addEventListener("resize", update);
|
|
8010
|
+
document.addEventListener("keydown", onKey, true);
|
|
8011
|
+
window.addEventListener("wheel", disarm, { passive: true, capture: true });
|
|
8012
|
+
window.addEventListener("touchstart", disarm, { passive: true, capture: true });
|
|
8013
|
+
window.addEventListener("pointerdown", disarm, true);
|
|
8014
|
+
const node = el.current;
|
|
8015
|
+
if (node) node.addEventListener("focusin", reveal);
|
|
8016
|
+
if (mq && mq.addEventListener) mq.addEventListener("change", update);
|
|
8017
|
+
return function() {
|
|
8018
|
+
window.removeEventListener("scroll", update);
|
|
8019
|
+
window.removeEventListener("resize", update);
|
|
8020
|
+
document.removeEventListener("keydown", onKey, true);
|
|
8021
|
+
window.removeEventListener("wheel", disarm, true);
|
|
8022
|
+
window.removeEventListener("touchstart", disarm, true);
|
|
8023
|
+
window.removeEventListener("pointerdown", disarm, true);
|
|
8024
|
+
if (node) node.removeEventListener("focusin", reveal);
|
|
8025
|
+
if (mq && mq.removeEventListener) mq.removeEventListener("change", update);
|
|
8026
|
+
};
|
|
8027
|
+
},
|
|
8028
|
+
[enabled, el, media, from]
|
|
8029
|
+
);
|
|
8030
|
+
return enabled && hidden;
|
|
8031
|
+
}
|
|
8032
|
+
|
|
8033
|
+
// src/AppShell.tsx
|
|
8034
|
+
var AppShell = React47.forwardRef(function AppShell2(props, ref) {
|
|
7652
8035
|
const t = useStrings();
|
|
7653
8036
|
const bp = useBreakpoint();
|
|
7654
8037
|
const wide = bp === "lg" || bp === "xl";
|
|
7655
|
-
const st =
|
|
7656
|
-
|
|
8038
|
+
const st = React47.useState(false), open = st[0], setOpen = st[1];
|
|
8039
|
+
React47.useEffect(
|
|
7657
8040
|
function() {
|
|
7658
8041
|
if (wide) setOpen(false);
|
|
7659
8042
|
},
|
|
7660
8043
|
[wide]
|
|
7661
8044
|
);
|
|
7662
|
-
const navEl = props.nav &&
|
|
8045
|
+
const navEl = props.nav && React47.isValidElement(props.nav) ? props.nav : null;
|
|
7663
8046
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
7664
|
-
const navState =
|
|
8047
|
+
const navState = React47.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
7665
8048
|
function onNav(id) {
|
|
7666
8049
|
if (shared) navState[1](id);
|
|
7667
8050
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
7668
8051
|
}
|
|
7669
|
-
const rootRef =
|
|
7670
|
-
const barRef =
|
|
8052
|
+
const rootRef = React47.useRef(null);
|
|
8053
|
+
const barRef = React47.useRef(null);
|
|
7671
8054
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
7672
8055
|
const hasBar = !!(props.header || props.nav);
|
|
7673
|
-
const barH =
|
|
8056
|
+
const barH = React47.useState(null);
|
|
8057
|
+
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8058
|
+
const awayRef = React47.useRef(away);
|
|
8059
|
+
awayRef.current = away;
|
|
8060
|
+
useIsoLayoutEffect(
|
|
8061
|
+
function() {
|
|
8062
|
+
const root = rootRef.current, bar = barRef.current;
|
|
8063
|
+
if (!root || !bar) return;
|
|
8064
|
+
root.style.setProperty("--aura-shell-bar-height", away ? "0px" : bar.getBoundingClientRect().height + "px");
|
|
8065
|
+
},
|
|
8066
|
+
[away]
|
|
8067
|
+
);
|
|
7674
8068
|
useIsoLayoutEffect(
|
|
7675
8069
|
function() {
|
|
7676
8070
|
const root = rootRef.current, bar = barRef.current;
|
|
7677
8071
|
if (!root || !bar) return;
|
|
7678
8072
|
function sync() {
|
|
7679
|
-
const
|
|
7680
|
-
root.style.setProperty("--aura-shell-bar-height",
|
|
7681
|
-
if (
|
|
8073
|
+
const h11 = bar.getBoundingClientRect().height;
|
|
8074
|
+
root.style.setProperty("--aura-shell-bar-height", awayRef.current ? "0px" : h11 + "px");
|
|
8075
|
+
if (h11 > 0) barH[1](Math.round(h11));
|
|
7682
8076
|
}
|
|
7683
8077
|
sync();
|
|
7684
8078
|
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
@@ -7690,8 +8084,8 @@ window.Aura = (() => {
|
|
|
7690
8084
|
},
|
|
7691
8085
|
[hasBar]
|
|
7692
8086
|
);
|
|
7693
|
-
const deskNav = navEl && shared ?
|
|
7694
|
-
const drawerNav = navEl ?
|
|
8087
|
+
const deskNav = navEl && shared ? React47.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
8088
|
+
const drawerNav = navEl ? React47.cloneElement(navEl, {
|
|
7695
8089
|
value: shared ? navState[0] : navEl.props.value,
|
|
7696
8090
|
onChange: function(id) {
|
|
7697
8091
|
onNav(id);
|
|
@@ -7706,7 +8100,7 @@ window.Aura = (() => {
|
|
|
7706
8100
|
collapsed: false,
|
|
7707
8101
|
collapsible: false
|
|
7708
8102
|
}) : props.nav;
|
|
7709
|
-
return /* @__PURE__ */
|
|
8103
|
+
return /* @__PURE__ */ React47.createElement(
|
|
7710
8104
|
"div",
|
|
7711
8105
|
{
|
|
7712
8106
|
ref: mergedRef,
|
|
@@ -7721,8 +8115,8 @@ window.Aura = (() => {
|
|
|
7721
8115
|
props.className
|
|
7722
8116
|
)
|
|
7723
8117
|
},
|
|
7724
|
-
props.nav ? /* @__PURE__ */
|
|
7725
|
-
props.nav ? /* @__PURE__ */
|
|
8118
|
+
props.nav ? /* @__PURE__ */ React47.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8119
|
+
props.nav ? /* @__PURE__ */ React47.createElement(
|
|
7726
8120
|
Drawer,
|
|
7727
8121
|
{
|
|
7728
8122
|
open,
|
|
@@ -7739,20 +8133,22 @@ window.Aura = (() => {
|
|
|
7739
8133
|
},
|
|
7740
8134
|
drawerNav
|
|
7741
8135
|
) : null,
|
|
7742
|
-
/* @__PURE__ */
|
|
8136
|
+
/* @__PURE__ */ React47.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React47.createElement(
|
|
7743
8137
|
"header",
|
|
7744
8138
|
{
|
|
7745
8139
|
ref: barRef,
|
|
7746
8140
|
className: cx(
|
|
7747
8141
|
"aura-shell__bar",
|
|
7748
|
-
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only"
|
|
8142
|
+
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only",
|
|
8143
|
+
props.headerHideOnScroll && "aura-shell__bar--hides",
|
|
8144
|
+
away && "is-away"
|
|
7749
8145
|
)
|
|
7750
8146
|
},
|
|
7751
|
-
props.nav ? /* @__PURE__ */
|
|
8147
|
+
props.nav ? /* @__PURE__ */ React47.createElement(
|
|
7752
8148
|
IconButton,
|
|
7753
8149
|
{
|
|
7754
8150
|
className: "aura-shell__menu",
|
|
7755
|
-
icon: /* @__PURE__ */
|
|
8151
|
+
icon: /* @__PURE__ */ React47.createElement(IconMenu, null),
|
|
7756
8152
|
label: props.menuLabel || t.openNav,
|
|
7757
8153
|
size: "md",
|
|
7758
8154
|
onClick: function() {
|
|
@@ -7761,8 +8157,8 @@ window.Aura = (() => {
|
|
|
7761
8157
|
"aria-expanded": open
|
|
7762
8158
|
}
|
|
7763
8159
|
) : null,
|
|
7764
|
-
/* @__PURE__ */
|
|
7765
|
-
) : null, /* @__PURE__ */
|
|
8160
|
+
/* @__PURE__ */ React47.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8161
|
+
) : null, /* @__PURE__ */ React47.createElement(
|
|
7766
8162
|
"main",
|
|
7767
8163
|
{
|
|
7768
8164
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -7775,17 +8171,17 @@ window.Aura = (() => {
|
|
|
7775
8171
|
});
|
|
7776
8172
|
|
|
7777
8173
|
// src/ActionBar.tsx
|
|
7778
|
-
var
|
|
7779
|
-
var ActionBar =
|
|
8174
|
+
var React48 = __toESM(require_react(), 1);
|
|
8175
|
+
var ActionBar = React48.forwardRef(function ActionBar2(props, ref) {
|
|
7780
8176
|
const t = useStrings();
|
|
7781
8177
|
const bulk = props.selected != null;
|
|
7782
8178
|
const idle = bulk && !props.selected;
|
|
7783
8179
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
7784
|
-
const hasStart =
|
|
8180
|
+
const hasStart = React48.Children.toArray(props.start).some(function(c) {
|
|
7785
8181
|
return c !== "";
|
|
7786
8182
|
});
|
|
7787
|
-
const cameFrom =
|
|
7788
|
-
const own =
|
|
8183
|
+
const cameFrom = React48.useRef(null);
|
|
8184
|
+
const own = React48.useRef(null);
|
|
7789
8185
|
function clear() {
|
|
7790
8186
|
props.onClearSelection();
|
|
7791
8187
|
setTimeout(function() {
|
|
@@ -7794,7 +8190,7 @@ window.Aura = (() => {
|
|
|
7794
8190
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
7795
8191
|
}, 0);
|
|
7796
8192
|
}
|
|
7797
|
-
return /* @__PURE__ */
|
|
8193
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7798
8194
|
"div",
|
|
7799
8195
|
{
|
|
7800
8196
|
ref: function(el) {
|
|
@@ -7808,6 +8204,7 @@ window.Aura = (() => {
|
|
|
7808
8204
|
},
|
|
7809
8205
|
role: "region",
|
|
7810
8206
|
"aria-label": props.label || t.actions,
|
|
8207
|
+
"data-aura-hide-bottomnav": props.hidesBottomNav && !idle ? "" : void 0,
|
|
7811
8208
|
className: cx(
|
|
7812
8209
|
"aura-actionbar",
|
|
7813
8210
|
"aura-actionbar--" + (props.position || "viewport"),
|
|
@@ -7815,16 +8212,16 @@ window.Aura = (() => {
|
|
|
7815
8212
|
props.className
|
|
7816
8213
|
)
|
|
7817
8214
|
},
|
|
7818
|
-
/* @__PURE__ */
|
|
8215
|
+
/* @__PURE__ */ React48.createElement("div", { className: cx("aura-actionbar__inner", hasStart && "has-start") }, /* @__PURE__ */ React48.createElement("div", { className: "aura-actionbar__status", role: "status" }, count, count && props.status ? " \xB7 " : null, props.status), !idle && hasStart ? /* @__PURE__ */ React48.createElement("div", { className: "aura-actionbar__start" }, props.start) : null, !idle ? /* @__PURE__ */ React48.createElement("div", { className: "aura-actionbar__actions" }, count && props.onClearSelection ? /* @__PURE__ */ React48.createElement(Button, { variant: "ghost", size: "sm", touchHeight: props.touchHeight, onClick: clear }, t.clear()) : null, props.children) : null)
|
|
7819
8216
|
);
|
|
7820
8217
|
});
|
|
7821
8218
|
|
|
7822
8219
|
// src/Separator.tsx
|
|
7823
|
-
var
|
|
7824
|
-
var Separator =
|
|
8220
|
+
var React49 = __toESM(require_react(), 1);
|
|
8221
|
+
var Separator = React49.forwardRef(function Separator2(props, ref) {
|
|
7825
8222
|
const vertical = props.orientation === "vertical";
|
|
7826
8223
|
const decorative = props.decorative !== false;
|
|
7827
|
-
return /* @__PURE__ */
|
|
8224
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7828
8225
|
"div",
|
|
7829
8226
|
{
|
|
7830
8227
|
ref,
|
|
@@ -7837,14 +8234,14 @@ window.Aura = (() => {
|
|
|
7837
8234
|
});
|
|
7838
8235
|
|
|
7839
8236
|
// src/Table.tsx
|
|
7840
|
-
var
|
|
7841
|
-
var StackLabels =
|
|
7842
|
-
var ColumnIndex =
|
|
7843
|
-
function
|
|
8237
|
+
var React50 = __toESM(require_react(), 1);
|
|
8238
|
+
var StackLabels = React50.createContext(null);
|
|
8239
|
+
var ColumnIndex = React50.createContext(-1);
|
|
8240
|
+
function flat2(children) {
|
|
7844
8241
|
const out = [];
|
|
7845
|
-
|
|
7846
|
-
if (
|
|
7847
|
-
out.push.apply(out,
|
|
8242
|
+
React50.Children.toArray(children).forEach(function(c) {
|
|
8243
|
+
if (React50.isValidElement(c) && c.type === React50.Fragment)
|
|
8244
|
+
out.push.apply(out, flat2(c.props.children));
|
|
7848
8245
|
else out.push(c);
|
|
7849
8246
|
});
|
|
7850
8247
|
return out;
|
|
@@ -7857,7 +8254,7 @@ window.Aura = (() => {
|
|
|
7857
8254
|
});
|
|
7858
8255
|
return parts.length ? parts.join("") : void 0;
|
|
7859
8256
|
}
|
|
7860
|
-
if (
|
|
8257
|
+
if (React50.isValidElement(node)) {
|
|
7861
8258
|
const p = node.props;
|
|
7862
8259
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
7863
8260
|
return text(p.children);
|
|
@@ -7866,14 +8263,14 @@ window.Aura = (() => {
|
|
|
7866
8263
|
}
|
|
7867
8264
|
function headerLabels(children) {
|
|
7868
8265
|
let out = [];
|
|
7869
|
-
|
|
7870
|
-
if (out.length || !
|
|
7871
|
-
const row =
|
|
7872
|
-
return
|
|
8266
|
+
flat2(children).forEach(function(c) {
|
|
8267
|
+
if (out.length || !React50.isValidElement(c) || c.type !== THead) return;
|
|
8268
|
+
const row = flat2(c.props.children).find(function(r2) {
|
|
8269
|
+
return React50.isValidElement(r2);
|
|
7873
8270
|
});
|
|
7874
8271
|
if (!row) return;
|
|
7875
|
-
|
|
7876
|
-
if (!
|
|
8272
|
+
flat2(row.props.children).forEach(function(cell) {
|
|
8273
|
+
if (!React50.isValidElement(cell)) return;
|
|
7877
8274
|
const p = cell.props;
|
|
7878
8275
|
const t = text(p.children);
|
|
7879
8276
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -7883,7 +8280,7 @@ window.Aura = (() => {
|
|
|
7883
8280
|
});
|
|
7884
8281
|
return out;
|
|
7885
8282
|
}
|
|
7886
|
-
var Table =
|
|
8283
|
+
var Table = React50.forwardRef(function Table2(props, ref) {
|
|
7887
8284
|
const {
|
|
7888
8285
|
caption,
|
|
7889
8286
|
captionHidden,
|
|
@@ -7913,12 +8310,12 @@ window.Aura = (() => {
|
|
|
7913
8310
|
"tbl-stack-labels",
|
|
7914
8311
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
7915
8312
|
);
|
|
7916
|
-
const outer =
|
|
8313
|
+
const outer = React50.useContext(StackLabels);
|
|
7917
8314
|
const pageDensity = useDensity();
|
|
7918
8315
|
const capId = uid();
|
|
7919
|
-
const wrap =
|
|
7920
|
-
const sc =
|
|
7921
|
-
const wide =
|
|
8316
|
+
const wrap = React50.useRef(null);
|
|
8317
|
+
const sc = React50.useState(false), scrolls = sc[0];
|
|
8318
|
+
const wide = React50.useState(false);
|
|
7922
8319
|
useIsoLayoutEffect(function() {
|
|
7923
8320
|
const el = wrap.current;
|
|
7924
8321
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -7935,7 +8332,7 @@ window.Aura = (() => {
|
|
|
7935
8332
|
ro.disconnect();
|
|
7936
8333
|
};
|
|
7937
8334
|
}, []);
|
|
7938
|
-
const table = /* @__PURE__ */
|
|
8335
|
+
const table = /* @__PURE__ */ React50.createElement(
|
|
7939
8336
|
"div",
|
|
7940
8337
|
{
|
|
7941
8338
|
ref: wrap,
|
|
@@ -7959,7 +8356,7 @@ window.Aura = (() => {
|
|
|
7959
8356
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
7960
8357
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
7961
8358
|
},
|
|
7962
|
-
/* @__PURE__ */
|
|
8359
|
+
/* @__PURE__ */ React50.createElement(
|
|
7963
8360
|
"table",
|
|
7964
8361
|
{
|
|
7965
8362
|
ref,
|
|
@@ -7975,11 +8372,11 @@ window.Aura = (() => {
|
|
|
7975
8372
|
role: stackBelow ? "table" : void 0,
|
|
7976
8373
|
...rest
|
|
7977
8374
|
},
|
|
7978
|
-
caption != null ? /* @__PURE__ */
|
|
7979
|
-
labels ? /* @__PURE__ */
|
|
8375
|
+
caption != null ? /* @__PURE__ */ React50.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8376
|
+
labels ? /* @__PURE__ */ React50.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React50.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
7980
8377
|
)
|
|
7981
8378
|
);
|
|
7982
|
-
return cards ? /* @__PURE__ */
|
|
8379
|
+
return cards ? /* @__PURE__ */ React50.createElement(
|
|
7983
8380
|
"div",
|
|
7984
8381
|
{
|
|
7985
8382
|
className: cx(
|
|
@@ -7992,10 +8389,10 @@ window.Aura = (() => {
|
|
|
7992
8389
|
) : table;
|
|
7993
8390
|
});
|
|
7994
8391
|
function section(tag, cls) {
|
|
7995
|
-
const C =
|
|
8392
|
+
const C = React50.forwardRef(function TableSection(props, ref) {
|
|
7996
8393
|
const { className, ...rest } = props;
|
|
7997
|
-
const stacked =
|
|
7998
|
-
return
|
|
8394
|
+
const stacked = React50.useContext(StackLabels) != null;
|
|
8395
|
+
return React50.createElement(
|
|
7999
8396
|
tag,
|
|
8000
8397
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8001
8398
|
);
|
|
@@ -8008,14 +8405,14 @@ window.Aura = (() => {
|
|
|
8008
8405
|
TBody.displayName = "TBody";
|
|
8009
8406
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
8010
8407
|
TFoot.displayName = "TFoot";
|
|
8011
|
-
var Tr =
|
|
8408
|
+
var Tr = React50.forwardRef(function Tr2(props, ref) {
|
|
8012
8409
|
const { className, children, ...rest } = props;
|
|
8013
|
-
const stacked =
|
|
8410
|
+
const stacked = React50.useContext(StackLabels) != null;
|
|
8014
8411
|
let col = 0;
|
|
8015
|
-
return /* @__PURE__ */
|
|
8412
|
+
return /* @__PURE__ */ React50.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
8016
8413
|
const at = col;
|
|
8017
|
-
if (
|
|
8018
|
-
return /* @__PURE__ */
|
|
8414
|
+
if (React50.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8415
|
+
return /* @__PURE__ */ React50.createElement(ColumnIndex.Provider, { key: React50.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
8019
8416
|
}) : children);
|
|
8020
8417
|
});
|
|
8021
8418
|
function cellClass(base, p) {
|
|
@@ -8029,10 +8426,10 @@ window.Aura = (() => {
|
|
|
8029
8426
|
p.className
|
|
8030
8427
|
);
|
|
8031
8428
|
}
|
|
8032
|
-
var Th =
|
|
8429
|
+
var Th = React50.forwardRef(function Th2(props, ref) {
|
|
8033
8430
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8034
|
-
const stacked =
|
|
8035
|
-
return /* @__PURE__ */
|
|
8431
|
+
const stacked = React50.useContext(StackLabels) != null;
|
|
8432
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8036
8433
|
"th",
|
|
8037
8434
|
{
|
|
8038
8435
|
ref,
|
|
@@ -8044,12 +8441,12 @@ window.Aura = (() => {
|
|
|
8044
8441
|
}
|
|
8045
8442
|
);
|
|
8046
8443
|
});
|
|
8047
|
-
var Td =
|
|
8444
|
+
var Td = React50.forwardRef(function Td2(props, ref) {
|
|
8048
8445
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8049
|
-
const labels =
|
|
8446
|
+
const labels = React50.useContext(StackLabels), col = React50.useContext(ColumnIndex);
|
|
8050
8447
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8051
8448
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8052
|
-
return /* @__PURE__ */
|
|
8449
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8053
8450
|
"td",
|
|
8054
8451
|
{
|
|
8055
8452
|
ref,
|
|
@@ -8063,8 +8460,8 @@ window.Aura = (() => {
|
|
|
8063
8460
|
});
|
|
8064
8461
|
|
|
8065
8462
|
// src/BottomNav.tsx
|
|
8066
|
-
var
|
|
8067
|
-
var BottomNav =
|
|
8463
|
+
var React51 = __toESM(require_react(), 1);
|
|
8464
|
+
var BottomNav = React51.forwardRef(function BottomNav2(props, ref) {
|
|
8068
8465
|
const t = useStrings();
|
|
8069
8466
|
const Link = useLinkComponent(props.linkComponent);
|
|
8070
8467
|
const st = useMaybeControlled(
|
|
@@ -8074,14 +8471,36 @@ window.Aura = (() => {
|
|
|
8074
8471
|
);
|
|
8075
8472
|
const active = st[0];
|
|
8076
8473
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8077
|
-
|
|
8474
|
+
const own = React51.useRef(null);
|
|
8475
|
+
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
8476
|
+
const away = useHideOnScroll(
|
|
8477
|
+
!!props.hideOnScroll,
|
|
8478
|
+
own,
|
|
8479
|
+
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
8480
|
+
64
|
|
8481
|
+
);
|
|
8482
|
+
const setRef = React51.useCallback(
|
|
8483
|
+
function(el) {
|
|
8484
|
+
own.current = el;
|
|
8485
|
+
if (typeof ref === "function") ref(el);
|
|
8486
|
+
else if (ref) ref.current = el;
|
|
8487
|
+
},
|
|
8488
|
+
[ref]
|
|
8489
|
+
);
|
|
8490
|
+
return /* @__PURE__ */ React51.createElement(React51.Fragment, null, /* @__PURE__ */ React51.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide2), "aria-hidden": "true" }), /* @__PURE__ */ React51.createElement(
|
|
8078
8491
|
"nav",
|
|
8079
8492
|
{
|
|
8080
|
-
ref,
|
|
8081
|
-
className: cx(
|
|
8493
|
+
ref: setRef,
|
|
8494
|
+
className: cx(
|
|
8495
|
+
"aura-bottomnav",
|
|
8496
|
+
"aura-bottomnav--" + hide2,
|
|
8497
|
+
props.hideOnScroll && "aura-bottomnav--hides",
|
|
8498
|
+
away && "is-away",
|
|
8499
|
+
props.className
|
|
8500
|
+
),
|
|
8082
8501
|
"aria-label": props.label || t.mainNav
|
|
8083
8502
|
},
|
|
8084
|
-
/* @__PURE__ */
|
|
8503
|
+
/* @__PURE__ */ React51.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8085
8504
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8086
8505
|
devWarnOnce(
|
|
8087
8506
|
"bottomnav-label-" + it.id,
|
|
@@ -8102,23 +8521,23 @@ window.Aura = (() => {
|
|
|
8102
8521
|
}
|
|
8103
8522
|
};
|
|
8104
8523
|
const inner = [
|
|
8105
|
-
/* @__PURE__ */
|
|
8106
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8107
|
-
/* @__PURE__ */
|
|
8108
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
8524
|
+
/* @__PURE__ */ React51.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React51.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React51.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React51.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
8525
|
+
it.ariaLabel ? /* @__PURE__ */ React51.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
8526
|
+
/* @__PURE__ */ React51.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
8527
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React51.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8109
8528
|
];
|
|
8110
|
-
return /* @__PURE__ */
|
|
8529
|
+
return /* @__PURE__ */ React51.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React51.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React51.createElement("button", { type: "button", ...common }, inner));
|
|
8111
8530
|
}))
|
|
8112
8531
|
));
|
|
8113
8532
|
});
|
|
8114
8533
|
|
|
8115
8534
|
// src/Surface.tsx
|
|
8116
|
-
var
|
|
8117
|
-
var
|
|
8118
|
-
var Surface =
|
|
8535
|
+
var React52 = __toESM(require_react(), 1);
|
|
8536
|
+
var h10 = React52.createElement;
|
|
8537
|
+
var Surface = React52.forwardRef(function Surface2(props, ref) {
|
|
8119
8538
|
const t = props.texture || "mesh";
|
|
8120
8539
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8121
|
-
return
|
|
8540
|
+
return h10(
|
|
8122
8541
|
props.as || "div",
|
|
8123
8542
|
Object.assign({}, rest, {
|
|
8124
8543
|
ref,
|
|
@@ -8136,14 +8555,14 @@ window.Aura = (() => {
|
|
|
8136
8555
|
});
|
|
8137
8556
|
|
|
8138
8557
|
// src/Stat.tsx
|
|
8139
|
-
var
|
|
8140
|
-
var Stat =
|
|
8558
|
+
var React53 = __toESM(require_react(), 1);
|
|
8559
|
+
var Stat = React53.forwardRef(function Stat2(props, ref) {
|
|
8141
8560
|
const Link = useLinkComponent(props.linkComponent);
|
|
8142
8561
|
return statElement(props, ref, Link);
|
|
8143
8562
|
});
|
|
8144
8563
|
|
|
8145
8564
|
// src/TimePicker.tsx
|
|
8146
|
-
var
|
|
8565
|
+
var React54 = __toESM(require_react(), 1);
|
|
8147
8566
|
var import_react_dom12 = __toESM(require_react_dom(), 1);
|
|
8148
8567
|
|
|
8149
8568
|
// src/text.ts
|
|
@@ -8185,7 +8604,7 @@ window.Aura = (() => {
|
|
|
8185
8604
|
function fromMin(n3) {
|
|
8186
8605
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8187
8606
|
}
|
|
8188
|
-
var TimePicker =
|
|
8607
|
+
var TimePicker = React54.forwardRef(function TimePicker2(props, ref) {
|
|
8189
8608
|
const t = useStrings();
|
|
8190
8609
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8191
8610
|
const st = useMaybeControlled(
|
|
@@ -8195,7 +8614,7 @@ window.Aura = (() => {
|
|
|
8195
8614
|
);
|
|
8196
8615
|
const value = st[0];
|
|
8197
8616
|
const step = props.step || 30, lo = toMin(props.min) != null ? toMin(props.min) : 0, hi = toMin(props.max) != null ? toMin(props.max) : 24 * 60 - 1;
|
|
8198
|
-
const slots =
|
|
8617
|
+
const slots = React54.useMemo(
|
|
8199
8618
|
function() {
|
|
8200
8619
|
const out = [];
|
|
8201
8620
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8207,12 +8626,12 @@ window.Aura = (() => {
|
|
|
8207
8626
|
const n3 = toMin(v);
|
|
8208
8627
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8209
8628
|
}
|
|
8210
|
-
const openState =
|
|
8211
|
-
const editState =
|
|
8212
|
-
const aState =
|
|
8213
|
-
const errState =
|
|
8214
|
-
const pos =
|
|
8215
|
-
const boxRef =
|
|
8629
|
+
const openState = React54.useState(false), open = openState[0], setOpen = openState[1];
|
|
8630
|
+
const editState = React54.useState(null), editing = editState[0], setEditing = editState[1];
|
|
8631
|
+
const aState = React54.useState(0), active = aState[0], setActive = aState[1];
|
|
8632
|
+
const errState = React54.useState(null);
|
|
8633
|
+
const pos = React54.useState(null);
|
|
8634
|
+
const boxRef = React54.useRef(null), inputRef = React54.useRef(null), listRef = React54.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8216
8635
|
const mounted = useMounted();
|
|
8217
8636
|
function nearest(v) {
|
|
8218
8637
|
const n3 = toMin(v);
|
|
@@ -8225,13 +8644,13 @@ window.Aura = (() => {
|
|
|
8225
8644
|
}
|
|
8226
8645
|
function place2() {
|
|
8227
8646
|
if (!boxRef.current) return;
|
|
8228
|
-
const
|
|
8647
|
+
const r2 = boxRef.current.getBoundingClientRect(), below2 = window.innerHeight - r2.bottom - 8, up2 = below2 < 200 && r2.top > below2;
|
|
8229
8648
|
pos[1]({
|
|
8230
|
-
left:
|
|
8231
|
-
width: Math.max(
|
|
8232
|
-
top: up2 ? void 0 :
|
|
8233
|
-
bottom: up2 ? window.innerHeight -
|
|
8234
|
-
maxHeight: Math.min(280, (up2 ?
|
|
8649
|
+
left: r2.left,
|
|
8650
|
+
width: Math.max(r2.width, 160),
|
|
8651
|
+
top: up2 ? void 0 : r2.bottom + 4,
|
|
8652
|
+
bottom: up2 ? window.innerHeight - r2.top + 4 : void 0,
|
|
8653
|
+
maxHeight: Math.min(280, (up2 ? r2.top : below2) - 8)
|
|
8235
8654
|
});
|
|
8236
8655
|
}
|
|
8237
8656
|
useIsoLayoutEffect(
|
|
@@ -8240,7 +8659,7 @@ window.Aura = (() => {
|
|
|
8240
8659
|
},
|
|
8241
8660
|
[open]
|
|
8242
8661
|
);
|
|
8243
|
-
|
|
8662
|
+
React54.useEffect(
|
|
8244
8663
|
function() {
|
|
8245
8664
|
if (!open) return;
|
|
8246
8665
|
function outside(e) {
|
|
@@ -8262,7 +8681,7 @@ window.Aura = (() => {
|
|
|
8262
8681
|
},
|
|
8263
8682
|
[open]
|
|
8264
8683
|
);
|
|
8265
|
-
|
|
8684
|
+
React54.useEffect(
|
|
8266
8685
|
function() {
|
|
8267
8686
|
if (!open || !listRef.current) return;
|
|
8268
8687
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8361,9 +8780,9 @@ window.Aura = (() => {
|
|
|
8361
8780
|
}
|
|
8362
8781
|
const error = errState[0] || props.error;
|
|
8363
8782
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8364
|
-
/* @__PURE__ */
|
|
8783
|
+
/* @__PURE__ */ React54.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React54.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
8365
8784
|
const dis = blocked(s), sel = s === value;
|
|
8366
|
-
return /* @__PURE__ */
|
|
8785
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8367
8786
|
"li",
|
|
8368
8787
|
{
|
|
8369
8788
|
key: s,
|
|
@@ -8388,13 +8807,13 @@ window.Aura = (() => {
|
|
|
8388
8807
|
if (active !== i) setActive(i);
|
|
8389
8808
|
}
|
|
8390
8809
|
},
|
|
8391
|
-
/* @__PURE__ */
|
|
8392
|
-
sel ? /* @__PURE__ */
|
|
8810
|
+
/* @__PURE__ */ React54.createElement("span", { className: "aura-combo__label" }, s),
|
|
8811
|
+
sel ? /* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
8393
8812
|
);
|
|
8394
8813
|
}))),
|
|
8395
8814
|
document.body
|
|
8396
8815
|
) : null;
|
|
8397
|
-
return /* @__PURE__ */
|
|
8816
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8398
8817
|
Field,
|
|
8399
8818
|
{
|
|
8400
8819
|
id,
|
|
@@ -8406,7 +8825,7 @@ window.Aura = (() => {
|
|
|
8406
8825
|
disabled: props.disabled,
|
|
8407
8826
|
className: props.className
|
|
8408
8827
|
},
|
|
8409
|
-
/* @__PURE__ */
|
|
8828
|
+
/* @__PURE__ */ React54.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconClock, null), className: "aura-input__icon" }), /* @__PURE__ */ React54.createElement(
|
|
8410
8829
|
"input",
|
|
8411
8830
|
{
|
|
8412
8831
|
ref: inputMerged,
|
|
@@ -8446,7 +8865,7 @@ window.Aura = (() => {
|
|
|
8446
8865
|
}, 0);
|
|
8447
8866
|
}
|
|
8448
8867
|
}
|
|
8449
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
8868
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React54.createElement(
|
|
8450
8869
|
"button",
|
|
8451
8870
|
{
|
|
8452
8871
|
type: "button",
|
|
@@ -8459,8 +8878,8 @@ window.Aura = (() => {
|
|
|
8459
8878
|
if (inputRef.current) inputRef.current.focus();
|
|
8460
8879
|
}
|
|
8461
8880
|
},
|
|
8462
|
-
/* @__PURE__ */
|
|
8463
|
-
) : null, /* @__PURE__ */
|
|
8881
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconX, null) })
|
|
8882
|
+
) : null, /* @__PURE__ */ React54.createElement(
|
|
8464
8883
|
"button",
|
|
8465
8884
|
{
|
|
8466
8885
|
type: "button",
|
|
@@ -8478,14 +8897,14 @@ window.Aura = (() => {
|
|
|
8478
8897
|
}
|
|
8479
8898
|
}
|
|
8480
8899
|
},
|
|
8481
|
-
/* @__PURE__ */
|
|
8900
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconChevronDown, null) })
|
|
8482
8901
|
)),
|
|
8483
8902
|
list
|
|
8484
8903
|
);
|
|
8485
8904
|
});
|
|
8486
8905
|
|
|
8487
8906
|
// src/FileUpload.tsx
|
|
8488
|
-
var
|
|
8907
|
+
var React55 = __toESM(require_react(), 1);
|
|
8489
8908
|
function matches(file, accept) {
|
|
8490
8909
|
if (!accept) return true;
|
|
8491
8910
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -8509,24 +8928,24 @@ window.Aura = (() => {
|
|
|
8509
8928
|
}).join(", ");
|
|
8510
8929
|
}
|
|
8511
8930
|
var seq = 0;
|
|
8512
|
-
var FileUpload =
|
|
8931
|
+
var FileUpload = React55.forwardRef(function FileUpload2(props, ref) {
|
|
8513
8932
|
const t = useStrings();
|
|
8514
8933
|
const auto = uid(), id = props.id || auto;
|
|
8515
8934
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
8516
8935
|
const items2 = st[0] || [];
|
|
8517
|
-
const dragState =
|
|
8518
|
-
const inputRef =
|
|
8519
|
-
const urls =
|
|
8936
|
+
const dragState = React55.useState(false), over = dragState[0];
|
|
8937
|
+
const inputRef = React55.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8938
|
+
const urls = React55.useRef({});
|
|
8520
8939
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
8521
8940
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
8522
|
-
|
|
8941
|
+
React55.useEffect(function() {
|
|
8523
8942
|
return function() {
|
|
8524
8943
|
Object.keys(urls.current).forEach(function(k) {
|
|
8525
8944
|
URL.revokeObjectURL(urls.current[k]);
|
|
8526
8945
|
});
|
|
8527
8946
|
};
|
|
8528
8947
|
}, []);
|
|
8529
|
-
|
|
8948
|
+
React55.useEffect(
|
|
8530
8949
|
function() {
|
|
8531
8950
|
const el = inputRef.current;
|
|
8532
8951
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -8586,7 +9005,7 @@ window.Aura = (() => {
|
|
|
8586
9005
|
if (inputRef.current) inputRef.current.focus();
|
|
8587
9006
|
}
|
|
8588
9007
|
const error = props.error;
|
|
8589
|
-
return /* @__PURE__ */
|
|
9008
|
+
return /* @__PURE__ */ React55.createElement(
|
|
8590
9009
|
Field,
|
|
8591
9010
|
{
|
|
8592
9011
|
id,
|
|
@@ -8598,7 +9017,7 @@ window.Aura = (() => {
|
|
|
8598
9017
|
disabled: props.disabled,
|
|
8599
9018
|
className: props.className
|
|
8600
9019
|
},
|
|
8601
|
-
/* @__PURE__ */
|
|
9020
|
+
/* @__PURE__ */ React55.createElement(
|
|
8602
9021
|
"div",
|
|
8603
9022
|
{
|
|
8604
9023
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -8619,9 +9038,9 @@ window.Aura = (() => {
|
|
|
8619
9038
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
8620
9039
|
}
|
|
8621
9040
|
},
|
|
8622
|
-
/* @__PURE__ */
|
|
8623
|
-
/* @__PURE__ */
|
|
8624
|
-
/* @__PURE__ */
|
|
9041
|
+
/* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9042
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9043
|
+
/* @__PURE__ */ React55.createElement(
|
|
8625
9044
|
"input",
|
|
8626
9045
|
{
|
|
8627
9046
|
ref: inputMerged,
|
|
@@ -8643,12 +9062,12 @@ window.Aura = (() => {
|
|
|
8643
9062
|
}
|
|
8644
9063
|
}
|
|
8645
9064
|
),
|
|
8646
|
-
/* @__PURE__ */
|
|
8647
|
-
note ? /* @__PURE__ */
|
|
9065
|
+
/* @__PURE__ */ React55.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9066
|
+
note ? /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
8648
9067
|
),
|
|
8649
|
-
items2.length ? /* @__PURE__ */
|
|
9068
|
+
items2.length ? /* @__PURE__ */ React55.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
8650
9069
|
const src = thumb(it);
|
|
8651
|
-
return /* @__PURE__ */
|
|
9070
|
+
return /* @__PURE__ */ React55.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React55.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React55.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React55.createElement(IconImage, null) : /* @__PURE__ */ React55.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React55.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React55.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React55.createElement(React55.Fragment, null, /* @__PURE__ */ React55.createElement(Icon, { name: /* @__PURE__ */ React55.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React55.createElement(
|
|
8652
9071
|
"span",
|
|
8653
9072
|
{
|
|
8654
9073
|
className: "aura-upload__bar",
|
|
@@ -8658,11 +9077,11 @@ window.Aura = (() => {
|
|
|
8658
9077
|
"aria-valuemax": 100,
|
|
8659
9078
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
8660
9079
|
},
|
|
8661
|
-
/* @__PURE__ */
|
|
8662
|
-
) : null), /* @__PURE__ */
|
|
9080
|
+
/* @__PURE__ */ React55.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9081
|
+
) : null), /* @__PURE__ */ React55.createElement(
|
|
8663
9082
|
IconButton,
|
|
8664
9083
|
{
|
|
8665
|
-
icon: /* @__PURE__ */
|
|
9084
|
+
icon: /* @__PURE__ */ React55.createElement(IconX, null),
|
|
8666
9085
|
label: t.remove(it.name),
|
|
8667
9086
|
onClick: function() {
|
|
8668
9087
|
remove(it);
|
|
@@ -8675,14 +9094,14 @@ window.Aura = (() => {
|
|
|
8675
9094
|
|
|
8676
9095
|
// src/theme.ts
|
|
8677
9096
|
function hexToRgb(hex) {
|
|
8678
|
-
let
|
|
8679
|
-
if (
|
|
8680
|
-
|
|
9097
|
+
let h11 = String(hex).trim().replace("#", "");
|
|
9098
|
+
if (h11.length === 3)
|
|
9099
|
+
h11 = h11.split("").map(function(c) {
|
|
8681
9100
|
return c + c;
|
|
8682
9101
|
}).join("");
|
|
8683
|
-
if (!/^[0-9a-f]{6}$/i.test(
|
|
9102
|
+
if (!/^[0-9a-f]{6}$/i.test(h11)) throw new Error('createTheme: "' + hex + '" is not a #rgb or #rrggbb colour');
|
|
8684
9103
|
return [0, 2, 4].map(function(i) {
|
|
8685
|
-
return parseInt(
|
|
9104
|
+
return parseInt(h11.slice(i, i + 2), 16) / 255;
|
|
8686
9105
|
});
|
|
8687
9106
|
}
|
|
8688
9107
|
function rgbToHex(rgb) {
|
|
@@ -8698,10 +9117,10 @@ window.Aura = (() => {
|
|
|
8698
9117
|
return c <= 31308e-7 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
|
|
8699
9118
|
}
|
|
8700
9119
|
function rgbToOklch(rgb) {
|
|
8701
|
-
const
|
|
8702
|
-
const l = Math.cbrt(0.4122214708 *
|
|
8703
|
-
const m = Math.cbrt(0.2119034982 *
|
|
8704
|
-
const s = Math.cbrt(0.0883024619 *
|
|
9120
|
+
const r2 = lin(rgb[0]), g = lin(rgb[1]), b = lin(rgb[2]);
|
|
9121
|
+
const l = Math.cbrt(0.4122214708 * r2 + 0.5363325363 * g + 0.0514459929 * b);
|
|
9122
|
+
const m = Math.cbrt(0.2119034982 * r2 + 0.6806995451 * g + 0.1073969566 * b);
|
|
9123
|
+
const s = Math.cbrt(0.0883024619 * r2 + 0.2817188376 * g + 0.6299787005 * b);
|
|
8705
9124
|
const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
|
|
8706
9125
|
const A = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
|
|
8707
9126
|
const B = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
|
|
@@ -8861,13 +9280,13 @@ window.Aura = (() => {
|
|
|
8861
9280
|
D["card-shadow-creative"] = "8px 8px 0px " + shadowDark;
|
|
8862
9281
|
const checks = [];
|
|
8863
9282
|
function check(theme, fg, bg, target, fgHex, bgHex) {
|
|
8864
|
-
const
|
|
9283
|
+
const r2 = contrast(fgHex, bgHex);
|
|
8865
9284
|
checks.push({
|
|
8866
9285
|
theme,
|
|
8867
9286
|
pair: fg + " on " + bg,
|
|
8868
|
-
ratio: Math.round(
|
|
9287
|
+
ratio: Math.round(r2 * 100) / 100,
|
|
8869
9288
|
target,
|
|
8870
|
-
pass:
|
|
9289
|
+
pass: r2 >= target - 5e-3
|
|
8871
9290
|
});
|
|
8872
9291
|
}
|
|
8873
9292
|
[
|
|
@@ -8978,9 +9397,9 @@ window.Aura = (() => {
|
|
|
8978
9397
|
}
|
|
8979
9398
|
|
|
8980
9399
|
// src/ThemeStyle.tsx
|
|
8981
|
-
var
|
|
9400
|
+
var React56 = __toESM(require_react(), 1);
|
|
8982
9401
|
function ThemeStyle(props) {
|
|
8983
|
-
const css =
|
|
9402
|
+
const css = React56.useMemo(
|
|
8984
9403
|
function() {
|
|
8985
9404
|
try {
|
|
8986
9405
|
return createTheme({
|
|
@@ -8997,11 +9416,11 @@ window.Aura = (() => {
|
|
|
8997
9416
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
8998
9417
|
);
|
|
8999
9418
|
if (css === null) return null;
|
|
9000
|
-
return /* @__PURE__ */
|
|
9419
|
+
return /* @__PURE__ */ React56.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
9001
9420
|
}
|
|
9002
9421
|
|
|
9003
9422
|
// src/colorScheme.tsx
|
|
9004
|
-
var
|
|
9423
|
+
var React57 = __toESM(require_react(), 1);
|
|
9005
9424
|
|
|
9006
9425
|
// src/colorSchemeScript.ts
|
|
9007
9426
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9018,7 +9437,7 @@ window.Aura = (() => {
|
|
|
9018
9437
|
|
|
9019
9438
|
// src/colorScheme.tsx
|
|
9020
9439
|
function ColorSchemeScript(props) {
|
|
9021
|
-
return /* @__PURE__ */
|
|
9440
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9022
9441
|
"script",
|
|
9023
9442
|
{
|
|
9024
9443
|
"data-aura-color-scheme": "",
|
|
@@ -9043,7 +9462,7 @@ window.Aura = (() => {
|
|
|
9043
9462
|
function useColorScheme(options) {
|
|
9044
9463
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9045
9464
|
const fallback = options && options.defaultScheme || "system";
|
|
9046
|
-
const subscribe2 =
|
|
9465
|
+
const subscribe2 = React57.useCallback(
|
|
9047
9466
|
function(cb) {
|
|
9048
9467
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9049
9468
|
function onSystem() {
|
|
@@ -9065,7 +9484,7 @@ window.Aura = (() => {
|
|
|
9065
9484
|
},
|
|
9066
9485
|
[fallback, key]
|
|
9067
9486
|
);
|
|
9068
|
-
const snapshot =
|
|
9487
|
+
const snapshot = React57.useSyncExternalStore(
|
|
9069
9488
|
subscribe2,
|
|
9070
9489
|
function() {
|
|
9071
9490
|
const s = readScheme(fallback);
|
|
@@ -9076,7 +9495,7 @@ window.Aura = (() => {
|
|
|
9076
9495
|
}
|
|
9077
9496
|
);
|
|
9078
9497
|
const parts = snapshot.split("|");
|
|
9079
|
-
const setScheme =
|
|
9498
|
+
const setScheme = React57.useCallback(
|
|
9080
9499
|
function(next) {
|
|
9081
9500
|
if (!valid(next)) return;
|
|
9082
9501
|
try {
|
|
@@ -9095,14 +9514,14 @@ window.Aura = (() => {
|
|
|
9095
9514
|
const cs = useColorScheme(props);
|
|
9096
9515
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9097
9516
|
const label = props.label || t.colorScheme;
|
|
9098
|
-
return /* @__PURE__ */
|
|
9517
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9099
9518
|
DropdownMenu,
|
|
9100
9519
|
{
|
|
9101
9520
|
label,
|
|
9102
|
-
trigger: /* @__PURE__ */
|
|
9521
|
+
trigger: /* @__PURE__ */ React57.createElement(
|
|
9103
9522
|
IconButton,
|
|
9104
9523
|
{
|
|
9105
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9524
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React57.createElement(IconMoon, null) : /* @__PURE__ */ React57.createElement(IconSun, null),
|
|
9106
9525
|
label: label + ": " + names[cs.scheme]
|
|
9107
9526
|
}
|
|
9108
9527
|
),
|
|
@@ -9120,14 +9539,14 @@ window.Aura = (() => {
|
|
|
9120
9539
|
}
|
|
9121
9540
|
|
|
9122
9541
|
// src/Badge.tsx
|
|
9123
|
-
var
|
|
9124
|
-
var Badge =
|
|
9542
|
+
var React58 = __toESM(require_react(), 1);
|
|
9543
|
+
var Badge = React58.forwardRef(function Badge2(props, ref) {
|
|
9125
9544
|
return badgeElement(props, ref);
|
|
9126
9545
|
});
|
|
9127
9546
|
|
|
9128
9547
|
// src/Progress.tsx
|
|
9129
|
-
var
|
|
9130
|
-
var Progress =
|
|
9548
|
+
var React59 = __toESM(require_react(), 1);
|
|
9549
|
+
var Progress = React59.forwardRef(function Progress2(props, ref) {
|
|
9131
9550
|
const t = useStrings();
|
|
9132
9551
|
const auto = uid(), id = props.id || auto;
|
|
9133
9552
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9136,7 +9555,7 @@ window.Aura = (() => {
|
|
|
9136
9555
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9137
9556
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9138
9557
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9139
|
-
return /* @__PURE__ */
|
|
9558
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9140
9559
|
"div",
|
|
9141
9560
|
{
|
|
9142
9561
|
ref,
|
|
@@ -9147,8 +9566,8 @@ window.Aura = (() => {
|
|
|
9147
9566
|
props.className
|
|
9148
9567
|
)
|
|
9149
9568
|
},
|
|
9150
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9151
|
-
/* @__PURE__ */
|
|
9569
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React59.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React59.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React59.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React59.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
9570
|
+
/* @__PURE__ */ React59.createElement(
|
|
9152
9571
|
"div",
|
|
9153
9572
|
{
|
|
9154
9573
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9160,8 +9579,8 @@ window.Aura = (() => {
|
|
|
9160
9579
|
"aria-valuenow": det ? props.value : void 0,
|
|
9161
9580
|
"aria-valuetext": det ? valueText : void 0
|
|
9162
9581
|
},
|
|
9163
|
-
/* @__PURE__ */
|
|
9164
|
-
sec ? /* @__PURE__ */
|
|
9582
|
+
/* @__PURE__ */ React59.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9583
|
+
sec ? /* @__PURE__ */ React59.createElement(
|
|
9165
9584
|
"span",
|
|
9166
9585
|
{
|
|
9167
9586
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9169,19 +9588,19 @@ window.Aura = (() => {
|
|
|
9169
9588
|
}
|
|
9170
9589
|
) : null
|
|
9171
9590
|
),
|
|
9172
|
-
props.hint ? /* @__PURE__ */
|
|
9591
|
+
props.hint ? /* @__PURE__ */ React59.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9173
9592
|
);
|
|
9174
9593
|
});
|
|
9175
9594
|
|
|
9176
9595
|
// src/Skeleton.tsx
|
|
9177
|
-
var
|
|
9178
|
-
var Skeleton =
|
|
9596
|
+
var React60 = __toESM(require_react(), 1);
|
|
9597
|
+
var Skeleton = React60.forwardRef(function Skeleton2(props, ref) {
|
|
9179
9598
|
const v = props.variant || "text";
|
|
9180
9599
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9181
9600
|
const n3 = props.lines, rows = [];
|
|
9182
9601
|
for (let i = 0; i < n3; i++)
|
|
9183
|
-
rows.push(/* @__PURE__ */
|
|
9184
|
-
return /* @__PURE__ */
|
|
9602
|
+
rows.push(/* @__PURE__ */ React60.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
9603
|
+
return /* @__PURE__ */ React60.createElement(
|
|
9185
9604
|
"span",
|
|
9186
9605
|
{
|
|
9187
9606
|
ref,
|
|
@@ -9199,17 +9618,17 @@ window.Aura = (() => {
|
|
|
9199
9618
|
if (v === "circle") {
|
|
9200
9619
|
style.width = style.height = props.size || props.width || 40;
|
|
9201
9620
|
}
|
|
9202
|
-
return /* @__PURE__ */
|
|
9621
|
+
return /* @__PURE__ */ React60.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9203
9622
|
});
|
|
9204
9623
|
|
|
9205
9624
|
// src/EmptyState.tsx
|
|
9206
|
-
var
|
|
9207
|
-
var EmptyState =
|
|
9625
|
+
var React61 = __toESM(require_react(), 1);
|
|
9626
|
+
var EmptyState = React61.forwardRef(function EmptyState2(props, ref) {
|
|
9208
9627
|
return emptyStateElement(props, ref);
|
|
9209
9628
|
});
|
|
9210
9629
|
|
|
9211
9630
|
// src/Pagination.tsx
|
|
9212
|
-
var
|
|
9631
|
+
var React62 = __toESM(require_react(), 1);
|
|
9213
9632
|
function pageList(page, count, sib) {
|
|
9214
9633
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9215
9634
|
if (page - sib <= 3) {
|
|
@@ -9229,7 +9648,7 @@ window.Aura = (() => {
|
|
|
9229
9648
|
if (count > 1) out.push(count);
|
|
9230
9649
|
return out;
|
|
9231
9650
|
}
|
|
9232
|
-
var Pagination =
|
|
9651
|
+
var Pagination = React62.forwardRef(function Pagination2(props, ref) {
|
|
9233
9652
|
const t = useStrings();
|
|
9234
9653
|
useAutoTip();
|
|
9235
9654
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9249,7 +9668,7 @@ window.Aura = (() => {
|
|
|
9249
9668
|
},
|
|
9250
9669
|
extra
|
|
9251
9670
|
);
|
|
9252
|
-
return link ? /* @__PURE__ */
|
|
9671
|
+
return link ? /* @__PURE__ */ React62.createElement(
|
|
9253
9672
|
Link,
|
|
9254
9673
|
{
|
|
9255
9674
|
href: link(p),
|
|
@@ -9262,7 +9681,7 @@ window.Aura = (() => {
|
|
|
9262
9681
|
...common
|
|
9263
9682
|
},
|
|
9264
9683
|
label
|
|
9265
|
-
) : /* @__PURE__ */
|
|
9684
|
+
) : /* @__PURE__ */ React62.createElement(
|
|
9266
9685
|
"button",
|
|
9267
9686
|
{
|
|
9268
9687
|
type: "button",
|
|
@@ -9276,7 +9695,7 @@ window.Aura = (() => {
|
|
|
9276
9695
|
}
|
|
9277
9696
|
function arrow(p, icon, label, rel, disabled) {
|
|
9278
9697
|
if (!link || disabled)
|
|
9279
|
-
return /* @__PURE__ */
|
|
9698
|
+
return /* @__PURE__ */ React62.createElement(
|
|
9280
9699
|
IconButton,
|
|
9281
9700
|
{
|
|
9282
9701
|
icon,
|
|
@@ -9287,7 +9706,7 @@ window.Aura = (() => {
|
|
|
9287
9706
|
}
|
|
9288
9707
|
}
|
|
9289
9708
|
);
|
|
9290
|
-
return /* @__PURE__ */
|
|
9709
|
+
return /* @__PURE__ */ React62.createElement(
|
|
9291
9710
|
Link,
|
|
9292
9711
|
{
|
|
9293
9712
|
href: link(p),
|
|
@@ -9302,17 +9721,17 @@ window.Aura = (() => {
|
|
|
9302
9721
|
}
|
|
9303
9722
|
}
|
|
9304
9723
|
},
|
|
9305
|
-
/* @__PURE__ */
|
|
9724
|
+
/* @__PURE__ */ React62.createElement(Icon, { name: icon, size: "sm" })
|
|
9306
9725
|
);
|
|
9307
9726
|
}
|
|
9308
|
-
return /* @__PURE__ */
|
|
9309
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9310
|
-
})), /* @__PURE__ */
|
|
9727
|
+
return /* @__PURE__ */ React62.createElement("nav", { ref, className: cx("aura-pagination", props.className), "aria-label": props.label || t.pagination }, arrow(page - 1, /* @__PURE__ */ React62.createElement(IconChevronLeft, null), t.prevPage, "prev", page <= 1), /* @__PURE__ */ React62.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
9728
|
+
return typeof p === "number" ? /* @__PURE__ */ React62.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React62.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
9729
|
+
})), /* @__PURE__ */ React62.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React62.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
|
|
9311
9730
|
});
|
|
9312
9731
|
|
|
9313
9732
|
// src/Accordion.tsx
|
|
9314
|
-
var
|
|
9315
|
-
var Accordion =
|
|
9733
|
+
var React63 = __toESM(require_react(), 1);
|
|
9734
|
+
var Accordion = React63.forwardRef(function Accordion2(props, ref) {
|
|
9316
9735
|
const auto = uid(), base = props.id || auto;
|
|
9317
9736
|
const multiple = props.type === "multiple";
|
|
9318
9737
|
const st = useMaybeControlled(
|
|
@@ -9350,9 +9769,9 @@ window.Aura = (() => {
|
|
|
9350
9769
|
n3.focus();
|
|
9351
9770
|
}
|
|
9352
9771
|
}
|
|
9353
|
-
return /* @__PURE__ */
|
|
9772
|
+
return /* @__PURE__ */ React63.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9354
9773
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9355
|
-
return /* @__PURE__ */
|
|
9774
|
+
return /* @__PURE__ */ React63.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React63.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React63.createElement(
|
|
9356
9775
|
"button",
|
|
9357
9776
|
{
|
|
9358
9777
|
type: "button",
|
|
@@ -9365,10 +9784,10 @@ window.Aura = (() => {
|
|
|
9365
9784
|
toggle(it.id);
|
|
9366
9785
|
}
|
|
9367
9786
|
},
|
|
9368
|
-
it.icon ? /* @__PURE__ */
|
|
9369
|
-
/* @__PURE__ */
|
|
9370
|
-
/* @__PURE__ */
|
|
9371
|
-
)), /* @__PURE__ */
|
|
9787
|
+
it.icon ? /* @__PURE__ */ React63.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
9788
|
+
/* @__PURE__ */ React63.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React63.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React63.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
|
|
9789
|
+
/* @__PURE__ */ React63.createElement(Icon, { name: /* @__PURE__ */ React63.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
9790
|
+
)), /* @__PURE__ */ React63.createElement(
|
|
9372
9791
|
"div",
|
|
9373
9792
|
{
|
|
9374
9793
|
id: pid,
|
|
@@ -9383,33 +9802,33 @@ window.Aura = (() => {
|
|
|
9383
9802
|
});
|
|
9384
9803
|
|
|
9385
9804
|
// src/Popover.tsx
|
|
9386
|
-
var
|
|
9805
|
+
var React64 = __toESM(require_react(), 1);
|
|
9387
9806
|
var import_react_dom13 = __toESM(require_react_dom(), 1);
|
|
9388
9807
|
function position(anchor, pop, placement) {
|
|
9389
|
-
const
|
|
9808
|
+
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
9390
9809
|
let side = (placement || "bottom-start").split("-")[0], align = (placement || "bottom-start").split("-")[1] || "start";
|
|
9391
|
-
if (side === "bottom" &&
|
|
9392
|
-
else if (side === "top" &&
|
|
9393
|
-
const below2 = vh -
|
|
9810
|
+
if (side === "bottom" && r2.bottom + gap + ph > vh - 8 && r2.top - gap - ph > 8) side = "top";
|
|
9811
|
+
else if (side === "top" && r2.top - gap - ph < 8 && r2.bottom + gap + ph < vh - 8) side = "bottom";
|
|
9812
|
+
const below2 = vh - r2.bottom - gap - 8, above = r2.top - gap - 8;
|
|
9394
9813
|
let maxHeight;
|
|
9395
9814
|
if (ph > below2 && ph > above) {
|
|
9396
9815
|
side = above > below2 ? "top" : "bottom";
|
|
9397
9816
|
maxHeight = Math.max(120, side === "top" ? above : below2);
|
|
9398
9817
|
}
|
|
9399
|
-
const
|
|
9400
|
-
const top = side === "top" ?
|
|
9401
|
-
const left = align === "end" ?
|
|
9818
|
+
const h11 = maxHeight ? Math.min(ph, maxHeight) : ph;
|
|
9819
|
+
const top = side === "top" ? r2.top - gap - h11 : r2.bottom + gap;
|
|
9820
|
+
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
9402
9821
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
9403
9822
|
}
|
|
9404
|
-
var Popover =
|
|
9823
|
+
var Popover = React64.forwardRef(function Popover2(props, ref) {
|
|
9405
9824
|
const t = useStrings();
|
|
9406
9825
|
const density = useDensity();
|
|
9407
9826
|
const auto = uid(), id = props.id || auto;
|
|
9408
9827
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
9409
9828
|
const open = !!st[0];
|
|
9410
|
-
const wrap =
|
|
9411
|
-
const pos =
|
|
9412
|
-
const inTree =
|
|
9829
|
+
const wrap = React64.useRef(null), pop = React64.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
9830
|
+
const pos = React64.useState(null), mounted = useMounted();
|
|
9831
|
+
const inTree = React64.useRef(false);
|
|
9413
9832
|
function trigger() {
|
|
9414
9833
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
9415
9834
|
}
|
|
@@ -9436,7 +9855,7 @@ window.Aura = (() => {
|
|
|
9436
9855
|
},
|
|
9437
9856
|
[open, mounted, props.placement]
|
|
9438
9857
|
);
|
|
9439
|
-
|
|
9858
|
+
React64.useEffect(
|
|
9440
9859
|
function() {
|
|
9441
9860
|
if (!open || !mounted) return;
|
|
9442
9861
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -9461,9 +9880,9 @@ window.Aura = (() => {
|
|
|
9461
9880
|
},
|
|
9462
9881
|
[open, mounted]
|
|
9463
9882
|
);
|
|
9464
|
-
const child =
|
|
9883
|
+
const child = React64.Children.only(props.trigger);
|
|
9465
9884
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
9466
|
-
/* @__PURE__ */
|
|
9885
|
+
/* @__PURE__ */ React64.createElement(
|
|
9467
9886
|
"div",
|
|
9468
9887
|
{
|
|
9469
9888
|
ref: popMerged,
|
|
@@ -9493,17 +9912,17 @@ window.Aura = (() => {
|
|
|
9493
9912
|
} else trapTab(e, pop.current);
|
|
9494
9913
|
}
|
|
9495
9914
|
},
|
|
9496
|
-
props.title ? /* @__PURE__ */
|
|
9915
|
+
props.title ? /* @__PURE__ */ React64.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React64.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React64.createElement(
|
|
9497
9916
|
IconButton,
|
|
9498
9917
|
{
|
|
9499
|
-
icon: /* @__PURE__ */
|
|
9918
|
+
icon: /* @__PURE__ */ React64.createElement(IconX, null),
|
|
9500
9919
|
label: t.close,
|
|
9501
9920
|
onClick: function() {
|
|
9502
9921
|
close(true);
|
|
9503
9922
|
}
|
|
9504
9923
|
}
|
|
9505
9924
|
)) : null,
|
|
9506
|
-
/* @__PURE__ */
|
|
9925
|
+
/* @__PURE__ */ React64.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
9507
9926
|
close: function() {
|
|
9508
9927
|
close(true);
|
|
9509
9928
|
}
|
|
@@ -9511,7 +9930,7 @@ window.Aura = (() => {
|
|
|
9511
9930
|
),
|
|
9512
9931
|
document.body
|
|
9513
9932
|
) : null;
|
|
9514
|
-
return /* @__PURE__ */
|
|
9933
|
+
return /* @__PURE__ */ React64.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React64.cloneElement(child, {
|
|
9515
9934
|
onClick: function(e) {
|
|
9516
9935
|
if (child.props.onClick) child.props.onClick(e);
|
|
9517
9936
|
st[1](!open);
|
|
@@ -9523,7 +9942,7 @@ window.Aura = (() => {
|
|
|
9523
9942
|
});
|
|
9524
9943
|
|
|
9525
9944
|
// src/NumberField.tsx
|
|
9526
|
-
var
|
|
9945
|
+
var React65 = __toESM(require_react(), 1);
|
|
9527
9946
|
function decimalsOf(n3) {
|
|
9528
9947
|
const s = String(n3);
|
|
9529
9948
|
const i = s.indexOf(".");
|
|
@@ -9536,7 +9955,7 @@ window.Aura = (() => {
|
|
|
9536
9955
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
9537
9956
|
return Number(s);
|
|
9538
9957
|
}
|
|
9539
|
-
var NumberField =
|
|
9958
|
+
var NumberField = React65.forwardRef(function NumberField2(props, ref) {
|
|
9540
9959
|
const t = useStrings();
|
|
9541
9960
|
const auto = uid(), id = props.id || auto;
|
|
9542
9961
|
const step = props.step || 1;
|
|
@@ -9547,7 +9966,7 @@ window.Aura = (() => {
|
|
|
9547
9966
|
props.onChange
|
|
9548
9967
|
);
|
|
9549
9968
|
const value = st[0], setValue = st[1];
|
|
9550
|
-
const draftState =
|
|
9969
|
+
const draftState = React65.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
9551
9970
|
function fmt2(n3) {
|
|
9552
9971
|
if (n3 == null || isNaN(n3)) return "";
|
|
9553
9972
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -9596,7 +10015,7 @@ window.Aura = (() => {
|
|
|
9596
10015
|
};
|
|
9597
10016
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
9598
10017
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
9599
|
-
return /* @__PURE__ */
|
|
10018
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9600
10019
|
Field,
|
|
9601
10020
|
{
|
|
9602
10021
|
id,
|
|
@@ -9608,7 +10027,7 @@ window.Aura = (() => {
|
|
|
9608
10027
|
disabled: props.disabled,
|
|
9609
10028
|
className: props.className
|
|
9610
10029
|
},
|
|
9611
|
-
/* @__PURE__ */
|
|
10030
|
+
/* @__PURE__ */ React65.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React65.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React65.createElement(
|
|
9612
10031
|
"input",
|
|
9613
10032
|
{
|
|
9614
10033
|
ref,
|
|
@@ -9655,7 +10074,7 @@ window.Aura = (() => {
|
|
|
9655
10074
|
},
|
|
9656
10075
|
onKeyDown
|
|
9657
10076
|
}
|
|
9658
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10077
|
+
), props.suffix != null ? /* @__PURE__ */ React65.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React65.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React65.createElement(
|
|
9659
10078
|
"button",
|
|
9660
10079
|
{
|
|
9661
10080
|
type: "button",
|
|
@@ -9671,8 +10090,8 @@ window.Aura = (() => {
|
|
|
9671
10090
|
nudge(-step);
|
|
9672
10091
|
}
|
|
9673
10092
|
},
|
|
9674
|
-
/* @__PURE__ */
|
|
9675
|
-
), /* @__PURE__ */
|
|
10093
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: /* @__PURE__ */ React65.createElement(IconMinus, null) })
|
|
10094
|
+
), /* @__PURE__ */ React65.createElement(
|
|
9676
10095
|
"button",
|
|
9677
10096
|
{
|
|
9678
10097
|
type: "button",
|
|
@@ -9688,14 +10107,14 @@ window.Aura = (() => {
|
|
|
9688
10107
|
nudge(step);
|
|
9689
10108
|
}
|
|
9690
10109
|
},
|
|
9691
|
-
/* @__PURE__ */
|
|
10110
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: /* @__PURE__ */ React65.createElement(IconPlus, null) })
|
|
9692
10111
|
)) : null)
|
|
9693
10112
|
);
|
|
9694
10113
|
});
|
|
9695
10114
|
|
|
9696
10115
|
// src/Stepper.tsx
|
|
9697
|
-
var
|
|
9698
|
-
var Stepper =
|
|
10116
|
+
var React66 = __toESM(require_react(), 1);
|
|
10117
|
+
var Stepper = React66.forwardRef(function Stepper2(props, ref) {
|
|
9699
10118
|
const t = useStrings();
|
|
9700
10119
|
const idBase = uid();
|
|
9701
10120
|
const steps = props.steps || [];
|
|
@@ -9706,22 +10125,22 @@ window.Aura = (() => {
|
|
|
9706
10125
|
if (at < 0) at = 0;
|
|
9707
10126
|
const vertical = props.orientation === "vertical";
|
|
9708
10127
|
const cur2 = steps[at];
|
|
9709
|
-
return /* @__PURE__ */
|
|
10128
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9710
10129
|
"nav",
|
|
9711
10130
|
{
|
|
9712
10131
|
ref,
|
|
9713
10132
|
"aria-label": props.label,
|
|
9714
10133
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
9715
10134
|
},
|
|
9716
|
-
/* @__PURE__ */
|
|
10135
|
+
/* @__PURE__ */ React66.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
9717
10136
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
9718
10137
|
const error = s.status === "error";
|
|
9719
|
-
const marker = /* @__PURE__ */
|
|
10138
|
+
const marker = /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconCheck, null) }) : i + 1);
|
|
9720
10139
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
9721
10140
|
const clickable = state === "done" && !!props.onStepClick;
|
|
9722
10141
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
9723
10142
|
const descId = idBase + "-step-" + i;
|
|
9724
|
-
const text2 = /* @__PURE__ */
|
|
10143
|
+
const text2 = /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React66.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React66.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React66.createElement(
|
|
9725
10144
|
"span",
|
|
9726
10145
|
{
|
|
9727
10146
|
className: "aura-stepper__desc",
|
|
@@ -9730,14 +10149,14 @@ window.Aura = (() => {
|
|
|
9730
10149
|
},
|
|
9731
10150
|
s.description
|
|
9732
10151
|
) : null);
|
|
9733
|
-
return /* @__PURE__ */
|
|
10152
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9734
10153
|
"li",
|
|
9735
10154
|
{
|
|
9736
10155
|
key: s.id,
|
|
9737
10156
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
9738
10157
|
"aria-current": state === "current" ? "step" : void 0
|
|
9739
10158
|
},
|
|
9740
|
-
clickable ? /* @__PURE__ */
|
|
10159
|
+
clickable ? /* @__PURE__ */ React66.createElement(
|
|
9741
10160
|
"button",
|
|
9742
10161
|
{
|
|
9743
10162
|
type: "button",
|
|
@@ -9749,19 +10168,19 @@ window.Aura = (() => {
|
|
|
9749
10168
|
},
|
|
9750
10169
|
marker,
|
|
9751
10170
|
text2
|
|
9752
|
-
) : /* @__PURE__ */
|
|
10171
|
+
) : /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
9753
10172
|
);
|
|
9754
10173
|
})),
|
|
9755
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10174
|
+
!vertical && cur2 ? /* @__PURE__ */ React66.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React66.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
|
|
9756
10175
|
);
|
|
9757
10176
|
});
|
|
9758
10177
|
|
|
9759
10178
|
// src/SegmentedControl.tsx
|
|
9760
|
-
var
|
|
10179
|
+
var React67 = __toESM(require_react(), 1);
|
|
9761
10180
|
function toOpt2(o) {
|
|
9762
10181
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
9763
10182
|
}
|
|
9764
|
-
var SegmentedControl =
|
|
10183
|
+
var SegmentedControl = React67.forwardRef(
|
|
9765
10184
|
function SegmentedControl2(props, ref) {
|
|
9766
10185
|
const options = (props.options || []).map(toOpt2);
|
|
9767
10186
|
useAutoTip();
|
|
@@ -9775,7 +10194,7 @@ window.Aura = (() => {
|
|
|
9775
10194
|
);
|
|
9776
10195
|
const value = st[0], setValue = st[1];
|
|
9777
10196
|
const auto = uid(), id = props.id || auto;
|
|
9778
|
-
const refs =
|
|
10197
|
+
const refs = React67.useRef([]);
|
|
9779
10198
|
const selIdx = options.findIndex(function(o) {
|
|
9780
10199
|
return o.value === value;
|
|
9781
10200
|
});
|
|
@@ -9808,7 +10227,7 @@ window.Aura = (() => {
|
|
|
9808
10227
|
move(options.length, -1);
|
|
9809
10228
|
}
|
|
9810
10229
|
}
|
|
9811
|
-
return /* @__PURE__ */
|
|
10230
|
+
return /* @__PURE__ */ React67.createElement(
|
|
9812
10231
|
"div",
|
|
9813
10232
|
{
|
|
9814
10233
|
ref,
|
|
@@ -9827,7 +10246,7 @@ window.Aura = (() => {
|
|
|
9827
10246
|
options.map(function(o, i) {
|
|
9828
10247
|
const on = o.value === value;
|
|
9829
10248
|
const off = props.disabled || o.disabled;
|
|
9830
|
-
return /* @__PURE__ */
|
|
10249
|
+
return /* @__PURE__ */ React67.createElement(
|
|
9831
10250
|
"button",
|
|
9832
10251
|
{
|
|
9833
10252
|
key: o.value,
|
|
@@ -9849,8 +10268,8 @@ window.Aura = (() => {
|
|
|
9849
10268
|
onKeyDown(e, i);
|
|
9850
10269
|
}
|
|
9851
10270
|
},
|
|
9852
|
-
o.icon ? /* @__PURE__ */
|
|
9853
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10271
|
+
o.icon ? /* @__PURE__ */ React67.createElement(Icon, { name: o.icon }) : null,
|
|
10272
|
+
o.iconOnly ? null : /* @__PURE__ */ React67.createElement("span", null, o.label)
|
|
9854
10273
|
);
|
|
9855
10274
|
})
|
|
9856
10275
|
);
|