@jirawatpyk/aura-react 5.10.1 → 5.12.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 +25 -2
- package/dist/aura.bundle.js +679 -595
- package/dist/cjs/index.cjs +678 -594
- package/dist/esm/Checkbox.js +1 -1
- package/dist/esm/DataTable.js +13 -4
- package/dist/esm/FilterBar.js +1 -1
- package/dist/esm/FilterSelect.js +17 -0
- package/dist/esm/Select.js +82 -20
- package/dist/esm/index.js +2 -0
- package/dist/index.d.cts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/styles.css +53 -1
- package/dist/styles.layer.css +53 -1
- package/package.json +1 -1
package/dist/aura.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"RadioGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
1
|
+
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"FilterSelect"},{"name":"RadioGroup"},{"name":"Switch"},{"name":"Combobox"},{"name":"DatePicker"},{"name":"DateRangePicker"},{"name":"Calendar"},{"name":"Alert"},{"name":"Toaster"},{"name":"PasswordField"},{"name":"FormErrorSummary"},{"name":"FilterBar"},{"name":"Command"},{"name":"Tooltip"},{"name":"Dialog"},{"name":"Drawer"},{"name":"DataTable"},{"name":"Card"},{"name":"Tabs"},{"name":"SideNav"},{"name":"Breadcrumb"},{"name":"Avatar"},{"name":"Stack"},{"name":"Grid"},{"name":"Container"},{"name":"AppShell"},{"name":"ActionBar"},{"name":"Separator"},{"name":"Table"},{"name":"Tr"},{"name":"Th"},{"name":"Td"},{"name":"BottomNav"},{"name":"Surface"},{"name":"Stat"},{"name":"TimePicker"},{"name":"FileUpload"},{"name":"ColorSchemeScript"},{"name":"ColorSchemeToggle"},{"name":"Badge"},{"name":"Tag"},{"name":"Progress"},{"name":"Skeleton"},{"name":"EmptyState"},{"name":"Pagination"},{"name":"Accordion"},{"name":"Popover"},{"name":"NumberField"},{"name":"Stepper"},{"name":"SegmentedControl"}]} */
|
|
2
2
|
window.Aura = (() => {
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -78,6 +78,7 @@ window.Aura = (() => {
|
|
|
78
78
|
Field: () => Field,
|
|
79
79
|
FileUpload: () => FileUpload,
|
|
80
80
|
FilterBar: () => FilterBar,
|
|
81
|
+
FilterSelect: () => FilterSelect,
|
|
81
82
|
FormErrorSummary: () => FormErrorSummary,
|
|
82
83
|
Grid: () => Grid,
|
|
83
84
|
ICONS: () => ICONS,
|
|
@@ -1524,7 +1525,7 @@ window.Aura = (() => {
|
|
|
1524
1525
|
checked: on,
|
|
1525
1526
|
tabIndex: props.tabIndex,
|
|
1526
1527
|
disabled: props.disabled,
|
|
1527
|
-
"aria-describedby": descId,
|
|
1528
|
+
"aria-describedby": cx(props["aria-describedby"], descId) || void 0,
|
|
1528
1529
|
"aria-label": labelled ? void 0 : props.label,
|
|
1529
1530
|
onChange: function(e) {
|
|
1530
1531
|
st[1](e.target.checked);
|
|
@@ -1654,6 +1655,7 @@ window.Aura = (() => {
|
|
|
1654
1655
|
var React15 = __toESM(require_react(), 1);
|
|
1655
1656
|
var import_react_dom2 = __toESM(require_react_dom(), 1);
|
|
1656
1657
|
var h4 = React15.createElement;
|
|
1658
|
+
var FILTER_KEY = "__auraFilter";
|
|
1657
1659
|
var FORM_KEYS = ["name", "form", "value", "defaultValue", "disabled", "autoComplete", "onInput", "onInvalid"];
|
|
1658
1660
|
var HANDLED_KEYS = FORM_KEYS.concat([
|
|
1659
1661
|
"onChange",
|
|
@@ -1687,20 +1689,49 @@ window.Aura = (() => {
|
|
|
1687
1689
|
};
|
|
1688
1690
|
});
|
|
1689
1691
|
}
|
|
1690
|
-
function
|
|
1692
|
+
function textOf(n3) {
|
|
1693
|
+
if (n3 == null || typeof n3 === "boolean") return "";
|
|
1694
|
+
if (typeof n3 === "string" || typeof n3 === "number") return String(n3);
|
|
1695
|
+
if (Array.isArray(n3)) return n3.map(textOf).join("");
|
|
1696
|
+
return React15.isValidElement(n3) ? textOf(n3.props.children) : "";
|
|
1697
|
+
}
|
|
1698
|
+
function childOptions(children, off) {
|
|
1699
|
+
const out = [];
|
|
1700
|
+
React15.Children.forEach(children, function(c) {
|
|
1701
|
+
if (!React15.isValidElement(c)) return;
|
|
1702
|
+
const p = c.props;
|
|
1703
|
+
if (c.type === "optgroup" || c.type === React15.Fragment)
|
|
1704
|
+
out.push.apply(out, childOptions(p.children, off || c.type === "optgroup" && !!p.disabled));
|
|
1705
|
+
else if (c.type === "option") {
|
|
1706
|
+
const label = textOf(p.children);
|
|
1707
|
+
out.push({ value: p.value != null ? String(p.value) : label, label, disabled: off || !!p.disabled });
|
|
1708
|
+
}
|
|
1709
|
+
});
|
|
1710
|
+
return out;
|
|
1711
|
+
}
|
|
1712
|
+
function initialLabel(props, filter) {
|
|
1691
1713
|
const opts = (props.options || []).map(function(o) {
|
|
1692
1714
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
1693
|
-
});
|
|
1694
|
-
const
|
|
1715
|
+
}).concat(childOptions(props.children));
|
|
1716
|
+
const first = opts.filter(function(o) {
|
|
1717
|
+
return !o.disabled;
|
|
1718
|
+
})[0];
|
|
1719
|
+
const v = props.value !== void 0 && props.value !== null ? String(props.value) : props.defaultValue !== void 0 && props.defaultValue !== null ? String(props.defaultValue) : props.placeholder ? "" : first ? first.value : "";
|
|
1695
1720
|
const hit = opts.filter(function(o) {
|
|
1696
1721
|
return o.value === v;
|
|
1697
1722
|
})[0];
|
|
1698
|
-
if (hit)
|
|
1699
|
-
|
|
1723
|
+
if (hit)
|
|
1724
|
+
return {
|
|
1725
|
+
label: filter && filter.allLabel && opts[0] && hit.value === opts[0].value ? filter.allLabel : hit.label,
|
|
1726
|
+
full: hit.label,
|
|
1727
|
+
empty: false
|
|
1728
|
+
};
|
|
1729
|
+
return { label: props.placeholder || "", full: props.placeholder || "", empty: true };
|
|
1700
1730
|
}
|
|
1701
1731
|
var Select = React15.forwardRef(function Select2(props, ref) {
|
|
1702
1732
|
const auto = uid(), id = props.id || auto;
|
|
1703
|
-
const
|
|
1733
|
+
const filter = props[FILTER_KEY];
|
|
1734
|
+
const rest = omit(props, FIELD_KEYS.concat(["children", FILTER_KEY]));
|
|
1704
1735
|
const opts = (props.options || []).map(function(o) {
|
|
1705
1736
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
1706
1737
|
return /* @__PURE__ */ React15.createElement("option", { key: v.value, value: v.value, disabled: v.disabled }, v.label);
|
|
@@ -1715,7 +1746,7 @@ window.Aura = (() => {
|
|
|
1715
1746
|
const live = !native && mounted;
|
|
1716
1747
|
const density = useDensity();
|
|
1717
1748
|
React15.useEffect(function() {
|
|
1718
|
-
if (props.label || props["aria-label"] || props["aria-labelledby"] || props.title) return;
|
|
1749
|
+
if (filter || props.label || props["aria-label"] || props["aria-labelledby"] || props.title) return;
|
|
1719
1750
|
if (document.querySelector('label[for="' + id.replace(/["\\]/g, "\\$&") + '"]')) return;
|
|
1720
1751
|
devWarnOnce(
|
|
1721
1752
|
"select-name",
|
|
@@ -1724,20 +1755,24 @@ window.Aura = (() => {
|
|
|
1724
1755
|
}, []);
|
|
1725
1756
|
const selRef = React15.useRef(null), trigRef = React15.useRef(null), listRef = React15.useRef(null);
|
|
1726
1757
|
const shown = React15.useState(function() {
|
|
1727
|
-
return initialLabel(props);
|
|
1758
|
+
return initialLabel(props, filter);
|
|
1728
1759
|
});
|
|
1729
1760
|
const openState = React15.useState(false), open = openState[0];
|
|
1730
1761
|
const activeState = React15.useState(-1), active = activeState[0];
|
|
1731
1762
|
const items2 = React15.useState([]);
|
|
1732
1763
|
const pos = React15.useState(null);
|
|
1733
1764
|
const typed = React15.useRef({ text: "", at: 0 });
|
|
1765
|
+
const allLabel = React15.useRef(void 0);
|
|
1766
|
+
allLabel.current = filter ? filter.allLabel : void 0;
|
|
1734
1767
|
const sync = React15.useCallback(function() {
|
|
1735
1768
|
const el = selRef.current;
|
|
1736
1769
|
if (!el) return;
|
|
1737
1770
|
const o = el.selectedIndex >= 0 ? el.options[el.selectedIndex] : null;
|
|
1738
|
-
const
|
|
1771
|
+
const text2 = o ? o.textContent || "" : "";
|
|
1772
|
+
const short = allLabel.current && el.selectedIndex === 0 ? allLabel.current : text2;
|
|
1773
|
+
const next = o ? { label: short, full: text2, empty: o.value === "" } : { label: "", full: "", empty: true };
|
|
1739
1774
|
shown[1](function(cur) {
|
|
1740
|
-
return cur.label === next.label && cur.empty === next.empty ? cur : next;
|
|
1775
|
+
return cur.label === next.label && cur.full === next.full && cur.empty === next.empty ? cur : next;
|
|
1741
1776
|
});
|
|
1742
1777
|
}, []);
|
|
1743
1778
|
const hook = React15.useCallback(
|
|
@@ -1928,12 +1963,16 @@ window.Aura = (() => {
|
|
|
1928
1963
|
const t = trigRef.current && trigRef.current.parentElement;
|
|
1929
1964
|
if (!t) return;
|
|
1930
1965
|
const r = t.getBoundingClientRect(), below2 = window.innerHeight - r.bottom - 8, above = r.top - 8, want = listRef.current ? listRef.current.scrollHeight : 320, up = below2 < Math.min(want, 200) && above > below2;
|
|
1966
|
+
const lw = listRef.current ? Math.max(r.width, listRef.current.offsetWidth) : r.width;
|
|
1967
|
+
const rtl = getComputedStyle(t).direction === "rtl";
|
|
1968
|
+
const left = lw <= r.width ? r.left : Math.max(8, Math.min(rtl ? r.right - lw : r.left, window.innerWidth - lw - 8));
|
|
1931
1969
|
pos[1]({
|
|
1932
|
-
left
|
|
1970
|
+
left,
|
|
1933
1971
|
width: r.width,
|
|
1934
1972
|
top: up ? void 0 : r.bottom + 4,
|
|
1935
1973
|
bottom: up ? window.innerHeight - r.top + 4 : void 0,
|
|
1936
|
-
maxHeight: Math.min(320, (up ? above : below2) - 4)
|
|
1974
|
+
maxHeight: Math.min(320, (up ? above : below2) - 4),
|
|
1975
|
+
rtl
|
|
1937
1976
|
});
|
|
1938
1977
|
}
|
|
1939
1978
|
place();
|
|
@@ -1966,7 +2005,7 @@ window.Aura = (() => {
|
|
|
1966
2005
|
[open, active, pos[0] != null]
|
|
1967
2006
|
);
|
|
1968
2007
|
const described = [describedBy(id, props), rest["aria-describedby"]].filter(Boolean).join(" ") || void 0;
|
|
1969
|
-
const field = (child) => /* @__PURE__ */ React15.createElement(
|
|
2008
|
+
const field = (child) => filter ? child : /* @__PURE__ */ React15.createElement(
|
|
1970
2009
|
Field,
|
|
1971
2010
|
{
|
|
1972
2011
|
id,
|
|
@@ -1981,6 +2020,21 @@ window.Aura = (() => {
|
|
|
1981
2020
|
},
|
|
1982
2021
|
child
|
|
1983
2022
|
);
|
|
2023
|
+
const nameId = id + "-name";
|
|
2024
|
+
const face = filter ? /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement("span", { id: nameId, className: "aura-filterselect__name", "aria-hidden": true }, filter.name), /* @__PURE__ */ React15.createElement("span", { className: "aura-filterselect__value", "aria-hidden": shown[0].label !== shown[0].full || void 0 }, shown[0].label || " "), shown[0].label !== shown[0].full ? /* @__PURE__ */ React15.createElement("span", { className: "aura-sr-only" }, shown[0].full) : null, /* @__PURE__ */ React15.createElement(Icon, { name: /* @__PURE__ */ React15.createElement(IconChevronDown, null), className: "aura-filterselect__chevron" })) : null;
|
|
2025
|
+
if (!live && filter)
|
|
2026
|
+
return /* @__PURE__ */ React15.createElement("div", { className: cx("aura-filterselect", props.disabled && "is-disabled", props.className) }, /* @__PURE__ */ React15.createElement("span", { className: "aura-filterselect__face", "aria-hidden": true, style: props.style }, face), h4(
|
|
2027
|
+
"select",
|
|
2028
|
+
Object.assign(extra, omit(rest, ["style"]), {
|
|
2029
|
+
ref: selMerged,
|
|
2030
|
+
id,
|
|
2031
|
+
className: "aura-filterselect__native",
|
|
2032
|
+
"aria-label": rest["aria-label"] || (rest["aria-labelledby"] ? void 0 : filter.name),
|
|
2033
|
+
"aria-describedby": described
|
|
2034
|
+
}),
|
|
2035
|
+
opts,
|
|
2036
|
+
props.children
|
|
2037
|
+
));
|
|
1984
2038
|
if (!live)
|
|
1985
2039
|
return field(
|
|
1986
2040
|
/* @__PURE__ */ React15.createElement("div", { className: cx("aura-input aura-select", props.icon && "has-icon") }, props.icon ? /* @__PURE__ */ React15.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null, h4(
|
|
@@ -2001,7 +2055,7 @@ window.Aura = (() => {
|
|
|
2001
2055
|
const optId = function(i) {
|
|
2002
2056
|
return id + "-opt-" + i;
|
|
2003
2057
|
};
|
|
2004
|
-
const labelledBy = rest["aria-labelledby"] || (props.label ? labelId : void 0);
|
|
2058
|
+
const labelledBy = rest["aria-labelledby"] || (filter && !rest["aria-label"] ? nameId : props.label ? labelId : void 0);
|
|
2005
2059
|
const selIndex = selRef.current ? selRef.current.selectedIndex : -1;
|
|
2006
2060
|
const option = function(it) {
|
|
2007
2061
|
const sel = selIndex === it.index;
|
|
@@ -2047,6 +2101,7 @@ window.Aura = (() => {
|
|
|
2047
2101
|
{
|
|
2048
2102
|
ref: listRef,
|
|
2049
2103
|
"data-density": density,
|
|
2104
|
+
dir: pos[0] ? pos[0].rtl ? "rtl" : "ltr" : void 0,
|
|
2050
2105
|
className: "aura-combo__popover aura-select__popover",
|
|
2051
2106
|
style: pos[0] ? {
|
|
2052
2107
|
left: pos[0].left,
|
|
@@ -2079,10 +2134,17 @@ window.Aura = (() => {
|
|
|
2079
2134
|
/* @__PURE__ */ React15.createElement(
|
|
2080
2135
|
"div",
|
|
2081
2136
|
{
|
|
2082
|
-
className: cx(
|
|
2137
|
+
className: cx(
|
|
2138
|
+
filter ? "aura-filterselect" : "aura-input",
|
|
2139
|
+
"aura-select aura-select--custom",
|
|
2140
|
+
props.icon && "has-icon",
|
|
2141
|
+
open && "is-open",
|
|
2142
|
+
filter && props.disabled && "is-disabled",
|
|
2143
|
+
filter && props.className
|
|
2144
|
+
),
|
|
2083
2145
|
"data-invalid": props.error ? "" : void 0
|
|
2084
2146
|
},
|
|
2085
|
-
props.icon ? /* @__PURE__ */ React15.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null,
|
|
2147
|
+
props.icon && !filter ? /* @__PURE__ */ React15.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null,
|
|
2086
2148
|
h4(
|
|
2087
2149
|
"select",
|
|
2088
2150
|
Object.assign(extra, pick(rest, FORM_KEYS), {
|
|
@@ -2116,7 +2178,7 @@ window.Aura = (() => {
|
|
|
2116
2178
|
type: "button",
|
|
2117
2179
|
role: "combobox",
|
|
2118
2180
|
form: id + "-no-form",
|
|
2119
|
-
className: "aura-input__control aura-select__trigger",
|
|
2181
|
+
className: filter ? "aura-select__trigger aura-filterselect__face" : "aura-input__control aura-select__trigger",
|
|
2120
2182
|
disabled: props.disabled,
|
|
2121
2183
|
tabIndex: rest.tabIndex,
|
|
2122
2184
|
"aria-haspopup": "listbox",
|
|
@@ -2125,7 +2187,7 @@ window.Aura = (() => {
|
|
|
2125
2187
|
"aria-activedescendant": open && active >= 0 ? optId(active) : void 0,
|
|
2126
2188
|
id,
|
|
2127
2189
|
"aria-label": rest["aria-label"],
|
|
2128
|
-
"aria-labelledby": rest["aria-labelledby"],
|
|
2190
|
+
"aria-labelledby": rest["aria-labelledby"] || (filter && !rest["aria-label"] ? nameId : void 0),
|
|
2129
2191
|
"aria-required": props.required || void 0,
|
|
2130
2192
|
"aria-invalid": props.error ? true : void 0,
|
|
2131
2193
|
"aria-describedby": described,
|
|
@@ -2148,17 +2210,30 @@ window.Aura = (() => {
|
|
|
2148
2210
|
if (selRef.current) selRef.current.dispatchEvent(new FocusEvent("focusout", { bubbles: true }));
|
|
2149
2211
|
}
|
|
2150
2212
|
},
|
|
2151
|
-
/* @__PURE__ */ React15.createElement("span", { id: id + "-value", className: cx("aura-select__value", shown[0].empty && "is-placeholder") }, shown[0].label || " ")
|
|
2213
|
+
face || /* @__PURE__ */ React15.createElement("span", { id: id + "-value", className: cx("aura-select__value", shown[0].empty && "is-placeholder") }, shown[0].label || " ")
|
|
2152
2214
|
),
|
|
2153
|
-
/* @__PURE__ */ React15.createElement(Icon, { name: /* @__PURE__ */ React15.createElement(IconChevronDown, null), className: "aura-select__chevron" }),
|
|
2215
|
+
filter ? null : /* @__PURE__ */ React15.createElement(Icon, { name: /* @__PURE__ */ React15.createElement(IconChevronDown, null), className: "aura-select__chevron" }),
|
|
2154
2216
|
popup
|
|
2155
2217
|
)
|
|
2156
2218
|
);
|
|
2157
2219
|
});
|
|
2158
2220
|
|
|
2159
|
-
// src/
|
|
2221
|
+
// src/FilterSelect.tsx
|
|
2160
2222
|
var React16 = __toESM(require_react(), 1);
|
|
2161
|
-
var
|
|
2223
|
+
var FilterSelect = React16.forwardRef(function FilterSelect2(props, ref) {
|
|
2224
|
+
const onChange = props.onChange;
|
|
2225
|
+
const pass = Object.assign(omit(props, ["label", "allLabel", "onChange"]), {
|
|
2226
|
+
[FILTER_KEY]: { name: props.label, allLabel: props.allLabel },
|
|
2227
|
+
onChange: onChange ? function(e) {
|
|
2228
|
+
onChange(e.target.value);
|
|
2229
|
+
} : void 0
|
|
2230
|
+
});
|
|
2231
|
+
return /* @__PURE__ */ React16.createElement(Select, { ...pass, ref });
|
|
2232
|
+
});
|
|
2233
|
+
|
|
2234
|
+
// src/RadioGroup.tsx
|
|
2235
|
+
var React17 = __toESM(require_react(), 1);
|
|
2236
|
+
var RadioGroup = React17.forwardRef(function RadioGroup2(props, ref) {
|
|
2162
2237
|
const auto = uid(), id = props.id || auto;
|
|
2163
2238
|
const st = useMaybeControlled(
|
|
2164
2239
|
props.value,
|
|
@@ -2166,7 +2241,7 @@ window.Aura = (() => {
|
|
|
2166
2241
|
props.onChange
|
|
2167
2242
|
);
|
|
2168
2243
|
const name = props.name || id;
|
|
2169
|
-
const setRef =
|
|
2244
|
+
const setRef = React17.useCallback(
|
|
2170
2245
|
function(el) {
|
|
2171
2246
|
if (el)
|
|
2172
2247
|
el.focus = function(opts) {
|
|
@@ -2178,7 +2253,7 @@ window.Aura = (() => {
|
|
|
2178
2253
|
},
|
|
2179
2254
|
[ref]
|
|
2180
2255
|
);
|
|
2181
|
-
return /* @__PURE__ */
|
|
2256
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2182
2257
|
"fieldset",
|
|
2183
2258
|
{
|
|
2184
2259
|
ref: setRef,
|
|
@@ -2187,10 +2262,10 @@ window.Aura = (() => {
|
|
|
2187
2262
|
"aria-invalid": props.error ? true : void 0,
|
|
2188
2263
|
disabled: props.disabled
|
|
2189
2264
|
},
|
|
2190
|
-
props.label ? /* @__PURE__ */
|
|
2191
|
-
/* @__PURE__ */
|
|
2265
|
+
props.label ? /* @__PURE__ */ React17.createElement("legend", { className: "aura-field__label" }, props.label, props.required ? /* @__PURE__ */ React17.createElement("span", { className: "aura-field__req", "aria-hidden": true }, " *") : null) : null,
|
|
2266
|
+
/* @__PURE__ */ React17.createElement("div", { className: cx("aura-radio-group__list", props.orientation === "horizontal" && "is-horizontal") }, (props.options || []).map(function(o) {
|
|
2192
2267
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
2193
|
-
return /* @__PURE__ */
|
|
2268
|
+
return /* @__PURE__ */ React17.createElement("label", { key: v.value, className: cx("aura-choice", v.disabled && "is-disabled") }, /* @__PURE__ */ React17.createElement(
|
|
2194
2269
|
"input",
|
|
2195
2270
|
{
|
|
2196
2271
|
type: "radio",
|
|
@@ -2204,19 +2279,19 @@ window.Aura = (() => {
|
|
|
2204
2279
|
st[1](v.value);
|
|
2205
2280
|
}
|
|
2206
2281
|
}
|
|
2207
|
-
), /* @__PURE__ */
|
|
2282
|
+
), /* @__PURE__ */ React17.createElement("span", { className: "aura-choice__text" }, /* @__PURE__ */ React17.createElement("span", { className: "aura-choice__label" }, v.label), v.description ? /* @__PURE__ */ React17.createElement("span", { className: "aura-choice__desc" }, v.description) : null));
|
|
2208
2283
|
})),
|
|
2209
|
-
props.error ? /* @__PURE__ */
|
|
2284
|
+
props.error ? /* @__PURE__ */ React17.createElement("p", { className: "aura-field__error", id: id + "-error" }, /* @__PURE__ */ React17.createElement(Icon, { name: /* @__PURE__ */ React17.createElement(IconCircleAlert, null), size: 14 }), props.error) : props.hint ? /* @__PURE__ */ React17.createElement("p", { className: "aura-field__hint", id: id + "-hint" }, props.hint) : null
|
|
2210
2285
|
);
|
|
2211
2286
|
});
|
|
2212
2287
|
|
|
2213
2288
|
// src/Switch.tsx
|
|
2214
|
-
var
|
|
2215
|
-
var Switch =
|
|
2289
|
+
var React18 = __toESM(require_react(), 1);
|
|
2290
|
+
var Switch = React18.forwardRef(function Switch2(props, ref) {
|
|
2216
2291
|
const auto = uid(), id = props.id || auto;
|
|
2217
2292
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
2218
2293
|
const on = !!st[0];
|
|
2219
|
-
return /* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2220
2295
|
"div",
|
|
2221
2296
|
{
|
|
2222
2297
|
className: cx("aura-switch-row", props.disabled && "is-disabled", props.className),
|
|
@@ -2226,7 +2301,7 @@ window.Aura = (() => {
|
|
|
2226
2301
|
st[1](!on);
|
|
2227
2302
|
}
|
|
2228
2303
|
},
|
|
2229
|
-
/* @__PURE__ */
|
|
2304
|
+
/* @__PURE__ */ React18.createElement(
|
|
2230
2305
|
"button",
|
|
2231
2306
|
{
|
|
2232
2307
|
ref,
|
|
@@ -2243,14 +2318,14 @@ window.Aura = (() => {
|
|
|
2243
2318
|
st[1](!on);
|
|
2244
2319
|
}
|
|
2245
2320
|
},
|
|
2246
|
-
/* @__PURE__ */
|
|
2321
|
+
/* @__PURE__ */ React18.createElement("span", { className: "aura-switch__thumb" })
|
|
2247
2322
|
),
|
|
2248
|
-
props.label ? /* @__PURE__ */
|
|
2323
|
+
props.label ? /* @__PURE__ */ React18.createElement("span", { className: "aura-choice__text" }, /* @__PURE__ */ React18.createElement("label", { className: "aura-choice__label", id: id + "-label", htmlFor: id }, props.label), props.description ? /* @__PURE__ */ React18.createElement("span", { className: "aura-choice__desc", id: id + "-desc" }, props.description) : null) : props.description ? /* @__PURE__ */ React18.createElement("span", { className: "aura-sr-only", id: id + "-desc" }, props.description) : null
|
|
2249
2324
|
);
|
|
2250
2325
|
});
|
|
2251
2326
|
|
|
2252
2327
|
// src/Combobox.tsx
|
|
2253
|
-
var
|
|
2328
|
+
var React19 = __toESM(require_react(), 1);
|
|
2254
2329
|
var import_react_dom3 = __toESM(require_react_dom(), 1);
|
|
2255
2330
|
function norm(s) {
|
|
2256
2331
|
return String(s == null ? "" : s).normalize("NFC").toLocaleLowerCase("th");
|
|
@@ -2265,7 +2340,7 @@ window.Aura = (() => {
|
|
|
2265
2340
|
return norm(k).indexOf(q) >= 0;
|
|
2266
2341
|
});
|
|
2267
2342
|
}
|
|
2268
|
-
var Combobox =
|
|
2343
|
+
var Combobox = React19.forwardRef(
|
|
2269
2344
|
function Combobox2(all, ref) {
|
|
2270
2345
|
const props = all;
|
|
2271
2346
|
const multi = all.multiple === true;
|
|
@@ -2300,11 +2375,11 @@ window.Aura = (() => {
|
|
|
2300
2375
|
return o.value === v;
|
|
2301
2376
|
})[0];
|
|
2302
2377
|
}).filter(Boolean) : [];
|
|
2303
|
-
const openState =
|
|
2304
|
-
const qState =
|
|
2305
|
-
const aState =
|
|
2306
|
-
const posState =
|
|
2307
|
-
const inputRef =
|
|
2378
|
+
const openState = React19.useState(false), open = openState[0], setOpen = openState[1];
|
|
2379
|
+
const qState = React19.useState(null), query = qState[0], setQuery = qState[1];
|
|
2380
|
+
const aState = React19.useState(0), active = aState[0], setActive = aState[1];
|
|
2381
|
+
const posState = React19.useState(null);
|
|
2382
|
+
const inputRef = React19.useRef(null), inputMerged = useMergedRef(ref, inputRef), boxRef = React19.useRef(null), listRef = React19.useRef(null);
|
|
2308
2383
|
const mounted = useMounted();
|
|
2309
2384
|
const limit = props.limit || 200;
|
|
2310
2385
|
const filter = props.filter || defaultFilter;
|
|
@@ -2332,7 +2407,7 @@ window.Aura = (() => {
|
|
|
2332
2407
|
},
|
|
2333
2408
|
[open, shown.length, values.length]
|
|
2334
2409
|
);
|
|
2335
|
-
|
|
2410
|
+
React19.useEffect(
|
|
2336
2411
|
function() {
|
|
2337
2412
|
if (!open) return;
|
|
2338
2413
|
function outside(e) {
|
|
@@ -2354,7 +2429,7 @@ window.Aura = (() => {
|
|
|
2354
2429
|
},
|
|
2355
2430
|
[open]
|
|
2356
2431
|
);
|
|
2357
|
-
|
|
2432
|
+
React19.useEffect(
|
|
2358
2433
|
function() {
|
|
2359
2434
|
if (!open || !listRef.current) return;
|
|
2360
2435
|
const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
|
|
@@ -2435,7 +2510,7 @@ window.Aura = (() => {
|
|
|
2435
2510
|
return id + "-opt-" + i;
|
|
2436
2511
|
};
|
|
2437
2512
|
const list = open && mounted && posState[0] ? (0, import_react_dom3.createPortal)(
|
|
2438
|
-
/* @__PURE__ */
|
|
2513
|
+
/* @__PURE__ */ React19.createElement("div", { ref: listRef, "data-density": density, className: "aura-combo__popover", style: posState[0] }, live.length ? /* @__PURE__ */ React19.createElement(
|
|
2439
2514
|
"ul",
|
|
2440
2515
|
{
|
|
2441
2516
|
id: listId,
|
|
@@ -2447,7 +2522,7 @@ window.Aura = (() => {
|
|
|
2447
2522
|
live.map(function(o, i) {
|
|
2448
2523
|
const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
|
|
2449
2524
|
const blocked = o.disabled || multi && full && !isSel;
|
|
2450
|
-
return /* @__PURE__ */
|
|
2525
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2451
2526
|
"li",
|
|
2452
2527
|
{
|
|
2453
2528
|
key: o.value,
|
|
@@ -2472,15 +2547,15 @@ window.Aura = (() => {
|
|
|
2472
2547
|
if (activeIdx !== i) setActive(i);
|
|
2473
2548
|
}
|
|
2474
2549
|
},
|
|
2475
|
-
o.icon ? /* @__PURE__ */
|
|
2476
|
-
/* @__PURE__ */
|
|
2477
|
-
isSel ? /* @__PURE__ */
|
|
2550
|
+
o.icon ? /* @__PURE__ */ React19.createElement(Icon, { name: o.icon }) : null,
|
|
2551
|
+
/* @__PURE__ */ React19.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__label" }, o.label), o.description ? /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__desc" }, o.description) : null),
|
|
2552
|
+
isSel ? /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
2478
2553
|
);
|
|
2479
2554
|
})
|
|
2480
|
-
) : null, props.loading || !live.length || more ? /* @__PURE__ */
|
|
2555
|
+
) : null, props.loading || !live.length || more ? /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__list", role: "status" }, props.loading ? /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__note" }, /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconLoaderCircle, null), className: "aura-spin" }), props.loadingText || t.searching) : !live.length ? /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__note" }, props.emptyText || t.noMatches) : /* @__PURE__ */ React19.createElement("div", { className: "aura-combo__note" }, t.keepTyping((props.options || []).length))) : null),
|
|
2481
2556
|
document.body
|
|
2482
2557
|
) : null;
|
|
2483
|
-
return /* @__PURE__ */
|
|
2558
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2484
2559
|
Field,
|
|
2485
2560
|
{
|
|
2486
2561
|
id,
|
|
@@ -2492,8 +2567,8 @@ window.Aura = (() => {
|
|
|
2492
2567
|
disabled: props.disabled,
|
|
2493
2568
|
className: props.className
|
|
2494
2569
|
},
|
|
2495
|
-
/* @__PURE__ */
|
|
2496
|
-
return /* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ React19.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo has-icon", open && "is-open", multi && "is-multi") }, /* @__PURE__ */ React19.createElement(Icon, { name: props.icon || /* @__PURE__ */ React19.createElement(IconSearch, null), className: "aura-input__icon" }), multi && picked.length ? /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__chips" }, picked.map(function(o) {
|
|
2571
|
+
return /* @__PURE__ */ React19.createElement("span", { key: o.value, className: "aura-combo__chip" }, /* @__PURE__ */ React19.createElement("span", { className: "aura-combo__chip-label" }, o.label), props.disabled || props.readOnly ? null : /* @__PURE__ */ React19.createElement(
|
|
2497
2572
|
"button",
|
|
2498
2573
|
{
|
|
2499
2574
|
type: "button",
|
|
@@ -2512,13 +2587,13 @@ window.Aura = (() => {
|
|
|
2512
2587
|
if (inputRef.current) inputRef.current.focus();
|
|
2513
2588
|
}
|
|
2514
2589
|
},
|
|
2515
|
-
/* @__PURE__ */
|
|
2590
|
+
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconX, null) })
|
|
2516
2591
|
));
|
|
2517
|
-
})) : null, multi ? /* @__PURE__ */
|
|
2592
|
+
})) : null, multi ? /* @__PURE__ */ React19.createElement("span", { id: summaryId, className: "aura-sr-only" }, picked.length ? t.selectedCount(picked.length) + ": " + picked.map(function(o) {
|
|
2518
2593
|
return o.label;
|
|
2519
2594
|
}).join(", ") : "") : null, props.name ? multi ? values.map(function(v) {
|
|
2520
|
-
return /* @__PURE__ */
|
|
2521
|
-
}) : /* @__PURE__ */
|
|
2595
|
+
return /* @__PURE__ */ React19.createElement("input", { key: v, type: "hidden", name: props.name, value: v });
|
|
2596
|
+
}) : /* @__PURE__ */ React19.createElement("input", { type: "hidden", name: props.name, value: value == null ? "" : value }) : null, /* @__PURE__ */ React19.createElement(
|
|
2522
2597
|
"input",
|
|
2523
2598
|
{
|
|
2524
2599
|
ref: inputMerged,
|
|
@@ -2554,7 +2629,7 @@ window.Aura = (() => {
|
|
|
2554
2629
|
}, 0);
|
|
2555
2630
|
}
|
|
2556
2631
|
}
|
|
2557
|
-
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */
|
|
2632
|
+
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */ React19.createElement(
|
|
2558
2633
|
"button",
|
|
2559
2634
|
{
|
|
2560
2635
|
type: "button",
|
|
@@ -2567,8 +2642,8 @@ window.Aura = (() => {
|
|
|
2567
2642
|
if (inputRef.current) inputRef.current.focus();
|
|
2568
2643
|
}
|
|
2569
2644
|
},
|
|
2570
|
-
/* @__PURE__ */
|
|
2571
|
-
) : null, /* @__PURE__ */
|
|
2645
|
+
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconX, null) })
|
|
2646
|
+
) : null, /* @__PURE__ */ React19.createElement(
|
|
2572
2647
|
"button",
|
|
2573
2648
|
{
|
|
2574
2649
|
type: "button",
|
|
@@ -2586,7 +2661,7 @@ window.Aura = (() => {
|
|
|
2586
2661
|
}
|
|
2587
2662
|
}
|
|
2588
2663
|
},
|
|
2589
|
-
/* @__PURE__ */
|
|
2664
|
+
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconChevronDown, null) })
|
|
2590
2665
|
)),
|
|
2591
2666
|
list
|
|
2592
2667
|
);
|
|
@@ -2594,7 +2669,7 @@ window.Aura = (() => {
|
|
|
2594
2669
|
);
|
|
2595
2670
|
|
|
2596
2671
|
// src/DatePicker.tsx
|
|
2597
|
-
var
|
|
2672
|
+
var React20 = __toESM(require_react(), 1);
|
|
2598
2673
|
var import_react_dom4 = __toESM(require_react_dom(), 1);
|
|
2599
2674
|
|
|
2600
2675
|
// src/dates.ts
|
|
@@ -2778,7 +2853,7 @@ window.Aura = (() => {
|
|
|
2778
2853
|
// src/DatePicker.tsx
|
|
2779
2854
|
function useFormatDate() {
|
|
2780
2855
|
const ctx = useAuraLocale(), locale = ctx.locale || "en", calendar = ctx.calendar;
|
|
2781
|
-
return
|
|
2856
|
+
return React20.useCallback(
|
|
2782
2857
|
function(iso, opts) {
|
|
2783
2858
|
const o = opts || {}, loc = o.locale || locale;
|
|
2784
2859
|
return formatDate(
|
|
@@ -2799,7 +2874,7 @@ window.Aura = (() => {
|
|
|
2799
2874
|
if (hi && fromISO(hi) && iso > hi) return false;
|
|
2800
2875
|
return !(o.isDateDisabled && o.isDateDisabled(iso));
|
|
2801
2876
|
}
|
|
2802
|
-
var Calendar =
|
|
2877
|
+
var Calendar = React20.forwardRef(function Calendar2(props, ref) {
|
|
2803
2878
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), tag = localeTag(locale, calendar);
|
|
2804
2879
|
const weekStart = props.weekStartsOn == null ? locale === "sv" ? 1 : 0 : props.weekStartsOn;
|
|
2805
2880
|
const given = props.today && fromISO(props.today) ? props.today : null, zone = props.timeZone || ctx.timeZone;
|
|
@@ -2814,7 +2889,7 @@ window.Aura = (() => {
|
|
|
2814
2889
|
function select(iso) {
|
|
2815
2890
|
if (props.onSelect) props.onSelect(iso);
|
|
2816
2891
|
}
|
|
2817
|
-
const focusState =
|
|
2892
|
+
const focusState = React20.useState(function() {
|
|
2818
2893
|
const d0 = fromISO(props.focus) || start || today;
|
|
2819
2894
|
if (!disabledAt(d0)) return d0;
|
|
2820
2895
|
for (let i = 1; i <= 366; i++) {
|
|
@@ -2824,21 +2899,21 @@ window.Aura = (() => {
|
|
|
2824
2899
|
return d0;
|
|
2825
2900
|
});
|
|
2826
2901
|
const focusDate = focusState[0], setFocus = focusState[1];
|
|
2827
|
-
const viewState =
|
|
2828
|
-
const hoverState =
|
|
2829
|
-
const gridRef =
|
|
2902
|
+
const viewState = React20.useState("days"), view = viewState[0], setView = viewState[1];
|
|
2903
|
+
const hoverState = React20.useState(null);
|
|
2904
|
+
const gridRef = React20.useRef(null), gridMerged = useMergedRef(ref, gridRef), moved = React20.useRef(false);
|
|
2830
2905
|
const th2 = locale === "th";
|
|
2831
2906
|
const dt = dateText(locale);
|
|
2832
2907
|
function disabled(d) {
|
|
2833
2908
|
return disabledAt(d);
|
|
2834
2909
|
}
|
|
2835
|
-
|
|
2910
|
+
React20.useEffect(function() {
|
|
2836
2911
|
if (!moved.current) return;
|
|
2837
2912
|
moved.current = false;
|
|
2838
2913
|
const el = gridRef.current && gridRef.current.querySelector('[data-date="' + toISO(focusDate) + '"]');
|
|
2839
2914
|
if (el) el.focus();
|
|
2840
2915
|
});
|
|
2841
|
-
|
|
2916
|
+
React20.useEffect(
|
|
2842
2917
|
function() {
|
|
2843
2918
|
if (props.autoFocus === false) return;
|
|
2844
2919
|
const el = gridRef.current && gridRef.current.querySelector('[tabindex="0"]');
|
|
@@ -2893,16 +2968,16 @@ window.Aura = (() => {
|
|
|
2893
2968
|
const yr = focusDate.getFullYear(), base = yr - yr % 12;
|
|
2894
2969
|
const years = [];
|
|
2895
2970
|
for (let y = base; y < base + 12; y++) years.push(y);
|
|
2896
|
-
return /* @__PURE__ */
|
|
2971
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React20.createElement(
|
|
2897
2972
|
IconButton,
|
|
2898
2973
|
{
|
|
2899
|
-
icon: /* @__PURE__ */
|
|
2974
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronLeft, null),
|
|
2900
2975
|
label: dt.prevYears,
|
|
2901
2976
|
onClick: function() {
|
|
2902
2977
|
setFocus(new Date(yr - 12, focusDate.getMonth(), 1));
|
|
2903
2978
|
}
|
|
2904
2979
|
}
|
|
2905
|
-
), /* @__PURE__ */
|
|
2980
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2906
2981
|
"button",
|
|
2907
2982
|
{
|
|
2908
2983
|
type: "button",
|
|
@@ -2912,18 +2987,18 @@ window.Aura = (() => {
|
|
|
2912
2987
|
}
|
|
2913
2988
|
},
|
|
2914
2989
|
fmt(tag, { year: "numeric" }, new Date(base, 0, 1)).replace(ERA, "") + " \u2013 " + fmt(tag, { year: "numeric" }, new Date(base + 11, 0, 1)).replace(ERA, "")
|
|
2915
|
-
), /* @__PURE__ */
|
|
2990
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2916
2991
|
IconButton,
|
|
2917
2992
|
{
|
|
2918
|
-
icon: /* @__PURE__ */
|
|
2993
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronRight, null),
|
|
2919
2994
|
label: dt.nextYears,
|
|
2920
2995
|
onClick: function() {
|
|
2921
2996
|
setFocus(new Date(yr + 12, focusDate.getMonth(), 1));
|
|
2922
2997
|
}
|
|
2923
2998
|
}
|
|
2924
|
-
)), /* @__PURE__ */
|
|
2999
|
+
)), /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__years" }, years.map(function(y) {
|
|
2925
3000
|
const d = new Date(y, focusDate.getMonth(), 1);
|
|
2926
|
-
return /* @__PURE__ */
|
|
3001
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2927
3002
|
"button",
|
|
2928
3003
|
{
|
|
2929
3004
|
key: y,
|
|
@@ -2940,16 +3015,16 @@ window.Aura = (() => {
|
|
|
2940
3015
|
);
|
|
2941
3016
|
})));
|
|
2942
3017
|
}
|
|
2943
|
-
return /* @__PURE__ */
|
|
3018
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React20.createElement(
|
|
2944
3019
|
IconButton,
|
|
2945
3020
|
{
|
|
2946
|
-
icon: /* @__PURE__ */
|
|
3021
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronLeft, null),
|
|
2947
3022
|
label: dt.prevMonth,
|
|
2948
3023
|
onClick: function() {
|
|
2949
3024
|
setFocus(addMonths(focusDate, -1));
|
|
2950
3025
|
}
|
|
2951
3026
|
}
|
|
2952
|
-
), /* @__PURE__ */
|
|
3027
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2953
3028
|
"button",
|
|
2954
3029
|
{
|
|
2955
3030
|
type: "button",
|
|
@@ -2960,19 +3035,19 @@ window.Aura = (() => {
|
|
|
2960
3035
|
}
|
|
2961
3036
|
},
|
|
2962
3037
|
monthTitle,
|
|
2963
|
-
/* @__PURE__ */
|
|
2964
|
-
), /* @__PURE__ */
|
|
3038
|
+
/* @__PURE__ */ React20.createElement(Icon, { name: /* @__PURE__ */ React20.createElement(IconChevronDown, null), size: 14 })
|
|
3039
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2965
3040
|
IconButton,
|
|
2966
3041
|
{
|
|
2967
|
-
icon: /* @__PURE__ */
|
|
3042
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronRight, null),
|
|
2968
3043
|
label: dt.nextMonth,
|
|
2969
3044
|
onClick: function() {
|
|
2970
3045
|
setFocus(addMonths(focusDate, 1));
|
|
2971
3046
|
}
|
|
2972
3047
|
}
|
|
2973
|
-
)), /* @__PURE__ */
|
|
2974
|
-
return /* @__PURE__ */
|
|
2975
|
-
}))), /* @__PURE__ */
|
|
3048
|
+
)), /* @__PURE__ */ React20.createElement("table", { role: "grid", className: "aura-cal__grid", "aria-label": monthTitle }, /* @__PURE__ */ React20.createElement("thead", null, /* @__PURE__ */ React20.createElement("tr", null, weekdayNames.map(function(n3, i) {
|
|
3049
|
+
return /* @__PURE__ */ React20.createElement("th", { key: i, scope: "col", abbr: n3.long }, /* @__PURE__ */ React20.createElement("span", { "aria-hidden": true }, n3.short));
|
|
3050
|
+
}))), /* @__PURE__ */ React20.createElement(
|
|
2976
3051
|
"tbody",
|
|
2977
3052
|
{
|
|
2978
3053
|
onMouseLeave: function() {
|
|
@@ -2980,11 +3055,11 @@ window.Aura = (() => {
|
|
|
2980
3055
|
}
|
|
2981
3056
|
},
|
|
2982
3057
|
weeks.map(function(wk, wi) {
|
|
2983
|
-
return /* @__PURE__ */
|
|
3058
|
+
return /* @__PURE__ */ React20.createElement("tr", { key: wi }, wk.map(function(d) {
|
|
2984
3059
|
const iso = toISO(d), out = d.getMonth() !== focusDate.getMonth(), dis = disabled(d);
|
|
2985
3060
|
const isStart = same(d, start), isEnd = same(d, end) || !end && props.range && same(d, hover) && start;
|
|
2986
3061
|
const sel = isStart || same(d, end);
|
|
2987
|
-
return /* @__PURE__ */
|
|
3062
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2988
3063
|
"td",
|
|
2989
3064
|
{
|
|
2990
3065
|
key: iso,
|
|
@@ -2996,7 +3071,7 @@ window.Aura = (() => {
|
|
|
2996
3071
|
props.range && isEnd && start && "is-range-end"
|
|
2997
3072
|
)
|
|
2998
3073
|
},
|
|
2999
|
-
/* @__PURE__ */
|
|
3074
|
+
/* @__PURE__ */ React20.createElement(
|
|
3000
3075
|
"button",
|
|
3001
3076
|
{
|
|
3002
3077
|
type: "button",
|
|
@@ -3029,7 +3104,7 @@ window.Aura = (() => {
|
|
|
3029
3104
|
);
|
|
3030
3105
|
}));
|
|
3031
3106
|
})
|
|
3032
|
-
)), props.footer === false ? null : /* @__PURE__ */
|
|
3107
|
+
)), props.footer === false ? null : /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__foot" }, /* @__PURE__ */ React20.createElement(
|
|
3033
3108
|
"button",
|
|
3034
3109
|
{
|
|
3035
3110
|
type: "button",
|
|
@@ -3041,11 +3116,11 @@ window.Aura = (() => {
|
|
|
3041
3116
|
}
|
|
3042
3117
|
},
|
|
3043
3118
|
dt.today
|
|
3044
|
-
), props.onClear ? /* @__PURE__ */
|
|
3119
|
+
), props.onClear ? /* @__PURE__ */ React20.createElement("button", { type: "button", className: "aura-cal__link", onClick: props.onClear }, dt.clear) : null));
|
|
3045
3120
|
});
|
|
3046
3121
|
function useCalendarPopover(boxRef) {
|
|
3047
|
-
const openState =
|
|
3048
|
-
const pos =
|
|
3122
|
+
const openState = React20.useState(false), open = openState[0], setOpen = openState[1];
|
|
3123
|
+
const pos = React20.useState(null), popRef = React20.useRef(null), mounted = useMounted();
|
|
3049
3124
|
function place() {
|
|
3050
3125
|
if (!boxRef.current) return;
|
|
3051
3126
|
const el = popRef.current, r = boxRef.current.getBoundingClientRect(), W = el ? el.offsetWidth : 320, H = el ? el.offsetHeight : 380;
|
|
@@ -3059,7 +3134,7 @@ window.Aura = (() => {
|
|
|
3059
3134
|
},
|
|
3060
3135
|
[open, !!pos[0]]
|
|
3061
3136
|
);
|
|
3062
|
-
|
|
3137
|
+
React20.useEffect(
|
|
3063
3138
|
function() {
|
|
3064
3139
|
if (!open) return;
|
|
3065
3140
|
function outside(e) {
|
|
@@ -3081,8 +3156,8 @@ window.Aura = (() => {
|
|
|
3081
3156
|
return { open, setOpen, pos: pos[0], popRef, mounted };
|
|
3082
3157
|
}
|
|
3083
3158
|
function DateField(props) {
|
|
3084
|
-
const editState =
|
|
3085
|
-
return /* @__PURE__ */
|
|
3159
|
+
const editState = React20.useState(null), editing = editState[0], setEditing = editState[1];
|
|
3160
|
+
return /* @__PURE__ */ React20.createElement(
|
|
3086
3161
|
Field,
|
|
3087
3162
|
{
|
|
3088
3163
|
id: props.id,
|
|
@@ -3094,7 +3169,7 @@ window.Aura = (() => {
|
|
|
3094
3169
|
disabled: props.disabled,
|
|
3095
3170
|
className: props.className
|
|
3096
3171
|
},
|
|
3097
|
-
/* @__PURE__ */
|
|
3172
|
+
/* @__PURE__ */ React20.createElement("div", { ref: props.boxRef, className: cx("aura-input aura-date", props.open && "is-open") }, /* @__PURE__ */ React20.createElement(
|
|
3098
3173
|
"input",
|
|
3099
3174
|
{
|
|
3100
3175
|
ref: props.inputRef,
|
|
@@ -3133,7 +3208,7 @@ window.Aura = (() => {
|
|
|
3133
3208
|
}
|
|
3134
3209
|
}
|
|
3135
3210
|
}
|
|
3136
|
-
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */
|
|
3211
|
+
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */ React20.createElement(
|
|
3137
3212
|
"button",
|
|
3138
3213
|
{
|
|
3139
3214
|
type: "button",
|
|
@@ -3142,8 +3217,8 @@ window.Aura = (() => {
|
|
|
3142
3217
|
"aria-label": props.clearLabel,
|
|
3143
3218
|
onClick: props.onClear
|
|
3144
3219
|
},
|
|
3145
|
-
/* @__PURE__ */
|
|
3146
|
-
) : null, /* @__PURE__ */
|
|
3220
|
+
/* @__PURE__ */ React20.createElement(Icon, { name: /* @__PURE__ */ React20.createElement(IconX, null) })
|
|
3221
|
+
) : null, /* @__PURE__ */ React20.createElement(
|
|
3147
3222
|
"button",
|
|
3148
3223
|
{
|
|
3149
3224
|
type: "button",
|
|
@@ -3157,11 +3232,11 @@ window.Aura = (() => {
|
|
|
3157
3232
|
props.onToggle(!props.open);
|
|
3158
3233
|
}
|
|
3159
3234
|
},
|
|
3160
|
-
/* @__PURE__ */
|
|
3235
|
+
/* @__PURE__ */ React20.createElement(Icon, { name: /* @__PURE__ */ React20.createElement(IconCalendar, null) })
|
|
3161
3236
|
))
|
|
3162
3237
|
);
|
|
3163
3238
|
}
|
|
3164
|
-
var DatePicker =
|
|
3239
|
+
var DatePicker = React20.forwardRef(function DatePicker2(props, ref) {
|
|
3165
3240
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
3166
3241
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
3167
3242
|
const st = useMaybeControlled(
|
|
@@ -3169,7 +3244,7 @@ window.Aura = (() => {
|
|
|
3169
3244
|
props.defaultValue == null ? null : props.defaultValue,
|
|
3170
3245
|
props.onChange
|
|
3171
3246
|
);
|
|
3172
|
-
const boxRef =
|
|
3247
|
+
const boxRef = React20.useRef(null), inputRef = React20.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
3173
3248
|
const pop = useCalendarPopover(boxRef);
|
|
3174
3249
|
const limits = {
|
|
3175
3250
|
min: props.min,
|
|
@@ -3178,8 +3253,8 @@ window.Aura = (() => {
|
|
|
3178
3253
|
timeZone: props.timeZone || ctx.timeZone,
|
|
3179
3254
|
isDateDisabled: props.isDateDisabled
|
|
3180
3255
|
};
|
|
3181
|
-
const bad =
|
|
3182
|
-
|
|
3256
|
+
const bad = React20.useState(null);
|
|
3257
|
+
React20.useEffect(
|
|
3183
3258
|
function() {
|
|
3184
3259
|
bad[1](null);
|
|
3185
3260
|
},
|
|
@@ -3201,7 +3276,7 @@ window.Aura = (() => {
|
|
|
3201
3276
|
if (inputRef.current) inputRef.current.focus();
|
|
3202
3277
|
}
|
|
3203
3278
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
3204
|
-
/* @__PURE__ */
|
|
3279
|
+
/* @__PURE__ */ React20.createElement(
|
|
3205
3280
|
"div",
|
|
3206
3281
|
{
|
|
3207
3282
|
ref: pop.popRef,
|
|
@@ -3218,7 +3293,7 @@ window.Aura = (() => {
|
|
|
3218
3293
|
} else trapTab(e, pop.popRef.current);
|
|
3219
3294
|
}
|
|
3220
3295
|
},
|
|
3221
|
-
/* @__PURE__ */
|
|
3296
|
+
/* @__PURE__ */ React20.createElement(
|
|
3222
3297
|
Calendar,
|
|
3223
3298
|
{
|
|
3224
3299
|
locale,
|
|
@@ -3241,7 +3316,7 @@ window.Aura = (() => {
|
|
|
3241
3316
|
),
|
|
3242
3317
|
document.body
|
|
3243
3318
|
) : null;
|
|
3244
|
-
return /* @__PURE__ */
|
|
3319
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
3245
3320
|
DateField,
|
|
3246
3321
|
{
|
|
3247
3322
|
id,
|
|
@@ -3276,7 +3351,7 @@ window.Aura = (() => {
|
|
|
3276
3351
|
}
|
|
3277
3352
|
), cal);
|
|
3278
3353
|
});
|
|
3279
|
-
var DateRangePicker =
|
|
3354
|
+
var DateRangePicker = React20.forwardRef(
|
|
3280
3355
|
function DateRangePicker2(props, ref) {
|
|
3281
3356
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
3282
3357
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
@@ -3286,8 +3361,8 @@ window.Aura = (() => {
|
|
|
3286
3361
|
props.onChange
|
|
3287
3362
|
);
|
|
3288
3363
|
const v = st[0] || { start: null, end: null };
|
|
3289
|
-
const draft =
|
|
3290
|
-
const boxRef =
|
|
3364
|
+
const draft = React20.useState(null);
|
|
3365
|
+
const boxRef = React20.useRef(null), inputRef = React20.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
3291
3366
|
const pop = useCalendarPopover(boxRef);
|
|
3292
3367
|
const limits = {
|
|
3293
3368
|
min: props.min,
|
|
@@ -3302,8 +3377,8 @@ window.Aura = (() => {
|
|
|
3302
3377
|
if (!r.end) return formatDate(r.start, o) + " \u2013";
|
|
3303
3378
|
return formatDate(r.start, o) + " \u2013 " + formatDate(r.end, o);
|
|
3304
3379
|
}
|
|
3305
|
-
const bad =
|
|
3306
|
-
|
|
3380
|
+
const bad = React20.useState(null);
|
|
3381
|
+
React20.useEffect(
|
|
3307
3382
|
function() {
|
|
3308
3383
|
bad[1](null);
|
|
3309
3384
|
},
|
|
@@ -3336,7 +3411,7 @@ window.Aura = (() => {
|
|
|
3336
3411
|
close();
|
|
3337
3412
|
}
|
|
3338
3413
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
3339
|
-
/* @__PURE__ */
|
|
3414
|
+
/* @__PURE__ */ React20.createElement(
|
|
3340
3415
|
"div",
|
|
3341
3416
|
{
|
|
3342
3417
|
ref: pop.popRef,
|
|
@@ -3353,8 +3428,8 @@ window.Aura = (() => {
|
|
|
3353
3428
|
} else trapTab(e, pop.popRef.current);
|
|
3354
3429
|
}
|
|
3355
3430
|
},
|
|
3356
|
-
/* @__PURE__ */
|
|
3357
|
-
/* @__PURE__ */
|
|
3431
|
+
/* @__PURE__ */ React20.createElement("p", { className: "aura-cal__hint", "aria-live": "polite" }, draft[0] ? dt.chooseEnd : dt.chooseStart),
|
|
3432
|
+
/* @__PURE__ */ React20.createElement(
|
|
3358
3433
|
Calendar,
|
|
3359
3434
|
{
|
|
3360
3435
|
range: true,
|
|
@@ -3375,7 +3450,7 @@ window.Aura = (() => {
|
|
|
3375
3450
|
),
|
|
3376
3451
|
document.body
|
|
3377
3452
|
) : null;
|
|
3378
|
-
return /* @__PURE__ */
|
|
3453
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
3379
3454
|
DateField,
|
|
3380
3455
|
{
|
|
3381
3456
|
id,
|
|
@@ -3414,18 +3489,18 @@ window.Aura = (() => {
|
|
|
3414
3489
|
);
|
|
3415
3490
|
|
|
3416
3491
|
// src/Alert.tsx
|
|
3417
|
-
var
|
|
3418
|
-
var Alert =
|
|
3492
|
+
var React21 = __toESM(require_react(), 1);
|
|
3493
|
+
var Alert = React21.forwardRef(function Alert2(props, ref) {
|
|
3419
3494
|
const t = useStrings();
|
|
3420
3495
|
return alertElement(
|
|
3421
3496
|
props,
|
|
3422
3497
|
ref,
|
|
3423
|
-
props.onDismiss ? /* @__PURE__ */
|
|
3498
|
+
props.onDismiss ? /* @__PURE__ */ React21.createElement(IconButton, { icon: /* @__PURE__ */ React21.createElement(IconX, null), label: t.dismiss, className: "aura-alert__close", onClick: props.onDismiss }) : null
|
|
3424
3499
|
);
|
|
3425
3500
|
});
|
|
3426
3501
|
|
|
3427
3502
|
// src/Toaster.tsx
|
|
3428
|
-
var
|
|
3503
|
+
var React22 = __toESM(require_react(), 1);
|
|
3429
3504
|
var import_react_dom5 = __toESM(require_react_dom(), 1);
|
|
3430
3505
|
var MAX_VISIBLE = 3;
|
|
3431
3506
|
var toastState = {
|
|
@@ -3501,8 +3576,8 @@ window.Aura = (() => {
|
|
|
3501
3576
|
function ToastItem(props) {
|
|
3502
3577
|
const str = useStrings();
|
|
3503
3578
|
const Link = useLinkComponent();
|
|
3504
|
-
const node =
|
|
3505
|
-
const origin =
|
|
3579
|
+
const node = React22.useRef(null);
|
|
3580
|
+
const origin = React22.useRef(null);
|
|
3506
3581
|
useIsoLayoutEffect(function() {
|
|
3507
3582
|
origin.current = outsideToaster(document.activeElement);
|
|
3508
3583
|
const el = node.current;
|
|
@@ -3518,8 +3593,8 @@ window.Aura = (() => {
|
|
|
3518
3593
|
}, 0);
|
|
3519
3594
|
};
|
|
3520
3595
|
}, []);
|
|
3521
|
-
const t = props.toast, timer =
|
|
3522
|
-
const hover =
|
|
3596
|
+
const t = props.toast, timer = React22.useRef(null), left = React22.useRef(t.duration || 5e3), since = React22.useRef(0);
|
|
3597
|
+
const hover = React22.useRef(false), focused = React22.useRef(false);
|
|
3523
3598
|
function syncFocus() {
|
|
3524
3599
|
if (focused.current && !(node.current && node.current.contains(document.activeElement))) focused.current = false;
|
|
3525
3600
|
}
|
|
@@ -3541,7 +3616,7 @@ window.Aura = (() => {
|
|
|
3541
3616
|
left.current -= Date.now() - since.current;
|
|
3542
3617
|
}
|
|
3543
3618
|
}
|
|
3544
|
-
|
|
3619
|
+
React22.useEffect(
|
|
3545
3620
|
function() {
|
|
3546
3621
|
if (timer.current) clearTimeout(timer.current);
|
|
3547
3622
|
timer.current = null;
|
|
@@ -3560,7 +3635,7 @@ window.Aura = (() => {
|
|
|
3560
3635
|
if (a.onClick) a.onClick();
|
|
3561
3636
|
if (a.dismiss !== false) toast.dismiss(t.id);
|
|
3562
3637
|
}
|
|
3563
|
-
return /* @__PURE__ */
|
|
3638
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3564
3639
|
"div",
|
|
3565
3640
|
{
|
|
3566
3641
|
ref: node,
|
|
@@ -3597,16 +3672,16 @@ window.Aura = (() => {
|
|
|
3597
3672
|
resume();
|
|
3598
3673
|
}
|
|
3599
3674
|
},
|
|
3600
|
-
/* @__PURE__ */
|
|
3675
|
+
/* @__PURE__ */ React22.createElement(
|
|
3601
3676
|
Icon,
|
|
3602
3677
|
{
|
|
3603
|
-
name: t.loading ? /* @__PURE__ */
|
|
3678
|
+
name: t.loading ? /* @__PURE__ */ React22.createElement(IconLoaderCircle, null) : React22.createElement(ALERT_ICON[t.tone] || IconInfo),
|
|
3604
3679
|
className: cx("aura-toast__icon", t.loading && "aura-spin")
|
|
3605
3680
|
}
|
|
3606
3681
|
),
|
|
3607
|
-
/* @__PURE__ */
|
|
3608
|
-
actions.length ? /* @__PURE__ */
|
|
3609
|
-
return a.href ? /* @__PURE__ */
|
|
3682
|
+
/* @__PURE__ */ React22.createElement("div", { className: "aura-toast__body" }, /* @__PURE__ */ React22.createElement("p", { className: "aura-toast__title" }, t.title), rich ? /* @__PURE__ */ React22.createElement("div", { className: "aura-toast__text" }, t.description) : null),
|
|
3683
|
+
actions.length ? /* @__PURE__ */ React22.createElement("div", { className: "aura-toast__actions" }, actions.map(function(a, i) {
|
|
3684
|
+
return a.href ? /* @__PURE__ */ React22.createElement(
|
|
3610
3685
|
Link,
|
|
3611
3686
|
{
|
|
3612
3687
|
key: i,
|
|
@@ -3618,7 +3693,7 @@ window.Aura = (() => {
|
|
|
3618
3693
|
}
|
|
3619
3694
|
},
|
|
3620
3695
|
a.label
|
|
3621
|
-
) : /* @__PURE__ */
|
|
3696
|
+
) : /* @__PURE__ */ React22.createElement(
|
|
3622
3697
|
"button",
|
|
3623
3698
|
{
|
|
3624
3699
|
key: i,
|
|
@@ -3631,10 +3706,10 @@ window.Aura = (() => {
|
|
|
3631
3706
|
a.label
|
|
3632
3707
|
);
|
|
3633
3708
|
})) : null,
|
|
3634
|
-
/* @__PURE__ */
|
|
3709
|
+
/* @__PURE__ */ React22.createElement(
|
|
3635
3710
|
IconButton,
|
|
3636
3711
|
{
|
|
3637
|
-
icon: /* @__PURE__ */
|
|
3712
|
+
icon: /* @__PURE__ */ React22.createElement(IconX, null),
|
|
3638
3713
|
label: str.dismissToast,
|
|
3639
3714
|
className: "aura-toast__close",
|
|
3640
3715
|
onClick: function() {
|
|
@@ -3662,8 +3737,8 @@ window.Aura = (() => {
|
|
|
3662
3737
|
function Toaster(props = {}) {
|
|
3663
3738
|
const t = useStrings();
|
|
3664
3739
|
const mounted = useMounted();
|
|
3665
|
-
const s =
|
|
3666
|
-
|
|
3740
|
+
const s = React22.useState(toastState.list);
|
|
3741
|
+
React22.useEffect(function() {
|
|
3667
3742
|
toastState.subs.push(s[1]);
|
|
3668
3743
|
s[1](toastState.list.slice());
|
|
3669
3744
|
return function() {
|
|
@@ -3672,9 +3747,9 @@ window.Aura = (() => {
|
|
|
3672
3747
|
});
|
|
3673
3748
|
};
|
|
3674
3749
|
}, []);
|
|
3675
|
-
const region =
|
|
3750
|
+
const region = React22.useRef(null);
|
|
3676
3751
|
const hotkey = props.hotkey === void 0 ? "Alt+T" : props.hotkey;
|
|
3677
|
-
|
|
3752
|
+
React22.useEffect(
|
|
3678
3753
|
function() {
|
|
3679
3754
|
if (!hotkey) return;
|
|
3680
3755
|
const match = hotkeyMatcher(hotkey);
|
|
@@ -3705,7 +3780,7 @@ window.Aura = (() => {
|
|
|
3705
3780
|
const pos = props.position || "bottom";
|
|
3706
3781
|
const offset = props.offset;
|
|
3707
3782
|
return (0, import_react_dom5.createPortal)(
|
|
3708
|
-
/* @__PURE__ */
|
|
3783
|
+
/* @__PURE__ */ React22.createElement(
|
|
3709
3784
|
"div",
|
|
3710
3785
|
{
|
|
3711
3786
|
ref: region,
|
|
@@ -3717,7 +3792,7 @@ window.Aura = (() => {
|
|
|
3717
3792
|
"aria-keyshortcuts": hotkey || void 0
|
|
3718
3793
|
},
|
|
3719
3794
|
s[0].map(function(t2) {
|
|
3720
|
-
return /* @__PURE__ */
|
|
3795
|
+
return /* @__PURE__ */ React22.createElement(ToastItem, { key: t2.id, toast: t2 });
|
|
3721
3796
|
})
|
|
3722
3797
|
),
|
|
3723
3798
|
document.body
|
|
@@ -3725,12 +3800,12 @@ window.Aura = (() => {
|
|
|
3725
3800
|
}
|
|
3726
3801
|
|
|
3727
3802
|
// src/PasswordField.tsx
|
|
3728
|
-
var
|
|
3729
|
-
var PasswordField =
|
|
3803
|
+
var React23 = __toESM(require_react(), 1);
|
|
3804
|
+
var PasswordField = React23.forwardRef(function PasswordField2(props, ref) {
|
|
3730
3805
|
const t = useStrings();
|
|
3731
|
-
const shown =
|
|
3806
|
+
const shown = React23.useState(false);
|
|
3732
3807
|
const rest = omit(props, ["toggle", "className"]);
|
|
3733
|
-
return /* @__PURE__ */
|
|
3808
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3734
3809
|
TextField,
|
|
3735
3810
|
{
|
|
3736
3811
|
autoComplete: "current-password",
|
|
@@ -3740,10 +3815,10 @@ window.Aura = (() => {
|
|
|
3740
3815
|
spellCheck: false,
|
|
3741
3816
|
autoCapitalize: "none",
|
|
3742
3817
|
className: cx("aura-password", props.className),
|
|
3743
|
-
suffix: props.toggle === false ? void 0 : /* @__PURE__ */
|
|
3818
|
+
suffix: props.toggle === false ? void 0 : /* @__PURE__ */ React23.createElement(
|
|
3744
3819
|
IconButton,
|
|
3745
3820
|
{
|
|
3746
|
-
icon: shown[0] ? /* @__PURE__ */
|
|
3821
|
+
icon: shown[0] ? /* @__PURE__ */ React23.createElement(IconEyeOff, null) : /* @__PURE__ */ React23.createElement(IconEye, null),
|
|
3747
3822
|
label: t.showPassword,
|
|
3748
3823
|
"aria-pressed": shown[0],
|
|
3749
3824
|
disabled: props.disabled,
|
|
@@ -3757,7 +3832,7 @@ window.Aura = (() => {
|
|
|
3757
3832
|
});
|
|
3758
3833
|
|
|
3759
3834
|
// src/FormErrorSummary.tsx
|
|
3760
|
-
var
|
|
3835
|
+
var React24 = __toESM(require_react(), 1);
|
|
3761
3836
|
function items(errors) {
|
|
3762
3837
|
if (Array.isArray(errors)) return errors;
|
|
3763
3838
|
const out = [];
|
|
@@ -3786,16 +3861,16 @@ window.Aura = (() => {
|
|
|
3786
3861
|
}
|
|
3787
3862
|
return named;
|
|
3788
3863
|
}
|
|
3789
|
-
var FormErrorSummary =
|
|
3864
|
+
var FormErrorSummary = React24.forwardRef(
|
|
3790
3865
|
function FormErrorSummary2(props, ref) {
|
|
3791
3866
|
const t = useStrings();
|
|
3792
3867
|
const auto = uid(), id = props.id || auto;
|
|
3793
3868
|
const list = items(props.errors);
|
|
3794
|
-
const box =
|
|
3869
|
+
const box = React24.useRef(null);
|
|
3795
3870
|
const keyed = props.focusKey !== void 0;
|
|
3796
|
-
const lastKey =
|
|
3871
|
+
const lastKey = React24.useRef(null), armed = React24.useRef(false), hadErrors = React24.useRef(false);
|
|
3797
3872
|
const has = list.length > 0;
|
|
3798
|
-
|
|
3873
|
+
React24.useEffect(
|
|
3799
3874
|
function() {
|
|
3800
3875
|
const appeared = has && !hadErrors.current;
|
|
3801
3876
|
hadErrors.current = has;
|
|
@@ -3819,7 +3894,7 @@ window.Aura = (() => {
|
|
|
3819
3894
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3820
3895
|
[has, props.focusKey, keyed]
|
|
3821
3896
|
);
|
|
3822
|
-
|
|
3897
|
+
React24.useEffect(
|
|
3823
3898
|
function() {
|
|
3824
3899
|
if (!keyed) return;
|
|
3825
3900
|
function disarm() {
|
|
@@ -3838,7 +3913,7 @@ window.Aura = (() => {
|
|
|
3838
3913
|
[keyed]
|
|
3839
3914
|
);
|
|
3840
3915
|
if (!list.length) return null;
|
|
3841
|
-
return /* @__PURE__ */
|
|
3916
|
+
return /* @__PURE__ */ React24.createElement(
|
|
3842
3917
|
"div",
|
|
3843
3918
|
{
|
|
3844
3919
|
ref: function(el) {
|
|
@@ -3852,9 +3927,9 @@ window.Aura = (() => {
|
|
|
3852
3927
|
"aria-labelledby": id + "-title",
|
|
3853
3928
|
className: cx("aura-alert aura-alert--danger aura-error-summary", props.className)
|
|
3854
3929
|
},
|
|
3855
|
-
/* @__PURE__ */
|
|
3856
|
-
/* @__PURE__ */
|
|
3857
|
-
return /* @__PURE__ */
|
|
3930
|
+
/* @__PURE__ */ React24.createElement(Icon, { name: /* @__PURE__ */ React24.createElement(IconCircleAlert, null), className: "aura-alert__icon" }),
|
|
3931
|
+
/* @__PURE__ */ React24.createElement("div", { className: "aura-alert__body" }, /* @__PURE__ */ React24.createElement("h2", { className: "aura-alert__title", id: id + "-title" }, props.title || t.errorSummary(list.length)), /* @__PURE__ */ React24.createElement("ul", { className: "aura-error-summary__list" }, list.map(function(e) {
|
|
3932
|
+
return /* @__PURE__ */ React24.createElement("li", { key: e.field }, /* @__PURE__ */ React24.createElement(
|
|
3858
3933
|
"a",
|
|
3859
3934
|
{
|
|
3860
3935
|
href: "#" + e.field,
|
|
@@ -3879,30 +3954,30 @@ window.Aura = (() => {
|
|
|
3879
3954
|
);
|
|
3880
3955
|
|
|
3881
3956
|
// src/FilterBar.tsx
|
|
3882
|
-
var
|
|
3957
|
+
var React26 = __toESM(require_react(), 1);
|
|
3883
3958
|
|
|
3884
3959
|
// src/Tag.tsx
|
|
3885
|
-
var
|
|
3886
|
-
function
|
|
3960
|
+
var React25 = __toESM(require_react(), 1);
|
|
3961
|
+
function textOf2(node) {
|
|
3887
3962
|
if (node == null || typeof node === "boolean") return "";
|
|
3888
3963
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
3889
|
-
if (Array.isArray(node)) return node.map(
|
|
3890
|
-
if (
|
|
3964
|
+
if (Array.isArray(node)) return node.map(textOf2).join("");
|
|
3965
|
+
if (React25.isValidElement(node)) {
|
|
3891
3966
|
const p = node.props;
|
|
3892
|
-
return p["aria-hidden"] === true || p["aria-hidden"] === "true" ? "" :
|
|
3967
|
+
return p["aria-hidden"] === true || p["aria-hidden"] === "true" ? "" : textOf2(p.children);
|
|
3893
3968
|
}
|
|
3894
3969
|
return "";
|
|
3895
3970
|
}
|
|
3896
|
-
var Tag =
|
|
3971
|
+
var Tag = React25.forwardRef(function Tag2(props, ref) {
|
|
3897
3972
|
const t = useStrings();
|
|
3898
3973
|
const selectable = props.onClick != null || props.selected != null;
|
|
3899
3974
|
const rest = omit(props, ["onRemove", "selected", "icon", "className", "children", "disabled", "removeLabel"]);
|
|
3900
3975
|
const inner = [
|
|
3901
|
-
props.icon ? /* @__PURE__ */
|
|
3902
|
-
/* @__PURE__ */
|
|
3976
|
+
props.icon ? /* @__PURE__ */ React25.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
|
|
3977
|
+
/* @__PURE__ */ React25.createElement("span", { key: "t", className: "aura-tag__text" }, props.children)
|
|
3903
3978
|
];
|
|
3904
3979
|
if (selectable) {
|
|
3905
|
-
return /* @__PURE__ */
|
|
3980
|
+
return /* @__PURE__ */ React25.createElement(
|
|
3906
3981
|
"button",
|
|
3907
3982
|
{
|
|
3908
3983
|
...rest,
|
|
@@ -3912,17 +3987,17 @@ window.Aura = (() => {
|
|
|
3912
3987
|
disabled: props.disabled,
|
|
3913
3988
|
className: cx("aura-tag is-selectable", props.selected && "is-selected", props.className)
|
|
3914
3989
|
},
|
|
3915
|
-
props.selected ? /* @__PURE__ */
|
|
3990
|
+
props.selected ? /* @__PURE__ */ React25.createElement(Icon, { name: /* @__PURE__ */ React25.createElement(IconCheck, null), size: 14 }) : inner[0],
|
|
3916
3991
|
inner[1]
|
|
3917
3992
|
);
|
|
3918
3993
|
}
|
|
3919
|
-
const name = props.onRemove && !props.removeLabel ?
|
|
3994
|
+
const name = props.onRemove && !props.removeLabel ? textOf2(props.children).replace(/\s+/g, " ").trim() : "";
|
|
3920
3995
|
if (props.onRemove && !props.disabled && !props.removeLabel && !name)
|
|
3921
3996
|
devWarnOnce(
|
|
3922
3997
|
"tag-remove-label",
|
|
3923
3998
|
'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
|
|
3924
3999
|
);
|
|
3925
|
-
return /* @__PURE__ */
|
|
4000
|
+
return /* @__PURE__ */ React25.createElement("span", { ...rest, ref, className: cx("aura-tag", props.disabled && "is-disabled", props.className) }, inner, props.onRemove && !props.disabled ? /* @__PURE__ */ React25.createElement(
|
|
3926
4001
|
"button",
|
|
3927
4002
|
{
|
|
3928
4003
|
type: "button",
|
|
@@ -3930,21 +4005,21 @@ window.Aura = (() => {
|
|
|
3930
4005
|
"aria-label": props.removeLabel || t.remove(name),
|
|
3931
4006
|
onClick: props.onRemove
|
|
3932
4007
|
},
|
|
3933
|
-
/* @__PURE__ */
|
|
4008
|
+
/* @__PURE__ */ React25.createElement(Icon, { name: /* @__PURE__ */ React25.createElement(IconX, null), size: 12 })
|
|
3934
4009
|
) : null);
|
|
3935
4010
|
});
|
|
3936
4011
|
|
|
3937
4012
|
// src/FilterBar.tsx
|
|
3938
|
-
var FilterBar =
|
|
4013
|
+
var FilterBar = React26.forwardRef(function FilterBar2(props, ref) {
|
|
3939
4014
|
const t = useStrings();
|
|
3940
4015
|
const id = uid();
|
|
3941
4016
|
const hasSearch = !!props.onSearchChange;
|
|
3942
|
-
const draft =
|
|
3943
|
-
const timer =
|
|
3944
|
-
const sent =
|
|
3945
|
-
const onChange =
|
|
4017
|
+
const draft = React26.useState(props.search || "");
|
|
4018
|
+
const timer = React26.useRef(null);
|
|
4019
|
+
const sent = React26.useRef(props.search || "");
|
|
4020
|
+
const onChange = React26.useRef(props.onSearchChange);
|
|
3946
4021
|
onChange.current = props.onSearchChange;
|
|
3947
|
-
|
|
4022
|
+
React26.useEffect(
|
|
3948
4023
|
function() {
|
|
3949
4024
|
if ((props.search || "") !== sent.current) {
|
|
3950
4025
|
sent.current = props.search || "";
|
|
@@ -3953,7 +4028,7 @@ window.Aura = (() => {
|
|
|
3953
4028
|
},
|
|
3954
4029
|
[props.search]
|
|
3955
4030
|
);
|
|
3956
|
-
|
|
4031
|
+
React26.useEffect(function() {
|
|
3957
4032
|
return function() {
|
|
3958
4033
|
if (timer.current) clearTimeout(timer.current);
|
|
3959
4034
|
};
|
|
@@ -3978,15 +4053,15 @@ window.Aura = (() => {
|
|
|
3978
4053
|
const filters = props.filters || [];
|
|
3979
4054
|
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
3980
4055
|
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
3981
|
-
return /* @__PURE__ */
|
|
4056
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3982
4057
|
"div",
|
|
3983
4058
|
{
|
|
3984
4059
|
ref,
|
|
3985
4060
|
role: "region",
|
|
3986
4061
|
"aria-label": props.label || t.filters,
|
|
3987
|
-
className: cx("aura-filterbar", props.className)
|
|
4062
|
+
className: cx("aura-filterbar", props.searchGrow && "aura-filterbar--grow", props.className)
|
|
3988
4063
|
},
|
|
3989
|
-
/* @__PURE__ */
|
|
4064
|
+
/* @__PURE__ */ React26.createElement("div", { className: "aura-filterbar__row" }, hasSearch ? /* @__PURE__ */ React26.createElement("div", { className: "aura-input has-icon aura-filterbar__search" }, /* @__PURE__ */ React26.createElement(Icon, { name: /* @__PURE__ */ React26.createElement(IconSearch, null), className: "aura-input__icon" }), /* @__PURE__ */ React26.createElement(
|
|
3990
4065
|
"input",
|
|
3991
4066
|
{
|
|
3992
4067
|
id,
|
|
@@ -4007,10 +4082,10 @@ window.Aura = (() => {
|
|
|
4007
4082
|
}
|
|
4008
4083
|
}
|
|
4009
4084
|
}
|
|
4010
|
-
), draft[0] ? /* @__PURE__ */
|
|
4085
|
+
), draft[0] ? /* @__PURE__ */ React26.createElement(
|
|
4011
4086
|
IconButton,
|
|
4012
4087
|
{
|
|
4013
|
-
icon: /* @__PURE__ */
|
|
4088
|
+
icon: /* @__PURE__ */ React26.createElement(IconX, null),
|
|
4014
4089
|
label: t.clear((props.searchLabel || t.search).toLowerCase()),
|
|
4015
4090
|
className: "aura-filterbar__clear-search",
|
|
4016
4091
|
onClick: function() {
|
|
@@ -4018,10 +4093,10 @@ window.Aura = (() => {
|
|
|
4018
4093
|
send("");
|
|
4019
4094
|
}
|
|
4020
4095
|
}
|
|
4021
|
-
) : null) : null, props.children ? /* @__PURE__ */
|
|
4022
|
-
filters.length || props.onClearAll && anything ? /* @__PURE__ */
|
|
4023
|
-
return /* @__PURE__ */
|
|
4024
|
-
}), props.onClearAll && anything ? /* @__PURE__ */
|
|
4096
|
+
) : null) : null, props.children ? /* @__PURE__ */ React26.createElement("div", { className: "aura-filterbar__controls" }, props.children) : null, /* @__PURE__ */ React26.createElement("span", { className: "aura-filterbar__spacer" }), count != null ? /* @__PURE__ */ React26.createElement("span", { className: "aura-filterbar__count", "aria-live": "polite" }, count) : null, props.actions ? /* @__PURE__ */ React26.createElement("div", { className: "aura-filterbar__actions" }, props.actions) : null),
|
|
4097
|
+
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React26.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
4098
|
+
return /* @__PURE__ */ React26.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
4099
|
+
}), props.onClearAll && anything ? /* @__PURE__ */ React26.createElement(
|
|
4025
4100
|
"button",
|
|
4026
4101
|
{
|
|
4027
4102
|
type: "button",
|
|
@@ -4039,11 +4114,11 @@ window.Aura = (() => {
|
|
|
4039
4114
|
});
|
|
4040
4115
|
|
|
4041
4116
|
// src/Command.tsx
|
|
4042
|
-
var
|
|
4117
|
+
var React28 = __toESM(require_react(), 1);
|
|
4043
4118
|
var import_react_dom6 = __toESM(require_react_dom(), 1);
|
|
4044
4119
|
|
|
4045
4120
|
// src/useModal.tsx
|
|
4046
|
-
var
|
|
4121
|
+
var React27 = __toESM(require_react(), 1);
|
|
4047
4122
|
var locks = 0;
|
|
4048
4123
|
var savedOverflow = "";
|
|
4049
4124
|
function lockScroll() {
|
|
@@ -4070,9 +4145,9 @@ window.Aura = (() => {
|
|
|
4070
4145
|
}
|
|
4071
4146
|
function useModal(open, ref, opts) {
|
|
4072
4147
|
const mounted = useMounted();
|
|
4073
|
-
const prev =
|
|
4148
|
+
const prev = React27.useRef(null);
|
|
4074
4149
|
const o = opts || {};
|
|
4075
|
-
|
|
4150
|
+
React27.useEffect(
|
|
4076
4151
|
function() {
|
|
4077
4152
|
if (!open || !mounted) return;
|
|
4078
4153
|
prev.current = document.activeElement;
|
|
@@ -4130,21 +4205,21 @@ window.Aura = (() => {
|
|
|
4130
4205
|
const t = useStrings();
|
|
4131
4206
|
const density = useDensity();
|
|
4132
4207
|
const id = uid(), listId = id + "-list";
|
|
4133
|
-
const box =
|
|
4134
|
-
const input =
|
|
4135
|
-
const qState =
|
|
4208
|
+
const box = React28.useRef(null);
|
|
4209
|
+
const input = React28.useRef(null);
|
|
4210
|
+
const qState = React28.useState(""), act = React28.useState(null);
|
|
4136
4211
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
4137
4212
|
function setQuery(v) {
|
|
4138
4213
|
if (props.query === void 0) qState[1](v);
|
|
4139
4214
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
4140
4215
|
}
|
|
4141
|
-
const openRef =
|
|
4216
|
+
const openRef = React28.useRef(props.open);
|
|
4142
4217
|
openRef.current = props.open;
|
|
4143
4218
|
const close = function() {
|
|
4144
4219
|
props.onOpenChange(false);
|
|
4145
4220
|
};
|
|
4146
4221
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
4147
|
-
|
|
4222
|
+
React28.useEffect(
|
|
4148
4223
|
function() {
|
|
4149
4224
|
if (props.hotkey === false) return;
|
|
4150
4225
|
function onKey2(e) {
|
|
@@ -4160,7 +4235,7 @@ window.Aura = (() => {
|
|
|
4160
4235
|
},
|
|
4161
4236
|
[props.hotkey, props.onOpenChange]
|
|
4162
4237
|
);
|
|
4163
|
-
|
|
4238
|
+
React28.useEffect(
|
|
4164
4239
|
function() {
|
|
4165
4240
|
if (!props.open) {
|
|
4166
4241
|
if (query) setQuery("");
|
|
@@ -4200,7 +4275,7 @@ window.Aura = (() => {
|
|
|
4200
4275
|
const optId = function(i2) {
|
|
4201
4276
|
return id + "-o" + i2;
|
|
4202
4277
|
};
|
|
4203
|
-
|
|
4278
|
+
React28.useEffect(
|
|
4204
4279
|
function() {
|
|
4205
4280
|
if (!box.current || active < 0) return;
|
|
4206
4281
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -4245,7 +4320,7 @@ window.Aura = (() => {
|
|
|
4245
4320
|
if (!modal.ready) return null;
|
|
4246
4321
|
let i = -1;
|
|
4247
4322
|
return (0, import_react_dom6.createPortal)(
|
|
4248
|
-
/* @__PURE__ */
|
|
4323
|
+
/* @__PURE__ */ React28.createElement(
|
|
4249
4324
|
"div",
|
|
4250
4325
|
{
|
|
4251
4326
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -4255,8 +4330,8 @@ window.Aura = (() => {
|
|
|
4255
4330
|
e.stopPropagation();
|
|
4256
4331
|
}
|
|
4257
4332
|
},
|
|
4258
|
-
/* @__PURE__ */
|
|
4259
|
-
/* @__PURE__ */
|
|
4333
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
4334
|
+
/* @__PURE__ */ React28.createElement(
|
|
4260
4335
|
"div",
|
|
4261
4336
|
{
|
|
4262
4337
|
ref: box,
|
|
@@ -4266,7 +4341,7 @@ window.Aura = (() => {
|
|
|
4266
4341
|
tabIndex: -1,
|
|
4267
4342
|
className: cx("aura-command", props.className)
|
|
4268
4343
|
},
|
|
4269
|
-
/* @__PURE__ */
|
|
4344
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-command__search" }, /* @__PURE__ */ React28.createElement(Icon, { name: /* @__PURE__ */ React28.createElement(IconSearch, null), className: "aura-command__search-icon" }), /* @__PURE__ */ React28.createElement(
|
|
4270
4345
|
"input",
|
|
4271
4346
|
{
|
|
4272
4347
|
ref: input,
|
|
@@ -4289,8 +4364,8 @@ window.Aura = (() => {
|
|
|
4289
4364
|
},
|
|
4290
4365
|
onKeyDown: onKey
|
|
4291
4366
|
}
|
|
4292
|
-
), /* @__PURE__ */
|
|
4293
|
-
/* @__PURE__ */
|
|
4367
|
+
), /* @__PURE__ */ React28.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
4368
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-command__list", "aria-busy": props.loading || void 0 }, props.loading ? /* @__PURE__ */ React28.createElement("div", { className: "aura-command__loading" }, /* @__PURE__ */ React28.createElement(Icon, { name: /* @__PURE__ */ React28.createElement(IconLoaderCircle, null), className: "aura-spin" }), t.searching) : null, !flat2.length ? props.loading ? null : /* @__PURE__ */ React28.createElement("div", { className: "aura-command__empty" }, props.empty != null ? props.empty : props.emptyText || t.noMatches) : /* @__PURE__ */ React28.createElement(
|
|
4294
4369
|
"div",
|
|
4295
4370
|
{
|
|
4296
4371
|
id: listId,
|
|
@@ -4300,7 +4375,7 @@ window.Aura = (() => {
|
|
|
4300
4375
|
},
|
|
4301
4376
|
groups.map(function(g, gi) {
|
|
4302
4377
|
const gid = id + "-g" + gi;
|
|
4303
|
-
return /* @__PURE__ */
|
|
4378
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4304
4379
|
"div",
|
|
4305
4380
|
{
|
|
4306
4381
|
key: g.name || gi,
|
|
@@ -4308,11 +4383,11 @@ window.Aura = (() => {
|
|
|
4308
4383
|
"aria-labelledby": g.name ? gid : void 0,
|
|
4309
4384
|
className: "aura-command__group"
|
|
4310
4385
|
},
|
|
4311
|
-
g.name ? /* @__PURE__ */
|
|
4386
|
+
g.name ? /* @__PURE__ */ React28.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
4312
4387
|
g.items.map(function(it) {
|
|
4313
4388
|
i++;
|
|
4314
4389
|
const n3 = i;
|
|
4315
|
-
return /* @__PURE__ */
|
|
4390
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4316
4391
|
"div",
|
|
4317
4392
|
{
|
|
4318
4393
|
key: it.id,
|
|
@@ -4335,16 +4410,16 @@ window.Aura = (() => {
|
|
|
4335
4410
|
run(it);
|
|
4336
4411
|
}
|
|
4337
4412
|
},
|
|
4338
|
-
it.icon ? /* @__PURE__ */
|
|
4339
|
-
/* @__PURE__ */
|
|
4340
|
-
it.shortcut ? /* @__PURE__ */
|
|
4413
|
+
it.icon ? /* @__PURE__ */ React28.createElement(Icon, { name: it.icon }) : null,
|
|
4414
|
+
/* @__PURE__ */ React28.createElement("span", { className: "aura-command__text" }, /* @__PURE__ */ React28.createElement("span", { className: "aura-command__label" }, it.label), it.description ? /* @__PURE__ */ React28.createElement("span", { className: "aura-command__desc" }, it.description) : null),
|
|
4415
|
+
it.shortcut ? /* @__PURE__ */ React28.createElement("kbd", { className: "aura-command__kbd" }, it.shortcut) : null
|
|
4341
4416
|
);
|
|
4342
4417
|
})
|
|
4343
4418
|
);
|
|
4344
4419
|
})
|
|
4345
4420
|
)),
|
|
4346
|
-
/* @__PURE__ */
|
|
4347
|
-
/* @__PURE__ */
|
|
4421
|
+
/* @__PURE__ */ React28.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !flat2.length ? t.noMatches : props.loading === false && query ? t.results(flat2.length) : ""),
|
|
4422
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-command__foot", "aria-hidden": true }, t.commandHint, /* @__PURE__ */ React28.createElement("span", { className: "aura-command__mod" }, isMac() ? "\u2318K" : "Ctrl K"))
|
|
4348
4423
|
)
|
|
4349
4424
|
),
|
|
4350
4425
|
document.body
|
|
@@ -4352,12 +4427,12 @@ window.Aura = (() => {
|
|
|
4352
4427
|
}
|
|
4353
4428
|
|
|
4354
4429
|
// src/Tooltip.tsx
|
|
4355
|
-
var
|
|
4430
|
+
var React29 = __toESM(require_react(), 1);
|
|
4356
4431
|
var import_react_dom7 = __toESM(require_react_dom(), 1);
|
|
4357
|
-
var Tooltip =
|
|
4358
|
-
const id = uid(), st =
|
|
4359
|
-
const anchor =
|
|
4360
|
-
const pos =
|
|
4432
|
+
var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
4433
|
+
const id = uid(), st = React29.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
4434
|
+
const anchor = React29.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip = React29.useRef(null), timer = React29.useRef(void 0);
|
|
4435
|
+
const pos = React29.useState(null), mounted = useMounted();
|
|
4361
4436
|
function show2(now) {
|
|
4362
4437
|
clearTimeout(timer.current);
|
|
4363
4438
|
timer.current = setTimeout(
|
|
@@ -4377,7 +4452,7 @@ window.Aura = (() => {
|
|
|
4377
4452
|
set(false);
|
|
4378
4453
|
}, 120);
|
|
4379
4454
|
}
|
|
4380
|
-
|
|
4455
|
+
React29.useEffect(function() {
|
|
4381
4456
|
return function() {
|
|
4382
4457
|
clearTimeout(timer.current);
|
|
4383
4458
|
};
|
|
@@ -4421,7 +4496,7 @@ window.Aura = (() => {
|
|
|
4421
4496
|
},
|
|
4422
4497
|
[open, mounted]
|
|
4423
4498
|
);
|
|
4424
|
-
|
|
4499
|
+
React29.useEffect(
|
|
4425
4500
|
function() {
|
|
4426
4501
|
if (!open) return;
|
|
4427
4502
|
function esc(e) {
|
|
@@ -4434,8 +4509,8 @@ window.Aura = (() => {
|
|
|
4434
4509
|
},
|
|
4435
4510
|
[open]
|
|
4436
4511
|
);
|
|
4437
|
-
const child =
|
|
4438
|
-
const trigger = /* @__PURE__ */
|
|
4512
|
+
const child = React29.Children.only(props.children);
|
|
4513
|
+
const trigger = /* @__PURE__ */ React29.createElement(
|
|
4439
4514
|
"span",
|
|
4440
4515
|
{
|
|
4441
4516
|
ref: anchorMerged,
|
|
@@ -4449,10 +4524,10 @@ window.Aura = (() => {
|
|
|
4449
4524
|
},
|
|
4450
4525
|
onBlur: hide
|
|
4451
4526
|
},
|
|
4452
|
-
|
|
4527
|
+
React29.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
4453
4528
|
);
|
|
4454
|
-
return /* @__PURE__ */
|
|
4455
|
-
/* @__PURE__ */
|
|
4529
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, trigger, open && mounted ? (0, import_react_dom7.createPortal)(
|
|
4530
|
+
/* @__PURE__ */ React29.createElement(
|
|
4456
4531
|
"div",
|
|
4457
4532
|
{
|
|
4458
4533
|
ref: tip,
|
|
@@ -4472,12 +4547,12 @@ window.Aura = (() => {
|
|
|
4472
4547
|
});
|
|
4473
4548
|
|
|
4474
4549
|
// src/Dialog.tsx
|
|
4475
|
-
var
|
|
4550
|
+
var React30 = __toESM(require_react(), 1);
|
|
4476
4551
|
var import_react_dom8 = __toESM(require_react_dom(), 1);
|
|
4477
|
-
var Dialog =
|
|
4552
|
+
var Dialog = React30.forwardRef(function Dialog2(props, ref) {
|
|
4478
4553
|
const t = useStrings();
|
|
4479
4554
|
const density = useDensity();
|
|
4480
|
-
const own =
|
|
4555
|
+
const own = React30.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4481
4556
|
function close() {
|
|
4482
4557
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4483
4558
|
}
|
|
@@ -4490,7 +4565,7 @@ window.Aura = (() => {
|
|
|
4490
4565
|
});
|
|
4491
4566
|
if (!modal.ready) return null;
|
|
4492
4567
|
return (0, import_react_dom8.createPortal)(
|
|
4493
|
-
/* @__PURE__ */
|
|
4568
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React30.createElement(
|
|
4494
4569
|
"div",
|
|
4495
4570
|
{
|
|
4496
4571
|
className: "aura-scrim",
|
|
@@ -4500,7 +4575,7 @@ window.Aura = (() => {
|
|
|
4500
4575
|
},
|
|
4501
4576
|
"aria-hidden": true
|
|
4502
4577
|
}
|
|
4503
|
-
), /* @__PURE__ */
|
|
4578
|
+
), /* @__PURE__ */ React30.createElement(
|
|
4504
4579
|
"div",
|
|
4505
4580
|
{
|
|
4506
4581
|
ref: merged,
|
|
@@ -4511,18 +4586,18 @@ window.Aura = (() => {
|
|
|
4511
4586
|
tabIndex: -1,
|
|
4512
4587
|
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
4513
4588
|
},
|
|
4514
|
-
/* @__PURE__ */
|
|
4515
|
-
props.description ? /* @__PURE__ */
|
|
4516
|
-
props.children ? /* @__PURE__ */
|
|
4517
|
-
props.footer ? /* @__PURE__ */
|
|
4589
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__head" }, /* @__PURE__ */ React30.createElement("h2", { className: "aura-dialog__title", id: titleId }, props.title), props.dismissible !== false ? /* @__PURE__ */ React30.createElement(IconButton, { icon: /* @__PURE__ */ React30.createElement(IconX, null), label: t.close, className: "aura-dialog__close", onClick: close }) : null),
|
|
4590
|
+
props.description ? /* @__PURE__ */ React30.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
|
|
4591
|
+
props.children ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__body" }, props.children) : null,
|
|
4592
|
+
props.footer ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null
|
|
4518
4593
|
)),
|
|
4519
4594
|
document.body
|
|
4520
4595
|
);
|
|
4521
4596
|
});
|
|
4522
|
-
var Drawer =
|
|
4597
|
+
var Drawer = React30.forwardRef(function Drawer2(props, ref) {
|
|
4523
4598
|
const t = useStrings();
|
|
4524
4599
|
const density = useDensity();
|
|
4525
|
-
const own =
|
|
4600
|
+
const own = React30.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4526
4601
|
function close() {
|
|
4527
4602
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4528
4603
|
}
|
|
@@ -4555,7 +4630,7 @@ window.Aura = (() => {
|
|
|
4555
4630
|
]);
|
|
4556
4631
|
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
4557
4632
|
return (0, import_react_dom8.createPortal)(
|
|
4558
|
-
/* @__PURE__ */
|
|
4633
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React30.createElement(
|
|
4559
4634
|
"div",
|
|
4560
4635
|
{
|
|
4561
4636
|
className: "aura-scrim",
|
|
@@ -4565,7 +4640,7 @@ window.Aura = (() => {
|
|
|
4565
4640
|
} : void 0,
|
|
4566
4641
|
"aria-hidden": true
|
|
4567
4642
|
}
|
|
4568
|
-
), /* @__PURE__ */
|
|
4643
|
+
), /* @__PURE__ */ React30.createElement(
|
|
4569
4644
|
"div",
|
|
4570
4645
|
{
|
|
4571
4646
|
...rest,
|
|
@@ -4578,11 +4653,11 @@ window.Aura = (() => {
|
|
|
4578
4653
|
tabIndex: -1,
|
|
4579
4654
|
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
4580
4655
|
},
|
|
4581
|
-
props.title || props.dismissible !== false ? /* @__PURE__ */
|
|
4656
|
+
props.title || props.dismissible !== false ? /* @__PURE__ */ React30.createElement("div", { className: "aura-drawer__head" }, props.title ? /* @__PURE__ */ React30.createElement("h2", { className: "aura-drawer__title", id: titleId }, props.title) : /* @__PURE__ */ React30.createElement("span", { style: { flex: 1 } }), props.dismissible !== false ? /* @__PURE__ */ React30.createElement(
|
|
4582
4657
|
IconButton,
|
|
4583
4658
|
{
|
|
4584
4659
|
...props.closeProps,
|
|
4585
|
-
icon: /* @__PURE__ */
|
|
4660
|
+
icon: /* @__PURE__ */ React30.createElement(IconX, null),
|
|
4586
4661
|
label: props.closeLabel || t.close,
|
|
4587
4662
|
onClick: function(e) {
|
|
4588
4663
|
const own2 = props.closeProps && props.closeProps.onClick;
|
|
@@ -4591,16 +4666,16 @@ window.Aura = (() => {
|
|
|
4591
4666
|
}
|
|
4592
4667
|
}
|
|
4593
4668
|
) : null) : null,
|
|
4594
|
-
props.description ? /* @__PURE__ */
|
|
4595
|
-
/* @__PURE__ */
|
|
4596
|
-
props.footer ? /* @__PURE__ */
|
|
4669
|
+
props.description ? /* @__PURE__ */ React30.createElement("p", { className: "aura-drawer__desc", id: descId }, props.description) : null,
|
|
4670
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-drawer__body" }, props.children),
|
|
4671
|
+
props.footer ? /* @__PURE__ */ React30.createElement("div", { className: "aura-drawer__foot" }, props.footer) : null
|
|
4597
4672
|
)),
|
|
4598
4673
|
document.body
|
|
4599
4674
|
);
|
|
4600
4675
|
});
|
|
4601
4676
|
|
|
4602
4677
|
// src/DataTable.tsx
|
|
4603
|
-
var
|
|
4678
|
+
var React31 = __toESM(require_react(), 1);
|
|
4604
4679
|
var import_react_dom9 = __toESM(require_react_dom(), 1);
|
|
4605
4680
|
var BP = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
4606
4681
|
var DEFAULT_COLUMNS = [
|
|
@@ -4623,7 +4698,7 @@ window.Aura = (() => {
|
|
|
4623
4698
|
var ROW_H_DEFAULT = 48;
|
|
4624
4699
|
var OVERSCAN = 8;
|
|
4625
4700
|
var FLEX_MIN = 160;
|
|
4626
|
-
var DataTableImpl =
|
|
4701
|
+
var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
|
|
4627
4702
|
const t = useStrings();
|
|
4628
4703
|
const columns = props.columns || DEFAULT_COLUMNS;
|
|
4629
4704
|
const byKey = {};
|
|
@@ -4662,7 +4737,7 @@ window.Aura = (() => {
|
|
|
4662
4737
|
const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
|
|
4663
4738
|
return rejected[String(k)];
|
|
4664
4739
|
}).join("\0") + "#" + selected.join("\0");
|
|
4665
|
-
|
|
4740
|
+
React31.useEffect(
|
|
4666
4741
|
function() {
|
|
4667
4742
|
if (droppedSig !== "") setSelected(selected);
|
|
4668
4743
|
},
|
|
@@ -4699,19 +4774,19 @@ window.Aura = (() => {
|
|
|
4699
4774
|
}),
|
|
4700
4775
|
props.onPinnedColumnsChange
|
|
4701
4776
|
);
|
|
4702
|
-
const widthState =
|
|
4777
|
+
const widthState = React31.useState({});
|
|
4703
4778
|
const widths = widthState[0], setWidths = widthState[1];
|
|
4704
|
-
const activeState =
|
|
4705
|
-
const scrollState =
|
|
4779
|
+
const activeState = React31.useState({ r: 1, c: 0 });
|
|
4780
|
+
const scrollState = React31.useState(0);
|
|
4706
4781
|
const scrollTop = scrollState[0], setScrollTop = scrollState[1];
|
|
4707
|
-
const scrolledX =
|
|
4708
|
-
const menuState =
|
|
4782
|
+
const scrolledX = React31.useState(false);
|
|
4783
|
+
const menuState = React31.useState(null);
|
|
4709
4784
|
const menu = menuState[0], setMenu = menuState[1];
|
|
4710
|
-
const dragState =
|
|
4785
|
+
const dragState = React31.useState(null);
|
|
4711
4786
|
const drag = dragState[0], setDrag = dragState[1];
|
|
4712
|
-
const gridRef =
|
|
4713
|
-
const wrapRef =
|
|
4714
|
-
const boxWidth =
|
|
4787
|
+
const gridRef = React31.useRef(null);
|
|
4788
|
+
const wrapRef = React31.useRef(null), wrapMerged = useMergedRef(ref, wrapRef);
|
|
4789
|
+
const boxWidth = React31.useState(null);
|
|
4715
4790
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
4716
4791
|
return c.hideBelow != null;
|
|
4717
4792
|
});
|
|
@@ -4721,7 +4796,7 @@ window.Aura = (() => {
|
|
|
4721
4796
|
return px != null && a.indexOf(px) === i;
|
|
4722
4797
|
}).length
|
|
4723
4798
|
);
|
|
4724
|
-
|
|
4799
|
+
React31.useEffect(
|
|
4725
4800
|
function() {
|
|
4726
4801
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
4727
4802
|
const ro = new ResizeObserver(function(en) {
|
|
@@ -4766,8 +4841,8 @@ window.Aura = (() => {
|
|
|
4766
4841
|
const px = hidePx(c);
|
|
4767
4842
|
return px != null && below(boxWidth[0], px);
|
|
4768
4843
|
}
|
|
4769
|
-
const scrollRef =
|
|
4770
|
-
const tipState =
|
|
4844
|
+
const scrollRef = React31.useRef(null);
|
|
4845
|
+
const tipState = React31.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
4771
4846
|
function showFull(e) {
|
|
4772
4847
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
4773
4848
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
@@ -4779,7 +4854,7 @@ window.Aura = (() => {
|
|
|
4779
4854
|
setTip(null);
|
|
4780
4855
|
}
|
|
4781
4856
|
const tipEl = tip && typeof document !== "undefined" ? (0, import_react_dom9.createPortal)(
|
|
4782
|
-
/* @__PURE__ */
|
|
4857
|
+
/* @__PURE__ */ React31.createElement(
|
|
4783
4858
|
"div",
|
|
4784
4859
|
{
|
|
4785
4860
|
className: "aura-tooltip aura-tooltip--above",
|
|
@@ -4790,7 +4865,7 @@ window.Aura = (() => {
|
|
|
4790
4865
|
),
|
|
4791
4866
|
document.body
|
|
4792
4867
|
) : null;
|
|
4793
|
-
const rowH =
|
|
4868
|
+
const rowH = React31.useState(ROW_H_DEFAULT);
|
|
4794
4869
|
const ROW_H = rowH[0];
|
|
4795
4870
|
useIsoLayoutEffect(function() {
|
|
4796
4871
|
const el = wrapRef.current;
|
|
@@ -4798,8 +4873,8 @@ window.Aura = (() => {
|
|
|
4798
4873
|
const v = parseFloat(getComputedStyle(el).getPropertyValue("--aura-table-row-height"));
|
|
4799
4874
|
if (v > 0 && v !== rowH[0]) rowH[1](v);
|
|
4800
4875
|
});
|
|
4801
|
-
const pending =
|
|
4802
|
-
const resizing =
|
|
4876
|
+
const pending = React31.useRef(null);
|
|
4877
|
+
const resizing = React31.useRef(false);
|
|
4803
4878
|
useIsoLayoutEffect(function() {
|
|
4804
4879
|
if (!gridRef.current) return;
|
|
4805
4880
|
const els = gridRef.current.querySelectorAll(
|
|
@@ -4883,7 +4958,7 @@ window.Aura = (() => {
|
|
|
4883
4958
|
return s;
|
|
4884
4959
|
}
|
|
4885
4960
|
const sortCol = sort && sort.key ? byKey[sort.key] : void 0;
|
|
4886
|
-
const view =
|
|
4961
|
+
const view = React31.useMemo(
|
|
4887
4962
|
function() {
|
|
4888
4963
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
4889
4964
|
const col = byKey[sort.key];
|
|
@@ -4925,8 +5000,8 @@ window.Aura = (() => {
|
|
|
4925
5000
|
const pageRows = pageSize && !manual ? view.slice(first, first + pageSize) : view;
|
|
4926
5001
|
const canSortAny = !busy && (manual ? total > 1 : rows.length > 1);
|
|
4927
5002
|
const shownTotal = manual && props.totalRows == null ? first + rows.length : total;
|
|
4928
|
-
const prevCount =
|
|
4929
|
-
|
|
5003
|
+
const prevCount = React31.useRef(pageCount);
|
|
5004
|
+
React31.useEffect(
|
|
4930
5005
|
function() {
|
|
4931
5006
|
if (busy) return;
|
|
4932
5007
|
const before = prevCount.current;
|
|
@@ -4940,9 +5015,9 @@ window.Aura = (() => {
|
|
|
4940
5015
|
[pageState[0], page, busy, pageCount]
|
|
4941
5016
|
);
|
|
4942
5017
|
const linkPaging = !!props.getPageHref && !props.onPageChange && !oneCallback;
|
|
4943
|
-
const prevLink =
|
|
4944
|
-
const jumpState =
|
|
4945
|
-
|
|
5018
|
+
const prevLink = React31.useRef(null), nextLink = React31.useRef(null), jumpLink = React31.useRef(null);
|
|
5019
|
+
const jumpState = React31.useState(null);
|
|
5020
|
+
React31.useEffect(
|
|
4946
5021
|
function() {
|
|
4947
5022
|
if (jumpState[0] == null) return;
|
|
4948
5023
|
if (jumpLink.current) jumpLink.current.click();
|
|
@@ -4993,9 +5068,15 @@ window.Aura = (() => {
|
|
|
4993
5068
|
);
|
|
4994
5069
|
}
|
|
4995
5070
|
function rowLinkWrap(r, content) {
|
|
4996
|
-
return rowHref ? /* @__PURE__ */
|
|
5071
|
+
return rowHref ? /* @__PURE__ */ React31.createElement(Link, { href: rowHref(r), className: "aura-table__row-link" }, content) : content;
|
|
4997
5072
|
}
|
|
4998
5073
|
const height = props.height || 0;
|
|
5074
|
+
const autoRows = props.rowHeight === "auto" && !height;
|
|
5075
|
+
if (props.rowHeight === "auto" && height)
|
|
5076
|
+
devWarnOnce(
|
|
5077
|
+
"table-row-height-auto",
|
|
5078
|
+
'DataTable `rowHeight="auto"` is ignored with `height`: virtualized rows are one fixed height. Drop `height` (and paginate) to let rows grow.'
|
|
5079
|
+
);
|
|
4999
5080
|
const virtual = !!height && !loading && pageRows.length > 0 && !stacked;
|
|
5000
5081
|
const stickyTotal = !!(props.footer && props.stickyFooter && rows.length && !loading);
|
|
5001
5082
|
const bodyH = Math.max(ROW_H, height - ROW_H - (stickyTotal ? ROW_H : 0));
|
|
@@ -5018,7 +5099,7 @@ window.Aura = (() => {
|
|
|
5018
5099
|
if (!activeRendered) return r === 0 && c === ac ? 0 : -1;
|
|
5019
5100
|
return r === ar && c === ac ? 0 : -1;
|
|
5020
5101
|
}
|
|
5021
|
-
|
|
5102
|
+
React31.useEffect(function() {
|
|
5022
5103
|
const p = pending.current;
|
|
5023
5104
|
if (!p || !gridRef.current) return;
|
|
5024
5105
|
let c = p.c;
|
|
@@ -5218,14 +5299,14 @@ window.Aura = (() => {
|
|
|
5218
5299
|
items2.push(
|
|
5219
5300
|
{
|
|
5220
5301
|
label: t.sortAsc,
|
|
5221
|
-
icon: /* @__PURE__ */
|
|
5302
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowUp, null),
|
|
5222
5303
|
onSelect: function() {
|
|
5223
5304
|
applySort({ key: c.key, dir: "asc" });
|
|
5224
5305
|
}
|
|
5225
5306
|
},
|
|
5226
5307
|
{
|
|
5227
5308
|
label: t.sortDesc,
|
|
5228
|
-
icon: /* @__PURE__ */
|
|
5309
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowDown, null),
|
|
5229
5310
|
onSelect: function() {
|
|
5230
5311
|
applySort({ key: c.key, dir: "desc" });
|
|
5231
5312
|
}
|
|
@@ -5235,7 +5316,7 @@ window.Aura = (() => {
|
|
|
5235
5316
|
if (c.width != null)
|
|
5236
5317
|
items2.push({
|
|
5237
5318
|
label: isPinned(c) ? t.unpin : t.pin,
|
|
5238
|
-
icon: isPinned(c) ? /* @__PURE__ */
|
|
5319
|
+
icon: isPinned(c) ? /* @__PURE__ */ React31.createElement(IconPinOff, null) : /* @__PURE__ */ React31.createElement(IconPin, null),
|
|
5239
5320
|
onSelect: function() {
|
|
5240
5321
|
togglePin(c.key);
|
|
5241
5322
|
}
|
|
@@ -5244,7 +5325,7 @@ window.Aura = (() => {
|
|
|
5244
5325
|
items2.push(
|
|
5245
5326
|
{
|
|
5246
5327
|
label: t.moveLeft,
|
|
5247
|
-
icon: /* @__PURE__ */
|
|
5328
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowLeft, null),
|
|
5248
5329
|
disabled: gi <= 0,
|
|
5249
5330
|
onSelect: function() {
|
|
5250
5331
|
moveCol(c.key, -1);
|
|
@@ -5252,7 +5333,7 @@ window.Aura = (() => {
|
|
|
5252
5333
|
},
|
|
5253
5334
|
{
|
|
5254
5335
|
label: t.moveRight,
|
|
5255
|
-
icon: /* @__PURE__ */
|
|
5336
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowRight, null),
|
|
5256
5337
|
disabled: gi >= group.length - 1,
|
|
5257
5338
|
onSelect: function() {
|
|
5258
5339
|
moveCol(c.key, 1);
|
|
@@ -5263,7 +5344,7 @@ window.Aura = (() => {
|
|
|
5263
5344
|
{ separator: true },
|
|
5264
5345
|
{
|
|
5265
5346
|
label: t.hideColumn,
|
|
5266
|
-
icon: /* @__PURE__ */
|
|
5347
|
+
icon: /* @__PURE__ */ React31.createElement(IconEyeOff, null),
|
|
5267
5348
|
disabled: shown.length <= 1,
|
|
5268
5349
|
onSelect: function() {
|
|
5269
5350
|
setHidden(c.key, true);
|
|
@@ -5284,7 +5365,7 @@ window.Aura = (() => {
|
|
|
5284
5365
|
setHidden(k, on);
|
|
5285
5366
|
}
|
|
5286
5367
|
};
|
|
5287
|
-
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */
|
|
5368
|
+
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React31.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
|
|
5288
5369
|
}
|
|
5289
5370
|
function openMenu(kind, key, anchor, rc) {
|
|
5290
5371
|
setMenu({ kind, key, anchor, rc });
|
|
@@ -5360,10 +5441,10 @@ window.Aura = (() => {
|
|
|
5360
5441
|
e.stopPropagation();
|
|
5361
5442
|
}
|
|
5362
5443
|
}
|
|
5363
|
-
const head = [/* @__PURE__ */
|
|
5444
|
+
const head = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5364
5445
|
if (selectable)
|
|
5365
5446
|
head.push(
|
|
5366
|
-
/* @__PURE__ */
|
|
5447
|
+
/* @__PURE__ */ React31.createElement(
|
|
5367
5448
|
"span",
|
|
5368
5449
|
{
|
|
5369
5450
|
key: "__sel",
|
|
@@ -5377,7 +5458,7 @@ window.Aura = (() => {
|
|
|
5377
5458
|
activeState[1]({ r: 0, c: 0 });
|
|
5378
5459
|
}
|
|
5379
5460
|
},
|
|
5380
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5461
|
+
pageKeys.length ? /* @__PURE__ */ React31.createElement(
|
|
5381
5462
|
Checkbox,
|
|
5382
5463
|
{
|
|
5383
5464
|
hideLabel: true,
|
|
@@ -5388,7 +5469,7 @@ window.Aura = (() => {
|
|
|
5388
5469
|
onChange: toggleAll
|
|
5389
5470
|
}
|
|
5390
5471
|
) : null,
|
|
5391
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5472
|
+
pageKeys.length ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__sel-text" }, nSel ? t.selectedCount(nSel) : t.selectAll) : /* @__PURE__ */ React31.createElement("span", { className: "aura-sr-only" }, t.selectRows)
|
|
5392
5473
|
)
|
|
5393
5474
|
);
|
|
5394
5475
|
vis.forEach(function(c, i) {
|
|
@@ -5398,7 +5479,7 @@ window.Aura = (() => {
|
|
|
5398
5479
|
const ariaSort = isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0;
|
|
5399
5480
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
5400
5481
|
head.push(
|
|
5401
|
-
/* @__PURE__ */
|
|
5482
|
+
/* @__PURE__ */ React31.createElement(
|
|
5402
5483
|
"span",
|
|
5403
5484
|
{
|
|
5404
5485
|
key: c.key,
|
|
@@ -5448,7 +5529,7 @@ window.Aura = (() => {
|
|
|
5448
5529
|
setDrag(null);
|
|
5449
5530
|
}
|
|
5450
5531
|
},
|
|
5451
|
-
/* @__PURE__ */
|
|
5532
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React31.createElement(
|
|
5452
5533
|
"button",
|
|
5453
5534
|
{
|
|
5454
5535
|
type: "button",
|
|
@@ -5460,14 +5541,14 @@ window.Aura = (() => {
|
|
|
5460
5541
|
}
|
|
5461
5542
|
},
|
|
5462
5543
|
c.label,
|
|
5463
|
-
/* @__PURE__ */
|
|
5544
|
+
/* @__PURE__ */ React31.createElement(
|
|
5464
5545
|
Icon,
|
|
5465
5546
|
{
|
|
5466
|
-
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */
|
|
5547
|
+
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */ React31.createElement(IconArrowDown, null) : /* @__PURE__ */ React31.createElement(IconArrowUp, null) : /* @__PURE__ */ React31.createElement(IconArrowUpDown, null),
|
|
5467
5548
|
size: 12
|
|
5468
5549
|
}
|
|
5469
5550
|
)
|
|
5470
|
-
) : /* @__PURE__ */
|
|
5551
|
+
) : /* @__PURE__ */ React31.createElement("span", { className: cx("aura-table__th-label", !c.label && "aura-sr-only") }, c.label || (c.actions ? t.actions : c.key)), pin ? /* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconPin, null), size: 12, className: "aura-table__pin-icon", label: t.pinned }) : null, controls ? /* @__PURE__ */ React31.createElement(
|
|
5471
5552
|
"button",
|
|
5472
5553
|
{
|
|
5473
5554
|
type: "button",
|
|
@@ -5481,9 +5562,9 @@ window.Aura = (() => {
|
|
|
5481
5562
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
5482
5563
|
}
|
|
5483
5564
|
},
|
|
5484
|
-
/* @__PURE__ */
|
|
5565
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconEllipsis, null) })
|
|
5485
5566
|
) : null),
|
|
5486
|
-
canResize(c) ? /* @__PURE__ */
|
|
5567
|
+
canResize(c) ? /* @__PURE__ */ React31.createElement(
|
|
5487
5568
|
"span",
|
|
5488
5569
|
{
|
|
5489
5570
|
className: "aura-table__resize",
|
|
@@ -5505,7 +5586,7 @@ window.Aura = (() => {
|
|
|
5505
5586
|
);
|
|
5506
5587
|
});
|
|
5507
5588
|
head.push(
|
|
5508
|
-
/* @__PURE__ */
|
|
5589
|
+
/* @__PURE__ */ React31.createElement(
|
|
5509
5590
|
"span",
|
|
5510
5591
|
{
|
|
5511
5592
|
key: "__gr",
|
|
@@ -5516,14 +5597,15 @@ window.Aura = (() => {
|
|
|
5516
5597
|
);
|
|
5517
5598
|
function cellContent(c, r) {
|
|
5518
5599
|
const v = r[c.key];
|
|
5519
|
-
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */
|
|
5600
|
+
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */ React31.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
5520
5601
|
}
|
|
5521
5602
|
function rowCells(r, i, k, isSel) {
|
|
5522
5603
|
const ri = i + 1;
|
|
5523
|
-
const
|
|
5604
|
+
const selLabel = selectable && canSelect(r) ? props.rowSelectLabel && props.rowSelectLabel(r) || t.selectRow(k) : void 0;
|
|
5605
|
+
const cells = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5524
5606
|
if (selectable)
|
|
5525
5607
|
cells.push(
|
|
5526
|
-
/* @__PURE__ */
|
|
5608
|
+
/* @__PURE__ */ React31.createElement(
|
|
5527
5609
|
"span",
|
|
5528
5610
|
{
|
|
5529
5611
|
key: "__sel",
|
|
@@ -5532,18 +5614,18 @@ window.Aura = (() => {
|
|
|
5532
5614
|
className: cx("aura-table__sel", nPinned && "is-pinned"),
|
|
5533
5615
|
tabIndex: tabFor(ri, 0),
|
|
5534
5616
|
"data-rc": ri + ":0",
|
|
5535
|
-
"aria-label": canSelect(r) ?
|
|
5617
|
+
"aria-label": canSelect(r) ? selLabel : props.rowSelectDisabledLabel ? props.rowSelectDisabledLabel(r) : void 0,
|
|
5536
5618
|
onFocus: function(e) {
|
|
5537
5619
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
5538
5620
|
}
|
|
5539
5621
|
},
|
|
5540
|
-
canSelect(r) ? /* @__PURE__ */
|
|
5622
|
+
canSelect(r) ? /* @__PURE__ */ React31.createElement(
|
|
5541
5623
|
Checkbox,
|
|
5542
5624
|
{
|
|
5543
5625
|
hideLabel: true,
|
|
5544
5626
|
checked: isSel,
|
|
5545
5627
|
tabIndex: -1,
|
|
5546
|
-
label:
|
|
5628
|
+
label: selLabel,
|
|
5547
5629
|
onChange: function(on) {
|
|
5548
5630
|
toggle(k, on);
|
|
5549
5631
|
}
|
|
@@ -5554,7 +5636,7 @@ window.Aura = (() => {
|
|
|
5554
5636
|
vis.forEach(function(c, j) {
|
|
5555
5637
|
const ci = j + (selectable ? 1 : 0), v = r[c.key], pin = isPinned(c);
|
|
5556
5638
|
cells.push(
|
|
5557
|
-
/* @__PURE__ */
|
|
5639
|
+
/* @__PURE__ */ React31.createElement(
|
|
5558
5640
|
"span",
|
|
5559
5641
|
{
|
|
5560
5642
|
key: c.key,
|
|
@@ -5564,6 +5646,7 @@ window.Aura = (() => {
|
|
|
5564
5646
|
"data-rc": ri + ":" + ci,
|
|
5565
5647
|
className: cx(
|
|
5566
5648
|
"aura-table__td",
|
|
5649
|
+
autoRows && "aura-table__td--auto",
|
|
5567
5650
|
c.mono && "aura-table__mono",
|
|
5568
5651
|
c.align === "end" && "is-end",
|
|
5569
5652
|
pin && "is-pinned",
|
|
@@ -5575,13 +5658,13 @@ window.Aura = (() => {
|
|
|
5575
5658
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
5576
5659
|
}
|
|
5577
5660
|
},
|
|
5578
|
-
j === 0 ? rowLinkWrap(r, cellContent(c, r)) : cellContent(c, r)
|
|
5661
|
+
autoRows ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__cell" }, j === 0 ? rowLinkWrap(r, cellContent(c, r)) : cellContent(c, r)) : j === 0 ? rowLinkWrap(r, cellContent(c, r)) : cellContent(c, r)
|
|
5579
5662
|
)
|
|
5580
5663
|
);
|
|
5581
5664
|
});
|
|
5582
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
5665
|
+
if (hasFields) cells.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
5583
5666
|
cells.push(
|
|
5584
|
-
/* @__PURE__ */
|
|
5667
|
+
/* @__PURE__ */ React31.createElement(
|
|
5585
5668
|
"span",
|
|
5586
5669
|
{
|
|
5587
5670
|
key: "__gr",
|
|
@@ -5598,14 +5681,14 @@ window.Aura = (() => {
|
|
|
5598
5681
|
const n3 = pageSize || props.skeletonRows || 5;
|
|
5599
5682
|
const skRows = body = [];
|
|
5600
5683
|
for (let i = 0; i < n3; i++) {
|
|
5601
|
-
const sk = [/* @__PURE__ */
|
|
5684
|
+
const sk = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
5602
5685
|
if (selectable)
|
|
5603
5686
|
sk.push(
|
|
5604
|
-
/* @__PURE__ */
|
|
5687
|
+
/* @__PURE__ */ React31.createElement("span", { key: "__sel", className: cx("aura-table__sel", nPinned && "is-pinned") }, /* @__PURE__ */ React31.createElement("span", { className: "aura-skel aura-skel--box" }))
|
|
5605
5688
|
);
|
|
5606
5689
|
vis.forEach(function(c, j) {
|
|
5607
5690
|
sk.push(
|
|
5608
|
-
/* @__PURE__ */
|
|
5691
|
+
/* @__PURE__ */ React31.createElement(
|
|
5609
5692
|
"span",
|
|
5610
5693
|
{
|
|
5611
5694
|
key: c.key,
|
|
@@ -5614,7 +5697,7 @@ window.Aura = (() => {
|
|
|
5614
5697
|
...cardAttrs(c, j),
|
|
5615
5698
|
"data-label": void 0
|
|
5616
5699
|
},
|
|
5617
|
-
/* @__PURE__ */
|
|
5700
|
+
/* @__PURE__ */ React31.createElement(
|
|
5618
5701
|
"span",
|
|
5619
5702
|
{
|
|
5620
5703
|
className: cx("aura-skel", c.pill && "aura-skel--pill"),
|
|
@@ -5624,28 +5707,28 @@ window.Aura = (() => {
|
|
|
5624
5707
|
)
|
|
5625
5708
|
);
|
|
5626
5709
|
});
|
|
5627
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
5710
|
+
if (hasFields) sk.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
5628
5711
|
sk.push(
|
|
5629
|
-
/* @__PURE__ */
|
|
5712
|
+
/* @__PURE__ */ React31.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
5630
5713
|
);
|
|
5631
5714
|
skRows.push(
|
|
5632
|
-
/* @__PURE__ */
|
|
5715
|
+
/* @__PURE__ */ React31.createElement("div", { key: "sk" + i, className: "aura-table__row aura-table__row--skeleton", "aria-hidden": true, style: rowStyle }, sk)
|
|
5633
5716
|
);
|
|
5634
5717
|
}
|
|
5635
5718
|
} else if (!rows.length) {
|
|
5636
5719
|
const em = props.empty || {};
|
|
5637
|
-
body = /* @__PURE__ */
|
|
5720
|
+
body = /* @__PURE__ */ React31.createElement("div", { className: "aura-table__empty", role: "row" }, /* @__PURE__ */ React31.createElement("div", { role: "gridcell" }, /* @__PURE__ */ React31.createElement("span", { className: "aura-table__empty-icon" }, /* @__PURE__ */ React31.createElement(Icon, { name: em.icon || /* @__PURE__ */ React31.createElement(IconInbox, null), size: "lg" })), /* @__PURE__ */ React31.createElement("p", { className: "aura-table__empty-title" }, em.title || t.empty), em.description ? /* @__PURE__ */ React31.createElement("p", { className: "aura-table__empty-text" }, em.description) : null, em.action ? /* @__PURE__ */ React31.createElement("div", { className: "aura-table__empty-action" }, em.action) : null));
|
|
5638
5721
|
} else {
|
|
5639
5722
|
const bodyRows = body = [];
|
|
5640
5723
|
if (virtual && start > 0)
|
|
5641
5724
|
bodyRows.push(
|
|
5642
|
-
/* @__PURE__ */
|
|
5725
|
+
/* @__PURE__ */ React31.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
5643
5726
|
);
|
|
5644
5727
|
for (let ri = start; ri < end; ri++) {
|
|
5645
5728
|
(function(r, i) {
|
|
5646
5729
|
const k = r[rowKey], isSel = !!selSet[k];
|
|
5647
5730
|
bodyRows.push(
|
|
5648
|
-
/* @__PURE__ */
|
|
5731
|
+
/* @__PURE__ */ React31.createElement(
|
|
5649
5732
|
"div",
|
|
5650
5733
|
{
|
|
5651
5734
|
key: k,
|
|
@@ -5654,6 +5737,7 @@ window.Aura = (() => {
|
|
|
5654
5737
|
"aria-selected": selectable && canSelect(r) ? isSel : void 0,
|
|
5655
5738
|
className: cx(
|
|
5656
5739
|
"aura-table__row",
|
|
5740
|
+
autoRows && "aura-table__row--auto",
|
|
5657
5741
|
isSel && "is-selected",
|
|
5658
5742
|
(props.onRowActivate || rowHref) && "is-actionable"
|
|
5659
5743
|
),
|
|
@@ -5672,7 +5756,7 @@ window.Aura = (() => {
|
|
|
5672
5756
|
}
|
|
5673
5757
|
if (virtual && end < pageRows.length)
|
|
5674
5758
|
bodyRows.push(
|
|
5675
|
-
/* @__PURE__ */
|
|
5759
|
+
/* @__PURE__ */ React31.createElement(
|
|
5676
5760
|
"div",
|
|
5677
5761
|
{
|
|
5678
5762
|
key: "__bot",
|
|
@@ -5685,9 +5769,9 @@ window.Aura = (() => {
|
|
|
5685
5769
|
}
|
|
5686
5770
|
let foot = null;
|
|
5687
5771
|
function pagerButton(dir) {
|
|
5688
|
-
const p = page + dir, off = busy || (dir < 0 ? page <= 1 : page >= pageCount), label = dir < 0 ? t.prevPage : t.nextPage, icon = dir < 0 ? /* @__PURE__ */
|
|
5772
|
+
const p = page + dir, off = busy || (dir < 0 ? page <= 1 : page >= pageCount), label = dir < 0 ? t.prevPage : t.nextPage, icon = dir < 0 ? /* @__PURE__ */ React31.createElement(IconChevronLeft, null) : /* @__PURE__ */ React31.createElement(IconChevronRight, null);
|
|
5689
5773
|
if (props.getPageHref && !off)
|
|
5690
|
-
return /* @__PURE__ */
|
|
5774
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5691
5775
|
Link,
|
|
5692
5776
|
{
|
|
5693
5777
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -5702,9 +5786,9 @@ window.Aura = (() => {
|
|
|
5702
5786
|
}
|
|
5703
5787
|
}
|
|
5704
5788
|
},
|
|
5705
|
-
/* @__PURE__ */
|
|
5789
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: icon })
|
|
5706
5790
|
);
|
|
5707
|
-
return /* @__PURE__ */
|
|
5791
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5708
5792
|
IconButton,
|
|
5709
5793
|
{
|
|
5710
5794
|
icon,
|
|
@@ -5719,11 +5803,11 @@ window.Aura = (() => {
|
|
|
5719
5803
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
5720
5804
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
5721
5805
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
5722
|
-
foot = /* @__PURE__ */
|
|
5806
|
+
foot = /* @__PURE__ */ React31.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React31.createElement("span", { "aria-live": "polite" }, busy ? t.loading : openTotal ? t.rangeOpen(from, to) : t.range(from, to, shownTotal)), /* @__PURE__ */ React31.createElement("span", { className: "aura-table__pager" }, /* @__PURE__ */ React31.createElement("span", null, openTotal ? t.pageOpen(page) : t.page(page, pageCount)), pagerButton(-1), pagerButton(1)));
|
|
5723
5807
|
} else if (height && rows.length && !loading) {
|
|
5724
|
-
foot = /* @__PURE__ */
|
|
5808
|
+
foot = /* @__PURE__ */ React31.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React31.createElement("span", null, t.rowCount(shownTotal)), selectable && selected.length ? /* @__PURE__ */ React31.createElement("span", null, t.selectedCount(selected.length)) : /* @__PURE__ */ React31.createElement("span", null));
|
|
5725
5809
|
}
|
|
5726
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
5810
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React31.createElement(
|
|
5727
5811
|
"div",
|
|
5728
5812
|
{
|
|
5729
5813
|
role: "row",
|
|
@@ -5732,8 +5816,8 @@ window.Aura = (() => {
|
|
|
5732
5816
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
5733
5817
|
style: rowStyle
|
|
5734
5818
|
},
|
|
5735
|
-
/* @__PURE__ */
|
|
5736
|
-
selectable ? /* @__PURE__ */
|
|
5819
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
5820
|
+
selectable ? /* @__PURE__ */ React31.createElement(
|
|
5737
5821
|
"span",
|
|
5738
5822
|
{
|
|
5739
5823
|
role: "gridcell",
|
|
@@ -5748,7 +5832,7 @@ window.Aura = (() => {
|
|
|
5748
5832
|
) : null,
|
|
5749
5833
|
vis.map(function(c, j) {
|
|
5750
5834
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
5751
|
-
return /* @__PURE__ */
|
|
5835
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5752
5836
|
"span",
|
|
5753
5837
|
{
|
|
5754
5838
|
key: c.key,
|
|
@@ -5774,8 +5858,8 @@ window.Aura = (() => {
|
|
|
5774
5858
|
props.footer[c.key]
|
|
5775
5859
|
);
|
|
5776
5860
|
}),
|
|
5777
|
-
hasFields ? /* @__PURE__ */
|
|
5778
|
-
/* @__PURE__ */
|
|
5861
|
+
hasFields ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
5862
|
+
/* @__PURE__ */ React31.createElement(
|
|
5779
5863
|
"span",
|
|
5780
5864
|
{
|
|
5781
5865
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -5789,7 +5873,7 @@ window.Aura = (() => {
|
|
|
5789
5873
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
5790
5874
|
};
|
|
5791
5875
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
5792
|
-
const gridEl = /* @__PURE__ */
|
|
5876
|
+
const gridEl = /* @__PURE__ */ React31.createElement(
|
|
5793
5877
|
"div",
|
|
5794
5878
|
{
|
|
5795
5879
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -5803,8 +5887,8 @@ window.Aura = (() => {
|
|
|
5803
5887
|
),
|
|
5804
5888
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
5805
5889
|
},
|
|
5806
|
-
refreshing ? /* @__PURE__ */
|
|
5807
|
-
/* @__PURE__ */
|
|
5890
|
+
refreshing ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
5891
|
+
/* @__PURE__ */ React31.createElement(
|
|
5808
5892
|
"div",
|
|
5809
5893
|
{
|
|
5810
5894
|
ref: function(el) {
|
|
@@ -5833,7 +5917,7 @@ window.Aura = (() => {
|
|
|
5833
5917
|
if (sx !== scrolledX[0]) scrolledX[1](sx);
|
|
5834
5918
|
}
|
|
5835
5919
|
},
|
|
5836
|
-
/* @__PURE__ */
|
|
5920
|
+
/* @__PURE__ */ React31.createElement(
|
|
5837
5921
|
"div",
|
|
5838
5922
|
{
|
|
5839
5923
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -5846,11 +5930,11 @@ window.Aura = (() => {
|
|
|
5846
5930
|
body,
|
|
5847
5931
|
totalRow
|
|
5848
5932
|
),
|
|
5849
|
-
busy ? /* @__PURE__ */
|
|
5850
|
-
controls ? /* @__PURE__ */
|
|
5933
|
+
busy ? /* @__PURE__ */ React31.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null,
|
|
5934
|
+
controls ? /* @__PURE__ */ React31.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React31.createElement(
|
|
5851
5935
|
IconButton,
|
|
5852
5936
|
{
|
|
5853
|
-
icon: /* @__PURE__ */
|
|
5937
|
+
icon: /* @__PURE__ */ React31.createElement(IconColumns3, null),
|
|
5854
5938
|
label: t.showHideColumns,
|
|
5855
5939
|
"aria-haspopup": "menu",
|
|
5856
5940
|
onClick: function(e) {
|
|
@@ -5859,7 +5943,7 @@ window.Aura = (() => {
|
|
|
5859
5943
|
}
|
|
5860
5944
|
)) : null,
|
|
5861
5945
|
foot,
|
|
5862
|
-
menu ? /* @__PURE__ */
|
|
5946
|
+
menu ? /* @__PURE__ */ React31.createElement(
|
|
5863
5947
|
Menu,
|
|
5864
5948
|
{
|
|
5865
5949
|
anchor: menu.anchor,
|
|
@@ -5869,13 +5953,13 @@ window.Aura = (() => {
|
|
|
5869
5953
|
}
|
|
5870
5954
|
) : null,
|
|
5871
5955
|
tipEl,
|
|
5872
|
-
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */
|
|
5956
|
+
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */ React31.createElement(Link, { ref: jumpLink, href: props.getPageHref(jumpState[0]), hidden: true, tabIndex: -1, "aria-hidden": true }) : null
|
|
5873
5957
|
);
|
|
5874
5958
|
if (!levels.length) return gridEl;
|
|
5875
5959
|
let out = gridEl;
|
|
5876
5960
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
5877
5961
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
5878
|
-
out = /* @__PURE__ */
|
|
5962
|
+
out = /* @__PURE__ */ React31.createElement(
|
|
5879
5963
|
"div",
|
|
5880
5964
|
{
|
|
5881
5965
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -5884,19 +5968,19 @@ window.Aura = (() => {
|
|
|
5884
5968
|
out
|
|
5885
5969
|
);
|
|
5886
5970
|
}
|
|
5887
|
-
return /* @__PURE__ */
|
|
5971
|
+
return /* @__PURE__ */ React31.createElement("div", { ref, className: cx("aura-table-box", props.className) }, out);
|
|
5888
5972
|
});
|
|
5889
5973
|
var DataTable2 = DataTableImpl;
|
|
5890
5974
|
|
|
5891
5975
|
// src/Card.tsx
|
|
5892
|
-
var
|
|
5893
|
-
var Card =
|
|
5976
|
+
var React32 = __toESM(require_react(), 1);
|
|
5977
|
+
var Card = React32.forwardRef(function Card2(props, ref) {
|
|
5894
5978
|
return cardElement(props, ref);
|
|
5895
5979
|
});
|
|
5896
5980
|
|
|
5897
5981
|
// src/Tabs.tsx
|
|
5898
|
-
var
|
|
5899
|
-
var Tabs =
|
|
5982
|
+
var React33 = __toESM(require_react(), 1);
|
|
5983
|
+
var Tabs = React33.forwardRef(function Tabs2(props, ref) {
|
|
5900
5984
|
const items2 = props.tabs || [], base = uid();
|
|
5901
5985
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
5902
5986
|
return !!t.href;
|
|
@@ -5910,7 +5994,7 @@ window.Aura = (() => {
|
|
|
5910
5994
|
props.onChange
|
|
5911
5995
|
);
|
|
5912
5996
|
const cur = asLinks && "value" in props ? props.value : st[0];
|
|
5913
|
-
const refs =
|
|
5997
|
+
const refs = React33.useRef({});
|
|
5914
5998
|
const current2 = items2.filter(function(t) {
|
|
5915
5999
|
return t.id === cur;
|
|
5916
6000
|
})[0] || firstOn || items2[0];
|
|
@@ -5922,7 +6006,7 @@ window.Aura = (() => {
|
|
|
5922
6006
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
5923
6007
|
};
|
|
5924
6008
|
const rootCls = cx("aura-tabs", seg && "aura-tabs--segmented");
|
|
5925
|
-
const [focusId, setFocusId] =
|
|
6009
|
+
const [focusId, setFocusId] = React33.useState(null);
|
|
5926
6010
|
items2.forEach(function(t) {
|
|
5927
6011
|
const al = t.tabProps && t.tabProps["aria-label"];
|
|
5928
6012
|
if (al && al.toLowerCase().indexOf(String(t.label).toLowerCase()) !== 0)
|
|
@@ -5932,19 +6016,19 @@ window.Aura = (() => {
|
|
|
5932
6016
|
);
|
|
5933
6017
|
});
|
|
5934
6018
|
if (asLinks)
|
|
5935
|
-
return /* @__PURE__ */
|
|
6019
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5936
6020
|
"nav",
|
|
5937
6021
|
{
|
|
5938
6022
|
ref,
|
|
5939
6023
|
"aria-label": props.label,
|
|
5940
6024
|
className: cx(rootCls, "aura-tabs--links", props.className)
|
|
5941
6025
|
},
|
|
5942
|
-
/* @__PURE__ */
|
|
6026
|
+
/* @__PURE__ */ React33.createElement("div", { className: listCls }, items2.map(function(t) {
|
|
5943
6027
|
const on = t.id === cur;
|
|
5944
6028
|
const inner = [
|
|
5945
|
-
t.icon ? /* @__PURE__ */
|
|
6029
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
5946
6030
|
t.label,
|
|
5947
|
-
t.count != null ? /* @__PURE__ */
|
|
6031
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
5948
6032
|
];
|
|
5949
6033
|
const own = omit(t.tabProps || {}, [
|
|
5950
6034
|
"type",
|
|
@@ -5958,7 +6042,7 @@ window.Aura = (() => {
|
|
|
5958
6042
|
"name",
|
|
5959
6043
|
"value"
|
|
5960
6044
|
]);
|
|
5961
|
-
return t.disabled ? /* @__PURE__ */
|
|
6045
|
+
return t.disabled ? /* @__PURE__ */ React33.createElement(
|
|
5962
6046
|
"span",
|
|
5963
6047
|
{
|
|
5964
6048
|
...omit(own, ["onClick"]),
|
|
@@ -5967,7 +6051,7 @@ window.Aura = (() => {
|
|
|
5967
6051
|
"aria-disabled": true
|
|
5968
6052
|
},
|
|
5969
6053
|
inner
|
|
5970
|
-
) : /* @__PURE__ */
|
|
6054
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
5971
6055
|
Link,
|
|
5972
6056
|
{
|
|
5973
6057
|
...own,
|
|
@@ -5997,7 +6081,7 @@ window.Aura = (() => {
|
|
|
5997
6081
|
const stop = manual && focusId && items2.filter(function(t) {
|
|
5998
6082
|
return t.id === focusId && !t.disabled;
|
|
5999
6083
|
})[0] || current2;
|
|
6000
|
-
return /* @__PURE__ */
|
|
6084
|
+
return /* @__PURE__ */ React33.createElement("div", { ref, className: cx(rootCls, props.className) }, /* @__PURE__ */ React33.createElement(
|
|
6001
6085
|
"div",
|
|
6002
6086
|
{
|
|
6003
6087
|
role: "tablist",
|
|
@@ -6030,7 +6114,7 @@ window.Aura = (() => {
|
|
|
6030
6114
|
items2.map(function(t) {
|
|
6031
6115
|
const on = current2 && t.id === current2.id;
|
|
6032
6116
|
const own = t.tabProps || {};
|
|
6033
|
-
return /* @__PURE__ */
|
|
6117
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6034
6118
|
"button",
|
|
6035
6119
|
{
|
|
6036
6120
|
...own,
|
|
@@ -6057,9 +6141,9 @@ window.Aura = (() => {
|
|
|
6057
6141
|
st[1](t.id);
|
|
6058
6142
|
}
|
|
6059
6143
|
},
|
|
6060
|
-
t.icon ? /* @__PURE__ */
|
|
6144
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { name: t.icon }) : null,
|
|
6061
6145
|
t.label,
|
|
6062
|
-
t.count != null ? /* @__PURE__ */
|
|
6146
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
6063
6147
|
);
|
|
6064
6148
|
})
|
|
6065
6149
|
), props.keepMounted ? (
|
|
@@ -6067,7 +6151,7 @@ window.Aura = (() => {
|
|
|
6067
6151
|
items2.map(function(t) {
|
|
6068
6152
|
if (t.content === void 0) return null;
|
|
6069
6153
|
const on = current2 && t.id === current2.id;
|
|
6070
|
-
return /* @__PURE__ */
|
|
6154
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6071
6155
|
"div",
|
|
6072
6156
|
{
|
|
6073
6157
|
key: t.id,
|
|
@@ -6081,7 +6165,7 @@ window.Aura = (() => {
|
|
|
6081
6165
|
t.content
|
|
6082
6166
|
);
|
|
6083
6167
|
})
|
|
6084
|
-
) : current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
6168
|
+
) : current2 && current2.content !== void 0 ? /* @__PURE__ */ React33.createElement(
|
|
6085
6169
|
"div",
|
|
6086
6170
|
{
|
|
6087
6171
|
role: "tabpanel",
|
|
@@ -6095,14 +6179,14 @@ window.Aura = (() => {
|
|
|
6095
6179
|
});
|
|
6096
6180
|
|
|
6097
6181
|
// src/SideNav.tsx
|
|
6098
|
-
var
|
|
6182
|
+
var React34 = __toESM(require_react(), 1);
|
|
6099
6183
|
var import_react_dom10 = __toESM(require_react_dom(), 1);
|
|
6100
6184
|
function contains(it, id) {
|
|
6101
6185
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
6102
6186
|
return c.id === id || contains(c, id);
|
|
6103
6187
|
});
|
|
6104
6188
|
}
|
|
6105
|
-
var SideNav =
|
|
6189
|
+
var SideNav = React34.forwardRef(function SideNav2(props, ref) {
|
|
6106
6190
|
const t = useStrings();
|
|
6107
6191
|
const Link = useLinkComponent(props.linkComponent);
|
|
6108
6192
|
const base = uid();
|
|
@@ -6114,14 +6198,14 @@ window.Aura = (() => {
|
|
|
6114
6198
|
const active = st[0];
|
|
6115
6199
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
6116
6200
|
const collapsed = col[0];
|
|
6117
|
-
const tipState =
|
|
6118
|
-
|
|
6201
|
+
const tipState = React34.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
6202
|
+
React34.useEffect(
|
|
6119
6203
|
function() {
|
|
6120
6204
|
if (!collapsed) setTip(null);
|
|
6121
6205
|
},
|
|
6122
6206
|
[collapsed]
|
|
6123
6207
|
);
|
|
6124
|
-
|
|
6208
|
+
React34.useEffect(
|
|
6125
6209
|
function() {
|
|
6126
6210
|
if (!tip) return;
|
|
6127
6211
|
function esc(e) {
|
|
@@ -6146,12 +6230,12 @@ window.Aura = (() => {
|
|
|
6146
6230
|
return { onMouseEnter: show2, onFocus: show2, onMouseLeave: hide, onBlur: hide };
|
|
6147
6231
|
}
|
|
6148
6232
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
6149
|
-
const openState =
|
|
6233
|
+
const openState = React34.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
6150
6234
|
function isOpen(it) {
|
|
6151
6235
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
6152
6236
|
return !!it.defaultOpen || contains(it, active);
|
|
6153
6237
|
}
|
|
6154
|
-
|
|
6238
|
+
React34.useEffect(
|
|
6155
6239
|
function() {
|
|
6156
6240
|
if (!active) return;
|
|
6157
6241
|
const next = {};
|
|
@@ -6173,7 +6257,7 @@ window.Aura = (() => {
|
|
|
6173
6257
|
},
|
|
6174
6258
|
[active]
|
|
6175
6259
|
);
|
|
6176
|
-
const navRef =
|
|
6260
|
+
const navRef = React34.useRef(null);
|
|
6177
6261
|
function onKeyDown(e) {
|
|
6178
6262
|
const k = e.key;
|
|
6179
6263
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -6192,12 +6276,12 @@ window.Aura = (() => {
|
|
|
6192
6276
|
function inner(it, group, open) {
|
|
6193
6277
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
6194
6278
|
return [
|
|
6195
|
-
it.icon ? /* @__PURE__ */
|
|
6196
|
-
collapsed && marked ? /* @__PURE__ */
|
|
6197
|
-
/* @__PURE__ */
|
|
6198
|
-
it.badge != null ? /* @__PURE__ */
|
|
6199
|
-
it.count != null ? /* @__PURE__ */
|
|
6200
|
-
group ? /* @__PURE__ */
|
|
6279
|
+
it.icon ? /* @__PURE__ */ React34.createElement(Icon, { key: "i", name: it.icon }) : collapsed ? /* @__PURE__ */ React34.createElement("span", { key: "i", className: "aura-nav__initial", "aria-hidden": "true" }, it.label.charAt(0)) : null,
|
|
6280
|
+
collapsed && marked ? /* @__PURE__ */ React34.createElement("span", { key: "d", className: "aura-nav__dot", "aria-hidden": "true" }) : null,
|
|
6281
|
+
/* @__PURE__ */ React34.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
|
|
6282
|
+
it.badge != null ? /* @__PURE__ */ React34.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
|
|
6283
|
+
it.count != null ? /* @__PURE__ */ React34.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
|
|
6284
|
+
group ? /* @__PURE__ */ React34.createElement(Icon, { key: "g", name: /* @__PURE__ */ React34.createElement(IconChevronDown, null), className: cx("aura-nav__chevron", open && "is-open") }) : null
|
|
6201
6285
|
];
|
|
6202
6286
|
}
|
|
6203
6287
|
function item(it, depth) {
|
|
@@ -6205,7 +6289,7 @@ window.Aura = (() => {
|
|
|
6205
6289
|
const open = !collapsed && isOpen(it);
|
|
6206
6290
|
const listId = base + "-" + it.id;
|
|
6207
6291
|
const holdsActive = contains(it, active);
|
|
6208
|
-
return /* @__PURE__ */
|
|
6292
|
+
return /* @__PURE__ */ React34.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React34.createElement(
|
|
6209
6293
|
"button",
|
|
6210
6294
|
{
|
|
6211
6295
|
type: "button",
|
|
@@ -6234,7 +6318,7 @@ window.Aura = (() => {
|
|
|
6234
6318
|
}
|
|
6235
6319
|
},
|
|
6236
6320
|
inner(it, true, open)
|
|
6237
|
-
), /* @__PURE__ */
|
|
6321
|
+
), /* @__PURE__ */ React34.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
6238
6322
|
return item(c, depth + 1);
|
|
6239
6323
|
})));
|
|
6240
6324
|
}
|
|
@@ -6250,9 +6334,9 @@ window.Aura = (() => {
|
|
|
6250
6334
|
st[1](it.id);
|
|
6251
6335
|
}
|
|
6252
6336
|
};
|
|
6253
|
-
return /* @__PURE__ */
|
|
6337
|
+
return /* @__PURE__ */ React34.createElement("li", { key: it.id }, it.href ? /* @__PURE__ */ React34.createElement(Link, { href: it.href, ...common }, inner(it, false, false)) : /* @__PURE__ */ React34.createElement("button", { type: "button", ...common }, inner(it, false, false)));
|
|
6254
6338
|
}
|
|
6255
|
-
return /* @__PURE__ */
|
|
6339
|
+
return /* @__PURE__ */ React34.createElement(
|
|
6256
6340
|
"nav",
|
|
6257
6341
|
{
|
|
6258
6342
|
ref: function(el) {
|
|
@@ -6270,17 +6354,17 @@ window.Aura = (() => {
|
|
|
6270
6354
|
"aria-label": props.label || t.mainNav,
|
|
6271
6355
|
onKeyDown
|
|
6272
6356
|
},
|
|
6273
|
-
props.header ? /* @__PURE__ */
|
|
6274
|
-
/* @__PURE__ */
|
|
6275
|
-
return /* @__PURE__ */
|
|
6357
|
+
props.header ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__header" }, props.header) : null,
|
|
6358
|
+
/* @__PURE__ */ React34.createElement("div", { className: "aura-nav__scroll" }, sections.map(function(s, i) {
|
|
6359
|
+
return /* @__PURE__ */ React34.createElement("div", { key: i, className: "aura-nav__section" }, s.title ? /* @__PURE__ */ React34.createElement("p", { className: "aura-nav__title" }, s.title) : null, /* @__PURE__ */ React34.createElement("ul", { className: "aura-nav__list" }, s.items.map(function(it) {
|
|
6276
6360
|
return item(it, 0);
|
|
6277
6361
|
})));
|
|
6278
6362
|
})),
|
|
6279
|
-
props.footer ? /* @__PURE__ */
|
|
6280
|
-
props.collapsible ? /* @__PURE__ */
|
|
6363
|
+
props.footer ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
|
|
6364
|
+
props.collapsible ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React34.createElement(
|
|
6281
6365
|
IconButton,
|
|
6282
6366
|
{
|
|
6283
|
-
icon: collapsed ? /* @__PURE__ */
|
|
6367
|
+
icon: collapsed ? /* @__PURE__ */ React34.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React34.createElement(IconPanelLeftClose, null),
|
|
6284
6368
|
label: collapsed ? t.expandNav : t.collapseNav,
|
|
6285
6369
|
size: "md",
|
|
6286
6370
|
onClick: function() {
|
|
@@ -6290,7 +6374,7 @@ window.Aura = (() => {
|
|
|
6290
6374
|
}
|
|
6291
6375
|
)) : null,
|
|
6292
6376
|
tip && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
6293
|
-
/* @__PURE__ */
|
|
6377
|
+
/* @__PURE__ */ React34.createElement(
|
|
6294
6378
|
"div",
|
|
6295
6379
|
{
|
|
6296
6380
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -6305,35 +6389,35 @@ window.Aura = (() => {
|
|
|
6305
6389
|
});
|
|
6306
6390
|
|
|
6307
6391
|
// src/Breadcrumb.tsx
|
|
6308
|
-
var
|
|
6309
|
-
var Breadcrumb =
|
|
6392
|
+
var React35 = __toESM(require_react(), 1);
|
|
6393
|
+
var Breadcrumb = React35.forwardRef(function Breadcrumb2(props, ref) {
|
|
6310
6394
|
const t = useStrings();
|
|
6311
6395
|
const Link = useLinkComponent(props.linkComponent);
|
|
6312
6396
|
const items2 = props.items || [];
|
|
6313
|
-
return /* @__PURE__ */
|
|
6397
|
+
return /* @__PURE__ */ React35.createElement("nav", { ref, "aria-label": props.label || t.breadcrumb, className: cx("aura-crumbs", props.className) }, /* @__PURE__ */ React35.createElement("ol", null, items2.map(function(it, i) {
|
|
6314
6398
|
const last = i === items2.length - 1;
|
|
6315
|
-
return /* @__PURE__ */
|
|
6399
|
+
return /* @__PURE__ */ React35.createElement("li", { key: i }, last ? /* @__PURE__ */ React35.createElement("span", { "aria-current": "page", className: "aura-crumbs__current" }, it.label) : it.href ? /* @__PURE__ */ React35.createElement(Link, { href: it.href, onClick: it.onClick }, it.label) : it.onClick ? /* @__PURE__ */ React35.createElement("button", { type: "button", onClick: it.onClick }, it.label) : (
|
|
6316
6400
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
6317
|
-
/* @__PURE__ */
|
|
6318
|
-
), last ? null : /* @__PURE__ */
|
|
6401
|
+
/* @__PURE__ */ React35.createElement("span", { className: "aura-crumbs__text" }, it.label)
|
|
6402
|
+
), last ? null : /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" }));
|
|
6319
6403
|
})));
|
|
6320
6404
|
});
|
|
6321
6405
|
|
|
6322
6406
|
// src/Avatar.tsx
|
|
6323
|
-
var
|
|
6407
|
+
var React36 = __toESM(require_react(), 1);
|
|
6324
6408
|
var AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
|
|
6325
6409
|
function initials(name) {
|
|
6326
6410
|
const parts = String(name || "?").trim().split(/\s+/);
|
|
6327
6411
|
return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
|
|
6328
6412
|
}
|
|
6329
|
-
var Avatar =
|
|
6330
|
-
const size = props.size || "md", errState =
|
|
6413
|
+
var Avatar = React36.forwardRef(function Avatar2(props, ref) {
|
|
6414
|
+
const size = props.size || "md", errState = React36.useState(null);
|
|
6331
6415
|
let hash = 0;
|
|
6332
6416
|
String(props.name || "").split("").forEach(function(ch) {
|
|
6333
6417
|
hash = hash * 31 + ch.charCodeAt(0) >>> 0;
|
|
6334
6418
|
});
|
|
6335
6419
|
const tone2 = AVATAR_TONES[hash % AVATAR_TONES.length];
|
|
6336
|
-
return /* @__PURE__ */
|
|
6420
|
+
return /* @__PURE__ */ React36.createElement(
|
|
6337
6421
|
"span",
|
|
6338
6422
|
{
|
|
6339
6423
|
ref,
|
|
@@ -6341,7 +6425,7 @@ window.Aura = (() => {
|
|
|
6341
6425
|
role: "img",
|
|
6342
6426
|
"aria-label": props.name + (props.status ? ", " + props.status : "")
|
|
6343
6427
|
},
|
|
6344
|
-
props.src && errState[0] !== props.src ? /* @__PURE__ */
|
|
6428
|
+
props.src && errState[0] !== props.src ? /* @__PURE__ */ React36.createElement(
|
|
6345
6429
|
"img",
|
|
6346
6430
|
{
|
|
6347
6431
|
key: props.src,
|
|
@@ -6351,16 +6435,16 @@ window.Aura = (() => {
|
|
|
6351
6435
|
errState[1](props.src || null);
|
|
6352
6436
|
}
|
|
6353
6437
|
}
|
|
6354
|
-
) : /* @__PURE__ */
|
|
6355
|
-
props.status === "online" ? /* @__PURE__ */
|
|
6438
|
+
) : /* @__PURE__ */ React36.createElement("span", { "aria-hidden": true }, initials(props.name)),
|
|
6439
|
+
props.status === "online" ? /* @__PURE__ */ React36.createElement("span", { className: "aura-avatar__status", "aria-hidden": true }) : null
|
|
6356
6440
|
);
|
|
6357
6441
|
});
|
|
6358
6442
|
|
|
6359
6443
|
// src/Stack.tsx
|
|
6360
|
-
var
|
|
6444
|
+
var React38 = __toESM(require_react(), 1);
|
|
6361
6445
|
|
|
6362
6446
|
// src/responsive.tsx
|
|
6363
|
-
var
|
|
6447
|
+
var React37 = __toESM(require_react(), 1);
|
|
6364
6448
|
|
|
6365
6449
|
// src/breakpoints.ts
|
|
6366
6450
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
@@ -6368,7 +6452,7 @@ window.Aura = (() => {
|
|
|
6368
6452
|
// src/responsive.tsx
|
|
6369
6453
|
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
6370
6454
|
function useBreakpoint() {
|
|
6371
|
-
return
|
|
6455
|
+
return React37.useSyncExternalStore(subscribe, current, function() {
|
|
6372
6456
|
return "lg";
|
|
6373
6457
|
});
|
|
6374
6458
|
}
|
|
@@ -6408,8 +6492,8 @@ window.Aura = (() => {
|
|
|
6408
6492
|
};
|
|
6409
6493
|
|
|
6410
6494
|
// src/Stack.tsx
|
|
6411
|
-
var h5 =
|
|
6412
|
-
var Stack =
|
|
6495
|
+
var h5 = React38.createElement;
|
|
6496
|
+
var Stack = React38.forwardRef(function Stack2(props, ref) {
|
|
6413
6497
|
const style = Object.assign(
|
|
6414
6498
|
{},
|
|
6415
6499
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -6423,9 +6507,9 @@ window.Aura = (() => {
|
|
|
6423
6507
|
});
|
|
6424
6508
|
|
|
6425
6509
|
// src/Grid.tsx
|
|
6426
|
-
var
|
|
6427
|
-
var h6 =
|
|
6428
|
-
var Grid =
|
|
6510
|
+
var React39 = __toESM(require_react(), 1);
|
|
6511
|
+
var h6 = React39.createElement;
|
|
6512
|
+
var Grid = React39.forwardRef(function Grid2(props, ref) {
|
|
6429
6513
|
const style = Object.assign(
|
|
6430
6514
|
{},
|
|
6431
6515
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -6440,9 +6524,9 @@ window.Aura = (() => {
|
|
|
6440
6524
|
});
|
|
6441
6525
|
|
|
6442
6526
|
// src/Container.tsx
|
|
6443
|
-
var
|
|
6444
|
-
var h7 =
|
|
6445
|
-
var Container =
|
|
6527
|
+
var React40 = __toESM(require_react(), 1);
|
|
6528
|
+
var h7 = React40.createElement;
|
|
6529
|
+
var Container = React40.forwardRef(function Container2(props, ref) {
|
|
6446
6530
|
return h7(
|
|
6447
6531
|
props.as || "div",
|
|
6448
6532
|
{
|
|
@@ -6455,27 +6539,27 @@ window.Aura = (() => {
|
|
|
6455
6539
|
});
|
|
6456
6540
|
|
|
6457
6541
|
// src/AppShell.tsx
|
|
6458
|
-
var
|
|
6459
|
-
var AppShell =
|
|
6542
|
+
var React41 = __toESM(require_react(), 1);
|
|
6543
|
+
var AppShell = React41.forwardRef(function AppShell2(props, ref) {
|
|
6460
6544
|
const t = useStrings();
|
|
6461
6545
|
const bp = useBreakpoint();
|
|
6462
6546
|
const wide = bp === "lg" || bp === "xl";
|
|
6463
|
-
const st =
|
|
6464
|
-
|
|
6547
|
+
const st = React41.useState(false), open = st[0], setOpen = st[1];
|
|
6548
|
+
React41.useEffect(
|
|
6465
6549
|
function() {
|
|
6466
6550
|
if (wide) setOpen(false);
|
|
6467
6551
|
},
|
|
6468
6552
|
[wide]
|
|
6469
6553
|
);
|
|
6470
|
-
const navEl = props.nav &&
|
|
6554
|
+
const navEl = props.nav && React41.isValidElement(props.nav) ? props.nav : null;
|
|
6471
6555
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
6472
|
-
const navState =
|
|
6556
|
+
const navState = React41.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
6473
6557
|
function onNav(id) {
|
|
6474
6558
|
if (shared) navState[1](id);
|
|
6475
6559
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
6476
6560
|
}
|
|
6477
|
-
const deskNav = navEl && shared ?
|
|
6478
|
-
const drawerNav = navEl ?
|
|
6561
|
+
const deskNav = navEl && shared ? React41.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
6562
|
+
const drawerNav = navEl ? React41.cloneElement(navEl, {
|
|
6479
6563
|
value: shared ? navState[0] : navEl.props.value,
|
|
6480
6564
|
onChange: function(id) {
|
|
6481
6565
|
onNav(id);
|
|
@@ -6485,7 +6569,7 @@ window.Aura = (() => {
|
|
|
6485
6569
|
collapsed: false,
|
|
6486
6570
|
collapsible: false
|
|
6487
6571
|
}) : props.nav;
|
|
6488
|
-
return /* @__PURE__ */
|
|
6572
|
+
return /* @__PURE__ */ React41.createElement("div", { ref, className: cx("aura-shell", props.bottomNav && "aura-shell--bottomnav", props.className) }, props.nav ? /* @__PURE__ */ React41.createElement("div", { className: "aura-shell__nav" }, deskNav) : null, props.nav ? /* @__PURE__ */ React41.createElement(
|
|
6489
6573
|
Drawer,
|
|
6490
6574
|
{
|
|
6491
6575
|
open,
|
|
@@ -6498,11 +6582,11 @@ window.Aura = (() => {
|
|
|
6498
6582
|
dismissible: true
|
|
6499
6583
|
},
|
|
6500
6584
|
drawerNav
|
|
6501
|
-
) : null, /* @__PURE__ */
|
|
6585
|
+
) : null, /* @__PURE__ */ React41.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React41.createElement("header", { className: cx("aura-shell__bar", !props.header && "aura-shell__bar--menu-only") }, props.nav ? /* @__PURE__ */ React41.createElement(
|
|
6502
6586
|
IconButton,
|
|
6503
6587
|
{
|
|
6504
6588
|
className: "aura-shell__menu",
|
|
6505
|
-
icon: /* @__PURE__ */
|
|
6589
|
+
icon: /* @__PURE__ */ React41.createElement(IconMenu, null),
|
|
6506
6590
|
label: props.menuLabel || t.openNav,
|
|
6507
6591
|
size: "md",
|
|
6508
6592
|
onClick: function() {
|
|
@@ -6510,18 +6594,18 @@ window.Aura = (() => {
|
|
|
6510
6594
|
},
|
|
6511
6595
|
"aria-expanded": open
|
|
6512
6596
|
}
|
|
6513
|
-
) : null, /* @__PURE__ */
|
|
6597
|
+
) : null, /* @__PURE__ */ React41.createElement("div", { className: "aura-shell__bar-content" }, props.header)) : null, /* @__PURE__ */ React41.createElement("main", { className: "aura-shell__content", id: props.mainId || "main", tabIndex: -1 }, props.children), props.bottomNav || null));
|
|
6514
6598
|
});
|
|
6515
6599
|
|
|
6516
6600
|
// src/ActionBar.tsx
|
|
6517
|
-
var
|
|
6518
|
-
var ActionBar =
|
|
6601
|
+
var React42 = __toESM(require_react(), 1);
|
|
6602
|
+
var ActionBar = React42.forwardRef(function ActionBar2(props, ref) {
|
|
6519
6603
|
const t = useStrings();
|
|
6520
6604
|
const bulk = props.selected != null;
|
|
6521
6605
|
const idle = bulk && !props.selected;
|
|
6522
6606
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
6523
|
-
const cameFrom =
|
|
6524
|
-
const own =
|
|
6607
|
+
const cameFrom = React42.useRef(null);
|
|
6608
|
+
const own = React42.useRef(null);
|
|
6525
6609
|
function clear() {
|
|
6526
6610
|
props.onClearSelection();
|
|
6527
6611
|
setTimeout(function() {
|
|
@@ -6530,7 +6614,7 @@ window.Aura = (() => {
|
|
|
6530
6614
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
6531
6615
|
}, 0);
|
|
6532
6616
|
}
|
|
6533
|
-
return /* @__PURE__ */
|
|
6617
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6534
6618
|
"div",
|
|
6535
6619
|
{
|
|
6536
6620
|
ref: function(el) {
|
|
@@ -6551,16 +6635,16 @@ window.Aura = (() => {
|
|
|
6551
6635
|
props.className
|
|
6552
6636
|
)
|
|
6553
6637
|
},
|
|
6554
|
-
/* @__PURE__ */
|
|
6638
|
+
/* @__PURE__ */ React42.createElement("div", { className: "aura-actionbar__inner" }, /* @__PURE__ */ React42.createElement("div", { className: "aura-actionbar__status", role: "status" }, count, count && props.status ? " \xB7 " : null, props.status), !idle ? /* @__PURE__ */ React42.createElement("div", { className: "aura-actionbar__actions" }, count && props.onClearSelection ? /* @__PURE__ */ React42.createElement(Button, { variant: "ghost", size: "sm", onClick: clear }, t.clear()) : null, props.children) : null)
|
|
6555
6639
|
);
|
|
6556
6640
|
});
|
|
6557
6641
|
|
|
6558
6642
|
// src/Separator.tsx
|
|
6559
|
-
var
|
|
6560
|
-
var Separator =
|
|
6643
|
+
var React43 = __toESM(require_react(), 1);
|
|
6644
|
+
var Separator = React43.forwardRef(function Separator2(props, ref) {
|
|
6561
6645
|
const vertical = props.orientation === "vertical";
|
|
6562
6646
|
const decorative = props.decorative !== false;
|
|
6563
|
-
return /* @__PURE__ */
|
|
6647
|
+
return /* @__PURE__ */ React43.createElement(
|
|
6564
6648
|
"div",
|
|
6565
6649
|
{
|
|
6566
6650
|
ref,
|
|
@@ -6573,13 +6657,13 @@ window.Aura = (() => {
|
|
|
6573
6657
|
});
|
|
6574
6658
|
|
|
6575
6659
|
// src/Table.tsx
|
|
6576
|
-
var
|
|
6577
|
-
var StackLabels =
|
|
6578
|
-
var ColumnIndex =
|
|
6660
|
+
var React44 = __toESM(require_react(), 1);
|
|
6661
|
+
var StackLabels = React44.createContext(null);
|
|
6662
|
+
var ColumnIndex = React44.createContext(-1);
|
|
6579
6663
|
function flat(children) {
|
|
6580
6664
|
const out = [];
|
|
6581
|
-
|
|
6582
|
-
if (
|
|
6665
|
+
React44.Children.toArray(children).forEach(function(c) {
|
|
6666
|
+
if (React44.isValidElement(c) && c.type === React44.Fragment)
|
|
6583
6667
|
out.push.apply(out, flat(c.props.children));
|
|
6584
6668
|
else out.push(c);
|
|
6585
6669
|
});
|
|
@@ -6593,7 +6677,7 @@ window.Aura = (() => {
|
|
|
6593
6677
|
});
|
|
6594
6678
|
return parts.length ? parts.join("") : void 0;
|
|
6595
6679
|
}
|
|
6596
|
-
if (
|
|
6680
|
+
if (React44.isValidElement(node)) {
|
|
6597
6681
|
const p = node.props;
|
|
6598
6682
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
6599
6683
|
return text(p.children);
|
|
@@ -6603,13 +6687,13 @@ window.Aura = (() => {
|
|
|
6603
6687
|
function headerLabels(children) {
|
|
6604
6688
|
let out = [];
|
|
6605
6689
|
flat(children).forEach(function(c) {
|
|
6606
|
-
if (out.length || !
|
|
6690
|
+
if (out.length || !React44.isValidElement(c) || c.type !== THead) return;
|
|
6607
6691
|
const row = flat(c.props.children).find(function(r) {
|
|
6608
|
-
return
|
|
6692
|
+
return React44.isValidElement(r);
|
|
6609
6693
|
});
|
|
6610
6694
|
if (!row) return;
|
|
6611
6695
|
flat(row.props.children).forEach(function(cell) {
|
|
6612
|
-
if (!
|
|
6696
|
+
if (!React44.isValidElement(cell)) return;
|
|
6613
6697
|
const p = cell.props;
|
|
6614
6698
|
const t = text(p.children);
|
|
6615
6699
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -6619,7 +6703,7 @@ window.Aura = (() => {
|
|
|
6619
6703
|
});
|
|
6620
6704
|
return out;
|
|
6621
6705
|
}
|
|
6622
|
-
var Table =
|
|
6706
|
+
var Table = React44.forwardRef(function Table2(props, ref) {
|
|
6623
6707
|
const { caption, captionHidden, density, stackBelow, className, children, ...rest } = props;
|
|
6624
6708
|
const labels = stackBelow ? headerLabels(children) : null;
|
|
6625
6709
|
if (labels && !labels.length)
|
|
@@ -6627,10 +6711,10 @@ window.Aura = (() => {
|
|
|
6627
6711
|
"tbl-stack-labels",
|
|
6628
6712
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
6629
6713
|
);
|
|
6630
|
-
const outer =
|
|
6714
|
+
const outer = React44.useContext(StackLabels);
|
|
6631
6715
|
const capId = uid();
|
|
6632
|
-
const wrap =
|
|
6633
|
-
const sc =
|
|
6716
|
+
const wrap = React44.useRef(null);
|
|
6717
|
+
const sc = React44.useState(false), scrolls = sc[0];
|
|
6634
6718
|
useIsoLayoutEffect(function() {
|
|
6635
6719
|
const el = wrap.current;
|
|
6636
6720
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -6644,7 +6728,7 @@ window.Aura = (() => {
|
|
|
6644
6728
|
ro.disconnect();
|
|
6645
6729
|
};
|
|
6646
6730
|
}, []);
|
|
6647
|
-
return /* @__PURE__ */
|
|
6731
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6648
6732
|
"div",
|
|
6649
6733
|
{
|
|
6650
6734
|
ref: wrap,
|
|
@@ -6655,7 +6739,7 @@ window.Aura = (() => {
|
|
|
6655
6739
|
"aria-labelledby": scrolls && caption != null ? capId : void 0,
|
|
6656
6740
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
6657
6741
|
},
|
|
6658
|
-
/* @__PURE__ */
|
|
6742
|
+
/* @__PURE__ */ React44.createElement(
|
|
6659
6743
|
"table",
|
|
6660
6744
|
{
|
|
6661
6745
|
ref,
|
|
@@ -6663,16 +6747,16 @@ window.Aura = (() => {
|
|
|
6663
6747
|
role: stackBelow ? "table" : void 0,
|
|
6664
6748
|
...rest
|
|
6665
6749
|
},
|
|
6666
|
-
caption != null ? /* @__PURE__ */
|
|
6667
|
-
labels ? /* @__PURE__ */
|
|
6750
|
+
caption != null ? /* @__PURE__ */ React44.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
6751
|
+
labels ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
6668
6752
|
)
|
|
6669
6753
|
);
|
|
6670
6754
|
});
|
|
6671
6755
|
function section(tag, cls) {
|
|
6672
|
-
const C =
|
|
6756
|
+
const C = React44.forwardRef(function TableSection(props, ref) {
|
|
6673
6757
|
const { className, ...rest } = props;
|
|
6674
|
-
const stacked =
|
|
6675
|
-
return
|
|
6758
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6759
|
+
return React44.createElement(
|
|
6676
6760
|
tag,
|
|
6677
6761
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
6678
6762
|
);
|
|
@@ -6685,14 +6769,14 @@ window.Aura = (() => {
|
|
|
6685
6769
|
TBody.displayName = "TBody";
|
|
6686
6770
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
6687
6771
|
TFoot.displayName = "TFoot";
|
|
6688
|
-
var Tr =
|
|
6772
|
+
var Tr = React44.forwardRef(function Tr2(props, ref) {
|
|
6689
6773
|
const { className, children, ...rest } = props;
|
|
6690
|
-
const stacked =
|
|
6774
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6691
6775
|
let col = 0;
|
|
6692
|
-
return /* @__PURE__ */
|
|
6776
|
+
return /* @__PURE__ */ React44.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat(children).map(function(c) {
|
|
6693
6777
|
const at = col;
|
|
6694
|
-
if (
|
|
6695
|
-
return /* @__PURE__ */
|
|
6778
|
+
if (React44.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
6779
|
+
return /* @__PURE__ */ React44.createElement(ColumnIndex.Provider, { key: React44.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
6696
6780
|
}) : children);
|
|
6697
6781
|
});
|
|
6698
6782
|
function cellClass(base, p) {
|
|
@@ -6706,10 +6790,10 @@ window.Aura = (() => {
|
|
|
6706
6790
|
p.className
|
|
6707
6791
|
);
|
|
6708
6792
|
}
|
|
6709
|
-
var Th =
|
|
6793
|
+
var Th = React44.forwardRef(function Th2(props, ref) {
|
|
6710
6794
|
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6711
|
-
const stacked =
|
|
6712
|
-
return /* @__PURE__ */
|
|
6795
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6796
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6713
6797
|
"th",
|
|
6714
6798
|
{
|
|
6715
6799
|
ref,
|
|
@@ -6720,11 +6804,11 @@ window.Aura = (() => {
|
|
|
6720
6804
|
}
|
|
6721
6805
|
);
|
|
6722
6806
|
});
|
|
6723
|
-
var Td =
|
|
6807
|
+
var Td = React44.forwardRef(function Td2(props, ref) {
|
|
6724
6808
|
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6725
|
-
const labels =
|
|
6809
|
+
const labels = React44.useContext(StackLabels), col = React44.useContext(ColumnIndex);
|
|
6726
6810
|
const shown = labels ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
6727
|
-
return /* @__PURE__ */
|
|
6811
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6728
6812
|
"td",
|
|
6729
6813
|
{
|
|
6730
6814
|
ref,
|
|
@@ -6737,8 +6821,8 @@ window.Aura = (() => {
|
|
|
6737
6821
|
});
|
|
6738
6822
|
|
|
6739
6823
|
// src/BottomNav.tsx
|
|
6740
|
-
var
|
|
6741
|
-
var BottomNav =
|
|
6824
|
+
var React45 = __toESM(require_react(), 1);
|
|
6825
|
+
var BottomNav = React45.forwardRef(function BottomNav2(props, ref) {
|
|
6742
6826
|
const t = useStrings();
|
|
6743
6827
|
const Link = useLinkComponent(props.linkComponent);
|
|
6744
6828
|
const st = useMaybeControlled(
|
|
@@ -6748,14 +6832,14 @@ window.Aura = (() => {
|
|
|
6748
6832
|
);
|
|
6749
6833
|
const active = st[0];
|
|
6750
6834
|
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
6751
|
-
return /* @__PURE__ */
|
|
6835
|
+
return /* @__PURE__ */ React45.createElement(React45.Fragment, null, /* @__PURE__ */ React45.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide), "aria-hidden": "true" }), /* @__PURE__ */ React45.createElement(
|
|
6752
6836
|
"nav",
|
|
6753
6837
|
{
|
|
6754
6838
|
ref,
|
|
6755
6839
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
6756
6840
|
"aria-label": props.label || t.mainNav
|
|
6757
6841
|
},
|
|
6758
|
-
/* @__PURE__ */
|
|
6842
|
+
/* @__PURE__ */ React45.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
6759
6843
|
const on = active === it.id;
|
|
6760
6844
|
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
6761
6845
|
const suffix = count || it.badge && it.badgeLabel ? " (" + (count || it.badgeLabel) + ")" : "";
|
|
@@ -6771,19 +6855,19 @@ window.Aura = (() => {
|
|
|
6771
6855
|
}
|
|
6772
6856
|
};
|
|
6773
6857
|
const inner = [
|
|
6774
|
-
/* @__PURE__ */
|
|
6775
|
-
/* @__PURE__ */
|
|
6776
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
6858
|
+
/* @__PURE__ */ React45.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React45.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React45.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React45.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
6859
|
+
/* @__PURE__ */ React45.createElement("span", { key: "l", className: "aura-bottomnav__label" }, it.label),
|
|
6860
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React45.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
6777
6861
|
];
|
|
6778
|
-
return /* @__PURE__ */
|
|
6862
|
+
return /* @__PURE__ */ React45.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React45.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React45.createElement("button", { type: "button", ...common }, inner));
|
|
6779
6863
|
}))
|
|
6780
6864
|
));
|
|
6781
6865
|
});
|
|
6782
6866
|
|
|
6783
6867
|
// src/Surface.tsx
|
|
6784
|
-
var
|
|
6785
|
-
var h8 =
|
|
6786
|
-
var Surface =
|
|
6868
|
+
var React46 = __toESM(require_react(), 1);
|
|
6869
|
+
var h8 = React46.createElement;
|
|
6870
|
+
var Surface = React46.forwardRef(function Surface2(props, ref) {
|
|
6787
6871
|
const t = props.texture || "mesh";
|
|
6788
6872
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
6789
6873
|
return h8(
|
|
@@ -6804,8 +6888,8 @@ window.Aura = (() => {
|
|
|
6804
6888
|
});
|
|
6805
6889
|
|
|
6806
6890
|
// src/Stat.tsx
|
|
6807
|
-
var
|
|
6808
|
-
var Stat =
|
|
6891
|
+
var React47 = __toESM(require_react(), 1);
|
|
6892
|
+
var Stat = React47.forwardRef(function Stat2(props, ref) {
|
|
6809
6893
|
const ch = props.change;
|
|
6810
6894
|
const dir = ch && (ch.direction || "flat");
|
|
6811
6895
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -6814,7 +6898,7 @@ window.Aura = (() => {
|
|
|
6814
6898
|
const numeric = typeof v === "number" || typeof v === "string" && /\d/.test(v) && /^[\s\d.,:+\-\u2212%()\u0E3F$\u20AC\u00A3\u00A5kKmMbB]+$/.test(v.replace(/\b[A-Z]{3}\b/g, ""));
|
|
6815
6899
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
6816
6900
|
const interactive = !!(props.href || props.onClick);
|
|
6817
|
-
return /* @__PURE__ */
|
|
6901
|
+
return /* @__PURE__ */ React47.createElement(
|
|
6818
6902
|
Tag3,
|
|
6819
6903
|
{
|
|
6820
6904
|
ref,
|
|
@@ -6824,20 +6908,20 @@ window.Aura = (() => {
|
|
|
6824
6908
|
type: Tag3 === "button" ? "button" : void 0,
|
|
6825
6909
|
"aria-busy": props.loading || void 0
|
|
6826
6910
|
},
|
|
6827
|
-
/* @__PURE__ */
|
|
6828
|
-
props.loading ? /* @__PURE__ */
|
|
6829
|
-
ch && !props.loading || props.caption ? /* @__PURE__ */
|
|
6911
|
+
/* @__PURE__ */ React47.createElement("span", { className: "aura-stat__head" }, /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__label" }, props.label), props.icon ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__icon" }, /* @__PURE__ */ React47.createElement(Icon, { name: props.icon })) : null),
|
|
6912
|
+
props.loading ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__value" }, /* @__PURE__ */ React47.createElement("span", { className: "aura-skel aura-stat__skel" })) : /* @__PURE__ */ React47.createElement("span", { className: cx("aura-stat__value", numeric && "is-numeric") }, props.value, props.unit ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__unit" }, props.unit) : null),
|
|
6913
|
+
ch && !props.loading || props.caption ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__foot" }, ch && !props.loading ? /* @__PURE__ */ React47.createElement("span", { className: cx("aura-stat__change", "is-" + tone2) }, /* @__PURE__ */ React47.createElement(
|
|
6830
6914
|
Icon,
|
|
6831
6915
|
{
|
|
6832
|
-
name: dir === "up" ? /* @__PURE__ */
|
|
6916
|
+
name: dir === "up" ? /* @__PURE__ */ React47.createElement(IconTrendingUp, null) : dir === "down" ? /* @__PURE__ */ React47.createElement(IconTrendingDown, null) : /* @__PURE__ */ React47.createElement(IconMinus, null),
|
|
6833
6917
|
size: 14
|
|
6834
6918
|
}
|
|
6835
|
-
), /* @__PURE__ */
|
|
6919
|
+
), /* @__PURE__ */ React47.createElement("span", null, ch.value)) : null, ch && ch.label && !props.loading ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__caption" }, ch.label) : null, props.caption ? /* @__PURE__ */ React47.createElement("span", { className: "aura-stat__caption" }, props.caption) : null) : null
|
|
6836
6920
|
);
|
|
6837
6921
|
});
|
|
6838
6922
|
|
|
6839
6923
|
// src/TimePicker.tsx
|
|
6840
|
-
var
|
|
6924
|
+
var React48 = __toESM(require_react(), 1);
|
|
6841
6925
|
var import_react_dom11 = __toESM(require_react_dom(), 1);
|
|
6842
6926
|
|
|
6843
6927
|
// src/text.ts
|
|
@@ -6879,7 +6963,7 @@ window.Aura = (() => {
|
|
|
6879
6963
|
function fromMin(n3) {
|
|
6880
6964
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
6881
6965
|
}
|
|
6882
|
-
var TimePicker =
|
|
6966
|
+
var TimePicker = React48.forwardRef(function TimePicker2(props, ref) {
|
|
6883
6967
|
const t = useStrings();
|
|
6884
6968
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
6885
6969
|
const st = useMaybeControlled(
|
|
@@ -6889,7 +6973,7 @@ window.Aura = (() => {
|
|
|
6889
6973
|
);
|
|
6890
6974
|
const value = st[0];
|
|
6891
6975
|
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;
|
|
6892
|
-
const slots =
|
|
6976
|
+
const slots = React48.useMemo(
|
|
6893
6977
|
function() {
|
|
6894
6978
|
const out = [];
|
|
6895
6979
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -6901,12 +6985,12 @@ window.Aura = (() => {
|
|
|
6901
6985
|
const n3 = toMin(v);
|
|
6902
6986
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
6903
6987
|
}
|
|
6904
|
-
const openState =
|
|
6905
|
-
const editState =
|
|
6906
|
-
const aState =
|
|
6907
|
-
const errState =
|
|
6908
|
-
const pos =
|
|
6909
|
-
const boxRef =
|
|
6988
|
+
const openState = React48.useState(false), open = openState[0], setOpen = openState[1];
|
|
6989
|
+
const editState = React48.useState(null), editing = editState[0], setEditing = editState[1];
|
|
6990
|
+
const aState = React48.useState(0), active = aState[0], setActive = aState[1];
|
|
6991
|
+
const errState = React48.useState(null);
|
|
6992
|
+
const pos = React48.useState(null);
|
|
6993
|
+
const boxRef = React48.useRef(null), inputRef = React48.useRef(null), listRef = React48.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
6910
6994
|
const mounted = useMounted();
|
|
6911
6995
|
function nearest(v) {
|
|
6912
6996
|
const n3 = toMin(v);
|
|
@@ -6934,7 +7018,7 @@ window.Aura = (() => {
|
|
|
6934
7018
|
},
|
|
6935
7019
|
[open]
|
|
6936
7020
|
);
|
|
6937
|
-
|
|
7021
|
+
React48.useEffect(
|
|
6938
7022
|
function() {
|
|
6939
7023
|
if (!open) return;
|
|
6940
7024
|
function outside(e) {
|
|
@@ -6956,7 +7040,7 @@ window.Aura = (() => {
|
|
|
6956
7040
|
},
|
|
6957
7041
|
[open]
|
|
6958
7042
|
);
|
|
6959
|
-
|
|
7043
|
+
React48.useEffect(
|
|
6960
7044
|
function() {
|
|
6961
7045
|
if (!open || !listRef.current) return;
|
|
6962
7046
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -7055,9 +7139,9 @@ window.Aura = (() => {
|
|
|
7055
7139
|
}
|
|
7056
7140
|
const error = errState[0] || props.error;
|
|
7057
7141
|
const list = open && mounted && pos[0] ? (0, import_react_dom11.createPortal)(
|
|
7058
|
-
/* @__PURE__ */
|
|
7142
|
+
/* @__PURE__ */ React48.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React48.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
7059
7143
|
const dis = blocked(s), sel = s === value;
|
|
7060
|
-
return /* @__PURE__ */
|
|
7144
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7061
7145
|
"li",
|
|
7062
7146
|
{
|
|
7063
7147
|
key: s,
|
|
@@ -7082,13 +7166,13 @@ window.Aura = (() => {
|
|
|
7082
7166
|
if (active !== i) setActive(i);
|
|
7083
7167
|
}
|
|
7084
7168
|
},
|
|
7085
|
-
/* @__PURE__ */
|
|
7086
|
-
sel ? /* @__PURE__ */
|
|
7169
|
+
/* @__PURE__ */ React48.createElement("span", { className: "aura-combo__label" }, s),
|
|
7170
|
+
sel ? /* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
7087
7171
|
);
|
|
7088
7172
|
}))),
|
|
7089
7173
|
document.body
|
|
7090
7174
|
) : null;
|
|
7091
|
-
return /* @__PURE__ */
|
|
7175
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7092
7176
|
Field,
|
|
7093
7177
|
{
|
|
7094
7178
|
id,
|
|
@@ -7100,7 +7184,7 @@ window.Aura = (() => {
|
|
|
7100
7184
|
disabled: props.disabled,
|
|
7101
7185
|
className: props.className
|
|
7102
7186
|
},
|
|
7103
|
-
/* @__PURE__ */
|
|
7187
|
+
/* @__PURE__ */ React48.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconClock, null), className: "aura-input__icon" }), /* @__PURE__ */ React48.createElement(
|
|
7104
7188
|
"input",
|
|
7105
7189
|
{
|
|
7106
7190
|
ref: inputMerged,
|
|
@@ -7140,7 +7224,7 @@ window.Aura = (() => {
|
|
|
7140
7224
|
}, 0);
|
|
7141
7225
|
}
|
|
7142
7226
|
}
|
|
7143
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
7227
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React48.createElement(
|
|
7144
7228
|
"button",
|
|
7145
7229
|
{
|
|
7146
7230
|
type: "button",
|
|
@@ -7153,8 +7237,8 @@ window.Aura = (() => {
|
|
|
7153
7237
|
if (inputRef.current) inputRef.current.focus();
|
|
7154
7238
|
}
|
|
7155
7239
|
},
|
|
7156
|
-
/* @__PURE__ */
|
|
7157
|
-
) : null, /* @__PURE__ */
|
|
7240
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconX, null) })
|
|
7241
|
+
) : null, /* @__PURE__ */ React48.createElement(
|
|
7158
7242
|
"button",
|
|
7159
7243
|
{
|
|
7160
7244
|
type: "button",
|
|
@@ -7172,14 +7256,14 @@ window.Aura = (() => {
|
|
|
7172
7256
|
}
|
|
7173
7257
|
}
|
|
7174
7258
|
},
|
|
7175
|
-
/* @__PURE__ */
|
|
7259
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconChevronDown, null) })
|
|
7176
7260
|
)),
|
|
7177
7261
|
list
|
|
7178
7262
|
);
|
|
7179
7263
|
});
|
|
7180
7264
|
|
|
7181
7265
|
// src/FileUpload.tsx
|
|
7182
|
-
var
|
|
7266
|
+
var React49 = __toESM(require_react(), 1);
|
|
7183
7267
|
function matches(file, accept) {
|
|
7184
7268
|
if (!accept) return true;
|
|
7185
7269
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -7203,24 +7287,24 @@ window.Aura = (() => {
|
|
|
7203
7287
|
}).join(", ");
|
|
7204
7288
|
}
|
|
7205
7289
|
var seq = 0;
|
|
7206
|
-
var FileUpload =
|
|
7290
|
+
var FileUpload = React49.forwardRef(function FileUpload2(props, ref) {
|
|
7207
7291
|
const t = useStrings();
|
|
7208
7292
|
const auto = uid(), id = props.id || auto;
|
|
7209
7293
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
7210
7294
|
const items2 = st[0] || [];
|
|
7211
|
-
const dragState =
|
|
7212
|
-
const inputRef =
|
|
7213
|
-
const urls =
|
|
7295
|
+
const dragState = React49.useState(false), over = dragState[0];
|
|
7296
|
+
const inputRef = React49.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
7297
|
+
const urls = React49.useRef({});
|
|
7214
7298
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
7215
7299
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
7216
|
-
|
|
7300
|
+
React49.useEffect(function() {
|
|
7217
7301
|
return function() {
|
|
7218
7302
|
Object.keys(urls.current).forEach(function(k) {
|
|
7219
7303
|
URL.revokeObjectURL(urls.current[k]);
|
|
7220
7304
|
});
|
|
7221
7305
|
};
|
|
7222
7306
|
}, []);
|
|
7223
|
-
|
|
7307
|
+
React49.useEffect(
|
|
7224
7308
|
function() {
|
|
7225
7309
|
const el = inputRef.current;
|
|
7226
7310
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -7280,7 +7364,7 @@ window.Aura = (() => {
|
|
|
7280
7364
|
if (inputRef.current) inputRef.current.focus();
|
|
7281
7365
|
}
|
|
7282
7366
|
const error = props.error;
|
|
7283
|
-
return /* @__PURE__ */
|
|
7367
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7284
7368
|
Field,
|
|
7285
7369
|
{
|
|
7286
7370
|
id,
|
|
@@ -7292,7 +7376,7 @@ window.Aura = (() => {
|
|
|
7292
7376
|
disabled: props.disabled,
|
|
7293
7377
|
className: props.className
|
|
7294
7378
|
},
|
|
7295
|
-
/* @__PURE__ */
|
|
7379
|
+
/* @__PURE__ */ React49.createElement(
|
|
7296
7380
|
"div",
|
|
7297
7381
|
{
|
|
7298
7382
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -7313,9 +7397,9 @@ window.Aura = (() => {
|
|
|
7313
7397
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
7314
7398
|
}
|
|
7315
7399
|
},
|
|
7316
|
-
/* @__PURE__ */
|
|
7317
|
-
/* @__PURE__ */
|
|
7318
|
-
/* @__PURE__ */
|
|
7400
|
+
/* @__PURE__ */ React49.createElement(Icon, { name: /* @__PURE__ */ React49.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
7401
|
+
/* @__PURE__ */ React49.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
7402
|
+
/* @__PURE__ */ React49.createElement(
|
|
7319
7403
|
"input",
|
|
7320
7404
|
{
|
|
7321
7405
|
ref: inputMerged,
|
|
@@ -7337,12 +7421,12 @@ window.Aura = (() => {
|
|
|
7337
7421
|
}
|
|
7338
7422
|
}
|
|
7339
7423
|
),
|
|
7340
|
-
/* @__PURE__ */
|
|
7341
|
-
note ? /* @__PURE__ */
|
|
7424
|
+
/* @__PURE__ */ React49.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
7425
|
+
note ? /* @__PURE__ */ React49.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
7342
7426
|
),
|
|
7343
|
-
items2.length ? /* @__PURE__ */
|
|
7427
|
+
items2.length ? /* @__PURE__ */ React49.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
7344
7428
|
const src = thumb(it);
|
|
7345
|
-
return /* @__PURE__ */
|
|
7429
|
+
return /* @__PURE__ */ React49.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React49.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React49.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React49.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React49.createElement(IconImage, null) : /* @__PURE__ */ React49.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React49.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React49.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React49.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React49.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Icon, { name: /* @__PURE__ */ React49.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React49.createElement(React49.Fragment, null, /* @__PURE__ */ React49.createElement(Icon, { name: /* @__PURE__ */ React49.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React49.createElement(
|
|
7346
7430
|
"span",
|
|
7347
7431
|
{
|
|
7348
7432
|
className: "aura-upload__bar",
|
|
@@ -7352,11 +7436,11 @@ window.Aura = (() => {
|
|
|
7352
7436
|
"aria-valuemax": 100,
|
|
7353
7437
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
7354
7438
|
},
|
|
7355
|
-
/* @__PURE__ */
|
|
7356
|
-
) : null), /* @__PURE__ */
|
|
7439
|
+
/* @__PURE__ */ React49.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
7440
|
+
) : null), /* @__PURE__ */ React49.createElement(
|
|
7357
7441
|
IconButton,
|
|
7358
7442
|
{
|
|
7359
|
-
icon: /* @__PURE__ */
|
|
7443
|
+
icon: /* @__PURE__ */ React49.createElement(IconX, null),
|
|
7360
7444
|
label: t.remove(it.name),
|
|
7361
7445
|
onClick: function() {
|
|
7362
7446
|
remove(it);
|
|
@@ -7641,9 +7725,9 @@ window.Aura = (() => {
|
|
|
7641
7725
|
}
|
|
7642
7726
|
|
|
7643
7727
|
// src/ThemeStyle.tsx
|
|
7644
|
-
var
|
|
7728
|
+
var React50 = __toESM(require_react(), 1);
|
|
7645
7729
|
function ThemeStyle(props) {
|
|
7646
|
-
const css =
|
|
7730
|
+
const css = React50.useMemo(
|
|
7647
7731
|
function() {
|
|
7648
7732
|
try {
|
|
7649
7733
|
return createTheme({
|
|
@@ -7660,11 +7744,11 @@ window.Aura = (() => {
|
|
|
7660
7744
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
7661
7745
|
);
|
|
7662
7746
|
if (css === null) return null;
|
|
7663
|
-
return /* @__PURE__ */
|
|
7747
|
+
return /* @__PURE__ */ React50.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
7664
7748
|
}
|
|
7665
7749
|
|
|
7666
7750
|
// src/colorScheme.tsx
|
|
7667
|
-
var
|
|
7751
|
+
var React51 = __toESM(require_react(), 1);
|
|
7668
7752
|
|
|
7669
7753
|
// src/colorSchemeScript.ts
|
|
7670
7754
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -7681,7 +7765,7 @@ window.Aura = (() => {
|
|
|
7681
7765
|
|
|
7682
7766
|
// src/colorScheme.tsx
|
|
7683
7767
|
function ColorSchemeScript(props) {
|
|
7684
|
-
return /* @__PURE__ */
|
|
7768
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7685
7769
|
"script",
|
|
7686
7770
|
{
|
|
7687
7771
|
"data-aura-color-scheme": "",
|
|
@@ -7706,7 +7790,7 @@ window.Aura = (() => {
|
|
|
7706
7790
|
function useColorScheme(options) {
|
|
7707
7791
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
7708
7792
|
const fallback = options && options.defaultScheme || "system";
|
|
7709
|
-
const subscribe2 =
|
|
7793
|
+
const subscribe2 = React51.useCallback(
|
|
7710
7794
|
function(cb) {
|
|
7711
7795
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
7712
7796
|
function onSystem() {
|
|
@@ -7728,7 +7812,7 @@ window.Aura = (() => {
|
|
|
7728
7812
|
},
|
|
7729
7813
|
[fallback, key]
|
|
7730
7814
|
);
|
|
7731
|
-
const snapshot =
|
|
7815
|
+
const snapshot = React51.useSyncExternalStore(
|
|
7732
7816
|
subscribe2,
|
|
7733
7817
|
function() {
|
|
7734
7818
|
const s = readScheme(fallback);
|
|
@@ -7739,7 +7823,7 @@ window.Aura = (() => {
|
|
|
7739
7823
|
}
|
|
7740
7824
|
);
|
|
7741
7825
|
const parts = snapshot.split("|");
|
|
7742
|
-
const setScheme =
|
|
7826
|
+
const setScheme = React51.useCallback(
|
|
7743
7827
|
function(next) {
|
|
7744
7828
|
if (!valid(next)) return;
|
|
7745
7829
|
try {
|
|
@@ -7758,14 +7842,14 @@ window.Aura = (() => {
|
|
|
7758
7842
|
const cs = useColorScheme(props);
|
|
7759
7843
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
7760
7844
|
const label = props.label || t.colorScheme;
|
|
7761
|
-
return /* @__PURE__ */
|
|
7845
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7762
7846
|
DropdownMenu,
|
|
7763
7847
|
{
|
|
7764
7848
|
label,
|
|
7765
|
-
trigger: /* @__PURE__ */
|
|
7849
|
+
trigger: /* @__PURE__ */ React51.createElement(
|
|
7766
7850
|
IconButton,
|
|
7767
7851
|
{
|
|
7768
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
7852
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React51.createElement(IconMoon, null) : /* @__PURE__ */ React51.createElement(IconSun, null),
|
|
7769
7853
|
label: label + ": " + names[cs.scheme]
|
|
7770
7854
|
}
|
|
7771
7855
|
),
|
|
@@ -7783,19 +7867,19 @@ window.Aura = (() => {
|
|
|
7783
7867
|
}
|
|
7784
7868
|
|
|
7785
7869
|
// src/Badge.tsx
|
|
7786
|
-
var
|
|
7787
|
-
var Badge =
|
|
7870
|
+
var React52 = __toESM(require_react(), 1);
|
|
7871
|
+
var Badge = React52.forwardRef(function Badge2(props, ref) {
|
|
7788
7872
|
return badgeElement(props, ref);
|
|
7789
7873
|
});
|
|
7790
7874
|
|
|
7791
7875
|
// src/Progress.tsx
|
|
7792
|
-
var
|
|
7793
|
-
var Progress =
|
|
7876
|
+
var React53 = __toESM(require_react(), 1);
|
|
7877
|
+
var Progress = React53.forwardRef(function Progress2(props, ref) {
|
|
7794
7878
|
const auto = uid(), id = props.id || auto;
|
|
7795
7879
|
const max = props.max || 100, det = props.value != null;
|
|
7796
7880
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
7797
7881
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
7798
|
-
return /* @__PURE__ */
|
|
7882
|
+
return /* @__PURE__ */ React53.createElement(
|
|
7799
7883
|
"div",
|
|
7800
7884
|
{
|
|
7801
7885
|
ref,
|
|
@@ -7806,8 +7890,8 @@ window.Aura = (() => {
|
|
|
7806
7890
|
props.className
|
|
7807
7891
|
)
|
|
7808
7892
|
},
|
|
7809
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
7810
|
-
/* @__PURE__ */
|
|
7893
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React53.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React53.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React53.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React53.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
7894
|
+
/* @__PURE__ */ React53.createElement(
|
|
7811
7895
|
"div",
|
|
7812
7896
|
{
|
|
7813
7897
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -7819,21 +7903,21 @@ window.Aura = (() => {
|
|
|
7819
7903
|
"aria-valuenow": det ? props.value : void 0,
|
|
7820
7904
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
7821
7905
|
},
|
|
7822
|
-
/* @__PURE__ */
|
|
7906
|
+
/* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
7823
7907
|
),
|
|
7824
|
-
props.hint ? /* @__PURE__ */
|
|
7908
|
+
props.hint ? /* @__PURE__ */ React53.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
7825
7909
|
);
|
|
7826
7910
|
});
|
|
7827
7911
|
|
|
7828
7912
|
// src/Skeleton.tsx
|
|
7829
|
-
var
|
|
7830
|
-
var Skeleton =
|
|
7913
|
+
var React54 = __toESM(require_react(), 1);
|
|
7914
|
+
var Skeleton = React54.forwardRef(function Skeleton2(props, ref) {
|
|
7831
7915
|
const v = props.variant || "text";
|
|
7832
7916
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
7833
7917
|
const n3 = props.lines, rows = [];
|
|
7834
7918
|
for (let i = 0; i < n3; i++)
|
|
7835
|
-
rows.push(/* @__PURE__ */
|
|
7836
|
-
return /* @__PURE__ */
|
|
7919
|
+
rows.push(/* @__PURE__ */ React54.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
7920
|
+
return /* @__PURE__ */ React54.createElement(
|
|
7837
7921
|
"span",
|
|
7838
7922
|
{
|
|
7839
7923
|
ref,
|
|
@@ -7851,17 +7935,17 @@ window.Aura = (() => {
|
|
|
7851
7935
|
if (v === "circle") {
|
|
7852
7936
|
style.width = style.height = props.size || props.width || 40;
|
|
7853
7937
|
}
|
|
7854
|
-
return /* @__PURE__ */
|
|
7938
|
+
return /* @__PURE__ */ React54.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
7855
7939
|
});
|
|
7856
7940
|
|
|
7857
7941
|
// src/EmptyState.tsx
|
|
7858
|
-
var
|
|
7859
|
-
var EmptyState =
|
|
7942
|
+
var React55 = __toESM(require_react(), 1);
|
|
7943
|
+
var EmptyState = React55.forwardRef(function EmptyState2(props, ref) {
|
|
7860
7944
|
return emptyStateElement(props, ref);
|
|
7861
7945
|
});
|
|
7862
7946
|
|
|
7863
7947
|
// src/Pagination.tsx
|
|
7864
|
-
var
|
|
7948
|
+
var React56 = __toESM(require_react(), 1);
|
|
7865
7949
|
function pageList(page, count, sib) {
|
|
7866
7950
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
7867
7951
|
if (page - sib <= 3) {
|
|
@@ -7881,7 +7965,7 @@ window.Aura = (() => {
|
|
|
7881
7965
|
if (count > 1) out.push(count);
|
|
7882
7966
|
return out;
|
|
7883
7967
|
}
|
|
7884
|
-
var Pagination =
|
|
7968
|
+
var Pagination = React56.forwardRef(function Pagination2(props, ref) {
|
|
7885
7969
|
const t = useStrings();
|
|
7886
7970
|
const count = Math.max(1, props.pageCount || 1);
|
|
7887
7971
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -7900,7 +7984,7 @@ window.Aura = (() => {
|
|
|
7900
7984
|
},
|
|
7901
7985
|
extra
|
|
7902
7986
|
);
|
|
7903
|
-
return link ? /* @__PURE__ */
|
|
7987
|
+
return link ? /* @__PURE__ */ React56.createElement(
|
|
7904
7988
|
Link,
|
|
7905
7989
|
{
|
|
7906
7990
|
href: link(p),
|
|
@@ -7913,7 +7997,7 @@ window.Aura = (() => {
|
|
|
7913
7997
|
...common
|
|
7914
7998
|
},
|
|
7915
7999
|
label
|
|
7916
|
-
) : /* @__PURE__ */
|
|
8000
|
+
) : /* @__PURE__ */ React56.createElement(
|
|
7917
8001
|
"button",
|
|
7918
8002
|
{
|
|
7919
8003
|
type: "button",
|
|
@@ -7927,7 +8011,7 @@ window.Aura = (() => {
|
|
|
7927
8011
|
}
|
|
7928
8012
|
function arrow(p, icon, label, rel, disabled) {
|
|
7929
8013
|
if (!link || disabled)
|
|
7930
|
-
return /* @__PURE__ */
|
|
8014
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7931
8015
|
IconButton,
|
|
7932
8016
|
{
|
|
7933
8017
|
icon,
|
|
@@ -7938,7 +8022,7 @@ window.Aura = (() => {
|
|
|
7938
8022
|
}
|
|
7939
8023
|
}
|
|
7940
8024
|
);
|
|
7941
|
-
return /* @__PURE__ */
|
|
8025
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7942
8026
|
Link,
|
|
7943
8027
|
{
|
|
7944
8028
|
href: link(p),
|
|
@@ -7953,17 +8037,17 @@ window.Aura = (() => {
|
|
|
7953
8037
|
}
|
|
7954
8038
|
}
|
|
7955
8039
|
},
|
|
7956
|
-
/* @__PURE__ */
|
|
8040
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: icon, size: "sm" })
|
|
7957
8041
|
);
|
|
7958
8042
|
}
|
|
7959
|
-
return /* @__PURE__ */
|
|
7960
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
7961
|
-
})), /* @__PURE__ */
|
|
8043
|
+
return /* @__PURE__ */ React56.createElement("nav", { ref, className: cx("aura-pagination", props.className), "aria-label": props.label || t.pagination }, arrow(page - 1, /* @__PURE__ */ React56.createElement(IconChevronLeft, null), t.prevPage, "prev", page <= 1), /* @__PURE__ */ React56.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
8044
|
+
return typeof p === "number" ? /* @__PURE__ */ React56.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React56.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
8045
|
+
})), /* @__PURE__ */ React56.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React56.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
|
|
7962
8046
|
});
|
|
7963
8047
|
|
|
7964
8048
|
// src/Accordion.tsx
|
|
7965
|
-
var
|
|
7966
|
-
var Accordion =
|
|
8049
|
+
var React57 = __toESM(require_react(), 1);
|
|
8050
|
+
var Accordion = React57.forwardRef(function Accordion2(props, ref) {
|
|
7967
8051
|
const auto = uid(), base = props.id || auto;
|
|
7968
8052
|
const multiple = props.type === "multiple";
|
|
7969
8053
|
const st = useMaybeControlled(
|
|
@@ -8001,9 +8085,9 @@ window.Aura = (() => {
|
|
|
8001
8085
|
n3.focus();
|
|
8002
8086
|
}
|
|
8003
8087
|
}
|
|
8004
|
-
return /* @__PURE__ */
|
|
8088
|
+
return /* @__PURE__ */ React57.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
8005
8089
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
8006
|
-
return /* @__PURE__ */
|
|
8090
|
+
return /* @__PURE__ */ React57.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React57.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React57.createElement(
|
|
8007
8091
|
"button",
|
|
8008
8092
|
{
|
|
8009
8093
|
type: "button",
|
|
@@ -8015,15 +8099,15 @@ window.Aura = (() => {
|
|
|
8015
8099
|
toggle(it.id);
|
|
8016
8100
|
}
|
|
8017
8101
|
},
|
|
8018
|
-
it.icon ? /* @__PURE__ */
|
|
8019
|
-
/* @__PURE__ */
|
|
8020
|
-
/* @__PURE__ */
|
|
8021
|
-
)), /* @__PURE__ */
|
|
8102
|
+
it.icon ? /* @__PURE__ */ React57.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
8103
|
+
/* @__PURE__ */ React57.createElement("span", { className: "aura-accordion__title" }, it.title, it.description ? /* @__PURE__ */ React57.createElement("span", { className: "aura-accordion__desc" }, it.description) : null),
|
|
8104
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
8105
|
+
)), /* @__PURE__ */ React57.createElement("div", { id: pid, role: "region", "aria-labelledby": bid, className: "aura-accordion__panel", hidden: !on }, it.content));
|
|
8022
8106
|
}));
|
|
8023
8107
|
});
|
|
8024
8108
|
|
|
8025
8109
|
// src/Popover.tsx
|
|
8026
|
-
var
|
|
8110
|
+
var React58 = __toESM(require_react(), 1);
|
|
8027
8111
|
var import_react_dom12 = __toESM(require_react_dom(), 1);
|
|
8028
8112
|
function position(anchor, pop, placement) {
|
|
8029
8113
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -8041,15 +8125,15 @@ window.Aura = (() => {
|
|
|
8041
8125
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
8042
8126
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
8043
8127
|
}
|
|
8044
|
-
var Popover =
|
|
8128
|
+
var Popover = React58.forwardRef(function Popover2(props, ref) {
|
|
8045
8129
|
const t = useStrings();
|
|
8046
8130
|
const density = useDensity();
|
|
8047
8131
|
const auto = uid(), id = props.id || auto;
|
|
8048
8132
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
8049
8133
|
const open = !!st[0];
|
|
8050
|
-
const wrap =
|
|
8051
|
-
const pos =
|
|
8052
|
-
const inTree =
|
|
8134
|
+
const wrap = React58.useRef(null), pop = React58.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
8135
|
+
const pos = React58.useState(null), mounted = useMounted();
|
|
8136
|
+
const inTree = React58.useRef(false);
|
|
8053
8137
|
function trigger() {
|
|
8054
8138
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
8055
8139
|
}
|
|
@@ -8076,7 +8160,7 @@ window.Aura = (() => {
|
|
|
8076
8160
|
},
|
|
8077
8161
|
[open, mounted, props.placement]
|
|
8078
8162
|
);
|
|
8079
|
-
|
|
8163
|
+
React58.useEffect(
|
|
8080
8164
|
function() {
|
|
8081
8165
|
if (!open || !mounted) return;
|
|
8082
8166
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -8101,9 +8185,9 @@ window.Aura = (() => {
|
|
|
8101
8185
|
},
|
|
8102
8186
|
[open, mounted]
|
|
8103
8187
|
);
|
|
8104
|
-
const child =
|
|
8188
|
+
const child = React58.Children.only(props.trigger);
|
|
8105
8189
|
const panel = open && mounted ? (0, import_react_dom12.createPortal)(
|
|
8106
|
-
/* @__PURE__ */
|
|
8190
|
+
/* @__PURE__ */ React58.createElement(
|
|
8107
8191
|
"div",
|
|
8108
8192
|
{
|
|
8109
8193
|
ref: popMerged,
|
|
@@ -8133,17 +8217,17 @@ window.Aura = (() => {
|
|
|
8133
8217
|
} else trapTab(e, pop.current);
|
|
8134
8218
|
}
|
|
8135
8219
|
},
|
|
8136
|
-
props.title ? /* @__PURE__ */
|
|
8220
|
+
props.title ? /* @__PURE__ */ React58.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React58.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React58.createElement(
|
|
8137
8221
|
IconButton,
|
|
8138
8222
|
{
|
|
8139
|
-
icon: /* @__PURE__ */
|
|
8223
|
+
icon: /* @__PURE__ */ React58.createElement(IconX, null),
|
|
8140
8224
|
label: t.close,
|
|
8141
8225
|
onClick: function() {
|
|
8142
8226
|
close(true);
|
|
8143
8227
|
}
|
|
8144
8228
|
}
|
|
8145
8229
|
)) : null,
|
|
8146
|
-
/* @__PURE__ */
|
|
8230
|
+
/* @__PURE__ */ React58.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
8147
8231
|
close: function() {
|
|
8148
8232
|
close(true);
|
|
8149
8233
|
}
|
|
@@ -8151,7 +8235,7 @@ window.Aura = (() => {
|
|
|
8151
8235
|
),
|
|
8152
8236
|
document.body
|
|
8153
8237
|
) : null;
|
|
8154
|
-
return /* @__PURE__ */
|
|
8238
|
+
return /* @__PURE__ */ React58.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React58.cloneElement(child, {
|
|
8155
8239
|
onClick: function(e) {
|
|
8156
8240
|
if (child.props.onClick) child.props.onClick(e);
|
|
8157
8241
|
st[1](!open);
|
|
@@ -8163,7 +8247,7 @@ window.Aura = (() => {
|
|
|
8163
8247
|
});
|
|
8164
8248
|
|
|
8165
8249
|
// src/NumberField.tsx
|
|
8166
|
-
var
|
|
8250
|
+
var React59 = __toESM(require_react(), 1);
|
|
8167
8251
|
function decimalsOf(n3) {
|
|
8168
8252
|
const s = String(n3);
|
|
8169
8253
|
const i = s.indexOf(".");
|
|
@@ -8176,7 +8260,7 @@ window.Aura = (() => {
|
|
|
8176
8260
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
8177
8261
|
return Number(s);
|
|
8178
8262
|
}
|
|
8179
|
-
var NumberField =
|
|
8263
|
+
var NumberField = React59.forwardRef(function NumberField2(props, ref) {
|
|
8180
8264
|
const t = useStrings();
|
|
8181
8265
|
const auto = uid(), id = props.id || auto;
|
|
8182
8266
|
const step = props.step || 1;
|
|
@@ -8187,7 +8271,7 @@ window.Aura = (() => {
|
|
|
8187
8271
|
props.onChange
|
|
8188
8272
|
);
|
|
8189
8273
|
const value = st[0], setValue = st[1];
|
|
8190
|
-
const draftState =
|
|
8274
|
+
const draftState = React59.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
8191
8275
|
function fmt2(n3) {
|
|
8192
8276
|
if (n3 == null || isNaN(n3)) return "";
|
|
8193
8277
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -8236,7 +8320,7 @@ window.Aura = (() => {
|
|
|
8236
8320
|
};
|
|
8237
8321
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
8238
8322
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
8239
|
-
return /* @__PURE__ */
|
|
8323
|
+
return /* @__PURE__ */ React59.createElement(
|
|
8240
8324
|
Field,
|
|
8241
8325
|
{
|
|
8242
8326
|
id,
|
|
@@ -8248,7 +8332,7 @@ window.Aura = (() => {
|
|
|
8248
8332
|
disabled: props.disabled,
|
|
8249
8333
|
className: props.className
|
|
8250
8334
|
},
|
|
8251
|
-
/* @__PURE__ */
|
|
8335
|
+
/* @__PURE__ */ React59.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React59.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React59.createElement(
|
|
8252
8336
|
"input",
|
|
8253
8337
|
{
|
|
8254
8338
|
ref,
|
|
@@ -8295,7 +8379,7 @@ window.Aura = (() => {
|
|
|
8295
8379
|
},
|
|
8296
8380
|
onKeyDown
|
|
8297
8381
|
}
|
|
8298
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
8382
|
+
), props.suffix != null ? /* @__PURE__ */ React59.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React59.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React59.createElement(
|
|
8299
8383
|
"button",
|
|
8300
8384
|
{
|
|
8301
8385
|
type: "button",
|
|
@@ -8311,8 +8395,8 @@ window.Aura = (() => {
|
|
|
8311
8395
|
nudge(-step);
|
|
8312
8396
|
}
|
|
8313
8397
|
},
|
|
8314
|
-
/* @__PURE__ */
|
|
8315
|
-
), /* @__PURE__ */
|
|
8398
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconMinus, null) })
|
|
8399
|
+
), /* @__PURE__ */ React59.createElement(
|
|
8316
8400
|
"button",
|
|
8317
8401
|
{
|
|
8318
8402
|
type: "button",
|
|
@@ -8328,14 +8412,14 @@ window.Aura = (() => {
|
|
|
8328
8412
|
nudge(step);
|
|
8329
8413
|
}
|
|
8330
8414
|
},
|
|
8331
|
-
/* @__PURE__ */
|
|
8415
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconPlus, null) })
|
|
8332
8416
|
)) : null)
|
|
8333
8417
|
);
|
|
8334
8418
|
});
|
|
8335
8419
|
|
|
8336
8420
|
// src/Stepper.tsx
|
|
8337
|
-
var
|
|
8338
|
-
var Stepper =
|
|
8421
|
+
var React60 = __toESM(require_react(), 1);
|
|
8422
|
+
var Stepper = React60.forwardRef(function Stepper2(props, ref) {
|
|
8339
8423
|
const t = useStrings();
|
|
8340
8424
|
const steps = props.steps || [];
|
|
8341
8425
|
let at = -1;
|
|
@@ -8345,26 +8429,26 @@ window.Aura = (() => {
|
|
|
8345
8429
|
if (at < 0) at = 0;
|
|
8346
8430
|
const vertical = props.orientation === "vertical";
|
|
8347
8431
|
const cur = steps[at];
|
|
8348
|
-
return /* @__PURE__ */
|
|
8432
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8349
8433
|
"nav",
|
|
8350
8434
|
{
|
|
8351
8435
|
ref,
|
|
8352
8436
|
"aria-label": props.label,
|
|
8353
8437
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
8354
8438
|
},
|
|
8355
|
-
/* @__PURE__ */
|
|
8439
|
+
/* @__PURE__ */ React60.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
8356
8440
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
8357
|
-
const marker = /* @__PURE__ */
|
|
8358
|
-
const text2 = /* @__PURE__ */
|
|
8441
|
+
const marker = /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, state === "done" ? /* @__PURE__ */ React60.createElement(Icon, { name: /* @__PURE__ */ React60.createElement(IconCheck, null) }) : i + 1);
|
|
8442
|
+
const text2 = /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__text" }, /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__label" }, s.label, state === "done" ? /* @__PURE__ */ React60.createElement("span", { className: "aura-sr-only" }, ", " + t.stepDone) : null), s.description ? /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__desc" }, s.description) : null);
|
|
8359
8443
|
const clickable = state === "done" && !!props.onStepClick;
|
|
8360
|
-
return /* @__PURE__ */
|
|
8444
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8361
8445
|
"li",
|
|
8362
8446
|
{
|
|
8363
8447
|
key: s.id,
|
|
8364
8448
|
className: cx("aura-stepper__item", "is-" + state),
|
|
8365
8449
|
"aria-current": state === "current" ? "step" : void 0
|
|
8366
8450
|
},
|
|
8367
|
-
clickable ? /* @__PURE__ */
|
|
8451
|
+
clickable ? /* @__PURE__ */ React60.createElement(
|
|
8368
8452
|
"button",
|
|
8369
8453
|
{
|
|
8370
8454
|
type: "button",
|
|
@@ -8375,19 +8459,19 @@ window.Aura = (() => {
|
|
|
8375
8459
|
},
|
|
8376
8460
|
marker,
|
|
8377
8461
|
text2
|
|
8378
|
-
) : /* @__PURE__ */
|
|
8462
|
+
) : /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
8379
8463
|
);
|
|
8380
8464
|
})),
|
|
8381
|
-
!vertical && cur ? /* @__PURE__ */
|
|
8465
|
+
!vertical && cur ? /* @__PURE__ */ React60.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length)), /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__compact-label" }, cur.label)) : null
|
|
8382
8466
|
);
|
|
8383
8467
|
});
|
|
8384
8468
|
|
|
8385
8469
|
// src/SegmentedControl.tsx
|
|
8386
|
-
var
|
|
8470
|
+
var React61 = __toESM(require_react(), 1);
|
|
8387
8471
|
function toOpt2(o) {
|
|
8388
8472
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
8389
8473
|
}
|
|
8390
|
-
var SegmentedControl =
|
|
8474
|
+
var SegmentedControl = React61.forwardRef(
|
|
8391
8475
|
function SegmentedControl2(props, ref) {
|
|
8392
8476
|
const options = (props.options || []).map(toOpt2);
|
|
8393
8477
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -8400,7 +8484,7 @@ window.Aura = (() => {
|
|
|
8400
8484
|
);
|
|
8401
8485
|
const value = st[0], setValue = st[1];
|
|
8402
8486
|
const auto = uid(), id = props.id || auto;
|
|
8403
|
-
const refs =
|
|
8487
|
+
const refs = React61.useRef([]);
|
|
8404
8488
|
const selIdx = options.findIndex(function(o) {
|
|
8405
8489
|
return o.value === value;
|
|
8406
8490
|
});
|
|
@@ -8433,7 +8517,7 @@ window.Aura = (() => {
|
|
|
8433
8517
|
move(options.length, -1);
|
|
8434
8518
|
}
|
|
8435
8519
|
}
|
|
8436
|
-
return /* @__PURE__ */
|
|
8520
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8437
8521
|
"div",
|
|
8438
8522
|
{
|
|
8439
8523
|
ref,
|
|
@@ -8452,7 +8536,7 @@ window.Aura = (() => {
|
|
|
8452
8536
|
options.map(function(o, i) {
|
|
8453
8537
|
const on = o.value === value;
|
|
8454
8538
|
const off = props.disabled || o.disabled;
|
|
8455
|
-
return /* @__PURE__ */
|
|
8539
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8456
8540
|
"button",
|
|
8457
8541
|
{
|
|
8458
8542
|
key: o.value,
|
|
@@ -8474,8 +8558,8 @@ window.Aura = (() => {
|
|
|
8474
8558
|
onKeyDown(e, i);
|
|
8475
8559
|
}
|
|
8476
8560
|
},
|
|
8477
|
-
o.icon ? /* @__PURE__ */
|
|
8478
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
8561
|
+
o.icon ? /* @__PURE__ */ React61.createElement(Icon, { name: o.icon }) : null,
|
|
8562
|
+
o.iconOnly ? null : /* @__PURE__ */ React61.createElement("span", null, o.label)
|
|
8479
8563
|
);
|
|
8480
8564
|
})
|
|
8481
8565
|
);
|