@jirawatpyk/aura-react 5.33.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 +9 -2
- package/dist/aura.bundle.js +685 -409
- package/dist/cjs/index.cjs +684 -408
- 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 +111 -36
- package/dist/index.d.ts +111 -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 +263 -27
- package/dist/server/index.d.cts +75 -0
- package/dist/server/index.d.ts +75 -0
- package/dist/server/index.js +263 -27
- package/dist/styles.css +62 -0
- package/dist/styles.layer.css +62 -0
- 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,15 +7654,15 @@ 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" },
|
|
@@ -7646,39 +7675,286 @@ window.Aura = (() => {
|
|
|
7646
7675
|
);
|
|
7647
7676
|
});
|
|
7648
7677
|
|
|
7649
|
-
// src/
|
|
7678
|
+
// src/StatusTile.tsx
|
|
7679
|
+
var React45 = __toESM(require_react(), 1);
|
|
7680
|
+
|
|
7681
|
+
// src/tiles.tsx
|
|
7650
7682
|
var React44 = __toESM(require_react(), 1);
|
|
7651
|
-
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) {
|
|
7652
7928
|
const t = useStrings();
|
|
7653
7929
|
const bp = useBreakpoint();
|
|
7654
7930
|
const wide = bp === "lg" || bp === "xl";
|
|
7655
|
-
const st =
|
|
7656
|
-
|
|
7931
|
+
const st = React46.useState(false), open = st[0], setOpen = st[1];
|
|
7932
|
+
React46.useEffect(
|
|
7657
7933
|
function() {
|
|
7658
7934
|
if (wide) setOpen(false);
|
|
7659
7935
|
},
|
|
7660
7936
|
[wide]
|
|
7661
7937
|
);
|
|
7662
|
-
const navEl = props.nav &&
|
|
7938
|
+
const navEl = props.nav && React46.isValidElement(props.nav) ? props.nav : null;
|
|
7663
7939
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
7664
|
-
const navState =
|
|
7940
|
+
const navState = React46.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
7665
7941
|
function onNav(id) {
|
|
7666
7942
|
if (shared) navState[1](id);
|
|
7667
7943
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
7668
7944
|
}
|
|
7669
|
-
const rootRef =
|
|
7670
|
-
const barRef =
|
|
7945
|
+
const rootRef = React46.useRef(null);
|
|
7946
|
+
const barRef = React46.useRef(null);
|
|
7671
7947
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
7672
7948
|
const hasBar = !!(props.header || props.nav);
|
|
7673
|
-
const barH =
|
|
7949
|
+
const barH = React46.useState(null);
|
|
7674
7950
|
useIsoLayoutEffect(
|
|
7675
7951
|
function() {
|
|
7676
7952
|
const root = rootRef.current, bar = barRef.current;
|
|
7677
7953
|
if (!root || !bar) return;
|
|
7678
7954
|
function sync() {
|
|
7679
|
-
const
|
|
7680
|
-
root.style.setProperty("--aura-shell-bar-height",
|
|
7681
|
-
if (
|
|
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));
|
|
7682
7958
|
}
|
|
7683
7959
|
sync();
|
|
7684
7960
|
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
@@ -7690,8 +7966,8 @@ window.Aura = (() => {
|
|
|
7690
7966
|
},
|
|
7691
7967
|
[hasBar]
|
|
7692
7968
|
);
|
|
7693
|
-
const deskNav = navEl && shared ?
|
|
7694
|
-
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, {
|
|
7695
7971
|
value: shared ? navState[0] : navEl.props.value,
|
|
7696
7972
|
onChange: function(id) {
|
|
7697
7973
|
onNav(id);
|
|
@@ -7706,7 +7982,7 @@ window.Aura = (() => {
|
|
|
7706
7982
|
collapsed: false,
|
|
7707
7983
|
collapsible: false
|
|
7708
7984
|
}) : props.nav;
|
|
7709
|
-
return /* @__PURE__ */
|
|
7985
|
+
return /* @__PURE__ */ React46.createElement(
|
|
7710
7986
|
"div",
|
|
7711
7987
|
{
|
|
7712
7988
|
ref: mergedRef,
|
|
@@ -7721,8 +7997,8 @@ window.Aura = (() => {
|
|
|
7721
7997
|
props.className
|
|
7722
7998
|
)
|
|
7723
7999
|
},
|
|
7724
|
-
props.nav ? /* @__PURE__ */
|
|
7725
|
-
props.nav ? /* @__PURE__ */
|
|
8000
|
+
props.nav ? /* @__PURE__ */ React46.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8001
|
+
props.nav ? /* @__PURE__ */ React46.createElement(
|
|
7726
8002
|
Drawer,
|
|
7727
8003
|
{
|
|
7728
8004
|
open,
|
|
@@ -7739,7 +8015,7 @@ window.Aura = (() => {
|
|
|
7739
8015
|
},
|
|
7740
8016
|
drawerNav
|
|
7741
8017
|
) : null,
|
|
7742
|
-
/* @__PURE__ */
|
|
8018
|
+
/* @__PURE__ */ React46.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React46.createElement(
|
|
7743
8019
|
"header",
|
|
7744
8020
|
{
|
|
7745
8021
|
ref: barRef,
|
|
@@ -7748,11 +8024,11 @@ window.Aura = (() => {
|
|
|
7748
8024
|
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only"
|
|
7749
8025
|
)
|
|
7750
8026
|
},
|
|
7751
|
-
props.nav ? /* @__PURE__ */
|
|
8027
|
+
props.nav ? /* @__PURE__ */ React46.createElement(
|
|
7752
8028
|
IconButton,
|
|
7753
8029
|
{
|
|
7754
8030
|
className: "aura-shell__menu",
|
|
7755
|
-
icon: /* @__PURE__ */
|
|
8031
|
+
icon: /* @__PURE__ */ React46.createElement(IconMenu, null),
|
|
7756
8032
|
label: props.menuLabel || t.openNav,
|
|
7757
8033
|
size: "md",
|
|
7758
8034
|
onClick: function() {
|
|
@@ -7761,8 +8037,8 @@ window.Aura = (() => {
|
|
|
7761
8037
|
"aria-expanded": open
|
|
7762
8038
|
}
|
|
7763
8039
|
) : null,
|
|
7764
|
-
/* @__PURE__ */
|
|
7765
|
-
) : null, /* @__PURE__ */
|
|
8040
|
+
/* @__PURE__ */ React46.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8041
|
+
) : null, /* @__PURE__ */ React46.createElement(
|
|
7766
8042
|
"main",
|
|
7767
8043
|
{
|
|
7768
8044
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -7775,17 +8051,17 @@ window.Aura = (() => {
|
|
|
7775
8051
|
});
|
|
7776
8052
|
|
|
7777
8053
|
// src/ActionBar.tsx
|
|
7778
|
-
var
|
|
7779
|
-
var ActionBar =
|
|
8054
|
+
var React47 = __toESM(require_react(), 1);
|
|
8055
|
+
var ActionBar = React47.forwardRef(function ActionBar2(props, ref) {
|
|
7780
8056
|
const t = useStrings();
|
|
7781
8057
|
const bulk = props.selected != null;
|
|
7782
8058
|
const idle = bulk && !props.selected;
|
|
7783
8059
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
7784
|
-
const hasStart =
|
|
8060
|
+
const hasStart = React47.Children.toArray(props.start).some(function(c) {
|
|
7785
8061
|
return c !== "";
|
|
7786
8062
|
});
|
|
7787
|
-
const cameFrom =
|
|
7788
|
-
const own =
|
|
8063
|
+
const cameFrom = React47.useRef(null);
|
|
8064
|
+
const own = React47.useRef(null);
|
|
7789
8065
|
function clear() {
|
|
7790
8066
|
props.onClearSelection();
|
|
7791
8067
|
setTimeout(function() {
|
|
@@ -7794,7 +8070,7 @@ window.Aura = (() => {
|
|
|
7794
8070
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
7795
8071
|
}, 0);
|
|
7796
8072
|
}
|
|
7797
|
-
return /* @__PURE__ */
|
|
8073
|
+
return /* @__PURE__ */ React47.createElement(
|
|
7798
8074
|
"div",
|
|
7799
8075
|
{
|
|
7800
8076
|
ref: function(el) {
|
|
@@ -7815,16 +8091,16 @@ window.Aura = (() => {
|
|
|
7815
8091
|
props.className
|
|
7816
8092
|
)
|
|
7817
8093
|
},
|
|
7818
|
-
/* @__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)
|
|
7819
8095
|
);
|
|
7820
8096
|
});
|
|
7821
8097
|
|
|
7822
8098
|
// src/Separator.tsx
|
|
7823
|
-
var
|
|
7824
|
-
var Separator =
|
|
8099
|
+
var React48 = __toESM(require_react(), 1);
|
|
8100
|
+
var Separator = React48.forwardRef(function Separator2(props, ref) {
|
|
7825
8101
|
const vertical = props.orientation === "vertical";
|
|
7826
8102
|
const decorative = props.decorative !== false;
|
|
7827
|
-
return /* @__PURE__ */
|
|
8103
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7828
8104
|
"div",
|
|
7829
8105
|
{
|
|
7830
8106
|
ref,
|
|
@@ -7837,14 +8113,14 @@ window.Aura = (() => {
|
|
|
7837
8113
|
});
|
|
7838
8114
|
|
|
7839
8115
|
// src/Table.tsx
|
|
7840
|
-
var
|
|
7841
|
-
var StackLabels =
|
|
7842
|
-
var ColumnIndex =
|
|
7843
|
-
function
|
|
8116
|
+
var React49 = __toESM(require_react(), 1);
|
|
8117
|
+
var StackLabels = React49.createContext(null);
|
|
8118
|
+
var ColumnIndex = React49.createContext(-1);
|
|
8119
|
+
function flat2(children) {
|
|
7844
8120
|
const out = [];
|
|
7845
|
-
|
|
7846
|
-
if (
|
|
7847
|
-
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));
|
|
7848
8124
|
else out.push(c);
|
|
7849
8125
|
});
|
|
7850
8126
|
return out;
|
|
@@ -7857,7 +8133,7 @@ window.Aura = (() => {
|
|
|
7857
8133
|
});
|
|
7858
8134
|
return parts.length ? parts.join("") : void 0;
|
|
7859
8135
|
}
|
|
7860
|
-
if (
|
|
8136
|
+
if (React49.isValidElement(node)) {
|
|
7861
8137
|
const p = node.props;
|
|
7862
8138
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
7863
8139
|
return text(p.children);
|
|
@@ -7866,14 +8142,14 @@ window.Aura = (() => {
|
|
|
7866
8142
|
}
|
|
7867
8143
|
function headerLabels(children) {
|
|
7868
8144
|
let out = [];
|
|
7869
|
-
|
|
7870
|
-
if (out.length || !
|
|
7871
|
-
const row =
|
|
7872
|
-
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);
|
|
7873
8149
|
});
|
|
7874
8150
|
if (!row) return;
|
|
7875
|
-
|
|
7876
|
-
if (!
|
|
8151
|
+
flat2(row.props.children).forEach(function(cell) {
|
|
8152
|
+
if (!React49.isValidElement(cell)) return;
|
|
7877
8153
|
const p = cell.props;
|
|
7878
8154
|
const t = text(p.children);
|
|
7879
8155
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -7883,7 +8159,7 @@ window.Aura = (() => {
|
|
|
7883
8159
|
});
|
|
7884
8160
|
return out;
|
|
7885
8161
|
}
|
|
7886
|
-
var Table =
|
|
8162
|
+
var Table = React49.forwardRef(function Table2(props, ref) {
|
|
7887
8163
|
const {
|
|
7888
8164
|
caption,
|
|
7889
8165
|
captionHidden,
|
|
@@ -7913,12 +8189,12 @@ window.Aura = (() => {
|
|
|
7913
8189
|
"tbl-stack-labels",
|
|
7914
8190
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
7915
8191
|
);
|
|
7916
|
-
const outer =
|
|
8192
|
+
const outer = React49.useContext(StackLabels);
|
|
7917
8193
|
const pageDensity = useDensity();
|
|
7918
8194
|
const capId = uid();
|
|
7919
|
-
const wrap =
|
|
7920
|
-
const sc =
|
|
7921
|
-
const wide =
|
|
8195
|
+
const wrap = React49.useRef(null);
|
|
8196
|
+
const sc = React49.useState(false), scrolls = sc[0];
|
|
8197
|
+
const wide = React49.useState(false);
|
|
7922
8198
|
useIsoLayoutEffect(function() {
|
|
7923
8199
|
const el = wrap.current;
|
|
7924
8200
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -7935,7 +8211,7 @@ window.Aura = (() => {
|
|
|
7935
8211
|
ro.disconnect();
|
|
7936
8212
|
};
|
|
7937
8213
|
}, []);
|
|
7938
|
-
const table = /* @__PURE__ */
|
|
8214
|
+
const table = /* @__PURE__ */ React49.createElement(
|
|
7939
8215
|
"div",
|
|
7940
8216
|
{
|
|
7941
8217
|
ref: wrap,
|
|
@@ -7959,7 +8235,7 @@ window.Aura = (() => {
|
|
|
7959
8235
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
7960
8236
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
7961
8237
|
},
|
|
7962
|
-
/* @__PURE__ */
|
|
8238
|
+
/* @__PURE__ */ React49.createElement(
|
|
7963
8239
|
"table",
|
|
7964
8240
|
{
|
|
7965
8241
|
ref,
|
|
@@ -7975,11 +8251,11 @@ window.Aura = (() => {
|
|
|
7975
8251
|
role: stackBelow ? "table" : void 0,
|
|
7976
8252
|
...rest
|
|
7977
8253
|
},
|
|
7978
|
-
caption != null ? /* @__PURE__ */
|
|
7979
|
-
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
|
|
7980
8256
|
)
|
|
7981
8257
|
);
|
|
7982
|
-
return cards ? /* @__PURE__ */
|
|
8258
|
+
return cards ? /* @__PURE__ */ React49.createElement(
|
|
7983
8259
|
"div",
|
|
7984
8260
|
{
|
|
7985
8261
|
className: cx(
|
|
@@ -7992,10 +8268,10 @@ window.Aura = (() => {
|
|
|
7992
8268
|
) : table;
|
|
7993
8269
|
});
|
|
7994
8270
|
function section(tag, cls) {
|
|
7995
|
-
const C =
|
|
8271
|
+
const C = React49.forwardRef(function TableSection(props, ref) {
|
|
7996
8272
|
const { className, ...rest } = props;
|
|
7997
|
-
const stacked =
|
|
7998
|
-
return
|
|
8273
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
8274
|
+
return React49.createElement(
|
|
7999
8275
|
tag,
|
|
8000
8276
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8001
8277
|
);
|
|
@@ -8008,14 +8284,14 @@ window.Aura = (() => {
|
|
|
8008
8284
|
TBody.displayName = "TBody";
|
|
8009
8285
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
8010
8286
|
TFoot.displayName = "TFoot";
|
|
8011
|
-
var Tr =
|
|
8287
|
+
var Tr = React49.forwardRef(function Tr2(props, ref) {
|
|
8012
8288
|
const { className, children, ...rest } = props;
|
|
8013
|
-
const stacked =
|
|
8289
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
8014
8290
|
let col = 0;
|
|
8015
|
-
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) {
|
|
8016
8292
|
const at = col;
|
|
8017
|
-
if (
|
|
8018
|
-
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);
|
|
8019
8295
|
}) : children);
|
|
8020
8296
|
});
|
|
8021
8297
|
function cellClass(base, p) {
|
|
@@ -8029,10 +8305,10 @@ window.Aura = (() => {
|
|
|
8029
8305
|
p.className
|
|
8030
8306
|
);
|
|
8031
8307
|
}
|
|
8032
|
-
var Th =
|
|
8308
|
+
var Th = React49.forwardRef(function Th2(props, ref) {
|
|
8033
8309
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8034
|
-
const stacked =
|
|
8035
|
-
return /* @__PURE__ */
|
|
8310
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
8311
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8036
8312
|
"th",
|
|
8037
8313
|
{
|
|
8038
8314
|
ref,
|
|
@@ -8044,12 +8320,12 @@ window.Aura = (() => {
|
|
|
8044
8320
|
}
|
|
8045
8321
|
);
|
|
8046
8322
|
});
|
|
8047
|
-
var Td =
|
|
8323
|
+
var Td = React49.forwardRef(function Td2(props, ref) {
|
|
8048
8324
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8049
|
-
const labels =
|
|
8325
|
+
const labels = React49.useContext(StackLabels), col = React49.useContext(ColumnIndex);
|
|
8050
8326
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8051
8327
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8052
|
-
return /* @__PURE__ */
|
|
8328
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8053
8329
|
"td",
|
|
8054
8330
|
{
|
|
8055
8331
|
ref,
|
|
@@ -8063,8 +8339,8 @@ window.Aura = (() => {
|
|
|
8063
8339
|
});
|
|
8064
8340
|
|
|
8065
8341
|
// src/BottomNav.tsx
|
|
8066
|
-
var
|
|
8067
|
-
var BottomNav =
|
|
8342
|
+
var React50 = __toESM(require_react(), 1);
|
|
8343
|
+
var BottomNav = React50.forwardRef(function BottomNav2(props, ref) {
|
|
8068
8344
|
const t = useStrings();
|
|
8069
8345
|
const Link = useLinkComponent(props.linkComponent);
|
|
8070
8346
|
const st = useMaybeControlled(
|
|
@@ -8074,14 +8350,14 @@ window.Aura = (() => {
|
|
|
8074
8350
|
);
|
|
8075
8351
|
const active = st[0];
|
|
8076
8352
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8077
|
-
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(
|
|
8078
8354
|
"nav",
|
|
8079
8355
|
{
|
|
8080
8356
|
ref,
|
|
8081
8357
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide2, props.className),
|
|
8082
8358
|
"aria-label": props.label || t.mainNav
|
|
8083
8359
|
},
|
|
8084
|
-
/* @__PURE__ */
|
|
8360
|
+
/* @__PURE__ */ React50.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8085
8361
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8086
8362
|
devWarnOnce(
|
|
8087
8363
|
"bottomnav-label-" + it.id,
|
|
@@ -8102,23 +8378,23 @@ window.Aura = (() => {
|
|
|
8102
8378
|
}
|
|
8103
8379
|
};
|
|
8104
8380
|
const inner = [
|
|
8105
|
-
/* @__PURE__ */
|
|
8106
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8107
|
-
/* @__PURE__ */
|
|
8108
|
-
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
|
|
8109
8385
|
];
|
|
8110
|
-
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));
|
|
8111
8387
|
}))
|
|
8112
8388
|
));
|
|
8113
8389
|
});
|
|
8114
8390
|
|
|
8115
8391
|
// src/Surface.tsx
|
|
8116
|
-
var
|
|
8117
|
-
var
|
|
8118
|
-
var Surface =
|
|
8392
|
+
var React51 = __toESM(require_react(), 1);
|
|
8393
|
+
var h10 = React51.createElement;
|
|
8394
|
+
var Surface = React51.forwardRef(function Surface2(props, ref) {
|
|
8119
8395
|
const t = props.texture || "mesh";
|
|
8120
8396
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8121
|
-
return
|
|
8397
|
+
return h10(
|
|
8122
8398
|
props.as || "div",
|
|
8123
8399
|
Object.assign({}, rest, {
|
|
8124
8400
|
ref,
|
|
@@ -8136,14 +8412,14 @@ window.Aura = (() => {
|
|
|
8136
8412
|
});
|
|
8137
8413
|
|
|
8138
8414
|
// src/Stat.tsx
|
|
8139
|
-
var
|
|
8140
|
-
var Stat =
|
|
8415
|
+
var React52 = __toESM(require_react(), 1);
|
|
8416
|
+
var Stat = React52.forwardRef(function Stat2(props, ref) {
|
|
8141
8417
|
const Link = useLinkComponent(props.linkComponent);
|
|
8142
8418
|
return statElement(props, ref, Link);
|
|
8143
8419
|
});
|
|
8144
8420
|
|
|
8145
8421
|
// src/TimePicker.tsx
|
|
8146
|
-
var
|
|
8422
|
+
var React53 = __toESM(require_react(), 1);
|
|
8147
8423
|
var import_react_dom12 = __toESM(require_react_dom(), 1);
|
|
8148
8424
|
|
|
8149
8425
|
// src/text.ts
|
|
@@ -8185,7 +8461,7 @@ window.Aura = (() => {
|
|
|
8185
8461
|
function fromMin(n3) {
|
|
8186
8462
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8187
8463
|
}
|
|
8188
|
-
var TimePicker =
|
|
8464
|
+
var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
8189
8465
|
const t = useStrings();
|
|
8190
8466
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8191
8467
|
const st = useMaybeControlled(
|
|
@@ -8195,7 +8471,7 @@ window.Aura = (() => {
|
|
|
8195
8471
|
);
|
|
8196
8472
|
const value = st[0];
|
|
8197
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;
|
|
8198
|
-
const slots =
|
|
8474
|
+
const slots = React53.useMemo(
|
|
8199
8475
|
function() {
|
|
8200
8476
|
const out = [];
|
|
8201
8477
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8207,12 +8483,12 @@ window.Aura = (() => {
|
|
|
8207
8483
|
const n3 = toMin(v);
|
|
8208
8484
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8209
8485
|
}
|
|
8210
|
-
const openState =
|
|
8211
|
-
const editState =
|
|
8212
|
-
const aState =
|
|
8213
|
-
const errState =
|
|
8214
|
-
const pos =
|
|
8215
|
-
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);
|
|
8216
8492
|
const mounted = useMounted();
|
|
8217
8493
|
function nearest(v) {
|
|
8218
8494
|
const n3 = toMin(v);
|
|
@@ -8225,13 +8501,13 @@ window.Aura = (() => {
|
|
|
8225
8501
|
}
|
|
8226
8502
|
function place2() {
|
|
8227
8503
|
if (!boxRef.current) return;
|
|
8228
|
-
const
|
|
8504
|
+
const r2 = boxRef.current.getBoundingClientRect(), below2 = window.innerHeight - r2.bottom - 8, up2 = below2 < 200 && r2.top > below2;
|
|
8229
8505
|
pos[1]({
|
|
8230
|
-
left:
|
|
8231
|
-
width: Math.max(
|
|
8232
|
-
top: up2 ? void 0 :
|
|
8233
|
-
bottom: up2 ? window.innerHeight -
|
|
8234
|
-
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)
|
|
8235
8511
|
});
|
|
8236
8512
|
}
|
|
8237
8513
|
useIsoLayoutEffect(
|
|
@@ -8240,7 +8516,7 @@ window.Aura = (() => {
|
|
|
8240
8516
|
},
|
|
8241
8517
|
[open]
|
|
8242
8518
|
);
|
|
8243
|
-
|
|
8519
|
+
React53.useEffect(
|
|
8244
8520
|
function() {
|
|
8245
8521
|
if (!open) return;
|
|
8246
8522
|
function outside(e) {
|
|
@@ -8262,7 +8538,7 @@ window.Aura = (() => {
|
|
|
8262
8538
|
},
|
|
8263
8539
|
[open]
|
|
8264
8540
|
);
|
|
8265
|
-
|
|
8541
|
+
React53.useEffect(
|
|
8266
8542
|
function() {
|
|
8267
8543
|
if (!open || !listRef.current) return;
|
|
8268
8544
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8361,9 +8637,9 @@ window.Aura = (() => {
|
|
|
8361
8637
|
}
|
|
8362
8638
|
const error = errState[0] || props.error;
|
|
8363
8639
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8364
|
-
/* @__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) {
|
|
8365
8641
|
const dis = blocked(s), sel = s === value;
|
|
8366
|
-
return /* @__PURE__ */
|
|
8642
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8367
8643
|
"li",
|
|
8368
8644
|
{
|
|
8369
8645
|
key: s,
|
|
@@ -8388,13 +8664,13 @@ window.Aura = (() => {
|
|
|
8388
8664
|
if (active !== i) setActive(i);
|
|
8389
8665
|
}
|
|
8390
8666
|
},
|
|
8391
|
-
/* @__PURE__ */
|
|
8392
|
-
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
|
|
8393
8669
|
);
|
|
8394
8670
|
}))),
|
|
8395
8671
|
document.body
|
|
8396
8672
|
) : null;
|
|
8397
|
-
return /* @__PURE__ */
|
|
8673
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8398
8674
|
Field,
|
|
8399
8675
|
{
|
|
8400
8676
|
id,
|
|
@@ -8406,7 +8682,7 @@ window.Aura = (() => {
|
|
|
8406
8682
|
disabled: props.disabled,
|
|
8407
8683
|
className: props.className
|
|
8408
8684
|
},
|
|
8409
|
-
/* @__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(
|
|
8410
8686
|
"input",
|
|
8411
8687
|
{
|
|
8412
8688
|
ref: inputMerged,
|
|
@@ -8446,7 +8722,7 @@ window.Aura = (() => {
|
|
|
8446
8722
|
}, 0);
|
|
8447
8723
|
}
|
|
8448
8724
|
}
|
|
8449
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
8725
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React53.createElement(
|
|
8450
8726
|
"button",
|
|
8451
8727
|
{
|
|
8452
8728
|
type: "button",
|
|
@@ -8459,8 +8735,8 @@ window.Aura = (() => {
|
|
|
8459
8735
|
if (inputRef.current) inputRef.current.focus();
|
|
8460
8736
|
}
|
|
8461
8737
|
},
|
|
8462
|
-
/* @__PURE__ */
|
|
8463
|
-
) : null, /* @__PURE__ */
|
|
8738
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconX, null) })
|
|
8739
|
+
) : null, /* @__PURE__ */ React53.createElement(
|
|
8464
8740
|
"button",
|
|
8465
8741
|
{
|
|
8466
8742
|
type: "button",
|
|
@@ -8478,14 +8754,14 @@ window.Aura = (() => {
|
|
|
8478
8754
|
}
|
|
8479
8755
|
}
|
|
8480
8756
|
},
|
|
8481
|
-
/* @__PURE__ */
|
|
8757
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconChevronDown, null) })
|
|
8482
8758
|
)),
|
|
8483
8759
|
list
|
|
8484
8760
|
);
|
|
8485
8761
|
});
|
|
8486
8762
|
|
|
8487
8763
|
// src/FileUpload.tsx
|
|
8488
|
-
var
|
|
8764
|
+
var React54 = __toESM(require_react(), 1);
|
|
8489
8765
|
function matches(file, accept) {
|
|
8490
8766
|
if (!accept) return true;
|
|
8491
8767
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -8509,24 +8785,24 @@ window.Aura = (() => {
|
|
|
8509
8785
|
}).join(", ");
|
|
8510
8786
|
}
|
|
8511
8787
|
var seq = 0;
|
|
8512
|
-
var FileUpload =
|
|
8788
|
+
var FileUpload = React54.forwardRef(function FileUpload2(props, ref) {
|
|
8513
8789
|
const t = useStrings();
|
|
8514
8790
|
const auto = uid(), id = props.id || auto;
|
|
8515
8791
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
8516
8792
|
const items2 = st[0] || [];
|
|
8517
|
-
const dragState =
|
|
8518
|
-
const inputRef =
|
|
8519
|
-
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({});
|
|
8520
8796
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
8521
8797
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
8522
|
-
|
|
8798
|
+
React54.useEffect(function() {
|
|
8523
8799
|
return function() {
|
|
8524
8800
|
Object.keys(urls.current).forEach(function(k) {
|
|
8525
8801
|
URL.revokeObjectURL(urls.current[k]);
|
|
8526
8802
|
});
|
|
8527
8803
|
};
|
|
8528
8804
|
}, []);
|
|
8529
|
-
|
|
8805
|
+
React54.useEffect(
|
|
8530
8806
|
function() {
|
|
8531
8807
|
const el = inputRef.current;
|
|
8532
8808
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -8586,7 +8862,7 @@ window.Aura = (() => {
|
|
|
8586
8862
|
if (inputRef.current) inputRef.current.focus();
|
|
8587
8863
|
}
|
|
8588
8864
|
const error = props.error;
|
|
8589
|
-
return /* @__PURE__ */
|
|
8865
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8590
8866
|
Field,
|
|
8591
8867
|
{
|
|
8592
8868
|
id,
|
|
@@ -8598,7 +8874,7 @@ window.Aura = (() => {
|
|
|
8598
8874
|
disabled: props.disabled,
|
|
8599
8875
|
className: props.className
|
|
8600
8876
|
},
|
|
8601
|
-
/* @__PURE__ */
|
|
8877
|
+
/* @__PURE__ */ React54.createElement(
|
|
8602
8878
|
"div",
|
|
8603
8879
|
{
|
|
8604
8880
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -8619,9 +8895,9 @@ window.Aura = (() => {
|
|
|
8619
8895
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
8620
8896
|
}
|
|
8621
8897
|
},
|
|
8622
|
-
/* @__PURE__ */
|
|
8623
|
-
/* @__PURE__ */
|
|
8624
|
-
/* @__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(
|
|
8625
8901
|
"input",
|
|
8626
8902
|
{
|
|
8627
8903
|
ref: inputMerged,
|
|
@@ -8643,12 +8919,12 @@ window.Aura = (() => {
|
|
|
8643
8919
|
}
|
|
8644
8920
|
}
|
|
8645
8921
|
),
|
|
8646
|
-
/* @__PURE__ */
|
|
8647
|
-
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
|
|
8648
8924
|
),
|
|
8649
|
-
items2.length ? /* @__PURE__ */
|
|
8925
|
+
items2.length ? /* @__PURE__ */ React54.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
8650
8926
|
const src = thumb(it);
|
|
8651
|
-
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(
|
|
8652
8928
|
"span",
|
|
8653
8929
|
{
|
|
8654
8930
|
className: "aura-upload__bar",
|
|
@@ -8658,11 +8934,11 @@ window.Aura = (() => {
|
|
|
8658
8934
|
"aria-valuemax": 100,
|
|
8659
8935
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
8660
8936
|
},
|
|
8661
|
-
/* @__PURE__ */
|
|
8662
|
-
) : null), /* @__PURE__ */
|
|
8937
|
+
/* @__PURE__ */ React54.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
8938
|
+
) : null), /* @__PURE__ */ React54.createElement(
|
|
8663
8939
|
IconButton,
|
|
8664
8940
|
{
|
|
8665
|
-
icon: /* @__PURE__ */
|
|
8941
|
+
icon: /* @__PURE__ */ React54.createElement(IconX, null),
|
|
8666
8942
|
label: t.remove(it.name),
|
|
8667
8943
|
onClick: function() {
|
|
8668
8944
|
remove(it);
|
|
@@ -8675,14 +8951,14 @@ window.Aura = (() => {
|
|
|
8675
8951
|
|
|
8676
8952
|
// src/theme.ts
|
|
8677
8953
|
function hexToRgb(hex) {
|
|
8678
|
-
let
|
|
8679
|
-
if (
|
|
8680
|
-
|
|
8954
|
+
let h11 = String(hex).trim().replace("#", "");
|
|
8955
|
+
if (h11.length === 3)
|
|
8956
|
+
h11 = h11.split("").map(function(c) {
|
|
8681
8957
|
return c + c;
|
|
8682
8958
|
}).join("");
|
|
8683
|
-
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');
|
|
8684
8960
|
return [0, 2, 4].map(function(i) {
|
|
8685
|
-
return parseInt(
|
|
8961
|
+
return parseInt(h11.slice(i, i + 2), 16) / 255;
|
|
8686
8962
|
});
|
|
8687
8963
|
}
|
|
8688
8964
|
function rgbToHex(rgb) {
|
|
@@ -8698,10 +8974,10 @@ window.Aura = (() => {
|
|
|
8698
8974
|
return c <= 31308e-7 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
|
|
8699
8975
|
}
|
|
8700
8976
|
function rgbToOklch(rgb) {
|
|
8701
|
-
const
|
|
8702
|
-
const l = Math.cbrt(0.4122214708 *
|
|
8703
|
-
const m = Math.cbrt(0.2119034982 *
|
|
8704
|
-
const s = Math.cbrt(0.0883024619 *
|
|
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);
|
|
8705
8981
|
const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
|
|
8706
8982
|
const A = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
|
|
8707
8983
|
const B = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
|
|
@@ -8861,13 +9137,13 @@ window.Aura = (() => {
|
|
|
8861
9137
|
D["card-shadow-creative"] = "8px 8px 0px " + shadowDark;
|
|
8862
9138
|
const checks = [];
|
|
8863
9139
|
function check(theme, fg, bg, target, fgHex, bgHex) {
|
|
8864
|
-
const
|
|
9140
|
+
const r2 = contrast(fgHex, bgHex);
|
|
8865
9141
|
checks.push({
|
|
8866
9142
|
theme,
|
|
8867
9143
|
pair: fg + " on " + bg,
|
|
8868
|
-
ratio: Math.round(
|
|
9144
|
+
ratio: Math.round(r2 * 100) / 100,
|
|
8869
9145
|
target,
|
|
8870
|
-
pass:
|
|
9146
|
+
pass: r2 >= target - 5e-3
|
|
8871
9147
|
});
|
|
8872
9148
|
}
|
|
8873
9149
|
[
|
|
@@ -8978,9 +9254,9 @@ window.Aura = (() => {
|
|
|
8978
9254
|
}
|
|
8979
9255
|
|
|
8980
9256
|
// src/ThemeStyle.tsx
|
|
8981
|
-
var
|
|
9257
|
+
var React55 = __toESM(require_react(), 1);
|
|
8982
9258
|
function ThemeStyle(props) {
|
|
8983
|
-
const css =
|
|
9259
|
+
const css = React55.useMemo(
|
|
8984
9260
|
function() {
|
|
8985
9261
|
try {
|
|
8986
9262
|
return createTheme({
|
|
@@ -8997,11 +9273,11 @@ window.Aura = (() => {
|
|
|
8997
9273
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
8998
9274
|
);
|
|
8999
9275
|
if (css === null) return null;
|
|
9000
|
-
return /* @__PURE__ */
|
|
9276
|
+
return /* @__PURE__ */ React55.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
9001
9277
|
}
|
|
9002
9278
|
|
|
9003
9279
|
// src/colorScheme.tsx
|
|
9004
|
-
var
|
|
9280
|
+
var React56 = __toESM(require_react(), 1);
|
|
9005
9281
|
|
|
9006
9282
|
// src/colorSchemeScript.ts
|
|
9007
9283
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9018,7 +9294,7 @@ window.Aura = (() => {
|
|
|
9018
9294
|
|
|
9019
9295
|
// src/colorScheme.tsx
|
|
9020
9296
|
function ColorSchemeScript(props) {
|
|
9021
|
-
return /* @__PURE__ */
|
|
9297
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9022
9298
|
"script",
|
|
9023
9299
|
{
|
|
9024
9300
|
"data-aura-color-scheme": "",
|
|
@@ -9043,7 +9319,7 @@ window.Aura = (() => {
|
|
|
9043
9319
|
function useColorScheme(options) {
|
|
9044
9320
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9045
9321
|
const fallback = options && options.defaultScheme || "system";
|
|
9046
|
-
const subscribe2 =
|
|
9322
|
+
const subscribe2 = React56.useCallback(
|
|
9047
9323
|
function(cb) {
|
|
9048
9324
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9049
9325
|
function onSystem() {
|
|
@@ -9065,7 +9341,7 @@ window.Aura = (() => {
|
|
|
9065
9341
|
},
|
|
9066
9342
|
[fallback, key]
|
|
9067
9343
|
);
|
|
9068
|
-
const snapshot =
|
|
9344
|
+
const snapshot = React56.useSyncExternalStore(
|
|
9069
9345
|
subscribe2,
|
|
9070
9346
|
function() {
|
|
9071
9347
|
const s = readScheme(fallback);
|
|
@@ -9076,7 +9352,7 @@ window.Aura = (() => {
|
|
|
9076
9352
|
}
|
|
9077
9353
|
);
|
|
9078
9354
|
const parts = snapshot.split("|");
|
|
9079
|
-
const setScheme =
|
|
9355
|
+
const setScheme = React56.useCallback(
|
|
9080
9356
|
function(next) {
|
|
9081
9357
|
if (!valid(next)) return;
|
|
9082
9358
|
try {
|
|
@@ -9095,14 +9371,14 @@ window.Aura = (() => {
|
|
|
9095
9371
|
const cs = useColorScheme(props);
|
|
9096
9372
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9097
9373
|
const label = props.label || t.colorScheme;
|
|
9098
|
-
return /* @__PURE__ */
|
|
9374
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9099
9375
|
DropdownMenu,
|
|
9100
9376
|
{
|
|
9101
9377
|
label,
|
|
9102
|
-
trigger: /* @__PURE__ */
|
|
9378
|
+
trigger: /* @__PURE__ */ React56.createElement(
|
|
9103
9379
|
IconButton,
|
|
9104
9380
|
{
|
|
9105
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9381
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React56.createElement(IconMoon, null) : /* @__PURE__ */ React56.createElement(IconSun, null),
|
|
9106
9382
|
label: label + ": " + names[cs.scheme]
|
|
9107
9383
|
}
|
|
9108
9384
|
),
|
|
@@ -9120,14 +9396,14 @@ window.Aura = (() => {
|
|
|
9120
9396
|
}
|
|
9121
9397
|
|
|
9122
9398
|
// src/Badge.tsx
|
|
9123
|
-
var
|
|
9124
|
-
var Badge =
|
|
9399
|
+
var React57 = __toESM(require_react(), 1);
|
|
9400
|
+
var Badge = React57.forwardRef(function Badge2(props, ref) {
|
|
9125
9401
|
return badgeElement(props, ref);
|
|
9126
9402
|
});
|
|
9127
9403
|
|
|
9128
9404
|
// src/Progress.tsx
|
|
9129
|
-
var
|
|
9130
|
-
var Progress =
|
|
9405
|
+
var React58 = __toESM(require_react(), 1);
|
|
9406
|
+
var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
9131
9407
|
const t = useStrings();
|
|
9132
9408
|
const auto = uid(), id = props.id || auto;
|
|
9133
9409
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9136,7 +9412,7 @@ window.Aura = (() => {
|
|
|
9136
9412
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9137
9413
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9138
9414
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9139
|
-
return /* @__PURE__ */
|
|
9415
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9140
9416
|
"div",
|
|
9141
9417
|
{
|
|
9142
9418
|
ref,
|
|
@@ -9147,8 +9423,8 @@ window.Aura = (() => {
|
|
|
9147
9423
|
props.className
|
|
9148
9424
|
)
|
|
9149
9425
|
},
|
|
9150
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9151
|
-
/* @__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(
|
|
9152
9428
|
"div",
|
|
9153
9429
|
{
|
|
9154
9430
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9160,8 +9436,8 @@ window.Aura = (() => {
|
|
|
9160
9436
|
"aria-valuenow": det ? props.value : void 0,
|
|
9161
9437
|
"aria-valuetext": det ? valueText : void 0
|
|
9162
9438
|
},
|
|
9163
|
-
/* @__PURE__ */
|
|
9164
|
-
sec ? /* @__PURE__ */
|
|
9439
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9440
|
+
sec ? /* @__PURE__ */ React58.createElement(
|
|
9165
9441
|
"span",
|
|
9166
9442
|
{
|
|
9167
9443
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9169,19 +9445,19 @@ window.Aura = (() => {
|
|
|
9169
9445
|
}
|
|
9170
9446
|
) : null
|
|
9171
9447
|
),
|
|
9172
|
-
props.hint ? /* @__PURE__ */
|
|
9448
|
+
props.hint ? /* @__PURE__ */ React58.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9173
9449
|
);
|
|
9174
9450
|
});
|
|
9175
9451
|
|
|
9176
9452
|
// src/Skeleton.tsx
|
|
9177
|
-
var
|
|
9178
|
-
var Skeleton =
|
|
9453
|
+
var React59 = __toESM(require_react(), 1);
|
|
9454
|
+
var Skeleton = React59.forwardRef(function Skeleton2(props, ref) {
|
|
9179
9455
|
const v = props.variant || "text";
|
|
9180
9456
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9181
9457
|
const n3 = props.lines, rows = [];
|
|
9182
9458
|
for (let i = 0; i < n3; i++)
|
|
9183
|
-
rows.push(/* @__PURE__ */
|
|
9184
|
-
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(
|
|
9185
9461
|
"span",
|
|
9186
9462
|
{
|
|
9187
9463
|
ref,
|
|
@@ -9199,17 +9475,17 @@ window.Aura = (() => {
|
|
|
9199
9475
|
if (v === "circle") {
|
|
9200
9476
|
style.width = style.height = props.size || props.width || 40;
|
|
9201
9477
|
}
|
|
9202
|
-
return /* @__PURE__ */
|
|
9478
|
+
return /* @__PURE__ */ React59.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9203
9479
|
});
|
|
9204
9480
|
|
|
9205
9481
|
// src/EmptyState.tsx
|
|
9206
|
-
var
|
|
9207
|
-
var EmptyState =
|
|
9482
|
+
var React60 = __toESM(require_react(), 1);
|
|
9483
|
+
var EmptyState = React60.forwardRef(function EmptyState2(props, ref) {
|
|
9208
9484
|
return emptyStateElement(props, ref);
|
|
9209
9485
|
});
|
|
9210
9486
|
|
|
9211
9487
|
// src/Pagination.tsx
|
|
9212
|
-
var
|
|
9488
|
+
var React61 = __toESM(require_react(), 1);
|
|
9213
9489
|
function pageList(page, count, sib) {
|
|
9214
9490
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9215
9491
|
if (page - sib <= 3) {
|
|
@@ -9229,7 +9505,7 @@ window.Aura = (() => {
|
|
|
9229
9505
|
if (count > 1) out.push(count);
|
|
9230
9506
|
return out;
|
|
9231
9507
|
}
|
|
9232
|
-
var Pagination =
|
|
9508
|
+
var Pagination = React61.forwardRef(function Pagination2(props, ref) {
|
|
9233
9509
|
const t = useStrings();
|
|
9234
9510
|
useAutoTip();
|
|
9235
9511
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9249,7 +9525,7 @@ window.Aura = (() => {
|
|
|
9249
9525
|
},
|
|
9250
9526
|
extra
|
|
9251
9527
|
);
|
|
9252
|
-
return link ? /* @__PURE__ */
|
|
9528
|
+
return link ? /* @__PURE__ */ React61.createElement(
|
|
9253
9529
|
Link,
|
|
9254
9530
|
{
|
|
9255
9531
|
href: link(p),
|
|
@@ -9262,7 +9538,7 @@ window.Aura = (() => {
|
|
|
9262
9538
|
...common
|
|
9263
9539
|
},
|
|
9264
9540
|
label
|
|
9265
|
-
) : /* @__PURE__ */
|
|
9541
|
+
) : /* @__PURE__ */ React61.createElement(
|
|
9266
9542
|
"button",
|
|
9267
9543
|
{
|
|
9268
9544
|
type: "button",
|
|
@@ -9276,7 +9552,7 @@ window.Aura = (() => {
|
|
|
9276
9552
|
}
|
|
9277
9553
|
function arrow(p, icon, label, rel, disabled) {
|
|
9278
9554
|
if (!link || disabled)
|
|
9279
|
-
return /* @__PURE__ */
|
|
9555
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9280
9556
|
IconButton,
|
|
9281
9557
|
{
|
|
9282
9558
|
icon,
|
|
@@ -9287,7 +9563,7 @@ window.Aura = (() => {
|
|
|
9287
9563
|
}
|
|
9288
9564
|
}
|
|
9289
9565
|
);
|
|
9290
|
-
return /* @__PURE__ */
|
|
9566
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9291
9567
|
Link,
|
|
9292
9568
|
{
|
|
9293
9569
|
href: link(p),
|
|
@@ -9302,17 +9578,17 @@ window.Aura = (() => {
|
|
|
9302
9578
|
}
|
|
9303
9579
|
}
|
|
9304
9580
|
},
|
|
9305
|
-
/* @__PURE__ */
|
|
9581
|
+
/* @__PURE__ */ React61.createElement(Icon, { name: icon, size: "sm" })
|
|
9306
9582
|
);
|
|
9307
9583
|
}
|
|
9308
|
-
return /* @__PURE__ */
|
|
9309
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9310
|
-
})), /* @__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));
|
|
9311
9587
|
});
|
|
9312
9588
|
|
|
9313
9589
|
// src/Accordion.tsx
|
|
9314
|
-
var
|
|
9315
|
-
var Accordion =
|
|
9590
|
+
var React62 = __toESM(require_react(), 1);
|
|
9591
|
+
var Accordion = React62.forwardRef(function Accordion2(props, ref) {
|
|
9316
9592
|
const auto = uid(), base = props.id || auto;
|
|
9317
9593
|
const multiple = props.type === "multiple";
|
|
9318
9594
|
const st = useMaybeControlled(
|
|
@@ -9350,9 +9626,9 @@ window.Aura = (() => {
|
|
|
9350
9626
|
n3.focus();
|
|
9351
9627
|
}
|
|
9352
9628
|
}
|
|
9353
|
-
return /* @__PURE__ */
|
|
9629
|
+
return /* @__PURE__ */ React62.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9354
9630
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9355
|
-
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(
|
|
9356
9632
|
"button",
|
|
9357
9633
|
{
|
|
9358
9634
|
type: "button",
|
|
@@ -9365,10 +9641,10 @@ window.Aura = (() => {
|
|
|
9365
9641
|
toggle(it.id);
|
|
9366
9642
|
}
|
|
9367
9643
|
},
|
|
9368
|
-
it.icon ? /* @__PURE__ */
|
|
9369
|
-
/* @__PURE__ */
|
|
9370
|
-
/* @__PURE__ */
|
|
9371
|
-
)), /* @__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(
|
|
9372
9648
|
"div",
|
|
9373
9649
|
{
|
|
9374
9650
|
id: pid,
|
|
@@ -9383,33 +9659,33 @@ window.Aura = (() => {
|
|
|
9383
9659
|
});
|
|
9384
9660
|
|
|
9385
9661
|
// src/Popover.tsx
|
|
9386
|
-
var
|
|
9662
|
+
var React63 = __toESM(require_react(), 1);
|
|
9387
9663
|
var import_react_dom13 = __toESM(require_react_dom(), 1);
|
|
9388
9664
|
function position(anchor, pop, placement) {
|
|
9389
|
-
const
|
|
9665
|
+
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
9390
9666
|
let side = (placement || "bottom-start").split("-")[0], align = (placement || "bottom-start").split("-")[1] || "start";
|
|
9391
|
-
if (side === "bottom" &&
|
|
9392
|
-
else if (side === "top" &&
|
|
9393
|
-
const below2 = vh -
|
|
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;
|
|
9394
9670
|
let maxHeight;
|
|
9395
9671
|
if (ph > below2 && ph > above) {
|
|
9396
9672
|
side = above > below2 ? "top" : "bottom";
|
|
9397
9673
|
maxHeight = Math.max(120, side === "top" ? above : below2);
|
|
9398
9674
|
}
|
|
9399
|
-
const
|
|
9400
|
-
const top = side === "top" ?
|
|
9401
|
-
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;
|
|
9402
9678
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
9403
9679
|
}
|
|
9404
|
-
var Popover =
|
|
9680
|
+
var Popover = React63.forwardRef(function Popover2(props, ref) {
|
|
9405
9681
|
const t = useStrings();
|
|
9406
9682
|
const density = useDensity();
|
|
9407
9683
|
const auto = uid(), id = props.id || auto;
|
|
9408
9684
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
9409
9685
|
const open = !!st[0];
|
|
9410
|
-
const wrap =
|
|
9411
|
-
const pos =
|
|
9412
|
-
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);
|
|
9413
9689
|
function trigger() {
|
|
9414
9690
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
9415
9691
|
}
|
|
@@ -9436,7 +9712,7 @@ window.Aura = (() => {
|
|
|
9436
9712
|
},
|
|
9437
9713
|
[open, mounted, props.placement]
|
|
9438
9714
|
);
|
|
9439
|
-
|
|
9715
|
+
React63.useEffect(
|
|
9440
9716
|
function() {
|
|
9441
9717
|
if (!open || !mounted) return;
|
|
9442
9718
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -9461,9 +9737,9 @@ window.Aura = (() => {
|
|
|
9461
9737
|
},
|
|
9462
9738
|
[open, mounted]
|
|
9463
9739
|
);
|
|
9464
|
-
const child =
|
|
9740
|
+
const child = React63.Children.only(props.trigger);
|
|
9465
9741
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
9466
|
-
/* @__PURE__ */
|
|
9742
|
+
/* @__PURE__ */ React63.createElement(
|
|
9467
9743
|
"div",
|
|
9468
9744
|
{
|
|
9469
9745
|
ref: popMerged,
|
|
@@ -9493,17 +9769,17 @@ window.Aura = (() => {
|
|
|
9493
9769
|
} else trapTab(e, pop.current);
|
|
9494
9770
|
}
|
|
9495
9771
|
},
|
|
9496
|
-
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(
|
|
9497
9773
|
IconButton,
|
|
9498
9774
|
{
|
|
9499
|
-
icon: /* @__PURE__ */
|
|
9775
|
+
icon: /* @__PURE__ */ React63.createElement(IconX, null),
|
|
9500
9776
|
label: t.close,
|
|
9501
9777
|
onClick: function() {
|
|
9502
9778
|
close(true);
|
|
9503
9779
|
}
|
|
9504
9780
|
}
|
|
9505
9781
|
)) : null,
|
|
9506
|
-
/* @__PURE__ */
|
|
9782
|
+
/* @__PURE__ */ React63.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
9507
9783
|
close: function() {
|
|
9508
9784
|
close(true);
|
|
9509
9785
|
}
|
|
@@ -9511,7 +9787,7 @@ window.Aura = (() => {
|
|
|
9511
9787
|
),
|
|
9512
9788
|
document.body
|
|
9513
9789
|
) : null;
|
|
9514
|
-
return /* @__PURE__ */
|
|
9790
|
+
return /* @__PURE__ */ React63.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React63.cloneElement(child, {
|
|
9515
9791
|
onClick: function(e) {
|
|
9516
9792
|
if (child.props.onClick) child.props.onClick(e);
|
|
9517
9793
|
st[1](!open);
|
|
@@ -9523,7 +9799,7 @@ window.Aura = (() => {
|
|
|
9523
9799
|
});
|
|
9524
9800
|
|
|
9525
9801
|
// src/NumberField.tsx
|
|
9526
|
-
var
|
|
9802
|
+
var React64 = __toESM(require_react(), 1);
|
|
9527
9803
|
function decimalsOf(n3) {
|
|
9528
9804
|
const s = String(n3);
|
|
9529
9805
|
const i = s.indexOf(".");
|
|
@@ -9536,7 +9812,7 @@ window.Aura = (() => {
|
|
|
9536
9812
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
9537
9813
|
return Number(s);
|
|
9538
9814
|
}
|
|
9539
|
-
var NumberField =
|
|
9815
|
+
var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
9540
9816
|
const t = useStrings();
|
|
9541
9817
|
const auto = uid(), id = props.id || auto;
|
|
9542
9818
|
const step = props.step || 1;
|
|
@@ -9547,7 +9823,7 @@ window.Aura = (() => {
|
|
|
9547
9823
|
props.onChange
|
|
9548
9824
|
);
|
|
9549
9825
|
const value = st[0], setValue = st[1];
|
|
9550
|
-
const draftState =
|
|
9826
|
+
const draftState = React64.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
9551
9827
|
function fmt2(n3) {
|
|
9552
9828
|
if (n3 == null || isNaN(n3)) return "";
|
|
9553
9829
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -9596,7 +9872,7 @@ window.Aura = (() => {
|
|
|
9596
9872
|
};
|
|
9597
9873
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
9598
9874
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
9599
|
-
return /* @__PURE__ */
|
|
9875
|
+
return /* @__PURE__ */ React64.createElement(
|
|
9600
9876
|
Field,
|
|
9601
9877
|
{
|
|
9602
9878
|
id,
|
|
@@ -9608,7 +9884,7 @@ window.Aura = (() => {
|
|
|
9608
9884
|
disabled: props.disabled,
|
|
9609
9885
|
className: props.className
|
|
9610
9886
|
},
|
|
9611
|
-
/* @__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(
|
|
9612
9888
|
"input",
|
|
9613
9889
|
{
|
|
9614
9890
|
ref,
|
|
@@ -9655,7 +9931,7 @@ window.Aura = (() => {
|
|
|
9655
9931
|
},
|
|
9656
9932
|
onKeyDown
|
|
9657
9933
|
}
|
|
9658
|
-
), 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(
|
|
9659
9935
|
"button",
|
|
9660
9936
|
{
|
|
9661
9937
|
type: "button",
|
|
@@ -9671,8 +9947,8 @@ window.Aura = (() => {
|
|
|
9671
9947
|
nudge(-step);
|
|
9672
9948
|
}
|
|
9673
9949
|
},
|
|
9674
|
-
/* @__PURE__ */
|
|
9675
|
-
), /* @__PURE__ */
|
|
9950
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconMinus, null) })
|
|
9951
|
+
), /* @__PURE__ */ React64.createElement(
|
|
9676
9952
|
"button",
|
|
9677
9953
|
{
|
|
9678
9954
|
type: "button",
|
|
@@ -9688,14 +9964,14 @@ window.Aura = (() => {
|
|
|
9688
9964
|
nudge(step);
|
|
9689
9965
|
}
|
|
9690
9966
|
},
|
|
9691
|
-
/* @__PURE__ */
|
|
9967
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconPlus, null) })
|
|
9692
9968
|
)) : null)
|
|
9693
9969
|
);
|
|
9694
9970
|
});
|
|
9695
9971
|
|
|
9696
9972
|
// src/Stepper.tsx
|
|
9697
|
-
var
|
|
9698
|
-
var Stepper =
|
|
9973
|
+
var React65 = __toESM(require_react(), 1);
|
|
9974
|
+
var Stepper = React65.forwardRef(function Stepper2(props, ref) {
|
|
9699
9975
|
const t = useStrings();
|
|
9700
9976
|
const idBase = uid();
|
|
9701
9977
|
const steps = props.steps || [];
|
|
@@ -9706,22 +9982,22 @@ window.Aura = (() => {
|
|
|
9706
9982
|
if (at < 0) at = 0;
|
|
9707
9983
|
const vertical = props.orientation === "vertical";
|
|
9708
9984
|
const cur2 = steps[at];
|
|
9709
|
-
return /* @__PURE__ */
|
|
9985
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9710
9986
|
"nav",
|
|
9711
9987
|
{
|
|
9712
9988
|
ref,
|
|
9713
9989
|
"aria-label": props.label,
|
|
9714
9990
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
9715
9991
|
},
|
|
9716
|
-
/* @__PURE__ */
|
|
9992
|
+
/* @__PURE__ */ React65.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
9717
9993
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
9718
9994
|
const error = s.status === "error";
|
|
9719
|
-
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);
|
|
9720
9996
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
9721
9997
|
const clickable = state === "done" && !!props.onStepClick;
|
|
9722
9998
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
9723
9999
|
const descId = idBase + "-step-" + i;
|
|
9724
|
-
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(
|
|
9725
10001
|
"span",
|
|
9726
10002
|
{
|
|
9727
10003
|
className: "aura-stepper__desc",
|
|
@@ -9730,14 +10006,14 @@ window.Aura = (() => {
|
|
|
9730
10006
|
},
|
|
9731
10007
|
s.description
|
|
9732
10008
|
) : null);
|
|
9733
|
-
return /* @__PURE__ */
|
|
10009
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9734
10010
|
"li",
|
|
9735
10011
|
{
|
|
9736
10012
|
key: s.id,
|
|
9737
10013
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
9738
10014
|
"aria-current": state === "current" ? "step" : void 0
|
|
9739
10015
|
},
|
|
9740
|
-
clickable ? /* @__PURE__ */
|
|
10016
|
+
clickable ? /* @__PURE__ */ React65.createElement(
|
|
9741
10017
|
"button",
|
|
9742
10018
|
{
|
|
9743
10019
|
type: "button",
|
|
@@ -9749,19 +10025,19 @@ window.Aura = (() => {
|
|
|
9749
10025
|
},
|
|
9750
10026
|
marker,
|
|
9751
10027
|
text2
|
|
9752
|
-
) : /* @__PURE__ */
|
|
10028
|
+
) : /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
9753
10029
|
);
|
|
9754
10030
|
})),
|
|
9755
|
-
!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
|
|
9756
10032
|
);
|
|
9757
10033
|
});
|
|
9758
10034
|
|
|
9759
10035
|
// src/SegmentedControl.tsx
|
|
9760
|
-
var
|
|
10036
|
+
var React66 = __toESM(require_react(), 1);
|
|
9761
10037
|
function toOpt2(o) {
|
|
9762
10038
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
9763
10039
|
}
|
|
9764
|
-
var SegmentedControl =
|
|
10040
|
+
var SegmentedControl = React66.forwardRef(
|
|
9765
10041
|
function SegmentedControl2(props, ref) {
|
|
9766
10042
|
const options = (props.options || []).map(toOpt2);
|
|
9767
10043
|
useAutoTip();
|
|
@@ -9775,7 +10051,7 @@ window.Aura = (() => {
|
|
|
9775
10051
|
);
|
|
9776
10052
|
const value = st[0], setValue = st[1];
|
|
9777
10053
|
const auto = uid(), id = props.id || auto;
|
|
9778
|
-
const refs =
|
|
10054
|
+
const refs = React66.useRef([]);
|
|
9779
10055
|
const selIdx = options.findIndex(function(o) {
|
|
9780
10056
|
return o.value === value;
|
|
9781
10057
|
});
|
|
@@ -9808,7 +10084,7 @@ window.Aura = (() => {
|
|
|
9808
10084
|
move(options.length, -1);
|
|
9809
10085
|
}
|
|
9810
10086
|
}
|
|
9811
|
-
return /* @__PURE__ */
|
|
10087
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9812
10088
|
"div",
|
|
9813
10089
|
{
|
|
9814
10090
|
ref,
|
|
@@ -9827,7 +10103,7 @@ window.Aura = (() => {
|
|
|
9827
10103
|
options.map(function(o, i) {
|
|
9828
10104
|
const on = o.value === value;
|
|
9829
10105
|
const off = props.disabled || o.disabled;
|
|
9830
|
-
return /* @__PURE__ */
|
|
10106
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9831
10107
|
"button",
|
|
9832
10108
|
{
|
|
9833
10109
|
key: o.value,
|
|
@@ -9849,8 +10125,8 @@ window.Aura = (() => {
|
|
|
9849
10125
|
onKeyDown(e, i);
|
|
9850
10126
|
}
|
|
9851
10127
|
},
|
|
9852
|
-
o.icon ? /* @__PURE__ */
|
|
9853
|
-
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)
|
|
9854
10130
|
);
|
|
9855
10131
|
})
|
|
9856
10132
|
);
|