@jirawatpyk/aura-react 5.11.0 → 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 +15 -2
- package/dist/aura.bundle.js +667 -592
- package/dist/cjs/index.cjs +666 -591
- 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 +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/styles.css +31 -0
- package/dist/styles.layer.css +31 -0
- package/package.json +1 -1
package/dist/aura.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @ds-bundle: {"format":4,"namespace":"Aura","components":[{"name":"Icon"},{"name":"Button"},{"name":"IconButton"},{"name":"Menu"},{"name":"DropdownMenu"},{"name":"Checkbox"},{"name":"StatusPill"},{"name":"TextField"},{"name":"Textarea"},{"name":"Select"},{"name":"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,
|
|
@@ -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,7 +5068,7 @@ 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;
|
|
4999
5074
|
const autoRows = props.rowHeight === "auto" && !height;
|
|
@@ -5024,7 +5099,7 @@ window.Aura = (() => {
|
|
|
5024
5099
|
if (!activeRendered) return r === 0 && c === ac ? 0 : -1;
|
|
5025
5100
|
return r === ar && c === ac ? 0 : -1;
|
|
5026
5101
|
}
|
|
5027
|
-
|
|
5102
|
+
React31.useEffect(function() {
|
|
5028
5103
|
const p = pending.current;
|
|
5029
5104
|
if (!p || !gridRef.current) return;
|
|
5030
5105
|
let c = p.c;
|
|
@@ -5224,14 +5299,14 @@ window.Aura = (() => {
|
|
|
5224
5299
|
items2.push(
|
|
5225
5300
|
{
|
|
5226
5301
|
label: t.sortAsc,
|
|
5227
|
-
icon: /* @__PURE__ */
|
|
5302
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowUp, null),
|
|
5228
5303
|
onSelect: function() {
|
|
5229
5304
|
applySort({ key: c.key, dir: "asc" });
|
|
5230
5305
|
}
|
|
5231
5306
|
},
|
|
5232
5307
|
{
|
|
5233
5308
|
label: t.sortDesc,
|
|
5234
|
-
icon: /* @__PURE__ */
|
|
5309
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowDown, null),
|
|
5235
5310
|
onSelect: function() {
|
|
5236
5311
|
applySort({ key: c.key, dir: "desc" });
|
|
5237
5312
|
}
|
|
@@ -5241,7 +5316,7 @@ window.Aura = (() => {
|
|
|
5241
5316
|
if (c.width != null)
|
|
5242
5317
|
items2.push({
|
|
5243
5318
|
label: isPinned(c) ? t.unpin : t.pin,
|
|
5244
|
-
icon: isPinned(c) ? /* @__PURE__ */
|
|
5319
|
+
icon: isPinned(c) ? /* @__PURE__ */ React31.createElement(IconPinOff, null) : /* @__PURE__ */ React31.createElement(IconPin, null),
|
|
5245
5320
|
onSelect: function() {
|
|
5246
5321
|
togglePin(c.key);
|
|
5247
5322
|
}
|
|
@@ -5250,7 +5325,7 @@ window.Aura = (() => {
|
|
|
5250
5325
|
items2.push(
|
|
5251
5326
|
{
|
|
5252
5327
|
label: t.moveLeft,
|
|
5253
|
-
icon: /* @__PURE__ */
|
|
5328
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowLeft, null),
|
|
5254
5329
|
disabled: gi <= 0,
|
|
5255
5330
|
onSelect: function() {
|
|
5256
5331
|
moveCol(c.key, -1);
|
|
@@ -5258,7 +5333,7 @@ window.Aura = (() => {
|
|
|
5258
5333
|
},
|
|
5259
5334
|
{
|
|
5260
5335
|
label: t.moveRight,
|
|
5261
|
-
icon: /* @__PURE__ */
|
|
5336
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowRight, null),
|
|
5262
5337
|
disabled: gi >= group.length - 1,
|
|
5263
5338
|
onSelect: function() {
|
|
5264
5339
|
moveCol(c.key, 1);
|
|
@@ -5269,7 +5344,7 @@ window.Aura = (() => {
|
|
|
5269
5344
|
{ separator: true },
|
|
5270
5345
|
{
|
|
5271
5346
|
label: t.hideColumn,
|
|
5272
|
-
icon: /* @__PURE__ */
|
|
5347
|
+
icon: /* @__PURE__ */ React31.createElement(IconEyeOff, null),
|
|
5273
5348
|
disabled: shown.length <= 1,
|
|
5274
5349
|
onSelect: function() {
|
|
5275
5350
|
setHidden(c.key, true);
|
|
@@ -5290,7 +5365,7 @@ window.Aura = (() => {
|
|
|
5290
5365
|
setHidden(k, on);
|
|
5291
5366
|
}
|
|
5292
5367
|
};
|
|
5293
|
-
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */
|
|
5368
|
+
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React31.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
|
|
5294
5369
|
}
|
|
5295
5370
|
function openMenu(kind, key, anchor, rc) {
|
|
5296
5371
|
setMenu({ kind, key, anchor, rc });
|
|
@@ -5366,10 +5441,10 @@ window.Aura = (() => {
|
|
|
5366
5441
|
e.stopPropagation();
|
|
5367
5442
|
}
|
|
5368
5443
|
}
|
|
5369
|
-
const head = [/* @__PURE__ */
|
|
5444
|
+
const head = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5370
5445
|
if (selectable)
|
|
5371
5446
|
head.push(
|
|
5372
|
-
/* @__PURE__ */
|
|
5447
|
+
/* @__PURE__ */ React31.createElement(
|
|
5373
5448
|
"span",
|
|
5374
5449
|
{
|
|
5375
5450
|
key: "__sel",
|
|
@@ -5383,7 +5458,7 @@ window.Aura = (() => {
|
|
|
5383
5458
|
activeState[1]({ r: 0, c: 0 });
|
|
5384
5459
|
}
|
|
5385
5460
|
},
|
|
5386
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5461
|
+
pageKeys.length ? /* @__PURE__ */ React31.createElement(
|
|
5387
5462
|
Checkbox,
|
|
5388
5463
|
{
|
|
5389
5464
|
hideLabel: true,
|
|
@@ -5394,7 +5469,7 @@ window.Aura = (() => {
|
|
|
5394
5469
|
onChange: toggleAll
|
|
5395
5470
|
}
|
|
5396
5471
|
) : null,
|
|
5397
|
-
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)
|
|
5398
5473
|
)
|
|
5399
5474
|
);
|
|
5400
5475
|
vis.forEach(function(c, i) {
|
|
@@ -5404,7 +5479,7 @@ window.Aura = (() => {
|
|
|
5404
5479
|
const ariaSort = isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0;
|
|
5405
5480
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
5406
5481
|
head.push(
|
|
5407
|
-
/* @__PURE__ */
|
|
5482
|
+
/* @__PURE__ */ React31.createElement(
|
|
5408
5483
|
"span",
|
|
5409
5484
|
{
|
|
5410
5485
|
key: c.key,
|
|
@@ -5454,7 +5529,7 @@ window.Aura = (() => {
|
|
|
5454
5529
|
setDrag(null);
|
|
5455
5530
|
}
|
|
5456
5531
|
},
|
|
5457
|
-
/* @__PURE__ */
|
|
5532
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React31.createElement(
|
|
5458
5533
|
"button",
|
|
5459
5534
|
{
|
|
5460
5535
|
type: "button",
|
|
@@ -5466,14 +5541,14 @@ window.Aura = (() => {
|
|
|
5466
5541
|
}
|
|
5467
5542
|
},
|
|
5468
5543
|
c.label,
|
|
5469
|
-
/* @__PURE__ */
|
|
5544
|
+
/* @__PURE__ */ React31.createElement(
|
|
5470
5545
|
Icon,
|
|
5471
5546
|
{
|
|
5472
|
-
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),
|
|
5473
5548
|
size: 12
|
|
5474
5549
|
}
|
|
5475
5550
|
)
|
|
5476
|
-
) : /* @__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(
|
|
5477
5552
|
"button",
|
|
5478
5553
|
{
|
|
5479
5554
|
type: "button",
|
|
@@ -5487,9 +5562,9 @@ window.Aura = (() => {
|
|
|
5487
5562
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
5488
5563
|
}
|
|
5489
5564
|
},
|
|
5490
|
-
/* @__PURE__ */
|
|
5565
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconEllipsis, null) })
|
|
5491
5566
|
) : null),
|
|
5492
|
-
canResize(c) ? /* @__PURE__ */
|
|
5567
|
+
canResize(c) ? /* @__PURE__ */ React31.createElement(
|
|
5493
5568
|
"span",
|
|
5494
5569
|
{
|
|
5495
5570
|
className: "aura-table__resize",
|
|
@@ -5511,7 +5586,7 @@ window.Aura = (() => {
|
|
|
5511
5586
|
);
|
|
5512
5587
|
});
|
|
5513
5588
|
head.push(
|
|
5514
|
-
/* @__PURE__ */
|
|
5589
|
+
/* @__PURE__ */ React31.createElement(
|
|
5515
5590
|
"span",
|
|
5516
5591
|
{
|
|
5517
5592
|
key: "__gr",
|
|
@@ -5522,15 +5597,15 @@ window.Aura = (() => {
|
|
|
5522
5597
|
);
|
|
5523
5598
|
function cellContent(c, r) {
|
|
5524
5599
|
const v = r[c.key];
|
|
5525
|
-
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;
|
|
5526
5601
|
}
|
|
5527
5602
|
function rowCells(r, i, k, isSel) {
|
|
5528
5603
|
const ri = i + 1;
|
|
5529
5604
|
const selLabel = selectable && canSelect(r) ? props.rowSelectLabel && props.rowSelectLabel(r) || t.selectRow(k) : void 0;
|
|
5530
|
-
const cells = [/* @__PURE__ */
|
|
5605
|
+
const cells = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5531
5606
|
if (selectable)
|
|
5532
5607
|
cells.push(
|
|
5533
|
-
/* @__PURE__ */
|
|
5608
|
+
/* @__PURE__ */ React31.createElement(
|
|
5534
5609
|
"span",
|
|
5535
5610
|
{
|
|
5536
5611
|
key: "__sel",
|
|
@@ -5544,7 +5619,7 @@ window.Aura = (() => {
|
|
|
5544
5619
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
5545
5620
|
}
|
|
5546
5621
|
},
|
|
5547
|
-
canSelect(r) ? /* @__PURE__ */
|
|
5622
|
+
canSelect(r) ? /* @__PURE__ */ React31.createElement(
|
|
5548
5623
|
Checkbox,
|
|
5549
5624
|
{
|
|
5550
5625
|
hideLabel: true,
|
|
@@ -5561,7 +5636,7 @@ window.Aura = (() => {
|
|
|
5561
5636
|
vis.forEach(function(c, j) {
|
|
5562
5637
|
const ci = j + (selectable ? 1 : 0), v = r[c.key], pin = isPinned(c);
|
|
5563
5638
|
cells.push(
|
|
5564
|
-
/* @__PURE__ */
|
|
5639
|
+
/* @__PURE__ */ React31.createElement(
|
|
5565
5640
|
"span",
|
|
5566
5641
|
{
|
|
5567
5642
|
key: c.key,
|
|
@@ -5583,13 +5658,13 @@ window.Aura = (() => {
|
|
|
5583
5658
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
5584
5659
|
}
|
|
5585
5660
|
},
|
|
5586
|
-
autoRows ? /* @__PURE__ */
|
|
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)
|
|
5587
5662
|
)
|
|
5588
5663
|
);
|
|
5589
5664
|
});
|
|
5590
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
5665
|
+
if (hasFields) cells.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
5591
5666
|
cells.push(
|
|
5592
|
-
/* @__PURE__ */
|
|
5667
|
+
/* @__PURE__ */ React31.createElement(
|
|
5593
5668
|
"span",
|
|
5594
5669
|
{
|
|
5595
5670
|
key: "__gr",
|
|
@@ -5606,14 +5681,14 @@ window.Aura = (() => {
|
|
|
5606
5681
|
const n3 = pageSize || props.skeletonRows || 5;
|
|
5607
5682
|
const skRows = body = [];
|
|
5608
5683
|
for (let i = 0; i < n3; i++) {
|
|
5609
|
-
const sk = [/* @__PURE__ */
|
|
5684
|
+
const sk = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
5610
5685
|
if (selectable)
|
|
5611
5686
|
sk.push(
|
|
5612
|
-
/* @__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" }))
|
|
5613
5688
|
);
|
|
5614
5689
|
vis.forEach(function(c, j) {
|
|
5615
5690
|
sk.push(
|
|
5616
|
-
/* @__PURE__ */
|
|
5691
|
+
/* @__PURE__ */ React31.createElement(
|
|
5617
5692
|
"span",
|
|
5618
5693
|
{
|
|
5619
5694
|
key: c.key,
|
|
@@ -5622,7 +5697,7 @@ window.Aura = (() => {
|
|
|
5622
5697
|
...cardAttrs(c, j),
|
|
5623
5698
|
"data-label": void 0
|
|
5624
5699
|
},
|
|
5625
|
-
/* @__PURE__ */
|
|
5700
|
+
/* @__PURE__ */ React31.createElement(
|
|
5626
5701
|
"span",
|
|
5627
5702
|
{
|
|
5628
5703
|
className: cx("aura-skel", c.pill && "aura-skel--pill"),
|
|
@@ -5632,28 +5707,28 @@ window.Aura = (() => {
|
|
|
5632
5707
|
)
|
|
5633
5708
|
);
|
|
5634
5709
|
});
|
|
5635
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
5710
|
+
if (hasFields) sk.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
5636
5711
|
sk.push(
|
|
5637
|
-
/* @__PURE__ */
|
|
5712
|
+
/* @__PURE__ */ React31.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
5638
5713
|
);
|
|
5639
5714
|
skRows.push(
|
|
5640
|
-
/* @__PURE__ */
|
|
5715
|
+
/* @__PURE__ */ React31.createElement("div", { key: "sk" + i, className: "aura-table__row aura-table__row--skeleton", "aria-hidden": true, style: rowStyle }, sk)
|
|
5641
5716
|
);
|
|
5642
5717
|
}
|
|
5643
5718
|
} else if (!rows.length) {
|
|
5644
5719
|
const em = props.empty || {};
|
|
5645
|
-
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));
|
|
5646
5721
|
} else {
|
|
5647
5722
|
const bodyRows = body = [];
|
|
5648
5723
|
if (virtual && start > 0)
|
|
5649
5724
|
bodyRows.push(
|
|
5650
|
-
/* @__PURE__ */
|
|
5725
|
+
/* @__PURE__ */ React31.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
5651
5726
|
);
|
|
5652
5727
|
for (let ri = start; ri < end; ri++) {
|
|
5653
5728
|
(function(r, i) {
|
|
5654
5729
|
const k = r[rowKey], isSel = !!selSet[k];
|
|
5655
5730
|
bodyRows.push(
|
|
5656
|
-
/* @__PURE__ */
|
|
5731
|
+
/* @__PURE__ */ React31.createElement(
|
|
5657
5732
|
"div",
|
|
5658
5733
|
{
|
|
5659
5734
|
key: k,
|
|
@@ -5681,7 +5756,7 @@ window.Aura = (() => {
|
|
|
5681
5756
|
}
|
|
5682
5757
|
if (virtual && end < pageRows.length)
|
|
5683
5758
|
bodyRows.push(
|
|
5684
|
-
/* @__PURE__ */
|
|
5759
|
+
/* @__PURE__ */ React31.createElement(
|
|
5685
5760
|
"div",
|
|
5686
5761
|
{
|
|
5687
5762
|
key: "__bot",
|
|
@@ -5694,9 +5769,9 @@ window.Aura = (() => {
|
|
|
5694
5769
|
}
|
|
5695
5770
|
let foot = null;
|
|
5696
5771
|
function pagerButton(dir) {
|
|
5697
|
-
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);
|
|
5698
5773
|
if (props.getPageHref && !off)
|
|
5699
|
-
return /* @__PURE__ */
|
|
5774
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5700
5775
|
Link,
|
|
5701
5776
|
{
|
|
5702
5777
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -5711,9 +5786,9 @@ window.Aura = (() => {
|
|
|
5711
5786
|
}
|
|
5712
5787
|
}
|
|
5713
5788
|
},
|
|
5714
|
-
/* @__PURE__ */
|
|
5789
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: icon })
|
|
5715
5790
|
);
|
|
5716
|
-
return /* @__PURE__ */
|
|
5791
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5717
5792
|
IconButton,
|
|
5718
5793
|
{
|
|
5719
5794
|
icon,
|
|
@@ -5728,11 +5803,11 @@ window.Aura = (() => {
|
|
|
5728
5803
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
5729
5804
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
5730
5805
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
5731
|
-
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)));
|
|
5732
5807
|
} else if (height && rows.length && !loading) {
|
|
5733
|
-
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));
|
|
5734
5809
|
}
|
|
5735
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
5810
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React31.createElement(
|
|
5736
5811
|
"div",
|
|
5737
5812
|
{
|
|
5738
5813
|
role: "row",
|
|
@@ -5741,8 +5816,8 @@ window.Aura = (() => {
|
|
|
5741
5816
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
5742
5817
|
style: rowStyle
|
|
5743
5818
|
},
|
|
5744
|
-
/* @__PURE__ */
|
|
5745
|
-
selectable ? /* @__PURE__ */
|
|
5819
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
5820
|
+
selectable ? /* @__PURE__ */ React31.createElement(
|
|
5746
5821
|
"span",
|
|
5747
5822
|
{
|
|
5748
5823
|
role: "gridcell",
|
|
@@ -5757,7 +5832,7 @@ window.Aura = (() => {
|
|
|
5757
5832
|
) : null,
|
|
5758
5833
|
vis.map(function(c, j) {
|
|
5759
5834
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
5760
|
-
return /* @__PURE__ */
|
|
5835
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5761
5836
|
"span",
|
|
5762
5837
|
{
|
|
5763
5838
|
key: c.key,
|
|
@@ -5783,8 +5858,8 @@ window.Aura = (() => {
|
|
|
5783
5858
|
props.footer[c.key]
|
|
5784
5859
|
);
|
|
5785
5860
|
}),
|
|
5786
|
-
hasFields ? /* @__PURE__ */
|
|
5787
|
-
/* @__PURE__ */
|
|
5861
|
+
hasFields ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
5862
|
+
/* @__PURE__ */ React31.createElement(
|
|
5788
5863
|
"span",
|
|
5789
5864
|
{
|
|
5790
5865
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -5798,7 +5873,7 @@ window.Aura = (() => {
|
|
|
5798
5873
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
5799
5874
|
};
|
|
5800
5875
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
5801
|
-
const gridEl = /* @__PURE__ */
|
|
5876
|
+
const gridEl = /* @__PURE__ */ React31.createElement(
|
|
5802
5877
|
"div",
|
|
5803
5878
|
{
|
|
5804
5879
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -5812,8 +5887,8 @@ window.Aura = (() => {
|
|
|
5812
5887
|
),
|
|
5813
5888
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
5814
5889
|
},
|
|
5815
|
-
refreshing ? /* @__PURE__ */
|
|
5816
|
-
/* @__PURE__ */
|
|
5890
|
+
refreshing ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
5891
|
+
/* @__PURE__ */ React31.createElement(
|
|
5817
5892
|
"div",
|
|
5818
5893
|
{
|
|
5819
5894
|
ref: function(el) {
|
|
@@ -5842,7 +5917,7 @@ window.Aura = (() => {
|
|
|
5842
5917
|
if (sx !== scrolledX[0]) scrolledX[1](sx);
|
|
5843
5918
|
}
|
|
5844
5919
|
},
|
|
5845
|
-
/* @__PURE__ */
|
|
5920
|
+
/* @__PURE__ */ React31.createElement(
|
|
5846
5921
|
"div",
|
|
5847
5922
|
{
|
|
5848
5923
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -5855,11 +5930,11 @@ window.Aura = (() => {
|
|
|
5855
5930
|
body,
|
|
5856
5931
|
totalRow
|
|
5857
5932
|
),
|
|
5858
|
-
busy ? /* @__PURE__ */
|
|
5859
|
-
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(
|
|
5860
5935
|
IconButton,
|
|
5861
5936
|
{
|
|
5862
|
-
icon: /* @__PURE__ */
|
|
5937
|
+
icon: /* @__PURE__ */ React31.createElement(IconColumns3, null),
|
|
5863
5938
|
label: t.showHideColumns,
|
|
5864
5939
|
"aria-haspopup": "menu",
|
|
5865
5940
|
onClick: function(e) {
|
|
@@ -5868,7 +5943,7 @@ window.Aura = (() => {
|
|
|
5868
5943
|
}
|
|
5869
5944
|
)) : null,
|
|
5870
5945
|
foot,
|
|
5871
|
-
menu ? /* @__PURE__ */
|
|
5946
|
+
menu ? /* @__PURE__ */ React31.createElement(
|
|
5872
5947
|
Menu,
|
|
5873
5948
|
{
|
|
5874
5949
|
anchor: menu.anchor,
|
|
@@ -5878,13 +5953,13 @@ window.Aura = (() => {
|
|
|
5878
5953
|
}
|
|
5879
5954
|
) : null,
|
|
5880
5955
|
tipEl,
|
|
5881
|
-
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
|
|
5882
5957
|
);
|
|
5883
5958
|
if (!levels.length) return gridEl;
|
|
5884
5959
|
let out = gridEl;
|
|
5885
5960
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
5886
5961
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
5887
|
-
out = /* @__PURE__ */
|
|
5962
|
+
out = /* @__PURE__ */ React31.createElement(
|
|
5888
5963
|
"div",
|
|
5889
5964
|
{
|
|
5890
5965
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -5893,19 +5968,19 @@ window.Aura = (() => {
|
|
|
5893
5968
|
out
|
|
5894
5969
|
);
|
|
5895
5970
|
}
|
|
5896
|
-
return /* @__PURE__ */
|
|
5971
|
+
return /* @__PURE__ */ React31.createElement("div", { ref, className: cx("aura-table-box", props.className) }, out);
|
|
5897
5972
|
});
|
|
5898
5973
|
var DataTable2 = DataTableImpl;
|
|
5899
5974
|
|
|
5900
5975
|
// src/Card.tsx
|
|
5901
|
-
var
|
|
5902
|
-
var Card =
|
|
5976
|
+
var React32 = __toESM(require_react(), 1);
|
|
5977
|
+
var Card = React32.forwardRef(function Card2(props, ref) {
|
|
5903
5978
|
return cardElement(props, ref);
|
|
5904
5979
|
});
|
|
5905
5980
|
|
|
5906
5981
|
// src/Tabs.tsx
|
|
5907
|
-
var
|
|
5908
|
-
var Tabs =
|
|
5982
|
+
var React33 = __toESM(require_react(), 1);
|
|
5983
|
+
var Tabs = React33.forwardRef(function Tabs2(props, ref) {
|
|
5909
5984
|
const items2 = props.tabs || [], base = uid();
|
|
5910
5985
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
5911
5986
|
return !!t.href;
|
|
@@ -5919,7 +5994,7 @@ window.Aura = (() => {
|
|
|
5919
5994
|
props.onChange
|
|
5920
5995
|
);
|
|
5921
5996
|
const cur = asLinks && "value" in props ? props.value : st[0];
|
|
5922
|
-
const refs =
|
|
5997
|
+
const refs = React33.useRef({});
|
|
5923
5998
|
const current2 = items2.filter(function(t) {
|
|
5924
5999
|
return t.id === cur;
|
|
5925
6000
|
})[0] || firstOn || items2[0];
|
|
@@ -5931,7 +6006,7 @@ window.Aura = (() => {
|
|
|
5931
6006
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
5932
6007
|
};
|
|
5933
6008
|
const rootCls = cx("aura-tabs", seg && "aura-tabs--segmented");
|
|
5934
|
-
const [focusId, setFocusId] =
|
|
6009
|
+
const [focusId, setFocusId] = React33.useState(null);
|
|
5935
6010
|
items2.forEach(function(t) {
|
|
5936
6011
|
const al = t.tabProps && t.tabProps["aria-label"];
|
|
5937
6012
|
if (al && al.toLowerCase().indexOf(String(t.label).toLowerCase()) !== 0)
|
|
@@ -5941,19 +6016,19 @@ window.Aura = (() => {
|
|
|
5941
6016
|
);
|
|
5942
6017
|
});
|
|
5943
6018
|
if (asLinks)
|
|
5944
|
-
return /* @__PURE__ */
|
|
6019
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5945
6020
|
"nav",
|
|
5946
6021
|
{
|
|
5947
6022
|
ref,
|
|
5948
6023
|
"aria-label": props.label,
|
|
5949
6024
|
className: cx(rootCls, "aura-tabs--links", props.className)
|
|
5950
6025
|
},
|
|
5951
|
-
/* @__PURE__ */
|
|
6026
|
+
/* @__PURE__ */ React33.createElement("div", { className: listCls }, items2.map(function(t) {
|
|
5952
6027
|
const on = t.id === cur;
|
|
5953
6028
|
const inner = [
|
|
5954
|
-
t.icon ? /* @__PURE__ */
|
|
6029
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
5955
6030
|
t.label,
|
|
5956
|
-
t.count != null ? /* @__PURE__ */
|
|
6031
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
5957
6032
|
];
|
|
5958
6033
|
const own = omit(t.tabProps || {}, [
|
|
5959
6034
|
"type",
|
|
@@ -5967,7 +6042,7 @@ window.Aura = (() => {
|
|
|
5967
6042
|
"name",
|
|
5968
6043
|
"value"
|
|
5969
6044
|
]);
|
|
5970
|
-
return t.disabled ? /* @__PURE__ */
|
|
6045
|
+
return t.disabled ? /* @__PURE__ */ React33.createElement(
|
|
5971
6046
|
"span",
|
|
5972
6047
|
{
|
|
5973
6048
|
...omit(own, ["onClick"]),
|
|
@@ -5976,7 +6051,7 @@ window.Aura = (() => {
|
|
|
5976
6051
|
"aria-disabled": true
|
|
5977
6052
|
},
|
|
5978
6053
|
inner
|
|
5979
|
-
) : /* @__PURE__ */
|
|
6054
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
5980
6055
|
Link,
|
|
5981
6056
|
{
|
|
5982
6057
|
...own,
|
|
@@ -6006,7 +6081,7 @@ window.Aura = (() => {
|
|
|
6006
6081
|
const stop = manual && focusId && items2.filter(function(t) {
|
|
6007
6082
|
return t.id === focusId && !t.disabled;
|
|
6008
6083
|
})[0] || current2;
|
|
6009
|
-
return /* @__PURE__ */
|
|
6084
|
+
return /* @__PURE__ */ React33.createElement("div", { ref, className: cx(rootCls, props.className) }, /* @__PURE__ */ React33.createElement(
|
|
6010
6085
|
"div",
|
|
6011
6086
|
{
|
|
6012
6087
|
role: "tablist",
|
|
@@ -6039,7 +6114,7 @@ window.Aura = (() => {
|
|
|
6039
6114
|
items2.map(function(t) {
|
|
6040
6115
|
const on = current2 && t.id === current2.id;
|
|
6041
6116
|
const own = t.tabProps || {};
|
|
6042
|
-
return /* @__PURE__ */
|
|
6117
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6043
6118
|
"button",
|
|
6044
6119
|
{
|
|
6045
6120
|
...own,
|
|
@@ -6066,9 +6141,9 @@ window.Aura = (() => {
|
|
|
6066
6141
|
st[1](t.id);
|
|
6067
6142
|
}
|
|
6068
6143
|
},
|
|
6069
|
-
t.icon ? /* @__PURE__ */
|
|
6144
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { name: t.icon }) : null,
|
|
6070
6145
|
t.label,
|
|
6071
|
-
t.count != null ? /* @__PURE__ */
|
|
6146
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
6072
6147
|
);
|
|
6073
6148
|
})
|
|
6074
6149
|
), props.keepMounted ? (
|
|
@@ -6076,7 +6151,7 @@ window.Aura = (() => {
|
|
|
6076
6151
|
items2.map(function(t) {
|
|
6077
6152
|
if (t.content === void 0) return null;
|
|
6078
6153
|
const on = current2 && t.id === current2.id;
|
|
6079
|
-
return /* @__PURE__ */
|
|
6154
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6080
6155
|
"div",
|
|
6081
6156
|
{
|
|
6082
6157
|
key: t.id,
|
|
@@ -6090,7 +6165,7 @@ window.Aura = (() => {
|
|
|
6090
6165
|
t.content
|
|
6091
6166
|
);
|
|
6092
6167
|
})
|
|
6093
|
-
) : current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
6168
|
+
) : current2 && current2.content !== void 0 ? /* @__PURE__ */ React33.createElement(
|
|
6094
6169
|
"div",
|
|
6095
6170
|
{
|
|
6096
6171
|
role: "tabpanel",
|
|
@@ -6104,14 +6179,14 @@ window.Aura = (() => {
|
|
|
6104
6179
|
});
|
|
6105
6180
|
|
|
6106
6181
|
// src/SideNav.tsx
|
|
6107
|
-
var
|
|
6182
|
+
var React34 = __toESM(require_react(), 1);
|
|
6108
6183
|
var import_react_dom10 = __toESM(require_react_dom(), 1);
|
|
6109
6184
|
function contains(it, id) {
|
|
6110
6185
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
6111
6186
|
return c.id === id || contains(c, id);
|
|
6112
6187
|
});
|
|
6113
6188
|
}
|
|
6114
|
-
var SideNav =
|
|
6189
|
+
var SideNav = React34.forwardRef(function SideNav2(props, ref) {
|
|
6115
6190
|
const t = useStrings();
|
|
6116
6191
|
const Link = useLinkComponent(props.linkComponent);
|
|
6117
6192
|
const base = uid();
|
|
@@ -6123,14 +6198,14 @@ window.Aura = (() => {
|
|
|
6123
6198
|
const active = st[0];
|
|
6124
6199
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
6125
6200
|
const collapsed = col[0];
|
|
6126
|
-
const tipState =
|
|
6127
|
-
|
|
6201
|
+
const tipState = React34.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
6202
|
+
React34.useEffect(
|
|
6128
6203
|
function() {
|
|
6129
6204
|
if (!collapsed) setTip(null);
|
|
6130
6205
|
},
|
|
6131
6206
|
[collapsed]
|
|
6132
6207
|
);
|
|
6133
|
-
|
|
6208
|
+
React34.useEffect(
|
|
6134
6209
|
function() {
|
|
6135
6210
|
if (!tip) return;
|
|
6136
6211
|
function esc(e) {
|
|
@@ -6155,12 +6230,12 @@ window.Aura = (() => {
|
|
|
6155
6230
|
return { onMouseEnter: show2, onFocus: show2, onMouseLeave: hide, onBlur: hide };
|
|
6156
6231
|
}
|
|
6157
6232
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
6158
|
-
const openState =
|
|
6233
|
+
const openState = React34.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
6159
6234
|
function isOpen(it) {
|
|
6160
6235
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
6161
6236
|
return !!it.defaultOpen || contains(it, active);
|
|
6162
6237
|
}
|
|
6163
|
-
|
|
6238
|
+
React34.useEffect(
|
|
6164
6239
|
function() {
|
|
6165
6240
|
if (!active) return;
|
|
6166
6241
|
const next = {};
|
|
@@ -6182,7 +6257,7 @@ window.Aura = (() => {
|
|
|
6182
6257
|
},
|
|
6183
6258
|
[active]
|
|
6184
6259
|
);
|
|
6185
|
-
const navRef =
|
|
6260
|
+
const navRef = React34.useRef(null);
|
|
6186
6261
|
function onKeyDown(e) {
|
|
6187
6262
|
const k = e.key;
|
|
6188
6263
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -6201,12 +6276,12 @@ window.Aura = (() => {
|
|
|
6201
6276
|
function inner(it, group, open) {
|
|
6202
6277
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
6203
6278
|
return [
|
|
6204
|
-
it.icon ? /* @__PURE__ */
|
|
6205
|
-
collapsed && marked ? /* @__PURE__ */
|
|
6206
|
-
/* @__PURE__ */
|
|
6207
|
-
it.badge != null ? /* @__PURE__ */
|
|
6208
|
-
it.count != null ? /* @__PURE__ */
|
|
6209
|
-
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
|
|
6210
6285
|
];
|
|
6211
6286
|
}
|
|
6212
6287
|
function item(it, depth) {
|
|
@@ -6214,7 +6289,7 @@ window.Aura = (() => {
|
|
|
6214
6289
|
const open = !collapsed && isOpen(it);
|
|
6215
6290
|
const listId = base + "-" + it.id;
|
|
6216
6291
|
const holdsActive = contains(it, active);
|
|
6217
|
-
return /* @__PURE__ */
|
|
6292
|
+
return /* @__PURE__ */ React34.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React34.createElement(
|
|
6218
6293
|
"button",
|
|
6219
6294
|
{
|
|
6220
6295
|
type: "button",
|
|
@@ -6243,7 +6318,7 @@ window.Aura = (() => {
|
|
|
6243
6318
|
}
|
|
6244
6319
|
},
|
|
6245
6320
|
inner(it, true, open)
|
|
6246
|
-
), /* @__PURE__ */
|
|
6321
|
+
), /* @__PURE__ */ React34.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
6247
6322
|
return item(c, depth + 1);
|
|
6248
6323
|
})));
|
|
6249
6324
|
}
|
|
@@ -6259,9 +6334,9 @@ window.Aura = (() => {
|
|
|
6259
6334
|
st[1](it.id);
|
|
6260
6335
|
}
|
|
6261
6336
|
};
|
|
6262
|
-
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)));
|
|
6263
6338
|
}
|
|
6264
|
-
return /* @__PURE__ */
|
|
6339
|
+
return /* @__PURE__ */ React34.createElement(
|
|
6265
6340
|
"nav",
|
|
6266
6341
|
{
|
|
6267
6342
|
ref: function(el) {
|
|
@@ -6279,17 +6354,17 @@ window.Aura = (() => {
|
|
|
6279
6354
|
"aria-label": props.label || t.mainNav,
|
|
6280
6355
|
onKeyDown
|
|
6281
6356
|
},
|
|
6282
|
-
props.header ? /* @__PURE__ */
|
|
6283
|
-
/* @__PURE__ */
|
|
6284
|
-
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) {
|
|
6285
6360
|
return item(it, 0);
|
|
6286
6361
|
})));
|
|
6287
6362
|
})),
|
|
6288
|
-
props.footer ? /* @__PURE__ */
|
|
6289
|
-
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(
|
|
6290
6365
|
IconButton,
|
|
6291
6366
|
{
|
|
6292
|
-
icon: collapsed ? /* @__PURE__ */
|
|
6367
|
+
icon: collapsed ? /* @__PURE__ */ React34.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React34.createElement(IconPanelLeftClose, null),
|
|
6293
6368
|
label: collapsed ? t.expandNav : t.collapseNav,
|
|
6294
6369
|
size: "md",
|
|
6295
6370
|
onClick: function() {
|
|
@@ -6299,7 +6374,7 @@ window.Aura = (() => {
|
|
|
6299
6374
|
}
|
|
6300
6375
|
)) : null,
|
|
6301
6376
|
tip && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
6302
|
-
/* @__PURE__ */
|
|
6377
|
+
/* @__PURE__ */ React34.createElement(
|
|
6303
6378
|
"div",
|
|
6304
6379
|
{
|
|
6305
6380
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -6314,35 +6389,35 @@ window.Aura = (() => {
|
|
|
6314
6389
|
});
|
|
6315
6390
|
|
|
6316
6391
|
// src/Breadcrumb.tsx
|
|
6317
|
-
var
|
|
6318
|
-
var Breadcrumb =
|
|
6392
|
+
var React35 = __toESM(require_react(), 1);
|
|
6393
|
+
var Breadcrumb = React35.forwardRef(function Breadcrumb2(props, ref) {
|
|
6319
6394
|
const t = useStrings();
|
|
6320
6395
|
const Link = useLinkComponent(props.linkComponent);
|
|
6321
6396
|
const items2 = props.items || [];
|
|
6322
|
-
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) {
|
|
6323
6398
|
const last = i === items2.length - 1;
|
|
6324
|
-
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) : (
|
|
6325
6400
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
6326
|
-
/* @__PURE__ */
|
|
6327
|
-
), 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" }));
|
|
6328
6403
|
})));
|
|
6329
6404
|
});
|
|
6330
6405
|
|
|
6331
6406
|
// src/Avatar.tsx
|
|
6332
|
-
var
|
|
6407
|
+
var React36 = __toESM(require_react(), 1);
|
|
6333
6408
|
var AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
|
|
6334
6409
|
function initials(name) {
|
|
6335
6410
|
const parts = String(name || "?").trim().split(/\s+/);
|
|
6336
6411
|
return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
|
|
6337
6412
|
}
|
|
6338
|
-
var Avatar =
|
|
6339
|
-
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);
|
|
6340
6415
|
let hash = 0;
|
|
6341
6416
|
String(props.name || "").split("").forEach(function(ch) {
|
|
6342
6417
|
hash = hash * 31 + ch.charCodeAt(0) >>> 0;
|
|
6343
6418
|
});
|
|
6344
6419
|
const tone2 = AVATAR_TONES[hash % AVATAR_TONES.length];
|
|
6345
|
-
return /* @__PURE__ */
|
|
6420
|
+
return /* @__PURE__ */ React36.createElement(
|
|
6346
6421
|
"span",
|
|
6347
6422
|
{
|
|
6348
6423
|
ref,
|
|
@@ -6350,7 +6425,7 @@ window.Aura = (() => {
|
|
|
6350
6425
|
role: "img",
|
|
6351
6426
|
"aria-label": props.name + (props.status ? ", " + props.status : "")
|
|
6352
6427
|
},
|
|
6353
|
-
props.src && errState[0] !== props.src ? /* @__PURE__ */
|
|
6428
|
+
props.src && errState[0] !== props.src ? /* @__PURE__ */ React36.createElement(
|
|
6354
6429
|
"img",
|
|
6355
6430
|
{
|
|
6356
6431
|
key: props.src,
|
|
@@ -6360,16 +6435,16 @@ window.Aura = (() => {
|
|
|
6360
6435
|
errState[1](props.src || null);
|
|
6361
6436
|
}
|
|
6362
6437
|
}
|
|
6363
|
-
) : /* @__PURE__ */
|
|
6364
|
-
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
|
|
6365
6440
|
);
|
|
6366
6441
|
});
|
|
6367
6442
|
|
|
6368
6443
|
// src/Stack.tsx
|
|
6369
|
-
var
|
|
6444
|
+
var React38 = __toESM(require_react(), 1);
|
|
6370
6445
|
|
|
6371
6446
|
// src/responsive.tsx
|
|
6372
|
-
var
|
|
6447
|
+
var React37 = __toESM(require_react(), 1);
|
|
6373
6448
|
|
|
6374
6449
|
// src/breakpoints.ts
|
|
6375
6450
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
@@ -6377,7 +6452,7 @@ window.Aura = (() => {
|
|
|
6377
6452
|
// src/responsive.tsx
|
|
6378
6453
|
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
6379
6454
|
function useBreakpoint() {
|
|
6380
|
-
return
|
|
6455
|
+
return React37.useSyncExternalStore(subscribe, current, function() {
|
|
6381
6456
|
return "lg";
|
|
6382
6457
|
});
|
|
6383
6458
|
}
|
|
@@ -6417,8 +6492,8 @@ window.Aura = (() => {
|
|
|
6417
6492
|
};
|
|
6418
6493
|
|
|
6419
6494
|
// src/Stack.tsx
|
|
6420
|
-
var h5 =
|
|
6421
|
-
var Stack =
|
|
6495
|
+
var h5 = React38.createElement;
|
|
6496
|
+
var Stack = React38.forwardRef(function Stack2(props, ref) {
|
|
6422
6497
|
const style = Object.assign(
|
|
6423
6498
|
{},
|
|
6424
6499
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -6432,9 +6507,9 @@ window.Aura = (() => {
|
|
|
6432
6507
|
});
|
|
6433
6508
|
|
|
6434
6509
|
// src/Grid.tsx
|
|
6435
|
-
var
|
|
6436
|
-
var h6 =
|
|
6437
|
-
var Grid =
|
|
6510
|
+
var React39 = __toESM(require_react(), 1);
|
|
6511
|
+
var h6 = React39.createElement;
|
|
6512
|
+
var Grid = React39.forwardRef(function Grid2(props, ref) {
|
|
6438
6513
|
const style = Object.assign(
|
|
6439
6514
|
{},
|
|
6440
6515
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -6449,9 +6524,9 @@ window.Aura = (() => {
|
|
|
6449
6524
|
});
|
|
6450
6525
|
|
|
6451
6526
|
// src/Container.tsx
|
|
6452
|
-
var
|
|
6453
|
-
var h7 =
|
|
6454
|
-
var Container =
|
|
6527
|
+
var React40 = __toESM(require_react(), 1);
|
|
6528
|
+
var h7 = React40.createElement;
|
|
6529
|
+
var Container = React40.forwardRef(function Container2(props, ref) {
|
|
6455
6530
|
return h7(
|
|
6456
6531
|
props.as || "div",
|
|
6457
6532
|
{
|
|
@@ -6464,27 +6539,27 @@ window.Aura = (() => {
|
|
|
6464
6539
|
});
|
|
6465
6540
|
|
|
6466
6541
|
// src/AppShell.tsx
|
|
6467
|
-
var
|
|
6468
|
-
var AppShell =
|
|
6542
|
+
var React41 = __toESM(require_react(), 1);
|
|
6543
|
+
var AppShell = React41.forwardRef(function AppShell2(props, ref) {
|
|
6469
6544
|
const t = useStrings();
|
|
6470
6545
|
const bp = useBreakpoint();
|
|
6471
6546
|
const wide = bp === "lg" || bp === "xl";
|
|
6472
|
-
const st =
|
|
6473
|
-
|
|
6547
|
+
const st = React41.useState(false), open = st[0], setOpen = st[1];
|
|
6548
|
+
React41.useEffect(
|
|
6474
6549
|
function() {
|
|
6475
6550
|
if (wide) setOpen(false);
|
|
6476
6551
|
},
|
|
6477
6552
|
[wide]
|
|
6478
6553
|
);
|
|
6479
|
-
const navEl = props.nav &&
|
|
6554
|
+
const navEl = props.nav && React41.isValidElement(props.nav) ? props.nav : null;
|
|
6480
6555
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
6481
|
-
const navState =
|
|
6556
|
+
const navState = React41.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
6482
6557
|
function onNav(id) {
|
|
6483
6558
|
if (shared) navState[1](id);
|
|
6484
6559
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
6485
6560
|
}
|
|
6486
|
-
const deskNav = navEl && shared ?
|
|
6487
|
-
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, {
|
|
6488
6563
|
value: shared ? navState[0] : navEl.props.value,
|
|
6489
6564
|
onChange: function(id) {
|
|
6490
6565
|
onNav(id);
|
|
@@ -6494,7 +6569,7 @@ window.Aura = (() => {
|
|
|
6494
6569
|
collapsed: false,
|
|
6495
6570
|
collapsible: false
|
|
6496
6571
|
}) : props.nav;
|
|
6497
|
-
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(
|
|
6498
6573
|
Drawer,
|
|
6499
6574
|
{
|
|
6500
6575
|
open,
|
|
@@ -6507,11 +6582,11 @@ window.Aura = (() => {
|
|
|
6507
6582
|
dismissible: true
|
|
6508
6583
|
},
|
|
6509
6584
|
drawerNav
|
|
6510
|
-
) : 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(
|
|
6511
6586
|
IconButton,
|
|
6512
6587
|
{
|
|
6513
6588
|
className: "aura-shell__menu",
|
|
6514
|
-
icon: /* @__PURE__ */
|
|
6589
|
+
icon: /* @__PURE__ */ React41.createElement(IconMenu, null),
|
|
6515
6590
|
label: props.menuLabel || t.openNav,
|
|
6516
6591
|
size: "md",
|
|
6517
6592
|
onClick: function() {
|
|
@@ -6519,18 +6594,18 @@ window.Aura = (() => {
|
|
|
6519
6594
|
},
|
|
6520
6595
|
"aria-expanded": open
|
|
6521
6596
|
}
|
|
6522
|
-
) : 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));
|
|
6523
6598
|
});
|
|
6524
6599
|
|
|
6525
6600
|
// src/ActionBar.tsx
|
|
6526
|
-
var
|
|
6527
|
-
var ActionBar =
|
|
6601
|
+
var React42 = __toESM(require_react(), 1);
|
|
6602
|
+
var ActionBar = React42.forwardRef(function ActionBar2(props, ref) {
|
|
6528
6603
|
const t = useStrings();
|
|
6529
6604
|
const bulk = props.selected != null;
|
|
6530
6605
|
const idle = bulk && !props.selected;
|
|
6531
6606
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
6532
|
-
const cameFrom =
|
|
6533
|
-
const own =
|
|
6607
|
+
const cameFrom = React42.useRef(null);
|
|
6608
|
+
const own = React42.useRef(null);
|
|
6534
6609
|
function clear() {
|
|
6535
6610
|
props.onClearSelection();
|
|
6536
6611
|
setTimeout(function() {
|
|
@@ -6539,7 +6614,7 @@ window.Aura = (() => {
|
|
|
6539
6614
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
6540
6615
|
}, 0);
|
|
6541
6616
|
}
|
|
6542
|
-
return /* @__PURE__ */
|
|
6617
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6543
6618
|
"div",
|
|
6544
6619
|
{
|
|
6545
6620
|
ref: function(el) {
|
|
@@ -6560,16 +6635,16 @@ window.Aura = (() => {
|
|
|
6560
6635
|
props.className
|
|
6561
6636
|
)
|
|
6562
6637
|
},
|
|
6563
|
-
/* @__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)
|
|
6564
6639
|
);
|
|
6565
6640
|
});
|
|
6566
6641
|
|
|
6567
6642
|
// src/Separator.tsx
|
|
6568
|
-
var
|
|
6569
|
-
var Separator =
|
|
6643
|
+
var React43 = __toESM(require_react(), 1);
|
|
6644
|
+
var Separator = React43.forwardRef(function Separator2(props, ref) {
|
|
6570
6645
|
const vertical = props.orientation === "vertical";
|
|
6571
6646
|
const decorative = props.decorative !== false;
|
|
6572
|
-
return /* @__PURE__ */
|
|
6647
|
+
return /* @__PURE__ */ React43.createElement(
|
|
6573
6648
|
"div",
|
|
6574
6649
|
{
|
|
6575
6650
|
ref,
|
|
@@ -6582,13 +6657,13 @@ window.Aura = (() => {
|
|
|
6582
6657
|
});
|
|
6583
6658
|
|
|
6584
6659
|
// src/Table.tsx
|
|
6585
|
-
var
|
|
6586
|
-
var StackLabels =
|
|
6587
|
-
var ColumnIndex =
|
|
6660
|
+
var React44 = __toESM(require_react(), 1);
|
|
6661
|
+
var StackLabels = React44.createContext(null);
|
|
6662
|
+
var ColumnIndex = React44.createContext(-1);
|
|
6588
6663
|
function flat(children) {
|
|
6589
6664
|
const out = [];
|
|
6590
|
-
|
|
6591
|
-
if (
|
|
6665
|
+
React44.Children.toArray(children).forEach(function(c) {
|
|
6666
|
+
if (React44.isValidElement(c) && c.type === React44.Fragment)
|
|
6592
6667
|
out.push.apply(out, flat(c.props.children));
|
|
6593
6668
|
else out.push(c);
|
|
6594
6669
|
});
|
|
@@ -6602,7 +6677,7 @@ window.Aura = (() => {
|
|
|
6602
6677
|
});
|
|
6603
6678
|
return parts.length ? parts.join("") : void 0;
|
|
6604
6679
|
}
|
|
6605
|
-
if (
|
|
6680
|
+
if (React44.isValidElement(node)) {
|
|
6606
6681
|
const p = node.props;
|
|
6607
6682
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
6608
6683
|
return text(p.children);
|
|
@@ -6612,13 +6687,13 @@ window.Aura = (() => {
|
|
|
6612
6687
|
function headerLabels(children) {
|
|
6613
6688
|
let out = [];
|
|
6614
6689
|
flat(children).forEach(function(c) {
|
|
6615
|
-
if (out.length || !
|
|
6690
|
+
if (out.length || !React44.isValidElement(c) || c.type !== THead) return;
|
|
6616
6691
|
const row = flat(c.props.children).find(function(r) {
|
|
6617
|
-
return
|
|
6692
|
+
return React44.isValidElement(r);
|
|
6618
6693
|
});
|
|
6619
6694
|
if (!row) return;
|
|
6620
6695
|
flat(row.props.children).forEach(function(cell) {
|
|
6621
|
-
if (!
|
|
6696
|
+
if (!React44.isValidElement(cell)) return;
|
|
6622
6697
|
const p = cell.props;
|
|
6623
6698
|
const t = text(p.children);
|
|
6624
6699
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -6628,7 +6703,7 @@ window.Aura = (() => {
|
|
|
6628
6703
|
});
|
|
6629
6704
|
return out;
|
|
6630
6705
|
}
|
|
6631
|
-
var Table =
|
|
6706
|
+
var Table = React44.forwardRef(function Table2(props, ref) {
|
|
6632
6707
|
const { caption, captionHidden, density, stackBelow, className, children, ...rest } = props;
|
|
6633
6708
|
const labels = stackBelow ? headerLabels(children) : null;
|
|
6634
6709
|
if (labels && !labels.length)
|
|
@@ -6636,10 +6711,10 @@ window.Aura = (() => {
|
|
|
6636
6711
|
"tbl-stack-labels",
|
|
6637
6712
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
6638
6713
|
);
|
|
6639
|
-
const outer =
|
|
6714
|
+
const outer = React44.useContext(StackLabels);
|
|
6640
6715
|
const capId = uid();
|
|
6641
|
-
const wrap =
|
|
6642
|
-
const sc =
|
|
6716
|
+
const wrap = React44.useRef(null);
|
|
6717
|
+
const sc = React44.useState(false), scrolls = sc[0];
|
|
6643
6718
|
useIsoLayoutEffect(function() {
|
|
6644
6719
|
const el = wrap.current;
|
|
6645
6720
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -6653,7 +6728,7 @@ window.Aura = (() => {
|
|
|
6653
6728
|
ro.disconnect();
|
|
6654
6729
|
};
|
|
6655
6730
|
}, []);
|
|
6656
|
-
return /* @__PURE__ */
|
|
6731
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6657
6732
|
"div",
|
|
6658
6733
|
{
|
|
6659
6734
|
ref: wrap,
|
|
@@ -6664,7 +6739,7 @@ window.Aura = (() => {
|
|
|
6664
6739
|
"aria-labelledby": scrolls && caption != null ? capId : void 0,
|
|
6665
6740
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
6666
6741
|
},
|
|
6667
|
-
/* @__PURE__ */
|
|
6742
|
+
/* @__PURE__ */ React44.createElement(
|
|
6668
6743
|
"table",
|
|
6669
6744
|
{
|
|
6670
6745
|
ref,
|
|
@@ -6672,16 +6747,16 @@ window.Aura = (() => {
|
|
|
6672
6747
|
role: stackBelow ? "table" : void 0,
|
|
6673
6748
|
...rest
|
|
6674
6749
|
},
|
|
6675
|
-
caption != null ? /* @__PURE__ */
|
|
6676
|
-
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
|
|
6677
6752
|
)
|
|
6678
6753
|
);
|
|
6679
6754
|
});
|
|
6680
6755
|
function section(tag, cls) {
|
|
6681
|
-
const C =
|
|
6756
|
+
const C = React44.forwardRef(function TableSection(props, ref) {
|
|
6682
6757
|
const { className, ...rest } = props;
|
|
6683
|
-
const stacked =
|
|
6684
|
-
return
|
|
6758
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6759
|
+
return React44.createElement(
|
|
6685
6760
|
tag,
|
|
6686
6761
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
6687
6762
|
);
|
|
@@ -6694,14 +6769,14 @@ window.Aura = (() => {
|
|
|
6694
6769
|
TBody.displayName = "TBody";
|
|
6695
6770
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
6696
6771
|
TFoot.displayName = "TFoot";
|
|
6697
|
-
var Tr =
|
|
6772
|
+
var Tr = React44.forwardRef(function Tr2(props, ref) {
|
|
6698
6773
|
const { className, children, ...rest } = props;
|
|
6699
|
-
const stacked =
|
|
6774
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6700
6775
|
let col = 0;
|
|
6701
|
-
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) {
|
|
6702
6777
|
const at = col;
|
|
6703
|
-
if (
|
|
6704
|
-
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);
|
|
6705
6780
|
}) : children);
|
|
6706
6781
|
});
|
|
6707
6782
|
function cellClass(base, p) {
|
|
@@ -6715,10 +6790,10 @@ window.Aura = (() => {
|
|
|
6715
6790
|
p.className
|
|
6716
6791
|
);
|
|
6717
6792
|
}
|
|
6718
|
-
var Th =
|
|
6793
|
+
var Th = React44.forwardRef(function Th2(props, ref) {
|
|
6719
6794
|
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6720
|
-
const stacked =
|
|
6721
|
-
return /* @__PURE__ */
|
|
6795
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6796
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6722
6797
|
"th",
|
|
6723
6798
|
{
|
|
6724
6799
|
ref,
|
|
@@ -6729,11 +6804,11 @@ window.Aura = (() => {
|
|
|
6729
6804
|
}
|
|
6730
6805
|
);
|
|
6731
6806
|
});
|
|
6732
|
-
var Td =
|
|
6807
|
+
var Td = React44.forwardRef(function Td2(props, ref) {
|
|
6733
6808
|
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6734
|
-
const labels =
|
|
6809
|
+
const labels = React44.useContext(StackLabels), col = React44.useContext(ColumnIndex);
|
|
6735
6810
|
const shown = labels ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
6736
|
-
return /* @__PURE__ */
|
|
6811
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6737
6812
|
"td",
|
|
6738
6813
|
{
|
|
6739
6814
|
ref,
|
|
@@ -6746,8 +6821,8 @@ window.Aura = (() => {
|
|
|
6746
6821
|
});
|
|
6747
6822
|
|
|
6748
6823
|
// src/BottomNav.tsx
|
|
6749
|
-
var
|
|
6750
|
-
var BottomNav =
|
|
6824
|
+
var React45 = __toESM(require_react(), 1);
|
|
6825
|
+
var BottomNav = React45.forwardRef(function BottomNav2(props, ref) {
|
|
6751
6826
|
const t = useStrings();
|
|
6752
6827
|
const Link = useLinkComponent(props.linkComponent);
|
|
6753
6828
|
const st = useMaybeControlled(
|
|
@@ -6757,14 +6832,14 @@ window.Aura = (() => {
|
|
|
6757
6832
|
);
|
|
6758
6833
|
const active = st[0];
|
|
6759
6834
|
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
6760
|
-
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(
|
|
6761
6836
|
"nav",
|
|
6762
6837
|
{
|
|
6763
6838
|
ref,
|
|
6764
6839
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
6765
6840
|
"aria-label": props.label || t.mainNav
|
|
6766
6841
|
},
|
|
6767
|
-
/* @__PURE__ */
|
|
6842
|
+
/* @__PURE__ */ React45.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
6768
6843
|
const on = active === it.id;
|
|
6769
6844
|
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
6770
6845
|
const suffix = count || it.badge && it.badgeLabel ? " (" + (count || it.badgeLabel) + ")" : "";
|
|
@@ -6780,19 +6855,19 @@ window.Aura = (() => {
|
|
|
6780
6855
|
}
|
|
6781
6856
|
};
|
|
6782
6857
|
const inner = [
|
|
6783
|
-
/* @__PURE__ */
|
|
6784
|
-
/* @__PURE__ */
|
|
6785
|
-
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
|
|
6786
6861
|
];
|
|
6787
|
-
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));
|
|
6788
6863
|
}))
|
|
6789
6864
|
));
|
|
6790
6865
|
});
|
|
6791
6866
|
|
|
6792
6867
|
// src/Surface.tsx
|
|
6793
|
-
var
|
|
6794
|
-
var h8 =
|
|
6795
|
-
var Surface =
|
|
6868
|
+
var React46 = __toESM(require_react(), 1);
|
|
6869
|
+
var h8 = React46.createElement;
|
|
6870
|
+
var Surface = React46.forwardRef(function Surface2(props, ref) {
|
|
6796
6871
|
const t = props.texture || "mesh";
|
|
6797
6872
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
6798
6873
|
return h8(
|
|
@@ -6813,8 +6888,8 @@ window.Aura = (() => {
|
|
|
6813
6888
|
});
|
|
6814
6889
|
|
|
6815
6890
|
// src/Stat.tsx
|
|
6816
|
-
var
|
|
6817
|
-
var Stat =
|
|
6891
|
+
var React47 = __toESM(require_react(), 1);
|
|
6892
|
+
var Stat = React47.forwardRef(function Stat2(props, ref) {
|
|
6818
6893
|
const ch = props.change;
|
|
6819
6894
|
const dir = ch && (ch.direction || "flat");
|
|
6820
6895
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -6823,7 +6898,7 @@ window.Aura = (() => {
|
|
|
6823
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, ""));
|
|
6824
6899
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
6825
6900
|
const interactive = !!(props.href || props.onClick);
|
|
6826
|
-
return /* @__PURE__ */
|
|
6901
|
+
return /* @__PURE__ */ React47.createElement(
|
|
6827
6902
|
Tag3,
|
|
6828
6903
|
{
|
|
6829
6904
|
ref,
|
|
@@ -6833,20 +6908,20 @@ window.Aura = (() => {
|
|
|
6833
6908
|
type: Tag3 === "button" ? "button" : void 0,
|
|
6834
6909
|
"aria-busy": props.loading || void 0
|
|
6835
6910
|
},
|
|
6836
|
-
/* @__PURE__ */
|
|
6837
|
-
props.loading ? /* @__PURE__ */
|
|
6838
|
-
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(
|
|
6839
6914
|
Icon,
|
|
6840
6915
|
{
|
|
6841
|
-
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),
|
|
6842
6917
|
size: 14
|
|
6843
6918
|
}
|
|
6844
|
-
), /* @__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
|
|
6845
6920
|
);
|
|
6846
6921
|
});
|
|
6847
6922
|
|
|
6848
6923
|
// src/TimePicker.tsx
|
|
6849
|
-
var
|
|
6924
|
+
var React48 = __toESM(require_react(), 1);
|
|
6850
6925
|
var import_react_dom11 = __toESM(require_react_dom(), 1);
|
|
6851
6926
|
|
|
6852
6927
|
// src/text.ts
|
|
@@ -6888,7 +6963,7 @@ window.Aura = (() => {
|
|
|
6888
6963
|
function fromMin(n3) {
|
|
6889
6964
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
6890
6965
|
}
|
|
6891
|
-
var TimePicker =
|
|
6966
|
+
var TimePicker = React48.forwardRef(function TimePicker2(props, ref) {
|
|
6892
6967
|
const t = useStrings();
|
|
6893
6968
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
6894
6969
|
const st = useMaybeControlled(
|
|
@@ -6898,7 +6973,7 @@ window.Aura = (() => {
|
|
|
6898
6973
|
);
|
|
6899
6974
|
const value = st[0];
|
|
6900
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;
|
|
6901
|
-
const slots =
|
|
6976
|
+
const slots = React48.useMemo(
|
|
6902
6977
|
function() {
|
|
6903
6978
|
const out = [];
|
|
6904
6979
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -6910,12 +6985,12 @@ window.Aura = (() => {
|
|
|
6910
6985
|
const n3 = toMin(v);
|
|
6911
6986
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
6912
6987
|
}
|
|
6913
|
-
const openState =
|
|
6914
|
-
const editState =
|
|
6915
|
-
const aState =
|
|
6916
|
-
const errState =
|
|
6917
|
-
const pos =
|
|
6918
|
-
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);
|
|
6919
6994
|
const mounted = useMounted();
|
|
6920
6995
|
function nearest(v) {
|
|
6921
6996
|
const n3 = toMin(v);
|
|
@@ -6943,7 +7018,7 @@ window.Aura = (() => {
|
|
|
6943
7018
|
},
|
|
6944
7019
|
[open]
|
|
6945
7020
|
);
|
|
6946
|
-
|
|
7021
|
+
React48.useEffect(
|
|
6947
7022
|
function() {
|
|
6948
7023
|
if (!open) return;
|
|
6949
7024
|
function outside(e) {
|
|
@@ -6965,7 +7040,7 @@ window.Aura = (() => {
|
|
|
6965
7040
|
},
|
|
6966
7041
|
[open]
|
|
6967
7042
|
);
|
|
6968
|
-
|
|
7043
|
+
React48.useEffect(
|
|
6969
7044
|
function() {
|
|
6970
7045
|
if (!open || !listRef.current) return;
|
|
6971
7046
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -7064,9 +7139,9 @@ window.Aura = (() => {
|
|
|
7064
7139
|
}
|
|
7065
7140
|
const error = errState[0] || props.error;
|
|
7066
7141
|
const list = open && mounted && pos[0] ? (0, import_react_dom11.createPortal)(
|
|
7067
|
-
/* @__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) {
|
|
7068
7143
|
const dis = blocked(s), sel = s === value;
|
|
7069
|
-
return /* @__PURE__ */
|
|
7144
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7070
7145
|
"li",
|
|
7071
7146
|
{
|
|
7072
7147
|
key: s,
|
|
@@ -7091,13 +7166,13 @@ window.Aura = (() => {
|
|
|
7091
7166
|
if (active !== i) setActive(i);
|
|
7092
7167
|
}
|
|
7093
7168
|
},
|
|
7094
|
-
/* @__PURE__ */
|
|
7095
|
-
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
|
|
7096
7171
|
);
|
|
7097
7172
|
}))),
|
|
7098
7173
|
document.body
|
|
7099
7174
|
) : null;
|
|
7100
|
-
return /* @__PURE__ */
|
|
7175
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7101
7176
|
Field,
|
|
7102
7177
|
{
|
|
7103
7178
|
id,
|
|
@@ -7109,7 +7184,7 @@ window.Aura = (() => {
|
|
|
7109
7184
|
disabled: props.disabled,
|
|
7110
7185
|
className: props.className
|
|
7111
7186
|
},
|
|
7112
|
-
/* @__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(
|
|
7113
7188
|
"input",
|
|
7114
7189
|
{
|
|
7115
7190
|
ref: inputMerged,
|
|
@@ -7149,7 +7224,7 @@ window.Aura = (() => {
|
|
|
7149
7224
|
}, 0);
|
|
7150
7225
|
}
|
|
7151
7226
|
}
|
|
7152
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
7227
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React48.createElement(
|
|
7153
7228
|
"button",
|
|
7154
7229
|
{
|
|
7155
7230
|
type: "button",
|
|
@@ -7162,8 +7237,8 @@ window.Aura = (() => {
|
|
|
7162
7237
|
if (inputRef.current) inputRef.current.focus();
|
|
7163
7238
|
}
|
|
7164
7239
|
},
|
|
7165
|
-
/* @__PURE__ */
|
|
7166
|
-
) : null, /* @__PURE__ */
|
|
7240
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconX, null) })
|
|
7241
|
+
) : null, /* @__PURE__ */ React48.createElement(
|
|
7167
7242
|
"button",
|
|
7168
7243
|
{
|
|
7169
7244
|
type: "button",
|
|
@@ -7181,14 +7256,14 @@ window.Aura = (() => {
|
|
|
7181
7256
|
}
|
|
7182
7257
|
}
|
|
7183
7258
|
},
|
|
7184
|
-
/* @__PURE__ */
|
|
7259
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconChevronDown, null) })
|
|
7185
7260
|
)),
|
|
7186
7261
|
list
|
|
7187
7262
|
);
|
|
7188
7263
|
});
|
|
7189
7264
|
|
|
7190
7265
|
// src/FileUpload.tsx
|
|
7191
|
-
var
|
|
7266
|
+
var React49 = __toESM(require_react(), 1);
|
|
7192
7267
|
function matches(file, accept) {
|
|
7193
7268
|
if (!accept) return true;
|
|
7194
7269
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -7212,24 +7287,24 @@ window.Aura = (() => {
|
|
|
7212
7287
|
}).join(", ");
|
|
7213
7288
|
}
|
|
7214
7289
|
var seq = 0;
|
|
7215
|
-
var FileUpload =
|
|
7290
|
+
var FileUpload = React49.forwardRef(function FileUpload2(props, ref) {
|
|
7216
7291
|
const t = useStrings();
|
|
7217
7292
|
const auto = uid(), id = props.id || auto;
|
|
7218
7293
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
7219
7294
|
const items2 = st[0] || [];
|
|
7220
|
-
const dragState =
|
|
7221
|
-
const inputRef =
|
|
7222
|
-
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({});
|
|
7223
7298
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
7224
7299
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
7225
|
-
|
|
7300
|
+
React49.useEffect(function() {
|
|
7226
7301
|
return function() {
|
|
7227
7302
|
Object.keys(urls.current).forEach(function(k) {
|
|
7228
7303
|
URL.revokeObjectURL(urls.current[k]);
|
|
7229
7304
|
});
|
|
7230
7305
|
};
|
|
7231
7306
|
}, []);
|
|
7232
|
-
|
|
7307
|
+
React49.useEffect(
|
|
7233
7308
|
function() {
|
|
7234
7309
|
const el = inputRef.current;
|
|
7235
7310
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -7289,7 +7364,7 @@ window.Aura = (() => {
|
|
|
7289
7364
|
if (inputRef.current) inputRef.current.focus();
|
|
7290
7365
|
}
|
|
7291
7366
|
const error = props.error;
|
|
7292
|
-
return /* @__PURE__ */
|
|
7367
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7293
7368
|
Field,
|
|
7294
7369
|
{
|
|
7295
7370
|
id,
|
|
@@ -7301,7 +7376,7 @@ window.Aura = (() => {
|
|
|
7301
7376
|
disabled: props.disabled,
|
|
7302
7377
|
className: props.className
|
|
7303
7378
|
},
|
|
7304
|
-
/* @__PURE__ */
|
|
7379
|
+
/* @__PURE__ */ React49.createElement(
|
|
7305
7380
|
"div",
|
|
7306
7381
|
{
|
|
7307
7382
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -7322,9 +7397,9 @@ window.Aura = (() => {
|
|
|
7322
7397
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
7323
7398
|
}
|
|
7324
7399
|
},
|
|
7325
|
-
/* @__PURE__ */
|
|
7326
|
-
/* @__PURE__ */
|
|
7327
|
-
/* @__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(
|
|
7328
7403
|
"input",
|
|
7329
7404
|
{
|
|
7330
7405
|
ref: inputMerged,
|
|
@@ -7346,12 +7421,12 @@ window.Aura = (() => {
|
|
|
7346
7421
|
}
|
|
7347
7422
|
}
|
|
7348
7423
|
),
|
|
7349
|
-
/* @__PURE__ */
|
|
7350
|
-
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
|
|
7351
7426
|
),
|
|
7352
|
-
items2.length ? /* @__PURE__ */
|
|
7427
|
+
items2.length ? /* @__PURE__ */ React49.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
7353
7428
|
const src = thumb(it);
|
|
7354
|
-
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(
|
|
7355
7430
|
"span",
|
|
7356
7431
|
{
|
|
7357
7432
|
className: "aura-upload__bar",
|
|
@@ -7361,11 +7436,11 @@ window.Aura = (() => {
|
|
|
7361
7436
|
"aria-valuemax": 100,
|
|
7362
7437
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
7363
7438
|
},
|
|
7364
|
-
/* @__PURE__ */
|
|
7365
|
-
) : null), /* @__PURE__ */
|
|
7439
|
+
/* @__PURE__ */ React49.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
7440
|
+
) : null), /* @__PURE__ */ React49.createElement(
|
|
7366
7441
|
IconButton,
|
|
7367
7442
|
{
|
|
7368
|
-
icon: /* @__PURE__ */
|
|
7443
|
+
icon: /* @__PURE__ */ React49.createElement(IconX, null),
|
|
7369
7444
|
label: t.remove(it.name),
|
|
7370
7445
|
onClick: function() {
|
|
7371
7446
|
remove(it);
|
|
@@ -7650,9 +7725,9 @@ window.Aura = (() => {
|
|
|
7650
7725
|
}
|
|
7651
7726
|
|
|
7652
7727
|
// src/ThemeStyle.tsx
|
|
7653
|
-
var
|
|
7728
|
+
var React50 = __toESM(require_react(), 1);
|
|
7654
7729
|
function ThemeStyle(props) {
|
|
7655
|
-
const css =
|
|
7730
|
+
const css = React50.useMemo(
|
|
7656
7731
|
function() {
|
|
7657
7732
|
try {
|
|
7658
7733
|
return createTheme({
|
|
@@ -7669,11 +7744,11 @@ window.Aura = (() => {
|
|
|
7669
7744
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
7670
7745
|
);
|
|
7671
7746
|
if (css === null) return null;
|
|
7672
|
-
return /* @__PURE__ */
|
|
7747
|
+
return /* @__PURE__ */ React50.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
7673
7748
|
}
|
|
7674
7749
|
|
|
7675
7750
|
// src/colorScheme.tsx
|
|
7676
|
-
var
|
|
7751
|
+
var React51 = __toESM(require_react(), 1);
|
|
7677
7752
|
|
|
7678
7753
|
// src/colorSchemeScript.ts
|
|
7679
7754
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -7690,7 +7765,7 @@ window.Aura = (() => {
|
|
|
7690
7765
|
|
|
7691
7766
|
// src/colorScheme.tsx
|
|
7692
7767
|
function ColorSchemeScript(props) {
|
|
7693
|
-
return /* @__PURE__ */
|
|
7768
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7694
7769
|
"script",
|
|
7695
7770
|
{
|
|
7696
7771
|
"data-aura-color-scheme": "",
|
|
@@ -7715,7 +7790,7 @@ window.Aura = (() => {
|
|
|
7715
7790
|
function useColorScheme(options) {
|
|
7716
7791
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
7717
7792
|
const fallback = options && options.defaultScheme || "system";
|
|
7718
|
-
const subscribe2 =
|
|
7793
|
+
const subscribe2 = React51.useCallback(
|
|
7719
7794
|
function(cb) {
|
|
7720
7795
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
7721
7796
|
function onSystem() {
|
|
@@ -7737,7 +7812,7 @@ window.Aura = (() => {
|
|
|
7737
7812
|
},
|
|
7738
7813
|
[fallback, key]
|
|
7739
7814
|
);
|
|
7740
|
-
const snapshot =
|
|
7815
|
+
const snapshot = React51.useSyncExternalStore(
|
|
7741
7816
|
subscribe2,
|
|
7742
7817
|
function() {
|
|
7743
7818
|
const s = readScheme(fallback);
|
|
@@ -7748,7 +7823,7 @@ window.Aura = (() => {
|
|
|
7748
7823
|
}
|
|
7749
7824
|
);
|
|
7750
7825
|
const parts = snapshot.split("|");
|
|
7751
|
-
const setScheme =
|
|
7826
|
+
const setScheme = React51.useCallback(
|
|
7752
7827
|
function(next) {
|
|
7753
7828
|
if (!valid(next)) return;
|
|
7754
7829
|
try {
|
|
@@ -7767,14 +7842,14 @@ window.Aura = (() => {
|
|
|
7767
7842
|
const cs = useColorScheme(props);
|
|
7768
7843
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
7769
7844
|
const label = props.label || t.colorScheme;
|
|
7770
|
-
return /* @__PURE__ */
|
|
7845
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7771
7846
|
DropdownMenu,
|
|
7772
7847
|
{
|
|
7773
7848
|
label,
|
|
7774
|
-
trigger: /* @__PURE__ */
|
|
7849
|
+
trigger: /* @__PURE__ */ React51.createElement(
|
|
7775
7850
|
IconButton,
|
|
7776
7851
|
{
|
|
7777
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
7852
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React51.createElement(IconMoon, null) : /* @__PURE__ */ React51.createElement(IconSun, null),
|
|
7778
7853
|
label: label + ": " + names[cs.scheme]
|
|
7779
7854
|
}
|
|
7780
7855
|
),
|
|
@@ -7792,19 +7867,19 @@ window.Aura = (() => {
|
|
|
7792
7867
|
}
|
|
7793
7868
|
|
|
7794
7869
|
// src/Badge.tsx
|
|
7795
|
-
var
|
|
7796
|
-
var Badge =
|
|
7870
|
+
var React52 = __toESM(require_react(), 1);
|
|
7871
|
+
var Badge = React52.forwardRef(function Badge2(props, ref) {
|
|
7797
7872
|
return badgeElement(props, ref);
|
|
7798
7873
|
});
|
|
7799
7874
|
|
|
7800
7875
|
// src/Progress.tsx
|
|
7801
|
-
var
|
|
7802
|
-
var Progress =
|
|
7876
|
+
var React53 = __toESM(require_react(), 1);
|
|
7877
|
+
var Progress = React53.forwardRef(function Progress2(props, ref) {
|
|
7803
7878
|
const auto = uid(), id = props.id || auto;
|
|
7804
7879
|
const max = props.max || 100, det = props.value != null;
|
|
7805
7880
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
7806
7881
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
7807
|
-
return /* @__PURE__ */
|
|
7882
|
+
return /* @__PURE__ */ React53.createElement(
|
|
7808
7883
|
"div",
|
|
7809
7884
|
{
|
|
7810
7885
|
ref,
|
|
@@ -7815,8 +7890,8 @@ window.Aura = (() => {
|
|
|
7815
7890
|
props.className
|
|
7816
7891
|
)
|
|
7817
7892
|
},
|
|
7818
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
7819
|
-
/* @__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(
|
|
7820
7895
|
"div",
|
|
7821
7896
|
{
|
|
7822
7897
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -7828,21 +7903,21 @@ window.Aura = (() => {
|
|
|
7828
7903
|
"aria-valuenow": det ? props.value : void 0,
|
|
7829
7904
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
7830
7905
|
},
|
|
7831
|
-
/* @__PURE__ */
|
|
7906
|
+
/* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
7832
7907
|
),
|
|
7833
|
-
props.hint ? /* @__PURE__ */
|
|
7908
|
+
props.hint ? /* @__PURE__ */ React53.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
7834
7909
|
);
|
|
7835
7910
|
});
|
|
7836
7911
|
|
|
7837
7912
|
// src/Skeleton.tsx
|
|
7838
|
-
var
|
|
7839
|
-
var Skeleton =
|
|
7913
|
+
var React54 = __toESM(require_react(), 1);
|
|
7914
|
+
var Skeleton = React54.forwardRef(function Skeleton2(props, ref) {
|
|
7840
7915
|
const v = props.variant || "text";
|
|
7841
7916
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
7842
7917
|
const n3 = props.lines, rows = [];
|
|
7843
7918
|
for (let i = 0; i < n3; i++)
|
|
7844
|
-
rows.push(/* @__PURE__ */
|
|
7845
|
-
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(
|
|
7846
7921
|
"span",
|
|
7847
7922
|
{
|
|
7848
7923
|
ref,
|
|
@@ -7860,17 +7935,17 @@ window.Aura = (() => {
|
|
|
7860
7935
|
if (v === "circle") {
|
|
7861
7936
|
style.width = style.height = props.size || props.width || 40;
|
|
7862
7937
|
}
|
|
7863
|
-
return /* @__PURE__ */
|
|
7938
|
+
return /* @__PURE__ */ React54.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
7864
7939
|
});
|
|
7865
7940
|
|
|
7866
7941
|
// src/EmptyState.tsx
|
|
7867
|
-
var
|
|
7868
|
-
var EmptyState =
|
|
7942
|
+
var React55 = __toESM(require_react(), 1);
|
|
7943
|
+
var EmptyState = React55.forwardRef(function EmptyState2(props, ref) {
|
|
7869
7944
|
return emptyStateElement(props, ref);
|
|
7870
7945
|
});
|
|
7871
7946
|
|
|
7872
7947
|
// src/Pagination.tsx
|
|
7873
|
-
var
|
|
7948
|
+
var React56 = __toESM(require_react(), 1);
|
|
7874
7949
|
function pageList(page, count, sib) {
|
|
7875
7950
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
7876
7951
|
if (page - sib <= 3) {
|
|
@@ -7890,7 +7965,7 @@ window.Aura = (() => {
|
|
|
7890
7965
|
if (count > 1) out.push(count);
|
|
7891
7966
|
return out;
|
|
7892
7967
|
}
|
|
7893
|
-
var Pagination =
|
|
7968
|
+
var Pagination = React56.forwardRef(function Pagination2(props, ref) {
|
|
7894
7969
|
const t = useStrings();
|
|
7895
7970
|
const count = Math.max(1, props.pageCount || 1);
|
|
7896
7971
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -7909,7 +7984,7 @@ window.Aura = (() => {
|
|
|
7909
7984
|
},
|
|
7910
7985
|
extra
|
|
7911
7986
|
);
|
|
7912
|
-
return link ? /* @__PURE__ */
|
|
7987
|
+
return link ? /* @__PURE__ */ React56.createElement(
|
|
7913
7988
|
Link,
|
|
7914
7989
|
{
|
|
7915
7990
|
href: link(p),
|
|
@@ -7922,7 +7997,7 @@ window.Aura = (() => {
|
|
|
7922
7997
|
...common
|
|
7923
7998
|
},
|
|
7924
7999
|
label
|
|
7925
|
-
) : /* @__PURE__ */
|
|
8000
|
+
) : /* @__PURE__ */ React56.createElement(
|
|
7926
8001
|
"button",
|
|
7927
8002
|
{
|
|
7928
8003
|
type: "button",
|
|
@@ -7936,7 +8011,7 @@ window.Aura = (() => {
|
|
|
7936
8011
|
}
|
|
7937
8012
|
function arrow(p, icon, label, rel, disabled) {
|
|
7938
8013
|
if (!link || disabled)
|
|
7939
|
-
return /* @__PURE__ */
|
|
8014
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7940
8015
|
IconButton,
|
|
7941
8016
|
{
|
|
7942
8017
|
icon,
|
|
@@ -7947,7 +8022,7 @@ window.Aura = (() => {
|
|
|
7947
8022
|
}
|
|
7948
8023
|
}
|
|
7949
8024
|
);
|
|
7950
|
-
return /* @__PURE__ */
|
|
8025
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7951
8026
|
Link,
|
|
7952
8027
|
{
|
|
7953
8028
|
href: link(p),
|
|
@@ -7962,17 +8037,17 @@ window.Aura = (() => {
|
|
|
7962
8037
|
}
|
|
7963
8038
|
}
|
|
7964
8039
|
},
|
|
7965
|
-
/* @__PURE__ */
|
|
8040
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: icon, size: "sm" })
|
|
7966
8041
|
);
|
|
7967
8042
|
}
|
|
7968
|
-
return /* @__PURE__ */
|
|
7969
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
7970
|
-
})), /* @__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));
|
|
7971
8046
|
});
|
|
7972
8047
|
|
|
7973
8048
|
// src/Accordion.tsx
|
|
7974
|
-
var
|
|
7975
|
-
var Accordion =
|
|
8049
|
+
var React57 = __toESM(require_react(), 1);
|
|
8050
|
+
var Accordion = React57.forwardRef(function Accordion2(props, ref) {
|
|
7976
8051
|
const auto = uid(), base = props.id || auto;
|
|
7977
8052
|
const multiple = props.type === "multiple";
|
|
7978
8053
|
const st = useMaybeControlled(
|
|
@@ -8010,9 +8085,9 @@ window.Aura = (() => {
|
|
|
8010
8085
|
n3.focus();
|
|
8011
8086
|
}
|
|
8012
8087
|
}
|
|
8013
|
-
return /* @__PURE__ */
|
|
8088
|
+
return /* @__PURE__ */ React57.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
8014
8089
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
8015
|
-
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(
|
|
8016
8091
|
"button",
|
|
8017
8092
|
{
|
|
8018
8093
|
type: "button",
|
|
@@ -8024,15 +8099,15 @@ window.Aura = (() => {
|
|
|
8024
8099
|
toggle(it.id);
|
|
8025
8100
|
}
|
|
8026
8101
|
},
|
|
8027
|
-
it.icon ? /* @__PURE__ */
|
|
8028
|
-
/* @__PURE__ */
|
|
8029
|
-
/* @__PURE__ */
|
|
8030
|
-
)), /* @__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));
|
|
8031
8106
|
}));
|
|
8032
8107
|
});
|
|
8033
8108
|
|
|
8034
8109
|
// src/Popover.tsx
|
|
8035
|
-
var
|
|
8110
|
+
var React58 = __toESM(require_react(), 1);
|
|
8036
8111
|
var import_react_dom12 = __toESM(require_react_dom(), 1);
|
|
8037
8112
|
function position(anchor, pop, placement) {
|
|
8038
8113
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -8050,15 +8125,15 @@ window.Aura = (() => {
|
|
|
8050
8125
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
8051
8126
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
8052
8127
|
}
|
|
8053
|
-
var Popover =
|
|
8128
|
+
var Popover = React58.forwardRef(function Popover2(props, ref) {
|
|
8054
8129
|
const t = useStrings();
|
|
8055
8130
|
const density = useDensity();
|
|
8056
8131
|
const auto = uid(), id = props.id || auto;
|
|
8057
8132
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
8058
8133
|
const open = !!st[0];
|
|
8059
|
-
const wrap =
|
|
8060
|
-
const pos =
|
|
8061
|
-
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);
|
|
8062
8137
|
function trigger() {
|
|
8063
8138
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
8064
8139
|
}
|
|
@@ -8085,7 +8160,7 @@ window.Aura = (() => {
|
|
|
8085
8160
|
},
|
|
8086
8161
|
[open, mounted, props.placement]
|
|
8087
8162
|
);
|
|
8088
|
-
|
|
8163
|
+
React58.useEffect(
|
|
8089
8164
|
function() {
|
|
8090
8165
|
if (!open || !mounted) return;
|
|
8091
8166
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -8110,9 +8185,9 @@ window.Aura = (() => {
|
|
|
8110
8185
|
},
|
|
8111
8186
|
[open, mounted]
|
|
8112
8187
|
);
|
|
8113
|
-
const child =
|
|
8188
|
+
const child = React58.Children.only(props.trigger);
|
|
8114
8189
|
const panel = open && mounted ? (0, import_react_dom12.createPortal)(
|
|
8115
|
-
/* @__PURE__ */
|
|
8190
|
+
/* @__PURE__ */ React58.createElement(
|
|
8116
8191
|
"div",
|
|
8117
8192
|
{
|
|
8118
8193
|
ref: popMerged,
|
|
@@ -8142,17 +8217,17 @@ window.Aura = (() => {
|
|
|
8142
8217
|
} else trapTab(e, pop.current);
|
|
8143
8218
|
}
|
|
8144
8219
|
},
|
|
8145
|
-
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(
|
|
8146
8221
|
IconButton,
|
|
8147
8222
|
{
|
|
8148
|
-
icon: /* @__PURE__ */
|
|
8223
|
+
icon: /* @__PURE__ */ React58.createElement(IconX, null),
|
|
8149
8224
|
label: t.close,
|
|
8150
8225
|
onClick: function() {
|
|
8151
8226
|
close(true);
|
|
8152
8227
|
}
|
|
8153
8228
|
}
|
|
8154
8229
|
)) : null,
|
|
8155
|
-
/* @__PURE__ */
|
|
8230
|
+
/* @__PURE__ */ React58.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
8156
8231
|
close: function() {
|
|
8157
8232
|
close(true);
|
|
8158
8233
|
}
|
|
@@ -8160,7 +8235,7 @@ window.Aura = (() => {
|
|
|
8160
8235
|
),
|
|
8161
8236
|
document.body
|
|
8162
8237
|
) : null;
|
|
8163
|
-
return /* @__PURE__ */
|
|
8238
|
+
return /* @__PURE__ */ React58.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React58.cloneElement(child, {
|
|
8164
8239
|
onClick: function(e) {
|
|
8165
8240
|
if (child.props.onClick) child.props.onClick(e);
|
|
8166
8241
|
st[1](!open);
|
|
@@ -8172,7 +8247,7 @@ window.Aura = (() => {
|
|
|
8172
8247
|
});
|
|
8173
8248
|
|
|
8174
8249
|
// src/NumberField.tsx
|
|
8175
|
-
var
|
|
8250
|
+
var React59 = __toESM(require_react(), 1);
|
|
8176
8251
|
function decimalsOf(n3) {
|
|
8177
8252
|
const s = String(n3);
|
|
8178
8253
|
const i = s.indexOf(".");
|
|
@@ -8185,7 +8260,7 @@ window.Aura = (() => {
|
|
|
8185
8260
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
8186
8261
|
return Number(s);
|
|
8187
8262
|
}
|
|
8188
|
-
var NumberField =
|
|
8263
|
+
var NumberField = React59.forwardRef(function NumberField2(props, ref) {
|
|
8189
8264
|
const t = useStrings();
|
|
8190
8265
|
const auto = uid(), id = props.id || auto;
|
|
8191
8266
|
const step = props.step || 1;
|
|
@@ -8196,7 +8271,7 @@ window.Aura = (() => {
|
|
|
8196
8271
|
props.onChange
|
|
8197
8272
|
);
|
|
8198
8273
|
const value = st[0], setValue = st[1];
|
|
8199
|
-
const draftState =
|
|
8274
|
+
const draftState = React59.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
8200
8275
|
function fmt2(n3) {
|
|
8201
8276
|
if (n3 == null || isNaN(n3)) return "";
|
|
8202
8277
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -8245,7 +8320,7 @@ window.Aura = (() => {
|
|
|
8245
8320
|
};
|
|
8246
8321
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
8247
8322
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
8248
|
-
return /* @__PURE__ */
|
|
8323
|
+
return /* @__PURE__ */ React59.createElement(
|
|
8249
8324
|
Field,
|
|
8250
8325
|
{
|
|
8251
8326
|
id,
|
|
@@ -8257,7 +8332,7 @@ window.Aura = (() => {
|
|
|
8257
8332
|
disabled: props.disabled,
|
|
8258
8333
|
className: props.className
|
|
8259
8334
|
},
|
|
8260
|
-
/* @__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(
|
|
8261
8336
|
"input",
|
|
8262
8337
|
{
|
|
8263
8338
|
ref,
|
|
@@ -8304,7 +8379,7 @@ window.Aura = (() => {
|
|
|
8304
8379
|
},
|
|
8305
8380
|
onKeyDown
|
|
8306
8381
|
}
|
|
8307
|
-
), 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(
|
|
8308
8383
|
"button",
|
|
8309
8384
|
{
|
|
8310
8385
|
type: "button",
|
|
@@ -8320,8 +8395,8 @@ window.Aura = (() => {
|
|
|
8320
8395
|
nudge(-step);
|
|
8321
8396
|
}
|
|
8322
8397
|
},
|
|
8323
|
-
/* @__PURE__ */
|
|
8324
|
-
), /* @__PURE__ */
|
|
8398
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconMinus, null) })
|
|
8399
|
+
), /* @__PURE__ */ React59.createElement(
|
|
8325
8400
|
"button",
|
|
8326
8401
|
{
|
|
8327
8402
|
type: "button",
|
|
@@ -8337,14 +8412,14 @@ window.Aura = (() => {
|
|
|
8337
8412
|
nudge(step);
|
|
8338
8413
|
}
|
|
8339
8414
|
},
|
|
8340
|
-
/* @__PURE__ */
|
|
8415
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconPlus, null) })
|
|
8341
8416
|
)) : null)
|
|
8342
8417
|
);
|
|
8343
8418
|
});
|
|
8344
8419
|
|
|
8345
8420
|
// src/Stepper.tsx
|
|
8346
|
-
var
|
|
8347
|
-
var Stepper =
|
|
8421
|
+
var React60 = __toESM(require_react(), 1);
|
|
8422
|
+
var Stepper = React60.forwardRef(function Stepper2(props, ref) {
|
|
8348
8423
|
const t = useStrings();
|
|
8349
8424
|
const steps = props.steps || [];
|
|
8350
8425
|
let at = -1;
|
|
@@ -8354,26 +8429,26 @@ window.Aura = (() => {
|
|
|
8354
8429
|
if (at < 0) at = 0;
|
|
8355
8430
|
const vertical = props.orientation === "vertical";
|
|
8356
8431
|
const cur = steps[at];
|
|
8357
|
-
return /* @__PURE__ */
|
|
8432
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8358
8433
|
"nav",
|
|
8359
8434
|
{
|
|
8360
8435
|
ref,
|
|
8361
8436
|
"aria-label": props.label,
|
|
8362
8437
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
8363
8438
|
},
|
|
8364
|
-
/* @__PURE__ */
|
|
8439
|
+
/* @__PURE__ */ React60.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
8365
8440
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
8366
|
-
const marker = /* @__PURE__ */
|
|
8367
|
-
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);
|
|
8368
8443
|
const clickable = state === "done" && !!props.onStepClick;
|
|
8369
|
-
return /* @__PURE__ */
|
|
8444
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8370
8445
|
"li",
|
|
8371
8446
|
{
|
|
8372
8447
|
key: s.id,
|
|
8373
8448
|
className: cx("aura-stepper__item", "is-" + state),
|
|
8374
8449
|
"aria-current": state === "current" ? "step" : void 0
|
|
8375
8450
|
},
|
|
8376
|
-
clickable ? /* @__PURE__ */
|
|
8451
|
+
clickable ? /* @__PURE__ */ React60.createElement(
|
|
8377
8452
|
"button",
|
|
8378
8453
|
{
|
|
8379
8454
|
type: "button",
|
|
@@ -8384,19 +8459,19 @@ window.Aura = (() => {
|
|
|
8384
8459
|
},
|
|
8385
8460
|
marker,
|
|
8386
8461
|
text2
|
|
8387
|
-
) : /* @__PURE__ */
|
|
8462
|
+
) : /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
8388
8463
|
);
|
|
8389
8464
|
})),
|
|
8390
|
-
!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
|
|
8391
8466
|
);
|
|
8392
8467
|
});
|
|
8393
8468
|
|
|
8394
8469
|
// src/SegmentedControl.tsx
|
|
8395
|
-
var
|
|
8470
|
+
var React61 = __toESM(require_react(), 1);
|
|
8396
8471
|
function toOpt2(o) {
|
|
8397
8472
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
8398
8473
|
}
|
|
8399
|
-
var SegmentedControl =
|
|
8474
|
+
var SegmentedControl = React61.forwardRef(
|
|
8400
8475
|
function SegmentedControl2(props, ref) {
|
|
8401
8476
|
const options = (props.options || []).map(toOpt2);
|
|
8402
8477
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -8409,7 +8484,7 @@ window.Aura = (() => {
|
|
|
8409
8484
|
);
|
|
8410
8485
|
const value = st[0], setValue = st[1];
|
|
8411
8486
|
const auto = uid(), id = props.id || auto;
|
|
8412
|
-
const refs =
|
|
8487
|
+
const refs = React61.useRef([]);
|
|
8413
8488
|
const selIdx = options.findIndex(function(o) {
|
|
8414
8489
|
return o.value === value;
|
|
8415
8490
|
});
|
|
@@ -8442,7 +8517,7 @@ window.Aura = (() => {
|
|
|
8442
8517
|
move(options.length, -1);
|
|
8443
8518
|
}
|
|
8444
8519
|
}
|
|
8445
|
-
return /* @__PURE__ */
|
|
8520
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8446
8521
|
"div",
|
|
8447
8522
|
{
|
|
8448
8523
|
ref,
|
|
@@ -8461,7 +8536,7 @@ window.Aura = (() => {
|
|
|
8461
8536
|
options.map(function(o, i) {
|
|
8462
8537
|
const on = o.value === value;
|
|
8463
8538
|
const off = props.disabled || o.disabled;
|
|
8464
|
-
return /* @__PURE__ */
|
|
8539
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8465
8540
|
"button",
|
|
8466
8541
|
{
|
|
8467
8542
|
key: o.value,
|
|
@@ -8483,8 +8558,8 @@ window.Aura = (() => {
|
|
|
8483
8558
|
onKeyDown(e, i);
|
|
8484
8559
|
}
|
|
8485
8560
|
},
|
|
8486
|
-
o.icon ? /* @__PURE__ */
|
|
8487
|
-
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)
|
|
8488
8563
|
);
|
|
8489
8564
|
})
|
|
8490
8565
|
);
|