@jirawatpyk/aura-react 5.33.0 → 5.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/aura.bundle.js +685 -409
- package/dist/cjs/index.cjs +684 -408
- package/dist/esm/StatusTile.js +53 -0
- package/dist/esm/autoTip.js +5 -0
- package/dist/esm/breakpoints.js +18 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/responsive.js +1 -15
- package/dist/esm/strings.js +4 -0
- package/dist/esm/strings.sv.js +4 -0
- package/dist/esm/strings.th.js +4 -0
- package/dist/esm/tiles.js +212 -0
- package/dist/index.d.cts +111 -36
- package/dist/index.d.ts +111 -36
- package/dist/locales/sv.cjs +4 -0
- package/dist/locales/sv.d.cts +5 -0
- package/dist/locales/sv.d.ts +5 -0
- package/dist/locales/th.cjs +4 -0
- package/dist/locales/th.d.cts +5 -0
- package/dist/locales/th.d.ts +5 -0
- package/dist/server/index.cjs +263 -27
- package/dist/server/index.d.cts +75 -0
- package/dist/server/index.d.ts +75 -0
- package/dist/server/index.js +263 -27
- package/dist/styles.css +62 -0
- package/dist/styles.layer.css +62 -0
- package/package.json +1 -1
package/dist/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,15 +7636,15 @@ 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" },
|
|
@@ -7628,39 +7657,286 @@ var PageHeader = React43.forwardRef(function PageHeader2(props, ref) {
|
|
|
7628
7657
|
);
|
|
7629
7658
|
});
|
|
7630
7659
|
|
|
7631
|
-
// src/
|
|
7660
|
+
// src/StatusTile.tsx
|
|
7661
|
+
var React45 = __toESM(require("react"), 1);
|
|
7662
|
+
|
|
7663
|
+
// src/tiles.tsx
|
|
7632
7664
|
var React44 = __toESM(require("react"), 1);
|
|
7633
|
-
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) {
|
|
7634
7910
|
const t = useStrings();
|
|
7635
7911
|
const bp = useBreakpoint();
|
|
7636
7912
|
const wide = bp === "lg" || bp === "xl";
|
|
7637
|
-
const st =
|
|
7638
|
-
|
|
7913
|
+
const st = React46.useState(false), open = st[0], setOpen = st[1];
|
|
7914
|
+
React46.useEffect(
|
|
7639
7915
|
function() {
|
|
7640
7916
|
if (wide) setOpen(false);
|
|
7641
7917
|
},
|
|
7642
7918
|
[wide]
|
|
7643
7919
|
);
|
|
7644
|
-
const navEl = props.nav &&
|
|
7920
|
+
const navEl = props.nav && React46.isValidElement(props.nav) ? props.nav : null;
|
|
7645
7921
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
7646
|
-
const navState =
|
|
7922
|
+
const navState = React46.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
7647
7923
|
function onNav(id) {
|
|
7648
7924
|
if (shared) navState[1](id);
|
|
7649
7925
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
7650
7926
|
}
|
|
7651
|
-
const rootRef =
|
|
7652
|
-
const barRef =
|
|
7927
|
+
const rootRef = React46.useRef(null);
|
|
7928
|
+
const barRef = React46.useRef(null);
|
|
7653
7929
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
7654
7930
|
const hasBar = !!(props.header || props.nav);
|
|
7655
|
-
const barH =
|
|
7931
|
+
const barH = React46.useState(null);
|
|
7656
7932
|
useIsoLayoutEffect(
|
|
7657
7933
|
function() {
|
|
7658
7934
|
const root = rootRef.current, bar = barRef.current;
|
|
7659
7935
|
if (!root || !bar) return;
|
|
7660
7936
|
function sync() {
|
|
7661
|
-
const
|
|
7662
|
-
root.style.setProperty("--aura-shell-bar-height",
|
|
7663
|
-
if (
|
|
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));
|
|
7664
7940
|
}
|
|
7665
7941
|
sync();
|
|
7666
7942
|
const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(sync);
|
|
@@ -7672,8 +7948,8 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7672
7948
|
},
|
|
7673
7949
|
[hasBar]
|
|
7674
7950
|
);
|
|
7675
|
-
const deskNav = navEl && shared ?
|
|
7676
|
-
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, {
|
|
7677
7953
|
value: shared ? navState[0] : navEl.props.value,
|
|
7678
7954
|
onChange: function(id) {
|
|
7679
7955
|
onNav(id);
|
|
@@ -7688,7 +7964,7 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7688
7964
|
collapsed: false,
|
|
7689
7965
|
collapsible: false
|
|
7690
7966
|
}) : props.nav;
|
|
7691
|
-
return /* @__PURE__ */
|
|
7967
|
+
return /* @__PURE__ */ React46.createElement(
|
|
7692
7968
|
"div",
|
|
7693
7969
|
{
|
|
7694
7970
|
ref: mergedRef,
|
|
@@ -7703,8 +7979,8 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7703
7979
|
props.className
|
|
7704
7980
|
)
|
|
7705
7981
|
},
|
|
7706
|
-
props.nav ? /* @__PURE__ */
|
|
7707
|
-
props.nav ? /* @__PURE__ */
|
|
7982
|
+
props.nav ? /* @__PURE__ */ React46.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
7983
|
+
props.nav ? /* @__PURE__ */ React46.createElement(
|
|
7708
7984
|
Drawer,
|
|
7709
7985
|
{
|
|
7710
7986
|
open,
|
|
@@ -7721,7 +7997,7 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7721
7997
|
},
|
|
7722
7998
|
drawerNav
|
|
7723
7999
|
) : null,
|
|
7724
|
-
/* @__PURE__ */
|
|
8000
|
+
/* @__PURE__ */ React46.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React46.createElement(
|
|
7725
8001
|
"header",
|
|
7726
8002
|
{
|
|
7727
8003
|
ref: barRef,
|
|
@@ -7730,11 +8006,11 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7730
8006
|
(!props.header || props.headerHideFrom === "lg") && "aura-shell__bar--menu-only"
|
|
7731
8007
|
)
|
|
7732
8008
|
},
|
|
7733
|
-
props.nav ? /* @__PURE__ */
|
|
8009
|
+
props.nav ? /* @__PURE__ */ React46.createElement(
|
|
7734
8010
|
IconButton,
|
|
7735
8011
|
{
|
|
7736
8012
|
className: "aura-shell__menu",
|
|
7737
|
-
icon: /* @__PURE__ */
|
|
8013
|
+
icon: /* @__PURE__ */ React46.createElement(IconMenu, null),
|
|
7738
8014
|
label: props.menuLabel || t.openNav,
|
|
7739
8015
|
size: "md",
|
|
7740
8016
|
onClick: function() {
|
|
@@ -7743,8 +8019,8 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7743
8019
|
"aria-expanded": open
|
|
7744
8020
|
}
|
|
7745
8021
|
) : null,
|
|
7746
|
-
/* @__PURE__ */
|
|
7747
|
-
) : null, /* @__PURE__ */
|
|
8022
|
+
/* @__PURE__ */ React46.createElement("div", { className: "aura-shell__bar-content" }, props.header)
|
|
8023
|
+
) : null, /* @__PURE__ */ React46.createElement(
|
|
7748
8024
|
"main",
|
|
7749
8025
|
{
|
|
7750
8026
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -7757,17 +8033,17 @@ var AppShell = React44.forwardRef(function AppShell2(props, ref) {
|
|
|
7757
8033
|
});
|
|
7758
8034
|
|
|
7759
8035
|
// src/ActionBar.tsx
|
|
7760
|
-
var
|
|
7761
|
-
var ActionBar =
|
|
8036
|
+
var React47 = __toESM(require("react"), 1);
|
|
8037
|
+
var ActionBar = React47.forwardRef(function ActionBar2(props, ref) {
|
|
7762
8038
|
const t = useStrings();
|
|
7763
8039
|
const bulk = props.selected != null;
|
|
7764
8040
|
const idle = bulk && !props.selected;
|
|
7765
8041
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
7766
|
-
const hasStart =
|
|
8042
|
+
const hasStart = React47.Children.toArray(props.start).some(function(c) {
|
|
7767
8043
|
return c !== "";
|
|
7768
8044
|
});
|
|
7769
|
-
const cameFrom =
|
|
7770
|
-
const own =
|
|
8045
|
+
const cameFrom = React47.useRef(null);
|
|
8046
|
+
const own = React47.useRef(null);
|
|
7771
8047
|
function clear() {
|
|
7772
8048
|
props.onClearSelection();
|
|
7773
8049
|
setTimeout(function() {
|
|
@@ -7776,7 +8052,7 @@ var ActionBar = React45.forwardRef(function ActionBar2(props, ref) {
|
|
|
7776
8052
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
7777
8053
|
}, 0);
|
|
7778
8054
|
}
|
|
7779
|
-
return /* @__PURE__ */
|
|
8055
|
+
return /* @__PURE__ */ React47.createElement(
|
|
7780
8056
|
"div",
|
|
7781
8057
|
{
|
|
7782
8058
|
ref: function(el) {
|
|
@@ -7797,16 +8073,16 @@ var ActionBar = React45.forwardRef(function ActionBar2(props, ref) {
|
|
|
7797
8073
|
props.className
|
|
7798
8074
|
)
|
|
7799
8075
|
},
|
|
7800
|
-
/* @__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)
|
|
7801
8077
|
);
|
|
7802
8078
|
});
|
|
7803
8079
|
|
|
7804
8080
|
// src/Separator.tsx
|
|
7805
|
-
var
|
|
7806
|
-
var Separator =
|
|
8081
|
+
var React48 = __toESM(require("react"), 1);
|
|
8082
|
+
var Separator = React48.forwardRef(function Separator2(props, ref) {
|
|
7807
8083
|
const vertical = props.orientation === "vertical";
|
|
7808
8084
|
const decorative = props.decorative !== false;
|
|
7809
|
-
return /* @__PURE__ */
|
|
8085
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7810
8086
|
"div",
|
|
7811
8087
|
{
|
|
7812
8088
|
ref,
|
|
@@ -7819,14 +8095,14 @@ var Separator = React46.forwardRef(function Separator2(props, ref) {
|
|
|
7819
8095
|
});
|
|
7820
8096
|
|
|
7821
8097
|
// src/Table.tsx
|
|
7822
|
-
var
|
|
7823
|
-
var StackLabels =
|
|
7824
|
-
var ColumnIndex =
|
|
7825
|
-
function
|
|
8098
|
+
var React49 = __toESM(require("react"), 1);
|
|
8099
|
+
var StackLabels = React49.createContext(null);
|
|
8100
|
+
var ColumnIndex = React49.createContext(-1);
|
|
8101
|
+
function flat2(children) {
|
|
7826
8102
|
const out = [];
|
|
7827
|
-
|
|
7828
|
-
if (
|
|
7829
|
-
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));
|
|
7830
8106
|
else out.push(c);
|
|
7831
8107
|
});
|
|
7832
8108
|
return out;
|
|
@@ -7839,7 +8115,7 @@ function text(node) {
|
|
|
7839
8115
|
});
|
|
7840
8116
|
return parts.length ? parts.join("") : void 0;
|
|
7841
8117
|
}
|
|
7842
|
-
if (
|
|
8118
|
+
if (React49.isValidElement(node)) {
|
|
7843
8119
|
const p = node.props;
|
|
7844
8120
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
7845
8121
|
return text(p.children);
|
|
@@ -7848,14 +8124,14 @@ function text(node) {
|
|
|
7848
8124
|
}
|
|
7849
8125
|
function headerLabels(children) {
|
|
7850
8126
|
let out = [];
|
|
7851
|
-
|
|
7852
|
-
if (out.length || !
|
|
7853
|
-
const row =
|
|
7854
|
-
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);
|
|
7855
8131
|
});
|
|
7856
8132
|
if (!row) return;
|
|
7857
|
-
|
|
7858
|
-
if (!
|
|
8133
|
+
flat2(row.props.children).forEach(function(cell) {
|
|
8134
|
+
if (!React49.isValidElement(cell)) return;
|
|
7859
8135
|
const p = cell.props;
|
|
7860
8136
|
const t = text(p.children);
|
|
7861
8137
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -7865,7 +8141,7 @@ function headerLabels(children) {
|
|
|
7865
8141
|
});
|
|
7866
8142
|
return out;
|
|
7867
8143
|
}
|
|
7868
|
-
var Table =
|
|
8144
|
+
var Table = React49.forwardRef(function Table2(props, ref) {
|
|
7869
8145
|
const {
|
|
7870
8146
|
caption,
|
|
7871
8147
|
captionHidden,
|
|
@@ -7895,12 +8171,12 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7895
8171
|
"tbl-stack-labels",
|
|
7896
8172
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
7897
8173
|
);
|
|
7898
|
-
const outer =
|
|
8174
|
+
const outer = React49.useContext(StackLabels);
|
|
7899
8175
|
const pageDensity = useDensity();
|
|
7900
8176
|
const capId = uid();
|
|
7901
|
-
const wrap =
|
|
7902
|
-
const sc =
|
|
7903
|
-
const wide =
|
|
8177
|
+
const wrap = React49.useRef(null);
|
|
8178
|
+
const sc = React49.useState(false), scrolls = sc[0];
|
|
8179
|
+
const wide = React49.useState(false);
|
|
7904
8180
|
useIsoLayoutEffect(function() {
|
|
7905
8181
|
const el = wrap.current;
|
|
7906
8182
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -7917,7 +8193,7 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7917
8193
|
ro.disconnect();
|
|
7918
8194
|
};
|
|
7919
8195
|
}, []);
|
|
7920
|
-
const table = /* @__PURE__ */
|
|
8196
|
+
const table = /* @__PURE__ */ React49.createElement(
|
|
7921
8197
|
"div",
|
|
7922
8198
|
{
|
|
7923
8199
|
ref: wrap,
|
|
@@ -7941,7 +8217,7 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7941
8217
|
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
7942
8218
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
7943
8219
|
},
|
|
7944
|
-
/* @__PURE__ */
|
|
8220
|
+
/* @__PURE__ */ React49.createElement(
|
|
7945
8221
|
"table",
|
|
7946
8222
|
{
|
|
7947
8223
|
ref,
|
|
@@ -7957,11 +8233,11 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7957
8233
|
role: stackBelow ? "table" : void 0,
|
|
7958
8234
|
...rest
|
|
7959
8235
|
},
|
|
7960
|
-
caption != null ? /* @__PURE__ */
|
|
7961
|
-
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
|
|
7962
8238
|
)
|
|
7963
8239
|
);
|
|
7964
|
-
return cards ? /* @__PURE__ */
|
|
8240
|
+
return cards ? /* @__PURE__ */ React49.createElement(
|
|
7965
8241
|
"div",
|
|
7966
8242
|
{
|
|
7967
8243
|
className: cx(
|
|
@@ -7974,10 +8250,10 @@ var Table = React47.forwardRef(function Table2(props, ref) {
|
|
|
7974
8250
|
) : table;
|
|
7975
8251
|
});
|
|
7976
8252
|
function section(tag, cls) {
|
|
7977
|
-
const C =
|
|
8253
|
+
const C = React49.forwardRef(function TableSection(props, ref) {
|
|
7978
8254
|
const { className, ...rest } = props;
|
|
7979
|
-
const stacked =
|
|
7980
|
-
return
|
|
8255
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
8256
|
+
return React49.createElement(
|
|
7981
8257
|
tag,
|
|
7982
8258
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
7983
8259
|
);
|
|
@@ -7990,14 +8266,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
7990
8266
|
TBody.displayName = "TBody";
|
|
7991
8267
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
7992
8268
|
TFoot.displayName = "TFoot";
|
|
7993
|
-
var Tr =
|
|
8269
|
+
var Tr = React49.forwardRef(function Tr2(props, ref) {
|
|
7994
8270
|
const { className, children, ...rest } = props;
|
|
7995
|
-
const stacked =
|
|
8271
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
7996
8272
|
let col = 0;
|
|
7997
|
-
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) {
|
|
7998
8274
|
const at = col;
|
|
7999
|
-
if (
|
|
8000
|
-
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);
|
|
8001
8277
|
}) : children);
|
|
8002
8278
|
});
|
|
8003
8279
|
function cellClass(base, p) {
|
|
@@ -8011,10 +8287,10 @@ function cellClass(base, p) {
|
|
|
8011
8287
|
p.className
|
|
8012
8288
|
);
|
|
8013
8289
|
}
|
|
8014
|
-
var Th =
|
|
8290
|
+
var Th = React49.forwardRef(function Th2(props, ref) {
|
|
8015
8291
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8016
|
-
const stacked =
|
|
8017
|
-
return /* @__PURE__ */
|
|
8292
|
+
const stacked = React49.useContext(StackLabels) != null;
|
|
8293
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8018
8294
|
"th",
|
|
8019
8295
|
{
|
|
8020
8296
|
ref,
|
|
@@ -8026,12 +8302,12 @@ var Th = React47.forwardRef(function Th2(props, ref) {
|
|
|
8026
8302
|
}
|
|
8027
8303
|
);
|
|
8028
8304
|
});
|
|
8029
|
-
var Td =
|
|
8305
|
+
var Td = React49.forwardRef(function Td2(props, ref) {
|
|
8030
8306
|
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
8031
|
-
const labels =
|
|
8307
|
+
const labels = React49.useContext(StackLabels), col = React49.useContext(ColumnIndex);
|
|
8032
8308
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
8033
8309
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
8034
|
-
return /* @__PURE__ */
|
|
8310
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8035
8311
|
"td",
|
|
8036
8312
|
{
|
|
8037
8313
|
ref,
|
|
@@ -8045,8 +8321,8 @@ var Td = React47.forwardRef(function Td2(props, ref) {
|
|
|
8045
8321
|
});
|
|
8046
8322
|
|
|
8047
8323
|
// src/BottomNav.tsx
|
|
8048
|
-
var
|
|
8049
|
-
var BottomNav =
|
|
8324
|
+
var React50 = __toESM(require("react"), 1);
|
|
8325
|
+
var BottomNav = React50.forwardRef(function BottomNav2(props, ref) {
|
|
8050
8326
|
const t = useStrings();
|
|
8051
8327
|
const Link = useLinkComponent(props.linkComponent);
|
|
8052
8328
|
const st = useMaybeControlled(
|
|
@@ -8056,14 +8332,14 @@ var BottomNav = React48.forwardRef(function BottomNav2(props, ref) {
|
|
|
8056
8332
|
);
|
|
8057
8333
|
const active = st[0];
|
|
8058
8334
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
8059
|
-
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(
|
|
8060
8336
|
"nav",
|
|
8061
8337
|
{
|
|
8062
8338
|
ref,
|
|
8063
8339
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide2, props.className),
|
|
8064
8340
|
"aria-label": props.label || t.mainNav
|
|
8065
8341
|
},
|
|
8066
|
-
/* @__PURE__ */
|
|
8342
|
+
/* @__PURE__ */ React50.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
8067
8343
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
8068
8344
|
devWarnOnce(
|
|
8069
8345
|
"bottomnav-label-" + it.id,
|
|
@@ -8084,23 +8360,23 @@ var BottomNav = React48.forwardRef(function BottomNav2(props, ref) {
|
|
|
8084
8360
|
}
|
|
8085
8361
|
};
|
|
8086
8362
|
const inner = [
|
|
8087
|
-
/* @__PURE__ */
|
|
8088
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
8089
|
-
/* @__PURE__ */
|
|
8090
|
-
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
|
|
8091
8367
|
];
|
|
8092
|
-
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));
|
|
8093
8369
|
}))
|
|
8094
8370
|
));
|
|
8095
8371
|
});
|
|
8096
8372
|
|
|
8097
8373
|
// src/Surface.tsx
|
|
8098
|
-
var
|
|
8099
|
-
var
|
|
8100
|
-
var Surface =
|
|
8374
|
+
var React51 = __toESM(require("react"), 1);
|
|
8375
|
+
var h10 = React51.createElement;
|
|
8376
|
+
var Surface = React51.forwardRef(function Surface2(props, ref) {
|
|
8101
8377
|
const t = props.texture || "mesh";
|
|
8102
8378
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
8103
|
-
return
|
|
8379
|
+
return h10(
|
|
8104
8380
|
props.as || "div",
|
|
8105
8381
|
Object.assign({}, rest, {
|
|
8106
8382
|
ref,
|
|
@@ -8118,14 +8394,14 @@ var Surface = React49.forwardRef(function Surface2(props, ref) {
|
|
|
8118
8394
|
});
|
|
8119
8395
|
|
|
8120
8396
|
// src/Stat.tsx
|
|
8121
|
-
var
|
|
8122
|
-
var Stat =
|
|
8397
|
+
var React52 = __toESM(require("react"), 1);
|
|
8398
|
+
var Stat = React52.forwardRef(function Stat2(props, ref) {
|
|
8123
8399
|
const Link = useLinkComponent(props.linkComponent);
|
|
8124
8400
|
return statElement(props, ref, Link);
|
|
8125
8401
|
});
|
|
8126
8402
|
|
|
8127
8403
|
// src/TimePicker.tsx
|
|
8128
|
-
var
|
|
8404
|
+
var React53 = __toESM(require("react"), 1);
|
|
8129
8405
|
var import_react_dom12 = require("react-dom");
|
|
8130
8406
|
|
|
8131
8407
|
// src/text.ts
|
|
@@ -8167,7 +8443,7 @@ function toMin(t) {
|
|
|
8167
8443
|
function fromMin(n3) {
|
|
8168
8444
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
8169
8445
|
}
|
|
8170
|
-
var TimePicker =
|
|
8446
|
+
var TimePicker = React53.forwardRef(function TimePicker2(props, ref) {
|
|
8171
8447
|
const t = useStrings();
|
|
8172
8448
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
8173
8449
|
const st = useMaybeControlled(
|
|
@@ -8177,7 +8453,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8177
8453
|
);
|
|
8178
8454
|
const value = st[0];
|
|
8179
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;
|
|
8180
|
-
const slots =
|
|
8456
|
+
const slots = React53.useMemo(
|
|
8181
8457
|
function() {
|
|
8182
8458
|
const out = [];
|
|
8183
8459
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -8189,12 +8465,12 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8189
8465
|
const n3 = toMin(v);
|
|
8190
8466
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
8191
8467
|
}
|
|
8192
|
-
const openState =
|
|
8193
|
-
const editState =
|
|
8194
|
-
const aState =
|
|
8195
|
-
const errState =
|
|
8196
|
-
const pos =
|
|
8197
|
-
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);
|
|
8198
8474
|
const mounted = useMounted();
|
|
8199
8475
|
function nearest(v) {
|
|
8200
8476
|
const n3 = toMin(v);
|
|
@@ -8207,13 +8483,13 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8207
8483
|
}
|
|
8208
8484
|
function place2() {
|
|
8209
8485
|
if (!boxRef.current) return;
|
|
8210
|
-
const
|
|
8486
|
+
const r2 = boxRef.current.getBoundingClientRect(), below2 = window.innerHeight - r2.bottom - 8, up2 = below2 < 200 && r2.top > below2;
|
|
8211
8487
|
pos[1]({
|
|
8212
|
-
left:
|
|
8213
|
-
width: Math.max(
|
|
8214
|
-
top: up2 ? void 0 :
|
|
8215
|
-
bottom: up2 ? window.innerHeight -
|
|
8216
|
-
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)
|
|
8217
8493
|
});
|
|
8218
8494
|
}
|
|
8219
8495
|
useIsoLayoutEffect(
|
|
@@ -8222,7 +8498,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8222
8498
|
},
|
|
8223
8499
|
[open]
|
|
8224
8500
|
);
|
|
8225
|
-
|
|
8501
|
+
React53.useEffect(
|
|
8226
8502
|
function() {
|
|
8227
8503
|
if (!open) return;
|
|
8228
8504
|
function outside(e) {
|
|
@@ -8244,7 +8520,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8244
8520
|
},
|
|
8245
8521
|
[open]
|
|
8246
8522
|
);
|
|
8247
|
-
|
|
8523
|
+
React53.useEffect(
|
|
8248
8524
|
function() {
|
|
8249
8525
|
if (!open || !listRef.current) return;
|
|
8250
8526
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -8343,9 +8619,9 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8343
8619
|
}
|
|
8344
8620
|
const error = errState[0] || props.error;
|
|
8345
8621
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
8346
|
-
/* @__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) {
|
|
8347
8623
|
const dis = blocked(s), sel = s === value;
|
|
8348
|
-
return /* @__PURE__ */
|
|
8624
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8349
8625
|
"li",
|
|
8350
8626
|
{
|
|
8351
8627
|
key: s,
|
|
@@ -8370,13 +8646,13 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8370
8646
|
if (active !== i) setActive(i);
|
|
8371
8647
|
}
|
|
8372
8648
|
},
|
|
8373
|
-
/* @__PURE__ */
|
|
8374
|
-
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
|
|
8375
8651
|
);
|
|
8376
8652
|
}))),
|
|
8377
8653
|
document.body
|
|
8378
8654
|
) : null;
|
|
8379
|
-
return /* @__PURE__ */
|
|
8655
|
+
return /* @__PURE__ */ React53.createElement(
|
|
8380
8656
|
Field,
|
|
8381
8657
|
{
|
|
8382
8658
|
id,
|
|
@@ -8388,7 +8664,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8388
8664
|
disabled: props.disabled,
|
|
8389
8665
|
className: props.className
|
|
8390
8666
|
},
|
|
8391
|
-
/* @__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(
|
|
8392
8668
|
"input",
|
|
8393
8669
|
{
|
|
8394
8670
|
ref: inputMerged,
|
|
@@ -8428,7 +8704,7 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8428
8704
|
}, 0);
|
|
8429
8705
|
}
|
|
8430
8706
|
}
|
|
8431
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
8707
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React53.createElement(
|
|
8432
8708
|
"button",
|
|
8433
8709
|
{
|
|
8434
8710
|
type: "button",
|
|
@@ -8441,8 +8717,8 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8441
8717
|
if (inputRef.current) inputRef.current.focus();
|
|
8442
8718
|
}
|
|
8443
8719
|
},
|
|
8444
|
-
/* @__PURE__ */
|
|
8445
|
-
) : null, /* @__PURE__ */
|
|
8720
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconX, null) })
|
|
8721
|
+
) : null, /* @__PURE__ */ React53.createElement(
|
|
8446
8722
|
"button",
|
|
8447
8723
|
{
|
|
8448
8724
|
type: "button",
|
|
@@ -8460,14 +8736,14 @@ var TimePicker = React51.forwardRef(function TimePicker2(props, ref) {
|
|
|
8460
8736
|
}
|
|
8461
8737
|
}
|
|
8462
8738
|
},
|
|
8463
|
-
/* @__PURE__ */
|
|
8739
|
+
/* @__PURE__ */ React53.createElement(Icon, { name: /* @__PURE__ */ React53.createElement(IconChevronDown, null) })
|
|
8464
8740
|
)),
|
|
8465
8741
|
list
|
|
8466
8742
|
);
|
|
8467
8743
|
});
|
|
8468
8744
|
|
|
8469
8745
|
// src/FileUpload.tsx
|
|
8470
|
-
var
|
|
8746
|
+
var React54 = __toESM(require("react"), 1);
|
|
8471
8747
|
function matches(file, accept) {
|
|
8472
8748
|
if (!accept) return true;
|
|
8473
8749
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -8491,24 +8767,24 @@ function describeAccept(accept, t) {
|
|
|
8491
8767
|
}).join(", ");
|
|
8492
8768
|
}
|
|
8493
8769
|
var seq = 0;
|
|
8494
|
-
var FileUpload =
|
|
8770
|
+
var FileUpload = React54.forwardRef(function FileUpload2(props, ref) {
|
|
8495
8771
|
const t = useStrings();
|
|
8496
8772
|
const auto = uid(), id = props.id || auto;
|
|
8497
8773
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
8498
8774
|
const items2 = st[0] || [];
|
|
8499
|
-
const dragState =
|
|
8500
|
-
const inputRef =
|
|
8501
|
-
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({});
|
|
8502
8778
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
8503
8779
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
8504
|
-
|
|
8780
|
+
React54.useEffect(function() {
|
|
8505
8781
|
return function() {
|
|
8506
8782
|
Object.keys(urls.current).forEach(function(k) {
|
|
8507
8783
|
URL.revokeObjectURL(urls.current[k]);
|
|
8508
8784
|
});
|
|
8509
8785
|
};
|
|
8510
8786
|
}, []);
|
|
8511
|
-
|
|
8787
|
+
React54.useEffect(
|
|
8512
8788
|
function() {
|
|
8513
8789
|
const el = inputRef.current;
|
|
8514
8790
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -8568,7 +8844,7 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8568
8844
|
if (inputRef.current) inputRef.current.focus();
|
|
8569
8845
|
}
|
|
8570
8846
|
const error = props.error;
|
|
8571
|
-
return /* @__PURE__ */
|
|
8847
|
+
return /* @__PURE__ */ React54.createElement(
|
|
8572
8848
|
Field,
|
|
8573
8849
|
{
|
|
8574
8850
|
id,
|
|
@@ -8580,7 +8856,7 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8580
8856
|
disabled: props.disabled,
|
|
8581
8857
|
className: props.className
|
|
8582
8858
|
},
|
|
8583
|
-
/* @__PURE__ */
|
|
8859
|
+
/* @__PURE__ */ React54.createElement(
|
|
8584
8860
|
"div",
|
|
8585
8861
|
{
|
|
8586
8862
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -8601,9 +8877,9 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8601
8877
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
8602
8878
|
}
|
|
8603
8879
|
},
|
|
8604
|
-
/* @__PURE__ */
|
|
8605
|
-
/* @__PURE__ */
|
|
8606
|
-
/* @__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(
|
|
8607
8883
|
"input",
|
|
8608
8884
|
{
|
|
8609
8885
|
ref: inputMerged,
|
|
@@ -8625,12 +8901,12 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8625
8901
|
}
|
|
8626
8902
|
}
|
|
8627
8903
|
),
|
|
8628
|
-
/* @__PURE__ */
|
|
8629
|
-
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
|
|
8630
8906
|
),
|
|
8631
|
-
items2.length ? /* @__PURE__ */
|
|
8907
|
+
items2.length ? /* @__PURE__ */ React54.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
8632
8908
|
const src = thumb(it);
|
|
8633
|
-
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(
|
|
8634
8910
|
"span",
|
|
8635
8911
|
{
|
|
8636
8912
|
className: "aura-upload__bar",
|
|
@@ -8640,11 +8916,11 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8640
8916
|
"aria-valuemax": 100,
|
|
8641
8917
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
8642
8918
|
},
|
|
8643
|
-
/* @__PURE__ */
|
|
8644
|
-
) : null), /* @__PURE__ */
|
|
8919
|
+
/* @__PURE__ */ React54.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
8920
|
+
) : null), /* @__PURE__ */ React54.createElement(
|
|
8645
8921
|
IconButton,
|
|
8646
8922
|
{
|
|
8647
|
-
icon: /* @__PURE__ */
|
|
8923
|
+
icon: /* @__PURE__ */ React54.createElement(IconX, null),
|
|
8648
8924
|
label: t.remove(it.name),
|
|
8649
8925
|
onClick: function() {
|
|
8650
8926
|
remove(it);
|
|
@@ -8657,14 +8933,14 @@ var FileUpload = React52.forwardRef(function FileUpload2(props, ref) {
|
|
|
8657
8933
|
|
|
8658
8934
|
// src/theme.ts
|
|
8659
8935
|
function hexToRgb(hex) {
|
|
8660
|
-
let
|
|
8661
|
-
if (
|
|
8662
|
-
|
|
8936
|
+
let h11 = String(hex).trim().replace("#", "");
|
|
8937
|
+
if (h11.length === 3)
|
|
8938
|
+
h11 = h11.split("").map(function(c) {
|
|
8663
8939
|
return c + c;
|
|
8664
8940
|
}).join("");
|
|
8665
|
-
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');
|
|
8666
8942
|
return [0, 2, 4].map(function(i) {
|
|
8667
|
-
return parseInt(
|
|
8943
|
+
return parseInt(h11.slice(i, i + 2), 16) / 255;
|
|
8668
8944
|
});
|
|
8669
8945
|
}
|
|
8670
8946
|
function rgbToHex(rgb) {
|
|
@@ -8680,10 +8956,10 @@ function delin(c) {
|
|
|
8680
8956
|
return c <= 31308e-7 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
|
|
8681
8957
|
}
|
|
8682
8958
|
function rgbToOklch(rgb) {
|
|
8683
|
-
const
|
|
8684
|
-
const l = Math.cbrt(0.4122214708 *
|
|
8685
|
-
const m = Math.cbrt(0.2119034982 *
|
|
8686
|
-
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);
|
|
8687
8963
|
const L = 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s;
|
|
8688
8964
|
const A = 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s;
|
|
8689
8965
|
const B = 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s;
|
|
@@ -8843,13 +9119,13 @@ function createTheme(opts) {
|
|
|
8843
9119
|
D["card-shadow-creative"] = "8px 8px 0px " + shadowDark;
|
|
8844
9120
|
const checks = [];
|
|
8845
9121
|
function check(theme, fg, bg, target, fgHex, bgHex) {
|
|
8846
|
-
const
|
|
9122
|
+
const r2 = contrast(fgHex, bgHex);
|
|
8847
9123
|
checks.push({
|
|
8848
9124
|
theme,
|
|
8849
9125
|
pair: fg + " on " + bg,
|
|
8850
|
-
ratio: Math.round(
|
|
9126
|
+
ratio: Math.round(r2 * 100) / 100,
|
|
8851
9127
|
target,
|
|
8852
|
-
pass:
|
|
9128
|
+
pass: r2 >= target - 5e-3
|
|
8853
9129
|
});
|
|
8854
9130
|
}
|
|
8855
9131
|
[
|
|
@@ -8960,9 +9236,9 @@ function createTheme(opts) {
|
|
|
8960
9236
|
}
|
|
8961
9237
|
|
|
8962
9238
|
// src/ThemeStyle.tsx
|
|
8963
|
-
var
|
|
9239
|
+
var React55 = __toESM(require("react"), 1);
|
|
8964
9240
|
function ThemeStyle(props) {
|
|
8965
|
-
const css =
|
|
9241
|
+
const css = React55.useMemo(
|
|
8966
9242
|
function() {
|
|
8967
9243
|
try {
|
|
8968
9244
|
return createTheme({
|
|
@@ -8979,11 +9255,11 @@ function ThemeStyle(props) {
|
|
|
8979
9255
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
8980
9256
|
);
|
|
8981
9257
|
if (css === null) return null;
|
|
8982
|
-
return /* @__PURE__ */
|
|
9258
|
+
return /* @__PURE__ */ React55.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
8983
9259
|
}
|
|
8984
9260
|
|
|
8985
9261
|
// src/colorScheme.tsx
|
|
8986
|
-
var
|
|
9262
|
+
var React56 = __toESM(require("react"), 1);
|
|
8987
9263
|
|
|
8988
9264
|
// src/colorSchemeScript.ts
|
|
8989
9265
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -9000,7 +9276,7 @@ function colorSchemeScript(options) {
|
|
|
9000
9276
|
|
|
9001
9277
|
// src/colorScheme.tsx
|
|
9002
9278
|
function ColorSchemeScript(props) {
|
|
9003
|
-
return /* @__PURE__ */
|
|
9279
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9004
9280
|
"script",
|
|
9005
9281
|
{
|
|
9006
9282
|
"data-aura-color-scheme": "",
|
|
@@ -9025,7 +9301,7 @@ function apply(scheme) {
|
|
|
9025
9301
|
function useColorScheme(options) {
|
|
9026
9302
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
9027
9303
|
const fallback = options && options.defaultScheme || "system";
|
|
9028
|
-
const subscribe2 =
|
|
9304
|
+
const subscribe2 = React56.useCallback(
|
|
9029
9305
|
function(cb) {
|
|
9030
9306
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
9031
9307
|
function onSystem() {
|
|
@@ -9047,7 +9323,7 @@ function useColorScheme(options) {
|
|
|
9047
9323
|
},
|
|
9048
9324
|
[fallback, key]
|
|
9049
9325
|
);
|
|
9050
|
-
const snapshot =
|
|
9326
|
+
const snapshot = React56.useSyncExternalStore(
|
|
9051
9327
|
subscribe2,
|
|
9052
9328
|
function() {
|
|
9053
9329
|
const s = readScheme(fallback);
|
|
@@ -9058,7 +9334,7 @@ function useColorScheme(options) {
|
|
|
9058
9334
|
}
|
|
9059
9335
|
);
|
|
9060
9336
|
const parts = snapshot.split("|");
|
|
9061
|
-
const setScheme =
|
|
9337
|
+
const setScheme = React56.useCallback(
|
|
9062
9338
|
function(next) {
|
|
9063
9339
|
if (!valid(next)) return;
|
|
9064
9340
|
try {
|
|
@@ -9077,14 +9353,14 @@ function ColorSchemeToggle(props) {
|
|
|
9077
9353
|
const cs = useColorScheme(props);
|
|
9078
9354
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
9079
9355
|
const label = props.label || t.colorScheme;
|
|
9080
|
-
return /* @__PURE__ */
|
|
9356
|
+
return /* @__PURE__ */ React56.createElement(
|
|
9081
9357
|
DropdownMenu,
|
|
9082
9358
|
{
|
|
9083
9359
|
label,
|
|
9084
|
-
trigger: /* @__PURE__ */
|
|
9360
|
+
trigger: /* @__PURE__ */ React56.createElement(
|
|
9085
9361
|
IconButton,
|
|
9086
9362
|
{
|
|
9087
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
9363
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React56.createElement(IconMoon, null) : /* @__PURE__ */ React56.createElement(IconSun, null),
|
|
9088
9364
|
label: label + ": " + names[cs.scheme]
|
|
9089
9365
|
}
|
|
9090
9366
|
),
|
|
@@ -9102,14 +9378,14 @@ function ColorSchemeToggle(props) {
|
|
|
9102
9378
|
}
|
|
9103
9379
|
|
|
9104
9380
|
// src/Badge.tsx
|
|
9105
|
-
var
|
|
9106
|
-
var Badge =
|
|
9381
|
+
var React57 = __toESM(require("react"), 1);
|
|
9382
|
+
var Badge = React57.forwardRef(function Badge2(props, ref) {
|
|
9107
9383
|
return badgeElement(props, ref);
|
|
9108
9384
|
});
|
|
9109
9385
|
|
|
9110
9386
|
// src/Progress.tsx
|
|
9111
|
-
var
|
|
9112
|
-
var Progress =
|
|
9387
|
+
var React58 = __toESM(require("react"), 1);
|
|
9388
|
+
var Progress = React58.forwardRef(function Progress2(props, ref) {
|
|
9113
9389
|
const t = useStrings();
|
|
9114
9390
|
const auto = uid(), id = props.id || auto;
|
|
9115
9391
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -9118,7 +9394,7 @@ var Progress = React56.forwardRef(function Progress2(props, ref) {
|
|
|
9118
9394
|
const spct = sec ? Math.max(0, Math.min(100 - pct, sec / max * 100)) : 0;
|
|
9119
9395
|
const valueText = props.valueText != null ? props.valueText : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
9120
9396
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
9121
|
-
return /* @__PURE__ */
|
|
9397
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9122
9398
|
"div",
|
|
9123
9399
|
{
|
|
9124
9400
|
ref,
|
|
@@ -9129,8 +9405,8 @@ var Progress = React56.forwardRef(function Progress2(props, ref) {
|
|
|
9129
9405
|
props.className
|
|
9130
9406
|
)
|
|
9131
9407
|
},
|
|
9132
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
9133
|
-
/* @__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(
|
|
9134
9410
|
"div",
|
|
9135
9411
|
{
|
|
9136
9412
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -9142,8 +9418,8 @@ var Progress = React56.forwardRef(function Progress2(props, ref) {
|
|
|
9142
9418
|
"aria-valuenow": det ? props.value : void 0,
|
|
9143
9419
|
"aria-valuetext": det ? valueText : void 0
|
|
9144
9420
|
},
|
|
9145
|
-
/* @__PURE__ */
|
|
9146
|
-
sec ? /* @__PURE__ */
|
|
9421
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
9422
|
+
sec ? /* @__PURE__ */ React58.createElement(
|
|
9147
9423
|
"span",
|
|
9148
9424
|
{
|
|
9149
9425
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -9151,19 +9427,19 @@ var Progress = React56.forwardRef(function Progress2(props, ref) {
|
|
|
9151
9427
|
}
|
|
9152
9428
|
) : null
|
|
9153
9429
|
),
|
|
9154
|
-
props.hint ? /* @__PURE__ */
|
|
9430
|
+
props.hint ? /* @__PURE__ */ React58.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
9155
9431
|
);
|
|
9156
9432
|
});
|
|
9157
9433
|
|
|
9158
9434
|
// src/Skeleton.tsx
|
|
9159
|
-
var
|
|
9160
|
-
var Skeleton =
|
|
9435
|
+
var React59 = __toESM(require("react"), 1);
|
|
9436
|
+
var Skeleton = React59.forwardRef(function Skeleton2(props, ref) {
|
|
9161
9437
|
const v = props.variant || "text";
|
|
9162
9438
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
9163
9439
|
const n3 = props.lines, rows = [];
|
|
9164
9440
|
for (let i = 0; i < n3; i++)
|
|
9165
|
-
rows.push(/* @__PURE__ */
|
|
9166
|
-
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(
|
|
9167
9443
|
"span",
|
|
9168
9444
|
{
|
|
9169
9445
|
ref,
|
|
@@ -9181,17 +9457,17 @@ var Skeleton = React57.forwardRef(function Skeleton2(props, ref) {
|
|
|
9181
9457
|
if (v === "circle") {
|
|
9182
9458
|
style.width = style.height = props.size || props.width || 40;
|
|
9183
9459
|
}
|
|
9184
|
-
return /* @__PURE__ */
|
|
9460
|
+
return /* @__PURE__ */ React59.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
9185
9461
|
});
|
|
9186
9462
|
|
|
9187
9463
|
// src/EmptyState.tsx
|
|
9188
|
-
var
|
|
9189
|
-
var EmptyState =
|
|
9464
|
+
var React60 = __toESM(require("react"), 1);
|
|
9465
|
+
var EmptyState = React60.forwardRef(function EmptyState2(props, ref) {
|
|
9190
9466
|
return emptyStateElement(props, ref);
|
|
9191
9467
|
});
|
|
9192
9468
|
|
|
9193
9469
|
// src/Pagination.tsx
|
|
9194
|
-
var
|
|
9470
|
+
var React61 = __toESM(require("react"), 1);
|
|
9195
9471
|
function pageList(page, count, sib) {
|
|
9196
9472
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
9197
9473
|
if (page - sib <= 3) {
|
|
@@ -9211,7 +9487,7 @@ function pageList(page, count, sib) {
|
|
|
9211
9487
|
if (count > 1) out.push(count);
|
|
9212
9488
|
return out;
|
|
9213
9489
|
}
|
|
9214
|
-
var Pagination =
|
|
9490
|
+
var Pagination = React61.forwardRef(function Pagination2(props, ref) {
|
|
9215
9491
|
const t = useStrings();
|
|
9216
9492
|
useAutoTip();
|
|
9217
9493
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -9231,7 +9507,7 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9231
9507
|
},
|
|
9232
9508
|
extra
|
|
9233
9509
|
);
|
|
9234
|
-
return link ? /* @__PURE__ */
|
|
9510
|
+
return link ? /* @__PURE__ */ React61.createElement(
|
|
9235
9511
|
Link,
|
|
9236
9512
|
{
|
|
9237
9513
|
href: link(p),
|
|
@@ -9244,7 +9520,7 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9244
9520
|
...common
|
|
9245
9521
|
},
|
|
9246
9522
|
label
|
|
9247
|
-
) : /* @__PURE__ */
|
|
9523
|
+
) : /* @__PURE__ */ React61.createElement(
|
|
9248
9524
|
"button",
|
|
9249
9525
|
{
|
|
9250
9526
|
type: "button",
|
|
@@ -9258,7 +9534,7 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9258
9534
|
}
|
|
9259
9535
|
function arrow(p, icon, label, rel, disabled) {
|
|
9260
9536
|
if (!link || disabled)
|
|
9261
|
-
return /* @__PURE__ */
|
|
9537
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9262
9538
|
IconButton,
|
|
9263
9539
|
{
|
|
9264
9540
|
icon,
|
|
@@ -9269,7 +9545,7 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9269
9545
|
}
|
|
9270
9546
|
}
|
|
9271
9547
|
);
|
|
9272
|
-
return /* @__PURE__ */
|
|
9548
|
+
return /* @__PURE__ */ React61.createElement(
|
|
9273
9549
|
Link,
|
|
9274
9550
|
{
|
|
9275
9551
|
href: link(p),
|
|
@@ -9284,17 +9560,17 @@ var Pagination = React59.forwardRef(function Pagination2(props, ref) {
|
|
|
9284
9560
|
}
|
|
9285
9561
|
}
|
|
9286
9562
|
},
|
|
9287
|
-
/* @__PURE__ */
|
|
9563
|
+
/* @__PURE__ */ React61.createElement(Icon, { name: icon, size: "sm" })
|
|
9288
9564
|
);
|
|
9289
9565
|
}
|
|
9290
|
-
return /* @__PURE__ */
|
|
9291
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
9292
|
-
})), /* @__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));
|
|
9293
9569
|
});
|
|
9294
9570
|
|
|
9295
9571
|
// src/Accordion.tsx
|
|
9296
|
-
var
|
|
9297
|
-
var Accordion =
|
|
9572
|
+
var React62 = __toESM(require("react"), 1);
|
|
9573
|
+
var Accordion = React62.forwardRef(function Accordion2(props, ref) {
|
|
9298
9574
|
const auto = uid(), base = props.id || auto;
|
|
9299
9575
|
const multiple = props.type === "multiple";
|
|
9300
9576
|
const st = useMaybeControlled(
|
|
@@ -9332,9 +9608,9 @@ var Accordion = React60.forwardRef(function Accordion2(props, ref) {
|
|
|
9332
9608
|
n3.focus();
|
|
9333
9609
|
}
|
|
9334
9610
|
}
|
|
9335
|
-
return /* @__PURE__ */
|
|
9611
|
+
return /* @__PURE__ */ React62.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
9336
9612
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
9337
|
-
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(
|
|
9338
9614
|
"button",
|
|
9339
9615
|
{
|
|
9340
9616
|
type: "button",
|
|
@@ -9347,10 +9623,10 @@ var Accordion = React60.forwardRef(function Accordion2(props, ref) {
|
|
|
9347
9623
|
toggle(it.id);
|
|
9348
9624
|
}
|
|
9349
9625
|
},
|
|
9350
|
-
it.icon ? /* @__PURE__ */
|
|
9351
|
-
/* @__PURE__ */
|
|
9352
|
-
/* @__PURE__ */
|
|
9353
|
-
)), /* @__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(
|
|
9354
9630
|
"div",
|
|
9355
9631
|
{
|
|
9356
9632
|
id: pid,
|
|
@@ -9365,33 +9641,33 @@ var Accordion = React60.forwardRef(function Accordion2(props, ref) {
|
|
|
9365
9641
|
});
|
|
9366
9642
|
|
|
9367
9643
|
// src/Popover.tsx
|
|
9368
|
-
var
|
|
9644
|
+
var React63 = __toESM(require("react"), 1);
|
|
9369
9645
|
var import_react_dom13 = require("react-dom");
|
|
9370
9646
|
function position(anchor, pop, placement) {
|
|
9371
|
-
const
|
|
9647
|
+
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
9372
9648
|
let side = (placement || "bottom-start").split("-")[0], align = (placement || "bottom-start").split("-")[1] || "start";
|
|
9373
|
-
if (side === "bottom" &&
|
|
9374
|
-
else if (side === "top" &&
|
|
9375
|
-
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;
|
|
9376
9652
|
let maxHeight;
|
|
9377
9653
|
if (ph > below2 && ph > above) {
|
|
9378
9654
|
side = above > below2 ? "top" : "bottom";
|
|
9379
9655
|
maxHeight = Math.max(120, side === "top" ? above : below2);
|
|
9380
9656
|
}
|
|
9381
|
-
const
|
|
9382
|
-
const top = side === "top" ?
|
|
9383
|
-
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;
|
|
9384
9660
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
9385
9661
|
}
|
|
9386
|
-
var Popover =
|
|
9662
|
+
var Popover = React63.forwardRef(function Popover2(props, ref) {
|
|
9387
9663
|
const t = useStrings();
|
|
9388
9664
|
const density = useDensity();
|
|
9389
9665
|
const auto = uid(), id = props.id || auto;
|
|
9390
9666
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
9391
9667
|
const open = !!st[0];
|
|
9392
|
-
const wrap =
|
|
9393
|
-
const pos =
|
|
9394
|
-
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);
|
|
9395
9671
|
function trigger() {
|
|
9396
9672
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
9397
9673
|
}
|
|
@@ -9418,7 +9694,7 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9418
9694
|
},
|
|
9419
9695
|
[open, mounted, props.placement]
|
|
9420
9696
|
);
|
|
9421
|
-
|
|
9697
|
+
React63.useEffect(
|
|
9422
9698
|
function() {
|
|
9423
9699
|
if (!open || !mounted) return;
|
|
9424
9700
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -9443,9 +9719,9 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9443
9719
|
},
|
|
9444
9720
|
[open, mounted]
|
|
9445
9721
|
);
|
|
9446
|
-
const child =
|
|
9722
|
+
const child = React63.Children.only(props.trigger);
|
|
9447
9723
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
9448
|
-
/* @__PURE__ */
|
|
9724
|
+
/* @__PURE__ */ React63.createElement(
|
|
9449
9725
|
"div",
|
|
9450
9726
|
{
|
|
9451
9727
|
ref: popMerged,
|
|
@@ -9475,17 +9751,17 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9475
9751
|
} else trapTab(e, pop.current);
|
|
9476
9752
|
}
|
|
9477
9753
|
},
|
|
9478
|
-
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(
|
|
9479
9755
|
IconButton,
|
|
9480
9756
|
{
|
|
9481
|
-
icon: /* @__PURE__ */
|
|
9757
|
+
icon: /* @__PURE__ */ React63.createElement(IconX, null),
|
|
9482
9758
|
label: t.close,
|
|
9483
9759
|
onClick: function() {
|
|
9484
9760
|
close(true);
|
|
9485
9761
|
}
|
|
9486
9762
|
}
|
|
9487
9763
|
)) : null,
|
|
9488
|
-
/* @__PURE__ */
|
|
9764
|
+
/* @__PURE__ */ React63.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
9489
9765
|
close: function() {
|
|
9490
9766
|
close(true);
|
|
9491
9767
|
}
|
|
@@ -9493,7 +9769,7 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9493
9769
|
),
|
|
9494
9770
|
document.body
|
|
9495
9771
|
) : null;
|
|
9496
|
-
return /* @__PURE__ */
|
|
9772
|
+
return /* @__PURE__ */ React63.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React63.cloneElement(child, {
|
|
9497
9773
|
onClick: function(e) {
|
|
9498
9774
|
if (child.props.onClick) child.props.onClick(e);
|
|
9499
9775
|
st[1](!open);
|
|
@@ -9505,7 +9781,7 @@ var Popover = React61.forwardRef(function Popover2(props, ref) {
|
|
|
9505
9781
|
});
|
|
9506
9782
|
|
|
9507
9783
|
// src/NumberField.tsx
|
|
9508
|
-
var
|
|
9784
|
+
var React64 = __toESM(require("react"), 1);
|
|
9509
9785
|
function decimalsOf(n3) {
|
|
9510
9786
|
const s = String(n3);
|
|
9511
9787
|
const i = s.indexOf(".");
|
|
@@ -9518,7 +9794,7 @@ function parse(text2) {
|
|
|
9518
9794
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
9519
9795
|
return Number(s);
|
|
9520
9796
|
}
|
|
9521
|
-
var NumberField =
|
|
9797
|
+
var NumberField = React64.forwardRef(function NumberField2(props, ref) {
|
|
9522
9798
|
const t = useStrings();
|
|
9523
9799
|
const auto = uid(), id = props.id || auto;
|
|
9524
9800
|
const step = props.step || 1;
|
|
@@ -9529,7 +9805,7 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9529
9805
|
props.onChange
|
|
9530
9806
|
);
|
|
9531
9807
|
const value = st[0], setValue = st[1];
|
|
9532
|
-
const draftState =
|
|
9808
|
+
const draftState = React64.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
9533
9809
|
function fmt2(n3) {
|
|
9534
9810
|
if (n3 == null || isNaN(n3)) return "";
|
|
9535
9811
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -9578,7 +9854,7 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9578
9854
|
};
|
|
9579
9855
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
9580
9856
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
9581
|
-
return /* @__PURE__ */
|
|
9857
|
+
return /* @__PURE__ */ React64.createElement(
|
|
9582
9858
|
Field,
|
|
9583
9859
|
{
|
|
9584
9860
|
id,
|
|
@@ -9590,7 +9866,7 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9590
9866
|
disabled: props.disabled,
|
|
9591
9867
|
className: props.className
|
|
9592
9868
|
},
|
|
9593
|
-
/* @__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(
|
|
9594
9870
|
"input",
|
|
9595
9871
|
{
|
|
9596
9872
|
ref,
|
|
@@ -9637,7 +9913,7 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9637
9913
|
},
|
|
9638
9914
|
onKeyDown
|
|
9639
9915
|
}
|
|
9640
|
-
), 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(
|
|
9641
9917
|
"button",
|
|
9642
9918
|
{
|
|
9643
9919
|
type: "button",
|
|
@@ -9653,8 +9929,8 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9653
9929
|
nudge(-step);
|
|
9654
9930
|
}
|
|
9655
9931
|
},
|
|
9656
|
-
/* @__PURE__ */
|
|
9657
|
-
), /* @__PURE__ */
|
|
9932
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconMinus, null) })
|
|
9933
|
+
), /* @__PURE__ */ React64.createElement(
|
|
9658
9934
|
"button",
|
|
9659
9935
|
{
|
|
9660
9936
|
type: "button",
|
|
@@ -9670,14 +9946,14 @@ var NumberField = React62.forwardRef(function NumberField2(props, ref) {
|
|
|
9670
9946
|
nudge(step);
|
|
9671
9947
|
}
|
|
9672
9948
|
},
|
|
9673
|
-
/* @__PURE__ */
|
|
9949
|
+
/* @__PURE__ */ React64.createElement(Icon, { name: /* @__PURE__ */ React64.createElement(IconPlus, null) })
|
|
9674
9950
|
)) : null)
|
|
9675
9951
|
);
|
|
9676
9952
|
});
|
|
9677
9953
|
|
|
9678
9954
|
// src/Stepper.tsx
|
|
9679
|
-
var
|
|
9680
|
-
var Stepper =
|
|
9955
|
+
var React65 = __toESM(require("react"), 1);
|
|
9956
|
+
var Stepper = React65.forwardRef(function Stepper2(props, ref) {
|
|
9681
9957
|
const t = useStrings();
|
|
9682
9958
|
const idBase = uid();
|
|
9683
9959
|
const steps = props.steps || [];
|
|
@@ -9688,22 +9964,22 @@ var Stepper = React63.forwardRef(function Stepper2(props, ref) {
|
|
|
9688
9964
|
if (at < 0) at = 0;
|
|
9689
9965
|
const vertical = props.orientation === "vertical";
|
|
9690
9966
|
const cur2 = steps[at];
|
|
9691
|
-
return /* @__PURE__ */
|
|
9967
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9692
9968
|
"nav",
|
|
9693
9969
|
{
|
|
9694
9970
|
ref,
|
|
9695
9971
|
"aria-label": props.label,
|
|
9696
9972
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
9697
9973
|
},
|
|
9698
|
-
/* @__PURE__ */
|
|
9974
|
+
/* @__PURE__ */ React65.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
9699
9975
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
9700
9976
|
const error = s.status === "error";
|
|
9701
|
-
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);
|
|
9702
9978
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
9703
9979
|
const clickable = state === "done" && !!props.onStepClick;
|
|
9704
9980
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
9705
9981
|
const descId = idBase + "-step-" + i;
|
|
9706
|
-
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(
|
|
9707
9983
|
"span",
|
|
9708
9984
|
{
|
|
9709
9985
|
className: "aura-stepper__desc",
|
|
@@ -9712,14 +9988,14 @@ var Stepper = React63.forwardRef(function Stepper2(props, ref) {
|
|
|
9712
9988
|
},
|
|
9713
9989
|
s.description
|
|
9714
9990
|
) : null);
|
|
9715
|
-
return /* @__PURE__ */
|
|
9991
|
+
return /* @__PURE__ */ React65.createElement(
|
|
9716
9992
|
"li",
|
|
9717
9993
|
{
|
|
9718
9994
|
key: s.id,
|
|
9719
9995
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
9720
9996
|
"aria-current": state === "current" ? "step" : void 0
|
|
9721
9997
|
},
|
|
9722
|
-
clickable ? /* @__PURE__ */
|
|
9998
|
+
clickable ? /* @__PURE__ */ React65.createElement(
|
|
9723
9999
|
"button",
|
|
9724
10000
|
{
|
|
9725
10001
|
type: "button",
|
|
@@ -9731,19 +10007,19 @@ var Stepper = React63.forwardRef(function Stepper2(props, ref) {
|
|
|
9731
10007
|
},
|
|
9732
10008
|
marker,
|
|
9733
10009
|
text2
|
|
9734
|
-
) : /* @__PURE__ */
|
|
10010
|
+
) : /* @__PURE__ */ React65.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
9735
10011
|
);
|
|
9736
10012
|
})),
|
|
9737
|
-
!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
|
|
9738
10014
|
);
|
|
9739
10015
|
});
|
|
9740
10016
|
|
|
9741
10017
|
// src/SegmentedControl.tsx
|
|
9742
|
-
var
|
|
10018
|
+
var React66 = __toESM(require("react"), 1);
|
|
9743
10019
|
function toOpt2(o) {
|
|
9744
10020
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
9745
10021
|
}
|
|
9746
|
-
var SegmentedControl =
|
|
10022
|
+
var SegmentedControl = React66.forwardRef(
|
|
9747
10023
|
function SegmentedControl2(props, ref) {
|
|
9748
10024
|
const options = (props.options || []).map(toOpt2);
|
|
9749
10025
|
useAutoTip();
|
|
@@ -9757,7 +10033,7 @@ var SegmentedControl = React64.forwardRef(
|
|
|
9757
10033
|
);
|
|
9758
10034
|
const value = st[0], setValue = st[1];
|
|
9759
10035
|
const auto = uid(), id = props.id || auto;
|
|
9760
|
-
const refs =
|
|
10036
|
+
const refs = React66.useRef([]);
|
|
9761
10037
|
const selIdx = options.findIndex(function(o) {
|
|
9762
10038
|
return o.value === value;
|
|
9763
10039
|
});
|
|
@@ -9790,7 +10066,7 @@ var SegmentedControl = React64.forwardRef(
|
|
|
9790
10066
|
move(options.length, -1);
|
|
9791
10067
|
}
|
|
9792
10068
|
}
|
|
9793
|
-
return /* @__PURE__ */
|
|
10069
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9794
10070
|
"div",
|
|
9795
10071
|
{
|
|
9796
10072
|
ref,
|
|
@@ -9809,7 +10085,7 @@ var SegmentedControl = React64.forwardRef(
|
|
|
9809
10085
|
options.map(function(o, i) {
|
|
9810
10086
|
const on = o.value === value;
|
|
9811
10087
|
const off = props.disabled || o.disabled;
|
|
9812
|
-
return /* @__PURE__ */
|
|
10088
|
+
return /* @__PURE__ */ React66.createElement(
|
|
9813
10089
|
"button",
|
|
9814
10090
|
{
|
|
9815
10091
|
key: o.value,
|
|
@@ -9831,8 +10107,8 @@ var SegmentedControl = React64.forwardRef(
|
|
|
9831
10107
|
onKeyDown(e, i);
|
|
9832
10108
|
}
|
|
9833
10109
|
},
|
|
9834
|
-
o.icon ? /* @__PURE__ */
|
|
9835
|
-
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)
|
|
9836
10112
|
);
|
|
9837
10113
|
})
|
|
9838
10114
|
);
|