@jirawatpyk/aura-react 5.10.1 → 5.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -2
- package/dist/aura.bundle.js +679 -595
- package/dist/cjs/index.cjs +678 -594
- package/dist/esm/Checkbox.js +1 -1
- package/dist/esm/DataTable.js +13 -4
- package/dist/esm/FilterBar.js +1 -1
- package/dist/esm/FilterSelect.js +17 -0
- package/dist/esm/Select.js +82 -20
- package/dist/esm/index.js +2 -0
- package/dist/index.d.cts +28 -1
- package/dist/index.d.ts +28 -1
- package/dist/styles.css +53 -1
- package/dist/styles.layer.css +53 -1
- package/package.json +1 -1
package/dist/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,
|
|
@@ -1506,7 +1507,7 @@ var Checkbox = React10.forwardRef(function Checkbox2(props, ref) {
|
|
|
1506
1507
|
checked: on,
|
|
1507
1508
|
tabIndex: props.tabIndex,
|
|
1508
1509
|
disabled: props.disabled,
|
|
1509
|
-
"aria-describedby": descId,
|
|
1510
|
+
"aria-describedby": cx(props["aria-describedby"], descId) || void 0,
|
|
1510
1511
|
"aria-label": labelled ? void 0 : props.label,
|
|
1511
1512
|
onChange: function(e) {
|
|
1512
1513
|
st[1](e.target.checked);
|
|
@@ -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,9 +5050,15 @@ 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;
|
|
5056
|
+
const autoRows = props.rowHeight === "auto" && !height;
|
|
5057
|
+
if (props.rowHeight === "auto" && height)
|
|
5058
|
+
devWarnOnce(
|
|
5059
|
+
"table-row-height-auto",
|
|
5060
|
+
'DataTable `rowHeight="auto"` is ignored with `height`: virtualized rows are one fixed height. Drop `height` (and paginate) to let rows grow.'
|
|
5061
|
+
);
|
|
4981
5062
|
const virtual = !!height && !loading && pageRows.length > 0 && !stacked;
|
|
4982
5063
|
const stickyTotal = !!(props.footer && props.stickyFooter && rows.length && !loading);
|
|
4983
5064
|
const bodyH = Math.max(ROW_H, height - ROW_H - (stickyTotal ? ROW_H : 0));
|
|
@@ -5000,7 +5081,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5000
5081
|
if (!activeRendered) return r === 0 && c === ac ? 0 : -1;
|
|
5001
5082
|
return r === ar && c === ac ? 0 : -1;
|
|
5002
5083
|
}
|
|
5003
|
-
|
|
5084
|
+
React31.useEffect(function() {
|
|
5004
5085
|
const p = pending.current;
|
|
5005
5086
|
if (!p || !gridRef.current) return;
|
|
5006
5087
|
let c = p.c;
|
|
@@ -5200,14 +5281,14 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5200
5281
|
items2.push(
|
|
5201
5282
|
{
|
|
5202
5283
|
label: t.sortAsc,
|
|
5203
|
-
icon: /* @__PURE__ */
|
|
5284
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowUp, null),
|
|
5204
5285
|
onSelect: function() {
|
|
5205
5286
|
applySort({ key: c.key, dir: "asc" });
|
|
5206
5287
|
}
|
|
5207
5288
|
},
|
|
5208
5289
|
{
|
|
5209
5290
|
label: t.sortDesc,
|
|
5210
|
-
icon: /* @__PURE__ */
|
|
5291
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowDown, null),
|
|
5211
5292
|
onSelect: function() {
|
|
5212
5293
|
applySort({ key: c.key, dir: "desc" });
|
|
5213
5294
|
}
|
|
@@ -5217,7 +5298,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5217
5298
|
if (c.width != null)
|
|
5218
5299
|
items2.push({
|
|
5219
5300
|
label: isPinned(c) ? t.unpin : t.pin,
|
|
5220
|
-
icon: isPinned(c) ? /* @__PURE__ */
|
|
5301
|
+
icon: isPinned(c) ? /* @__PURE__ */ React31.createElement(IconPinOff, null) : /* @__PURE__ */ React31.createElement(IconPin, null),
|
|
5221
5302
|
onSelect: function() {
|
|
5222
5303
|
togglePin(c.key);
|
|
5223
5304
|
}
|
|
@@ -5226,7 +5307,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5226
5307
|
items2.push(
|
|
5227
5308
|
{
|
|
5228
5309
|
label: t.moveLeft,
|
|
5229
|
-
icon: /* @__PURE__ */
|
|
5310
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowLeft, null),
|
|
5230
5311
|
disabled: gi <= 0,
|
|
5231
5312
|
onSelect: function() {
|
|
5232
5313
|
moveCol(c.key, -1);
|
|
@@ -5234,7 +5315,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5234
5315
|
},
|
|
5235
5316
|
{
|
|
5236
5317
|
label: t.moveRight,
|
|
5237
|
-
icon: /* @__PURE__ */
|
|
5318
|
+
icon: /* @__PURE__ */ React31.createElement(IconArrowRight, null),
|
|
5238
5319
|
disabled: gi >= group.length - 1,
|
|
5239
5320
|
onSelect: function() {
|
|
5240
5321
|
moveCol(c.key, 1);
|
|
@@ -5245,7 +5326,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5245
5326
|
{ separator: true },
|
|
5246
5327
|
{
|
|
5247
5328
|
label: t.hideColumn,
|
|
5248
|
-
icon: /* @__PURE__ */
|
|
5329
|
+
icon: /* @__PURE__ */ React31.createElement(IconEyeOff, null),
|
|
5249
5330
|
disabled: shown.length <= 1,
|
|
5250
5331
|
onSelect: function() {
|
|
5251
5332
|
setHidden(c.key, true);
|
|
@@ -5266,7 +5347,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5266
5347
|
setHidden(k, on);
|
|
5267
5348
|
}
|
|
5268
5349
|
};
|
|
5269
|
-
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */
|
|
5350
|
+
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React31.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
|
|
5270
5351
|
}
|
|
5271
5352
|
function openMenu(kind, key, anchor, rc) {
|
|
5272
5353
|
setMenu({ kind, key, anchor, rc });
|
|
@@ -5342,10 +5423,10 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5342
5423
|
e.stopPropagation();
|
|
5343
5424
|
}
|
|
5344
5425
|
}
|
|
5345
|
-
const head = [/* @__PURE__ */
|
|
5426
|
+
const head = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5346
5427
|
if (selectable)
|
|
5347
5428
|
head.push(
|
|
5348
|
-
/* @__PURE__ */
|
|
5429
|
+
/* @__PURE__ */ React31.createElement(
|
|
5349
5430
|
"span",
|
|
5350
5431
|
{
|
|
5351
5432
|
key: "__sel",
|
|
@@ -5359,7 +5440,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5359
5440
|
activeState[1]({ r: 0, c: 0 });
|
|
5360
5441
|
}
|
|
5361
5442
|
},
|
|
5362
|
-
pageKeys.length ? /* @__PURE__ */
|
|
5443
|
+
pageKeys.length ? /* @__PURE__ */ React31.createElement(
|
|
5363
5444
|
Checkbox,
|
|
5364
5445
|
{
|
|
5365
5446
|
hideLabel: true,
|
|
@@ -5370,7 +5451,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5370
5451
|
onChange: toggleAll
|
|
5371
5452
|
}
|
|
5372
5453
|
) : null,
|
|
5373
|
-
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)
|
|
5374
5455
|
)
|
|
5375
5456
|
);
|
|
5376
5457
|
vis.forEach(function(c, i) {
|
|
@@ -5380,7 +5461,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5380
5461
|
const ariaSort = isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0;
|
|
5381
5462
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
5382
5463
|
head.push(
|
|
5383
|
-
/* @__PURE__ */
|
|
5464
|
+
/* @__PURE__ */ React31.createElement(
|
|
5384
5465
|
"span",
|
|
5385
5466
|
{
|
|
5386
5467
|
key: c.key,
|
|
@@ -5430,7 +5511,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5430
5511
|
setDrag(null);
|
|
5431
5512
|
}
|
|
5432
5513
|
},
|
|
5433
|
-
/* @__PURE__ */
|
|
5514
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React31.createElement(
|
|
5434
5515
|
"button",
|
|
5435
5516
|
{
|
|
5436
5517
|
type: "button",
|
|
@@ -5442,14 +5523,14 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5442
5523
|
}
|
|
5443
5524
|
},
|
|
5444
5525
|
c.label,
|
|
5445
|
-
/* @__PURE__ */
|
|
5526
|
+
/* @__PURE__ */ React31.createElement(
|
|
5446
5527
|
Icon,
|
|
5447
5528
|
{
|
|
5448
|
-
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),
|
|
5449
5530
|
size: 12
|
|
5450
5531
|
}
|
|
5451
5532
|
)
|
|
5452
|
-
) : /* @__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(
|
|
5453
5534
|
"button",
|
|
5454
5535
|
{
|
|
5455
5536
|
type: "button",
|
|
@@ -5463,9 +5544,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5463
5544
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
5464
5545
|
}
|
|
5465
5546
|
},
|
|
5466
|
-
/* @__PURE__ */
|
|
5547
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconEllipsis, null) })
|
|
5467
5548
|
) : null),
|
|
5468
|
-
canResize(c) ? /* @__PURE__ */
|
|
5549
|
+
canResize(c) ? /* @__PURE__ */ React31.createElement(
|
|
5469
5550
|
"span",
|
|
5470
5551
|
{
|
|
5471
5552
|
className: "aura-table__resize",
|
|
@@ -5487,7 +5568,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5487
5568
|
);
|
|
5488
5569
|
});
|
|
5489
5570
|
head.push(
|
|
5490
|
-
/* @__PURE__ */
|
|
5571
|
+
/* @__PURE__ */ React31.createElement(
|
|
5491
5572
|
"span",
|
|
5492
5573
|
{
|
|
5493
5574
|
key: "__gr",
|
|
@@ -5498,14 +5579,15 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5498
5579
|
);
|
|
5499
5580
|
function cellContent(c, r) {
|
|
5500
5581
|
const v = r[c.key];
|
|
5501
|
-
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;
|
|
5502
5583
|
}
|
|
5503
5584
|
function rowCells(r, i, k, isSel) {
|
|
5504
5585
|
const ri = i + 1;
|
|
5505
|
-
const
|
|
5586
|
+
const selLabel = selectable && canSelect(r) ? props.rowSelectLabel && props.rowSelectLabel(r) || t.selectRow(k) : void 0;
|
|
5587
|
+
const cells = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
5506
5588
|
if (selectable)
|
|
5507
5589
|
cells.push(
|
|
5508
|
-
/* @__PURE__ */
|
|
5590
|
+
/* @__PURE__ */ React31.createElement(
|
|
5509
5591
|
"span",
|
|
5510
5592
|
{
|
|
5511
5593
|
key: "__sel",
|
|
@@ -5514,18 +5596,18 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5514
5596
|
className: cx("aura-table__sel", nPinned && "is-pinned"),
|
|
5515
5597
|
tabIndex: tabFor(ri, 0),
|
|
5516
5598
|
"data-rc": ri + ":0",
|
|
5517
|
-
"aria-label": canSelect(r) ?
|
|
5599
|
+
"aria-label": canSelect(r) ? selLabel : props.rowSelectDisabledLabel ? props.rowSelectDisabledLabel(r) : void 0,
|
|
5518
5600
|
onFocus: function(e) {
|
|
5519
5601
|
if (e.target === e.currentTarget) activeState[1]({ r: ri, c: 0 });
|
|
5520
5602
|
}
|
|
5521
5603
|
},
|
|
5522
|
-
canSelect(r) ? /* @__PURE__ */
|
|
5604
|
+
canSelect(r) ? /* @__PURE__ */ React31.createElement(
|
|
5523
5605
|
Checkbox,
|
|
5524
5606
|
{
|
|
5525
5607
|
hideLabel: true,
|
|
5526
5608
|
checked: isSel,
|
|
5527
5609
|
tabIndex: -1,
|
|
5528
|
-
label:
|
|
5610
|
+
label: selLabel,
|
|
5529
5611
|
onChange: function(on) {
|
|
5530
5612
|
toggle(k, on);
|
|
5531
5613
|
}
|
|
@@ -5536,7 +5618,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5536
5618
|
vis.forEach(function(c, j) {
|
|
5537
5619
|
const ci = j + (selectable ? 1 : 0), v = r[c.key], pin = isPinned(c);
|
|
5538
5620
|
cells.push(
|
|
5539
|
-
/* @__PURE__ */
|
|
5621
|
+
/* @__PURE__ */ React31.createElement(
|
|
5540
5622
|
"span",
|
|
5541
5623
|
{
|
|
5542
5624
|
key: c.key,
|
|
@@ -5546,6 +5628,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5546
5628
|
"data-rc": ri + ":" + ci,
|
|
5547
5629
|
className: cx(
|
|
5548
5630
|
"aura-table__td",
|
|
5631
|
+
autoRows && "aura-table__td--auto",
|
|
5549
5632
|
c.mono && "aura-table__mono",
|
|
5550
5633
|
c.align === "end" && "is-end",
|
|
5551
5634
|
pin && "is-pinned",
|
|
@@ -5557,13 +5640,13 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5557
5640
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
5558
5641
|
}
|
|
5559
5642
|
},
|
|
5560
|
-
j === 0 ? rowLinkWrap(r, cellContent(c, r)) : cellContent(c, r)
|
|
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)
|
|
5561
5644
|
)
|
|
5562
5645
|
);
|
|
5563
5646
|
});
|
|
5564
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
5647
|
+
if (hasFields) cells.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
5565
5648
|
cells.push(
|
|
5566
|
-
/* @__PURE__ */
|
|
5649
|
+
/* @__PURE__ */ React31.createElement(
|
|
5567
5650
|
"span",
|
|
5568
5651
|
{
|
|
5569
5652
|
key: "__gr",
|
|
@@ -5580,14 +5663,14 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5580
5663
|
const n3 = pageSize || props.skeletonRows || 5;
|
|
5581
5664
|
const skRows = body = [];
|
|
5582
5665
|
for (let i = 0; i < n3; i++) {
|
|
5583
|
-
const sk = [/* @__PURE__ */
|
|
5666
|
+
const sk = [/* @__PURE__ */ React31.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
5584
5667
|
if (selectable)
|
|
5585
5668
|
sk.push(
|
|
5586
|
-
/* @__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" }))
|
|
5587
5670
|
);
|
|
5588
5671
|
vis.forEach(function(c, j) {
|
|
5589
5672
|
sk.push(
|
|
5590
|
-
/* @__PURE__ */
|
|
5673
|
+
/* @__PURE__ */ React31.createElement(
|
|
5591
5674
|
"span",
|
|
5592
5675
|
{
|
|
5593
5676
|
key: c.key,
|
|
@@ -5596,7 +5679,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5596
5679
|
...cardAttrs(c, j),
|
|
5597
5680
|
"data-label": void 0
|
|
5598
5681
|
},
|
|
5599
|
-
/* @__PURE__ */
|
|
5682
|
+
/* @__PURE__ */ React31.createElement(
|
|
5600
5683
|
"span",
|
|
5601
5684
|
{
|
|
5602
5685
|
className: cx("aura-skel", c.pill && "aura-skel--pill"),
|
|
@@ -5606,28 +5689,28 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5606
5689
|
)
|
|
5607
5690
|
);
|
|
5608
5691
|
});
|
|
5609
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
5692
|
+
if (hasFields) sk.push(/* @__PURE__ */ React31.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
5610
5693
|
sk.push(
|
|
5611
|
-
/* @__PURE__ */
|
|
5694
|
+
/* @__PURE__ */ React31.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
5612
5695
|
);
|
|
5613
5696
|
skRows.push(
|
|
5614
|
-
/* @__PURE__ */
|
|
5697
|
+
/* @__PURE__ */ React31.createElement("div", { key: "sk" + i, className: "aura-table__row aura-table__row--skeleton", "aria-hidden": true, style: rowStyle }, sk)
|
|
5615
5698
|
);
|
|
5616
5699
|
}
|
|
5617
5700
|
} else if (!rows.length) {
|
|
5618
5701
|
const em = props.empty || {};
|
|
5619
|
-
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));
|
|
5620
5703
|
} else {
|
|
5621
5704
|
const bodyRows = body = [];
|
|
5622
5705
|
if (virtual && start > 0)
|
|
5623
5706
|
bodyRows.push(
|
|
5624
|
-
/* @__PURE__ */
|
|
5707
|
+
/* @__PURE__ */ React31.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
5625
5708
|
);
|
|
5626
5709
|
for (let ri = start; ri < end; ri++) {
|
|
5627
5710
|
(function(r, i) {
|
|
5628
5711
|
const k = r[rowKey], isSel = !!selSet[k];
|
|
5629
5712
|
bodyRows.push(
|
|
5630
|
-
/* @__PURE__ */
|
|
5713
|
+
/* @__PURE__ */ React31.createElement(
|
|
5631
5714
|
"div",
|
|
5632
5715
|
{
|
|
5633
5716
|
key: k,
|
|
@@ -5636,6 +5719,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5636
5719
|
"aria-selected": selectable && canSelect(r) ? isSel : void 0,
|
|
5637
5720
|
className: cx(
|
|
5638
5721
|
"aura-table__row",
|
|
5722
|
+
autoRows && "aura-table__row--auto",
|
|
5639
5723
|
isSel && "is-selected",
|
|
5640
5724
|
(props.onRowActivate || rowHref) && "is-actionable"
|
|
5641
5725
|
),
|
|
@@ -5654,7 +5738,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5654
5738
|
}
|
|
5655
5739
|
if (virtual && end < pageRows.length)
|
|
5656
5740
|
bodyRows.push(
|
|
5657
|
-
/* @__PURE__ */
|
|
5741
|
+
/* @__PURE__ */ React31.createElement(
|
|
5658
5742
|
"div",
|
|
5659
5743
|
{
|
|
5660
5744
|
key: "__bot",
|
|
@@ -5667,9 +5751,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5667
5751
|
}
|
|
5668
5752
|
let foot = null;
|
|
5669
5753
|
function pagerButton(dir) {
|
|
5670
|
-
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);
|
|
5671
5755
|
if (props.getPageHref && !off)
|
|
5672
|
-
return /* @__PURE__ */
|
|
5756
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5673
5757
|
Link,
|
|
5674
5758
|
{
|
|
5675
5759
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -5684,9 +5768,9 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5684
5768
|
}
|
|
5685
5769
|
}
|
|
5686
5770
|
},
|
|
5687
|
-
/* @__PURE__ */
|
|
5771
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: icon })
|
|
5688
5772
|
);
|
|
5689
|
-
return /* @__PURE__ */
|
|
5773
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5690
5774
|
IconButton,
|
|
5691
5775
|
{
|
|
5692
5776
|
icon,
|
|
@@ -5701,11 +5785,11 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5701
5785
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
5702
5786
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
5703
5787
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
5704
|
-
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)));
|
|
5705
5789
|
} else if (height && rows.length && !loading) {
|
|
5706
|
-
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));
|
|
5707
5791
|
}
|
|
5708
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
5792
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React31.createElement(
|
|
5709
5793
|
"div",
|
|
5710
5794
|
{
|
|
5711
5795
|
role: "row",
|
|
@@ -5714,8 +5798,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5714
5798
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
5715
5799
|
style: rowStyle
|
|
5716
5800
|
},
|
|
5717
|
-
/* @__PURE__ */
|
|
5718
|
-
selectable ? /* @__PURE__ */
|
|
5801
|
+
/* @__PURE__ */ React31.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
5802
|
+
selectable ? /* @__PURE__ */ React31.createElement(
|
|
5719
5803
|
"span",
|
|
5720
5804
|
{
|
|
5721
5805
|
role: "gridcell",
|
|
@@ -5730,7 +5814,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5730
5814
|
) : null,
|
|
5731
5815
|
vis.map(function(c, j) {
|
|
5732
5816
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
5733
|
-
return /* @__PURE__ */
|
|
5817
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5734
5818
|
"span",
|
|
5735
5819
|
{
|
|
5736
5820
|
key: c.key,
|
|
@@ -5756,8 +5840,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5756
5840
|
props.footer[c.key]
|
|
5757
5841
|
);
|
|
5758
5842
|
}),
|
|
5759
|
-
hasFields ? /* @__PURE__ */
|
|
5760
|
-
/* @__PURE__ */
|
|
5843
|
+
hasFields ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
5844
|
+
/* @__PURE__ */ React31.createElement(
|
|
5761
5845
|
"span",
|
|
5762
5846
|
{
|
|
5763
5847
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -5771,7 +5855,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5771
5855
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
5772
5856
|
};
|
|
5773
5857
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
5774
|
-
const gridEl = /* @__PURE__ */
|
|
5858
|
+
const gridEl = /* @__PURE__ */ React31.createElement(
|
|
5775
5859
|
"div",
|
|
5776
5860
|
{
|
|
5777
5861
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -5785,8 +5869,8 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5785
5869
|
),
|
|
5786
5870
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
5787
5871
|
},
|
|
5788
|
-
refreshing ? /* @__PURE__ */
|
|
5789
|
-
/* @__PURE__ */
|
|
5872
|
+
refreshing ? /* @__PURE__ */ React31.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
5873
|
+
/* @__PURE__ */ React31.createElement(
|
|
5790
5874
|
"div",
|
|
5791
5875
|
{
|
|
5792
5876
|
ref: function(el) {
|
|
@@ -5815,7 +5899,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5815
5899
|
if (sx !== scrolledX[0]) scrolledX[1](sx);
|
|
5816
5900
|
}
|
|
5817
5901
|
},
|
|
5818
|
-
/* @__PURE__ */
|
|
5902
|
+
/* @__PURE__ */ React31.createElement(
|
|
5819
5903
|
"div",
|
|
5820
5904
|
{
|
|
5821
5905
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -5828,11 +5912,11 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5828
5912
|
body,
|
|
5829
5913
|
totalRow
|
|
5830
5914
|
),
|
|
5831
|
-
busy ? /* @__PURE__ */
|
|
5832
|
-
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(
|
|
5833
5917
|
IconButton,
|
|
5834
5918
|
{
|
|
5835
|
-
icon: /* @__PURE__ */
|
|
5919
|
+
icon: /* @__PURE__ */ React31.createElement(IconColumns3, null),
|
|
5836
5920
|
label: t.showHideColumns,
|
|
5837
5921
|
"aria-haspopup": "menu",
|
|
5838
5922
|
onClick: function(e) {
|
|
@@ -5841,7 +5925,7 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5841
5925
|
}
|
|
5842
5926
|
)) : null,
|
|
5843
5927
|
foot,
|
|
5844
|
-
menu ? /* @__PURE__ */
|
|
5928
|
+
menu ? /* @__PURE__ */ React31.createElement(
|
|
5845
5929
|
Menu,
|
|
5846
5930
|
{
|
|
5847
5931
|
anchor: menu.anchor,
|
|
@@ -5851,13 +5935,13 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5851
5935
|
}
|
|
5852
5936
|
) : null,
|
|
5853
5937
|
tipEl,
|
|
5854
|
-
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
|
|
5855
5939
|
);
|
|
5856
5940
|
if (!levels.length) return gridEl;
|
|
5857
5941
|
let out = gridEl;
|
|
5858
5942
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
5859
5943
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
5860
|
-
out = /* @__PURE__ */
|
|
5944
|
+
out = /* @__PURE__ */ React31.createElement(
|
|
5861
5945
|
"div",
|
|
5862
5946
|
{
|
|
5863
5947
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -5866,19 +5950,19 @@ var DataTableImpl = React30.forwardRef(function DataTable(props, ref) {
|
|
|
5866
5950
|
out
|
|
5867
5951
|
);
|
|
5868
5952
|
}
|
|
5869
|
-
return /* @__PURE__ */
|
|
5953
|
+
return /* @__PURE__ */ React31.createElement("div", { ref, className: cx("aura-table-box", props.className) }, out);
|
|
5870
5954
|
});
|
|
5871
5955
|
var DataTable2 = DataTableImpl;
|
|
5872
5956
|
|
|
5873
5957
|
// src/Card.tsx
|
|
5874
|
-
var
|
|
5875
|
-
var Card =
|
|
5958
|
+
var React32 = __toESM(require("react"), 1);
|
|
5959
|
+
var Card = React32.forwardRef(function Card2(props, ref) {
|
|
5876
5960
|
return cardElement(props, ref);
|
|
5877
5961
|
});
|
|
5878
5962
|
|
|
5879
5963
|
// src/Tabs.tsx
|
|
5880
|
-
var
|
|
5881
|
-
var Tabs =
|
|
5964
|
+
var React33 = __toESM(require("react"), 1);
|
|
5965
|
+
var Tabs = React33.forwardRef(function Tabs2(props, ref) {
|
|
5882
5966
|
const items2 = props.tabs || [], base = uid();
|
|
5883
5967
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
5884
5968
|
return !!t.href;
|
|
@@ -5892,7 +5976,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5892
5976
|
props.onChange
|
|
5893
5977
|
);
|
|
5894
5978
|
const cur = asLinks && "value" in props ? props.value : st[0];
|
|
5895
|
-
const refs =
|
|
5979
|
+
const refs = React33.useRef({});
|
|
5896
5980
|
const current2 = items2.filter(function(t) {
|
|
5897
5981
|
return t.id === cur;
|
|
5898
5982
|
})[0] || firstOn || items2[0];
|
|
@@ -5904,7 +5988,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5904
5988
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
5905
5989
|
};
|
|
5906
5990
|
const rootCls = cx("aura-tabs", seg && "aura-tabs--segmented");
|
|
5907
|
-
const [focusId, setFocusId] =
|
|
5991
|
+
const [focusId, setFocusId] = React33.useState(null);
|
|
5908
5992
|
items2.forEach(function(t) {
|
|
5909
5993
|
const al = t.tabProps && t.tabProps["aria-label"];
|
|
5910
5994
|
if (al && al.toLowerCase().indexOf(String(t.label).toLowerCase()) !== 0)
|
|
@@ -5914,19 +5998,19 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5914
5998
|
);
|
|
5915
5999
|
});
|
|
5916
6000
|
if (asLinks)
|
|
5917
|
-
return /* @__PURE__ */
|
|
6001
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5918
6002
|
"nav",
|
|
5919
6003
|
{
|
|
5920
6004
|
ref,
|
|
5921
6005
|
"aria-label": props.label,
|
|
5922
6006
|
className: cx(rootCls, "aura-tabs--links", props.className)
|
|
5923
6007
|
},
|
|
5924
|
-
/* @__PURE__ */
|
|
6008
|
+
/* @__PURE__ */ React33.createElement("div", { className: listCls }, items2.map(function(t) {
|
|
5925
6009
|
const on = t.id === cur;
|
|
5926
6010
|
const inner = [
|
|
5927
|
-
t.icon ? /* @__PURE__ */
|
|
6011
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
5928
6012
|
t.label,
|
|
5929
|
-
t.count != null ? /* @__PURE__ */
|
|
6013
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
5930
6014
|
];
|
|
5931
6015
|
const own = omit(t.tabProps || {}, [
|
|
5932
6016
|
"type",
|
|
@@ -5940,7 +6024,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5940
6024
|
"name",
|
|
5941
6025
|
"value"
|
|
5942
6026
|
]);
|
|
5943
|
-
return t.disabled ? /* @__PURE__ */
|
|
6027
|
+
return t.disabled ? /* @__PURE__ */ React33.createElement(
|
|
5944
6028
|
"span",
|
|
5945
6029
|
{
|
|
5946
6030
|
...omit(own, ["onClick"]),
|
|
@@ -5949,7 +6033,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5949
6033
|
"aria-disabled": true
|
|
5950
6034
|
},
|
|
5951
6035
|
inner
|
|
5952
|
-
) : /* @__PURE__ */
|
|
6036
|
+
) : /* @__PURE__ */ React33.createElement(
|
|
5953
6037
|
Link,
|
|
5954
6038
|
{
|
|
5955
6039
|
...own,
|
|
@@ -5979,7 +6063,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
5979
6063
|
const stop = manual && focusId && items2.filter(function(t) {
|
|
5980
6064
|
return t.id === focusId && !t.disabled;
|
|
5981
6065
|
})[0] || current2;
|
|
5982
|
-
return /* @__PURE__ */
|
|
6066
|
+
return /* @__PURE__ */ React33.createElement("div", { ref, className: cx(rootCls, props.className) }, /* @__PURE__ */ React33.createElement(
|
|
5983
6067
|
"div",
|
|
5984
6068
|
{
|
|
5985
6069
|
role: "tablist",
|
|
@@ -6012,7 +6096,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6012
6096
|
items2.map(function(t) {
|
|
6013
6097
|
const on = current2 && t.id === current2.id;
|
|
6014
6098
|
const own = t.tabProps || {};
|
|
6015
|
-
return /* @__PURE__ */
|
|
6099
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6016
6100
|
"button",
|
|
6017
6101
|
{
|
|
6018
6102
|
...own,
|
|
@@ -6039,9 +6123,9 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6039
6123
|
st[1](t.id);
|
|
6040
6124
|
}
|
|
6041
6125
|
},
|
|
6042
|
-
t.icon ? /* @__PURE__ */
|
|
6126
|
+
t.icon ? /* @__PURE__ */ React33.createElement(Icon, { name: t.icon }) : null,
|
|
6043
6127
|
t.label,
|
|
6044
|
-
t.count != null ? /* @__PURE__ */
|
|
6128
|
+
t.count != null ? /* @__PURE__ */ React33.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
6045
6129
|
);
|
|
6046
6130
|
})
|
|
6047
6131
|
), props.keepMounted ? (
|
|
@@ -6049,7 +6133,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6049
6133
|
items2.map(function(t) {
|
|
6050
6134
|
if (t.content === void 0) return null;
|
|
6051
6135
|
const on = current2 && t.id === current2.id;
|
|
6052
|
-
return /* @__PURE__ */
|
|
6136
|
+
return /* @__PURE__ */ React33.createElement(
|
|
6053
6137
|
"div",
|
|
6054
6138
|
{
|
|
6055
6139
|
key: t.id,
|
|
@@ -6063,7 +6147,7 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6063
6147
|
t.content
|
|
6064
6148
|
);
|
|
6065
6149
|
})
|
|
6066
|
-
) : current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
6150
|
+
) : current2 && current2.content !== void 0 ? /* @__PURE__ */ React33.createElement(
|
|
6067
6151
|
"div",
|
|
6068
6152
|
{
|
|
6069
6153
|
role: "tabpanel",
|
|
@@ -6077,14 +6161,14 @@ var Tabs = React32.forwardRef(function Tabs2(props, ref) {
|
|
|
6077
6161
|
});
|
|
6078
6162
|
|
|
6079
6163
|
// src/SideNav.tsx
|
|
6080
|
-
var
|
|
6164
|
+
var React34 = __toESM(require("react"), 1);
|
|
6081
6165
|
var import_react_dom10 = require("react-dom");
|
|
6082
6166
|
function contains(it, id) {
|
|
6083
6167
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
6084
6168
|
return c.id === id || contains(c, id);
|
|
6085
6169
|
});
|
|
6086
6170
|
}
|
|
6087
|
-
var SideNav =
|
|
6171
|
+
var SideNav = React34.forwardRef(function SideNav2(props, ref) {
|
|
6088
6172
|
const t = useStrings();
|
|
6089
6173
|
const Link = useLinkComponent(props.linkComponent);
|
|
6090
6174
|
const base = uid();
|
|
@@ -6096,14 +6180,14 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6096
6180
|
const active = st[0];
|
|
6097
6181
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
6098
6182
|
const collapsed = col[0];
|
|
6099
|
-
const tipState =
|
|
6100
|
-
|
|
6183
|
+
const tipState = React34.useState(null), tip = tipState[0], setTip = tipState[1];
|
|
6184
|
+
React34.useEffect(
|
|
6101
6185
|
function() {
|
|
6102
6186
|
if (!collapsed) setTip(null);
|
|
6103
6187
|
},
|
|
6104
6188
|
[collapsed]
|
|
6105
6189
|
);
|
|
6106
|
-
|
|
6190
|
+
React34.useEffect(
|
|
6107
6191
|
function() {
|
|
6108
6192
|
if (!tip) return;
|
|
6109
6193
|
function esc(e) {
|
|
@@ -6128,12 +6212,12 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6128
6212
|
return { onMouseEnter: show2, onFocus: show2, onMouseLeave: hide, onBlur: hide };
|
|
6129
6213
|
}
|
|
6130
6214
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
6131
|
-
const openState =
|
|
6215
|
+
const openState = React34.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
6132
6216
|
function isOpen(it) {
|
|
6133
6217
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
6134
6218
|
return !!it.defaultOpen || contains(it, active);
|
|
6135
6219
|
}
|
|
6136
|
-
|
|
6220
|
+
React34.useEffect(
|
|
6137
6221
|
function() {
|
|
6138
6222
|
if (!active) return;
|
|
6139
6223
|
const next = {};
|
|
@@ -6155,7 +6239,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6155
6239
|
},
|
|
6156
6240
|
[active]
|
|
6157
6241
|
);
|
|
6158
|
-
const navRef =
|
|
6242
|
+
const navRef = React34.useRef(null);
|
|
6159
6243
|
function onKeyDown(e) {
|
|
6160
6244
|
const k = e.key;
|
|
6161
6245
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -6174,12 +6258,12 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6174
6258
|
function inner(it, group, open) {
|
|
6175
6259
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
6176
6260
|
return [
|
|
6177
|
-
it.icon ? /* @__PURE__ */
|
|
6178
|
-
collapsed && marked ? /* @__PURE__ */
|
|
6179
|
-
/* @__PURE__ */
|
|
6180
|
-
it.badge != null ? /* @__PURE__ */
|
|
6181
|
-
it.count != null ? /* @__PURE__ */
|
|
6182
|
-
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
|
|
6183
6267
|
];
|
|
6184
6268
|
}
|
|
6185
6269
|
function item(it, depth) {
|
|
@@ -6187,7 +6271,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6187
6271
|
const open = !collapsed && isOpen(it);
|
|
6188
6272
|
const listId = base + "-" + it.id;
|
|
6189
6273
|
const holdsActive = contains(it, active);
|
|
6190
|
-
return /* @__PURE__ */
|
|
6274
|
+
return /* @__PURE__ */ React34.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React34.createElement(
|
|
6191
6275
|
"button",
|
|
6192
6276
|
{
|
|
6193
6277
|
type: "button",
|
|
@@ -6216,7 +6300,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6216
6300
|
}
|
|
6217
6301
|
},
|
|
6218
6302
|
inner(it, true, open)
|
|
6219
|
-
), /* @__PURE__ */
|
|
6303
|
+
), /* @__PURE__ */ React34.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
6220
6304
|
return item(c, depth + 1);
|
|
6221
6305
|
})));
|
|
6222
6306
|
}
|
|
@@ -6232,9 +6316,9 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6232
6316
|
st[1](it.id);
|
|
6233
6317
|
}
|
|
6234
6318
|
};
|
|
6235
|
-
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)));
|
|
6236
6320
|
}
|
|
6237
|
-
return /* @__PURE__ */
|
|
6321
|
+
return /* @__PURE__ */ React34.createElement(
|
|
6238
6322
|
"nav",
|
|
6239
6323
|
{
|
|
6240
6324
|
ref: function(el) {
|
|
@@ -6252,17 +6336,17 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6252
6336
|
"aria-label": props.label || t.mainNav,
|
|
6253
6337
|
onKeyDown
|
|
6254
6338
|
},
|
|
6255
|
-
props.header ? /* @__PURE__ */
|
|
6256
|
-
/* @__PURE__ */
|
|
6257
|
-
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) {
|
|
6258
6342
|
return item(it, 0);
|
|
6259
6343
|
})));
|
|
6260
6344
|
})),
|
|
6261
|
-
props.footer ? /* @__PURE__ */
|
|
6262
|
-
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(
|
|
6263
6347
|
IconButton,
|
|
6264
6348
|
{
|
|
6265
|
-
icon: collapsed ? /* @__PURE__ */
|
|
6349
|
+
icon: collapsed ? /* @__PURE__ */ React34.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React34.createElement(IconPanelLeftClose, null),
|
|
6266
6350
|
label: collapsed ? t.expandNav : t.collapseNav,
|
|
6267
6351
|
size: "md",
|
|
6268
6352
|
onClick: function() {
|
|
@@ -6272,7 +6356,7 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6272
6356
|
}
|
|
6273
6357
|
)) : null,
|
|
6274
6358
|
tip && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
6275
|
-
/* @__PURE__ */
|
|
6359
|
+
/* @__PURE__ */ React34.createElement(
|
|
6276
6360
|
"div",
|
|
6277
6361
|
{
|
|
6278
6362
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -6287,35 +6371,35 @@ var SideNav = React33.forwardRef(function SideNav2(props, ref) {
|
|
|
6287
6371
|
});
|
|
6288
6372
|
|
|
6289
6373
|
// src/Breadcrumb.tsx
|
|
6290
|
-
var
|
|
6291
|
-
var Breadcrumb =
|
|
6374
|
+
var React35 = __toESM(require("react"), 1);
|
|
6375
|
+
var Breadcrumb = React35.forwardRef(function Breadcrumb2(props, ref) {
|
|
6292
6376
|
const t = useStrings();
|
|
6293
6377
|
const Link = useLinkComponent(props.linkComponent);
|
|
6294
6378
|
const items2 = props.items || [];
|
|
6295
|
-
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) {
|
|
6296
6380
|
const last = i === items2.length - 1;
|
|
6297
|
-
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) : (
|
|
6298
6382
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
6299
|
-
/* @__PURE__ */
|
|
6300
|
-
), 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" }));
|
|
6301
6385
|
})));
|
|
6302
6386
|
});
|
|
6303
6387
|
|
|
6304
6388
|
// src/Avatar.tsx
|
|
6305
|
-
var
|
|
6389
|
+
var React36 = __toESM(require("react"), 1);
|
|
6306
6390
|
var AVATAR_TONES = ["progress", "ready", "neutral", "warning"];
|
|
6307
6391
|
function initials(name) {
|
|
6308
6392
|
const parts = String(name || "?").trim().split(/\s+/);
|
|
6309
6393
|
return ((parts[0] || "?")[0] + (parts.length > 1 ? parts[parts.length - 1][0] : parts[0][1] || "")).toUpperCase();
|
|
6310
6394
|
}
|
|
6311
|
-
var Avatar =
|
|
6312
|
-
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);
|
|
6313
6397
|
let hash = 0;
|
|
6314
6398
|
String(props.name || "").split("").forEach(function(ch) {
|
|
6315
6399
|
hash = hash * 31 + ch.charCodeAt(0) >>> 0;
|
|
6316
6400
|
});
|
|
6317
6401
|
const tone2 = AVATAR_TONES[hash % AVATAR_TONES.length];
|
|
6318
|
-
return /* @__PURE__ */
|
|
6402
|
+
return /* @__PURE__ */ React36.createElement(
|
|
6319
6403
|
"span",
|
|
6320
6404
|
{
|
|
6321
6405
|
ref,
|
|
@@ -6323,7 +6407,7 @@ var Avatar = React35.forwardRef(function Avatar2(props, ref) {
|
|
|
6323
6407
|
role: "img",
|
|
6324
6408
|
"aria-label": props.name + (props.status ? ", " + props.status : "")
|
|
6325
6409
|
},
|
|
6326
|
-
props.src && errState[0] !== props.src ? /* @__PURE__ */
|
|
6410
|
+
props.src && errState[0] !== props.src ? /* @__PURE__ */ React36.createElement(
|
|
6327
6411
|
"img",
|
|
6328
6412
|
{
|
|
6329
6413
|
key: props.src,
|
|
@@ -6333,16 +6417,16 @@ var Avatar = React35.forwardRef(function Avatar2(props, ref) {
|
|
|
6333
6417
|
errState[1](props.src || null);
|
|
6334
6418
|
}
|
|
6335
6419
|
}
|
|
6336
|
-
) : /* @__PURE__ */
|
|
6337
|
-
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
|
|
6338
6422
|
);
|
|
6339
6423
|
});
|
|
6340
6424
|
|
|
6341
6425
|
// src/Stack.tsx
|
|
6342
|
-
var
|
|
6426
|
+
var React38 = __toESM(require("react"), 1);
|
|
6343
6427
|
|
|
6344
6428
|
// src/responsive.tsx
|
|
6345
|
-
var
|
|
6429
|
+
var React37 = __toESM(require("react"), 1);
|
|
6346
6430
|
|
|
6347
6431
|
// src/breakpoints.ts
|
|
6348
6432
|
var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
@@ -6350,7 +6434,7 @@ var breakpoints = { sm: 640, md: 768, lg: 1024, xl: 1280 };
|
|
|
6350
6434
|
// src/responsive.tsx
|
|
6351
6435
|
var ORDER = ["base", "sm", "md", "lg", "xl"];
|
|
6352
6436
|
function useBreakpoint() {
|
|
6353
|
-
return
|
|
6437
|
+
return React37.useSyncExternalStore(subscribe, current, function() {
|
|
6354
6438
|
return "lg";
|
|
6355
6439
|
});
|
|
6356
6440
|
}
|
|
@@ -6390,8 +6474,8 @@ var space = function(v) {
|
|
|
6390
6474
|
};
|
|
6391
6475
|
|
|
6392
6476
|
// src/Stack.tsx
|
|
6393
|
-
var h5 =
|
|
6394
|
-
var Stack =
|
|
6477
|
+
var h5 = React38.createElement;
|
|
6478
|
+
var Stack = React38.forwardRef(function Stack2(props, ref) {
|
|
6395
6479
|
const style = Object.assign(
|
|
6396
6480
|
{},
|
|
6397
6481
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -6405,9 +6489,9 @@ var Stack = React37.forwardRef(function Stack2(props, ref) {
|
|
|
6405
6489
|
});
|
|
6406
6490
|
|
|
6407
6491
|
// src/Grid.tsx
|
|
6408
|
-
var
|
|
6409
|
-
var h6 =
|
|
6410
|
-
var Grid =
|
|
6492
|
+
var React39 = __toESM(require("react"), 1);
|
|
6493
|
+
var h6 = React39.createElement;
|
|
6494
|
+
var Grid = React39.forwardRef(function Grid2(props, ref) {
|
|
6411
6495
|
const style = Object.assign(
|
|
6412
6496
|
{},
|
|
6413
6497
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -6422,9 +6506,9 @@ var Grid = React38.forwardRef(function Grid2(props, ref) {
|
|
|
6422
6506
|
});
|
|
6423
6507
|
|
|
6424
6508
|
// src/Container.tsx
|
|
6425
|
-
var
|
|
6426
|
-
var h7 =
|
|
6427
|
-
var Container =
|
|
6509
|
+
var React40 = __toESM(require("react"), 1);
|
|
6510
|
+
var h7 = React40.createElement;
|
|
6511
|
+
var Container = React40.forwardRef(function Container2(props, ref) {
|
|
6428
6512
|
return h7(
|
|
6429
6513
|
props.as || "div",
|
|
6430
6514
|
{
|
|
@@ -6437,27 +6521,27 @@ var Container = React39.forwardRef(function Container2(props, ref) {
|
|
|
6437
6521
|
});
|
|
6438
6522
|
|
|
6439
6523
|
// src/AppShell.tsx
|
|
6440
|
-
var
|
|
6441
|
-
var AppShell =
|
|
6524
|
+
var React41 = __toESM(require("react"), 1);
|
|
6525
|
+
var AppShell = React41.forwardRef(function AppShell2(props, ref) {
|
|
6442
6526
|
const t = useStrings();
|
|
6443
6527
|
const bp = useBreakpoint();
|
|
6444
6528
|
const wide = bp === "lg" || bp === "xl";
|
|
6445
|
-
const st =
|
|
6446
|
-
|
|
6529
|
+
const st = React41.useState(false), open = st[0], setOpen = st[1];
|
|
6530
|
+
React41.useEffect(
|
|
6447
6531
|
function() {
|
|
6448
6532
|
if (wide) setOpen(false);
|
|
6449
6533
|
},
|
|
6450
6534
|
[wide]
|
|
6451
6535
|
);
|
|
6452
|
-
const navEl = props.nav &&
|
|
6536
|
+
const navEl = props.nav && React41.isValidElement(props.nav) ? props.nav : null;
|
|
6453
6537
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
6454
|
-
const navState =
|
|
6538
|
+
const navState = React41.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
6455
6539
|
function onNav(id) {
|
|
6456
6540
|
if (shared) navState[1](id);
|
|
6457
6541
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
6458
6542
|
}
|
|
6459
|
-
const deskNav = navEl && shared ?
|
|
6460
|
-
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, {
|
|
6461
6545
|
value: shared ? navState[0] : navEl.props.value,
|
|
6462
6546
|
onChange: function(id) {
|
|
6463
6547
|
onNav(id);
|
|
@@ -6467,7 +6551,7 @@ var AppShell = React40.forwardRef(function AppShell2(props, ref) {
|
|
|
6467
6551
|
collapsed: false,
|
|
6468
6552
|
collapsible: false
|
|
6469
6553
|
}) : props.nav;
|
|
6470
|
-
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(
|
|
6471
6555
|
Drawer,
|
|
6472
6556
|
{
|
|
6473
6557
|
open,
|
|
@@ -6480,11 +6564,11 @@ var AppShell = React40.forwardRef(function AppShell2(props, ref) {
|
|
|
6480
6564
|
dismissible: true
|
|
6481
6565
|
},
|
|
6482
6566
|
drawerNav
|
|
6483
|
-
) : 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(
|
|
6484
6568
|
IconButton,
|
|
6485
6569
|
{
|
|
6486
6570
|
className: "aura-shell__menu",
|
|
6487
|
-
icon: /* @__PURE__ */
|
|
6571
|
+
icon: /* @__PURE__ */ React41.createElement(IconMenu, null),
|
|
6488
6572
|
label: props.menuLabel || t.openNav,
|
|
6489
6573
|
size: "md",
|
|
6490
6574
|
onClick: function() {
|
|
@@ -6492,18 +6576,18 @@ var AppShell = React40.forwardRef(function AppShell2(props, ref) {
|
|
|
6492
6576
|
},
|
|
6493
6577
|
"aria-expanded": open
|
|
6494
6578
|
}
|
|
6495
|
-
) : 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));
|
|
6496
6580
|
});
|
|
6497
6581
|
|
|
6498
6582
|
// src/ActionBar.tsx
|
|
6499
|
-
var
|
|
6500
|
-
var ActionBar =
|
|
6583
|
+
var React42 = __toESM(require("react"), 1);
|
|
6584
|
+
var ActionBar = React42.forwardRef(function ActionBar2(props, ref) {
|
|
6501
6585
|
const t = useStrings();
|
|
6502
6586
|
const bulk = props.selected != null;
|
|
6503
6587
|
const idle = bulk && !props.selected;
|
|
6504
6588
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
6505
|
-
const cameFrom =
|
|
6506
|
-
const own =
|
|
6589
|
+
const cameFrom = React42.useRef(null);
|
|
6590
|
+
const own = React42.useRef(null);
|
|
6507
6591
|
function clear() {
|
|
6508
6592
|
props.onClearSelection();
|
|
6509
6593
|
setTimeout(function() {
|
|
@@ -6512,7 +6596,7 @@ var ActionBar = React41.forwardRef(function ActionBar2(props, ref) {
|
|
|
6512
6596
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
6513
6597
|
}, 0);
|
|
6514
6598
|
}
|
|
6515
|
-
return /* @__PURE__ */
|
|
6599
|
+
return /* @__PURE__ */ React42.createElement(
|
|
6516
6600
|
"div",
|
|
6517
6601
|
{
|
|
6518
6602
|
ref: function(el) {
|
|
@@ -6533,16 +6617,16 @@ var ActionBar = React41.forwardRef(function ActionBar2(props, ref) {
|
|
|
6533
6617
|
props.className
|
|
6534
6618
|
)
|
|
6535
6619
|
},
|
|
6536
|
-
/* @__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)
|
|
6537
6621
|
);
|
|
6538
6622
|
});
|
|
6539
6623
|
|
|
6540
6624
|
// src/Separator.tsx
|
|
6541
|
-
var
|
|
6542
|
-
var Separator =
|
|
6625
|
+
var React43 = __toESM(require("react"), 1);
|
|
6626
|
+
var Separator = React43.forwardRef(function Separator2(props, ref) {
|
|
6543
6627
|
const vertical = props.orientation === "vertical";
|
|
6544
6628
|
const decorative = props.decorative !== false;
|
|
6545
|
-
return /* @__PURE__ */
|
|
6629
|
+
return /* @__PURE__ */ React43.createElement(
|
|
6546
6630
|
"div",
|
|
6547
6631
|
{
|
|
6548
6632
|
ref,
|
|
@@ -6555,13 +6639,13 @@ var Separator = React42.forwardRef(function Separator2(props, ref) {
|
|
|
6555
6639
|
});
|
|
6556
6640
|
|
|
6557
6641
|
// src/Table.tsx
|
|
6558
|
-
var
|
|
6559
|
-
var StackLabels =
|
|
6560
|
-
var ColumnIndex =
|
|
6642
|
+
var React44 = __toESM(require("react"), 1);
|
|
6643
|
+
var StackLabels = React44.createContext(null);
|
|
6644
|
+
var ColumnIndex = React44.createContext(-1);
|
|
6561
6645
|
function flat(children) {
|
|
6562
6646
|
const out = [];
|
|
6563
|
-
|
|
6564
|
-
if (
|
|
6647
|
+
React44.Children.toArray(children).forEach(function(c) {
|
|
6648
|
+
if (React44.isValidElement(c) && c.type === React44.Fragment)
|
|
6565
6649
|
out.push.apply(out, flat(c.props.children));
|
|
6566
6650
|
else out.push(c);
|
|
6567
6651
|
});
|
|
@@ -6575,7 +6659,7 @@ function text(node) {
|
|
|
6575
6659
|
});
|
|
6576
6660
|
return parts.length ? parts.join("") : void 0;
|
|
6577
6661
|
}
|
|
6578
|
-
if (
|
|
6662
|
+
if (React44.isValidElement(node)) {
|
|
6579
6663
|
const p = node.props;
|
|
6580
6664
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
6581
6665
|
return text(p.children);
|
|
@@ -6585,13 +6669,13 @@ function text(node) {
|
|
|
6585
6669
|
function headerLabels(children) {
|
|
6586
6670
|
let out = [];
|
|
6587
6671
|
flat(children).forEach(function(c) {
|
|
6588
|
-
if (out.length || !
|
|
6672
|
+
if (out.length || !React44.isValidElement(c) || c.type !== THead) return;
|
|
6589
6673
|
const row = flat(c.props.children).find(function(r) {
|
|
6590
|
-
return
|
|
6674
|
+
return React44.isValidElement(r);
|
|
6591
6675
|
});
|
|
6592
6676
|
if (!row) return;
|
|
6593
6677
|
flat(row.props.children).forEach(function(cell) {
|
|
6594
|
-
if (!
|
|
6678
|
+
if (!React44.isValidElement(cell)) return;
|
|
6595
6679
|
const p = cell.props;
|
|
6596
6680
|
const t = text(p.children);
|
|
6597
6681
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -6601,7 +6685,7 @@ function headerLabels(children) {
|
|
|
6601
6685
|
});
|
|
6602
6686
|
return out;
|
|
6603
6687
|
}
|
|
6604
|
-
var Table =
|
|
6688
|
+
var Table = React44.forwardRef(function Table2(props, ref) {
|
|
6605
6689
|
const { caption, captionHidden, density, stackBelow, className, children, ...rest } = props;
|
|
6606
6690
|
const labels = stackBelow ? headerLabels(children) : null;
|
|
6607
6691
|
if (labels && !labels.length)
|
|
@@ -6609,10 +6693,10 @@ var Table = React43.forwardRef(function Table2(props, ref) {
|
|
|
6609
6693
|
"tbl-stack-labels",
|
|
6610
6694
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
6611
6695
|
);
|
|
6612
|
-
const outer =
|
|
6696
|
+
const outer = React44.useContext(StackLabels);
|
|
6613
6697
|
const capId = uid();
|
|
6614
|
-
const wrap =
|
|
6615
|
-
const sc =
|
|
6698
|
+
const wrap = React44.useRef(null);
|
|
6699
|
+
const sc = React44.useState(false), scrolls = sc[0];
|
|
6616
6700
|
useIsoLayoutEffect(function() {
|
|
6617
6701
|
const el = wrap.current;
|
|
6618
6702
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -6626,7 +6710,7 @@ var Table = React43.forwardRef(function Table2(props, ref) {
|
|
|
6626
6710
|
ro.disconnect();
|
|
6627
6711
|
};
|
|
6628
6712
|
}, []);
|
|
6629
|
-
return /* @__PURE__ */
|
|
6713
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6630
6714
|
"div",
|
|
6631
6715
|
{
|
|
6632
6716
|
ref: wrap,
|
|
@@ -6637,7 +6721,7 @@ var Table = React43.forwardRef(function Table2(props, ref) {
|
|
|
6637
6721
|
"aria-labelledby": scrolls && caption != null ? capId : void 0,
|
|
6638
6722
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
6639
6723
|
},
|
|
6640
|
-
/* @__PURE__ */
|
|
6724
|
+
/* @__PURE__ */ React44.createElement(
|
|
6641
6725
|
"table",
|
|
6642
6726
|
{
|
|
6643
6727
|
ref,
|
|
@@ -6645,16 +6729,16 @@ var Table = React43.forwardRef(function Table2(props, ref) {
|
|
|
6645
6729
|
role: stackBelow ? "table" : void 0,
|
|
6646
6730
|
...rest
|
|
6647
6731
|
},
|
|
6648
|
-
caption != null ? /* @__PURE__ */
|
|
6649
|
-
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
|
|
6650
6734
|
)
|
|
6651
6735
|
);
|
|
6652
6736
|
});
|
|
6653
6737
|
function section(tag, cls) {
|
|
6654
|
-
const C =
|
|
6738
|
+
const C = React44.forwardRef(function TableSection(props, ref) {
|
|
6655
6739
|
const { className, ...rest } = props;
|
|
6656
|
-
const stacked =
|
|
6657
|
-
return
|
|
6740
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6741
|
+
return React44.createElement(
|
|
6658
6742
|
tag,
|
|
6659
6743
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
6660
6744
|
);
|
|
@@ -6667,14 +6751,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
6667
6751
|
TBody.displayName = "TBody";
|
|
6668
6752
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
6669
6753
|
TFoot.displayName = "TFoot";
|
|
6670
|
-
var Tr =
|
|
6754
|
+
var Tr = React44.forwardRef(function Tr2(props, ref) {
|
|
6671
6755
|
const { className, children, ...rest } = props;
|
|
6672
|
-
const stacked =
|
|
6756
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6673
6757
|
let col = 0;
|
|
6674
|
-
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) {
|
|
6675
6759
|
const at = col;
|
|
6676
|
-
if (
|
|
6677
|
-
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);
|
|
6678
6762
|
}) : children);
|
|
6679
6763
|
});
|
|
6680
6764
|
function cellClass(base, p) {
|
|
@@ -6688,10 +6772,10 @@ function cellClass(base, p) {
|
|
|
6688
6772
|
p.className
|
|
6689
6773
|
);
|
|
6690
6774
|
}
|
|
6691
|
-
var Th =
|
|
6775
|
+
var Th = React44.forwardRef(function Th2(props, ref) {
|
|
6692
6776
|
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6693
|
-
const stacked =
|
|
6694
|
-
return /* @__PURE__ */
|
|
6777
|
+
const stacked = React44.useContext(StackLabels) != null;
|
|
6778
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6695
6779
|
"th",
|
|
6696
6780
|
{
|
|
6697
6781
|
ref,
|
|
@@ -6702,11 +6786,11 @@ var Th = React43.forwardRef(function Th2(props, ref) {
|
|
|
6702
6786
|
}
|
|
6703
6787
|
);
|
|
6704
6788
|
});
|
|
6705
|
-
var Td =
|
|
6789
|
+
var Td = React44.forwardRef(function Td2(props, ref) {
|
|
6706
6790
|
const { align, numeric, mono, className, scope, label, ...rest } = props;
|
|
6707
|
-
const labels =
|
|
6791
|
+
const labels = React44.useContext(StackLabels), col = React44.useContext(ColumnIndex);
|
|
6708
6792
|
const shown = labels ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
6709
|
-
return /* @__PURE__ */
|
|
6793
|
+
return /* @__PURE__ */ React44.createElement(
|
|
6710
6794
|
"td",
|
|
6711
6795
|
{
|
|
6712
6796
|
ref,
|
|
@@ -6719,8 +6803,8 @@ var Td = React43.forwardRef(function Td2(props, ref) {
|
|
|
6719
6803
|
});
|
|
6720
6804
|
|
|
6721
6805
|
// src/BottomNav.tsx
|
|
6722
|
-
var
|
|
6723
|
-
var BottomNav =
|
|
6806
|
+
var React45 = __toESM(require("react"), 1);
|
|
6807
|
+
var BottomNav = React45.forwardRef(function BottomNav2(props, ref) {
|
|
6724
6808
|
const t = useStrings();
|
|
6725
6809
|
const Link = useLinkComponent(props.linkComponent);
|
|
6726
6810
|
const st = useMaybeControlled(
|
|
@@ -6730,14 +6814,14 @@ var BottomNav = React44.forwardRef(function BottomNav2(props, ref) {
|
|
|
6730
6814
|
);
|
|
6731
6815
|
const active = st[0];
|
|
6732
6816
|
const hide = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
6733
|
-
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(
|
|
6734
6818
|
"nav",
|
|
6735
6819
|
{
|
|
6736
6820
|
ref,
|
|
6737
6821
|
className: cx("aura-bottomnav", "aura-bottomnav--" + hide, props.className),
|
|
6738
6822
|
"aria-label": props.label || t.mainNav
|
|
6739
6823
|
},
|
|
6740
|
-
/* @__PURE__ */
|
|
6824
|
+
/* @__PURE__ */ React45.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
6741
6825
|
const on = active === it.id;
|
|
6742
6826
|
const count = it.count != null && it.count > 0 ? it.count > 99 ? "99+" : String(it.count) : null;
|
|
6743
6827
|
const suffix = count || it.badge && it.badgeLabel ? " (" + (count || it.badgeLabel) + ")" : "";
|
|
@@ -6753,19 +6837,19 @@ var BottomNav = React44.forwardRef(function BottomNav2(props, ref) {
|
|
|
6753
6837
|
}
|
|
6754
6838
|
};
|
|
6755
6839
|
const inner = [
|
|
6756
|
-
/* @__PURE__ */
|
|
6757
|
-
/* @__PURE__ */
|
|
6758
|
-
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
|
|
6759
6843
|
];
|
|
6760
|
-
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));
|
|
6761
6845
|
}))
|
|
6762
6846
|
));
|
|
6763
6847
|
});
|
|
6764
6848
|
|
|
6765
6849
|
// src/Surface.tsx
|
|
6766
|
-
var
|
|
6767
|
-
var h8 =
|
|
6768
|
-
var Surface =
|
|
6850
|
+
var React46 = __toESM(require("react"), 1);
|
|
6851
|
+
var h8 = React46.createElement;
|
|
6852
|
+
var Surface = React46.forwardRef(function Surface2(props, ref) {
|
|
6769
6853
|
const t = props.texture || "mesh";
|
|
6770
6854
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
6771
6855
|
return h8(
|
|
@@ -6786,8 +6870,8 @@ var Surface = React45.forwardRef(function Surface2(props, ref) {
|
|
|
6786
6870
|
});
|
|
6787
6871
|
|
|
6788
6872
|
// src/Stat.tsx
|
|
6789
|
-
var
|
|
6790
|
-
var Stat =
|
|
6873
|
+
var React47 = __toESM(require("react"), 1);
|
|
6874
|
+
var Stat = React47.forwardRef(function Stat2(props, ref) {
|
|
6791
6875
|
const ch = props.change;
|
|
6792
6876
|
const dir = ch && (ch.direction || "flat");
|
|
6793
6877
|
const tone2 = ch && (ch.tone || (dir === "up" ? "positive" : dir === "down" ? "negative" : "neutral"));
|
|
@@ -6796,7 +6880,7 @@ var Stat = React46.forwardRef(function Stat2(props, ref) {
|
|
|
6796
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, ""));
|
|
6797
6881
|
const Tag3 = props.href ? Link : props.onClick ? "button" : "div";
|
|
6798
6882
|
const interactive = !!(props.href || props.onClick);
|
|
6799
|
-
return /* @__PURE__ */
|
|
6883
|
+
return /* @__PURE__ */ React47.createElement(
|
|
6800
6884
|
Tag3,
|
|
6801
6885
|
{
|
|
6802
6886
|
ref,
|
|
@@ -6806,20 +6890,20 @@ var Stat = React46.forwardRef(function Stat2(props, ref) {
|
|
|
6806
6890
|
type: Tag3 === "button" ? "button" : void 0,
|
|
6807
6891
|
"aria-busy": props.loading || void 0
|
|
6808
6892
|
},
|
|
6809
|
-
/* @__PURE__ */
|
|
6810
|
-
props.loading ? /* @__PURE__ */
|
|
6811
|
-
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(
|
|
6812
6896
|
Icon,
|
|
6813
6897
|
{
|
|
6814
|
-
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),
|
|
6815
6899
|
size: 14
|
|
6816
6900
|
}
|
|
6817
|
-
), /* @__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
|
|
6818
6902
|
);
|
|
6819
6903
|
});
|
|
6820
6904
|
|
|
6821
6905
|
// src/TimePicker.tsx
|
|
6822
|
-
var
|
|
6906
|
+
var React48 = __toESM(require("react"), 1);
|
|
6823
6907
|
var import_react_dom11 = require("react-dom");
|
|
6824
6908
|
|
|
6825
6909
|
// src/text.ts
|
|
@@ -6861,7 +6945,7 @@ function toMin(t) {
|
|
|
6861
6945
|
function fromMin(n3) {
|
|
6862
6946
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
6863
6947
|
}
|
|
6864
|
-
var TimePicker =
|
|
6948
|
+
var TimePicker = React48.forwardRef(function TimePicker2(props, ref) {
|
|
6865
6949
|
const t = useStrings();
|
|
6866
6950
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
6867
6951
|
const st = useMaybeControlled(
|
|
@@ -6871,7 +6955,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6871
6955
|
);
|
|
6872
6956
|
const value = st[0];
|
|
6873
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;
|
|
6874
|
-
const slots =
|
|
6958
|
+
const slots = React48.useMemo(
|
|
6875
6959
|
function() {
|
|
6876
6960
|
const out = [];
|
|
6877
6961
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -6883,12 +6967,12 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6883
6967
|
const n3 = toMin(v);
|
|
6884
6968
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
6885
6969
|
}
|
|
6886
|
-
const openState =
|
|
6887
|
-
const editState =
|
|
6888
|
-
const aState =
|
|
6889
|
-
const errState =
|
|
6890
|
-
const pos =
|
|
6891
|
-
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);
|
|
6892
6976
|
const mounted = useMounted();
|
|
6893
6977
|
function nearest(v) {
|
|
6894
6978
|
const n3 = toMin(v);
|
|
@@ -6916,7 +7000,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6916
7000
|
},
|
|
6917
7001
|
[open]
|
|
6918
7002
|
);
|
|
6919
|
-
|
|
7003
|
+
React48.useEffect(
|
|
6920
7004
|
function() {
|
|
6921
7005
|
if (!open) return;
|
|
6922
7006
|
function outside(e) {
|
|
@@ -6938,7 +7022,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
6938
7022
|
},
|
|
6939
7023
|
[open]
|
|
6940
7024
|
);
|
|
6941
|
-
|
|
7025
|
+
React48.useEffect(
|
|
6942
7026
|
function() {
|
|
6943
7027
|
if (!open || !listRef.current) return;
|
|
6944
7028
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -7037,9 +7121,9 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7037
7121
|
}
|
|
7038
7122
|
const error = errState[0] || props.error;
|
|
7039
7123
|
const list = open && mounted && pos[0] ? (0, import_react_dom11.createPortal)(
|
|
7040
|
-
/* @__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) {
|
|
7041
7125
|
const dis = blocked(s), sel = s === value;
|
|
7042
|
-
return /* @__PURE__ */
|
|
7126
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7043
7127
|
"li",
|
|
7044
7128
|
{
|
|
7045
7129
|
key: s,
|
|
@@ -7064,13 +7148,13 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7064
7148
|
if (active !== i) setActive(i);
|
|
7065
7149
|
}
|
|
7066
7150
|
},
|
|
7067
|
-
/* @__PURE__ */
|
|
7068
|
-
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
|
|
7069
7153
|
);
|
|
7070
7154
|
}))),
|
|
7071
7155
|
document.body
|
|
7072
7156
|
) : null;
|
|
7073
|
-
return /* @__PURE__ */
|
|
7157
|
+
return /* @__PURE__ */ React48.createElement(
|
|
7074
7158
|
Field,
|
|
7075
7159
|
{
|
|
7076
7160
|
id,
|
|
@@ -7082,7 +7166,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7082
7166
|
disabled: props.disabled,
|
|
7083
7167
|
className: props.className
|
|
7084
7168
|
},
|
|
7085
|
-
/* @__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(
|
|
7086
7170
|
"input",
|
|
7087
7171
|
{
|
|
7088
7172
|
ref: inputMerged,
|
|
@@ -7122,7 +7206,7 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7122
7206
|
}, 0);
|
|
7123
7207
|
}
|
|
7124
7208
|
}
|
|
7125
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
7209
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React48.createElement(
|
|
7126
7210
|
"button",
|
|
7127
7211
|
{
|
|
7128
7212
|
type: "button",
|
|
@@ -7135,8 +7219,8 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7135
7219
|
if (inputRef.current) inputRef.current.focus();
|
|
7136
7220
|
}
|
|
7137
7221
|
},
|
|
7138
|
-
/* @__PURE__ */
|
|
7139
|
-
) : null, /* @__PURE__ */
|
|
7222
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconX, null) })
|
|
7223
|
+
) : null, /* @__PURE__ */ React48.createElement(
|
|
7140
7224
|
"button",
|
|
7141
7225
|
{
|
|
7142
7226
|
type: "button",
|
|
@@ -7154,14 +7238,14 @@ var TimePicker = React47.forwardRef(function TimePicker2(props, ref) {
|
|
|
7154
7238
|
}
|
|
7155
7239
|
}
|
|
7156
7240
|
},
|
|
7157
|
-
/* @__PURE__ */
|
|
7241
|
+
/* @__PURE__ */ React48.createElement(Icon, { name: /* @__PURE__ */ React48.createElement(IconChevronDown, null) })
|
|
7158
7242
|
)),
|
|
7159
7243
|
list
|
|
7160
7244
|
);
|
|
7161
7245
|
});
|
|
7162
7246
|
|
|
7163
7247
|
// src/FileUpload.tsx
|
|
7164
|
-
var
|
|
7248
|
+
var React49 = __toESM(require("react"), 1);
|
|
7165
7249
|
function matches(file, accept) {
|
|
7166
7250
|
if (!accept) return true;
|
|
7167
7251
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -7185,24 +7269,24 @@ function describeAccept(accept, t) {
|
|
|
7185
7269
|
}).join(", ");
|
|
7186
7270
|
}
|
|
7187
7271
|
var seq = 0;
|
|
7188
|
-
var FileUpload =
|
|
7272
|
+
var FileUpload = React49.forwardRef(function FileUpload2(props, ref) {
|
|
7189
7273
|
const t = useStrings();
|
|
7190
7274
|
const auto = uid(), id = props.id || auto;
|
|
7191
7275
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
7192
7276
|
const items2 = st[0] || [];
|
|
7193
|
-
const dragState =
|
|
7194
|
-
const inputRef =
|
|
7195
|
-
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({});
|
|
7196
7280
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
7197
7281
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
7198
|
-
|
|
7282
|
+
React49.useEffect(function() {
|
|
7199
7283
|
return function() {
|
|
7200
7284
|
Object.keys(urls.current).forEach(function(k) {
|
|
7201
7285
|
URL.revokeObjectURL(urls.current[k]);
|
|
7202
7286
|
});
|
|
7203
7287
|
};
|
|
7204
7288
|
}, []);
|
|
7205
|
-
|
|
7289
|
+
React49.useEffect(
|
|
7206
7290
|
function() {
|
|
7207
7291
|
const el = inputRef.current;
|
|
7208
7292
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -7262,7 +7346,7 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7262
7346
|
if (inputRef.current) inputRef.current.focus();
|
|
7263
7347
|
}
|
|
7264
7348
|
const error = props.error;
|
|
7265
|
-
return /* @__PURE__ */
|
|
7349
|
+
return /* @__PURE__ */ React49.createElement(
|
|
7266
7350
|
Field,
|
|
7267
7351
|
{
|
|
7268
7352
|
id,
|
|
@@ -7274,7 +7358,7 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7274
7358
|
disabled: props.disabled,
|
|
7275
7359
|
className: props.className
|
|
7276
7360
|
},
|
|
7277
|
-
/* @__PURE__ */
|
|
7361
|
+
/* @__PURE__ */ React49.createElement(
|
|
7278
7362
|
"div",
|
|
7279
7363
|
{
|
|
7280
7364
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -7295,9 +7379,9 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7295
7379
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
7296
7380
|
}
|
|
7297
7381
|
},
|
|
7298
|
-
/* @__PURE__ */
|
|
7299
|
-
/* @__PURE__ */
|
|
7300
|
-
/* @__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(
|
|
7301
7385
|
"input",
|
|
7302
7386
|
{
|
|
7303
7387
|
ref: inputMerged,
|
|
@@ -7319,12 +7403,12 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7319
7403
|
}
|
|
7320
7404
|
}
|
|
7321
7405
|
),
|
|
7322
|
-
/* @__PURE__ */
|
|
7323
|
-
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
|
|
7324
7408
|
),
|
|
7325
|
-
items2.length ? /* @__PURE__ */
|
|
7409
|
+
items2.length ? /* @__PURE__ */ React49.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
7326
7410
|
const src = thumb(it);
|
|
7327
|
-
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(
|
|
7328
7412
|
"span",
|
|
7329
7413
|
{
|
|
7330
7414
|
className: "aura-upload__bar",
|
|
@@ -7334,11 +7418,11 @@ var FileUpload = React48.forwardRef(function FileUpload2(props, ref) {
|
|
|
7334
7418
|
"aria-valuemax": 100,
|
|
7335
7419
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
7336
7420
|
},
|
|
7337
|
-
/* @__PURE__ */
|
|
7338
|
-
) : null), /* @__PURE__ */
|
|
7421
|
+
/* @__PURE__ */ React49.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
7422
|
+
) : null), /* @__PURE__ */ React49.createElement(
|
|
7339
7423
|
IconButton,
|
|
7340
7424
|
{
|
|
7341
|
-
icon: /* @__PURE__ */
|
|
7425
|
+
icon: /* @__PURE__ */ React49.createElement(IconX, null),
|
|
7342
7426
|
label: t.remove(it.name),
|
|
7343
7427
|
onClick: function() {
|
|
7344
7428
|
remove(it);
|
|
@@ -7623,9 +7707,9 @@ function createTheme(opts) {
|
|
|
7623
7707
|
}
|
|
7624
7708
|
|
|
7625
7709
|
// src/ThemeStyle.tsx
|
|
7626
|
-
var
|
|
7710
|
+
var React50 = __toESM(require("react"), 1);
|
|
7627
7711
|
function ThemeStyle(props) {
|
|
7628
|
-
const css =
|
|
7712
|
+
const css = React50.useMemo(
|
|
7629
7713
|
function() {
|
|
7630
7714
|
try {
|
|
7631
7715
|
return createTheme({
|
|
@@ -7642,11 +7726,11 @@ function ThemeStyle(props) {
|
|
|
7642
7726
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
7643
7727
|
);
|
|
7644
7728
|
if (css === null) return null;
|
|
7645
|
-
return /* @__PURE__ */
|
|
7729
|
+
return /* @__PURE__ */ React50.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
7646
7730
|
}
|
|
7647
7731
|
|
|
7648
7732
|
// src/colorScheme.tsx
|
|
7649
|
-
var
|
|
7733
|
+
var React51 = __toESM(require("react"), 1);
|
|
7650
7734
|
|
|
7651
7735
|
// src/colorSchemeScript.ts
|
|
7652
7736
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -7663,7 +7747,7 @@ function colorSchemeScript(options) {
|
|
|
7663
7747
|
|
|
7664
7748
|
// src/colorScheme.tsx
|
|
7665
7749
|
function ColorSchemeScript(props) {
|
|
7666
|
-
return /* @__PURE__ */
|
|
7750
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7667
7751
|
"script",
|
|
7668
7752
|
{
|
|
7669
7753
|
"data-aura-color-scheme": "",
|
|
@@ -7688,7 +7772,7 @@ function apply(scheme) {
|
|
|
7688
7772
|
function useColorScheme(options) {
|
|
7689
7773
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
7690
7774
|
const fallback = options && options.defaultScheme || "system";
|
|
7691
|
-
const subscribe2 =
|
|
7775
|
+
const subscribe2 = React51.useCallback(
|
|
7692
7776
|
function(cb) {
|
|
7693
7777
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
7694
7778
|
function onSystem() {
|
|
@@ -7710,7 +7794,7 @@ function useColorScheme(options) {
|
|
|
7710
7794
|
},
|
|
7711
7795
|
[fallback, key]
|
|
7712
7796
|
);
|
|
7713
|
-
const snapshot =
|
|
7797
|
+
const snapshot = React51.useSyncExternalStore(
|
|
7714
7798
|
subscribe2,
|
|
7715
7799
|
function() {
|
|
7716
7800
|
const s = readScheme(fallback);
|
|
@@ -7721,7 +7805,7 @@ function useColorScheme(options) {
|
|
|
7721
7805
|
}
|
|
7722
7806
|
);
|
|
7723
7807
|
const parts = snapshot.split("|");
|
|
7724
|
-
const setScheme =
|
|
7808
|
+
const setScheme = React51.useCallback(
|
|
7725
7809
|
function(next) {
|
|
7726
7810
|
if (!valid(next)) return;
|
|
7727
7811
|
try {
|
|
@@ -7740,14 +7824,14 @@ function ColorSchemeToggle(props) {
|
|
|
7740
7824
|
const cs = useColorScheme(props);
|
|
7741
7825
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
7742
7826
|
const label = props.label || t.colorScheme;
|
|
7743
|
-
return /* @__PURE__ */
|
|
7827
|
+
return /* @__PURE__ */ React51.createElement(
|
|
7744
7828
|
DropdownMenu,
|
|
7745
7829
|
{
|
|
7746
7830
|
label,
|
|
7747
|
-
trigger: /* @__PURE__ */
|
|
7831
|
+
trigger: /* @__PURE__ */ React51.createElement(
|
|
7748
7832
|
IconButton,
|
|
7749
7833
|
{
|
|
7750
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
7834
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React51.createElement(IconMoon, null) : /* @__PURE__ */ React51.createElement(IconSun, null),
|
|
7751
7835
|
label: label + ": " + names[cs.scheme]
|
|
7752
7836
|
}
|
|
7753
7837
|
),
|
|
@@ -7765,19 +7849,19 @@ function ColorSchemeToggle(props) {
|
|
|
7765
7849
|
}
|
|
7766
7850
|
|
|
7767
7851
|
// src/Badge.tsx
|
|
7768
|
-
var
|
|
7769
|
-
var Badge =
|
|
7852
|
+
var React52 = __toESM(require("react"), 1);
|
|
7853
|
+
var Badge = React52.forwardRef(function Badge2(props, ref) {
|
|
7770
7854
|
return badgeElement(props, ref);
|
|
7771
7855
|
});
|
|
7772
7856
|
|
|
7773
7857
|
// src/Progress.tsx
|
|
7774
|
-
var
|
|
7775
|
-
var Progress =
|
|
7858
|
+
var React53 = __toESM(require("react"), 1);
|
|
7859
|
+
var Progress = React53.forwardRef(function Progress2(props, ref) {
|
|
7776
7860
|
const auto = uid(), id = props.id || auto;
|
|
7777
7861
|
const max = props.max || 100, det = props.value != null;
|
|
7778
7862
|
const pct = det ? Math.max(0, Math.min(100, props.value / max * 100)) : 0;
|
|
7779
7863
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
7780
|
-
return /* @__PURE__ */
|
|
7864
|
+
return /* @__PURE__ */ React53.createElement(
|
|
7781
7865
|
"div",
|
|
7782
7866
|
{
|
|
7783
7867
|
ref,
|
|
@@ -7788,8 +7872,8 @@ var Progress = React52.forwardRef(function Progress2(props, ref) {
|
|
|
7788
7872
|
props.className
|
|
7789
7873
|
)
|
|
7790
7874
|
},
|
|
7791
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
7792
|
-
/* @__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(
|
|
7793
7877
|
"div",
|
|
7794
7878
|
{
|
|
7795
7879
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -7801,21 +7885,21 @@ var Progress = React52.forwardRef(function Progress2(props, ref) {
|
|
|
7801
7885
|
"aria-valuenow": det ? props.value : void 0,
|
|
7802
7886
|
"aria-valuetext": det && props.valueLabel != null ? String(props.valueLabel) : void 0
|
|
7803
7887
|
},
|
|
7804
|
-
/* @__PURE__ */
|
|
7888
|
+
/* @__PURE__ */ React53.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 })
|
|
7805
7889
|
),
|
|
7806
|
-
props.hint ? /* @__PURE__ */
|
|
7890
|
+
props.hint ? /* @__PURE__ */ React53.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
7807
7891
|
);
|
|
7808
7892
|
});
|
|
7809
7893
|
|
|
7810
7894
|
// src/Skeleton.tsx
|
|
7811
|
-
var
|
|
7812
|
-
var Skeleton =
|
|
7895
|
+
var React54 = __toESM(require("react"), 1);
|
|
7896
|
+
var Skeleton = React54.forwardRef(function Skeleton2(props, ref) {
|
|
7813
7897
|
const v = props.variant || "text";
|
|
7814
7898
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
7815
7899
|
const n3 = props.lines, rows = [];
|
|
7816
7900
|
for (let i = 0; i < n3; i++)
|
|
7817
|
-
rows.push(/* @__PURE__ */
|
|
7818
|
-
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(
|
|
7819
7903
|
"span",
|
|
7820
7904
|
{
|
|
7821
7905
|
ref,
|
|
@@ -7833,17 +7917,17 @@ var Skeleton = React53.forwardRef(function Skeleton2(props, ref) {
|
|
|
7833
7917
|
if (v === "circle") {
|
|
7834
7918
|
style.width = style.height = props.size || props.width || 40;
|
|
7835
7919
|
}
|
|
7836
|
-
return /* @__PURE__ */
|
|
7920
|
+
return /* @__PURE__ */ React54.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
7837
7921
|
});
|
|
7838
7922
|
|
|
7839
7923
|
// src/EmptyState.tsx
|
|
7840
|
-
var
|
|
7841
|
-
var EmptyState =
|
|
7924
|
+
var React55 = __toESM(require("react"), 1);
|
|
7925
|
+
var EmptyState = React55.forwardRef(function EmptyState2(props, ref) {
|
|
7842
7926
|
return emptyStateElement(props, ref);
|
|
7843
7927
|
});
|
|
7844
7928
|
|
|
7845
7929
|
// src/Pagination.tsx
|
|
7846
|
-
var
|
|
7930
|
+
var React56 = __toESM(require("react"), 1);
|
|
7847
7931
|
function pageList(page, count, sib) {
|
|
7848
7932
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
7849
7933
|
if (page - sib <= 3) {
|
|
@@ -7863,7 +7947,7 @@ function pageList(page, count, sib) {
|
|
|
7863
7947
|
if (count > 1) out.push(count);
|
|
7864
7948
|
return out;
|
|
7865
7949
|
}
|
|
7866
|
-
var Pagination =
|
|
7950
|
+
var Pagination = React56.forwardRef(function Pagination2(props, ref) {
|
|
7867
7951
|
const t = useStrings();
|
|
7868
7952
|
const count = Math.max(1, props.pageCount || 1);
|
|
7869
7953
|
const st = useMaybeControlled(props.page, props.defaultPage || 1, props.onChange);
|
|
@@ -7882,7 +7966,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7882
7966
|
},
|
|
7883
7967
|
extra
|
|
7884
7968
|
);
|
|
7885
|
-
return link ? /* @__PURE__ */
|
|
7969
|
+
return link ? /* @__PURE__ */ React56.createElement(
|
|
7886
7970
|
Link,
|
|
7887
7971
|
{
|
|
7888
7972
|
href: link(p),
|
|
@@ -7895,7 +7979,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7895
7979
|
...common
|
|
7896
7980
|
},
|
|
7897
7981
|
label
|
|
7898
|
-
) : /* @__PURE__ */
|
|
7982
|
+
) : /* @__PURE__ */ React56.createElement(
|
|
7899
7983
|
"button",
|
|
7900
7984
|
{
|
|
7901
7985
|
type: "button",
|
|
@@ -7909,7 +7993,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7909
7993
|
}
|
|
7910
7994
|
function arrow(p, icon, label, rel, disabled) {
|
|
7911
7995
|
if (!link || disabled)
|
|
7912
|
-
return /* @__PURE__ */
|
|
7996
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7913
7997
|
IconButton,
|
|
7914
7998
|
{
|
|
7915
7999
|
icon,
|
|
@@ -7920,7 +8004,7 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7920
8004
|
}
|
|
7921
8005
|
}
|
|
7922
8006
|
);
|
|
7923
|
-
return /* @__PURE__ */
|
|
8007
|
+
return /* @__PURE__ */ React56.createElement(
|
|
7924
8008
|
Link,
|
|
7925
8009
|
{
|
|
7926
8010
|
href: link(p),
|
|
@@ -7935,17 +8019,17 @@ var Pagination = React55.forwardRef(function Pagination2(props, ref) {
|
|
|
7935
8019
|
}
|
|
7936
8020
|
}
|
|
7937
8021
|
},
|
|
7938
|
-
/* @__PURE__ */
|
|
8022
|
+
/* @__PURE__ */ React56.createElement(Icon, { name: icon, size: "sm" })
|
|
7939
8023
|
);
|
|
7940
8024
|
}
|
|
7941
|
-
return /* @__PURE__ */
|
|
7942
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
7943
|
-
})), /* @__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));
|
|
7944
8028
|
});
|
|
7945
8029
|
|
|
7946
8030
|
// src/Accordion.tsx
|
|
7947
|
-
var
|
|
7948
|
-
var Accordion =
|
|
8031
|
+
var React57 = __toESM(require("react"), 1);
|
|
8032
|
+
var Accordion = React57.forwardRef(function Accordion2(props, ref) {
|
|
7949
8033
|
const auto = uid(), base = props.id || auto;
|
|
7950
8034
|
const multiple = props.type === "multiple";
|
|
7951
8035
|
const st = useMaybeControlled(
|
|
@@ -7983,9 +8067,9 @@ var Accordion = React56.forwardRef(function Accordion2(props, ref) {
|
|
|
7983
8067
|
n3.focus();
|
|
7984
8068
|
}
|
|
7985
8069
|
}
|
|
7986
|
-
return /* @__PURE__ */
|
|
8070
|
+
return /* @__PURE__ */ React57.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
7987
8071
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
7988
|
-
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(
|
|
7989
8073
|
"button",
|
|
7990
8074
|
{
|
|
7991
8075
|
type: "button",
|
|
@@ -7997,15 +8081,15 @@ var Accordion = React56.forwardRef(function Accordion2(props, ref) {
|
|
|
7997
8081
|
toggle(it.id);
|
|
7998
8082
|
}
|
|
7999
8083
|
},
|
|
8000
|
-
it.icon ? /* @__PURE__ */
|
|
8001
|
-
/* @__PURE__ */
|
|
8002
|
-
/* @__PURE__ */
|
|
8003
|
-
)), /* @__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));
|
|
8004
8088
|
}));
|
|
8005
8089
|
});
|
|
8006
8090
|
|
|
8007
8091
|
// src/Popover.tsx
|
|
8008
|
-
var
|
|
8092
|
+
var React58 = __toESM(require("react"), 1);
|
|
8009
8093
|
var import_react_dom12 = require("react-dom");
|
|
8010
8094
|
function position(anchor, pop, placement) {
|
|
8011
8095
|
const r = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -8023,15 +8107,15 @@ function position(anchor, pop, placement) {
|
|
|
8023
8107
|
const left = align === "end" ? r.right - pw : align === "center" ? r.left + r.width / 2 - pw / 2 : r.left;
|
|
8024
8108
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
8025
8109
|
}
|
|
8026
|
-
var Popover =
|
|
8110
|
+
var Popover = React58.forwardRef(function Popover2(props, ref) {
|
|
8027
8111
|
const t = useStrings();
|
|
8028
8112
|
const density = useDensity();
|
|
8029
8113
|
const auto = uid(), id = props.id || auto;
|
|
8030
8114
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
8031
8115
|
const open = !!st[0];
|
|
8032
|
-
const wrap =
|
|
8033
|
-
const pos =
|
|
8034
|
-
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);
|
|
8035
8119
|
function trigger() {
|
|
8036
8120
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
8037
8121
|
}
|
|
@@ -8058,7 +8142,7 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8058
8142
|
},
|
|
8059
8143
|
[open, mounted, props.placement]
|
|
8060
8144
|
);
|
|
8061
|
-
|
|
8145
|
+
React58.useEffect(
|
|
8062
8146
|
function() {
|
|
8063
8147
|
if (!open || !mounted) return;
|
|
8064
8148
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -8083,9 +8167,9 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8083
8167
|
},
|
|
8084
8168
|
[open, mounted]
|
|
8085
8169
|
);
|
|
8086
|
-
const child =
|
|
8170
|
+
const child = React58.Children.only(props.trigger);
|
|
8087
8171
|
const panel = open && mounted ? (0, import_react_dom12.createPortal)(
|
|
8088
|
-
/* @__PURE__ */
|
|
8172
|
+
/* @__PURE__ */ React58.createElement(
|
|
8089
8173
|
"div",
|
|
8090
8174
|
{
|
|
8091
8175
|
ref: popMerged,
|
|
@@ -8115,17 +8199,17 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8115
8199
|
} else trapTab(e, pop.current);
|
|
8116
8200
|
}
|
|
8117
8201
|
},
|
|
8118
|
-
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(
|
|
8119
8203
|
IconButton,
|
|
8120
8204
|
{
|
|
8121
|
-
icon: /* @__PURE__ */
|
|
8205
|
+
icon: /* @__PURE__ */ React58.createElement(IconX, null),
|
|
8122
8206
|
label: t.close,
|
|
8123
8207
|
onClick: function() {
|
|
8124
8208
|
close(true);
|
|
8125
8209
|
}
|
|
8126
8210
|
}
|
|
8127
8211
|
)) : null,
|
|
8128
|
-
/* @__PURE__ */
|
|
8212
|
+
/* @__PURE__ */ React58.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
8129
8213
|
close: function() {
|
|
8130
8214
|
close(true);
|
|
8131
8215
|
}
|
|
@@ -8133,7 +8217,7 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8133
8217
|
),
|
|
8134
8218
|
document.body
|
|
8135
8219
|
) : null;
|
|
8136
|
-
return /* @__PURE__ */
|
|
8220
|
+
return /* @__PURE__ */ React58.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React58.cloneElement(child, {
|
|
8137
8221
|
onClick: function(e) {
|
|
8138
8222
|
if (child.props.onClick) child.props.onClick(e);
|
|
8139
8223
|
st[1](!open);
|
|
@@ -8145,7 +8229,7 @@ var Popover = React57.forwardRef(function Popover2(props, ref) {
|
|
|
8145
8229
|
});
|
|
8146
8230
|
|
|
8147
8231
|
// src/NumberField.tsx
|
|
8148
|
-
var
|
|
8232
|
+
var React59 = __toESM(require("react"), 1);
|
|
8149
8233
|
function decimalsOf(n3) {
|
|
8150
8234
|
const s = String(n3);
|
|
8151
8235
|
const i = s.indexOf(".");
|
|
@@ -8158,7 +8242,7 @@ function parse(text2) {
|
|
|
8158
8242
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
8159
8243
|
return Number(s);
|
|
8160
8244
|
}
|
|
8161
|
-
var NumberField =
|
|
8245
|
+
var NumberField = React59.forwardRef(function NumberField2(props, ref) {
|
|
8162
8246
|
const t = useStrings();
|
|
8163
8247
|
const auto = uid(), id = props.id || auto;
|
|
8164
8248
|
const step = props.step || 1;
|
|
@@ -8169,7 +8253,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8169
8253
|
props.onChange
|
|
8170
8254
|
);
|
|
8171
8255
|
const value = st[0], setValue = st[1];
|
|
8172
|
-
const draftState =
|
|
8256
|
+
const draftState = React59.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
8173
8257
|
function fmt2(n3) {
|
|
8174
8258
|
if (n3 == null || isNaN(n3)) return "";
|
|
8175
8259
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -8218,7 +8302,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8218
8302
|
};
|
|
8219
8303
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
8220
8304
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
8221
|
-
return /* @__PURE__ */
|
|
8305
|
+
return /* @__PURE__ */ React59.createElement(
|
|
8222
8306
|
Field,
|
|
8223
8307
|
{
|
|
8224
8308
|
id,
|
|
@@ -8230,7 +8314,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8230
8314
|
disabled: props.disabled,
|
|
8231
8315
|
className: props.className
|
|
8232
8316
|
},
|
|
8233
|
-
/* @__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(
|
|
8234
8318
|
"input",
|
|
8235
8319
|
{
|
|
8236
8320
|
ref,
|
|
@@ -8277,7 +8361,7 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8277
8361
|
},
|
|
8278
8362
|
onKeyDown
|
|
8279
8363
|
}
|
|
8280
|
-
), 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(
|
|
8281
8365
|
"button",
|
|
8282
8366
|
{
|
|
8283
8367
|
type: "button",
|
|
@@ -8293,8 +8377,8 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8293
8377
|
nudge(-step);
|
|
8294
8378
|
}
|
|
8295
8379
|
},
|
|
8296
|
-
/* @__PURE__ */
|
|
8297
|
-
), /* @__PURE__ */
|
|
8380
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconMinus, null) })
|
|
8381
|
+
), /* @__PURE__ */ React59.createElement(
|
|
8298
8382
|
"button",
|
|
8299
8383
|
{
|
|
8300
8384
|
type: "button",
|
|
@@ -8310,14 +8394,14 @@ var NumberField = React58.forwardRef(function NumberField2(props, ref) {
|
|
|
8310
8394
|
nudge(step);
|
|
8311
8395
|
}
|
|
8312
8396
|
},
|
|
8313
|
-
/* @__PURE__ */
|
|
8397
|
+
/* @__PURE__ */ React59.createElement(Icon, { name: /* @__PURE__ */ React59.createElement(IconPlus, null) })
|
|
8314
8398
|
)) : null)
|
|
8315
8399
|
);
|
|
8316
8400
|
});
|
|
8317
8401
|
|
|
8318
8402
|
// src/Stepper.tsx
|
|
8319
|
-
var
|
|
8320
|
-
var Stepper =
|
|
8403
|
+
var React60 = __toESM(require("react"), 1);
|
|
8404
|
+
var Stepper = React60.forwardRef(function Stepper2(props, ref) {
|
|
8321
8405
|
const t = useStrings();
|
|
8322
8406
|
const steps = props.steps || [];
|
|
8323
8407
|
let at = -1;
|
|
@@ -8327,26 +8411,26 @@ var Stepper = React59.forwardRef(function Stepper2(props, ref) {
|
|
|
8327
8411
|
if (at < 0) at = 0;
|
|
8328
8412
|
const vertical = props.orientation === "vertical";
|
|
8329
8413
|
const cur = steps[at];
|
|
8330
|
-
return /* @__PURE__ */
|
|
8414
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8331
8415
|
"nav",
|
|
8332
8416
|
{
|
|
8333
8417
|
ref,
|
|
8334
8418
|
"aria-label": props.label,
|
|
8335
8419
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
8336
8420
|
},
|
|
8337
|
-
/* @__PURE__ */
|
|
8421
|
+
/* @__PURE__ */ React60.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
8338
8422
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
8339
|
-
const marker = /* @__PURE__ */
|
|
8340
|
-
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);
|
|
8341
8425
|
const clickable = state === "done" && !!props.onStepClick;
|
|
8342
|
-
return /* @__PURE__ */
|
|
8426
|
+
return /* @__PURE__ */ React60.createElement(
|
|
8343
8427
|
"li",
|
|
8344
8428
|
{
|
|
8345
8429
|
key: s.id,
|
|
8346
8430
|
className: cx("aura-stepper__item", "is-" + state),
|
|
8347
8431
|
"aria-current": state === "current" ? "step" : void 0
|
|
8348
8432
|
},
|
|
8349
|
-
clickable ? /* @__PURE__ */
|
|
8433
|
+
clickable ? /* @__PURE__ */ React60.createElement(
|
|
8350
8434
|
"button",
|
|
8351
8435
|
{
|
|
8352
8436
|
type: "button",
|
|
@@ -8357,19 +8441,19 @@ var Stepper = React59.forwardRef(function Stepper2(props, ref) {
|
|
|
8357
8441
|
},
|
|
8358
8442
|
marker,
|
|
8359
8443
|
text2
|
|
8360
|
-
) : /* @__PURE__ */
|
|
8444
|
+
) : /* @__PURE__ */ React60.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
8361
8445
|
);
|
|
8362
8446
|
})),
|
|
8363
|
-
!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
|
|
8364
8448
|
);
|
|
8365
8449
|
});
|
|
8366
8450
|
|
|
8367
8451
|
// src/SegmentedControl.tsx
|
|
8368
|
-
var
|
|
8452
|
+
var React61 = __toESM(require("react"), 1);
|
|
8369
8453
|
function toOpt2(o) {
|
|
8370
8454
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
8371
8455
|
}
|
|
8372
|
-
var SegmentedControl =
|
|
8456
|
+
var SegmentedControl = React61.forwardRef(
|
|
8373
8457
|
function SegmentedControl2(props, ref) {
|
|
8374
8458
|
const options = (props.options || []).map(toOpt2);
|
|
8375
8459
|
const firstEnabled = options.filter(function(o) {
|
|
@@ -8382,7 +8466,7 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8382
8466
|
);
|
|
8383
8467
|
const value = st[0], setValue = st[1];
|
|
8384
8468
|
const auto = uid(), id = props.id || auto;
|
|
8385
|
-
const refs =
|
|
8469
|
+
const refs = React61.useRef([]);
|
|
8386
8470
|
const selIdx = options.findIndex(function(o) {
|
|
8387
8471
|
return o.value === value;
|
|
8388
8472
|
});
|
|
@@ -8415,7 +8499,7 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8415
8499
|
move(options.length, -1);
|
|
8416
8500
|
}
|
|
8417
8501
|
}
|
|
8418
|
-
return /* @__PURE__ */
|
|
8502
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8419
8503
|
"div",
|
|
8420
8504
|
{
|
|
8421
8505
|
ref,
|
|
@@ -8434,7 +8518,7 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8434
8518
|
options.map(function(o, i) {
|
|
8435
8519
|
const on = o.value === value;
|
|
8436
8520
|
const off = props.disabled || o.disabled;
|
|
8437
|
-
return /* @__PURE__ */
|
|
8521
|
+
return /* @__PURE__ */ React61.createElement(
|
|
8438
8522
|
"button",
|
|
8439
8523
|
{
|
|
8440
8524
|
key: o.value,
|
|
@@ -8456,8 +8540,8 @@ var SegmentedControl = React60.forwardRef(
|
|
|
8456
8540
|
onKeyDown(e, i);
|
|
8457
8541
|
}
|
|
8458
8542
|
},
|
|
8459
|
-
o.icon ? /* @__PURE__ */
|
|
8460
|
-
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)
|
|
8461
8545
|
);
|
|
8462
8546
|
})
|
|
8463
8547
|
);
|