@jirawatpyk/aura-react 5.11.0 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -2
- package/dist/aura.bundle.js +667 -592
- package/dist/cjs/index.cjs +666 -591
- package/dist/esm/FilterBar.js +1 -1
- package/dist/esm/FilterSelect.js +17 -0
- package/dist/esm/Select.js +82 -20
- package/dist/esm/index.js +2 -0
- package/dist/index.d.cts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/styles.css +31 -0
- package/dist/styles.layer.css +31 -0
- package/package.json +1 -1
package/dist/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,
|
|
@@ -1636,6 +1637,7 @@ var Textarea = React14.forwardRef(function Textarea2(props, ref) {
|
|
|
1636
1637
|
var React15 = __toESM(require("react"), 1);
|
|
1637
1638
|
var import_react_dom2 = require("react-dom");
|
|
1638
1639
|
var h4 = React15.createElement;
|
|
1640
|
+
var FILTER_KEY = "__auraFilter";
|
|
1639
1641
|
var FORM_KEYS = ["name", "form", "value", "defaultValue", "disabled", "autoComplete", "onInput", "onInvalid"];
|
|
1640
1642
|
var HANDLED_KEYS = FORM_KEYS.concat([
|
|
1641
1643
|
"onChange",
|
|
@@ -1669,20 +1671,49 @@ function readItems(el) {
|
|
|
1669
1671
|
};
|
|
1670
1672
|
});
|
|
1671
1673
|
}
|
|
1672
|
-
function
|
|
1674
|
+
function textOf(n3) {
|
|
1675
|
+
if (n3 == null || typeof n3 === "boolean") return "";
|
|
1676
|
+
if (typeof n3 === "string" || typeof n3 === "number") return String(n3);
|
|
1677
|
+
if (Array.isArray(n3)) return n3.map(textOf).join("");
|
|
1678
|
+
return React15.isValidElement(n3) ? textOf(n3.props.children) : "";
|
|
1679
|
+
}
|
|
1680
|
+
function childOptions(children, off) {
|
|
1681
|
+
const out = [];
|
|
1682
|
+
React15.Children.forEach(children, function(c) {
|
|
1683
|
+
if (!React15.isValidElement(c)) return;
|
|
1684
|
+
const p = c.props;
|
|
1685
|
+
if (c.type === "optgroup" || c.type === React15.Fragment)
|
|
1686
|
+
out.push.apply(out, childOptions(p.children, off || c.type === "optgroup" && !!p.disabled));
|
|
1687
|
+
else if (c.type === "option") {
|
|
1688
|
+
const label = textOf(p.children);
|
|
1689
|
+
out.push({ value: p.value != null ? String(p.value) : label, label, disabled: off || !!p.disabled });
|
|
1690
|
+
}
|
|
1691
|
+
});
|
|
1692
|
+
return out;
|
|
1693
|
+
}
|
|
1694
|
+
function initialLabel(props, filter) {
|
|
1673
1695
|
const opts = (props.options || []).map(function(o) {
|
|
1674
1696
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
1675
|
-
});
|
|
1676
|
-
const
|
|
1697
|
+
}).concat(childOptions(props.children));
|
|
1698
|
+
const first = opts.filter(function(o) {
|
|
1699
|
+
return !o.disabled;
|
|
1700
|
+
})[0];
|
|
1701
|
+
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
1702
|
const hit = opts.filter(function(o) {
|
|
1678
1703
|
return o.value === v;
|
|
1679
1704
|
})[0];
|
|
1680
|
-
if (hit)
|
|
1681
|
-
|
|
1705
|
+
if (hit)
|
|
1706
|
+
return {
|
|
1707
|
+
label: filter && filter.allLabel && opts[0] && hit.value === opts[0].value ? filter.allLabel : hit.label,
|
|
1708
|
+
full: hit.label,
|
|
1709
|
+
empty: false
|
|
1710
|
+
};
|
|
1711
|
+
return { label: props.placeholder || "", full: props.placeholder || "", empty: true };
|
|
1682
1712
|
}
|
|
1683
1713
|
var Select = React15.forwardRef(function Select2(props, ref) {
|
|
1684
1714
|
const auto = uid(), id = props.id || auto;
|
|
1685
|
-
const
|
|
1715
|
+
const filter = props[FILTER_KEY];
|
|
1716
|
+
const rest = omit(props, FIELD_KEYS.concat(["children", FILTER_KEY]));
|
|
1686
1717
|
const opts = (props.options || []).map(function(o) {
|
|
1687
1718
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
1688
1719
|
return /* @__PURE__ */ React15.createElement("option", { key: v.value, value: v.value, disabled: v.disabled }, v.label);
|
|
@@ -1697,7 +1728,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1697
1728
|
const live = !native && mounted;
|
|
1698
1729
|
const density = useDensity();
|
|
1699
1730
|
React15.useEffect(function() {
|
|
1700
|
-
if (props.label || props["aria-label"] || props["aria-labelledby"] || props.title) return;
|
|
1731
|
+
if (filter || props.label || props["aria-label"] || props["aria-labelledby"] || props.title) return;
|
|
1701
1732
|
if (document.querySelector('label[for="' + id.replace(/["\\]/g, "\\$&") + '"]')) return;
|
|
1702
1733
|
devWarnOnce(
|
|
1703
1734
|
"select-name",
|
|
@@ -1706,20 +1737,24 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1706
1737
|
}, []);
|
|
1707
1738
|
const selRef = React15.useRef(null), trigRef = React15.useRef(null), listRef = React15.useRef(null);
|
|
1708
1739
|
const shown = React15.useState(function() {
|
|
1709
|
-
return initialLabel(props);
|
|
1740
|
+
return initialLabel(props, filter);
|
|
1710
1741
|
});
|
|
1711
1742
|
const openState = React15.useState(false), open = openState[0];
|
|
1712
1743
|
const activeState = React15.useState(-1), active = activeState[0];
|
|
1713
1744
|
const items2 = React15.useState([]);
|
|
1714
1745
|
const pos = React15.useState(null);
|
|
1715
1746
|
const typed = React15.useRef({ text: "", at: 0 });
|
|
1747
|
+
const allLabel = React15.useRef(void 0);
|
|
1748
|
+
allLabel.current = filter ? filter.allLabel : void 0;
|
|
1716
1749
|
const sync = React15.useCallback(function() {
|
|
1717
1750
|
const el = selRef.current;
|
|
1718
1751
|
if (!el) return;
|
|
1719
1752
|
const o = el.selectedIndex >= 0 ? el.options[el.selectedIndex] : null;
|
|
1720
|
-
const
|
|
1753
|
+
const text2 = o ? o.textContent || "" : "";
|
|
1754
|
+
const short = allLabel.current && el.selectedIndex === 0 ? allLabel.current : text2;
|
|
1755
|
+
const next = o ? { label: short, full: text2, empty: o.value === "" } : { label: "", full: "", empty: true };
|
|
1721
1756
|
shown[1](function(cur) {
|
|
1722
|
-
return cur.label === next.label && cur.empty === next.empty ? cur : next;
|
|
1757
|
+
return cur.label === next.label && cur.full === next.full && cur.empty === next.empty ? cur : next;
|
|
1723
1758
|
});
|
|
1724
1759
|
}, []);
|
|
1725
1760
|
const hook = React15.useCallback(
|
|
@@ -1910,12 +1945,16 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1910
1945
|
const t = trigRef.current && trigRef.current.parentElement;
|
|
1911
1946
|
if (!t) return;
|
|
1912
1947
|
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;
|
|
1948
|
+
const lw = listRef.current ? Math.max(r.width, listRef.current.offsetWidth) : r.width;
|
|
1949
|
+
const rtl = getComputedStyle(t).direction === "rtl";
|
|
1950
|
+
const left = lw <= r.width ? r.left : Math.max(8, Math.min(rtl ? r.right - lw : r.left, window.innerWidth - lw - 8));
|
|
1913
1951
|
pos[1]({
|
|
1914
|
-
left
|
|
1952
|
+
left,
|
|
1915
1953
|
width: r.width,
|
|
1916
1954
|
top: up ? void 0 : r.bottom + 4,
|
|
1917
1955
|
bottom: up ? window.innerHeight - r.top + 4 : void 0,
|
|
1918
|
-
maxHeight: Math.min(320, (up ? above : below2) - 4)
|
|
1956
|
+
maxHeight: Math.min(320, (up ? above : below2) - 4),
|
|
1957
|
+
rtl
|
|
1919
1958
|
});
|
|
1920
1959
|
}
|
|
1921
1960
|
place();
|
|
@@ -1948,7 +1987,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1948
1987
|
[open, active, pos[0] != null]
|
|
1949
1988
|
);
|
|
1950
1989
|
const described = [describedBy(id, props), rest["aria-describedby"]].filter(Boolean).join(" ") || void 0;
|
|
1951
|
-
const field = (child) => /* @__PURE__ */ React15.createElement(
|
|
1990
|
+
const field = (child) => filter ? child : /* @__PURE__ */ React15.createElement(
|
|
1952
1991
|
Field,
|
|
1953
1992
|
{
|
|
1954
1993
|
id,
|
|
@@ -1963,6 +2002,21 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1963
2002
|
},
|
|
1964
2003
|
child
|
|
1965
2004
|
);
|
|
2005
|
+
const nameId = id + "-name";
|
|
2006
|
+
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;
|
|
2007
|
+
if (!live && filter)
|
|
2008
|
+
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(
|
|
2009
|
+
"select",
|
|
2010
|
+
Object.assign(extra, omit(rest, ["style"]), {
|
|
2011
|
+
ref: selMerged,
|
|
2012
|
+
id,
|
|
2013
|
+
className: "aura-filterselect__native",
|
|
2014
|
+
"aria-label": rest["aria-label"] || (rest["aria-labelledby"] ? void 0 : filter.name),
|
|
2015
|
+
"aria-describedby": described
|
|
2016
|
+
}),
|
|
2017
|
+
opts,
|
|
2018
|
+
props.children
|
|
2019
|
+
));
|
|
1966
2020
|
if (!live)
|
|
1967
2021
|
return field(
|
|
1968
2022
|
/* @__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 +2037,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
1983
2037
|
const optId = function(i) {
|
|
1984
2038
|
return id + "-opt-" + i;
|
|
1985
2039
|
};
|
|
1986
|
-
const labelledBy = rest["aria-labelledby"] || (props.label ? labelId : void 0);
|
|
2040
|
+
const labelledBy = rest["aria-labelledby"] || (filter && !rest["aria-label"] ? nameId : props.label ? labelId : void 0);
|
|
1987
2041
|
const selIndex = selRef.current ? selRef.current.selectedIndex : -1;
|
|
1988
2042
|
const option = function(it) {
|
|
1989
2043
|
const sel = selIndex === it.index;
|
|
@@ -2029,6 +2083,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2029
2083
|
{
|
|
2030
2084
|
ref: listRef,
|
|
2031
2085
|
"data-density": density,
|
|
2086
|
+
dir: pos[0] ? pos[0].rtl ? "rtl" : "ltr" : void 0,
|
|
2032
2087
|
className: "aura-combo__popover aura-select__popover",
|
|
2033
2088
|
style: pos[0] ? {
|
|
2034
2089
|
left: pos[0].left,
|
|
@@ -2061,10 +2116,17 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2061
2116
|
/* @__PURE__ */ React15.createElement(
|
|
2062
2117
|
"div",
|
|
2063
2118
|
{
|
|
2064
|
-
className: cx(
|
|
2119
|
+
className: cx(
|
|
2120
|
+
filter ? "aura-filterselect" : "aura-input",
|
|
2121
|
+
"aura-select aura-select--custom",
|
|
2122
|
+
props.icon && "has-icon",
|
|
2123
|
+
open && "is-open",
|
|
2124
|
+
filter && props.disabled && "is-disabled",
|
|
2125
|
+
filter && props.className
|
|
2126
|
+
),
|
|
2065
2127
|
"data-invalid": props.error ? "" : void 0
|
|
2066
2128
|
},
|
|
2067
|
-
props.icon ? /* @__PURE__ */ React15.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null,
|
|
2129
|
+
props.icon && !filter ? /* @__PURE__ */ React15.createElement(Icon, { name: props.icon, className: "aura-input__icon" }) : null,
|
|
2068
2130
|
h4(
|
|
2069
2131
|
"select",
|
|
2070
2132
|
Object.assign(extra, pick(rest, FORM_KEYS), {
|
|
@@ -2098,7 +2160,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2098
2160
|
type: "button",
|
|
2099
2161
|
role: "combobox",
|
|
2100
2162
|
form: id + "-no-form",
|
|
2101
|
-
className: "aura-input__control aura-select__trigger",
|
|
2163
|
+
className: filter ? "aura-select__trigger aura-filterselect__face" : "aura-input__control aura-select__trigger",
|
|
2102
2164
|
disabled: props.disabled,
|
|
2103
2165
|
tabIndex: rest.tabIndex,
|
|
2104
2166
|
"aria-haspopup": "listbox",
|
|
@@ -2107,7 +2169,7 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2107
2169
|
"aria-activedescendant": open && active >= 0 ? optId(active) : void 0,
|
|
2108
2170
|
id,
|
|
2109
2171
|
"aria-label": rest["aria-label"],
|
|
2110
|
-
"aria-labelledby": rest["aria-labelledby"],
|
|
2172
|
+
"aria-labelledby": rest["aria-labelledby"] || (filter && !rest["aria-label"] ? nameId : void 0),
|
|
2111
2173
|
"aria-required": props.required || void 0,
|
|
2112
2174
|
"aria-invalid": props.error ? true : void 0,
|
|
2113
2175
|
"aria-describedby": described,
|
|
@@ -2130,17 +2192,30 @@ var Select = React15.forwardRef(function Select2(props, ref) {
|
|
|
2130
2192
|
if (selRef.current) selRef.current.dispatchEvent(new FocusEvent("focusout", { bubbles: true }));
|
|
2131
2193
|
}
|
|
2132
2194
|
},
|
|
2133
|
-
/* @__PURE__ */ React15.createElement("span", { id: id + "-value", className: cx("aura-select__value", shown[0].empty && "is-placeholder") }, shown[0].label || " ")
|
|
2195
|
+
face || /* @__PURE__ */ React15.createElement("span", { id: id + "-value", className: cx("aura-select__value", shown[0].empty && "is-placeholder") }, shown[0].label || " ")
|
|
2134
2196
|
),
|
|
2135
|
-
/* @__PURE__ */ React15.createElement(Icon, { name: /* @__PURE__ */ React15.createElement(IconChevronDown, null), className: "aura-select__chevron" }),
|
|
2197
|
+
filter ? null : /* @__PURE__ */ React15.createElement(Icon, { name: /* @__PURE__ */ React15.createElement(IconChevronDown, null), className: "aura-select__chevron" }),
|
|
2136
2198
|
popup
|
|
2137
2199
|
)
|
|
2138
2200
|
);
|
|
2139
2201
|
});
|
|
2140
2202
|
|
|
2141
|
-
// src/
|
|
2203
|
+
// src/FilterSelect.tsx
|
|
2142
2204
|
var React16 = __toESM(require("react"), 1);
|
|
2143
|
-
var
|
|
2205
|
+
var FilterSelect = React16.forwardRef(function FilterSelect2(props, ref) {
|
|
2206
|
+
const onChange = props.onChange;
|
|
2207
|
+
const pass = Object.assign(omit(props, ["label", "allLabel", "onChange"]), {
|
|
2208
|
+
[FILTER_KEY]: { name: props.label, allLabel: props.allLabel },
|
|
2209
|
+
onChange: onChange ? function(e) {
|
|
2210
|
+
onChange(e.target.value);
|
|
2211
|
+
} : void 0
|
|
2212
|
+
});
|
|
2213
|
+
return /* @__PURE__ */ React16.createElement(Select, { ...pass, ref });
|
|
2214
|
+
});
|
|
2215
|
+
|
|
2216
|
+
// src/RadioGroup.tsx
|
|
2217
|
+
var React17 = __toESM(require("react"), 1);
|
|
2218
|
+
var RadioGroup = React17.forwardRef(function RadioGroup2(props, ref) {
|
|
2144
2219
|
const auto = uid(), id = props.id || auto;
|
|
2145
2220
|
const st = useMaybeControlled(
|
|
2146
2221
|
props.value,
|
|
@@ -2148,7 +2223,7 @@ var RadioGroup = React16.forwardRef(function RadioGroup2(props, ref) {
|
|
|
2148
2223
|
props.onChange
|
|
2149
2224
|
);
|
|
2150
2225
|
const name = props.name || id;
|
|
2151
|
-
const setRef =
|
|
2226
|
+
const setRef = React17.useCallback(
|
|
2152
2227
|
function(el) {
|
|
2153
2228
|
if (el)
|
|
2154
2229
|
el.focus = function(opts) {
|
|
@@ -2160,7 +2235,7 @@ var RadioGroup = React16.forwardRef(function RadioGroup2(props, ref) {
|
|
|
2160
2235
|
},
|
|
2161
2236
|
[ref]
|
|
2162
2237
|
);
|
|
2163
|
-
return /* @__PURE__ */
|
|
2238
|
+
return /* @__PURE__ */ React17.createElement(
|
|
2164
2239
|
"fieldset",
|
|
2165
2240
|
{
|
|
2166
2241
|
ref: setRef,
|
|
@@ -2169,10 +2244,10 @@ var RadioGroup = React16.forwardRef(function RadioGroup2(props, ref) {
|
|
|
2169
2244
|
"aria-invalid": props.error ? true : void 0,
|
|
2170
2245
|
disabled: props.disabled
|
|
2171
2246
|
},
|
|
2172
|
-
props.label ? /* @__PURE__ */
|
|
2173
|
-
/* @__PURE__ */
|
|
2247
|
+
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,
|
|
2248
|
+
/* @__PURE__ */ React17.createElement("div", { className: cx("aura-radio-group__list", props.orientation === "horizontal" && "is-horizontal") }, (props.options || []).map(function(o) {
|
|
2174
2249
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
2175
|
-
return /* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ React17.createElement("label", { key: v.value, className: cx("aura-choice", v.disabled && "is-disabled") }, /* @__PURE__ */ React17.createElement(
|
|
2176
2251
|
"input",
|
|
2177
2252
|
{
|
|
2178
2253
|
type: "radio",
|
|
@@ -2186,19 +2261,19 @@ var RadioGroup = React16.forwardRef(function RadioGroup2(props, ref) {
|
|
|
2186
2261
|
st[1](v.value);
|
|
2187
2262
|
}
|
|
2188
2263
|
}
|
|
2189
|
-
), /* @__PURE__ */
|
|
2264
|
+
), /* @__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
2265
|
})),
|
|
2191
|
-
props.error ? /* @__PURE__ */
|
|
2266
|
+
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
2267
|
);
|
|
2193
2268
|
});
|
|
2194
2269
|
|
|
2195
2270
|
// src/Switch.tsx
|
|
2196
|
-
var
|
|
2197
|
-
var Switch =
|
|
2271
|
+
var React18 = __toESM(require("react"), 1);
|
|
2272
|
+
var Switch = React18.forwardRef(function Switch2(props, ref) {
|
|
2198
2273
|
const auto = uid(), id = props.id || auto;
|
|
2199
2274
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
2200
2275
|
const on = !!st[0];
|
|
2201
|
-
return /* @__PURE__ */
|
|
2276
|
+
return /* @__PURE__ */ React18.createElement(
|
|
2202
2277
|
"div",
|
|
2203
2278
|
{
|
|
2204
2279
|
className: cx("aura-switch-row", props.disabled && "is-disabled", props.className),
|
|
@@ -2208,7 +2283,7 @@ var Switch = React17.forwardRef(function Switch2(props, ref) {
|
|
|
2208
2283
|
st[1](!on);
|
|
2209
2284
|
}
|
|
2210
2285
|
},
|
|
2211
|
-
/* @__PURE__ */
|
|
2286
|
+
/* @__PURE__ */ React18.createElement(
|
|
2212
2287
|
"button",
|
|
2213
2288
|
{
|
|
2214
2289
|
ref,
|
|
@@ -2225,14 +2300,14 @@ var Switch = React17.forwardRef(function Switch2(props, ref) {
|
|
|
2225
2300
|
st[1](!on);
|
|
2226
2301
|
}
|
|
2227
2302
|
},
|
|
2228
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ React18.createElement("span", { className: "aura-switch__thumb" })
|
|
2229
2304
|
),
|
|
2230
|
-
props.label ? /* @__PURE__ */
|
|
2305
|
+
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
2306
|
);
|
|
2232
2307
|
});
|
|
2233
2308
|
|
|
2234
2309
|
// src/Combobox.tsx
|
|
2235
|
-
var
|
|
2310
|
+
var React19 = __toESM(require("react"), 1);
|
|
2236
2311
|
var import_react_dom3 = require("react-dom");
|
|
2237
2312
|
function norm(s) {
|
|
2238
2313
|
return String(s == null ? "" : s).normalize("NFC").toLocaleLowerCase("th");
|
|
@@ -2247,7 +2322,7 @@ function defaultFilter(option, query) {
|
|
|
2247
2322
|
return norm(k).indexOf(q) >= 0;
|
|
2248
2323
|
});
|
|
2249
2324
|
}
|
|
2250
|
-
var Combobox =
|
|
2325
|
+
var Combobox = React19.forwardRef(
|
|
2251
2326
|
function Combobox2(all, ref) {
|
|
2252
2327
|
const props = all;
|
|
2253
2328
|
const multi = all.multiple === true;
|
|
@@ -2282,11 +2357,11 @@ var Combobox = React18.forwardRef(
|
|
|
2282
2357
|
return o.value === v;
|
|
2283
2358
|
})[0];
|
|
2284
2359
|
}).filter(Boolean) : [];
|
|
2285
|
-
const openState =
|
|
2286
|
-
const qState =
|
|
2287
|
-
const aState =
|
|
2288
|
-
const posState =
|
|
2289
|
-
const inputRef =
|
|
2360
|
+
const openState = React19.useState(false), open = openState[0], setOpen = openState[1];
|
|
2361
|
+
const qState = React19.useState(null), query = qState[0], setQuery = qState[1];
|
|
2362
|
+
const aState = React19.useState(0), active = aState[0], setActive = aState[1];
|
|
2363
|
+
const posState = React19.useState(null);
|
|
2364
|
+
const inputRef = React19.useRef(null), inputMerged = useMergedRef(ref, inputRef), boxRef = React19.useRef(null), listRef = React19.useRef(null);
|
|
2290
2365
|
const mounted = useMounted();
|
|
2291
2366
|
const limit = props.limit || 200;
|
|
2292
2367
|
const filter = props.filter || defaultFilter;
|
|
@@ -2314,7 +2389,7 @@ var Combobox = React18.forwardRef(
|
|
|
2314
2389
|
},
|
|
2315
2390
|
[open, shown.length, values.length]
|
|
2316
2391
|
);
|
|
2317
|
-
|
|
2392
|
+
React19.useEffect(
|
|
2318
2393
|
function() {
|
|
2319
2394
|
if (!open) return;
|
|
2320
2395
|
function outside(e) {
|
|
@@ -2336,7 +2411,7 @@ var Combobox = React18.forwardRef(
|
|
|
2336
2411
|
},
|
|
2337
2412
|
[open]
|
|
2338
2413
|
);
|
|
2339
|
-
|
|
2414
|
+
React19.useEffect(
|
|
2340
2415
|
function() {
|
|
2341
2416
|
if (!open || !listRef.current) return;
|
|
2342
2417
|
const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
|
|
@@ -2417,7 +2492,7 @@ var Combobox = React18.forwardRef(
|
|
|
2417
2492
|
return id + "-opt-" + i;
|
|
2418
2493
|
};
|
|
2419
2494
|
const list = open && mounted && posState[0] ? (0, import_react_dom3.createPortal)(
|
|
2420
|
-
/* @__PURE__ */
|
|
2495
|
+
/* @__PURE__ */ React19.createElement("div", { ref: listRef, "data-density": density, className: "aura-combo__popover", style: posState[0] }, live.length ? /* @__PURE__ */ React19.createElement(
|
|
2421
2496
|
"ul",
|
|
2422
2497
|
{
|
|
2423
2498
|
id: listId,
|
|
@@ -2429,7 +2504,7 @@ var Combobox = React18.forwardRef(
|
|
|
2429
2504
|
live.map(function(o, i) {
|
|
2430
2505
|
const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
|
|
2431
2506
|
const blocked = o.disabled || multi && full && !isSel;
|
|
2432
|
-
return /* @__PURE__ */
|
|
2507
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2433
2508
|
"li",
|
|
2434
2509
|
{
|
|
2435
2510
|
key: o.value,
|
|
@@ -2454,15 +2529,15 @@ var Combobox = React18.forwardRef(
|
|
|
2454
2529
|
if (activeIdx !== i) setActive(i);
|
|
2455
2530
|
}
|
|
2456
2531
|
},
|
|
2457
|
-
o.icon ? /* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
isSel ? /* @__PURE__ */
|
|
2532
|
+
o.icon ? /* @__PURE__ */ React19.createElement(Icon, { name: o.icon }) : null,
|
|
2533
|
+
/* @__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),
|
|
2534
|
+
isSel ? /* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
2460
2535
|
);
|
|
2461
2536
|
})
|
|
2462
|
-
) : null, props.loading || !live.length || more ? /* @__PURE__ */
|
|
2537
|
+
) : 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
2538
|
document.body
|
|
2464
2539
|
) : null;
|
|
2465
|
-
return /* @__PURE__ */
|
|
2540
|
+
return /* @__PURE__ */ React19.createElement(
|
|
2466
2541
|
Field,
|
|
2467
2542
|
{
|
|
2468
2543
|
id,
|
|
@@ -2474,8 +2549,8 @@ var Combobox = React18.forwardRef(
|
|
|
2474
2549
|
disabled: props.disabled,
|
|
2475
2550
|
className: props.className
|
|
2476
2551
|
},
|
|
2477
|
-
/* @__PURE__ */
|
|
2478
|
-
return /* @__PURE__ */
|
|
2552
|
+
/* @__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) {
|
|
2553
|
+
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
2554
|
"button",
|
|
2480
2555
|
{
|
|
2481
2556
|
type: "button",
|
|
@@ -2494,13 +2569,13 @@ var Combobox = React18.forwardRef(
|
|
|
2494
2569
|
if (inputRef.current) inputRef.current.focus();
|
|
2495
2570
|
}
|
|
2496
2571
|
},
|
|
2497
|
-
/* @__PURE__ */
|
|
2572
|
+
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconX, null) })
|
|
2498
2573
|
));
|
|
2499
|
-
})) : null, multi ? /* @__PURE__ */
|
|
2574
|
+
})) : null, multi ? /* @__PURE__ */ React19.createElement("span", { id: summaryId, className: "aura-sr-only" }, picked.length ? t.selectedCount(picked.length) + ": " + picked.map(function(o) {
|
|
2500
2575
|
return o.label;
|
|
2501
2576
|
}).join(", ") : "") : null, props.name ? multi ? values.map(function(v) {
|
|
2502
|
-
return /* @__PURE__ */
|
|
2503
|
-
}) : /* @__PURE__ */
|
|
2577
|
+
return /* @__PURE__ */ React19.createElement("input", { key: v, type: "hidden", name: props.name, value: v });
|
|
2578
|
+
}) : /* @__PURE__ */ React19.createElement("input", { type: "hidden", name: props.name, value: value == null ? "" : value }) : null, /* @__PURE__ */ React19.createElement(
|
|
2504
2579
|
"input",
|
|
2505
2580
|
{
|
|
2506
2581
|
ref: inputMerged,
|
|
@@ -2536,7 +2611,7 @@ var Combobox = React18.forwardRef(
|
|
|
2536
2611
|
}, 0);
|
|
2537
2612
|
}
|
|
2538
2613
|
}
|
|
2539
|
-
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */
|
|
2614
|
+
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */ React19.createElement(
|
|
2540
2615
|
"button",
|
|
2541
2616
|
{
|
|
2542
2617
|
type: "button",
|
|
@@ -2549,8 +2624,8 @@ var Combobox = React18.forwardRef(
|
|
|
2549
2624
|
if (inputRef.current) inputRef.current.focus();
|
|
2550
2625
|
}
|
|
2551
2626
|
},
|
|
2552
|
-
/* @__PURE__ */
|
|
2553
|
-
) : null, /* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconX, null) })
|
|
2628
|
+
) : null, /* @__PURE__ */ React19.createElement(
|
|
2554
2629
|
"button",
|
|
2555
2630
|
{
|
|
2556
2631
|
type: "button",
|
|
@@ -2568,7 +2643,7 @@ var Combobox = React18.forwardRef(
|
|
|
2568
2643
|
}
|
|
2569
2644
|
}
|
|
2570
2645
|
},
|
|
2571
|
-
/* @__PURE__ */
|
|
2646
|
+
/* @__PURE__ */ React19.createElement(Icon, { name: /* @__PURE__ */ React19.createElement(IconChevronDown, null) })
|
|
2572
2647
|
)),
|
|
2573
2648
|
list
|
|
2574
2649
|
);
|
|
@@ -2576,7 +2651,7 @@ var Combobox = React18.forwardRef(
|
|
|
2576
2651
|
);
|
|
2577
2652
|
|
|
2578
2653
|
// src/DatePicker.tsx
|
|
2579
|
-
var
|
|
2654
|
+
var React20 = __toESM(require("react"), 1);
|
|
2580
2655
|
var import_react_dom4 = require("react-dom");
|
|
2581
2656
|
|
|
2582
2657
|
// src/dates.ts
|
|
@@ -2760,7 +2835,7 @@ function todayIn(timeZone) {
|
|
|
2760
2835
|
// src/DatePicker.tsx
|
|
2761
2836
|
function useFormatDate() {
|
|
2762
2837
|
const ctx = useAuraLocale(), locale = ctx.locale || "en", calendar = ctx.calendar;
|
|
2763
|
-
return
|
|
2838
|
+
return React20.useCallback(
|
|
2764
2839
|
function(iso, opts) {
|
|
2765
2840
|
const o = opts || {}, loc = o.locale || locale;
|
|
2766
2841
|
return formatDate(
|
|
@@ -2781,7 +2856,7 @@ function allowedDate(iso, o) {
|
|
|
2781
2856
|
if (hi && fromISO(hi) && iso > hi) return false;
|
|
2782
2857
|
return !(o.isDateDisabled && o.isDateDisabled(iso));
|
|
2783
2858
|
}
|
|
2784
|
-
var Calendar =
|
|
2859
|
+
var Calendar = React20.forwardRef(function Calendar2(props, ref) {
|
|
2785
2860
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), tag = localeTag(locale, calendar);
|
|
2786
2861
|
const weekStart = props.weekStartsOn == null ? locale === "sv" ? 1 : 0 : props.weekStartsOn;
|
|
2787
2862
|
const given = props.today && fromISO(props.today) ? props.today : null, zone = props.timeZone || ctx.timeZone;
|
|
@@ -2796,7 +2871,7 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2796
2871
|
function select(iso) {
|
|
2797
2872
|
if (props.onSelect) props.onSelect(iso);
|
|
2798
2873
|
}
|
|
2799
|
-
const focusState =
|
|
2874
|
+
const focusState = React20.useState(function() {
|
|
2800
2875
|
const d0 = fromISO(props.focus) || start || today;
|
|
2801
2876
|
if (!disabledAt(d0)) return d0;
|
|
2802
2877
|
for (let i = 1; i <= 366; i++) {
|
|
@@ -2806,21 +2881,21 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2806
2881
|
return d0;
|
|
2807
2882
|
});
|
|
2808
2883
|
const focusDate = focusState[0], setFocus = focusState[1];
|
|
2809
|
-
const viewState =
|
|
2810
|
-
const hoverState =
|
|
2811
|
-
const gridRef =
|
|
2884
|
+
const viewState = React20.useState("days"), view = viewState[0], setView = viewState[1];
|
|
2885
|
+
const hoverState = React20.useState(null);
|
|
2886
|
+
const gridRef = React20.useRef(null), gridMerged = useMergedRef(ref, gridRef), moved = React20.useRef(false);
|
|
2812
2887
|
const th2 = locale === "th";
|
|
2813
2888
|
const dt = dateText(locale);
|
|
2814
2889
|
function disabled(d) {
|
|
2815
2890
|
return disabledAt(d);
|
|
2816
2891
|
}
|
|
2817
|
-
|
|
2892
|
+
React20.useEffect(function() {
|
|
2818
2893
|
if (!moved.current) return;
|
|
2819
2894
|
moved.current = false;
|
|
2820
2895
|
const el = gridRef.current && gridRef.current.querySelector('[data-date="' + toISO(focusDate) + '"]');
|
|
2821
2896
|
if (el) el.focus();
|
|
2822
2897
|
});
|
|
2823
|
-
|
|
2898
|
+
React20.useEffect(
|
|
2824
2899
|
function() {
|
|
2825
2900
|
if (props.autoFocus === false) return;
|
|
2826
2901
|
const el = gridRef.current && gridRef.current.querySelector('[tabindex="0"]');
|
|
@@ -2875,16 +2950,16 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2875
2950
|
const yr = focusDate.getFullYear(), base = yr - yr % 12;
|
|
2876
2951
|
const years = [];
|
|
2877
2952
|
for (let y = base; y < base + 12; y++) years.push(y);
|
|
2878
|
-
return /* @__PURE__ */
|
|
2953
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React20.createElement(
|
|
2879
2954
|
IconButton,
|
|
2880
2955
|
{
|
|
2881
|
-
icon: /* @__PURE__ */
|
|
2956
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronLeft, null),
|
|
2882
2957
|
label: dt.prevYears,
|
|
2883
2958
|
onClick: function() {
|
|
2884
2959
|
setFocus(new Date(yr - 12, focusDate.getMonth(), 1));
|
|
2885
2960
|
}
|
|
2886
2961
|
}
|
|
2887
|
-
), /* @__PURE__ */
|
|
2962
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2888
2963
|
"button",
|
|
2889
2964
|
{
|
|
2890
2965
|
type: "button",
|
|
@@ -2894,18 +2969,18 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2894
2969
|
}
|
|
2895
2970
|
},
|
|
2896
2971
|
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__ */
|
|
2972
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2898
2973
|
IconButton,
|
|
2899
2974
|
{
|
|
2900
|
-
icon: /* @__PURE__ */
|
|
2975
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronRight, null),
|
|
2901
2976
|
label: dt.nextYears,
|
|
2902
2977
|
onClick: function() {
|
|
2903
2978
|
setFocus(new Date(yr + 12, focusDate.getMonth(), 1));
|
|
2904
2979
|
}
|
|
2905
2980
|
}
|
|
2906
|
-
)), /* @__PURE__ */
|
|
2981
|
+
)), /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__years" }, years.map(function(y) {
|
|
2907
2982
|
const d = new Date(y, focusDate.getMonth(), 1);
|
|
2908
|
-
return /* @__PURE__ */
|
|
2983
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2909
2984
|
"button",
|
|
2910
2985
|
{
|
|
2911
2986
|
key: y,
|
|
@@ -2922,16 +2997,16 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2922
2997
|
);
|
|
2923
2998
|
})));
|
|
2924
2999
|
}
|
|
2925
|
-
return /* @__PURE__ */
|
|
3000
|
+
return /* @__PURE__ */ React20.createElement("div", { className: "aura-cal", ref: gridMerged, key: gridKey }, /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__head" }, /* @__PURE__ */ React20.createElement(
|
|
2926
3001
|
IconButton,
|
|
2927
3002
|
{
|
|
2928
|
-
icon: /* @__PURE__ */
|
|
3003
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronLeft, null),
|
|
2929
3004
|
label: dt.prevMonth,
|
|
2930
3005
|
onClick: function() {
|
|
2931
3006
|
setFocus(addMonths(focusDate, -1));
|
|
2932
3007
|
}
|
|
2933
3008
|
}
|
|
2934
|
-
), /* @__PURE__ */
|
|
3009
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2935
3010
|
"button",
|
|
2936
3011
|
{
|
|
2937
3012
|
type: "button",
|
|
@@ -2942,19 +3017,19 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2942
3017
|
}
|
|
2943
3018
|
},
|
|
2944
3019
|
monthTitle,
|
|
2945
|
-
/* @__PURE__ */
|
|
2946
|
-
), /* @__PURE__ */
|
|
3020
|
+
/* @__PURE__ */ React20.createElement(Icon, { name: /* @__PURE__ */ React20.createElement(IconChevronDown, null), size: 14 })
|
|
3021
|
+
), /* @__PURE__ */ React20.createElement(
|
|
2947
3022
|
IconButton,
|
|
2948
3023
|
{
|
|
2949
|
-
icon: /* @__PURE__ */
|
|
3024
|
+
icon: /* @__PURE__ */ React20.createElement(IconChevronRight, null),
|
|
2950
3025
|
label: dt.nextMonth,
|
|
2951
3026
|
onClick: function() {
|
|
2952
3027
|
setFocus(addMonths(focusDate, 1));
|
|
2953
3028
|
}
|
|
2954
3029
|
}
|
|
2955
|
-
)), /* @__PURE__ */
|
|
2956
|
-
return /* @__PURE__ */
|
|
2957
|
-
}))), /* @__PURE__ */
|
|
3030
|
+
)), /* @__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) {
|
|
3031
|
+
return /* @__PURE__ */ React20.createElement("th", { key: i, scope: "col", abbr: n3.long }, /* @__PURE__ */ React20.createElement("span", { "aria-hidden": true }, n3.short));
|
|
3032
|
+
}))), /* @__PURE__ */ React20.createElement(
|
|
2958
3033
|
"tbody",
|
|
2959
3034
|
{
|
|
2960
3035
|
onMouseLeave: function() {
|
|
@@ -2962,11 +3037,11 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2962
3037
|
}
|
|
2963
3038
|
},
|
|
2964
3039
|
weeks.map(function(wk, wi) {
|
|
2965
|
-
return /* @__PURE__ */
|
|
3040
|
+
return /* @__PURE__ */ React20.createElement("tr", { key: wi }, wk.map(function(d) {
|
|
2966
3041
|
const iso = toISO(d), out = d.getMonth() !== focusDate.getMonth(), dis = disabled(d);
|
|
2967
3042
|
const isStart = same(d, start), isEnd = same(d, end) || !end && props.range && same(d, hover) && start;
|
|
2968
3043
|
const sel = isStart || same(d, end);
|
|
2969
|
-
return /* @__PURE__ */
|
|
3044
|
+
return /* @__PURE__ */ React20.createElement(
|
|
2970
3045
|
"td",
|
|
2971
3046
|
{
|
|
2972
3047
|
key: iso,
|
|
@@ -2978,7 +3053,7 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
2978
3053
|
props.range && isEnd && start && "is-range-end"
|
|
2979
3054
|
)
|
|
2980
3055
|
},
|
|
2981
|
-
/* @__PURE__ */
|
|
3056
|
+
/* @__PURE__ */ React20.createElement(
|
|
2982
3057
|
"button",
|
|
2983
3058
|
{
|
|
2984
3059
|
type: "button",
|
|
@@ -3011,7 +3086,7 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
3011
3086
|
);
|
|
3012
3087
|
}));
|
|
3013
3088
|
})
|
|
3014
|
-
)), props.footer === false ? null : /* @__PURE__ */
|
|
3089
|
+
)), props.footer === false ? null : /* @__PURE__ */ React20.createElement("div", { className: "aura-cal__foot" }, /* @__PURE__ */ React20.createElement(
|
|
3015
3090
|
"button",
|
|
3016
3091
|
{
|
|
3017
3092
|
type: "button",
|
|
@@ -3023,11 +3098,11 @@ var Calendar = React19.forwardRef(function Calendar2(props, ref) {
|
|
|
3023
3098
|
}
|
|
3024
3099
|
},
|
|
3025
3100
|
dt.today
|
|
3026
|
-
), props.onClear ? /* @__PURE__ */
|
|
3101
|
+
), props.onClear ? /* @__PURE__ */ React20.createElement("button", { type: "button", className: "aura-cal__link", onClick: props.onClear }, dt.clear) : null));
|
|
3027
3102
|
});
|
|
3028
3103
|
function useCalendarPopover(boxRef) {
|
|
3029
|
-
const openState =
|
|
3030
|
-
const pos =
|
|
3104
|
+
const openState = React20.useState(false), open = openState[0], setOpen = openState[1];
|
|
3105
|
+
const pos = React20.useState(null), popRef = React20.useRef(null), mounted = useMounted();
|
|
3031
3106
|
function place() {
|
|
3032
3107
|
if (!boxRef.current) return;
|
|
3033
3108
|
const el = popRef.current, r = boxRef.current.getBoundingClientRect(), W = el ? el.offsetWidth : 320, H = el ? el.offsetHeight : 380;
|
|
@@ -3041,7 +3116,7 @@ function useCalendarPopover(boxRef) {
|
|
|
3041
3116
|
},
|
|
3042
3117
|
[open, !!pos[0]]
|
|
3043
3118
|
);
|
|
3044
|
-
|
|
3119
|
+
React20.useEffect(
|
|
3045
3120
|
function() {
|
|
3046
3121
|
if (!open) return;
|
|
3047
3122
|
function outside(e) {
|
|
@@ -3063,8 +3138,8 @@ function useCalendarPopover(boxRef) {
|
|
|
3063
3138
|
return { open, setOpen, pos: pos[0], popRef, mounted };
|
|
3064
3139
|
}
|
|
3065
3140
|
function DateField(props) {
|
|
3066
|
-
const editState =
|
|
3067
|
-
return /* @__PURE__ */
|
|
3141
|
+
const editState = React20.useState(null), editing = editState[0], setEditing = editState[1];
|
|
3142
|
+
return /* @__PURE__ */ React20.createElement(
|
|
3068
3143
|
Field,
|
|
3069
3144
|
{
|
|
3070
3145
|
id: props.id,
|
|
@@ -3076,7 +3151,7 @@ function DateField(props) {
|
|
|
3076
3151
|
disabled: props.disabled,
|
|
3077
3152
|
className: props.className
|
|
3078
3153
|
},
|
|
3079
|
-
/* @__PURE__ */
|
|
3154
|
+
/* @__PURE__ */ React20.createElement("div", { ref: props.boxRef, className: cx("aura-input aura-date", props.open && "is-open") }, /* @__PURE__ */ React20.createElement(
|
|
3080
3155
|
"input",
|
|
3081
3156
|
{
|
|
3082
3157
|
ref: props.inputRef,
|
|
@@ -3115,7 +3190,7 @@ function DateField(props) {
|
|
|
3115
3190
|
}
|
|
3116
3191
|
}
|
|
3117
3192
|
}
|
|
3118
|
-
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */
|
|
3193
|
+
), props.clearable !== false && props.hasValue && !props.disabled ? /* @__PURE__ */ React20.createElement(
|
|
3119
3194
|
"button",
|
|
3120
3195
|
{
|
|
3121
3196
|
type: "button",
|
|
@@ -3124,8 +3199,8 @@ function DateField(props) {
|
|
|
3124
3199
|
"aria-label": props.clearLabel,
|
|
3125
3200
|
onClick: props.onClear
|
|
3126
3201
|
},
|
|
3127
|
-
/* @__PURE__ */
|
|
3128
|
-
) : null, /* @__PURE__ */
|
|
3202
|
+
/* @__PURE__ */ React20.createElement(Icon, { name: /* @__PURE__ */ React20.createElement(IconX, null) })
|
|
3203
|
+
) : null, /* @__PURE__ */ React20.createElement(
|
|
3129
3204
|
"button",
|
|
3130
3205
|
{
|
|
3131
3206
|
type: "button",
|
|
@@ -3139,11 +3214,11 @@ function DateField(props) {
|
|
|
3139
3214
|
props.onToggle(!props.open);
|
|
3140
3215
|
}
|
|
3141
3216
|
},
|
|
3142
|
-
/* @__PURE__ */
|
|
3217
|
+
/* @__PURE__ */ React20.createElement(Icon, { name: /* @__PURE__ */ React20.createElement(IconCalendar, null) })
|
|
3143
3218
|
))
|
|
3144
3219
|
);
|
|
3145
3220
|
}
|
|
3146
|
-
var DatePicker =
|
|
3221
|
+
var DatePicker = React20.forwardRef(function DatePicker2(props, ref) {
|
|
3147
3222
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
3148
3223
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
3149
3224
|
const st = useMaybeControlled(
|
|
@@ -3151,7 +3226,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3151
3226
|
props.defaultValue == null ? null : props.defaultValue,
|
|
3152
3227
|
props.onChange
|
|
3153
3228
|
);
|
|
3154
|
-
const boxRef =
|
|
3229
|
+
const boxRef = React20.useRef(null), inputRef = React20.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
3155
3230
|
const pop = useCalendarPopover(boxRef);
|
|
3156
3231
|
const limits = {
|
|
3157
3232
|
min: props.min,
|
|
@@ -3160,8 +3235,8 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3160
3235
|
timeZone: props.timeZone || ctx.timeZone,
|
|
3161
3236
|
isDateDisabled: props.isDateDisabled
|
|
3162
3237
|
};
|
|
3163
|
-
const bad =
|
|
3164
|
-
|
|
3238
|
+
const bad = React20.useState(null);
|
|
3239
|
+
React20.useEffect(
|
|
3165
3240
|
function() {
|
|
3166
3241
|
bad[1](null);
|
|
3167
3242
|
},
|
|
@@ -3183,7 +3258,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3183
3258
|
if (inputRef.current) inputRef.current.focus();
|
|
3184
3259
|
}
|
|
3185
3260
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
3186
|
-
/* @__PURE__ */
|
|
3261
|
+
/* @__PURE__ */ React20.createElement(
|
|
3187
3262
|
"div",
|
|
3188
3263
|
{
|
|
3189
3264
|
ref: pop.popRef,
|
|
@@ -3200,7 +3275,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3200
3275
|
} else trapTab(e, pop.popRef.current);
|
|
3201
3276
|
}
|
|
3202
3277
|
},
|
|
3203
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ React20.createElement(
|
|
3204
3279
|
Calendar,
|
|
3205
3280
|
{
|
|
3206
3281
|
locale,
|
|
@@ -3223,7 +3298,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3223
3298
|
),
|
|
3224
3299
|
document.body
|
|
3225
3300
|
) : null;
|
|
3226
|
-
return /* @__PURE__ */
|
|
3301
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
3227
3302
|
DateField,
|
|
3228
3303
|
{
|
|
3229
3304
|
id,
|
|
@@ -3258,7 +3333,7 @@ var DatePicker = React19.forwardRef(function DatePicker2(props, ref) {
|
|
|
3258
3333
|
}
|
|
3259
3334
|
), cal);
|
|
3260
3335
|
});
|
|
3261
|
-
var DateRangePicker =
|
|
3336
|
+
var DateRangePicker = React20.forwardRef(
|
|
3262
3337
|
function DateRangePicker2(props, ref) {
|
|
3263
3338
|
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
3264
3339
|
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
@@ -3268,8 +3343,8 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3268
3343
|
props.onChange
|
|
3269
3344
|
);
|
|
3270
3345
|
const v = st[0] || { start: null, end: null };
|
|
3271
|
-
const draft =
|
|
3272
|
-
const boxRef =
|
|
3346
|
+
const draft = React20.useState(null);
|
|
3347
|
+
const boxRef = React20.useRef(null), inputRef = React20.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
3273
3348
|
const pop = useCalendarPopover(boxRef);
|
|
3274
3349
|
const limits = {
|
|
3275
3350
|
min: props.min,
|
|
@@ -3284,8 +3359,8 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3284
3359
|
if (!r.end) return formatDate(r.start, o) + " \u2013";
|
|
3285
3360
|
return formatDate(r.start, o) + " \u2013 " + formatDate(r.end, o);
|
|
3286
3361
|
}
|
|
3287
|
-
const bad =
|
|
3288
|
-
|
|
3362
|
+
const bad = React20.useState(null);
|
|
3363
|
+
React20.useEffect(
|
|
3289
3364
|
function() {
|
|
3290
3365
|
bad[1](null);
|
|
3291
3366
|
},
|
|
@@ -3318,7 +3393,7 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3318
3393
|
close();
|
|
3319
3394
|
}
|
|
3320
3395
|
const cal = pop.open && pop.mounted && pop.pos ? (0, import_react_dom4.createPortal)(
|
|
3321
|
-
/* @__PURE__ */
|
|
3396
|
+
/* @__PURE__ */ React20.createElement(
|
|
3322
3397
|
"div",
|
|
3323
3398
|
{
|
|
3324
3399
|
ref: pop.popRef,
|
|
@@ -3335,8 +3410,8 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3335
3410
|
} else trapTab(e, pop.popRef.current);
|
|
3336
3411
|
}
|
|
3337
3412
|
},
|
|
3338
|
-
/* @__PURE__ */
|
|
3339
|
-
/* @__PURE__ */
|
|
3413
|
+
/* @__PURE__ */ React20.createElement("p", { className: "aura-cal__hint", "aria-live": "polite" }, draft[0] ? dt.chooseEnd : dt.chooseStart),
|
|
3414
|
+
/* @__PURE__ */ React20.createElement(
|
|
3340
3415
|
Calendar,
|
|
3341
3416
|
{
|
|
3342
3417
|
range: true,
|
|
@@ -3357,7 +3432,7 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3357
3432
|
),
|
|
3358
3433
|
document.body
|
|
3359
3434
|
) : null;
|
|
3360
|
-
return /* @__PURE__ */
|
|
3435
|
+
return /* @__PURE__ */ React20.createElement(React20.Fragment, null, /* @__PURE__ */ React20.createElement(
|
|
3361
3436
|
DateField,
|
|
3362
3437
|
{
|
|
3363
3438
|
id,
|
|
@@ -3396,18 +3471,18 @@ var DateRangePicker = React19.forwardRef(
|
|
|
3396
3471
|
);
|
|
3397
3472
|
|
|
3398
3473
|
// src/Alert.tsx
|
|
3399
|
-
var
|
|
3400
|
-
var Alert =
|
|
3474
|
+
var React21 = __toESM(require("react"), 1);
|
|
3475
|
+
var Alert = React21.forwardRef(function Alert2(props, ref) {
|
|
3401
3476
|
const t = useStrings();
|
|
3402
3477
|
return alertElement(
|
|
3403
3478
|
props,
|
|
3404
3479
|
ref,
|
|
3405
|
-
props.onDismiss ? /* @__PURE__ */
|
|
3480
|
+
props.onDismiss ? /* @__PURE__ */ React21.createElement(IconButton, { icon: /* @__PURE__ */ React21.createElement(IconX, null), label: t.dismiss, className: "aura-alert__close", onClick: props.onDismiss }) : null
|
|
3406
3481
|
);
|
|
3407
3482
|
});
|
|
3408
3483
|
|
|
3409
3484
|
// src/Toaster.tsx
|
|
3410
|
-
var
|
|
3485
|
+
var React22 = __toESM(require("react"), 1);
|
|
3411
3486
|
var import_react_dom5 = require("react-dom");
|
|
3412
3487
|
var MAX_VISIBLE = 3;
|
|
3413
3488
|
var toastState = {
|
|
@@ -3483,8 +3558,8 @@ function outsideToaster(el) {
|
|
|
3483
3558
|
function ToastItem(props) {
|
|
3484
3559
|
const str = useStrings();
|
|
3485
3560
|
const Link = useLinkComponent();
|
|
3486
|
-
const node =
|
|
3487
|
-
const origin =
|
|
3561
|
+
const node = React22.useRef(null);
|
|
3562
|
+
const origin = React22.useRef(null);
|
|
3488
3563
|
useIsoLayoutEffect(function() {
|
|
3489
3564
|
origin.current = outsideToaster(document.activeElement);
|
|
3490
3565
|
const el = node.current;
|
|
@@ -3500,8 +3575,8 @@ function ToastItem(props) {
|
|
|
3500
3575
|
}, 0);
|
|
3501
3576
|
};
|
|
3502
3577
|
}, []);
|
|
3503
|
-
const t = props.toast, timer =
|
|
3504
|
-
const hover =
|
|
3578
|
+
const t = props.toast, timer = React22.useRef(null), left = React22.useRef(t.duration || 5e3), since = React22.useRef(0);
|
|
3579
|
+
const hover = React22.useRef(false), focused = React22.useRef(false);
|
|
3505
3580
|
function syncFocus() {
|
|
3506
3581
|
if (focused.current && !(node.current && node.current.contains(document.activeElement))) focused.current = false;
|
|
3507
3582
|
}
|
|
@@ -3523,7 +3598,7 @@ function ToastItem(props) {
|
|
|
3523
3598
|
left.current -= Date.now() - since.current;
|
|
3524
3599
|
}
|
|
3525
3600
|
}
|
|
3526
|
-
|
|
3601
|
+
React22.useEffect(
|
|
3527
3602
|
function() {
|
|
3528
3603
|
if (timer.current) clearTimeout(timer.current);
|
|
3529
3604
|
timer.current = null;
|
|
@@ -3542,7 +3617,7 @@ function ToastItem(props) {
|
|
|
3542
3617
|
if (a.onClick) a.onClick();
|
|
3543
3618
|
if (a.dismiss !== false) toast.dismiss(t.id);
|
|
3544
3619
|
}
|
|
3545
|
-
return /* @__PURE__ */
|
|
3620
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3546
3621
|
"div",
|
|
3547
3622
|
{
|
|
3548
3623
|
ref: node,
|
|
@@ -3579,16 +3654,16 @@ function ToastItem(props) {
|
|
|
3579
3654
|
resume();
|
|
3580
3655
|
}
|
|
3581
3656
|
},
|
|
3582
|
-
/* @__PURE__ */
|
|
3657
|
+
/* @__PURE__ */ React22.createElement(
|
|
3583
3658
|
Icon,
|
|
3584
3659
|
{
|
|
3585
|
-
name: t.loading ? /* @__PURE__ */
|
|
3660
|
+
name: t.loading ? /* @__PURE__ */ React22.createElement(IconLoaderCircle, null) : React22.createElement(ALERT_ICON[t.tone] || IconInfo),
|
|
3586
3661
|
className: cx("aura-toast__icon", t.loading && "aura-spin")
|
|
3587
3662
|
}
|
|
3588
3663
|
),
|
|
3589
|
-
/* @__PURE__ */
|
|
3590
|
-
actions.length ? /* @__PURE__ */
|
|
3591
|
-
return a.href ? /* @__PURE__ */
|
|
3664
|
+
/* @__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),
|
|
3665
|
+
actions.length ? /* @__PURE__ */ React22.createElement("div", { className: "aura-toast__actions" }, actions.map(function(a, i) {
|
|
3666
|
+
return a.href ? /* @__PURE__ */ React22.createElement(
|
|
3592
3667
|
Link,
|
|
3593
3668
|
{
|
|
3594
3669
|
key: i,
|
|
@@ -3600,7 +3675,7 @@ function ToastItem(props) {
|
|
|
3600
3675
|
}
|
|
3601
3676
|
},
|
|
3602
3677
|
a.label
|
|
3603
|
-
) : /* @__PURE__ */
|
|
3678
|
+
) : /* @__PURE__ */ React22.createElement(
|
|
3604
3679
|
"button",
|
|
3605
3680
|
{
|
|
3606
3681
|
key: i,
|
|
@@ -3613,10 +3688,10 @@ function ToastItem(props) {
|
|
|
3613
3688
|
a.label
|
|
3614
3689
|
);
|
|
3615
3690
|
})) : null,
|
|
3616
|
-
/* @__PURE__ */
|
|
3691
|
+
/* @__PURE__ */ React22.createElement(
|
|
3617
3692
|
IconButton,
|
|
3618
3693
|
{
|
|
3619
|
-
icon: /* @__PURE__ */
|
|
3694
|
+
icon: /* @__PURE__ */ React22.createElement(IconX, null),
|
|
3620
3695
|
label: str.dismissToast,
|
|
3621
3696
|
className: "aura-toast__close",
|
|
3622
3697
|
onClick: function() {
|
|
@@ -3644,8 +3719,8 @@ function hotkeyMatcher(spec) {
|
|
|
3644
3719
|
function Toaster(props = {}) {
|
|
3645
3720
|
const t = useStrings();
|
|
3646
3721
|
const mounted = useMounted();
|
|
3647
|
-
const s =
|
|
3648
|
-
|
|
3722
|
+
const s = React22.useState(toastState.list);
|
|
3723
|
+
React22.useEffect(function() {
|
|
3649
3724
|
toastState.subs.push(s[1]);
|
|
3650
3725
|
s[1](toastState.list.slice());
|
|
3651
3726
|
return function() {
|
|
@@ -3654,9 +3729,9 @@ function Toaster(props = {}) {
|
|
|
3654
3729
|
});
|
|
3655
3730
|
};
|
|
3656
3731
|
}, []);
|
|
3657
|
-
const region =
|
|
3732
|
+
const region = React22.useRef(null);
|
|
3658
3733
|
const hotkey = props.hotkey === void 0 ? "Alt+T" : props.hotkey;
|
|
3659
|
-
|
|
3734
|
+
React22.useEffect(
|
|
3660
3735
|
function() {
|
|
3661
3736
|
if (!hotkey) return;
|
|
3662
3737
|
const match = hotkeyMatcher(hotkey);
|
|
@@ -3687,7 +3762,7 @@ function Toaster(props = {}) {
|
|
|
3687
3762
|
const pos = props.position || "bottom";
|
|
3688
3763
|
const offset = props.offset;
|
|
3689
3764
|
return (0, import_react_dom5.createPortal)(
|
|
3690
|
-
/* @__PURE__ */
|
|
3765
|
+
/* @__PURE__ */ React22.createElement(
|
|
3691
3766
|
"div",
|
|
3692
3767
|
{
|
|
3693
3768
|
ref: region,
|
|
@@ -3699,7 +3774,7 @@ function Toaster(props = {}) {
|
|
|
3699
3774
|
"aria-keyshortcuts": hotkey || void 0
|
|
3700
3775
|
},
|
|
3701
3776
|
s[0].map(function(t2) {
|
|
3702
|
-
return /* @__PURE__ */
|
|
3777
|
+
return /* @__PURE__ */ React22.createElement(ToastItem, { key: t2.id, toast: t2 });
|
|
3703
3778
|
})
|
|
3704
3779
|
),
|
|
3705
3780
|
document.body
|
|
@@ -3707,12 +3782,12 @@ function Toaster(props = {}) {
|
|
|
3707
3782
|
}
|
|
3708
3783
|
|
|
3709
3784
|
// src/PasswordField.tsx
|
|
3710
|
-
var
|
|
3711
|
-
var PasswordField =
|
|
3785
|
+
var React23 = __toESM(require("react"), 1);
|
|
3786
|
+
var PasswordField = React23.forwardRef(function PasswordField2(props, ref) {
|
|
3712
3787
|
const t = useStrings();
|
|
3713
|
-
const shown =
|
|
3788
|
+
const shown = React23.useState(false);
|
|
3714
3789
|
const rest = omit(props, ["toggle", "className"]);
|
|
3715
|
-
return /* @__PURE__ */
|
|
3790
|
+
return /* @__PURE__ */ React23.createElement(
|
|
3716
3791
|
TextField,
|
|
3717
3792
|
{
|
|
3718
3793
|
autoComplete: "current-password",
|
|
@@ -3722,10 +3797,10 @@ var PasswordField = React22.forwardRef(function PasswordField2(props, ref) {
|
|
|
3722
3797
|
spellCheck: false,
|
|
3723
3798
|
autoCapitalize: "none",
|
|
3724
3799
|
className: cx("aura-password", props.className),
|
|
3725
|
-
suffix: props.toggle === false ? void 0 : /* @__PURE__ */
|
|
3800
|
+
suffix: props.toggle === false ? void 0 : /* @__PURE__ */ React23.createElement(
|
|
3726
3801
|
IconButton,
|
|
3727
3802
|
{
|
|
3728
|
-
icon: shown[0] ? /* @__PURE__ */
|
|
3803
|
+
icon: shown[0] ? /* @__PURE__ */ React23.createElement(IconEyeOff, null) : /* @__PURE__ */ React23.createElement(IconEye, null),
|
|
3729
3804
|
label: t.showPassword,
|
|
3730
3805
|
"aria-pressed": shown[0],
|
|
3731
3806
|
disabled: props.disabled,
|
|
@@ -3739,7 +3814,7 @@ var PasswordField = React22.forwardRef(function PasswordField2(props, ref) {
|
|
|
3739
3814
|
});
|
|
3740
3815
|
|
|
3741
3816
|
// src/FormErrorSummary.tsx
|
|
3742
|
-
var
|
|
3817
|
+
var React24 = __toESM(require("react"), 1);
|
|
3743
3818
|
function items(errors) {
|
|
3744
3819
|
if (Array.isArray(errors)) return errors;
|
|
3745
3820
|
const out = [];
|
|
@@ -3768,16 +3843,16 @@ function fieldElement(field) {
|
|
|
3768
3843
|
}
|
|
3769
3844
|
return named;
|
|
3770
3845
|
}
|
|
3771
|
-
var FormErrorSummary =
|
|
3846
|
+
var FormErrorSummary = React24.forwardRef(
|
|
3772
3847
|
function FormErrorSummary2(props, ref) {
|
|
3773
3848
|
const t = useStrings();
|
|
3774
3849
|
const auto = uid(), id = props.id || auto;
|
|
3775
3850
|
const list = items(props.errors);
|
|
3776
|
-
const box =
|
|
3851
|
+
const box = React24.useRef(null);
|
|
3777
3852
|
const keyed = props.focusKey !== void 0;
|
|
3778
|
-
const lastKey =
|
|
3853
|
+
const lastKey = React24.useRef(null), armed = React24.useRef(false), hadErrors = React24.useRef(false);
|
|
3779
3854
|
const has = list.length > 0;
|
|
3780
|
-
|
|
3855
|
+
React24.useEffect(
|
|
3781
3856
|
function() {
|
|
3782
3857
|
const appeared = has && !hadErrors.current;
|
|
3783
3858
|
hadErrors.current = has;
|
|
@@ -3801,7 +3876,7 @@ var FormErrorSummary = React23.forwardRef(
|
|
|
3801
3876
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
3802
3877
|
[has, props.focusKey, keyed]
|
|
3803
3878
|
);
|
|
3804
|
-
|
|
3879
|
+
React24.useEffect(
|
|
3805
3880
|
function() {
|
|
3806
3881
|
if (!keyed) return;
|
|
3807
3882
|
function disarm() {
|
|
@@ -3820,7 +3895,7 @@ var FormErrorSummary = React23.forwardRef(
|
|
|
3820
3895
|
[keyed]
|
|
3821
3896
|
);
|
|
3822
3897
|
if (!list.length) return null;
|
|
3823
|
-
return /* @__PURE__ */
|
|
3898
|
+
return /* @__PURE__ */ React24.createElement(
|
|
3824
3899
|
"div",
|
|
3825
3900
|
{
|
|
3826
3901
|
ref: function(el) {
|
|
@@ -3834,9 +3909,9 @@ var FormErrorSummary = React23.forwardRef(
|
|
|
3834
3909
|
"aria-labelledby": id + "-title",
|
|
3835
3910
|
className: cx("aura-alert aura-alert--danger aura-error-summary", props.className)
|
|
3836
3911
|
},
|
|
3837
|
-
/* @__PURE__ */
|
|
3838
|
-
/* @__PURE__ */
|
|
3839
|
-
return /* @__PURE__ */
|
|
3912
|
+
/* @__PURE__ */ React24.createElement(Icon, { name: /* @__PURE__ */ React24.createElement(IconCircleAlert, null), className: "aura-alert__icon" }),
|
|
3913
|
+
/* @__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) {
|
|
3914
|
+
return /* @__PURE__ */ React24.createElement("li", { key: e.field }, /* @__PURE__ */ React24.createElement(
|
|
3840
3915
|
"a",
|
|
3841
3916
|
{
|
|
3842
3917
|
href: "#" + e.field,
|
|
@@ -3861,30 +3936,30 @@ var FormErrorSummary = React23.forwardRef(
|
|
|
3861
3936
|
);
|
|
3862
3937
|
|
|
3863
3938
|
// src/FilterBar.tsx
|
|
3864
|
-
var
|
|
3939
|
+
var React26 = __toESM(require("react"), 1);
|
|
3865
3940
|
|
|
3866
3941
|
// src/Tag.tsx
|
|
3867
|
-
var
|
|
3868
|
-
function
|
|
3942
|
+
var React25 = __toESM(require("react"), 1);
|
|
3943
|
+
function textOf2(node) {
|
|
3869
3944
|
if (node == null || typeof node === "boolean") return "";
|
|
3870
3945
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
3871
|
-
if (Array.isArray(node)) return node.map(
|
|
3872
|
-
if (
|
|
3946
|
+
if (Array.isArray(node)) return node.map(textOf2).join("");
|
|
3947
|
+
if (React25.isValidElement(node)) {
|
|
3873
3948
|
const p = node.props;
|
|
3874
|
-
return p["aria-hidden"] === true || p["aria-hidden"] === "true" ? "" :
|
|
3949
|
+
return p["aria-hidden"] === true || p["aria-hidden"] === "true" ? "" : textOf2(p.children);
|
|
3875
3950
|
}
|
|
3876
3951
|
return "";
|
|
3877
3952
|
}
|
|
3878
|
-
var Tag =
|
|
3953
|
+
var Tag = React25.forwardRef(function Tag2(props, ref) {
|
|
3879
3954
|
const t = useStrings();
|
|
3880
3955
|
const selectable = props.onClick != null || props.selected != null;
|
|
3881
3956
|
const rest = omit(props, ["onRemove", "selected", "icon", "className", "children", "disabled", "removeLabel"]);
|
|
3882
3957
|
const inner = [
|
|
3883
|
-
props.icon ? /* @__PURE__ */
|
|
3884
|
-
/* @__PURE__ */
|
|
3958
|
+
props.icon ? /* @__PURE__ */ React25.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
|
|
3959
|
+
/* @__PURE__ */ React25.createElement("span", { key: "t", className: "aura-tag__text" }, props.children)
|
|
3885
3960
|
];
|
|
3886
3961
|
if (selectable) {
|
|
3887
|
-
return /* @__PURE__ */
|
|
3962
|
+
return /* @__PURE__ */ React25.createElement(
|
|
3888
3963
|
"button",
|
|
3889
3964
|
{
|
|
3890
3965
|
...rest,
|
|
@@ -3894,17 +3969,17 @@ var Tag = React24.forwardRef(function Tag2(props, ref) {
|
|
|
3894
3969
|
disabled: props.disabled,
|
|
3895
3970
|
className: cx("aura-tag is-selectable", props.selected && "is-selected", props.className)
|
|
3896
3971
|
},
|
|
3897
|
-
props.selected ? /* @__PURE__ */
|
|
3972
|
+
props.selected ? /* @__PURE__ */ React25.createElement(Icon, { name: /* @__PURE__ */ React25.createElement(IconCheck, null), size: 14 }) : inner[0],
|
|
3898
3973
|
inner[1]
|
|
3899
3974
|
);
|
|
3900
3975
|
}
|
|
3901
|
-
const name = props.onRemove && !props.removeLabel ?
|
|
3976
|
+
const name = props.onRemove && !props.removeLabel ? textOf2(props.children).replace(/\s+/g, " ").trim() : "";
|
|
3902
3977
|
if (props.onRemove && !props.disabled && !props.removeLabel && !name)
|
|
3903
3978
|
devWarnOnce(
|
|
3904
3979
|
"tag-remove-label",
|
|
3905
3980
|
'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
|
|
3906
3981
|
);
|
|
3907
|
-
return /* @__PURE__ */
|
|
3982
|
+
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
3983
|
"button",
|
|
3909
3984
|
{
|
|
3910
3985
|
type: "button",
|
|
@@ -3912,21 +3987,21 @@ var Tag = React24.forwardRef(function Tag2(props, ref) {
|
|
|
3912
3987
|
"aria-label": props.removeLabel || t.remove(name),
|
|
3913
3988
|
onClick: props.onRemove
|
|
3914
3989
|
},
|
|
3915
|
-
/* @__PURE__ */
|
|
3990
|
+
/* @__PURE__ */ React25.createElement(Icon, { name: /* @__PURE__ */ React25.createElement(IconX, null), size: 12 })
|
|
3916
3991
|
) : null);
|
|
3917
3992
|
});
|
|
3918
3993
|
|
|
3919
3994
|
// src/FilterBar.tsx
|
|
3920
|
-
var FilterBar =
|
|
3995
|
+
var FilterBar = React26.forwardRef(function FilterBar2(props, ref) {
|
|
3921
3996
|
const t = useStrings();
|
|
3922
3997
|
const id = uid();
|
|
3923
3998
|
const hasSearch = !!props.onSearchChange;
|
|
3924
|
-
const draft =
|
|
3925
|
-
const timer =
|
|
3926
|
-
const sent =
|
|
3927
|
-
const onChange =
|
|
3999
|
+
const draft = React26.useState(props.search || "");
|
|
4000
|
+
const timer = React26.useRef(null);
|
|
4001
|
+
const sent = React26.useRef(props.search || "");
|
|
4002
|
+
const onChange = React26.useRef(props.onSearchChange);
|
|
3928
4003
|
onChange.current = props.onSearchChange;
|
|
3929
|
-
|
|
4004
|
+
React26.useEffect(
|
|
3930
4005
|
function() {
|
|
3931
4006
|
if ((props.search || "") !== sent.current) {
|
|
3932
4007
|
sent.current = props.search || "";
|
|
@@ -3935,7 +4010,7 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
3935
4010
|
},
|
|
3936
4011
|
[props.search]
|
|
3937
4012
|
);
|
|
3938
|
-
|
|
4013
|
+
React26.useEffect(function() {
|
|
3939
4014
|
return function() {
|
|
3940
4015
|
if (timer.current) clearTimeout(timer.current);
|
|
3941
4016
|
};
|
|
@@ -3960,15 +4035,15 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
3960
4035
|
const filters = props.filters || [];
|
|
3961
4036
|
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
3962
4037
|
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
3963
|
-
return /* @__PURE__ */
|
|
4038
|
+
return /* @__PURE__ */ React26.createElement(
|
|
3964
4039
|
"div",
|
|
3965
4040
|
{
|
|
3966
4041
|
ref,
|
|
3967
4042
|
role: "region",
|
|
3968
4043
|
"aria-label": props.label || t.filters,
|
|
3969
|
-
className: cx("aura-filterbar", props.className)
|
|
4044
|
+
className: cx("aura-filterbar", props.searchGrow && "aura-filterbar--grow", props.className)
|
|
3970
4045
|
},
|
|
3971
|
-
/* @__PURE__ */
|
|
4046
|
+
/* @__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
4047
|
"input",
|
|
3973
4048
|
{
|
|
3974
4049
|
id,
|
|
@@ -3989,10 +4064,10 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
3989
4064
|
}
|
|
3990
4065
|
}
|
|
3991
4066
|
}
|
|
3992
|
-
), draft[0] ? /* @__PURE__ */
|
|
4067
|
+
), draft[0] ? /* @__PURE__ */ React26.createElement(
|
|
3993
4068
|
IconButton,
|
|
3994
4069
|
{
|
|
3995
|
-
icon: /* @__PURE__ */
|
|
4070
|
+
icon: /* @__PURE__ */ React26.createElement(IconX, null),
|
|
3996
4071
|
label: t.clear((props.searchLabel || t.search).toLowerCase()),
|
|
3997
4072
|
className: "aura-filterbar__clear-search",
|
|
3998
4073
|
onClick: function() {
|
|
@@ -4000,10 +4075,10 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
4000
4075
|
send("");
|
|
4001
4076
|
}
|
|
4002
4077
|
}
|
|
4003
|
-
) : null) : null, props.children ? /* @__PURE__ */
|
|
4004
|
-
filters.length || props.onClearAll && anything ? /* @__PURE__ */
|
|
4005
|
-
return /* @__PURE__ */
|
|
4006
|
-
}), props.onClearAll && anything ? /* @__PURE__ */
|
|
4078
|
+
) : 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),
|
|
4079
|
+
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React26.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
4080
|
+
return /* @__PURE__ */ React26.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
4081
|
+
}), props.onClearAll && anything ? /* @__PURE__ */ React26.createElement(
|
|
4007
4082
|
"button",
|
|
4008
4083
|
{
|
|
4009
4084
|
type: "button",
|
|
@@ -4021,11 +4096,11 @@ var FilterBar = React25.forwardRef(function FilterBar2(props, ref) {
|
|
|
4021
4096
|
});
|
|
4022
4097
|
|
|
4023
4098
|
// src/Command.tsx
|
|
4024
|
-
var
|
|
4099
|
+
var React28 = __toESM(require("react"), 1);
|
|
4025
4100
|
var import_react_dom6 = require("react-dom");
|
|
4026
4101
|
|
|
4027
4102
|
// src/useModal.tsx
|
|
4028
|
-
var
|
|
4103
|
+
var React27 = __toESM(require("react"), 1);
|
|
4029
4104
|
var locks = 0;
|
|
4030
4105
|
var savedOverflow = "";
|
|
4031
4106
|
function lockScroll() {
|
|
@@ -4052,9 +4127,9 @@ function tabbable(el) {
|
|
|
4052
4127
|
}
|
|
4053
4128
|
function useModal(open, ref, opts) {
|
|
4054
4129
|
const mounted = useMounted();
|
|
4055
|
-
const prev =
|
|
4130
|
+
const prev = React27.useRef(null);
|
|
4056
4131
|
const o = opts || {};
|
|
4057
|
-
|
|
4132
|
+
React27.useEffect(
|
|
4058
4133
|
function() {
|
|
4059
4134
|
if (!open || !mounted) return;
|
|
4060
4135
|
prev.current = document.activeElement;
|
|
@@ -4112,21 +4187,21 @@ function Command(props) {
|
|
|
4112
4187
|
const t = useStrings();
|
|
4113
4188
|
const density = useDensity();
|
|
4114
4189
|
const id = uid(), listId = id + "-list";
|
|
4115
|
-
const box =
|
|
4116
|
-
const input =
|
|
4117
|
-
const qState =
|
|
4190
|
+
const box = React28.useRef(null);
|
|
4191
|
+
const input = React28.useRef(null);
|
|
4192
|
+
const qState = React28.useState(""), act = React28.useState(null);
|
|
4118
4193
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
4119
4194
|
function setQuery(v) {
|
|
4120
4195
|
if (props.query === void 0) qState[1](v);
|
|
4121
4196
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
4122
4197
|
}
|
|
4123
|
-
const openRef =
|
|
4198
|
+
const openRef = React28.useRef(props.open);
|
|
4124
4199
|
openRef.current = props.open;
|
|
4125
4200
|
const close = function() {
|
|
4126
4201
|
props.onOpenChange(false);
|
|
4127
4202
|
};
|
|
4128
4203
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
4129
|
-
|
|
4204
|
+
React28.useEffect(
|
|
4130
4205
|
function() {
|
|
4131
4206
|
if (props.hotkey === false) return;
|
|
4132
4207
|
function onKey2(e) {
|
|
@@ -4142,7 +4217,7 @@ function Command(props) {
|
|
|
4142
4217
|
},
|
|
4143
4218
|
[props.hotkey, props.onOpenChange]
|
|
4144
4219
|
);
|
|
4145
|
-
|
|
4220
|
+
React28.useEffect(
|
|
4146
4221
|
function() {
|
|
4147
4222
|
if (!props.open) {
|
|
4148
4223
|
if (query) setQuery("");
|
|
@@ -4182,7 +4257,7 @@ function Command(props) {
|
|
|
4182
4257
|
const optId = function(i2) {
|
|
4183
4258
|
return id + "-o" + i2;
|
|
4184
4259
|
};
|
|
4185
|
-
|
|
4260
|
+
React28.useEffect(
|
|
4186
4261
|
function() {
|
|
4187
4262
|
if (!box.current || active < 0) return;
|
|
4188
4263
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -4227,7 +4302,7 @@ function Command(props) {
|
|
|
4227
4302
|
if (!modal.ready) return null;
|
|
4228
4303
|
let i = -1;
|
|
4229
4304
|
return (0, import_react_dom6.createPortal)(
|
|
4230
|
-
/* @__PURE__ */
|
|
4305
|
+
/* @__PURE__ */ React28.createElement(
|
|
4231
4306
|
"div",
|
|
4232
4307
|
{
|
|
4233
4308
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -4237,8 +4312,8 @@ function Command(props) {
|
|
|
4237
4312
|
e.stopPropagation();
|
|
4238
4313
|
}
|
|
4239
4314
|
},
|
|
4240
|
-
/* @__PURE__ */
|
|
4241
|
-
/* @__PURE__ */
|
|
4315
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
4316
|
+
/* @__PURE__ */ React28.createElement(
|
|
4242
4317
|
"div",
|
|
4243
4318
|
{
|
|
4244
4319
|
ref: box,
|
|
@@ -4248,7 +4323,7 @@ function Command(props) {
|
|
|
4248
4323
|
tabIndex: -1,
|
|
4249
4324
|
className: cx("aura-command", props.className)
|
|
4250
4325
|
},
|
|
4251
|
-
/* @__PURE__ */
|
|
4326
|
+
/* @__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
4327
|
"input",
|
|
4253
4328
|
{
|
|
4254
4329
|
ref: input,
|
|
@@ -4271,8 +4346,8 @@ function Command(props) {
|
|
|
4271
4346
|
},
|
|
4272
4347
|
onKeyDown: onKey
|
|
4273
4348
|
}
|
|
4274
|
-
), /* @__PURE__ */
|
|
4275
|
-
/* @__PURE__ */
|
|
4349
|
+
), /* @__PURE__ */ React28.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
4350
|
+
/* @__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
4351
|
"div",
|
|
4277
4352
|
{
|
|
4278
4353
|
id: listId,
|
|
@@ -4282,7 +4357,7 @@ function Command(props) {
|
|
|
4282
4357
|
},
|
|
4283
4358
|
groups.map(function(g, gi) {
|
|
4284
4359
|
const gid = id + "-g" + gi;
|
|
4285
|
-
return /* @__PURE__ */
|
|
4360
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4286
4361
|
"div",
|
|
4287
4362
|
{
|
|
4288
4363
|
key: g.name || gi,
|
|
@@ -4290,11 +4365,11 @@ function Command(props) {
|
|
|
4290
4365
|
"aria-labelledby": g.name ? gid : void 0,
|
|
4291
4366
|
className: "aura-command__group"
|
|
4292
4367
|
},
|
|
4293
|
-
g.name ? /* @__PURE__ */
|
|
4368
|
+
g.name ? /* @__PURE__ */ React28.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
4294
4369
|
g.items.map(function(it) {
|
|
4295
4370
|
i++;
|
|
4296
4371
|
const n3 = i;
|
|
4297
|
-
return /* @__PURE__ */
|
|
4372
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4298
4373
|
"div",
|
|
4299
4374
|
{
|
|
4300
4375
|
key: it.id,
|
|
@@ -4317,16 +4392,16 @@ function Command(props) {
|
|
|
4317
4392
|
run(it);
|
|
4318
4393
|
}
|
|
4319
4394
|
},
|
|
4320
|
-
it.icon ? /* @__PURE__ */
|
|
4321
|
-
/* @__PURE__ */
|
|
4322
|
-
it.shortcut ? /* @__PURE__ */
|
|
4395
|
+
it.icon ? /* @__PURE__ */ React28.createElement(Icon, { name: it.icon }) : null,
|
|
4396
|
+
/* @__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),
|
|
4397
|
+
it.shortcut ? /* @__PURE__ */ React28.createElement("kbd", { className: "aura-command__kbd" }, it.shortcut) : null
|
|
4323
4398
|
);
|
|
4324
4399
|
})
|
|
4325
4400
|
);
|
|
4326
4401
|
})
|
|
4327
4402
|
)),
|
|
4328
|
-
/* @__PURE__ */
|
|
4329
|
-
/* @__PURE__ */
|
|
4403
|
+
/* @__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) : ""),
|
|
4404
|
+
/* @__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
4405
|
)
|
|
4331
4406
|
),
|
|
4332
4407
|
document.body
|
|
@@ -4334,12 +4409,12 @@ function Command(props) {
|
|
|
4334
4409
|
}
|
|
4335
4410
|
|
|
4336
4411
|
// src/Tooltip.tsx
|
|
4337
|
-
var
|
|
4412
|
+
var React29 = __toESM(require("react"), 1);
|
|
4338
4413
|
var import_react_dom7 = require("react-dom");
|
|
4339
|
-
var Tooltip =
|
|
4340
|
-
const id = uid(), st =
|
|
4341
|
-
const anchor =
|
|
4342
|
-
const pos =
|
|
4414
|
+
var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
4415
|
+
const id = uid(), st = React29.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
4416
|
+
const anchor = React29.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip = React29.useRef(null), timer = React29.useRef(void 0);
|
|
4417
|
+
const pos = React29.useState(null), mounted = useMounted();
|
|
4343
4418
|
function show2(now) {
|
|
4344
4419
|
clearTimeout(timer.current);
|
|
4345
4420
|
timer.current = setTimeout(
|
|
@@ -4359,7 +4434,7 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4359
4434
|
set(false);
|
|
4360
4435
|
}, 120);
|
|
4361
4436
|
}
|
|
4362
|
-
|
|
4437
|
+
React29.useEffect(function() {
|
|
4363
4438
|
return function() {
|
|
4364
4439
|
clearTimeout(timer.current);
|
|
4365
4440
|
};
|
|
@@ -4403,7 +4478,7 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4403
4478
|
},
|
|
4404
4479
|
[open, mounted]
|
|
4405
4480
|
);
|
|
4406
|
-
|
|
4481
|
+
React29.useEffect(
|
|
4407
4482
|
function() {
|
|
4408
4483
|
if (!open) return;
|
|
4409
4484
|
function esc(e) {
|
|
@@ -4416,8 +4491,8 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4416
4491
|
},
|
|
4417
4492
|
[open]
|
|
4418
4493
|
);
|
|
4419
|
-
const child =
|
|
4420
|
-
const trigger = /* @__PURE__ */
|
|
4494
|
+
const child = React29.Children.only(props.children);
|
|
4495
|
+
const trigger = /* @__PURE__ */ React29.createElement(
|
|
4421
4496
|
"span",
|
|
4422
4497
|
{
|
|
4423
4498
|
ref: anchorMerged,
|
|
@@ -4431,10 +4506,10 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4431
4506
|
},
|
|
4432
4507
|
onBlur: hide
|
|
4433
4508
|
},
|
|
4434
|
-
|
|
4509
|
+
React29.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
4435
4510
|
);
|
|
4436
|
-
return /* @__PURE__ */
|
|
4437
|
-
/* @__PURE__ */
|
|
4511
|
+
return /* @__PURE__ */ React29.createElement(React29.Fragment, null, trigger, open && mounted ? (0, import_react_dom7.createPortal)(
|
|
4512
|
+
/* @__PURE__ */ React29.createElement(
|
|
4438
4513
|
"div",
|
|
4439
4514
|
{
|
|
4440
4515
|
ref: tip,
|
|
@@ -4454,12 +4529,12 @@ var Tooltip = React28.forwardRef(function Tooltip2(props, ref) {
|
|
|
4454
4529
|
});
|
|
4455
4530
|
|
|
4456
4531
|
// src/Dialog.tsx
|
|
4457
|
-
var
|
|
4532
|
+
var React30 = __toESM(require("react"), 1);
|
|
4458
4533
|
var import_react_dom8 = require("react-dom");
|
|
4459
|
-
var Dialog =
|
|
4534
|
+
var Dialog = React30.forwardRef(function Dialog2(props, ref) {
|
|
4460
4535
|
const t = useStrings();
|
|
4461
4536
|
const density = useDensity();
|
|
4462
|
-
const own =
|
|
4537
|
+
const own = React30.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4463
4538
|
function close() {
|
|
4464
4539
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4465
4540
|
}
|
|
@@ -4472,7 +4547,7 @@ var Dialog = React29.forwardRef(function Dialog2(props, ref) {
|
|
|
4472
4547
|
});
|
|
4473
4548
|
if (!modal.ready) return null;
|
|
4474
4549
|
return (0, import_react_dom8.createPortal)(
|
|
4475
|
-
/* @__PURE__ */
|
|
4550
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React30.createElement(
|
|
4476
4551
|
"div",
|
|
4477
4552
|
{
|
|
4478
4553
|
className: "aura-scrim",
|
|
@@ -4482,7 +4557,7 @@ var Dialog = React29.forwardRef(function Dialog2(props, ref) {
|
|
|
4482
4557
|
},
|
|
4483
4558
|
"aria-hidden": true
|
|
4484
4559
|
}
|
|
4485
|
-
), /* @__PURE__ */
|
|
4560
|
+
), /* @__PURE__ */ React30.createElement(
|
|
4486
4561
|
"div",
|
|
4487
4562
|
{
|
|
4488
4563
|
ref: merged,
|
|
@@ -4493,18 +4568,18 @@ var Dialog = React29.forwardRef(function Dialog2(props, ref) {
|
|
|
4493
4568
|
tabIndex: -1,
|
|
4494
4569
|
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
4495
4570
|
},
|
|
4496
|
-
/* @__PURE__ */
|
|
4497
|
-
props.description ? /* @__PURE__ */
|
|
4498
|
-
props.children ? /* @__PURE__ */
|
|
4499
|
-
props.footer ? /* @__PURE__ */
|
|
4571
|
+
/* @__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),
|
|
4572
|
+
props.description ? /* @__PURE__ */ React30.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
|
|
4573
|
+
props.children ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__body" }, props.children) : null,
|
|
4574
|
+
props.footer ? /* @__PURE__ */ React30.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null
|
|
4500
4575
|
)),
|
|
4501
4576
|
document.body
|
|
4502
4577
|
);
|
|
4503
4578
|
});
|
|
4504
|
-
var Drawer =
|
|
4579
|
+
var Drawer = React30.forwardRef(function Drawer2(props, ref) {
|
|
4505
4580
|
const t = useStrings();
|
|
4506
4581
|
const density = useDensity();
|
|
4507
|
-
const own =
|
|
4582
|
+
const own = React30.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4508
4583
|
function close() {
|
|
4509
4584
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
4510
4585
|
}
|
|
@@ -4537,7 +4612,7 @@ var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
|
4537
4612
|
]);
|
|
4538
4613
|
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
4539
4614
|
return (0, import_react_dom8.createPortal)(
|
|
4540
|
-
/* @__PURE__ */
|
|
4615
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React30.createElement(
|
|
4541
4616
|
"div",
|
|
4542
4617
|
{
|
|
4543
4618
|
className: "aura-scrim",
|
|
@@ -4547,7 +4622,7 @@ var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
|
4547
4622
|
} : void 0,
|
|
4548
4623
|
"aria-hidden": true
|
|
4549
4624
|
}
|
|
4550
|
-
), /* @__PURE__ */
|
|
4625
|
+
), /* @__PURE__ */ React30.createElement(
|
|
4551
4626
|
"div",
|
|
4552
4627
|
{
|
|
4553
4628
|
...rest,
|
|
@@ -4560,11 +4635,11 @@ var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
|
4560
4635
|
tabIndex: -1,
|
|
4561
4636
|
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
4562
4637
|
},
|
|
4563
|
-
props.title || props.dismissible !== false ? /* @__PURE__ */
|
|
4638
|
+
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
4639
|
IconButton,
|
|
4565
4640
|
{
|
|
4566
4641
|
...props.closeProps,
|
|
4567
|
-
icon: /* @__PURE__ */
|
|
4642
|
+
icon: /* @__PURE__ */ React30.createElement(IconX, null),
|
|
4568
4643
|
label: props.closeLabel || t.close,
|
|
4569
4644
|
onClick: function(e) {
|
|
4570
4645
|
const own2 = props.closeProps && props.closeProps.onClick;
|
|
@@ -4573,16 +4648,16 @@ var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
|
4573
4648
|
}
|
|
4574
4649
|
}
|
|
4575
4650
|
) : null) : null,
|
|
4576
|
-
props.description ? /* @__PURE__ */
|
|
4577
|
-
/* @__PURE__ */
|
|
4578
|
-
props.footer ? /* @__PURE__ */
|
|
4651
|
+
props.description ? /* @__PURE__ */ React30.createElement("p", { className: "aura-drawer__desc", id: descId }, props.description) : null,
|
|
4652
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-drawer__body" }, props.children),
|
|
4653
|
+
props.footer ? /* @__PURE__ */ React30.createElement("div", { className: "aura-drawer__foot" }, props.footer) : null
|
|
4579
4654
|
)),
|
|
4580
4655
|
document.body
|
|
4581
4656
|
);
|
|
4582
4657
|
});
|
|
4583
4658
|
|
|
4584
4659
|
// src/DataTable.tsx
|
|
4585
|
-
var
|
|
4660
|
+
var React31 = __toESM(require("react"), 1);
|
|
4586
4661
|
var import_react_dom9 = require("react-dom");
|
|
4587
4662
|
var BP = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
4588
4663
|
var DEFAULT_COLUMNS = [
|
|
@@ -4605,7 +4680,7 @@ function hidePx(c) {
|
|
|
4605
4680
|
var ROW_H_DEFAULT = 48;
|
|
4606
4681
|
var OVERSCAN = 8;
|
|
4607
4682
|
var FLEX_MIN = 160;
|
|
4608
|
-
var DataTableImpl =
|
|
4683
|
+
var DataTableImpl = React31.forwardRef(function DataTable(props, ref) {
|
|
4609
4684
|
const t = useStrings();
|
|
4610
4685
|
const columns = props.columns || DEFAULT_COLUMNS;
|
|
4611
4686
|
const byKey = {};
|
|
@@ -4644,7 +4719,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4644
4719
|
const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
|
|
4645
4720
|
return rejected[String(k)];
|
|
4646
4721
|
}).join("\0") + "#" + selected.join("\0");
|
|
4647
|
-
|
|
4722
|
+
React31.useEffect(
|
|
4648
4723
|
function() {
|
|
4649
4724
|
if (droppedSig !== "") setSelected(selected);
|
|
4650
4725
|
},
|
|
@@ -4681,19 +4756,19 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4681
4756
|
}),
|
|
4682
4757
|
props.onPinnedColumnsChange
|
|
4683
4758
|
);
|
|
4684
|
-
const widthState =
|
|
4759
|
+
const widthState = React31.useState({});
|
|
4685
4760
|
const widths = widthState[0], setWidths = widthState[1];
|
|
4686
|
-
const activeState =
|
|
4687
|
-
const scrollState =
|
|
4761
|
+
const activeState = React31.useState({ r: 1, c: 0 });
|
|
4762
|
+
const scrollState = React31.useState(0);
|
|
4688
4763
|
const scrollTop = scrollState[0], setScrollTop = scrollState[1];
|
|
4689
|
-
const scrolledX =
|
|
4690
|
-
const menuState =
|
|
4764
|
+
const scrolledX = React31.useState(false);
|
|
4765
|
+
const menuState = React31.useState(null);
|
|
4691
4766
|
const menu = menuState[0], setMenu = menuState[1];
|
|
4692
|
-
const dragState =
|
|
4767
|
+
const dragState = React31.useState(null);
|
|
4693
4768
|
const drag = dragState[0], setDrag = dragState[1];
|
|
4694
|
-
const gridRef =
|
|
4695
|
-
const wrapRef =
|
|
4696
|
-
const boxWidth =
|
|
4769
|
+
const gridRef = React31.useRef(null);
|
|
4770
|
+
const wrapRef = React31.useRef(null), wrapMerged = useMergedRef(ref, wrapRef);
|
|
4771
|
+
const boxWidth = React31.useState(null);
|
|
4697
4772
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
4698
4773
|
return c.hideBelow != null;
|
|
4699
4774
|
});
|
|
@@ -4703,7 +4778,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4703
4778
|
return px != null && a.indexOf(px) === i;
|
|
4704
4779
|
}).length
|
|
4705
4780
|
);
|
|
4706
|
-
|
|
4781
|
+
React31.useEffect(
|
|
4707
4782
|
function() {
|
|
4708
4783
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
4709
4784
|
const ro = new ResizeObserver(function(en) {
|
|
@@ -4748,8 +4823,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4748
4823
|
const px = hidePx(c);
|
|
4749
4824
|
return px != null && below(boxWidth[0], px);
|
|
4750
4825
|
}
|
|
4751
|
-
const scrollRef =
|
|
4752
|
-
const tipState =
|
|
4826
|
+
const scrollRef = React31.useRef(null);
|
|
4827
|
+
const tipState = React31.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
4753
4828
|
function showFull(e) {
|
|
4754
4829
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
4755
4830
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
@@ -4761,7 +4836,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4761
4836
|
setTip(null);
|
|
4762
4837
|
}
|
|
4763
4838
|
const tipEl = tip && typeof document !== "undefined" ? (0, import_react_dom9.createPortal)(
|
|
4764
|
-
/* @__PURE__ */
|
|
4839
|
+
/* @__PURE__ */ React31.createElement(
|
|
4765
4840
|
"div",
|
|
4766
4841
|
{
|
|
4767
4842
|
className: "aura-tooltip aura-tooltip--above",
|
|
@@ -4772,7 +4847,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4772
4847
|
),
|
|
4773
4848
|
document.body
|
|
4774
4849
|
) : null;
|
|
4775
|
-
const rowH =
|
|
4850
|
+
const rowH = React31.useState(ROW_H_DEFAULT);
|
|
4776
4851
|
const ROW_H = rowH[0];
|
|
4777
4852
|
useIsoLayoutEffect(function() {
|
|
4778
4853
|
const el = wrapRef.current;
|
|
@@ -4780,8 +4855,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4780
4855
|
const v = parseFloat(getComputedStyle(el).getPropertyValue("--aura-table-row-height"));
|
|
4781
4856
|
if (v > 0 && v !== rowH[0]) rowH[1](v);
|
|
4782
4857
|
});
|
|
4783
|
-
const pending =
|
|
4784
|
-
const resizing =
|
|
4858
|
+
const pending = React31.useRef(null);
|
|
4859
|
+
const resizing = React31.useRef(false);
|
|
4785
4860
|
useIsoLayoutEffect(function() {
|
|
4786
4861
|
if (!gridRef.current) return;
|
|
4787
4862
|
const els = gridRef.current.querySelectorAll(
|
|
@@ -4865,7 +4940,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4865
4940
|
return s;
|
|
4866
4941
|
}
|
|
4867
4942
|
const sortCol = sort && sort.key ? byKey[sort.key] : void 0;
|
|
4868
|
-
const view =
|
|
4943
|
+
const view = React31.useMemo(
|
|
4869
4944
|
function() {
|
|
4870
4945
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
4871
4946
|
const col = byKey[sort.key];
|
|
@@ -4907,8 +4982,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4907
4982
|
const pageRows = pageSize && !manual ? view.slice(first, first + pageSize) : view;
|
|
4908
4983
|
const canSortAny = !busy && (manual ? total > 1 : rows.length > 1);
|
|
4909
4984
|
const shownTotal = manual && props.totalRows == null ? first + rows.length : total;
|
|
4910
|
-
const prevCount =
|
|
4911
|
-
|
|
4985
|
+
const prevCount = React31.useRef(pageCount);
|
|
4986
|
+
React31.useEffect(
|
|
4912
4987
|
function() {
|
|
4913
4988
|
if (busy) return;
|
|
4914
4989
|
const before = prevCount.current;
|
|
@@ -4922,9 +4997,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4922
4997
|
[pageState[0], page, busy, pageCount]
|
|
4923
4998
|
);
|
|
4924
4999
|
const linkPaging = !!props.getPageHref && !props.onPageChange && !oneCallback;
|
|
4925
|
-
const prevLink =
|
|
4926
|
-
const jumpState =
|
|
4927
|
-
|
|
5000
|
+
const prevLink = React31.useRef(null), nextLink = React31.useRef(null), jumpLink = React31.useRef(null);
|
|
5001
|
+
const jumpState = React31.useState(null);
|
|
5002
|
+
React31.useEffect(
|
|
4928
5003
|
function() {
|
|
4929
5004
|
if (jumpState[0] == null) return;
|
|
4930
5005
|
if (jumpLink.current) jumpLink.current.click();
|
|
@@ -4975,7 +5050,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
4975
5050
|
);
|
|
4976
5051
|
}
|
|
4977
5052
|
function rowLinkWrap(r, content) {
|
|
4978
|
-
return rowHref ? /* @__PURE__ */
|
|
5053
|
+
return rowHref ? /* @__PURE__ */ React31.createElement(Link, { href: rowHref(r), className: "aura-table__row-link" }, content) : content;
|
|
4979
5054
|
}
|
|
4980
5055
|
const height = props.height || 0;
|
|
4981
5056
|
const autoRows = props.rowHeight === "auto" && !height;
|
|
@@ -5006,7 +5081,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5006
5081
|
if (!activeRendered) return r === 0 && c === ac ? 0 : -1;
|
|
5007
5082
|
return r === ar && c === ac ? 0 : -1;
|
|
5008
5083
|
}
|
|
5009
|
-
|
|
5084
|
+
React31.useEffect(function() {
|
|
5010
5085
|
const p = pending.current;
|
|
5011
5086
|
if (!p || !gridRef.current) return;
|
|
5012
5087
|
let c = p.c;
|
|
@@ -5206,14 +5281,14 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5206
5281
|
items2.push(
|
|
5207
5282
|
{
|
|
5208
5283
|
label: t.sortAsc,
|
|
5209
|
-
icon: /* @__PURE__ */
|
|
5284
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowUp, null),
|
|
5210
5285
|
onSelect: function() {
|
|
5211
5286
|
applySort({ key: c.key, dir: "asc" });
|
|
5212
5287
|
}
|
|
5213
5288
|
},
|
|
5214
5289
|
{
|
|
5215
5290
|
label: t.sortDesc,
|
|
5216
|
-
icon: /* @__PURE__ */
|
|
5291
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowDown, null),
|
|
5217
5292
|
onSelect: function() {
|
|
5218
5293
|
applySort({ key: c.key, dir: "desc" });
|
|
5219
5294
|
}
|
|
@@ -5223,7 +5298,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5223
5298
|
if (c.width != null)
|
|
5224
5299
|
items2.push({
|
|
5225
5300
|
label: isPinned(c) ? t.unpin : t.pin,
|
|
5226
|
-
icon: isPinned(c) ? /* @__PURE__ */
|
|
5301
|
+
icon: isPinned(c) ? /* @__PURE__ */ React31.createElement(IconPinOff, null) : /* @__PURE__ */ React31.createElement(IconPin, null),
|
|
5227
5302
|
onSelect: function() {
|
|
5228
5303
|
togglePin(c.key);
|
|
5229
5304
|
}
|
|
@@ -5232,7 +5307,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5232
5307
|
items2.push(
|
|
5233
5308
|
{
|
|
5234
5309
|
label: t.moveLeft,
|
|
5235
|
-
icon: /* @__PURE__ */
|
|
5310
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowLeft, null),
|
|
5236
5311
|
disabled: gi <= 0,
|
|
5237
5312
|
onSelect: function() {
|
|
5238
5313
|
moveCol(c.key, -1);
|
|
@@ -5240,7 +5315,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5240
5315
|
},
|
|
5241
5316
|
{
|
|
5242
5317
|
label: t.moveRight,
|
|
5243
|
-
icon: /* @__PURE__ */
|
|
5318
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowRight, null),
|
|
5244
5319
|
disabled: gi >= group.length - 1,
|
|
5245
5320
|
onSelect: function() {
|
|
5246
5321
|
moveCol(c.key, 1);
|
|
@@ -5251,7 +5326,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5251
5326
|
{ separator: true },
|
|
5252
5327
|
{
|
|
5253
5328
|
label: t.hideColumn,
|
|
5254
|
-
icon: /* @__PURE__ */
|
|
5329
|
+
icon: /* @__PURE__ */ React31.createElement(IconEyeOff, null),
|
|
5255
5330
|
disabled: shown.length <= 1,
|
|
5256
5331
|
onSelect: function() {
|
|
5257
5332
|
setHidden(c.key, true);
|
|
@@ -5272,7 +5347,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5272
5347
|
setHidden(k, on);
|
|
5273
5348
|
}
|
|
5274
5349
|
};
|
|
5275
|
-
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */
|
|
5350
|
+
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React31.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
|
|
5276
5351
|
}
|
|
5277
5352
|
function openMenu(kind, key, anchor, rc) {
|
|
5278
5353
|
setMenu({ kind, key, anchor, rc });
|
|
@@ -5348,10 +5423,10 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5348
5423
|
e.stopPropagation();
|
|
5349
5424
|
}
|
|
5350
5425
|
}
|
|
5351
|
-
const head = [/* @__PURE__ */
|
|
5426
|
+
const head = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5352
5427
|
if (selectable)
|
|
5353
5428
|
head.push(
|
|
5354
|
-
/* @__PURE__ */
|
|
5429
|
+
/* @__PURE__ */ React31.createElement(
|
|
5355
5430
|
"span",
|
|
5356
5431
|
{
|
|
5357
5432
|
key: "__sel",
|
|
@@ -5365,7 +5440,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5365
5440
|
activeState[1]({ r: 0, c: 0 });
|
|
5366
5441
|
}
|
|
5367
5442
|
},
|
|
5368
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5443
|
+
pageKeys.length ? /* @__PURE__ */ React31.createElement(
|
|
5369
5444
|
Checkbox,
|
|
5370
5445
|
{
|
|
5371
5446
|
hideLabel: true,
|
|
@@ -5376,7 +5451,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5376
5451
|
onChange: toggleAll
|
|
5377
5452
|
}
|
|
5378
5453
|
) : null,
|
|
5379
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5454
|
+
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
5455
|
)
|
|
5381
5456
|
);
|
|
5382
5457
|
vis.forEach(function(c, i) {
|
|
@@ -5386,7 +5461,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5386
5461
|
const ariaSort = isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0;
|
|
5387
5462
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
5388
5463
|
head.push(
|
|
5389
|
-
/* @__PURE__ */
|
|
5464
|
+
/* @__PURE__ */ React31.createElement(
|
|
5390
5465
|
"span",
|
|
5391
5466
|
{
|
|
5392
5467
|
key: c.key,
|
|
@@ -5436,7 +5511,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5436
5511
|
setDrag(null);
|
|
5437
5512
|
}
|
|
5438
5513
|
},
|
|
5439
|
-
/* @__PURE__ */
|
|
5514
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React31.createElement(
|
|
5440
5515
|
"button",
|
|
5441
5516
|
{
|
|
5442
5517
|
type: "button",
|
|
@@ -5448,14 +5523,14 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5448
5523
|
}
|
|
5449
5524
|
},
|
|
5450
5525
|
c.label,
|
|
5451
|
-
/* @__PURE__ */
|
|
5526
|
+
/* @__PURE__ */ React31.createElement(
|
|
5452
5527
|
Icon,
|
|
5453
5528
|
{
|
|
5454
|
-
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */
|
|
5529
|
+
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */ React31.createElement(IconArrowDown, null) : /* @__PURE__ */ React31.createElement(IconArrowUp, null) : /* @__PURE__ */ React31.createElement(IconArrowUpDown, null),
|
|
5455
5530
|
size: 12
|
|
5456
5531
|
}
|
|
5457
5532
|
)
|
|
5458
|
-
) : /* @__PURE__ */
|
|
5533
|
+
) : /* @__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
5534
|
"button",
|
|
5460
5535
|
{
|
|
5461
5536
|
type: "button",
|
|
@@ -5469,9 +5544,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5469
5544
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
5470
5545
|
}
|
|
5471
5546
|
},
|
|
5472
|
-
/* @__PURE__ */
|
|
5547
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconEllipsis, null) })
|
|
5473
5548
|
) : null),
|
|
5474
|
-
canResize(c) ? /* @__PURE__ */
|
|
5549
|
+
canResize(c) ? /* @__PURE__ */ React31.createElement(
|
|
5475
5550
|
"span",
|
|
5476
5551
|
{
|
|
5477
5552
|
className: "aura-table__resize",
|
|
@@ -5493,7 +5568,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5493
5568
|
);
|
|
5494
5569
|
});
|
|
5495
5570
|
head.push(
|
|
5496
|
-
/* @__PURE__ */
|
|
5571
|
+
/* @__PURE__ */ React31.createElement(
|
|
5497
5572
|
"span",
|
|
5498
5573
|
{
|
|
5499
5574
|
key: "__gr",
|
|
@@ -5504,15 +5579,15 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5504
5579
|
);
|
|
5505
5580
|
function cellContent(c, r) {
|
|
5506
5581
|
const v = r[c.key];
|
|
5507
|
-
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */
|
|
5582
|
+
return c.render ? c.render(r) : c.pill ? /* @__PURE__ */ React31.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
5508
5583
|
}
|
|
5509
5584
|
function rowCells(r, i, k, isSel) {
|
|
5510
5585
|
const ri = i + 1;
|
|
5511
5586
|
const selLabel = selectable && canSelect(r) ? props.rowSelectLabel && props.rowSelectLabel(r) || t.selectRow(k) : void 0;
|
|
5512
|
-
const cells = [/* @__PURE__ */
|
|
5587
|
+
const cells = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5513
5588
|
if (selectable)
|
|
5514
5589
|
cells.push(
|
|
5515
|
-
/* @__PURE__ */
|
|
5590
|
+
/* @__PURE__ */ React31.createElement(
|
|
5516
5591
|
"span",
|
|
5517
5592
|
{
|
|
5518
5593
|
key: "__sel",
|
|
@@ -5526,7 +5601,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5526
5601
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
5527
5602
|
}
|
|
5528
5603
|
},
|
|
5529
|
-
canSelect(r) ? /* @__PURE__ */
|
|
5604
|
+
canSelect(r) ? /* @__PURE__ */ React31.createElement(
|
|
5530
5605
|
Checkbox,
|
|
5531
5606
|
{
|
|
5532
5607
|
hideLabel: true,
|
|
@@ -5543,7 +5618,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5543
5618
|
vis.forEach(function(c, j) {
|
|
5544
5619
|
const ci = j + (selectable ? 1 : 0), v = r[c.key], pin = isPinned(c);
|
|
5545
5620
|
cells.push(
|
|
5546
|
-
/* @__PURE__ */
|
|
5621
|
+
/* @__PURE__ */ React31.createElement(
|
|
5547
5622
|
"span",
|
|
5548
5623
|
{
|
|
5549
5624
|
key: c.key,
|
|
@@ -5565,13 +5640,13 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5565
5640
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
5566
5641
|
}
|
|
5567
5642
|
},
|
|
5568
|
-
autoRows ? /* @__PURE__ */
|
|
5643
|
+
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
5644
|
)
|
|
5570
5645
|
);
|
|
5571
5646
|
});
|
|
5572
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
5647
|
+
if (hasFields) cells.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
5573
5648
|
cells.push(
|
|
5574
|
-
/* @__PURE__ */
|
|
5649
|
+
/* @__PURE__ */ React31.createElement(
|
|
5575
5650
|
"span",
|
|
5576
5651
|
{
|
|
5577
5652
|
key: "__gr",
|
|
@@ -5588,14 +5663,14 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5588
5663
|
const n3 = pageSize || props.skeletonRows || 5;
|
|
5589
5664
|
const skRows = body = [];
|
|
5590
5665
|
for (let i = 0; i < n3; i++) {
|
|
5591
|
-
const sk = [/* @__PURE__ */
|
|
5666
|
+
const sk = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
5592
5667
|
if (selectable)
|
|
5593
5668
|
sk.push(
|
|
5594
|
-
/* @__PURE__ */
|
|
5669
|
+
/* @__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
5670
|
);
|
|
5596
5671
|
vis.forEach(function(c, j) {
|
|
5597
5672
|
sk.push(
|
|
5598
|
-
/* @__PURE__ */
|
|
5673
|
+
/* @__PURE__ */ React31.createElement(
|
|
5599
5674
|
"span",
|
|
5600
5675
|
{
|
|
5601
5676
|
key: c.key,
|
|
@@ -5604,7 +5679,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5604
5679
|
...cardAttrs(c, j),
|
|
5605
5680
|
"data-label": void 0
|
|
5606
5681
|
},
|
|
5607
|
-
/* @__PURE__ */
|
|
5682
|
+
/* @__PURE__ */ React31.createElement(
|
|
5608
5683
|
"span",
|
|
5609
5684
|
{
|
|
5610
5685
|
className: cx("aura-skel", c.pill && "aura-skel--pill"),
|
|
@@ -5614,28 +5689,28 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5614
5689
|
)
|
|
5615
5690
|
);
|
|
5616
5691
|
});
|
|
5617
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
5692
|
+
if (hasFields) sk.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
5618
5693
|
sk.push(
|
|
5619
|
-
/* @__PURE__ */
|
|
5694
|
+
/* @__PURE__ */ React31.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
5620
5695
|
);
|
|
5621
5696
|
skRows.push(
|
|
5622
|
-
/* @__PURE__ */
|
|
5697
|
+
/* @__PURE__ */ React31.createElement("div", { key: "sk" + i, className: "aura-table__row aura-table__row--skeleton", "aria-hidden": true, style: rowStyle }, sk)
|
|
5623
5698
|
);
|
|
5624
5699
|
}
|
|
5625
5700
|
} else if (!rows.length) {
|
|
5626
5701
|
const em = props.empty || {};
|
|
5627
|
-
body = /* @__PURE__ */
|
|
5702
|
+
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
5703
|
} else {
|
|
5629
5704
|
const bodyRows = body = [];
|
|
5630
5705
|
if (virtual && start > 0)
|
|
5631
5706
|
bodyRows.push(
|
|
5632
|
-
/* @__PURE__ */
|
|
5707
|
+
/* @__PURE__ */ React31.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
5633
5708
|
);
|
|
5634
5709
|
for (let ri = start; ri < end; ri++) {
|
|
5635
5710
|
(function(r, i) {
|
|
5636
5711
|
const k = r[rowKey], isSel = !!selSet[k];
|
|
5637
5712
|
bodyRows.push(
|
|
5638
|
-
/* @__PURE__ */
|
|
5713
|
+
/* @__PURE__ */ React31.createElement(
|
|
5639
5714
|
"div",
|
|
5640
5715
|
{
|
|
5641
5716
|
key: k,
|
|
@@ -5663,7 +5738,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5663
5738
|
}
|
|
5664
5739
|
if (virtual && end < pageRows.length)
|
|
5665
5740
|
bodyRows.push(
|
|
5666
|
-
/* @__PURE__ */
|
|
5741
|
+
/* @__PURE__ */ React31.createElement(
|
|
5667
5742
|
"div",
|
|
5668
5743
|
{
|
|
5669
5744
|
key: "__bot",
|
|
@@ -5676,9 +5751,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5676
5751
|
}
|
|
5677
5752
|
let foot = null;
|
|
5678
5753
|
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__ */
|
|
5754
|
+
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
5755
|
if (props.getPageHref && !off)
|
|
5681
|
-
return /* @__PURE__ */
|
|
5756
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5682
5757
|
Link,
|
|
5683
5758
|
{
|
|
5684
5759
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -5693,9 +5768,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5693
5768
|
}
|
|
5694
5769
|
}
|
|
5695
5770
|
},
|
|
5696
|
-
/* @__PURE__ */
|
|
5771
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: icon })
|
|
5697
5772
|
);
|
|
5698
|
-
return /* @__PURE__ */
|
|
5773
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5699
5774
|
IconButton,
|
|
5700
5775
|
{
|
|
5701
5776
|
icon,
|
|
@@ -5710,11 +5785,11 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5710
5785
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
5711
5786
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
5712
5787
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
5713
|
-
foot = /* @__PURE__ */
|
|
5788
|
+
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
5789
|
} else if (height && rows.length && !loading) {
|
|
5715
|
-
foot = /* @__PURE__ */
|
|
5790
|
+
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
5791
|
}
|
|
5717
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
5792
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React31.createElement(
|
|
5718
5793
|
"div",
|
|
5719
5794
|
{
|
|
5720
5795
|
role: "row",
|
|
@@ -5723,8 +5798,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5723
5798
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
5724
5799
|
style: rowStyle
|
|
5725
5800
|
},
|
|
5726
|
-
/* @__PURE__ */
|
|
5727
|
-
selectable ? /* @__PURE__ */
|
|
5801
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
5802
|
+
selectable ? /* @__PURE__ */ React31.createElement(
|
|
5728
5803
|
"span",
|
|
5729
5804
|
{
|
|
5730
5805
|
role: "gridcell",
|
|
@@ -5739,7 +5814,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5739
5814
|
) : null,
|
|
5740
5815
|
vis.map(function(c, j) {
|
|
5741
5816
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
5742
|
-
return /* @__PURE__ */
|
|
5817
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5743
5818
|
"span",
|
|
5744
5819
|
{
|
|
5745
5820
|
key: c.key,
|
|
@@ -5765,8 +5840,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5765
5840
|
props.footer[c.key]
|
|
5766
5841
|
);
|
|
5767
5842
|
}),
|
|
5768
|
-
hasFields ? /* @__PURE__ */
|
|
5769
|
-
/* @__PURE__ */
|
|
5843
|
+
hasFields ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
5844
|
+
/* @__PURE__ */ React31.createElement(
|
|
5770
5845
|
"span",
|
|
5771
5846
|
{
|
|
5772
5847
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -5780,7 +5855,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5780
5855
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
5781
5856
|
};
|
|
5782
5857
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
5783
|
-
const gridEl = /* @__PURE__ */
|
|
5858
|
+
const gridEl = /* @__PURE__ */ React31.createElement(
|
|
5784
5859
|
"div",
|
|
5785
5860
|
{
|
|
5786
5861
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -5794,8 +5869,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5794
5869
|
),
|
|
5795
5870
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
5796
5871
|
},
|
|
5797
|
-
refreshing ? /* @__PURE__ */
|
|
5798
|
-
/* @__PURE__ */
|
|
5872
|
+
refreshing ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
5873
|
+
/* @__PURE__ */ React31.createElement(
|
|
5799
5874
|
"div",
|
|
5800
5875
|
{
|
|
5801
5876
|
ref: function(el) {
|
|
@@ -5824,7 +5899,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5824
5899
|
if (sx !== scrolledX[0]) scrolledX[1](sx);
|
|
5825
5900
|
}
|
|
5826
5901
|
},
|
|
5827
|
-
/* @__PURE__ */
|
|
5902
|
+
/* @__PURE__ */ React31.createElement(
|
|
5828
5903
|
"div",
|
|
5829
5904
|
{
|
|
5830
5905
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -5837,11 +5912,11 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5837
5912
|
body,
|
|
5838
5913
|
totalRow
|
|
5839
5914
|
),
|
|
5840
|
-
busy ? /* @__PURE__ */
|
|
5841
|
-
controls ? /* @__PURE__ */
|
|
5915
|
+
busy ? /* @__PURE__ */ React31.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null,
|
|
5916
|
+
controls ? /* @__PURE__ */ React31.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React31.createElement(
|
|
5842
5917
|
IconButton,
|
|
5843
5918
|
{
|
|
5844
|
-
icon: /* @__PURE__ */
|
|
5919
|
+
icon: /* @__PURE__ */ React31.createElement(IconColumns3, null),
|
|
5845
5920
|
label: t.showHideColumns,
|
|
5846
5921
|
"aria-haspopup": "menu",
|
|
5847
5922
|
onClick: function(e) {
|
|
@@ -5850,7 +5925,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5850
5925
|
}
|
|
5851
5926
|
)) : null,
|
|
5852
5927
|
foot,
|
|
5853
|
-
menu ? /* @__PURE__ */
|
|
5928
|
+
menu ? /* @__PURE__ */ React31.createElement(
|
|
5854
5929
|
Menu,
|
|
5855
5930
|
{
|
|
5856
5931
|
anchor: menu.anchor,
|
|
@@ -5860,13 +5935,13 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5860
5935
|
}
|
|
5861
5936
|
) : null,
|
|
5862
5937
|
tipEl,
|
|
5863
|
-
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */
|
|
5938
|
+
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
5939
|
);
|
|
5865
5940
|
if (!levels.length) return gridEl;
|
|
5866
5941
|
let out = gridEl;
|
|
5867
5942
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
5868
5943
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
5869
|
-
out = /* @__PURE__ */
|
|
5944
|
+
out = /* @__PURE__ */ React31.createElement(
|
|
5870
5945
|
"div",
|
|
5871
5946
|
{
|
|
5872
5947
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -5875,19 +5950,19 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5875
5950
|
out
|
|
5876
5951
|
);
|
|
5877
5952
|
}
|
|
5878
|
-
return /* @__PURE__ */
|
|
5953
|
+
return /* @__PURE__ */ React31.createElement("div", { ref, className: cx("aura-table-box", props.className) }, out);
|
|
5879
5954
|
});
|
|
5880
5955
|
var DataTable2 = DataTableImpl;
|
|
5881
5956
|
|
|
5882
5957
|
// src/Card.tsx
|
|
5883
|
-
var
|
|
5884
|
-
var Card =
|
|
5958
|
+
var React32 = __toESM(require("react"), 1);
|
|
5959
|
+
var Card = React32.forwardRef(function Card2(props, ref) {
|
|
5885
5960
|
return cardElement(props, ref);
|
|
5886
5961
|
});
|
|
5887
5962
|
|
|
5888
5963
|
// src/Tabs.tsx
|
|
5889
|
-
var
|
|
5890
|
-
var Tabs =
|
|
5964
|
+
var React33 = __toESM(require("react"), 1);
|
|
5965
|
+
var Tabs = React33.forwardRef(function Tabs2(props, ref) {
|
|
5891
5966
|
const items2 = props.tabs || [], base = uid();
|
|
5892
5967
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
5893
5968
|
return !!t.href;
|
|
@@ -5901,7 +5976,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5901
5976
|
props.onChange
|
|
5902
5977
|
);
|
|
5903
5978
|
const cur = asLinks && "value" in props ? props.value : st[0];
|
|
5904
|
-
const refs =
|
|
5979
|
+
const refs = React33.useRef({});
|
|
5905
5980
|
const current2 = items2.filter(function(t) {
|
|
5906
5981
|
return t.id === cur;
|
|
5907
5982
|
})[0] || firstOn || items2[0];
|
|
@@ -5913,7 +5988,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5913
5988
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
5914
5989
|
};
|
|
5915
5990
|
const rootCls = cx("aura-tabs", seg && "aura-tabs--segmented");
|
|
5916
|
-
const [focusId, setFocusId] =
|
|
5991
|
+
const [focusId, setFocusId] = React33.useState(null);
|
|
5917
5992
|
items2.forEach(function(t) {
|
|
5918
5993
|
const al = t.tabProps && t.tabProps["aria-label"];
|
|
5919
5994
|
if (al && al.toLowerCase().indexOf(String(t.label).toLowerCase()) !== 0)
|
|
@@ -5923,19 +5998,19 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5923
5998
|
);
|
|
5924
5999
|
});
|
|
5925
6000
|
if (asLinks)
|
|
5926
|
-
return /* @__PURE__ */
|
|
6001
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5927
6002
|
"nav",
|
|
5928
6003
|
{
|
|
5929
6004
|
ref,
|
|
5930
6005
|
"aria-label": props.label,
|
|
5931
6006
|
className: cx(rootCls, "aura-tabs--links", props.className)
|
|
5932
6007
|
},
|
|
5933
|
-
/* @__PURE__ */
|
|
6008
|
+
/* @__PURE__ */ React33.createElement("div", { className: listCls }, items2.map(function(t) {
|
|
5934
6009
|
const on = t.id === cur;
|
|
5935
6010
|
const inner = [
|
|
5936
|
-
t.icon ? /* @__PURE__ */
|
|
6011
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
5937
6012
|
t.label,
|
|
5938
|
-
t.count != null ? /* @__PURE__ */
|
|
6013
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
5939
6014
|
];
|
|
5940
6015
|
const own = omit(t.tabProps || {}, [
|
|
5941
6016
|
"type",
|
|
@@ -5949,7 +6024,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5949
6024
|
"name",
|
|
5950
6025
|
"value"
|
|
5951
6026
|
]);
|
|
5952
|
-
return t.disabled ? /* @__PURE__ */
|
|
6027
|
+
return t.disabled ? /* @__PURE__ */ React33.createElement(
|
|
5953
6028
|
"span",
|
|
5954
6029
|
{
|
|
5955
6030
|
...omit(own, ["onClick"]),
|
|
@@ -5958,7 +6033,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5958
6033
|
"aria-disabled": true
|
|
5959
6034
|
},
|
|
5960
6035
|
inner
|
|
5961
|
-
) : /* @__PURE__ */
|
|
6036
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
5962
6037
|
Link,
|
|
5963
6038
|
{
|
|
5964
6039
|
...own,
|
|
@@ -5988,7 +6063,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5988
6063
|
const stop = manual && focusId && items2.filter(function(t) {
|
|
5989
6064
|
return t.id === focusId && !t.disabled;
|
|
5990
6065
|
})[0] || current2;
|
|
5991
|
-
return /* @__PURE__ */
|
|
6066
|
+
return /* @__PURE__ */ React33.createElement("div", { ref, className: cx(rootCls, props.className) }, /* @__PURE__ */ React33.createElement(
|
|
5992
6067
|
"div",
|
|
5993
6068
|
{
|
|
5994
6069
|
role: "tablist",
|
|
@@ -6021,7 +6096,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6021
6096
|
items2.map(function(t) {
|
|
6022
6097
|
const on = current2 && t.id === current2.id;
|
|
6023
6098
|
const own = t.tabProps || {};
|
|
6024
|
-
return /* @__PURE__ */
|
|
6099
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6025
6100
|
"button",
|
|
6026
6101
|
{
|
|
6027
6102
|
...own,
|
|
@@ -6048,9 +6123,9 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6048
6123
|
st[1](t.id);
|
|
6049
6124
|
}
|
|
6050
6125
|
},
|
|
6051
|
-
t.icon ? /* @__PURE__ */
|
|
6126
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { name: t.icon }) : null,
|
|
6052
6127
|
t.label,
|
|
6053
|
-
t.count != null ? /* @__PURE__ */
|
|
6128
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
6054
6129
|
);
|
|
6055
6130
|
})
|
|
6056
6131
|
), props.keepMounted ? (
|
|
@@ -6058,7 +6133,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6058
6133
|
items2.map(function(t) {
|
|
6059
6134
|
if (t.content === void 0) return null;
|
|
6060
6135
|
const on = current2 && t.id === current2.id;
|
|
6061
|
-
return /* @__PURE__ */
|
|
6136
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6062
6137
|
"div",
|
|
6063
6138
|
{
|
|
6064
6139
|
key: t.id,
|
|
@@ -6072,7 +6147,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6072
6147
|
t.content
|
|
6073
6148
|
);
|
|
6074
6149
|
})
|
|
6075
|
-
) : current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
6150
|
+
) : current2 && current2.content !== void 0 ? /* @__PURE__ */ React33.createElement(
|
|
6076
6151
|
"div",
|
|
6077
6152
|
{
|
|
6078
6153
|
role: "tabpanel",
|
|
@@ -6086,14 +6161,14 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6086
6161
|
});
|
|
6087
6162
|
|
|
6088
6163
|
// src/SideNav.tsx
|
|
6089
|
-
var
|
|
6164
|
+
var React34 = __toESM(require("react"), 1);
|
|
6090
6165
|
var import_react_dom10 = require("react-dom");
|
|
6091
6166
|
function contains(it, id) {
|
|
6092
6167
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
6093
6168
|
return c.id === id || contains(c, id);
|
|
6094
6169
|
});
|
|
6095
6170
|
}
|
|
6096
|
-
var SideNav =
|
|
6171
|
+
var SideNav = React34.forwardRef(function SideNav2(props, ref) {
|
|
6097
6172
|
const t = useStrings();
|
|
6098
6173
|
const Link = useLinkComponent(props.linkComponent);
|
|
6099
6174
|
const base = uid();
|
|
@@ -6105,14 +6180,14 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6105
6180
|
const active = st[0];
|
|
6106
6181
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
6107
6182
|
const collapsed = col[0];
|
|
6108
|
-
const tipState =
|
|
6109
|
-
|
|
6183
|
+
const tipState = React34.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
6184
|
+
React34.useEffect(
|
|
6110
6185
|
function() {
|
|
6111
6186
|
if (!collapsed) setTip(null);
|
|
6112
6187
|
},
|
|
6113
6188
|
[collapsed]
|
|
6114
6189
|
);
|
|
6115
|
-
|
|
6190
|
+
React34.useEffect(
|
|
6116
6191
|
function() {
|
|
6117
6192
|
if (!tip) return;
|
|
6118
6193
|
function esc(e) {
|
|
@@ -6137,12 +6212,12 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6137
6212
|
return { onMouseEnter: show2, onFocus: show2, onMouseLeave: hide, onBlur: hide };
|
|
6138
6213
|
}
|
|
6139
6214
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
6140
|
-
const openState =
|
|
6215
|
+
const openState = React34.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
6141
6216
|
function isOpen(it) {
|
|
6142
6217
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
6143
6218
|
return !!it.defaultOpen || contains(it, active);
|
|
6144
6219
|
}
|
|
6145
|
-
|
|
6220
|
+
React34.useEffect(
|
|
6146
6221
|
function() {
|
|
6147
6222
|
if (!active) return;
|
|
6148
6223
|
const next = {};
|
|
@@ -6164,7 +6239,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6164
6239
|
},
|
|
6165
6240
|
[active]
|
|
6166
6241
|
);
|
|
6167
|
-
const navRef =
|
|
6242
|
+
const navRef = React34.useRef(null);
|
|
6168
6243
|
function onKeyDown(e) {
|
|
6169
6244
|
const k = e.key;
|
|
6170
6245
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -6183,12 +6258,12 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6183
6258
|
function inner(it, group, open) {
|
|
6184
6259
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
6185
6260
|
return [
|
|
6186
|
-
it.icon ? /* @__PURE__ */
|
|
6187
|
-
collapsed && marked ? /* @__PURE__ */
|
|
6188
|
-
/* @__PURE__ */
|
|
6189
|
-
it.badge != null ? /* @__PURE__ */
|
|
6190
|
-
it.count != null ? /* @__PURE__ */
|
|
6191
|
-
group ? /* @__PURE__ */
|
|
6261
|
+
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,
|
|
6262
|
+
collapsed && marked ? /* @__PURE__ */ React34.createElement("span", { key: "d", className: "aura-nav__dot", "aria-hidden": "true" }) : null,
|
|
6263
|
+
/* @__PURE__ */ React34.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
|
|
6264
|
+
it.badge != null ? /* @__PURE__ */ React34.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
|
|
6265
|
+
it.count != null ? /* @__PURE__ */ React34.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
|
|
6266
|
+
group ? /* @__PURE__ */ React34.createElement(Icon, { key: "g", name: /* @__PURE__ */ React34.createElement(IconChevronDown, null), className: cx("aura-nav__chevron", open && "is-open") }) : null
|
|
6192
6267
|
];
|
|
6193
6268
|
}
|
|
6194
6269
|
function item(it, depth) {
|
|
@@ -6196,7 +6271,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6196
6271
|
const open = !collapsed && isOpen(it);
|
|
6197
6272
|
const listId = base + "-" + it.id;
|
|
6198
6273
|
const holdsActive = contains(it, active);
|
|
6199
|
-
return /* @__PURE__ */
|
|
6274
|
+
return /* @__PURE__ */ React34.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React34.createElement(
|
|
6200
6275
|
"button",
|
|
6201
6276
|
{
|
|
6202
6277
|
type: "button",
|
|
@@ -6225,7 +6300,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6225
6300
|
}
|
|
6226
6301
|
},
|
|
6227
6302
|
inner(it, true, open)
|
|
6228
|
-
), /* @__PURE__ */
|
|
6303
|
+
), /* @__PURE__ */ React34.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
6229
6304
|
return item(c, depth + 1);
|
|
6230
6305
|
})));
|
|
6231
6306
|
}
|
|
@@ -6241,9 +6316,9 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6241
6316
|
st[1](it.id);
|
|
6242
6317
|
}
|
|
6243
6318
|
};
|
|
6244
|
-
return /* @__PURE__ */
|
|
6319
|
+
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
6320
|
}
|
|
6246
|
-
return /* @__PURE__ */
|
|
6321
|
+
return /* @__PURE__ */ React34.createElement(
|
|
6247
6322
|
"nav",
|
|
6248
6323
|
{
|
|
6249
6324
|
ref: function(el) {
|
|
@@ -6261,17 +6336,17 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6261
6336
|
"aria-label": props.label || t.mainNav,
|
|
6262
6337
|
onKeyDown
|
|
6263
6338
|
},
|
|
6264
|
-
props.header ? /* @__PURE__ */
|
|
6265
|
-
/* @__PURE__ */
|
|
6266
|
-
return /* @__PURE__ */
|
|
6339
|
+
props.header ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__header" }, props.header) : null,
|
|
6340
|
+
/* @__PURE__ */ React34.createElement("div", { className: "aura-nav__scroll" }, sections.map(function(s, i) {
|
|
6341
|
+
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
6342
|
return item(it, 0);
|
|
6268
6343
|
})));
|
|
6269
6344
|
})),
|
|
6270
|
-
props.footer ? /* @__PURE__ */
|
|
6271
|
-
props.collapsible ? /* @__PURE__ */
|
|
6345
|
+
props.footer ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
|
|
6346
|
+
props.collapsible ? /* @__PURE__ */ React34.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React34.createElement(
|
|
6272
6347
|
IconButton,
|
|
6273
6348
|
{
|
|
6274
|
-
icon: collapsed ? /* @__PURE__ */
|
|
6349
|
+
icon: collapsed ? /* @__PURE__ */ React34.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React34.createElement(IconPanelLeftClose, null),
|
|
6275
6350
|
label: collapsed ? t.expandNav : t.collapseNav,
|
|
6276
6351
|
size: "md",
|
|
6277
6352
|
onClick: function() {
|
|
@@ -6281,7 +6356,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6281
6356
|
}
|
|
6282
6357
|
)) : null,
|
|
6283
6358
|
tip && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
6284
|
-
/* @__PURE__ */
|
|
6359
|
+
/* @__PURE__ */ React34.createElement(
|
|
6285
6360
|
"div",
|
|
6286
6361
|
{
|
|
6287
6362
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -6296,35 +6371,35 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6296
6371
|
});
|
|
6297
6372
|
|
|
6298
6373
|
// src/Breadcrumb.tsx
|
|
6299
|
-
var
|
|
6300
|
-
var Breadcrumb =
|
|
6374
|
+
var React35 = __toESM(require("react"), 1);
|
|
6375
|
+
var Breadcrumb = React35.forwardRef(function Breadcrumb2(props, ref) {
|
|
6301
6376
|
const t = useStrings();
|
|
6302
6377
|
const Link = useLinkComponent(props.linkComponent);
|
|
6303
6378
|
const items2 = props.items || [];
|
|
6304
|
-
return /* @__PURE__ */
|
|
6379
|
+
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
6380
|
const last = i === items2.length - 1;
|
|
6306
|
-
return /* @__PURE__ */
|
|
6381
|
+
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
6382
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
6308
|
-
/* @__PURE__ */
|
|
6309
|
-
), last ? null : /* @__PURE__ */
|
|
6383
|
+
/* @__PURE__ */ React35.createElement("span", { className: "aura-crumbs__text" }, it.label)
|
|
6384
|
+
), last ? null : /* @__PURE__ */ React35.createElement(Icon, { name: /* @__PURE__ */ React35.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" }));
|
|
6310
6385
|
})));
|
|
6311
6386
|
});
|
|
6312
6387
|
|
|
6313
6388
|
// src/Avatar.tsx
|
|
6314
|
-
var
|
|
6389
|
+
var React36 = __toESM(require("react"), 1);
|
|
6315
6390
|
var AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
|
|
6316
6391
|
function initials(name) {
|
|
6317
6392
|
const parts = String(name || "?").trim().split(/\s+/);
|
|
6318
6393
|
return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
|
|
6319
6394
|
}
|
|
6320
|
-
var Avatar =
|
|
6321
|
-
const size = props.size || "md", errState =
|
|
6395
|
+
var Avatar = React36.forwardRef(function Avatar2(props, ref) {
|
|
6396
|
+
const size = props.size || "md", errState = React36.useState(null);
|
|
6322
6397
|
let hash = 0;
|
|
6323
6398
|
String(props.name || "").split("").forEach(function(ch) {
|
|
6324
6399
|
hash = hash * 31 + ch.charCodeAt(0) >>> 0;
|
|
6325
6400
|
});
|
|
6326
6401
|
const tone2 = AVATAR_TONES[hash % AVATAR_TONES.length];
|
|
6327
|
-
return /* @__PURE__ */
|
|
6402
|
+
return /* @__PURE__ */ React36.createElement(
|
|
6328
6403
|
"span",
|
|
6329
6404
|
{
|
|
6330
6405
|
ref,
|
|
@@ -6332,7 +6407,7 @@ var Avatar = React35.forwardRef(function Avatar2(props, ref) {
|
|
|
6332
6407
|
role: "img",
|
|
6333
6408
|
"aria-label": props.name + (props.status ? ", " + props.status : "")
|
|
6334
6409
|
},
|
|
6335
|
-
props.src && errState[0] !== props.src ? /* @__PURE__ */
|
|
6410
|
+
props.src && errState[0] !== props.src ? /* @__PURE__ */ React36.createElement(
|
|
6336
6411
|
"img",
|
|
6337
6412
|
{
|
|
6338
6413
|
key: props.src,
|
|
@@ -6342,16 +6417,16 @@ var Avatar = React35.forwardRef(function Avatar2(props, ref) {
|
|
|
6342
6417
|
errState[1](props.src || null);
|
|
6343
6418
|
}
|
|
6344
6419
|
}
|
|
6345
|
-
) : /* @__PURE__ */
|
|
6346
|
-
props.status === "online" ? /* @__PURE__ */
|
|
6420
|
+
) : /* @__PURE__ */ React36.createElement("span", { "aria-hidden": true }, initials(props.name)),
|
|
6421
|
+
props.status === "online" ? /* @__PURE__ */ React36.createElement("span", { className: "aura-avatar__status", "aria-hidden": true }) : null
|
|
6347
6422
|
);
|
|
6348
6423
|
});
|
|
6349
6424
|
|
|
6350
6425
|
// src/Stack.tsx
|
|
6351
|
-
var
|
|
6426
|
+
var React38 = __toESM(require("react"), 1);
|
|
6352
6427
|
|
|
6353
6428
|
// src/responsive.tsx
|
|
6354
|
-
var
|
|
6429
|
+
var React37 = __toESM(require("react"), 1);
|
|
6355
6430
|
|
|
6356
6431
|
// src/breakpoints.ts
|
|
6357
6432
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
@@ -6359,7 +6434,7 @@ var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
|
6359
6434
|
// src/responsive.tsx
|
|
6360
6435
|
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
6361
6436
|
function useBreakpoint() {
|
|
6362
|
-
return
|
|
6437
|
+
return React37.useSyncExternalStore(subscribe, current, function() {
|
|
6363
6438
|
return "lg";
|
|
6364
6439
|
});
|
|
6365
6440
|
}
|
|
@@ -6399,8 +6474,8 @@ var space = function(v) {
|
|
|
6399
6474
|
};
|
|
6400
6475
|
|
|
6401
6476
|
// src/Stack.tsx
|
|
6402
|
-
var h5 =
|
|
6403
|
-
var Stack =
|
|
6477
|
+
var h5 = React38.createElement;
|
|
6478
|
+
var Stack = React38.forwardRef(function Stack2(props, ref) {
|
|
6404
6479
|
const style = Object.assign(
|
|
6405
6480
|
{},
|
|
6406
6481
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -6414,9 +6489,9 @@ var Stack = React37.forwardRef(function Stack2(props, ref) {
|
|
|
6414
6489
|
});
|
|
6415
6490
|
|
|
6416
6491
|
// src/Grid.tsx
|
|
6417
|
-
var
|
|
6418
|
-
var h6 =
|
|
6419
|
-
var Grid =
|
|
6492
|
+
var React39 = __toESM(require("react"), 1);
|
|
6493
|
+
var h6 = React39.createElement;
|
|
6494
|
+
var Grid = React39.forwardRef(function Grid2(props, ref) {
|
|
6420
6495
|
const style = Object.assign(
|
|
6421
6496
|
{},
|
|
6422
6497
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -6431,9 +6506,9 @@ var Grid = React38.forwardRef(function Grid2(props, ref) {
|
|
|
6431
6506
|
});
|
|
6432
6507
|
|
|
6433
6508
|
// src/Container.tsx
|
|
6434
|
-
var
|
|
6435
|
-
var h7 =
|
|
6436
|
-
var Container =
|
|
6509
|
+
var React40 = __toESM(require("react"), 1);
|
|
6510
|
+
var h7 = React40.createElement;
|
|
6511
|
+
var Container = React40.forwardRef(function Container2(props, ref) {
|
|
6437
6512
|
return h7(
|
|
6438
6513
|
props.as || "div",
|
|
6439
6514
|
{
|
|
@@ -6446,27 +6521,27 @@ var Container = React39.forwardRef(function Container2(props, ref) {
|
|
|
6446
6521
|
});
|
|
6447
6522
|
|
|
6448
6523
|
// src/AppShell.tsx
|
|
6449
|
-
var
|
|
6450
|
-
var AppShell =
|
|
6524
|
+
var React41 = __toESM(require("react"), 1);
|
|
6525
|
+
var AppShell = React41.forwardRef(function AppShell2(props, ref) {
|
|
6451
6526
|
const t = useStrings();
|
|
6452
6527
|
const bp = useBreakpoint();
|
|
6453
6528
|
const wide = bp === "lg" || bp === "xl";
|
|
6454
|
-
const st =
|
|
6455
|
-
|
|
6529
|
+
const st = React41.useState(false), open = st[0], setOpen = st[1];
|
|
6530
|
+
React41.useEffect(
|
|
6456
6531
|
function() {
|
|
6457
6532
|
if (wide) setOpen(false);
|
|
6458
6533
|
},
|
|
6459
6534
|
[wide]
|
|
6460
6535
|
);
|
|
6461
|
-
const navEl = props.nav &&
|
|
6536
|
+
const navEl = props.nav && React41.isValidElement(props.nav) ? props.nav : null;
|
|
6462
6537
|
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 =
|
|
6538
|
+
const navState = React41.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
6464
6539
|
function onNav(id) {
|
|
6465
6540
|
if (shared) navState[1](id);
|
|
6466
6541
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
6467
6542
|
}
|
|
6468
|
-
const deskNav = navEl && shared ?
|
|
6469
|
-
const drawerNav = navEl ?
|
|
6543
|
+
const deskNav = navEl && shared ? React41.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
6544
|
+
const drawerNav = navEl ? React41.cloneElement(navEl, {
|
|
6470
6545
|
value: shared ? navState[0] : navEl.props.value,
|
|
6471
6546
|
onChange: function(id) {
|
|
6472
6547
|
onNav(id);
|
|
@@ -6476,7 +6551,7 @@ var AppShell = React40.forwardRef(function AppShell2(props, ref) {
|
|
|
6476
6551
|
collapsed: false,
|
|
6477
6552
|
collapsible: false
|
|
6478
6553
|
}) : props.nav;
|
|
6479
|
-
return /* @__PURE__ */
|
|
6554
|
+
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
6555
|
Drawer,
|
|
6481
6556
|
{
|
|
6482
6557
|
open,
|
|
@@ -6489,11 +6564,11 @@ var AppShell = React40.forwardRef(function AppShell2(props, ref) {
|
|
|
6489
6564
|
dismissible: true
|
|
6490
6565
|
},
|
|
6491
6566
|
drawerNav
|
|
6492
|
-
) : null, /* @__PURE__ */
|
|
6567
|
+
) : 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
6568
|
IconButton,
|
|
6494
6569
|
{
|
|
6495
6570
|
className: "aura-shell__menu",
|
|
6496
|
-
icon: /* @__PURE__ */
|
|
6571
|
+
icon: /* @__PURE__ */ React41.createElement(IconMenu, null),
|
|
6497
6572
|
label: props.menuLabel || t.openNav,
|
|
6498
6573
|
size: "md",
|
|
6499
6574
|
onClick: function() {
|
|
@@ -6501,18 +6576,18 @@ var AppShell = React40.forwardRef(function AppShell2(props, ref) {
|
|
|
6501
6576
|
},
|
|
6502
6577
|
"aria-expanded": open
|
|
6503
6578
|
}
|
|
6504
|
-
) : null, /* @__PURE__ */
|
|
6579
|
+
) : 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
6580
|
});
|
|
6506
6581
|
|
|
6507
6582
|
// src/ActionBar.tsx
|
|
6508
|
-
var
|
|
6509
|
-
var ActionBar =
|
|
6583
|
+
var React42 = __toESM(require("react"), 1);
|
|
6584
|
+
var ActionBar = React42.forwardRef(function ActionBar2(props, ref) {
|
|
6510
6585
|
const t = useStrings();
|
|
6511
6586
|
const bulk = props.selected != null;
|
|
6512
6587
|
const idle = bulk && !props.selected;
|
|
6513
6588
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
6514
|
-
const cameFrom =
|
|
6515
|
-
const own =
|
|
6589
|
+
const cameFrom = React42.useRef(null);
|
|
6590
|
+
const own = React42.useRef(null);
|
|
6516
6591
|
function clear() {
|
|
6517
6592
|
props.onClearSelection();
|
|
6518
6593
|
setTimeout(function() {
|
|
@@ -6521,7 +6596,7 @@ var ActionBar = React41.forwardRef(function ActionBar2(props, ref) {
|
|
|
6521
6596
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
6522
6597
|
}, 0);
|
|
6523
6598
|
}
|
|
6524
|
-
return /* @__PURE__ */
|
|
6599
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6525
6600
|
"div",
|
|
6526
6601
|
{
|
|
6527
6602
|
ref: function(el) {
|
|
@@ -6542,16 +6617,16 @@ var ActionBar = React41.forwardRef(function ActionBar2(props, ref) {
|
|
|
6542
6617
|
props.className
|
|
6543
6618
|
)
|
|
6544
6619
|
},
|
|
6545
|
-
/* @__PURE__ */
|
|
6620
|
+
/* @__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
6621
|
);
|
|
6547
6622
|
});
|
|
6548
6623
|
|
|
6549
6624
|
// src/Separator.tsx
|
|
6550
|
-
var
|
|
6551
|
-
var Separator =
|
|
6625
|
+
var React43 = __toESM(require("react"), 1);
|
|
6626
|
+
var Separator = React43.forwardRef(function Separator2(props, ref) {
|
|
6552
6627
|
const vertical = props.orientation === "vertical";
|
|
6553
6628
|
const decorative = props.decorative !== false;
|
|
6554
|
-
return /* @__PURE__ */
|
|
6629
|
+
return /* @__PURE__ */ React43.createElement(
|
|
6555
6630
|
"div",
|
|
6556
6631
|
{
|
|
6557
6632
|
ref,
|
|
@@ -6564,13 +6639,13 @@ var Separator = React42.forwardRef(function Separator2(props, ref) {
|
|
|
6564
6639
|
});
|
|
6565
6640
|
|
|
6566
6641
|
// src/Table.tsx
|
|
6567
|
-
var
|
|
6568
|
-
var StackLabels =
|
|
6569
|
-
var ColumnIndex =
|
|
6642
|
+
var React44 = __toESM(require("react"), 1);
|
|
6643
|
+
var StackLabels = React44.createContext(null);
|
|
6644
|
+
var ColumnIndex = React44.createContext(-1);
|
|
6570
6645
|
function flat(children) {
|
|
6571
6646
|
const out = [];
|
|
6572
|
-
|
|
6573
|
-
if (
|
|
6647
|
+
React44.Children.toArray(children).forEach(function(c) {
|
|
6648
|
+
if (React44.isValidElement(c) && c.type === React44.Fragment)
|
|
6574
6649
|
out.push.apply(out, flat(c.props.children));
|
|
6575
6650
|
else out.push(c);
|
|
6576
6651
|
});
|
|
@@ -6584,7 +6659,7 @@ function text(node) {
|
|
|
6584
6659
|
});
|
|
6585
6660
|
return parts.length ? parts.join("") : void 0;
|
|
6586
6661
|
}
|
|
6587
|
-
if (
|
|
6662
|
+
if (React44.isValidElement(node)) {
|
|
6588
6663
|
const p = node.props;
|
|
6589
6664
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
6590
6665
|
return text(p.children);
|
|
@@ -6594,13 +6669,13 @@ function text(node) {
|
|
|
6594
6669
|
function headerLabels(children) {
|
|
6595
6670
|
let out = [];
|
|
6596
6671
|
flat(children).forEach(function(c) {
|
|
6597
|
-
if (out.length || !
|
|
6672
|
+
if (out.length || !React44.isValidElement(c) || c.type !== THead) return;
|
|
6598
6673
|
const row = flat(c.props.children).find(function(r) {
|
|
6599
|
-
return
|
|
6674
|
+
return React44.isValidElement(r);
|
|
6600
6675
|
});
|
|
6601
6676
|
if (!row) return;
|
|
6602
6677
|
flat(row.props.children).forEach(function(cell) {
|
|
6603
|
-
if (!
|
|
6678
|
+
if (!React44.isValidElement(cell)) return;
|
|
6604
6679
|
const p = cell.props;
|
|
6605
6680
|
const t = text(p.children);
|
|
6606
6681
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -6610,7 +6685,7 @@ function headerLabels(children) {
|
|
|
6610
6685
|
});
|
|
6611
6686
|
return out;
|
|
6612
6687
|
}
|
|
6613
|
-
var Table =
|
|
6688
|
+
var Table = React44.forwardRef(function Table2(props, ref) {
|
|
6614
6689
|
const { caption, captionHidden, density, stackBelow, className, children, ...rest } = props;
|
|
6615
6690
|
const labels = stackBelow ? headerLabels(children) : null;
|
|
6616
6691
|
if (labels && !labels.length)
|
|
@@ -6618,10 +6693,10 @@ var Table = React43.forwardRef(function Table2(props, ref) {
|
|
|
6618
6693
|
"tbl-stack-labels",
|
|
6619
6694
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
6620
6695
|
);
|
|
6621
|
-
const outer =
|
|
6696
|
+
const outer = React44.useContext(StackLabels);
|
|
6622
6697
|
const capId = uid();
|
|
6623
|
-
const wrap =
|
|
6624
|
-
const sc =
|
|
6698
|
+
const wrap = React44.useRef(null);
|
|
6699
|
+
const sc = React44.useState(false), scrolls = sc[0];
|
|
6625
6700
|
useIsoLayoutEffect(function() {
|
|
6626
6701
|
const el = wrap.current;
|
|
6627
6702
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -6635,7 +6710,7 @@ var Table = React43.forwardRef(function Table2(props, ref) {
|
|
|
6635
6710
|
ro.disconnect();
|
|
6636
6711
|
};
|
|
6637
6712
|
}, []);
|
|
6638
|
-
return /* @__PURE__ */
|
|
6713
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6639
6714
|
"div",
|
|
6640
6715
|
{
|
|
6641
6716
|
ref: wrap,
|
|
@@ -6646,7 +6721,7 @@ var Table = React43.forwardRef(function Table2(props, ref) {
|
|
|
6646
6721
|
"aria-labelledby": scrolls && caption != null ? capId : void 0,
|
|
6647
6722
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
6648
6723
|
},
|
|
6649
|
-
/* @__PURE__ */
|
|
6724
|
+
/* @__PURE__ */ React44.createElement(
|
|
6650
6725
|
"table",
|
|
6651
6726
|
{
|
|
6652
6727
|
ref,
|
|
@@ -6654,16 +6729,16 @@ var Table = React43.forwardRef(function Table2(props, ref) {
|
|
|
6654
6729
|
role: stackBelow ? "table" : void 0,
|
|
6655
6730
|
...rest
|
|
6656
6731
|
},
|
|
6657
|
-
caption != null ? /* @__PURE__ */
|
|
6658
|
-
labels ? /* @__PURE__ */
|
|
6732
|
+
caption != null ? /* @__PURE__ */ React44.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
6733
|
+
labels ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React44.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
6659
6734
|
)
|
|
6660
6735
|
);
|
|
6661
6736
|
});
|
|
6662
6737
|
function section(tag, cls) {
|
|
6663
|
-
const C =
|
|
6738
|
+
const C = React44.forwardRef(function TableSection(props, ref) {
|
|
6664
6739
|
const { className, ...rest } = props;
|
|
6665
|
-
const stacked =
|
|
6666
|
-
return
|
|
6740
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6741
|
+
return React44.createElement(
|
|
6667
6742
|
tag,
|
|
6668
6743
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
6669
6744
|
);
|
|
@@ -6676,14 +6751,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
6676
6751
|
TBody.displayName = "TBody";
|
|
6677
6752
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
6678
6753
|
TFoot.displayName = "TFoot";
|
|
6679
|
-
var Tr =
|
|
6754
|
+
var Tr = React44.forwardRef(function Tr2(props, ref) {
|
|
6680
6755
|
const { className, children, ...rest } = props;
|
|
6681
|
-
const stacked =
|
|
6756
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6682
6757
|
let col = 0;
|
|
6683
|
-
return /* @__PURE__ */
|
|
6758
|
+
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
6759
|
const at = col;
|
|
6685
|
-
if (
|
|
6686
|
-
return /* @__PURE__ */
|
|
6760
|
+
if (React44.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
6761
|
+
return /* @__PURE__ */ React44.createElement(ColumnIndex.Provider, { key: React44.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
6687
6762
|
}) : children);
|
|
6688
6763
|
});
|
|
6689
6764
|
function cellClass(base, p) {
|
|
@@ -6697,10 +6772,10 @@ function cellClass(base, p) {
|
|
|
6697
6772
|
p.className
|
|
6698
6773
|
);
|
|
6699
6774
|
}
|
|
6700
|
-
var Th =
|
|
6775
|
+
var Th = React44.forwardRef(function Th2(props, ref) {
|
|
6701
6776
|
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6702
|
-
const stacked =
|
|
6703
|
-
return /* @__PURE__ */
|
|
6777
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6778
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6704
6779
|
"th",
|
|
6705
6780
|
{
|
|
6706
6781
|
ref,
|
|
@@ -6711,11 +6786,11 @@ var Th = React43.forwardRef(function Th2(props, ref) {
|
|
|
6711
6786
|
}
|
|
6712
6787
|
);
|
|
6713
6788
|
});
|
|
6714
|
-
var Td =
|
|
6789
|
+
var Td = React44.forwardRef(function Td2(props, ref) {
|
|
6715
6790
|
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6716
|
-
const labels =
|
|
6791
|
+
const labels = React44.useContext(StackLabels), col = React44.useContext(ColumnIndex);
|
|
6717
6792
|
const shown = labels ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
6718
|
-
return /* @__PURE__ */
|
|
6793
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6719
6794
|
"td",
|
|
6720
6795
|
{
|
|
6721
6796
|
ref,
|
|
@@ -6728,8 +6803,8 @@ var Td = React43.forwardRef(function Td2(props, ref) {
|
|
|
6728
6803
|
});
|
|
6729
6804
|
|
|
6730
6805
|
// src/BottomNav.tsx
|
|
6731
|
-
var
|
|
6732
|
-
var BottomNav =
|
|
6806
|
+
var React45 = __toESM(require("react"), 1);
|
|
6807
|
+
var BottomNav = React45.forwardRef(function BottomNav2(props, ref) {
|
|
6733
6808
|
const t = useStrings();
|
|
6734
6809
|
const Link = useLinkComponent(props.linkComponent);
|
|
6735
6810
|
const st = useMaybeControlled(
|
|
@@ -6739,14 +6814,14 @@ var BottomNav = React44.forwardRef(function BottomNav2(props, ref) {
|
|
|
6739
6814
|
);
|
|
6740
6815
|
const active = st[0];
|
|
6741
6816
|
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
6742
|
-
return /* @__PURE__ */
|
|
6817
|
+
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
6818
|
"nav",
|
|
6744
6819
|
{
|
|
6745
6820
|
ref,
|
|
6746
6821
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
6747
6822
|
"aria-label": props.label || t.mainNav
|
|
6748
6823
|
},
|
|
6749
|
-
/* @__PURE__ */
|
|
6824
|
+
/* @__PURE__ */ React45.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
6750
6825
|
const on = active === it.id;
|
|
6751
6826
|
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
6752
6827
|
const suffix = count || it.badge && it.badgeLabel ? " (" + (count || it.badgeLabel) + ")" : "";
|
|
@@ -6762,19 +6837,19 @@ var BottomNav = React44.forwardRef(function BottomNav2(props, ref) {
|
|
|
6762
6837
|
}
|
|
6763
6838
|
};
|
|
6764
6839
|
const inner = [
|
|
6765
|
-
/* @__PURE__ */
|
|
6766
|
-
/* @__PURE__ */
|
|
6767
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
6840
|
+
/* @__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),
|
|
6841
|
+
/* @__PURE__ */ React45.createElement("span", { key: "l", className: "aura-bottomnav__label" }, it.label),
|
|
6842
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React45.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
6768
6843
|
];
|
|
6769
|
-
return /* @__PURE__ */
|
|
6844
|
+
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
6845
|
}))
|
|
6771
6846
|
));
|
|
6772
6847
|
});
|
|
6773
6848
|
|
|
6774
6849
|
// src/Surface.tsx
|
|
6775
|
-
var
|
|
6776
|
-
var h8 =
|
|
6777
|
-
var Surface =
|
|
6850
|
+
var React46 = __toESM(require("react"), 1);
|
|
6851
|
+
var h8 = React46.createElement;
|
|
6852
|
+
var Surface = React46.forwardRef(function Surface2(props, ref) {
|
|
6778
6853
|
const t = props.texture || "mesh";
|
|
6779
6854
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
6780
6855
|
return h8(
|
|
@@ -6795,8 +6870,8 @@ var Surface = React45.forwardRef(function Surface2(props, ref) {
|
|
|
6795
6870
|
});
|
|
6796
6871
|
|
|
6797
6872
|
// src/Stat.tsx
|
|
6798
|
-
var
|
|
6799
|
-
var Stat =
|
|
6873
|
+
var React47 = __toESM(require("react"), 1);
|
|
6874
|
+
var Stat = React47.forwardRef(function Stat2(props, ref) {
|
|
6800
6875
|
const ch = props.change;
|
|
6801
6876
|
const dir = ch && (ch.direction || "flat");
|
|
6802
6877
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -6805,7 +6880,7 @@ var Stat = React46.forwardRef(function Stat2(props, ref) {
|
|
|
6805
6880
|
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
6881
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
6807
6882
|
const interactive = !!(props.href || props.onClick);
|
|
6808
|
-
return /* @__PURE__ */
|
|
6883
|
+
return /* @__PURE__ */ React47.createElement(
|
|
6809
6884
|
Tag3,
|
|
6810
6885
|
{
|
|
6811
6886
|
ref,
|
|
@@ -6815,20 +6890,20 @@ var Stat = React46.forwardRef(function Stat2(props, ref) {
|
|
|
6815
6890
|
type: Tag3 === "button" ? "button" : void 0,
|
|
6816
6891
|
"aria-busy": props.loading || void 0
|
|
6817
6892
|
},
|
|
6818
|
-
/* @__PURE__ */
|
|
6819
|
-
props.loading ? /* @__PURE__ */
|
|
6820
|
-
ch && !props.loading || props.caption ? /* @__PURE__ */
|
|
6893
|
+
/* @__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),
|
|
6894
|
+
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),
|
|
6895
|
+
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
6896
|
Icon,
|
|
6822
6897
|
{
|
|
6823
|
-
name: dir === "up" ? /* @__PURE__ */
|
|
6898
|
+
name: dir === "up" ? /* @__PURE__ */ React47.createElement(IconTrendingUp, null) : dir === "down" ? /* @__PURE__ */ React47.createElement(IconTrendingDown, null) : /* @__PURE__ */ React47.createElement(IconMinus, null),
|
|
6824
6899
|
size: 14
|
|
6825
6900
|
}
|
|
6826
|
-
), /* @__PURE__ */
|
|
6901
|
+
), /* @__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
6902
|
);
|
|
6828
6903
|
});
|
|
6829
6904
|
|
|
6830
6905
|
// src/TimePicker.tsx
|
|
6831
|
-
var
|
|
6906
|
+
var React48 = __toESM(require("react"), 1);
|
|
6832
6907
|
var import_react_dom11 = require("react-dom");
|
|
6833
6908
|
|
|
6834
6909
|
// src/text.ts
|
|
@@ -6870,7 +6945,7 @@ function toMin(t) {
|
|
|
6870
6945
|
function fromMin(n3) {
|
|
6871
6946
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
6872
6947
|
}
|
|
6873
|
-
var TimePicker =
|
|
6948
|
+
var TimePicker = React48.forwardRef(function TimePicker2(props, ref) {
|
|
6874
6949
|
const t = useStrings();
|
|
6875
6950
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
6876
6951
|
const st = useMaybeControlled(
|
|
@@ -6880,7 +6955,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6880
6955
|
);
|
|
6881
6956
|
const value = st[0];
|
|
6882
6957
|
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 =
|
|
6958
|
+
const slots = React48.useMemo(
|
|
6884
6959
|
function() {
|
|
6885
6960
|
const out = [];
|
|
6886
6961
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -6892,12 +6967,12 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6892
6967
|
const n3 = toMin(v);
|
|
6893
6968
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
6894
6969
|
}
|
|
6895
|
-
const openState =
|
|
6896
|
-
const editState =
|
|
6897
|
-
const aState =
|
|
6898
|
-
const errState =
|
|
6899
|
-
const pos =
|
|
6900
|
-
const boxRef =
|
|
6970
|
+
const openState = React48.useState(false), open = openState[0], setOpen = openState[1];
|
|
6971
|
+
const editState = React48.useState(null), editing = editState[0], setEditing = editState[1];
|
|
6972
|
+
const aState = React48.useState(0), active = aState[0], setActive = aState[1];
|
|
6973
|
+
const errState = React48.useState(null);
|
|
6974
|
+
const pos = React48.useState(null);
|
|
6975
|
+
const boxRef = React48.useRef(null), inputRef = React48.useRef(null), listRef = React48.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
6901
6976
|
const mounted = useMounted();
|
|
6902
6977
|
function nearest(v) {
|
|
6903
6978
|
const n3 = toMin(v);
|
|
@@ -6925,7 +7000,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6925
7000
|
},
|
|
6926
7001
|
[open]
|
|
6927
7002
|
);
|
|
6928
|
-
|
|
7003
|
+
React48.useEffect(
|
|
6929
7004
|
function() {
|
|
6930
7005
|
if (!open) return;
|
|
6931
7006
|
function outside(e) {
|
|
@@ -6947,7 +7022,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6947
7022
|
},
|
|
6948
7023
|
[open]
|
|
6949
7024
|
);
|
|
6950
|
-
|
|
7025
|
+
React48.useEffect(
|
|
6951
7026
|
function() {
|
|
6952
7027
|
if (!open || !listRef.current) return;
|
|
6953
7028
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -7046,9 +7121,9 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7046
7121
|
}
|
|
7047
7122
|
const error = errState[0] || props.error;
|
|
7048
7123
|
const list = open && mounted && pos[0] ? (0, import_react_dom11.createPortal)(
|
|
7049
|
-
/* @__PURE__ */
|
|
7124
|
+
/* @__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
7125
|
const dis = blocked(s), sel = s === value;
|
|
7051
|
-
return /* @__PURE__ */
|
|
7126
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7052
7127
|
"li",
|
|
7053
7128
|
{
|
|
7054
7129
|
key: s,
|
|
@@ -7073,13 +7148,13 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7073
7148
|
if (active !== i) setActive(i);
|
|
7074
7149
|
}
|
|
7075
7150
|
},
|
|
7076
|
-
/* @__PURE__ */
|
|
7077
|
-
sel ? /* @__PURE__ */
|
|
7151
|
+
/* @__PURE__ */ React48.createElement("span", { className: "aura-combo__label" }, s),
|
|
7152
|
+
sel ? /* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
7078
7153
|
);
|
|
7079
7154
|
}))),
|
|
7080
7155
|
document.body
|
|
7081
7156
|
) : null;
|
|
7082
|
-
return /* @__PURE__ */
|
|
7157
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7083
7158
|
Field,
|
|
7084
7159
|
{
|
|
7085
7160
|
id,
|
|
@@ -7091,7 +7166,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7091
7166
|
disabled: props.disabled,
|
|
7092
7167
|
className: props.className
|
|
7093
7168
|
},
|
|
7094
|
-
/* @__PURE__ */
|
|
7169
|
+
/* @__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
7170
|
"input",
|
|
7096
7171
|
{
|
|
7097
7172
|
ref: inputMerged,
|
|
@@ -7131,7 +7206,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7131
7206
|
}, 0);
|
|
7132
7207
|
}
|
|
7133
7208
|
}
|
|
7134
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
7209
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React48.createElement(
|
|
7135
7210
|
"button",
|
|
7136
7211
|
{
|
|
7137
7212
|
type: "button",
|
|
@@ -7144,8 +7219,8 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7144
7219
|
if (inputRef.current) inputRef.current.focus();
|
|
7145
7220
|
}
|
|
7146
7221
|
},
|
|
7147
|
-
/* @__PURE__ */
|
|
7148
|
-
) : null, /* @__PURE__ */
|
|
7222
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconX, null) })
|
|
7223
|
+
) : null, /* @__PURE__ */ React48.createElement(
|
|
7149
7224
|
"button",
|
|
7150
7225
|
{
|
|
7151
7226
|
type: "button",
|
|
@@ -7163,14 +7238,14 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7163
7238
|
}
|
|
7164
7239
|
}
|
|
7165
7240
|
},
|
|
7166
|
-
/* @__PURE__ */
|
|
7241
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconChevronDown, null) })
|
|
7167
7242
|
)),
|
|
7168
7243
|
list
|
|
7169
7244
|
);
|
|
7170
7245
|
});
|
|
7171
7246
|
|
|
7172
7247
|
// src/FileUpload.tsx
|
|
7173
|
-
var
|
|
7248
|
+
var React49 = __toESM(require("react"), 1);
|
|
7174
7249
|
function matches(file, accept) {
|
|
7175
7250
|
if (!accept) return true;
|
|
7176
7251
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -7194,24 +7269,24 @@ function describeAccept(accept, t) {
|
|
|
7194
7269
|
}).join(", ");
|
|
7195
7270
|
}
|
|
7196
7271
|
var seq = 0;
|
|
7197
|
-
var FileUpload =
|
|
7272
|
+
var FileUpload = React49.forwardRef(function FileUpload2(props, ref) {
|
|
7198
7273
|
const t = useStrings();
|
|
7199
7274
|
const auto = uid(), id = props.id || auto;
|
|
7200
7275
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
7201
7276
|
const items2 = st[0] || [];
|
|
7202
|
-
const dragState =
|
|
7203
|
-
const inputRef =
|
|
7204
|
-
const urls =
|
|
7277
|
+
const dragState = React49.useState(false), over = dragState[0];
|
|
7278
|
+
const inputRef = React49.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
7279
|
+
const urls = React49.useRef({});
|
|
7205
7280
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
7206
7281
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
7207
|
-
|
|
7282
|
+
React49.useEffect(function() {
|
|
7208
7283
|
return function() {
|
|
7209
7284
|
Object.keys(urls.current).forEach(function(k) {
|
|
7210
7285
|
URL.revokeObjectURL(urls.current[k]);
|
|
7211
7286
|
});
|
|
7212
7287
|
};
|
|
7213
7288
|
}, []);
|
|
7214
|
-
|
|
7289
|
+
React49.useEffect(
|
|
7215
7290
|
function() {
|
|
7216
7291
|
const el = inputRef.current;
|
|
7217
7292
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -7271,7 +7346,7 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7271
7346
|
if (inputRef.current) inputRef.current.focus();
|
|
7272
7347
|
}
|
|
7273
7348
|
const error = props.error;
|
|
7274
|
-
return /* @__PURE__ */
|
|
7349
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7275
7350
|
Field,
|
|
7276
7351
|
{
|
|
7277
7352
|
id,
|
|
@@ -7283,7 +7358,7 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7283
7358
|
disabled: props.disabled,
|
|
7284
7359
|
className: props.className
|
|
7285
7360
|
},
|
|
7286
|
-
/* @__PURE__ */
|
|
7361
|
+
/* @__PURE__ */ React49.createElement(
|
|
7287
7362
|
"div",
|
|
7288
7363
|
{
|
|
7289
7364
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -7304,9 +7379,9 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7304
7379
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
7305
7380
|
}
|
|
7306
7381
|
},
|
|
7307
|
-
/* @__PURE__ */
|
|
7308
|
-
/* @__PURE__ */
|
|
7309
|
-
/* @__PURE__ */
|
|
7382
|
+
/* @__PURE__ */ React49.createElement(Icon, { name: /* @__PURE__ */ React49.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
7383
|
+
/* @__PURE__ */ React49.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
7384
|
+
/* @__PURE__ */ React49.createElement(
|
|
7310
7385
|
"input",
|
|
7311
7386
|
{
|
|
7312
7387
|
ref: inputMerged,
|
|
@@ -7328,12 +7403,12 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7328
7403
|
}
|
|
7329
7404
|
}
|
|
7330
7405
|
),
|
|
7331
|
-
/* @__PURE__ */
|
|
7332
|
-
note ? /* @__PURE__ */
|
|
7406
|
+
/* @__PURE__ */ React49.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
7407
|
+
note ? /* @__PURE__ */ React49.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
7333
7408
|
),
|
|
7334
|
-
items2.length ? /* @__PURE__ */
|
|
7409
|
+
items2.length ? /* @__PURE__ */ React49.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
7335
7410
|
const src = thumb(it);
|
|
7336
|
-
return /* @__PURE__ */
|
|
7411
|
+
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
7412
|
"span",
|
|
7338
7413
|
{
|
|
7339
7414
|
className: "aura-upload__bar",
|
|
@@ -7343,11 +7418,11 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7343
7418
|
"aria-valuemax": 100,
|
|
7344
7419
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
7345
7420
|
},
|
|
7346
|
-
/* @__PURE__ */
|
|
7347
|
-
) : null), /* @__PURE__ */
|
|
7421
|
+
/* @__PURE__ */ React49.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
7422
|
+
) : null), /* @__PURE__ */ React49.createElement(
|
|
7348
7423
|
IconButton,
|
|
7349
7424
|
{
|
|
7350
|
-
icon: /* @__PURE__ */
|
|
7425
|
+
icon: /* @__PURE__ */ React49.createElement(IconX, null),
|
|
7351
7426
|
label: t.remove(it.name),
|
|
7352
7427
|
onClick: function() {
|
|
7353
7428
|
remove(it);
|
|
@@ -7632,9 +7707,9 @@ function createTheme(opts) {
|
|
|
7632
7707
|
}
|
|
7633
7708
|
|
|
7634
7709
|
// src/ThemeStyle.tsx
|
|
7635
|
-
var
|
|
7710
|
+
var React50 = __toESM(require("react"), 1);
|
|
7636
7711
|
function ThemeStyle(props) {
|
|
7637
|
-
const css =
|
|
7712
|
+
const css = React50.useMemo(
|
|
7638
7713
|
function() {
|
|
7639
7714
|
try {
|
|
7640
7715
|
return createTheme({
|
|
@@ -7651,11 +7726,11 @@ function ThemeStyle(props) {
|
|
|
7651
7726
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
7652
7727
|
);
|
|
7653
7728
|
if (css === null) return null;
|
|
7654
|
-
return /* @__PURE__ */
|
|
7729
|
+
return /* @__PURE__ */ React50.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
7655
7730
|
}
|
|
7656
7731
|
|
|
7657
7732
|
// src/colorScheme.tsx
|
|
7658
|
-
var
|
|
7733
|
+
var React51 = __toESM(require("react"), 1);
|
|
7659
7734
|
|
|
7660
7735
|
// src/colorSchemeScript.ts
|
|
7661
7736
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -7672,7 +7747,7 @@ function colorSchemeScript(options) {
|
|
|
7672
7747
|
|
|
7673
7748
|
// src/colorScheme.tsx
|
|
7674
7749
|
function ColorSchemeScript(props) {
|
|
7675
|
-
return /* @__PURE__ */
|
|
7750
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7676
7751
|
"script",
|
|
7677
7752
|
{
|
|
7678
7753
|
"data-aura-color-scheme": "",
|
|
@@ -7697,7 +7772,7 @@ function apply(scheme) {
|
|
|
7697
7772
|
function useColorScheme(options) {
|
|
7698
7773
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
7699
7774
|
const fallback = options && options.defaultScheme || "system";
|
|
7700
|
-
const subscribe2 =
|
|
7775
|
+
const subscribe2 = React51.useCallback(
|
|
7701
7776
|
function(cb) {
|
|
7702
7777
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
7703
7778
|
function onSystem() {
|
|
@@ -7719,7 +7794,7 @@ function useColorScheme(options) {
|
|
|
7719
7794
|
},
|
|
7720
7795
|
[fallback, key]
|
|
7721
7796
|
);
|
|
7722
|
-
const snapshot =
|
|
7797
|
+
const snapshot = React51.useSyncExternalStore(
|
|
7723
7798
|
subscribe2,
|
|
7724
7799
|
function() {
|
|
7725
7800
|
const s = readScheme(fallback);
|
|
@@ -7730,7 +7805,7 @@ function useColorScheme(options) {
|
|
|
7730
7805
|
}
|
|
7731
7806
|
);
|
|
7732
7807
|
const parts = snapshot.split("|");
|
|
7733
|
-
const setScheme =
|
|
7808
|
+
const setScheme = React51.useCallback(
|
|
7734
7809
|
function(next) {
|
|
7735
7810
|
if (!valid(next)) return;
|
|
7736
7811
|
try {
|
|
@@ -7749,14 +7824,14 @@ function ColorSchemeToggle(props) {
|
|
|
7749
7824
|
const cs = useColorScheme(props);
|
|
7750
7825
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
7751
7826
|
const label = props.label || t.colorScheme;
|
|
7752
|
-
return /* @__PURE__ */
|
|
7827
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7753
7828
|
DropdownMenu,
|
|
7754
7829
|
{
|
|
7755
7830
|
label,
|
|
7756
|
-
trigger: /* @__PURE__ */
|
|
7831
|
+
trigger: /* @__PURE__ */ React51.createElement(
|
|
7757
7832
|
IconButton,
|
|
7758
7833
|
{
|
|
7759
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
7834
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React51.createElement(IconMoon, null) : /* @__PURE__ */ React51.createElement(IconSun, null),
|
|
7760
7835
|
label: label + ": " + names[cs.scheme]
|
|
7761
7836
|
}
|
|
7762
7837
|
),
|
|
@@ -7774,19 +7849,19 @@ function ColorSchemeToggle(props) {
|
|
|
7774
7849
|
}
|
|
7775
7850
|
|
|
7776
7851
|
// src/Badge.tsx
|
|
7777
|
-
var
|
|
7778
|
-
var Badge =
|
|
7852
|
+
var React52 = __toESM(require("react"), 1);
|
|
7853
|
+
var Badge = React52.forwardRef(function Badge2(props, ref) {
|
|
7779
7854
|
return badgeElement(props, ref);
|
|
7780
7855
|
});
|
|
7781
7856
|
|
|
7782
7857
|
// src/Progress.tsx
|
|
7783
|
-
var
|
|
7784
|
-
var Progress =
|
|
7858
|
+
var React53 = __toESM(require("react"), 1);
|
|
7859
|
+
var Progress = React53.forwardRef(function Progress2(props, ref) {
|
|
7785
7860
|
const auto = uid(), id = props.id || auto;
|
|
7786
7861
|
const max = props.max || 100, det = props.value != null;
|
|
7787
7862
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
7788
7863
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
7789
|
-
return /* @__PURE__ */
|
|
7864
|
+
return /* @__PURE__ */ React53.createElement(
|
|
7790
7865
|
"div",
|
|
7791
7866
|
{
|
|
7792
7867
|
ref,
|
|
@@ -7797,8 +7872,8 @@ var Progress = React52.forwardRef(function Progress2(props, ref) {
|
|
|
7797
7872
|
props.className
|
|
7798
7873
|
)
|
|
7799
7874
|
},
|
|
7800
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
7801
|
-
/* @__PURE__ */
|
|
7875
|
+
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,
|
|
7876
|
+
/* @__PURE__ */ React53.createElement(
|
|
7802
7877
|
"div",
|
|
7803
7878
|
{
|
|
7804
7879
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -7810,21 +7885,21 @@ var Progress = React52.forwardRef(function Progress2(props, ref) {
|
|
|
7810
7885
|
"aria-valuenow": det ? props.value : void 0,
|
|
7811
7886
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
7812
7887
|
},
|
|
7813
|
-
/* @__PURE__ */
|
|
7888
|
+
/* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
7814
7889
|
),
|
|
7815
|
-
props.hint ? /* @__PURE__ */
|
|
7890
|
+
props.hint ? /* @__PURE__ */ React53.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
7816
7891
|
);
|
|
7817
7892
|
});
|
|
7818
7893
|
|
|
7819
7894
|
// src/Skeleton.tsx
|
|
7820
|
-
var
|
|
7821
|
-
var Skeleton =
|
|
7895
|
+
var React54 = __toESM(require("react"), 1);
|
|
7896
|
+
var Skeleton = React54.forwardRef(function Skeleton2(props, ref) {
|
|
7822
7897
|
const v = props.variant || "text";
|
|
7823
7898
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
7824
7899
|
const n3 = props.lines, rows = [];
|
|
7825
7900
|
for (let i = 0; i < n3; i++)
|
|
7826
|
-
rows.push(/* @__PURE__ */
|
|
7827
|
-
return /* @__PURE__ */
|
|
7901
|
+
rows.push(/* @__PURE__ */ React54.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
7902
|
+
return /* @__PURE__ */ React54.createElement(
|
|
7828
7903
|
"span",
|
|
7829
7904
|
{
|
|
7830
7905
|
ref,
|
|
@@ -7842,17 +7917,17 @@ var Skeleton = React53.forwardRef(function Skeleton2(props, ref) {
|
|
|
7842
7917
|
if (v === "circle") {
|
|
7843
7918
|
style.width = style.height = props.size || props.width || 40;
|
|
7844
7919
|
}
|
|
7845
|
-
return /* @__PURE__ */
|
|
7920
|
+
return /* @__PURE__ */ React54.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
7846
7921
|
});
|
|
7847
7922
|
|
|
7848
7923
|
// src/EmptyState.tsx
|
|
7849
|
-
var
|
|
7850
|
-
var EmptyState =
|
|
7924
|
+
var React55 = __toESM(require("react"), 1);
|
|
7925
|
+
var EmptyState = React55.forwardRef(function EmptyState2(props, ref) {
|
|
7851
7926
|
return emptyStateElement(props, ref);
|
|
7852
7927
|
});
|
|
7853
7928
|
|
|
7854
7929
|
// src/Pagination.tsx
|
|
7855
|
-
var
|
|
7930
|
+
var React56 = __toESM(require("react"), 1);
|
|
7856
7931
|
function pageList(page, count, sib) {
|
|
7857
7932
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
7858
7933
|
if (page - sib <= 3) {
|
|
@@ -7872,7 +7947,7 @@ function pageList(page, count, sib) {
|
|
|
7872
7947
|
if (count > 1) out.push(count);
|
|
7873
7948
|
return out;
|
|
7874
7949
|
}
|
|
7875
|
-
var Pagination =
|
|
7950
|
+
var Pagination = React56.forwardRef(function Pagination2(props, ref) {
|
|
7876
7951
|
const t = useStrings();
|
|
7877
7952
|
const count = Math.max(1, props.pageCount || 1);
|
|
7878
7953
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -7891,7 +7966,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7891
7966
|
},
|
|
7892
7967
|
extra
|
|
7893
7968
|
);
|
|
7894
|
-
return link ? /* @__PURE__ */
|
|
7969
|
+
return link ? /* @__PURE__ */ React56.createElement(
|
|
7895
7970
|
Link,
|
|
7896
7971
|
{
|
|
7897
7972
|
href: link(p),
|
|
@@ -7904,7 +7979,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7904
7979
|
...common
|
|
7905
7980
|
},
|
|
7906
7981
|
label
|
|
7907
|
-
) : /* @__PURE__ */
|
|
7982
|
+
) : /* @__PURE__ */ React56.createElement(
|
|
7908
7983
|
"button",
|
|
7909
7984
|
{
|
|
7910
7985
|
type: "button",
|
|
@@ -7918,7 +7993,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7918
7993
|
}
|
|
7919
7994
|
function arrow(p, icon, label, rel, disabled) {
|
|
7920
7995
|
if (!link || disabled)
|
|
7921
|
-
return /* @__PURE__ */
|
|
7996
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7922
7997
|
IconButton,
|
|
7923
7998
|
{
|
|
7924
7999
|
icon,
|
|
@@ -7929,7 +8004,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7929
8004
|
}
|
|
7930
8005
|
}
|
|
7931
8006
|
);
|
|
7932
|
-
return /* @__PURE__ */
|
|
8007
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7933
8008
|
Link,
|
|
7934
8009
|
{
|
|
7935
8010
|
href: link(p),
|
|
@@ -7944,17 +8019,17 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7944
8019
|
}
|
|
7945
8020
|
}
|
|
7946
8021
|
},
|
|
7947
|
-
/* @__PURE__ */
|
|
8022
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: icon, size: "sm" })
|
|
7948
8023
|
);
|
|
7949
8024
|
}
|
|
7950
|
-
return /* @__PURE__ */
|
|
7951
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
7952
|
-
})), /* @__PURE__ */
|
|
8025
|
+
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) {
|
|
8026
|
+
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");
|
|
8027
|
+
})), /* @__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
8028
|
});
|
|
7954
8029
|
|
|
7955
8030
|
// src/Accordion.tsx
|
|
7956
|
-
var
|
|
7957
|
-
var Accordion =
|
|
8031
|
+
var React57 = __toESM(require("react"), 1);
|
|
8032
|
+
var Accordion = React57.forwardRef(function Accordion2(props, ref) {
|
|
7958
8033
|
const auto = uid(), base = props.id || auto;
|
|
7959
8034
|
const multiple = props.type === "multiple";
|
|
7960
8035
|
const st = useMaybeControlled(
|
|
@@ -7992,9 +8067,9 @@ var Accordion = React56.forwardRef(function Accordion2(props, ref) {
|
|
|
7992
8067
|
n3.focus();
|
|
7993
8068
|
}
|
|
7994
8069
|
}
|
|
7995
|
-
return /* @__PURE__ */
|
|
8070
|
+
return /* @__PURE__ */ React57.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
7996
8071
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
7997
|
-
return /* @__PURE__ */
|
|
8072
|
+
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
8073
|
"button",
|
|
7999
8074
|
{
|
|
8000
8075
|
type: "button",
|
|
@@ -8006,15 +8081,15 @@ var Accordion = React56.forwardRef(function Accordion2(props, ref) {
|
|
|
8006
8081
|
toggle(it.id);
|
|
8007
8082
|
}
|
|
8008
8083
|
},
|
|
8009
|
-
it.icon ? /* @__PURE__ */
|
|
8010
|
-
/* @__PURE__ */
|
|
8011
|
-
/* @__PURE__ */
|
|
8012
|
-
)), /* @__PURE__ */
|
|
8084
|
+
it.icon ? /* @__PURE__ */ React57.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
8085
|
+
/* @__PURE__ */ React57.createElement("span", { className: "aura-accordion__title" }, it.title, it.description ? /* @__PURE__ */ React57.createElement("span", { className: "aura-accordion__desc" }, it.description) : null),
|
|
8086
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
8087
|
+
)), /* @__PURE__ */ React57.createElement("div", { id: pid, role: "region", "aria-labelledby": bid, className: "aura-accordion__panel", hidden: !on }, it.content));
|
|
8013
8088
|
}));
|
|
8014
8089
|
});
|
|
8015
8090
|
|
|
8016
8091
|
// src/Popover.tsx
|
|
8017
|
-
var
|
|
8092
|
+
var React58 = __toESM(require("react"), 1);
|
|
8018
8093
|
var import_react_dom12 = require("react-dom");
|
|
8019
8094
|
function position(anchor, pop, placement) {
|
|
8020
8095
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -8032,15 +8107,15 @@ function position(anchor, pop, placement) {
|
|
|
8032
8107
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
8033
8108
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
8034
8109
|
}
|
|
8035
|
-
var Popover =
|
|
8110
|
+
var Popover = React58.forwardRef(function Popover2(props, ref) {
|
|
8036
8111
|
const t = useStrings();
|
|
8037
8112
|
const density = useDensity();
|
|
8038
8113
|
const auto = uid(), id = props.id || auto;
|
|
8039
8114
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
8040
8115
|
const open = !!st[0];
|
|
8041
|
-
const wrap =
|
|
8042
|
-
const pos =
|
|
8043
|
-
const inTree =
|
|
8116
|
+
const wrap = React58.useRef(null), pop = React58.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
8117
|
+
const pos = React58.useState(null), mounted = useMounted();
|
|
8118
|
+
const inTree = React58.useRef(false);
|
|
8044
8119
|
function trigger() {
|
|
8045
8120
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
8046
8121
|
}
|
|
@@ -8067,7 +8142,7 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8067
8142
|
},
|
|
8068
8143
|
[open, mounted, props.placement]
|
|
8069
8144
|
);
|
|
8070
|
-
|
|
8145
|
+
React58.useEffect(
|
|
8071
8146
|
function() {
|
|
8072
8147
|
if (!open || !mounted) return;
|
|
8073
8148
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -8092,9 +8167,9 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8092
8167
|
},
|
|
8093
8168
|
[open, mounted]
|
|
8094
8169
|
);
|
|
8095
|
-
const child =
|
|
8170
|
+
const child = React58.Children.only(props.trigger);
|
|
8096
8171
|
const panel = open && mounted ? (0, import_react_dom12.createPortal)(
|
|
8097
|
-
/* @__PURE__ */
|
|
8172
|
+
/* @__PURE__ */ React58.createElement(
|
|
8098
8173
|
"div",
|
|
8099
8174
|
{
|
|
8100
8175
|
ref: popMerged,
|
|
@@ -8124,17 +8199,17 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8124
8199
|
} else trapTab(e, pop.current);
|
|
8125
8200
|
}
|
|
8126
8201
|
},
|
|
8127
|
-
props.title ? /* @__PURE__ */
|
|
8202
|
+
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
8203
|
IconButton,
|
|
8129
8204
|
{
|
|
8130
|
-
icon: /* @__PURE__ */
|
|
8205
|
+
icon: /* @__PURE__ */ React58.createElement(IconX, null),
|
|
8131
8206
|
label: t.close,
|
|
8132
8207
|
onClick: function() {
|
|
8133
8208
|
close(true);
|
|
8134
8209
|
}
|
|
8135
8210
|
}
|
|
8136
8211
|
)) : null,
|
|
8137
|
-
/* @__PURE__ */
|
|
8212
|
+
/* @__PURE__ */ React58.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
8138
8213
|
close: function() {
|
|
8139
8214
|
close(true);
|
|
8140
8215
|
}
|
|
@@ -8142,7 +8217,7 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8142
8217
|
),
|
|
8143
8218
|
document.body
|
|
8144
8219
|
) : null;
|
|
8145
|
-
return /* @__PURE__ */
|
|
8220
|
+
return /* @__PURE__ */ React58.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React58.cloneElement(child, {
|
|
8146
8221
|
onClick: function(e) {
|
|
8147
8222
|
if (child.props.onClick) child.props.onClick(e);
|
|
8148
8223
|
st[1](!open);
|
|
@@ -8154,7 +8229,7 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8154
8229
|
});
|
|
8155
8230
|
|
|
8156
8231
|
// src/NumberField.tsx
|
|
8157
|
-
var
|
|
8232
|
+
var React59 = __toESM(require("react"), 1);
|
|
8158
8233
|
function decimalsOf(n3) {
|
|
8159
8234
|
const s = String(n3);
|
|
8160
8235
|
const i = s.indexOf(".");
|
|
@@ -8167,7 +8242,7 @@ function parse(text2) {
|
|
|
8167
8242
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
8168
8243
|
return Number(s);
|
|
8169
8244
|
}
|
|
8170
|
-
var NumberField =
|
|
8245
|
+
var NumberField = React59.forwardRef(function NumberField2(props, ref) {
|
|
8171
8246
|
const t = useStrings();
|
|
8172
8247
|
const auto = uid(), id = props.id || auto;
|
|
8173
8248
|
const step = props.step || 1;
|
|
@@ -8178,7 +8253,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8178
8253
|
props.onChange
|
|
8179
8254
|
);
|
|
8180
8255
|
const value = st[0], setValue = st[1];
|
|
8181
|
-
const draftState =
|
|
8256
|
+
const draftState = React59.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
8182
8257
|
function fmt2(n3) {
|
|
8183
8258
|
if (n3 == null || isNaN(n3)) return "";
|
|
8184
8259
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -8227,7 +8302,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8227
8302
|
};
|
|
8228
8303
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
8229
8304
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
8230
|
-
return /* @__PURE__ */
|
|
8305
|
+
return /* @__PURE__ */ React59.createElement(
|
|
8231
8306
|
Field,
|
|
8232
8307
|
{
|
|
8233
8308
|
id,
|
|
@@ -8239,7 +8314,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8239
8314
|
disabled: props.disabled,
|
|
8240
8315
|
className: props.className
|
|
8241
8316
|
},
|
|
8242
|
-
/* @__PURE__ */
|
|
8317
|
+
/* @__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
8318
|
"input",
|
|
8244
8319
|
{
|
|
8245
8320
|
ref,
|
|
@@ -8286,7 +8361,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8286
8361
|
},
|
|
8287
8362
|
onKeyDown
|
|
8288
8363
|
}
|
|
8289
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
8364
|
+
), 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
8365
|
"button",
|
|
8291
8366
|
{
|
|
8292
8367
|
type: "button",
|
|
@@ -8302,8 +8377,8 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8302
8377
|
nudge(-step);
|
|
8303
8378
|
}
|
|
8304
8379
|
},
|
|
8305
|
-
/* @__PURE__ */
|
|
8306
|
-
), /* @__PURE__ */
|
|
8380
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconMinus, null) })
|
|
8381
|
+
), /* @__PURE__ */ React59.createElement(
|
|
8307
8382
|
"button",
|
|
8308
8383
|
{
|
|
8309
8384
|
type: "button",
|
|
@@ -8319,14 +8394,14 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8319
8394
|
nudge(step);
|
|
8320
8395
|
}
|
|
8321
8396
|
},
|
|
8322
|
-
/* @__PURE__ */
|
|
8397
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconPlus, null) })
|
|
8323
8398
|
)) : null)
|
|
8324
8399
|
);
|
|
8325
8400
|
});
|
|
8326
8401
|
|
|
8327
8402
|
// src/Stepper.tsx
|
|
8328
|
-
var
|
|
8329
|
-
var Stepper =
|
|
8403
|
+
var React60 = __toESM(require("react"), 1);
|
|
8404
|
+
var Stepper = React60.forwardRef(function Stepper2(props, ref) {
|
|
8330
8405
|
const t = useStrings();
|
|
8331
8406
|
const steps = props.steps || [];
|
|
8332
8407
|
let at = -1;
|
|
@@ -8336,26 +8411,26 @@ var Stepper = React59.forwardRef(function Stepper2(props, ref) {
|
|
|
8336
8411
|
if (at < 0) at = 0;
|
|
8337
8412
|
const vertical = props.orientation === "vertical";
|
|
8338
8413
|
const cur = steps[at];
|
|
8339
|
-
return /* @__PURE__ */
|
|
8414
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8340
8415
|
"nav",
|
|
8341
8416
|
{
|
|
8342
8417
|
ref,
|
|
8343
8418
|
"aria-label": props.label,
|
|
8344
8419
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
8345
8420
|
},
|
|
8346
|
-
/* @__PURE__ */
|
|
8421
|
+
/* @__PURE__ */ React60.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
8347
8422
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
8348
|
-
const marker = /* @__PURE__ */
|
|
8349
|
-
const text2 = /* @__PURE__ */
|
|
8423
|
+
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);
|
|
8424
|
+
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
8425
|
const clickable = state === "done" && !!props.onStepClick;
|
|
8351
|
-
return /* @__PURE__ */
|
|
8426
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8352
8427
|
"li",
|
|
8353
8428
|
{
|
|
8354
8429
|
key: s.id,
|
|
8355
8430
|
className: cx("aura-stepper__item", "is-" + state),
|
|
8356
8431
|
"aria-current": state === "current" ? "step" : void 0
|
|
8357
8432
|
},
|
|
8358
|
-
clickable ? /* @__PURE__ */
|
|
8433
|
+
clickable ? /* @__PURE__ */ React60.createElement(
|
|
8359
8434
|
"button",
|
|
8360
8435
|
{
|
|
8361
8436
|
type: "button",
|
|
@@ -8366,19 +8441,19 @@ var Stepper = React59.forwardRef(function Stepper2(props, ref) {
|
|
|
8366
8441
|
},
|
|
8367
8442
|
marker,
|
|
8368
8443
|
text2
|
|
8369
|
-
) : /* @__PURE__ */
|
|
8444
|
+
) : /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
8370
8445
|
);
|
|
8371
8446
|
})),
|
|
8372
|
-
!vertical && cur ? /* @__PURE__ */
|
|
8447
|
+
!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
8448
|
);
|
|
8374
8449
|
});
|
|
8375
8450
|
|
|
8376
8451
|
// src/SegmentedControl.tsx
|
|
8377
|
-
var
|
|
8452
|
+
var React61 = __toESM(require("react"), 1);
|
|
8378
8453
|
function toOpt2(o) {
|
|
8379
8454
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
8380
8455
|
}
|
|
8381
|
-
var SegmentedControl =
|
|
8456
|
+
var SegmentedControl = React61.forwardRef(
|
|
8382
8457
|
function SegmentedControl2(props, ref) {
|
|
8383
8458
|
const options = (props.options || []).map(toOpt2);
|
|
8384
8459
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -8391,7 +8466,7 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8391
8466
|
);
|
|
8392
8467
|
const value = st[0], setValue = st[1];
|
|
8393
8468
|
const auto = uid(), id = props.id || auto;
|
|
8394
|
-
const refs =
|
|
8469
|
+
const refs = React61.useRef([]);
|
|
8395
8470
|
const selIdx = options.findIndex(function(o) {
|
|
8396
8471
|
return o.value === value;
|
|
8397
8472
|
});
|
|
@@ -8424,7 +8499,7 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8424
8499
|
move(options.length, -1);
|
|
8425
8500
|
}
|
|
8426
8501
|
}
|
|
8427
|
-
return /* @__PURE__ */
|
|
8502
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8428
8503
|
"div",
|
|
8429
8504
|
{
|
|
8430
8505
|
ref,
|
|
@@ -8443,7 +8518,7 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8443
8518
|
options.map(function(o, i) {
|
|
8444
8519
|
const on = o.value === value;
|
|
8445
8520
|
const off = props.disabled || o.disabled;
|
|
8446
|
-
return /* @__PURE__ */
|
|
8521
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8447
8522
|
"button",
|
|
8448
8523
|
{
|
|
8449
8524
|
key: o.value,
|
|
@@ -8465,8 +8540,8 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8465
8540
|
onKeyDown(e, i);
|
|
8466
8541
|
}
|
|
8467
8542
|
},
|
|
8468
|
-
o.icon ? /* @__PURE__ */
|
|
8469
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
8543
|
+
o.icon ? /* @__PURE__ */ React61.createElement(Icon, { name: o.icon }) : null,
|
|
8544
|
+
o.iconOnly ? null : /* @__PURE__ */ React61.createElement("span", null, o.label)
|
|
8470
8545
|
);
|
|
8471
8546
|
})
|
|
8472
8547
|
);
|