@jirawatpyk/aura-react 5.32.0 → 5.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -2
- package/dist/aura.bundle.js +710 -414
- package/dist/cjs/index.cjs +709 -413
- package/dist/esm/AppShell.js +33 -14
- package/dist/esm/PageHeader.js +1 -0
- package/dist/esm/StatusTile.js +53 -0
- package/dist/esm/autoTip.js +5 -0
- package/dist/esm/breakpoints.js +18 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/responsive.js +1 -15
- package/dist/esm/strings.js +4 -0
- package/dist/esm/strings.sv.js +4 -0
- package/dist/esm/strings.th.js +4 -0
- package/dist/esm/tiles.js +212 -0
- package/dist/index.d.cts +119 -36
- package/dist/index.d.ts +119 -36
- package/dist/locales/sv.cjs +4 -0
- package/dist/locales/sv.d.cts +5 -0
- package/dist/locales/sv.d.ts +5 -0
- package/dist/locales/th.cjs +4 -0
- package/dist/locales/th.d.cts +5 -0
- package/dist/locales/th.d.ts +5 -0
- package/dist/server/index.cjs +264 -27
- package/dist/server/index.d.cts +79 -0
- package/dist/server/index.d.ts +79 -0
- package/dist/server/index.js +264 -27
- package/dist/styles.css +103 -24
- package/dist/styles.layer.css +103 -24
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -80,9 +80,11 @@ __export(index_exports, {
|
|
|
80
80
|
Separator: () => Separator,
|
|
81
81
|
SideNav: () => SideNav,
|
|
82
82
|
Skeleton: () => Skeleton,
|
|
83
|
+
Sparkline: () => Sparkline,
|
|
83
84
|
Stack: () => Stack,
|
|
84
85
|
Stat: () => Stat,
|
|
85
86
|
StatusPill: () => StatusPill,
|
|
87
|
+
StatusTile: () => StatusTile,
|
|
86
88
|
Stepper: () => Stepper,
|
|
87
89
|
Surface: () => Surface,
|
|
88
90
|
Switch: () => Switch,
|
|
@@ -97,6 +99,7 @@ __export(index_exports, {
|
|
|
97
99
|
Textarea: () => Textarea,
|
|
98
100
|
Th: () => Th,
|
|
99
101
|
ThemeStyle: () => ThemeStyle,
|
|
102
|
+
TileGrid: () => TileGrid,
|
|
100
103
|
TimePicker: () => TimePicker,
|
|
101
104
|
Toaster: () => Toaster,
|
|
102
105
|
Tooltip: () => Tooltip,
|
|
@@ -189,9 +192,9 @@ function iconSvg(shapes, props, ref) {
|
|
|
189
192
|
...a11y
|
|
190
193
|
},
|
|
191
194
|
shapes.map(function(s, i) {
|
|
192
|
-
const
|
|
193
|
-
for (const k in s[1])
|
|
194
|
-
return h(s[0],
|
|
195
|
+
const attrs2 = { key: i };
|
|
196
|
+
for (const k in s[1]) attrs2[k === "stroke-width" ? "strokeWidth" : k] = s[1][k];
|
|
197
|
+
return h(s[0], attrs2);
|
|
195
198
|
})
|
|
196
199
|
);
|
|
197
200
|
}
|
|
@@ -304,9 +307,9 @@ function compare(a, b) {
|
|
|
304
307
|
return collator ? collator.compare(String(a), String(b)) : String(a).localeCompare(String(b));
|
|
305
308
|
}
|
|
306
309
|
var uid = React3.useId || function() {
|
|
307
|
-
const
|
|
308
|
-
if (!
|
|
309
|
-
return
|
|
310
|
+
const r2 = React3.useRef(null);
|
|
311
|
+
if (!r2.current) r2.current = "aura-" + Math.random().toString(36).slice(2, 9);
|
|
312
|
+
return r2.current;
|
|
310
313
|
};
|
|
311
314
|
var FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
|
|
312
315
|
function noopSubscribe() {
|
|
@@ -344,10 +347,10 @@ function trapTab(e, container) {
|
|
|
344
347
|
function useMergedRef(a, b) {
|
|
345
348
|
return React3.useCallback(
|
|
346
349
|
function(node) {
|
|
347
|
-
[a, b].forEach(function(
|
|
348
|
-
if (!
|
|
349
|
-
if (typeof
|
|
350
|
-
else
|
|
350
|
+
[a, b].forEach(function(r2) {
|
|
351
|
+
if (!r2) return;
|
|
352
|
+
if (typeof r2 === "function") r2(node);
|
|
353
|
+
else r2.current = node;
|
|
351
354
|
});
|
|
352
355
|
},
|
|
353
356
|
[a, b]
|
|
@@ -572,6 +575,14 @@ var IconPanelLeftOpen = /* @__PURE__ */ defineIcon("panel-left-open", [
|
|
|
572
575
|
["path", { d: "M9 3v18" }],
|
|
573
576
|
["path", { d: "m14 9 3 3-3 3" }]
|
|
574
577
|
]);
|
|
578
|
+
var IconWrench = /* @__PURE__ */ defineIcon("wrench", [
|
|
579
|
+
[
|
|
580
|
+
"path",
|
|
581
|
+
{
|
|
582
|
+
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"
|
|
583
|
+
}
|
|
584
|
+
]
|
|
585
|
+
]);
|
|
575
586
|
|
|
576
587
|
// src/display.tsx
|
|
577
588
|
var h2 = React4.createElement;
|
|
@@ -911,11 +922,15 @@ var th = {
|
|
|
911
922
|
pageN: function(p) {
|
|
912
923
|
return "\u0E2B\u0E19\u0E49\u0E32 " + p;
|
|
913
924
|
},
|
|
914
|
-
progressReserved: function(v,
|
|
915
|
-
return "\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27 " + n(v) + " \u0E08\u0E32\u0E01 " + n(max) + " \u0E08\u0E2D\u0E07\u0E44\u0E27\u0E49 " + n(
|
|
925
|
+
progressReserved: function(v, r2, max) {
|
|
926
|
+
return "\u0E43\u0E0A\u0E49\u0E41\u0E25\u0E49\u0E27 " + n(v) + " \u0E08\u0E32\u0E01 " + n(max) + " \u0E08\u0E2D\u0E07\u0E44\u0E27\u0E49 " + n(r2);
|
|
916
927
|
},
|
|
917
928
|
breadcrumbMore: "\u0E41\u0E2A\u0E14\u0E07\u0E40\u0E2A\u0E49\u0E19\u0E17\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14",
|
|
918
929
|
stepError: "\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14",
|
|
930
|
+
statusDown: "\u0E25\u0E48\u0E21",
|
|
931
|
+
statusProblem: "\u0E21\u0E35\u0E1B\u0E31\u0E0D\u0E2B\u0E32",
|
|
932
|
+
statusMaintenance: "\u0E1B\u0E34\u0E14\u0E1B\u0E23\u0E31\u0E1A\u0E1B\u0E23\u0E38\u0E07",
|
|
933
|
+
statusOk: "\u0E1B\u0E01\u0E15\u0E34",
|
|
919
934
|
accepts: function(list, max) {
|
|
920
935
|
return [list, max && "\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19 " + max + " \u0E15\u0E48\u0E2D\u0E44\u0E1F\u0E25\u0E4C"].filter(Boolean).join(" \xB7 ");
|
|
921
936
|
}
|
|
@@ -1042,11 +1057,15 @@ var sv = {
|
|
|
1042
1057
|
pageN: function(p) {
|
|
1043
1058
|
return "Sida " + p;
|
|
1044
1059
|
},
|
|
1045
|
-
progressReserved: function(v,
|
|
1046
|
-
return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(
|
|
1060
|
+
progressReserved: function(v, r2, max) {
|
|
1061
|
+
return nsv(v) + " av " + nsv(max) + " anv\xE4nda, " + nsv(r2) + " reserverade";
|
|
1047
1062
|
},
|
|
1048
1063
|
breadcrumbMore: "Visa hela s\xF6kv\xE4gen",
|
|
1049
1064
|
stepError: "har fel",
|
|
1065
|
+
statusDown: "Nere",
|
|
1066
|
+
statusProblem: "Problem",
|
|
1067
|
+
statusMaintenance: "Underh\xE5ll",
|
|
1068
|
+
statusOk: "OK",
|
|
1050
1069
|
accepts: function(list, max) {
|
|
1051
1070
|
return [list, max && "h\xF6gst " + max + " per fil"].filter(Boolean).join(", ");
|
|
1052
1071
|
}
|
|
@@ -1174,11 +1193,15 @@ var STRINGS = {
|
|
|
1174
1193
|
pageN: function(p) {
|
|
1175
1194
|
return "Page " + p;
|
|
1176
1195
|
},
|
|
1177
|
-
progressReserved: function(v,
|
|
1178
|
-
return n2(v) + " of " + n2(max) + " used, " + n2(
|
|
1196
|
+
progressReserved: function(v, r2, max) {
|
|
1197
|
+
return n2(v) + " of " + n2(max) + " used, " + n2(r2) + " reserved";
|
|
1179
1198
|
},
|
|
1180
1199
|
breadcrumbMore: "Show the full path",
|
|
1181
1200
|
stepError: "has errors",
|
|
1201
|
+
statusDown: "Down",
|
|
1202
|
+
statusProblem: "Problem",
|
|
1203
|
+
statusMaintenance: "Maintenance",
|
|
1204
|
+
statusOk: "OK",
|
|
1182
1205
|
accepts: function(list, max) {
|
|
1183
1206
|
return [list, max && "up to " + max + " each"].filter(Boolean).join(", ");
|
|
1184
1207
|
}
|
|
@@ -1350,6 +1373,11 @@ function source(t) {
|
|
|
1350
1373
|
const tag = el.closest(".aura-tag");
|
|
1351
1374
|
if (tag) s = tag.querySelector(".aura-tag__text[" + ATTR + "]");
|
|
1352
1375
|
}
|
|
1376
|
+
if (!s) {
|
|
1377
|
+
const tile = el.closest(".aura-status-tile");
|
|
1378
|
+
const control = el.closest("a, button, input, select, textarea, [tabindex]");
|
|
1379
|
+
if (tile && (!control || control === tile)) s = tile.querySelector(".aura-status-tile__title[" + ATTR + "]");
|
|
1380
|
+
}
|
|
1353
1381
|
if (!s || !s.getAttribute(ATTR) || !s.isConnected) return null;
|
|
1354
1382
|
if (s.getAttribute("aria-expanded") === "true") return null;
|
|
1355
1383
|
return s;
|
|
@@ -1360,11 +1388,11 @@ function place() {
|
|
|
1360
1388
|
hide();
|
|
1361
1389
|
return;
|
|
1362
1390
|
}
|
|
1363
|
-
const
|
|
1364
|
-
let top =
|
|
1365
|
-
if (top < m &&
|
|
1391
|
+
const r2 = cur.getBoundingClientRect(), t = tip.getBoundingClientRect(), vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
1392
|
+
let top = r2.top - t.height - gap;
|
|
1393
|
+
if (top < m && r2.bottom + gap + t.height <= vh - m) top = r2.bottom + gap;
|
|
1366
1394
|
top = Math.max(m, Math.min(top, vh - t.height - m));
|
|
1367
|
-
const left = Math.max(m, Math.min(
|
|
1395
|
+
const left = Math.max(m, Math.min(r2.left + r2.width / 2 - t.width / 2, vw - t.width - m));
|
|
1368
1396
|
tip.style.top = top + "px";
|
|
1369
1397
|
tip.style.left = left + "px";
|
|
1370
1398
|
}
|
|
@@ -1538,9 +1566,9 @@ function makesBlock(s) {
|
|
|
1538
1566
|
}
|
|
1539
1567
|
function inView(el) {
|
|
1540
1568
|
if (!el.isConnected) return false;
|
|
1541
|
-
const
|
|
1542
|
-
if (
|
|
1543
|
-
let top =
|
|
1569
|
+
const r2 = el.getBoundingClientRect();
|
|
1570
|
+
if (r2.width === 0 && r2.height === 0) return false;
|
|
1571
|
+
let top = r2.top, bottom = r2.bottom, left = r2.left, right = r2.right;
|
|
1544
1572
|
let pos = getComputedStyle(el).position;
|
|
1545
1573
|
for (let p = el.parentElement; p && p !== document.body && p !== document.documentElement; p = p.parentElement) {
|
|
1546
1574
|
const s = getComputedStyle(p);
|
|
@@ -1578,16 +1606,16 @@ var Menu = React9.forwardRef(function Menu2(props, ref) {
|
|
|
1578
1606
|
function place2() {
|
|
1579
1607
|
const a = props.anchor, m = own.current;
|
|
1580
1608
|
if (!a || !m) return;
|
|
1581
|
-
const
|
|
1582
|
-
let top =
|
|
1609
|
+
const r2 = a.getBoundingClientRect(), mh = m.scrollHeight, mw = m.offsetWidth, below2 = window.innerHeight - r2.bottom - 12, above = r2.top - 12;
|
|
1610
|
+
let top = r2.bottom + 4, maxHeight;
|
|
1583
1611
|
if (mh > below2) {
|
|
1584
|
-
if (mh <= above) top =
|
|
1612
|
+
if (mh <= above) top = r2.top - mh - 4;
|
|
1585
1613
|
else if (above > below2) {
|
|
1586
1614
|
maxHeight = above;
|
|
1587
|
-
top =
|
|
1615
|
+
top = r2.top - above - 4;
|
|
1588
1616
|
} else maxHeight = below2;
|
|
1589
1617
|
}
|
|
1590
|
-
const left = Math.max(8, Math.min(
|
|
1618
|
+
const left = Math.max(8, Math.min(r2.right - mw, window.innerWidth - mw - 8));
|
|
1591
1619
|
setPos(function(p) {
|
|
1592
1620
|
return p && p.top === top && p.left === left && p.maxHeight === maxHeight ? p : { top, left, maxHeight };
|
|
1593
1621
|
});
|
|
@@ -2051,9 +2079,9 @@ var HANDLED_KEYS = FORM_KEYS.concat([
|
|
|
2051
2079
|
"size"
|
|
2052
2080
|
]);
|
|
2053
2081
|
function pick(o, keys) {
|
|
2054
|
-
const
|
|
2055
|
-
for (const k of keys) if (k in o)
|
|
2056
|
-
return
|
|
2082
|
+
const r2 = {};
|
|
2083
|
+
for (const k of keys) if (k in o) r2[k] = o[k];
|
|
2084
|
+
return r2;
|
|
2057
2085
|
}
|
|
2058
2086
|
function readItems(el) {
|
|
2059
2087
|
if (!el) return [];
|
|
@@ -2352,15 +2380,15 @@ var Select = React16.forwardRef(function Select2(props, ref) {
|
|
|
2352
2380
|
function place2() {
|
|
2353
2381
|
const t = trigRef.current && trigRef.current.parentElement;
|
|
2354
2382
|
if (!t) return;
|
|
2355
|
-
const
|
|
2356
|
-
const lw = listRef.current ? Math.max(
|
|
2383
|
+
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;
|
|
2384
|
+
const lw = listRef.current ? Math.max(r2.width, listRef.current.offsetWidth) : r2.width;
|
|
2357
2385
|
const rtl = getComputedStyle(t).direction === "rtl";
|
|
2358
|
-
const left = lw <=
|
|
2386
|
+
const left = lw <= r2.width ? r2.left : Math.max(8, Math.min(rtl ? r2.right - lw : r2.left, window.innerWidth - lw - 8));
|
|
2359
2387
|
pos[1]({
|
|
2360
2388
|
left,
|
|
2361
|
-
width:
|
|
2362
|
-
top: up2 ? void 0 :
|
|
2363
|
-
bottom: up2 ? window.innerHeight -
|
|
2389
|
+
width: r2.width,
|
|
2390
|
+
top: up2 ? void 0 : r2.bottom + 4,
|
|
2391
|
+
bottom: up2 ? window.innerHeight - r2.top + 4 : void 0,
|
|
2364
2392
|
maxHeight: Math.min(320, (up2 ? above : below2) - 4),
|
|
2365
2393
|
rtl
|
|
2366
2394
|
});
|
|
@@ -2555,10 +2583,10 @@ var Select = React16.forwardRef(function Select2(props, ref) {
|
|
|
2555
2583
|
"aria-label": labelledBy ? void 0 : rest["aria-label"],
|
|
2556
2584
|
className: "aura-combo__list"
|
|
2557
2585
|
},
|
|
2558
|
-
runs.map(function(
|
|
2559
|
-
if (
|
|
2586
|
+
runs.map(function(r2, n3) {
|
|
2587
|
+
if (r2.group === null) return /* @__PURE__ */ React16.createElement(React16.Fragment, { key: "r" + n3 }, r2.items.map(option));
|
|
2560
2588
|
const gid = id + "-group-" + n3;
|
|
2561
|
-
return /* @__PURE__ */ React16.createElement("div", { key: "r" + n3, role: "group", "aria-labelledby": gid }, /* @__PURE__ */ React16.createElement("div", { id: gid, className: "aura-select__group" },
|
|
2589
|
+
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));
|
|
2562
2590
|
})
|
|
2563
2591
|
)
|
|
2564
2592
|
),
|
|
@@ -3140,10 +3168,10 @@ function useCalendarPopover(boxRef) {
|
|
|
3140
3168
|
const pos = React18.useState(null), popRef = React18.useRef(null), mounted = useMounted();
|
|
3141
3169
|
function place2() {
|
|
3142
3170
|
if (!boxRef.current) return;
|
|
3143
|
-
const el = popRef.current,
|
|
3144
|
-
const up2 = window.innerHeight -
|
|
3145
|
-
const left = Math.max(8, Math.min(
|
|
3146
|
-
pos[1](up2 ? { left, bottom: window.innerHeight -
|
|
3171
|
+
const el = popRef.current, r2 = boxRef.current.getBoundingClientRect(), W = el ? el.offsetWidth : 320, H = el ? el.offsetHeight : 380;
|
|
3172
|
+
const up2 = window.innerHeight - r2.bottom < H + 12 && r2.top > H + 12;
|
|
3173
|
+
const left = Math.max(8, Math.min(r2.left, window.innerWidth - W - 8));
|
|
3174
|
+
pos[1](up2 ? { left, bottom: window.innerHeight - r2.top + 4 } : { left, top: r2.bottom + 4 });
|
|
3147
3175
|
}
|
|
3148
3176
|
useIsoLayoutEffect(
|
|
3149
3177
|
function() {
|
|
@@ -3389,10 +3417,10 @@ var DateRangePicker = React18.forwardRef(
|
|
|
3389
3417
|
isDateDisabled: props.isDateDisabled
|
|
3390
3418
|
};
|
|
3391
3419
|
const o = { locale, calendar };
|
|
3392
|
-
function show3(
|
|
3393
|
-
if (!
|
|
3394
|
-
if (!
|
|
3395
|
-
return formatDate(
|
|
3420
|
+
function show3(r2) {
|
|
3421
|
+
if (!r2.start) return "";
|
|
3422
|
+
if (!r2.end) return formatDate(r2.start, o) + " \u2013";
|
|
3423
|
+
return formatDate(r2.start, o) + " \u2013 " + formatDate(r2.end, o);
|
|
3396
3424
|
}
|
|
3397
3425
|
const bad = React18.useState(null);
|
|
3398
3426
|
React18.useEffect(
|
|
@@ -3532,8 +3560,8 @@ var FilterDateRange = React19.forwardRef(
|
|
|
3532
3560
|
draft[1](null);
|
|
3533
3561
|
if (faceRef.current) faceRef.current.focus();
|
|
3534
3562
|
}
|
|
3535
|
-
function choose(
|
|
3536
|
-
if (
|
|
3563
|
+
function choose(r2) {
|
|
3564
|
+
if (r2.start !== raw.start || r2.end !== raw.end) st[1](r2);
|
|
3537
3565
|
close();
|
|
3538
3566
|
}
|
|
3539
3567
|
function pick2(iso) {
|
|
@@ -3547,12 +3575,12 @@ var FilterDateRange = React19.forwardRef(
|
|
|
3547
3575
|
}
|
|
3548
3576
|
const isAny = !v.start || !v.end;
|
|
3549
3577
|
const own = props["aria-label"] || void 0;
|
|
3550
|
-
const
|
|
3578
|
+
const attrs2 = {};
|
|
3551
3579
|
Object.keys(props).forEach(function(k) {
|
|
3552
3580
|
if (k === "style" || /^(aria|data)-/.test(k) && k !== "aria-label")
|
|
3553
|
-
|
|
3581
|
+
attrs2[k] = props[k];
|
|
3554
3582
|
});
|
|
3555
|
-
const presetBtn = function(label,
|
|
3583
|
+
const presetBtn = function(label, r2, on, key) {
|
|
3556
3584
|
return /* @__PURE__ */ React19.createElement(
|
|
3557
3585
|
Button,
|
|
3558
3586
|
{
|
|
@@ -3560,11 +3588,11 @@ var FilterDateRange = React19.forwardRef(
|
|
|
3560
3588
|
size: "sm",
|
|
3561
3589
|
variant: "ghost",
|
|
3562
3590
|
touchHeight: true,
|
|
3563
|
-
disabled: !!
|
|
3591
|
+
disabled: !!r2.start && !!r2.end && !(allowedDate(r2.start, limits) && allowedDate(r2.end, limits)),
|
|
3564
3592
|
className: cx("aura-filterdate__preset", on && "is-selected"),
|
|
3565
3593
|
"aria-pressed": on,
|
|
3566
3594
|
onClick: function() {
|
|
3567
|
-
choose(
|
|
3595
|
+
choose(r2);
|
|
3568
3596
|
}
|
|
3569
3597
|
},
|
|
3570
3598
|
label
|
|
@@ -3629,7 +3657,7 @@ var FilterDateRange = React19.forwardRef(
|
|
|
3629
3657
|
/* @__PURE__ */ React19.createElement(
|
|
3630
3658
|
"button",
|
|
3631
3659
|
{
|
|
3632
|
-
...
|
|
3660
|
+
...attrs2,
|
|
3633
3661
|
ref: setFace,
|
|
3634
3662
|
id,
|
|
3635
3663
|
type: "button",
|
|
@@ -3667,8 +3695,8 @@ var RadioGroup = React20.forwardRef(function RadioGroup2(props, ref) {
|
|
|
3667
3695
|
function(el) {
|
|
3668
3696
|
if (el)
|
|
3669
3697
|
el.focus = function(opts) {
|
|
3670
|
-
const
|
|
3671
|
-
if (
|
|
3698
|
+
const r2 = el.querySelector('input[type="radio"]:checked') || el.querySelector('input[type="radio"]:not(:disabled)');
|
|
3699
|
+
if (r2) r2.focus(opts);
|
|
3672
3700
|
};
|
|
3673
3701
|
if (typeof ref === "function") ref(el);
|
|
3674
3702
|
else if (ref) ref.current = el;
|
|
@@ -3834,14 +3862,14 @@ var Combobox = React22.forwardRef(
|
|
|
3834
3862
|
}) : -1 : Math.min(active, shown.length - 1);
|
|
3835
3863
|
function place2() {
|
|
3836
3864
|
if (!boxRef.current) return;
|
|
3837
|
-
const
|
|
3838
|
-
const maxH = 320, below2 = window.innerHeight -
|
|
3865
|
+
const r2 = boxRef.current.getBoundingClientRect();
|
|
3866
|
+
const maxH = 320, below2 = window.innerHeight - r2.bottom - 8, up2 = below2 < 200 && r2.top > below2;
|
|
3839
3867
|
posState[1]({
|
|
3840
|
-
left:
|
|
3841
|
-
width:
|
|
3842
|
-
top: up2 ? void 0 :
|
|
3843
|
-
bottom: up2 ? window.innerHeight -
|
|
3844
|
-
maxHeight: Math.min(maxH, (up2 ?
|
|
3868
|
+
left: r2.left,
|
|
3869
|
+
width: r2.width,
|
|
3870
|
+
top: up2 ? void 0 : r2.bottom + 4,
|
|
3871
|
+
bottom: up2 ? window.innerHeight - r2.top + 4 : void 0,
|
|
3872
|
+
maxHeight: Math.min(maxH, (up2 ? r2.top : below2) - 8)
|
|
3845
3873
|
});
|
|
3846
3874
|
}
|
|
3847
3875
|
useIsoLayoutEffect(
|
|
@@ -4678,13 +4706,13 @@ var Tooltip = React27.forwardRef(function Tooltip2(props, ref) {
|
|
|
4678
4706
|
}, []);
|
|
4679
4707
|
function place2() {
|
|
4680
4708
|
if (!anchor.current || !tip2.current) return;
|
|
4681
|
-
const
|
|
4709
|
+
const r2 = anchor.current.getBoundingClientRect(), t = tip2.current.getBoundingClientRect();
|
|
4682
4710
|
const vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
4683
4711
|
let side = props.side || "top";
|
|
4684
|
-
if (side === "top" &&
|
|
4685
|
-
else if (side === "bottom" &&
|
|
4686
|
-
else if (side === "left" &&
|
|
4687
|
-
else if (side === "right" &&
|
|
4712
|
+
if (side === "top" && r2.top - t.height - gap < m && r2.bottom + gap + t.height <= vh - m) side = "bottom";
|
|
4713
|
+
else if (side === "bottom" && r2.bottom + gap + t.height > vh - m && r2.top - t.height - gap >= m) side = "top";
|
|
4714
|
+
else if (side === "left" && r2.left - t.width - gap < m && r2.right + gap + t.width <= vw - m) side = "right";
|
|
4715
|
+
else if (side === "right" && r2.right + gap + t.width > vw - m && r2.left - t.width - gap >= m) side = "left";
|
|
4688
4716
|
const clampX = function(x) {
|
|
4689
4717
|
return Math.max(m, Math.min(x, vw - t.width - m));
|
|
4690
4718
|
};
|
|
@@ -4693,12 +4721,12 @@ var Tooltip = React27.forwardRef(function Tooltip2(props, ref) {
|
|
|
4693
4721
|
};
|
|
4694
4722
|
let top, left;
|
|
4695
4723
|
if (side === "top" || side === "bottom") {
|
|
4696
|
-
top = clampY(side === "top" ?
|
|
4697
|
-
left = clampX(
|
|
4724
|
+
top = clampY(side === "top" ? r2.top - t.height - gap : r2.bottom + gap);
|
|
4725
|
+
left = clampX(r2.left + r2.width / 2 - t.width / 2);
|
|
4698
4726
|
} else {
|
|
4699
|
-
left = side === "left" ?
|
|
4727
|
+
left = side === "left" ? r2.left - t.width - gap : r2.right + gap;
|
|
4700
4728
|
left = clampX(left);
|
|
4701
|
-
top = clampY(
|
|
4729
|
+
top = clampY(r2.top + r2.height / 2 - t.height / 2);
|
|
4702
4730
|
}
|
|
4703
4731
|
pos[1]({ top, left });
|
|
4704
4732
|
}
|
|
@@ -5119,18 +5147,18 @@ function Command(props) {
|
|
|
5119
5147
|
if (!g) groups.push(g = { name, items: [] });
|
|
5120
5148
|
g.items.push(it);
|
|
5121
5149
|
});
|
|
5122
|
-
const
|
|
5150
|
+
const flat3 = [];
|
|
5123
5151
|
groups.forEach(function(g) {
|
|
5124
5152
|
g.items.forEach(function(it) {
|
|
5125
|
-
|
|
5153
|
+
flat3.push(it);
|
|
5126
5154
|
});
|
|
5127
5155
|
});
|
|
5128
|
-
const enabled =
|
|
5156
|
+
const enabled = flat3.map(function(it, i2) {
|
|
5129
5157
|
return it.disabled ? -1 : i2;
|
|
5130
5158
|
}).filter(function(i2) {
|
|
5131
5159
|
return i2 >= 0;
|
|
5132
5160
|
});
|
|
5133
|
-
const byId = act[0] == null ? -1 :
|
|
5161
|
+
const byId = act[0] == null ? -1 : flat3.findIndex(function(it) {
|
|
5134
5162
|
return it.id === act[0];
|
|
5135
5163
|
});
|
|
5136
5164
|
const active = enabled.indexOf(byId) >= 0 ? byId : enabled.length ? enabled[0] : -1;
|
|
@@ -5158,7 +5186,7 @@ function Command(props) {
|
|
|
5158
5186
|
if (dir === "first") n3 = 0;
|
|
5159
5187
|
else if (dir === "last") n3 = enabled.length - 1;
|
|
5160
5188
|
else n3 = (at + dir + enabled.length) % enabled.length;
|
|
5161
|
-
act[1](
|
|
5189
|
+
act[1](flat3[enabled[n3]].id);
|
|
5162
5190
|
}
|
|
5163
5191
|
function onKey(e) {
|
|
5164
5192
|
if (e.key === "ArrowDown") {
|
|
@@ -5176,7 +5204,7 @@ function Command(props) {
|
|
|
5176
5204
|
} else if (e.key === "Enter") {
|
|
5177
5205
|
if (e.nativeEvent.isComposing || e.keyCode === 229) return;
|
|
5178
5206
|
e.preventDefault();
|
|
5179
|
-
if (active >= 0) run(
|
|
5207
|
+
if (active >= 0) run(flat3[active]);
|
|
5180
5208
|
}
|
|
5181
5209
|
}
|
|
5182
5210
|
if (!modal.ready) return null;
|
|
@@ -5210,8 +5238,8 @@ function Command(props) {
|
|
|
5210
5238
|
"data-autofocus": "",
|
|
5211
5239
|
type: "text",
|
|
5212
5240
|
role: "combobox",
|
|
5213
|
-
"aria-expanded":
|
|
5214
|
-
"aria-controls":
|
|
5241
|
+
"aria-expanded": flat3.length > 0,
|
|
5242
|
+
"aria-controls": flat3.length ? listId : void 0,
|
|
5215
5243
|
"aria-autocomplete": "list",
|
|
5216
5244
|
"aria-activedescendant": active >= 0 ? optId(active) : void 0,
|
|
5217
5245
|
"aria-label": props.label || t.commandMenu,
|
|
@@ -5227,7 +5255,7 @@ function Command(props) {
|
|
|
5227
5255
|
onKeyDown: onKey
|
|
5228
5256
|
}
|
|
5229
5257
|
), /* @__PURE__ */ React31.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
5230
|
-
/* @__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, !
|
|
5258
|
+
/* @__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(
|
|
5231
5259
|
"div",
|
|
5232
5260
|
{
|
|
5233
5261
|
id: listId,
|
|
@@ -5281,7 +5309,7 @@ function Command(props) {
|
|
|
5281
5309
|
);
|
|
5282
5310
|
})
|
|
5283
5311
|
)),
|
|
5284
|
-
/* @__PURE__ */ React31.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !
|
|
5312
|
+
/* @__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) : ""),
|
|
5285
5313
|
/* @__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"))
|
|
5286
5314
|
)
|
|
5287
5315
|
),
|
|
@@ -5528,13 +5556,13 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5528
5556
|
const selState = useMaybeControlled(props.selected, props.defaultSelected || [], null);
|
|
5529
5557
|
const onSel = React33.useRef(props.onSelectionChange);
|
|
5530
5558
|
onSel.current = props.onSelectionChange;
|
|
5531
|
-
const canSelect = function(
|
|
5532
|
-
return !!
|
|
5559
|
+
const canSelect = function(r2) {
|
|
5560
|
+
return !!r2 && (!props.isRowSelectable || !!props.isRowSelectable(r2));
|
|
5533
5561
|
};
|
|
5534
5562
|
const rejected = {};
|
|
5535
5563
|
if (props.isRowSelectable)
|
|
5536
|
-
rows.forEach(function(
|
|
5537
|
-
if (!canSelect(
|
|
5564
|
+
rows.forEach(function(r2) {
|
|
5565
|
+
if (!canSelect(r2)) rejected[String(r2[rowKey])] = true;
|
|
5538
5566
|
});
|
|
5539
5567
|
const selected = selState[0].filter(function(k) {
|
|
5540
5568
|
return !rejected[String(k)];
|
|
@@ -5679,8 +5707,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5679
5707
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
5680
5708
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
5681
5709
|
return setTip(null);
|
|
5682
|
-
const
|
|
5683
|
-
setTip({ text: (el.textContent || "").trim(), left:
|
|
5710
|
+
const r2 = el.getBoundingClientRect();
|
|
5711
|
+
setTip({ text: (el.textContent || "").trim(), left: r2.left, top: r2.top });
|
|
5684
5712
|
}
|
|
5685
5713
|
function hideFull() {
|
|
5686
5714
|
setTip(null);
|
|
@@ -5825,14 +5853,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5825
5853
|
function() {
|
|
5826
5854
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
5827
5855
|
const col = byKey[sort.key];
|
|
5828
|
-
const val = col.sortValue || (col.pill ? function(
|
|
5829
|
-
return TONE_ORDER[col.tones && col.tones[
|
|
5830
|
-
} : function(
|
|
5831
|
-
return
|
|
5856
|
+
const val = col.sortValue || (col.pill ? function(r2) {
|
|
5857
|
+
return TONE_ORDER[col.tones && col.tones[r2[col.key]] || toneFor(r2[col.key])];
|
|
5858
|
+
} : function(r2) {
|
|
5859
|
+
return r2[col.key];
|
|
5832
5860
|
});
|
|
5833
5861
|
const dir = sort.dir === "desc" ? -1 : 1;
|
|
5834
|
-
return rows.map(function(
|
|
5835
|
-
return [
|
|
5862
|
+
return rows.map(function(r2, i) {
|
|
5863
|
+
return [r2, i];
|
|
5836
5864
|
}).sort(function(a, b) {
|
|
5837
5865
|
return compare(val(a[0]), val(b[0])) * dir || a[1] - b[1];
|
|
5838
5866
|
}).map(function(p) {
|
|
@@ -5930,8 +5958,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5930
5958
|
})
|
|
5931
5959
|
);
|
|
5932
5960
|
}
|
|
5933
|
-
function rowLinkWrap(
|
|
5934
|
-
return rowHref ? /* @__PURE__ */ React33.createElement(Link, { href: rowHref(
|
|
5961
|
+
function rowLinkWrap(r2, content) {
|
|
5962
|
+
return rowHref ? /* @__PURE__ */ React33.createElement(Link, { href: rowHref(r2), className: "aura-table__row-link" }, content) : content;
|
|
5935
5963
|
}
|
|
5936
5964
|
const height = props.height || 0;
|
|
5937
5965
|
const autoRows = props.rowHeight === "auto" && !height;
|
|
@@ -5986,9 +6014,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5986
6014
|
},
|
|
5987
6015
|
[stacked]
|
|
5988
6016
|
);
|
|
5989
|
-
function tabFor(
|
|
5990
|
-
if (!activeRendered) return
|
|
5991
|
-
return
|
|
6017
|
+
function tabFor(r2, c) {
|
|
6018
|
+
if (!activeRendered) return r2 === 0 && c === ac ? 0 : -1;
|
|
6019
|
+
return r2 === ar && c === acShown ? 0 : -1;
|
|
5992
6020
|
}
|
|
5993
6021
|
React33.useEffect(function() {
|
|
5994
6022
|
const p = pending.current;
|
|
@@ -6012,38 +6040,38 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6012
6040
|
el.focus();
|
|
6013
6041
|
}
|
|
6014
6042
|
});
|
|
6015
|
-
function focusCell(
|
|
6016
|
-
|
|
6043
|
+
function focusCell(r2, c, dir) {
|
|
6044
|
+
r2 = Math.max(0, Math.min(r2, lastR));
|
|
6017
6045
|
c = Math.max(0, Math.min(c, nCols - 1));
|
|
6018
|
-
if (stacked &&
|
|
6019
|
-
if (gridRef.current && (
|
|
6046
|
+
if (stacked && r2 === 0 && nRows > 0 && (!(selectable && c === 0) || noCardSel)) r2 = 1;
|
|
6047
|
+
if (gridRef.current && (r2 === T && hasTotal || stacked)) {
|
|
6020
6048
|
const shown2 = function(cc) {
|
|
6021
6049
|
if (cardHidden[cc]) return false;
|
|
6022
|
-
const e = gridRef.current.querySelector('[data-rc="' +
|
|
6050
|
+
const e = gridRef.current.querySelector('[data-rc="' + r2 + ":" + cc + '"]');
|
|
6023
6051
|
return !!e && e.getClientRects().length > 0;
|
|
6024
6052
|
};
|
|
6025
6053
|
c = nearestShown(c, dir || 1, shown2);
|
|
6026
6054
|
}
|
|
6027
|
-
activeState[1]({ r, c });
|
|
6028
|
-
pending.current = { r, c };
|
|
6029
|
-
if (virtual && hasTotal &&
|
|
6055
|
+
activeState[1]({ r: r2, c });
|
|
6056
|
+
pending.current = { r: r2, c };
|
|
6057
|
+
if (virtual && hasTotal && r2 === T && !props.stickyFooter) {
|
|
6030
6058
|
const sc = scrollRef.current;
|
|
6031
6059
|
sc.scrollTop = sc.scrollHeight;
|
|
6032
6060
|
setScrollTop(sc.scrollTop);
|
|
6033
|
-
} else if (virtual &&
|
|
6034
|
-
const sc = scrollRef.current, top = (
|
|
6061
|
+
} else if (virtual && r2 > 0 && r2 <= nRows) {
|
|
6062
|
+
const sc = scrollRef.current, top = (r2 - 1) * ROW_H;
|
|
6035
6063
|
if (top < sc.scrollTop) sc.scrollTop = top;
|
|
6036
6064
|
else if (top + ROW_H > sc.scrollTop + bodyH) sc.scrollTop = top + ROW_H - bodyH;
|
|
6037
6065
|
setScrollTop(sc.scrollTop);
|
|
6038
6066
|
}
|
|
6039
|
-
const el = gridRef.current && gridRef.current.querySelector('[data-rc="' +
|
|
6067
|
+
const el = gridRef.current && gridRef.current.querySelector('[data-rc="' + r2 + ":" + c + '"]');
|
|
6040
6068
|
if (el) {
|
|
6041
6069
|
pending.current = null;
|
|
6042
6070
|
el.focus();
|
|
6043
6071
|
}
|
|
6044
6072
|
}
|
|
6045
|
-
const pageKeys = pageRows.filter(canSelect).map(function(
|
|
6046
|
-
return
|
|
6073
|
+
const pageKeys = pageRows.filter(canSelect).map(function(r2) {
|
|
6074
|
+
return r2[rowKey];
|
|
6047
6075
|
});
|
|
6048
6076
|
const selSet = {};
|
|
6049
6077
|
selected.forEach(function(k) {
|
|
@@ -6301,51 +6329,51 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6301
6329
|
}
|
|
6302
6330
|
return;
|
|
6303
6331
|
}
|
|
6304
|
-
const p = rc.split(":"),
|
|
6305
|
-
const row =
|
|
6332
|
+
const p = rc.split(":"), r2 = +p[0], c = +p[1], k = e.key, col = colAt(c);
|
|
6333
|
+
const row = r2 > 0 && r2 <= nRows ? pageRows[r2 - 1] : null, isTotal = hasTotal && r2 === T;
|
|
6306
6334
|
let handled = true;
|
|
6307
|
-
if (
|
|
6335
|
+
if (r2 === 0 && col && e.altKey && (k === "ArrowLeft" || k === "ArrowRight") && canResize(col))
|
|
6308
6336
|
setW(col, widthOf(col) + (k === "ArrowLeft" ? -1 : 1) * (e.shiftKey ? 48 : 16), true);
|
|
6309
|
-
else if (
|
|
6337
|
+
else if (r2 === 0 && col && e.ctrlKey && e.shiftKey && (k === "ArrowLeft" || k === "ArrowRight") && reorderable) {
|
|
6310
6338
|
if (moveCol(col.key, k === "ArrowLeft" ? -1 : 1)) pending.current = { r: 0, key: col.key, c };
|
|
6311
|
-
} else if (
|
|
6339
|
+
} else if (r2 === 0 && col && (e.altKey && k === "ArrowDown" || k === "ContextMenu" || e.shiftKey && k === "F10") && controls)
|
|
6312
6340
|
openMenu("col", col.key, target, { r: 0, c });
|
|
6313
|
-
else if (k === "ArrowRight") focusCell(
|
|
6314
|
-
else if (k === "ArrowLeft") focusCell(
|
|
6341
|
+
else if (k === "ArrowRight") focusCell(r2, c + 1);
|
|
6342
|
+
else if (k === "ArrowLeft") focusCell(r2, c - 1, -1);
|
|
6315
6343
|
else if (k === "ArrowDown") {
|
|
6316
|
-
if (
|
|
6344
|
+
if (r2 < lastR) focusCell(r2 + 1, c);
|
|
6317
6345
|
else if (pageSize && page < pageCount && goPage(page + 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
6318
6346
|
} else if (k === "ArrowUp") {
|
|
6319
|
-
if (
|
|
6320
|
-
else if (
|
|
6321
|
-
} else if (k === "Home") focusCell(e.ctrlKey ? 1 :
|
|
6322
|
-
else if (k === "End") focusCell(e.ctrlKey ? lastR :
|
|
6347
|
+
if (r2 > 1 || r2 === 1 && !(pageSize && page > 1)) focusCell(r2 - 1, c);
|
|
6348
|
+
else if (r2 === 1 && goPage(page - 1, { r: pageSize, c })) activeState[1]({ r: pageSize, c });
|
|
6349
|
+
} else if (k === "Home") focusCell(e.ctrlKey ? 1 : r2, 0);
|
|
6350
|
+
else if (k === "End") focusCell(e.ctrlKey ? lastR : r2, nCols - 1, -1);
|
|
6323
6351
|
else if (k === "PageDown") {
|
|
6324
6352
|
if (pageSize) {
|
|
6325
6353
|
if (goPage(page + 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
6326
|
-
} else focusCell(Math.min(lastR,
|
|
6354
|
+
} else focusCell(Math.min(lastR, r2 + visibleRows), c);
|
|
6327
6355
|
} else if (k === "PageUp") {
|
|
6328
6356
|
if (pageSize) {
|
|
6329
6357
|
if (goPage(page - 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
6330
|
-
} else focusCell(Math.max(1,
|
|
6358
|
+
} else focusCell(Math.max(1, r2 - visibleRows), c);
|
|
6331
6359
|
} else if (isTotal && (k === " " || k === "Enter" || k === "F2")) {
|
|
6332
6360
|
handled = false;
|
|
6333
|
-
} else if (k === "F2" &&
|
|
6361
|
+
} else if (k === "F2" && r2 > 0) {
|
|
6334
6362
|
const inner = target.querySelector("button, a[href], input, select, textarea");
|
|
6335
6363
|
if (inner) inner.focus();
|
|
6336
6364
|
else handled = false;
|
|
6337
6365
|
} else if (k === " " || k === "Enter") {
|
|
6338
|
-
if (
|
|
6366
|
+
if (r2 === 0 && !col && selectable && nRows) {
|
|
6339
6367
|
if (pageKeys.length) toggleAll();
|
|
6340
|
-
} else if (
|
|
6341
|
-
else if (
|
|
6368
|
+
} else if (r2 === 0 && col && col.sortable && canSortAny) sortBy(col.key);
|
|
6369
|
+
else if (r2 > 0 && k === " " && selectable) {
|
|
6342
6370
|
if (canSelect(row) && !(stacked && noCardSel))
|
|
6343
6371
|
toggle(row[rowKey], !selSet[row[rowKey]], { shiftKey: e.shiftKey, source: "keyboard" });
|
|
6344
|
-
} else if (
|
|
6372
|
+
} else if (r2 > 0 && k === "Enter" && rowHref && !target.querySelector("button, a[href]:not(.aura-table__row-link), input, select, textarea"))
|
|
6345
6373
|
followRow(target.closest('[role="row"]'), e);
|
|
6346
|
-
else if (
|
|
6374
|
+
else if (r2 > 0 && k === "Enter" && target.querySelector("button, a[href], input, select, textarea"))
|
|
6347
6375
|
target.querySelector("button, a[href], input, select, textarea").focus();
|
|
6348
|
-
else if (
|
|
6376
|
+
else if (r2 > 0 && k === "Enter" && props.onRowActivate) props.onRowActivate(row);
|
|
6349
6377
|
else handled = false;
|
|
6350
6378
|
} else handled = false;
|
|
6351
6379
|
if (handled) {
|
|
@@ -6508,13 +6536,13 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6508
6536
|
}
|
|
6509
6537
|
)
|
|
6510
6538
|
);
|
|
6511
|
-
function cellContent(c,
|
|
6512
|
-
const v =
|
|
6513
|
-
return c.render ? c.render(
|
|
6539
|
+
function cellContent(c, r2) {
|
|
6540
|
+
const v = r2[c.key];
|
|
6541
|
+
return c.render ? c.render(r2) : c.pill ? /* @__PURE__ */ React33.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
6514
6542
|
}
|
|
6515
|
-
function rowCells(
|
|
6543
|
+
function rowCells(r2, i, k, isSel) {
|
|
6516
6544
|
const ri = i + 1;
|
|
6517
|
-
const selLabel = selectable && canSelect(
|
|
6545
|
+
const selLabel = selectable && canSelect(r2) ? props.rowSelectLabel && props.rowSelectLabel(r2) || t.selectRow(k) : void 0;
|
|
6518
6546
|
const cells = [/* @__PURE__ */ React33.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
6519
6547
|
if (selectable)
|
|
6520
6548
|
cells.push(
|
|
@@ -6527,7 +6555,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6527
6555
|
className: cx("aura-table__sel", nPinned && "is-pinned"),
|
|
6528
6556
|
tabIndex: tabFor(ri, 0),
|
|
6529
6557
|
"data-rc": ri + ":0",
|
|
6530
|
-
"aria-label": canSelect(
|
|
6558
|
+
"aria-label": canSelect(r2) ? selLabel : props.rowSelectDisabledLabel ? props.rowSelectDisabledLabel(r2) : void 0,
|
|
6531
6559
|
onFocus: function(e) {
|
|
6532
6560
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
6533
6561
|
},
|
|
@@ -6535,7 +6563,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6535
6563
|
shiftClick.current = e.shiftKey;
|
|
6536
6564
|
}
|
|
6537
6565
|
},
|
|
6538
|
-
canSelect(
|
|
6566
|
+
canSelect(r2) ? /* @__PURE__ */ React33.createElement(
|
|
6539
6567
|
Checkbox,
|
|
6540
6568
|
{
|
|
6541
6569
|
hideLabel: true,
|
|
@@ -6552,7 +6580,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6552
6580
|
)
|
|
6553
6581
|
);
|
|
6554
6582
|
vis.forEach(function(c, j) {
|
|
6555
|
-
const ci = j + (selectable ? 1 : 0), v =
|
|
6583
|
+
const ci = j + (selectable ? 1 : 0), v = r2[c.key], pin = isPinned(c);
|
|
6556
6584
|
cells.push(
|
|
6557
6585
|
/* @__PURE__ */ React33.createElement(
|
|
6558
6586
|
"span",
|
|
@@ -6576,7 +6604,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6576
6604
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
6577
6605
|
}
|
|
6578
6606
|
},
|
|
6579
|
-
autoRows ? /* @__PURE__ */ React33.createElement("span", { className: "aura-table__cell" }, j === 0 ? rowLinkWrap(
|
|
6607
|
+
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)
|
|
6580
6608
|
)
|
|
6581
6609
|
);
|
|
6582
6610
|
});
|
|
@@ -6674,8 +6702,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6674
6702
|
/* @__PURE__ */ React33.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
6675
6703
|
);
|
|
6676
6704
|
for (let ri = start; ri < end; ri++) {
|
|
6677
|
-
(function(
|
|
6678
|
-
const k =
|
|
6705
|
+
(function(r2, i) {
|
|
6706
|
+
const k = r2[rowKey], isSel = !!selSet[k];
|
|
6679
6707
|
bodyRows.push(
|
|
6680
6708
|
/* @__PURE__ */ React33.createElement(
|
|
6681
6709
|
"div",
|
|
@@ -6683,7 +6711,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6683
6711
|
key: k,
|
|
6684
6712
|
role: "row",
|
|
6685
6713
|
"aria-rowindex": first + i + 2,
|
|
6686
|
-
"aria-selected": selectable && canSelect(
|
|
6714
|
+
"aria-selected": selectable && canSelect(r2) ? isSel : void 0,
|
|
6687
6715
|
className: cx(
|
|
6688
6716
|
"aura-table__row",
|
|
6689
6717
|
autoRows && "aura-table__row--auto",
|
|
@@ -6695,10 +6723,10 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6695
6723
|
const el = e.target;
|
|
6696
6724
|
if (el.closest && el.closest(".aura-check, button, a, input")) return;
|
|
6697
6725
|
if (rowHref) followRow(e.currentTarget, e);
|
|
6698
|
-
else if (props.onRowActivate) props.onRowActivate(
|
|
6726
|
+
else if (props.onRowActivate) props.onRowActivate(r2);
|
|
6699
6727
|
}
|
|
6700
6728
|
},
|
|
6701
|
-
rowCells(
|
|
6729
|
+
rowCells(r2, i, k, isSel)
|
|
6702
6730
|
)
|
|
6703
6731
|
);
|
|
6704
6732
|
})(pageRows[ri], ri);
|
|
@@ -7216,8 +7244,8 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7216
7244
|
function tipHandlers(label) {
|
|
7217
7245
|
if (!collapsed) return {};
|
|
7218
7246
|
function show3(e) {
|
|
7219
|
-
const
|
|
7220
|
-
setTip({ text: label, top:
|
|
7247
|
+
const r2 = e.currentTarget.getBoundingClientRect();
|
|
7248
|
+
setTip({ text: label, top: r2.top + r2.height / 2, left: r2.right + 8 });
|
|
7221
7249
|
}
|
|
7222
7250
|
function hide2() {
|
|
7223
7251
|
setTip(null);
|
|
@@ -7503,9 +7531,24 @@ var React39 = __toESM(require("react"), 1);
|
|
|
7503
7531
|
|
|
7504
7532
|
// src/breakpoints.ts
|
|
7505
7533
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
7534
|
+
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
7535
|
+
function respVars(prefix, value, map2) {
|
|
7536
|
+
const style = {};
|
|
7537
|
+
if (value == null) return style;
|
|
7538
|
+
if (typeof value !== "object") value = { base: value };
|
|
7539
|
+
let byBp = value, cur2;
|
|
7540
|
+
ORDER.forEach(function(k) {
|
|
7541
|
+
if (byBp[k] !== void 0) cur2 = map2 ? map2(byBp[k]) : byBp[k];
|
|
7542
|
+
if (cur2 !== void 0) style["--" + prefix + "-" + k] = cur2;
|
|
7543
|
+
});
|
|
7544
|
+
return style;
|
|
7545
|
+
}
|
|
7546
|
+
var space = function(v) {
|
|
7547
|
+
return typeof v === "number" ? "var(--aura-space-" + v + ")" : v;
|
|
7548
|
+
};
|
|
7506
7549
|
|
|
7507
7550
|
// src/responsive.tsx
|
|
7508
|
-
var
|
|
7551
|
+
var ORDER2 = ["base", "sm", "md", "lg", "xl"];
|
|
7509
7552
|
function useBreakpoint() {
|
|
7510
7553
|
return React39.useSyncExternalStore(subscribe, current, function() {
|
|
7511
7554
|
return "lg";
|
|
@@ -7513,7 +7556,7 @@ function useBreakpoint() {
|
|
|
7513
7556
|
}
|
|
7514
7557
|
function current() {
|
|
7515
7558
|
let w = window.innerWidth, bp = "base";
|
|
7516
|
-
|
|
7559
|
+
ORDER2.slice(1).forEach(function(k) {
|
|
7517
7560
|
if (w >= breakpoints[k]) bp = k;
|
|
7518
7561
|
});
|
|
7519
7562
|
return bp;
|
|
@@ -7528,23 +7571,9 @@ function useResponsive(value) {
|
|
|
7528
7571
|
const bp = useBreakpoint();
|
|
7529
7572
|
if (value == null || typeof value !== "object") return value;
|
|
7530
7573
|
const map2 = value;
|
|
7531
|
-
for (let i =
|
|
7574
|
+
for (let i = ORDER2.indexOf(bp); i >= 0; i--) if (map2[ORDER2[i]] !== void 0) return map2[ORDER2[i]];
|
|
7532
7575
|
return void 0;
|
|
7533
7576
|
}
|
|
7534
|
-
function respVars(prefix, value, map2) {
|
|
7535
|
-
const style = {};
|
|
7536
|
-
if (value == null) return style;
|
|
7537
|
-
if (typeof value !== "object") value = { base: value };
|
|
7538
|
-
let byBp = value, cur2;
|
|
7539
|
-
ORDER.forEach(function(k) {
|
|
7540
|
-
if (byBp[k] !== void 0) cur2 = map2 ? map2(byBp[k]) : byBp[k];
|
|
7541
|
-
if (cur2 !== void 0) style["--" + prefix + "-" + k] = cur2;
|
|
7542
|
-
});
|
|
7543
|
-
return style;
|
|
7544
|
-
}
|
|
7545
|
-
var space = function(v) {
|
|
7546
|
-
return typeof v === "number" ? "var(--aura-space-" + v + ")" : v;
|
|
7547
|
-
};
|
|
7548
7577
|
|
|
7549
7578
|
// src/Stack.tsx
|
|
7550
7579
|
var h5 = React40.createElement;
|
|
@@ -7582,14 +7611,14 @@ var Grid = React41.forwardRef(function Grid2(props, ref) {
|
|
|
7582
7611
|
var React42 = __toESM(require("react"), 1);
|
|
7583
7612
|
var h7 = React42.createElement;
|
|
7584
7613
|
var Container = React42.forwardRef(function Container2(props, ref) {
|
|
7585
|
-
const
|
|
7614
|
+
const attrs2 = {};
|
|
7586
7615
|
Object.keys(props).forEach(function(k) {
|
|
7587
7616
|
if (k === "id" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
7588
|
-
|
|
7617
|
+
attrs2[k] = props[k];
|
|
7589
7618
|
});
|
|
7590
7619
|
return h7(
|
|
7591
7620
|
props.as || "div",
|
|
7592
|
-
Object.assign(
|
|
7621
|
+
Object.assign(attrs2, {
|
|
7593
7622
|
ref,
|
|
7594
7623
|
className: cx(
|
|
7595
7624
|
"aura-container",
|
|
@@ -7607,18 +7636,19 @@ var Container = React42.forwardRef(function Container2(props, ref) {
|
|
|
7607
7636
|
var React43 = __toESM(require("react"), 1);
|
|
7608
7637
|
var h8 = React43.createElement;
|
|
7609
7638
|
var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
7610
|
-
const
|
|
7639
|
+
const attrs2 = {};
|
|
7611
7640
|
Object.keys(props).forEach(function(k) {
|
|
7612
7641
|
if (k === "id" || k === "lang" || k === "dir" || k === "role" || /^(aria|data)-/.test(k))
|
|
7613
|
-
|
|
7642
|
+
attrs2[k] = props[k];
|
|
7614
7643
|
});
|
|
7615
7644
|
const level = props.headingLevel || 1;
|
|
7616
7645
|
return h8(
|
|
7617
7646
|
"div",
|
|
7618
|
-
Object.assign(
|
|
7647
|
+
Object.assign(attrs2, { ref, className: cx("aura-page-header", props.className), style: props.style }),
|
|
7619
7648
|
h8(
|
|
7620
7649
|
"div",
|
|
7621
7650
|
{ className: "aura-page-header__text" },
|
|
7651
|
+
props.breadcrumb != null && props.breadcrumb !== false ? h8("div", { className: "aura-page-header__breadcrumb" }, props.breadcrumb) : null,
|
|
7622
7652
|
props.eyebrow != null && props.eyebrow !== false ? h8("p", { className: "aura-page-header__eyebrow" }, props.eyebrow) : null,
|
|
7623
7653
|
h8("h" + level, { className: "aura-page-header__title", id: props.titleId }, props.title),
|
|
7624
7654
|
props.meta != null && props.meta !== false ? h8("div", { className: "aura-page-header__meta" }, props.meta) : null
|
|
@@ -7627,36 +7657,286 @@ var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
|
7627
7657
|
);
|
|
7628
7658
|
});
|
|
7629
7659
|
|
|
7630
|
-
// src/
|
|
7660
|
+
// src/StatusTile.tsx
|
|
7661
|
+
var React45 = __toESM(require("react"), 1);
|
|
7662
|
+
|
|
7663
|
+
// src/tiles.tsx
|
|
7631
7664
|
var React44 = __toESM(require("react"), 1);
|
|
7632
|
-
var
|
|
7665
|
+
var h9 = React44.createElement;
|
|
7666
|
+
var STATUS_ICON = {
|
|
7667
|
+
down: IconCircleAlert,
|
|
7668
|
+
problem: IconTriangleAlert,
|
|
7669
|
+
maintenance: IconWrench,
|
|
7670
|
+
ok: IconCircleCheck
|
|
7671
|
+
};
|
|
7672
|
+
var STATUS_TONE = {
|
|
7673
|
+
down: "danger",
|
|
7674
|
+
problem: "warning",
|
|
7675
|
+
maintenance: "accent",
|
|
7676
|
+
ok: "default"
|
|
7677
|
+
};
|
|
7678
|
+
var STATUS_WORD = {
|
|
7679
|
+
down: "statusDown",
|
|
7680
|
+
problem: "statusProblem",
|
|
7681
|
+
maintenance: "statusMaintenance",
|
|
7682
|
+
ok: "statusOk"
|
|
7683
|
+
};
|
|
7684
|
+
function statusWord(status, t) {
|
|
7685
|
+
return String(t[STATUS_WORD[status]] || STATUS_WORD[status]);
|
|
7686
|
+
}
|
|
7687
|
+
function attrs(props) {
|
|
7688
|
+
const out = {};
|
|
7689
|
+
Object.keys(props).forEach(function(k) {
|
|
7690
|
+
if (k === "id" || k === "style" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
7691
|
+
out[k] = props[k];
|
|
7692
|
+
});
|
|
7693
|
+
return out;
|
|
7694
|
+
}
|
|
7695
|
+
var comma = h9("span", { className: "aura-status-tile__sep" }, ",");
|
|
7696
|
+
function statusTileElement(props, ref, Link, t, titleRef) {
|
|
7697
|
+
const status = STATUS_ICON[props.status] ? props.status : "ok";
|
|
7698
|
+
const valueTone = props.valueTone || STATUS_TONE[status];
|
|
7699
|
+
const word = props.statusLabel || statusWord(status, t);
|
|
7700
|
+
const markers = (props.markers || []).filter(Boolean);
|
|
7701
|
+
const has = function(v) {
|
|
7702
|
+
return v != null && v !== false && v !== "";
|
|
7703
|
+
};
|
|
7704
|
+
const hasValue = has(props.value), hasMeta = has(props.meta);
|
|
7705
|
+
const Tag3 = props.href ? Link : "div";
|
|
7706
|
+
return h9(
|
|
7707
|
+
Tag3,
|
|
7708
|
+
Object.assign(attrs(props), {
|
|
7709
|
+
ref,
|
|
7710
|
+
href: props.href,
|
|
7711
|
+
className: cx("aura-status-tile", "aura-status-tile--" + status, props.href && "is-interactive", props.className)
|
|
7712
|
+
}),
|
|
7713
|
+
h9(
|
|
7714
|
+
"span",
|
|
7715
|
+
{ className: "aura-status-tile__head" },
|
|
7716
|
+
h9(Icon, { name: h9(STATUS_ICON[status]), size: 16, className: "aura-status-tile__icon" }),
|
|
7717
|
+
h9("span", { className: "aura-status-tile__title", ref: titleRef }, props.title, comma),
|
|
7718
|
+
h9("span", { className: "aura-sr-only" }, word + (hasValue || hasMeta || markers.length ? "," : "")),
|
|
7719
|
+
hasValue ? h9(
|
|
7720
|
+
"span",
|
|
7721
|
+
{ className: cx("aura-status-tile__value", "is-" + valueTone) },
|
|
7722
|
+
props.value,
|
|
7723
|
+
hasMeta || markers.length ? comma : null
|
|
7724
|
+
) : null
|
|
7725
|
+
),
|
|
7726
|
+
hasMeta || markers.length ? h9(
|
|
7727
|
+
"span",
|
|
7728
|
+
{ className: "aura-status-tile__foot" },
|
|
7729
|
+
hasMeta ? h9("span", { className: "aura-status-tile__meta" }, props.meta, markers.length ? comma : null) : null,
|
|
7730
|
+
markers.length ? h9(
|
|
7731
|
+
"span",
|
|
7732
|
+
{ className: "aura-status-tile__markers" },
|
|
7733
|
+
markers.map(function(m, i) {
|
|
7734
|
+
return h9(
|
|
7735
|
+
"span",
|
|
7736
|
+
{
|
|
7737
|
+
key: i,
|
|
7738
|
+
className: cx("aura-status-tile__marker", "is-" + (m.tone || "neutral")),
|
|
7739
|
+
"data-aura-tip": m.label
|
|
7740
|
+
},
|
|
7741
|
+
h9(Icon, { name: m.icon, size: 14 }),
|
|
7742
|
+
h9("span", { className: "aura-sr-only" }, m.label + (i < markers.length - 1 ? "," : ""))
|
|
7743
|
+
);
|
|
7744
|
+
})
|
|
7745
|
+
) : null
|
|
7746
|
+
) : null
|
|
7747
|
+
);
|
|
7748
|
+
}
|
|
7749
|
+
var TileGrid = React44.forwardRef(function TileGrid2(props, ref) {
|
|
7750
|
+
const style = Object.assign(
|
|
7751
|
+
{},
|
|
7752
|
+
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
7753
|
+
props.style
|
|
7754
|
+
);
|
|
7755
|
+
return h9(
|
|
7756
|
+
"ul",
|
|
7757
|
+
Object.assign(attrs(props), {
|
|
7758
|
+
ref,
|
|
7759
|
+
role: "list",
|
|
7760
|
+
className: cx("aura-grid-layout", "aura-tile-grid", props.className),
|
|
7761
|
+
style
|
|
7762
|
+
}),
|
|
7763
|
+
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
7764
|
+
flat(props.children).map(function(c, i) {
|
|
7765
|
+
return h9("li", { key: React44.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
7766
|
+
})
|
|
7767
|
+
);
|
|
7768
|
+
});
|
|
7769
|
+
function flat(children) {
|
|
7770
|
+
const out = [];
|
|
7771
|
+
React44.Children.toArray(children).forEach(function(c) {
|
|
7772
|
+
if (React44.isValidElement(c) && c.type === React44.Fragment)
|
|
7773
|
+
flat(c.props.children).forEach(function(x) {
|
|
7774
|
+
out.push(React44.isValidElement(x) ? React44.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
7775
|
+
});
|
|
7776
|
+
else if (c !== "") out.push(c);
|
|
7777
|
+
});
|
|
7778
|
+
return out;
|
|
7779
|
+
}
|
|
7780
|
+
var SIZES2 = { sm: [80, 24], md: [120, 32] };
|
|
7781
|
+
var PAD = 2;
|
|
7782
|
+
function r(n3) {
|
|
7783
|
+
return Math.round(n3 * 100) / 100;
|
|
7784
|
+
}
|
|
7785
|
+
function num(v) {
|
|
7786
|
+
return typeof v === "number" && isFinite(v) ? v : null;
|
|
7787
|
+
}
|
|
7788
|
+
var Sparkline = React44.forwardRef(function Sparkline2(props, ref) {
|
|
7789
|
+
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
7790
|
+
const W = wh[0], H = wh[1];
|
|
7791
|
+
const data = (props.data || []).map(num);
|
|
7792
|
+
const n3 = data.length;
|
|
7793
|
+
const vals = data.filter(function(v) {
|
|
7794
|
+
return v != null;
|
|
7795
|
+
});
|
|
7796
|
+
let lo = num(props.min), hi = num(props.max);
|
|
7797
|
+
if (lo == null) lo = vals.length ? Math.min.apply(null, vals) : 0;
|
|
7798
|
+
if (hi == null) hi = vals.length ? Math.max.apply(null, vals) : 0;
|
|
7799
|
+
if (lo > hi) {
|
|
7800
|
+
const s = lo;
|
|
7801
|
+
lo = hi;
|
|
7802
|
+
hi = s;
|
|
7803
|
+
}
|
|
7804
|
+
const step = n3 > 1 ? (W - 2 * PAD) / (n3 - 1) : 0;
|
|
7805
|
+
const x = function(i) {
|
|
7806
|
+
return n3 > 1 ? PAD + i * step : W / 2;
|
|
7807
|
+
};
|
|
7808
|
+
const y = function(v) {
|
|
7809
|
+
if (hi === lo) return H / 2;
|
|
7810
|
+
const k = Math.max(0, Math.min(1, (v - lo) / (hi - lo)));
|
|
7811
|
+
return H - PAD - k * (H - 2 * PAD);
|
|
7812
|
+
};
|
|
7813
|
+
let d = "";
|
|
7814
|
+
const dots = [];
|
|
7815
|
+
data.forEach(function(v, i) {
|
|
7816
|
+
if (v == null) return;
|
|
7817
|
+
const prev = i > 0 && data[i - 1] != null, next = i < n3 - 1 && data[i + 1] != null;
|
|
7818
|
+
if (!prev && !next) dots.push(h9("circle", { key: "d" + i, cx: r(x(i)), cy: r(y(v)), r: 1.5 }));
|
|
7819
|
+
else d += (prev ? "L" : "M") + r(x(i)) + " " + r(y(v));
|
|
7820
|
+
});
|
|
7821
|
+
const mode = props.failures || "none";
|
|
7822
|
+
const fails = [];
|
|
7823
|
+
if (mode !== "none" && props.failed)
|
|
7824
|
+
data.forEach(function(_v, i) {
|
|
7825
|
+
if (!props.failed[i]) return;
|
|
7826
|
+
if (mode === "band") {
|
|
7827
|
+
const w = Math.max(2, step || W), left = Math.max(0, x(i) - w / 2), right = Math.min(W, x(i) + w / 2);
|
|
7828
|
+
fails.push(h9("rect", { key: "f" + i, x: r(left), y: 0, width: r(right - left), height: H }));
|
|
7829
|
+
} else
|
|
7830
|
+
fails.push(
|
|
7831
|
+
h9("rect", {
|
|
7832
|
+
key: "f" + i,
|
|
7833
|
+
x: r(Math.max(0, Math.min(W - 1.5, x(i) - 0.75))),
|
|
7834
|
+
y: H - 6,
|
|
7835
|
+
width: 1.5,
|
|
7836
|
+
height: 6
|
|
7837
|
+
})
|
|
7838
|
+
);
|
|
7839
|
+
});
|
|
7840
|
+
const named = !!props.label;
|
|
7841
|
+
return h9(
|
|
7842
|
+
"svg",
|
|
7843
|
+
Object.assign(attrs(props), {
|
|
7844
|
+
ref,
|
|
7845
|
+
className: cx("aura-sparkline", "is-" + (props.tone || "neutral"), props.className),
|
|
7846
|
+
width: W,
|
|
7847
|
+
height: H,
|
|
7848
|
+
viewBox: "0 0 " + W + " " + H,
|
|
7849
|
+
role: named ? "img" : void 0,
|
|
7850
|
+
"aria-label": named ? props.label : void 0,
|
|
7851
|
+
"aria-hidden": named ? void 0 : true,
|
|
7852
|
+
focusable: "false"
|
|
7853
|
+
}),
|
|
7854
|
+
fails.length && mode === "band" ? h9("g", { className: "aura-sparkline__band" }, fails) : null,
|
|
7855
|
+
d ? h9("path", { className: "aura-sparkline__line", d }) : null,
|
|
7856
|
+
dots.length ? h9("g", { className: "aura-sparkline__dots" }, dots) : null,
|
|
7857
|
+
fails.length && mode === "ticks" ? h9("g", { className: "aura-sparkline__ticks" }, fails) : null
|
|
7858
|
+
);
|
|
7859
|
+
});
|
|
7860
|
+
|
|
7861
|
+
// src/StatusTile.tsx
|
|
7862
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React45.useLayoutEffect : React45.useEffect;
|
|
7863
|
+
var StatusTile = React45.forwardRef(function StatusTile2(props, ref) {
|
|
7864
|
+
const Link = useLinkComponent(props.linkComponent);
|
|
7865
|
+
const t = useStrings();
|
|
7866
|
+
useAutoTip();
|
|
7867
|
+
if (!props.href && (props["aria-label"] || props["aria-labelledby"]))
|
|
7868
|
+
devWarnOnce(
|
|
7869
|
+
"status-tile-label",
|
|
7870
|
+
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
7871
|
+
);
|
|
7872
|
+
const titleRef = React45.useRef(null);
|
|
7873
|
+
const check = React45.useCallback(function() {
|
|
7874
|
+
const el = titleRef.current;
|
|
7875
|
+
if (!el) return;
|
|
7876
|
+
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
7877
|
+
const text2 = (el.textContent || "").replace(/,$/, "").trim();
|
|
7878
|
+
if (cut && text2) el.setAttribute("data-aura-tip", text2);
|
|
7879
|
+
else el.removeAttribute("data-aura-tip");
|
|
7880
|
+
}, []);
|
|
7881
|
+
useIsoLayoutEffect2(check, [props.title, check]);
|
|
7882
|
+
const linked = !!props.href;
|
|
7883
|
+
React45.useEffect(
|
|
7884
|
+
function() {
|
|
7885
|
+
const el = titleRef.current;
|
|
7886
|
+
if (!el) return;
|
|
7887
|
+
let live = true;
|
|
7888
|
+
const ro = typeof ResizeObserver !== "undefined" ? new ResizeObserver(check) : null;
|
|
7889
|
+
const mo = typeof MutationObserver !== "undefined" ? new MutationObserver(check) : null;
|
|
7890
|
+
if (ro) ro.observe(el);
|
|
7891
|
+
if (mo) mo.observe(el, { characterData: true, childList: true, subtree: true });
|
|
7892
|
+
if (document.fonts && document.fonts.ready)
|
|
7893
|
+
document.fonts.ready.then(function() {
|
|
7894
|
+
if (live) check();
|
|
7895
|
+
});
|
|
7896
|
+
return function() {
|
|
7897
|
+
live = false;
|
|
7898
|
+
if (ro) ro.disconnect();
|
|
7899
|
+
if (mo) mo.disconnect();
|
|
7900
|
+
};
|
|
7901
|
+
},
|
|
7902
|
+
[check, linked]
|
|
7903
|
+
);
|
|
7904
|
+
return statusTileElement(props, ref, Link, t, titleRef);
|
|
7905
|
+
});
|
|
7906
|
+
|
|
7907
|
+
// src/AppShell.tsx
|
|
7908
|
+
var React46 = __toESM(require("react"), 1);
|
|
7909
|
+
var AppShell = React46.forwardRef(function AppShell2(props, ref) {
|
|
7633
7910
|
const t = useStrings();
|
|
7634
7911
|
const bp = useBreakpoint();
|
|
7635
7912
|
const wide = bp === "lg" || bp === "xl";
|
|
7636
|
-
const st =
|
|
7637
|
-
|
|
7913
|
+
const st = React46.useState(false), open = st[0], setOpen = st[1];
|
|
7914
|
+
React46.useEffect(
|
|
7638
7915
|
function() {
|
|
7639
7916
|
if (wide) setOpen(false);
|
|
7640
7917
|
},
|
|
7641
7918
|
[wide]
|
|
7642
7919
|
);
|
|
7643
|
-
const navEl = props.nav &&
|
|
7920
|
+
const navEl = props.nav && React46.isValidElement(props.nav) ? props.nav : null;
|
|
7644
7921
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
7645
|
-
const navState =
|
|
7922
|
+
const navState = React46.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
7646
7923
|
function onNav(id) {
|
|
7647
7924
|
if (shared) navState[1](id);
|
|
7648
7925
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
7649
7926
|
}
|
|
7650
|
-
const rootRef =
|
|
7651
|
-
const barRef =
|
|
7927
|
+
const rootRef = React46.useRef(null);
|
|
7928
|
+
const barRef = React46.useRef(null);
|
|
7652
7929
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
7653
7930
|
const hasBar = !!(props.header || props.nav);
|
|
7931
|
+
const barH = React46.useState(null);
|
|
7654
7932
|
useIsoLayoutEffect(
|
|
7655
7933
|
function() {
|
|
7656
7934
|
const root = rootRef.current, bar = barRef.current;
|
|
7657
7935
|
if (!root || !bar) return;
|
|
7658
7936
|
function sync() {
|
|
7659
|
-
|
|
7937
|
+
const h11 = bar.getBoundingClientRect().height;
|
|
7938
|
+
root.style.setProperty("--aura-shell-bar-height", h11 + "px");
|
|
7939
|
+
if (h11 > 0) barH[1](Math.round(h11));
|
|
7660
7940
|
}
|
|
7661
7941
|
sync();
|
|
7662
7942
|
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
@@ -7668,8 +7948,8 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7668
7948
|
},
|
|
7669
7949
|
[hasBar]
|
|
7670
7950
|
);
|
|
7671
|
-
const deskNav = navEl && shared ?
|
|
7672
|
-
const drawerNav = navEl ?
|
|
7951
|
+
const deskNav = navEl && shared ? React46.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
7952
|
+
const drawerNav = navEl ? React46.cloneElement(navEl, {
|
|
7673
7953
|
value: shared ? navState[0] : navEl.props.value,
|
|
7674
7954
|
onChange: function(id) {
|
|
7675
7955
|
onNav(id);
|
|
@@ -7684,7 +7964,7 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7684
7964
|
collapsed: false,
|
|
7685
7965
|
collapsible: false
|
|
7686
7966
|
}) : props.nav;
|
|
7687
|
-
return /* @__PURE__ */
|
|
7967
|
+
return /* @__PURE__ */ React46.createElement(
|
|
7688
7968
|
"div",
|
|
7689
7969
|
{
|
|
7690
7970
|
ref: mergedRef,
|
|
@@ -7694,11 +7974,13 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7694
7974
|
/* 5.14: no top bar at all, or one that only holds the menu button (gone from lg up): the bar-height token is 0. */
|
|
7695
7975
|
!props.header && !props.nav && "aura-shell--no-bar",
|
|
7696
7976
|
!props.header && props.nav && "aura-shell--menu-bar",
|
|
7977
|
+
/* 5.33 (DxT Monitor #6): a header bar for phones only. */
|
|
7978
|
+
props.header && props.headerHideFrom === "lg" && "aura-shell--menu-bar",
|
|
7697
7979
|
props.className
|
|
7698
7980
|
)
|
|
7699
7981
|
},
|
|
7700
|
-
props.nav ? /* @__PURE__ */
|
|
7701
|
-
props.nav ? /* @__PURE__ */
|
|
7982
|
+
props.nav ? /* @__PURE__ */ React46.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
7983
|
+
props.nav ? /* @__PURE__ */ React46.createElement(
|
|
7702
7984
|
Drawer,
|
|
7703
7985
|
{
|
|
7704
7986
|
open,
|
|
@@ -7708,23 +7990,37 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7708
7990
|
side: "left",
|
|
7709
7991
|
size: "nav",
|
|
7710
7992
|
"aria-label": props.navLabel || t.navigation,
|
|
7711
|
-
dismissible: true
|
|
7993
|
+
dismissible: true,
|
|
7994
|
+
closeProps: { touchHeight: true },
|
|
7995
|
+
className: navEl && navEl.props.headerDivider && navEl.props.header ? "aura-drawer--nav-divided" : void 0,
|
|
7996
|
+
style: barH[0] ? { "--aura-shell-bar-height": barH[0] + "px" } : void 0
|
|
7712
7997
|
},
|
|
7713
7998
|
drawerNav
|
|
7714
7999
|
) : null,
|
|
7715
|
-
/* @__PURE__ */
|
|
7716
|
-
|
|
8000
|
+
/* @__PURE__ */ React46.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React46.createElement(
|
|
8001
|
+
"header",
|
|
7717
8002
|
{
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
8003
|
+
ref: barRef,
|
|
8004
|
+
className: cx(
|
|
8005
|
+
"aura-shell__bar",
|
|
8006
|
+
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only"
|
|
8007
|
+
)
|
|
8008
|
+
},
|
|
8009
|
+
props.nav ? /* @__PURE__ */ React46.createElement(
|
|
8010
|
+
IconButton,
|
|
8011
|
+
{
|
|
8012
|
+
className: "aura-shell__menu",
|
|
8013
|
+
icon: /* @__PURE__ */ React46.createElement(IconMenu, null),
|
|
8014
|
+
label: props.menuLabel || t.openNav,
|
|
8015
|
+
size: "md",
|
|
8016
|
+
onClick: function() {
|
|
8017
|
+
setOpen(true);
|
|
8018
|
+
},
|
|
8019
|
+
"aria-expanded": open
|
|
8020
|
+
}
|
|
8021
|
+
) : null,
|
|
8022
|
+
/* @__PURE__ */ React46.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8023
|
+
) : null, /* @__PURE__ */ React46.createElement(
|
|
7728
8024
|
"main",
|
|
7729
8025
|
{
|
|
7730
8026
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -7737,17 +8033,17 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7737
8033
|
});
|
|
7738
8034
|
|
|
7739
8035
|
// src/ActionBar.tsx
|
|
7740
|
-
var
|
|
7741
|
-
var ActionBar =
|
|
8036
|
+
var React47 = __toESM(require("react"), 1);
|
|
8037
|
+
var ActionBar = React47.forwardRef(function ActionBar2(props, ref) {
|
|
7742
8038
|
const t = useStrings();
|
|
7743
8039
|
const bulk = props.selected != null;
|
|
7744
8040
|
const idle = bulk && !props.selected;
|
|
7745
8041
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
7746
|
-
const hasStart =
|
|
8042
|
+
const hasStart = React47.Children.toArray(props.start).some(function(c) {
|
|
7747
8043
|
return c !== "";
|
|
7748
8044
|
});
|
|
7749
|
-
const cameFrom =
|
|
7750
|
-
const own =
|
|
8045
|
+
const cameFrom = React47.useRef(null);
|
|
8046
|
+
const own = React47.useRef(null);
|
|
7751
8047
|
function clear() {
|
|
7752
8048
|
props.onClearSelection();
|
|
7753
8049
|
setTimeout(function() {
|
|
@@ -7756,7 +8052,7 @@ var ActionBar = React45.forwardRef(function ActionBar2(props, ref) {
|
|
|
7756
8052
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
7757
8053
|
}, 0);
|
|
7758
8054
|
}
|
|
7759
|
-
return /* @__PURE__ */
|
|
8055
|
+
return /* @__PURE__ */ React47.createElement(
|
|
7760
8056
|
"div",
|
|
7761
8057
|
{
|
|
7762
8058
|
ref: function(el) {
|
|
@@ -7777,16 +8073,16 @@ var ActionBar = React45.forwardRef(function ActionBar2(props, ref) {
|
|
|
7777
8073
|
props.className
|
|
7778
8074
|
)
|
|
7779
8075
|
},
|
|
7780
|
-
/* @__PURE__ */
|
|
8076
|
+
/* @__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)
|
|
7781
8077
|
);
|
|
7782
8078
|
});
|
|
7783
8079
|
|
|
7784
8080
|
// src/Separator.tsx
|
|
7785
|
-
var
|
|
7786
|
-
var Separator =
|
|
8081
|
+
var React48 = __toESM(require("react"), 1);
|
|
8082
|
+
var Separator = React48.forwardRef(function Separator2(props, ref) {
|
|
7787
8083
|
const vertical = props.orientation === "vertical";
|
|
7788
8084
|
const decorative = props.decorative !== false;
|
|
7789
|
-
return /* @__PURE__ */
|
|
8085
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7790
8086
|
"div",
|
|
7791
8087
|
{
|
|
7792
8088
|
ref,
|
|
@@ -7799,14 +8095,14 @@ var Separator = React46.forwardRef(function Separator2(props, ref) {
|
|
|
7799
8095
|
});
|
|
7800
8096
|
|
|
7801
8097
|
// src/Table.tsx
|
|
7802
|
-
var
|
|
7803
|
-
var StackLabels =
|
|
7804
|
-
var ColumnIndex =
|
|
7805
|
-
function
|
|
8098
|
+
var React49 = __toESM(require("react"), 1);
|
|
8099
|
+
var StackLabels = React49.createContext(null);
|
|
8100
|
+
var ColumnIndex = React49.createContext(-1);
|
|
8101
|
+
function flat2(children) {
|
|
7806
8102
|
const out = [];
|
|
7807
|
-
|
|
7808
|
-
if (
|
|
7809
|
-
out.push.apply(out,
|
|
8103
|
+
React49.Children.toArray(children).forEach(function(c) {
|
|
8104
|
+
if (React49.isValidElement(c) && c.type === React49.Fragment)
|
|
8105
|
+
out.push.apply(out, flat2(c.props.children));
|
|
7810
8106
|
else out.push(c);
|
|
7811
8107
|
});
|
|
7812
8108
|
return out;
|
|
@@ -7819,7 +8115,7 @@ function text(node) {
|
|
|
7819
8115
|
});
|
|
7820
8116
|
return parts.length ? parts.join("") : void 0;
|
|
7821
8117
|
}
|
|
7822
|
-
if (
|
|
8118
|
+
if (React49.isValidElement(node)) {
|
|
7823
8119
|
const p = node.props;
|
|
7824
8120
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
7825
8121
|
return text(p.children);
|
|
@@ -7828,14 +8124,14 @@ function text(node) {
|
|
|
7828
8124
|
}
|
|
7829
8125
|
function headerLabels(children) {
|
|
7830
8126
|
let out = [];
|
|
7831
|
-
|
|
7832
|
-
if (out.length || !
|
|
7833
|
-
const row =
|
|
7834
|
-
return
|
|
8127
|
+
flat2(children).forEach(function(c) {
|
|
8128
|
+
if (out.length || !React49.isValidElement(c) || c.type !== THead) return;
|
|
8129
|
+
const row = flat2(c.props.children).find(function(r2) {
|
|
8130
|
+
return React49.isValidElement(r2);
|
|
7835
8131
|
});
|
|
7836
8132
|
if (!row) return;
|
|
7837
|
-
|
|
7838
|
-
if (!
|
|
8133
|
+
flat2(row.props.children).forEach(function(cell) {
|
|
8134
|
+
if (!React49.isValidElement(cell)) return;
|
|
7839
8135
|
const p = cell.props;
|
|
7840
8136
|
const t = text(p.children);
|
|
7841
8137
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -7845,7 +8141,7 @@ function headerLabels(children) {
|
|
|
7845
8141
|
});
|
|
7846
8142
|
return out;
|
|
7847
8143
|
}
|
|
7848
|
-
var Table =
|
|
8144
|
+
var Table = React49.forwardRef(function Table2(props, ref) {
|
|
7849
8145
|
const {
|
|
7850
8146
|
caption,
|
|
7851
8147
|
captionHidden,
|
|
@@ -7875,12 +8171,12 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7875
8171
|
"tbl-stack-labels",
|
|
7876
8172
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
7877
8173
|
);
|
|
7878
|
-
const outer =
|
|
8174
|
+
const outer = React49.useContext(StackLabels);
|
|
7879
8175
|
const pageDensity = useDensity();
|
|
7880
8176
|
const capId = uid();
|
|
7881
|
-
const wrap =
|
|
7882
|
-
const sc =
|
|
7883
|
-
const wide =
|
|
8177
|
+
const wrap = React49.useRef(null);
|
|
8178
|
+
const sc = React49.useState(false), scrolls = sc[0];
|
|
8179
|
+
const wide = React49.useState(false);
|
|
7884
8180
|
useIsoLayoutEffect(function() {
|
|
7885
8181
|
const el = wrap.current;
|
|
7886
8182
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -7897,7 +8193,7 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7897
8193
|
ro.disconnect();
|
|
7898
8194
|
};
|
|
7899
8195
|
}, []);
|
|
7900
|
-
const table = /* @__PURE__ */
|
|
8196
|
+
const table = /* @__PURE__ */ React49.createElement(
|
|
7901
8197
|
"div",
|
|
7902
8198
|
{
|
|
7903
8199
|
ref: wrap,
|
|
@@ -7921,7 +8217,7 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7921
8217
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
7922
8218
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
7923
8219
|
},
|
|
7924
|
-
/* @__PURE__ */
|
|
8220
|
+
/* @__PURE__ */ React49.createElement(
|
|
7925
8221
|
"table",
|
|
7926
8222
|
{
|
|
7927
8223
|
ref,
|
|
@@ -7937,11 +8233,11 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7937
8233
|
role: stackBelow ? "table" : void 0,
|
|
7938
8234
|
...rest
|
|
7939
8235
|
},
|
|
7940
|
-
caption != null ? /* @__PURE__ */
|
|
7941
|
-
labels ? /* @__PURE__ */
|
|
8236
|
+
caption != null ? /* @__PURE__ */ React49.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8237
|
+
labels ? /* @__PURE__ */ React49.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React49.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
7942
8238
|
)
|
|
7943
8239
|
);
|
|
7944
|
-
return cards ? /* @__PURE__ */
|
|
8240
|
+
return cards ? /* @__PURE__ */ React49.createElement(
|
|
7945
8241
|
"div",
|
|
7946
8242
|
{
|
|
7947
8243
|
className: cx(
|
|
@@ -7954,10 +8250,10 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7954
8250
|
) : table;
|
|
7955
8251
|
});
|
|
7956
8252
|
function section(tag, cls) {
|
|
7957
|
-
const C =
|
|
8253
|
+
const C = React49.forwardRef(function TableSection(props, ref) {
|
|
7958
8254
|
const { className, ...rest } = props;
|
|
7959
|
-
const stacked =
|
|
7960
|
-
return
|
|
8255
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
8256
|
+
return React49.createElement(
|
|
7961
8257
|
tag,
|
|
7962
8258
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
7963
8259
|
);
|
|
@@ -7970,14 +8266,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
7970
8266
|
TBody.displayName = "TBody";
|
|
7971
8267
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
7972
8268
|
TFoot.displayName = "TFoot";
|
|
7973
|
-
var Tr =
|
|
8269
|
+
var Tr = React49.forwardRef(function Tr2(props, ref) {
|
|
7974
8270
|
const { className, children, ...rest } = props;
|
|
7975
|
-
const stacked =
|
|
8271
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
7976
8272
|
let col = 0;
|
|
7977
|
-
return /* @__PURE__ */
|
|
8273
|
+
return /* @__PURE__ */ React49.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
7978
8274
|
const at = col;
|
|
7979
|
-
if (
|
|
7980
|
-
return /* @__PURE__ */
|
|
8275
|
+
if (React49.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
8276
|
+
return /* @__PURE__ */ React49.createElement(ColumnIndex.Provider, { key: React49.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
7981
8277
|
}) : children);
|
|
7982
8278
|
});
|
|
7983
8279
|
function cellClass(base, p) {
|
|
@@ -7991,10 +8287,10 @@ function cellClass(base, p) {
|
|
|
7991
8287
|
p.className
|
|
7992
8288
|
);
|
|
7993
8289
|
}
|
|
7994
|
-
var Th =
|
|
8290
|
+
var Th = React49.forwardRef(function Th2(props, ref) {
|
|
7995
8291
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
7996
|
-
const stacked =
|
|
7997
|
-
return /* @__PURE__ */
|
|
8292
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
8293
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7998
8294
|
"th",
|
|
7999
8295
|
{
|
|
8000
8296
|
ref,
|
|
@@ -8006,12 +8302,12 @@ var Th = React47.forwardRef(function Th2(props, ref) {
|
|
|
8006
8302
|
}
|
|
8007
8303
|
);
|
|
8008
8304
|
});
|
|
8009
|
-
var Td =
|
|
8305
|
+
var Td = React49.forwardRef(function Td2(props, ref) {
|
|
8010
8306
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8011
|
-
const labels =
|
|
8307
|
+
const labels = React49.useContext(StackLabels), col = React49.useContext(ColumnIndex);
|
|
8012
8308
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8013
8309
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8014
|
-
return /* @__PURE__ */
|
|
8310
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8015
8311
|
"td",
|
|
8016
8312
|
{
|
|
8017
8313
|
ref,
|
|
@@ -8025,8 +8321,8 @@ var Td = React47.forwardRef(function Td2(props, ref) {
|
|
|
8025
8321
|
});
|
|
8026
8322
|
|
|
8027
8323
|
// src/BottomNav.tsx
|
|
8028
|
-
var
|
|
8029
|
-
var BottomNav =
|
|
8324
|
+
var React50 = __toESM(require("react"), 1);
|
|
8325
|
+
var BottomNav = React50.forwardRef(function BottomNav2(props, ref) {
|
|
8030
8326
|
const t = useStrings();
|
|
8031
8327
|
const Link = useLinkComponent(props.linkComponent);
|
|
8032
8328
|
const st = useMaybeControlled(
|
|
@@ -8036,14 +8332,14 @@ var BottomNav = React48.forwardRef(function BottomNav2(props, ref) {
|
|
|
8036
8332
|
);
|
|
8037
8333
|
const active = st[0];
|
|
8038
8334
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8039
|
-
return /* @__PURE__ */
|
|
8335
|
+
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(
|
|
8040
8336
|
"nav",
|
|
8041
8337
|
{
|
|
8042
8338
|
ref,
|
|
8043
8339
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide2, props.className),
|
|
8044
8340
|
"aria-label": props.label || t.mainNav
|
|
8045
8341
|
},
|
|
8046
|
-
/* @__PURE__ */
|
|
8342
|
+
/* @__PURE__ */ React50.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8047
8343
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8048
8344
|
devWarnOnce(
|
|
8049
8345
|
"bottomnav-label-" + it.id,
|
|
@@ -8064,23 +8360,23 @@ var BottomNav = React48.forwardRef(function BottomNav2(props, ref) {
|
|
|
8064
8360
|
}
|
|
8065
8361
|
};
|
|
8066
8362
|
const inner = [
|
|
8067
|
-
/* @__PURE__ */
|
|
8068
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8069
|
-
/* @__PURE__ */
|
|
8070
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
8363
|
+
/* @__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),
|
|
8364
|
+
it.ariaLabel ? /* @__PURE__ */ React50.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
8365
|
+
/* @__PURE__ */ React50.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
8366
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React50.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
8071
8367
|
];
|
|
8072
|
-
return /* @__PURE__ */
|
|
8368
|
+
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));
|
|
8073
8369
|
}))
|
|
8074
8370
|
));
|
|
8075
8371
|
});
|
|
8076
8372
|
|
|
8077
8373
|
// src/Surface.tsx
|
|
8078
|
-
var
|
|
8079
|
-
var
|
|
8080
|
-
var Surface =
|
|
8374
|
+
var React51 = __toESM(require("react"), 1);
|
|
8375
|
+
var h10 = React51.createElement;
|
|
8376
|
+
var Surface = React51.forwardRef(function Surface2(props, ref) {
|
|
8081
8377
|
const t = props.texture || "mesh";
|
|
8082
8378
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8083
|
-
return
|
|
8379
|
+
return h10(
|
|
8084
8380
|
props.as || "div",
|
|
8085
8381
|
Object.assign({}, rest, {
|
|
8086
8382
|
ref,
|
|
@@ -8098,14 +8394,14 @@ var Surface = React49.forwardRef(function Surface2(props, ref) {
|
|
|
8098
8394
|
});
|
|
8099
8395
|
|
|
8100
8396
|
// src/Stat.tsx
|
|
8101
|
-
var
|
|
8102
|
-
var Stat =
|
|
8397
|
+
var React52 = __toESM(require("react"), 1);
|
|
8398
|
+
var Stat = React52.forwardRef(function Stat2(props, ref) {
|
|
8103
8399
|
const Link = useLinkComponent(props.linkComponent);
|
|
8104
8400
|
return statElement(props, ref, Link);
|
|
8105
8401
|
});
|
|
8106
8402
|
|
|
8107
8403
|
// src/TimePicker.tsx
|
|
8108
|
-
var
|
|
8404
|
+
var React53 = __toESM(require("react"), 1);
|
|
8109
8405
|
var import_react_dom12 = require("react-dom");
|
|
8110
8406
|
|
|
8111
8407
|
// src/text.ts
|
|
@@ -8147,7 +8443,7 @@ function toMin(t) {
|
|
|
8147
8443
|
function fromMin(n3) {
|
|
8148
8444
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8149
8445
|
}
|
|
8150
|
-
var TimePicker =
|
|
8446
|
+
var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
8151
8447
|
const t = useStrings();
|
|
8152
8448
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8153
8449
|
const st = useMaybeControlled(
|
|
@@ -8157,7 +8453,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8157
8453
|
);
|
|
8158
8454
|
const value = st[0];
|
|
8159
8455
|
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;
|
|
8160
|
-
const slots =
|
|
8456
|
+
const slots = React53.useMemo(
|
|
8161
8457
|
function() {
|
|
8162
8458
|
const out = [];
|
|
8163
8459
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8169,12 +8465,12 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8169
8465
|
const n3 = toMin(v);
|
|
8170
8466
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8171
8467
|
}
|
|
8172
|
-
const openState =
|
|
8173
|
-
const editState =
|
|
8174
|
-
const aState =
|
|
8175
|
-
const errState =
|
|
8176
|
-
const pos =
|
|
8177
|
-
const boxRef =
|
|
8468
|
+
const openState = React53.useState(false), open = openState[0], setOpen = openState[1];
|
|
8469
|
+
const editState = React53.useState(null), editing = editState[0], setEditing = editState[1];
|
|
8470
|
+
const aState = React53.useState(0), active = aState[0], setActive = aState[1];
|
|
8471
|
+
const errState = React53.useState(null);
|
|
8472
|
+
const pos = React53.useState(null);
|
|
8473
|
+
const boxRef = React53.useRef(null), inputRef = React53.useRef(null), listRef = React53.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8178
8474
|
const mounted = useMounted();
|
|
8179
8475
|
function nearest(v) {
|
|
8180
8476
|
const n3 = toMin(v);
|
|
@@ -8187,13 +8483,13 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8187
8483
|
}
|
|
8188
8484
|
function place2() {
|
|
8189
8485
|
if (!boxRef.current) return;
|
|
8190
|
-
const
|
|
8486
|
+
const r2 = boxRef.current.getBoundingClientRect(), below2 = window.innerHeight - r2.bottom - 8, up2 = below2 < 200 && r2.top > below2;
|
|
8191
8487
|
pos[1]({
|
|
8192
|
-
left:
|
|
8193
|
-
width: Math.max(
|
|
8194
|
-
top: up2 ? void 0 :
|
|
8195
|
-
bottom: up2 ? window.innerHeight -
|
|
8196
|
-
maxHeight: Math.min(280, (up2 ?
|
|
8488
|
+
left: r2.left,
|
|
8489
|
+
width: Math.max(r2.width, 160),
|
|
8490
|
+
top: up2 ? void 0 : r2.bottom + 4,
|
|
8491
|
+
bottom: up2 ? window.innerHeight - r2.top + 4 : void 0,
|
|
8492
|
+
maxHeight: Math.min(280, (up2 ? r2.top : below2) - 8)
|
|
8197
8493
|
});
|
|
8198
8494
|
}
|
|
8199
8495
|
useIsoLayoutEffect(
|
|
@@ -8202,7 +8498,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8202
8498
|
},
|
|
8203
8499
|
[open]
|
|
8204
8500
|
);
|
|
8205
|
-
|
|
8501
|
+
React53.useEffect(
|
|
8206
8502
|
function() {
|
|
8207
8503
|
if (!open) return;
|
|
8208
8504
|
function outside(e) {
|
|
@@ -8224,7 +8520,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8224
8520
|
},
|
|
8225
8521
|
[open]
|
|
8226
8522
|
);
|
|
8227
|
-
|
|
8523
|
+
React53.useEffect(
|
|
8228
8524
|
function() {
|
|
8229
8525
|
if (!open || !listRef.current) return;
|
|
8230
8526
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8323,9 +8619,9 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8323
8619
|
}
|
|
8324
8620
|
const error = errState[0] || props.error;
|
|
8325
8621
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8326
|
-
/* @__PURE__ */
|
|
8622
|
+
/* @__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) {
|
|
8327
8623
|
const dis = blocked(s), sel = s === value;
|
|
8328
|
-
return /* @__PURE__ */
|
|
8624
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8329
8625
|
"li",
|
|
8330
8626
|
{
|
|
8331
8627
|
key: s,
|
|
@@ -8350,13 +8646,13 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8350
8646
|
if (active !== i) setActive(i);
|
|
8351
8647
|
}
|
|
8352
8648
|
},
|
|
8353
|
-
/* @__PURE__ */
|
|
8354
|
-
sel ? /* @__PURE__ */
|
|
8649
|
+
/* @__PURE__ */ React53.createElement("span", { className: "aura-combo__label" }, s),
|
|
8650
|
+
sel ? /* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
8355
8651
|
);
|
|
8356
8652
|
}))),
|
|
8357
8653
|
document.body
|
|
8358
8654
|
) : null;
|
|
8359
|
-
return /* @__PURE__ */
|
|
8655
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8360
8656
|
Field,
|
|
8361
8657
|
{
|
|
8362
8658
|
id,
|
|
@@ -8368,7 +8664,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8368
8664
|
disabled: props.disabled,
|
|
8369
8665
|
className: props.className
|
|
8370
8666
|
},
|
|
8371
|
-
/* @__PURE__ */
|
|
8667
|
+
/* @__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(
|
|
8372
8668
|
"input",
|
|
8373
8669
|
{
|
|
8374
8670
|
ref: inputMerged,
|
|
@@ -8408,7 +8704,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8408
8704
|
}, 0);
|
|
8409
8705
|
}
|
|
8410
8706
|
}
|
|
8411
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
8707
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React53.createElement(
|
|
8412
8708
|
"button",
|
|
8413
8709
|
{
|
|
8414
8710
|
type: "button",
|
|
@@ -8421,8 +8717,8 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8421
8717
|
if (inputRef.current) inputRef.current.focus();
|
|
8422
8718
|
}
|
|
8423
8719
|
},
|
|
8424
|
-
/* @__PURE__ */
|
|
8425
|
-
) : null, /* @__PURE__ */
|
|
8720
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconX, null) })
|
|
8721
|
+
) : null, /* @__PURE__ */ React53.createElement(
|
|
8426
8722
|
"button",
|
|
8427
8723
|
{
|
|
8428
8724
|
type: "button",
|
|
@@ -8440,14 +8736,14 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8440
8736
|
}
|
|
8441
8737
|
}
|
|
8442
8738
|
},
|
|
8443
|
-
/* @__PURE__ */
|
|
8739
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconChevronDown, null) })
|
|
8444
8740
|
)),
|
|
8445
8741
|
list
|
|
8446
8742
|
);
|
|
8447
8743
|
});
|
|
8448
8744
|
|
|
8449
8745
|
// src/FileUpload.tsx
|
|
8450
|
-
var
|
|
8746
|
+
var React54 = __toESM(require("react"), 1);
|
|
8451
8747
|
function matches(file, accept) {
|
|
8452
8748
|
if (!accept) return true;
|
|
8453
8749
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -8471,24 +8767,24 @@ function describeAccept(accept, t) {
|
|
|
8471
8767
|
}).join(", ");
|
|
8472
8768
|
}
|
|
8473
8769
|
var seq = 0;
|
|
8474
|
-
var FileUpload =
|
|
8770
|
+
var FileUpload = React54.forwardRef(function FileUpload2(props, ref) {
|
|
8475
8771
|
const t = useStrings();
|
|
8476
8772
|
const auto = uid(), id = props.id || auto;
|
|
8477
8773
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
8478
8774
|
const items2 = st[0] || [];
|
|
8479
|
-
const dragState =
|
|
8480
|
-
const inputRef =
|
|
8481
|
-
const urls =
|
|
8775
|
+
const dragState = React54.useState(false), over = dragState[0];
|
|
8776
|
+
const inputRef = React54.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
8777
|
+
const urls = React54.useRef({});
|
|
8482
8778
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
8483
8779
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
8484
|
-
|
|
8780
|
+
React54.useEffect(function() {
|
|
8485
8781
|
return function() {
|
|
8486
8782
|
Object.keys(urls.current).forEach(function(k) {
|
|
8487
8783
|
URL.revokeObjectURL(urls.current[k]);
|
|
8488
8784
|
});
|
|
8489
8785
|
};
|
|
8490
8786
|
}, []);
|
|
8491
|
-
|
|
8787
|
+
React54.useEffect(
|
|
8492
8788
|
function() {
|
|
8493
8789
|
const el = inputRef.current;
|
|
8494
8790
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -8548,7 +8844,7 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8548
8844
|
if (inputRef.current) inputRef.current.focus();
|
|
8549
8845
|
}
|
|
8550
8846
|
const error = props.error;
|
|
8551
|
-
return /* @__PURE__ */
|
|
8847
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8552
8848
|
Field,
|
|
8553
8849
|
{
|
|
8554
8850
|
id,
|
|
@@ -8560,7 +8856,7 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8560
8856
|
disabled: props.disabled,
|
|
8561
8857
|
className: props.className
|
|
8562
8858
|
},
|
|
8563
|
-
/* @__PURE__ */
|
|
8859
|
+
/* @__PURE__ */ React54.createElement(
|
|
8564
8860
|
"div",
|
|
8565
8861
|
{
|
|
8566
8862
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -8581,9 +8877,9 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8581
8877
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
8582
8878
|
}
|
|
8583
8879
|
},
|
|
8584
|
-
/* @__PURE__ */
|
|
8585
|
-
/* @__PURE__ */
|
|
8586
|
-
/* @__PURE__ */
|
|
8880
|
+
/* @__PURE__ */ React54.createElement(Icon, { name: /* @__PURE__ */ React54.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
8881
|
+
/* @__PURE__ */ React54.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
8882
|
+
/* @__PURE__ */ React54.createElement(
|
|
8587
8883
|
"input",
|
|
8588
8884
|
{
|
|
8589
8885
|
ref: inputMerged,
|
|
@@ -8605,12 +8901,12 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8605
8901
|
}
|
|
8606
8902
|
}
|
|
8607
8903
|
),
|
|
8608
|
-
/* @__PURE__ */
|
|
8609
|
-
note ? /* @__PURE__ */
|
|
8904
|
+
/* @__PURE__ */ React54.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
8905
|
+
note ? /* @__PURE__ */ React54.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
8610
8906
|
),
|
|
8611
|
-
items2.length ? /* @__PURE__ */
|
|
8907
|
+
items2.length ? /* @__PURE__ */ React54.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
8612
8908
|
const src = thumb(it);
|
|
8613
|
-
return /* @__PURE__ */
|
|
8909
|
+
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(
|
|
8614
8910
|
"span",
|
|
8615
8911
|
{
|
|
8616
8912
|
className: "aura-upload__bar",
|
|
@@ -8620,11 +8916,11 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8620
8916
|
"aria-valuemax": 100,
|
|
8621
8917
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
8622
8918
|
},
|
|
8623
|
-
/* @__PURE__ */
|
|
8624
|
-
) : null), /* @__PURE__ */
|
|
8919
|
+
/* @__PURE__ */ React54.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
8920
|
+
) : null), /* @__PURE__ */ React54.createElement(
|
|
8625
8921
|
IconButton,
|
|
8626
8922
|
{
|
|
8627
|
-
icon: /* @__PURE__ */
|
|
8923
|
+
icon: /* @__PURE__ */ React54.createElement(IconX, null),
|
|
8628
8924
|
label: t.remove(it.name),
|
|
8629
8925
|
onClick: function() {
|
|
8630
8926
|
remove(it);
|
|
@@ -8637,14 +8933,14 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8637
8933
|
|
|
8638
8934
|
// src/theme.ts
|
|
8639
8935
|
function hexToRgb(hex) {
|
|
8640
|
-
let
|
|
8641
|
-
if (
|
|
8642
|
-
|
|
8936
|
+
let h11 = String(hex).trim().replace("#", "");
|
|
8937
|
+
if (h11.length === 3)
|
|
8938
|
+
h11 = h11.split("").map(function(c) {
|
|
8643
8939
|
return c + c;
|
|
8644
8940
|
}).join("");
|
|
8645
|
-
if (!/^[0-9a-f]{6}$/i.test(
|
|
8941
|
+
if (!/^[0-9a-f]{6}$/i.test(h11)) throw new Error('createTheme: "' + hex + '" is not a #rgb or #rrggbb colour');
|
|
8646
8942
|
return [0, 2, 4].map(function(i) {
|
|
8647
|
-
return parseInt(
|
|
8943
|
+
return parseInt(h11.slice(i, i + 2), 16) / 255;
|
|
8648
8944
|
});
|
|
8649
8945
|
}
|
|
8650
8946
|
function rgbToHex(rgb) {
|
|
@@ -8660,10 +8956,10 @@ function delin(c) {
|
|
|
8660
8956
|
return c <= 31308e-7 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
|
|
8661
8957
|
}
|
|
8662
8958
|
function rgbToOklch(rgb) {
|
|
8663
|
-
const
|
|
8664
|
-
const l = Math.cbrt(0.4122214708 *
|
|
8665
|
-
const m = Math.cbrt(0.2119034982 *
|
|
8666
|
-
const s = Math.cbrt(0.0883024619 *
|
|
8959
|
+
const r2 = lin(rgb[0]), g = lin(rgb[1]), b = lin(rgb[2]);
|
|
8960
|
+
const l = Math.cbrt(0.4122214708 * r2 + 0.5363325363 * g + 0.0514459929 * b);
|
|
8961
|
+
const m = Math.cbrt(0.2119034982 * r2 + 0.6806995451 * g + 0.1073969566 * b);
|
|
8962
|
+
const s = Math.cbrt(0.0883024619 * r2 + 0.2817188376 * g + 0.6299787005 * b);
|
|
8667
8963
|
const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
|
|
8668
8964
|
const A = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
|
|
8669
8965
|
const B = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
|
|
@@ -8823,13 +9119,13 @@ function createTheme(opts) {
|
|
|
8823
9119
|
D["card-shadow-creative"] = "8px 8px 0px " + shadowDark;
|
|
8824
9120
|
const checks = [];
|
|
8825
9121
|
function check(theme, fg, bg, target, fgHex, bgHex) {
|
|
8826
|
-
const
|
|
9122
|
+
const r2 = contrast(fgHex, bgHex);
|
|
8827
9123
|
checks.push({
|
|
8828
9124
|
theme,
|
|
8829
9125
|
pair: fg + " on " + bg,
|
|
8830
|
-
ratio: Math.round(
|
|
9126
|
+
ratio: Math.round(r2 * 100) / 100,
|
|
8831
9127
|
target,
|
|
8832
|
-
pass:
|
|
9128
|
+
pass: r2 >= target - 5e-3
|
|
8833
9129
|
});
|
|
8834
9130
|
}
|
|
8835
9131
|
[
|
|
@@ -8940,9 +9236,9 @@ function createTheme(opts) {
|
|
|
8940
9236
|
}
|
|
8941
9237
|
|
|
8942
9238
|
// src/ThemeStyle.tsx
|
|
8943
|
-
var
|
|
9239
|
+
var React55 = __toESM(require("react"), 1);
|
|
8944
9240
|
function ThemeStyle(props) {
|
|
8945
|
-
const css =
|
|
9241
|
+
const css = React55.useMemo(
|
|
8946
9242
|
function() {
|
|
8947
9243
|
try {
|
|
8948
9244
|
return createTheme({
|
|
@@ -8959,11 +9255,11 @@ function ThemeStyle(props) {
|
|
|
8959
9255
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
8960
9256
|
);
|
|
8961
9257
|
if (css === null) return null;
|
|
8962
|
-
return /* @__PURE__ */
|
|
9258
|
+
return /* @__PURE__ */ React55.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
8963
9259
|
}
|
|
8964
9260
|
|
|
8965
9261
|
// src/colorScheme.tsx
|
|
8966
|
-
var
|
|
9262
|
+
var React56 = __toESM(require("react"), 1);
|
|
8967
9263
|
|
|
8968
9264
|
// src/colorSchemeScript.ts
|
|
8969
9265
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -8980,7 +9276,7 @@ function colorSchemeScript(options) {
|
|
|
8980
9276
|
|
|
8981
9277
|
// src/colorScheme.tsx
|
|
8982
9278
|
function ColorSchemeScript(props) {
|
|
8983
|
-
return /* @__PURE__ */
|
|
9279
|
+
return /* @__PURE__ */ React56.createElement(
|
|
8984
9280
|
"script",
|
|
8985
9281
|
{
|
|
8986
9282
|
"data-aura-color-scheme": "",
|
|
@@ -9005,7 +9301,7 @@ function apply(scheme) {
|
|
|
9005
9301
|
function useColorScheme(options) {
|
|
9006
9302
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9007
9303
|
const fallback = options && options.defaultScheme || "system";
|
|
9008
|
-
const subscribe2 =
|
|
9304
|
+
const subscribe2 = React56.useCallback(
|
|
9009
9305
|
function(cb) {
|
|
9010
9306
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9011
9307
|
function onSystem() {
|
|
@@ -9027,7 +9323,7 @@ function useColorScheme(options) {
|
|
|
9027
9323
|
},
|
|
9028
9324
|
[fallback, key]
|
|
9029
9325
|
);
|
|
9030
|
-
const snapshot =
|
|
9326
|
+
const snapshot = React56.useSyncExternalStore(
|
|
9031
9327
|
subscribe2,
|
|
9032
9328
|
function() {
|
|
9033
9329
|
const s = readScheme(fallback);
|
|
@@ -9038,7 +9334,7 @@ function useColorScheme(options) {
|
|
|
9038
9334
|
}
|
|
9039
9335
|
);
|
|
9040
9336
|
const parts = snapshot.split("|");
|
|
9041
|
-
const setScheme =
|
|
9337
|
+
const setScheme = React56.useCallback(
|
|
9042
9338
|
function(next) {
|
|
9043
9339
|
if (!valid(next)) return;
|
|
9044
9340
|
try {
|
|
@@ -9057,14 +9353,14 @@ function ColorSchemeToggle(props) {
|
|
|
9057
9353
|
const cs = useColorScheme(props);
|
|
9058
9354
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9059
9355
|
const label = props.label || t.colorScheme;
|
|
9060
|
-
return /* @__PURE__ */
|
|
9356
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9061
9357
|
DropdownMenu,
|
|
9062
9358
|
{
|
|
9063
9359
|
label,
|
|
9064
|
-
trigger: /* @__PURE__ */
|
|
9360
|
+
trigger: /* @__PURE__ */ React56.createElement(
|
|
9065
9361
|
IconButton,
|
|
9066
9362
|
{
|
|
9067
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9363
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React56.createElement(IconMoon, null) : /* @__PURE__ */ React56.createElement(IconSun, null),
|
|
9068
9364
|
label: label + ": " + names[cs.scheme]
|
|
9069
9365
|
}
|
|
9070
9366
|
),
|
|
@@ -9082,14 +9378,14 @@ function ColorSchemeToggle(props) {
|
|
|
9082
9378
|
}
|
|
9083
9379
|
|
|
9084
9380
|
// src/Badge.tsx
|
|
9085
|
-
var
|
|
9086
|
-
var Badge =
|
|
9381
|
+
var React57 = __toESM(require("react"), 1);
|
|
9382
|
+
var Badge = React57.forwardRef(function Badge2(props, ref) {
|
|
9087
9383
|
return badgeElement(props, ref);
|
|
9088
9384
|
});
|
|
9089
9385
|
|
|
9090
9386
|
// src/Progress.tsx
|
|
9091
|
-
var
|
|
9092
|
-
var Progress =
|
|
9387
|
+
var React58 = __toESM(require("react"), 1);
|
|
9388
|
+
var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
9093
9389
|
const t = useStrings();
|
|
9094
9390
|
const auto = uid(), id = props.id || auto;
|
|
9095
9391
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9098,7 +9394,7 @@ var Progress = React56.forwardRef(function Progress2(props, ref) {
|
|
|
9098
9394
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9099
9395
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9100
9396
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9101
|
-
return /* @__PURE__ */
|
|
9397
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9102
9398
|
"div",
|
|
9103
9399
|
{
|
|
9104
9400
|
ref,
|
|
@@ -9109,8 +9405,8 @@ var Progress = React56.forwardRef(function Progress2(props, ref) {
|
|
|
9109
9405
|
props.className
|
|
9110
9406
|
)
|
|
9111
9407
|
},
|
|
9112
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9113
|
-
/* @__PURE__ */
|
|
9408
|
+
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,
|
|
9409
|
+
/* @__PURE__ */ React58.createElement(
|
|
9114
9410
|
"div",
|
|
9115
9411
|
{
|
|
9116
9412
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9122,8 +9418,8 @@ var Progress = React56.forwardRef(function Progress2(props, ref) {
|
|
|
9122
9418
|
"aria-valuenow": det ? props.value : void 0,
|
|
9123
9419
|
"aria-valuetext": det ? valueText : void 0
|
|
9124
9420
|
},
|
|
9125
|
-
/* @__PURE__ */
|
|
9126
|
-
sec ? /* @__PURE__ */
|
|
9421
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9422
|
+
sec ? /* @__PURE__ */ React58.createElement(
|
|
9127
9423
|
"span",
|
|
9128
9424
|
{
|
|
9129
9425
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9131,19 +9427,19 @@ var Progress = React56.forwardRef(function Progress2(props, ref) {
|
|
|
9131
9427
|
}
|
|
9132
9428
|
) : null
|
|
9133
9429
|
),
|
|
9134
|
-
props.hint ? /* @__PURE__ */
|
|
9430
|
+
props.hint ? /* @__PURE__ */ React58.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9135
9431
|
);
|
|
9136
9432
|
});
|
|
9137
9433
|
|
|
9138
9434
|
// src/Skeleton.tsx
|
|
9139
|
-
var
|
|
9140
|
-
var Skeleton =
|
|
9435
|
+
var React59 = __toESM(require("react"), 1);
|
|
9436
|
+
var Skeleton = React59.forwardRef(function Skeleton2(props, ref) {
|
|
9141
9437
|
const v = props.variant || "text";
|
|
9142
9438
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9143
9439
|
const n3 = props.lines, rows = [];
|
|
9144
9440
|
for (let i = 0; i < n3; i++)
|
|
9145
|
-
rows.push(/* @__PURE__ */
|
|
9146
|
-
return /* @__PURE__ */
|
|
9441
|
+
rows.push(/* @__PURE__ */ React59.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
9442
|
+
return /* @__PURE__ */ React59.createElement(
|
|
9147
9443
|
"span",
|
|
9148
9444
|
{
|
|
9149
9445
|
ref,
|
|
@@ -9161,17 +9457,17 @@ var Skeleton = React57.forwardRef(function Skeleton2(props, ref) {
|
|
|
9161
9457
|
if (v === "circle") {
|
|
9162
9458
|
style.width = style.height = props.size || props.width || 40;
|
|
9163
9459
|
}
|
|
9164
|
-
return /* @__PURE__ */
|
|
9460
|
+
return /* @__PURE__ */ React59.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9165
9461
|
});
|
|
9166
9462
|
|
|
9167
9463
|
// src/EmptyState.tsx
|
|
9168
|
-
var
|
|
9169
|
-
var EmptyState =
|
|
9464
|
+
var React60 = __toESM(require("react"), 1);
|
|
9465
|
+
var EmptyState = React60.forwardRef(function EmptyState2(props, ref) {
|
|
9170
9466
|
return emptyStateElement(props, ref);
|
|
9171
9467
|
});
|
|
9172
9468
|
|
|
9173
9469
|
// src/Pagination.tsx
|
|
9174
|
-
var
|
|
9470
|
+
var React61 = __toESM(require("react"), 1);
|
|
9175
9471
|
function pageList(page, count, sib) {
|
|
9176
9472
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9177
9473
|
if (page - sib <= 3) {
|
|
@@ -9191,7 +9487,7 @@ function pageList(page, count, sib) {
|
|
|
9191
9487
|
if (count > 1) out.push(count);
|
|
9192
9488
|
return out;
|
|
9193
9489
|
}
|
|
9194
|
-
var Pagination =
|
|
9490
|
+
var Pagination = React61.forwardRef(function Pagination2(props, ref) {
|
|
9195
9491
|
const t = useStrings();
|
|
9196
9492
|
useAutoTip();
|
|
9197
9493
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9211,7 +9507,7 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9211
9507
|
},
|
|
9212
9508
|
extra
|
|
9213
9509
|
);
|
|
9214
|
-
return link ? /* @__PURE__ */
|
|
9510
|
+
return link ? /* @__PURE__ */ React61.createElement(
|
|
9215
9511
|
Link,
|
|
9216
9512
|
{
|
|
9217
9513
|
href: link(p),
|
|
@@ -9224,7 +9520,7 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9224
9520
|
...common
|
|
9225
9521
|
},
|
|
9226
9522
|
label
|
|
9227
|
-
) : /* @__PURE__ */
|
|
9523
|
+
) : /* @__PURE__ */ React61.createElement(
|
|
9228
9524
|
"button",
|
|
9229
9525
|
{
|
|
9230
9526
|
type: "button",
|
|
@@ -9238,7 +9534,7 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9238
9534
|
}
|
|
9239
9535
|
function arrow(p, icon, label, rel, disabled) {
|
|
9240
9536
|
if (!link || disabled)
|
|
9241
|
-
return /* @__PURE__ */
|
|
9537
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9242
9538
|
IconButton,
|
|
9243
9539
|
{
|
|
9244
9540
|
icon,
|
|
@@ -9249,7 +9545,7 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9249
9545
|
}
|
|
9250
9546
|
}
|
|
9251
9547
|
);
|
|
9252
|
-
return /* @__PURE__ */
|
|
9548
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9253
9549
|
Link,
|
|
9254
9550
|
{
|
|
9255
9551
|
href: link(p),
|
|
@@ -9264,17 +9560,17 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9264
9560
|
}
|
|
9265
9561
|
}
|
|
9266
9562
|
},
|
|
9267
|
-
/* @__PURE__ */
|
|
9563
|
+
/* @__PURE__ */ React61.createElement(Icon, { name: icon, size: "sm" })
|
|
9268
9564
|
);
|
|
9269
9565
|
}
|
|
9270
|
-
return /* @__PURE__ */
|
|
9271
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9272
|
-
})), /* @__PURE__ */
|
|
9566
|
+
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) {
|
|
9567
|
+
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");
|
|
9568
|
+
})), /* @__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));
|
|
9273
9569
|
});
|
|
9274
9570
|
|
|
9275
9571
|
// src/Accordion.tsx
|
|
9276
|
-
var
|
|
9277
|
-
var Accordion =
|
|
9572
|
+
var React62 = __toESM(require("react"), 1);
|
|
9573
|
+
var Accordion = React62.forwardRef(function Accordion2(props, ref) {
|
|
9278
9574
|
const auto = uid(), base = props.id || auto;
|
|
9279
9575
|
const multiple = props.type === "multiple";
|
|
9280
9576
|
const st = useMaybeControlled(
|
|
@@ -9312,9 +9608,9 @@ var Accordion = React60.forwardRef(function Accordion2(props, ref) {
|
|
|
9312
9608
|
n3.focus();
|
|
9313
9609
|
}
|
|
9314
9610
|
}
|
|
9315
|
-
return /* @__PURE__ */
|
|
9611
|
+
return /* @__PURE__ */ React62.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9316
9612
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9317
|
-
return /* @__PURE__ */
|
|
9613
|
+
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(
|
|
9318
9614
|
"button",
|
|
9319
9615
|
{
|
|
9320
9616
|
type: "button",
|
|
@@ -9327,10 +9623,10 @@ var Accordion = React60.forwardRef(function Accordion2(props, ref) {
|
|
|
9327
9623
|
toggle(it.id);
|
|
9328
9624
|
}
|
|
9329
9625
|
},
|
|
9330
|
-
it.icon ? /* @__PURE__ */
|
|
9331
|
-
/* @__PURE__ */
|
|
9332
|
-
/* @__PURE__ */
|
|
9333
|
-
)), /* @__PURE__ */
|
|
9626
|
+
it.icon ? /* @__PURE__ */ React62.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
9627
|
+
/* @__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),
|
|
9628
|
+
/* @__PURE__ */ React62.createElement(Icon, { name: /* @__PURE__ */ React62.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
9629
|
+
)), /* @__PURE__ */ React62.createElement(
|
|
9334
9630
|
"div",
|
|
9335
9631
|
{
|
|
9336
9632
|
id: pid,
|
|
@@ -9345,33 +9641,33 @@ var Accordion = React60.forwardRef(function Accordion2(props, ref) {
|
|
|
9345
9641
|
});
|
|
9346
9642
|
|
|
9347
9643
|
// src/Popover.tsx
|
|
9348
|
-
var
|
|
9644
|
+
var React63 = __toESM(require("react"), 1);
|
|
9349
9645
|
var import_react_dom13 = require("react-dom");
|
|
9350
9646
|
function position(anchor, pop, placement) {
|
|
9351
|
-
const
|
|
9647
|
+
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
9352
9648
|
let side = (placement || "bottom-start").split("-")[0], align = (placement || "bottom-start").split("-")[1] || "start";
|
|
9353
|
-
if (side === "bottom" &&
|
|
9354
|
-
else if (side === "top" &&
|
|
9355
|
-
const below2 = vh -
|
|
9649
|
+
if (side === "bottom" && r2.bottom + gap + ph > vh - 8 && r2.top - gap - ph > 8) side = "top";
|
|
9650
|
+
else if (side === "top" && r2.top - gap - ph < 8 && r2.bottom + gap + ph < vh - 8) side = "bottom";
|
|
9651
|
+
const below2 = vh - r2.bottom - gap - 8, above = r2.top - gap - 8;
|
|
9356
9652
|
let maxHeight;
|
|
9357
9653
|
if (ph > below2 && ph > above) {
|
|
9358
9654
|
side = above > below2 ? "top" : "bottom";
|
|
9359
9655
|
maxHeight = Math.max(120, side === "top" ? above : below2);
|
|
9360
9656
|
}
|
|
9361
|
-
const
|
|
9362
|
-
const top = side === "top" ?
|
|
9363
|
-
const left = align === "end" ?
|
|
9657
|
+
const h11 = maxHeight ? Math.min(ph, maxHeight) : ph;
|
|
9658
|
+
const top = side === "top" ? r2.top - gap - h11 : r2.bottom + gap;
|
|
9659
|
+
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
9364
9660
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
9365
9661
|
}
|
|
9366
|
-
var Popover =
|
|
9662
|
+
var Popover = React63.forwardRef(function Popover2(props, ref) {
|
|
9367
9663
|
const t = useStrings();
|
|
9368
9664
|
const density = useDensity();
|
|
9369
9665
|
const auto = uid(), id = props.id || auto;
|
|
9370
9666
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
9371
9667
|
const open = !!st[0];
|
|
9372
|
-
const wrap =
|
|
9373
|
-
const pos =
|
|
9374
|
-
const inTree =
|
|
9668
|
+
const wrap = React63.useRef(null), pop = React63.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
9669
|
+
const pos = React63.useState(null), mounted = useMounted();
|
|
9670
|
+
const inTree = React63.useRef(false);
|
|
9375
9671
|
function trigger() {
|
|
9376
9672
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
9377
9673
|
}
|
|
@@ -9398,7 +9694,7 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9398
9694
|
},
|
|
9399
9695
|
[open, mounted, props.placement]
|
|
9400
9696
|
);
|
|
9401
|
-
|
|
9697
|
+
React63.useEffect(
|
|
9402
9698
|
function() {
|
|
9403
9699
|
if (!open || !mounted) return;
|
|
9404
9700
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -9423,9 +9719,9 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9423
9719
|
},
|
|
9424
9720
|
[open, mounted]
|
|
9425
9721
|
);
|
|
9426
|
-
const child =
|
|
9722
|
+
const child = React63.Children.only(props.trigger);
|
|
9427
9723
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
9428
|
-
/* @__PURE__ */
|
|
9724
|
+
/* @__PURE__ */ React63.createElement(
|
|
9429
9725
|
"div",
|
|
9430
9726
|
{
|
|
9431
9727
|
ref: popMerged,
|
|
@@ -9455,17 +9751,17 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9455
9751
|
} else trapTab(e, pop.current);
|
|
9456
9752
|
}
|
|
9457
9753
|
},
|
|
9458
|
-
props.title ? /* @__PURE__ */
|
|
9754
|
+
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(
|
|
9459
9755
|
IconButton,
|
|
9460
9756
|
{
|
|
9461
|
-
icon: /* @__PURE__ */
|
|
9757
|
+
icon: /* @__PURE__ */ React63.createElement(IconX, null),
|
|
9462
9758
|
label: t.close,
|
|
9463
9759
|
onClick: function() {
|
|
9464
9760
|
close(true);
|
|
9465
9761
|
}
|
|
9466
9762
|
}
|
|
9467
9763
|
)) : null,
|
|
9468
|
-
/* @__PURE__ */
|
|
9764
|
+
/* @__PURE__ */ React63.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
9469
9765
|
close: function() {
|
|
9470
9766
|
close(true);
|
|
9471
9767
|
}
|
|
@@ -9473,7 +9769,7 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9473
9769
|
),
|
|
9474
9770
|
document.body
|
|
9475
9771
|
) : null;
|
|
9476
|
-
return /* @__PURE__ */
|
|
9772
|
+
return /* @__PURE__ */ React63.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React63.cloneElement(child, {
|
|
9477
9773
|
onClick: function(e) {
|
|
9478
9774
|
if (child.props.onClick) child.props.onClick(e);
|
|
9479
9775
|
st[1](!open);
|
|
@@ -9485,7 +9781,7 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9485
9781
|
});
|
|
9486
9782
|
|
|
9487
9783
|
// src/NumberField.tsx
|
|
9488
|
-
var
|
|
9784
|
+
var React64 = __toESM(require("react"), 1);
|
|
9489
9785
|
function decimalsOf(n3) {
|
|
9490
9786
|
const s = String(n3);
|
|
9491
9787
|
const i = s.indexOf(".");
|
|
@@ -9498,7 +9794,7 @@ function parse(text2) {
|
|
|
9498
9794
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
9499
9795
|
return Number(s);
|
|
9500
9796
|
}
|
|
9501
|
-
var NumberField =
|
|
9797
|
+
var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
9502
9798
|
const t = useStrings();
|
|
9503
9799
|
const auto = uid(), id = props.id || auto;
|
|
9504
9800
|
const step = props.step || 1;
|
|
@@ -9509,7 +9805,7 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9509
9805
|
props.onChange
|
|
9510
9806
|
);
|
|
9511
9807
|
const value = st[0], setValue = st[1];
|
|
9512
|
-
const draftState =
|
|
9808
|
+
const draftState = React64.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
9513
9809
|
function fmt2(n3) {
|
|
9514
9810
|
if (n3 == null || isNaN(n3)) return "";
|
|
9515
9811
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -9558,7 +9854,7 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9558
9854
|
};
|
|
9559
9855
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
9560
9856
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
9561
|
-
return /* @__PURE__ */
|
|
9857
|
+
return /* @__PURE__ */ React64.createElement(
|
|
9562
9858
|
Field,
|
|
9563
9859
|
{
|
|
9564
9860
|
id,
|
|
@@ -9570,7 +9866,7 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9570
9866
|
disabled: props.disabled,
|
|
9571
9867
|
className: props.className
|
|
9572
9868
|
},
|
|
9573
|
-
/* @__PURE__ */
|
|
9869
|
+
/* @__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(
|
|
9574
9870
|
"input",
|
|
9575
9871
|
{
|
|
9576
9872
|
ref,
|
|
@@ -9617,7 +9913,7 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9617
9913
|
},
|
|
9618
9914
|
onKeyDown
|
|
9619
9915
|
}
|
|
9620
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
9916
|
+
), 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(
|
|
9621
9917
|
"button",
|
|
9622
9918
|
{
|
|
9623
9919
|
type: "button",
|
|
@@ -9633,8 +9929,8 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9633
9929
|
nudge(-step);
|
|
9634
9930
|
}
|
|
9635
9931
|
},
|
|
9636
|
-
/* @__PURE__ */
|
|
9637
|
-
), /* @__PURE__ */
|
|
9932
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconMinus, null) })
|
|
9933
|
+
), /* @__PURE__ */ React64.createElement(
|
|
9638
9934
|
"button",
|
|
9639
9935
|
{
|
|
9640
9936
|
type: "button",
|
|
@@ -9650,14 +9946,14 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9650
9946
|
nudge(step);
|
|
9651
9947
|
}
|
|
9652
9948
|
},
|
|
9653
|
-
/* @__PURE__ */
|
|
9949
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconPlus, null) })
|
|
9654
9950
|
)) : null)
|
|
9655
9951
|
);
|
|
9656
9952
|
});
|
|
9657
9953
|
|
|
9658
9954
|
// src/Stepper.tsx
|
|
9659
|
-
var
|
|
9660
|
-
var Stepper =
|
|
9955
|
+
var React65 = __toESM(require("react"), 1);
|
|
9956
|
+
var Stepper = React65.forwardRef(function Stepper2(props, ref) {
|
|
9661
9957
|
const t = useStrings();
|
|
9662
9958
|
const idBase = uid();
|
|
9663
9959
|
const steps = props.steps || [];
|
|
@@ -9668,22 +9964,22 @@ var Stepper = React63.forwardRef(function Stepper2(props, ref) {
|
|
|
9668
9964
|
if (at < 0) at = 0;
|
|
9669
9965
|
const vertical = props.orientation === "vertical";
|
|
9670
9966
|
const cur2 = steps[at];
|
|
9671
|
-
return /* @__PURE__ */
|
|
9967
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9672
9968
|
"nav",
|
|
9673
9969
|
{
|
|
9674
9970
|
ref,
|
|
9675
9971
|
"aria-label": props.label,
|
|
9676
9972
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
9677
9973
|
},
|
|
9678
|
-
/* @__PURE__ */
|
|
9974
|
+
/* @__PURE__ */ React65.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
9679
9975
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
9680
9976
|
const error = s.status === "error";
|
|
9681
|
-
const marker = /* @__PURE__ */
|
|
9977
|
+
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);
|
|
9682
9978
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
9683
9979
|
const clickable = state === "done" && !!props.onStepClick;
|
|
9684
9980
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
9685
9981
|
const descId = idBase + "-step-" + i;
|
|
9686
|
-
const text2 = /* @__PURE__ */
|
|
9982
|
+
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(
|
|
9687
9983
|
"span",
|
|
9688
9984
|
{
|
|
9689
9985
|
className: "aura-stepper__desc",
|
|
@@ -9692,14 +9988,14 @@ var Stepper = React63.forwardRef(function Stepper2(props, ref) {
|
|
|
9692
9988
|
},
|
|
9693
9989
|
s.description
|
|
9694
9990
|
) : null);
|
|
9695
|
-
return /* @__PURE__ */
|
|
9991
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9696
9992
|
"li",
|
|
9697
9993
|
{
|
|
9698
9994
|
key: s.id,
|
|
9699
9995
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
9700
9996
|
"aria-current": state === "current" ? "step" : void 0
|
|
9701
9997
|
},
|
|
9702
|
-
clickable ? /* @__PURE__ */
|
|
9998
|
+
clickable ? /* @__PURE__ */ React65.createElement(
|
|
9703
9999
|
"button",
|
|
9704
10000
|
{
|
|
9705
10001
|
type: "button",
|
|
@@ -9711,19 +10007,19 @@ var Stepper = React63.forwardRef(function Stepper2(props, ref) {
|
|
|
9711
10007
|
},
|
|
9712
10008
|
marker,
|
|
9713
10009
|
text2
|
|
9714
|
-
) : /* @__PURE__ */
|
|
10010
|
+
) : /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
9715
10011
|
);
|
|
9716
10012
|
})),
|
|
9717
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10013
|
+
!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
|
|
9718
10014
|
);
|
|
9719
10015
|
});
|
|
9720
10016
|
|
|
9721
10017
|
// src/SegmentedControl.tsx
|
|
9722
|
-
var
|
|
10018
|
+
var React66 = __toESM(require("react"), 1);
|
|
9723
10019
|
function toOpt2(o) {
|
|
9724
10020
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
9725
10021
|
}
|
|
9726
|
-
var SegmentedControl =
|
|
10022
|
+
var SegmentedControl = React66.forwardRef(
|
|
9727
10023
|
function SegmentedControl2(props, ref) {
|
|
9728
10024
|
const options = (props.options || []).map(toOpt2);
|
|
9729
10025
|
useAutoTip();
|
|
@@ -9737,7 +10033,7 @@ var SegmentedControl = React64.forwardRef(
|
|
|
9737
10033
|
);
|
|
9738
10034
|
const value = st[0], setValue = st[1];
|
|
9739
10035
|
const auto = uid(), id = props.id || auto;
|
|
9740
|
-
const refs =
|
|
10036
|
+
const refs = React66.useRef([]);
|
|
9741
10037
|
const selIdx = options.findIndex(function(o) {
|
|
9742
10038
|
return o.value === value;
|
|
9743
10039
|
});
|
|
@@ -9770,7 +10066,7 @@ var SegmentedControl = React64.forwardRef(
|
|
|
9770
10066
|
move(options.length, -1);
|
|
9771
10067
|
}
|
|
9772
10068
|
}
|
|
9773
|
-
return /* @__PURE__ */
|
|
10069
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9774
10070
|
"div",
|
|
9775
10071
|
{
|
|
9776
10072
|
ref,
|
|
@@ -9789,7 +10085,7 @@ var SegmentedControl = React64.forwardRef(
|
|
|
9789
10085
|
options.map(function(o, i) {
|
|
9790
10086
|
const on = o.value === value;
|
|
9791
10087
|
const off = props.disabled || o.disabled;
|
|
9792
|
-
return /* @__PURE__ */
|
|
10088
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9793
10089
|
"button",
|
|
9794
10090
|
{
|
|
9795
10091
|
key: o.value,
|
|
@@ -9811,8 +10107,8 @@ var SegmentedControl = React64.forwardRef(
|
|
|
9811
10107
|
onKeyDown(e, i);
|
|
9812
10108
|
}
|
|
9813
10109
|
},
|
|
9814
|
-
o.icon ? /* @__PURE__ */
|
|
9815
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10110
|
+
o.icon ? /* @__PURE__ */ React66.createElement(Icon, { name: o.icon }) : null,
|
|
10111
|
+
o.iconOnly ? null : /* @__PURE__ */ React66.createElement("span", null, o.label)
|
|
9816
10112
|
);
|
|
9817
10113
|
})
|
|
9818
10114
|
);
|