@jirawatpyk/aura-react 5.65.0 → 5.67.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 +9 -0
- package/dist/aura.bundle.js +690 -600
- package/dist/cjs/index.cjs +689 -599
- package/dist/esm/CheckboxGroup.js +81 -0
- package/dist/esm/Combobox.js +13 -2
- package/dist/esm/Menu.js +4 -2
- package/dist/esm/index.js +2 -0
- package/dist/esm/strings.js +1 -0
- package/dist/esm/strings.sv.js +1 -0
- package/dist/esm/strings.th.js +1 -0
- package/dist/index.d.cts +34 -1
- package/dist/index.d.ts +34 -1
- package/dist/locales/sv.cjs +1 -0
- package/dist/locales/sv.d.cts +2 -0
- package/dist/locales/sv.d.ts +2 -0
- package/dist/locales/th.cjs +1 -0
- package/dist/locales/th.d.cts +2 -0
- package/dist/locales/th.d.ts +2 -0
- package/dist/server/index.cjs +3 -0
- package/dist/server/index.d.cts +2 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.js +3 -0
- package/dist/styles.css +8 -0
- package/dist/styles.layer.css +8 -0
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -44,6 +44,7 @@ __export(index_exports, {
|
|
|
44
44
|
Calendar: () => Calendar,
|
|
45
45
|
Card: () => Card,
|
|
46
46
|
Checkbox: () => Checkbox,
|
|
47
|
+
CheckboxGroup: () => CheckboxGroup,
|
|
47
48
|
ColorSchemeScript: () => ColorSchemeScript,
|
|
48
49
|
ColorSchemeToggle: () => ColorSchemeToggle,
|
|
49
50
|
Combobox: () => Combobox,
|
|
@@ -1011,6 +1012,7 @@ var th = {
|
|
|
1011
1012
|
statusOk: "\u0E1B\u0E01\u0E15\u0E34",
|
|
1012
1013
|
statusUnknown: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E21\u0E35\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25",
|
|
1013
1014
|
opensInNewTab: "\u0E40\u0E1B\u0E34\u0E14\u0E43\u0E19\u0E41\u0E17\u0E47\u0E1A\u0E43\u0E2B\u0E21\u0E48",
|
|
1015
|
+
required: "\u0E08\u0E33\u0E40\u0E1B\u0E47\u0E19",
|
|
1014
1016
|
filtersApplied: function(n3) {
|
|
1015
1017
|
return "\u0E15\u0E31\u0E27\u0E01\u0E23\u0E2D\u0E07, \u0E43\u0E0A\u0E49\u0E2D\u0E22\u0E39\u0E48 " + n3.toLocaleString("en") + " \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23";
|
|
1016
1018
|
},
|
|
@@ -1152,6 +1154,7 @@ var sv = {
|
|
|
1152
1154
|
statusOk: "OK",
|
|
1153
1155
|
statusUnknown: "Ingen data",
|
|
1154
1156
|
opensInNewTab: "\xF6ppnas i en ny flik",
|
|
1157
|
+
required: "obligatoriskt",
|
|
1155
1158
|
filtersApplied: function(n3) {
|
|
1156
1159
|
return "Filter, " + n3.toLocaleString("sv-SE") + " aktiva";
|
|
1157
1160
|
},
|
|
@@ -1294,6 +1297,7 @@ var STRINGS = {
|
|
|
1294
1297
|
statusOk: "OK",
|
|
1295
1298
|
statusUnknown: "No data",
|
|
1296
1299
|
opensInNewTab: "opens in a new tab",
|
|
1300
|
+
required: "required",
|
|
1297
1301
|
filtersApplied: function(n3) {
|
|
1298
1302
|
return "Filters, " + n3.toLocaleString("en") + " applied";
|
|
1299
1303
|
},
|
|
@@ -1817,11 +1821,13 @@ var Menu = React9.forwardRef(function Menu2(props, ref) {
|
|
|
1817
1821
|
if (it.separator) return /* @__PURE__ */ React9.createElement("div", { key: "s" + i, role: "separator", className: "aura-menu__sep" });
|
|
1818
1822
|
const isRadio = it.type === "radio";
|
|
1819
1823
|
const isCheck = !isRadio && it.checked !== void 0;
|
|
1820
|
-
const
|
|
1824
|
+
const checkAtEnd = isCheck && !!it.icon && it.checkPlacement !== "start";
|
|
1825
|
+
const lead = isRadio ? /* @__PURE__ */ React9.createElement("span", { className: cx("aura-menu__radio", it.checked && "is-on") }) : isCheck && !checkAtEnd ? /* @__PURE__ */ React9.createElement("span", { className: cx("aura-menu__check", it.checked && "is-on") }, it.checked ? /* @__PURE__ */ React9.createElement(Icon, { name: /* @__PURE__ */ React9.createElement(IconCheck, null), size: 12, strokeWidth: 3 }) : null) : it.icon ? /* @__PURE__ */ React9.createElement(Icon, { name: it.icon }) : /* @__PURE__ */ React9.createElement("span", { className: "aura-menu__blank" });
|
|
1821
1826
|
const body = [
|
|
1822
1827
|
/* @__PURE__ */ React9.createElement(React9.Fragment, { key: "l" }, lead),
|
|
1823
1828
|
/* @__PURE__ */ React9.createElement("span", { key: "t", className: "aura-menu__label" }, it.label),
|
|
1824
|
-
it.hint ? /* @__PURE__ */ React9.createElement("span", { key: "h", className: "aura-menu__hint" }, it.hint) : null
|
|
1829
|
+
it.hint ? /* @__PURE__ */ React9.createElement("span", { key: "h", className: "aura-menu__hint" }, it.hint) : null,
|
|
1830
|
+
checkAtEnd ? /* @__PURE__ */ React9.createElement("span", { key: "c", className: cx("aura-menu__mark", it.checked && "is-on") }, it.checked ? /* @__PURE__ */ React9.createElement(Icon, { name: /* @__PURE__ */ React9.createElement(IconCheck, null), size: 16, strokeWidth: 2.5 }) : null) : null
|
|
1825
1831
|
];
|
|
1826
1832
|
const cls = cx("aura-menu__item", it.tone === "danger" && "aura-menu__item--danger");
|
|
1827
1833
|
const reasonId = it.disabled && it.disabledReason ? itemId + "-r" + i : void 0;
|
|
@@ -3881,15 +3887,88 @@ var RadioGroup = React20.forwardRef(function RadioGroup2(props, ref) {
|
|
|
3881
3887
|
);
|
|
3882
3888
|
});
|
|
3883
3889
|
|
|
3884
|
-
// src/
|
|
3890
|
+
// src/CheckboxGroup.tsx
|
|
3885
3891
|
var React21 = __toESM(require("react"), 1);
|
|
3886
|
-
var
|
|
3892
|
+
var CheckboxGroup = React21.forwardRef(
|
|
3893
|
+
function CheckboxGroup2(props, ref) {
|
|
3894
|
+
const t = useStrings();
|
|
3895
|
+
const auto = uid(), id = props.id || auto;
|
|
3896
|
+
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
3897
|
+
const picked = st[0] || [];
|
|
3898
|
+
const opts = (props.options || []).map(function(o) {
|
|
3899
|
+
return typeof o === "object" ? o : { value: o, label: o };
|
|
3900
|
+
});
|
|
3901
|
+
const name = props.name || id;
|
|
3902
|
+
const setRef = React21.useCallback(
|
|
3903
|
+
function(el) {
|
|
3904
|
+
if (el)
|
|
3905
|
+
el.focus = function(o) {
|
|
3906
|
+
const b = el.querySelector('input[type="checkbox"]:checked:not(:disabled)') || el.querySelector('input[type="checkbox"]:not(:disabled)');
|
|
3907
|
+
if (b) b.focus(o);
|
|
3908
|
+
};
|
|
3909
|
+
if (typeof ref === "function") ref(el);
|
|
3910
|
+
else if (ref) ref.current = el;
|
|
3911
|
+
},
|
|
3912
|
+
[ref]
|
|
3913
|
+
);
|
|
3914
|
+
return /* @__PURE__ */ React21.createElement(
|
|
3915
|
+
"fieldset",
|
|
3916
|
+
{
|
|
3917
|
+
ref: setRef,
|
|
3918
|
+
className: cx(
|
|
3919
|
+
"aura-field aura-radio-group aura-checkbox-group",
|
|
3920
|
+
props.error && "is-invalid",
|
|
3921
|
+
touchClass(props.touchHeight),
|
|
3922
|
+
props.className
|
|
3923
|
+
),
|
|
3924
|
+
"aria-describedby": describedBy(id, props),
|
|
3925
|
+
disabled: props.disabled
|
|
3926
|
+
},
|
|
3927
|
+
props.label ? /* @__PURE__ */ React21.createElement("legend", { className: "aura-field__label" }, props.label, props.required ? /* @__PURE__ */ React21.createElement(React21.Fragment, null, /* @__PURE__ */ React21.createElement("span", { className: "aura-field__req", "aria-hidden": true }, " *"), /* @__PURE__ */ React21.createElement("span", { className: "aura-sr-only" }, " (" + t.required + ")")) : null) : null,
|
|
3928
|
+
/* @__PURE__ */ React21.createElement("div", { className: cx("aura-radio-group__list", props.orientation === "horizontal" && "is-horizontal") }, opts.map(function(v) {
|
|
3929
|
+
return /* @__PURE__ */ React21.createElement(
|
|
3930
|
+
Checkbox,
|
|
3931
|
+
{
|
|
3932
|
+
key: v.value,
|
|
3933
|
+
name,
|
|
3934
|
+
value: v.value,
|
|
3935
|
+
checked: picked.indexOf(v.value) >= 0,
|
|
3936
|
+
disabled: props.disabled || v.disabled,
|
|
3937
|
+
description: v.description,
|
|
3938
|
+
touchHeight: props.touchHeight,
|
|
3939
|
+
"aria-invalid": props.error ? true : void 0,
|
|
3940
|
+
"aria-describedby": props.error ? id + "-error" : void 0,
|
|
3941
|
+
onChange: function(on) {
|
|
3942
|
+
const known = opts.map(function(o) {
|
|
3943
|
+
return o.value;
|
|
3944
|
+
});
|
|
3945
|
+
const next = known.filter(function(val) {
|
|
3946
|
+
return val === v.value ? on : picked.indexOf(val) >= 0;
|
|
3947
|
+
}).concat(
|
|
3948
|
+
picked.filter(function(val) {
|
|
3949
|
+
return known.indexOf(val) < 0;
|
|
3950
|
+
})
|
|
3951
|
+
);
|
|
3952
|
+
st[1](next);
|
|
3953
|
+
}
|
|
3954
|
+
},
|
|
3955
|
+
v.label
|
|
3956
|
+
);
|
|
3957
|
+
})),
|
|
3958
|
+
props.error ? /* @__PURE__ */ React21.createElement("p", { className: "aura-field__error", id: id + "-error" }, /* @__PURE__ */ React21.createElement(Icon, { name: /* @__PURE__ */ React21.createElement(IconCircleAlert, null), size: 14 }), props.error) : props.hint ? /* @__PURE__ */ React21.createElement("p", { className: "aura-field__hint", id: id + "-hint" }, props.hint) : null
|
|
3959
|
+
);
|
|
3960
|
+
}
|
|
3961
|
+
);
|
|
3962
|
+
|
|
3963
|
+
// src/Switch.tsx
|
|
3964
|
+
var React22 = __toESM(require("react"), 1);
|
|
3965
|
+
var Switch = React22.forwardRef(function Switch2(props, ref) {
|
|
3887
3966
|
const auto = uid(), id = props.id || auto;
|
|
3888
3967
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
3889
3968
|
const on = !!st[0];
|
|
3890
3969
|
const ro = !!props.readOnly && !props.disabled;
|
|
3891
3970
|
const described = [props.description ? id + "-desc" : "", props["aria-describedby"] || ""].filter(Boolean).join(" ");
|
|
3892
|
-
return /* @__PURE__ */
|
|
3971
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3893
3972
|
"div",
|
|
3894
3973
|
{
|
|
3895
3974
|
className: cx("aura-switch-row", props.disabled && "is-disabled", ro && "is-readonly", props.className),
|
|
@@ -3899,7 +3978,7 @@ var Switch = React21.forwardRef(function Switch2(props, ref) {
|
|
|
3899
3978
|
st[1](!on);
|
|
3900
3979
|
}
|
|
3901
3980
|
},
|
|
3902
|
-
/* @__PURE__ */
|
|
3981
|
+
/* @__PURE__ */ React22.createElement(
|
|
3903
3982
|
"button",
|
|
3904
3983
|
{
|
|
3905
3984
|
ref,
|
|
@@ -3917,15 +3996,15 @@ var Switch = React21.forwardRef(function Switch2(props, ref) {
|
|
|
3917
3996
|
if (!ro) st[1](!on);
|
|
3918
3997
|
}
|
|
3919
3998
|
},
|
|
3920
|
-
/* @__PURE__ */
|
|
3999
|
+
/* @__PURE__ */ React22.createElement("span", { className: "aura-switch__thumb" })
|
|
3921
4000
|
),
|
|
3922
|
-
props.label ? /* @__PURE__ */
|
|
3923
|
-
props.icon ? /* @__PURE__ */
|
|
4001
|
+
props.label ? /* @__PURE__ */ React22.createElement("span", { className: "aura-choice__text" }, /* @__PURE__ */ React22.createElement("label", { className: "aura-choice__label", id: id + "-label", htmlFor: id }, props.label), props.description ? /* @__PURE__ */ React22.createElement("span", { className: "aura-choice__desc", id: id + "-desc" }, props.description) : null) : props.description ? /* @__PURE__ */ React22.createElement("span", { className: "aura-sr-only", id: id + "-desc" }, props.description) : null,
|
|
4002
|
+
props.icon ? /* @__PURE__ */ React22.createElement(Icon, { name: props.icon, className: "aura-switch-row__icon" }) : null
|
|
3924
4003
|
);
|
|
3925
4004
|
});
|
|
3926
4005
|
|
|
3927
4006
|
// src/Combobox.tsx
|
|
3928
|
-
var
|
|
4007
|
+
var React23 = __toESM(require("react"), 1);
|
|
3929
4008
|
var import_react_dom5 = require("react-dom");
|
|
3930
4009
|
function norm(s) {
|
|
3931
4010
|
return String(s == null ? "" : s).normalize("NFC").toLocaleLowerCase("th");
|
|
@@ -3940,7 +4019,7 @@ function defaultFilter(option, query) {
|
|
|
3940
4019
|
return norm(k).indexOf(q) >= 0;
|
|
3941
4020
|
});
|
|
3942
4021
|
}
|
|
3943
|
-
var Combobox =
|
|
4022
|
+
var Combobox = React23.forwardRef(
|
|
3944
4023
|
function Combobox2(all, ref) {
|
|
3945
4024
|
const props = all;
|
|
3946
4025
|
const multi = all.multiple === true;
|
|
@@ -3982,11 +4061,11 @@ var Combobox = React22.forwardRef(
|
|
|
3982
4061
|
return o.value === v;
|
|
3983
4062
|
})[0];
|
|
3984
4063
|
}).filter(Boolean) : [];
|
|
3985
|
-
const openState =
|
|
3986
|
-
const qState =
|
|
3987
|
-
const aState =
|
|
3988
|
-
const posState =
|
|
3989
|
-
const inputRef =
|
|
4064
|
+
const openState = React23.useState(false), open = openState[0], setOpen = openState[1];
|
|
4065
|
+
const qState = React23.useState(null), query = qState[0], setQuery = qState[1];
|
|
4066
|
+
const aState = React23.useState(0), active = aState[0], setActive = aState[1];
|
|
4067
|
+
const posState = React23.useState(null);
|
|
4068
|
+
const inputRef = React23.useRef(null), inputMerged = useMergedRef(ref, inputRef), boxRef = React23.useRef(null), listRef = React23.useRef(null);
|
|
3990
4069
|
const mounted = useMounted();
|
|
3991
4070
|
const limit = props.limit || 200;
|
|
3992
4071
|
const filter = props.filter || defaultFilter;
|
|
@@ -4016,7 +4095,7 @@ var Combobox = React22.forwardRef(
|
|
|
4016
4095
|
},
|
|
4017
4096
|
[open, shown.length, values.length]
|
|
4018
4097
|
);
|
|
4019
|
-
|
|
4098
|
+
React23.useEffect(
|
|
4020
4099
|
function() {
|
|
4021
4100
|
if (!open) return;
|
|
4022
4101
|
function outside(e) {
|
|
@@ -4039,7 +4118,7 @@ var Combobox = React22.forwardRef(
|
|
|
4039
4118
|
},
|
|
4040
4119
|
[open]
|
|
4041
4120
|
);
|
|
4042
|
-
|
|
4121
|
+
React23.useEffect(
|
|
4043
4122
|
function() {
|
|
4044
4123
|
if (!open || !listRef.current) return;
|
|
4045
4124
|
const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
|
|
@@ -4059,8 +4138,8 @@ var Combobox = React22.forwardRef(
|
|
|
4059
4138
|
setOpen(false);
|
|
4060
4139
|
setQuery(null);
|
|
4061
4140
|
}
|
|
4062
|
-
const committed =
|
|
4063
|
-
const commitRef =
|
|
4141
|
+
const committed = React23.useRef(false);
|
|
4142
|
+
const commitRef = React23.useRef(function() {
|
|
4064
4143
|
return false;
|
|
4065
4144
|
});
|
|
4066
4145
|
function commitTyped() {
|
|
@@ -4148,7 +4227,7 @@ var Combobox = React22.forwardRef(
|
|
|
4148
4227
|
function renderOpt(o, i) {
|
|
4149
4228
|
const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
|
|
4150
4229
|
const blocked = o.disabled || multi && full && !isSel;
|
|
4151
|
-
return /* @__PURE__ */
|
|
4230
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4152
4231
|
"li",
|
|
4153
4232
|
{
|
|
4154
4233
|
key: o.value,
|
|
@@ -4174,9 +4253,9 @@ var Combobox = React22.forwardRef(
|
|
|
4174
4253
|
if (activeIdx !== i) setActive(i);
|
|
4175
4254
|
}
|
|
4176
4255
|
},
|
|
4177
|
-
o.icon ? /* @__PURE__ */
|
|
4178
|
-
/* @__PURE__ */
|
|
4179
|
-
isSel ? /* @__PURE__ */
|
|
4256
|
+
o.icon ? /* @__PURE__ */ React23.createElement(Icon, { name: o.icon }) : null,
|
|
4257
|
+
/* @__PURE__ */ React23.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React23.createElement("span", { className: "aura-combo__label", id: o.description ? optId(i) + "-label" : void 0 }, o.label), o.description ? /* @__PURE__ */ React23.createElement("span", { className: "aura-combo__desc", id: optId(i) + "-desc", "aria-hidden": true }, o.description) : null),
|
|
4258
|
+
isSel ? /* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
4180
4259
|
);
|
|
4181
4260
|
}
|
|
4182
4261
|
function grouped(list2) {
|
|
@@ -4189,7 +4268,7 @@ var Combobox = React22.forwardRef(
|
|
|
4189
4268
|
return out;
|
|
4190
4269
|
}
|
|
4191
4270
|
const list = open && mounted && posState[0] ? (0, import_react_dom5.createPortal)(
|
|
4192
|
-
/* @__PURE__ */
|
|
4271
|
+
/* @__PURE__ */ React23.createElement(
|
|
4193
4272
|
"div",
|
|
4194
4273
|
{
|
|
4195
4274
|
ref: listRef,
|
|
@@ -4200,7 +4279,7 @@ var Combobox = React22.forwardRef(
|
|
|
4200
4279
|
e.preventDefault();
|
|
4201
4280
|
}
|
|
4202
4281
|
},
|
|
4203
|
-
live.length ? /* @__PURE__ */
|
|
4282
|
+
live.length ? /* @__PURE__ */ React23.createElement(
|
|
4204
4283
|
"ul",
|
|
4205
4284
|
{
|
|
4206
4285
|
id: listId,
|
|
@@ -4211,33 +4290,34 @@ var Combobox = React22.forwardRef(
|
|
|
4211
4290
|
},
|
|
4212
4291
|
grouped(live).map(function(seg) {
|
|
4213
4292
|
if (seg.g == null)
|
|
4214
|
-
return /* @__PURE__ */
|
|
4293
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, { key: "u" + seg.items[0][1] }, seg.items.map(function(p) {
|
|
4215
4294
|
return renderOpt(p[0], p[1]);
|
|
4216
4295
|
}));
|
|
4217
4296
|
const gid = id + "-group-" + seg.g + "-" + seg.items[0][1];
|
|
4218
|
-
return /* @__PURE__ */
|
|
4297
|
+
return /* @__PURE__ */ React23.createElement("li", { key: gid, role: "group", "aria-labelledby": gid, className: "aura-combo__group" }, /* @__PURE__ */ React23.createElement("span", { id: gid, role: "presentation", className: "aura-combo__group-label" }, groups[seg.g].label), /* @__PURE__ */ React23.createElement("ul", { role: "none", className: "aura-combo__grouplist" }, seg.items.map(function(p) {
|
|
4219
4298
|
return renderOpt(p[0], p[1]);
|
|
4220
4299
|
})));
|
|
4221
4300
|
})
|
|
4222
4301
|
) : null,
|
|
4223
|
-
props.loading || !live.length || more ? /* @__PURE__ */
|
|
4302
|
+
props.loading || !live.length || more ? /* @__PURE__ */ React23.createElement("div", { className: "aura-combo__list", role: "status" }, props.loading ? /* @__PURE__ */ React23.createElement("div", { className: "aura-combo__note" }, /* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconLoaderCircle, null), className: "aura-spin" }), props.loadingText || t.searching) : !live.length ? /* @__PURE__ */ React23.createElement("div", { className: "aura-combo__note" }, props.emptyText || t.noMatches) : /* @__PURE__ */ React23.createElement("div", { className: "aura-combo__note" }, t.keepTyping(options.length))) : null
|
|
4224
4303
|
),
|
|
4225
4304
|
document.body
|
|
4226
4305
|
) : null;
|
|
4227
|
-
return /* @__PURE__ */
|
|
4306
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4228
4307
|
Field,
|
|
4229
4308
|
{
|
|
4230
4309
|
id,
|
|
4231
4310
|
label: props.label,
|
|
4232
4311
|
hint: props.hint,
|
|
4233
4312
|
error: props.error,
|
|
4313
|
+
invalid: props.invalid,
|
|
4234
4314
|
required: props.required,
|
|
4235
4315
|
optional: props.optional,
|
|
4236
4316
|
disabled: props.disabled,
|
|
4237
4317
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
4238
4318
|
},
|
|
4239
|
-
/* @__PURE__ */
|
|
4240
|
-
return /* @__PURE__ */
|
|
4319
|
+
/* @__PURE__ */ React23.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo has-icon", open && "is-open", multi && "is-multi") }, /* @__PURE__ */ React23.createElement(Icon, { name: props.icon || /* @__PURE__ */ React23.createElement(IconSearch, null), className: "aura-input__icon" }), multi && picked.length ? /* @__PURE__ */ React23.createElement("span", { className: "aura-combo__chips" }, picked.map(function(o) {
|
|
4320
|
+
return /* @__PURE__ */ React23.createElement("span", { key: o.value, className: "aura-combo__chip" }, /* @__PURE__ */ React23.createElement("span", { className: "aura-combo__chip-label" }, o.label), props.disabled || props.readOnly ? null : /* @__PURE__ */ React23.createElement(
|
|
4241
4321
|
"button",
|
|
4242
4322
|
{
|
|
4243
4323
|
type: "button",
|
|
@@ -4256,13 +4336,13 @@ var Combobox = React22.forwardRef(
|
|
|
4256
4336
|
if (inputRef.current) inputRef.current.focus();
|
|
4257
4337
|
}
|
|
4258
4338
|
},
|
|
4259
|
-
/* @__PURE__ */
|
|
4339
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconX, null) })
|
|
4260
4340
|
));
|
|
4261
|
-
})) : null, multi ? /* @__PURE__ */
|
|
4341
|
+
})) : null, multi ? /* @__PURE__ */ React23.createElement("span", { id: summaryId, className: "aura-sr-only" }, picked.length ? t.selectedCount(picked.length) + ": " + picked.map(function(o) {
|
|
4262
4342
|
return o.label;
|
|
4263
4343
|
}).join(", ") : "") : null, props.name ? multi ? values.map(function(v) {
|
|
4264
|
-
return /* @__PURE__ */
|
|
4265
|
-
}) : /* @__PURE__ */
|
|
4344
|
+
return /* @__PURE__ */ React23.createElement("input", { key: v, type: "hidden", name: props.name, value: v });
|
|
4345
|
+
}) : /* @__PURE__ */ React23.createElement("input", { type: "hidden", name: props.name, value: value == null ? "" : value }) : null, /* @__PURE__ */ React23.createElement(
|
|
4266
4346
|
"input",
|
|
4267
4347
|
{
|
|
4268
4348
|
ref: inputMerged,
|
|
@@ -4275,8 +4355,18 @@ var Combobox = React22.forwardRef(
|
|
|
4275
4355
|
"aria-controls": open && live.length ? listId : void 0,
|
|
4276
4356
|
"aria-autocomplete": "list",
|
|
4277
4357
|
"aria-activedescendant": open && live[activeIdx] ? optId(activeIdx) : void 0,
|
|
4278
|
-
"aria-invalid": props.error ? true : void 0,
|
|
4279
|
-
"aria-describedby":
|
|
4358
|
+
"aria-invalid": props.error || props.invalid ? true : void 0,
|
|
4359
|
+
"aria-describedby": (
|
|
4360
|
+
/* each id once, in order: error or hint, the chip summary, then yours */
|
|
4361
|
+
Array.from(
|
|
4362
|
+
new Set(
|
|
4363
|
+
[
|
|
4364
|
+
props.error ? id + "-error" : props.hint ? id + "-hint" : "",
|
|
4365
|
+
multi && picked.length ? summaryId : ""
|
|
4366
|
+
].concat(String(props["aria-describedby"] || "").split(/\s+/)).filter(Boolean)
|
|
4367
|
+
)
|
|
4368
|
+
).join(" ") || void 0
|
|
4369
|
+
),
|
|
4280
4370
|
placeholder: multi && values.length ? void 0 : props.placeholder,
|
|
4281
4371
|
disabled: props.disabled,
|
|
4282
4372
|
readOnly: props.readOnly,
|
|
@@ -4301,7 +4391,7 @@ var Combobox = React22.forwardRef(
|
|
|
4301
4391
|
}, 0);
|
|
4302
4392
|
}
|
|
4303
4393
|
}
|
|
4304
|
-
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */
|
|
4394
|
+
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */ React23.createElement(
|
|
4305
4395
|
"button",
|
|
4306
4396
|
{
|
|
4307
4397
|
type: "button",
|
|
@@ -4314,8 +4404,8 @@ var Combobox = React22.forwardRef(
|
|
|
4314
4404
|
if (inputRef.current) inputRef.current.focus();
|
|
4315
4405
|
}
|
|
4316
4406
|
},
|
|
4317
|
-
/* @__PURE__ */
|
|
4318
|
-
) : null, /* @__PURE__ */
|
|
4407
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconX, null) })
|
|
4408
|
+
) : null, /* @__PURE__ */ React23.createElement(
|
|
4319
4409
|
"button",
|
|
4320
4410
|
{
|
|
4321
4411
|
type: "button",
|
|
@@ -4333,7 +4423,7 @@ var Combobox = React22.forwardRef(
|
|
|
4333
4423
|
}
|
|
4334
4424
|
}
|
|
4335
4425
|
},
|
|
4336
|
-
/* @__PURE__ */
|
|
4426
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconChevronDown, null) })
|
|
4337
4427
|
)),
|
|
4338
4428
|
list
|
|
4339
4429
|
);
|
|
@@ -4341,20 +4431,20 @@ var Combobox = React22.forwardRef(
|
|
|
4341
4431
|
);
|
|
4342
4432
|
|
|
4343
4433
|
// src/Alert.tsx
|
|
4344
|
-
var
|
|
4345
|
-
var Alert =
|
|
4434
|
+
var React24 = __toESM(require("react"), 1);
|
|
4435
|
+
var Alert = React24.forwardRef(function Alert2(props, ref) {
|
|
4346
4436
|
const t = useStrings();
|
|
4347
4437
|
const autoId = uid();
|
|
4348
4438
|
return alertElement(
|
|
4349
4439
|
props,
|
|
4350
4440
|
ref,
|
|
4351
|
-
props.onDismiss ? /* @__PURE__ */
|
|
4441
|
+
props.onDismiss ? /* @__PURE__ */ React24.createElement(IconButton, { icon: /* @__PURE__ */ React24.createElement(IconX, null), label: t.dismiss, className: "aura-alert__close", onClick: props.onDismiss }) : null,
|
|
4352
4442
|
autoId
|
|
4353
4443
|
);
|
|
4354
4444
|
});
|
|
4355
4445
|
|
|
4356
4446
|
// src/Toaster.tsx
|
|
4357
|
-
var
|
|
4447
|
+
var React25 = __toESM(require("react"), 1);
|
|
4358
4448
|
var import_react_dom6 = require("react-dom");
|
|
4359
4449
|
var MAX_VISIBLE = 3;
|
|
4360
4450
|
var toastState = {
|
|
@@ -4430,8 +4520,8 @@ function outsideToaster(el) {
|
|
|
4430
4520
|
function ToastItem(props) {
|
|
4431
4521
|
const str = useStrings();
|
|
4432
4522
|
const Link = useLinkComponent();
|
|
4433
|
-
const node =
|
|
4434
|
-
const origin =
|
|
4523
|
+
const node = React25.useRef(null);
|
|
4524
|
+
const origin = React25.useRef(null);
|
|
4435
4525
|
useIsoLayoutEffect(function() {
|
|
4436
4526
|
origin.current = outsideToaster(document.activeElement);
|
|
4437
4527
|
const el = node.current;
|
|
@@ -4447,8 +4537,8 @@ function ToastItem(props) {
|
|
|
4447
4537
|
}, 0);
|
|
4448
4538
|
};
|
|
4449
4539
|
}, []);
|
|
4450
|
-
const t = props.toast, timer2 =
|
|
4451
|
-
const hover =
|
|
4540
|
+
const t = props.toast, timer2 = React25.useRef(null), left = React25.useRef(t.duration || 5e3), since = React25.useRef(0);
|
|
4541
|
+
const hover = React25.useRef(false), focused = React25.useRef(false);
|
|
4452
4542
|
function syncFocus() {
|
|
4453
4543
|
if (focused.current && !(node.current && node.current.contains(document.activeElement))) focused.current = false;
|
|
4454
4544
|
}
|
|
@@ -4470,7 +4560,7 @@ function ToastItem(props) {
|
|
|
4470
4560
|
left.current -= Date.now() - since.current;
|
|
4471
4561
|
}
|
|
4472
4562
|
}
|
|
4473
|
-
|
|
4563
|
+
React25.useEffect(
|
|
4474
4564
|
function() {
|
|
4475
4565
|
if (timer2.current) clearTimeout(timer2.current);
|
|
4476
4566
|
timer2.current = null;
|
|
@@ -4489,7 +4579,7 @@ function ToastItem(props) {
|
|
|
4489
4579
|
if (a.onClick) a.onClick();
|
|
4490
4580
|
if (a.dismiss !== false) toast.dismiss(t.id);
|
|
4491
4581
|
}
|
|
4492
|
-
return /* @__PURE__ */
|
|
4582
|
+
return /* @__PURE__ */ React25.createElement(
|
|
4493
4583
|
"div",
|
|
4494
4584
|
{
|
|
4495
4585
|
ref: node,
|
|
@@ -4526,16 +4616,16 @@ function ToastItem(props) {
|
|
|
4526
4616
|
resume();
|
|
4527
4617
|
}
|
|
4528
4618
|
},
|
|
4529
|
-
/* @__PURE__ */
|
|
4619
|
+
/* @__PURE__ */ React25.createElement(
|
|
4530
4620
|
Icon,
|
|
4531
4621
|
{
|
|
4532
|
-
name: t.loading ? /* @__PURE__ */
|
|
4622
|
+
name: t.loading ? /* @__PURE__ */ React25.createElement(IconLoaderCircle, null) : React25.createElement(ALERT_ICON[t.tone] || IconInfo),
|
|
4533
4623
|
className: cx("aura-toast__icon", t.loading && "aura-spin")
|
|
4534
4624
|
}
|
|
4535
4625
|
),
|
|
4536
|
-
/* @__PURE__ */
|
|
4537
|
-
actions.length ? /* @__PURE__ */
|
|
4538
|
-
return a.href ? /* @__PURE__ */
|
|
4626
|
+
/* @__PURE__ */ React25.createElement("div", { className: "aura-toast__body" }, /* @__PURE__ */ React25.createElement("p", { className: "aura-toast__title" }, t.title), rich ? /* @__PURE__ */ React25.createElement("div", { className: "aura-toast__text" }, t.description) : null),
|
|
4627
|
+
actions.length ? /* @__PURE__ */ React25.createElement("div", { className: "aura-toast__actions" }, actions.map(function(a, i) {
|
|
4628
|
+
return a.href ? /* @__PURE__ */ React25.createElement(
|
|
4539
4629
|
Link,
|
|
4540
4630
|
{
|
|
4541
4631
|
key: i,
|
|
@@ -4547,7 +4637,7 @@ function ToastItem(props) {
|
|
|
4547
4637
|
}
|
|
4548
4638
|
},
|
|
4549
4639
|
a.label
|
|
4550
|
-
) : /* @__PURE__ */
|
|
4640
|
+
) : /* @__PURE__ */ React25.createElement(
|
|
4551
4641
|
"button",
|
|
4552
4642
|
{
|
|
4553
4643
|
key: i,
|
|
@@ -4560,10 +4650,10 @@ function ToastItem(props) {
|
|
|
4560
4650
|
a.label
|
|
4561
4651
|
);
|
|
4562
4652
|
})) : null,
|
|
4563
|
-
/* @__PURE__ */
|
|
4653
|
+
/* @__PURE__ */ React25.createElement(
|
|
4564
4654
|
IconButton,
|
|
4565
4655
|
{
|
|
4566
|
-
icon: /* @__PURE__ */
|
|
4656
|
+
icon: /* @__PURE__ */ React25.createElement(IconX, null),
|
|
4567
4657
|
label: str.dismissToast,
|
|
4568
4658
|
className: "aura-toast__close",
|
|
4569
4659
|
onClick: function() {
|
|
@@ -4591,8 +4681,8 @@ function hotkeyMatcher(spec) {
|
|
|
4591
4681
|
function Toaster(props = {}) {
|
|
4592
4682
|
const t = useStrings();
|
|
4593
4683
|
const mounted = useMounted();
|
|
4594
|
-
const s =
|
|
4595
|
-
|
|
4684
|
+
const s = React25.useState(toastState.list);
|
|
4685
|
+
React25.useEffect(function() {
|
|
4596
4686
|
toastState.subs.push(s[1]);
|
|
4597
4687
|
s[1](toastState.list.slice());
|
|
4598
4688
|
return function() {
|
|
@@ -4601,9 +4691,9 @@ function Toaster(props = {}) {
|
|
|
4601
4691
|
});
|
|
4602
4692
|
};
|
|
4603
4693
|
}, []);
|
|
4604
|
-
const region =
|
|
4694
|
+
const region = React25.useRef(null);
|
|
4605
4695
|
const hotkey = props.hotkey === void 0 ? "Alt+T" : props.hotkey;
|
|
4606
|
-
|
|
4696
|
+
React25.useEffect(
|
|
4607
4697
|
function() {
|
|
4608
4698
|
if (!hotkey) return;
|
|
4609
4699
|
const match = hotkeyMatcher(hotkey);
|
|
@@ -4634,7 +4724,7 @@ function Toaster(props = {}) {
|
|
|
4634
4724
|
const pos = props.position || "bottom";
|
|
4635
4725
|
const offset = props.offset;
|
|
4636
4726
|
return (0, import_react_dom6.createPortal)(
|
|
4637
|
-
/* @__PURE__ */
|
|
4727
|
+
/* @__PURE__ */ React25.createElement(
|
|
4638
4728
|
"div",
|
|
4639
4729
|
{
|
|
4640
4730
|
ref: region,
|
|
@@ -4646,7 +4736,7 @@ function Toaster(props = {}) {
|
|
|
4646
4736
|
"aria-keyshortcuts": hotkey || void 0
|
|
4647
4737
|
},
|
|
4648
4738
|
s[0].map(function(t2) {
|
|
4649
|
-
return /* @__PURE__ */
|
|
4739
|
+
return /* @__PURE__ */ React25.createElement(ToastItem, { key: t2.id, toast: t2 });
|
|
4650
4740
|
})
|
|
4651
4741
|
),
|
|
4652
4742
|
document.body
|
|
@@ -4654,12 +4744,12 @@ function Toaster(props = {}) {
|
|
|
4654
4744
|
}
|
|
4655
4745
|
|
|
4656
4746
|
// src/PasswordField.tsx
|
|
4657
|
-
var
|
|
4658
|
-
var PasswordField =
|
|
4747
|
+
var React26 = __toESM(require("react"), 1);
|
|
4748
|
+
var PasswordField = React26.forwardRef(function PasswordField2(props, ref) {
|
|
4659
4749
|
const t = useStrings();
|
|
4660
|
-
const shown =
|
|
4750
|
+
const shown = React26.useState(false);
|
|
4661
4751
|
const rest = omit(props, ["toggle", "className"]);
|
|
4662
|
-
return /* @__PURE__ */
|
|
4752
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4663
4753
|
TextField,
|
|
4664
4754
|
{
|
|
4665
4755
|
autoComplete: "current-password",
|
|
@@ -4669,10 +4759,10 @@ var PasswordField = React25.forwardRef(function PasswordField2(props, ref) {
|
|
|
4669
4759
|
spellCheck: false,
|
|
4670
4760
|
autoCapitalize: "none",
|
|
4671
4761
|
className: cx("aura-password", props.className),
|
|
4672
|
-
suffix: props.toggle === false ? void 0 : /* @__PURE__ */
|
|
4762
|
+
suffix: props.toggle === false ? void 0 : /* @__PURE__ */ React26.createElement(
|
|
4673
4763
|
IconButton,
|
|
4674
4764
|
{
|
|
4675
|
-
icon: shown[0] ? /* @__PURE__ */
|
|
4765
|
+
icon: shown[0] ? /* @__PURE__ */ React26.createElement(IconEyeOff, null) : /* @__PURE__ */ React26.createElement(IconEye, null),
|
|
4676
4766
|
label: t.showPassword,
|
|
4677
4767
|
"aria-pressed": shown[0],
|
|
4678
4768
|
disabled: props.disabled,
|
|
@@ -4686,7 +4776,7 @@ var PasswordField = React25.forwardRef(function PasswordField2(props, ref) {
|
|
|
4686
4776
|
});
|
|
4687
4777
|
|
|
4688
4778
|
// src/FormErrorSummary.tsx
|
|
4689
|
-
var
|
|
4779
|
+
var React27 = __toESM(require("react"), 1);
|
|
4690
4780
|
function items(errors) {
|
|
4691
4781
|
if (Array.isArray(errors)) return errors;
|
|
4692
4782
|
const out = [];
|
|
@@ -4715,16 +4805,16 @@ function fieldElement(field) {
|
|
|
4715
4805
|
}
|
|
4716
4806
|
return named;
|
|
4717
4807
|
}
|
|
4718
|
-
var FormErrorSummary =
|
|
4808
|
+
var FormErrorSummary = React27.forwardRef(
|
|
4719
4809
|
function FormErrorSummary2(props, ref) {
|
|
4720
4810
|
const t = useStrings();
|
|
4721
4811
|
const auto = uid(), id = props.id || auto;
|
|
4722
4812
|
const list = items(props.errors);
|
|
4723
|
-
const box =
|
|
4813
|
+
const box = React27.useRef(null);
|
|
4724
4814
|
const keyed = props.focusKey !== void 0;
|
|
4725
|
-
const lastKey =
|
|
4815
|
+
const lastKey = React27.useRef(null), armed = React27.useRef(false), hadErrors = React27.useRef(false);
|
|
4726
4816
|
const has = list.length > 0;
|
|
4727
|
-
|
|
4817
|
+
React27.useEffect(
|
|
4728
4818
|
function() {
|
|
4729
4819
|
const appeared = has && !hadErrors.current;
|
|
4730
4820
|
hadErrors.current = has;
|
|
@@ -4748,7 +4838,7 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4748
4838
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4749
4839
|
[has, props.focusKey, keyed]
|
|
4750
4840
|
);
|
|
4751
|
-
|
|
4841
|
+
React27.useEffect(
|
|
4752
4842
|
function() {
|
|
4753
4843
|
if (!keyed) return;
|
|
4754
4844
|
function disarm() {
|
|
@@ -4767,7 +4857,7 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4767
4857
|
[keyed]
|
|
4768
4858
|
);
|
|
4769
4859
|
if (!list.length) return null;
|
|
4770
|
-
return /* @__PURE__ */
|
|
4860
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4771
4861
|
"div",
|
|
4772
4862
|
{
|
|
4773
4863
|
ref: function(el) {
|
|
@@ -4781,9 +4871,9 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4781
4871
|
"aria-labelledby": id + "-title",
|
|
4782
4872
|
className: cx("aura-alert aura-alert--danger aura-error-summary", props.className)
|
|
4783
4873
|
},
|
|
4784
|
-
/* @__PURE__ */
|
|
4785
|
-
/* @__PURE__ */
|
|
4786
|
-
return /* @__PURE__ */
|
|
4874
|
+
/* @__PURE__ */ React27.createElement(Icon, { name: /* @__PURE__ */ React27.createElement(IconCircleAlert, null), className: "aura-alert__icon" }),
|
|
4875
|
+
/* @__PURE__ */ React27.createElement("div", { className: "aura-alert__body" }, /* @__PURE__ */ React27.createElement("h2", { className: "aura-alert__title", id: id + "-title" }, props.title || t.errorSummary(list.length)), /* @__PURE__ */ React27.createElement("ul", { className: "aura-error-summary__list" }, list.map(function(e) {
|
|
4876
|
+
return /* @__PURE__ */ React27.createElement("li", { key: e.field }, /* @__PURE__ */ React27.createElement(
|
|
4787
4877
|
"a",
|
|
4788
4878
|
{
|
|
4789
4879
|
href: "#" + e.field,
|
|
@@ -4808,14 +4898,14 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4808
4898
|
);
|
|
4809
4899
|
|
|
4810
4900
|
// src/FilterBar.tsx
|
|
4811
|
-
var
|
|
4901
|
+
var React32 = __toESM(require("react"), 1);
|
|
4812
4902
|
|
|
4813
4903
|
// src/Dialog.tsx
|
|
4814
|
-
var
|
|
4904
|
+
var React29 = __toESM(require("react"), 1);
|
|
4815
4905
|
var import_react_dom7 = require("react-dom");
|
|
4816
4906
|
|
|
4817
4907
|
// src/useModal.tsx
|
|
4818
|
-
var
|
|
4908
|
+
var React28 = __toESM(require("react"), 1);
|
|
4819
4909
|
var locks = 0;
|
|
4820
4910
|
var savedOverflow = "";
|
|
4821
4911
|
function lockScroll() {
|
|
@@ -4842,11 +4932,11 @@ function tabbable(el) {
|
|
|
4842
4932
|
}
|
|
4843
4933
|
function useModal(open, ref, opts) {
|
|
4844
4934
|
const mounted = useMounted();
|
|
4845
|
-
const prev =
|
|
4935
|
+
const prev = React28.useRef(null);
|
|
4846
4936
|
const o = opts || {};
|
|
4847
|
-
const latest =
|
|
4937
|
+
const latest = React28.useRef(o);
|
|
4848
4938
|
latest.current = o;
|
|
4849
|
-
|
|
4939
|
+
React28.useEffect(
|
|
4850
4940
|
function() {
|
|
4851
4941
|
if (!open || !mounted) return;
|
|
4852
4942
|
prev.current = document.activeElement;
|
|
@@ -4901,15 +4991,15 @@ function useModal(open, ref, opts) {
|
|
|
4901
4991
|
}
|
|
4902
4992
|
|
|
4903
4993
|
// src/Dialog.tsx
|
|
4904
|
-
var DialogClose =
|
|
4994
|
+
var DialogClose = React29.createContext(null);
|
|
4905
4995
|
function useDialogClose() {
|
|
4906
|
-
return
|
|
4996
|
+
return React29.useContext(DialogClose) || function() {
|
|
4907
4997
|
};
|
|
4908
4998
|
}
|
|
4909
|
-
var Dialog =
|
|
4999
|
+
var Dialog = React29.forwardRef(function Dialog2(props, ref) {
|
|
4910
5000
|
const t = useStrings();
|
|
4911
5001
|
const density = useDensity();
|
|
4912
|
-
const own =
|
|
5002
|
+
const own = React29.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4913
5003
|
const openState = useMaybeControlled(props.open, false, null), open = openState[0];
|
|
4914
5004
|
if (props.open === void 0 && !props.trigger)
|
|
4915
5005
|
devWarnOnce("dialog-no-open", "Dialog has neither `open` nor `trigger`, so it can never open. Pass one of them.");
|
|
@@ -4937,7 +5027,7 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4937
5027
|
onCloseComplete: props.onCloseComplete
|
|
4938
5028
|
});
|
|
4939
5029
|
const trig = props.trigger;
|
|
4940
|
-
const trigger = trig &&
|
|
5030
|
+
const trigger = trig && React29.isValidElement(trig) ? React29.cloneElement(trig, {
|
|
4941
5031
|
"aria-haspopup": "dialog",
|
|
4942
5032
|
"aria-expanded": open,
|
|
4943
5033
|
"data-aura-trigger": trigId,
|
|
@@ -4972,7 +5062,7 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4972
5062
|
"aria-modal"
|
|
4973
5063
|
]);
|
|
4974
5064
|
const panel = (0, import_react_dom7.createPortal)(
|
|
4975
|
-
/* @__PURE__ */
|
|
5065
|
+
/* @__PURE__ */ React29.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React29.createElement(
|
|
4976
5066
|
"div",
|
|
4977
5067
|
{
|
|
4978
5068
|
className: "aura-scrim",
|
|
@@ -4982,7 +5072,7 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4982
5072
|
},
|
|
4983
5073
|
"aria-hidden": true
|
|
4984
5074
|
}
|
|
4985
|
-
), /* @__PURE__ */
|
|
5075
|
+
), /* @__PURE__ */ React29.createElement(
|
|
4986
5076
|
"div",
|
|
4987
5077
|
{
|
|
4988
5078
|
...rest,
|
|
@@ -4994,18 +5084,18 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4994
5084
|
tabIndex: -1,
|
|
4995
5085
|
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
4996
5086
|
},
|
|
4997
|
-
/* @__PURE__ */
|
|
4998
|
-
props.description ? /* @__PURE__ */
|
|
4999
|
-
/* @__PURE__ */
|
|
5087
|
+
/* @__PURE__ */ React29.createElement("div", { className: "aura-dialog__head" }, /* @__PURE__ */ React29.createElement("h2", { className: "aura-dialog__title", id: titleId }, props.title), props.dismissible !== false ? /* @__PURE__ */ React29.createElement(IconButton, { icon: /* @__PURE__ */ React29.createElement(IconX, null), label: t.close, className: "aura-dialog__close", onClick: close }) : null),
|
|
5088
|
+
props.description ? /* @__PURE__ */ React29.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
|
|
5089
|
+
/* @__PURE__ */ React29.createElement(DialogClose.Provider, { value: closeNow }, props.children ? /* @__PURE__ */ React29.createElement("div", { className: "aura-dialog__body" }, props.children) : null, props.footer ? /* @__PURE__ */ React29.createElement("div", { className: "aura-dialog__foot" }, props.footer) : null)
|
|
5000
5090
|
)),
|
|
5001
5091
|
document.body
|
|
5002
5092
|
);
|
|
5003
|
-
return trigger ? /* @__PURE__ */
|
|
5093
|
+
return trigger ? /* @__PURE__ */ React29.createElement(React29.Fragment, null, trigger, panel) : panel;
|
|
5004
5094
|
});
|
|
5005
|
-
var Drawer =
|
|
5095
|
+
var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
5006
5096
|
const t = useStrings();
|
|
5007
5097
|
const density = useDensity();
|
|
5008
|
-
const own =
|
|
5098
|
+
const own = React29.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
5009
5099
|
function close() {
|
|
5010
5100
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
5011
5101
|
}
|
|
@@ -5042,7 +5132,7 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5042
5132
|
]);
|
|
5043
5133
|
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
5044
5134
|
return (0, import_react_dom7.createPortal)(
|
|
5045
|
-
/* @__PURE__ */
|
|
5135
|
+
/* @__PURE__ */ React29.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React29.createElement(
|
|
5046
5136
|
"div",
|
|
5047
5137
|
{
|
|
5048
5138
|
className: "aura-scrim",
|
|
@@ -5052,7 +5142,7 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5052
5142
|
} : void 0,
|
|
5053
5143
|
"aria-hidden": true
|
|
5054
5144
|
}
|
|
5055
|
-
), /* @__PURE__ */
|
|
5145
|
+
), /* @__PURE__ */ React29.createElement(
|
|
5056
5146
|
"div",
|
|
5057
5147
|
{
|
|
5058
5148
|
...rest,
|
|
@@ -5065,11 +5155,11 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5065
5155
|
tabIndex: -1,
|
|
5066
5156
|
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
5067
5157
|
},
|
|
5068
|
-
props.title || props.dismissible !== false ? /* @__PURE__ */
|
|
5158
|
+
props.title || props.dismissible !== false ? /* @__PURE__ */ React29.createElement("div", { className: "aura-drawer__head" }, props.title ? /* @__PURE__ */ React29.createElement("h2", { className: "aura-drawer__title", id: titleId }, props.title) : /* @__PURE__ */ React29.createElement("span", { style: { flex: 1 } }), props.dismissible !== false ? /* @__PURE__ */ React29.createElement(
|
|
5069
5159
|
IconButton,
|
|
5070
5160
|
{
|
|
5071
5161
|
...props.closeProps,
|
|
5072
|
-
icon: /* @__PURE__ */
|
|
5162
|
+
icon: /* @__PURE__ */ React29.createElement(IconX, null),
|
|
5073
5163
|
label: props.closeLabel || t.close,
|
|
5074
5164
|
onClick: function(e) {
|
|
5075
5165
|
const own2 = props.closeProps && props.closeProps.onClick;
|
|
@@ -5078,24 +5168,24 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5078
5168
|
}
|
|
5079
5169
|
}
|
|
5080
5170
|
) : null) : null,
|
|
5081
|
-
props.description ? /* @__PURE__ */
|
|
5082
|
-
/* @__PURE__ */
|
|
5083
|
-
props.footer ? /* @__PURE__ */
|
|
5171
|
+
props.description ? /* @__PURE__ */ React29.createElement("p", { className: "aura-drawer__desc", id: descId }, props.description) : null,
|
|
5172
|
+
/* @__PURE__ */ React29.createElement("div", { className: "aura-drawer__body" }, props.children),
|
|
5173
|
+
props.footer ? /* @__PURE__ */ React29.createElement("div", { className: "aura-drawer__foot" }, props.footer) : null
|
|
5084
5174
|
)),
|
|
5085
5175
|
document.body
|
|
5086
5176
|
);
|
|
5087
5177
|
});
|
|
5088
5178
|
|
|
5089
5179
|
// src/Tag.tsx
|
|
5090
|
-
var
|
|
5180
|
+
var React31 = __toESM(require("react"), 1);
|
|
5091
5181
|
|
|
5092
5182
|
// src/Tooltip.tsx
|
|
5093
|
-
var
|
|
5183
|
+
var React30 = __toESM(require("react"), 1);
|
|
5094
5184
|
var import_react_dom8 = require("react-dom");
|
|
5095
|
-
var Tooltip =
|
|
5096
|
-
const id = uid(), st =
|
|
5097
|
-
const anchor =
|
|
5098
|
-
const pos =
|
|
5185
|
+
var Tooltip = React30.forwardRef(function Tooltip2(props, ref) {
|
|
5186
|
+
const id = uid(), st = React30.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
5187
|
+
const anchor = React30.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip2 = React30.useRef(null), timer2 = React30.useRef(void 0);
|
|
5188
|
+
const pos = React30.useState(null), mounted = useMounted();
|
|
5099
5189
|
function show3(now) {
|
|
5100
5190
|
clearTimeout(timer2.current);
|
|
5101
5191
|
timer2.current = setTimeout(
|
|
@@ -5115,7 +5205,7 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5115
5205
|
set(false);
|
|
5116
5206
|
}, 120);
|
|
5117
5207
|
}
|
|
5118
|
-
|
|
5208
|
+
React30.useEffect(function() {
|
|
5119
5209
|
return function() {
|
|
5120
5210
|
clearTimeout(timer2.current);
|
|
5121
5211
|
};
|
|
@@ -5159,7 +5249,7 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5159
5249
|
},
|
|
5160
5250
|
[open, mounted]
|
|
5161
5251
|
);
|
|
5162
|
-
|
|
5252
|
+
React30.useEffect(
|
|
5163
5253
|
function() {
|
|
5164
5254
|
if (!open) return;
|
|
5165
5255
|
function esc(e) {
|
|
@@ -5172,8 +5262,8 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5172
5262
|
},
|
|
5173
5263
|
[open]
|
|
5174
5264
|
);
|
|
5175
|
-
const child =
|
|
5176
|
-
const trigger = /* @__PURE__ */
|
|
5265
|
+
const child = React30.Children.only(props.children);
|
|
5266
|
+
const trigger = /* @__PURE__ */ React30.createElement(
|
|
5177
5267
|
"span",
|
|
5178
5268
|
{
|
|
5179
5269
|
ref: anchorMerged,
|
|
@@ -5187,10 +5277,10 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5187
5277
|
},
|
|
5188
5278
|
onBlur: hide2
|
|
5189
5279
|
},
|
|
5190
|
-
|
|
5280
|
+
React30.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
5191
5281
|
);
|
|
5192
|
-
return /* @__PURE__ */
|
|
5193
|
-
/* @__PURE__ */
|
|
5282
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, trigger, open && mounted ? (0, import_react_dom8.createPortal)(
|
|
5283
|
+
/* @__PURE__ */ React30.createElement(
|
|
5194
5284
|
"div",
|
|
5195
5285
|
{
|
|
5196
5286
|
ref: tip2,
|
|
@@ -5217,13 +5307,13 @@ function textOf2(node, all) {
|
|
|
5217
5307
|
return node.map(function(n3) {
|
|
5218
5308
|
return textOf2(n3, all);
|
|
5219
5309
|
}).join("");
|
|
5220
|
-
if (
|
|
5310
|
+
if (React31.isValidElement(node)) {
|
|
5221
5311
|
const p = node.props;
|
|
5222
5312
|
return !all && (p["aria-hidden"] === true || p["aria-hidden"] === "true") ? "" : textOf2(p.children, all);
|
|
5223
5313
|
}
|
|
5224
5314
|
return "";
|
|
5225
5315
|
}
|
|
5226
|
-
var Tag =
|
|
5316
|
+
var Tag = React31.forwardRef(function Tag2(props, ref) {
|
|
5227
5317
|
const t = useStrings();
|
|
5228
5318
|
const selectable = props.onClick != null || props.selected != null;
|
|
5229
5319
|
const rest = omit(props, [
|
|
@@ -5236,10 +5326,10 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5236
5326
|
"removeLabel",
|
|
5237
5327
|
"touchHeight"
|
|
5238
5328
|
]);
|
|
5239
|
-
const textRef =
|
|
5329
|
+
const textRef = React31.useRef(null);
|
|
5240
5330
|
useAutoTip();
|
|
5241
|
-
const cutState =
|
|
5242
|
-
const check =
|
|
5331
|
+
const cutState = React31.useState(false), isCut = cutState[0];
|
|
5332
|
+
const check = React31.useCallback(function() {
|
|
5243
5333
|
const el = textRef.current;
|
|
5244
5334
|
if (el) cutState[1](el.scrollWidth > el.clientWidth + 1);
|
|
5245
5335
|
}, []);
|
|
@@ -5258,11 +5348,11 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5258
5348
|
);
|
|
5259
5349
|
const fullText = isCut ? textOf2(props.children, true).replace(/\s+/g, " ").trim() : "";
|
|
5260
5350
|
const inner = [
|
|
5261
|
-
props.icon ? /* @__PURE__ */
|
|
5262
|
-
/* @__PURE__ */
|
|
5351
|
+
props.icon ? /* @__PURE__ */ React31.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
|
|
5352
|
+
/* @__PURE__ */ React31.createElement("span", { key: "t", ref: textRef, className: "aura-tag__text", "data-aura-tip": fullText || void 0 }, props.children)
|
|
5263
5353
|
];
|
|
5264
5354
|
if (selectable) {
|
|
5265
|
-
return /* @__PURE__ */
|
|
5355
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5266
5356
|
"button",
|
|
5267
5357
|
{
|
|
5268
5358
|
...rest,
|
|
@@ -5277,7 +5367,7 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5277
5367
|
props.className
|
|
5278
5368
|
)
|
|
5279
5369
|
},
|
|
5280
|
-
props.selected ? /* @__PURE__ */
|
|
5370
|
+
props.selected ? /* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconCheck, null), size: 14 }) : inner[0],
|
|
5281
5371
|
inner[1]
|
|
5282
5372
|
);
|
|
5283
5373
|
}
|
|
@@ -5287,8 +5377,8 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5287
5377
|
"tag-remove-label",
|
|
5288
5378
|
'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
|
|
5289
5379
|
);
|
|
5290
|
-
return /* @__PURE__ */
|
|
5291
|
-
const btn = /* @__PURE__ */
|
|
5380
|
+
return /* @__PURE__ */ React31.createElement("span", { ...rest, ref, className: cx("aura-tag", props.disabled && "is-disabled", props.className) }, inner, props.onRemove && !props.disabled ? function() {
|
|
5381
|
+
const btn = /* @__PURE__ */ React31.createElement(
|
|
5292
5382
|
"button",
|
|
5293
5383
|
{
|
|
5294
5384
|
type: "button",
|
|
@@ -5296,9 +5386,9 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5296
5386
|
"aria-label": props.removeLabel || t.remove(name),
|
|
5297
5387
|
onClick: props.onRemove
|
|
5298
5388
|
},
|
|
5299
|
-
/* @__PURE__ */
|
|
5389
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconX, null), size: 14 })
|
|
5300
5390
|
);
|
|
5301
|
-
return /* @__PURE__ */
|
|
5391
|
+
return /* @__PURE__ */ React31.createElement(Tooltip, { content: fullText, open: fullText ? void 0 : false }, btn);
|
|
5302
5392
|
}() : null);
|
|
5303
5393
|
});
|
|
5304
5394
|
|
|
@@ -5321,16 +5411,16 @@ var space = function(v) {
|
|
|
5321
5411
|
};
|
|
5322
5412
|
|
|
5323
5413
|
// src/FilterBar.tsx
|
|
5324
|
-
var FilterBar =
|
|
5414
|
+
var FilterBar = React32.forwardRef(function FilterBar2(props, ref) {
|
|
5325
5415
|
const t = useStrings();
|
|
5326
5416
|
const id = uid();
|
|
5327
5417
|
const hasSearch = !!props.onSearchChange;
|
|
5328
|
-
const draft =
|
|
5329
|
-
const timer2 =
|
|
5330
|
-
const sent =
|
|
5331
|
-
const onChange =
|
|
5418
|
+
const draft = React32.useState(props.search || "");
|
|
5419
|
+
const timer2 = React32.useRef(null);
|
|
5420
|
+
const sent = React32.useRef(props.search || "");
|
|
5421
|
+
const onChange = React32.useRef(props.onSearchChange);
|
|
5332
5422
|
onChange.current = props.onSearchChange;
|
|
5333
|
-
|
|
5423
|
+
React32.useEffect(
|
|
5334
5424
|
function() {
|
|
5335
5425
|
if ((props.search || "") !== sent.current) {
|
|
5336
5426
|
sent.current = props.search || "";
|
|
@@ -5339,7 +5429,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5339
5429
|
},
|
|
5340
5430
|
[props.search]
|
|
5341
5431
|
);
|
|
5342
|
-
|
|
5432
|
+
React32.useEffect(function() {
|
|
5343
5433
|
return function() {
|
|
5344
5434
|
if (timer2.current) clearTimeout(timer2.current);
|
|
5345
5435
|
};
|
|
@@ -5362,14 +5452,14 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5362
5452
|
);
|
|
5363
5453
|
}
|
|
5364
5454
|
const filters = props.filters || [];
|
|
5365
|
-
const hasChildren =
|
|
5455
|
+
const hasChildren = React32.Children.toArray(props.children).length > 0;
|
|
5366
5456
|
const collapse = props.collapseBelow && hasChildren ? props.collapseBelow : null;
|
|
5367
|
-
const sheet =
|
|
5457
|
+
const sheet = React32.useState(false), open = !!collapse && sheet[0];
|
|
5368
5458
|
const sheetId = id + "-filters";
|
|
5369
|
-
const doneRef =
|
|
5459
|
+
const doneRef = React32.useRef(null), moreRef = React32.useRef(null), own = React32.useRef(null), rootRef = useMergedRef(ref, own);
|
|
5370
5460
|
if (collapse)
|
|
5371
|
-
|
|
5372
|
-
if (!
|
|
5461
|
+
React32.Children.forEach(props.children, function(c) {
|
|
5462
|
+
if (!React32.isValidElement(c) || c.type === Button || c.type === IconButton) return;
|
|
5373
5463
|
const p = c.props;
|
|
5374
5464
|
if (p.defaultValue !== void 0 || p.defaultChecked !== void 0 || "label" in p && !("value" in p) && !("selected" in p) && !("checked" in p))
|
|
5375
5465
|
devWarnOnce(
|
|
@@ -5387,7 +5477,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5387
5477
|
) || bar.querySelector(".aura-filterbar__search input");
|
|
5388
5478
|
}
|
|
5389
5479
|
const applied = props.filterCount != null ? props.filterCount : filters.length;
|
|
5390
|
-
|
|
5480
|
+
React32.useEffect(
|
|
5391
5481
|
function() {
|
|
5392
5482
|
if (!open || !collapse || typeof window.matchMedia !== "function") return;
|
|
5393
5483
|
const mq = window.matchMedia("(min-width: " + breakpoints[collapse] + "px)");
|
|
@@ -5412,7 +5502,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5412
5502
|
}
|
|
5413
5503
|
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
5414
5504
|
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
5415
|
-
const searchBox = hasSearch ? /* @__PURE__ */
|
|
5505
|
+
const searchBox = hasSearch ? /* @__PURE__ */ React32.createElement("div", { className: "aura-input has-icon aura-filterbar__search" }, /* @__PURE__ */ React32.createElement(Icon, { name: /* @__PURE__ */ React32.createElement(IconSearch, null), className: "aura-input__icon" }), /* @__PURE__ */ React32.createElement(
|
|
5416
5506
|
"input",
|
|
5417
5507
|
{
|
|
5418
5508
|
id,
|
|
@@ -5433,10 +5523,10 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5433
5523
|
}
|
|
5434
5524
|
}
|
|
5435
5525
|
}
|
|
5436
|
-
), draft[0] ? /* @__PURE__ */
|
|
5526
|
+
), draft[0] ? /* @__PURE__ */ React32.createElement(
|
|
5437
5527
|
IconButton,
|
|
5438
5528
|
{
|
|
5439
|
-
icon: /* @__PURE__ */
|
|
5529
|
+
icon: /* @__PURE__ */ React32.createElement(IconX, null),
|
|
5440
5530
|
label: t.clear((props.searchLabel || t.search).toLowerCase()),
|
|
5441
5531
|
className: "aura-filterbar__clear-search",
|
|
5442
5532
|
onClick: function() {
|
|
@@ -5445,12 +5535,12 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5445
5535
|
}
|
|
5446
5536
|
}
|
|
5447
5537
|
) : null) : null;
|
|
5448
|
-
const more = collapse ? /* @__PURE__ */
|
|
5538
|
+
const more = collapse ? /* @__PURE__ */ React32.createElement(
|
|
5449
5539
|
Button,
|
|
5450
5540
|
{
|
|
5451
5541
|
ref: moreRef,
|
|
5452
5542
|
variant: "secondary",
|
|
5453
|
-
icon: /* @__PURE__ */
|
|
5543
|
+
icon: /* @__PURE__ */ React32.createElement(IconSlidersHorizontal, null),
|
|
5454
5544
|
className: "aura-filterbar__more",
|
|
5455
5545
|
"aria-haspopup": "dialog",
|
|
5456
5546
|
"aria-expanded": open,
|
|
@@ -5459,9 +5549,9 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5459
5549
|
sheet[1](true);
|
|
5460
5550
|
}
|
|
5461
5551
|
},
|
|
5462
|
-
applied > 0 ? /* @__PURE__ */
|
|
5552
|
+
applied > 0 ? /* @__PURE__ */ React32.createElement(React32.Fragment, null, /* @__PURE__ */ React32.createElement("span", { className: "aura-sr-only" }, t.filtersApplied(applied)), /* @__PURE__ */ React32.createElement("span", { "aria-hidden": true }, t.filters + " (" + applied + ")")) : t.filters
|
|
5463
5553
|
) : null;
|
|
5464
|
-
return /* @__PURE__ */
|
|
5554
|
+
return /* @__PURE__ */ React32.createElement(
|
|
5465
5555
|
"div",
|
|
5466
5556
|
{
|
|
5467
5557
|
ref: rootRef,
|
|
@@ -5477,15 +5567,15 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5477
5567
|
props.className
|
|
5478
5568
|
)
|
|
5479
5569
|
},
|
|
5480
|
-
/* @__PURE__ */
|
|
5570
|
+
/* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar__row" }, collapse ? (
|
|
5481
5571
|
/* 5.42: the search and the Filters button share a row of their own below the breakpoint (count and actions
|
|
5482
5572
|
* wrap under them); from the breakpoint up this box is display: contents and the bar is as before. */
|
|
5483
|
-
/* @__PURE__ */
|
|
5484
|
-
) : searchBox, hasChildren && !open ? /* @__PURE__ */
|
|
5485
|
-
filters.length || props.onClearAll && anything ? /* @__PURE__ */
|
|
5486
|
-
return /* @__PURE__ */
|
|
5487
|
-
}), props.onClearAll && anything ? /* @__PURE__ */
|
|
5488
|
-
collapse ? /* @__PURE__ */
|
|
5573
|
+
/* @__PURE__ */ React32.createElement("div", { className: cx("aura-filterbar__lead", !hasSearch && "is-alone") }, searchBox, more)
|
|
5574
|
+
) : searchBox, hasChildren && !open ? /* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar__controls" }, props.children) : null, /* @__PURE__ */ React32.createElement("span", { className: "aura-filterbar__spacer" }), count != null ? /* @__PURE__ */ React32.createElement("span", { className: "aura-filterbar__count", "aria-live": "polite" }, count) : null, props.actions ? /* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar__actions" }, props.actions) : null),
|
|
5575
|
+
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
5576
|
+
return /* @__PURE__ */ React32.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
5577
|
+
}), props.onClearAll && anything ? /* @__PURE__ */ React32.createElement("button", { type: "button", className: "aura-filterbar__clear", onClick: clearAll }, t.clearFilters) : null) : null,
|
|
5578
|
+
collapse ? /* @__PURE__ */ React32.createElement(
|
|
5489
5579
|
Dialog,
|
|
5490
5580
|
{
|
|
5491
5581
|
open,
|
|
@@ -5497,7 +5587,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5497
5587
|
title: t.filters,
|
|
5498
5588
|
size: "sm",
|
|
5499
5589
|
className: "aura-filterbar__sheet",
|
|
5500
|
-
footer: /* @__PURE__ */
|
|
5590
|
+
footer: /* @__PURE__ */ React32.createElement(React32.Fragment, null, props.onClearAll && filters.length ? /* @__PURE__ */ React32.createElement(
|
|
5501
5591
|
Button,
|
|
5502
5592
|
{
|
|
5503
5593
|
variant: "secondary",
|
|
@@ -5508,7 +5598,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5508
5598
|
}
|
|
5509
5599
|
},
|
|
5510
5600
|
t.clearFilters
|
|
5511
|
-
) : null, /* @__PURE__ */
|
|
5601
|
+
) : null, /* @__PURE__ */ React32.createElement(
|
|
5512
5602
|
Button,
|
|
5513
5603
|
{
|
|
5514
5604
|
ref: doneRef,
|
|
@@ -5520,13 +5610,13 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5520
5610
|
t.done
|
|
5521
5611
|
))
|
|
5522
5612
|
},
|
|
5523
|
-
/* @__PURE__ */
|
|
5613
|
+
/* @__PURE__ */ React32.createElement(FilterSheet.Provider, { value: true }, /* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar aura-filterbar--sheet is-touch-always" }, props.children))
|
|
5524
5614
|
) : null
|
|
5525
5615
|
);
|
|
5526
5616
|
});
|
|
5527
5617
|
|
|
5528
5618
|
// src/Command.tsx
|
|
5529
|
-
var
|
|
5619
|
+
var React33 = __toESM(require("react"), 1);
|
|
5530
5620
|
var import_react_dom9 = require("react-dom");
|
|
5531
5621
|
function isMac() {
|
|
5532
5622
|
return typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
@@ -5535,21 +5625,21 @@ function Command(props) {
|
|
|
5535
5625
|
const t = useStrings();
|
|
5536
5626
|
const density = useDensity();
|
|
5537
5627
|
const id = uid(), listId = id + "-list";
|
|
5538
|
-
const box =
|
|
5539
|
-
const input =
|
|
5540
|
-
const qState =
|
|
5628
|
+
const box = React33.useRef(null);
|
|
5629
|
+
const input = React33.useRef(null);
|
|
5630
|
+
const qState = React33.useState(""), act = React33.useState(null);
|
|
5541
5631
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
5542
5632
|
function setQuery(v) {
|
|
5543
5633
|
if (props.query === void 0) qState[1](v);
|
|
5544
5634
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
5545
5635
|
}
|
|
5546
|
-
const openRef =
|
|
5636
|
+
const openRef = React33.useRef(props.open);
|
|
5547
5637
|
openRef.current = props.open;
|
|
5548
5638
|
const close = function() {
|
|
5549
5639
|
props.onOpenChange(false);
|
|
5550
5640
|
};
|
|
5551
5641
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
5552
|
-
|
|
5642
|
+
React33.useEffect(
|
|
5553
5643
|
function() {
|
|
5554
5644
|
if (props.hotkey === false) return;
|
|
5555
5645
|
function onKey2(e) {
|
|
@@ -5565,7 +5655,7 @@ function Command(props) {
|
|
|
5565
5655
|
},
|
|
5566
5656
|
[props.hotkey, props.onOpenChange]
|
|
5567
5657
|
);
|
|
5568
|
-
|
|
5658
|
+
React33.useEffect(
|
|
5569
5659
|
function() {
|
|
5570
5660
|
if (!props.open) {
|
|
5571
5661
|
if (query) setQuery("");
|
|
@@ -5605,7 +5695,7 @@ function Command(props) {
|
|
|
5605
5695
|
const optId = function(i2) {
|
|
5606
5696
|
return id + "-o" + i2;
|
|
5607
5697
|
};
|
|
5608
|
-
|
|
5698
|
+
React33.useEffect(
|
|
5609
5699
|
function() {
|
|
5610
5700
|
if (!box.current || active < 0) return;
|
|
5611
5701
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -5650,7 +5740,7 @@ function Command(props) {
|
|
|
5650
5740
|
if (!modal.ready) return null;
|
|
5651
5741
|
let i = -1;
|
|
5652
5742
|
return (0, import_react_dom9.createPortal)(
|
|
5653
|
-
/* @__PURE__ */
|
|
5743
|
+
/* @__PURE__ */ React33.createElement(
|
|
5654
5744
|
"div",
|
|
5655
5745
|
{
|
|
5656
5746
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -5660,8 +5750,8 @@ function Command(props) {
|
|
|
5660
5750
|
e.stopPropagation();
|
|
5661
5751
|
}
|
|
5662
5752
|
},
|
|
5663
|
-
/* @__PURE__ */
|
|
5664
|
-
/* @__PURE__ */
|
|
5753
|
+
/* @__PURE__ */ React33.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
5754
|
+
/* @__PURE__ */ React33.createElement(
|
|
5665
5755
|
"div",
|
|
5666
5756
|
{
|
|
5667
5757
|
ref: box,
|
|
@@ -5671,7 +5761,7 @@ function Command(props) {
|
|
|
5671
5761
|
tabIndex: -1,
|
|
5672
5762
|
className: cx("aura-command", props.className)
|
|
5673
5763
|
},
|
|
5674
|
-
/* @__PURE__ */
|
|
5764
|
+
/* @__PURE__ */ React33.createElement("div", { className: "aura-command__search" }, /* @__PURE__ */ React33.createElement(Icon, { name: /* @__PURE__ */ React33.createElement(IconSearch, null), className: "aura-command__search-icon" }), /* @__PURE__ */ React33.createElement(
|
|
5675
5765
|
"input",
|
|
5676
5766
|
{
|
|
5677
5767
|
ref: input,
|
|
@@ -5694,8 +5784,8 @@ function Command(props) {
|
|
|
5694
5784
|
},
|
|
5695
5785
|
onKeyDown: onKey
|
|
5696
5786
|
}
|
|
5697
|
-
), /* @__PURE__ */
|
|
5698
|
-
/* @__PURE__ */
|
|
5787
|
+
), /* @__PURE__ */ React33.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
5788
|
+
/* @__PURE__ */ React33.createElement("div", { className: "aura-command__list", "aria-busy": props.loading || void 0 }, props.loading ? /* @__PURE__ */ React33.createElement("div", { className: "aura-command__loading" }, /* @__PURE__ */ React33.createElement(Icon, { name: /* @__PURE__ */ React33.createElement(IconLoaderCircle, null), className: "aura-spin" }), t.searching) : null, !flat3.length ? props.loading ? null : /* @__PURE__ */ React33.createElement("div", { className: "aura-command__empty" }, props.empty != null ? props.empty : props.emptyText || t.noMatches) : /* @__PURE__ */ React33.createElement(
|
|
5699
5789
|
"div",
|
|
5700
5790
|
{
|
|
5701
5791
|
id: listId,
|
|
@@ -5705,7 +5795,7 @@ function Command(props) {
|
|
|
5705
5795
|
},
|
|
5706
5796
|
groups.map(function(g, gi) {
|
|
5707
5797
|
const gid = id + "-g" + gi;
|
|
5708
|
-
return /* @__PURE__ */
|
|
5798
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5709
5799
|
"div",
|
|
5710
5800
|
{
|
|
5711
5801
|
key: g.name || gi,
|
|
@@ -5713,11 +5803,11 @@ function Command(props) {
|
|
|
5713
5803
|
"aria-labelledby": g.name ? gid : void 0,
|
|
5714
5804
|
className: "aura-command__group"
|
|
5715
5805
|
},
|
|
5716
|
-
g.name ? /* @__PURE__ */
|
|
5806
|
+
g.name ? /* @__PURE__ */ React33.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
5717
5807
|
g.items.map(function(it) {
|
|
5718
5808
|
i++;
|
|
5719
5809
|
const n3 = i;
|
|
5720
|
-
return /* @__PURE__ */
|
|
5810
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5721
5811
|
"div",
|
|
5722
5812
|
{
|
|
5723
5813
|
key: it.id,
|
|
@@ -5741,16 +5831,16 @@ function Command(props) {
|
|
|
5741
5831
|
run(it);
|
|
5742
5832
|
}
|
|
5743
5833
|
},
|
|
5744
|
-
it.icon ? /* @__PURE__ */
|
|
5745
|
-
/* @__PURE__ */
|
|
5746
|
-
it.shortcut ? /* @__PURE__ */
|
|
5834
|
+
it.icon ? /* @__PURE__ */ React33.createElement(Icon, { name: it.icon }) : null,
|
|
5835
|
+
/* @__PURE__ */ React33.createElement("span", { className: "aura-command__text" }, /* @__PURE__ */ React33.createElement("span", { className: "aura-command__label", id: it.description ? optId(n3) + "-label" : void 0 }, it.label), it.description ? /* @__PURE__ */ React33.createElement("span", { className: "aura-command__desc", id: optId(n3) + "-desc", "aria-hidden": true }, it.description) : null),
|
|
5836
|
+
it.shortcut ? /* @__PURE__ */ React33.createElement("kbd", { className: "aura-command__kbd", id: it.description ? optId(n3) + "-kbd" : void 0 }, it.shortcut) : null
|
|
5747
5837
|
);
|
|
5748
5838
|
})
|
|
5749
5839
|
);
|
|
5750
5840
|
})
|
|
5751
5841
|
)),
|
|
5752
|
-
/* @__PURE__ */
|
|
5753
|
-
/* @__PURE__ */
|
|
5842
|
+
/* @__PURE__ */ React33.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !flat3.length ? t.noMatches : props.loading === false && query ? t.results(flat3.length) : ""),
|
|
5843
|
+
/* @__PURE__ */ React33.createElement("div", { className: "aura-command__foot", "aria-hidden": true }, t.commandHint, /* @__PURE__ */ React33.createElement("span", { className: "aura-command__mod" }, isMac() ? "\u2318K" : "Ctrl K"))
|
|
5754
5844
|
)
|
|
5755
5845
|
),
|
|
5756
5846
|
document.body
|
|
@@ -5758,7 +5848,7 @@ function Command(props) {
|
|
|
5758
5848
|
}
|
|
5759
5849
|
|
|
5760
5850
|
// src/DataTable.tsx
|
|
5761
|
-
var
|
|
5851
|
+
var React34 = __toESM(require("react"), 1);
|
|
5762
5852
|
var import_react_dom10 = require("react-dom");
|
|
5763
5853
|
function ownRowAttrs(p) {
|
|
5764
5854
|
if (!p) return null;
|
|
@@ -5794,7 +5884,7 @@ function hidePx(c) {
|
|
|
5794
5884
|
var ROW_H_DEFAULT = 48;
|
|
5795
5885
|
var OVERSCAN = 8;
|
|
5796
5886
|
var FLEX_MIN = 160;
|
|
5797
|
-
var DataTableImpl =
|
|
5887
|
+
var DataTableImpl = React34.forwardRef(function DataTable(props, ref) {
|
|
5798
5888
|
const t = useStrings();
|
|
5799
5889
|
const columns = props.columns || DEFAULT_COLUMNS;
|
|
5800
5890
|
const byKey = {};
|
|
@@ -5821,7 +5911,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5821
5911
|
);
|
|
5822
5912
|
const sort = sortState[0], setSort = sortState[1];
|
|
5823
5913
|
const selState = useMaybeControlled(props.selected, props.defaultSelected || [], null);
|
|
5824
|
-
const onSel =
|
|
5914
|
+
const onSel = React34.useRef(props.onSelectionChange);
|
|
5825
5915
|
onSel.current = props.onSelectionChange;
|
|
5826
5916
|
const canSelect = function(r2) {
|
|
5827
5917
|
return !!r2 && (!props.isRowSelectable || !!props.isRowSelectable(r2));
|
|
@@ -5841,7 +5931,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5841
5931
|
const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
|
|
5842
5932
|
return rejected[String(k)];
|
|
5843
5933
|
}).join("\0") + "#" + selected.join("\0");
|
|
5844
|
-
|
|
5934
|
+
React34.useEffect(
|
|
5845
5935
|
function() {
|
|
5846
5936
|
if (droppedSig !== "") setSelected(selected);
|
|
5847
5937
|
},
|
|
@@ -5878,19 +5968,19 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5878
5968
|
}),
|
|
5879
5969
|
props.onPinnedColumnsChange
|
|
5880
5970
|
);
|
|
5881
|
-
const widthState =
|
|
5971
|
+
const widthState = React34.useState({});
|
|
5882
5972
|
const widths = widthState[0], setWidths = widthState[1];
|
|
5883
|
-
const activeState =
|
|
5884
|
-
const scrollState =
|
|
5973
|
+
const activeState = React34.useState({ r: 1, c: 0 });
|
|
5974
|
+
const scrollState = React34.useState(0);
|
|
5885
5975
|
const scrollTop = scrollState[0], setScrollTop = scrollState[1];
|
|
5886
|
-
const scrolledX =
|
|
5887
|
-
const menuState =
|
|
5976
|
+
const scrolledX = React34.useState(false);
|
|
5977
|
+
const menuState = React34.useState(null);
|
|
5888
5978
|
const menu = menuState[0], setMenu = menuState[1];
|
|
5889
|
-
const dragState =
|
|
5979
|
+
const dragState = React34.useState(null);
|
|
5890
5980
|
const drag = dragState[0], setDrag = dragState[1];
|
|
5891
|
-
const gridRef =
|
|
5892
|
-
const wrapRef =
|
|
5893
|
-
const boxWidth =
|
|
5981
|
+
const gridRef = React34.useRef(null);
|
|
5982
|
+
const wrapRef = React34.useRef(null), wrapMerged = useMergedRef(ref, wrapRef);
|
|
5983
|
+
const boxWidth = React34.useState(null);
|
|
5894
5984
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
5895
5985
|
return c.hideBelow != null;
|
|
5896
5986
|
});
|
|
@@ -5900,7 +5990,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5900
5990
|
return px != null && a.indexOf(px) === i;
|
|
5901
5991
|
}).length
|
|
5902
5992
|
);
|
|
5903
|
-
|
|
5993
|
+
React34.useEffect(
|
|
5904
5994
|
function() {
|
|
5905
5995
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
5906
5996
|
const ro = new ResizeObserver(function(en) {
|
|
@@ -5946,8 +6036,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5946
6036
|
const px = hidePx(c);
|
|
5947
6037
|
return px != null && below(boxWidth[0], px);
|
|
5948
6038
|
}
|
|
5949
|
-
const scrollRef =
|
|
5950
|
-
const edgeState =
|
|
6039
|
+
const scrollRef = React34.useRef(null);
|
|
6040
|
+
const edgeState = React34.useState("");
|
|
5951
6041
|
const checkMoreX = function() {
|
|
5952
6042
|
const el = scrollRef.current;
|
|
5953
6043
|
if (!el) return;
|
|
@@ -5955,9 +6045,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5955
6045
|
const next = more ? [el.offsetTop, el.clientHeight, el.offsetWidth - el.clientWidth].join(" ") : "";
|
|
5956
6046
|
if (next !== edgeState[0]) edgeState[1](next);
|
|
5957
6047
|
};
|
|
5958
|
-
const checkRef =
|
|
6048
|
+
const checkRef = React34.useRef(checkMoreX);
|
|
5959
6049
|
checkRef.current = checkMoreX;
|
|
5960
|
-
|
|
6050
|
+
React34.useEffect(function() {
|
|
5961
6051
|
const el = scrollRef.current;
|
|
5962
6052
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
5963
6053
|
const ro = new ResizeObserver(function() {
|
|
@@ -5969,7 +6059,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5969
6059
|
ro.disconnect();
|
|
5970
6060
|
};
|
|
5971
6061
|
}, []);
|
|
5972
|
-
const tipState =
|
|
6062
|
+
const tipState = React34.useState(null), tip2 = tipState[0], setTip = tipState[1];
|
|
5973
6063
|
function showFull(e) {
|
|
5974
6064
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
5975
6065
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
@@ -5981,7 +6071,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5981
6071
|
setTip(null);
|
|
5982
6072
|
}
|
|
5983
6073
|
const tipEl = tip2 && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
5984
|
-
/* @__PURE__ */
|
|
6074
|
+
/* @__PURE__ */ React34.createElement(
|
|
5985
6075
|
"div",
|
|
5986
6076
|
{
|
|
5987
6077
|
className: "aura-tooltip aura-tooltip--above",
|
|
@@ -5992,7 +6082,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5992
6082
|
),
|
|
5993
6083
|
document.body
|
|
5994
6084
|
) : null;
|
|
5995
|
-
const rowH =
|
|
6085
|
+
const rowH = React34.useState(ROW_H_DEFAULT);
|
|
5996
6086
|
const ROW_H = rowH[0];
|
|
5997
6087
|
useIsoLayoutEffect(function() {
|
|
5998
6088
|
const el = wrapRef.current;
|
|
@@ -6000,8 +6090,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6000
6090
|
const v = parseFloat(getComputedStyle(el).getPropertyValue("--aura-table-row-height"));
|
|
6001
6091
|
if (v > 0 && v !== rowH[0]) rowH[1](v);
|
|
6002
6092
|
});
|
|
6003
|
-
const pending =
|
|
6004
|
-
const resizing =
|
|
6093
|
+
const pending = React34.useRef(null);
|
|
6094
|
+
const resizing = React34.useRef(false);
|
|
6005
6095
|
useIsoLayoutEffect(function() {
|
|
6006
6096
|
if (!gridRef.current || tabMode) return;
|
|
6007
6097
|
const els = gridRef.current.querySelectorAll(
|
|
@@ -6124,7 +6214,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6124
6214
|
return s;
|
|
6125
6215
|
}
|
|
6126
6216
|
const sortCol = sort && sort.key ? byKey[sort.key] : void 0;
|
|
6127
|
-
const view =
|
|
6217
|
+
const view = React34.useMemo(
|
|
6128
6218
|
function() {
|
|
6129
6219
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
6130
6220
|
const col = byKey[sort.key];
|
|
@@ -6166,8 +6256,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6166
6256
|
const pageRows = pageSize && !manual ? view.slice(first, first + pageSize) : view;
|
|
6167
6257
|
const canSortAny = !busy && (manual ? total > 1 : rows.length > 1);
|
|
6168
6258
|
const shownTotal = manual && props.totalRows == null ? first + rows.length : total;
|
|
6169
|
-
const prevCount =
|
|
6170
|
-
|
|
6259
|
+
const prevCount = React34.useRef(pageCount);
|
|
6260
|
+
React34.useEffect(
|
|
6171
6261
|
function() {
|
|
6172
6262
|
if (busy) return;
|
|
6173
6263
|
const before = prevCount.current;
|
|
@@ -6181,9 +6271,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6181
6271
|
[pageState[0], page, busy, pageCount]
|
|
6182
6272
|
);
|
|
6183
6273
|
const linkPaging = !!props.getPageHref && !props.onPageChange && !oneCallback;
|
|
6184
|
-
const prevLink =
|
|
6185
|
-
const jumpState =
|
|
6186
|
-
|
|
6274
|
+
const prevLink = React34.useRef(null), nextLink = React34.useRef(null), jumpLink = React34.useRef(null);
|
|
6275
|
+
const jumpState = React34.useState(null);
|
|
6276
|
+
React34.useEffect(
|
|
6187
6277
|
function() {
|
|
6188
6278
|
if (jumpState[0] == null) return;
|
|
6189
6279
|
if (jumpLink.current) jumpLink.current.click();
|
|
@@ -6234,7 +6324,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6234
6324
|
);
|
|
6235
6325
|
}
|
|
6236
6326
|
function rowLinkWrap(r2, content) {
|
|
6237
|
-
return rowHref ? /* @__PURE__ */
|
|
6327
|
+
return rowHref ? /* @__PURE__ */ React34.createElement(Link, { href: rowHref(r2), className: "aura-table__row-link" }, content) : content;
|
|
6238
6328
|
}
|
|
6239
6329
|
const height = props.height || 0;
|
|
6240
6330
|
const autoRows = props.rowHeight === "auto" && !height;
|
|
@@ -6278,8 +6368,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6278
6368
|
const acShown = nearestShown(ac, 1, function(cc) {
|
|
6279
6369
|
return !cardHidden[cc];
|
|
6280
6370
|
});
|
|
6281
|
-
const lastFocus =
|
|
6282
|
-
|
|
6371
|
+
const lastFocus = React34.useRef(null);
|
|
6372
|
+
React34.useEffect(
|
|
6283
6373
|
function() {
|
|
6284
6374
|
const was = lastFocus.current, g = gridRef.current;
|
|
6285
6375
|
if (!stacked || !was || !g || !g.contains(was) || was.getClientRects().length > 0) return;
|
|
@@ -6294,7 +6384,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6294
6384
|
if (!activeRendered) return r2 === 0 && c === ac ? 0 : -1;
|
|
6295
6385
|
return r2 === ar && c === acShown ? 0 : -1;
|
|
6296
6386
|
}
|
|
6297
|
-
|
|
6387
|
+
React34.useEffect(function() {
|
|
6298
6388
|
const p = pending.current;
|
|
6299
6389
|
if (!p || !gridRef.current) return;
|
|
6300
6390
|
let c = p.c;
|
|
@@ -6357,8 +6447,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6357
6447
|
return selSet[String(k)];
|
|
6358
6448
|
}).length;
|
|
6359
6449
|
const all = nSel > 0 && nSel === pageKeys.length;
|
|
6360
|
-
const anchor =
|
|
6361
|
-
const shiftClick =
|
|
6450
|
+
const anchor = React34.useRef(null);
|
|
6451
|
+
const shiftClick = React34.useRef(false);
|
|
6362
6452
|
function toggle(k, on, how) {
|
|
6363
6453
|
const same2 = function(x) {
|
|
6364
6454
|
return String(x) === String(k);
|
|
@@ -6514,14 +6604,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6514
6604
|
items2.push(
|
|
6515
6605
|
{
|
|
6516
6606
|
label: t.sortAsc,
|
|
6517
|
-
icon: /* @__PURE__ */
|
|
6607
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowUp, null),
|
|
6518
6608
|
onSelect: function() {
|
|
6519
6609
|
applySort({ key: c.key, dir: "asc" });
|
|
6520
6610
|
}
|
|
6521
6611
|
},
|
|
6522
6612
|
{
|
|
6523
6613
|
label: t.sortDesc,
|
|
6524
|
-
icon: /* @__PURE__ */
|
|
6614
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowDown, null),
|
|
6525
6615
|
onSelect: function() {
|
|
6526
6616
|
applySort({ key: c.key, dir: "desc" });
|
|
6527
6617
|
}
|
|
@@ -6531,7 +6621,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6531
6621
|
if (c.width != null)
|
|
6532
6622
|
items2.push({
|
|
6533
6623
|
label: isPinned(c) ? t.unpin : t.pin,
|
|
6534
|
-
icon: isPinned(c) ? /* @__PURE__ */
|
|
6624
|
+
icon: isPinned(c) ? /* @__PURE__ */ React34.createElement(IconPinOff, null) : /* @__PURE__ */ React34.createElement(IconPin, null),
|
|
6535
6625
|
onSelect: function() {
|
|
6536
6626
|
togglePin(c.key);
|
|
6537
6627
|
}
|
|
@@ -6540,7 +6630,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6540
6630
|
items2.push(
|
|
6541
6631
|
{
|
|
6542
6632
|
label: t.moveLeft,
|
|
6543
|
-
icon: /* @__PURE__ */
|
|
6633
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowLeft, null),
|
|
6544
6634
|
disabled: gi <= 0,
|
|
6545
6635
|
onSelect: function() {
|
|
6546
6636
|
moveCol(c.key, -1);
|
|
@@ -6548,7 +6638,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6548
6638
|
},
|
|
6549
6639
|
{
|
|
6550
6640
|
label: t.moveRight,
|
|
6551
|
-
icon: /* @__PURE__ */
|
|
6641
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowRight, null),
|
|
6552
6642
|
disabled: gi >= group.length - 1,
|
|
6553
6643
|
onSelect: function() {
|
|
6554
6644
|
moveCol(c.key, 1);
|
|
@@ -6559,7 +6649,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6559
6649
|
{ separator: true },
|
|
6560
6650
|
{
|
|
6561
6651
|
label: t.hideColumn,
|
|
6562
|
-
icon: /* @__PURE__ */
|
|
6652
|
+
icon: /* @__PURE__ */ React34.createElement(IconEyeOff, null),
|
|
6563
6653
|
disabled: shown.length <= 1,
|
|
6564
6654
|
onSelect: function() {
|
|
6565
6655
|
setHidden(c.key, true);
|
|
@@ -6580,7 +6670,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6580
6670
|
setHidden(k, on);
|
|
6581
6671
|
}
|
|
6582
6672
|
};
|
|
6583
|
-
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */
|
|
6673
|
+
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React34.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
|
|
6584
6674
|
}
|
|
6585
6675
|
function openMenu(kind, key, anchor2, rc) {
|
|
6586
6676
|
setMenu({ kind, key, anchor: anchor2, rc });
|
|
@@ -6657,10 +6747,10 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6657
6747
|
e.stopPropagation();
|
|
6658
6748
|
}
|
|
6659
6749
|
}
|
|
6660
|
-
const head = [/* @__PURE__ */
|
|
6750
|
+
const head = [/* @__PURE__ */ React34.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
6661
6751
|
if (selectable)
|
|
6662
6752
|
head.push(
|
|
6663
|
-
/* @__PURE__ */
|
|
6753
|
+
/* @__PURE__ */ React34.createElement(
|
|
6664
6754
|
"span",
|
|
6665
6755
|
{
|
|
6666
6756
|
key: "__sel",
|
|
@@ -6674,7 +6764,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6674
6764
|
activeState[1]({ r: 0, c: 0 });
|
|
6675
6765
|
}
|
|
6676
6766
|
},
|
|
6677
|
-
pageKeys.length ? /* @__PURE__ */
|
|
6767
|
+
pageKeys.length ? /* @__PURE__ */ React34.createElement(
|
|
6678
6768
|
Checkbox,
|
|
6679
6769
|
{
|
|
6680
6770
|
ref: props.selectAllRef,
|
|
@@ -6686,7 +6776,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6686
6776
|
onChange: toggleAll
|
|
6687
6777
|
}
|
|
6688
6778
|
) : null,
|
|
6689
|
-
pageKeys.length ? /* @__PURE__ */
|
|
6779
|
+
pageKeys.length ? /* @__PURE__ */ React34.createElement("span", { className: "aura-table__sel-text" }, nSel ? t.selectedCount(nSel) : t.selectAll) : /* @__PURE__ */ React34.createElement("span", { className: "aura-sr-only" }, t.selectRows)
|
|
6690
6780
|
)
|
|
6691
6781
|
);
|
|
6692
6782
|
vis.forEach(function(c, i) {
|
|
@@ -6697,7 +6787,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6697
6787
|
const ariaSort = sort && canSortAny ? isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0 : own || (canSort ? "none" : void 0);
|
|
6698
6788
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
6699
6789
|
head.push(
|
|
6700
|
-
/* @__PURE__ */
|
|
6790
|
+
/* @__PURE__ */ React34.createElement(
|
|
6701
6791
|
"span",
|
|
6702
6792
|
{
|
|
6703
6793
|
key: c.key,
|
|
@@ -6748,7 +6838,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6748
6838
|
setDrag(null);
|
|
6749
6839
|
}
|
|
6750
6840
|
},
|
|
6751
|
-
/* @__PURE__ */
|
|
6841
|
+
/* @__PURE__ */ React34.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React34.createElement(
|
|
6752
6842
|
"button",
|
|
6753
6843
|
{
|
|
6754
6844
|
type: "button",
|
|
@@ -6760,14 +6850,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6760
6850
|
}
|
|
6761
6851
|
},
|
|
6762
6852
|
c.label,
|
|
6763
|
-
/* @__PURE__ */
|
|
6853
|
+
/* @__PURE__ */ React34.createElement(
|
|
6764
6854
|
Icon,
|
|
6765
6855
|
{
|
|
6766
|
-
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */
|
|
6856
|
+
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */ React34.createElement(IconArrowDown, null) : /* @__PURE__ */ React34.createElement(IconArrowUp, null) : /* @__PURE__ */ React34.createElement(IconArrowUpDown, null),
|
|
6767
6857
|
size: 12
|
|
6768
6858
|
}
|
|
6769
6859
|
)
|
|
6770
|
-
) : /* @__PURE__ */
|
|
6860
|
+
) : /* @__PURE__ */ React34.createElement("span", { className: cx("aura-table__th-label", !c.label && "aura-sr-only") }, c.label || (c.actions ? t.actions : c.key)), pin ? /* @__PURE__ */ React34.createElement(Icon, { name: /* @__PURE__ */ React34.createElement(IconPin, null), size: 12, className: "aura-table__pin-icon", label: t.pinned }) : null, controls ? /* @__PURE__ */ React34.createElement(
|
|
6771
6861
|
"button",
|
|
6772
6862
|
{
|
|
6773
6863
|
type: "button",
|
|
@@ -6781,9 +6871,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6781
6871
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
6782
6872
|
}
|
|
6783
6873
|
},
|
|
6784
|
-
/* @__PURE__ */
|
|
6874
|
+
/* @__PURE__ */ React34.createElement(Icon, { name: /* @__PURE__ */ React34.createElement(IconEllipsis, null) })
|
|
6785
6875
|
) : null),
|
|
6786
|
-
canResize(c) ? /* @__PURE__ */
|
|
6876
|
+
canResize(c) ? /* @__PURE__ */ React34.createElement(
|
|
6787
6877
|
"span",
|
|
6788
6878
|
{
|
|
6789
6879
|
className: "aura-table__resize",
|
|
@@ -6805,7 +6895,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6805
6895
|
);
|
|
6806
6896
|
});
|
|
6807
6897
|
head.push(
|
|
6808
|
-
/* @__PURE__ */
|
|
6898
|
+
/* @__PURE__ */ React34.createElement(
|
|
6809
6899
|
"span",
|
|
6810
6900
|
{
|
|
6811
6901
|
key: "__gr",
|
|
@@ -6816,15 +6906,15 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6816
6906
|
);
|
|
6817
6907
|
function cellContent(c, r2) {
|
|
6818
6908
|
const v = r2[c.key];
|
|
6819
|
-
return c.render ? c.render(r2) : c.pill ? /* @__PURE__ */
|
|
6909
|
+
return c.render ? c.render(r2) : c.pill ? /* @__PURE__ */ React34.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
6820
6910
|
}
|
|
6821
6911
|
function rowCells(r2, i, k, isSel) {
|
|
6822
6912
|
const ri = i + 1;
|
|
6823
6913
|
const selLabel = selectable && canSelect(r2) ? props.rowSelectLabel && props.rowSelectLabel(r2) || t.selectRow(k) : void 0;
|
|
6824
|
-
const cells = [/* @__PURE__ */
|
|
6914
|
+
const cells = [/* @__PURE__ */ React34.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
6825
6915
|
if (selectable)
|
|
6826
6916
|
cells.push(
|
|
6827
|
-
/* @__PURE__ */
|
|
6917
|
+
/* @__PURE__ */ React34.createElement(
|
|
6828
6918
|
"span",
|
|
6829
6919
|
{
|
|
6830
6920
|
key: "__sel",
|
|
@@ -6841,7 +6931,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6841
6931
|
shiftClick.current = e.shiftKey;
|
|
6842
6932
|
}
|
|
6843
6933
|
},
|
|
6844
|
-
canSelect(r2) ? /* @__PURE__ */
|
|
6934
|
+
canSelect(r2) ? /* @__PURE__ */ React34.createElement(
|
|
6845
6935
|
Checkbox,
|
|
6846
6936
|
{
|
|
6847
6937
|
hideLabel: true,
|
|
@@ -6860,7 +6950,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6860
6950
|
vis.forEach(function(c, j) {
|
|
6861
6951
|
const ci = j + (selectable ? 1 : 0), v = r2[c.key], pin = isPinned(c);
|
|
6862
6952
|
cells.push(
|
|
6863
|
-
/* @__PURE__ */
|
|
6953
|
+
/* @__PURE__ */ React34.createElement(
|
|
6864
6954
|
"span",
|
|
6865
6955
|
{
|
|
6866
6956
|
key: c.key,
|
|
@@ -6882,13 +6972,13 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6882
6972
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
6883
6973
|
}
|
|
6884
6974
|
},
|
|
6885
|
-
autoRows ? /* @__PURE__ */
|
|
6975
|
+
autoRows ? /* @__PURE__ */ React34.createElement("span", { className: "aura-table__cell" }, j === 0 ? rowLinkWrap(r2, cellContent(c, r2)) : cellContent(c, r2)) : j === 0 ? rowLinkWrap(r2, cellContent(c, r2)) : cellContent(c, r2)
|
|
6886
6976
|
)
|
|
6887
6977
|
);
|
|
6888
6978
|
});
|
|
6889
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
6979
|
+
if (hasFields) cells.push(/* @__PURE__ */ React34.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
6890
6980
|
cells.push(
|
|
6891
|
-
/* @__PURE__ */
|
|
6981
|
+
/* @__PURE__ */ React34.createElement(
|
|
6892
6982
|
"span",
|
|
6893
6983
|
{
|
|
6894
6984
|
key: "__gr",
|
|
@@ -6905,17 +6995,17 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6905
6995
|
const n3 = pageSize || props.skeletonRows || 5;
|
|
6906
6996
|
const skRows = body = [];
|
|
6907
6997
|
for (let i = 0; i < n3; i++) {
|
|
6908
|
-
const sk = [/* @__PURE__ */
|
|
6998
|
+
const sk = [/* @__PURE__ */ React34.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
6909
6999
|
if (selectable)
|
|
6910
7000
|
sk.push(
|
|
6911
|
-
/* @__PURE__ */
|
|
7001
|
+
/* @__PURE__ */ React34.createElement("span", { key: "__sel", className: cx("aura-table__sel", nPinned && "is-pinned") }, /* @__PURE__ */ React34.createElement("span", { className: "aura-skel aura-skel--box" }))
|
|
6912
7002
|
);
|
|
6913
7003
|
vis.forEach(function(c, j) {
|
|
6914
7004
|
const part = cardPart(c, j);
|
|
6915
7005
|
const action = part === "footer" || part === "actions";
|
|
6916
7006
|
const lines = c.pill ? 1 : Math.max(1, Math.min(10, Math.floor(Number(c.skeletonLines)) || 1));
|
|
6917
7007
|
const bar = function(n4) {
|
|
6918
|
-
return /* @__PURE__ */
|
|
7008
|
+
return /* @__PURE__ */ React34.createElement(
|
|
6919
7009
|
"span",
|
|
6920
7010
|
{
|
|
6921
7011
|
key: n4,
|
|
@@ -6927,7 +7017,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6927
7017
|
const bars2 = [];
|
|
6928
7018
|
for (let b = 0; b < lines; b++) bars2.push(bar(b));
|
|
6929
7019
|
sk.push(
|
|
6930
|
-
/* @__PURE__ */
|
|
7020
|
+
/* @__PURE__ */ React34.createElement(
|
|
6931
7021
|
"span",
|
|
6932
7022
|
{
|
|
6933
7023
|
key: c.key,
|
|
@@ -6940,7 +7030,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6940
7030
|
style: cellStyle(c, j),
|
|
6941
7031
|
...cardAttrs(c, j)
|
|
6942
7032
|
},
|
|
6943
|
-
action ? /* @__PURE__ */
|
|
7033
|
+
action ? /* @__PURE__ */ React34.createElement(
|
|
6944
7034
|
"span",
|
|
6945
7035
|
{
|
|
6946
7036
|
className: cx(
|
|
@@ -6949,16 +7039,16 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6949
7039
|
c.skeletonTouch && "is-touch"
|
|
6950
7040
|
)
|
|
6951
7041
|
}
|
|
6952
|
-
) : lines > 1 ? /* @__PURE__ */
|
|
7042
|
+
) : lines > 1 ? /* @__PURE__ */ React34.createElement("span", { className: "aura-skel-lines" }, bars2) : bars2[0]
|
|
6953
7043
|
)
|
|
6954
7044
|
);
|
|
6955
7045
|
});
|
|
6956
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
7046
|
+
if (hasFields) sk.push(/* @__PURE__ */ React34.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
6957
7047
|
sk.push(
|
|
6958
|
-
/* @__PURE__ */
|
|
7048
|
+
/* @__PURE__ */ React34.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
6959
7049
|
);
|
|
6960
7050
|
skRows.push(
|
|
6961
|
-
/* @__PURE__ */
|
|
7051
|
+
/* @__PURE__ */ React34.createElement(
|
|
6962
7052
|
"div",
|
|
6963
7053
|
{
|
|
6964
7054
|
key: "sk" + i,
|
|
@@ -6972,18 +7062,18 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6972
7062
|
}
|
|
6973
7063
|
} else if (!rows.length) {
|
|
6974
7064
|
const em = props.empty || {};
|
|
6975
|
-
body = /* @__PURE__ */
|
|
7065
|
+
body = /* @__PURE__ */ React34.createElement("div", { className: "aura-table__empty", role: "row" }, /* @__PURE__ */ React34.createElement("div", { role: "gridcell" }, /* @__PURE__ */ React34.createElement("span", { className: "aura-table__empty-icon" }, /* @__PURE__ */ React34.createElement(Icon, { name: em.icon || /* @__PURE__ */ React34.createElement(IconInbox, null), size: "lg" })), /* @__PURE__ */ React34.createElement("p", { className: "aura-table__empty-title" }, em.title || t.empty), em.description ? /* @__PURE__ */ React34.createElement("p", { className: "aura-table__empty-text" }, em.description) : null, em.action ? /* @__PURE__ */ React34.createElement("div", { className: "aura-table__empty-action" }, em.action) : null));
|
|
6976
7066
|
} else {
|
|
6977
7067
|
const bodyRows = body = [];
|
|
6978
7068
|
if (virtual && start > 0)
|
|
6979
7069
|
bodyRows.push(
|
|
6980
|
-
/* @__PURE__ */
|
|
7070
|
+
/* @__PURE__ */ React34.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
6981
7071
|
);
|
|
6982
7072
|
for (let ri = start; ri < end; ri++) {
|
|
6983
7073
|
(function(r2, i) {
|
|
6984
7074
|
const k = r2[rowKey], isSel = !!selSet[k];
|
|
6985
7075
|
bodyRows.push(
|
|
6986
|
-
/* @__PURE__ */
|
|
7076
|
+
/* @__PURE__ */ React34.createElement(
|
|
6987
7077
|
"div",
|
|
6988
7078
|
{
|
|
6989
7079
|
key: k,
|
|
@@ -7012,7 +7102,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7012
7102
|
}
|
|
7013
7103
|
if (virtual && end < pageRows.length)
|
|
7014
7104
|
bodyRows.push(
|
|
7015
|
-
/* @__PURE__ */
|
|
7105
|
+
/* @__PURE__ */ React34.createElement(
|
|
7016
7106
|
"div",
|
|
7017
7107
|
{
|
|
7018
7108
|
key: "__bot",
|
|
@@ -7025,9 +7115,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7025
7115
|
}
|
|
7026
7116
|
let foot = null;
|
|
7027
7117
|
function pagerButton(dir) {
|
|
7028
|
-
const p = page + dir, off = busy || (dir < 0 ? page <= 1 : page >= pageCount), label = dir < 0 ? t.prevPage : t.nextPage, icon = dir < 0 ? /* @__PURE__ */
|
|
7118
|
+
const p = page + dir, off = busy || (dir < 0 ? page <= 1 : page >= pageCount), label = dir < 0 ? t.prevPage : t.nextPage, icon = dir < 0 ? /* @__PURE__ */ React34.createElement(IconChevronLeft, null) : /* @__PURE__ */ React34.createElement(IconChevronRight, null);
|
|
7029
7119
|
if (props.getPageHref && !off)
|
|
7030
|
-
return /* @__PURE__ */
|
|
7120
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7031
7121
|
Link,
|
|
7032
7122
|
{
|
|
7033
7123
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -7042,9 +7132,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7042
7132
|
}
|
|
7043
7133
|
}
|
|
7044
7134
|
},
|
|
7045
|
-
/* @__PURE__ */
|
|
7135
|
+
/* @__PURE__ */ React34.createElement(Icon, { name: icon })
|
|
7046
7136
|
);
|
|
7047
|
-
return /* @__PURE__ */
|
|
7137
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7048
7138
|
IconButton,
|
|
7049
7139
|
{
|
|
7050
7140
|
icon,
|
|
@@ -7059,11 +7149,11 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7059
7149
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
7060
7150
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
7061
7151
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
7062
|
-
foot = /* @__PURE__ */
|
|
7152
|
+
foot = /* @__PURE__ */ React34.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React34.createElement("span", { "aria-live": "polite" }, busy ? t.loading : openTotal ? t.rangeOpen(from, to) : t.range(from, to, shownTotal)), /* @__PURE__ */ React34.createElement("span", { className: "aura-table__pager" }, /* @__PURE__ */ React34.createElement("span", null, openTotal ? t.pageOpen(page) : t.page(page, pageCount)), pagerButton(-1), pagerButton(1)));
|
|
7063
7153
|
} else if (height && rows.length && !loading) {
|
|
7064
|
-
foot = /* @__PURE__ */
|
|
7154
|
+
foot = /* @__PURE__ */ React34.createElement("div", { className: "aura-table__foot" }, /* @__PURE__ */ React34.createElement("span", null, t.rowCount(shownTotal)), selectable && selected.length ? /* @__PURE__ */ React34.createElement("span", null, t.selectedCount(selected.length)) : /* @__PURE__ */ React34.createElement("span", null));
|
|
7065
7155
|
}
|
|
7066
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
7156
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React34.createElement(
|
|
7067
7157
|
"div",
|
|
7068
7158
|
{
|
|
7069
7159
|
role: "row",
|
|
@@ -7072,8 +7162,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7072
7162
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
7073
7163
|
style: rowStyle
|
|
7074
7164
|
},
|
|
7075
|
-
/* @__PURE__ */
|
|
7076
|
-
selectable ? /* @__PURE__ */
|
|
7165
|
+
/* @__PURE__ */ React34.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
7166
|
+
selectable ? /* @__PURE__ */ React34.createElement(
|
|
7077
7167
|
"span",
|
|
7078
7168
|
{
|
|
7079
7169
|
role: "gridcell",
|
|
@@ -7088,7 +7178,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7088
7178
|
) : null,
|
|
7089
7179
|
vis.map(function(c, j) {
|
|
7090
7180
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
7091
|
-
return /* @__PURE__ */
|
|
7181
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7092
7182
|
"span",
|
|
7093
7183
|
{
|
|
7094
7184
|
key: c.key,
|
|
@@ -7114,8 +7204,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7114
7204
|
props.footer[c.key]
|
|
7115
7205
|
);
|
|
7116
7206
|
}),
|
|
7117
|
-
hasFields ? /* @__PURE__ */
|
|
7118
|
-
/* @__PURE__ */
|
|
7207
|
+
hasFields ? /* @__PURE__ */ React34.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
7208
|
+
/* @__PURE__ */ React34.createElement(
|
|
7119
7209
|
"span",
|
|
7120
7210
|
{
|
|
7121
7211
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -7129,7 +7219,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7129
7219
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
7130
7220
|
};
|
|
7131
7221
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
7132
|
-
const gridEl = /* @__PURE__ */
|
|
7222
|
+
const gridEl = /* @__PURE__ */ React34.createElement(
|
|
7133
7223
|
"div",
|
|
7134
7224
|
{
|
|
7135
7225
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -7150,8 +7240,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7150
7240
|
),
|
|
7151
7241
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
7152
7242
|
},
|
|
7153
|
-
refreshing ? /* @__PURE__ */
|
|
7154
|
-
edgeState[0] && !stacked ? /* @__PURE__ */
|
|
7243
|
+
refreshing ? /* @__PURE__ */ React34.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
7244
|
+
edgeState[0] && !stacked ? /* @__PURE__ */ React34.createElement(
|
|
7155
7245
|
"span",
|
|
7156
7246
|
{
|
|
7157
7247
|
className: "aura-table__edge",
|
|
@@ -7163,7 +7253,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7163
7253
|
}
|
|
7164
7254
|
}
|
|
7165
7255
|
) : null,
|
|
7166
|
-
/* @__PURE__ */
|
|
7256
|
+
/* @__PURE__ */ React34.createElement(
|
|
7167
7257
|
"div",
|
|
7168
7258
|
{
|
|
7169
7259
|
ref: function(el) {
|
|
@@ -7201,7 +7291,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7201
7291
|
checkMoreX();
|
|
7202
7292
|
}
|
|
7203
7293
|
},
|
|
7204
|
-
/* @__PURE__ */
|
|
7294
|
+
/* @__PURE__ */ React34.createElement(
|
|
7205
7295
|
"div",
|
|
7206
7296
|
{
|
|
7207
7297
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -7214,11 +7304,11 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7214
7304
|
body,
|
|
7215
7305
|
totalRow
|
|
7216
7306
|
),
|
|
7217
|
-
busy ? /* @__PURE__ */
|
|
7218
|
-
controls ? /* @__PURE__ */
|
|
7307
|
+
busy ? /* @__PURE__ */ React34.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null,
|
|
7308
|
+
controls ? /* @__PURE__ */ React34.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React34.createElement(
|
|
7219
7309
|
IconButton,
|
|
7220
7310
|
{
|
|
7221
|
-
icon: /* @__PURE__ */
|
|
7311
|
+
icon: /* @__PURE__ */ React34.createElement(IconColumns3, null),
|
|
7222
7312
|
label: t.showHideColumns,
|
|
7223
7313
|
"aria-haspopup": "menu",
|
|
7224
7314
|
onClick: function(e) {
|
|
@@ -7227,7 +7317,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7227
7317
|
}
|
|
7228
7318
|
)) : null,
|
|
7229
7319
|
foot,
|
|
7230
|
-
menu ? /* @__PURE__ */
|
|
7320
|
+
menu ? /* @__PURE__ */ React34.createElement(
|
|
7231
7321
|
Menu,
|
|
7232
7322
|
{
|
|
7233
7323
|
anchor: menu.anchor,
|
|
@@ -7237,13 +7327,13 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7237
7327
|
}
|
|
7238
7328
|
) : null,
|
|
7239
7329
|
tipEl,
|
|
7240
|
-
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */
|
|
7330
|
+
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */ React34.createElement(Link, { ref: jumpLink, href: props.getPageHref(jumpState[0]), hidden: true, tabIndex: -1, "aria-hidden": true }) : null
|
|
7241
7331
|
);
|
|
7242
7332
|
if (!levels.length) return gridEl;
|
|
7243
7333
|
let out = gridEl;
|
|
7244
7334
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
7245
7335
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
7246
|
-
out = /* @__PURE__ */
|
|
7336
|
+
out = /* @__PURE__ */ React34.createElement(
|
|
7247
7337
|
"div",
|
|
7248
7338
|
{
|
|
7249
7339
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -7252,7 +7342,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7252
7342
|
out
|
|
7253
7343
|
);
|
|
7254
7344
|
}
|
|
7255
|
-
return /* @__PURE__ */
|
|
7345
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7256
7346
|
"div",
|
|
7257
7347
|
{
|
|
7258
7348
|
ref,
|
|
@@ -7269,14 +7359,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7269
7359
|
var DataTable2 = DataTableImpl;
|
|
7270
7360
|
|
|
7271
7361
|
// src/Card.tsx
|
|
7272
|
-
var
|
|
7273
|
-
var Card =
|
|
7362
|
+
var React35 = __toESM(require("react"), 1);
|
|
7363
|
+
var Card = React35.forwardRef(function Card2(props, ref) {
|
|
7274
7364
|
return cardElement(props, ref);
|
|
7275
7365
|
});
|
|
7276
7366
|
|
|
7277
7367
|
// src/Tabs.tsx
|
|
7278
|
-
var
|
|
7279
|
-
var Tabs =
|
|
7368
|
+
var React36 = __toESM(require("react"), 1);
|
|
7369
|
+
var Tabs = React36.forwardRef(function Tabs2(props, ref) {
|
|
7280
7370
|
const items2 = props.tabs || [], base = uid();
|
|
7281
7371
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
7282
7372
|
return !!t.href;
|
|
@@ -7290,7 +7380,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7290
7380
|
props.onChange
|
|
7291
7381
|
);
|
|
7292
7382
|
const cur2 = asLinks && "value" in props ? props.value : st[0];
|
|
7293
|
-
const refs =
|
|
7383
|
+
const refs = React36.useRef({});
|
|
7294
7384
|
const current2 = items2.filter(function(t) {
|
|
7295
7385
|
return t.id === cur2;
|
|
7296
7386
|
})[0] || firstOn || items2[0];
|
|
@@ -7308,7 +7398,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7308
7398
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
7309
7399
|
};
|
|
7310
7400
|
const rootCls = cx("aura-tabs", seg && "aura-tabs--segmented", touchClass(props.touchHeight));
|
|
7311
|
-
const [focusId, setFocusId] =
|
|
7401
|
+
const [focusId, setFocusId] = React36.useState(null);
|
|
7312
7402
|
items2.forEach(function(t) {
|
|
7313
7403
|
const al = t.tabProps && t.tabProps["aria-label"];
|
|
7314
7404
|
if (al && al.toLowerCase().indexOf(String(t.label).toLowerCase()) !== 0)
|
|
@@ -7318,19 +7408,19 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7318
7408
|
);
|
|
7319
7409
|
});
|
|
7320
7410
|
if (asLinks)
|
|
7321
|
-
return /* @__PURE__ */
|
|
7411
|
+
return /* @__PURE__ */ React36.createElement(
|
|
7322
7412
|
"nav",
|
|
7323
7413
|
{
|
|
7324
7414
|
ref,
|
|
7325
7415
|
"aria-label": props.label,
|
|
7326
7416
|
className: cx(rootCls, "aura-tabs--links", props.className)
|
|
7327
7417
|
},
|
|
7328
|
-
/* @__PURE__ */
|
|
7418
|
+
/* @__PURE__ */ React36.createElement("div", { className: listCls }, items2.map(function(t) {
|
|
7329
7419
|
const on = t.id === cur2;
|
|
7330
7420
|
const inner = [
|
|
7331
|
-
t.icon ? /* @__PURE__ */
|
|
7421
|
+
t.icon ? /* @__PURE__ */ React36.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
7332
7422
|
t.label,
|
|
7333
|
-
t.count != null ? /* @__PURE__ */
|
|
7423
|
+
t.count != null ? /* @__PURE__ */ React36.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
7334
7424
|
];
|
|
7335
7425
|
const own = omit(t.tabProps || {}, [
|
|
7336
7426
|
"type",
|
|
@@ -7344,7 +7434,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7344
7434
|
"name",
|
|
7345
7435
|
"value"
|
|
7346
7436
|
]);
|
|
7347
|
-
return t.disabled ? /* @__PURE__ */
|
|
7437
|
+
return t.disabled ? /* @__PURE__ */ React36.createElement(
|
|
7348
7438
|
"span",
|
|
7349
7439
|
{
|
|
7350
7440
|
...omit(own, ["onClick"]),
|
|
@@ -7353,7 +7443,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7353
7443
|
"aria-disabled": true
|
|
7354
7444
|
},
|
|
7355
7445
|
inner
|
|
7356
|
-
) : /* @__PURE__ */
|
|
7446
|
+
) : /* @__PURE__ */ React36.createElement(
|
|
7357
7447
|
Link,
|
|
7358
7448
|
{
|
|
7359
7449
|
...own,
|
|
@@ -7383,7 +7473,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7383
7473
|
const stop2 = manual && focusId && items2.filter(function(t) {
|
|
7384
7474
|
return t.id === focusId && !t.disabled;
|
|
7385
7475
|
})[0] || current2;
|
|
7386
|
-
return /* @__PURE__ */
|
|
7476
|
+
return /* @__PURE__ */ React36.createElement("div", { ref, className: cx(rootCls, props.className) }, /* @__PURE__ */ React36.createElement(
|
|
7387
7477
|
"div",
|
|
7388
7478
|
{
|
|
7389
7479
|
role: "tablist",
|
|
@@ -7416,7 +7506,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7416
7506
|
items2.map(function(t) {
|
|
7417
7507
|
const on = current2 && t.id === current2.id;
|
|
7418
7508
|
const own = t.tabProps || {};
|
|
7419
|
-
return /* @__PURE__ */
|
|
7509
|
+
return /* @__PURE__ */ React36.createElement(
|
|
7420
7510
|
"button",
|
|
7421
7511
|
{
|
|
7422
7512
|
...own,
|
|
@@ -7443,9 +7533,9 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7443
7533
|
st[1](t.id);
|
|
7444
7534
|
}
|
|
7445
7535
|
},
|
|
7446
|
-
t.icon ? /* @__PURE__ */
|
|
7536
|
+
t.icon ? /* @__PURE__ */ React36.createElement(Icon, { name: t.icon }) : null,
|
|
7447
7537
|
t.label,
|
|
7448
|
-
t.count != null ? /* @__PURE__ */
|
|
7538
|
+
t.count != null ? /* @__PURE__ */ React36.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
7449
7539
|
);
|
|
7450
7540
|
})
|
|
7451
7541
|
), props.keepMounted ? (
|
|
@@ -7453,7 +7543,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7453
7543
|
items2.map(function(t) {
|
|
7454
7544
|
if (t.content === void 0) return null;
|
|
7455
7545
|
const on = current2 && t.id === current2.id;
|
|
7456
|
-
return /* @__PURE__ */
|
|
7546
|
+
return /* @__PURE__ */ React36.createElement(
|
|
7457
7547
|
"div",
|
|
7458
7548
|
{
|
|
7459
7549
|
key: t.id,
|
|
@@ -7467,7 +7557,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7467
7557
|
t.content
|
|
7468
7558
|
);
|
|
7469
7559
|
})
|
|
7470
|
-
) : current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
7560
|
+
) : current2 && current2.content !== void 0 ? /* @__PURE__ */ React36.createElement(
|
|
7471
7561
|
"div",
|
|
7472
7562
|
{
|
|
7473
7563
|
role: "tabpanel",
|
|
@@ -7481,14 +7571,14 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7481
7571
|
});
|
|
7482
7572
|
|
|
7483
7573
|
// src/SideNav.tsx
|
|
7484
|
-
var
|
|
7574
|
+
var React37 = __toESM(require("react"), 1);
|
|
7485
7575
|
var import_react_dom11 = require("react-dom");
|
|
7486
7576
|
function contains(it, id) {
|
|
7487
7577
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
7488
7578
|
return c.id === id || contains(c, id);
|
|
7489
7579
|
});
|
|
7490
7580
|
}
|
|
7491
|
-
var SideNav =
|
|
7581
|
+
var SideNav = React37.forwardRef(function SideNav2(props, ref) {
|
|
7492
7582
|
const t = useStrings();
|
|
7493
7583
|
const Link = useLinkComponent(props.linkComponent);
|
|
7494
7584
|
const base = uid();
|
|
@@ -7500,14 +7590,14 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7500
7590
|
const active = st[0];
|
|
7501
7591
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
7502
7592
|
const collapsed = col[0];
|
|
7503
|
-
const tipState =
|
|
7504
|
-
|
|
7593
|
+
const tipState = React37.useState(null), tip2 = tipState[0], setTip = tipState[1];
|
|
7594
|
+
React37.useEffect(
|
|
7505
7595
|
function() {
|
|
7506
7596
|
if (!collapsed) setTip(null);
|
|
7507
7597
|
},
|
|
7508
7598
|
[collapsed]
|
|
7509
7599
|
);
|
|
7510
|
-
|
|
7600
|
+
React37.useEffect(
|
|
7511
7601
|
function() {
|
|
7512
7602
|
if (!tip2) return;
|
|
7513
7603
|
function esc(e) {
|
|
@@ -7532,12 +7622,12 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7532
7622
|
return { onMouseEnter: show3, onFocus: show3, onMouseLeave: hide2, onBlur: hide2 };
|
|
7533
7623
|
}
|
|
7534
7624
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
7535
|
-
const openState =
|
|
7625
|
+
const openState = React37.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
7536
7626
|
function isOpen(it) {
|
|
7537
7627
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
7538
7628
|
return !!it.defaultOpen || contains(it, active);
|
|
7539
7629
|
}
|
|
7540
|
-
|
|
7630
|
+
React37.useEffect(
|
|
7541
7631
|
function() {
|
|
7542
7632
|
if (!active) return;
|
|
7543
7633
|
const next = {};
|
|
@@ -7559,7 +7649,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7559
7649
|
},
|
|
7560
7650
|
[active]
|
|
7561
7651
|
);
|
|
7562
|
-
const navRef =
|
|
7652
|
+
const navRef = React37.useRef(null);
|
|
7563
7653
|
function onKeyDown(e) {
|
|
7564
7654
|
const k = e.key;
|
|
7565
7655
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -7578,12 +7668,12 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7578
7668
|
function inner(it, group, open) {
|
|
7579
7669
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
7580
7670
|
return [
|
|
7581
|
-
it.icon ? /* @__PURE__ */
|
|
7582
|
-
collapsed && marked ? /* @__PURE__ */
|
|
7583
|
-
/* @__PURE__ */
|
|
7584
|
-
it.badge != null ? /* @__PURE__ */
|
|
7585
|
-
it.count != null ? /* @__PURE__ */
|
|
7586
|
-
group ? /* @__PURE__ */
|
|
7671
|
+
it.icon ? /* @__PURE__ */ React37.createElement(Icon, { key: "i", name: it.icon }) : collapsed ? /* @__PURE__ */ React37.createElement("span", { key: "i", className: "aura-nav__initial", "aria-hidden": "true" }, it.label.charAt(0)) : null,
|
|
7672
|
+
collapsed && marked ? /* @__PURE__ */ React37.createElement("span", { key: "d", className: "aura-nav__dot", "aria-hidden": "true" }) : null,
|
|
7673
|
+
/* @__PURE__ */ React37.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
|
|
7674
|
+
it.badge != null ? /* @__PURE__ */ React37.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
|
|
7675
|
+
it.count != null ? /* @__PURE__ */ React37.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
|
|
7676
|
+
group ? /* @__PURE__ */ React37.createElement(Icon, { key: "g", name: /* @__PURE__ */ React37.createElement(IconChevronDown, null), className: cx("aura-nav__chevron", open && "is-open") }) : null
|
|
7587
7677
|
];
|
|
7588
7678
|
}
|
|
7589
7679
|
function item(it, depth) {
|
|
@@ -7591,7 +7681,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7591
7681
|
const open = !collapsed && isOpen(it);
|
|
7592
7682
|
const listId = base + "-" + it.id;
|
|
7593
7683
|
const holdsActive = contains(it, active);
|
|
7594
|
-
return /* @__PURE__ */
|
|
7684
|
+
return /* @__PURE__ */ React37.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React37.createElement(
|
|
7595
7685
|
"button",
|
|
7596
7686
|
{
|
|
7597
7687
|
type: "button",
|
|
@@ -7620,7 +7710,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7620
7710
|
}
|
|
7621
7711
|
},
|
|
7622
7712
|
inner(it, true, open)
|
|
7623
|
-
), /* @__PURE__ */
|
|
7713
|
+
), /* @__PURE__ */ React37.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
7624
7714
|
return item(c, depth + 1);
|
|
7625
7715
|
})));
|
|
7626
7716
|
}
|
|
@@ -7639,9 +7729,9 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7639
7729
|
if (action && props.onAction) props.onAction(it.id);
|
|
7640
7730
|
}
|
|
7641
7731
|
};
|
|
7642
|
-
return /* @__PURE__ */
|
|
7732
|
+
return /* @__PURE__ */ React37.createElement("li", { key: it.id }, it.href ? /* @__PURE__ */ React37.createElement(Link, { href: it.href, ...common }, inner(it, false, false)) : /* @__PURE__ */ React37.createElement("button", { type: "button", ...common }, inner(it, false, false)));
|
|
7643
7733
|
}
|
|
7644
|
-
return /* @__PURE__ */
|
|
7734
|
+
return /* @__PURE__ */ React37.createElement(
|
|
7645
7735
|
"nav",
|
|
7646
7736
|
{
|
|
7647
7737
|
ref: function(el) {
|
|
@@ -7661,14 +7751,14 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7661
7751
|
"aria-label": props.label || t.mainNav,
|
|
7662
7752
|
onKeyDown
|
|
7663
7753
|
},
|
|
7664
|
-
props.header ? /* @__PURE__ */
|
|
7665
|
-
/* @__PURE__ */
|
|
7666
|
-
return /* @__PURE__ */
|
|
7754
|
+
props.header ? /* @__PURE__ */ React37.createElement("div", { className: "aura-nav__header" }, props.header) : null,
|
|
7755
|
+
/* @__PURE__ */ React37.createElement("div", { className: "aura-nav__scroll" }, sections.map(function(s, i) {
|
|
7756
|
+
return /* @__PURE__ */ React37.createElement("div", { key: i, className: "aura-nav__section" }, s.title ? /* @__PURE__ */ React37.createElement("p", { className: "aura-nav__title" }, s.title) : null, /* @__PURE__ */ React37.createElement("ul", { className: "aura-nav__list" }, s.items.map(function(it) {
|
|
7667
7757
|
return item(it, 0);
|
|
7668
7758
|
})));
|
|
7669
7759
|
})),
|
|
7670
|
-
props.footer ? /* @__PURE__ */
|
|
7671
|
-
props.collapsible && props.collapseToggle === "row" ? /* @__PURE__ */
|
|
7760
|
+
props.footer ? /* @__PURE__ */ React37.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
|
|
7761
|
+
props.collapsible && props.collapseToggle === "row" ? /* @__PURE__ */ React37.createElement("div", { className: "aura-nav__toggle aura-nav__toggle--row" }, /* @__PURE__ */ React37.createElement(
|
|
7672
7762
|
"button",
|
|
7673
7763
|
{
|
|
7674
7764
|
type: "button",
|
|
@@ -7679,12 +7769,12 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7679
7769
|
col[1](!collapsed);
|
|
7680
7770
|
}
|
|
7681
7771
|
},
|
|
7682
|
-
/* @__PURE__ */
|
|
7683
|
-
/* @__PURE__ */
|
|
7684
|
-
)) : props.collapsible ? /* @__PURE__ */
|
|
7772
|
+
/* @__PURE__ */ React37.createElement(Icon, { name: collapsed ? /* @__PURE__ */ React37.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React37.createElement(IconPanelLeftClose, null) }),
|
|
7773
|
+
/* @__PURE__ */ React37.createElement("span", { className: "aura-nav__label" }, collapsed ? t.expandNav : t.collapseNav)
|
|
7774
|
+
)) : props.collapsible ? /* @__PURE__ */ React37.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React37.createElement(
|
|
7685
7775
|
IconButton,
|
|
7686
7776
|
{
|
|
7687
|
-
icon: collapsed ? /* @__PURE__ */
|
|
7777
|
+
icon: collapsed ? /* @__PURE__ */ React37.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React37.createElement(IconPanelLeftClose, null),
|
|
7688
7778
|
label: collapsed ? t.expandNav : t.collapseNav,
|
|
7689
7779
|
size: "md",
|
|
7690
7780
|
onClick: function() {
|
|
@@ -7694,7 +7784,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7694
7784
|
}
|
|
7695
7785
|
)) : null,
|
|
7696
7786
|
tip2 && typeof document !== "undefined" ? (0, import_react_dom11.createPortal)(
|
|
7697
|
-
/* @__PURE__ */
|
|
7787
|
+
/* @__PURE__ */ React37.createElement(
|
|
7698
7788
|
"div",
|
|
7699
7789
|
{
|
|
7700
7790
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -7709,8 +7799,8 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7709
7799
|
});
|
|
7710
7800
|
|
|
7711
7801
|
// src/Breadcrumb.tsx
|
|
7712
|
-
var
|
|
7713
|
-
var Breadcrumb =
|
|
7802
|
+
var React38 = __toESM(require("react"), 1);
|
|
7803
|
+
var Breadcrumb = React38.forwardRef(function Breadcrumb2(props, ref) {
|
|
7714
7804
|
const t = useStrings();
|
|
7715
7805
|
const Link = useLinkComponent(props.linkComponent);
|
|
7716
7806
|
const items2 = props.items || [];
|
|
@@ -7718,12 +7808,12 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7718
7808
|
const trail = items2.map(function(it) {
|
|
7719
7809
|
return it.label + "" + (it.href || "");
|
|
7720
7810
|
}).join("");
|
|
7721
|
-
const st =
|
|
7811
|
+
const st = React38.useState(null), expanded = st[0] === trail, setExpanded = function() {
|
|
7722
7812
|
st[1](trail);
|
|
7723
7813
|
};
|
|
7724
|
-
const listRef =
|
|
7725
|
-
const focusNext =
|
|
7726
|
-
|
|
7814
|
+
const listRef = React38.useRef(null);
|
|
7815
|
+
const focusNext = React38.useRef(false);
|
|
7816
|
+
React38.useEffect(
|
|
7727
7817
|
function() {
|
|
7728
7818
|
if (!expanded || !focusNext.current) return;
|
|
7729
7819
|
focusNext.current = false;
|
|
@@ -7738,8 +7828,8 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7738
7828
|
},
|
|
7739
7829
|
[expanded]
|
|
7740
7830
|
);
|
|
7741
|
-
const sep = /* @__PURE__ */
|
|
7742
|
-
const more = collapsible && !expanded ? /* @__PURE__ */
|
|
7831
|
+
const sep = /* @__PURE__ */ React38.createElement(Icon, { name: /* @__PURE__ */ React38.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" });
|
|
7832
|
+
const more = collapsible && !expanded ? /* @__PURE__ */ React38.createElement("li", { key: "more", className: "aura-crumbs__more" }, /* @__PURE__ */ React38.createElement(
|
|
7743
7833
|
"button",
|
|
7744
7834
|
{
|
|
7745
7835
|
type: "button",
|
|
@@ -7762,23 +7852,23 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7762
7852
|
if (it.onClick) it.onClick();
|
|
7763
7853
|
} : void 0;
|
|
7764
7854
|
out.push(
|
|
7765
|
-
/* @__PURE__ */
|
|
7855
|
+
/* @__PURE__ */ React38.createElement(
|
|
7766
7856
|
"li",
|
|
7767
7857
|
{
|
|
7768
7858
|
key: i,
|
|
7769
7859
|
...it.itemProps,
|
|
7770
7860
|
className: cx(it.itemProps && it.itemProps.className, collapsible && !last && i > 0 && "aura-crumbs__middle") || void 0
|
|
7771
7861
|
},
|
|
7772
|
-
last ? /* @__PURE__ */
|
|
7862
|
+
last ? /* @__PURE__ */ React38.createElement("span", { ...plain, "aria-current": "page", className: cx("aura-crumbs__current", lp.className) }, it.label) : it.href ? /* @__PURE__ */ React38.createElement(Link, { ...lp, href: it.href, onClick: click }, it.label) : it.onClick ? /* @__PURE__ */ React38.createElement("button", { ...lp, type: "button", onClick: click }, it.label) : (
|
|
7773
7863
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
7774
|
-
/* @__PURE__ */
|
|
7864
|
+
/* @__PURE__ */ React38.createElement("span", { ...plain, className: cx("aura-crumbs__text", lp.className) }, it.label)
|
|
7775
7865
|
),
|
|
7776
7866
|
last ? null : sep
|
|
7777
7867
|
)
|
|
7778
7868
|
);
|
|
7779
7869
|
if (i === 0 && more) out.push(more);
|
|
7780
7870
|
});
|
|
7781
|
-
return /* @__PURE__ */
|
|
7871
|
+
return /* @__PURE__ */ React38.createElement(
|
|
7782
7872
|
"nav",
|
|
7783
7873
|
{
|
|
7784
7874
|
ref,
|
|
@@ -7789,27 +7879,27 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7789
7879
|
props.className
|
|
7790
7880
|
)
|
|
7791
7881
|
},
|
|
7792
|
-
/* @__PURE__ */
|
|
7882
|
+
/* @__PURE__ */ React38.createElement("ol", { ref: listRef }, out)
|
|
7793
7883
|
);
|
|
7794
7884
|
});
|
|
7795
7885
|
|
|
7796
7886
|
// src/Avatar.tsx
|
|
7797
|
-
var
|
|
7798
|
-
var Avatar =
|
|
7799
|
-
const errState =
|
|
7887
|
+
var React39 = __toESM(require("react"), 1);
|
|
7888
|
+
var Avatar = React39.forwardRef(function Avatar2(props, ref) {
|
|
7889
|
+
const errState = React39.useState(null);
|
|
7800
7890
|
return avatarElement(props, ref, errState[0], function() {
|
|
7801
7891
|
errState[1](props.src || null);
|
|
7802
7892
|
});
|
|
7803
7893
|
});
|
|
7804
7894
|
|
|
7805
7895
|
// src/Stack.tsx
|
|
7806
|
-
var
|
|
7896
|
+
var React41 = __toESM(require("react"), 1);
|
|
7807
7897
|
|
|
7808
7898
|
// src/responsive.tsx
|
|
7809
|
-
var
|
|
7899
|
+
var React40 = __toESM(require("react"), 1);
|
|
7810
7900
|
var ORDER2 = ["base", "sm", "md", "lg", "xl"];
|
|
7811
7901
|
function useBreakpoint() {
|
|
7812
|
-
return
|
|
7902
|
+
return React40.useSyncExternalStore(subscribe, current, function() {
|
|
7813
7903
|
return "lg";
|
|
7814
7904
|
});
|
|
7815
7905
|
}
|
|
@@ -7835,8 +7925,8 @@ function useResponsive(value) {
|
|
|
7835
7925
|
}
|
|
7836
7926
|
|
|
7837
7927
|
// src/Stack.tsx
|
|
7838
|
-
var h5 =
|
|
7839
|
-
var Stack =
|
|
7928
|
+
var h5 = React41.createElement;
|
|
7929
|
+
var Stack = React41.forwardRef(function Stack2(props, ref) {
|
|
7840
7930
|
const style = Object.assign(
|
|
7841
7931
|
{},
|
|
7842
7932
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -7850,9 +7940,9 @@ var Stack = React40.forwardRef(function Stack2(props, ref) {
|
|
|
7850
7940
|
});
|
|
7851
7941
|
|
|
7852
7942
|
// src/Grid.tsx
|
|
7853
|
-
var
|
|
7854
|
-
var h6 =
|
|
7855
|
-
var Grid =
|
|
7943
|
+
var React42 = __toESM(require("react"), 1);
|
|
7944
|
+
var h6 = React42.createElement;
|
|
7945
|
+
var Grid = React42.forwardRef(function Grid2(props, ref) {
|
|
7856
7946
|
const style = Object.assign(
|
|
7857
7947
|
{},
|
|
7858
7948
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -7867,9 +7957,9 @@ var Grid = React41.forwardRef(function Grid2(props, ref) {
|
|
|
7867
7957
|
});
|
|
7868
7958
|
|
|
7869
7959
|
// src/Container.tsx
|
|
7870
|
-
var
|
|
7871
|
-
var h7 =
|
|
7872
|
-
var Container =
|
|
7960
|
+
var React43 = __toESM(require("react"), 1);
|
|
7961
|
+
var h7 = React43.createElement;
|
|
7962
|
+
var Container = React43.forwardRef(function Container2(props, ref) {
|
|
7873
7963
|
const attrs2 = {};
|
|
7874
7964
|
Object.keys(props).forEach(function(k) {
|
|
7875
7965
|
if (k === "id" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
@@ -7892,11 +7982,11 @@ var Container = React42.forwardRef(function Container2(props, ref) {
|
|
|
7892
7982
|
});
|
|
7893
7983
|
|
|
7894
7984
|
// src/PageHeaderClient.tsx
|
|
7895
|
-
var
|
|
7985
|
+
var React45 = __toESM(require("react"), 1);
|
|
7896
7986
|
|
|
7897
7987
|
// src/PageHeader.tsx
|
|
7898
|
-
var
|
|
7899
|
-
var h8 =
|
|
7988
|
+
var React44 = __toESM(require("react"), 1);
|
|
7989
|
+
var h8 = React44.createElement;
|
|
7900
7990
|
var LAZY = Symbol.for("react.lazy");
|
|
7901
7991
|
function chipsOnly(node) {
|
|
7902
7992
|
let el = 0;
|
|
@@ -7915,8 +8005,8 @@ function chipsOnly(node) {
|
|
|
7915
8005
|
}
|
|
7916
8006
|
return walk(value);
|
|
7917
8007
|
}
|
|
7918
|
-
if (
|
|
7919
|
-
if (n3.type ===
|
|
8008
|
+
if (React44.isValidElement(n3)) {
|
|
8009
|
+
if (n3.type === React44.Fragment) return walk(n3.props.children);
|
|
7920
8010
|
el++;
|
|
7921
8011
|
return true;
|
|
7922
8012
|
}
|
|
@@ -7924,7 +8014,7 @@ function chipsOnly(node) {
|
|
|
7924
8014
|
};
|
|
7925
8015
|
return walk(node) && el > 0;
|
|
7926
8016
|
}
|
|
7927
|
-
var PageHeader =
|
|
8017
|
+
var PageHeader = React44.forwardRef(function PageHeader2(props, ref) {
|
|
7928
8018
|
const attrs2 = {};
|
|
7929
8019
|
Object.keys(props).forEach(function(k) {
|
|
7930
8020
|
if (k === "id" || k === "lang" || k === "dir" || k === "role" || /^(aria|data)-/.test(k))
|
|
@@ -8004,12 +8094,12 @@ function trapped(el) {
|
|
|
8004
8094
|
}
|
|
8005
8095
|
return false;
|
|
8006
8096
|
}
|
|
8007
|
-
var PageHeader3 =
|
|
8008
|
-
const own =
|
|
8097
|
+
var PageHeader3 = React45.forwardRef(function PageHeader4(props, ref) {
|
|
8098
|
+
const own = React45.useRef(null);
|
|
8009
8099
|
const merged = useMergedRef(ref, own);
|
|
8010
8100
|
const bar = props.actionsBarBelow;
|
|
8011
8101
|
const hasActions = props.actions != null && props.actions !== false;
|
|
8012
|
-
|
|
8102
|
+
React45.useEffect(
|
|
8013
8103
|
function() {
|
|
8014
8104
|
if (bar !== "sm" && bar !== "md" || !hasActions || !own.current) return;
|
|
8015
8105
|
const el = own.current.querySelector(":scope > .aura-page-header__actions");
|
|
@@ -8048,20 +8138,20 @@ var PageHeader3 = React44.forwardRef(function PageHeader4(props, ref) {
|
|
|
8048
8138
|
[bar, hasActions]
|
|
8049
8139
|
);
|
|
8050
8140
|
const focusTitle = !!props.focusTitleOnMount;
|
|
8051
|
-
|
|
8141
|
+
React45.useEffect(function() {
|
|
8052
8142
|
if (!focusTitle || !own.current) return;
|
|
8053
8143
|
const t = own.current.querySelector(".aura-page-header__title");
|
|
8054
8144
|
if (t) t.focus({ preventScroll: true });
|
|
8055
8145
|
}, []);
|
|
8056
|
-
return /* @__PURE__ */
|
|
8146
|
+
return /* @__PURE__ */ React45.createElement(PageHeader, { ...props, ref: merged });
|
|
8057
8147
|
});
|
|
8058
8148
|
|
|
8059
8149
|
// src/StatusTile.tsx
|
|
8060
|
-
var
|
|
8150
|
+
var React47 = __toESM(require("react"), 1);
|
|
8061
8151
|
|
|
8062
8152
|
// src/tiles.tsx
|
|
8063
|
-
var
|
|
8064
|
-
var h9 =
|
|
8153
|
+
var React46 = __toESM(require("react"), 1);
|
|
8154
|
+
var h9 = React46.createElement;
|
|
8065
8155
|
var STATUS_ICON = {
|
|
8066
8156
|
down: IconCircleAlert,
|
|
8067
8157
|
problem: IconTriangleAlert,
|
|
@@ -8153,7 +8243,7 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
8153
8243
|
) : null
|
|
8154
8244
|
);
|
|
8155
8245
|
}
|
|
8156
|
-
var TileGrid =
|
|
8246
|
+
var TileGrid = React46.forwardRef(function TileGrid2(props, ref) {
|
|
8157
8247
|
const style = Object.assign(
|
|
8158
8248
|
{},
|
|
8159
8249
|
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
@@ -8169,16 +8259,16 @@ var TileGrid = React45.forwardRef(function TileGrid2(props, ref) {
|
|
|
8169
8259
|
}),
|
|
8170
8260
|
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
8171
8261
|
flat(props.children).map(function(c, i) {
|
|
8172
|
-
return h9("li", { key:
|
|
8262
|
+
return h9("li", { key: React46.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
8173
8263
|
})
|
|
8174
8264
|
);
|
|
8175
8265
|
});
|
|
8176
8266
|
function flat(children) {
|
|
8177
8267
|
const out = [];
|
|
8178
|
-
|
|
8179
|
-
if (
|
|
8268
|
+
React46.Children.toArray(children).forEach(function(c) {
|
|
8269
|
+
if (React46.isValidElement(c) && c.type === React46.Fragment)
|
|
8180
8270
|
flat(c.props.children).forEach(function(x) {
|
|
8181
|
-
out.push(
|
|
8271
|
+
out.push(React46.isValidElement(x) ? React46.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
8182
8272
|
});
|
|
8183
8273
|
else if (c !== "") out.push(c);
|
|
8184
8274
|
});
|
|
@@ -8192,7 +8282,7 @@ function r(n3) {
|
|
|
8192
8282
|
function num(v) {
|
|
8193
8283
|
return typeof v === "number" && isFinite(v) ? v : null;
|
|
8194
8284
|
}
|
|
8195
|
-
var Sparkline =
|
|
8285
|
+
var Sparkline = React46.forwardRef(function Sparkline2(props, ref) {
|
|
8196
8286
|
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
8197
8287
|
const W = wh[0], H = wh[1];
|
|
8198
8288
|
const data = (props.data || []).map(num);
|
|
@@ -8266,8 +8356,8 @@ var Sparkline = React45.forwardRef(function Sparkline2(props, ref) {
|
|
|
8266
8356
|
});
|
|
8267
8357
|
|
|
8268
8358
|
// src/StatusTile.tsx
|
|
8269
|
-
var useIsoLayoutEffect2 = typeof window !== "undefined" ?
|
|
8270
|
-
var StatusTile =
|
|
8359
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React47.useLayoutEffect : React47.useEffect;
|
|
8360
|
+
var StatusTile = React47.forwardRef(function StatusTile2(props, ref) {
|
|
8271
8361
|
const Link = useLinkComponent(props.linkComponent);
|
|
8272
8362
|
const t = useStrings();
|
|
8273
8363
|
useAutoTip();
|
|
@@ -8276,8 +8366,8 @@ var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
|
8276
8366
|
"status-tile-label",
|
|
8277
8367
|
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
8278
8368
|
);
|
|
8279
|
-
const titleRef =
|
|
8280
|
-
const check =
|
|
8369
|
+
const titleRef = React47.useRef(null);
|
|
8370
|
+
const check = React47.useCallback(function() {
|
|
8281
8371
|
const el = titleRef.current;
|
|
8282
8372
|
if (!el) return;
|
|
8283
8373
|
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
@@ -8287,7 +8377,7 @@ var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
|
8287
8377
|
}, []);
|
|
8288
8378
|
useIsoLayoutEffect2(check, [props.title, check]);
|
|
8289
8379
|
const linked = !!props.href;
|
|
8290
|
-
|
|
8380
|
+
React47.useEffect(
|
|
8291
8381
|
function() {
|
|
8292
8382
|
const el = titleRef.current;
|
|
8293
8383
|
if (!el) return;
|
|
@@ -8312,14 +8402,14 @@ var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
|
8312
8402
|
});
|
|
8313
8403
|
|
|
8314
8404
|
// src/AppShell.tsx
|
|
8315
|
-
var
|
|
8405
|
+
var React49 = __toESM(require("react"), 1);
|
|
8316
8406
|
|
|
8317
8407
|
// src/scrollHide.ts
|
|
8318
|
-
var
|
|
8408
|
+
var React48 = __toESM(require("react"), 1);
|
|
8319
8409
|
var STEP = 8;
|
|
8320
8410
|
function useHideOnScroll(enabled, el, media, from) {
|
|
8321
|
-
const st =
|
|
8322
|
-
|
|
8411
|
+
const st = React48.useState(false), hidden = st[0], setHidden = st[1];
|
|
8412
|
+
React48.useEffect(
|
|
8323
8413
|
function() {
|
|
8324
8414
|
if (!enabled || typeof window === "undefined") {
|
|
8325
8415
|
setHidden(false);
|
|
@@ -8412,32 +8502,32 @@ function useHideOnScroll(enabled, el, media, from) {
|
|
|
8412
8502
|
function pinned(bar) {
|
|
8413
8503
|
return getComputedStyle(bar).position !== "static";
|
|
8414
8504
|
}
|
|
8415
|
-
var AppShell =
|
|
8505
|
+
var AppShell = React49.forwardRef(function AppShell2(props, ref) {
|
|
8416
8506
|
const t = useStrings();
|
|
8417
8507
|
const bp = useBreakpoint();
|
|
8418
8508
|
const wide = bp === "lg" || bp === "xl";
|
|
8419
|
-
const st =
|
|
8420
|
-
|
|
8509
|
+
const st = React49.useState(false), open = st[0], setOpen = st[1];
|
|
8510
|
+
React49.useEffect(
|
|
8421
8511
|
function() {
|
|
8422
8512
|
if (wide) setOpen(false);
|
|
8423
8513
|
},
|
|
8424
8514
|
[wide]
|
|
8425
8515
|
);
|
|
8426
|
-
const navEl = props.nav &&
|
|
8516
|
+
const navEl = props.nav && React49.isValidElement(props.nav) ? props.nav : null;
|
|
8427
8517
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
8428
|
-
const navState =
|
|
8518
|
+
const navState = React49.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
8429
8519
|
function onNav(id) {
|
|
8430
8520
|
if (shared) navState[1](id);
|
|
8431
8521
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
8432
8522
|
}
|
|
8433
|
-
const rootRef =
|
|
8434
|
-
const barRef =
|
|
8435
|
-
const probeRef =
|
|
8523
|
+
const rootRef = React49.useRef(null);
|
|
8524
|
+
const barRef = React49.useRef(null);
|
|
8525
|
+
const probeRef = React49.useRef(null);
|
|
8436
8526
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
8437
8527
|
const hasBar = !!(props.header || props.nav);
|
|
8438
|
-
const barH =
|
|
8528
|
+
const barH = React49.useState(null);
|
|
8439
8529
|
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8440
|
-
const awayRef =
|
|
8530
|
+
const awayRef = React49.useRef(away);
|
|
8441
8531
|
awayRef.current = away;
|
|
8442
8532
|
useIsoLayoutEffect(
|
|
8443
8533
|
function() {
|
|
@@ -8472,8 +8562,8 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8472
8562
|
},
|
|
8473
8563
|
[hasBar]
|
|
8474
8564
|
);
|
|
8475
|
-
const deskNav = navEl && shared ?
|
|
8476
|
-
const drawerNav = navEl ?
|
|
8565
|
+
const deskNav = navEl && shared ? React49.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
8566
|
+
const drawerNav = navEl ? React49.cloneElement(navEl, {
|
|
8477
8567
|
value: shared ? navState[0] : navEl.props.value,
|
|
8478
8568
|
onChange: function(id) {
|
|
8479
8569
|
onNav(id);
|
|
@@ -8488,7 +8578,7 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8488
8578
|
collapsed: false,
|
|
8489
8579
|
collapsible: false
|
|
8490
8580
|
}) : props.nav;
|
|
8491
|
-
return /* @__PURE__ */
|
|
8581
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8492
8582
|
"div",
|
|
8493
8583
|
{
|
|
8494
8584
|
ref: mergedRef,
|
|
@@ -8503,8 +8593,8 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8503
8593
|
props.className
|
|
8504
8594
|
)
|
|
8505
8595
|
},
|
|
8506
|
-
props.nav ? /* @__PURE__ */
|
|
8507
|
-
props.nav ? /* @__PURE__ */
|
|
8596
|
+
props.nav ? /* @__PURE__ */ React49.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8597
|
+
props.nav ? /* @__PURE__ */ React49.createElement(
|
|
8508
8598
|
Drawer,
|
|
8509
8599
|
{
|
|
8510
8600
|
open,
|
|
@@ -8521,7 +8611,7 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8521
8611
|
},
|
|
8522
8612
|
drawerNav
|
|
8523
8613
|
) : null,
|
|
8524
|
-
/* @__PURE__ */
|
|
8614
|
+
/* @__PURE__ */ React49.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React49.createElement(
|
|
8525
8615
|
"header",
|
|
8526
8616
|
{
|
|
8527
8617
|
ref: barRef,
|
|
@@ -8533,11 +8623,11 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8533
8623
|
away && "is-away"
|
|
8534
8624
|
)
|
|
8535
8625
|
},
|
|
8536
|
-
props.nav ? /* @__PURE__ */
|
|
8626
|
+
props.nav ? /* @__PURE__ */ React49.createElement(
|
|
8537
8627
|
IconButton,
|
|
8538
8628
|
{
|
|
8539
8629
|
className: "aura-shell__menu",
|
|
8540
|
-
icon: /* @__PURE__ */
|
|
8630
|
+
icon: /* @__PURE__ */ React49.createElement(IconMenu, null),
|
|
8541
8631
|
label: props.menuLabel || t.openNav,
|
|
8542
8632
|
size: "md",
|
|
8543
8633
|
touchHeight: true,
|
|
@@ -8547,9 +8637,9 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8547
8637
|
"aria-expanded": open
|
|
8548
8638
|
}
|
|
8549
8639
|
) : null,
|
|
8550
|
-
/* @__PURE__ */
|
|
8551
|
-
/* @__PURE__ */
|
|
8552
|
-
) : null, /* @__PURE__ */
|
|
8640
|
+
/* @__PURE__ */ React49.createElement("div", { className: "aura-shell__bar-content" }, props.header),
|
|
8641
|
+
/* @__PURE__ */ React49.createElement("span", { className: "aura-shell__probe", "aria-hidden": "true", ref: probeRef })
|
|
8642
|
+
) : null, /* @__PURE__ */ React49.createElement(
|
|
8553
8643
|
"main",
|
|
8554
8644
|
{
|
|
8555
8645
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -8562,17 +8652,17 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8562
8652
|
});
|
|
8563
8653
|
|
|
8564
8654
|
// src/ActionBar.tsx
|
|
8565
|
-
var
|
|
8566
|
-
var ActionBar =
|
|
8655
|
+
var React50 = __toESM(require("react"), 1);
|
|
8656
|
+
var ActionBar = React50.forwardRef(function ActionBar2(props, ref) {
|
|
8567
8657
|
const t = useStrings();
|
|
8568
8658
|
const bulk = props.selected != null;
|
|
8569
8659
|
const idle = bulk && !props.selected;
|
|
8570
8660
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
8571
|
-
const hasStart =
|
|
8661
|
+
const hasStart = React50.Children.toArray(props.start).some(function(c) {
|
|
8572
8662
|
return c !== "";
|
|
8573
8663
|
});
|
|
8574
|
-
const cameFrom =
|
|
8575
|
-
const own =
|
|
8664
|
+
const cameFrom = React50.useRef(null);
|
|
8665
|
+
const own = React50.useRef(null);
|
|
8576
8666
|
function clear() {
|
|
8577
8667
|
props.onClearSelection();
|
|
8578
8668
|
setTimeout(function() {
|
|
@@ -8581,7 +8671,7 @@ var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
|
8581
8671
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
8582
8672
|
}, 0);
|
|
8583
8673
|
}
|
|
8584
|
-
return /* @__PURE__ */
|
|
8674
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8585
8675
|
"div",
|
|
8586
8676
|
{
|
|
8587
8677
|
ref: function(el) {
|
|
@@ -8603,16 +8693,16 @@ var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
|
8603
8693
|
props.className
|
|
8604
8694
|
)
|
|
8605
8695
|
},
|
|
8606
|
-
/* @__PURE__ */
|
|
8696
|
+
/* @__PURE__ */ React50.createElement("div", { className: cx("aura-actionbar__inner", hasStart && "has-start") }, /* @__PURE__ */ React50.createElement("div", { className: "aura-actionbar__status", role: "status" }, count, count && props.status ? " \xB7 " : null, props.status), !idle && hasStart ? /* @__PURE__ */ React50.createElement("div", { className: "aura-actionbar__start" }, props.start) : null, !idle ? /* @__PURE__ */ React50.createElement("div", { className: "aura-actionbar__actions" }, count && props.onClearSelection ? /* @__PURE__ */ React50.createElement(Button, { variant: "ghost", size: "sm", touchHeight: props.touchHeight, onClick: clear }, t.clear()) : null, props.children) : null)
|
|
8607
8697
|
);
|
|
8608
8698
|
});
|
|
8609
8699
|
|
|
8610
8700
|
// src/Separator.tsx
|
|
8611
|
-
var
|
|
8612
|
-
var Separator =
|
|
8701
|
+
var React51 = __toESM(require("react"), 1);
|
|
8702
|
+
var Separator = React51.forwardRef(function Separator2(props, ref) {
|
|
8613
8703
|
const vertical = props.orientation === "vertical";
|
|
8614
8704
|
const decorative = props.decorative !== false;
|
|
8615
|
-
return /* @__PURE__ */
|
|
8705
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8616
8706
|
"div",
|
|
8617
8707
|
{
|
|
8618
8708
|
ref,
|
|
@@ -8625,13 +8715,13 @@ var Separator = React50.forwardRef(function Separator2(props, ref) {
|
|
|
8625
8715
|
});
|
|
8626
8716
|
|
|
8627
8717
|
// src/Table.tsx
|
|
8628
|
-
var
|
|
8718
|
+
var React53 = __toESM(require("react"), 1);
|
|
8629
8719
|
|
|
8630
8720
|
// src/TableSkeleton.tsx
|
|
8631
|
-
var
|
|
8632
|
-
var h10 =
|
|
8721
|
+
var React52 = __toESM(require("react"), 1);
|
|
8722
|
+
var h10 = React52.createElement;
|
|
8633
8723
|
function inertProps() {
|
|
8634
|
-
return { inert: parseInt(
|
|
8724
|
+
return { inert: parseInt(React52.version, 10) >= 19 ? true : "", "aria-hidden": true };
|
|
8635
8725
|
}
|
|
8636
8726
|
function widthOf(w) {
|
|
8637
8727
|
return w == null || w === "" ? void 0 : typeof w === "number" ? w + "px" : w;
|
|
@@ -8789,12 +8879,12 @@ function TableSkeleton(props) {
|
|
|
8789
8879
|
}
|
|
8790
8880
|
|
|
8791
8881
|
// src/Table.tsx
|
|
8792
|
-
var StackLabels =
|
|
8793
|
-
var ColumnIndex =
|
|
8882
|
+
var StackLabels = React53.createContext(null);
|
|
8883
|
+
var ColumnIndex = React53.createContext(-1);
|
|
8794
8884
|
function flat2(children) {
|
|
8795
8885
|
const out = [];
|
|
8796
|
-
|
|
8797
|
-
if (
|
|
8886
|
+
React53.Children.toArray(children).forEach(function(c) {
|
|
8887
|
+
if (React53.isValidElement(c) && c.type === React53.Fragment)
|
|
8798
8888
|
out.push.apply(out, flat2(c.props.children));
|
|
8799
8889
|
else out.push(c);
|
|
8800
8890
|
});
|
|
@@ -8808,7 +8898,7 @@ function text(node) {
|
|
|
8808
8898
|
});
|
|
8809
8899
|
return parts.length ? parts.join("") : void 0;
|
|
8810
8900
|
}
|
|
8811
|
-
if (
|
|
8901
|
+
if (React53.isValidElement(node)) {
|
|
8812
8902
|
const p = node.props;
|
|
8813
8903
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8814
8904
|
return text(p.children);
|
|
@@ -8818,13 +8908,13 @@ function text(node) {
|
|
|
8818
8908
|
function headerLabels(children) {
|
|
8819
8909
|
let out = [];
|
|
8820
8910
|
flat2(children).forEach(function(c) {
|
|
8821
|
-
if (out.length || !
|
|
8911
|
+
if (out.length || !React53.isValidElement(c) || c.type !== THead) return;
|
|
8822
8912
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8823
|
-
return
|
|
8913
|
+
return React53.isValidElement(r2);
|
|
8824
8914
|
});
|
|
8825
8915
|
if (!row) return;
|
|
8826
8916
|
flat2(row.props.children).forEach(function(cell) {
|
|
8827
|
-
if (!
|
|
8917
|
+
if (!React53.isValidElement(cell)) return;
|
|
8828
8918
|
const p = cell.props;
|
|
8829
8919
|
const t = text(p.children);
|
|
8830
8920
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8837,13 +8927,13 @@ function headerLabels(children) {
|
|
|
8837
8927
|
function headerColumns(children) {
|
|
8838
8928
|
const out = [];
|
|
8839
8929
|
flat2(children).forEach(function(c) {
|
|
8840
|
-
if (out.length || !
|
|
8930
|
+
if (out.length || !React53.isValidElement(c) || c.type !== THead) return;
|
|
8841
8931
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8842
|
-
return
|
|
8932
|
+
return React53.isValidElement(r2);
|
|
8843
8933
|
});
|
|
8844
8934
|
if (!row) return;
|
|
8845
8935
|
flat2(row.props.children).forEach(function(cell) {
|
|
8846
|
-
if (!
|
|
8936
|
+
if (!React53.isValidElement(cell)) return;
|
|
8847
8937
|
const p = cell.props;
|
|
8848
8938
|
const t = text(p.children);
|
|
8849
8939
|
const style = p.style;
|
|
@@ -8861,7 +8951,7 @@ function headerColumns(children) {
|
|
|
8861
8951
|
});
|
|
8862
8952
|
return out;
|
|
8863
8953
|
}
|
|
8864
|
-
var Table =
|
|
8954
|
+
var Table = React53.forwardRef(function Table2(props, ref) {
|
|
8865
8955
|
const {
|
|
8866
8956
|
caption,
|
|
8867
8957
|
captionHidden,
|
|
@@ -8889,7 +8979,7 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8889
8979
|
);
|
|
8890
8980
|
const shownChildren = skeletonCols ? [
|
|
8891
8981
|
flat2(children).filter(function(c) {
|
|
8892
|
-
return
|
|
8982
|
+
return React53.isValidElement(c) && c.type === THead;
|
|
8893
8983
|
}),
|
|
8894
8984
|
skeletonBody(skeletonCols, loadingRows != null ? Math.max(0, loadingRows) : 5, !!stackBelow)
|
|
8895
8985
|
] : children;
|
|
@@ -8905,12 +8995,12 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8905
8995
|
"tbl-stack-labels",
|
|
8906
8996
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8907
8997
|
);
|
|
8908
|
-
const outer =
|
|
8998
|
+
const outer = React53.useContext(StackLabels);
|
|
8909
8999
|
const pageDensity = useDensity();
|
|
8910
9000
|
const capId = uid();
|
|
8911
|
-
const wrap =
|
|
8912
|
-
const sc =
|
|
8913
|
-
const wide =
|
|
9001
|
+
const wrap = React53.useRef(null);
|
|
9002
|
+
const sc = React53.useState(false), scrolls = sc[0];
|
|
9003
|
+
const wide = React53.useState(false);
|
|
8914
9004
|
useIsoLayoutEffect(function() {
|
|
8915
9005
|
const el = wrap.current;
|
|
8916
9006
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8927,7 +9017,7 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8927
9017
|
ro.disconnect();
|
|
8928
9018
|
};
|
|
8929
9019
|
}, []);
|
|
8930
|
-
const table = /* @__PURE__ */
|
|
9020
|
+
const table = /* @__PURE__ */ React53.createElement(
|
|
8931
9021
|
"div",
|
|
8932
9022
|
{
|
|
8933
9023
|
ref: wrap,
|
|
@@ -8952,7 +9042,7 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8952
9042
|
"aria-labelledby": scrolls && !loading ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8953
9043
|
"aria-label": scrolls && !loading && caption == null ? rest["aria-label"] : void 0
|
|
8954
9044
|
},
|
|
8955
|
-
/* @__PURE__ */
|
|
9045
|
+
/* @__PURE__ */ React53.createElement(
|
|
8956
9046
|
"table",
|
|
8957
9047
|
{
|
|
8958
9048
|
ref,
|
|
@@ -8969,12 +9059,12 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8969
9059
|
role: stackBelow ? "table" : void 0,
|
|
8970
9060
|
...rest
|
|
8971
9061
|
},
|
|
8972
|
-
caption != null ? /* @__PURE__ */
|
|
9062
|
+
caption != null ? /* @__PURE__ */ React53.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8973
9063
|
skeletonCols ? skeletonColgroup(skeletonCols) : null,
|
|
8974
|
-
labels ? /* @__PURE__ */
|
|
9064
|
+
labels ? /* @__PURE__ */ React53.createElement(StackLabels.Provider, { value: labels }, shownChildren) : outer ? /* @__PURE__ */ React53.createElement(StackLabels.Provider, { value: null }, shownChildren) : shownChildren
|
|
8975
9065
|
)
|
|
8976
9066
|
);
|
|
8977
|
-
return cards ? /* @__PURE__ */
|
|
9067
|
+
return cards ? /* @__PURE__ */ React53.createElement(
|
|
8978
9068
|
"div",
|
|
8979
9069
|
{
|
|
8980
9070
|
className: cx(
|
|
@@ -8987,10 +9077,10 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8987
9077
|
) : table;
|
|
8988
9078
|
});
|
|
8989
9079
|
function section(tag, cls) {
|
|
8990
|
-
const C =
|
|
9080
|
+
const C = React53.forwardRef(function TableSection(props, ref) {
|
|
8991
9081
|
const { className, ...rest } = props;
|
|
8992
|
-
const stacked =
|
|
8993
|
-
return
|
|
9082
|
+
const stacked = React53.useContext(StackLabels) != null;
|
|
9083
|
+
return React53.createElement(
|
|
8994
9084
|
tag,
|
|
8995
9085
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
8996
9086
|
);
|
|
@@ -9003,14 +9093,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
9003
9093
|
TBody.displayName = "TBody";
|
|
9004
9094
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
9005
9095
|
TFoot.displayName = "TFoot";
|
|
9006
|
-
var Tr =
|
|
9096
|
+
var Tr = React53.forwardRef(function Tr2(props, ref) {
|
|
9007
9097
|
const { className, children, ...rest } = props;
|
|
9008
|
-
const stacked =
|
|
9098
|
+
const stacked = React53.useContext(StackLabels) != null;
|
|
9009
9099
|
let col = 0;
|
|
9010
|
-
return /* @__PURE__ */
|
|
9100
|
+
return /* @__PURE__ */ React53.createElement("tr", { ref, className: cx("aura-tbl__row", className), role: stacked ? "row" : void 0, ...rest }, stacked ? flat2(children).map(function(c) {
|
|
9011
9101
|
const at = col;
|
|
9012
|
-
if (
|
|
9013
|
-
return /* @__PURE__ */
|
|
9102
|
+
if (React53.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
9103
|
+
return /* @__PURE__ */ React53.createElement(ColumnIndex.Provider, { key: React53.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
9014
9104
|
}) : children);
|
|
9015
9105
|
});
|
|
9016
9106
|
function cellClass(base, p) {
|
|
@@ -9027,10 +9117,10 @@ function cellClass(base, p) {
|
|
|
9027
9117
|
p.className
|
|
9028
9118
|
);
|
|
9029
9119
|
}
|
|
9030
|
-
var Th =
|
|
9120
|
+
var Th = React53.forwardRef(function Th2(props, ref) {
|
|
9031
9121
|
const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, wrap, ...rest } = props;
|
|
9032
|
-
const stacked =
|
|
9033
|
-
return /* @__PURE__ */
|
|
9122
|
+
const stacked = React53.useContext(StackLabels) != null;
|
|
9123
|
+
return /* @__PURE__ */ React53.createElement(
|
|
9034
9124
|
"th",
|
|
9035
9125
|
{
|
|
9036
9126
|
ref,
|
|
@@ -9042,12 +9132,12 @@ var Th = React52.forwardRef(function Th2(props, ref) {
|
|
|
9042
9132
|
}
|
|
9043
9133
|
);
|
|
9044
9134
|
});
|
|
9045
|
-
var Td =
|
|
9135
|
+
var Td = React53.forwardRef(function Td2(props, ref) {
|
|
9046
9136
|
const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, wrap, ...rest } = props;
|
|
9047
|
-
const labels =
|
|
9137
|
+
const labels = React53.useContext(StackLabels), col = React53.useContext(ColumnIndex);
|
|
9048
9138
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
9049
9139
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
9050
|
-
return /* @__PURE__ */
|
|
9140
|
+
return /* @__PURE__ */ React53.createElement(
|
|
9051
9141
|
"td",
|
|
9052
9142
|
{
|
|
9053
9143
|
ref,
|
|
@@ -9061,8 +9151,8 @@ var Td = React52.forwardRef(function Td2(props, ref) {
|
|
|
9061
9151
|
});
|
|
9062
9152
|
|
|
9063
9153
|
// src/BottomNav.tsx
|
|
9064
|
-
var
|
|
9065
|
-
var BottomNav =
|
|
9154
|
+
var React54 = __toESM(require("react"), 1);
|
|
9155
|
+
var BottomNav = React54.forwardRef(function BottomNav2(props, ref) {
|
|
9066
9156
|
const t = useStrings();
|
|
9067
9157
|
const Link = useLinkComponent(props.linkComponent);
|
|
9068
9158
|
const st = useMaybeControlled(
|
|
@@ -9072,7 +9162,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9072
9162
|
);
|
|
9073
9163
|
const active = st[0];
|
|
9074
9164
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
9075
|
-
const own =
|
|
9165
|
+
const own = React54.useRef(null);
|
|
9076
9166
|
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
9077
9167
|
const away = useHideOnScroll(
|
|
9078
9168
|
!!props.hideOnScroll,
|
|
@@ -9080,7 +9170,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9080
9170
|
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
9081
9171
|
64
|
|
9082
9172
|
);
|
|
9083
|
-
const setRef =
|
|
9173
|
+
const setRef = React54.useCallback(
|
|
9084
9174
|
function(el) {
|
|
9085
9175
|
own.current = el;
|
|
9086
9176
|
if (typeof ref === "function") ref(el);
|
|
@@ -9088,7 +9178,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9088
9178
|
},
|
|
9089
9179
|
[ref]
|
|
9090
9180
|
);
|
|
9091
|
-
return /* @__PURE__ */
|
|
9181
|
+
return /* @__PURE__ */ React54.createElement(React54.Fragment, null, /* @__PURE__ */ React54.createElement("div", { className: cx("aura-bottomnav-spacer", "aura-bottomnav--" + hide2), "aria-hidden": "true" }), /* @__PURE__ */ React54.createElement(
|
|
9092
9182
|
"nav",
|
|
9093
9183
|
{
|
|
9094
9184
|
ref: setRef,
|
|
@@ -9101,7 +9191,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9101
9191
|
),
|
|
9102
9192
|
"aria-label": props.label || t.mainNav
|
|
9103
9193
|
},
|
|
9104
|
-
/* @__PURE__ */
|
|
9194
|
+
/* @__PURE__ */ React54.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
9105
9195
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
9106
9196
|
devWarnOnce(
|
|
9107
9197
|
"bottomnav-label-" + it.id,
|
|
@@ -9122,20 +9212,20 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9122
9212
|
}
|
|
9123
9213
|
};
|
|
9124
9214
|
const inner = [
|
|
9125
|
-
/* @__PURE__ */
|
|
9126
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
9127
|
-
/* @__PURE__ */
|
|
9128
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
9215
|
+
/* @__PURE__ */ React54.createElement("span", { key: "i", className: "aura-bottomnav__icon" }, /* @__PURE__ */ React54.createElement(Icon, { name: it.icon, size: "md" }), count ? /* @__PURE__ */ React54.createElement("span", { className: "aura-bottomnav__count", "aria-hidden": "true" }, count) : it.badge ? /* @__PURE__ */ React54.createElement("span", { className: "aura-bottomnav__dot", "aria-hidden": "true" }) : null),
|
|
9216
|
+
it.ariaLabel ? /* @__PURE__ */ React54.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
9217
|
+
/* @__PURE__ */ React54.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
9218
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React54.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
9129
9219
|
];
|
|
9130
|
-
return /* @__PURE__ */
|
|
9220
|
+
return /* @__PURE__ */ React54.createElement("li", { key: it.id, className: "aura-bottomnav__cell" }, it.href ? /* @__PURE__ */ React54.createElement(Link, { href: it.href, ...common }, inner) : /* @__PURE__ */ React54.createElement("button", { type: "button", ...common }, inner));
|
|
9131
9221
|
}))
|
|
9132
9222
|
));
|
|
9133
9223
|
});
|
|
9134
9224
|
|
|
9135
9225
|
// src/Surface.tsx
|
|
9136
|
-
var
|
|
9137
|
-
var h11 =
|
|
9138
|
-
var Surface =
|
|
9226
|
+
var React55 = __toESM(require("react"), 1);
|
|
9227
|
+
var h11 = React55.createElement;
|
|
9228
|
+
var Surface = React55.forwardRef(function Surface2(props, ref) {
|
|
9139
9229
|
const t = props.texture || "mesh";
|
|
9140
9230
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
9141
9231
|
return h11(
|
|
@@ -9156,14 +9246,14 @@ var Surface = React54.forwardRef(function Surface2(props, ref) {
|
|
|
9156
9246
|
});
|
|
9157
9247
|
|
|
9158
9248
|
// src/Stat.tsx
|
|
9159
|
-
var
|
|
9160
|
-
var Stat =
|
|
9249
|
+
var React56 = __toESM(require("react"), 1);
|
|
9250
|
+
var Stat = React56.forwardRef(function Stat2(props, ref) {
|
|
9161
9251
|
const Link = useLinkComponent(props.linkComponent);
|
|
9162
9252
|
return statElement(props, ref, Link);
|
|
9163
9253
|
});
|
|
9164
9254
|
|
|
9165
9255
|
// src/TimePicker.tsx
|
|
9166
|
-
var
|
|
9256
|
+
var React57 = __toESM(require("react"), 1);
|
|
9167
9257
|
var import_react_dom12 = require("react-dom");
|
|
9168
9258
|
|
|
9169
9259
|
// src/text.ts
|
|
@@ -9205,7 +9295,7 @@ function toMin(t) {
|
|
|
9205
9295
|
function fromMin(n3) {
|
|
9206
9296
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
9207
9297
|
}
|
|
9208
|
-
var TimePicker =
|
|
9298
|
+
var TimePicker = React57.forwardRef(function TimePicker2(props, ref) {
|
|
9209
9299
|
const t = useStrings();
|
|
9210
9300
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
9211
9301
|
const st = useMaybeControlled(
|
|
@@ -9215,7 +9305,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9215
9305
|
);
|
|
9216
9306
|
const value = st[0];
|
|
9217
9307
|
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;
|
|
9218
|
-
const slots =
|
|
9308
|
+
const slots = React57.useMemo(
|
|
9219
9309
|
function() {
|
|
9220
9310
|
const out = [];
|
|
9221
9311
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -9227,12 +9317,12 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9227
9317
|
const n3 = toMin(v);
|
|
9228
9318
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
9229
9319
|
}
|
|
9230
|
-
const openState =
|
|
9231
|
-
const editState =
|
|
9232
|
-
const aState =
|
|
9233
|
-
const errState =
|
|
9234
|
-
const pos =
|
|
9235
|
-
const boxRef =
|
|
9320
|
+
const openState = React57.useState(false), open = openState[0], setOpen = openState[1];
|
|
9321
|
+
const editState = React57.useState(null), editing = editState[0], setEditing = editState[1];
|
|
9322
|
+
const aState = React57.useState(0), active = aState[0], setActive = aState[1];
|
|
9323
|
+
const errState = React57.useState(null);
|
|
9324
|
+
const pos = React57.useState(null);
|
|
9325
|
+
const boxRef = React57.useRef(null), inputRef = React57.useRef(null), listRef = React57.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9236
9326
|
const mounted = useMounted();
|
|
9237
9327
|
function nearest(v) {
|
|
9238
9328
|
const n3 = toMin(v);
|
|
@@ -9260,7 +9350,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9260
9350
|
},
|
|
9261
9351
|
[open]
|
|
9262
9352
|
);
|
|
9263
|
-
|
|
9353
|
+
React57.useEffect(
|
|
9264
9354
|
function() {
|
|
9265
9355
|
if (!open) return;
|
|
9266
9356
|
function outside(e) {
|
|
@@ -9282,7 +9372,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9282
9372
|
},
|
|
9283
9373
|
[open]
|
|
9284
9374
|
);
|
|
9285
|
-
|
|
9375
|
+
React57.useEffect(
|
|
9286
9376
|
function() {
|
|
9287
9377
|
if (!open || !listRef.current) return;
|
|
9288
9378
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -9381,9 +9471,9 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9381
9471
|
}
|
|
9382
9472
|
const error = errState[0] || props.error;
|
|
9383
9473
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
9384
|
-
/* @__PURE__ */
|
|
9474
|
+
/* @__PURE__ */ React57.createElement("div", { ref: listRef, className: "aura-combo__popover aura-time__popover", style: pos[0] }, /* @__PURE__ */ React57.createElement("ul", { id: listId, role: "listbox", "aria-label": props.label, className: "aura-combo__list" }, slots.map(function(s, i) {
|
|
9385
9475
|
const dis = blocked(s), sel = s === value;
|
|
9386
|
-
return /* @__PURE__ */
|
|
9476
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9387
9477
|
"li",
|
|
9388
9478
|
{
|
|
9389
9479
|
key: s,
|
|
@@ -9408,13 +9498,13 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9408
9498
|
if (active !== i) setActive(i);
|
|
9409
9499
|
}
|
|
9410
9500
|
},
|
|
9411
|
-
/* @__PURE__ */
|
|
9412
|
-
sel ? /* @__PURE__ */
|
|
9501
|
+
/* @__PURE__ */ React57.createElement("span", { className: "aura-combo__label" }, s),
|
|
9502
|
+
sel ? /* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
9413
9503
|
);
|
|
9414
9504
|
}))),
|
|
9415
9505
|
document.body
|
|
9416
9506
|
) : null;
|
|
9417
|
-
return /* @__PURE__ */
|
|
9507
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9418
9508
|
Field,
|
|
9419
9509
|
{
|
|
9420
9510
|
id,
|
|
@@ -9426,7 +9516,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9426
9516
|
disabled: props.disabled,
|
|
9427
9517
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
9428
9518
|
},
|
|
9429
|
-
/* @__PURE__ */
|
|
9519
|
+
/* @__PURE__ */ React57.createElement("div", { ref: boxRef, className: cx("aura-input aura-combo aura-time has-icon", open && "is-open") }, /* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconClock, null), className: "aura-input__icon" }), /* @__PURE__ */ React57.createElement(
|
|
9430
9520
|
"input",
|
|
9431
9521
|
{
|
|
9432
9522
|
ref: inputMerged,
|
|
@@ -9466,7 +9556,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9466
9556
|
}, 0);
|
|
9467
9557
|
}
|
|
9468
9558
|
}
|
|
9469
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
9559
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React57.createElement(
|
|
9470
9560
|
"button",
|
|
9471
9561
|
{
|
|
9472
9562
|
type: "button",
|
|
@@ -9479,8 +9569,8 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9479
9569
|
if (inputRef.current) inputRef.current.focus();
|
|
9480
9570
|
}
|
|
9481
9571
|
},
|
|
9482
|
-
/* @__PURE__ */
|
|
9483
|
-
) : null, /* @__PURE__ */
|
|
9572
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconX, null) })
|
|
9573
|
+
) : null, /* @__PURE__ */ React57.createElement(
|
|
9484
9574
|
"button",
|
|
9485
9575
|
{
|
|
9486
9576
|
type: "button",
|
|
@@ -9498,14 +9588,14 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9498
9588
|
}
|
|
9499
9589
|
}
|
|
9500
9590
|
},
|
|
9501
|
-
/* @__PURE__ */
|
|
9591
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconChevronDown, null) })
|
|
9502
9592
|
)),
|
|
9503
9593
|
list
|
|
9504
9594
|
);
|
|
9505
9595
|
});
|
|
9506
9596
|
|
|
9507
9597
|
// src/FileUpload.tsx
|
|
9508
|
-
var
|
|
9598
|
+
var React58 = __toESM(require("react"), 1);
|
|
9509
9599
|
function matches(file, accept) {
|
|
9510
9600
|
if (!accept) return true;
|
|
9511
9601
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9529,24 +9619,24 @@ function describeAccept(accept, t) {
|
|
|
9529
9619
|
}).join(", ");
|
|
9530
9620
|
}
|
|
9531
9621
|
var seq = 0;
|
|
9532
|
-
var FileUpload =
|
|
9622
|
+
var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
|
|
9533
9623
|
const t = useStrings();
|
|
9534
9624
|
const auto = uid(), id = props.id || auto;
|
|
9535
9625
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9536
9626
|
const items2 = st[0] || [];
|
|
9537
|
-
const dragState =
|
|
9538
|
-
const inputRef =
|
|
9539
|
-
const urls =
|
|
9627
|
+
const dragState = React58.useState(false), over = dragState[0];
|
|
9628
|
+
const inputRef = React58.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9629
|
+
const urls = React58.useRef({});
|
|
9540
9630
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9541
9631
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9542
|
-
|
|
9632
|
+
React58.useEffect(function() {
|
|
9543
9633
|
return function() {
|
|
9544
9634
|
Object.keys(urls.current).forEach(function(k) {
|
|
9545
9635
|
URL.revokeObjectURL(urls.current[k]);
|
|
9546
9636
|
});
|
|
9547
9637
|
};
|
|
9548
9638
|
}, []);
|
|
9549
|
-
|
|
9639
|
+
React58.useEffect(
|
|
9550
9640
|
function() {
|
|
9551
9641
|
const el = inputRef.current;
|
|
9552
9642
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9606,7 +9696,7 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9606
9696
|
if (inputRef.current) inputRef.current.focus();
|
|
9607
9697
|
}
|
|
9608
9698
|
const error = props.error;
|
|
9609
|
-
return /* @__PURE__ */
|
|
9699
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9610
9700
|
Field,
|
|
9611
9701
|
{
|
|
9612
9702
|
id,
|
|
@@ -9618,7 +9708,7 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9618
9708
|
disabled: props.disabled,
|
|
9619
9709
|
className: props.className
|
|
9620
9710
|
},
|
|
9621
|
-
/* @__PURE__ */
|
|
9711
|
+
/* @__PURE__ */ React58.createElement(
|
|
9622
9712
|
"div",
|
|
9623
9713
|
{
|
|
9624
9714
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9639,9 +9729,9 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9639
9729
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9640
9730
|
}
|
|
9641
9731
|
},
|
|
9642
|
-
/* @__PURE__ */
|
|
9643
|
-
/* @__PURE__ */
|
|
9644
|
-
/* @__PURE__ */
|
|
9732
|
+
/* @__PURE__ */ React58.createElement(Icon, { name: /* @__PURE__ */ React58.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9733
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9734
|
+
/* @__PURE__ */ React58.createElement(
|
|
9645
9735
|
"input",
|
|
9646
9736
|
{
|
|
9647
9737
|
ref: inputMerged,
|
|
@@ -9663,12 +9753,12 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9663
9753
|
}
|
|
9664
9754
|
}
|
|
9665
9755
|
),
|
|
9666
|
-
/* @__PURE__ */
|
|
9667
|
-
note ? /* @__PURE__ */
|
|
9756
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9757
|
+
note ? /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
9668
9758
|
),
|
|
9669
|
-
items2.length ? /* @__PURE__ */
|
|
9759
|
+
items2.length ? /* @__PURE__ */ React58.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9670
9760
|
const src = thumb(it);
|
|
9671
|
-
return /* @__PURE__ */
|
|
9761
|
+
return /* @__PURE__ */ React58.createElement("li", { key: it.id, className: cx("aura-upload__item", it.error && "is-error") }, src ? /* @__PURE__ */ React58.createElement("img", { className: "aura-upload__thumb", src, alt: "" }) : /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__thumb is-icon", "aria-hidden": true }, /* @__PURE__ */ React58.createElement(Icon, { name: /^image\//.test(it.type || "") ? /* @__PURE__ */ React58.createElement(IconImage, null) : /* @__PURE__ */ React58.createElement(IconFile, null), size: "md" })), /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__meta" }, it.url && !it.error ? /* @__PURE__ */ React58.createElement("a", { className: "aura-upload__name", href: it.url, target: "_blank", rel: "noreferrer" }, it.name) : /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__name" }, it.name), /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__sub" }, it.error ? /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Icon, { name: /* @__PURE__ */ React58.createElement(IconCircleAlert, null), size: 12 }), it.error) : it.status === "uploading" ? t.uploading + (it.progress != null ? " " + Math.round(it.progress) + "%" : "") : it.status === "done" ? /* @__PURE__ */ React58.createElement(React58.Fragment, null, /* @__PURE__ */ React58.createElement(Icon, { name: /* @__PURE__ */ React58.createElement(IconCircleCheck, null), size: 12 }), formatBytes(it.size)) : formatBytes(it.size)), it.status === "uploading" ? /* @__PURE__ */ React58.createElement(
|
|
9672
9762
|
"span",
|
|
9673
9763
|
{
|
|
9674
9764
|
className: "aura-upload__bar",
|
|
@@ -9678,11 +9768,11 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9678
9768
|
"aria-valuemax": 100,
|
|
9679
9769
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9680
9770
|
},
|
|
9681
|
-
/* @__PURE__ */
|
|
9682
|
-
) : null), /* @__PURE__ */
|
|
9771
|
+
/* @__PURE__ */ React58.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9772
|
+
) : null), /* @__PURE__ */ React58.createElement(
|
|
9683
9773
|
IconButton,
|
|
9684
9774
|
{
|
|
9685
|
-
icon: /* @__PURE__ */
|
|
9775
|
+
icon: /* @__PURE__ */ React58.createElement(IconX, null),
|
|
9686
9776
|
label: t.remove(it.name),
|
|
9687
9777
|
onClick: function() {
|
|
9688
9778
|
remove(it);
|
|
@@ -9998,9 +10088,9 @@ function createTheme(opts) {
|
|
|
9998
10088
|
}
|
|
9999
10089
|
|
|
10000
10090
|
// src/ThemeStyle.tsx
|
|
10001
|
-
var
|
|
10091
|
+
var React59 = __toESM(require("react"), 1);
|
|
10002
10092
|
function ThemeStyle(props) {
|
|
10003
|
-
const css =
|
|
10093
|
+
const css = React59.useMemo(
|
|
10004
10094
|
function() {
|
|
10005
10095
|
try {
|
|
10006
10096
|
return createTheme({
|
|
@@ -10017,11 +10107,11 @@ function ThemeStyle(props) {
|
|
|
10017
10107
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
10018
10108
|
);
|
|
10019
10109
|
if (css === null) return null;
|
|
10020
|
-
return /* @__PURE__ */
|
|
10110
|
+
return /* @__PURE__ */ React59.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
10021
10111
|
}
|
|
10022
10112
|
|
|
10023
10113
|
// src/colorScheme.tsx
|
|
10024
|
-
var
|
|
10114
|
+
var React60 = __toESM(require("react"), 1);
|
|
10025
10115
|
|
|
10026
10116
|
// src/colorSchemeScript.ts
|
|
10027
10117
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -10038,7 +10128,7 @@ function colorSchemeScript(options) {
|
|
|
10038
10128
|
|
|
10039
10129
|
// src/colorScheme.tsx
|
|
10040
10130
|
function ColorSchemeScript(props) {
|
|
10041
|
-
return /* @__PURE__ */
|
|
10131
|
+
return /* @__PURE__ */ React60.createElement(
|
|
10042
10132
|
"script",
|
|
10043
10133
|
{
|
|
10044
10134
|
"data-aura-color-scheme": "",
|
|
@@ -10063,7 +10153,7 @@ function apply(scheme) {
|
|
|
10063
10153
|
function useColorScheme(options) {
|
|
10064
10154
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
10065
10155
|
const fallback = options && options.defaultScheme || "system";
|
|
10066
|
-
const subscribe2 =
|
|
10156
|
+
const subscribe2 = React60.useCallback(
|
|
10067
10157
|
function(cb) {
|
|
10068
10158
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
10069
10159
|
function onSystem() {
|
|
@@ -10085,7 +10175,7 @@ function useColorScheme(options) {
|
|
|
10085
10175
|
},
|
|
10086
10176
|
[fallback, key]
|
|
10087
10177
|
);
|
|
10088
|
-
const snapshot =
|
|
10178
|
+
const snapshot = React60.useSyncExternalStore(
|
|
10089
10179
|
subscribe2,
|
|
10090
10180
|
function() {
|
|
10091
10181
|
const s = readScheme(fallback);
|
|
@@ -10096,7 +10186,7 @@ function useColorScheme(options) {
|
|
|
10096
10186
|
}
|
|
10097
10187
|
);
|
|
10098
10188
|
const parts = snapshot.split("|");
|
|
10099
|
-
const setScheme =
|
|
10189
|
+
const setScheme = React60.useCallback(
|
|
10100
10190
|
function(next) {
|
|
10101
10191
|
if (!valid(next)) return;
|
|
10102
10192
|
try {
|
|
@@ -10115,14 +10205,14 @@ function ColorSchemeToggle(props) {
|
|
|
10115
10205
|
const cs = useColorScheme(props);
|
|
10116
10206
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
10117
10207
|
const label = props.label || t.colorScheme;
|
|
10118
|
-
return /* @__PURE__ */
|
|
10208
|
+
return /* @__PURE__ */ React60.createElement(
|
|
10119
10209
|
DropdownMenu,
|
|
10120
10210
|
{
|
|
10121
10211
|
label,
|
|
10122
|
-
trigger: /* @__PURE__ */
|
|
10212
|
+
trigger: /* @__PURE__ */ React60.createElement(
|
|
10123
10213
|
IconButton,
|
|
10124
10214
|
{
|
|
10125
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
10215
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React60.createElement(IconMoon, null) : /* @__PURE__ */ React60.createElement(IconSun, null),
|
|
10126
10216
|
label: label + ": " + names[cs.scheme]
|
|
10127
10217
|
}
|
|
10128
10218
|
),
|
|
@@ -10140,14 +10230,14 @@ function ColorSchemeToggle(props) {
|
|
|
10140
10230
|
}
|
|
10141
10231
|
|
|
10142
10232
|
// src/Badge.tsx
|
|
10143
|
-
var
|
|
10144
|
-
var Badge =
|
|
10233
|
+
var React61 = __toESM(require("react"), 1);
|
|
10234
|
+
var Badge = React61.forwardRef(function Badge2(props, ref) {
|
|
10145
10235
|
return badgeElement(props, ref);
|
|
10146
10236
|
});
|
|
10147
10237
|
|
|
10148
10238
|
// src/Progress.tsx
|
|
10149
|
-
var
|
|
10150
|
-
var Progress =
|
|
10239
|
+
var React62 = __toESM(require("react"), 1);
|
|
10240
|
+
var Progress = React62.forwardRef(function Progress2(props, ref) {
|
|
10151
10241
|
const t = useStrings();
|
|
10152
10242
|
const auto = uid(), id = props.id || auto;
|
|
10153
10243
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -10157,7 +10247,7 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10157
10247
|
const keyed = !!props.legend && spct > 0;
|
|
10158
10248
|
const valueText = props.valueText != null ? props.valueText : keyed ? t.progressReserved(props.value, sec, max) : props.valueLabel != null ? String(props.valueLabel) : sec ? t.progressReserved(props.value, sec, max) : void 0;
|
|
10159
10249
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
10160
|
-
return /* @__PURE__ */
|
|
10250
|
+
return /* @__PURE__ */ React62.createElement(
|
|
10161
10251
|
"div",
|
|
10162
10252
|
{
|
|
10163
10253
|
ref,
|
|
@@ -10168,8 +10258,8 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10168
10258
|
props.className
|
|
10169
10259
|
)
|
|
10170
10260
|
},
|
|
10171
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
10172
|
-
/* @__PURE__ */
|
|
10261
|
+
props.label || props.showValue && shown ? /* @__PURE__ */ React62.createElement("div", { className: "aura-progress__head" }, props.label ? /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__label", id: id + "-label" }, props.label) : /* @__PURE__ */ React62.createElement("span", null), props.showValue && shown ? /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__value" }, shown) : null) : null,
|
|
10262
|
+
/* @__PURE__ */ React62.createElement(
|
|
10173
10263
|
"div",
|
|
10174
10264
|
{
|
|
10175
10265
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -10181,8 +10271,8 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10181
10271
|
"aria-valuenow": det ? props.value : void 0,
|
|
10182
10272
|
"aria-valuetext": det ? valueText : void 0
|
|
10183
10273
|
},
|
|
10184
|
-
/* @__PURE__ */
|
|
10185
|
-
sec ? /* @__PURE__ */
|
|
10274
|
+
/* @__PURE__ */ React62.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
10275
|
+
sec ? /* @__PURE__ */ React62.createElement(
|
|
10186
10276
|
"span",
|
|
10187
10277
|
{
|
|
10188
10278
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -10190,20 +10280,20 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10190
10280
|
}
|
|
10191
10281
|
) : null
|
|
10192
10282
|
),
|
|
10193
|
-
keyed ? /* @__PURE__ */
|
|
10194
|
-
props.hint ? /* @__PURE__ */
|
|
10283
|
+
keyed ? /* @__PURE__ */ React62.createElement("div", { className: "aura-progress__legend", "aria-hidden": "true" }, props.legend.value != null && props.legend.value !== false ? /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__swatch" }), props.legend.value) : null, /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__key" }, /* @__PURE__ */ React62.createElement("span", { className: "aura-progress__swatch aura-progress__swatch--reserved" }), props.legend.secondary)) : null,
|
|
10284
|
+
props.hint ? /* @__PURE__ */ React62.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
10195
10285
|
);
|
|
10196
10286
|
});
|
|
10197
10287
|
|
|
10198
10288
|
// src/Skeleton.tsx
|
|
10199
|
-
var
|
|
10200
|
-
var Skeleton =
|
|
10289
|
+
var React63 = __toESM(require("react"), 1);
|
|
10290
|
+
var Skeleton = React63.forwardRef(function Skeleton2(props, ref) {
|
|
10201
10291
|
const v = props.variant || "text";
|
|
10202
10292
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
10203
10293
|
const n3 = props.lines, rows = [];
|
|
10204
10294
|
for (let i = 0; i < n3; i++)
|
|
10205
|
-
rows.push(/* @__PURE__ */
|
|
10206
|
-
return /* @__PURE__ */
|
|
10295
|
+
rows.push(/* @__PURE__ */ React63.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
10296
|
+
return /* @__PURE__ */ React63.createElement(
|
|
10207
10297
|
"span",
|
|
10208
10298
|
{
|
|
10209
10299
|
ref,
|
|
@@ -10221,17 +10311,17 @@ var Skeleton = React62.forwardRef(function Skeleton2(props, ref) {
|
|
|
10221
10311
|
if (v === "circle") {
|
|
10222
10312
|
style.width = style.height = props.size || props.width || 40;
|
|
10223
10313
|
}
|
|
10224
|
-
return /* @__PURE__ */
|
|
10314
|
+
return /* @__PURE__ */ React63.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
10225
10315
|
});
|
|
10226
10316
|
|
|
10227
10317
|
// src/EmptyState.tsx
|
|
10228
|
-
var
|
|
10229
|
-
var EmptyState =
|
|
10318
|
+
var React64 = __toESM(require("react"), 1);
|
|
10319
|
+
var EmptyState = React64.forwardRef(function EmptyState2(props, ref) {
|
|
10230
10320
|
return emptyStateElement(props, ref);
|
|
10231
10321
|
});
|
|
10232
10322
|
|
|
10233
10323
|
// src/Pagination.tsx
|
|
10234
|
-
var
|
|
10324
|
+
var React65 = __toESM(require("react"), 1);
|
|
10235
10325
|
function pageList(page, count, sib) {
|
|
10236
10326
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
10237
10327
|
if (page - sib <= 3) {
|
|
@@ -10251,7 +10341,7 @@ function pageList(page, count, sib) {
|
|
|
10251
10341
|
if (count > 1) out.push(count);
|
|
10252
10342
|
return out;
|
|
10253
10343
|
}
|
|
10254
|
-
var Pagination =
|
|
10344
|
+
var Pagination = React65.forwardRef(function Pagination2(props, ref) {
|
|
10255
10345
|
const t = useStrings();
|
|
10256
10346
|
useAutoTip();
|
|
10257
10347
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -10271,7 +10361,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10271
10361
|
},
|
|
10272
10362
|
extra
|
|
10273
10363
|
);
|
|
10274
|
-
return link ? /* @__PURE__ */
|
|
10364
|
+
return link ? /* @__PURE__ */ React65.createElement(
|
|
10275
10365
|
Link,
|
|
10276
10366
|
{
|
|
10277
10367
|
href: link(p),
|
|
@@ -10284,7 +10374,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10284
10374
|
...common
|
|
10285
10375
|
},
|
|
10286
10376
|
label
|
|
10287
|
-
) : /* @__PURE__ */
|
|
10377
|
+
) : /* @__PURE__ */ React65.createElement(
|
|
10288
10378
|
"button",
|
|
10289
10379
|
{
|
|
10290
10380
|
type: "button",
|
|
@@ -10298,7 +10388,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10298
10388
|
}
|
|
10299
10389
|
function arrow(p, icon, label, rel, disabled) {
|
|
10300
10390
|
if (!link || disabled)
|
|
10301
|
-
return /* @__PURE__ */
|
|
10391
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10302
10392
|
IconButton,
|
|
10303
10393
|
{
|
|
10304
10394
|
icon,
|
|
@@ -10309,7 +10399,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10309
10399
|
}
|
|
10310
10400
|
}
|
|
10311
10401
|
);
|
|
10312
|
-
return /* @__PURE__ */
|
|
10402
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10313
10403
|
Link,
|
|
10314
10404
|
{
|
|
10315
10405
|
href: link(p),
|
|
@@ -10324,17 +10414,17 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10324
10414
|
}
|
|
10325
10415
|
}
|
|
10326
10416
|
},
|
|
10327
|
-
/* @__PURE__ */
|
|
10417
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: icon, size: "sm" })
|
|
10328
10418
|
);
|
|
10329
10419
|
}
|
|
10330
|
-
return /* @__PURE__ */
|
|
10331
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
10332
|
-
})), /* @__PURE__ */
|
|
10420
|
+
return /* @__PURE__ */ React65.createElement("nav", { ref, className: cx("aura-pagination", props.className), "aria-label": props.label || t.pagination }, arrow(page - 1, /* @__PURE__ */ React65.createElement(IconChevronLeft, null), t.prevPage, "prev", page <= 1), /* @__PURE__ */ React65.createElement("ol", { className: "aura-pagination__list" }, pageList(page, count, props.siblingCount == null ? 1 : props.siblingCount).map(function(p) {
|
|
10421
|
+
return typeof p === "number" ? /* @__PURE__ */ React65.createElement("li", { key: p }, item(p, p)) : /* @__PURE__ */ React65.createElement("li", { key: p, className: "aura-pagination__gap", "aria-hidden": true }, "\u2026");
|
|
10422
|
+
})), /* @__PURE__ */ React65.createElement("span", { className: "aura-pagination__compact", "aria-hidden": true }, t.page(page, count)), arrow(page + 1, /* @__PURE__ */ React65.createElement(IconChevronRight, null), t.nextPage, "next", page >= count));
|
|
10333
10423
|
});
|
|
10334
10424
|
|
|
10335
10425
|
// src/Accordion.tsx
|
|
10336
|
-
var
|
|
10337
|
-
var Accordion =
|
|
10426
|
+
var React66 = __toESM(require("react"), 1);
|
|
10427
|
+
var Accordion = React66.forwardRef(function Accordion2(props, ref) {
|
|
10338
10428
|
const auto = uid(), base = props.id || auto;
|
|
10339
10429
|
const multiple = props.type === "multiple";
|
|
10340
10430
|
const st = useMaybeControlled(
|
|
@@ -10372,9 +10462,9 @@ var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
|
10372
10462
|
n3.focus();
|
|
10373
10463
|
}
|
|
10374
10464
|
}
|
|
10375
|
-
return /* @__PURE__ */
|
|
10465
|
+
return /* @__PURE__ */ React66.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
10376
10466
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
10377
|
-
return /* @__PURE__ */
|
|
10467
|
+
return /* @__PURE__ */ React66.createElement("div", { key: it.id, className: cx("aura-accordion__item", on && "is-open") }, /* @__PURE__ */ React66.createElement(HT, { className: "aura-accordion__heading" }, /* @__PURE__ */ React66.createElement(
|
|
10378
10468
|
"button",
|
|
10379
10469
|
{
|
|
10380
10470
|
type: "button",
|
|
@@ -10387,10 +10477,10 @@ var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
|
10387
10477
|
toggle(it.id);
|
|
10388
10478
|
}
|
|
10389
10479
|
},
|
|
10390
|
-
it.icon ? /* @__PURE__ */
|
|
10391
|
-
/* @__PURE__ */
|
|
10392
|
-
/* @__PURE__ */
|
|
10393
|
-
)), /* @__PURE__ */
|
|
10480
|
+
it.icon ? /* @__PURE__ */ React66.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
10481
|
+
/* @__PURE__ */ React66.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React66.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React66.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc", "aria-hidden": true }, it.description) : null),
|
|
10482
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
10483
|
+
)), /* @__PURE__ */ React66.createElement(
|
|
10394
10484
|
"div",
|
|
10395
10485
|
{
|
|
10396
10486
|
id: pid,
|
|
@@ -10405,7 +10495,7 @@ var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
|
10405
10495
|
});
|
|
10406
10496
|
|
|
10407
10497
|
// src/Popover.tsx
|
|
10408
|
-
var
|
|
10498
|
+
var React67 = __toESM(require("react"), 1);
|
|
10409
10499
|
var import_react_dom13 = require("react-dom");
|
|
10410
10500
|
function position(anchor, pop, placement) {
|
|
10411
10501
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -10423,15 +10513,15 @@ function position(anchor, pop, placement) {
|
|
|
10423
10513
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
10424
10514
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
10425
10515
|
}
|
|
10426
|
-
var Popover =
|
|
10516
|
+
var Popover = React67.forwardRef(function Popover2(props, ref) {
|
|
10427
10517
|
const t = useStrings();
|
|
10428
10518
|
const density = useDensity();
|
|
10429
10519
|
const auto = uid(), id = props.id || auto;
|
|
10430
10520
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
10431
10521
|
const open = !!st[0];
|
|
10432
|
-
const wrap =
|
|
10433
|
-
const pos =
|
|
10434
|
-
const inTree =
|
|
10522
|
+
const wrap = React67.useRef(null), pop = React67.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
10523
|
+
const pos = React67.useState(null), mounted = useMounted();
|
|
10524
|
+
const inTree = React67.useRef(false);
|
|
10435
10525
|
function trigger() {
|
|
10436
10526
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
10437
10527
|
}
|
|
@@ -10458,7 +10548,7 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10458
10548
|
},
|
|
10459
10549
|
[open, mounted, props.placement]
|
|
10460
10550
|
);
|
|
10461
|
-
|
|
10551
|
+
React67.useEffect(
|
|
10462
10552
|
function() {
|
|
10463
10553
|
if (!open || !mounted) return;
|
|
10464
10554
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10490,9 +10580,9 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10490
10580
|
},
|
|
10491
10581
|
[open, mounted]
|
|
10492
10582
|
);
|
|
10493
|
-
const child =
|
|
10583
|
+
const child = React67.Children.only(props.trigger);
|
|
10494
10584
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10495
|
-
/* @__PURE__ */
|
|
10585
|
+
/* @__PURE__ */ React67.createElement(
|
|
10496
10586
|
"div",
|
|
10497
10587
|
{
|
|
10498
10588
|
ref: popMerged,
|
|
@@ -10522,17 +10612,17 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10522
10612
|
} else trapTab(e, pop.current);
|
|
10523
10613
|
}
|
|
10524
10614
|
},
|
|
10525
|
-
props.title ? /* @__PURE__ */
|
|
10615
|
+
props.title ? /* @__PURE__ */ React67.createElement("div", { className: "aura-popover__head" }, /* @__PURE__ */ React67.createElement("p", { className: "aura-popover__title", id: id + "-title" }, props.title), /* @__PURE__ */ React67.createElement(
|
|
10526
10616
|
IconButton,
|
|
10527
10617
|
{
|
|
10528
|
-
icon: /* @__PURE__ */
|
|
10618
|
+
icon: /* @__PURE__ */ React67.createElement(IconX, null),
|
|
10529
10619
|
label: t.close,
|
|
10530
10620
|
onClick: function() {
|
|
10531
10621
|
close(true);
|
|
10532
10622
|
}
|
|
10533
10623
|
}
|
|
10534
10624
|
)) : null,
|
|
10535
|
-
/* @__PURE__ */
|
|
10625
|
+
/* @__PURE__ */ React67.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10536
10626
|
close: function() {
|
|
10537
10627
|
close(true);
|
|
10538
10628
|
}
|
|
@@ -10540,7 +10630,7 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10540
10630
|
),
|
|
10541
10631
|
document.body
|
|
10542
10632
|
) : null;
|
|
10543
|
-
return /* @__PURE__ */
|
|
10633
|
+
return /* @__PURE__ */ React67.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React67.cloneElement(child, {
|
|
10544
10634
|
onClick: function(e) {
|
|
10545
10635
|
if (child.props.onClick) child.props.onClick(e);
|
|
10546
10636
|
st[1](!open);
|
|
@@ -10552,7 +10642,7 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10552
10642
|
});
|
|
10553
10643
|
|
|
10554
10644
|
// src/NumberField.tsx
|
|
10555
|
-
var
|
|
10645
|
+
var React68 = __toESM(require("react"), 1);
|
|
10556
10646
|
function decimalsOf(n3) {
|
|
10557
10647
|
const s = String(n3);
|
|
10558
10648
|
const i = s.indexOf(".");
|
|
@@ -10565,7 +10655,7 @@ function parse(text2) {
|
|
|
10565
10655
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10566
10656
|
return Number(s);
|
|
10567
10657
|
}
|
|
10568
|
-
var NumberField =
|
|
10658
|
+
var NumberField = React68.forwardRef(function NumberField2(props, ref) {
|
|
10569
10659
|
const t = useStrings();
|
|
10570
10660
|
const auto = uid(), id = props.id || auto;
|
|
10571
10661
|
const step = props.step || 1;
|
|
@@ -10576,7 +10666,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10576
10666
|
props.onChange
|
|
10577
10667
|
);
|
|
10578
10668
|
const value = st[0], setValue = st[1];
|
|
10579
|
-
const draftState =
|
|
10669
|
+
const draftState = React68.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10580
10670
|
function fmt2(n3) {
|
|
10581
10671
|
if (n3 == null || isNaN(n3)) return "";
|
|
10582
10672
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10625,7 +10715,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10625
10715
|
};
|
|
10626
10716
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10627
10717
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10628
|
-
return /* @__PURE__ */
|
|
10718
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10629
10719
|
Field,
|
|
10630
10720
|
{
|
|
10631
10721
|
id,
|
|
@@ -10637,7 +10727,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10637
10727
|
disabled: props.disabled,
|
|
10638
10728
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10639
10729
|
},
|
|
10640
|
-
/* @__PURE__ */
|
|
10730
|
+
/* @__PURE__ */ React68.createElement("div", { className: cx("aura-input aura-number", stepper && "has-stepper") }, props.prefix != null ? /* @__PURE__ */ React68.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.prefix) : null, /* @__PURE__ */ React68.createElement(
|
|
10641
10731
|
"input",
|
|
10642
10732
|
{
|
|
10643
10733
|
ref,
|
|
@@ -10684,7 +10774,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10684
10774
|
},
|
|
10685
10775
|
onKeyDown
|
|
10686
10776
|
}
|
|
10687
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10777
|
+
), props.suffix != null ? /* @__PURE__ */ React68.createElement("span", { className: "aura-number__affix", "aria-hidden": true }, props.suffix) : null, stepper ? /* @__PURE__ */ React68.createElement("span", { className: "aura-number__steps" }, /* @__PURE__ */ React68.createElement(
|
|
10688
10778
|
"button",
|
|
10689
10779
|
{
|
|
10690
10780
|
type: "button",
|
|
@@ -10700,8 +10790,8 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10700
10790
|
nudge(-step);
|
|
10701
10791
|
}
|
|
10702
10792
|
},
|
|
10703
|
-
/* @__PURE__ */
|
|
10704
|
-
), /* @__PURE__ */
|
|
10793
|
+
/* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconMinus, null) })
|
|
10794
|
+
), /* @__PURE__ */ React68.createElement(
|
|
10705
10795
|
"button",
|
|
10706
10796
|
{
|
|
10707
10797
|
type: "button",
|
|
@@ -10717,14 +10807,14 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10717
10807
|
nudge(step);
|
|
10718
10808
|
}
|
|
10719
10809
|
},
|
|
10720
|
-
/* @__PURE__ */
|
|
10810
|
+
/* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconPlus, null) })
|
|
10721
10811
|
)) : null)
|
|
10722
10812
|
);
|
|
10723
10813
|
});
|
|
10724
10814
|
|
|
10725
10815
|
// src/Stepper.tsx
|
|
10726
|
-
var
|
|
10727
|
-
var Stepper =
|
|
10816
|
+
var React69 = __toESM(require("react"), 1);
|
|
10817
|
+
var Stepper = React69.forwardRef(function Stepper2(props, ref) {
|
|
10728
10818
|
const t = useStrings();
|
|
10729
10819
|
const idBase = uid();
|
|
10730
10820
|
const steps = props.steps || [];
|
|
@@ -10735,22 +10825,22 @@ var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
|
10735
10825
|
if (at < 0) at = 0;
|
|
10736
10826
|
const vertical = props.orientation === "vertical";
|
|
10737
10827
|
const cur2 = steps[at];
|
|
10738
|
-
return /* @__PURE__ */
|
|
10828
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10739
10829
|
"nav",
|
|
10740
10830
|
{
|
|
10741
10831
|
ref,
|
|
10742
10832
|
"aria-label": props.label,
|
|
10743
10833
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10744
10834
|
},
|
|
10745
|
-
/* @__PURE__ */
|
|
10835
|
+
/* @__PURE__ */ React69.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10746
10836
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10747
10837
|
const error = s.status === "error";
|
|
10748
|
-
const marker = /* @__PURE__ */
|
|
10838
|
+
const marker = /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__marker", "aria-hidden": true }, error ? /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconCircleAlert, null) }) : state === "done" ? /* @__PURE__ */ React69.createElement(Icon, { name: /* @__PURE__ */ React69.createElement(IconCheck, null) }) : i + 1);
|
|
10749
10839
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10750
10840
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10751
10841
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10752
10842
|
const descId = idBase + "-step-" + i;
|
|
10753
|
-
const text2 = /* @__PURE__ */
|
|
10843
|
+
const text2 = /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__text" }, named ? /* @__PURE__ */ React69.createElement("span", { className: "aura-sr-only" }, String(s.label) + (note ? ", " + note : "")) : null, /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__label", "aria-hidden": named ? true : void 0 }, s.label, note && !named ? /* @__PURE__ */ React69.createElement("span", { className: "aura-sr-only" }, ", " + note) : null), s.description ? /* @__PURE__ */ React69.createElement(
|
|
10754
10844
|
"span",
|
|
10755
10845
|
{
|
|
10756
10846
|
className: "aura-stepper__desc",
|
|
@@ -10759,14 +10849,14 @@ var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
|
10759
10849
|
},
|
|
10760
10850
|
s.description
|
|
10761
10851
|
) : null);
|
|
10762
|
-
return /* @__PURE__ */
|
|
10852
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10763
10853
|
"li",
|
|
10764
10854
|
{
|
|
10765
10855
|
key: s.id,
|
|
10766
10856
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10767
10857
|
"aria-current": state === "current" ? "step" : void 0
|
|
10768
10858
|
},
|
|
10769
|
-
clickable ? /* @__PURE__ */
|
|
10859
|
+
clickable ? /* @__PURE__ */ React69.createElement(
|
|
10770
10860
|
"button",
|
|
10771
10861
|
{
|
|
10772
10862
|
type: "button",
|
|
@@ -10778,19 +10868,19 @@ var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
|
10778
10868
|
},
|
|
10779
10869
|
marker,
|
|
10780
10870
|
text2
|
|
10781
|
-
) : /* @__PURE__ */
|
|
10871
|
+
) : /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10782
10872
|
);
|
|
10783
10873
|
})),
|
|
10784
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10874
|
+
!vertical && cur2 ? /* @__PURE__ */ React69.createElement("p", { className: "aura-stepper__compact", "aria-hidden": true }, /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__count" }, t.stepOf(at + 1, steps.length), cur2.status === "error" ? /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__count-error" }, " \u2014 " + t.stepError) : null), /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__compact-label" }, cur2.label)) : null
|
|
10785
10875
|
);
|
|
10786
10876
|
});
|
|
10787
10877
|
|
|
10788
10878
|
// src/SegmentedControl.tsx
|
|
10789
|
-
var
|
|
10879
|
+
var React70 = __toESM(require("react"), 1);
|
|
10790
10880
|
function toOpt2(o) {
|
|
10791
10881
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10792
10882
|
}
|
|
10793
|
-
var SegmentedControl =
|
|
10883
|
+
var SegmentedControl = React70.forwardRef(
|
|
10794
10884
|
function SegmentedControl2(props, ref) {
|
|
10795
10885
|
const options = (props.options || []).map(toOpt2);
|
|
10796
10886
|
useAutoTip();
|
|
@@ -10804,7 +10894,7 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10804
10894
|
);
|
|
10805
10895
|
const value = st[0], setValue = st[1];
|
|
10806
10896
|
const auto = uid(), id = props.id || auto;
|
|
10807
|
-
const refs =
|
|
10897
|
+
const refs = React70.useRef([]);
|
|
10808
10898
|
const selIdx = options.findIndex(function(o) {
|
|
10809
10899
|
return o.value === value;
|
|
10810
10900
|
});
|
|
@@ -10837,7 +10927,7 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10837
10927
|
move(options.length, -1);
|
|
10838
10928
|
}
|
|
10839
10929
|
}
|
|
10840
|
-
return /* @__PURE__ */
|
|
10930
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10841
10931
|
"div",
|
|
10842
10932
|
{
|
|
10843
10933
|
ref,
|
|
@@ -10857,7 +10947,7 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10857
10947
|
options.map(function(o, i) {
|
|
10858
10948
|
const on = o.value === value;
|
|
10859
10949
|
const off = props.disabled || o.disabled;
|
|
10860
|
-
return /* @__PURE__ */
|
|
10950
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10861
10951
|
"button",
|
|
10862
10952
|
{
|
|
10863
10953
|
key: o.value,
|
|
@@ -10879,8 +10969,8 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10879
10969
|
onKeyDown(e, i);
|
|
10880
10970
|
}
|
|
10881
10971
|
},
|
|
10882
|
-
o.icon ? /* @__PURE__ */
|
|
10883
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10972
|
+
o.icon ? /* @__PURE__ */ React70.createElement(Icon, { name: o.icon }) : null,
|
|
10973
|
+
o.iconOnly ? null : /* @__PURE__ */ React70.createElement("span", null, o.label)
|
|
10884
10974
|
);
|
|
10885
10975
|
})
|
|
10886
10976
|
);
|