@jirawatpyk/aura-react 5.32.0 → 5.34.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 +17 -2
- package/dist/aura.bundle.js +710 -414
- package/dist/cjs/index.cjs +709 -413
- package/dist/esm/AppShell.js +33 -14
- package/dist/esm/PageHeader.js +1 -0
- 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/strings.js +4 -0
- package/dist/esm/strings.sv.js +4 -0
- package/dist/esm/strings.th.js +4 -0
- package/dist/esm/tiles.js +212 -0
- package/dist/index.d.cts +119 -36
- package/dist/index.d.ts +119 -36
- package/dist/locales/sv.cjs +4 -0
- package/dist/locales/sv.d.cts +5 -0
- package/dist/locales/sv.d.ts +5 -0
- package/dist/locales/th.cjs +4 -0
- package/dist/locales/th.d.cts +5 -0
- package/dist/locales/th.d.ts +5 -0
- package/dist/server/index.cjs +264 -27
- package/dist/server/index.d.cts +79 -0
- package/dist/server/index.d.ts +79 -0
- package/dist/server/index.js +264 -27
- package/dist/styles.css +103 -24
- package/dist/styles.layer.css +103 -24
- 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,15 @@ 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",
|
|
937
952
|
accepts: function(list, max) {
|
|
938
953
|
return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
|
|
939
954
|
}
|
|
@@ -1060,11 +1075,15 @@ window.Aura = (() => {
|
|
|
1060
1075
|
pageN: function(p) {
|
|
1061
1076
|
return "Sida " + p;
|
|
1062
1077
|
},
|
|
1063
|
-
progressReserved: function(v,
|
|
1064
|
-
return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(
|
|
1078
|
+
progressReserved: function(v, r2, max) {
|
|
1079
|
+
return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(r2) + " reserverade";
|
|
1065
1080
|
},
|
|
1066
1081
|
breadcrumbMore: "Visa hela s\xF6kv\xE4gen",
|
|
1067
1082
|
stepError: "har fel",
|
|
1083
|
+
statusDown: "Nere",
|
|
1084
|
+
statusProblem: "Problem",
|
|
1085
|
+
statusMaintenance: "Underh\xE5ll",
|
|
1086
|
+
statusOk: "OK",
|
|
1068
1087
|
accepts: function(list, max) {
|
|
1069
1088
|
return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
|
|
1070
1089
|
}
|
|
@@ -1192,11 +1211,15 @@ window.Aura = (() => {
|
|
|
1192
1211
|
pageN: function(p) {
|
|
1193
1212
|
return "Page " + p;
|
|
1194
1213
|
},
|
|
1195
|
-
progressReserved: function(v,
|
|
1196
|
-
return n2(v) + " of " + n2(max) + " used, " + n2(
|
|
1214
|
+
progressReserved: function(v, r2, max) {
|
|
1215
|
+
return n2(v) + " of " + n2(max) + " used, " + n2(r2) + " reserved";
|
|
1197
1216
|
},
|
|
1198
1217
|
breadcrumbMore: "Show the full path",
|
|
1199
1218
|
stepError: "has errors",
|
|
1219
|
+
statusDown: "Down",
|
|
1220
|
+
statusProblem: "Problem",
|
|
1221
|
+
statusMaintenance: "Maintenance",
|
|
1222
|
+
statusOk: "OK",
|
|
1200
1223
|
accepts: function(list, max) {
|
|
1201
1224
|
return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
|
|
1202
1225
|
}
|
|
@@ -1368,6 +1391,11 @@ window.Aura = (() => {
|
|
|
1368
1391
|
const tag = el.closest(".aura-tag");
|
|
1369
1392
|
if (tag) s = tag.querySelector(".aura-tag__text[" + ATTR + "]");
|
|
1370
1393
|
}
|
|
1394
|
+
if (!s) {
|
|
1395
|
+
const tile = el.closest(".aura-status-tile");
|
|
1396
|
+
const control = el.closest("a, button, input, select, textarea, [tabindex]");
|
|
1397
|
+
if (tile && (!control || control === tile)) s = tile.querySelector(".aura-status-tile__title[" + ATTR + "]");
|
|
1398
|
+
}
|
|
1371
1399
|
if (!s || !s.getAttribute(ATTR) || !s.isConnected) return null;
|
|
1372
1400
|
if (s.getAttribute("aria-expanded") === "true") return null;
|
|
1373
1401
|
return s;
|
|
@@ -1378,11 +1406,11 @@ window.Aura = (() => {
|
|
|
1378
1406
|
hide();
|
|
1379
1407
|
return;
|
|
1380
1408
|
}
|
|
1381
|
-
const
|
|
1382
|
-
let top =
|
|
1383
|
-
if (top < m &&
|
|
1409
|
+
const r2 = cur.getBoundingClientRect(), t = tip.getBoundingClientRect(), vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
1410
|
+
let top = r2.top - t.height - gap;
|
|
1411
|
+
if (top < m && r2.bottom + gap + t.height <= vh - m) top = r2.bottom + gap;
|
|
1384
1412
|
top = Math.max(m, Math.min(top, vh - t.height - m));
|
|
1385
|
-
const left = Math.max(m, Math.min(
|
|
1413
|
+
const left = Math.max(m, Math.min(r2.left + r2.width / 2 - t.width / 2, vw - t.width - m));
|
|
1386
1414
|
tip.style.top = top + "px";
|
|
1387
1415
|
tip.style.left = left + "px";
|
|
1388
1416
|
}
|
|
@@ -1556,9 +1584,9 @@ window.Aura = (() => {
|
|
|
1556
1584
|
}
|
|
1557
1585
|
function inView(el) {
|
|
1558
1586
|
if (!el.isConnected) return false;
|
|
1559
|
-
const
|
|
1560
|
-
if (
|
|
1561
|
-
let top =
|
|
1587
|
+
const r2 = el.getBoundingClientRect();
|
|
1588
|
+
if (r2.width === 0 && r2.height === 0) return false;
|
|
1589
|
+
let top = r2.top, bottom = r2.bottom, left = r2.left, right = r2.right;
|
|
1562
1590
|
let pos = getComputedStyle(el).position;
|
|
1563
1591
|
for (let p = el.parentElement; p && p !== document.body && p !== document.documentElement; p = p.parentElement) {
|
|
1564
1592
|
const s = getComputedStyle(p);
|
|
@@ -1596,16 +1624,16 @@ window.Aura = (() => {
|
|
|
1596
1624
|
function place2() {
|
|
1597
1625
|
const a = props.anchor, m = own.current;
|
|
1598
1626
|
if (!a || !m) return;
|
|
1599
|
-
const
|
|
1600
|
-
let top =
|
|
1627
|
+
const r2 = a.getBoundingClientRect(), mh = m.scrollHeight, mw = m.offsetWidth, below2 = window.innerHeight - r2.bottom - 12, above = r2.top - 12;
|
|
1628
|
+
let top = r2.bottom + 4, maxHeight;
|
|
1601
1629
|
if (mh > below2) {
|
|
1602
|
-
if (mh <= above) top =
|
|
1630
|
+
if (mh <= above) top = r2.top - mh - 4;
|
|
1603
1631
|
else if (above > below2) {
|
|
1604
1632
|
maxHeight = above;
|
|
1605
|
-
top =
|
|
1633
|
+
top = r2.top - above - 4;
|
|
1606
1634
|
} else maxHeight = below2;
|
|
1607
1635
|
}
|
|
1608
|
-
const left = Math.max(8, Math.min(
|
|
1636
|
+
const left = Math.max(8, Math.min(r2.right - mw, window.innerWidth - mw - 8));
|
|
1609
1637
|
setPos(function(p) {
|
|
1610
1638
|
return p && p.top === top && p.left === left && p.maxHeight === maxHeight ? p : { top, left, maxHeight };
|
|
1611
1639
|
});
|
|
@@ -2069,9 +2097,9 @@ window.Aura = (() => {
|
|
|
2069
2097
|
"size"
|
|
2070
2098
|
]);
|
|
2071
2099
|
function pick(o, keys) {
|
|
2072
|
-
const
|
|
2073
|
-
for (const k of keys) if (k in o)
|
|
2074
|
-
return
|
|
2100
|
+
const r2 = {};
|
|
2101
|
+
for (const k of keys) if (k in o) r2[k] = o[k];
|
|
2102
|
+
return r2;
|
|
2075
2103
|
}
|
|
2076
2104
|
function readItems(el) {
|
|
2077
2105
|
if (!el) return [];
|
|
@@ -2370,15 +2398,15 @@ window.Aura = (() => {
|
|
|
2370
2398
|
function place2() {
|
|
2371
2399
|
const t = trigRef.current && trigRef.current.parentElement;
|
|
2372
2400
|
if (!t) return;
|
|
2373
|
-
const
|
|
2374
|
-
const lw = listRef.current ? Math.max(
|
|
2401
|
+
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;
|
|
2402
|
+
const lw = listRef.current ? Math.max(r2.width, listRef.current.offsetWidth) : r2.width;
|
|
2375
2403
|
const rtl = getComputedStyle(t).direction === "rtl";
|
|
2376
|
-
const left = lw <=
|
|
2404
|
+
const left = lw <= r2.width ? r2.left : Math.max(8, Math.min(rtl ? r2.right - lw : r2.left, window.innerWidth - lw - 8));
|
|
2377
2405
|
pos[1]({
|
|
2378
2406
|
left,
|
|
2379
|
-
width:
|
|
2380
|
-
top: up2 ? void 0 :
|
|
2381
|
-
bottom: up2 ? window.innerHeight -
|
|
2407
|
+
width: r2.width,
|
|
2408
|
+
top: up2 ? void 0 : r2.bottom + 4,
|
|
2409
|
+
bottom: up2 ? window.innerHeight - r2.top + 4 : void 0,
|
|
2382
2410
|
maxHeight: Math.min(320, (up2 ? above : below2) - 4),
|
|
2383
2411
|
rtl
|
|
2384
2412
|
});
|
|
@@ -2573,10 +2601,10 @@ window.Aura = (() => {
|
|
|
2573
2601
|
"aria-label": labelledBy ? void 0 : rest["aria-label"],
|
|
2574
2602
|
className: "aura-combo__list"
|
|
2575
2603
|
},
|
|
2576
|
-
runs.map(function(
|
|
2577
|
-
if (
|
|
2604
|
+
runs.map(function(r2, n3) {
|
|
2605
|
+
if (r2.group === null) return /* @__PURE__ */ React16.createElement(React16.Fragment, { key: "r" + n3 }, r2.items.map(option));
|
|
2578
2606
|
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" },
|
|
2607
|
+
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
2608
|
})
|
|
2581
2609
|
)
|
|
2582
2610
|
),
|
|
@@ -3158,10 +3186,10 @@ window.Aura = (() => {
|
|
|
3158
3186
|
const pos = React18.useState(null), popRef = React18.useRef(null), mounted = useMounted();
|
|
3159
3187
|
function place2() {
|
|
3160
3188
|
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 -
|
|
3189
|
+
const el = popRef.current, r2 = boxRef.current.getBoundingClientRect(), W = el ? el.offsetWidth : 320, H = el ? el.offsetHeight : 380;
|
|
3190
|
+
const up2 = window.innerHeight - r2.bottom < H + 12 && r2.top > H + 12;
|
|
3191
|
+
const left = Math.max(8, Math.min(r2.left, window.innerWidth - W - 8));
|
|
3192
|
+
pos[1](up2 ? { left, bottom: window.innerHeight - r2.top + 4 } : { left, top: r2.bottom + 4 });
|
|
3165
3193
|
}
|
|
3166
3194
|
useIsoLayoutEffect(
|
|
3167
3195
|
function() {
|
|
@@ -3407,10 +3435,10 @@ window.Aura = (() => {
|
|
|
3407
3435
|
isDateDisabled: props.isDateDisabled
|
|
3408
3436
|
};
|
|
3409
3437
|
const o = { locale, calendar };
|
|
3410
|
-
function show3(
|
|
3411
|
-
if (!
|
|
3412
|
-
if (!
|
|
3413
|
-
return formatDate(
|
|
3438
|
+
function show3(r2) {
|
|
3439
|
+
if (!r2.start) return "";
|
|
3440
|
+
if (!r2.end) return formatDate(r2.start, o) + " \u2013";
|
|
3441
|
+
return formatDate(r2.start, o) + " \u2013 " + formatDate(r2.end, o);
|
|
3414
3442
|
}
|
|
3415
3443
|
const bad = React18.useState(null);
|
|
3416
3444
|
React18.useEffect(
|
|
@@ -3550,8 +3578,8 @@ window.Aura = (() => {
|
|
|
3550
3578
|
draft[1](null);
|
|
3551
3579
|
if (faceRef.current) faceRef.current.focus();
|
|
3552
3580
|
}
|
|
3553
|
-
function choose(
|
|
3554
|
-
if (
|
|
3581
|
+
function choose(r2) {
|
|
3582
|
+
if (r2.start !== raw.start || r2.end !== raw.end) st[1](r2);
|
|
3555
3583
|
close();
|
|
3556
3584
|
}
|
|
3557
3585
|
function pick2(iso) {
|
|
@@ -3565,12 +3593,12 @@ window.Aura = (() => {
|
|
|
3565
3593
|
}
|
|
3566
3594
|
const isAny = !v.start || !v.end;
|
|
3567
3595
|
const own = props["aria-label"] || void 0;
|
|
3568
|
-
const
|
|
3596
|
+
const attrs2 = {};
|
|
3569
3597
|
Object.keys(props).forEach(function(k) {
|
|
3570
3598
|
if (k === "style" || /^(aria|data)-/.test(k) && k !== "aria-label")
|
|
3571
|
-
|
|
3599
|
+
attrs2[k] = props[k];
|
|
3572
3600
|
});
|
|
3573
|
-
const presetBtn = function(label,
|
|
3601
|
+
const presetBtn = function(label, r2, on, key) {
|
|
3574
3602
|
return /* @__PURE__ */ React19.createElement(
|
|
3575
3603
|
Button,
|
|
3576
3604
|
{
|
|
@@ -3578,11 +3606,11 @@ window.Aura = (() => {
|
|
|
3578
3606
|
size: "sm",
|
|
3579
3607
|
variant: "ghost",
|
|
3580
3608
|
touchHeight: true,
|
|
3581
|
-
disabled: !!
|
|
3609
|
+
disabled: !!r2.start && !!r2.end && !(allowedDate(r2.start, limits) && allowedDate(r2.end, limits)),
|
|
3582
3610
|
className: cx("aura-filterdate__preset", on && "is-selected"),
|
|
3583
3611
|
"aria-pressed": on,
|
|
3584
3612
|
onClick: function() {
|
|
3585
|
-
choose(
|
|
3613
|
+
choose(r2);
|
|
3586
3614
|
}
|
|
3587
3615
|
},
|
|
3588
3616
|
label
|
|
@@ -3647,7 +3675,7 @@ window.Aura = (() => {
|
|
|
3647
3675
|
/* @__PURE__ */ React19.createElement(
|
|
3648
3676
|
"button",
|
|
3649
3677
|
{
|
|
3650
|
-
...
|
|
3678
|
+
...attrs2,
|
|
3651
3679
|
ref: setFace,
|
|
3652
3680
|
id,
|
|
3653
3681
|
type: "button",
|
|
@@ -3685,8 +3713,8 @@ window.Aura = (() => {
|
|
|
3685
3713
|
function(el) {
|
|
3686
3714
|
if (el)
|
|
3687
3715
|
el.focus = function(opts) {
|
|
3688
|
-
const
|
|
3689
|
-
if (
|
|
3716
|
+
const r2 = el.querySelector('input[type="radio"]:checked') || el.querySelector('input[type="radio"]:not(:disabled)');
|
|
3717
|
+
if (r2) r2.focus(opts);
|
|
3690
3718
|
};
|
|
3691
3719
|
if (typeof ref === "function") ref(el);
|
|
3692
3720
|
else if (ref) ref.current = el;
|
|
@@ -3852,14 +3880,14 @@ window.Aura = (() => {
|
|
|
3852
3880
|
}) : -1 : Math.min(active, shown.length - 1);
|
|
3853
3881
|
function place2() {
|
|
3854
3882
|
if (!boxRef.current) return;
|
|
3855
|
-
const
|
|
3856
|
-
const maxH = 320, below2 = window.innerHeight -
|
|
3883
|
+
const r2 = boxRef.current.getBoundingClientRect();
|
|
3884
|
+
const maxH = 320, below2 = window.innerHeight - r2.bottom - 8, up2 = below2 < 200 && r2.top > below2;
|
|
3857
3885
|
posState[1]({
|
|
3858
|
-
left:
|
|
3859
|
-
width:
|
|
3860
|
-
top: up2 ? void 0 :
|
|
3861
|
-
bottom: up2 ? window.innerHeight -
|
|
3862
|
-
maxHeight: Math.min(maxH, (up2 ?
|
|
3886
|
+
left: r2.left,
|
|
3887
|
+
width: r2.width,
|
|
3888
|
+
top: up2 ? void 0 : r2.bottom + 4,
|
|
3889
|
+
bottom: up2 ? window.innerHeight - r2.top + 4 : void 0,
|
|
3890
|
+
maxHeight: Math.min(maxH, (up2 ? r2.top : below2) - 8)
|
|
3863
3891
|
});
|
|
3864
3892
|
}
|
|
3865
3893
|
useIsoLayoutEffect(
|
|
@@ -4696,13 +4724,13 @@ window.Aura = (() => {
|
|
|
4696
4724
|
}, []);
|
|
4697
4725
|
function place2() {
|
|
4698
4726
|
if (!anchor.current || !tip2.current) return;
|
|
4699
|
-
const
|
|
4727
|
+
const r2 = anchor.current.getBoundingClientRect(), t = tip2.current.getBoundingClientRect();
|
|
4700
4728
|
const vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
4701
4729
|
let side = props.side || "top";
|
|
4702
|
-
if (side === "top" &&
|
|
4703
|
-
else if (side === "bottom" &&
|
|
4704
|
-
else if (side === "left" &&
|
|
4705
|
-
else if (side === "right" &&
|
|
4730
|
+
if (side === "top" && r2.top - t.height - gap < m && r2.bottom + gap + t.height <= vh - m) side = "bottom";
|
|
4731
|
+
else if (side === "bottom" && r2.bottom + gap + t.height > vh - m && r2.top - t.height - gap >= m) side = "top";
|
|
4732
|
+
else if (side === "left" && r2.left - t.width - gap < m && r2.right + gap + t.width <= vw - m) side = "right";
|
|
4733
|
+
else if (side === "right" && r2.right + gap + t.width > vw - m && r2.left - t.width - gap >= m) side = "left";
|
|
4706
4734
|
const clampX = function(x) {
|
|
4707
4735
|
return Math.max(m, Math.min(x, vw - t.width - m));
|
|
4708
4736
|
};
|
|
@@ -4711,12 +4739,12 @@ window.Aura = (() => {
|
|
|
4711
4739
|
};
|
|
4712
4740
|
let top, left;
|
|
4713
4741
|
if (side === "top" || side === "bottom") {
|
|
4714
|
-
top = clampY(side === "top" ?
|
|
4715
|
-
left = clampX(
|
|
4742
|
+
top = clampY(side === "top" ? r2.top - t.height - gap : r2.bottom + gap);
|
|
4743
|
+
left = clampX(r2.left + r2.width / 2 - t.width / 2);
|
|
4716
4744
|
} else {
|
|
4717
|
-
left = side === "left" ?
|
|
4745
|
+
left = side === "left" ? r2.left - t.width - gap : r2.right + gap;
|
|
4718
4746
|
left = clampX(left);
|
|
4719
|
-
top = clampY(
|
|
4747
|
+
top = clampY(r2.top + r2.height / 2 - t.height / 2);
|
|
4720
4748
|
}
|
|
4721
4749
|
pos[1]({ top, left });
|
|
4722
4750
|
}
|
|
@@ -5137,18 +5165,18 @@ window.Aura = (() => {
|
|
|
5137
5165
|
if (!g) groups.push(g = { name, items: [] });
|
|
5138
5166
|
g.items.push(it);
|
|
5139
5167
|
});
|
|
5140
|
-
const
|
|
5168
|
+
const flat3 = [];
|
|
5141
5169
|
groups.forEach(function(g) {
|
|
5142
5170
|
g.items.forEach(function(it) {
|
|
5143
|
-
|
|
5171
|
+
flat3.push(it);
|
|
5144
5172
|
});
|
|
5145
5173
|
});
|
|
5146
|
-
const enabled =
|
|
5174
|
+
const enabled = flat3.map(function(it, i2) {
|
|
5147
5175
|
return it.disabled ? -1 : i2;
|
|
5148
5176
|
}).filter(function(i2) {
|
|
5149
5177
|
return i2 >= 0;
|
|
5150
5178
|
});
|
|
5151
|
-
const byId = act[0] == null ? -1 :
|
|
5179
|
+
const byId = act[0] == null ? -1 : flat3.findIndex(function(it) {
|
|
5152
5180
|
return it.id === act[0];
|
|
5153
5181
|
});
|
|
5154
5182
|
const active = enabled.indexOf(byId) >= 0 ? byId : enabled.length ? enabled[0] : -1;
|
|
@@ -5176,7 +5204,7 @@ window.Aura = (() => {
|
|
|
5176
5204
|
if (dir === "first") n3 = 0;
|
|
5177
5205
|
else if (dir === "last") n3 = enabled.length - 1;
|
|
5178
5206
|
else n3 = (at + dir + enabled.length) % enabled.length;
|
|
5179
|
-
act[1](
|
|
5207
|
+
act[1](flat3[enabled[n3]].id);
|
|
5180
5208
|
}
|
|
5181
5209
|
function onKey(e) {
|
|
5182
5210
|
if (e.key === "ArrowDown") {
|
|
@@ -5194,7 +5222,7 @@ window.Aura = (() => {
|
|
|
5194
5222
|
} else if (e.key === "Enter") {
|
|
5195
5223
|
if (e.nativeEvent.isComposing || e.keyCode === 229) return;
|
|
5196
5224
|
e.preventDefault();
|
|
5197
|
-
if (active >= 0) run(
|
|
5225
|
+
if (active >= 0) run(flat3[active]);
|
|
5198
5226
|
}
|
|
5199
5227
|
}
|
|
5200
5228
|
if (!modal.ready) return null;
|
|
@@ -5228,8 +5256,8 @@ window.Aura = (() => {
|
|
|
5228
5256
|
"data-autofocus": "",
|
|
5229
5257
|
type: "text",
|
|
5230
5258
|
role: "combobox",
|
|
5231
|
-
"aria-expanded":
|
|
5232
|
-
"aria-controls":
|
|
5259
|
+
"aria-expanded": flat3.length > 0,
|
|
5260
|
+
"aria-controls": flat3.length ? listId : void 0,
|
|
5233
5261
|
"aria-autocomplete": "list",
|
|
5234
5262
|
"aria-activedescendant": active >= 0 ? optId(active) : void 0,
|
|
5235
5263
|
"aria-label": props.label || t.commandMenu,
|
|
@@ -5245,7 +5273,7 @@ window.Aura = (() => {
|
|
|
5245
5273
|
onKeyDown: onKey
|
|
5246
5274
|
}
|
|
5247
5275
|
), /* @__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, !
|
|
5276
|
+
/* @__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
5277
|
"div",
|
|
5250
5278
|
{
|
|
5251
5279
|
id: listId,
|
|
@@ -5299,7 +5327,7 @@ window.Aura = (() => {
|
|
|
5299
5327
|
);
|
|
5300
5328
|
})
|
|
5301
5329
|
)),
|
|
5302
|
-
/* @__PURE__ */ React31.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !
|
|
5330
|
+
/* @__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
5331
|
/* @__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
5332
|
)
|
|
5305
5333
|
),
|
|
@@ -5546,13 +5574,13 @@ window.Aura = (() => {
|
|
|
5546
5574
|
const selState = useMaybeControlled(props.selected, props.defaultSelected || [], null);
|
|
5547
5575
|
const onSel = React33.useRef(props.onSelectionChange);
|
|
5548
5576
|
onSel.current = props.onSelectionChange;
|
|
5549
|
-
const canSelect = function(
|
|
5550
|
-
return !!
|
|
5577
|
+
const canSelect = function(r2) {
|
|
5578
|
+
return !!r2 && (!props.isRowSelectable || !!props.isRowSelectable(r2));
|
|
5551
5579
|
};
|
|
5552
5580
|
const rejected = {};
|
|
5553
5581
|
if (props.isRowSelectable)
|
|
5554
|
-
rows.forEach(function(
|
|
5555
|
-
if (!canSelect(
|
|
5582
|
+
rows.forEach(function(r2) {
|
|
5583
|
+
if (!canSelect(r2)) rejected[String(r2[rowKey])] = true;
|
|
5556
5584
|
});
|
|
5557
5585
|
const selected = selState[0].filter(function(k) {
|
|
5558
5586
|
return !rejected[String(k)];
|
|
@@ -5697,8 +5725,8 @@ window.Aura = (() => {
|
|
|
5697
5725
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
5698
5726
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
5699
5727
|
return setTip(null);
|
|
5700
|
-
const
|
|
5701
|
-
setTip({ text: (el.textContent || "").trim(), left:
|
|
5728
|
+
const r2 = el.getBoundingClientRect();
|
|
5729
|
+
setTip({ text: (el.textContent || "").trim(), left: r2.left, top: r2.top });
|
|
5702
5730
|
}
|
|
5703
5731
|
function hideFull() {
|
|
5704
5732
|
setTip(null);
|
|
@@ -5843,14 +5871,14 @@ window.Aura = (() => {
|
|
|
5843
5871
|
function() {
|
|
5844
5872
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
5845
5873
|
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
|
|
5874
|
+
const val = col.sortValue || (col.pill ? function(r2) {
|
|
5875
|
+
return TONE_ORDER[col.tones && col.tones[r2[col.key]] || toneFor(r2[col.key])];
|
|
5876
|
+
} : function(r2) {
|
|
5877
|
+
return r2[col.key];
|
|
5850
5878
|
});
|
|
5851
5879
|
const dir = sort.dir === "desc" ? -1 : 1;
|
|
5852
|
-
return rows.map(function(
|
|
5853
|
-
return [
|
|
5880
|
+
return rows.map(function(r2, i) {
|
|
5881
|
+
return [r2, i];
|
|
5854
5882
|
}).sort(function(a, b) {
|
|
5855
5883
|
return compare(val(a[0]), val(b[0])) * dir || a[1] - b[1];
|
|
5856
5884
|
}).map(function(p) {
|
|
@@ -5948,8 +5976,8 @@ window.Aura = (() => {
|
|
|
5948
5976
|
})
|
|
5949
5977
|
);
|
|
5950
5978
|
}
|
|
5951
|
-
function rowLinkWrap(
|
|
5952
|
-
return rowHref ? /* @__PURE__ */ React33.createElement(Link, { href: rowHref(
|
|
5979
|
+
function rowLinkWrap(r2, content) {
|
|
5980
|
+
return rowHref ? /* @__PURE__ */ React33.createElement(Link, { href: rowHref(r2), className: "aura-table__row-link" }, content) : content;
|
|
5953
5981
|
}
|
|
5954
5982
|
const height = props.height || 0;
|
|
5955
5983
|
const autoRows = props.rowHeight === "auto" && !height;
|
|
@@ -6004,9 +6032,9 @@ window.Aura = (() => {
|
|
|
6004
6032
|
},
|
|
6005
6033
|
[stacked]
|
|
6006
6034
|
);
|
|
6007
|
-
function tabFor(
|
|
6008
|
-
if (!activeRendered) return
|
|
6009
|
-
return
|
|
6035
|
+
function tabFor(r2, c) {
|
|
6036
|
+
if (!activeRendered) return r2 === 0 && c === ac ? 0 : -1;
|
|
6037
|
+
return r2 === ar && c === acShown ? 0 : -1;
|
|
6010
6038
|
}
|
|
6011
6039
|
React33.useEffect(function() {
|
|
6012
6040
|
const p = pending.current;
|
|
@@ -6030,38 +6058,38 @@ window.Aura = (() => {
|
|
|
6030
6058
|
el.focus();
|
|
6031
6059
|
}
|
|
6032
6060
|
});
|
|
6033
|
-
function focusCell(
|
|
6034
|
-
|
|
6061
|
+
function focusCell(r2, c, dir) {
|
|
6062
|
+
r2 = Math.max(0, Math.min(r2, lastR));
|
|
6035
6063
|
c = Math.max(0, Math.min(c, nCols - 1));
|
|
6036
|
-
if (stacked &&
|
|
6037
|
-
if (gridRef.current && (
|
|
6064
|
+
if (stacked && r2 === 0 && nRows > 0 && (!(selectable && c === 0) || noCardSel)) r2 = 1;
|
|
6065
|
+
if (gridRef.current && (r2 === T && hasTotal || stacked)) {
|
|
6038
6066
|
const shown2 = function(cc) {
|
|
6039
6067
|
if (cardHidden[cc]) return false;
|
|
6040
|
-
const e = gridRef.current.querySelector('[data-rc="' +
|
|
6068
|
+
const e = gridRef.current.querySelector('[data-rc="' + r2 + ":" + cc + '"]');
|
|
6041
6069
|
return !!e && e.getClientRects().length > 0;
|
|
6042
6070
|
};
|
|
6043
6071
|
c = nearestShown(c, dir || 1, shown2);
|
|
6044
6072
|
}
|
|
6045
|
-
activeState[1]({ r, c });
|
|
6046
|
-
pending.current = { r, c };
|
|
6047
|
-
if (virtual && hasTotal &&
|
|
6073
|
+
activeState[1]({ r: r2, c });
|
|
6074
|
+
pending.current = { r: r2, c };
|
|
6075
|
+
if (virtual && hasTotal && r2 === T && !props.stickyFooter) {
|
|
6048
6076
|
const sc = scrollRef.current;
|
|
6049
6077
|
sc.scrollTop = sc.scrollHeight;
|
|
6050
6078
|
setScrollTop(sc.scrollTop);
|
|
6051
|
-
} else if (virtual &&
|
|
6052
|
-
const sc = scrollRef.current, top = (
|
|
6079
|
+
} else if (virtual && r2 > 0 && r2 <= nRows) {
|
|
6080
|
+
const sc = scrollRef.current, top = (r2 - 1) * ROW_H;
|
|
6053
6081
|
if (top < sc.scrollTop) sc.scrollTop = top;
|
|
6054
6082
|
else if (top + ROW_H > sc.scrollTop + bodyH) sc.scrollTop = top + ROW_H - bodyH;
|
|
6055
6083
|
setScrollTop(sc.scrollTop);
|
|
6056
6084
|
}
|
|
6057
|
-
const el = gridRef.current && gridRef.current.querySelector('[data-rc="' +
|
|
6085
|
+
const el = gridRef.current && gridRef.current.querySelector('[data-rc="' + r2 + ":" + c + '"]');
|
|
6058
6086
|
if (el) {
|
|
6059
6087
|
pending.current = null;
|
|
6060
6088
|
el.focus();
|
|
6061
6089
|
}
|
|
6062
6090
|
}
|
|
6063
|
-
const pageKeys = pageRows.filter(canSelect).map(function(
|
|
6064
|
-
return
|
|
6091
|
+
const pageKeys = pageRows.filter(canSelect).map(function(r2) {
|
|
6092
|
+
return r2[rowKey];
|
|
6065
6093
|
});
|
|
6066
6094
|
const selSet = {};
|
|
6067
6095
|
selected.forEach(function(k) {
|
|
@@ -6319,51 +6347,51 @@ window.Aura = (() => {
|
|
|
6319
6347
|
}
|
|
6320
6348
|
return;
|
|
6321
6349
|
}
|
|
6322
|
-
const p = rc.split(":"),
|
|
6323
|
-
const row =
|
|
6350
|
+
const p = rc.split(":"), r2 = +p[0], c = +p[1], k = e.key, col = colAt(c);
|
|
6351
|
+
const row = r2 > 0 && r2 <= nRows ? pageRows[r2 - 1] : null, isTotal = hasTotal && r2 === T;
|
|
6324
6352
|
let handled = true;
|
|
6325
|
-
if (
|
|
6353
|
+
if (r2 === 0 && col && e.altKey && (k === "ArrowLeft" || k === "ArrowRight") && canResize(col))
|
|
6326
6354
|
setW(col, widthOf(col) + (k === "ArrowLeft" ? -1 : 1) * (e.shiftKey ? 48 : 16), true);
|
|
6327
|
-
else if (
|
|
6355
|
+
else if (r2 === 0 && col && e.ctrlKey && e.shiftKey && (k === "ArrowLeft" || k === "ArrowRight") && reorderable) {
|
|
6328
6356
|
if (moveCol(col.key, k === "ArrowLeft" ? -1 : 1)) pending.current = { r: 0, key: col.key, c };
|
|
6329
|
-
} else if (
|
|
6357
|
+
} else if (r2 === 0 && col && (e.altKey && k === "ArrowDown" || k === "ContextMenu" || e.shiftKey && k === "F10") && controls)
|
|
6330
6358
|
openMenu("col", col.key, target, { r: 0, c });
|
|
6331
|
-
else if (k === "ArrowRight") focusCell(
|
|
6332
|
-
else if (k === "ArrowLeft") focusCell(
|
|
6359
|
+
else if (k === "ArrowRight") focusCell(r2, c + 1);
|
|
6360
|
+
else if (k === "ArrowLeft") focusCell(r2, c - 1, -1);
|
|
6333
6361
|
else if (k === "ArrowDown") {
|
|
6334
|
-
if (
|
|
6362
|
+
if (r2 < lastR) focusCell(r2 + 1, c);
|
|
6335
6363
|
else if (pageSize && page < pageCount && goPage(page + 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
6336
6364
|
} 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 :
|
|
6365
|
+
if (r2 > 1 || r2 === 1 && !(pageSize && page > 1)) focusCell(r2 - 1, c);
|
|
6366
|
+
else if (r2 === 1 && goPage(page - 1, { r: pageSize, c })) activeState[1]({ r: pageSize, c });
|
|
6367
|
+
} else if (k === "Home") focusCell(e.ctrlKey ? 1 : r2, 0);
|
|
6368
|
+
else if (k === "End") focusCell(e.ctrlKey ? lastR : r2, nCols - 1, -1);
|
|
6341
6369
|
else if (k === "PageDown") {
|
|
6342
6370
|
if (pageSize) {
|
|
6343
6371
|
if (goPage(page + 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
6344
|
-
} else focusCell(Math.min(lastR,
|
|
6372
|
+
} else focusCell(Math.min(lastR, r2 + visibleRows), c);
|
|
6345
6373
|
} else if (k === "PageUp") {
|
|
6346
6374
|
if (pageSize) {
|
|
6347
6375
|
if (goPage(page - 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
6348
|
-
} else focusCell(Math.max(1,
|
|
6376
|
+
} else focusCell(Math.max(1, r2 - visibleRows), c);
|
|
6349
6377
|
} else if (isTotal && (k === " " || k === "Enter" || k === "F2")) {
|
|
6350
6378
|
handled = false;
|
|
6351
|
-
} else if (k === "F2" &&
|
|
6379
|
+
} else if (k === "F2" && r2 > 0) {
|
|
6352
6380
|
const inner = target.querySelector("button, a[href], input, select, textarea");
|
|
6353
6381
|
if (inner) inner.focus();
|
|
6354
6382
|
else handled = false;
|
|
6355
6383
|
} else if (k === " " || k === "Enter") {
|
|
6356
|
-
if (
|
|
6384
|
+
if (r2 === 0 && !col && selectable && nRows) {
|
|
6357
6385
|
if (pageKeys.length) toggleAll();
|
|
6358
|
-
} else if (
|
|
6359
|
-
else if (
|
|
6386
|
+
} else if (r2 === 0 && col && col.sortable && canSortAny) sortBy(col.key);
|
|
6387
|
+
else if (r2 > 0 && k === " " && selectable) {
|
|
6360
6388
|
if (canSelect(row) && !(stacked && noCardSel))
|
|
6361
6389
|
toggle(row[rowKey], !selSet[row[rowKey]], { shiftKey: e.shiftKey, source: "keyboard" });
|
|
6362
|
-
} else if (
|
|
6390
|
+
} else if (r2 > 0 && k === "Enter" && rowHref && !target.querySelector("button, a[href]:not(.aura-table__row-link), input, select, textarea"))
|
|
6363
6391
|
followRow(target.closest('[role="row"]'), e);
|
|
6364
|
-
else if (
|
|
6392
|
+
else if (r2 > 0 && k === "Enter" && target.querySelector("button, a[href], input, select, textarea"))
|
|
6365
6393
|
target.querySelector("button, a[href], input, select, textarea").focus();
|
|
6366
|
-
else if (
|
|
6394
|
+
else if (r2 > 0 && k === "Enter" && props.onRowActivate) props.onRowActivate(row);
|
|
6367
6395
|
else handled = false;
|
|
6368
6396
|
} else handled = false;
|
|
6369
6397
|
if (handled) {
|
|
@@ -6526,13 +6554,13 @@ window.Aura = (() => {
|
|
|
6526
6554
|
}
|
|
6527
6555
|
)
|
|
6528
6556
|
);
|
|
6529
|
-
function cellContent(c,
|
|
6530
|
-
const v =
|
|
6531
|
-
return c.render ? c.render(
|
|
6557
|
+
function cellContent(c, r2) {
|
|
6558
|
+
const v = r2[c.key];
|
|
6559
|
+
return c.render ? c.render(r2) : c.pill ? /* @__PURE__ */ React33.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
6532
6560
|
}
|
|
6533
|
-
function rowCells(
|
|
6561
|
+
function rowCells(r2, i, k, isSel) {
|
|
6534
6562
|
const ri = i + 1;
|
|
6535
|
-
const selLabel = selectable && canSelect(
|
|
6563
|
+
const selLabel = selectable && canSelect(r2) ? props.rowSelectLabel && props.rowSelectLabel(r2) || t.selectRow(k) : void 0;
|
|
6536
6564
|
const cells = [/* @__PURE__ */ React33.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
6537
6565
|
if (selectable)
|
|
6538
6566
|
cells.push(
|
|
@@ -6545,7 +6573,7 @@ window.Aura = (() => {
|
|
|
6545
6573
|
className: cx("aura-table__sel", nPinned && "is-pinned"),
|
|
6546
6574
|
tabIndex: tabFor(ri, 0),
|
|
6547
6575
|
"data-rc": ri + ":0",
|
|
6548
|
-
"aria-label": canSelect(
|
|
6576
|
+
"aria-label": canSelect(r2) ? selLabel : props.rowSelectDisabledLabel ? props.rowSelectDisabledLabel(r2) : void 0,
|
|
6549
6577
|
onFocus: function(e) {
|
|
6550
6578
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
6551
6579
|
},
|
|
@@ -6553,7 +6581,7 @@ window.Aura = (() => {
|
|
|
6553
6581
|
shiftClick.current = e.shiftKey;
|
|
6554
6582
|
}
|
|
6555
6583
|
},
|
|
6556
|
-
canSelect(
|
|
6584
|
+
canSelect(r2) ? /* @__PURE__ */ React33.createElement(
|
|
6557
6585
|
Checkbox,
|
|
6558
6586
|
{
|
|
6559
6587
|
hideLabel: true,
|
|
@@ -6570,7 +6598,7 @@ window.Aura = (() => {
|
|
|
6570
6598
|
)
|
|
6571
6599
|
);
|
|
6572
6600
|
vis.forEach(function(c, j) {
|
|
6573
|
-
const ci = j + (selectable ? 1 : 0), v =
|
|
6601
|
+
const ci = j + (selectable ? 1 : 0), v = r2[c.key], pin = isPinned(c);
|
|
6574
6602
|
cells.push(
|
|
6575
6603
|
/* @__PURE__ */ React33.createElement(
|
|
6576
6604
|
"span",
|
|
@@ -6594,7 +6622,7 @@ window.Aura = (() => {
|
|
|
6594
6622
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
6595
6623
|
}
|
|
6596
6624
|
},
|
|
6597
|
-
autoRows ? /* @__PURE__ */ React33.createElement("span", { className: "aura-table__cell" }, j === 0 ? rowLinkWrap(
|
|
6625
|
+
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
6626
|
)
|
|
6599
6627
|
);
|
|
6600
6628
|
});
|
|
@@ -6692,8 +6720,8 @@ window.Aura = (() => {
|
|
|
6692
6720
|
/* @__PURE__ */ React33.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
6693
6721
|
);
|
|
6694
6722
|
for (let ri = start; ri < end; ri++) {
|
|
6695
|
-
(function(
|
|
6696
|
-
const k =
|
|
6723
|
+
(function(r2, i) {
|
|
6724
|
+
const k = r2[rowKey], isSel = !!selSet[k];
|
|
6697
6725
|
bodyRows.push(
|
|
6698
6726
|
/* @__PURE__ */ React33.createElement(
|
|
6699
6727
|
"div",
|
|
@@ -6701,7 +6729,7 @@ window.Aura = (() => {
|
|
|
6701
6729
|
key: k,
|
|
6702
6730
|
role: "row",
|
|
6703
6731
|
"aria-rowindex": first + i + 2,
|
|
6704
|
-
"aria-selected": selectable && canSelect(
|
|
6732
|
+
"aria-selected": selectable && canSelect(r2) ? isSel : void 0,
|
|
6705
6733
|
className: cx(
|
|
6706
6734
|
"aura-table__row",
|
|
6707
6735
|
autoRows && "aura-table__row--auto",
|
|
@@ -6713,10 +6741,10 @@ window.Aura = (() => {
|
|
|
6713
6741
|
const el = e.target;
|
|
6714
6742
|
if (el.closest && el.closest(".aura-check, button, a, input")) return;
|
|
6715
6743
|
if (rowHref) followRow(e.currentTarget, e);
|
|
6716
|
-
else if (props.onRowActivate) props.onRowActivate(
|
|
6744
|
+
else if (props.onRowActivate) props.onRowActivate(r2);
|
|
6717
6745
|
}
|
|
6718
6746
|
},
|
|
6719
|
-
rowCells(
|
|
6747
|
+
rowCells(r2, i, k, isSel)
|
|
6720
6748
|
)
|
|
6721
6749
|
);
|
|
6722
6750
|
})(pageRows[ri], ri);
|
|
@@ -7234,8 +7262,8 @@ window.Aura = (() => {
|
|
|
7234
7262
|
function tipHandlers(label) {
|
|
7235
7263
|
if (!collapsed) return {};
|
|
7236
7264
|
function show3(e) {
|
|
7237
|
-
const
|
|
7238
|
-
setTip({ text: label, top:
|
|
7265
|
+
const r2 = e.currentTarget.getBoundingClientRect();
|
|
7266
|
+
setTip({ text: label, top: r2.top + r2.height / 2, left: r2.right + 8 });
|
|
7239
7267
|
}
|
|
7240
7268
|
function hide2() {
|
|
7241
7269
|
setTip(null);
|
|
@@ -7521,9 +7549,24 @@ window.Aura = (() => {
|
|
|
7521
7549
|
|
|
7522
7550
|
// src/breakpoints.ts
|
|
7523
7551
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
7552
|
+
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
7553
|
+
function respVars(prefix, value, map2) {
|
|
7554
|
+
const style = {};
|
|
7555
|
+
if (value == null) return style;
|
|
7556
|
+
if (typeof value !== "object") value = { base: value };
|
|
7557
|
+
let byBp = value, cur2;
|
|
7558
|
+
ORDER.forEach(function(k) {
|
|
7559
|
+
if (byBp[k] !== void 0) cur2 = map2 ? map2(byBp[k]) : byBp[k];
|
|
7560
|
+
if (cur2 !== void 0) style["--" + prefix + "-" + k] = cur2;
|
|
7561
|
+
});
|
|
7562
|
+
return style;
|
|
7563
|
+
}
|
|
7564
|
+
var space = function(v) {
|
|
7565
|
+
return typeof v === "number" ? "var(--aura-space-" + v + ")" : v;
|
|
7566
|
+
};
|
|
7524
7567
|
|
|
7525
7568
|
// src/responsive.tsx
|
|
7526
|
-
var
|
|
7569
|
+
var ORDER2 = ["base", "sm", "md", "lg", "xl"];
|
|
7527
7570
|
function useBreakpoint() {
|
|
7528
7571
|
return React39.useSyncExternalStore(subscribe, current, function() {
|
|
7529
7572
|
return "lg";
|
|
@@ -7531,7 +7574,7 @@ window.Aura = (() => {
|
|
|
7531
7574
|
}
|
|
7532
7575
|
function current() {
|
|
7533
7576
|
let w = window.innerWidth, bp = "base";
|
|
7534
|
-
|
|
7577
|
+
ORDER2.slice(1).forEach(function(k) {
|
|
7535
7578
|
if (w >= breakpoints[k]) bp = k;
|
|
7536
7579
|
});
|
|
7537
7580
|
return bp;
|
|
@@ -7546,23 +7589,9 @@ window.Aura = (() => {
|
|
|
7546
7589
|
const bp = useBreakpoint();
|
|
7547
7590
|
if (value == null || typeof value !== "object") return value;
|
|
7548
7591
|
const map2 = value;
|
|
7549
|
-
for (let i =
|
|
7592
|
+
for (let i = ORDER2.indexOf(bp); i >= 0; i--) if (map2[ORDER2[i]] !== void 0) return map2[ORDER2[i]];
|
|
7550
7593
|
return void 0;
|
|
7551
7594
|
}
|
|
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
7595
|
|
|
7567
7596
|
// src/Stack.tsx
|
|
7568
7597
|
var h5 = React40.createElement;
|
|
@@ -7600,14 +7629,14 @@ window.Aura = (() => {
|
|
|
7600
7629
|
var React42 = __toESM(require_react(), 1);
|
|
7601
7630
|
var h7 = React42.createElement;
|
|
7602
7631
|
var Container = React42.forwardRef(function Container2(props, ref) {
|
|
7603
|
-
const
|
|
7632
|
+
const attrs2 = {};
|
|
7604
7633
|
Object.keys(props).forEach(function(k) {
|
|
7605
7634
|
if (k === "id" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
7606
|
-
|
|
7635
|
+
attrs2[k] = props[k];
|
|
7607
7636
|
});
|
|
7608
7637
|
return h7(
|
|
7609
7638
|
props.as || "div",
|
|
7610
|
-
Object.assign(
|
|
7639
|
+
Object.assign(attrs2, {
|
|
7611
7640
|
ref,
|
|
7612
7641
|
className: cx(
|
|
7613
7642
|
"aura-container",
|
|
@@ -7625,18 +7654,19 @@ window.Aura = (() => {
|
|
|
7625
7654
|
var React43 = __toESM(require_react(), 1);
|
|
7626
7655
|
var h8 = React43.createElement;
|
|
7627
7656
|
var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
7628
|
-
const
|
|
7657
|
+
const attrs2 = {};
|
|
7629
7658
|
Object.keys(props).forEach(function(k) {
|
|
7630
7659
|
if (k === "id" || k === "lang" || k === "dir" || k === "role" || /^(aria|data)-/.test(k))
|
|
7631
|
-
|
|
7660
|
+
attrs2[k] = props[k];
|
|
7632
7661
|
});
|
|
7633
7662
|
const level = props.headingLevel || 1;
|
|
7634
7663
|
return h8(
|
|
7635
7664
|
"div",
|
|
7636
|
-
Object.assign(
|
|
7665
|
+
Object.assign(attrs2, { ref, className: cx("aura-page-header", props.className), style: props.style }),
|
|
7637
7666
|
h8(
|
|
7638
7667
|
"div",
|
|
7639
7668
|
{ className: "aura-page-header__text" },
|
|
7669
|
+
props.breadcrumb != null && props.breadcrumb !== false ? h8("div", { className: "aura-page-header__breadcrumb" }, props.breadcrumb) : null,
|
|
7640
7670
|
props.eyebrow != null && props.eyebrow !== false ? h8("p", { className: "aura-page-header__eyebrow" }, props.eyebrow) : null,
|
|
7641
7671
|
h8("h" + level, { className: "aura-page-header__title", id: props.titleId }, props.title),
|
|
7642
7672
|
props.meta != null && props.meta !== false ? h8("div", { className: "aura-page-header__meta" }, props.meta) : null
|
|
@@ -7645,36 +7675,286 @@ window.Aura = (() => {
|
|
|
7645
7675
|
);
|
|
7646
7676
|
});
|
|
7647
7677
|
|
|
7648
|
-
// src/
|
|
7678
|
+
// src/StatusTile.tsx
|
|
7679
|
+
var React45 = __toESM(require_react(), 1);
|
|
7680
|
+
|
|
7681
|
+
// src/tiles.tsx
|
|
7649
7682
|
var React44 = __toESM(require_react(), 1);
|
|
7650
|
-
var
|
|
7683
|
+
var h9 = React44.createElement;
|
|
7684
|
+
var STATUS_ICON = {
|
|
7685
|
+
down: IconCircleAlert,
|
|
7686
|
+
problem: IconTriangleAlert,
|
|
7687
|
+
maintenance: IconWrench,
|
|
7688
|
+
ok: IconCircleCheck
|
|
7689
|
+
};
|
|
7690
|
+
var STATUS_TONE = {
|
|
7691
|
+
down: "danger",
|
|
7692
|
+
problem: "warning",
|
|
7693
|
+
maintenance: "accent",
|
|
7694
|
+
ok: "default"
|
|
7695
|
+
};
|
|
7696
|
+
var STATUS_WORD = {
|
|
7697
|
+
down: "statusDown",
|
|
7698
|
+
problem: "statusProblem",
|
|
7699
|
+
maintenance: "statusMaintenance",
|
|
7700
|
+
ok: "statusOk"
|
|
7701
|
+
};
|
|
7702
|
+
function statusWord(status, t) {
|
|
7703
|
+
return String(t[STATUS_WORD[status]] || STATUS_WORD[status]);
|
|
7704
|
+
}
|
|
7705
|
+
function attrs(props) {
|
|
7706
|
+
const out = {};
|
|
7707
|
+
Object.keys(props).forEach(function(k) {
|
|
7708
|
+
if (k === "id" || k === "style" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
7709
|
+
out[k] = props[k];
|
|
7710
|
+
});
|
|
7711
|
+
return out;
|
|
7712
|
+
}
|
|
7713
|
+
var comma = h9("span", { className: "aura-status-tile__sep" }, ",");
|
|
7714
|
+
function statusTileElement(props, ref, Link, t, titleRef) {
|
|
7715
|
+
const status = STATUS_ICON[props.status] ? props.status : "ok";
|
|
7716
|
+
const valueTone = props.valueTone || STATUS_TONE[status];
|
|
7717
|
+
const word = props.statusLabel || statusWord(status, t);
|
|
7718
|
+
const markers = (props.markers || []).filter(Boolean);
|
|
7719
|
+
const has = function(v) {
|
|
7720
|
+
return v != null && v !== false && v !== "";
|
|
7721
|
+
};
|
|
7722
|
+
const hasValue = has(props.value), hasMeta = has(props.meta);
|
|
7723
|
+
const Tag3 = props.href ? Link : "div";
|
|
7724
|
+
return h9(
|
|
7725
|
+
Tag3,
|
|
7726
|
+
Object.assign(attrs(props), {
|
|
7727
|
+
ref,
|
|
7728
|
+
href: props.href,
|
|
7729
|
+
className: cx("aura-status-tile", "aura-status-tile--" + status, props.href && "is-interactive", props.className)
|
|
7730
|
+
}),
|
|
7731
|
+
h9(
|
|
7732
|
+
"span",
|
|
7733
|
+
{ className: "aura-status-tile__head" },
|
|
7734
|
+
h9(Icon, { name: h9(STATUS_ICON[status]), size: 16, className: "aura-status-tile__icon" }),
|
|
7735
|
+
h9("span", { className: "aura-status-tile__title", ref: titleRef }, props.title, comma),
|
|
7736
|
+
h9("span", { className: "aura-sr-only" }, word + (hasValue || hasMeta || markers.length ? "," : "")),
|
|
7737
|
+
hasValue ? h9(
|
|
7738
|
+
"span",
|
|
7739
|
+
{ className: cx("aura-status-tile__value", "is-" + valueTone) },
|
|
7740
|
+
props.value,
|
|
7741
|
+
hasMeta || markers.length ? comma : null
|
|
7742
|
+
) : null
|
|
7743
|
+
),
|
|
7744
|
+
hasMeta || markers.length ? h9(
|
|
7745
|
+
"span",
|
|
7746
|
+
{ className: "aura-status-tile__foot" },
|
|
7747
|
+
hasMeta ? h9("span", { className: "aura-status-tile__meta" }, props.meta, markers.length ? comma : null) : null,
|
|
7748
|
+
markers.length ? h9(
|
|
7749
|
+
"span",
|
|
7750
|
+
{ className: "aura-status-tile__markers" },
|
|
7751
|
+
markers.map(function(m, i) {
|
|
7752
|
+
return h9(
|
|
7753
|
+
"span",
|
|
7754
|
+
{
|
|
7755
|
+
key: i,
|
|
7756
|
+
className: cx("aura-status-tile__marker", "is-" + (m.tone || "neutral")),
|
|
7757
|
+
"data-aura-tip": m.label
|
|
7758
|
+
},
|
|
7759
|
+
h9(Icon, { name: m.icon, size: 14 }),
|
|
7760
|
+
h9("span", { className: "aura-sr-only" }, m.label + (i < markers.length - 1 ? "," : ""))
|
|
7761
|
+
);
|
|
7762
|
+
})
|
|
7763
|
+
) : null
|
|
7764
|
+
) : null
|
|
7765
|
+
);
|
|
7766
|
+
}
|
|
7767
|
+
var TileGrid = React44.forwardRef(function TileGrid2(props, ref) {
|
|
7768
|
+
const style = Object.assign(
|
|
7769
|
+
{},
|
|
7770
|
+
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
7771
|
+
props.style
|
|
7772
|
+
);
|
|
7773
|
+
return h9(
|
|
7774
|
+
"ul",
|
|
7775
|
+
Object.assign(attrs(props), {
|
|
7776
|
+
ref,
|
|
7777
|
+
role: "list",
|
|
7778
|
+
className: cx("aura-grid-layout", "aura-tile-grid", props.className),
|
|
7779
|
+
style
|
|
7780
|
+
}),
|
|
7781
|
+
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
7782
|
+
flat(props.children).map(function(c, i) {
|
|
7783
|
+
return h9("li", { key: React44.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
7784
|
+
})
|
|
7785
|
+
);
|
|
7786
|
+
});
|
|
7787
|
+
function flat(children) {
|
|
7788
|
+
const out = [];
|
|
7789
|
+
React44.Children.toArray(children).forEach(function(c) {
|
|
7790
|
+
if (React44.isValidElement(c) && c.type === React44.Fragment)
|
|
7791
|
+
flat(c.props.children).forEach(function(x) {
|
|
7792
|
+
out.push(React44.isValidElement(x) ? React44.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
7793
|
+
});
|
|
7794
|
+
else if (c !== "") out.push(c);
|
|
7795
|
+
});
|
|
7796
|
+
return out;
|
|
7797
|
+
}
|
|
7798
|
+
var SIZES2 = { sm: [80, 24], md: [120, 32] };
|
|
7799
|
+
var PAD = 2;
|
|
7800
|
+
function r(n3) {
|
|
7801
|
+
return Math.round(n3 * 100) / 100;
|
|
7802
|
+
}
|
|
7803
|
+
function num(v) {
|
|
7804
|
+
return typeof v === "number" && isFinite(v) ? v : null;
|
|
7805
|
+
}
|
|
7806
|
+
var Sparkline = React44.forwardRef(function Sparkline2(props, ref) {
|
|
7807
|
+
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
7808
|
+
const W = wh[0], H = wh[1];
|
|
7809
|
+
const data = (props.data || []).map(num);
|
|
7810
|
+
const n3 = data.length;
|
|
7811
|
+
const vals = data.filter(function(v) {
|
|
7812
|
+
return v != null;
|
|
7813
|
+
});
|
|
7814
|
+
let lo = num(props.min), hi = num(props.max);
|
|
7815
|
+
if (lo == null) lo = vals.length ? Math.min.apply(null, vals) : 0;
|
|
7816
|
+
if (hi == null) hi = vals.length ? Math.max.apply(null, vals) : 0;
|
|
7817
|
+
if (lo > hi) {
|
|
7818
|
+
const s = lo;
|
|
7819
|
+
lo = hi;
|
|
7820
|
+
hi = s;
|
|
7821
|
+
}
|
|
7822
|
+
const step = n3 > 1 ? (W - 2 * PAD) / (n3 - 1) : 0;
|
|
7823
|
+
const x = function(i) {
|
|
7824
|
+
return n3 > 1 ? PAD + i * step : W / 2;
|
|
7825
|
+
};
|
|
7826
|
+
const y = function(v) {
|
|
7827
|
+
if (hi === lo) return H / 2;
|
|
7828
|
+
const k = Math.max(0, Math.min(1, (v - lo) / (hi - lo)));
|
|
7829
|
+
return H - PAD - k * (H - 2 * PAD);
|
|
7830
|
+
};
|
|
7831
|
+
let d = "";
|
|
7832
|
+
const dots = [];
|
|
7833
|
+
data.forEach(function(v, i) {
|
|
7834
|
+
if (v == null) return;
|
|
7835
|
+
const prev = i > 0 && data[i - 1] != null, next = i < n3 - 1 && data[i + 1] != null;
|
|
7836
|
+
if (!prev && !next) dots.push(h9("circle", { key: "d" + i, cx: r(x(i)), cy: r(y(v)), r: 1.5 }));
|
|
7837
|
+
else d += (prev ? "L" : "M") + r(x(i)) + " " + r(y(v));
|
|
7838
|
+
});
|
|
7839
|
+
const mode = props.failures || "none";
|
|
7840
|
+
const fails = [];
|
|
7841
|
+
if (mode !== "none" && props.failed)
|
|
7842
|
+
data.forEach(function(_v, i) {
|
|
7843
|
+
if (!props.failed[i]) return;
|
|
7844
|
+
if (mode === "band") {
|
|
7845
|
+
const w = Math.max(2, step || W), left = Math.max(0, x(i) - w / 2), right = Math.min(W, x(i) + w / 2);
|
|
7846
|
+
fails.push(h9("rect", { key: "f" + i, x: r(left), y: 0, width: r(right - left), height: H }));
|
|
7847
|
+
} else
|
|
7848
|
+
fails.push(
|
|
7849
|
+
h9("rect", {
|
|
7850
|
+
key: "f" + i,
|
|
7851
|
+
x: r(Math.max(0, Math.min(W - 1.5, x(i) - 0.75))),
|
|
7852
|
+
y: H - 6,
|
|
7853
|
+
width: 1.5,
|
|
7854
|
+
height: 6
|
|
7855
|
+
})
|
|
7856
|
+
);
|
|
7857
|
+
});
|
|
7858
|
+
const named = !!props.label;
|
|
7859
|
+
return h9(
|
|
7860
|
+
"svg",
|
|
7861
|
+
Object.assign(attrs(props), {
|
|
7862
|
+
ref,
|
|
7863
|
+
className: cx("aura-sparkline", "is-" + (props.tone || "neutral"), props.className),
|
|
7864
|
+
width: W,
|
|
7865
|
+
height: H,
|
|
7866
|
+
viewBox: "0 0 " + W + " " + H,
|
|
7867
|
+
role: named ? "img" : void 0,
|
|
7868
|
+
"aria-label": named ? props.label : void 0,
|
|
7869
|
+
"aria-hidden": named ? void 0 : true,
|
|
7870
|
+
focusable: "false"
|
|
7871
|
+
}),
|
|
7872
|
+
fails.length && mode === "band" ? h9("g", { className: "aura-sparkline__band" }, fails) : null,
|
|
7873
|
+
d ? h9("path", { className: "aura-sparkline__line", d }) : null,
|
|
7874
|
+
dots.length ? h9("g", { className: "aura-sparkline__dots" }, dots) : null,
|
|
7875
|
+
fails.length && mode === "ticks" ? h9("g", { className: "aura-sparkline__ticks" }, fails) : null
|
|
7876
|
+
);
|
|
7877
|
+
});
|
|
7878
|
+
|
|
7879
|
+
// src/StatusTile.tsx
|
|
7880
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React45.useLayoutEffect : React45.useEffect;
|
|
7881
|
+
var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
7882
|
+
const Link = useLinkComponent(props.linkComponent);
|
|
7883
|
+
const t = useStrings();
|
|
7884
|
+
useAutoTip();
|
|
7885
|
+
if (!props.href && (props["aria-label"] || props["aria-labelledby"]))
|
|
7886
|
+
devWarnOnce(
|
|
7887
|
+
"status-tile-label",
|
|
7888
|
+
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
7889
|
+
);
|
|
7890
|
+
const titleRef = React45.useRef(null);
|
|
7891
|
+
const check = React45.useCallback(function() {
|
|
7892
|
+
const el = titleRef.current;
|
|
7893
|
+
if (!el) return;
|
|
7894
|
+
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
7895
|
+
const text2 = (el.textContent || "").replace(/,$/, "").trim();
|
|
7896
|
+
if (cut && text2) el.setAttribute("data-aura-tip", text2);
|
|
7897
|
+
else el.removeAttribute("data-aura-tip");
|
|
7898
|
+
}, []);
|
|
7899
|
+
useIsoLayoutEffect2(check, [props.title, check]);
|
|
7900
|
+
const linked = !!props.href;
|
|
7901
|
+
React45.useEffect(
|
|
7902
|
+
function() {
|
|
7903
|
+
const el = titleRef.current;
|
|
7904
|
+
if (!el) return;
|
|
7905
|
+
let live = true;
|
|
7906
|
+
const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(check) : null;
|
|
7907
|
+
const mo = typeof MutationObserver !== "undefined" ? new MutationObserver(check) : null;
|
|
7908
|
+
if (ro) ro.observe(el);
|
|
7909
|
+
if (mo) mo.observe(el, { characterData: true, childList: true, subtree: true });
|
|
7910
|
+
if (document.fonts && document.fonts.ready)
|
|
7911
|
+
document.fonts.ready.then(function() {
|
|
7912
|
+
if (live) check();
|
|
7913
|
+
});
|
|
7914
|
+
return function() {
|
|
7915
|
+
live = false;
|
|
7916
|
+
if (ro) ro.disconnect();
|
|
7917
|
+
if (mo) mo.disconnect();
|
|
7918
|
+
};
|
|
7919
|
+
},
|
|
7920
|
+
[check, linked]
|
|
7921
|
+
);
|
|
7922
|
+
return statusTileElement(props, ref, Link, t, titleRef);
|
|
7923
|
+
});
|
|
7924
|
+
|
|
7925
|
+
// src/AppShell.tsx
|
|
7926
|
+
var React46 = __toESM(require_react(), 1);
|
|
7927
|
+
var AppShell = React46.forwardRef(function AppShell2(props, ref) {
|
|
7651
7928
|
const t = useStrings();
|
|
7652
7929
|
const bp = useBreakpoint();
|
|
7653
7930
|
const wide = bp === "lg" || bp === "xl";
|
|
7654
|
-
const st =
|
|
7655
|
-
|
|
7931
|
+
const st = React46.useState(false), open = st[0], setOpen = st[1];
|
|
7932
|
+
React46.useEffect(
|
|
7656
7933
|
function() {
|
|
7657
7934
|
if (wide) setOpen(false);
|
|
7658
7935
|
},
|
|
7659
7936
|
[wide]
|
|
7660
7937
|
);
|
|
7661
|
-
const navEl = props.nav &&
|
|
7938
|
+
const navEl = props.nav && React46.isValidElement(props.nav) ? props.nav : null;
|
|
7662
7939
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
7663
|
-
const navState =
|
|
7940
|
+
const navState = React46.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
7664
7941
|
function onNav(id) {
|
|
7665
7942
|
if (shared) navState[1](id);
|
|
7666
7943
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
7667
7944
|
}
|
|
7668
|
-
const rootRef =
|
|
7669
|
-
const barRef =
|
|
7945
|
+
const rootRef = React46.useRef(null);
|
|
7946
|
+
const barRef = React46.useRef(null);
|
|
7670
7947
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
7671
7948
|
const hasBar = !!(props.header || props.nav);
|
|
7949
|
+
const barH = React46.useState(null);
|
|
7672
7950
|
useIsoLayoutEffect(
|
|
7673
7951
|
function() {
|
|
7674
7952
|
const root = rootRef.current, bar = barRef.current;
|
|
7675
7953
|
if (!root || !bar) return;
|
|
7676
7954
|
function sync() {
|
|
7677
|
-
|
|
7955
|
+
const h11 = bar.getBoundingClientRect().height;
|
|
7956
|
+
root.style.setProperty("--aura-shell-bar-height", h11 + "px");
|
|
7957
|
+
if (h11 > 0) barH[1](Math.round(h11));
|
|
7678
7958
|
}
|
|
7679
7959
|
sync();
|
|
7680
7960
|
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
@@ -7686,8 +7966,8 @@ window.Aura = (() => {
|
|
|
7686
7966
|
},
|
|
7687
7967
|
[hasBar]
|
|
7688
7968
|
);
|
|
7689
|
-
const deskNav = navEl && shared ?
|
|
7690
|
-
const drawerNav = navEl ?
|
|
7969
|
+
const deskNav = navEl && shared ? React46.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
7970
|
+
const drawerNav = navEl ? React46.cloneElement(navEl, {
|
|
7691
7971
|
value: shared ? navState[0] : navEl.props.value,
|
|
7692
7972
|
onChange: function(id) {
|
|
7693
7973
|
onNav(id);
|
|
@@ -7702,7 +7982,7 @@ window.Aura = (() => {
|
|
|
7702
7982
|
collapsed: false,
|
|
7703
7983
|
collapsible: false
|
|
7704
7984
|
}) : props.nav;
|
|
7705
|
-
return /* @__PURE__ */
|
|
7985
|
+
return /* @__PURE__ */ React46.createElement(
|
|
7706
7986
|
"div",
|
|
7707
7987
|
{
|
|
7708
7988
|
ref: mergedRef,
|
|
@@ -7712,11 +7992,13 @@ window.Aura = (() => {
|
|
|
7712
7992
|
/* 5.14: no top bar at all, or one that only holds the menu button (gone from lg up): the bar-height token is 0. */
|
|
7713
7993
|
!props.header && !props.nav && "aura-shell--no-bar",
|
|
7714
7994
|
!props.header && props.nav && "aura-shell--menu-bar",
|
|
7995
|
+
/* 5.33 (DxT Monitor #6): a header bar for phones only. */
|
|
7996
|
+
props.header && props.headerHideFrom === "lg" && "aura-shell--menu-bar",
|
|
7715
7997
|
props.className
|
|
7716
7998
|
)
|
|
7717
7999
|
},
|
|
7718
|
-
props.nav ? /* @__PURE__ */
|
|
7719
|
-
props.nav ? /* @__PURE__ */
|
|
8000
|
+
props.nav ? /* @__PURE__ */ React46.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8001
|
+
props.nav ? /* @__PURE__ */ React46.createElement(
|
|
7720
8002
|
Drawer,
|
|
7721
8003
|
{
|
|
7722
8004
|
open,
|
|
@@ -7726,23 +8008,37 @@ window.Aura = (() => {
|
|
|
7726
8008
|
side: "left",
|
|
7727
8009
|
size: "nav",
|
|
7728
8010
|
"aria-label": props.navLabel || t.navigation,
|
|
7729
|
-
dismissible: true
|
|
8011
|
+
dismissible: true,
|
|
8012
|
+
closeProps: { touchHeight: true },
|
|
8013
|
+
className: navEl && navEl.props.headerDivider && navEl.props.header ? "aura-drawer--nav-divided" : void 0,
|
|
8014
|
+
style: barH[0] ? { "--aura-shell-bar-height": barH[0] + "px" } : void 0
|
|
7730
8015
|
},
|
|
7731
8016
|
drawerNav
|
|
7732
8017
|
) : null,
|
|
7733
|
-
/* @__PURE__ */
|
|
7734
|
-
|
|
8018
|
+
/* @__PURE__ */ React46.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React46.createElement(
|
|
8019
|
+
"header",
|
|
7735
8020
|
{
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
8021
|
+
ref: barRef,
|
|
8022
|
+
className: cx(
|
|
8023
|
+
"aura-shell__bar",
|
|
8024
|
+
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only"
|
|
8025
|
+
)
|
|
8026
|
+
},
|
|
8027
|
+
props.nav ? /* @__PURE__ */ React46.createElement(
|
|
8028
|
+
IconButton,
|
|
8029
|
+
{
|
|
8030
|
+
className: "aura-shell__menu",
|
|
8031
|
+
icon: /* @__PURE__ */ React46.createElement(IconMenu, null),
|
|
8032
|
+
label: props.menuLabel || t.openNav,
|
|
8033
|
+
size: "md",
|
|
8034
|
+
onClick: function() {
|
|
8035
|
+
setOpen(true);
|
|
8036
|
+
},
|
|
8037
|
+
"aria-expanded": open
|
|
8038
|
+
}
|
|
8039
|
+
) : null,
|
|
8040
|
+
/* @__PURE__ */ React46.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8041
|
+
) : null, /* @__PURE__ */ React46.createElement(
|
|
7746
8042
|
"main",
|
|
7747
8043
|
{
|
|
7748
8044
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -7755,17 +8051,17 @@ window.Aura = (() => {
|
|
|
7755
8051
|
});
|
|
7756
8052
|
|
|
7757
8053
|
// src/ActionBar.tsx
|
|
7758
|
-
var
|
|
7759
|
-
var ActionBar =
|
|
8054
|
+
var React47 = __toESM(require_react(), 1);
|
|
8055
|
+
var ActionBar = React47.forwardRef(function ActionBar2(props, ref) {
|
|
7760
8056
|
const t = useStrings();
|
|
7761
8057
|
const bulk = props.selected != null;
|
|
7762
8058
|
const idle = bulk && !props.selected;
|
|
7763
8059
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
7764
|
-
const hasStart =
|
|
8060
|
+
const hasStart = React47.Children.toArray(props.start).some(function(c) {
|
|
7765
8061
|
return c !== "";
|
|
7766
8062
|
});
|
|
7767
|
-
const cameFrom =
|
|
7768
|
-
const own =
|
|
8063
|
+
const cameFrom = React47.useRef(null);
|
|
8064
|
+
const own = React47.useRef(null);
|
|
7769
8065
|
function clear() {
|
|
7770
8066
|
props.onClearSelection();
|
|
7771
8067
|
setTimeout(function() {
|
|
@@ -7774,7 +8070,7 @@ window.Aura = (() => {
|
|
|
7774
8070
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
7775
8071
|
}, 0);
|
|
7776
8072
|
}
|
|
7777
|
-
return /* @__PURE__ */
|
|
8073
|
+
return /* @__PURE__ */ React47.createElement(
|
|
7778
8074
|
"div",
|
|
7779
8075
|
{
|
|
7780
8076
|
ref: function(el) {
|
|
@@ -7795,16 +8091,16 @@ window.Aura = (() => {
|
|
|
7795
8091
|
props.className
|
|
7796
8092
|
)
|
|
7797
8093
|
},
|
|
7798
|
-
/* @__PURE__ */
|
|
8094
|
+
/* @__PURE__ */ React47.createElement("div", { className: cx("aura-actionbar__inner", hasStart && "has-start") }, /* @__PURE__ */ React47.createElement("div", { className: "aura-actionbar__status", role: "status" }, count, count && props.status ? " \xB7 " : null, props.status), !idle && hasStart ? /* @__PURE__ */ React47.createElement("div", { className: "aura-actionbar__start" }, props.start) : null, !idle ? /* @__PURE__ */ React47.createElement("div", { className: "aura-actionbar__actions" }, count && props.onClearSelection ? /* @__PURE__ */ React47.createElement(Button, { variant: "ghost", size: "sm", touchHeight: props.touchHeight, onClick: clear }, t.clear()) : null, props.children) : null)
|
|
7799
8095
|
);
|
|
7800
8096
|
});
|
|
7801
8097
|
|
|
7802
8098
|
// src/Separator.tsx
|
|
7803
|
-
var
|
|
7804
|
-
var Separator =
|
|
8099
|
+
var React48 = __toESM(require_react(), 1);
|
|
8100
|
+
var Separator = React48.forwardRef(function Separator2(props, ref) {
|
|
7805
8101
|
const vertical = props.orientation === "vertical";
|
|
7806
8102
|
const decorative = props.decorative !== false;
|
|
7807
|
-
return /* @__PURE__ */
|
|
8103
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7808
8104
|
"div",
|
|
7809
8105
|
{
|
|
7810
8106
|
ref,
|
|
@@ -7817,14 +8113,14 @@ window.Aura = (() => {
|
|
|
7817
8113
|
});
|
|
7818
8114
|
|
|
7819
8115
|
// src/Table.tsx
|
|
7820
|
-
var
|
|
7821
|
-
var StackLabels =
|
|
7822
|
-
var ColumnIndex =
|
|
7823
|
-
function
|
|
8116
|
+
var React49 = __toESM(require_react(), 1);
|
|
8117
|
+
var StackLabels = React49.createContext(null);
|
|
8118
|
+
var ColumnIndex = React49.createContext(-1);
|
|
8119
|
+
function flat2(children) {
|
|
7824
8120
|
const out = [];
|
|
7825
|
-
|
|
7826
|
-
if (
|
|
7827
|
-
out.push.apply(out,
|
|
8121
|
+
React49.Children.toArray(children).forEach(function(c) {
|
|
8122
|
+
if (React49.isValidElement(c) && c.type === React49.Fragment)
|
|
8123
|
+
out.push.apply(out, flat2(c.props.children));
|
|
7828
8124
|
else out.push(c);
|
|
7829
8125
|
});
|
|
7830
8126
|
return out;
|
|
@@ -7837,7 +8133,7 @@ window.Aura = (() => {
|
|
|
7837
8133
|
});
|
|
7838
8134
|
return parts.length ? parts.join("") : void 0;
|
|
7839
8135
|
}
|
|
7840
|
-
if (
|
|
8136
|
+
if (React49.isValidElement(node)) {
|
|
7841
8137
|
const p = node.props;
|
|
7842
8138
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
7843
8139
|
return text(p.children);
|
|
@@ -7846,14 +8142,14 @@ window.Aura = (() => {
|
|
|
7846
8142
|
}
|
|
7847
8143
|
function headerLabels(children) {
|
|
7848
8144
|
let out = [];
|
|
7849
|
-
|
|
7850
|
-
if (out.length || !
|
|
7851
|
-
const row =
|
|
7852
|
-
return
|
|
8145
|
+
flat2(children).forEach(function(c) {
|
|
8146
|
+
if (out.length || !React49.isValidElement(c) || c.type !== THead) return;
|
|
8147
|
+
const row = flat2(c.props.children).find(function(r2) {
|
|
8148
|
+
return React49.isValidElement(r2);
|
|
7853
8149
|
});
|
|
7854
8150
|
if (!row) return;
|
|
7855
|
-
|
|
7856
|
-
if (!
|
|
8151
|
+
flat2(row.props.children).forEach(function(cell) {
|
|
8152
|
+
if (!React49.isValidElement(cell)) return;
|
|
7857
8153
|
const p = cell.props;
|
|
7858
8154
|
const t = text(p.children);
|
|
7859
8155
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -7863,7 +8159,7 @@ window.Aura = (() => {
|
|
|
7863
8159
|
});
|
|
7864
8160
|
return out;
|
|
7865
8161
|
}
|
|
7866
|
-
var Table =
|
|
8162
|
+
var Table = React49.forwardRef(function Table2(props, ref) {
|
|
7867
8163
|
const {
|
|
7868
8164
|
caption,
|
|
7869
8165
|
captionHidden,
|
|
@@ -7893,12 +8189,12 @@ window.Aura = (() => {
|
|
|
7893
8189
|
"tbl-stack-labels",
|
|
7894
8190
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
7895
8191
|
);
|
|
7896
|
-
const outer =
|
|
8192
|
+
const outer = React49.useContext(StackLabels);
|
|
7897
8193
|
const pageDensity = useDensity();
|
|
7898
8194
|
const capId = uid();
|
|
7899
|
-
const wrap =
|
|
7900
|
-
const sc =
|
|
7901
|
-
const wide =
|
|
8195
|
+
const wrap = React49.useRef(null);
|
|
8196
|
+
const sc = React49.useState(false), scrolls = sc[0];
|
|
8197
|
+
const wide = React49.useState(false);
|
|
7902
8198
|
useIsoLayoutEffect(function() {
|
|
7903
8199
|
const el = wrap.current;
|
|
7904
8200
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -7915,7 +8211,7 @@ window.Aura = (() => {
|
|
|
7915
8211
|
ro.disconnect();
|
|
7916
8212
|
};
|
|
7917
8213
|
}, []);
|
|
7918
|
-
const table = /* @__PURE__ */
|
|
8214
|
+
const table = /* @__PURE__ */ React49.createElement(
|
|
7919
8215
|
"div",
|
|
7920
8216
|
{
|
|
7921
8217
|
ref: wrap,
|
|
@@ -7939,7 +8235,7 @@ window.Aura = (() => {
|
|
|
7939
8235
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
7940
8236
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
7941
8237
|
},
|
|
7942
|
-
/* @__PURE__ */
|
|
8238
|
+
/* @__PURE__ */ React49.createElement(
|
|
7943
8239
|
"table",
|
|
7944
8240
|
{
|
|
7945
8241
|
ref,
|
|
@@ -7955,11 +8251,11 @@ window.Aura = (() => {
|
|
|
7955
8251
|
role: stackBelow ? "table" : void 0,
|
|
7956
8252
|
...rest
|
|
7957
8253
|
},
|
|
7958
|
-
caption != null ? /* @__PURE__ */
|
|
7959
|
-
labels ? /* @__PURE__ */
|
|
8254
|
+
caption != null ? /* @__PURE__ */ React49.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8255
|
+
labels ? /* @__PURE__ */ React49.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React49.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
7960
8256
|
)
|
|
7961
8257
|
);
|
|
7962
|
-
return cards ? /* @__PURE__ */
|
|
8258
|
+
return cards ? /* @__PURE__ */ React49.createElement(
|
|
7963
8259
|
"div",
|
|
7964
8260
|
{
|
|
7965
8261
|
className: cx(
|
|
@@ -7972,10 +8268,10 @@ window.Aura = (() => {
|
|
|
7972
8268
|
) : table;
|
|
7973
8269
|
});
|
|
7974
8270
|
function section(tag, cls) {
|
|
7975
|
-
const C =
|
|
8271
|
+
const C = React49.forwardRef(function TableSection(props, ref) {
|
|
7976
8272
|
const { className, ...rest } = props;
|
|
7977
|
-
const stacked =
|
|
7978
|
-
return
|
|
8273
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
8274
|
+
return React49.createElement(
|
|
7979
8275
|
tag,
|
|
7980
8276
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
7981
8277
|
);
|
|
@@ -7988,14 +8284,14 @@ window.Aura = (() => {
|
|
|
7988
8284
|
TBody.displayName = "TBody";
|
|
7989
8285
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
7990
8286
|
TFoot.displayName = "TFoot";
|
|
7991
|
-
var Tr =
|
|
8287
|
+
var Tr = React49.forwardRef(function Tr2(props, ref) {
|
|
7992
8288
|
const { className, children, ...rest } = props;
|
|
7993
|
-
const stacked =
|
|
8289
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
7994
8290
|
let col = 0;
|
|
7995
|
-
return /* @__PURE__ */
|
|
8291
|
+
return /* @__PURE__ */ React49.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
7996
8292
|
const at = col;
|
|
7997
|
-
if (
|
|
7998
|
-
return /* @__PURE__ */
|
|
8293
|
+
if (React49.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8294
|
+
return /* @__PURE__ */ React49.createElement(ColumnIndex.Provider, { key: React49.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
7999
8295
|
}) : children);
|
|
8000
8296
|
});
|
|
8001
8297
|
function cellClass(base, p) {
|
|
@@ -8009,10 +8305,10 @@ window.Aura = (() => {
|
|
|
8009
8305
|
p.className
|
|
8010
8306
|
);
|
|
8011
8307
|
}
|
|
8012
|
-
var Th =
|
|
8308
|
+
var Th = React49.forwardRef(function Th2(props, ref) {
|
|
8013
8309
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8014
|
-
const stacked =
|
|
8015
|
-
return /* @__PURE__ */
|
|
8310
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
8311
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8016
8312
|
"th",
|
|
8017
8313
|
{
|
|
8018
8314
|
ref,
|
|
@@ -8024,12 +8320,12 @@ window.Aura = (() => {
|
|
|
8024
8320
|
}
|
|
8025
8321
|
);
|
|
8026
8322
|
});
|
|
8027
|
-
var Td =
|
|
8323
|
+
var Td = React49.forwardRef(function Td2(props, ref) {
|
|
8028
8324
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8029
|
-
const labels =
|
|
8325
|
+
const labels = React49.useContext(StackLabels), col = React49.useContext(ColumnIndex);
|
|
8030
8326
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8031
8327
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8032
|
-
return /* @__PURE__ */
|
|
8328
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8033
8329
|
"td",
|
|
8034
8330
|
{
|
|
8035
8331
|
ref,
|
|
@@ -8043,8 +8339,8 @@ window.Aura = (() => {
|
|
|
8043
8339
|
});
|
|
8044
8340
|
|
|
8045
8341
|
// src/BottomNav.tsx
|
|
8046
|
-
var
|
|
8047
|
-
var BottomNav =
|
|
8342
|
+
var React50 = __toESM(require_react(), 1);
|
|
8343
|
+
var BottomNav = React50.forwardRef(function BottomNav2(props, ref) {
|
|
8048
8344
|
const t = useStrings();
|
|
8049
8345
|
const Link = useLinkComponent(props.linkComponent);
|
|
8050
8346
|
const st = useMaybeControlled(
|
|
@@ -8054,14 +8350,14 @@ window.Aura = (() => {
|
|
|
8054
8350
|
);
|
|
8055
8351
|
const active = st[0];
|
|
8056
8352
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8057
|
-
return /* @__PURE__ */
|
|
8353
|
+
return /* @__PURE__ */ React50.createElement(React50.Fragment, null, /* @__PURE__ */ React50.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide2), "aria-hidden": "true" }), /* @__PURE__ */ React50.createElement(
|
|
8058
8354
|
"nav",
|
|
8059
8355
|
{
|
|
8060
8356
|
ref,
|
|
8061
8357
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide2, props.className),
|
|
8062
8358
|
"aria-label": props.label || t.mainNav
|
|
8063
8359
|
},
|
|
8064
|
-
/* @__PURE__ */
|
|
8360
|
+
/* @__PURE__ */ React50.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8065
8361
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8066
8362
|
devWarnOnce(
|
|
8067
8363
|
"bottomnav-label-" + it.id,
|
|
@@ -8082,23 +8378,23 @@ window.Aura = (() => {
|
|
|
8082
8378
|
}
|
|
8083
8379
|
};
|
|
8084
8380
|
const inner = [
|
|
8085
|
-
/* @__PURE__ */
|
|
8086
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8087
|
-
/* @__PURE__ */
|
|
8088
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
8381
|
+
/* @__PURE__ */ React50.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React50.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React50.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React50.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
8382
|
+
it.ariaLabel ? /* @__PURE__ */ React50.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
8383
|
+
/* @__PURE__ */ React50.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
8384
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React50.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8089
8385
|
];
|
|
8090
|
-
return /* @__PURE__ */
|
|
8386
|
+
return /* @__PURE__ */ React50.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React50.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React50.createElement("button", { type: "button", ...common }, inner));
|
|
8091
8387
|
}))
|
|
8092
8388
|
));
|
|
8093
8389
|
});
|
|
8094
8390
|
|
|
8095
8391
|
// src/Surface.tsx
|
|
8096
|
-
var
|
|
8097
|
-
var
|
|
8098
|
-
var Surface =
|
|
8392
|
+
var React51 = __toESM(require_react(), 1);
|
|
8393
|
+
var h10 = React51.createElement;
|
|
8394
|
+
var Surface = React51.forwardRef(function Surface2(props, ref) {
|
|
8099
8395
|
const t = props.texture || "mesh";
|
|
8100
8396
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8101
|
-
return
|
|
8397
|
+
return h10(
|
|
8102
8398
|
props.as || "div",
|
|
8103
8399
|
Object.assign({}, rest, {
|
|
8104
8400
|
ref,
|
|
@@ -8116,14 +8412,14 @@ window.Aura = (() => {
|
|
|
8116
8412
|
});
|
|
8117
8413
|
|
|
8118
8414
|
// src/Stat.tsx
|
|
8119
|
-
var
|
|
8120
|
-
var Stat =
|
|
8415
|
+
var React52 = __toESM(require_react(), 1);
|
|
8416
|
+
var Stat = React52.forwardRef(function Stat2(props, ref) {
|
|
8121
8417
|
const Link = useLinkComponent(props.linkComponent);
|
|
8122
8418
|
return statElement(props, ref, Link);
|
|
8123
8419
|
});
|
|
8124
8420
|
|
|
8125
8421
|
// src/TimePicker.tsx
|
|
8126
|
-
var
|
|
8422
|
+
var React53 = __toESM(require_react(), 1);
|
|
8127
8423
|
var import_react_dom12 = __toESM(require_react_dom(), 1);
|
|
8128
8424
|
|
|
8129
8425
|
// src/text.ts
|
|
@@ -8165,7 +8461,7 @@ window.Aura = (() => {
|
|
|
8165
8461
|
function fromMin(n3) {
|
|
8166
8462
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8167
8463
|
}
|
|
8168
|
-
var TimePicker =
|
|
8464
|
+
var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
8169
8465
|
const t = useStrings();
|
|
8170
8466
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8171
8467
|
const st = useMaybeControlled(
|
|
@@ -8175,7 +8471,7 @@ window.Aura = (() => {
|
|
|
8175
8471
|
);
|
|
8176
8472
|
const value = st[0];
|
|
8177
8473
|
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;
|
|
8178
|
-
const slots =
|
|
8474
|
+
const slots = React53.useMemo(
|
|
8179
8475
|
function() {
|
|
8180
8476
|
const out = [];
|
|
8181
8477
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8187,12 +8483,12 @@ window.Aura = (() => {
|
|
|
8187
8483
|
const n3 = toMin(v);
|
|
8188
8484
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8189
8485
|
}
|
|
8190
|
-
const openState =
|
|
8191
|
-
const editState =
|
|
8192
|
-
const aState =
|
|
8193
|
-
const errState =
|
|
8194
|
-
const pos =
|
|
8195
|
-
const boxRef =
|
|
8486
|
+
const openState = React53.useState(false), open = openState[0], setOpen = openState[1];
|
|
8487
|
+
const editState = React53.useState(null), editing = editState[0], setEditing = editState[1];
|
|
8488
|
+
const aState = React53.useState(0), active = aState[0], setActive = aState[1];
|
|
8489
|
+
const errState = React53.useState(null);
|
|
8490
|
+
const pos = React53.useState(null);
|
|
8491
|
+
const boxRef = React53.useRef(null), inputRef = React53.useRef(null), listRef = React53.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8196
8492
|
const mounted = useMounted();
|
|
8197
8493
|
function nearest(v) {
|
|
8198
8494
|
const n3 = toMin(v);
|
|
@@ -8205,13 +8501,13 @@ window.Aura = (() => {
|
|
|
8205
8501
|
}
|
|
8206
8502
|
function place2() {
|
|
8207
8503
|
if (!boxRef.current) return;
|
|
8208
|
-
const
|
|
8504
|
+
const r2 = boxRef.current.getBoundingClientRect(), below2 = window.innerHeight - r2.bottom - 8, up2 = below2 < 200 && r2.top > below2;
|
|
8209
8505
|
pos[1]({
|
|
8210
|
-
left:
|
|
8211
|
-
width: Math.max(
|
|
8212
|
-
top: up2 ? void 0 :
|
|
8213
|
-
bottom: up2 ? window.innerHeight -
|
|
8214
|
-
maxHeight: Math.min(280, (up2 ?
|
|
8506
|
+
left: r2.left,
|
|
8507
|
+
width: Math.max(r2.width, 160),
|
|
8508
|
+
top: up2 ? void 0 : r2.bottom + 4,
|
|
8509
|
+
bottom: up2 ? window.innerHeight - r2.top + 4 : void 0,
|
|
8510
|
+
maxHeight: Math.min(280, (up2 ? r2.top : below2) - 8)
|
|
8215
8511
|
});
|
|
8216
8512
|
}
|
|
8217
8513
|
useIsoLayoutEffect(
|
|
@@ -8220,7 +8516,7 @@ window.Aura = (() => {
|
|
|
8220
8516
|
},
|
|
8221
8517
|
[open]
|
|
8222
8518
|
);
|
|
8223
|
-
|
|
8519
|
+
React53.useEffect(
|
|
8224
8520
|
function() {
|
|
8225
8521
|
if (!open) return;
|
|
8226
8522
|
function outside(e) {
|
|
@@ -8242,7 +8538,7 @@ window.Aura = (() => {
|
|
|
8242
8538
|
},
|
|
8243
8539
|
[open]
|
|
8244
8540
|
);
|
|
8245
|
-
|
|
8541
|
+
React53.useEffect(
|
|
8246
8542
|
function() {
|
|
8247
8543
|
if (!open || !listRef.current) return;
|
|
8248
8544
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8341,9 +8637,9 @@ window.Aura = (() => {
|
|
|
8341
8637
|
}
|
|
8342
8638
|
const error = errState[0] || props.error;
|
|
8343
8639
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8344
|
-
/* @__PURE__ */
|
|
8640
|
+
/* @__PURE__ */ React53.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React53.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
8345
8641
|
const dis = blocked(s), sel = s === value;
|
|
8346
|
-
return /* @__PURE__ */
|
|
8642
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8347
8643
|
"li",
|
|
8348
8644
|
{
|
|
8349
8645
|
key: s,
|
|
@@ -8368,13 +8664,13 @@ window.Aura = (() => {
|
|
|
8368
8664
|
if (active !== i) setActive(i);
|
|
8369
8665
|
}
|
|
8370
8666
|
},
|
|
8371
|
-
/* @__PURE__ */
|
|
8372
|
-
sel ? /* @__PURE__ */
|
|
8667
|
+
/* @__PURE__ */ React53.createElement("span", { className: "aura-combo__label" }, s),
|
|
8668
|
+
sel ? /* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
8373
8669
|
);
|
|
8374
8670
|
}))),
|
|
8375
8671
|
document.body
|
|
8376
8672
|
) : null;
|
|
8377
|
-
return /* @__PURE__ */
|
|
8673
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8378
8674
|
Field,
|
|
8379
8675
|
{
|
|
8380
8676
|
id,
|
|
@@ -8386,7 +8682,7 @@ window.Aura = (() => {
|
|
|
8386
8682
|
disabled: props.disabled,
|
|
8387
8683
|
className: props.className
|
|
8388
8684
|
},
|
|
8389
|
-
/* @__PURE__ */
|
|
8685
|
+
/* @__PURE__ */ React53.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconClock, null), className: "aura-input__icon" }), /* @__PURE__ */ React53.createElement(
|
|
8390
8686
|
"input",
|
|
8391
8687
|
{
|
|
8392
8688
|
ref: inputMerged,
|
|
@@ -8426,7 +8722,7 @@ window.Aura = (() => {
|
|
|
8426
8722
|
}, 0);
|
|
8427
8723
|
}
|
|
8428
8724
|
}
|
|
8429
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
8725
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React53.createElement(
|
|
8430
8726
|
"button",
|
|
8431
8727
|
{
|
|
8432
8728
|
type: "button",
|
|
@@ -8439,8 +8735,8 @@ window.Aura = (() => {
|
|
|
8439
8735
|
if (inputRef.current) inputRef.current.focus();
|
|
8440
8736
|
}
|
|
8441
8737
|
},
|
|
8442
|
-
/* @__PURE__ */
|
|
8443
|
-
) : null, /* @__PURE__ */
|
|
8738
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconX, null) })
|
|
8739
|
+
) : null, /* @__PURE__ */ React53.createElement(
|
|
8444
8740
|
"button",
|
|
8445
8741
|
{
|
|
8446
8742
|
type: "button",
|
|
@@ -8458,14 +8754,14 @@ window.Aura = (() => {
|
|
|
8458
8754
|
}
|
|
8459
8755
|
}
|
|
8460
8756
|
},
|
|
8461
|
-
/* @__PURE__ */
|
|
8757
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconChevronDown, null) })
|
|
8462
8758
|
)),
|
|
8463
8759
|
list
|
|
8464
8760
|
);
|
|
8465
8761
|
});
|
|
8466
8762
|
|
|
8467
8763
|
// src/FileUpload.tsx
|
|
8468
|
-
var
|
|
8764
|
+
var React54 = __toESM(require_react(), 1);
|
|
8469
8765
|
function matches(file, accept) {
|
|
8470
8766
|
if (!accept) return true;
|
|
8471
8767
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -8489,24 +8785,24 @@ window.Aura = (() => {
|
|
|
8489
8785
|
}).join(", ");
|
|
8490
8786
|
}
|
|
8491
8787
|
var seq = 0;
|
|
8492
|
-
var FileUpload =
|
|
8788
|
+
var FileUpload = React54.forwardRef(function FileUpload2(props, ref) {
|
|
8493
8789
|
const t = useStrings();
|
|
8494
8790
|
const auto = uid(), id = props.id || auto;
|
|
8495
8791
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
8496
8792
|
const items2 = st[0] || [];
|
|
8497
|
-
const dragState =
|
|
8498
|
-
const inputRef =
|
|
8499
|
-
const urls =
|
|
8793
|
+
const dragState = React54.useState(false), over = dragState[0];
|
|
8794
|
+
const inputRef = React54.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8795
|
+
const urls = React54.useRef({});
|
|
8500
8796
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
8501
8797
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
8502
|
-
|
|
8798
|
+
React54.useEffect(function() {
|
|
8503
8799
|
return function() {
|
|
8504
8800
|
Object.keys(urls.current).forEach(function(k) {
|
|
8505
8801
|
URL.revokeObjectURL(urls.current[k]);
|
|
8506
8802
|
});
|
|
8507
8803
|
};
|
|
8508
8804
|
}, []);
|
|
8509
|
-
|
|
8805
|
+
React54.useEffect(
|
|
8510
8806
|
function() {
|
|
8511
8807
|
const el = inputRef.current;
|
|
8512
8808
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -8566,7 +8862,7 @@ window.Aura = (() => {
|
|
|
8566
8862
|
if (inputRef.current) inputRef.current.focus();
|
|
8567
8863
|
}
|
|
8568
8864
|
const error = props.error;
|
|
8569
|
-
return /* @__PURE__ */
|
|
8865
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8570
8866
|
Field,
|
|
8571
8867
|
{
|
|
8572
8868
|
id,
|
|
@@ -8578,7 +8874,7 @@ window.Aura = (() => {
|
|
|
8578
8874
|
disabled: props.disabled,
|
|
8579
8875
|
className: props.className
|
|
8580
8876
|
},
|
|
8581
|
-
/* @__PURE__ */
|
|
8877
|
+
/* @__PURE__ */ React54.createElement(
|
|
8582
8878
|
"div",
|
|
8583
8879
|
{
|
|
8584
8880
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -8599,9 +8895,9 @@ window.Aura = (() => {
|
|
|
8599
8895
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
8600
8896
|
}
|
|
8601
8897
|
},
|
|
8602
|
-
/* @__PURE__ */
|
|
8603
|
-
/* @__PURE__ */
|
|
8604
|
-
/* @__PURE__ */
|
|
8898
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
8899
|
+
/* @__PURE__ */ React54.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
8900
|
+
/* @__PURE__ */ React54.createElement(
|
|
8605
8901
|
"input",
|
|
8606
8902
|
{
|
|
8607
8903
|
ref: inputMerged,
|
|
@@ -8623,12 +8919,12 @@ window.Aura = (() => {
|
|
|
8623
8919
|
}
|
|
8624
8920
|
}
|
|
8625
8921
|
),
|
|
8626
|
-
/* @__PURE__ */
|
|
8627
|
-
note ? /* @__PURE__ */
|
|
8922
|
+
/* @__PURE__ */ React54.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
8923
|
+
note ? /* @__PURE__ */ React54.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
8628
8924
|
),
|
|
8629
|
-
items2.length ? /* @__PURE__ */
|
|
8925
|
+
items2.length ? /* @__PURE__ */ React54.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
8630
8926
|
const src = thumb(it);
|
|
8631
|
-
return /* @__PURE__ */
|
|
8927
|
+
return /* @__PURE__ */ React54.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React54.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React54.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React54.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React54.createElement(IconImage, null) : /* @__PURE__ */ React54.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React54.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React54.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React54.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React54.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React54.createElement(
|
|
8632
8928
|
"span",
|
|
8633
8929
|
{
|
|
8634
8930
|
className: "aura-upload__bar",
|
|
@@ -8638,11 +8934,11 @@ window.Aura = (() => {
|
|
|
8638
8934
|
"aria-valuemax": 100,
|
|
8639
8935
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
8640
8936
|
},
|
|
8641
|
-
/* @__PURE__ */
|
|
8642
|
-
) : null), /* @__PURE__ */
|
|
8937
|
+
/* @__PURE__ */ React54.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
8938
|
+
) : null), /* @__PURE__ */ React54.createElement(
|
|
8643
8939
|
IconButton,
|
|
8644
8940
|
{
|
|
8645
|
-
icon: /* @__PURE__ */
|
|
8941
|
+
icon: /* @__PURE__ */ React54.createElement(IconX, null),
|
|
8646
8942
|
label: t.remove(it.name),
|
|
8647
8943
|
onClick: function() {
|
|
8648
8944
|
remove(it);
|
|
@@ -8655,14 +8951,14 @@ window.Aura = (() => {
|
|
|
8655
8951
|
|
|
8656
8952
|
// src/theme.ts
|
|
8657
8953
|
function hexToRgb(hex) {
|
|
8658
|
-
let
|
|
8659
|
-
if (
|
|
8660
|
-
|
|
8954
|
+
let h11 = String(hex).trim().replace("#", "");
|
|
8955
|
+
if (h11.length === 3)
|
|
8956
|
+
h11 = h11.split("").map(function(c) {
|
|
8661
8957
|
return c + c;
|
|
8662
8958
|
}).join("");
|
|
8663
|
-
if (!/^[0-9a-f]{6}$/i.test(
|
|
8959
|
+
if (!/^[0-9a-f]{6}$/i.test(h11)) throw new Error('createTheme: "' + hex + '" is not a #rgb or #rrggbb colour');
|
|
8664
8960
|
return [0, 2, 4].map(function(i) {
|
|
8665
|
-
return parseInt(
|
|
8961
|
+
return parseInt(h11.slice(i, i + 2), 16) / 255;
|
|
8666
8962
|
});
|
|
8667
8963
|
}
|
|
8668
8964
|
function rgbToHex(rgb) {
|
|
@@ -8678,10 +8974,10 @@ window.Aura = (() => {
|
|
|
8678
8974
|
return c <= 31308e-7 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
|
|
8679
8975
|
}
|
|
8680
8976
|
function rgbToOklch(rgb) {
|
|
8681
|
-
const
|
|
8682
|
-
const l = Math.cbrt(0.4122214708 *
|
|
8683
|
-
const m = Math.cbrt(0.2119034982 *
|
|
8684
|
-
const s = Math.cbrt(0.0883024619 *
|
|
8977
|
+
const r2 = lin(rgb[0]), g = lin(rgb[1]), b = lin(rgb[2]);
|
|
8978
|
+
const l = Math.cbrt(0.4122214708 * r2 + 0.5363325363 * g + 0.0514459929 * b);
|
|
8979
|
+
const m = Math.cbrt(0.2119034982 * r2 + 0.6806995451 * g + 0.1073969566 * b);
|
|
8980
|
+
const s = Math.cbrt(0.0883024619 * r2 + 0.2817188376 * g + 0.6299787005 * b);
|
|
8685
8981
|
const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
|
|
8686
8982
|
const A = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
|
|
8687
8983
|
const B = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
|
|
@@ -8841,13 +9137,13 @@ window.Aura = (() => {
|
|
|
8841
9137
|
D["card-shadow-creative"] = "8px 8px 0px " + shadowDark;
|
|
8842
9138
|
const checks = [];
|
|
8843
9139
|
function check(theme, fg, bg, target, fgHex, bgHex) {
|
|
8844
|
-
const
|
|
9140
|
+
const r2 = contrast(fgHex, bgHex);
|
|
8845
9141
|
checks.push({
|
|
8846
9142
|
theme,
|
|
8847
9143
|
pair: fg + " on " + bg,
|
|
8848
|
-
ratio: Math.round(
|
|
9144
|
+
ratio: Math.round(r2 * 100) / 100,
|
|
8849
9145
|
target,
|
|
8850
|
-
pass:
|
|
9146
|
+
pass: r2 >= target - 5e-3
|
|
8851
9147
|
});
|
|
8852
9148
|
}
|
|
8853
9149
|
[
|
|
@@ -8958,9 +9254,9 @@ window.Aura = (() => {
|
|
|
8958
9254
|
}
|
|
8959
9255
|
|
|
8960
9256
|
// src/ThemeStyle.tsx
|
|
8961
|
-
var
|
|
9257
|
+
var React55 = __toESM(require_react(), 1);
|
|
8962
9258
|
function ThemeStyle(props) {
|
|
8963
|
-
const css =
|
|
9259
|
+
const css = React55.useMemo(
|
|
8964
9260
|
function() {
|
|
8965
9261
|
try {
|
|
8966
9262
|
return createTheme({
|
|
@@ -8977,11 +9273,11 @@ window.Aura = (() => {
|
|
|
8977
9273
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
8978
9274
|
);
|
|
8979
9275
|
if (css === null) return null;
|
|
8980
|
-
return /* @__PURE__ */
|
|
9276
|
+
return /* @__PURE__ */ React55.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
8981
9277
|
}
|
|
8982
9278
|
|
|
8983
9279
|
// src/colorScheme.tsx
|
|
8984
|
-
var
|
|
9280
|
+
var React56 = __toESM(require_react(), 1);
|
|
8985
9281
|
|
|
8986
9282
|
// src/colorSchemeScript.ts
|
|
8987
9283
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -8998,7 +9294,7 @@ window.Aura = (() => {
|
|
|
8998
9294
|
|
|
8999
9295
|
// src/colorScheme.tsx
|
|
9000
9296
|
function ColorSchemeScript(props) {
|
|
9001
|
-
return /* @__PURE__ */
|
|
9297
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9002
9298
|
"script",
|
|
9003
9299
|
{
|
|
9004
9300
|
"data-aura-color-scheme": "",
|
|
@@ -9023,7 +9319,7 @@ window.Aura = (() => {
|
|
|
9023
9319
|
function useColorScheme(options) {
|
|
9024
9320
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9025
9321
|
const fallback = options && options.defaultScheme || "system";
|
|
9026
|
-
const subscribe2 =
|
|
9322
|
+
const subscribe2 = React56.useCallback(
|
|
9027
9323
|
function(cb) {
|
|
9028
9324
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9029
9325
|
function onSystem() {
|
|
@@ -9045,7 +9341,7 @@ window.Aura = (() => {
|
|
|
9045
9341
|
},
|
|
9046
9342
|
[fallback, key]
|
|
9047
9343
|
);
|
|
9048
|
-
const snapshot =
|
|
9344
|
+
const snapshot = React56.useSyncExternalStore(
|
|
9049
9345
|
subscribe2,
|
|
9050
9346
|
function() {
|
|
9051
9347
|
const s = readScheme(fallback);
|
|
@@ -9056,7 +9352,7 @@ window.Aura = (() => {
|
|
|
9056
9352
|
}
|
|
9057
9353
|
);
|
|
9058
9354
|
const parts = snapshot.split("|");
|
|
9059
|
-
const setScheme =
|
|
9355
|
+
const setScheme = React56.useCallback(
|
|
9060
9356
|
function(next) {
|
|
9061
9357
|
if (!valid(next)) return;
|
|
9062
9358
|
try {
|
|
@@ -9075,14 +9371,14 @@ window.Aura = (() => {
|
|
|
9075
9371
|
const cs = useColorScheme(props);
|
|
9076
9372
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9077
9373
|
const label = props.label || t.colorScheme;
|
|
9078
|
-
return /* @__PURE__ */
|
|
9374
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9079
9375
|
DropdownMenu,
|
|
9080
9376
|
{
|
|
9081
9377
|
label,
|
|
9082
|
-
trigger: /* @__PURE__ */
|
|
9378
|
+
trigger: /* @__PURE__ */ React56.createElement(
|
|
9083
9379
|
IconButton,
|
|
9084
9380
|
{
|
|
9085
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9381
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React56.createElement(IconMoon, null) : /* @__PURE__ */ React56.createElement(IconSun, null),
|
|
9086
9382
|
label: label + ": " + names[cs.scheme]
|
|
9087
9383
|
}
|
|
9088
9384
|
),
|
|
@@ -9100,14 +9396,14 @@ window.Aura = (() => {
|
|
|
9100
9396
|
}
|
|
9101
9397
|
|
|
9102
9398
|
// src/Badge.tsx
|
|
9103
|
-
var
|
|
9104
|
-
var Badge =
|
|
9399
|
+
var React57 = __toESM(require_react(), 1);
|
|
9400
|
+
var Badge = React57.forwardRef(function Badge2(props, ref) {
|
|
9105
9401
|
return badgeElement(props, ref);
|
|
9106
9402
|
});
|
|
9107
9403
|
|
|
9108
9404
|
// src/Progress.tsx
|
|
9109
|
-
var
|
|
9110
|
-
var Progress =
|
|
9405
|
+
var React58 = __toESM(require_react(), 1);
|
|
9406
|
+
var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
9111
9407
|
const t = useStrings();
|
|
9112
9408
|
const auto = uid(), id = props.id || auto;
|
|
9113
9409
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9116,7 +9412,7 @@ window.Aura = (() => {
|
|
|
9116
9412
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9117
9413
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9118
9414
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9119
|
-
return /* @__PURE__ */
|
|
9415
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9120
9416
|
"div",
|
|
9121
9417
|
{
|
|
9122
9418
|
ref,
|
|
@@ -9127,8 +9423,8 @@ window.Aura = (() => {
|
|
|
9127
9423
|
props.className
|
|
9128
9424
|
)
|
|
9129
9425
|
},
|
|
9130
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9131
|
-
/* @__PURE__ */
|
|
9426
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React58.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React58.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React58.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
9427
|
+
/* @__PURE__ */ React58.createElement(
|
|
9132
9428
|
"div",
|
|
9133
9429
|
{
|
|
9134
9430
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9140,8 +9436,8 @@ window.Aura = (() => {
|
|
|
9140
9436
|
"aria-valuenow": det ? props.value : void 0,
|
|
9141
9437
|
"aria-valuetext": det ? valueText : void 0
|
|
9142
9438
|
},
|
|
9143
|
-
/* @__PURE__ */
|
|
9144
|
-
sec ? /* @__PURE__ */
|
|
9439
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9440
|
+
sec ? /* @__PURE__ */ React58.createElement(
|
|
9145
9441
|
"span",
|
|
9146
9442
|
{
|
|
9147
9443
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9149,19 +9445,19 @@ window.Aura = (() => {
|
|
|
9149
9445
|
}
|
|
9150
9446
|
) : null
|
|
9151
9447
|
),
|
|
9152
|
-
props.hint ? /* @__PURE__ */
|
|
9448
|
+
props.hint ? /* @__PURE__ */ React58.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9153
9449
|
);
|
|
9154
9450
|
});
|
|
9155
9451
|
|
|
9156
9452
|
// src/Skeleton.tsx
|
|
9157
|
-
var
|
|
9158
|
-
var Skeleton =
|
|
9453
|
+
var React59 = __toESM(require_react(), 1);
|
|
9454
|
+
var Skeleton = React59.forwardRef(function Skeleton2(props, ref) {
|
|
9159
9455
|
const v = props.variant || "text";
|
|
9160
9456
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9161
9457
|
const n3 = props.lines, rows = [];
|
|
9162
9458
|
for (let i = 0; i < n3; i++)
|
|
9163
|
-
rows.push(/* @__PURE__ */
|
|
9164
|
-
return /* @__PURE__ */
|
|
9459
|
+
rows.push(/* @__PURE__ */ React59.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
9460
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9165
9461
|
"span",
|
|
9166
9462
|
{
|
|
9167
9463
|
ref,
|
|
@@ -9179,17 +9475,17 @@ window.Aura = (() => {
|
|
|
9179
9475
|
if (v === "circle") {
|
|
9180
9476
|
style.width = style.height = props.size || props.width || 40;
|
|
9181
9477
|
}
|
|
9182
|
-
return /* @__PURE__ */
|
|
9478
|
+
return /* @__PURE__ */ React59.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9183
9479
|
});
|
|
9184
9480
|
|
|
9185
9481
|
// src/EmptyState.tsx
|
|
9186
|
-
var
|
|
9187
|
-
var EmptyState =
|
|
9482
|
+
var React60 = __toESM(require_react(), 1);
|
|
9483
|
+
var EmptyState = React60.forwardRef(function EmptyState2(props, ref) {
|
|
9188
9484
|
return emptyStateElement(props, ref);
|
|
9189
9485
|
});
|
|
9190
9486
|
|
|
9191
9487
|
// src/Pagination.tsx
|
|
9192
|
-
var
|
|
9488
|
+
var React61 = __toESM(require_react(), 1);
|
|
9193
9489
|
function pageList(page, count, sib) {
|
|
9194
9490
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9195
9491
|
if (page - sib <= 3) {
|
|
@@ -9209,7 +9505,7 @@ window.Aura = (() => {
|
|
|
9209
9505
|
if (count > 1) out.push(count);
|
|
9210
9506
|
return out;
|
|
9211
9507
|
}
|
|
9212
|
-
var Pagination =
|
|
9508
|
+
var Pagination = React61.forwardRef(function Pagination2(props, ref) {
|
|
9213
9509
|
const t = useStrings();
|
|
9214
9510
|
useAutoTip();
|
|
9215
9511
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9229,7 +9525,7 @@ window.Aura = (() => {
|
|
|
9229
9525
|
},
|
|
9230
9526
|
extra
|
|
9231
9527
|
);
|
|
9232
|
-
return link ? /* @__PURE__ */
|
|
9528
|
+
return link ? /* @__PURE__ */ React61.createElement(
|
|
9233
9529
|
Link,
|
|
9234
9530
|
{
|
|
9235
9531
|
href: link(p),
|
|
@@ -9242,7 +9538,7 @@ window.Aura = (() => {
|
|
|
9242
9538
|
...common
|
|
9243
9539
|
},
|
|
9244
9540
|
label
|
|
9245
|
-
) : /* @__PURE__ */
|
|
9541
|
+
) : /* @__PURE__ */ React61.createElement(
|
|
9246
9542
|
"button",
|
|
9247
9543
|
{
|
|
9248
9544
|
type: "button",
|
|
@@ -9256,7 +9552,7 @@ window.Aura = (() => {
|
|
|
9256
9552
|
}
|
|
9257
9553
|
function arrow(p, icon, label, rel, disabled) {
|
|
9258
9554
|
if (!link || disabled)
|
|
9259
|
-
return /* @__PURE__ */
|
|
9555
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9260
9556
|
IconButton,
|
|
9261
9557
|
{
|
|
9262
9558
|
icon,
|
|
@@ -9267,7 +9563,7 @@ window.Aura = (() => {
|
|
|
9267
9563
|
}
|
|
9268
9564
|
}
|
|
9269
9565
|
);
|
|
9270
|
-
return /* @__PURE__ */
|
|
9566
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9271
9567
|
Link,
|
|
9272
9568
|
{
|
|
9273
9569
|
href: link(p),
|
|
@@ -9282,17 +9578,17 @@ window.Aura = (() => {
|
|
|
9282
9578
|
}
|
|
9283
9579
|
}
|
|
9284
9580
|
},
|
|
9285
|
-
/* @__PURE__ */
|
|
9581
|
+
/* @__PURE__ */ React61.createElement(Icon, { name: icon, size: "sm" })
|
|
9286
9582
|
);
|
|
9287
9583
|
}
|
|
9288
|
-
return /* @__PURE__ */
|
|
9289
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9290
|
-
})), /* @__PURE__ */
|
|
9584
|
+
return /* @__PURE__ */ React61.createElement("nav", { ref, className: cx("aura-pagination", props.className), "aria-label": props.label || t.pagination }, arrow(page - 1, /* @__PURE__ */ React61.createElement(IconChevronLeft, null), t.prevPage, "prev", page <= 1), /* @__PURE__ */ React61.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
9585
|
+
return typeof p === "number" ? /* @__PURE__ */ React61.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React61.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
9586
|
+
})), /* @__PURE__ */ React61.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React61.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
|
|
9291
9587
|
});
|
|
9292
9588
|
|
|
9293
9589
|
// src/Accordion.tsx
|
|
9294
|
-
var
|
|
9295
|
-
var Accordion =
|
|
9590
|
+
var React62 = __toESM(require_react(), 1);
|
|
9591
|
+
var Accordion = React62.forwardRef(function Accordion2(props, ref) {
|
|
9296
9592
|
const auto = uid(), base = props.id || auto;
|
|
9297
9593
|
const multiple = props.type === "multiple";
|
|
9298
9594
|
const st = useMaybeControlled(
|
|
@@ -9330,9 +9626,9 @@ window.Aura = (() => {
|
|
|
9330
9626
|
n3.focus();
|
|
9331
9627
|
}
|
|
9332
9628
|
}
|
|
9333
|
-
return /* @__PURE__ */
|
|
9629
|
+
return /* @__PURE__ */ React62.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9334
9630
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9335
|
-
return /* @__PURE__ */
|
|
9631
|
+
return /* @__PURE__ */ React62.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React62.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React62.createElement(
|
|
9336
9632
|
"button",
|
|
9337
9633
|
{
|
|
9338
9634
|
type: "button",
|
|
@@ -9345,10 +9641,10 @@ window.Aura = (() => {
|
|
|
9345
9641
|
toggle(it.id);
|
|
9346
9642
|
}
|
|
9347
9643
|
},
|
|
9348
|
-
it.icon ? /* @__PURE__ */
|
|
9349
|
-
/* @__PURE__ */
|
|
9350
|
-
/* @__PURE__ */
|
|
9351
|
-
)), /* @__PURE__ */
|
|
9644
|
+
it.icon ? /* @__PURE__ */ React62.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
9645
|
+
/* @__PURE__ */ React62.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React62.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React62.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
|
|
9646
|
+
/* @__PURE__ */ React62.createElement(Icon, { name: /* @__PURE__ */ React62.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
9647
|
+
)), /* @__PURE__ */ React62.createElement(
|
|
9352
9648
|
"div",
|
|
9353
9649
|
{
|
|
9354
9650
|
id: pid,
|
|
@@ -9363,33 +9659,33 @@ window.Aura = (() => {
|
|
|
9363
9659
|
});
|
|
9364
9660
|
|
|
9365
9661
|
// src/Popover.tsx
|
|
9366
|
-
var
|
|
9662
|
+
var React63 = __toESM(require_react(), 1);
|
|
9367
9663
|
var import_react_dom13 = __toESM(require_react_dom(), 1);
|
|
9368
9664
|
function position(anchor, pop, placement) {
|
|
9369
|
-
const
|
|
9665
|
+
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
9370
9666
|
let side = (placement || "bottom-start").split("-")[0], align = (placement || "bottom-start").split("-")[1] || "start";
|
|
9371
|
-
if (side === "bottom" &&
|
|
9372
|
-
else if (side === "top" &&
|
|
9373
|
-
const below2 = vh -
|
|
9667
|
+
if (side === "bottom" && r2.bottom + gap + ph > vh - 8 && r2.top - gap - ph > 8) side = "top";
|
|
9668
|
+
else if (side === "top" && r2.top - gap - ph < 8 && r2.bottom + gap + ph < vh - 8) side = "bottom";
|
|
9669
|
+
const below2 = vh - r2.bottom - gap - 8, above = r2.top - gap - 8;
|
|
9374
9670
|
let maxHeight;
|
|
9375
9671
|
if (ph > below2 && ph > above) {
|
|
9376
9672
|
side = above > below2 ? "top" : "bottom";
|
|
9377
9673
|
maxHeight = Math.max(120, side === "top" ? above : below2);
|
|
9378
9674
|
}
|
|
9379
|
-
const
|
|
9380
|
-
const top = side === "top" ?
|
|
9381
|
-
const left = align === "end" ?
|
|
9675
|
+
const h11 = maxHeight ? Math.min(ph, maxHeight) : ph;
|
|
9676
|
+
const top = side === "top" ? r2.top - gap - h11 : r2.bottom + gap;
|
|
9677
|
+
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
9382
9678
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
9383
9679
|
}
|
|
9384
|
-
var Popover =
|
|
9680
|
+
var Popover = React63.forwardRef(function Popover2(props, ref) {
|
|
9385
9681
|
const t = useStrings();
|
|
9386
9682
|
const density = useDensity();
|
|
9387
9683
|
const auto = uid(), id = props.id || auto;
|
|
9388
9684
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
9389
9685
|
const open = !!st[0];
|
|
9390
|
-
const wrap =
|
|
9391
|
-
const pos =
|
|
9392
|
-
const inTree =
|
|
9686
|
+
const wrap = React63.useRef(null), pop = React63.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
9687
|
+
const pos = React63.useState(null), mounted = useMounted();
|
|
9688
|
+
const inTree = React63.useRef(false);
|
|
9393
9689
|
function trigger() {
|
|
9394
9690
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
9395
9691
|
}
|
|
@@ -9416,7 +9712,7 @@ window.Aura = (() => {
|
|
|
9416
9712
|
},
|
|
9417
9713
|
[open, mounted, props.placement]
|
|
9418
9714
|
);
|
|
9419
|
-
|
|
9715
|
+
React63.useEffect(
|
|
9420
9716
|
function() {
|
|
9421
9717
|
if (!open || !mounted) return;
|
|
9422
9718
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -9441,9 +9737,9 @@ window.Aura = (() => {
|
|
|
9441
9737
|
},
|
|
9442
9738
|
[open, mounted]
|
|
9443
9739
|
);
|
|
9444
|
-
const child =
|
|
9740
|
+
const child = React63.Children.only(props.trigger);
|
|
9445
9741
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
9446
|
-
/* @__PURE__ */
|
|
9742
|
+
/* @__PURE__ */ React63.createElement(
|
|
9447
9743
|
"div",
|
|
9448
9744
|
{
|
|
9449
9745
|
ref: popMerged,
|
|
@@ -9473,17 +9769,17 @@ window.Aura = (() => {
|
|
|
9473
9769
|
} else trapTab(e, pop.current);
|
|
9474
9770
|
}
|
|
9475
9771
|
},
|
|
9476
|
-
props.title ? /* @__PURE__ */
|
|
9772
|
+
props.title ? /* @__PURE__ */ React63.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React63.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React63.createElement(
|
|
9477
9773
|
IconButton,
|
|
9478
9774
|
{
|
|
9479
|
-
icon: /* @__PURE__ */
|
|
9775
|
+
icon: /* @__PURE__ */ React63.createElement(IconX, null),
|
|
9480
9776
|
label: t.close,
|
|
9481
9777
|
onClick: function() {
|
|
9482
9778
|
close(true);
|
|
9483
9779
|
}
|
|
9484
9780
|
}
|
|
9485
9781
|
)) : null,
|
|
9486
|
-
/* @__PURE__ */
|
|
9782
|
+
/* @__PURE__ */ React63.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
9487
9783
|
close: function() {
|
|
9488
9784
|
close(true);
|
|
9489
9785
|
}
|
|
@@ -9491,7 +9787,7 @@ window.Aura = (() => {
|
|
|
9491
9787
|
),
|
|
9492
9788
|
document.body
|
|
9493
9789
|
) : null;
|
|
9494
|
-
return /* @__PURE__ */
|
|
9790
|
+
return /* @__PURE__ */ React63.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React63.cloneElement(child, {
|
|
9495
9791
|
onClick: function(e) {
|
|
9496
9792
|
if (child.props.onClick) child.props.onClick(e);
|
|
9497
9793
|
st[1](!open);
|
|
@@ -9503,7 +9799,7 @@ window.Aura = (() => {
|
|
|
9503
9799
|
});
|
|
9504
9800
|
|
|
9505
9801
|
// src/NumberField.tsx
|
|
9506
|
-
var
|
|
9802
|
+
var React64 = __toESM(require_react(), 1);
|
|
9507
9803
|
function decimalsOf(n3) {
|
|
9508
9804
|
const s = String(n3);
|
|
9509
9805
|
const i = s.indexOf(".");
|
|
@@ -9516,7 +9812,7 @@ window.Aura = (() => {
|
|
|
9516
9812
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
9517
9813
|
return Number(s);
|
|
9518
9814
|
}
|
|
9519
|
-
var NumberField =
|
|
9815
|
+
var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
9520
9816
|
const t = useStrings();
|
|
9521
9817
|
const auto = uid(), id = props.id || auto;
|
|
9522
9818
|
const step = props.step || 1;
|
|
@@ -9527,7 +9823,7 @@ window.Aura = (() => {
|
|
|
9527
9823
|
props.onChange
|
|
9528
9824
|
);
|
|
9529
9825
|
const value = st[0], setValue = st[1];
|
|
9530
|
-
const draftState =
|
|
9826
|
+
const draftState = React64.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
9531
9827
|
function fmt2(n3) {
|
|
9532
9828
|
if (n3 == null || isNaN(n3)) return "";
|
|
9533
9829
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -9576,7 +9872,7 @@ window.Aura = (() => {
|
|
|
9576
9872
|
};
|
|
9577
9873
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
9578
9874
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
9579
|
-
return /* @__PURE__ */
|
|
9875
|
+
return /* @__PURE__ */ React64.createElement(
|
|
9580
9876
|
Field,
|
|
9581
9877
|
{
|
|
9582
9878
|
id,
|
|
@@ -9588,7 +9884,7 @@ window.Aura = (() => {
|
|
|
9588
9884
|
disabled: props.disabled,
|
|
9589
9885
|
className: props.className
|
|
9590
9886
|
},
|
|
9591
|
-
/* @__PURE__ */
|
|
9887
|
+
/* @__PURE__ */ React64.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React64.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React64.createElement(
|
|
9592
9888
|
"input",
|
|
9593
9889
|
{
|
|
9594
9890
|
ref,
|
|
@@ -9635,7 +9931,7 @@ window.Aura = (() => {
|
|
|
9635
9931
|
},
|
|
9636
9932
|
onKeyDown
|
|
9637
9933
|
}
|
|
9638
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
9934
|
+
), props.suffix != null ? /* @__PURE__ */ React64.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React64.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React64.createElement(
|
|
9639
9935
|
"button",
|
|
9640
9936
|
{
|
|
9641
9937
|
type: "button",
|
|
@@ -9651,8 +9947,8 @@ window.Aura = (() => {
|
|
|
9651
9947
|
nudge(-step);
|
|
9652
9948
|
}
|
|
9653
9949
|
},
|
|
9654
|
-
/* @__PURE__ */
|
|
9655
|
-
), /* @__PURE__ */
|
|
9950
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconMinus, null) })
|
|
9951
|
+
), /* @__PURE__ */ React64.createElement(
|
|
9656
9952
|
"button",
|
|
9657
9953
|
{
|
|
9658
9954
|
type: "button",
|
|
@@ -9668,14 +9964,14 @@ window.Aura = (() => {
|
|
|
9668
9964
|
nudge(step);
|
|
9669
9965
|
}
|
|
9670
9966
|
},
|
|
9671
|
-
/* @__PURE__ */
|
|
9967
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconPlus, null) })
|
|
9672
9968
|
)) : null)
|
|
9673
9969
|
);
|
|
9674
9970
|
});
|
|
9675
9971
|
|
|
9676
9972
|
// src/Stepper.tsx
|
|
9677
|
-
var
|
|
9678
|
-
var Stepper =
|
|
9973
|
+
var React65 = __toESM(require_react(), 1);
|
|
9974
|
+
var Stepper = React65.forwardRef(function Stepper2(props, ref) {
|
|
9679
9975
|
const t = useStrings();
|
|
9680
9976
|
const idBase = uid();
|
|
9681
9977
|
const steps = props.steps || [];
|
|
@@ -9686,22 +9982,22 @@ window.Aura = (() => {
|
|
|
9686
9982
|
if (at < 0) at = 0;
|
|
9687
9983
|
const vertical = props.orientation === "vertical";
|
|
9688
9984
|
const cur2 = steps[at];
|
|
9689
|
-
return /* @__PURE__ */
|
|
9985
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9690
9986
|
"nav",
|
|
9691
9987
|
{
|
|
9692
9988
|
ref,
|
|
9693
9989
|
"aria-label": props.label,
|
|
9694
9990
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
9695
9991
|
},
|
|
9696
|
-
/* @__PURE__ */
|
|
9992
|
+
/* @__PURE__ */ React65.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
9697
9993
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
9698
9994
|
const error = s.status === "error";
|
|
9699
|
-
const marker = /* @__PURE__ */
|
|
9995
|
+
const marker = /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React65.createElement(Icon, { name: /* @__PURE__ */ React65.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React65.createElement(Icon, { name: /* @__PURE__ */ React65.createElement(IconCheck, null) }) : i + 1);
|
|
9700
9996
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
9701
9997
|
const clickable = state === "done" && !!props.onStepClick;
|
|
9702
9998
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
9703
9999
|
const descId = idBase + "-step-" + i;
|
|
9704
|
-
const text2 = /* @__PURE__ */
|
|
10000
|
+
const text2 = /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React65.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React65.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React65.createElement(
|
|
9705
10001
|
"span",
|
|
9706
10002
|
{
|
|
9707
10003
|
className: "aura-stepper__desc",
|
|
@@ -9710,14 +10006,14 @@ window.Aura = (() => {
|
|
|
9710
10006
|
},
|
|
9711
10007
|
s.description
|
|
9712
10008
|
) : null);
|
|
9713
|
-
return /* @__PURE__ */
|
|
10009
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9714
10010
|
"li",
|
|
9715
10011
|
{
|
|
9716
10012
|
key: s.id,
|
|
9717
10013
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
9718
10014
|
"aria-current": state === "current" ? "step" : void 0
|
|
9719
10015
|
},
|
|
9720
|
-
clickable ? /* @__PURE__ */
|
|
10016
|
+
clickable ? /* @__PURE__ */ React65.createElement(
|
|
9721
10017
|
"button",
|
|
9722
10018
|
{
|
|
9723
10019
|
type: "button",
|
|
@@ -9729,19 +10025,19 @@ window.Aura = (() => {
|
|
|
9729
10025
|
},
|
|
9730
10026
|
marker,
|
|
9731
10027
|
text2
|
|
9732
|
-
) : /* @__PURE__ */
|
|
10028
|
+
) : /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
9733
10029
|
);
|
|
9734
10030
|
})),
|
|
9735
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10031
|
+
!vertical && cur2 ? /* @__PURE__ */ React65.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
|
|
9736
10032
|
);
|
|
9737
10033
|
});
|
|
9738
10034
|
|
|
9739
10035
|
// src/SegmentedControl.tsx
|
|
9740
|
-
var
|
|
10036
|
+
var React66 = __toESM(require_react(), 1);
|
|
9741
10037
|
function toOpt2(o) {
|
|
9742
10038
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
9743
10039
|
}
|
|
9744
|
-
var SegmentedControl =
|
|
10040
|
+
var SegmentedControl = React66.forwardRef(
|
|
9745
10041
|
function SegmentedControl2(props, ref) {
|
|
9746
10042
|
const options = (props.options || []).map(toOpt2);
|
|
9747
10043
|
useAutoTip();
|
|
@@ -9755,7 +10051,7 @@ window.Aura = (() => {
|
|
|
9755
10051
|
);
|
|
9756
10052
|
const value = st[0], setValue = st[1];
|
|
9757
10053
|
const auto = uid(), id = props.id || auto;
|
|
9758
|
-
const refs =
|
|
10054
|
+
const refs = React66.useRef([]);
|
|
9759
10055
|
const selIdx = options.findIndex(function(o) {
|
|
9760
10056
|
return o.value === value;
|
|
9761
10057
|
});
|
|
@@ -9788,7 +10084,7 @@ window.Aura = (() => {
|
|
|
9788
10084
|
move(options.length, -1);
|
|
9789
10085
|
}
|
|
9790
10086
|
}
|
|
9791
|
-
return /* @__PURE__ */
|
|
10087
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9792
10088
|
"div",
|
|
9793
10089
|
{
|
|
9794
10090
|
ref,
|
|
@@ -9807,7 +10103,7 @@ window.Aura = (() => {
|
|
|
9807
10103
|
options.map(function(o, i) {
|
|
9808
10104
|
const on = o.value === value;
|
|
9809
10105
|
const off = props.disabled || o.disabled;
|
|
9810
|
-
return /* @__PURE__ */
|
|
10106
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9811
10107
|
"button",
|
|
9812
10108
|
{
|
|
9813
10109
|
key: o.value,
|
|
@@ -9829,8 +10125,8 @@ window.Aura = (() => {
|
|
|
9829
10125
|
onKeyDown(e, i);
|
|
9830
10126
|
}
|
|
9831
10127
|
},
|
|
9832
|
-
o.icon ? /* @__PURE__ */
|
|
9833
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10128
|
+
o.icon ? /* @__PURE__ */ React66.createElement(Icon, { name: o.icon }) : null,
|
|
10129
|
+
o.iconOnly ? null : /* @__PURE__ */ React66.createElement("span", null, o.label)
|
|
9834
10130
|
);
|
|
9835
10131
|
})
|
|
9836
10132
|
);
|