@jirawatpyk/aura-react 5.11.0 → 5.13.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 +30 -2
- package/dist/aura.bundle.js +784 -622
- package/dist/cjs/index.cjs +783 -621
- package/dist/esm/DataTable.js +82 -22
- package/dist/esm/FilterBar.js +1 -1
- package/dist/esm/FilterSelect.js +17 -0
- package/dist/esm/Select.js +82 -20
- package/dist/esm/Table.js +14 -6
- package/dist/esm/display.js +20 -1
- package/dist/esm/index.js +2 -0
- package/dist/index.d.cts +45 -2
- package/dist/index.d.ts +45 -2
- package/dist/server/index.cjs +20 -1
- package/dist/server/index.d.cts +4 -1
- package/dist/server/index.d.ts +4 -1
- package/dist/server/index.js +20 -1
- package/dist/styles.css +66 -0
- package/dist/styles.layer.css +66 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -59,6 +59,7 @@ __export(index_exports, {
|
|
|
59
59
|
Field: () => Field,
|
|
60
60
|
FileUpload: () => FileUpload,
|
|
61
61
|
FilterBar: () => FilterBar,
|
|
62
|
+
FilterSelect: () => FilterSelect,
|
|
62
63
|
FormErrorSummary: () => FormErrorSummary,
|
|
63
64
|
Grid: () => Grid,
|
|
64
65
|
ICONS: () => ICONS,
|
|
@@ -656,11 +657,30 @@ function badgeElement(props, ref) {
|
|
|
656
657
|
}
|
|
657
658
|
function emptyStateElement(props, ref) {
|
|
658
659
|
const HT = "h" + (props.headingLevel || 3);
|
|
660
|
+
const rest = omit(props, [
|
|
661
|
+
"title",
|
|
662
|
+
"description",
|
|
663
|
+
"icon",
|
|
664
|
+
"action",
|
|
665
|
+
"size",
|
|
666
|
+
"bordered",
|
|
667
|
+
"headingLevel",
|
|
668
|
+
"tone",
|
|
669
|
+
"className",
|
|
670
|
+
"children"
|
|
671
|
+
]);
|
|
659
672
|
return /* @__PURE__ */ React4.createElement(
|
|
660
673
|
"div",
|
|
661
674
|
{
|
|
675
|
+
...rest,
|
|
662
676
|
ref,
|
|
663
|
-
className: cx(
|
|
677
|
+
className: cx(
|
|
678
|
+
"aura-empty",
|
|
679
|
+
props.size === "sm" && "is-sm",
|
|
680
|
+
props.bordered && "is-bordered",
|
|
681
|
+
props.tone === "danger" && "is-danger",
|
|
682
|
+
props.className
|
|
683
|
+
)
|
|
664
684
|
},
|
|
665
685
|
/* @__PURE__ */ React4.createElement("span", { className: "aura-empty__icon", "aria-hidden": true }, /* @__PURE__ */ React4.createElement(Icon, { name: props.icon || /* @__PURE__ */ React4.createElement(IconInbox, null), size: props.size === "sm" ? "md" : "lg" })),
|
|
666
686
|
/* @__PURE__ */ React4.createElement(HT, { className: "aura-empty__title" }, props.title),
|
|
@@ -1636,6 +1656,7 @@ var Textarea = React14.forwardRef(function Textarea2(props, ref) {
|
|
|
1636
1656
|
var React15 = __toESM(require("react"), 1);
|
|
1637
1657
|
var import_react_dom2 = require("react-dom");
|
|
1638
1658
|
var h4 = React15.createElement;
|
|
1659
|
+
var FILTER_KEY = "__auraFilter";
|
|
1639
1660
|
var FORM_KEYS = ["name", "form", "value", "defaultValue", "disabled", "autoComplete", "onInput", "onInvalid"];
|
|
1640
1661
|
var HANDLED_KEYS = FORM_KEYS.concat([
|
|
1641
1662
|
"onChange",
|
|
@@ -1669,20 +1690,49 @@ function readItems(el) {
|
|
|
1669
1690
|
};
|
|
1670
1691
|
});
|
|
1671
1692
|
}
|
|
1672
|
-
function
|
|
1693
|
+
function textOf(n3) {
|
|
1694
|
+
if (n3 == null || typeof n3 === "boolean") return "";
|
|
1695
|
+
if (typeof n3 === "string" || typeof n3 === "number") return String(n3);
|
|
1696
|
+
if (Array.isArray(n3)) return n3.map(textOf).join("");
|
|
1697
|
+
return React15.isValidElement(n3) ? textOf(n3.props.children) : "";
|
|
1698
|
+
}
|
|
1699
|
+
function childOptions(children, off) {
|
|
1700
|
+
const out = [];
|
|
1701
|
+
React15.Children.forEach(children, function(c) {
|
|
1702
|
+
if (!React15.isValidElement(c)) return;
|
|
1703
|
+
const p = c.props;
|
|
1704
|
+
if (c.type === "optgroup" || c.type === React15.Fragment)
|
|
1705
|
+
out.push.apply(out, childOptions(p.children, off || c.type === "optgroup" && !!p.disabled));
|
|
1706
|
+
else if (c.type === "option") {
|
|
1707
|
+
const label = textOf(p.children);
|
|
1708
|
+
out.push({ value: p.value != null ? String(p.value) : label, label, disabled: off || !!p.disabled });
|
|
1709
|
+
}
|
|
1710
|
+
});
|
|
1711
|
+
return out;
|
|
1712
|
+
}
|
|
1713
|
+
function initialLabel(props, filter) {
|
|
1673
1714
|
const opts = (props.options || []).map(function(o) {
|
|
1674
1715
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
1675
|
-
});
|
|
1676
|
-
const
|
|
1716
|
+
}).concat(childOptions(props.children));
|
|
1717
|
+
const first = opts.filter(function(o) {
|
|
1718
|
+
return !o.disabled;
|
|
1719
|
+
})[0];
|
|
1720
|
+
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 : "";
|
|
1677
1721
|
const hit = opts.filter(function(o) {
|
|
1678
1722
|
return o.value === v;
|
|
1679
1723
|
})[0];
|
|
1680
|
-
if (hit)
|
|
1681
|
-
|
|
1724
|
+
if (hit)
|
|
1725
|
+
return {
|
|
1726
|
+
label: filter && filter.allLabel && opts[0] && hit.value === opts[0].value ? filter.allLabel : hit.label,
|
|
1727
|
+
full: hit.label,
|
|
1728
|
+
empty: false
|
|
1729
|
+
};
|
|
1730
|
+
return { label: props.placeholder || "", full: props.placeholder || "", empty: true };
|
|
1682
1731
|
}
|
|
1683
1732
|
var Select = React15.forwardRef(function Select2(props, ref) {
|
|
1684
1733
|
const auto = uid(), id = props.id || auto;
|
|
1685
|
-
const
|
|
1734
|
+
const filter = props[FILTER_KEY];
|
|
1735
|
+
const rest = omit(props, FIELD_KEYS.concat(["children", FILTER_KEY]));
|
|
1686
1736
|
const opts = (props.options || []).map(function(o) {
|
|
1687
1737
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
1688
1738
|
return /* @__PURE__ */ React15.createElement("option", { key: v.value, value: v.value, disabled: v.disabled }, v.label);
|
|
@@ -1697,7 +1747,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1697
1747
|
const live = !native && mounted;
|
|
1698
1748
|
const density = useDensity();
|
|
1699
1749
|
React15.useEffect(function() {
|
|
1700
|
-
if (props.label || props["aria-label"] || props["aria-labelledby"] || props.title) return;
|
|
1750
|
+
if (filter || props.label || props["aria-label"] || props["aria-labelledby"] || props.title) return;
|
|
1701
1751
|
if (document.querySelector('label[for="' + id.replace(/["\\]/g, "\\$&") + '"]')) return;
|
|
1702
1752
|
devWarnOnce(
|
|
1703
1753
|
"select-name",
|
|
@@ -1706,20 +1756,24 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1706
1756
|
}, []);
|
|
1707
1757
|
const selRef = React15.useRef(null), trigRef = React15.useRef(null), listRef = React15.useRef(null);
|
|
1708
1758
|
const shown = React15.useState(function() {
|
|
1709
|
-
return initialLabel(props);
|
|
1759
|
+
return initialLabel(props, filter);
|
|
1710
1760
|
});
|
|
1711
1761
|
const openState = React15.useState(false), open = openState[0];
|
|
1712
1762
|
const activeState = React15.useState(-1), active = activeState[0];
|
|
1713
1763
|
const items2 = React15.useState([]);
|
|
1714
1764
|
const pos = React15.useState(null);
|
|
1715
1765
|
const typed = React15.useRef({ text: "", at: 0 });
|
|
1766
|
+
const allLabel = React15.useRef(void 0);
|
|
1767
|
+
allLabel.current = filter ? filter.allLabel : void 0;
|
|
1716
1768
|
const sync = React15.useCallback(function() {
|
|
1717
1769
|
const el = selRef.current;
|
|
1718
1770
|
if (!el) return;
|
|
1719
1771
|
const o = el.selectedIndex >= 0 ? el.options[el.selectedIndex] : null;
|
|
1720
|
-
const
|
|
1772
|
+
const text2 = o ? o.textContent || "" : "";
|
|
1773
|
+
const short = allLabel.current && el.selectedIndex === 0 ? allLabel.current : text2;
|
|
1774
|
+
const next = o ? { label: short, full: text2, empty: o.value === "" } : { label: "", full: "", empty: true };
|
|
1721
1775
|
shown[1](function(cur) {
|
|
1722
|
-
return cur.label === next.label && cur.empty === next.empty ? cur : next;
|
|
1776
|
+
return cur.label === next.label && cur.full === next.full && cur.empty === next.empty ? cur : next;
|
|
1723
1777
|
});
|
|
1724
1778
|
}, []);
|
|
1725
1779
|
const hook = React15.useCallback(
|
|
@@ -1910,12 +1964,16 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1910
1964
|
const t = trigRef.current && trigRef.current.parentElement;
|
|
1911
1965
|
if (!t) return;
|
|
1912
1966
|
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;
|
|
1967
|
+
const lw = listRef.current ? Math.max(r.width, listRef.current.offsetWidth) : r.width;
|
|
1968
|
+
const rtl = getComputedStyle(t).direction === "rtl";
|
|
1969
|
+
const left = lw <= r.width ? r.left : Math.max(8, Math.min(rtl ? r.right - lw : r.left, window.innerWidth - lw - 8));
|
|
1913
1970
|
pos[1]({
|
|
1914
|
-
left
|
|
1971
|
+
left,
|
|
1915
1972
|
width: r.width,
|
|
1916
1973
|
top: up ? void 0 : r.bottom + 4,
|
|
1917
1974
|
bottom: up ? window.innerHeight - r.top + 4 : void 0,
|
|
1918
|
-
maxHeight: Math.min(320, (up ? above : below2) - 4)
|
|
1975
|
+
maxHeight: Math.min(320, (up ? above : below2) - 4),
|
|
1976
|
+
rtl
|
|
1919
1977
|
});
|
|
1920
1978
|
}
|
|
1921
1979
|
place();
|
|
@@ -1948,7 +2006,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1948
2006
|
[open, active, pos[0] != null]
|
|
1949
2007
|
);
|
|
1950
2008
|
const described = [describedBy(id, props), rest["aria-describedby"]].filter(Boolean).join(" ") || void 0;
|
|
1951
|
-
const field = (child) => /* @__PURE__ */ React15.createElement(
|
|
2009
|
+
const field = (child) => filter ? child : /* @__PURE__ */ React15.createElement(
|
|
1952
2010
|
Field,
|
|
1953
2011
|
{
|
|
1954
2012
|
id,
|
|
@@ -1963,6 +2021,21 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1963
2021
|
},
|
|
1964
2022
|
child
|
|
1965
2023
|
);
|
|
2024
|
+
const nameId = id + "-name";
|
|
2025
|
+
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;
|
|
2026
|
+
if (!live && filter)
|
|
2027
|
+
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(
|
|
2028
|
+
"select",
|
|
2029
|
+
Object.assign(extra, omit(rest, ["style"]), {
|
|
2030
|
+
ref: selMerged,
|
|
2031
|
+
id,
|
|
2032
|
+
className: "aura-filterselect__native",
|
|
2033
|
+
"aria-label": rest["aria-label"] || (rest["aria-labelledby"] ? void 0 : filter.name),
|
|
2034
|
+
"aria-describedby": described
|
|
2035
|
+
}),
|
|
2036
|
+
opts,
|
|
2037
|
+
props.children
|
|
2038
|
+
));
|
|
1966
2039
|
if (!live)
|
|
1967
2040
|
return field(
|
|
1968
2041
|
/* @__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(
|
|
@@ -1983,7 +2056,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1983
2056
|
const optId = function(i) {
|
|
1984
2057
|
return id + "-opt-" + i;
|
|
1985
2058
|
};
|
|
1986
|
-
const labelledBy = rest["aria-labelledby"] || (props.label ? labelId : void 0);
|
|
2059
|
+
const labelledBy = rest["aria-labelledby"] || (filter && !rest["aria-label"] ? nameId : props.label ? labelId : void 0);
|
|
1987
2060
|
const selIndex = selRef.current ? selRef.current.selectedIndex : -1;
|
|
1988
2061
|
const option = function(it) {
|
|
1989
2062
|
const sel = selIndex === it.index;
|
|
@@ -2029,6 +2102,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2029
2102
|
{
|
|
2030
2103
|
ref: listRef,
|
|
2031
2104
|
"data-density": density,
|
|
2105
|
+
dir: pos[0] ? pos[0].rtl ? "rtl" : "ltr" : void 0,
|
|
2032
2106
|
className: "aura-combo__popover aura-select__popover",
|
|
2033
2107
|
style: pos[0] ? {
|
|
2034
2108
|
left: pos[0].left,
|
|
@@ -2061,10 +2135,17 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2061
2135
|
/* @__PURE__ */ React15.createElement(
|
|
2062
2136
|
"div",
|
|
2063
2137
|
{
|
|
2064
|
-
className: cx(
|
|
2138
|
+
className: cx(
|
|
2139
|
+
filter ? "aura-filterselect" : "aura-input",
|
|
2140
|
+
"aura-select aura-select--custom",
|
|
2141
|
+
props.icon && "has-icon",
|
|
2142
|
+
open && "is-open",
|
|
2143
|
+
filter && props.disabled && "is-disabled",
|
|
2144
|
+
filter && props.className
|
|
2145
|
+
),
|
|
2065
2146
|
"data-invalid": props.error ? "" : void 0
|
|
2066
2147
|
},
|
|
2067
|
-
props.icon ? /* @__PURE__ */ React15.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null,
|
|
2148
|
+
props.icon && !filter ? /* @__PURE__ */ React15.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null,
|
|
2068
2149
|
h4(
|
|
2069
2150
|
"select",
|
|
2070
2151
|
Object.assign(extra, pick(rest, FORM_KEYS), {
|
|
@@ -2098,7 +2179,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2098
2179
|
type: "button",
|
|
2099
2180
|
role: "combobox",
|
|
2100
2181
|
form: id + "-no-form",
|
|
2101
|
-
className: "aura-input__control aura-select__trigger",
|
|
2182
|
+
className: filter ? "aura-select__trigger aura-filterselect__face" : "aura-input__control aura-select__trigger",
|
|
2102
2183
|
disabled: props.disabled,
|
|
2103
2184
|
tabIndex: rest.tabIndex,
|
|
2104
2185
|
"aria-haspopup": "listbox",
|
|
@@ -2107,7 +2188,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2107
2188
|
"aria-activedescendant": open && active >= 0 ? optId(active) : void 0,
|
|
2108
2189
|
id,
|
|
2109
2190
|
"aria-label": rest["aria-label"],
|
|
2110
|
-
"aria-labelledby": rest["aria-labelledby"],
|
|
2191
|
+
"aria-labelledby": rest["aria-labelledby"] || (filter && !rest["aria-label"] ? nameId : void 0),
|
|
2111
2192
|
"aria-required": props.required || void 0,
|
|
2112
2193
|
"aria-invalid": props.error ? true : void 0,
|
|
2113
2194
|
"aria-describedby": described,
|
|
@@ -2130,17 +2211,30 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2130
2211
|
if (selRef.current) selRef.current.dispatchEvent(new FocusEvent("focusout", { bubbles: true }));
|
|
2131
2212
|
}
|
|
2132
2213
|
},
|
|
2133
|
-
/* @__PURE__ */ React15.createElement("span", { id: id + "-value", className: cx("aura-select__value", shown[0].empty && "is-placeholder") }, shown[0].label || " ")
|
|
2214
|
+
face || /* @__PURE__ */ React15.createElement("span", { id: id + "-value", className: cx("aura-select__value", shown[0].empty && "is-placeholder") }, shown[0].label || " ")
|
|
2134
2215
|
),
|
|
2135
|
-
/* @__PURE__ */ React15.createElement(Icon, { name: /* @__PURE__ */ React15.createElement(IconChevronDown, null), className: "aura-select__chevron" }),
|
|
2216
|
+
filter ? null : /* @__PURE__ */ React15.createElement(Icon, { name: /* @__PURE__ */ React15.createElement(IconChevronDown, null), className: "aura-select__chevron" }),
|
|
2136
2217
|
popup
|
|
2137
2218
|
)
|
|
2138
2219
|
);
|
|
2139
2220
|
});
|
|
2140
2221
|
|
|
2141
|
-
// src/
|
|
2222
|
+
// src/FilterSelect.tsx
|
|
2142
2223
|
var React16 = __toESM(require("react"), 1);
|
|
2143
|
-
var
|
|
2224
|
+
var FilterSelect = React16.forwardRef(function FilterSelect2(props, ref) {
|
|
2225
|
+
const onChange = props.onChange;
|
|
2226
|
+
const pass = Object.assign(omit(props, ["label", "allLabel", "onChange"]), {
|
|
2227
|
+
[FILTER_KEY]: { name: props.label, allLabel: props.allLabel },
|
|
2228
|
+
onChange: onChange ? function(e) {
|
|
2229
|
+
onChange(e.target.value);
|
|
2230
|
+
} : void 0
|
|
2231
|
+
});
|
|
2232
|
+
return /* @__PURE__ */ React16.createElement(Select, { ...pass, ref });
|
|
2233
|
+
});
|
|
2234
|
+
|
|
2235
|
+
// src/RadioGroup.tsx
|
|
2236
|
+
var React17 = __toESM(require("react"), 1);
|
|
2237
|
+
var RadioGroup = React17.forwardRef(function RadioGroup2(props, ref) {
|
|
2144
2238
|
const auto = uid(), id = props.id || auto;
|
|
2145
2239
|
const st = useMaybeControlled(
|
|
2146
2240
|
props.value,
|
|
@@ -2148,7 +2242,7 @@ var RadioGroup = React16.forwardRef(function RadioGroup2(props, ref) {
|
|
|
2148
2242
|
props.onChange
|
|
2149
2243
|
);
|
|
2150
2244
|
const name = props.name || id;
|
|
2151
|
-
const setRef =
|
|
2245
|
+
const setRef = React17.useCallback(
|
|
2152
2246
|
function(el) {
|
|
2153
2247
|
if (el)
|
|
2154
2248
|
el.focus = function(opts) {
|
|
@@ -2160,7 +2254,7 @@ var RadioGroup = React16.forwardRef(function RadioGroup2(props, ref) {
|
|
|
2160
2254
|
},
|
|
2161
2255
|
[ref]
|
|
2162
2256
|
);
|
|
2163
|
-
return /* @__PURE__ */
|
|
2257
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2164
2258
|
"fieldset",
|
|
2165
2259
|
{
|
|
2166
2260
|
ref: setRef,
|
|
@@ -2169,10 +2263,10 @@ var RadioGroup = React16.forwardRef(function RadioGroup2(props, ref) {
|
|
|
2169
2263
|
"aria-invalid": props.error ? true : void 0,
|
|
2170
2264
|
disabled: props.disabled
|
|
2171
2265
|
},
|
|
2172
|
-
props.label ? /* @__PURE__ */
|
|
2173
|
-
/* @__PURE__ */
|
|
2266
|
+
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,
|
|
2267
|
+
/* @__PURE__ */ React17.createElement("div", { className: cx("aura-radio-group__list", props.orientation === "horizontal" && "is-horizontal") }, (props.options || []).map(function(o) {
|
|
2174
2268
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
2175
|
-
return /* @__PURE__ */
|
|
2269
|
+
return /* @__PURE__ */ React17.createElement("label", { key: v.value, className: cx("aura-choice", v.disabled && "is-disabled") }, /* @__PURE__ */ React17.createElement(
|
|
2176
2270
|
"input",
|
|
2177
2271
|
{
|
|
2178
2272
|
type: "radio",
|
|
@@ -2186,19 +2280,19 @@ var RadioGroup = React16.forwardRef(function RadioGroup2(props, ref) {
|
|
|
2186
2280
|
st[1](v.value);
|
|
2187
2281
|
}
|
|
2188
2282
|
}
|
|
2189
|
-
), /* @__PURE__ */
|
|
2283
|
+
), /* @__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));
|
|
2190
2284
|
})),
|
|
2191
|
-
props.error ? /* @__PURE__ */
|
|
2285
|
+
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
|
|
2192
2286
|
);
|
|
2193
2287
|
});
|
|
2194
2288
|
|
|
2195
2289
|
// src/Switch.tsx
|
|
2196
|
-
var
|
|
2197
|
-
var Switch =
|
|
2290
|
+
var React18 = __toESM(require("react"), 1);
|
|
2291
|
+
var Switch = React18.forwardRef(function Switch2(props, ref) {
|
|
2198
2292
|
const auto = uid(), id = props.id || auto;
|
|
2199
2293
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
2200
2294
|
const on = !!st[0];
|
|
2201
|
-
return /* @__PURE__ */
|
|
2295
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2202
2296
|
"div",
|
|
2203
2297
|
{
|
|
2204
2298
|
className: cx("aura-switch-row", props.disabled && "is-disabled", props.className),
|
|
@@ -2208,7 +2302,7 @@ var Switch = React17.forwardRef(function Switch2(props, ref) {
|
|
|
2208
2302
|
st[1](!on);
|
|
2209
2303
|
}
|
|
2210
2304
|
},
|
|
2211
|
-
/* @__PURE__ */
|
|
2305
|
+
/* @__PURE__ */ React18.createElement(
|
|
2212
2306
|
"button",
|
|
2213
2307
|
{
|
|
2214
2308
|
ref,
|
|
@@ -2225,14 +2319,14 @@ var Switch = React17.forwardRef(function Switch2(props, ref) {
|
|
|
2225
2319
|
st[1](!on);
|
|
2226
2320
|
}
|
|
2227
2321
|
},
|
|
2228
|
-
/* @__PURE__ */
|
|
2322
|
+
/* @__PURE__ */ React18.createElement("span", { className: "aura-switch__thumb" })
|
|
2229
2323
|
),
|
|
2230
|
-
props.label ? /* @__PURE__ */
|
|
2324
|
+
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
|
|
2231
2325
|
);
|
|
2232
2326
|
});
|
|
2233
2327
|
|
|
2234
2328
|
// src/Combobox.tsx
|
|
2235
|
-
var
|
|
2329
|
+
var React19 = __toESM(require("react"), 1);
|
|
2236
2330
|
var import_react_dom3 = require("react-dom");
|
|
2237
2331
|
function norm(s) {
|
|
2238
2332
|
return String(s == null ? "" : s).normalize("NFC").toLocaleLowerCase("th");
|
|
@@ -2247,7 +2341,7 @@ function defaultFilter(option, query) {
|
|
|
2247
2341
|
return norm(k).indexOf(q) >= 0;
|
|
2248
2342
|
});
|
|
2249
2343
|
}
|
|
2250
|
-
var Combobox =
|
|
2344
|
+
var Combobox = React19.forwardRef(
|
|
2251
2345
|
function Combobox2(all, ref) {
|
|
2252
2346
|
const props = all;
|
|
2253
2347
|
const multi = all.multiple === true;
|
|
@@ -2282,11 +2376,11 @@ var Combobox = React18.forwardRef(
|
|
|
2282
2376
|
return o.value === v;
|
|
2283
2377
|
})[0];
|
|
2284
2378
|
}).filter(Boolean) : [];
|
|
2285
|
-
const openState =
|
|
2286
|
-
const qState =
|
|
2287
|
-
const aState =
|
|
2288
|
-
const posState =
|
|
2289
|
-
const inputRef =
|
|
2379
|
+
const openState = React19.useState(false), open = openState[0], setOpen = openState[1];
|
|
2380
|
+
const qState = React19.useState(null), query = qState[0], setQuery = qState[1];
|
|
2381
|
+
const aState = React19.useState(0), active = aState[0], setActive = aState[1];
|
|
2382
|
+
const posState = React19.useState(null);
|
|
2383
|
+
const inputRef = React19.useRef(null), inputMerged = useMergedRef(ref, inputRef), boxRef = React19.useRef(null), listRef = React19.useRef(null);
|
|
2290
2384
|
const mounted = useMounted();
|
|
2291
2385
|
const limit = props.limit || 200;
|
|
2292
2386
|
const filter = props.filter || defaultFilter;
|
|
@@ -2314,7 +2408,7 @@ var Combobox = React18.forwardRef(
|
|
|
2314
2408
|
},
|
|
2315
2409
|
[open, shown.length, values.length]
|
|
2316
2410
|
);
|
|
2317
|
-
|
|
2411
|
+
React19.useEffect(
|
|
2318
2412
|
function() {
|
|
2319
2413
|
if (!open) return;
|
|
2320
2414
|
function outside(e) {
|
|
@@ -2336,7 +2430,7 @@ var Combobox = React18.forwardRef(
|
|
|
2336
2430
|
},
|
|
2337
2431
|
[open]
|
|
2338
2432
|
);
|
|
2339
|
-
|
|
2433
|
+
React19.useEffect(
|
|
2340
2434
|
function() {
|
|
2341
2435
|
if (!open || !listRef.current) return;
|
|
2342
2436
|
const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
|
|
@@ -2417,7 +2511,7 @@ var Combobox = React18.forwardRef(
|
|
|
2417
2511
|
return id + "-opt-" + i;
|
|
2418
2512
|
};
|
|
2419
2513
|
const list = open && mounted && posState[0] ? (0, import_react_dom3.createPortal)(
|
|
2420
|
-
/* @__PURE__ */
|
|
2514
|
+
/* @__PURE__ */ React19.createElement("div", { ref: listRef, "data-density": density, className: "aura-combo__popover", style: posState[0] }, live.length ? /* @__PURE__ */ React19.createElement(
|
|
2421
2515
|
"ul",
|
|
2422
2516
|
{
|
|
2423
2517
|
id: listId,
|
|
@@ -2429,7 +2523,7 @@ var Combobox = React18.forwardRef(
|
|
|
2429
2523
|
live.map(function(o, i) {
|
|
2430
2524
|
const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
|
|
2431
2525
|
const blocked = o.disabled || multi && full && !isSel;
|
|
2432
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2433
2527
|
"li",
|
|
2434
2528
|
{
|
|
2435
2529
|
key: o.value,
|
|
@@ -2454,15 +2548,15 @@ var Combobox = React18.forwardRef(
|
|
|
2454
2548
|
if (activeIdx !== i) setActive(i);
|
|
2455
2549
|
}
|
|
2456
2550
|
},
|
|
2457
|
-
o.icon ? /* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
isSel ? /* @__PURE__ */
|
|
2551
|
+
o.icon ? /* @__PURE__ */ React19.createElement(Icon, { name: o.icon }) : null,
|
|
2552
|
+
/* @__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),
|
|
2553
|
+
isSel ? /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
2460
2554
|
);
|
|
2461
2555
|
})
|
|
2462
|
-
) : null, props.loading || !live.length || more ? /* @__PURE__ */
|
|
2556
|
+
) : 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),
|
|
2463
2557
|
document.body
|
|
2464
2558
|
) : null;
|
|
2465
|
-
return /* @__PURE__ */
|
|
2559
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2466
2560
|
Field,
|
|
2467
2561
|
{
|
|
2468
2562
|
id,
|
|
@@ -2474,8 +2568,8 @@ var Combobox = React18.forwardRef(
|
|
|
2474
2568
|
disabled: props.disabled,
|
|
2475
2569
|
className: props.className
|
|
2476
2570
|
},
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
return /* @__PURE__ */
|
|
2571
|
+
/* @__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) {
|
|
2572
|
+
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(
|
|
2479
2573
|
"button",
|
|
2480
2574
|
{
|
|
2481
2575
|
type: "button",
|
|
@@ -2494,13 +2588,13 @@ var Combobox = React18.forwardRef(
|
|
|
2494
2588
|
if (inputRef.current) inputRef.current.focus();
|
|
2495
2589
|
}
|
|
2496
2590
|
},
|
|
2497
|
-
/* @__PURE__ */
|
|
2591
|
+
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconX, null) })
|
|
2498
2592
|
));
|
|
2499
|
-
})) : null, multi ? /* @__PURE__ */
|
|
2593
|
+
})) : null, multi ? /* @__PURE__ */ React19.createElement("span", { id: summaryId, className: "aura-sr-only" }, picked.length ? t.selectedCount(picked.length) + ": " + picked.map(function(o) {
|
|
2500
2594
|
return o.label;
|
|
2501
2595
|
}).join(", ") : "") : null, props.name ? multi ? values.map(function(v) {
|
|
2502
|
-
return /* @__PURE__ */
|
|
2503
|
-
}) : /* @__PURE__ */
|
|
2596
|
+
return /* @__PURE__ */ React19.createElement("input", { key: v, type: "hidden", name: props.name, value: v });
|
|
2597
|
+
}) : /* @__PURE__ */ React19.createElement("input", { type: "hidden", name: props.name, value: value == null ? "" : value }) : null, /* @__PURE__ */ React19.createElement(
|
|
2504
2598
|
"input",
|
|
2505
2599
|
{
|
|
2506
2600
|
ref: inputMerged,
|
|
@@ -2536,7 +2630,7 @@ var Combobox = React18.forwardRef(
|
|
|
2536
2630
|
}, 0);
|
|
2537
2631
|
}
|
|
2538
2632
|
}
|
|
2539
|
-
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */
|
|
2633
|
+
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */ React19.createElement(
|
|
2540
2634
|
"button",
|
|
2541
2635
|
{
|
|
2542
2636
|
type: "button",
|
|
@@ -2549,8 +2643,8 @@ var Combobox = React18.forwardRef(
|
|
|
2549
2643
|
if (inputRef.current) inputRef.current.focus();
|
|
2550
2644
|
}
|
|
2551
2645
|
},
|
|
2552
|
-
/* @__PURE__ */
|
|
2553
|
-
) : null, /* @__PURE__ */
|
|
2646
|
+
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconX, null) })
|
|
2647
|
+
) : null, /* @__PURE__ */ React19.createElement(
|
|
2554
2648
|
"button",
|
|
2555
2649
|
{
|
|
2556
2650
|
type: "button",
|
|
@@ -2568,7 +2662,7 @@ var Combobox = React18.forwardRef(
|
|
|
2568
2662
|
}
|
|
2569
2663
|
}
|
|
2570
2664
|
},
|
|
2571
|
-
/* @__PURE__ */
|
|
2665
|
+
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconChevronDown, null) })
|
|
2572
2666
|
)),
|
|
2573
2667
|
list
|
|
2574
2668
|
);
|
|
@@ -2576,7 +2670,7 @@ var Combobox = React18.forwardRef(
|
|
|
2576
2670
|
);
|
|
2577
2671
|
|
|
2578
2672
|
// src/DatePicker.tsx
|
|
2579
|
-
var
|
|
2673
|
+
var React20 = __toESM(require("react"), 1);
|
|
2580
2674
|
var import_react_dom4 = require("react-dom");
|
|
2581
2675
|
|
|
2582
2676
|
// src/dates.ts
|
|
@@ -2760,7 +2854,7 @@ function todayIn(timeZone) {
|
|
|
2760
2854
|
// src/DatePicker.tsx
|
|
2761
2855
|
function useFormatDate() {
|
|
2762
2856
|
const ctx = useAuraLocale(), locale = ctx.locale || "en", calendar = ctx.calendar;
|
|
2763
|
-
return
|
|
2857
|
+
return React20.useCallback(
|
|
2764
2858
|
function(iso, opts) {
|
|
2765
2859
|
const o = opts || {}, loc = o.locale || locale;
|
|
2766
2860
|
return formatDate(
|
|
@@ -2781,7 +2875,7 @@ function allowedDate(iso, o) {
|
|
|
2781
2875
|
if (hi && fromISO(hi) && iso > hi) return false;
|
|
2782
2876
|
return !(o.isDateDisabled && o.isDateDisabled(iso));
|
|
2783
2877
|
}
|
|
2784
|
-
var Calendar =
|
|
2878
|
+
var Calendar = React20.forwardRef(function Calendar2(props, ref) {
|
|
2785
2879
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), tag = localeTag(locale, calendar);
|
|
2786
2880
|
const weekStart = props.weekStartsOn == null ? locale === "sv" ? 1 : 0 : props.weekStartsOn;
|
|
2787
2881
|
const given = props.today && fromISO(props.today) ? props.today : null, zone = props.timeZone || ctx.timeZone;
|
|
@@ -2796,7 +2890,7 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2796
2890
|
function select(iso) {
|
|
2797
2891
|
if (props.onSelect) props.onSelect(iso);
|
|
2798
2892
|
}
|
|
2799
|
-
const focusState =
|
|
2893
|
+
const focusState = React20.useState(function() {
|
|
2800
2894
|
const d0 = fromISO(props.focus) || start || today;
|
|
2801
2895
|
if (!disabledAt(d0)) return d0;
|
|
2802
2896
|
for (let i = 1; i <= 366; i++) {
|
|
@@ -2806,21 +2900,21 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2806
2900
|
return d0;
|
|
2807
2901
|
});
|
|
2808
2902
|
const focusDate = focusState[0], setFocus = focusState[1];
|
|
2809
|
-
const viewState =
|
|
2810
|
-
const hoverState =
|
|
2811
|
-
const gridRef =
|
|
2903
|
+
const viewState = React20.useState("days"), view = viewState[0], setView = viewState[1];
|
|
2904
|
+
const hoverState = React20.useState(null);
|
|
2905
|
+
const gridRef = React20.useRef(null), gridMerged = useMergedRef(ref, gridRef), moved = React20.useRef(false);
|
|
2812
2906
|
const th2 = locale === "th";
|
|
2813
2907
|
const dt = dateText(locale);
|
|
2814
2908
|
function disabled(d) {
|
|
2815
2909
|
return disabledAt(d);
|
|
2816
2910
|
}
|
|
2817
|
-
|
|
2911
|
+
React20.useEffect(function() {
|
|
2818
2912
|
if (!moved.current) return;
|
|
2819
2913
|
moved.current = false;
|
|
2820
2914
|
const el = gridRef.current && gridRef.current.querySelector('[data-date="' + toISO(focusDate) + '"]');
|
|
2821
2915
|
if (el) el.focus();
|
|
2822
2916
|
});
|
|
2823
|
-
|
|
2917
|
+
React20.useEffect(
|
|
2824
2918
|
function() {
|
|
2825
2919
|
if (props.autoFocus === false) return;
|
|
2826
2920
|
const el = gridRef.current && gridRef.current.querySelector('[tabindex="0"]');
|
|
@@ -2875,16 +2969,16 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2875
2969
|
const yr = focusDate.getFullYear(), base = yr - yr % 12;
|
|
2876
2970
|
const years = [];
|
|
2877
2971
|
for (let y = base; y < base + 12; y++) years.push(y);
|
|
2878
|
-
return /* @__PURE__ */
|
|
2972
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React20.createElement(
|
|
2879
2973
|
IconButton,
|
|
2880
2974
|
{
|
|
2881
|
-
icon: /* @__PURE__ */
|
|
2975
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronLeft, null),
|
|
2882
2976
|
label: dt.prevYears,
|
|
2883
2977
|
onClick: function() {
|
|
2884
2978
|
setFocus(new Date(yr - 12, focusDate.getMonth(), 1));
|
|
2885
2979
|
}
|
|
2886
2980
|
}
|
|
2887
|
-
), /* @__PURE__ */
|
|
2981
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2888
2982
|
"button",
|
|
2889
2983
|
{
|
|
2890
2984
|
type: "button",
|
|
@@ -2894,18 +2988,18 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2894
2988
|
}
|
|
2895
2989
|
},
|
|
2896
2990
|
fmt(tag, { year: "numeric" }, new Date(base, 0, 1)).replace(ERA, "") + " \u2013 " + fmt(tag, { year: "numeric" }, new Date(base + 11, 0, 1)).replace(ERA, "")
|
|
2897
|
-
), /* @__PURE__ */
|
|
2991
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2898
2992
|
IconButton,
|
|
2899
2993
|
{
|
|
2900
|
-
icon: /* @__PURE__ */
|
|
2994
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronRight, null),
|
|
2901
2995
|
label: dt.nextYears,
|
|
2902
2996
|
onClick: function() {
|
|
2903
2997
|
setFocus(new Date(yr + 12, focusDate.getMonth(), 1));
|
|
2904
2998
|
}
|
|
2905
2999
|
}
|
|
2906
|
-
)), /* @__PURE__ */
|
|
3000
|
+
)), /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__years" }, years.map(function(y) {
|
|
2907
3001
|
const d = new Date(y, focusDate.getMonth(), 1);
|
|
2908
|
-
return /* @__PURE__ */
|
|
3002
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2909
3003
|
"button",
|
|
2910
3004
|
{
|
|
2911
3005
|
key: y,
|
|
@@ -2922,16 +3016,16 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2922
3016
|
);
|
|
2923
3017
|
})));
|
|
2924
3018
|
}
|
|
2925
|
-
return /* @__PURE__ */
|
|
3019
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React20.createElement(
|
|
2926
3020
|
IconButton,
|
|
2927
3021
|
{
|
|
2928
|
-
icon: /* @__PURE__ */
|
|
3022
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronLeft, null),
|
|
2929
3023
|
label: dt.prevMonth,
|
|
2930
3024
|
onClick: function() {
|
|
2931
3025
|
setFocus(addMonths(focusDate, -1));
|
|
2932
3026
|
}
|
|
2933
3027
|
}
|
|
2934
|
-
), /* @__PURE__ */
|
|
3028
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2935
3029
|
"button",
|
|
2936
3030
|
{
|
|
2937
3031
|
type: "button",
|
|
@@ -2942,19 +3036,19 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2942
3036
|
}
|
|
2943
3037
|
},
|
|
2944
3038
|
monthTitle,
|
|
2945
|
-
/* @__PURE__ */
|
|
2946
|
-
), /* @__PURE__ */
|
|
3039
|
+
/* @__PURE__ */ React20.createElement(Icon, { name: /* @__PURE__ */ React20.createElement(IconChevronDown, null), size: 14 })
|
|
3040
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2947
3041
|
IconButton,
|
|
2948
3042
|
{
|
|
2949
|
-
icon: /* @__PURE__ */
|
|
3043
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronRight, null),
|
|
2950
3044
|
label: dt.nextMonth,
|
|
2951
3045
|
onClick: function() {
|
|
2952
3046
|
setFocus(addMonths(focusDate, 1));
|
|
2953
3047
|
}
|
|
2954
3048
|
}
|
|
2955
|
-
)), /* @__PURE__ */
|
|
2956
|
-
return /* @__PURE__ */
|
|
2957
|
-
}))), /* @__PURE__ */
|
|
3049
|
+
)), /* @__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) {
|
|
3050
|
+
return /* @__PURE__ */ React20.createElement("th", { key: i, scope: "col", abbr: n3.long }, /* @__PURE__ */ React20.createElement("span", { "aria-hidden": true }, n3.short));
|
|
3051
|
+
}))), /* @__PURE__ */ React20.createElement(
|
|
2958
3052
|
"tbody",
|
|
2959
3053
|
{
|
|
2960
3054
|
onMouseLeave: function() {
|
|
@@ -2962,11 +3056,11 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2962
3056
|
}
|
|
2963
3057
|
},
|
|
2964
3058
|
weeks.map(function(wk, wi) {
|
|
2965
|
-
return /* @__PURE__ */
|
|
3059
|
+
return /* @__PURE__ */ React20.createElement("tr", { key: wi }, wk.map(function(d) {
|
|
2966
3060
|
const iso = toISO(d), out = d.getMonth() !== focusDate.getMonth(), dis = disabled(d);
|
|
2967
3061
|
const isStart = same(d, start), isEnd = same(d, end) || !end && props.range && same(d, hover) && start;
|
|
2968
3062
|
const sel = isStart || same(d, end);
|
|
2969
|
-
return /* @__PURE__ */
|
|
3063
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2970
3064
|
"td",
|
|
2971
3065
|
{
|
|
2972
3066
|
key: iso,
|
|
@@ -2978,7 +3072,7 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2978
3072
|
props.range && isEnd && start && "is-range-end"
|
|
2979
3073
|
)
|
|
2980
3074
|
},
|
|
2981
|
-
/* @__PURE__ */
|
|
3075
|
+
/* @__PURE__ */ React20.createElement(
|
|
2982
3076
|
"button",
|
|
2983
3077
|
{
|
|
2984
3078
|
type: "button",
|
|
@@ -3011,7 +3105,7 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
3011
3105
|
);
|
|
3012
3106
|
}));
|
|
3013
3107
|
})
|
|
3014
|
-
)), props.footer === false ? null : /* @__PURE__ */
|
|
3108
|
+
)), props.footer === false ? null : /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__foot" }, /* @__PURE__ */ React20.createElement(
|
|
3015
3109
|
"button",
|
|
3016
3110
|
{
|
|
3017
3111
|
type: "button",
|
|
@@ -3023,11 +3117,11 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
3023
3117
|
}
|
|
3024
3118
|
},
|
|
3025
3119
|
dt.today
|
|
3026
|
-
), props.onClear ? /* @__PURE__ */
|
|
3120
|
+
), props.onClear ? /* @__PURE__ */ React20.createElement("button", { type: "button", className: "aura-cal__link", onClick: props.onClear }, dt.clear) : null));
|
|
3027
3121
|
});
|
|
3028
3122
|
function useCalendarPopover(boxRef) {
|
|
3029
|
-
const openState =
|
|
3030
|
-
const pos =
|
|
3123
|
+
const openState = React20.useState(false), open = openState[0], setOpen = openState[1];
|
|
3124
|
+
const pos = React20.useState(null), popRef = React20.useRef(null), mounted = useMounted();
|
|
3031
3125
|
function place() {
|
|
3032
3126
|
if (!boxRef.current) return;
|
|
3033
3127
|
const el = popRef.current, r = boxRef.current.getBoundingClientRect(), W = el ? el.offsetWidth : 320, H = el ? el.offsetHeight : 380;
|
|
@@ -3041,7 +3135,7 @@ function useCalendarPopover(boxRef) {
|
|
|
3041
3135
|
},
|
|
3042
3136
|
[open, !!pos[0]]
|
|
3043
3137
|
);
|
|
3044
|
-
|
|
3138
|
+
React20.useEffect(
|
|
3045
3139
|
function() {
|
|
3046
3140
|
if (!open) return;
|
|
3047
3141
|
function outside(e) {
|
|
@@ -3063,8 +3157,8 @@ function useCalendarPopover(boxRef) {
|
|
|
3063
3157
|
return { open, setOpen, pos: pos[0], popRef, mounted };
|
|
3064
3158
|
}
|
|
3065
3159
|
function DateField(props) {
|
|
3066
|
-
const editState =
|
|
3067
|
-
return /* @__PURE__ */
|
|
3160
|
+
const editState = React20.useState(null), editing = editState[0], setEditing = editState[1];
|
|
3161
|
+
return /* @__PURE__ */ React20.createElement(
|
|
3068
3162
|
Field,
|
|
3069
3163
|
{
|
|
3070
3164
|
id: props.id,
|
|
@@ -3076,7 +3170,7 @@ function DateField(props) {
|
|
|
3076
3170
|
disabled: props.disabled,
|
|
3077
3171
|
className: props.className
|
|
3078
3172
|
},
|
|
3079
|
-
/* @__PURE__ */
|
|
3173
|
+
/* @__PURE__ */ React20.createElement("div", { ref: props.boxRef, className: cx("aura-input aura-date", props.open && "is-open") }, /* @__PURE__ */ React20.createElement(
|
|
3080
3174
|
"input",
|
|
3081
3175
|
{
|
|
3082
3176
|
ref: props.inputRef,
|
|
@@ -3115,7 +3209,7 @@ function DateField(props) {
|
|
|
3115
3209
|
}
|
|
3116
3210
|
}
|
|
3117
3211
|
}
|
|
3118
|
-
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */
|
|
3212
|
+
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */ React20.createElement(
|
|
3119
3213
|
"button",
|
|
3120
3214
|
{
|
|
3121
3215
|
type: "button",
|
|
@@ -3124,8 +3218,8 @@ function DateField(props) {
|
|
|
3124
3218
|
"aria-label": props.clearLabel,
|
|
3125
3219
|
onClick: props.onClear
|
|
3126
3220
|
},
|
|
3127
|
-
/* @__PURE__ */
|
|
3128
|
-
) : null, /* @__PURE__ */
|
|
3221
|
+
/* @__PURE__ */ React20.createElement(Icon, { name: /* @__PURE__ */ React20.createElement(IconX, null) })
|
|
3222
|
+
) : null, /* @__PURE__ */ React20.createElement(
|
|
3129
3223
|
"button",
|
|
3130
3224
|
{
|
|
3131
3225
|
type: "button",
|
|
@@ -3139,11 +3233,11 @@ function DateField(props) {
|
|
|
3139
3233
|
props.onToggle(!props.open);
|
|
3140
3234
|
}
|
|
3141
3235
|
},
|
|
3142
|
-
/* @__PURE__ */
|
|
3236
|
+
/* @__PURE__ */ React20.createElement(Icon, { name: /* @__PURE__ */ React20.createElement(IconCalendar, null) })
|
|
3143
3237
|
))
|
|
3144
3238
|
);
|
|
3145
3239
|
}
|
|
3146
|
-
var DatePicker =
|
|
3240
|
+
var DatePicker = React20.forwardRef(function DatePicker2(props, ref) {
|
|
3147
3241
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
3148
3242
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
3149
3243
|
const st = useMaybeControlled(
|
|
@@ -3151,7 +3245,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3151
3245
|
props.defaultValue == null ? null : props.defaultValue,
|
|
3152
3246
|
props.onChange
|
|
3153
3247
|
);
|
|
3154
|
-
const boxRef =
|
|
3248
|
+
const boxRef = React20.useRef(null), inputRef = React20.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
3155
3249
|
const pop = useCalendarPopover(boxRef);
|
|
3156
3250
|
const limits = {
|
|
3157
3251
|
min: props.min,
|
|
@@ -3160,8 +3254,8 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3160
3254
|
timeZone: props.timeZone || ctx.timeZone,
|
|
3161
3255
|
isDateDisabled: props.isDateDisabled
|
|
3162
3256
|
};
|
|
3163
|
-
const bad =
|
|
3164
|
-
|
|
3257
|
+
const bad = React20.useState(null);
|
|
3258
|
+
React20.useEffect(
|
|
3165
3259
|
function() {
|
|
3166
3260
|
bad[1](null);
|
|
3167
3261
|
},
|
|
@@ -3183,7 +3277,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3183
3277
|
if (inputRef.current) inputRef.current.focus();
|
|
3184
3278
|
}
|
|
3185
3279
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
3186
|
-
/* @__PURE__ */
|
|
3280
|
+
/* @__PURE__ */ React20.createElement(
|
|
3187
3281
|
"div",
|
|
3188
3282
|
{
|
|
3189
3283
|
ref: pop.popRef,
|
|
@@ -3200,7 +3294,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3200
3294
|
} else trapTab(e, pop.popRef.current);
|
|
3201
3295
|
}
|
|
3202
3296
|
},
|
|
3203
|
-
/* @__PURE__ */
|
|
3297
|
+
/* @__PURE__ */ React20.createElement(
|
|
3204
3298
|
Calendar,
|
|
3205
3299
|
{
|
|
3206
3300
|
locale,
|
|
@@ -3223,7 +3317,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3223
3317
|
),
|
|
3224
3318
|
document.body
|
|
3225
3319
|
) : null;
|
|
3226
|
-
return /* @__PURE__ */
|
|
3320
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
3227
3321
|
DateField,
|
|
3228
3322
|
{
|
|
3229
3323
|
id,
|
|
@@ -3258,7 +3352,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3258
3352
|
}
|
|
3259
3353
|
), cal);
|
|
3260
3354
|
});
|
|
3261
|
-
var DateRangePicker =
|
|
3355
|
+
var DateRangePicker = React20.forwardRef(
|
|
3262
3356
|
function DateRangePicker2(props, ref) {
|
|
3263
3357
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
3264
3358
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
@@ -3268,8 +3362,8 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3268
3362
|
props.onChange
|
|
3269
3363
|
);
|
|
3270
3364
|
const v = st[0] || { start: null, end: null };
|
|
3271
|
-
const draft =
|
|
3272
|
-
const boxRef =
|
|
3365
|
+
const draft = React20.useState(null);
|
|
3366
|
+
const boxRef = React20.useRef(null), inputRef = React20.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
3273
3367
|
const pop = useCalendarPopover(boxRef);
|
|
3274
3368
|
const limits = {
|
|
3275
3369
|
min: props.min,
|
|
@@ -3284,8 +3378,8 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3284
3378
|
if (!r.end) return formatDate(r.start, o) + " \u2013";
|
|
3285
3379
|
return formatDate(r.start, o) + " \u2013 " + formatDate(r.end, o);
|
|
3286
3380
|
}
|
|
3287
|
-
const bad =
|
|
3288
|
-
|
|
3381
|
+
const bad = React20.useState(null);
|
|
3382
|
+
React20.useEffect(
|
|
3289
3383
|
function() {
|
|
3290
3384
|
bad[1](null);
|
|
3291
3385
|
},
|
|
@@ -3318,7 +3412,7 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3318
3412
|
close();
|
|
3319
3413
|
}
|
|
3320
3414
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
3321
|
-
/* @__PURE__ */
|
|
3415
|
+
/* @__PURE__ */ React20.createElement(
|
|
3322
3416
|
"div",
|
|
3323
3417
|
{
|
|
3324
3418
|
ref: pop.popRef,
|
|
@@ -3335,8 +3429,8 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3335
3429
|
} else trapTab(e, pop.popRef.current);
|
|
3336
3430
|
}
|
|
3337
3431
|
},
|
|
3338
|
-
/* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */
|
|
3432
|
+
/* @__PURE__ */ React20.createElement("p", { className: "aura-cal__hint", "aria-live": "polite" }, draft[0] ? dt.chooseEnd : dt.chooseStart),
|
|
3433
|
+
/* @__PURE__ */ React20.createElement(
|
|
3340
3434
|
Calendar,
|
|
3341
3435
|
{
|
|
3342
3436
|
range: true,
|
|
@@ -3357,7 +3451,7 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3357
3451
|
),
|
|
3358
3452
|
document.body
|
|
3359
3453
|
) : null;
|
|
3360
|
-
return /* @__PURE__ */
|
|
3454
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
3361
3455
|
DateField,
|
|
3362
3456
|
{
|
|
3363
3457
|
id,
|
|
@@ -3396,18 +3490,18 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3396
3490
|
);
|
|
3397
3491
|
|
|
3398
3492
|
// src/Alert.tsx
|
|
3399
|
-
var
|
|
3400
|
-
var Alert =
|
|
3493
|
+
var React21 = __toESM(require("react"), 1);
|
|
3494
|
+
var Alert = React21.forwardRef(function Alert2(props, ref) {
|
|
3401
3495
|
const t = useStrings();
|
|
3402
3496
|
return alertElement(
|
|
3403
3497
|
props,
|
|
3404
3498
|
ref,
|
|
3405
|
-
props.onDismiss ? /* @__PURE__ */
|
|
3499
|
+
props.onDismiss ? /* @__PURE__ */ React21.createElement(IconButton, { icon: /* @__PURE__ */ React21.createElement(IconX, null), label: t.dismiss, className: "aura-alert__close", onClick: props.onDismiss }) : null
|
|
3406
3500
|
);
|
|
3407
3501
|
});
|
|
3408
3502
|
|
|
3409
3503
|
// src/Toaster.tsx
|
|
3410
|
-
var
|
|
3504
|
+
var React22 = __toESM(require("react"), 1);
|
|
3411
3505
|
var import_react_dom5 = require("react-dom");
|
|
3412
3506
|
var MAX_VISIBLE = 3;
|
|
3413
3507
|
var toastState = {
|
|
@@ -3483,8 +3577,8 @@ function outsideToaster(el) {
|
|
|
3483
3577
|
function ToastItem(props) {
|
|
3484
3578
|
const str = useStrings();
|
|
3485
3579
|
const Link = useLinkComponent();
|
|
3486
|
-
const node =
|
|
3487
|
-
const origin =
|
|
3580
|
+
const node = React22.useRef(null);
|
|
3581
|
+
const origin = React22.useRef(null);
|
|
3488
3582
|
useIsoLayoutEffect(function() {
|
|
3489
3583
|
origin.current = outsideToaster(document.activeElement);
|
|
3490
3584
|
const el = node.current;
|
|
@@ -3500,8 +3594,8 @@ function ToastItem(props) {
|
|
|
3500
3594
|
}, 0);
|
|
3501
3595
|
};
|
|
3502
3596
|
}, []);
|
|
3503
|
-
const t = props.toast, timer =
|
|
3504
|
-
const hover =
|
|
3597
|
+
const t = props.toast, timer = React22.useRef(null), left = React22.useRef(t.duration || 5e3), since = React22.useRef(0);
|
|
3598
|
+
const hover = React22.useRef(false), focused = React22.useRef(false);
|
|
3505
3599
|
function syncFocus() {
|
|
3506
3600
|
if (focused.current && !(node.current && node.current.contains(document.activeElement))) focused.current = false;
|
|
3507
3601
|
}
|
|
@@ -3523,7 +3617,7 @@ function ToastItem(props) {
|
|
|
3523
3617
|
left.current -= Date.now() - since.current;
|
|
3524
3618
|
}
|
|
3525
3619
|
}
|
|
3526
|
-
|
|
3620
|
+
React22.useEffect(
|
|
3527
3621
|
function() {
|
|
3528
3622
|
if (timer.current) clearTimeout(timer.current);
|
|
3529
3623
|
timer.current = null;
|
|
@@ -3542,7 +3636,7 @@ function ToastItem(props) {
|
|
|
3542
3636
|
if (a.onClick) a.onClick();
|
|
3543
3637
|
if (a.dismiss !== false) toast.dismiss(t.id);
|
|
3544
3638
|
}
|
|
3545
|
-
return /* @__PURE__ */
|
|
3639
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3546
3640
|
"div",
|
|
3547
3641
|
{
|
|
3548
3642
|
ref: node,
|
|
@@ -3579,16 +3673,16 @@ function ToastItem(props) {
|
|
|
3579
3673
|
resume();
|
|
3580
3674
|
}
|
|
3581
3675
|
},
|
|
3582
|
-
/* @__PURE__ */
|
|
3676
|
+
/* @__PURE__ */ React22.createElement(
|
|
3583
3677
|
Icon,
|
|
3584
3678
|
{
|
|
3585
|
-
name: t.loading ? /* @__PURE__ */
|
|
3679
|
+
name: t.loading ? /* @__PURE__ */ React22.createElement(IconLoaderCircle, null) : React22.createElement(ALERT_ICON[t.tone] || IconInfo),
|
|
3586
3680
|
className: cx("aura-toast__icon", t.loading && "aura-spin")
|
|
3587
3681
|
}
|
|
3588
3682
|
),
|
|
3589
|
-
/* @__PURE__ */
|
|
3590
|
-
actions.length ? /* @__PURE__ */
|
|
3591
|
-
return a.href ? /* @__PURE__ */
|
|
3683
|
+
/* @__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),
|
|
3684
|
+
actions.length ? /* @__PURE__ */ React22.createElement("div", { className: "aura-toast__actions" }, actions.map(function(a, i) {
|
|
3685
|
+
return a.href ? /* @__PURE__ */ React22.createElement(
|
|
3592
3686
|
Link,
|
|
3593
3687
|
{
|
|
3594
3688
|
key: i,
|
|
@@ -3600,7 +3694,7 @@ function ToastItem(props) {
|
|
|
3600
3694
|
}
|
|
3601
3695
|
},
|
|
3602
3696
|
a.label
|
|
3603
|
-
) : /* @__PURE__ */
|
|
3697
|
+
) : /* @__PURE__ */ React22.createElement(
|
|
3604
3698
|
"button",
|
|
3605
3699
|
{
|
|
3606
3700
|
key: i,
|
|
@@ -3613,10 +3707,10 @@ function ToastItem(props) {
|
|
|
3613
3707
|
a.label
|
|
3614
3708
|
);
|
|
3615
3709
|
})) : null,
|
|
3616
|
-
/* @__PURE__ */
|
|
3710
|
+
/* @__PURE__ */ React22.createElement(
|
|
3617
3711
|
IconButton,
|
|
3618
3712
|
{
|
|
3619
|
-
icon: /* @__PURE__ */
|
|
3713
|
+
icon: /* @__PURE__ */ React22.createElement(IconX, null),
|
|
3620
3714
|
label: str.dismissToast,
|
|
3621
3715
|
className: "aura-toast__close",
|
|
3622
3716
|
onClick: function() {
|
|
@@ -3644,8 +3738,8 @@ function hotkeyMatcher(spec) {
|
|
|
3644
3738
|
function Toaster(props = {}) {
|
|
3645
3739
|
const t = useStrings();
|
|
3646
3740
|
const mounted = useMounted();
|
|
3647
|
-
const s =
|
|
3648
|
-
|
|
3741
|
+
const s = React22.useState(toastState.list);
|
|
3742
|
+
React22.useEffect(function() {
|
|
3649
3743
|
toastState.subs.push(s[1]);
|
|
3650
3744
|
s[1](toastState.list.slice());
|
|
3651
3745
|
return function() {
|
|
@@ -3654,9 +3748,9 @@ function Toaster(props = {}) {
|
|
|
3654
3748
|
});
|
|
3655
3749
|
};
|
|
3656
3750
|
}, []);
|
|
3657
|
-
const region =
|
|
3751
|
+
const region = React22.useRef(null);
|
|
3658
3752
|
const hotkey = props.hotkey === void 0 ? "Alt+T" : props.hotkey;
|
|
3659
|
-
|
|
3753
|
+
React22.useEffect(
|
|
3660
3754
|
function() {
|
|
3661
3755
|
if (!hotkey) return;
|
|
3662
3756
|
const match = hotkeyMatcher(hotkey);
|
|
@@ -3687,7 +3781,7 @@ function Toaster(props = {}) {
|
|
|
3687
3781
|
const pos = props.position || "bottom";
|
|
3688
3782
|
const offset = props.offset;
|
|
3689
3783
|
return (0, import_react_dom5.createPortal)(
|
|
3690
|
-
/* @__PURE__ */
|
|
3784
|
+
/* @__PURE__ */ React22.createElement(
|
|
3691
3785
|
"div",
|
|
3692
3786
|
{
|
|
3693
3787
|
ref: region,
|
|
@@ -3699,7 +3793,7 @@ function Toaster(props = {}) {
|
|
|
3699
3793
|
"aria-keyshortcuts": hotkey || void 0
|
|
3700
3794
|
},
|
|
3701
3795
|
s[0].map(function(t2) {
|
|
3702
|
-
return /* @__PURE__ */
|
|
3796
|
+
return /* @__PURE__ */ React22.createElement(ToastItem, { key: t2.id, toast: t2 });
|
|
3703
3797
|
})
|
|
3704
3798
|
),
|
|
3705
3799
|
document.body
|
|
@@ -3707,12 +3801,12 @@ function Toaster(props = {}) {
|
|
|
3707
3801
|
}
|
|
3708
3802
|
|
|
3709
3803
|
// src/PasswordField.tsx
|
|
3710
|
-
var
|
|
3711
|
-
var PasswordField =
|
|
3804
|
+
var React23 = __toESM(require("react"), 1);
|
|
3805
|
+
var PasswordField = React23.forwardRef(function PasswordField2(props, ref) {
|
|
3712
3806
|
const t = useStrings();
|
|
3713
|
-
const shown =
|
|
3807
|
+
const shown = React23.useState(false);
|
|
3714
3808
|
const rest = omit(props, ["toggle", "className"]);
|
|
3715
|
-
return /* @__PURE__ */
|
|
3809
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3716
3810
|
TextField,
|
|
3717
3811
|
{
|
|
3718
3812
|
autoComplete: "current-password",
|
|
@@ -3722,10 +3816,10 @@ var PasswordField = React22.forwardRef(function PasswordField2(props, ref) {
|
|
|
3722
3816
|
spellCheck: false,
|
|
3723
3817
|
autoCapitalize: "none",
|
|
3724
3818
|
className: cx("aura-password", props.className),
|
|
3725
|
-
suffix: props.toggle === false ? void 0 : /* @__PURE__ */
|
|
3819
|
+
suffix: props.toggle === false ? void 0 : /* @__PURE__ */ React23.createElement(
|
|
3726
3820
|
IconButton,
|
|
3727
3821
|
{
|
|
3728
|
-
icon: shown[0] ? /* @__PURE__ */
|
|
3822
|
+
icon: shown[0] ? /* @__PURE__ */ React23.createElement(IconEyeOff, null) : /* @__PURE__ */ React23.createElement(IconEye, null),
|
|
3729
3823
|
label: t.showPassword,
|
|
3730
3824
|
"aria-pressed": shown[0],
|
|
3731
3825
|
disabled: props.disabled,
|
|
@@ -3739,7 +3833,7 @@ var PasswordField = React22.forwardRef(function PasswordField2(props, ref) {
|
|
|
3739
3833
|
});
|
|
3740
3834
|
|
|
3741
3835
|
// src/FormErrorSummary.tsx
|
|
3742
|
-
var
|
|
3836
|
+
var React24 = __toESM(require("react"), 1);
|
|
3743
3837
|
function items(errors) {
|
|
3744
3838
|
if (Array.isArray(errors)) return errors;
|
|
3745
3839
|
const out = [];
|
|
@@ -3768,16 +3862,16 @@ function fieldElement(field) {
|
|
|
3768
3862
|
}
|
|
3769
3863
|
return named;
|
|
3770
3864
|
}
|
|
3771
|
-
var FormErrorSummary =
|
|
3865
|
+
var FormErrorSummary = React24.forwardRef(
|
|
3772
3866
|
function FormErrorSummary2(props, ref) {
|
|
3773
3867
|
const t = useStrings();
|
|
3774
3868
|
const auto = uid(), id = props.id || auto;
|
|
3775
3869
|
const list = items(props.errors);
|
|
3776
|
-
const box =
|
|
3870
|
+
const box = React24.useRef(null);
|
|
3777
3871
|
const keyed = props.focusKey !== void 0;
|
|
3778
|
-
const lastKey =
|
|
3872
|
+
const lastKey = React24.useRef(null), armed = React24.useRef(false), hadErrors = React24.useRef(false);
|
|
3779
3873
|
const has = list.length > 0;
|
|
3780
|
-
|
|
3874
|
+
React24.useEffect(
|
|
3781
3875
|
function() {
|
|
3782
3876
|
const appeared = has && !hadErrors.current;
|
|
3783
3877
|
hadErrors.current = has;
|
|
@@ -3801,7 +3895,7 @@ var FormErrorSummary = React23.forwardRef(
|
|
|
3801
3895
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3802
3896
|
[has, props.focusKey, keyed]
|
|
3803
3897
|
);
|
|
3804
|
-
|
|
3898
|
+
React24.useEffect(
|
|
3805
3899
|
function() {
|
|
3806
3900
|
if (!keyed) return;
|
|
3807
3901
|
function disarm() {
|
|
@@ -3820,7 +3914,7 @@ var FormErrorSummary = React23.forwardRef(
|
|
|
3820
3914
|
[keyed]
|
|
3821
3915
|
);
|
|
3822
3916
|
if (!list.length) return null;
|
|
3823
|
-
return /* @__PURE__ */
|
|
3917
|
+
return /* @__PURE__ */ React24.createElement(
|
|
3824
3918
|
"div",
|
|
3825
3919
|
{
|
|
3826
3920
|
ref: function(el) {
|
|
@@ -3834,9 +3928,9 @@ var FormErrorSummary = React23.forwardRef(
|
|
|
3834
3928
|
"aria-labelledby": id + "-title",
|
|
3835
3929
|
className: cx("aura-alert aura-alert--danger aura-error-summary", props.className)
|
|
3836
3930
|
},
|
|
3837
|
-
/* @__PURE__ */
|
|
3838
|
-
/* @__PURE__ */
|
|
3839
|
-
return /* @__PURE__ */
|
|
3931
|
+
/* @__PURE__ */ React24.createElement(Icon, { name: /* @__PURE__ */ React24.createElement(IconCircleAlert, null), className: "aura-alert__icon" }),
|
|
3932
|
+
/* @__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) {
|
|
3933
|
+
return /* @__PURE__ */ React24.createElement("li", { key: e.field }, /* @__PURE__ */ React24.createElement(
|
|
3840
3934
|
"a",
|
|
3841
3935
|
{
|
|
3842
3936
|
href: "#" + e.field,
|
|
@@ -3861,30 +3955,30 @@ var FormErrorSummary = React23.forwardRef(
|
|
|
3861
3955
|
);
|
|
3862
3956
|
|
|
3863
3957
|
// src/FilterBar.tsx
|
|
3864
|
-
var
|
|
3958
|
+
var React26 = __toESM(require("react"), 1);
|
|
3865
3959
|
|
|
3866
3960
|
// src/Tag.tsx
|
|
3867
|
-
var
|
|
3868
|
-
function
|
|
3961
|
+
var React25 = __toESM(require("react"), 1);
|
|
3962
|
+
function textOf2(node) {
|
|
3869
3963
|
if (node == null || typeof node === "boolean") return "";
|
|
3870
3964
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
3871
|
-
if (Array.isArray(node)) return node.map(
|
|
3872
|
-
if (
|
|
3965
|
+
if (Array.isArray(node)) return node.map(textOf2).join("");
|
|
3966
|
+
if (React25.isValidElement(node)) {
|
|
3873
3967
|
const p = node.props;
|
|
3874
|
-
return p["aria-hidden"] === true || p["aria-hidden"] === "true" ? "" :
|
|
3968
|
+
return p["aria-hidden"] === true || p["aria-hidden"] === "true" ? "" : textOf2(p.children);
|
|
3875
3969
|
}
|
|
3876
3970
|
return "";
|
|
3877
3971
|
}
|
|
3878
|
-
var Tag =
|
|
3972
|
+
var Tag = React25.forwardRef(function Tag2(props, ref) {
|
|
3879
3973
|
const t = useStrings();
|
|
3880
3974
|
const selectable = props.onClick != null || props.selected != null;
|
|
3881
3975
|
const rest = omit(props, ["onRemove", "selected", "icon", "className", "children", "disabled", "removeLabel"]);
|
|
3882
3976
|
const inner = [
|
|
3883
|
-
props.icon ? /* @__PURE__ */
|
|
3884
|
-
/* @__PURE__ */
|
|
3977
|
+
props.icon ? /* @__PURE__ */ React25.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
|
|
3978
|
+
/* @__PURE__ */ React25.createElement("span", { key: "t", className: "aura-tag__text" }, props.children)
|
|
3885
3979
|
];
|
|
3886
3980
|
if (selectable) {
|
|
3887
|
-
return /* @__PURE__ */
|
|
3981
|
+
return /* @__PURE__ */ React25.createElement(
|
|
3888
3982
|
"button",
|
|
3889
3983
|
{
|
|
3890
3984
|
...rest,
|
|
@@ -3894,17 +3988,17 @@ var Tag = React24.forwardRef(function Tag2(props, ref) {
|
|
|
3894
3988
|
disabled: props.disabled,
|
|
3895
3989
|
className: cx("aura-tag is-selectable", props.selected && "is-selected", props.className)
|
|
3896
3990
|
},
|
|
3897
|
-
props.selected ? /* @__PURE__ */
|
|
3991
|
+
props.selected ? /* @__PURE__ */ React25.createElement(Icon, { name: /* @__PURE__ */ React25.createElement(IconCheck, null), size: 14 }) : inner[0],
|
|
3898
3992
|
inner[1]
|
|
3899
3993
|
);
|
|
3900
3994
|
}
|
|
3901
|
-
const name = props.onRemove && !props.removeLabel ?
|
|
3995
|
+
const name = props.onRemove && !props.removeLabel ? textOf2(props.children).replace(/\s+/g, " ").trim() : "";
|
|
3902
3996
|
if (props.onRemove && !props.disabled && !props.removeLabel && !name)
|
|
3903
3997
|
devWarnOnce(
|
|
3904
3998
|
"tag-remove-label",
|
|
3905
3999
|
'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
|
|
3906
4000
|
);
|
|
3907
|
-
return /* @__PURE__ */
|
|
4001
|
+
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(
|
|
3908
4002
|
"button",
|
|
3909
4003
|
{
|
|
3910
4004
|
type: "button",
|
|
@@ -3912,21 +4006,21 @@ var Tag = React24.forwardRef(function Tag2(props, ref) {
|
|
|
3912
4006
|
"aria-label": props.removeLabel || t.remove(name),
|
|
3913
4007
|
onClick: props.onRemove
|
|
3914
4008
|
},
|
|
3915
|
-
/* @__PURE__ */
|
|
4009
|
+
/* @__PURE__ */ React25.createElement(Icon, { name: /* @__PURE__ */ React25.createElement(IconX, null), size: 12 })
|
|
3916
4010
|
) : null);
|
|
3917
4011
|
});
|
|
3918
4012
|
|
|
3919
4013
|
// src/FilterBar.tsx
|
|
3920
|
-
var FilterBar =
|
|
4014
|
+
var FilterBar = React26.forwardRef(function FilterBar2(props, ref) {
|
|
3921
4015
|
const t = useStrings();
|
|
3922
4016
|
const id = uid();
|
|
3923
4017
|
const hasSearch = !!props.onSearchChange;
|
|
3924
|
-
const draft =
|
|
3925
|
-
const timer =
|
|
3926
|
-
const sent =
|
|
3927
|
-
const onChange =
|
|
4018
|
+
const draft = React26.useState(props.search || "");
|
|
4019
|
+
const timer = React26.useRef(null);
|
|
4020
|
+
const sent = React26.useRef(props.search || "");
|
|
4021
|
+
const onChange = React26.useRef(props.onSearchChange);
|
|
3928
4022
|
onChange.current = props.onSearchChange;
|
|
3929
|
-
|
|
4023
|
+
React26.useEffect(
|
|
3930
4024
|
function() {
|
|
3931
4025
|
if ((props.search || "") !== sent.current) {
|
|
3932
4026
|
sent.current = props.search || "";
|
|
@@ -3935,7 +4029,7 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
3935
4029
|
},
|
|
3936
4030
|
[props.search]
|
|
3937
4031
|
);
|
|
3938
|
-
|
|
4032
|
+
React26.useEffect(function() {
|
|
3939
4033
|
return function() {
|
|
3940
4034
|
if (timer.current) clearTimeout(timer.current);
|
|
3941
4035
|
};
|
|
@@ -3960,15 +4054,15 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
3960
4054
|
const filters = props.filters || [];
|
|
3961
4055
|
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
3962
4056
|
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
3963
|
-
return /* @__PURE__ */
|
|
4057
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3964
4058
|
"div",
|
|
3965
4059
|
{
|
|
3966
4060
|
ref,
|
|
3967
4061
|
role: "region",
|
|
3968
4062
|
"aria-label": props.label || t.filters,
|
|
3969
|
-
className: cx("aura-filterbar", props.className)
|
|
4063
|
+
className: cx("aura-filterbar", props.searchGrow && "aura-filterbar--grow", props.className)
|
|
3970
4064
|
},
|
|
3971
|
-
/* @__PURE__ */
|
|
4065
|
+
/* @__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(
|
|
3972
4066
|
"input",
|
|
3973
4067
|
{
|
|
3974
4068
|
id,
|
|
@@ -3989,10 +4083,10 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
3989
4083
|
}
|
|
3990
4084
|
}
|
|
3991
4085
|
}
|
|
3992
|
-
), draft[0] ? /* @__PURE__ */
|
|
4086
|
+
), draft[0] ? /* @__PURE__ */ React26.createElement(
|
|
3993
4087
|
IconButton,
|
|
3994
4088
|
{
|
|
3995
|
-
icon: /* @__PURE__ */
|
|
4089
|
+
icon: /* @__PURE__ */ React26.createElement(IconX, null),
|
|
3996
4090
|
label: t.clear((props.searchLabel || t.search).toLowerCase()),
|
|
3997
4091
|
className: "aura-filterbar__clear-search",
|
|
3998
4092
|
onClick: function() {
|
|
@@ -4000,10 +4094,10 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
4000
4094
|
send("");
|
|
4001
4095
|
}
|
|
4002
4096
|
}
|
|
4003
|
-
) : null) : null, props.children ? /* @__PURE__ */
|
|
4004
|
-
filters.length || props.onClearAll && anything ? /* @__PURE__ */
|
|
4005
|
-
return /* @__PURE__ */
|
|
4006
|
-
}), props.onClearAll && anything ? /* @__PURE__ */
|
|
4097
|
+
) : 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),
|
|
4098
|
+
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React26.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
4099
|
+
return /* @__PURE__ */ React26.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
4100
|
+
}), props.onClearAll && anything ? /* @__PURE__ */ React26.createElement(
|
|
4007
4101
|
"button",
|
|
4008
4102
|
{
|
|
4009
4103
|
type: "button",
|
|
@@ -4021,11 +4115,11 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
4021
4115
|
});
|
|
4022
4116
|
|
|
4023
4117
|
// src/Command.tsx
|
|
4024
|
-
var
|
|
4118
|
+
var React28 = __toESM(require("react"), 1);
|
|
4025
4119
|
var import_react_dom6 = require("react-dom");
|
|
4026
4120
|
|
|
4027
4121
|
// src/useModal.tsx
|
|
4028
|
-
var
|
|
4122
|
+
var React27 = __toESM(require("react"), 1);
|
|
4029
4123
|
var locks = 0;
|
|
4030
4124
|
var savedOverflow = "";
|
|
4031
4125
|
function lockScroll() {
|
|
@@ -4052,9 +4146,9 @@ function tabbable(el) {
|
|
|
4052
4146
|
}
|
|
4053
4147
|
function useModal(open, ref, opts) {
|
|
4054
4148
|
const mounted = useMounted();
|
|
4055
|
-
const prev =
|
|
4149
|
+
const prev = React27.useRef(null);
|
|
4056
4150
|
const o = opts || {};
|
|
4057
|
-
|
|
4151
|
+
React27.useEffect(
|
|
4058
4152
|
function() {
|
|
4059
4153
|
if (!open || !mounted) return;
|
|
4060
4154
|
prev.current = document.activeElement;
|
|
@@ -4112,21 +4206,21 @@ function Command(props) {
|
|
|
4112
4206
|
const t = useStrings();
|
|
4113
4207
|
const density = useDensity();
|
|
4114
4208
|
const id = uid(), listId = id + "-list";
|
|
4115
|
-
const box =
|
|
4116
|
-
const input =
|
|
4117
|
-
const qState =
|
|
4209
|
+
const box = React28.useRef(null);
|
|
4210
|
+
const input = React28.useRef(null);
|
|
4211
|
+
const qState = React28.useState(""), act = React28.useState(null);
|
|
4118
4212
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
4119
4213
|
function setQuery(v) {
|
|
4120
4214
|
if (props.query === void 0) qState[1](v);
|
|
4121
4215
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
4122
4216
|
}
|
|
4123
|
-
const openRef =
|
|
4217
|
+
const openRef = React28.useRef(props.open);
|
|
4124
4218
|
openRef.current = props.open;
|
|
4125
4219
|
const close = function() {
|
|
4126
4220
|
props.onOpenChange(false);
|
|
4127
4221
|
};
|
|
4128
4222
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
4129
|
-
|
|
4223
|
+
React28.useEffect(
|
|
4130
4224
|
function() {
|
|
4131
4225
|
if (props.hotkey === false) return;
|
|
4132
4226
|
function onKey2(e) {
|
|
@@ -4142,7 +4236,7 @@ function Command(props) {
|
|
|
4142
4236
|
},
|
|
4143
4237
|
[props.hotkey, props.onOpenChange]
|
|
4144
4238
|
);
|
|
4145
|
-
|
|
4239
|
+
React28.useEffect(
|
|
4146
4240
|
function() {
|
|
4147
4241
|
if (!props.open) {
|
|
4148
4242
|
if (query) setQuery("");
|
|
@@ -4182,7 +4276,7 @@ function Command(props) {
|
|
|
4182
4276
|
const optId = function(i2) {
|
|
4183
4277
|
return id + "-o" + i2;
|
|
4184
4278
|
};
|
|
4185
|
-
|
|
4279
|
+
React28.useEffect(
|
|
4186
4280
|
function() {
|
|
4187
4281
|
if (!box.current || active < 0) return;
|
|
4188
4282
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -4227,7 +4321,7 @@ function Command(props) {
|
|
|
4227
4321
|
if (!modal.ready) return null;
|
|
4228
4322
|
let i = -1;
|
|
4229
4323
|
return (0, import_react_dom6.createPortal)(
|
|
4230
|
-
/* @__PURE__ */
|
|
4324
|
+
/* @__PURE__ */ React28.createElement(
|
|
4231
4325
|
"div",
|
|
4232
4326
|
{
|
|
4233
4327
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -4237,8 +4331,8 @@ function Command(props) {
|
|
|
4237
4331
|
e.stopPropagation();
|
|
4238
4332
|
}
|
|
4239
4333
|
},
|
|
4240
|
-
/* @__PURE__ */
|
|
4241
|
-
/* @__PURE__ */
|
|
4334
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
4335
|
+
/* @__PURE__ */ React28.createElement(
|
|
4242
4336
|
"div",
|
|
4243
4337
|
{
|
|
4244
4338
|
ref: box,
|
|
@@ -4248,7 +4342,7 @@ function Command(props) {
|
|
|
4248
4342
|
tabIndex: -1,
|
|
4249
4343
|
className: cx("aura-command", props.className)
|
|
4250
4344
|
},
|
|
4251
|
-
/* @__PURE__ */
|
|
4345
|
+
/* @__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(
|
|
4252
4346
|
"input",
|
|
4253
4347
|
{
|
|
4254
4348
|
ref: input,
|
|
@@ -4271,8 +4365,8 @@ function Command(props) {
|
|
|
4271
4365
|
},
|
|
4272
4366
|
onKeyDown: onKey
|
|
4273
4367
|
}
|
|
4274
|
-
), /* @__PURE__ */
|
|
4275
|
-
/* @__PURE__ */
|
|
4368
|
+
), /* @__PURE__ */ React28.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
4369
|
+
/* @__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(
|
|
4276
4370
|
"div",
|
|
4277
4371
|
{
|
|
4278
4372
|
id: listId,
|
|
@@ -4282,7 +4376,7 @@ function Command(props) {
|
|
|
4282
4376
|
},
|
|
4283
4377
|
groups.map(function(g, gi) {
|
|
4284
4378
|
const gid = id + "-g" + gi;
|
|
4285
|
-
return /* @__PURE__ */
|
|
4379
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4286
4380
|
"div",
|
|
4287
4381
|
{
|
|
4288
4382
|
key: g.name || gi,
|
|
@@ -4290,11 +4384,11 @@ function Command(props) {
|
|
|
4290
4384
|
"aria-labelledby": g.name ? gid : void 0,
|
|
4291
4385
|
className: "aura-command__group"
|
|
4292
4386
|
},
|
|
4293
|
-
g.name ? /* @__PURE__ */
|
|
4387
|
+
g.name ? /* @__PURE__ */ React28.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
4294
4388
|
g.items.map(function(it) {
|
|
4295
4389
|
i++;
|
|
4296
4390
|
const n3 = i;
|
|
4297
|
-
return /* @__PURE__ */
|
|
4391
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4298
4392
|
"div",
|
|
4299
4393
|
{
|
|
4300
4394
|
key: it.id,
|
|
@@ -4317,16 +4411,16 @@ function Command(props) {
|
|
|
4317
4411
|
run(it);
|
|
4318
4412
|
}
|
|
4319
4413
|
},
|
|
4320
|
-
it.icon ? /* @__PURE__ */
|
|
4321
|
-
/* @__PURE__ */
|
|
4322
|
-
it.shortcut ? /* @__PURE__ */
|
|
4414
|
+
it.icon ? /* @__PURE__ */ React28.createElement(Icon, { name: it.icon }) : null,
|
|
4415
|
+
/* @__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),
|
|
4416
|
+
it.shortcut ? /* @__PURE__ */ React28.createElement("kbd", { className: "aura-command__kbd" }, it.shortcut) : null
|
|
4323
4417
|
);
|
|
4324
4418
|
})
|
|
4325
4419
|
);
|
|
4326
4420
|
})
|
|
4327
4421
|
)),
|
|
4328
|
-
/* @__PURE__ */
|
|
4329
|
-
/* @__PURE__ */
|
|
4422
|
+
/* @__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) : ""),
|
|
4423
|
+
/* @__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"))
|
|
4330
4424
|
)
|
|
4331
4425
|
),
|
|
4332
4426
|
document.body
|
|
@@ -4334,12 +4428,12 @@ function Command(props) {
|
|
|
4334
4428
|
}
|
|
4335
4429
|
|
|
4336
4430
|
// src/Tooltip.tsx
|
|
4337
|
-
var
|
|
4431
|
+
var React29 = __toESM(require("react"), 1);
|
|
4338
4432
|
var import_react_dom7 = require("react-dom");
|
|
4339
|
-
var Tooltip =
|
|
4340
|
-
const id = uid(), st =
|
|
4341
|
-
const anchor =
|
|
4342
|
-
const pos =
|
|
4433
|
+
var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
4434
|
+
const id = uid(), st = React29.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
4435
|
+
const anchor = React29.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip = React29.useRef(null), timer = React29.useRef(void 0);
|
|
4436
|
+
const pos = React29.useState(null), mounted = useMounted();
|
|
4343
4437
|
function show2(now) {
|
|
4344
4438
|
clearTimeout(timer.current);
|
|
4345
4439
|
timer.current = setTimeout(
|
|
@@ -4359,7 +4453,7 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4359
4453
|
set(false);
|
|
4360
4454
|
}, 120);
|
|
4361
4455
|
}
|
|
4362
|
-
|
|
4456
|
+
React29.useEffect(function() {
|
|
4363
4457
|
return function() {
|
|
4364
4458
|
clearTimeout(timer.current);
|
|
4365
4459
|
};
|
|
@@ -4403,7 +4497,7 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4403
4497
|
},
|
|
4404
4498
|
[open, mounted]
|
|
4405
4499
|
);
|
|
4406
|
-
|
|
4500
|
+
React29.useEffect(
|
|
4407
4501
|
function() {
|
|
4408
4502
|
if (!open) return;
|
|
4409
4503
|
function esc(e) {
|
|
@@ -4416,8 +4510,8 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4416
4510
|
},
|
|
4417
4511
|
[open]
|
|
4418
4512
|
);
|
|
4419
|
-
const child =
|
|
4420
|
-
const trigger = /* @__PURE__ */
|
|
4513
|
+
const child = React29.Children.only(props.children);
|
|
4514
|
+
const trigger = /* @__PURE__ */ React29.createElement(
|
|
4421
4515
|
"span",
|
|
4422
4516
|
{
|
|
4423
4517
|
ref: anchorMerged,
|
|
@@ -4431,10 +4525,10 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4431
4525
|
},
|
|
4432
4526
|
onBlur: hide
|
|
4433
4527
|
},
|
|
4434
|
-
|
|
4528
|
+
React29.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
4435
4529
|
);
|
|
4436
|
-
return /* @__PURE__ */
|
|
4437
|
-
/* @__PURE__ */
|
|
4530
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, trigger, open && mounted ? (0, import_react_dom7.createPortal)(
|
|
4531
|
+
/* @__PURE__ */ React29.createElement(
|
|
4438
4532
|
"div",
|
|
4439
4533
|
{
|
|
4440
4534
|
ref: tip,
|
|
@@ -4454,12 +4548,12 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4454
4548
|
});
|
|
4455
4549
|
|
|
4456
4550
|
// src/Dialog.tsx
|
|
4457
|
-
var
|
|
4551
|
+
var React30 = __toESM(require("react"), 1);
|
|
4458
4552
|
var import_react_dom8 = require("react-dom");
|
|
4459
|
-
var Dialog =
|
|
4553
|
+
var Dialog = React30.forwardRef(function Dialog2(props, ref) {
|
|
4460
4554
|
const t = useStrings();
|
|
4461
4555
|
const density = useDensity();
|
|
4462
|
-
const own =
|
|
4556
|
+
const own = React30.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4463
4557
|
function close() {
|
|
4464
4558
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4465
4559
|
}
|
|
@@ -4472,7 +4566,7 @@ var Dialog = React29.forwardRef(function Dialog2(props, ref) {
|
|
|
4472
4566
|
});
|
|
4473
4567
|
if (!modal.ready) return null;
|
|
4474
4568
|
return (0, import_react_dom8.createPortal)(
|
|
4475
|
-
/* @__PURE__ */
|
|
4569
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React30.createElement(
|
|
4476
4570
|
"div",
|
|
4477
4571
|
{
|
|
4478
4572
|
className: "aura-scrim",
|
|
@@ -4482,7 +4576,7 @@ var Dialog = React29.forwardRef(function Dialog2(props, ref) {
|
|
|
4482
4576
|
},
|
|
4483
4577
|
"aria-hidden": true
|
|
4484
4578
|
}
|
|
4485
|
-
), /* @__PURE__ */
|
|
4579
|
+
), /* @__PURE__ */ React30.createElement(
|
|
4486
4580
|
"div",
|
|
4487
4581
|
{
|
|
4488
4582
|
ref: merged,
|
|
@@ -4493,18 +4587,18 @@ var Dialog = React29.forwardRef(function Dialog2(props, ref) {
|
|
|
4493
4587
|
tabIndex: -1,
|
|
4494
4588
|
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
4495
4589
|
},
|
|
4496
|
-
/* @__PURE__ */
|
|
4497
|
-
props.description ? /* @__PURE__ */
|
|
4498
|
-
props.children ? /* @__PURE__ */
|
|
4499
|
-
props.footer ? /* @__PURE__ */
|
|
4590
|
+
/* @__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),
|
|
4591
|
+
props.description ? /* @__PURE__ */ React30.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
|
|
4592
|
+
props.children ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__body" }, props.children) : null,
|
|
4593
|
+
props.footer ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null
|
|
4500
4594
|
)),
|
|
4501
4595
|
document.body
|
|
4502
4596
|
);
|
|
4503
4597
|
});
|
|
4504
|
-
var Drawer =
|
|
4598
|
+
var Drawer = React30.forwardRef(function Drawer2(props, ref) {
|
|
4505
4599
|
const t = useStrings();
|
|
4506
4600
|
const density = useDensity();
|
|
4507
|
-
const own =
|
|
4601
|
+
const own = React30.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4508
4602
|
function close() {
|
|
4509
4603
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4510
4604
|
}
|
|
@@ -4537,7 +4631,7 @@ var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
|
4537
4631
|
]);
|
|
4538
4632
|
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
4539
4633
|
return (0, import_react_dom8.createPortal)(
|
|
4540
|
-
/* @__PURE__ */
|
|
4634
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React30.createElement(
|
|
4541
4635
|
"div",
|
|
4542
4636
|
{
|
|
4543
4637
|
className: "aura-scrim",
|
|
@@ -4547,7 +4641,7 @@ var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
|
4547
4641
|
} : void 0,
|
|
4548
4642
|
"aria-hidden": true
|
|
4549
4643
|
}
|
|
4550
|
-
), /* @__PURE__ */
|
|
4644
|
+
), /* @__PURE__ */ React30.createElement(
|
|
4551
4645
|
"div",
|
|
4552
4646
|
{
|
|
4553
4647
|
...rest,
|
|
@@ -4560,11 +4654,11 @@ var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
|
4560
4654
|
tabIndex: -1,
|
|
4561
4655
|
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
4562
4656
|
},
|
|
4563
|
-
props.title || props.dismissible !== false ? /* @__PURE__ */
|
|
4657
|
+
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(
|
|
4564
4658
|
IconButton,
|
|
4565
4659
|
{
|
|
4566
4660
|
...props.closeProps,
|
|
4567
|
-
icon: /* @__PURE__ */
|
|
4661
|
+
icon: /* @__PURE__ */ React30.createElement(IconX, null),
|
|
4568
4662
|
label: props.closeLabel || t.close,
|
|
4569
4663
|
onClick: function(e) {
|
|
4570
4664
|
const own2 = props.closeProps && props.closeProps.onClick;
|
|
@@ -4573,16 +4667,16 @@ var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
|
4573
4667
|
}
|
|
4574
4668
|
}
|
|
4575
4669
|
) : null) : null,
|
|
4576
|
-
props.description ? /* @__PURE__ */
|
|
4577
|
-
/* @__PURE__ */
|
|
4578
|
-
props.footer ? /* @__PURE__ */
|
|
4670
|
+
props.description ? /* @__PURE__ */ React30.createElement("p", { className: "aura-drawer__desc", id: descId }, props.description) : null,
|
|
4671
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-drawer__body" }, props.children),
|
|
4672
|
+
props.footer ? /* @__PURE__ */ React30.createElement("div", { className: "aura-drawer__foot" }, props.footer) : null
|
|
4579
4673
|
)),
|
|
4580
4674
|
document.body
|
|
4581
4675
|
);
|
|
4582
4676
|
});
|
|
4583
4677
|
|
|
4584
4678
|
// src/DataTable.tsx
|
|
4585
|
-
var
|
|
4679
|
+
var React31 = __toESM(require("react"), 1);
|
|
4586
4680
|
var import_react_dom9 = require("react-dom");
|
|
4587
4681
|
var BP = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
4588
4682
|
var DEFAULT_COLUMNS = [
|
|
@@ -4605,7 +4699,7 @@ function hidePx(c) {
|
|
|
4605
4699
|
var ROW_H_DEFAULT = 48;
|
|
4606
4700
|
var OVERSCAN = 8;
|
|
4607
4701
|
var FLEX_MIN = 160;
|
|
4608
|
-
var DataTableImpl =
|
|
4702
|
+
var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
|
|
4609
4703
|
const t = useStrings();
|
|
4610
4704
|
const columns = props.columns || DEFAULT_COLUMNS;
|
|
4611
4705
|
const byKey = {};
|
|
@@ -4644,7 +4738,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4644
4738
|
const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
|
|
4645
4739
|
return rejected[String(k)];
|
|
4646
4740
|
}).join("\0") + "#" + selected.join("\0");
|
|
4647
|
-
|
|
4741
|
+
React31.useEffect(
|
|
4648
4742
|
function() {
|
|
4649
4743
|
if (droppedSig !== "") setSelected(selected);
|
|
4650
4744
|
},
|
|
@@ -4681,19 +4775,19 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4681
4775
|
}),
|
|
4682
4776
|
props.onPinnedColumnsChange
|
|
4683
4777
|
);
|
|
4684
|
-
const widthState =
|
|
4778
|
+
const widthState = React31.useState({});
|
|
4685
4779
|
const widths = widthState[0], setWidths = widthState[1];
|
|
4686
|
-
const activeState =
|
|
4687
|
-
const scrollState =
|
|
4780
|
+
const activeState = React31.useState({ r: 1, c: 0 });
|
|
4781
|
+
const scrollState = React31.useState(0);
|
|
4688
4782
|
const scrollTop = scrollState[0], setScrollTop = scrollState[1];
|
|
4689
|
-
const scrolledX =
|
|
4690
|
-
const menuState =
|
|
4783
|
+
const scrolledX = React31.useState(false);
|
|
4784
|
+
const menuState = React31.useState(null);
|
|
4691
4785
|
const menu = menuState[0], setMenu = menuState[1];
|
|
4692
|
-
const dragState =
|
|
4786
|
+
const dragState = React31.useState(null);
|
|
4693
4787
|
const drag = dragState[0], setDrag = dragState[1];
|
|
4694
|
-
const gridRef =
|
|
4695
|
-
const wrapRef =
|
|
4696
|
-
const boxWidth =
|
|
4788
|
+
const gridRef = React31.useRef(null);
|
|
4789
|
+
const wrapRef = React31.useRef(null), wrapMerged = useMergedRef(ref, wrapRef);
|
|
4790
|
+
const boxWidth = React31.useState(null);
|
|
4697
4791
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
4698
4792
|
return c.hideBelow != null;
|
|
4699
4793
|
});
|
|
@@ -4703,7 +4797,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4703
4797
|
return px != null && a.indexOf(px) === i;
|
|
4704
4798
|
}).length
|
|
4705
4799
|
);
|
|
4706
|
-
|
|
4800
|
+
React31.useEffect(
|
|
4707
4801
|
function() {
|
|
4708
4802
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
4709
4803
|
const ro = new ResizeObserver(function(en) {
|
|
@@ -4718,6 +4812,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4718
4812
|
[measure, levelShape]
|
|
4719
4813
|
);
|
|
4720
4814
|
const stacked = !!props.stackBelow && boxWidth[0] != null && below(boxWidth[0], props.stackBelow);
|
|
4815
|
+
const noCardSel = !!props.hideSelectionInCards && selectable;
|
|
4721
4816
|
useIsoLayoutEffect(
|
|
4722
4817
|
function() {
|
|
4723
4818
|
if (measure && wrapRef.current) boxWidth[1](wrapRef.current.getBoundingClientRect().width);
|
|
@@ -4748,8 +4843,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4748
4843
|
const px = hidePx(c);
|
|
4749
4844
|
return px != null && below(boxWidth[0], px);
|
|
4750
4845
|
}
|
|
4751
|
-
const scrollRef =
|
|
4752
|
-
const tipState =
|
|
4846
|
+
const scrollRef = React31.useRef(null);
|
|
4847
|
+
const tipState = React31.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
4753
4848
|
function showFull(e) {
|
|
4754
4849
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
4755
4850
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
@@ -4761,7 +4856,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4761
4856
|
setTip(null);
|
|
4762
4857
|
}
|
|
4763
4858
|
const tipEl = tip && typeof document !== "undefined" ? (0, import_react_dom9.createPortal)(
|
|
4764
|
-
/* @__PURE__ */
|
|
4859
|
+
/* @__PURE__ */ React31.createElement(
|
|
4765
4860
|
"div",
|
|
4766
4861
|
{
|
|
4767
4862
|
className: "aura-tooltip aura-tooltip--above",
|
|
@@ -4772,7 +4867,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4772
4867
|
),
|
|
4773
4868
|
document.body
|
|
4774
4869
|
) : null;
|
|
4775
|
-
const rowH =
|
|
4870
|
+
const rowH = React31.useState(ROW_H_DEFAULT);
|
|
4776
4871
|
const ROW_H = rowH[0];
|
|
4777
4872
|
useIsoLayoutEffect(function() {
|
|
4778
4873
|
const el = wrapRef.current;
|
|
@@ -4780,8 +4875,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4780
4875
|
const v = parseFloat(getComputedStyle(el).getPropertyValue("--aura-table-row-height"));
|
|
4781
4876
|
if (v > 0 && v !== rowH[0]) rowH[1](v);
|
|
4782
4877
|
});
|
|
4783
|
-
const pending =
|
|
4784
|
-
const resizing =
|
|
4878
|
+
const pending = React31.useRef(null);
|
|
4879
|
+
const resizing = React31.useRef(false);
|
|
4785
4880
|
useIsoLayoutEffect(function() {
|
|
4786
4881
|
if (!gridRef.current) return;
|
|
4787
4882
|
const els = gridRef.current.querySelectorAll(
|
|
@@ -4818,9 +4913,38 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4818
4913
|
const pillKey = (vis.filter(function(c, i) {
|
|
4819
4914
|
return i > 0 && c.pill;
|
|
4820
4915
|
})[0] || { key: "" }).key;
|
|
4821
|
-
|
|
4822
|
-
return
|
|
4916
|
+
const ownTitle = vis.some(function(c) {
|
|
4917
|
+
return c.card === "title";
|
|
4918
|
+
}), ownPill = vis.some(function(c) {
|
|
4919
|
+
return c.card === "pill";
|
|
4920
|
+
});
|
|
4921
|
+
let autoTitle = -1;
|
|
4922
|
+
if (!ownTitle) {
|
|
4923
|
+
for (let i = 0; i < vis.length; i++)
|
|
4924
|
+
if (!vis[i].card && (i === 0 || !vis[i].actions)) {
|
|
4925
|
+
autoTitle = i;
|
|
4926
|
+
break;
|
|
4927
|
+
}
|
|
4823
4928
|
}
|
|
4929
|
+
function cardPart(c, i) {
|
|
4930
|
+
if (c.card) return c.card;
|
|
4931
|
+
if (i === autoTitle) return "title";
|
|
4932
|
+
if (c.key === pillKey && !ownPill) return "pill";
|
|
4933
|
+
return c.actions ? "actions" : "field";
|
|
4934
|
+
}
|
|
4935
|
+
const cardRank = {};
|
|
4936
|
+
if (vis.some(function(c) {
|
|
4937
|
+
return c.cardOrder != null;
|
|
4938
|
+
}))
|
|
4939
|
+
vis.map(function(c, i) {
|
|
4940
|
+
return { c, i, o: c.cardOrder != null ? c.cardOrder : i };
|
|
4941
|
+
}).filter(function(x) {
|
|
4942
|
+
return cardPart(x.c, x.i) === "field";
|
|
4943
|
+
}).sort(function(a, b) {
|
|
4944
|
+
return a.o - b.o || a.i - b.i;
|
|
4945
|
+
}).forEach(function(x, n3) {
|
|
4946
|
+
cardRank[x.c.key] = n3;
|
|
4947
|
+
});
|
|
4824
4948
|
function cardAttrs(c, i) {
|
|
4825
4949
|
const part = cardPart(c, i), lv = hideLevel(c);
|
|
4826
4950
|
return {
|
|
@@ -4862,10 +4986,11 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4862
4986
|
s["--aura-cell-w"] = w + "px";
|
|
4863
4987
|
}
|
|
4864
4988
|
if (isPinned(c)) s["--aura-cell-left"] = "calc(var(--aura-space-6)" + selW + " + " + pinOffsets[c.key] + ")";
|
|
4989
|
+
if (cardRank[c.key] != null) s["--aura-card-order"] = String(5 + cardRank[c.key]);
|
|
4865
4990
|
return s;
|
|
4866
4991
|
}
|
|
4867
4992
|
const sortCol = sort && sort.key ? byKey[sort.key] : void 0;
|
|
4868
|
-
const view =
|
|
4993
|
+
const view = React31.useMemo(
|
|
4869
4994
|
function() {
|
|
4870
4995
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
4871
4996
|
const col = byKey[sort.key];
|
|
@@ -4907,8 +5032,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4907
5032
|
const pageRows = pageSize && !manual ? view.slice(first, first + pageSize) : view;
|
|
4908
5033
|
const canSortAny = !busy && (manual ? total > 1 : rows.length > 1);
|
|
4909
5034
|
const shownTotal = manual && props.totalRows == null ? first + rows.length : total;
|
|
4910
|
-
const prevCount =
|
|
4911
|
-
|
|
5035
|
+
const prevCount = React31.useRef(pageCount);
|
|
5036
|
+
React31.useEffect(
|
|
4912
5037
|
function() {
|
|
4913
5038
|
if (busy) return;
|
|
4914
5039
|
const before = prevCount.current;
|
|
@@ -4922,9 +5047,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4922
5047
|
[pageState[0], page, busy, pageCount]
|
|
4923
5048
|
);
|
|
4924
5049
|
const linkPaging = !!props.getPageHref && !props.onPageChange && !oneCallback;
|
|
4925
|
-
const prevLink =
|
|
4926
|
-
const jumpState =
|
|
4927
|
-
|
|
5050
|
+
const prevLink = React31.useRef(null), nextLink = React31.useRef(null), jumpLink = React31.useRef(null);
|
|
5051
|
+
const jumpState = React31.useState(null);
|
|
5052
|
+
React31.useEffect(
|
|
4928
5053
|
function() {
|
|
4929
5054
|
if (jumpState[0] == null) return;
|
|
4930
5055
|
if (jumpLink.current) jumpLink.current.click();
|
|
@@ -4975,7 +5100,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4975
5100
|
);
|
|
4976
5101
|
}
|
|
4977
5102
|
function rowLinkWrap(r, content) {
|
|
4978
|
-
return rowHref ? /* @__PURE__ */
|
|
5103
|
+
return rowHref ? /* @__PURE__ */ React31.createElement(Link, { href: rowHref(r), className: "aura-table__row-link" }, content) : content;
|
|
4979
5104
|
}
|
|
4980
5105
|
const height = props.height || 0;
|
|
4981
5106
|
const autoRows = props.rowHeight === "auto" && !height;
|
|
@@ -5002,11 +5127,39 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5002
5127
|
function colAt(ci) {
|
|
5003
5128
|
return selectable ? ci === 0 ? null : vis[ci - 1] : vis[ci];
|
|
5004
5129
|
}
|
|
5130
|
+
const cardHidden = [];
|
|
5131
|
+
for (let ci = 0; ci < nCols; ci++) {
|
|
5132
|
+
const col = colAt(ci);
|
|
5133
|
+
cardHidden.push(stacked && (col ? cardPart(col, vis.indexOf(col)) === "hide" : noCardSel));
|
|
5134
|
+
}
|
|
5135
|
+
function nearestShown(c, dir, ok) {
|
|
5136
|
+
if (ok(c)) return c;
|
|
5137
|
+
for (let d = 1; d < nCols; d++) {
|
|
5138
|
+
const a = c + d * dir, b = c - d * dir;
|
|
5139
|
+
if (a >= 0 && a < nCols && ok(a)) return a;
|
|
5140
|
+
if (b >= 0 && b < nCols && ok(b)) return b;
|
|
5141
|
+
}
|
|
5142
|
+
return c;
|
|
5143
|
+
}
|
|
5144
|
+
const acShown = nearestShown(ac, 1, function(cc) {
|
|
5145
|
+
return !cardHidden[cc];
|
|
5146
|
+
});
|
|
5147
|
+
const lastFocus = React31.useRef(null);
|
|
5148
|
+
React31.useEffect(
|
|
5149
|
+
function() {
|
|
5150
|
+
const was = lastFocus.current, g = gridRef.current;
|
|
5151
|
+
if (!stacked || !was || !g || !g.contains(was) || was.getClientRects().length > 0) return;
|
|
5152
|
+
if (document.activeElement && document.activeElement !== document.body && document.activeElement !== was) return;
|
|
5153
|
+
const el = g.querySelector('[data-rc="' + Math.max(1, ar) + ":" + acShown + '"]');
|
|
5154
|
+
if (el && el.getClientRects().length > 0) el.focus();
|
|
5155
|
+
},
|
|
5156
|
+
[stacked]
|
|
5157
|
+
);
|
|
5005
5158
|
function tabFor(r, c) {
|
|
5006
5159
|
if (!activeRendered) return r === 0 && c === ac ? 0 : -1;
|
|
5007
|
-
return r === ar && c ===
|
|
5160
|
+
return r === ar && c === acShown ? 0 : -1;
|
|
5008
5161
|
}
|
|
5009
|
-
|
|
5162
|
+
React31.useEffect(function() {
|
|
5010
5163
|
const p = pending.current;
|
|
5011
5164
|
if (!p || !gridRef.current) return;
|
|
5012
5165
|
let c = p.c;
|
|
@@ -5028,26 +5181,17 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5028
5181
|
el.focus();
|
|
5029
5182
|
}
|
|
5030
5183
|
});
|
|
5031
|
-
function focusCell(r, c) {
|
|
5184
|
+
function focusCell(r, c, dir) {
|
|
5032
5185
|
r = Math.max(0, Math.min(r, lastR));
|
|
5033
5186
|
c = Math.max(0, Math.min(c, nCols - 1));
|
|
5034
|
-
if (stacked && r === 0 && nRows > 0 && !(selectable && c === 0)) r = 1;
|
|
5035
|
-
if (gridRef.current && r === T && hasTotal) {
|
|
5187
|
+
if (stacked && r === 0 && nRows > 0 && (!(selectable && c === 0) || noCardSel)) r = 1;
|
|
5188
|
+
if (gridRef.current && (r === T && hasTotal || stacked)) {
|
|
5036
5189
|
const shown2 = function(cc) {
|
|
5190
|
+
if (cardHidden[cc]) return false;
|
|
5037
5191
|
const e = gridRef.current.querySelector('[data-rc="' + r + ":" + cc + '"]');
|
|
5038
5192
|
return !!e && e.getClientRects().length > 0;
|
|
5039
5193
|
};
|
|
5040
|
-
|
|
5041
|
-
for (let d = 1; d < nCols; d++) {
|
|
5042
|
-
if (c + d < nCols && shown2(c + d)) {
|
|
5043
|
-
c = c + d;
|
|
5044
|
-
break;
|
|
5045
|
-
}
|
|
5046
|
-
if (c - d >= 0 && shown2(c - d)) {
|
|
5047
|
-
c = c - d;
|
|
5048
|
-
break;
|
|
5049
|
-
}
|
|
5050
|
-
}
|
|
5194
|
+
c = nearestShown(c, dir || 1, shown2);
|
|
5051
5195
|
}
|
|
5052
5196
|
activeState[1]({ r, c });
|
|
5053
5197
|
pending.current = { r, c };
|
|
@@ -5206,14 +5350,14 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5206
5350
|
items2.push(
|
|
5207
5351
|
{
|
|
5208
5352
|
label: t.sortAsc,
|
|
5209
|
-
icon: /* @__PURE__ */
|
|
5353
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowUp, null),
|
|
5210
5354
|
onSelect: function() {
|
|
5211
5355
|
applySort({ key: c.key, dir: "asc" });
|
|
5212
5356
|
}
|
|
5213
5357
|
},
|
|
5214
5358
|
{
|
|
5215
5359
|
label: t.sortDesc,
|
|
5216
|
-
icon: /* @__PURE__ */
|
|
5360
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowDown, null),
|
|
5217
5361
|
onSelect: function() {
|
|
5218
5362
|
applySort({ key: c.key, dir: "desc" });
|
|
5219
5363
|
}
|
|
@@ -5223,7 +5367,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5223
5367
|
if (c.width != null)
|
|
5224
5368
|
items2.push({
|
|
5225
5369
|
label: isPinned(c) ? t.unpin : t.pin,
|
|
5226
|
-
icon: isPinned(c) ? /* @__PURE__ */
|
|
5370
|
+
icon: isPinned(c) ? /* @__PURE__ */ React31.createElement(IconPinOff, null) : /* @__PURE__ */ React31.createElement(IconPin, null),
|
|
5227
5371
|
onSelect: function() {
|
|
5228
5372
|
togglePin(c.key);
|
|
5229
5373
|
}
|
|
@@ -5232,7 +5376,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5232
5376
|
items2.push(
|
|
5233
5377
|
{
|
|
5234
5378
|
label: t.moveLeft,
|
|
5235
|
-
icon: /* @__PURE__ */
|
|
5379
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowLeft, null),
|
|
5236
5380
|
disabled: gi <= 0,
|
|
5237
5381
|
onSelect: function() {
|
|
5238
5382
|
moveCol(c.key, -1);
|
|
@@ -5240,7 +5384,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5240
5384
|
},
|
|
5241
5385
|
{
|
|
5242
5386
|
label: t.moveRight,
|
|
5243
|
-
icon: /* @__PURE__ */
|
|
5387
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowRight, null),
|
|
5244
5388
|
disabled: gi >= group.length - 1,
|
|
5245
5389
|
onSelect: function() {
|
|
5246
5390
|
moveCol(c.key, 1);
|
|
@@ -5251,7 +5395,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5251
5395
|
{ separator: true },
|
|
5252
5396
|
{
|
|
5253
5397
|
label: t.hideColumn,
|
|
5254
|
-
icon: /* @__PURE__ */
|
|
5398
|
+
icon: /* @__PURE__ */ React31.createElement(IconEyeOff, null),
|
|
5255
5399
|
disabled: shown.length <= 1,
|
|
5256
5400
|
onSelect: function() {
|
|
5257
5401
|
setHidden(c.key, true);
|
|
@@ -5272,7 +5416,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5272
5416
|
setHidden(k, on);
|
|
5273
5417
|
}
|
|
5274
5418
|
};
|
|
5275
|
-
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */
|
|
5419
|
+
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React31.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
|
|
5276
5420
|
}
|
|
5277
5421
|
function openMenu(kind, key, anchor, rc) {
|
|
5278
5422
|
setMenu({ kind, key, anchor, rc });
|
|
@@ -5307,7 +5451,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5307
5451
|
} else if (r === 0 && col && (e.altKey && k === "ArrowDown" || k === "ContextMenu" || e.shiftKey && k === "F10") && controls)
|
|
5308
5452
|
openMenu("col", col.key, target, { r: 0, c });
|
|
5309
5453
|
else if (k === "ArrowRight") focusCell(r, c + 1);
|
|
5310
|
-
else if (k === "ArrowLeft") focusCell(r, c - 1);
|
|
5454
|
+
else if (k === "ArrowLeft") focusCell(r, c - 1, -1);
|
|
5311
5455
|
else if (k === "ArrowDown") {
|
|
5312
5456
|
if (r < lastR) focusCell(r + 1, c);
|
|
5313
5457
|
else if (pageSize && page < pageCount && goPage(page + 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
@@ -5315,7 +5459,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5315
5459
|
if (r > 1 || r === 1 && !(pageSize && page > 1)) focusCell(r - 1, c);
|
|
5316
5460
|
else if (r === 1 && goPage(page - 1, { r: pageSize, c })) activeState[1]({ r: pageSize, c });
|
|
5317
5461
|
} else if (k === "Home") focusCell(e.ctrlKey ? 1 : r, 0);
|
|
5318
|
-
else if (k === "End") focusCell(e.ctrlKey ? lastR : r, nCols - 1);
|
|
5462
|
+
else if (k === "End") focusCell(e.ctrlKey ? lastR : r, nCols - 1, -1);
|
|
5319
5463
|
else if (k === "PageDown") {
|
|
5320
5464
|
if (pageSize) {
|
|
5321
5465
|
if (goPage(page + 1, { r: 1, c })) activeState[1]({ r: 1, c });
|
|
@@ -5335,7 +5479,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5335
5479
|
if (pageKeys.length) toggleAll();
|
|
5336
5480
|
} else if (r === 0 && col && col.sortable && canSortAny) sortBy(col.key);
|
|
5337
5481
|
else if (r > 0 && k === " " && selectable) {
|
|
5338
|
-
if (canSelect(row)) toggle(row[rowKey], !selSet[row[rowKey]]);
|
|
5482
|
+
if (canSelect(row) && !(stacked && noCardSel)) toggle(row[rowKey], !selSet[row[rowKey]]);
|
|
5339
5483
|
} else if (r > 0 && k === "Enter" && rowHref && !target.querySelector("button, a[href]:not(.aura-table__row-link), input, select, textarea"))
|
|
5340
5484
|
followRow(target.closest('[role="row"]'), e);
|
|
5341
5485
|
else if (r > 0 && k === "Enter" && target.querySelector("button, a[href], input, select, textarea"))
|
|
@@ -5348,10 +5492,10 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5348
5492
|
e.stopPropagation();
|
|
5349
5493
|
}
|
|
5350
5494
|
}
|
|
5351
|
-
const head = [/* @__PURE__ */
|
|
5495
|
+
const head = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5352
5496
|
if (selectable)
|
|
5353
5497
|
head.push(
|
|
5354
|
-
/* @__PURE__ */
|
|
5498
|
+
/* @__PURE__ */ React31.createElement(
|
|
5355
5499
|
"span",
|
|
5356
5500
|
{
|
|
5357
5501
|
key: "__sel",
|
|
@@ -5365,7 +5509,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5365
5509
|
activeState[1]({ r: 0, c: 0 });
|
|
5366
5510
|
}
|
|
5367
5511
|
},
|
|
5368
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5512
|
+
pageKeys.length ? /* @__PURE__ */ React31.createElement(
|
|
5369
5513
|
Checkbox,
|
|
5370
5514
|
{
|
|
5371
5515
|
hideLabel: true,
|
|
@@ -5376,7 +5520,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5376
5520
|
onChange: toggleAll
|
|
5377
5521
|
}
|
|
5378
5522
|
) : null,
|
|
5379
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5523
|
+
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)
|
|
5380
5524
|
)
|
|
5381
5525
|
);
|
|
5382
5526
|
vis.forEach(function(c, i) {
|
|
@@ -5386,7 +5530,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5386
5530
|
const ariaSort = isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0;
|
|
5387
5531
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
5388
5532
|
head.push(
|
|
5389
|
-
/* @__PURE__ */
|
|
5533
|
+
/* @__PURE__ */ React31.createElement(
|
|
5390
5534
|
"span",
|
|
5391
5535
|
{
|
|
5392
5536
|
key: c.key,
|
|
@@ -5395,6 +5539,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5395
5539
|
"aria-colindex": ci + 1,
|
|
5396
5540
|
style: cellStyle(c, i),
|
|
5397
5541
|
"data-hide": hideLevel(c) ? String(hideLevel(c)) : void 0,
|
|
5542
|
+
"data-card": cardPart(c, i) === "hide" ? "hide" : void 0,
|
|
5398
5543
|
tabIndex: tabFor(0, ci),
|
|
5399
5544
|
"data-rc": "0:" + ci,
|
|
5400
5545
|
className: cx(
|
|
@@ -5436,7 +5581,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5436
5581
|
setDrag(null);
|
|
5437
5582
|
}
|
|
5438
5583
|
},
|
|
5439
|
-
/* @__PURE__ */
|
|
5584
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React31.createElement(
|
|
5440
5585
|
"button",
|
|
5441
5586
|
{
|
|
5442
5587
|
type: "button",
|
|
@@ -5448,14 +5593,14 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5448
5593
|
}
|
|
5449
5594
|
},
|
|
5450
5595
|
c.label,
|
|
5451
|
-
/* @__PURE__ */
|
|
5596
|
+
/* @__PURE__ */ React31.createElement(
|
|
5452
5597
|
Icon,
|
|
5453
5598
|
{
|
|
5454
|
-
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */
|
|
5599
|
+
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */ React31.createElement(IconArrowDown, null) : /* @__PURE__ */ React31.createElement(IconArrowUp, null) : /* @__PURE__ */ React31.createElement(IconArrowUpDown, null),
|
|
5455
5600
|
size: 12
|
|
5456
5601
|
}
|
|
5457
5602
|
)
|
|
5458
|
-
) : /* @__PURE__ */
|
|
5603
|
+
) : /* @__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(
|
|
5459
5604
|
"button",
|
|
5460
5605
|
{
|
|
5461
5606
|
type: "button",
|
|
@@ -5469,9 +5614,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5469
5614
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
5470
5615
|
}
|
|
5471
5616
|
},
|
|
5472
|
-
/* @__PURE__ */
|
|
5617
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconEllipsis, null) })
|
|
5473
5618
|
) : null),
|
|
5474
|
-
canResize(c) ? /* @__PURE__ */
|
|
5619
|
+
canResize(c) ? /* @__PURE__ */ React31.createElement(
|
|
5475
5620
|
"span",
|
|
5476
5621
|
{
|
|
5477
5622
|
className: "aura-table__resize",
|
|
@@ -5493,7 +5638,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5493
5638
|
);
|
|
5494
5639
|
});
|
|
5495
5640
|
head.push(
|
|
5496
|
-
/* @__PURE__ */
|
|
5641
|
+
/* @__PURE__ */ React31.createElement(
|
|
5497
5642
|
"span",
|
|
5498
5643
|
{
|
|
5499
5644
|
key: "__gr",
|
|
@@ -5504,15 +5649,15 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5504
5649
|
);
|
|
5505
5650
|
function cellContent(c, r) {
|
|
5506
5651
|
const v = r[c.key];
|
|
5507
|
-
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */
|
|
5652
|
+
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */ React31.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
5508
5653
|
}
|
|
5509
5654
|
function rowCells(r, i, k, isSel) {
|
|
5510
5655
|
const ri = i + 1;
|
|
5511
5656
|
const selLabel = selectable && canSelect(r) ? props.rowSelectLabel && props.rowSelectLabel(r) || t.selectRow(k) : void 0;
|
|
5512
|
-
const cells = [/* @__PURE__ */
|
|
5657
|
+
const cells = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5513
5658
|
if (selectable)
|
|
5514
5659
|
cells.push(
|
|
5515
|
-
/* @__PURE__ */
|
|
5660
|
+
/* @__PURE__ */ React31.createElement(
|
|
5516
5661
|
"span",
|
|
5517
5662
|
{
|
|
5518
5663
|
key: "__sel",
|
|
@@ -5526,7 +5671,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5526
5671
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
5527
5672
|
}
|
|
5528
5673
|
},
|
|
5529
|
-
canSelect(r) ? /* @__PURE__ */
|
|
5674
|
+
canSelect(r) ? /* @__PURE__ */ React31.createElement(
|
|
5530
5675
|
Checkbox,
|
|
5531
5676
|
{
|
|
5532
5677
|
hideLabel: true,
|
|
@@ -5543,7 +5688,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5543
5688
|
vis.forEach(function(c, j) {
|
|
5544
5689
|
const ci = j + (selectable ? 1 : 0), v = r[c.key], pin = isPinned(c);
|
|
5545
5690
|
cells.push(
|
|
5546
|
-
/* @__PURE__ */
|
|
5691
|
+
/* @__PURE__ */ React31.createElement(
|
|
5547
5692
|
"span",
|
|
5548
5693
|
{
|
|
5549
5694
|
key: c.key,
|
|
@@ -5565,13 +5710,13 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5565
5710
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
5566
5711
|
}
|
|
5567
5712
|
},
|
|
5568
|
-
autoRows ? /* @__PURE__ */
|
|
5713
|
+
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)
|
|
5569
5714
|
)
|
|
5570
5715
|
);
|
|
5571
5716
|
});
|
|
5572
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
5717
|
+
if (hasFields) cells.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
5573
5718
|
cells.push(
|
|
5574
|
-
/* @__PURE__ */
|
|
5719
|
+
/* @__PURE__ */ React31.createElement(
|
|
5575
5720
|
"span",
|
|
5576
5721
|
{
|
|
5577
5722
|
key: "__gr",
|
|
@@ -5588,14 +5733,14 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5588
5733
|
const n3 = pageSize || props.skeletonRows || 5;
|
|
5589
5734
|
const skRows = body = [];
|
|
5590
5735
|
for (let i = 0; i < n3; i++) {
|
|
5591
|
-
const sk = [/* @__PURE__ */
|
|
5736
|
+
const sk = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
5592
5737
|
if (selectable)
|
|
5593
5738
|
sk.push(
|
|
5594
|
-
/* @__PURE__ */
|
|
5739
|
+
/* @__PURE__ */ React31.createElement("span", { key: "__sel", className: cx("aura-table__sel", nPinned && "is-pinned") }, /* @__PURE__ */ React31.createElement("span", { className: "aura-skel aura-skel--box" }))
|
|
5595
5740
|
);
|
|
5596
5741
|
vis.forEach(function(c, j) {
|
|
5597
5742
|
sk.push(
|
|
5598
|
-
/* @__PURE__ */
|
|
5743
|
+
/* @__PURE__ */ React31.createElement(
|
|
5599
5744
|
"span",
|
|
5600
5745
|
{
|
|
5601
5746
|
key: c.key,
|
|
@@ -5604,7 +5749,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5604
5749
|
...cardAttrs(c, j),
|
|
5605
5750
|
"data-label": void 0
|
|
5606
5751
|
},
|
|
5607
|
-
/* @__PURE__ */
|
|
5752
|
+
/* @__PURE__ */ React31.createElement(
|
|
5608
5753
|
"span",
|
|
5609
5754
|
{
|
|
5610
5755
|
className: cx("aura-skel", c.pill && "aura-skel--pill"),
|
|
@@ -5614,28 +5759,28 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5614
5759
|
)
|
|
5615
5760
|
);
|
|
5616
5761
|
});
|
|
5617
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
5762
|
+
if (hasFields) sk.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
5618
5763
|
sk.push(
|
|
5619
|
-
/* @__PURE__ */
|
|
5764
|
+
/* @__PURE__ */ React31.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
5620
5765
|
);
|
|
5621
5766
|
skRows.push(
|
|
5622
|
-
/* @__PURE__ */
|
|
5767
|
+
/* @__PURE__ */ React31.createElement("div", { key: "sk" + i, className: "aura-table__row aura-table__row--skeleton", "aria-hidden": true, style: rowStyle }, sk)
|
|
5623
5768
|
);
|
|
5624
5769
|
}
|
|
5625
5770
|
} else if (!rows.length) {
|
|
5626
5771
|
const em = props.empty || {};
|
|
5627
|
-
body = /* @__PURE__ */
|
|
5772
|
+
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));
|
|
5628
5773
|
} else {
|
|
5629
5774
|
const bodyRows = body = [];
|
|
5630
5775
|
if (virtual && start > 0)
|
|
5631
5776
|
bodyRows.push(
|
|
5632
|
-
/* @__PURE__ */
|
|
5777
|
+
/* @__PURE__ */ React31.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
5633
5778
|
);
|
|
5634
5779
|
for (let ri = start; ri < end; ri++) {
|
|
5635
5780
|
(function(r, i) {
|
|
5636
5781
|
const k = r[rowKey], isSel = !!selSet[k];
|
|
5637
5782
|
bodyRows.push(
|
|
5638
|
-
/* @__PURE__ */
|
|
5783
|
+
/* @__PURE__ */ React31.createElement(
|
|
5639
5784
|
"div",
|
|
5640
5785
|
{
|
|
5641
5786
|
key: k,
|
|
@@ -5663,7 +5808,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5663
5808
|
}
|
|
5664
5809
|
if (virtual && end < pageRows.length)
|
|
5665
5810
|
bodyRows.push(
|
|
5666
|
-
/* @__PURE__ */
|
|
5811
|
+
/* @__PURE__ */ React31.createElement(
|
|
5667
5812
|
"div",
|
|
5668
5813
|
{
|
|
5669
5814
|
key: "__bot",
|
|
@@ -5676,9 +5821,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5676
5821
|
}
|
|
5677
5822
|
let foot = null;
|
|
5678
5823
|
function pagerButton(dir) {
|
|
5679
|
-
const p = page + dir, off = busy || (dir < 0 ? page <= 1 : page >= pageCount), label = dir < 0 ? t.prevPage : t.nextPage, icon = dir < 0 ? /* @__PURE__ */
|
|
5824
|
+
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);
|
|
5680
5825
|
if (props.getPageHref && !off)
|
|
5681
|
-
return /* @__PURE__ */
|
|
5826
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5682
5827
|
Link,
|
|
5683
5828
|
{
|
|
5684
5829
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -5693,9 +5838,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5693
5838
|
}
|
|
5694
5839
|
}
|
|
5695
5840
|
},
|
|
5696
|
-
/* @__PURE__ */
|
|
5841
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: icon })
|
|
5697
5842
|
);
|
|
5698
|
-
return /* @__PURE__ */
|
|
5843
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5699
5844
|
IconButton,
|
|
5700
5845
|
{
|
|
5701
5846
|
icon,
|
|
@@ -5710,11 +5855,11 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5710
5855
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
5711
5856
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
5712
5857
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
5713
|
-
foot = /* @__PURE__ */
|
|
5858
|
+
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)));
|
|
5714
5859
|
} else if (height && rows.length && !loading) {
|
|
5715
|
-
foot = /* @__PURE__ */
|
|
5860
|
+
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));
|
|
5716
5861
|
}
|
|
5717
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
5862
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React31.createElement(
|
|
5718
5863
|
"div",
|
|
5719
5864
|
{
|
|
5720
5865
|
role: "row",
|
|
@@ -5723,8 +5868,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5723
5868
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
5724
5869
|
style: rowStyle
|
|
5725
5870
|
},
|
|
5726
|
-
/* @__PURE__ */
|
|
5727
|
-
selectable ? /* @__PURE__ */
|
|
5871
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
5872
|
+
selectable ? /* @__PURE__ */ React31.createElement(
|
|
5728
5873
|
"span",
|
|
5729
5874
|
{
|
|
5730
5875
|
role: "gridcell",
|
|
@@ -5739,7 +5884,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5739
5884
|
) : null,
|
|
5740
5885
|
vis.map(function(c, j) {
|
|
5741
5886
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
5742
|
-
return /* @__PURE__ */
|
|
5887
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5743
5888
|
"span",
|
|
5744
5889
|
{
|
|
5745
5890
|
key: c.key,
|
|
@@ -5760,13 +5905,13 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5760
5905
|
),
|
|
5761
5906
|
style: cellStyle(c, j),
|
|
5762
5907
|
...cardAttrs(c, j),
|
|
5763
|
-
"data-label": j ===
|
|
5908
|
+
"data-label": cardPart(c, j) === "title" ? void 0 : c.label || t.totals
|
|
5764
5909
|
},
|
|
5765
5910
|
props.footer[c.key]
|
|
5766
5911
|
);
|
|
5767
5912
|
}),
|
|
5768
|
-
hasFields ? /* @__PURE__ */
|
|
5769
|
-
/* @__PURE__ */
|
|
5913
|
+
hasFields ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
5914
|
+
/* @__PURE__ */ React31.createElement(
|
|
5770
5915
|
"span",
|
|
5771
5916
|
{
|
|
5772
5917
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -5780,7 +5925,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5780
5925
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
5781
5926
|
};
|
|
5782
5927
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
5783
|
-
const gridEl = /* @__PURE__ */
|
|
5928
|
+
const gridEl = /* @__PURE__ */ React31.createElement(
|
|
5784
5929
|
"div",
|
|
5785
5930
|
{
|
|
5786
5931
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -5788,14 +5933,15 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5788
5933
|
className: cx(
|
|
5789
5934
|
"aura-table",
|
|
5790
5935
|
stacked && "aura-table--stacked",
|
|
5936
|
+
noCardSel && "aura-table--cards-nosel",
|
|
5791
5937
|
scrolledX[0] && "is-scrolled-x",
|
|
5792
5938
|
refreshing && "is-refreshing",
|
|
5793
5939
|
!levels.length && props.className
|
|
5794
5940
|
),
|
|
5795
5941
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
5796
5942
|
},
|
|
5797
|
-
refreshing ? /* @__PURE__ */
|
|
5798
|
-
/* @__PURE__ */
|
|
5943
|
+
refreshing ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
5944
|
+
/* @__PURE__ */ React31.createElement(
|
|
5799
5945
|
"div",
|
|
5800
5946
|
{
|
|
5801
5947
|
ref: function(el) {
|
|
@@ -5805,8 +5951,16 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5805
5951
|
className: "aura-table__scroll",
|
|
5806
5952
|
onMouseOver: showFull,
|
|
5807
5953
|
onMouseLeave: hideFull,
|
|
5808
|
-
onFocus:
|
|
5809
|
-
|
|
5954
|
+
onFocus: function(e) {
|
|
5955
|
+
lastFocus.current = e.target;
|
|
5956
|
+
showFull(e);
|
|
5957
|
+
},
|
|
5958
|
+
onBlur: function(e) {
|
|
5959
|
+
const to = e.relatedTarget;
|
|
5960
|
+
if ((!to || !e.currentTarget.contains(to)) && e.target.getClientRects().length > 0)
|
|
5961
|
+
lastFocus.current = null;
|
|
5962
|
+
hideFull();
|
|
5963
|
+
},
|
|
5810
5964
|
style: scrollStyle,
|
|
5811
5965
|
role: "grid",
|
|
5812
5966
|
"aria-label": props.label,
|
|
@@ -5824,7 +5978,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5824
5978
|
if (sx !== scrolledX[0]) scrolledX[1](sx);
|
|
5825
5979
|
}
|
|
5826
5980
|
},
|
|
5827
|
-
/* @__PURE__ */
|
|
5981
|
+
/* @__PURE__ */ React31.createElement(
|
|
5828
5982
|
"div",
|
|
5829
5983
|
{
|
|
5830
5984
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -5837,11 +5991,11 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5837
5991
|
body,
|
|
5838
5992
|
totalRow
|
|
5839
5993
|
),
|
|
5840
|
-
busy ? /* @__PURE__ */
|
|
5841
|
-
controls ? /* @__PURE__ */
|
|
5994
|
+
busy ? /* @__PURE__ */ React31.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null,
|
|
5995
|
+
controls ? /* @__PURE__ */ React31.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React31.createElement(
|
|
5842
5996
|
IconButton,
|
|
5843
5997
|
{
|
|
5844
|
-
icon: /* @__PURE__ */
|
|
5998
|
+
icon: /* @__PURE__ */ React31.createElement(IconColumns3, null),
|
|
5845
5999
|
label: t.showHideColumns,
|
|
5846
6000
|
"aria-haspopup": "menu",
|
|
5847
6001
|
onClick: function(e) {
|
|
@@ -5850,7 +6004,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5850
6004
|
}
|
|
5851
6005
|
)) : null,
|
|
5852
6006
|
foot,
|
|
5853
|
-
menu ? /* @__PURE__ */
|
|
6007
|
+
menu ? /* @__PURE__ */ React31.createElement(
|
|
5854
6008
|
Menu,
|
|
5855
6009
|
{
|
|
5856
6010
|
anchor: menu.anchor,
|
|
@@ -5860,13 +6014,13 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5860
6014
|
}
|
|
5861
6015
|
) : null,
|
|
5862
6016
|
tipEl,
|
|
5863
|
-
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */
|
|
6017
|
+
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */ React31.createElement(Link, { ref: jumpLink, href: props.getPageHref(jumpState[0]), hidden: true, tabIndex: -1, "aria-hidden": true }) : null
|
|
5864
6018
|
);
|
|
5865
6019
|
if (!levels.length) return gridEl;
|
|
5866
6020
|
let out = gridEl;
|
|
5867
6021
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
5868
6022
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
5869
|
-
out = /* @__PURE__ */
|
|
6023
|
+
out = /* @__PURE__ */ React31.createElement(
|
|
5870
6024
|
"div",
|
|
5871
6025
|
{
|
|
5872
6026
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -5875,19 +6029,19 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5875
6029
|
out
|
|
5876
6030
|
);
|
|
5877
6031
|
}
|
|
5878
|
-
return /* @__PURE__ */
|
|
6032
|
+
return /* @__PURE__ */ React31.createElement("div", { ref, className: cx("aura-table-box", props.className) }, out);
|
|
5879
6033
|
});
|
|
5880
6034
|
var DataTable2 = DataTableImpl;
|
|
5881
6035
|
|
|
5882
6036
|
// src/Card.tsx
|
|
5883
|
-
var
|
|
5884
|
-
var Card =
|
|
6037
|
+
var React32 = __toESM(require("react"), 1);
|
|
6038
|
+
var Card = React32.forwardRef(function Card2(props, ref) {
|
|
5885
6039
|
return cardElement(props, ref);
|
|
5886
6040
|
});
|
|
5887
6041
|
|
|
5888
6042
|
// src/Tabs.tsx
|
|
5889
|
-
var
|
|
5890
|
-
var Tabs =
|
|
6043
|
+
var React33 = __toESM(require("react"), 1);
|
|
6044
|
+
var Tabs = React33.forwardRef(function Tabs2(props, ref) {
|
|
5891
6045
|
const items2 = props.tabs || [], base = uid();
|
|
5892
6046
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
5893
6047
|
return !!t.href;
|
|
@@ -5901,7 +6055,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5901
6055
|
props.onChange
|
|
5902
6056
|
);
|
|
5903
6057
|
const cur = asLinks && "value" in props ? props.value : st[0];
|
|
5904
|
-
const refs =
|
|
6058
|
+
const refs = React33.useRef({});
|
|
5905
6059
|
const current2 = items2.filter(function(t) {
|
|
5906
6060
|
return t.id === cur;
|
|
5907
6061
|
})[0] || firstOn || items2[0];
|
|
@@ -5913,7 +6067,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5913
6067
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
5914
6068
|
};
|
|
5915
6069
|
const rootCls = cx("aura-tabs", seg && "aura-tabs--segmented");
|
|
5916
|
-
const [focusId, setFocusId] =
|
|
6070
|
+
const [focusId, setFocusId] = React33.useState(null);
|
|
5917
6071
|
items2.forEach(function(t) {
|
|
5918
6072
|
const al = t.tabProps && t.tabProps["aria-label"];
|
|
5919
6073
|
if (al && al.toLowerCase().indexOf(String(t.label).toLowerCase()) !== 0)
|
|
@@ -5923,19 +6077,19 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5923
6077
|
);
|
|
5924
6078
|
});
|
|
5925
6079
|
if (asLinks)
|
|
5926
|
-
return /* @__PURE__ */
|
|
6080
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5927
6081
|
"nav",
|
|
5928
6082
|
{
|
|
5929
6083
|
ref,
|
|
5930
6084
|
"aria-label": props.label,
|
|
5931
6085
|
className: cx(rootCls, "aura-tabs--links", props.className)
|
|
5932
6086
|
},
|
|
5933
|
-
/* @__PURE__ */
|
|
6087
|
+
/* @__PURE__ */ React33.createElement("div", { className: listCls }, items2.map(function(t) {
|
|
5934
6088
|
const on = t.id === cur;
|
|
5935
6089
|
const inner = [
|
|
5936
|
-
t.icon ? /* @__PURE__ */
|
|
6090
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
5937
6091
|
t.label,
|
|
5938
|
-
t.count != null ? /* @__PURE__ */
|
|
6092
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
5939
6093
|
];
|
|
5940
6094
|
const own = omit(t.tabProps || {}, [
|
|
5941
6095
|
"type",
|
|
@@ -5949,7 +6103,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5949
6103
|
"name",
|
|
5950
6104
|
"value"
|
|
5951
6105
|
]);
|
|
5952
|
-
return t.disabled ? /* @__PURE__ */
|
|
6106
|
+
return t.disabled ? /* @__PURE__ */ React33.createElement(
|
|
5953
6107
|
"span",
|
|
5954
6108
|
{
|
|
5955
6109
|
...omit(own, ["onClick"]),
|
|
@@ -5958,7 +6112,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5958
6112
|
"aria-disabled": true
|
|
5959
6113
|
},
|
|
5960
6114
|
inner
|
|
5961
|
-
) : /* @__PURE__ */
|
|
6115
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
5962
6116
|
Link,
|
|
5963
6117
|
{
|
|
5964
6118
|
...own,
|
|
@@ -5988,7 +6142,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5988
6142
|
const stop = manual && focusId && items2.filter(function(t) {
|
|
5989
6143
|
return t.id === focusId && !t.disabled;
|
|
5990
6144
|
})[0] || current2;
|
|
5991
|
-
return /* @__PURE__ */
|
|
6145
|
+
return /* @__PURE__ */ React33.createElement("div", { ref, className: cx(rootCls, props.className) }, /* @__PURE__ */ React33.createElement(
|
|
5992
6146
|
"div",
|
|
5993
6147
|
{
|
|
5994
6148
|
role: "tablist",
|
|
@@ -6021,7 +6175,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6021
6175
|
items2.map(function(t) {
|
|
6022
6176
|
const on = current2 && t.id === current2.id;
|
|
6023
6177
|
const own = t.tabProps || {};
|
|
6024
|
-
return /* @__PURE__ */
|
|
6178
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6025
6179
|
"button",
|
|
6026
6180
|
{
|
|
6027
6181
|
...own,
|
|
@@ -6048,9 +6202,9 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6048
6202
|
st[1](t.id);
|
|
6049
6203
|
}
|
|
6050
6204
|
},
|
|
6051
|
-
t.icon ? /* @__PURE__ */
|
|
6205
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { name: t.icon }) : null,
|
|
6052
6206
|
t.label,
|
|
6053
|
-
t.count != null ? /* @__PURE__ */
|
|
6207
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
6054
6208
|
);
|
|
6055
6209
|
})
|
|
6056
6210
|
), props.keepMounted ? (
|
|
@@ -6058,7 +6212,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6058
6212
|
items2.map(function(t) {
|
|
6059
6213
|
if (t.content === void 0) return null;
|
|
6060
6214
|
const on = current2 && t.id === current2.id;
|
|
6061
|
-
return /* @__PURE__ */
|
|
6215
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6062
6216
|
"div",
|
|
6063
6217
|
{
|
|
6064
6218
|
key: t.id,
|
|
@@ -6072,7 +6226,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6072
6226
|
t.content
|
|
6073
6227
|
);
|
|
6074
6228
|
})
|
|
6075
|
-
) : current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
6229
|
+
) : current2 && current2.content !== void 0 ? /* @__PURE__ */ React33.createElement(
|
|
6076
6230
|
"div",
|
|
6077
6231
|
{
|
|
6078
6232
|
role: "tabpanel",
|
|
@@ -6086,14 +6240,14 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6086
6240
|
});
|
|
6087
6241
|
|
|
6088
6242
|
// src/SideNav.tsx
|
|
6089
|
-
var
|
|
6243
|
+
var React34 = __toESM(require("react"), 1);
|
|
6090
6244
|
var import_react_dom10 = require("react-dom");
|
|
6091
6245
|
function contains(it, id) {
|
|
6092
6246
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
6093
6247
|
return c.id === id || contains(c, id);
|
|
6094
6248
|
});
|
|
6095
6249
|
}
|
|
6096
|
-
var SideNav =
|
|
6250
|
+
var SideNav = React34.forwardRef(function SideNav2(props, ref) {
|
|
6097
6251
|
const t = useStrings();
|
|
6098
6252
|
const Link = useLinkComponent(props.linkComponent);
|
|
6099
6253
|
const base = uid();
|
|
@@ -6105,14 +6259,14 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6105
6259
|
const active = st[0];
|
|
6106
6260
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
6107
6261
|
const collapsed = col[0];
|
|
6108
|
-
const tipState =
|
|
6109
|
-
|
|
6262
|
+
const tipState = React34.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
6263
|
+
React34.useEffect(
|
|
6110
6264
|
function() {
|
|
6111
6265
|
if (!collapsed) setTip(null);
|
|
6112
6266
|
},
|
|
6113
6267
|
[collapsed]
|
|
6114
6268
|
);
|
|
6115
|
-
|
|
6269
|
+
React34.useEffect(
|
|
6116
6270
|
function() {
|
|
6117
6271
|
if (!tip) return;
|
|
6118
6272
|
function esc(e) {
|
|
@@ -6137,12 +6291,12 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6137
6291
|
return { onMouseEnter: show2, onFocus: show2, onMouseLeave: hide, onBlur: hide };
|
|
6138
6292
|
}
|
|
6139
6293
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
6140
|
-
const openState =
|
|
6294
|
+
const openState = React34.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
6141
6295
|
function isOpen(it) {
|
|
6142
6296
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
6143
6297
|
return !!it.defaultOpen || contains(it, active);
|
|
6144
6298
|
}
|
|
6145
|
-
|
|
6299
|
+
React34.useEffect(
|
|
6146
6300
|
function() {
|
|
6147
6301
|
if (!active) return;
|
|
6148
6302
|
const next = {};
|
|
@@ -6164,7 +6318,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6164
6318
|
},
|
|
6165
6319
|
[active]
|
|
6166
6320
|
);
|
|
6167
|
-
const navRef =
|
|
6321
|
+
const navRef = React34.useRef(null);
|
|
6168
6322
|
function onKeyDown(e) {
|
|
6169
6323
|
const k = e.key;
|
|
6170
6324
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -6183,12 +6337,12 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6183
6337
|
function inner(it, group, open) {
|
|
6184
6338
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
6185
6339
|
return [
|
|
6186
|
-
it.icon ? /* @__PURE__ */
|
|
6187
|
-
collapsed && marked ? /* @__PURE__ */
|
|
6188
|
-
/* @__PURE__ */
|
|
6189
|
-
it.badge != null ? /* @__PURE__ */
|
|
6190
|
-
it.count != null ? /* @__PURE__ */
|
|
6191
|
-
group ? /* @__PURE__ */
|
|
6340
|
+
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,
|
|
6341
|
+
collapsed && marked ? /* @__PURE__ */ React34.createElement("span", { key: "d", className: "aura-nav__dot", "aria-hidden": "true" }) : null,
|
|
6342
|
+
/* @__PURE__ */ React34.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
|
|
6343
|
+
it.badge != null ? /* @__PURE__ */ React34.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
|
|
6344
|
+
it.count != null ? /* @__PURE__ */ React34.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
|
|
6345
|
+
group ? /* @__PURE__ */ React34.createElement(Icon, { key: "g", name: /* @__PURE__ */ React34.createElement(IconChevronDown, null), className: cx("aura-nav__chevron", open && "is-open") }) : null
|
|
6192
6346
|
];
|
|
6193
6347
|
}
|
|
6194
6348
|
function item(it, depth) {
|
|
@@ -6196,7 +6350,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6196
6350
|
const open = !collapsed && isOpen(it);
|
|
6197
6351
|
const listId = base + "-" + it.id;
|
|
6198
6352
|
const holdsActive = contains(it, active);
|
|
6199
|
-
return /* @__PURE__ */
|
|
6353
|
+
return /* @__PURE__ */ React34.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React34.createElement(
|
|
6200
6354
|
"button",
|
|
6201
6355
|
{
|
|
6202
6356
|
type: "button",
|
|
@@ -6225,7 +6379,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6225
6379
|
}
|
|
6226
6380
|
},
|
|
6227
6381
|
inner(it, true, open)
|
|
6228
|
-
), /* @__PURE__ */
|
|
6382
|
+
), /* @__PURE__ */ React34.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
6229
6383
|
return item(c, depth + 1);
|
|
6230
6384
|
})));
|
|
6231
6385
|
}
|
|
@@ -6241,9 +6395,9 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6241
6395
|
st[1](it.id);
|
|
6242
6396
|
}
|
|
6243
6397
|
};
|
|
6244
|
-
return /* @__PURE__ */
|
|
6398
|
+
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)));
|
|
6245
6399
|
}
|
|
6246
|
-
return /* @__PURE__ */
|
|
6400
|
+
return /* @__PURE__ */ React34.createElement(
|
|
6247
6401
|
"nav",
|
|
6248
6402
|
{
|
|
6249
6403
|
ref: function(el) {
|
|
@@ -6261,17 +6415,17 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6261
6415
|
"aria-label": props.label || t.mainNav,
|
|
6262
6416
|
onKeyDown
|
|
6263
6417
|
},
|
|
6264
|
-
props.header ? /* @__PURE__ */
|
|
6265
|
-
/* @__PURE__ */
|
|
6266
|
-
return /* @__PURE__ */
|
|
6418
|
+
props.header ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__header" }, props.header) : null,
|
|
6419
|
+
/* @__PURE__ */ React34.createElement("div", { className: "aura-nav__scroll" }, sections.map(function(s, i) {
|
|
6420
|
+
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) {
|
|
6267
6421
|
return item(it, 0);
|
|
6268
6422
|
})));
|
|
6269
6423
|
})),
|
|
6270
|
-
props.footer ? /* @__PURE__ */
|
|
6271
|
-
props.collapsible ? /* @__PURE__ */
|
|
6424
|
+
props.footer ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
|
|
6425
|
+
props.collapsible ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React34.createElement(
|
|
6272
6426
|
IconButton,
|
|
6273
6427
|
{
|
|
6274
|
-
icon: collapsed ? /* @__PURE__ */
|
|
6428
|
+
icon: collapsed ? /* @__PURE__ */ React34.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React34.createElement(IconPanelLeftClose, null),
|
|
6275
6429
|
label: collapsed ? t.expandNav : t.collapseNav,
|
|
6276
6430
|
size: "md",
|
|
6277
6431
|
onClick: function() {
|
|
@@ -6281,7 +6435,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6281
6435
|
}
|
|
6282
6436
|
)) : null,
|
|
6283
6437
|
tip && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
6284
|
-
/* @__PURE__ */
|
|
6438
|
+
/* @__PURE__ */ React34.createElement(
|
|
6285
6439
|
"div",
|
|
6286
6440
|
{
|
|
6287
6441
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -6296,35 +6450,35 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6296
6450
|
});
|
|
6297
6451
|
|
|
6298
6452
|
// src/Breadcrumb.tsx
|
|
6299
|
-
var
|
|
6300
|
-
var Breadcrumb =
|
|
6453
|
+
var React35 = __toESM(require("react"), 1);
|
|
6454
|
+
var Breadcrumb = React35.forwardRef(function Breadcrumb2(props, ref) {
|
|
6301
6455
|
const t = useStrings();
|
|
6302
6456
|
const Link = useLinkComponent(props.linkComponent);
|
|
6303
6457
|
const items2 = props.items || [];
|
|
6304
|
-
return /* @__PURE__ */
|
|
6458
|
+
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) {
|
|
6305
6459
|
const last = i === items2.length - 1;
|
|
6306
|
-
return /* @__PURE__ */
|
|
6460
|
+
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) : (
|
|
6307
6461
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
6308
|
-
/* @__PURE__ */
|
|
6309
|
-
), last ? null : /* @__PURE__ */
|
|
6462
|
+
/* @__PURE__ */ React35.createElement("span", { className: "aura-crumbs__text" }, it.label)
|
|
6463
|
+
), last ? null : /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" }));
|
|
6310
6464
|
})));
|
|
6311
6465
|
});
|
|
6312
6466
|
|
|
6313
6467
|
// src/Avatar.tsx
|
|
6314
|
-
var
|
|
6468
|
+
var React36 = __toESM(require("react"), 1);
|
|
6315
6469
|
var AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
|
|
6316
6470
|
function initials(name) {
|
|
6317
6471
|
const parts = String(name || "?").trim().split(/\s+/);
|
|
6318
6472
|
return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
|
|
6319
6473
|
}
|
|
6320
|
-
var Avatar =
|
|
6321
|
-
const size = props.size || "md", errState =
|
|
6474
|
+
var Avatar = React36.forwardRef(function Avatar2(props, ref) {
|
|
6475
|
+
const size = props.size || "md", errState = React36.useState(null);
|
|
6322
6476
|
let hash = 0;
|
|
6323
6477
|
String(props.name || "").split("").forEach(function(ch) {
|
|
6324
6478
|
hash = hash * 31 + ch.charCodeAt(0) >>> 0;
|
|
6325
6479
|
});
|
|
6326
6480
|
const tone2 = AVATAR_TONES[hash % AVATAR_TONES.length];
|
|
6327
|
-
return /* @__PURE__ */
|
|
6481
|
+
return /* @__PURE__ */ React36.createElement(
|
|
6328
6482
|
"span",
|
|
6329
6483
|
{
|
|
6330
6484
|
ref,
|
|
@@ -6332,7 +6486,7 @@ var Avatar = React35.forwardRef(function Avatar2(props, ref) {
|
|
|
6332
6486
|
role: "img",
|
|
6333
6487
|
"aria-label": props.name + (props.status ? ", " + props.status : "")
|
|
6334
6488
|
},
|
|
6335
|
-
props.src && errState[0] !== props.src ? /* @__PURE__ */
|
|
6489
|
+
props.src && errState[0] !== props.src ? /* @__PURE__ */ React36.createElement(
|
|
6336
6490
|
"img",
|
|
6337
6491
|
{
|
|
6338
6492
|
key: props.src,
|
|
@@ -6342,16 +6496,16 @@ var Avatar = React35.forwardRef(function Avatar2(props, ref) {
|
|
|
6342
6496
|
errState[1](props.src || null);
|
|
6343
6497
|
}
|
|
6344
6498
|
}
|
|
6345
|
-
) : /* @__PURE__ */
|
|
6346
|
-
props.status === "online" ? /* @__PURE__ */
|
|
6499
|
+
) : /* @__PURE__ */ React36.createElement("span", { "aria-hidden": true }, initials(props.name)),
|
|
6500
|
+
props.status === "online" ? /* @__PURE__ */ React36.createElement("span", { className: "aura-avatar__status", "aria-hidden": true }) : null
|
|
6347
6501
|
);
|
|
6348
6502
|
});
|
|
6349
6503
|
|
|
6350
6504
|
// src/Stack.tsx
|
|
6351
|
-
var
|
|
6505
|
+
var React38 = __toESM(require("react"), 1);
|
|
6352
6506
|
|
|
6353
6507
|
// src/responsive.tsx
|
|
6354
|
-
var
|
|
6508
|
+
var React37 = __toESM(require("react"), 1);
|
|
6355
6509
|
|
|
6356
6510
|
// src/breakpoints.ts
|
|
6357
6511
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
@@ -6359,7 +6513,7 @@ var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
|
6359
6513
|
// src/responsive.tsx
|
|
6360
6514
|
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
6361
6515
|
function useBreakpoint() {
|
|
6362
|
-
return
|
|
6516
|
+
return React37.useSyncExternalStore(subscribe, current, function() {
|
|
6363
6517
|
return "lg";
|
|
6364
6518
|
});
|
|
6365
6519
|
}
|
|
@@ -6399,8 +6553,8 @@ var space = function(v) {
|
|
|
6399
6553
|
};
|
|
6400
6554
|
|
|
6401
6555
|
// src/Stack.tsx
|
|
6402
|
-
var h5 =
|
|
6403
|
-
var Stack =
|
|
6556
|
+
var h5 = React38.createElement;
|
|
6557
|
+
var Stack = React38.forwardRef(function Stack2(props, ref) {
|
|
6404
6558
|
const style = Object.assign(
|
|
6405
6559
|
{},
|
|
6406
6560
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -6414,9 +6568,9 @@ var Stack = React37.forwardRef(function Stack2(props, ref) {
|
|
|
6414
6568
|
});
|
|
6415
6569
|
|
|
6416
6570
|
// src/Grid.tsx
|
|
6417
|
-
var
|
|
6418
|
-
var h6 =
|
|
6419
|
-
var Grid =
|
|
6571
|
+
var React39 = __toESM(require("react"), 1);
|
|
6572
|
+
var h6 = React39.createElement;
|
|
6573
|
+
var Grid = React39.forwardRef(function Grid2(props, ref) {
|
|
6420
6574
|
const style = Object.assign(
|
|
6421
6575
|
{},
|
|
6422
6576
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -6431,9 +6585,9 @@ var Grid = React38.forwardRef(function Grid2(props, ref) {
|
|
|
6431
6585
|
});
|
|
6432
6586
|
|
|
6433
6587
|
// src/Container.tsx
|
|
6434
|
-
var
|
|
6435
|
-
var h7 =
|
|
6436
|
-
var Container =
|
|
6588
|
+
var React40 = __toESM(require("react"), 1);
|
|
6589
|
+
var h7 = React40.createElement;
|
|
6590
|
+
var Container = React40.forwardRef(function Container2(props, ref) {
|
|
6437
6591
|
return h7(
|
|
6438
6592
|
props.as || "div",
|
|
6439
6593
|
{
|
|
@@ -6446,27 +6600,27 @@ var Container = React39.forwardRef(function Container2(props, ref) {
|
|
|
6446
6600
|
});
|
|
6447
6601
|
|
|
6448
6602
|
// src/AppShell.tsx
|
|
6449
|
-
var
|
|
6450
|
-
var AppShell =
|
|
6603
|
+
var React41 = __toESM(require("react"), 1);
|
|
6604
|
+
var AppShell = React41.forwardRef(function AppShell2(props, ref) {
|
|
6451
6605
|
const t = useStrings();
|
|
6452
6606
|
const bp = useBreakpoint();
|
|
6453
6607
|
const wide = bp === "lg" || bp === "xl";
|
|
6454
|
-
const st =
|
|
6455
|
-
|
|
6608
|
+
const st = React41.useState(false), open = st[0], setOpen = st[1];
|
|
6609
|
+
React41.useEffect(
|
|
6456
6610
|
function() {
|
|
6457
6611
|
if (wide) setOpen(false);
|
|
6458
6612
|
},
|
|
6459
6613
|
[wide]
|
|
6460
6614
|
);
|
|
6461
|
-
const navEl = props.nav &&
|
|
6615
|
+
const navEl = props.nav && React41.isValidElement(props.nav) ? props.nav : null;
|
|
6462
6616
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
6463
|
-
const navState =
|
|
6617
|
+
const navState = React41.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
6464
6618
|
function onNav(id) {
|
|
6465
6619
|
if (shared) navState[1](id);
|
|
6466
6620
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
6467
6621
|
}
|
|
6468
|
-
const deskNav = navEl && shared ?
|
|
6469
|
-
const drawerNav = navEl ?
|
|
6622
|
+
const deskNav = navEl && shared ? React41.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
6623
|
+
const drawerNav = navEl ? React41.cloneElement(navEl, {
|
|
6470
6624
|
value: shared ? navState[0] : navEl.props.value,
|
|
6471
6625
|
onChange: function(id) {
|
|
6472
6626
|
onNav(id);
|
|
@@ -6476,7 +6630,7 @@ var AppShell = React40.forwardRef(function AppShell2(props, ref) {
|
|
|
6476
6630
|
collapsed: false,
|
|
6477
6631
|
collapsible: false
|
|
6478
6632
|
}) : props.nav;
|
|
6479
|
-
return /* @__PURE__ */
|
|
6633
|
+
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(
|
|
6480
6634
|
Drawer,
|
|
6481
6635
|
{
|
|
6482
6636
|
open,
|
|
@@ -6489,11 +6643,11 @@ var AppShell = React40.forwardRef(function AppShell2(props, ref) {
|
|
|
6489
6643
|
dismissible: true
|
|
6490
6644
|
},
|
|
6491
6645
|
drawerNav
|
|
6492
|
-
) : null, /* @__PURE__ */
|
|
6646
|
+
) : 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(
|
|
6493
6647
|
IconButton,
|
|
6494
6648
|
{
|
|
6495
6649
|
className: "aura-shell__menu",
|
|
6496
|
-
icon: /* @__PURE__ */
|
|
6650
|
+
icon: /* @__PURE__ */ React41.createElement(IconMenu, null),
|
|
6497
6651
|
label: props.menuLabel || t.openNav,
|
|
6498
6652
|
size: "md",
|
|
6499
6653
|
onClick: function() {
|
|
@@ -6501,18 +6655,18 @@ var AppShell = React40.forwardRef(function AppShell2(props, ref) {
|
|
|
6501
6655
|
},
|
|
6502
6656
|
"aria-expanded": open
|
|
6503
6657
|
}
|
|
6504
|
-
) : null, /* @__PURE__ */
|
|
6658
|
+
) : 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));
|
|
6505
6659
|
});
|
|
6506
6660
|
|
|
6507
6661
|
// src/ActionBar.tsx
|
|
6508
|
-
var
|
|
6509
|
-
var ActionBar =
|
|
6662
|
+
var React42 = __toESM(require("react"), 1);
|
|
6663
|
+
var ActionBar = React42.forwardRef(function ActionBar2(props, ref) {
|
|
6510
6664
|
const t = useStrings();
|
|
6511
6665
|
const bulk = props.selected != null;
|
|
6512
6666
|
const idle = bulk && !props.selected;
|
|
6513
6667
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
6514
|
-
const cameFrom =
|
|
6515
|
-
const own =
|
|
6668
|
+
const cameFrom = React42.useRef(null);
|
|
6669
|
+
const own = React42.useRef(null);
|
|
6516
6670
|
function clear() {
|
|
6517
6671
|
props.onClearSelection();
|
|
6518
6672
|
setTimeout(function() {
|
|
@@ -6521,7 +6675,7 @@ var ActionBar = React41.forwardRef(function ActionBar2(props, ref) {
|
|
|
6521
6675
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
6522
6676
|
}, 0);
|
|
6523
6677
|
}
|
|
6524
|
-
return /* @__PURE__ */
|
|
6678
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6525
6679
|
"div",
|
|
6526
6680
|
{
|
|
6527
6681
|
ref: function(el) {
|
|
@@ -6542,16 +6696,16 @@ var ActionBar = React41.forwardRef(function ActionBar2(props, ref) {
|
|
|
6542
6696
|
props.className
|
|
6543
6697
|
)
|
|
6544
6698
|
},
|
|
6545
|
-
/* @__PURE__ */
|
|
6699
|
+
/* @__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)
|
|
6546
6700
|
);
|
|
6547
6701
|
});
|
|
6548
6702
|
|
|
6549
6703
|
// src/Separator.tsx
|
|
6550
|
-
var
|
|
6551
|
-
var Separator =
|
|
6704
|
+
var React43 = __toESM(require("react"), 1);
|
|
6705
|
+
var Separator = React43.forwardRef(function Separator2(props, ref) {
|
|
6552
6706
|
const vertical = props.orientation === "vertical";
|
|
6553
6707
|
const decorative = props.decorative !== false;
|
|
6554
|
-
return /* @__PURE__ */
|
|
6708
|
+
return /* @__PURE__ */ React43.createElement(
|
|
6555
6709
|
"div",
|
|
6556
6710
|
{
|
|
6557
6711
|
ref,
|
|
@@ -6564,13 +6718,13 @@ var Separator = React42.forwardRef(function Separator2(props, ref) {
|
|
|
6564
6718
|
});
|
|
6565
6719
|
|
|
6566
6720
|
// src/Table.tsx
|
|
6567
|
-
var
|
|
6568
|
-
var StackLabels =
|
|
6569
|
-
var ColumnIndex =
|
|
6721
|
+
var React44 = __toESM(require("react"), 1);
|
|
6722
|
+
var StackLabels = React44.createContext(null);
|
|
6723
|
+
var ColumnIndex = React44.createContext(-1);
|
|
6570
6724
|
function flat(children) {
|
|
6571
6725
|
const out = [];
|
|
6572
|
-
|
|
6573
|
-
if (
|
|
6726
|
+
React44.Children.toArray(children).forEach(function(c) {
|
|
6727
|
+
if (React44.isValidElement(c) && c.type === React44.Fragment)
|
|
6574
6728
|
out.push.apply(out, flat(c.props.children));
|
|
6575
6729
|
else out.push(c);
|
|
6576
6730
|
});
|
|
@@ -6584,7 +6738,7 @@ function text(node) {
|
|
|
6584
6738
|
});
|
|
6585
6739
|
return parts.length ? parts.join("") : void 0;
|
|
6586
6740
|
}
|
|
6587
|
-
if (
|
|
6741
|
+
if (React44.isValidElement(node)) {
|
|
6588
6742
|
const p = node.props;
|
|
6589
6743
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
6590
6744
|
return text(p.children);
|
|
@@ -6594,13 +6748,13 @@ function text(node) {
|
|
|
6594
6748
|
function headerLabels(children) {
|
|
6595
6749
|
let out = [];
|
|
6596
6750
|
flat(children).forEach(function(c) {
|
|
6597
|
-
if (out.length || !
|
|
6751
|
+
if (out.length || !React44.isValidElement(c) || c.type !== THead) return;
|
|
6598
6752
|
const row = flat(c.props.children).find(function(r) {
|
|
6599
|
-
return
|
|
6753
|
+
return React44.isValidElement(r);
|
|
6600
6754
|
});
|
|
6601
6755
|
if (!row) return;
|
|
6602
6756
|
flat(row.props.children).forEach(function(cell) {
|
|
6603
|
-
if (!
|
|
6757
|
+
if (!React44.isValidElement(cell)) return;
|
|
6604
6758
|
const p = cell.props;
|
|
6605
6759
|
const t = text(p.children);
|
|
6606
6760
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -6610,18 +6764,18 @@ function headerLabels(children) {
|
|
|
6610
6764
|
});
|
|
6611
6765
|
return out;
|
|
6612
6766
|
}
|
|
6613
|
-
var Table =
|
|
6614
|
-
const { caption, captionHidden, density, stackBelow, className, children, ...rest } = props;
|
|
6767
|
+
var Table = React44.forwardRef(function Table2(props, ref) {
|
|
6768
|
+
const { caption, captionHidden, density, stackBelow, align, bordered, className, children, ...rest } = props;
|
|
6615
6769
|
const labels = stackBelow ? headerLabels(children) : null;
|
|
6616
6770
|
if (labels && !labels.length)
|
|
6617
6771
|
devWarnOnce(
|
|
6618
6772
|
"tbl-stack-labels",
|
|
6619
6773
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
6620
6774
|
);
|
|
6621
|
-
const outer =
|
|
6775
|
+
const outer = React44.useContext(StackLabels);
|
|
6622
6776
|
const capId = uid();
|
|
6623
|
-
const wrap =
|
|
6624
|
-
const sc =
|
|
6777
|
+
const wrap = React44.useRef(null);
|
|
6778
|
+
const sc = React44.useState(false), scrolls = sc[0];
|
|
6625
6779
|
useIsoLayoutEffect(function() {
|
|
6626
6780
|
const el = wrap.current;
|
|
6627
6781
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -6635,35 +6789,40 @@ var Table = React43.forwardRef(function Table2(props, ref) {
|
|
|
6635
6789
|
ro.disconnect();
|
|
6636
6790
|
};
|
|
6637
6791
|
}, []);
|
|
6638
|
-
return /* @__PURE__ */
|
|
6792
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6639
6793
|
"div",
|
|
6640
6794
|
{
|
|
6641
6795
|
ref: wrap,
|
|
6642
|
-
className: cx("aura-tbl-wrap", stackBelow && "is-stackable"),
|
|
6796
|
+
className: cx("aura-tbl-wrap", stackBelow && "is-stackable", bordered === false && "is-flush"),
|
|
6643
6797
|
"data-density": density,
|
|
6644
6798
|
tabIndex: scrolls ? 0 : void 0,
|
|
6645
6799
|
role: scrolls && (caption != null || rest["aria-label"]) ? "region" : void 0,
|
|
6646
6800
|
"aria-labelledby": scrolls && caption != null ? capId : void 0,
|
|
6647
6801
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
6648
6802
|
},
|
|
6649
|
-
/* @__PURE__ */
|
|
6803
|
+
/* @__PURE__ */ React44.createElement(
|
|
6650
6804
|
"table",
|
|
6651
6805
|
{
|
|
6652
6806
|
ref,
|
|
6653
|
-
className: cx(
|
|
6807
|
+
className: cx(
|
|
6808
|
+
"aura-tbl",
|
|
6809
|
+
stackBelow && "aura-tbl--stack-" + stackBelow,
|
|
6810
|
+
align === "middle" && "aura-tbl--middle",
|
|
6811
|
+
className
|
|
6812
|
+
),
|
|
6654
6813
|
role: stackBelow ? "table" : void 0,
|
|
6655
6814
|
...rest
|
|
6656
6815
|
},
|
|
6657
|
-
caption != null ? /* @__PURE__ */
|
|
6658
|
-
labels ? /* @__PURE__ */
|
|
6816
|
+
caption != null ? /* @__PURE__ */ React44.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
6817
|
+
labels ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
6659
6818
|
)
|
|
6660
6819
|
);
|
|
6661
6820
|
});
|
|
6662
6821
|
function section(tag, cls) {
|
|
6663
|
-
const C =
|
|
6822
|
+
const C = React44.forwardRef(function TableSection(props, ref) {
|
|
6664
6823
|
const { className, ...rest } = props;
|
|
6665
|
-
const stacked =
|
|
6666
|
-
return
|
|
6824
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6825
|
+
return React44.createElement(
|
|
6667
6826
|
tag,
|
|
6668
6827
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
6669
6828
|
);
|
|
@@ -6676,14 +6835,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
6676
6835
|
TBody.displayName = "TBody";
|
|
6677
6836
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
6678
6837
|
TFoot.displayName = "TFoot";
|
|
6679
|
-
var Tr =
|
|
6838
|
+
var Tr = React44.forwardRef(function Tr2(props, ref) {
|
|
6680
6839
|
const { className, children, ...rest } = props;
|
|
6681
|
-
const stacked =
|
|
6840
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6682
6841
|
let col = 0;
|
|
6683
|
-
return /* @__PURE__ */
|
|
6842
|
+
return /* @__PURE__ */ React44.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat(children).map(function(c) {
|
|
6684
6843
|
const at = col;
|
|
6685
|
-
if (
|
|
6686
|
-
return /* @__PURE__ */
|
|
6844
|
+
if (React44.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
6845
|
+
return /* @__PURE__ */ React44.createElement(ColumnIndex.Provider, { key: React44.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
6687
6846
|
}) : children);
|
|
6688
6847
|
});
|
|
6689
6848
|
function cellClass(base, p) {
|
|
@@ -6697,39 +6856,42 @@ function cellClass(base, p) {
|
|
|
6697
6856
|
p.className
|
|
6698
6857
|
);
|
|
6699
6858
|
}
|
|
6700
|
-
var Th =
|
|
6701
|
-
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6702
|
-
const stacked =
|
|
6703
|
-
return /* @__PURE__ */
|
|
6859
|
+
var Th = React44.forwardRef(function Th2(props, ref) {
|
|
6860
|
+
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
6861
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6862
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6704
6863
|
"th",
|
|
6705
6864
|
{
|
|
6706
6865
|
ref,
|
|
6707
6866
|
scope: scope || "col",
|
|
6708
6867
|
className: cellClass("aura-tbl__th", props),
|
|
6709
6868
|
role: stacked ? scope === "row" ? "rowheader" : "columnheader" : void 0,
|
|
6869
|
+
"data-card": stacked && (card === "title" || card === "action") ? card : void 0,
|
|
6710
6870
|
...rest
|
|
6711
6871
|
}
|
|
6712
6872
|
);
|
|
6713
6873
|
});
|
|
6714
|
-
var Td =
|
|
6715
|
-
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6716
|
-
const labels =
|
|
6717
|
-
const
|
|
6718
|
-
|
|
6874
|
+
var Td = React44.forwardRef(function Td2(props, ref) {
|
|
6875
|
+
const { align, numeric, mono, className, scope, label, card, ...rest } = props;
|
|
6876
|
+
const labels = React44.useContext(StackLabels), col = React44.useContext(ColumnIndex);
|
|
6877
|
+
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
6878
|
+
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
6879
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6719
6880
|
"td",
|
|
6720
6881
|
{
|
|
6721
6882
|
ref,
|
|
6722
6883
|
className: cellClass("aura-tbl__td", props),
|
|
6723
6884
|
role: labels ? "cell" : void 0,
|
|
6724
6885
|
"data-label": shown || void 0,
|
|
6886
|
+
"data-card": slot,
|
|
6725
6887
|
...rest
|
|
6726
6888
|
}
|
|
6727
6889
|
);
|
|
6728
6890
|
});
|
|
6729
6891
|
|
|
6730
6892
|
// src/BottomNav.tsx
|
|
6731
|
-
var
|
|
6732
|
-
var BottomNav =
|
|
6893
|
+
var React45 = __toESM(require("react"), 1);
|
|
6894
|
+
var BottomNav = React45.forwardRef(function BottomNav2(props, ref) {
|
|
6733
6895
|
const t = useStrings();
|
|
6734
6896
|
const Link = useLinkComponent(props.linkComponent);
|
|
6735
6897
|
const st = useMaybeControlled(
|
|
@@ -6739,14 +6901,14 @@ var BottomNav = React44.forwardRef(function BottomNav2(props, ref) {
|
|
|
6739
6901
|
);
|
|
6740
6902
|
const active = st[0];
|
|
6741
6903
|
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
6742
|
-
return /* @__PURE__ */
|
|
6904
|
+
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(
|
|
6743
6905
|
"nav",
|
|
6744
6906
|
{
|
|
6745
6907
|
ref,
|
|
6746
6908
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
6747
6909
|
"aria-label": props.label || t.mainNav
|
|
6748
6910
|
},
|
|
6749
|
-
/* @__PURE__ */
|
|
6911
|
+
/* @__PURE__ */ React45.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
6750
6912
|
const on = active === it.id;
|
|
6751
6913
|
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
6752
6914
|
const suffix = count || it.badge && it.badgeLabel ? " (" + (count || it.badgeLabel) + ")" : "";
|
|
@@ -6762,19 +6924,19 @@ var BottomNav = React44.forwardRef(function BottomNav2(props, ref) {
|
|
|
6762
6924
|
}
|
|
6763
6925
|
};
|
|
6764
6926
|
const inner = [
|
|
6765
|
-
/* @__PURE__ */
|
|
6766
|
-
/* @__PURE__ */
|
|
6767
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
6927
|
+
/* @__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),
|
|
6928
|
+
/* @__PURE__ */ React45.createElement("span", { key: "l", className: "aura-bottomnav__label" }, it.label),
|
|
6929
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React45.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
6768
6930
|
];
|
|
6769
|
-
return /* @__PURE__ */
|
|
6931
|
+
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));
|
|
6770
6932
|
}))
|
|
6771
6933
|
));
|
|
6772
6934
|
});
|
|
6773
6935
|
|
|
6774
6936
|
// src/Surface.tsx
|
|
6775
|
-
var
|
|
6776
|
-
var h8 =
|
|
6777
|
-
var Surface =
|
|
6937
|
+
var React46 = __toESM(require("react"), 1);
|
|
6938
|
+
var h8 = React46.createElement;
|
|
6939
|
+
var Surface = React46.forwardRef(function Surface2(props, ref) {
|
|
6778
6940
|
const t = props.texture || "mesh";
|
|
6779
6941
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
6780
6942
|
return h8(
|
|
@@ -6795,8 +6957,8 @@ var Surface = React45.forwardRef(function Surface2(props, ref) {
|
|
|
6795
6957
|
});
|
|
6796
6958
|
|
|
6797
6959
|
// src/Stat.tsx
|
|
6798
|
-
var
|
|
6799
|
-
var Stat =
|
|
6960
|
+
var React47 = __toESM(require("react"), 1);
|
|
6961
|
+
var Stat = React47.forwardRef(function Stat2(props, ref) {
|
|
6800
6962
|
const ch = props.change;
|
|
6801
6963
|
const dir = ch && (ch.direction || "flat");
|
|
6802
6964
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -6805,7 +6967,7 @@ var Stat = React46.forwardRef(function Stat2(props, ref) {
|
|
|
6805
6967
|
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, ""));
|
|
6806
6968
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
6807
6969
|
const interactive = !!(props.href || props.onClick);
|
|
6808
|
-
return /* @__PURE__ */
|
|
6970
|
+
return /* @__PURE__ */ React47.createElement(
|
|
6809
6971
|
Tag3,
|
|
6810
6972
|
{
|
|
6811
6973
|
ref,
|
|
@@ -6815,20 +6977,20 @@ var Stat = React46.forwardRef(function Stat2(props, ref) {
|
|
|
6815
6977
|
type: Tag3 === "button" ? "button" : void 0,
|
|
6816
6978
|
"aria-busy": props.loading || void 0
|
|
6817
6979
|
},
|
|
6818
|
-
/* @__PURE__ */
|
|
6819
|
-
props.loading ? /* @__PURE__ */
|
|
6820
|
-
ch && !props.loading || props.caption ? /* @__PURE__ */
|
|
6980
|
+
/* @__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),
|
|
6981
|
+
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),
|
|
6982
|
+
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(
|
|
6821
6983
|
Icon,
|
|
6822
6984
|
{
|
|
6823
|
-
name: dir === "up" ? /* @__PURE__ */
|
|
6985
|
+
name: dir === "up" ? /* @__PURE__ */ React47.createElement(IconTrendingUp, null) : dir === "down" ? /* @__PURE__ */ React47.createElement(IconTrendingDown, null) : /* @__PURE__ */ React47.createElement(IconMinus, null),
|
|
6824
6986
|
size: 14
|
|
6825
6987
|
}
|
|
6826
|
-
), /* @__PURE__ */
|
|
6988
|
+
), /* @__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
|
|
6827
6989
|
);
|
|
6828
6990
|
});
|
|
6829
6991
|
|
|
6830
6992
|
// src/TimePicker.tsx
|
|
6831
|
-
var
|
|
6993
|
+
var React48 = __toESM(require("react"), 1);
|
|
6832
6994
|
var import_react_dom11 = require("react-dom");
|
|
6833
6995
|
|
|
6834
6996
|
// src/text.ts
|
|
@@ -6870,7 +7032,7 @@ function toMin(t) {
|
|
|
6870
7032
|
function fromMin(n3) {
|
|
6871
7033
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
6872
7034
|
}
|
|
6873
|
-
var TimePicker =
|
|
7035
|
+
var TimePicker = React48.forwardRef(function TimePicker2(props, ref) {
|
|
6874
7036
|
const t = useStrings();
|
|
6875
7037
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
6876
7038
|
const st = useMaybeControlled(
|
|
@@ -6880,7 +7042,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6880
7042
|
);
|
|
6881
7043
|
const value = st[0];
|
|
6882
7044
|
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;
|
|
6883
|
-
const slots =
|
|
7045
|
+
const slots = React48.useMemo(
|
|
6884
7046
|
function() {
|
|
6885
7047
|
const out = [];
|
|
6886
7048
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -6892,12 +7054,12 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6892
7054
|
const n3 = toMin(v);
|
|
6893
7055
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
6894
7056
|
}
|
|
6895
|
-
const openState =
|
|
6896
|
-
const editState =
|
|
6897
|
-
const aState =
|
|
6898
|
-
const errState =
|
|
6899
|
-
const pos =
|
|
6900
|
-
const boxRef =
|
|
7057
|
+
const openState = React48.useState(false), open = openState[0], setOpen = openState[1];
|
|
7058
|
+
const editState = React48.useState(null), editing = editState[0], setEditing = editState[1];
|
|
7059
|
+
const aState = React48.useState(0), active = aState[0], setActive = aState[1];
|
|
7060
|
+
const errState = React48.useState(null);
|
|
7061
|
+
const pos = React48.useState(null);
|
|
7062
|
+
const boxRef = React48.useRef(null), inputRef = React48.useRef(null), listRef = React48.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
6901
7063
|
const mounted = useMounted();
|
|
6902
7064
|
function nearest(v) {
|
|
6903
7065
|
const n3 = toMin(v);
|
|
@@ -6925,7 +7087,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6925
7087
|
},
|
|
6926
7088
|
[open]
|
|
6927
7089
|
);
|
|
6928
|
-
|
|
7090
|
+
React48.useEffect(
|
|
6929
7091
|
function() {
|
|
6930
7092
|
if (!open) return;
|
|
6931
7093
|
function outside(e) {
|
|
@@ -6947,7 +7109,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6947
7109
|
},
|
|
6948
7110
|
[open]
|
|
6949
7111
|
);
|
|
6950
|
-
|
|
7112
|
+
React48.useEffect(
|
|
6951
7113
|
function() {
|
|
6952
7114
|
if (!open || !listRef.current) return;
|
|
6953
7115
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -7046,9 +7208,9 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7046
7208
|
}
|
|
7047
7209
|
const error = errState[0] || props.error;
|
|
7048
7210
|
const list = open && mounted && pos[0] ? (0, import_react_dom11.createPortal)(
|
|
7049
|
-
/* @__PURE__ */
|
|
7211
|
+
/* @__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) {
|
|
7050
7212
|
const dis = blocked(s), sel = s === value;
|
|
7051
|
-
return /* @__PURE__ */
|
|
7213
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7052
7214
|
"li",
|
|
7053
7215
|
{
|
|
7054
7216
|
key: s,
|
|
@@ -7073,13 +7235,13 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7073
7235
|
if (active !== i) setActive(i);
|
|
7074
7236
|
}
|
|
7075
7237
|
},
|
|
7076
|
-
/* @__PURE__ */
|
|
7077
|
-
sel ? /* @__PURE__ */
|
|
7238
|
+
/* @__PURE__ */ React48.createElement("span", { className: "aura-combo__label" }, s),
|
|
7239
|
+
sel ? /* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
7078
7240
|
);
|
|
7079
7241
|
}))),
|
|
7080
7242
|
document.body
|
|
7081
7243
|
) : null;
|
|
7082
|
-
return /* @__PURE__ */
|
|
7244
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7083
7245
|
Field,
|
|
7084
7246
|
{
|
|
7085
7247
|
id,
|
|
@@ -7091,7 +7253,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7091
7253
|
disabled: props.disabled,
|
|
7092
7254
|
className: props.className
|
|
7093
7255
|
},
|
|
7094
|
-
/* @__PURE__ */
|
|
7256
|
+
/* @__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(
|
|
7095
7257
|
"input",
|
|
7096
7258
|
{
|
|
7097
7259
|
ref: inputMerged,
|
|
@@ -7131,7 +7293,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7131
7293
|
}, 0);
|
|
7132
7294
|
}
|
|
7133
7295
|
}
|
|
7134
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
7296
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React48.createElement(
|
|
7135
7297
|
"button",
|
|
7136
7298
|
{
|
|
7137
7299
|
type: "button",
|
|
@@ -7144,8 +7306,8 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7144
7306
|
if (inputRef.current) inputRef.current.focus();
|
|
7145
7307
|
}
|
|
7146
7308
|
},
|
|
7147
|
-
/* @__PURE__ */
|
|
7148
|
-
) : null, /* @__PURE__ */
|
|
7309
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconX, null) })
|
|
7310
|
+
) : null, /* @__PURE__ */ React48.createElement(
|
|
7149
7311
|
"button",
|
|
7150
7312
|
{
|
|
7151
7313
|
type: "button",
|
|
@@ -7163,14 +7325,14 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7163
7325
|
}
|
|
7164
7326
|
}
|
|
7165
7327
|
},
|
|
7166
|
-
/* @__PURE__ */
|
|
7328
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconChevronDown, null) })
|
|
7167
7329
|
)),
|
|
7168
7330
|
list
|
|
7169
7331
|
);
|
|
7170
7332
|
});
|
|
7171
7333
|
|
|
7172
7334
|
// src/FileUpload.tsx
|
|
7173
|
-
var
|
|
7335
|
+
var React49 = __toESM(require("react"), 1);
|
|
7174
7336
|
function matches(file, accept) {
|
|
7175
7337
|
if (!accept) return true;
|
|
7176
7338
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -7194,24 +7356,24 @@ function describeAccept(accept, t) {
|
|
|
7194
7356
|
}).join(", ");
|
|
7195
7357
|
}
|
|
7196
7358
|
var seq = 0;
|
|
7197
|
-
var FileUpload =
|
|
7359
|
+
var FileUpload = React49.forwardRef(function FileUpload2(props, ref) {
|
|
7198
7360
|
const t = useStrings();
|
|
7199
7361
|
const auto = uid(), id = props.id || auto;
|
|
7200
7362
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
7201
7363
|
const items2 = st[0] || [];
|
|
7202
|
-
const dragState =
|
|
7203
|
-
const inputRef =
|
|
7204
|
-
const urls =
|
|
7364
|
+
const dragState = React49.useState(false), over = dragState[0];
|
|
7365
|
+
const inputRef = React49.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
7366
|
+
const urls = React49.useRef({});
|
|
7205
7367
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
7206
7368
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
7207
|
-
|
|
7369
|
+
React49.useEffect(function() {
|
|
7208
7370
|
return function() {
|
|
7209
7371
|
Object.keys(urls.current).forEach(function(k) {
|
|
7210
7372
|
URL.revokeObjectURL(urls.current[k]);
|
|
7211
7373
|
});
|
|
7212
7374
|
};
|
|
7213
7375
|
}, []);
|
|
7214
|
-
|
|
7376
|
+
React49.useEffect(
|
|
7215
7377
|
function() {
|
|
7216
7378
|
const el = inputRef.current;
|
|
7217
7379
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -7271,7 +7433,7 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7271
7433
|
if (inputRef.current) inputRef.current.focus();
|
|
7272
7434
|
}
|
|
7273
7435
|
const error = props.error;
|
|
7274
|
-
return /* @__PURE__ */
|
|
7436
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7275
7437
|
Field,
|
|
7276
7438
|
{
|
|
7277
7439
|
id,
|
|
@@ -7283,7 +7445,7 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7283
7445
|
disabled: props.disabled,
|
|
7284
7446
|
className: props.className
|
|
7285
7447
|
},
|
|
7286
|
-
/* @__PURE__ */
|
|
7448
|
+
/* @__PURE__ */ React49.createElement(
|
|
7287
7449
|
"div",
|
|
7288
7450
|
{
|
|
7289
7451
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -7304,9 +7466,9 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7304
7466
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
7305
7467
|
}
|
|
7306
7468
|
},
|
|
7307
|
-
/* @__PURE__ */
|
|
7308
|
-
/* @__PURE__ */
|
|
7309
|
-
/* @__PURE__ */
|
|
7469
|
+
/* @__PURE__ */ React49.createElement(Icon, { name: /* @__PURE__ */ React49.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
7470
|
+
/* @__PURE__ */ React49.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
7471
|
+
/* @__PURE__ */ React49.createElement(
|
|
7310
7472
|
"input",
|
|
7311
7473
|
{
|
|
7312
7474
|
ref: inputMerged,
|
|
@@ -7328,12 +7490,12 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7328
7490
|
}
|
|
7329
7491
|
}
|
|
7330
7492
|
),
|
|
7331
|
-
/* @__PURE__ */
|
|
7332
|
-
note ? /* @__PURE__ */
|
|
7493
|
+
/* @__PURE__ */ React49.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
7494
|
+
note ? /* @__PURE__ */ React49.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
7333
7495
|
),
|
|
7334
|
-
items2.length ? /* @__PURE__ */
|
|
7496
|
+
items2.length ? /* @__PURE__ */ React49.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
7335
7497
|
const src = thumb(it);
|
|
7336
|
-
return /* @__PURE__ */
|
|
7498
|
+
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(
|
|
7337
7499
|
"span",
|
|
7338
7500
|
{
|
|
7339
7501
|
className: "aura-upload__bar",
|
|
@@ -7343,11 +7505,11 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7343
7505
|
"aria-valuemax": 100,
|
|
7344
7506
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
7345
7507
|
},
|
|
7346
|
-
/* @__PURE__ */
|
|
7347
|
-
) : null), /* @__PURE__ */
|
|
7508
|
+
/* @__PURE__ */ React49.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
7509
|
+
) : null), /* @__PURE__ */ React49.createElement(
|
|
7348
7510
|
IconButton,
|
|
7349
7511
|
{
|
|
7350
|
-
icon: /* @__PURE__ */
|
|
7512
|
+
icon: /* @__PURE__ */ React49.createElement(IconX, null),
|
|
7351
7513
|
label: t.remove(it.name),
|
|
7352
7514
|
onClick: function() {
|
|
7353
7515
|
remove(it);
|
|
@@ -7632,9 +7794,9 @@ function createTheme(opts) {
|
|
|
7632
7794
|
}
|
|
7633
7795
|
|
|
7634
7796
|
// src/ThemeStyle.tsx
|
|
7635
|
-
var
|
|
7797
|
+
var React50 = __toESM(require("react"), 1);
|
|
7636
7798
|
function ThemeStyle(props) {
|
|
7637
|
-
const css =
|
|
7799
|
+
const css = React50.useMemo(
|
|
7638
7800
|
function() {
|
|
7639
7801
|
try {
|
|
7640
7802
|
return createTheme({
|
|
@@ -7651,11 +7813,11 @@ function ThemeStyle(props) {
|
|
|
7651
7813
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
7652
7814
|
);
|
|
7653
7815
|
if (css === null) return null;
|
|
7654
|
-
return /* @__PURE__ */
|
|
7816
|
+
return /* @__PURE__ */ React50.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
7655
7817
|
}
|
|
7656
7818
|
|
|
7657
7819
|
// src/colorScheme.tsx
|
|
7658
|
-
var
|
|
7820
|
+
var React51 = __toESM(require("react"), 1);
|
|
7659
7821
|
|
|
7660
7822
|
// src/colorSchemeScript.ts
|
|
7661
7823
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -7672,7 +7834,7 @@ function colorSchemeScript(options) {
|
|
|
7672
7834
|
|
|
7673
7835
|
// src/colorScheme.tsx
|
|
7674
7836
|
function ColorSchemeScript(props) {
|
|
7675
|
-
return /* @__PURE__ */
|
|
7837
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7676
7838
|
"script",
|
|
7677
7839
|
{
|
|
7678
7840
|
"data-aura-color-scheme": "",
|
|
@@ -7697,7 +7859,7 @@ function apply(scheme) {
|
|
|
7697
7859
|
function useColorScheme(options) {
|
|
7698
7860
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
7699
7861
|
const fallback = options && options.defaultScheme || "system";
|
|
7700
|
-
const subscribe2 =
|
|
7862
|
+
const subscribe2 = React51.useCallback(
|
|
7701
7863
|
function(cb) {
|
|
7702
7864
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
7703
7865
|
function onSystem() {
|
|
@@ -7719,7 +7881,7 @@ function useColorScheme(options) {
|
|
|
7719
7881
|
},
|
|
7720
7882
|
[fallback, key]
|
|
7721
7883
|
);
|
|
7722
|
-
const snapshot =
|
|
7884
|
+
const snapshot = React51.useSyncExternalStore(
|
|
7723
7885
|
subscribe2,
|
|
7724
7886
|
function() {
|
|
7725
7887
|
const s = readScheme(fallback);
|
|
@@ -7730,7 +7892,7 @@ function useColorScheme(options) {
|
|
|
7730
7892
|
}
|
|
7731
7893
|
);
|
|
7732
7894
|
const parts = snapshot.split("|");
|
|
7733
|
-
const setScheme =
|
|
7895
|
+
const setScheme = React51.useCallback(
|
|
7734
7896
|
function(next) {
|
|
7735
7897
|
if (!valid(next)) return;
|
|
7736
7898
|
try {
|
|
@@ -7749,14 +7911,14 @@ function ColorSchemeToggle(props) {
|
|
|
7749
7911
|
const cs = useColorScheme(props);
|
|
7750
7912
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
7751
7913
|
const label = props.label || t.colorScheme;
|
|
7752
|
-
return /* @__PURE__ */
|
|
7914
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7753
7915
|
DropdownMenu,
|
|
7754
7916
|
{
|
|
7755
7917
|
label,
|
|
7756
|
-
trigger: /* @__PURE__ */
|
|
7918
|
+
trigger: /* @__PURE__ */ React51.createElement(
|
|
7757
7919
|
IconButton,
|
|
7758
7920
|
{
|
|
7759
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
7921
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React51.createElement(IconMoon, null) : /* @__PURE__ */ React51.createElement(IconSun, null),
|
|
7760
7922
|
label: label + ": " + names[cs.scheme]
|
|
7761
7923
|
}
|
|
7762
7924
|
),
|
|
@@ -7774,19 +7936,19 @@ function ColorSchemeToggle(props) {
|
|
|
7774
7936
|
}
|
|
7775
7937
|
|
|
7776
7938
|
// src/Badge.tsx
|
|
7777
|
-
var
|
|
7778
|
-
var Badge =
|
|
7939
|
+
var React52 = __toESM(require("react"), 1);
|
|
7940
|
+
var Badge = React52.forwardRef(function Badge2(props, ref) {
|
|
7779
7941
|
return badgeElement(props, ref);
|
|
7780
7942
|
});
|
|
7781
7943
|
|
|
7782
7944
|
// src/Progress.tsx
|
|
7783
|
-
var
|
|
7784
|
-
var Progress =
|
|
7945
|
+
var React53 = __toESM(require("react"), 1);
|
|
7946
|
+
var Progress = React53.forwardRef(function Progress2(props, ref) {
|
|
7785
7947
|
const auto = uid(), id = props.id || auto;
|
|
7786
7948
|
const max = props.max || 100, det = props.value != null;
|
|
7787
7949
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
7788
7950
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
7789
|
-
return /* @__PURE__ */
|
|
7951
|
+
return /* @__PURE__ */ React53.createElement(
|
|
7790
7952
|
"div",
|
|
7791
7953
|
{
|
|
7792
7954
|
ref,
|
|
@@ -7797,8 +7959,8 @@ var Progress = React52.forwardRef(function Progress2(props, ref) {
|
|
|
7797
7959
|
props.className
|
|
7798
7960
|
)
|
|
7799
7961
|
},
|
|
7800
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
7801
|
-
/* @__PURE__ */
|
|
7962
|
+
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,
|
|
7963
|
+
/* @__PURE__ */ React53.createElement(
|
|
7802
7964
|
"div",
|
|
7803
7965
|
{
|
|
7804
7966
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -7810,21 +7972,21 @@ var Progress = React52.forwardRef(function Progress2(props, ref) {
|
|
|
7810
7972
|
"aria-valuenow": det ? props.value : void 0,
|
|
7811
7973
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
7812
7974
|
},
|
|
7813
|
-
/* @__PURE__ */
|
|
7975
|
+
/* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
7814
7976
|
),
|
|
7815
|
-
props.hint ? /* @__PURE__ */
|
|
7977
|
+
props.hint ? /* @__PURE__ */ React53.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
7816
7978
|
);
|
|
7817
7979
|
});
|
|
7818
7980
|
|
|
7819
7981
|
// src/Skeleton.tsx
|
|
7820
|
-
var
|
|
7821
|
-
var Skeleton =
|
|
7982
|
+
var React54 = __toESM(require("react"), 1);
|
|
7983
|
+
var Skeleton = React54.forwardRef(function Skeleton2(props, ref) {
|
|
7822
7984
|
const v = props.variant || "text";
|
|
7823
7985
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
7824
7986
|
const n3 = props.lines, rows = [];
|
|
7825
7987
|
for (let i = 0; i < n3; i++)
|
|
7826
|
-
rows.push(/* @__PURE__ */
|
|
7827
|
-
return /* @__PURE__ */
|
|
7988
|
+
rows.push(/* @__PURE__ */ React54.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
7989
|
+
return /* @__PURE__ */ React54.createElement(
|
|
7828
7990
|
"span",
|
|
7829
7991
|
{
|
|
7830
7992
|
ref,
|
|
@@ -7842,17 +8004,17 @@ var Skeleton = React53.forwardRef(function Skeleton2(props, ref) {
|
|
|
7842
8004
|
if (v === "circle") {
|
|
7843
8005
|
style.width = style.height = props.size || props.width || 40;
|
|
7844
8006
|
}
|
|
7845
|
-
return /* @__PURE__ */
|
|
8007
|
+
return /* @__PURE__ */ React54.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
7846
8008
|
});
|
|
7847
8009
|
|
|
7848
8010
|
// src/EmptyState.tsx
|
|
7849
|
-
var
|
|
7850
|
-
var EmptyState =
|
|
8011
|
+
var React55 = __toESM(require("react"), 1);
|
|
8012
|
+
var EmptyState = React55.forwardRef(function EmptyState2(props, ref) {
|
|
7851
8013
|
return emptyStateElement(props, ref);
|
|
7852
8014
|
});
|
|
7853
8015
|
|
|
7854
8016
|
// src/Pagination.tsx
|
|
7855
|
-
var
|
|
8017
|
+
var React56 = __toESM(require("react"), 1);
|
|
7856
8018
|
function pageList(page, count, sib) {
|
|
7857
8019
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
7858
8020
|
if (page - sib <= 3) {
|
|
@@ -7872,7 +8034,7 @@ function pageList(page, count, sib) {
|
|
|
7872
8034
|
if (count > 1) out.push(count);
|
|
7873
8035
|
return out;
|
|
7874
8036
|
}
|
|
7875
|
-
var Pagination =
|
|
8037
|
+
var Pagination = React56.forwardRef(function Pagination2(props, ref) {
|
|
7876
8038
|
const t = useStrings();
|
|
7877
8039
|
const count = Math.max(1, props.pageCount || 1);
|
|
7878
8040
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -7891,7 +8053,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7891
8053
|
},
|
|
7892
8054
|
extra
|
|
7893
8055
|
);
|
|
7894
|
-
return link ? /* @__PURE__ */
|
|
8056
|
+
return link ? /* @__PURE__ */ React56.createElement(
|
|
7895
8057
|
Link,
|
|
7896
8058
|
{
|
|
7897
8059
|
href: link(p),
|
|
@@ -7904,7 +8066,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7904
8066
|
...common
|
|
7905
8067
|
},
|
|
7906
8068
|
label
|
|
7907
|
-
) : /* @__PURE__ */
|
|
8069
|
+
) : /* @__PURE__ */ React56.createElement(
|
|
7908
8070
|
"button",
|
|
7909
8071
|
{
|
|
7910
8072
|
type: "button",
|
|
@@ -7918,7 +8080,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7918
8080
|
}
|
|
7919
8081
|
function arrow(p, icon, label, rel, disabled) {
|
|
7920
8082
|
if (!link || disabled)
|
|
7921
|
-
return /* @__PURE__ */
|
|
8083
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7922
8084
|
IconButton,
|
|
7923
8085
|
{
|
|
7924
8086
|
icon,
|
|
@@ -7929,7 +8091,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7929
8091
|
}
|
|
7930
8092
|
}
|
|
7931
8093
|
);
|
|
7932
|
-
return /* @__PURE__ */
|
|
8094
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7933
8095
|
Link,
|
|
7934
8096
|
{
|
|
7935
8097
|
href: link(p),
|
|
@@ -7944,17 +8106,17 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7944
8106
|
}
|
|
7945
8107
|
}
|
|
7946
8108
|
},
|
|
7947
|
-
/* @__PURE__ */
|
|
8109
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: icon, size: "sm" })
|
|
7948
8110
|
);
|
|
7949
8111
|
}
|
|
7950
|
-
return /* @__PURE__ */
|
|
7951
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
7952
|
-
})), /* @__PURE__ */
|
|
8112
|
+
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) {
|
|
8113
|
+
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");
|
|
8114
|
+
})), /* @__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));
|
|
7953
8115
|
});
|
|
7954
8116
|
|
|
7955
8117
|
// src/Accordion.tsx
|
|
7956
|
-
var
|
|
7957
|
-
var Accordion =
|
|
8118
|
+
var React57 = __toESM(require("react"), 1);
|
|
8119
|
+
var Accordion = React57.forwardRef(function Accordion2(props, ref) {
|
|
7958
8120
|
const auto = uid(), base = props.id || auto;
|
|
7959
8121
|
const multiple = props.type === "multiple";
|
|
7960
8122
|
const st = useMaybeControlled(
|
|
@@ -7992,9 +8154,9 @@ var Accordion = React56.forwardRef(function Accordion2(props, ref) {
|
|
|
7992
8154
|
n3.focus();
|
|
7993
8155
|
}
|
|
7994
8156
|
}
|
|
7995
|
-
return /* @__PURE__ */
|
|
8157
|
+
return /* @__PURE__ */ React57.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
7996
8158
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
7997
|
-
return /* @__PURE__ */
|
|
8159
|
+
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(
|
|
7998
8160
|
"button",
|
|
7999
8161
|
{
|
|
8000
8162
|
type: "button",
|
|
@@ -8006,15 +8168,15 @@ var Accordion = React56.forwardRef(function Accordion2(props, ref) {
|
|
|
8006
8168
|
toggle(it.id);
|
|
8007
8169
|
}
|
|
8008
8170
|
},
|
|
8009
|
-
it.icon ? /* @__PURE__ */
|
|
8010
|
-
/* @__PURE__ */
|
|
8011
|
-
/* @__PURE__ */
|
|
8012
|
-
)), /* @__PURE__ */
|
|
8171
|
+
it.icon ? /* @__PURE__ */ React57.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
8172
|
+
/* @__PURE__ */ React57.createElement("span", { className: "aura-accordion__title" }, it.title, it.description ? /* @__PURE__ */ React57.createElement("span", { className: "aura-accordion__desc" }, it.description) : null),
|
|
8173
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
8174
|
+
)), /* @__PURE__ */ React57.createElement("div", { id: pid, role: "region", "aria-labelledby": bid, className: "aura-accordion__panel", hidden: !on }, it.content));
|
|
8013
8175
|
}));
|
|
8014
8176
|
});
|
|
8015
8177
|
|
|
8016
8178
|
// src/Popover.tsx
|
|
8017
|
-
var
|
|
8179
|
+
var React58 = __toESM(require("react"), 1);
|
|
8018
8180
|
var import_react_dom12 = require("react-dom");
|
|
8019
8181
|
function position(anchor, pop, placement) {
|
|
8020
8182
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -8032,15 +8194,15 @@ function position(anchor, pop, placement) {
|
|
|
8032
8194
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
8033
8195
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
8034
8196
|
}
|
|
8035
|
-
var Popover =
|
|
8197
|
+
var Popover = React58.forwardRef(function Popover2(props, ref) {
|
|
8036
8198
|
const t = useStrings();
|
|
8037
8199
|
const density = useDensity();
|
|
8038
8200
|
const auto = uid(), id = props.id || auto;
|
|
8039
8201
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
8040
8202
|
const open = !!st[0];
|
|
8041
|
-
const wrap =
|
|
8042
|
-
const pos =
|
|
8043
|
-
const inTree =
|
|
8203
|
+
const wrap = React58.useRef(null), pop = React58.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
8204
|
+
const pos = React58.useState(null), mounted = useMounted();
|
|
8205
|
+
const inTree = React58.useRef(false);
|
|
8044
8206
|
function trigger() {
|
|
8045
8207
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
8046
8208
|
}
|
|
@@ -8067,7 +8229,7 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8067
8229
|
},
|
|
8068
8230
|
[open, mounted, props.placement]
|
|
8069
8231
|
);
|
|
8070
|
-
|
|
8232
|
+
React58.useEffect(
|
|
8071
8233
|
function() {
|
|
8072
8234
|
if (!open || !mounted) return;
|
|
8073
8235
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -8092,9 +8254,9 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8092
8254
|
},
|
|
8093
8255
|
[open, mounted]
|
|
8094
8256
|
);
|
|
8095
|
-
const child =
|
|
8257
|
+
const child = React58.Children.only(props.trigger);
|
|
8096
8258
|
const panel = open && mounted ? (0, import_react_dom12.createPortal)(
|
|
8097
|
-
/* @__PURE__ */
|
|
8259
|
+
/* @__PURE__ */ React58.createElement(
|
|
8098
8260
|
"div",
|
|
8099
8261
|
{
|
|
8100
8262
|
ref: popMerged,
|
|
@@ -8124,17 +8286,17 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8124
8286
|
} else trapTab(e, pop.current);
|
|
8125
8287
|
}
|
|
8126
8288
|
},
|
|
8127
|
-
props.title ? /* @__PURE__ */
|
|
8289
|
+
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(
|
|
8128
8290
|
IconButton,
|
|
8129
8291
|
{
|
|
8130
|
-
icon: /* @__PURE__ */
|
|
8292
|
+
icon: /* @__PURE__ */ React58.createElement(IconX, null),
|
|
8131
8293
|
label: t.close,
|
|
8132
8294
|
onClick: function() {
|
|
8133
8295
|
close(true);
|
|
8134
8296
|
}
|
|
8135
8297
|
}
|
|
8136
8298
|
)) : null,
|
|
8137
|
-
/* @__PURE__ */
|
|
8299
|
+
/* @__PURE__ */ React58.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
8138
8300
|
close: function() {
|
|
8139
8301
|
close(true);
|
|
8140
8302
|
}
|
|
@@ -8142,7 +8304,7 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8142
8304
|
),
|
|
8143
8305
|
document.body
|
|
8144
8306
|
) : null;
|
|
8145
|
-
return /* @__PURE__ */
|
|
8307
|
+
return /* @__PURE__ */ React58.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React58.cloneElement(child, {
|
|
8146
8308
|
onClick: function(e) {
|
|
8147
8309
|
if (child.props.onClick) child.props.onClick(e);
|
|
8148
8310
|
st[1](!open);
|
|
@@ -8154,7 +8316,7 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8154
8316
|
});
|
|
8155
8317
|
|
|
8156
8318
|
// src/NumberField.tsx
|
|
8157
|
-
var
|
|
8319
|
+
var React59 = __toESM(require("react"), 1);
|
|
8158
8320
|
function decimalsOf(n3) {
|
|
8159
8321
|
const s = String(n3);
|
|
8160
8322
|
const i = s.indexOf(".");
|
|
@@ -8167,7 +8329,7 @@ function parse(text2) {
|
|
|
8167
8329
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
8168
8330
|
return Number(s);
|
|
8169
8331
|
}
|
|
8170
|
-
var NumberField =
|
|
8332
|
+
var NumberField = React59.forwardRef(function NumberField2(props, ref) {
|
|
8171
8333
|
const t = useStrings();
|
|
8172
8334
|
const auto = uid(), id = props.id || auto;
|
|
8173
8335
|
const step = props.step || 1;
|
|
@@ -8178,7 +8340,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8178
8340
|
props.onChange
|
|
8179
8341
|
);
|
|
8180
8342
|
const value = st[0], setValue = st[1];
|
|
8181
|
-
const draftState =
|
|
8343
|
+
const draftState = React59.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
8182
8344
|
function fmt2(n3) {
|
|
8183
8345
|
if (n3 == null || isNaN(n3)) return "";
|
|
8184
8346
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -8227,7 +8389,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8227
8389
|
};
|
|
8228
8390
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
8229
8391
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
8230
|
-
return /* @__PURE__ */
|
|
8392
|
+
return /* @__PURE__ */ React59.createElement(
|
|
8231
8393
|
Field,
|
|
8232
8394
|
{
|
|
8233
8395
|
id,
|
|
@@ -8239,7 +8401,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8239
8401
|
disabled: props.disabled,
|
|
8240
8402
|
className: props.className
|
|
8241
8403
|
},
|
|
8242
|
-
/* @__PURE__ */
|
|
8404
|
+
/* @__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(
|
|
8243
8405
|
"input",
|
|
8244
8406
|
{
|
|
8245
8407
|
ref,
|
|
@@ -8286,7 +8448,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8286
8448
|
},
|
|
8287
8449
|
onKeyDown
|
|
8288
8450
|
}
|
|
8289
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
8451
|
+
), 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(
|
|
8290
8452
|
"button",
|
|
8291
8453
|
{
|
|
8292
8454
|
type: "button",
|
|
@@ -8302,8 +8464,8 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8302
8464
|
nudge(-step);
|
|
8303
8465
|
}
|
|
8304
8466
|
},
|
|
8305
|
-
/* @__PURE__ */
|
|
8306
|
-
), /* @__PURE__ */
|
|
8467
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconMinus, null) })
|
|
8468
|
+
), /* @__PURE__ */ React59.createElement(
|
|
8307
8469
|
"button",
|
|
8308
8470
|
{
|
|
8309
8471
|
type: "button",
|
|
@@ -8319,14 +8481,14 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8319
8481
|
nudge(step);
|
|
8320
8482
|
}
|
|
8321
8483
|
},
|
|
8322
|
-
/* @__PURE__ */
|
|
8484
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconPlus, null) })
|
|
8323
8485
|
)) : null)
|
|
8324
8486
|
);
|
|
8325
8487
|
});
|
|
8326
8488
|
|
|
8327
8489
|
// src/Stepper.tsx
|
|
8328
|
-
var
|
|
8329
|
-
var Stepper =
|
|
8490
|
+
var React60 = __toESM(require("react"), 1);
|
|
8491
|
+
var Stepper = React60.forwardRef(function Stepper2(props, ref) {
|
|
8330
8492
|
const t = useStrings();
|
|
8331
8493
|
const steps = props.steps || [];
|
|
8332
8494
|
let at = -1;
|
|
@@ -8336,26 +8498,26 @@ var Stepper = React59.forwardRef(function Stepper2(props, ref) {
|
|
|
8336
8498
|
if (at < 0) at = 0;
|
|
8337
8499
|
const vertical = props.orientation === "vertical";
|
|
8338
8500
|
const cur = steps[at];
|
|
8339
|
-
return /* @__PURE__ */
|
|
8501
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8340
8502
|
"nav",
|
|
8341
8503
|
{
|
|
8342
8504
|
ref,
|
|
8343
8505
|
"aria-label": props.label,
|
|
8344
8506
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
8345
8507
|
},
|
|
8346
|
-
/* @__PURE__ */
|
|
8508
|
+
/* @__PURE__ */ React60.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
8347
8509
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
8348
|
-
const marker = /* @__PURE__ */
|
|
8349
|
-
const text2 = /* @__PURE__ */
|
|
8510
|
+
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);
|
|
8511
|
+
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);
|
|
8350
8512
|
const clickable = state === "done" && !!props.onStepClick;
|
|
8351
|
-
return /* @__PURE__ */
|
|
8513
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8352
8514
|
"li",
|
|
8353
8515
|
{
|
|
8354
8516
|
key: s.id,
|
|
8355
8517
|
className: cx("aura-stepper__item", "is-" + state),
|
|
8356
8518
|
"aria-current": state === "current" ? "step" : void 0
|
|
8357
8519
|
},
|
|
8358
|
-
clickable ? /* @__PURE__ */
|
|
8520
|
+
clickable ? /* @__PURE__ */ React60.createElement(
|
|
8359
8521
|
"button",
|
|
8360
8522
|
{
|
|
8361
8523
|
type: "button",
|
|
@@ -8366,19 +8528,19 @@ var Stepper = React59.forwardRef(function Stepper2(props, ref) {
|
|
|
8366
8528
|
},
|
|
8367
8529
|
marker,
|
|
8368
8530
|
text2
|
|
8369
|
-
) : /* @__PURE__ */
|
|
8531
|
+
) : /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
8370
8532
|
);
|
|
8371
8533
|
})),
|
|
8372
|
-
!vertical && cur ? /* @__PURE__ */
|
|
8534
|
+
!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
|
|
8373
8535
|
);
|
|
8374
8536
|
});
|
|
8375
8537
|
|
|
8376
8538
|
// src/SegmentedControl.tsx
|
|
8377
|
-
var
|
|
8539
|
+
var React61 = __toESM(require("react"), 1);
|
|
8378
8540
|
function toOpt2(o) {
|
|
8379
8541
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
8380
8542
|
}
|
|
8381
|
-
var SegmentedControl =
|
|
8543
|
+
var SegmentedControl = React61.forwardRef(
|
|
8382
8544
|
function SegmentedControl2(props, ref) {
|
|
8383
8545
|
const options = (props.options || []).map(toOpt2);
|
|
8384
8546
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -8391,7 +8553,7 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8391
8553
|
);
|
|
8392
8554
|
const value = st[0], setValue = st[1];
|
|
8393
8555
|
const auto = uid(), id = props.id || auto;
|
|
8394
|
-
const refs =
|
|
8556
|
+
const refs = React61.useRef([]);
|
|
8395
8557
|
const selIdx = options.findIndex(function(o) {
|
|
8396
8558
|
return o.value === value;
|
|
8397
8559
|
});
|
|
@@ -8424,7 +8586,7 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8424
8586
|
move(options.length, -1);
|
|
8425
8587
|
}
|
|
8426
8588
|
}
|
|
8427
|
-
return /* @__PURE__ */
|
|
8589
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8428
8590
|
"div",
|
|
8429
8591
|
{
|
|
8430
8592
|
ref,
|
|
@@ -8443,7 +8605,7 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8443
8605
|
options.map(function(o, i) {
|
|
8444
8606
|
const on = o.value === value;
|
|
8445
8607
|
const off = props.disabled || o.disabled;
|
|
8446
|
-
return /* @__PURE__ */
|
|
8608
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8447
8609
|
"button",
|
|
8448
8610
|
{
|
|
8449
8611
|
key: o.value,
|
|
@@ -8465,8 +8627,8 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8465
8627
|
onKeyDown(e, i);
|
|
8466
8628
|
}
|
|
8467
8629
|
},
|
|
8468
|
-
o.icon ? /* @__PURE__ */
|
|
8469
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
8630
|
+
o.icon ? /* @__PURE__ */ React61.createElement(Icon, { name: o.icon }) : null,
|
|
8631
|
+
o.iconOnly ? null : /* @__PURE__ */ React61.createElement("span", null, o.label)
|
|
8470
8632
|
);
|
|
8471
8633
|
})
|
|
8472
8634
|
);
|