@jirawatpyk/aura-react 5.66.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 +4 -0
- package/dist/aura.bundle.js +673 -596
- package/dist/cjs/index.cjs +672 -595
- package/dist/esm/CheckboxGroup.js +81 -0
- 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 +22 -0
- package/dist/index.d.ts +22 -0
- 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 +2 -0
- package/dist/styles.layer.css +2 -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
|
},
|
|
@@ -3883,15 +3887,88 @@ var RadioGroup = React20.forwardRef(function RadioGroup2(props, ref) {
|
|
|
3883
3887
|
);
|
|
3884
3888
|
});
|
|
3885
3889
|
|
|
3886
|
-
// src/
|
|
3890
|
+
// src/CheckboxGroup.tsx
|
|
3887
3891
|
var React21 = __toESM(require("react"), 1);
|
|
3888
|
-
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) {
|
|
3889
3966
|
const auto = uid(), id = props.id || auto;
|
|
3890
3967
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
3891
3968
|
const on = !!st[0];
|
|
3892
3969
|
const ro = !!props.readOnly && !props.disabled;
|
|
3893
3970
|
const described = [props.description ? id + "-desc" : "", props["aria-describedby"] || ""].filter(Boolean).join(" ");
|
|
3894
|
-
return /* @__PURE__ */
|
|
3971
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3895
3972
|
"div",
|
|
3896
3973
|
{
|
|
3897
3974
|
className: cx("aura-switch-row", props.disabled && "is-disabled", ro && "is-readonly", props.className),
|
|
@@ -3901,7 +3978,7 @@ var Switch = React21.forwardRef(function Switch2(props, ref) {
|
|
|
3901
3978
|
st[1](!on);
|
|
3902
3979
|
}
|
|
3903
3980
|
},
|
|
3904
|
-
/* @__PURE__ */
|
|
3981
|
+
/* @__PURE__ */ React22.createElement(
|
|
3905
3982
|
"button",
|
|
3906
3983
|
{
|
|
3907
3984
|
ref,
|
|
@@ -3919,15 +3996,15 @@ var Switch = React21.forwardRef(function Switch2(props, ref) {
|
|
|
3919
3996
|
if (!ro) st[1](!on);
|
|
3920
3997
|
}
|
|
3921
3998
|
},
|
|
3922
|
-
/* @__PURE__ */
|
|
3999
|
+
/* @__PURE__ */ React22.createElement("span", { className: "aura-switch__thumb" })
|
|
3923
4000
|
),
|
|
3924
|
-
props.label ? /* @__PURE__ */
|
|
3925
|
-
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
|
|
3926
4003
|
);
|
|
3927
4004
|
});
|
|
3928
4005
|
|
|
3929
4006
|
// src/Combobox.tsx
|
|
3930
|
-
var
|
|
4007
|
+
var React23 = __toESM(require("react"), 1);
|
|
3931
4008
|
var import_react_dom5 = require("react-dom");
|
|
3932
4009
|
function norm(s) {
|
|
3933
4010
|
return String(s == null ? "" : s).normalize("NFC").toLocaleLowerCase("th");
|
|
@@ -3942,7 +4019,7 @@ function defaultFilter(option, query) {
|
|
|
3942
4019
|
return norm(k).indexOf(q) >= 0;
|
|
3943
4020
|
});
|
|
3944
4021
|
}
|
|
3945
|
-
var Combobox =
|
|
4022
|
+
var Combobox = React23.forwardRef(
|
|
3946
4023
|
function Combobox2(all, ref) {
|
|
3947
4024
|
const props = all;
|
|
3948
4025
|
const multi = all.multiple === true;
|
|
@@ -3984,11 +4061,11 @@ var Combobox = React22.forwardRef(
|
|
|
3984
4061
|
return o.value === v;
|
|
3985
4062
|
})[0];
|
|
3986
4063
|
}).filter(Boolean) : [];
|
|
3987
|
-
const openState =
|
|
3988
|
-
const qState =
|
|
3989
|
-
const aState =
|
|
3990
|
-
const posState =
|
|
3991
|
-
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);
|
|
3992
4069
|
const mounted = useMounted();
|
|
3993
4070
|
const limit = props.limit || 200;
|
|
3994
4071
|
const filter = props.filter || defaultFilter;
|
|
@@ -4018,7 +4095,7 @@ var Combobox = React22.forwardRef(
|
|
|
4018
4095
|
},
|
|
4019
4096
|
[open, shown.length, values.length]
|
|
4020
4097
|
);
|
|
4021
|
-
|
|
4098
|
+
React23.useEffect(
|
|
4022
4099
|
function() {
|
|
4023
4100
|
if (!open) return;
|
|
4024
4101
|
function outside(e) {
|
|
@@ -4041,7 +4118,7 @@ var Combobox = React22.forwardRef(
|
|
|
4041
4118
|
},
|
|
4042
4119
|
[open]
|
|
4043
4120
|
);
|
|
4044
|
-
|
|
4121
|
+
React23.useEffect(
|
|
4045
4122
|
function() {
|
|
4046
4123
|
if (!open || !listRef.current) return;
|
|
4047
4124
|
const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
|
|
@@ -4061,8 +4138,8 @@ var Combobox = React22.forwardRef(
|
|
|
4061
4138
|
setOpen(false);
|
|
4062
4139
|
setQuery(null);
|
|
4063
4140
|
}
|
|
4064
|
-
const committed =
|
|
4065
|
-
const commitRef =
|
|
4141
|
+
const committed = React23.useRef(false);
|
|
4142
|
+
const commitRef = React23.useRef(function() {
|
|
4066
4143
|
return false;
|
|
4067
4144
|
});
|
|
4068
4145
|
function commitTyped() {
|
|
@@ -4150,7 +4227,7 @@ var Combobox = React22.forwardRef(
|
|
|
4150
4227
|
function renderOpt(o, i) {
|
|
4151
4228
|
const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
|
|
4152
4229
|
const blocked = o.disabled || multi && full && !isSel;
|
|
4153
|
-
return /* @__PURE__ */
|
|
4230
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4154
4231
|
"li",
|
|
4155
4232
|
{
|
|
4156
4233
|
key: o.value,
|
|
@@ -4176,9 +4253,9 @@ var Combobox = React22.forwardRef(
|
|
|
4176
4253
|
if (activeIdx !== i) setActive(i);
|
|
4177
4254
|
}
|
|
4178
4255
|
},
|
|
4179
|
-
o.icon ? /* @__PURE__ */
|
|
4180
|
-
/* @__PURE__ */
|
|
4181
|
-
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
|
|
4182
4259
|
);
|
|
4183
4260
|
}
|
|
4184
4261
|
function grouped(list2) {
|
|
@@ -4191,7 +4268,7 @@ var Combobox = React22.forwardRef(
|
|
|
4191
4268
|
return out;
|
|
4192
4269
|
}
|
|
4193
4270
|
const list = open && mounted && posState[0] ? (0, import_react_dom5.createPortal)(
|
|
4194
|
-
/* @__PURE__ */
|
|
4271
|
+
/* @__PURE__ */ React23.createElement(
|
|
4195
4272
|
"div",
|
|
4196
4273
|
{
|
|
4197
4274
|
ref: listRef,
|
|
@@ -4202,7 +4279,7 @@ var Combobox = React22.forwardRef(
|
|
|
4202
4279
|
e.preventDefault();
|
|
4203
4280
|
}
|
|
4204
4281
|
},
|
|
4205
|
-
live.length ? /* @__PURE__ */
|
|
4282
|
+
live.length ? /* @__PURE__ */ React23.createElement(
|
|
4206
4283
|
"ul",
|
|
4207
4284
|
{
|
|
4208
4285
|
id: listId,
|
|
@@ -4213,20 +4290,20 @@ var Combobox = React22.forwardRef(
|
|
|
4213
4290
|
},
|
|
4214
4291
|
grouped(live).map(function(seg) {
|
|
4215
4292
|
if (seg.g == null)
|
|
4216
|
-
return /* @__PURE__ */
|
|
4293
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, { key: "u" + seg.items[0][1] }, seg.items.map(function(p) {
|
|
4217
4294
|
return renderOpt(p[0], p[1]);
|
|
4218
4295
|
}));
|
|
4219
4296
|
const gid = id + "-group-" + seg.g + "-" + seg.items[0][1];
|
|
4220
|
-
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) {
|
|
4221
4298
|
return renderOpt(p[0], p[1]);
|
|
4222
4299
|
})));
|
|
4223
4300
|
})
|
|
4224
4301
|
) : null,
|
|
4225
|
-
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
|
|
4226
4303
|
),
|
|
4227
4304
|
document.body
|
|
4228
4305
|
) : null;
|
|
4229
|
-
return /* @__PURE__ */
|
|
4306
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4230
4307
|
Field,
|
|
4231
4308
|
{
|
|
4232
4309
|
id,
|
|
@@ -4239,8 +4316,8 @@ var Combobox = React22.forwardRef(
|
|
|
4239
4316
|
disabled: props.disabled,
|
|
4240
4317
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
4241
4318
|
},
|
|
4242
|
-
/* @__PURE__ */
|
|
4243
|
-
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(
|
|
4244
4321
|
"button",
|
|
4245
4322
|
{
|
|
4246
4323
|
type: "button",
|
|
@@ -4259,13 +4336,13 @@ var Combobox = React22.forwardRef(
|
|
|
4259
4336
|
if (inputRef.current) inputRef.current.focus();
|
|
4260
4337
|
}
|
|
4261
4338
|
},
|
|
4262
|
-
/* @__PURE__ */
|
|
4339
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconX, null) })
|
|
4263
4340
|
));
|
|
4264
|
-
})) : 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) {
|
|
4265
4342
|
return o.label;
|
|
4266
4343
|
}).join(", ") : "") : null, props.name ? multi ? values.map(function(v) {
|
|
4267
|
-
return /* @__PURE__ */
|
|
4268
|
-
}) : /* @__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(
|
|
4269
4346
|
"input",
|
|
4270
4347
|
{
|
|
4271
4348
|
ref: inputMerged,
|
|
@@ -4314,7 +4391,7 @@ var Combobox = React22.forwardRef(
|
|
|
4314
4391
|
}, 0);
|
|
4315
4392
|
}
|
|
4316
4393
|
}
|
|
4317
|
-
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */
|
|
4394
|
+
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */ React23.createElement(
|
|
4318
4395
|
"button",
|
|
4319
4396
|
{
|
|
4320
4397
|
type: "button",
|
|
@@ -4327,8 +4404,8 @@ var Combobox = React22.forwardRef(
|
|
|
4327
4404
|
if (inputRef.current) inputRef.current.focus();
|
|
4328
4405
|
}
|
|
4329
4406
|
},
|
|
4330
|
-
/* @__PURE__ */
|
|
4331
|
-
) : null, /* @__PURE__ */
|
|
4407
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconX, null) })
|
|
4408
|
+
) : null, /* @__PURE__ */ React23.createElement(
|
|
4332
4409
|
"button",
|
|
4333
4410
|
{
|
|
4334
4411
|
type: "button",
|
|
@@ -4346,7 +4423,7 @@ var Combobox = React22.forwardRef(
|
|
|
4346
4423
|
}
|
|
4347
4424
|
}
|
|
4348
4425
|
},
|
|
4349
|
-
/* @__PURE__ */
|
|
4426
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconChevronDown, null) })
|
|
4350
4427
|
)),
|
|
4351
4428
|
list
|
|
4352
4429
|
);
|
|
@@ -4354,20 +4431,20 @@ var Combobox = React22.forwardRef(
|
|
|
4354
4431
|
);
|
|
4355
4432
|
|
|
4356
4433
|
// src/Alert.tsx
|
|
4357
|
-
var
|
|
4358
|
-
var Alert =
|
|
4434
|
+
var React24 = __toESM(require("react"), 1);
|
|
4435
|
+
var Alert = React24.forwardRef(function Alert2(props, ref) {
|
|
4359
4436
|
const t = useStrings();
|
|
4360
4437
|
const autoId = uid();
|
|
4361
4438
|
return alertElement(
|
|
4362
4439
|
props,
|
|
4363
4440
|
ref,
|
|
4364
|
-
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,
|
|
4365
4442
|
autoId
|
|
4366
4443
|
);
|
|
4367
4444
|
});
|
|
4368
4445
|
|
|
4369
4446
|
// src/Toaster.tsx
|
|
4370
|
-
var
|
|
4447
|
+
var React25 = __toESM(require("react"), 1);
|
|
4371
4448
|
var import_react_dom6 = require("react-dom");
|
|
4372
4449
|
var MAX_VISIBLE = 3;
|
|
4373
4450
|
var toastState = {
|
|
@@ -4443,8 +4520,8 @@ function outsideToaster(el) {
|
|
|
4443
4520
|
function ToastItem(props) {
|
|
4444
4521
|
const str = useStrings();
|
|
4445
4522
|
const Link = useLinkComponent();
|
|
4446
|
-
const node =
|
|
4447
|
-
const origin =
|
|
4523
|
+
const node = React25.useRef(null);
|
|
4524
|
+
const origin = React25.useRef(null);
|
|
4448
4525
|
useIsoLayoutEffect(function() {
|
|
4449
4526
|
origin.current = outsideToaster(document.activeElement);
|
|
4450
4527
|
const el = node.current;
|
|
@@ -4460,8 +4537,8 @@ function ToastItem(props) {
|
|
|
4460
4537
|
}, 0);
|
|
4461
4538
|
};
|
|
4462
4539
|
}, []);
|
|
4463
|
-
const t = props.toast, timer2 =
|
|
4464
|
-
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);
|
|
4465
4542
|
function syncFocus() {
|
|
4466
4543
|
if (focused.current && !(node.current && node.current.contains(document.activeElement))) focused.current = false;
|
|
4467
4544
|
}
|
|
@@ -4483,7 +4560,7 @@ function ToastItem(props) {
|
|
|
4483
4560
|
left.current -= Date.now() - since.current;
|
|
4484
4561
|
}
|
|
4485
4562
|
}
|
|
4486
|
-
|
|
4563
|
+
React25.useEffect(
|
|
4487
4564
|
function() {
|
|
4488
4565
|
if (timer2.current) clearTimeout(timer2.current);
|
|
4489
4566
|
timer2.current = null;
|
|
@@ -4502,7 +4579,7 @@ function ToastItem(props) {
|
|
|
4502
4579
|
if (a.onClick) a.onClick();
|
|
4503
4580
|
if (a.dismiss !== false) toast.dismiss(t.id);
|
|
4504
4581
|
}
|
|
4505
|
-
return /* @__PURE__ */
|
|
4582
|
+
return /* @__PURE__ */ React25.createElement(
|
|
4506
4583
|
"div",
|
|
4507
4584
|
{
|
|
4508
4585
|
ref: node,
|
|
@@ -4539,16 +4616,16 @@ function ToastItem(props) {
|
|
|
4539
4616
|
resume();
|
|
4540
4617
|
}
|
|
4541
4618
|
},
|
|
4542
|
-
/* @__PURE__ */
|
|
4619
|
+
/* @__PURE__ */ React25.createElement(
|
|
4543
4620
|
Icon,
|
|
4544
4621
|
{
|
|
4545
|
-
name: t.loading ? /* @__PURE__ */
|
|
4622
|
+
name: t.loading ? /* @__PURE__ */ React25.createElement(IconLoaderCircle, null) : React25.createElement(ALERT_ICON[t.tone] || IconInfo),
|
|
4546
4623
|
className: cx("aura-toast__icon", t.loading && "aura-spin")
|
|
4547
4624
|
}
|
|
4548
4625
|
),
|
|
4549
|
-
/* @__PURE__ */
|
|
4550
|
-
actions.length ? /* @__PURE__ */
|
|
4551
|
-
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(
|
|
4552
4629
|
Link,
|
|
4553
4630
|
{
|
|
4554
4631
|
key: i,
|
|
@@ -4560,7 +4637,7 @@ function ToastItem(props) {
|
|
|
4560
4637
|
}
|
|
4561
4638
|
},
|
|
4562
4639
|
a.label
|
|
4563
|
-
) : /* @__PURE__ */
|
|
4640
|
+
) : /* @__PURE__ */ React25.createElement(
|
|
4564
4641
|
"button",
|
|
4565
4642
|
{
|
|
4566
4643
|
key: i,
|
|
@@ -4573,10 +4650,10 @@ function ToastItem(props) {
|
|
|
4573
4650
|
a.label
|
|
4574
4651
|
);
|
|
4575
4652
|
})) : null,
|
|
4576
|
-
/* @__PURE__ */
|
|
4653
|
+
/* @__PURE__ */ React25.createElement(
|
|
4577
4654
|
IconButton,
|
|
4578
4655
|
{
|
|
4579
|
-
icon: /* @__PURE__ */
|
|
4656
|
+
icon: /* @__PURE__ */ React25.createElement(IconX, null),
|
|
4580
4657
|
label: str.dismissToast,
|
|
4581
4658
|
className: "aura-toast__close",
|
|
4582
4659
|
onClick: function() {
|
|
@@ -4604,8 +4681,8 @@ function hotkeyMatcher(spec) {
|
|
|
4604
4681
|
function Toaster(props = {}) {
|
|
4605
4682
|
const t = useStrings();
|
|
4606
4683
|
const mounted = useMounted();
|
|
4607
|
-
const s =
|
|
4608
|
-
|
|
4684
|
+
const s = React25.useState(toastState.list);
|
|
4685
|
+
React25.useEffect(function() {
|
|
4609
4686
|
toastState.subs.push(s[1]);
|
|
4610
4687
|
s[1](toastState.list.slice());
|
|
4611
4688
|
return function() {
|
|
@@ -4614,9 +4691,9 @@ function Toaster(props = {}) {
|
|
|
4614
4691
|
});
|
|
4615
4692
|
};
|
|
4616
4693
|
}, []);
|
|
4617
|
-
const region =
|
|
4694
|
+
const region = React25.useRef(null);
|
|
4618
4695
|
const hotkey = props.hotkey === void 0 ? "Alt+T" : props.hotkey;
|
|
4619
|
-
|
|
4696
|
+
React25.useEffect(
|
|
4620
4697
|
function() {
|
|
4621
4698
|
if (!hotkey) return;
|
|
4622
4699
|
const match = hotkeyMatcher(hotkey);
|
|
@@ -4647,7 +4724,7 @@ function Toaster(props = {}) {
|
|
|
4647
4724
|
const pos = props.position || "bottom";
|
|
4648
4725
|
const offset = props.offset;
|
|
4649
4726
|
return (0, import_react_dom6.createPortal)(
|
|
4650
|
-
/* @__PURE__ */
|
|
4727
|
+
/* @__PURE__ */ React25.createElement(
|
|
4651
4728
|
"div",
|
|
4652
4729
|
{
|
|
4653
4730
|
ref: region,
|
|
@@ -4659,7 +4736,7 @@ function Toaster(props = {}) {
|
|
|
4659
4736
|
"aria-keyshortcuts": hotkey || void 0
|
|
4660
4737
|
},
|
|
4661
4738
|
s[0].map(function(t2) {
|
|
4662
|
-
return /* @__PURE__ */
|
|
4739
|
+
return /* @__PURE__ */ React25.createElement(ToastItem, { key: t2.id, toast: t2 });
|
|
4663
4740
|
})
|
|
4664
4741
|
),
|
|
4665
4742
|
document.body
|
|
@@ -4667,12 +4744,12 @@ function Toaster(props = {}) {
|
|
|
4667
4744
|
}
|
|
4668
4745
|
|
|
4669
4746
|
// src/PasswordField.tsx
|
|
4670
|
-
var
|
|
4671
|
-
var PasswordField =
|
|
4747
|
+
var React26 = __toESM(require("react"), 1);
|
|
4748
|
+
var PasswordField = React26.forwardRef(function PasswordField2(props, ref) {
|
|
4672
4749
|
const t = useStrings();
|
|
4673
|
-
const shown =
|
|
4750
|
+
const shown = React26.useState(false);
|
|
4674
4751
|
const rest = omit(props, ["toggle", "className"]);
|
|
4675
|
-
return /* @__PURE__ */
|
|
4752
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4676
4753
|
TextField,
|
|
4677
4754
|
{
|
|
4678
4755
|
autoComplete: "current-password",
|
|
@@ -4682,10 +4759,10 @@ var PasswordField = React25.forwardRef(function PasswordField2(props, ref) {
|
|
|
4682
4759
|
spellCheck: false,
|
|
4683
4760
|
autoCapitalize: "none",
|
|
4684
4761
|
className: cx("aura-password", props.className),
|
|
4685
|
-
suffix: props.toggle === false ? void 0 : /* @__PURE__ */
|
|
4762
|
+
suffix: props.toggle === false ? void 0 : /* @__PURE__ */ React26.createElement(
|
|
4686
4763
|
IconButton,
|
|
4687
4764
|
{
|
|
4688
|
-
icon: shown[0] ? /* @__PURE__ */
|
|
4765
|
+
icon: shown[0] ? /* @__PURE__ */ React26.createElement(IconEyeOff, null) : /* @__PURE__ */ React26.createElement(IconEye, null),
|
|
4689
4766
|
label: t.showPassword,
|
|
4690
4767
|
"aria-pressed": shown[0],
|
|
4691
4768
|
disabled: props.disabled,
|
|
@@ -4699,7 +4776,7 @@ var PasswordField = React25.forwardRef(function PasswordField2(props, ref) {
|
|
|
4699
4776
|
});
|
|
4700
4777
|
|
|
4701
4778
|
// src/FormErrorSummary.tsx
|
|
4702
|
-
var
|
|
4779
|
+
var React27 = __toESM(require("react"), 1);
|
|
4703
4780
|
function items(errors) {
|
|
4704
4781
|
if (Array.isArray(errors)) return errors;
|
|
4705
4782
|
const out = [];
|
|
@@ -4728,16 +4805,16 @@ function fieldElement(field) {
|
|
|
4728
4805
|
}
|
|
4729
4806
|
return named;
|
|
4730
4807
|
}
|
|
4731
|
-
var FormErrorSummary =
|
|
4808
|
+
var FormErrorSummary = React27.forwardRef(
|
|
4732
4809
|
function FormErrorSummary2(props, ref) {
|
|
4733
4810
|
const t = useStrings();
|
|
4734
4811
|
const auto = uid(), id = props.id || auto;
|
|
4735
4812
|
const list = items(props.errors);
|
|
4736
|
-
const box =
|
|
4813
|
+
const box = React27.useRef(null);
|
|
4737
4814
|
const keyed = props.focusKey !== void 0;
|
|
4738
|
-
const lastKey =
|
|
4815
|
+
const lastKey = React27.useRef(null), armed = React27.useRef(false), hadErrors = React27.useRef(false);
|
|
4739
4816
|
const has = list.length > 0;
|
|
4740
|
-
|
|
4817
|
+
React27.useEffect(
|
|
4741
4818
|
function() {
|
|
4742
4819
|
const appeared = has && !hadErrors.current;
|
|
4743
4820
|
hadErrors.current = has;
|
|
@@ -4761,7 +4838,7 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4761
4838
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4762
4839
|
[has, props.focusKey, keyed]
|
|
4763
4840
|
);
|
|
4764
|
-
|
|
4841
|
+
React27.useEffect(
|
|
4765
4842
|
function() {
|
|
4766
4843
|
if (!keyed) return;
|
|
4767
4844
|
function disarm() {
|
|
@@ -4780,7 +4857,7 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4780
4857
|
[keyed]
|
|
4781
4858
|
);
|
|
4782
4859
|
if (!list.length) return null;
|
|
4783
|
-
return /* @__PURE__ */
|
|
4860
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4784
4861
|
"div",
|
|
4785
4862
|
{
|
|
4786
4863
|
ref: function(el) {
|
|
@@ -4794,9 +4871,9 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4794
4871
|
"aria-labelledby": id + "-title",
|
|
4795
4872
|
className: cx("aura-alert aura-alert--danger aura-error-summary", props.className)
|
|
4796
4873
|
},
|
|
4797
|
-
/* @__PURE__ */
|
|
4798
|
-
/* @__PURE__ */
|
|
4799
|
-
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(
|
|
4800
4877
|
"a",
|
|
4801
4878
|
{
|
|
4802
4879
|
href: "#" + e.field,
|
|
@@ -4821,14 +4898,14 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4821
4898
|
);
|
|
4822
4899
|
|
|
4823
4900
|
// src/FilterBar.tsx
|
|
4824
|
-
var
|
|
4901
|
+
var React32 = __toESM(require("react"), 1);
|
|
4825
4902
|
|
|
4826
4903
|
// src/Dialog.tsx
|
|
4827
|
-
var
|
|
4904
|
+
var React29 = __toESM(require("react"), 1);
|
|
4828
4905
|
var import_react_dom7 = require("react-dom");
|
|
4829
4906
|
|
|
4830
4907
|
// src/useModal.tsx
|
|
4831
|
-
var
|
|
4908
|
+
var React28 = __toESM(require("react"), 1);
|
|
4832
4909
|
var locks = 0;
|
|
4833
4910
|
var savedOverflow = "";
|
|
4834
4911
|
function lockScroll() {
|
|
@@ -4855,11 +4932,11 @@ function tabbable(el) {
|
|
|
4855
4932
|
}
|
|
4856
4933
|
function useModal(open, ref, opts) {
|
|
4857
4934
|
const mounted = useMounted();
|
|
4858
|
-
const prev =
|
|
4935
|
+
const prev = React28.useRef(null);
|
|
4859
4936
|
const o = opts || {};
|
|
4860
|
-
const latest =
|
|
4937
|
+
const latest = React28.useRef(o);
|
|
4861
4938
|
latest.current = o;
|
|
4862
|
-
|
|
4939
|
+
React28.useEffect(
|
|
4863
4940
|
function() {
|
|
4864
4941
|
if (!open || !mounted) return;
|
|
4865
4942
|
prev.current = document.activeElement;
|
|
@@ -4914,15 +4991,15 @@ function useModal(open, ref, opts) {
|
|
|
4914
4991
|
}
|
|
4915
4992
|
|
|
4916
4993
|
// src/Dialog.tsx
|
|
4917
|
-
var DialogClose =
|
|
4994
|
+
var DialogClose = React29.createContext(null);
|
|
4918
4995
|
function useDialogClose() {
|
|
4919
|
-
return
|
|
4996
|
+
return React29.useContext(DialogClose) || function() {
|
|
4920
4997
|
};
|
|
4921
4998
|
}
|
|
4922
|
-
var Dialog =
|
|
4999
|
+
var Dialog = React29.forwardRef(function Dialog2(props, ref) {
|
|
4923
5000
|
const t = useStrings();
|
|
4924
5001
|
const density = useDensity();
|
|
4925
|
-
const own =
|
|
5002
|
+
const own = React29.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4926
5003
|
const openState = useMaybeControlled(props.open, false, null), open = openState[0];
|
|
4927
5004
|
if (props.open === void 0 && !props.trigger)
|
|
4928
5005
|
devWarnOnce("dialog-no-open", "Dialog has neither `open` nor `trigger`, so it can never open. Pass one of them.");
|
|
@@ -4950,7 +5027,7 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4950
5027
|
onCloseComplete: props.onCloseComplete
|
|
4951
5028
|
});
|
|
4952
5029
|
const trig = props.trigger;
|
|
4953
|
-
const trigger = trig &&
|
|
5030
|
+
const trigger = trig && React29.isValidElement(trig) ? React29.cloneElement(trig, {
|
|
4954
5031
|
"aria-haspopup": "dialog",
|
|
4955
5032
|
"aria-expanded": open,
|
|
4956
5033
|
"data-aura-trigger": trigId,
|
|
@@ -4985,7 +5062,7 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4985
5062
|
"aria-modal"
|
|
4986
5063
|
]);
|
|
4987
5064
|
const panel = (0, import_react_dom7.createPortal)(
|
|
4988
|
-
/* @__PURE__ */
|
|
5065
|
+
/* @__PURE__ */ React29.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React29.createElement(
|
|
4989
5066
|
"div",
|
|
4990
5067
|
{
|
|
4991
5068
|
className: "aura-scrim",
|
|
@@ -4995,7 +5072,7 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4995
5072
|
},
|
|
4996
5073
|
"aria-hidden": true
|
|
4997
5074
|
}
|
|
4998
|
-
), /* @__PURE__ */
|
|
5075
|
+
), /* @__PURE__ */ React29.createElement(
|
|
4999
5076
|
"div",
|
|
5000
5077
|
{
|
|
5001
5078
|
...rest,
|
|
@@ -5007,18 +5084,18 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
5007
5084
|
tabIndex: -1,
|
|
5008
5085
|
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
5009
5086
|
},
|
|
5010
|
-
/* @__PURE__ */
|
|
5011
|
-
props.description ? /* @__PURE__ */
|
|
5012
|
-
/* @__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)
|
|
5013
5090
|
)),
|
|
5014
5091
|
document.body
|
|
5015
5092
|
);
|
|
5016
|
-
return trigger ? /* @__PURE__ */
|
|
5093
|
+
return trigger ? /* @__PURE__ */ React29.createElement(React29.Fragment, null, trigger, panel) : panel;
|
|
5017
5094
|
});
|
|
5018
|
-
var Drawer =
|
|
5095
|
+
var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
5019
5096
|
const t = useStrings();
|
|
5020
5097
|
const density = useDensity();
|
|
5021
|
-
const own =
|
|
5098
|
+
const own = React29.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
5022
5099
|
function close() {
|
|
5023
5100
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
5024
5101
|
}
|
|
@@ -5055,7 +5132,7 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5055
5132
|
]);
|
|
5056
5133
|
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
5057
5134
|
return (0, import_react_dom7.createPortal)(
|
|
5058
|
-
/* @__PURE__ */
|
|
5135
|
+
/* @__PURE__ */ React29.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React29.createElement(
|
|
5059
5136
|
"div",
|
|
5060
5137
|
{
|
|
5061
5138
|
className: "aura-scrim",
|
|
@@ -5065,7 +5142,7 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5065
5142
|
} : void 0,
|
|
5066
5143
|
"aria-hidden": true
|
|
5067
5144
|
}
|
|
5068
|
-
), /* @__PURE__ */
|
|
5145
|
+
), /* @__PURE__ */ React29.createElement(
|
|
5069
5146
|
"div",
|
|
5070
5147
|
{
|
|
5071
5148
|
...rest,
|
|
@@ -5078,11 +5155,11 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5078
5155
|
tabIndex: -1,
|
|
5079
5156
|
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
5080
5157
|
},
|
|
5081
|
-
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(
|
|
5082
5159
|
IconButton,
|
|
5083
5160
|
{
|
|
5084
5161
|
...props.closeProps,
|
|
5085
|
-
icon: /* @__PURE__ */
|
|
5162
|
+
icon: /* @__PURE__ */ React29.createElement(IconX, null),
|
|
5086
5163
|
label: props.closeLabel || t.close,
|
|
5087
5164
|
onClick: function(e) {
|
|
5088
5165
|
const own2 = props.closeProps && props.closeProps.onClick;
|
|
@@ -5091,24 +5168,24 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5091
5168
|
}
|
|
5092
5169
|
}
|
|
5093
5170
|
) : null) : null,
|
|
5094
|
-
props.description ? /* @__PURE__ */
|
|
5095
|
-
/* @__PURE__ */
|
|
5096
|
-
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
|
|
5097
5174
|
)),
|
|
5098
5175
|
document.body
|
|
5099
5176
|
);
|
|
5100
5177
|
});
|
|
5101
5178
|
|
|
5102
5179
|
// src/Tag.tsx
|
|
5103
|
-
var
|
|
5180
|
+
var React31 = __toESM(require("react"), 1);
|
|
5104
5181
|
|
|
5105
5182
|
// src/Tooltip.tsx
|
|
5106
|
-
var
|
|
5183
|
+
var React30 = __toESM(require("react"), 1);
|
|
5107
5184
|
var import_react_dom8 = require("react-dom");
|
|
5108
|
-
var Tooltip =
|
|
5109
|
-
const id = uid(), st =
|
|
5110
|
-
const anchor =
|
|
5111
|
-
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();
|
|
5112
5189
|
function show3(now) {
|
|
5113
5190
|
clearTimeout(timer2.current);
|
|
5114
5191
|
timer2.current = setTimeout(
|
|
@@ -5128,7 +5205,7 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5128
5205
|
set(false);
|
|
5129
5206
|
}, 120);
|
|
5130
5207
|
}
|
|
5131
|
-
|
|
5208
|
+
React30.useEffect(function() {
|
|
5132
5209
|
return function() {
|
|
5133
5210
|
clearTimeout(timer2.current);
|
|
5134
5211
|
};
|
|
@@ -5172,7 +5249,7 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5172
5249
|
},
|
|
5173
5250
|
[open, mounted]
|
|
5174
5251
|
);
|
|
5175
|
-
|
|
5252
|
+
React30.useEffect(
|
|
5176
5253
|
function() {
|
|
5177
5254
|
if (!open) return;
|
|
5178
5255
|
function esc(e) {
|
|
@@ -5185,8 +5262,8 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5185
5262
|
},
|
|
5186
5263
|
[open]
|
|
5187
5264
|
);
|
|
5188
|
-
const child =
|
|
5189
|
-
const trigger = /* @__PURE__ */
|
|
5265
|
+
const child = React30.Children.only(props.children);
|
|
5266
|
+
const trigger = /* @__PURE__ */ React30.createElement(
|
|
5190
5267
|
"span",
|
|
5191
5268
|
{
|
|
5192
5269
|
ref: anchorMerged,
|
|
@@ -5200,10 +5277,10 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5200
5277
|
},
|
|
5201
5278
|
onBlur: hide2
|
|
5202
5279
|
},
|
|
5203
|
-
|
|
5280
|
+
React30.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
5204
5281
|
);
|
|
5205
|
-
return /* @__PURE__ */
|
|
5206
|
-
/* @__PURE__ */
|
|
5282
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, trigger, open && mounted ? (0, import_react_dom8.createPortal)(
|
|
5283
|
+
/* @__PURE__ */ React30.createElement(
|
|
5207
5284
|
"div",
|
|
5208
5285
|
{
|
|
5209
5286
|
ref: tip2,
|
|
@@ -5230,13 +5307,13 @@ function textOf2(node, all) {
|
|
|
5230
5307
|
return node.map(function(n3) {
|
|
5231
5308
|
return textOf2(n3, all);
|
|
5232
5309
|
}).join("");
|
|
5233
|
-
if (
|
|
5310
|
+
if (React31.isValidElement(node)) {
|
|
5234
5311
|
const p = node.props;
|
|
5235
5312
|
return !all && (p["aria-hidden"] === true || p["aria-hidden"] === "true") ? "" : textOf2(p.children, all);
|
|
5236
5313
|
}
|
|
5237
5314
|
return "";
|
|
5238
5315
|
}
|
|
5239
|
-
var Tag =
|
|
5316
|
+
var Tag = React31.forwardRef(function Tag2(props, ref) {
|
|
5240
5317
|
const t = useStrings();
|
|
5241
5318
|
const selectable = props.onClick != null || props.selected != null;
|
|
5242
5319
|
const rest = omit(props, [
|
|
@@ -5249,10 +5326,10 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5249
5326
|
"removeLabel",
|
|
5250
5327
|
"touchHeight"
|
|
5251
5328
|
]);
|
|
5252
|
-
const textRef =
|
|
5329
|
+
const textRef = React31.useRef(null);
|
|
5253
5330
|
useAutoTip();
|
|
5254
|
-
const cutState =
|
|
5255
|
-
const check =
|
|
5331
|
+
const cutState = React31.useState(false), isCut = cutState[0];
|
|
5332
|
+
const check = React31.useCallback(function() {
|
|
5256
5333
|
const el = textRef.current;
|
|
5257
5334
|
if (el) cutState[1](el.scrollWidth > el.clientWidth + 1);
|
|
5258
5335
|
}, []);
|
|
@@ -5271,11 +5348,11 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5271
5348
|
);
|
|
5272
5349
|
const fullText = isCut ? textOf2(props.children, true).replace(/\s+/g, " ").trim() : "";
|
|
5273
5350
|
const inner = [
|
|
5274
|
-
props.icon ? /* @__PURE__ */
|
|
5275
|
-
/* @__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)
|
|
5276
5353
|
];
|
|
5277
5354
|
if (selectable) {
|
|
5278
|
-
return /* @__PURE__ */
|
|
5355
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5279
5356
|
"button",
|
|
5280
5357
|
{
|
|
5281
5358
|
...rest,
|
|
@@ -5290,7 +5367,7 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5290
5367
|
props.className
|
|
5291
5368
|
)
|
|
5292
5369
|
},
|
|
5293
|
-
props.selected ? /* @__PURE__ */
|
|
5370
|
+
props.selected ? /* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconCheck, null), size: 14 }) : inner[0],
|
|
5294
5371
|
inner[1]
|
|
5295
5372
|
);
|
|
5296
5373
|
}
|
|
@@ -5300,8 +5377,8 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5300
5377
|
"tag-remove-label",
|
|
5301
5378
|
'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
|
|
5302
5379
|
);
|
|
5303
|
-
return /* @__PURE__ */
|
|
5304
|
-
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(
|
|
5305
5382
|
"button",
|
|
5306
5383
|
{
|
|
5307
5384
|
type: "button",
|
|
@@ -5309,9 +5386,9 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5309
5386
|
"aria-label": props.removeLabel || t.remove(name),
|
|
5310
5387
|
onClick: props.onRemove
|
|
5311
5388
|
},
|
|
5312
|
-
/* @__PURE__ */
|
|
5389
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconX, null), size: 14 })
|
|
5313
5390
|
);
|
|
5314
|
-
return /* @__PURE__ */
|
|
5391
|
+
return /* @__PURE__ */ React31.createElement(Tooltip, { content: fullText, open: fullText ? void 0 : false }, btn);
|
|
5315
5392
|
}() : null);
|
|
5316
5393
|
});
|
|
5317
5394
|
|
|
@@ -5334,16 +5411,16 @@ var space = function(v) {
|
|
|
5334
5411
|
};
|
|
5335
5412
|
|
|
5336
5413
|
// src/FilterBar.tsx
|
|
5337
|
-
var FilterBar =
|
|
5414
|
+
var FilterBar = React32.forwardRef(function FilterBar2(props, ref) {
|
|
5338
5415
|
const t = useStrings();
|
|
5339
5416
|
const id = uid();
|
|
5340
5417
|
const hasSearch = !!props.onSearchChange;
|
|
5341
|
-
const draft =
|
|
5342
|
-
const timer2 =
|
|
5343
|
-
const sent =
|
|
5344
|
-
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);
|
|
5345
5422
|
onChange.current = props.onSearchChange;
|
|
5346
|
-
|
|
5423
|
+
React32.useEffect(
|
|
5347
5424
|
function() {
|
|
5348
5425
|
if ((props.search || "") !== sent.current) {
|
|
5349
5426
|
sent.current = props.search || "";
|
|
@@ -5352,7 +5429,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5352
5429
|
},
|
|
5353
5430
|
[props.search]
|
|
5354
5431
|
);
|
|
5355
|
-
|
|
5432
|
+
React32.useEffect(function() {
|
|
5356
5433
|
return function() {
|
|
5357
5434
|
if (timer2.current) clearTimeout(timer2.current);
|
|
5358
5435
|
};
|
|
@@ -5375,14 +5452,14 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5375
5452
|
);
|
|
5376
5453
|
}
|
|
5377
5454
|
const filters = props.filters || [];
|
|
5378
|
-
const hasChildren =
|
|
5455
|
+
const hasChildren = React32.Children.toArray(props.children).length > 0;
|
|
5379
5456
|
const collapse = props.collapseBelow && hasChildren ? props.collapseBelow : null;
|
|
5380
|
-
const sheet =
|
|
5457
|
+
const sheet = React32.useState(false), open = !!collapse && sheet[0];
|
|
5381
5458
|
const sheetId = id + "-filters";
|
|
5382
|
-
const doneRef =
|
|
5459
|
+
const doneRef = React32.useRef(null), moreRef = React32.useRef(null), own = React32.useRef(null), rootRef = useMergedRef(ref, own);
|
|
5383
5460
|
if (collapse)
|
|
5384
|
-
|
|
5385
|
-
if (!
|
|
5461
|
+
React32.Children.forEach(props.children, function(c) {
|
|
5462
|
+
if (!React32.isValidElement(c) || c.type === Button || c.type === IconButton) return;
|
|
5386
5463
|
const p = c.props;
|
|
5387
5464
|
if (p.defaultValue !== void 0 || p.defaultChecked !== void 0 || "label" in p && !("value" in p) && !("selected" in p) && !("checked" in p))
|
|
5388
5465
|
devWarnOnce(
|
|
@@ -5400,7 +5477,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5400
5477
|
) || bar.querySelector(".aura-filterbar__search input");
|
|
5401
5478
|
}
|
|
5402
5479
|
const applied = props.filterCount != null ? props.filterCount : filters.length;
|
|
5403
|
-
|
|
5480
|
+
React32.useEffect(
|
|
5404
5481
|
function() {
|
|
5405
5482
|
if (!open || !collapse || typeof window.matchMedia !== "function") return;
|
|
5406
5483
|
const mq = window.matchMedia("(min-width: " + breakpoints[collapse] + "px)");
|
|
@@ -5425,7 +5502,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5425
5502
|
}
|
|
5426
5503
|
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
5427
5504
|
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
5428
|
-
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(
|
|
5429
5506
|
"input",
|
|
5430
5507
|
{
|
|
5431
5508
|
id,
|
|
@@ -5446,10 +5523,10 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5446
5523
|
}
|
|
5447
5524
|
}
|
|
5448
5525
|
}
|
|
5449
|
-
), draft[0] ? /* @__PURE__ */
|
|
5526
|
+
), draft[0] ? /* @__PURE__ */ React32.createElement(
|
|
5450
5527
|
IconButton,
|
|
5451
5528
|
{
|
|
5452
|
-
icon: /* @__PURE__ */
|
|
5529
|
+
icon: /* @__PURE__ */ React32.createElement(IconX, null),
|
|
5453
5530
|
label: t.clear((props.searchLabel || t.search).toLowerCase()),
|
|
5454
5531
|
className: "aura-filterbar__clear-search",
|
|
5455
5532
|
onClick: function() {
|
|
@@ -5458,12 +5535,12 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5458
5535
|
}
|
|
5459
5536
|
}
|
|
5460
5537
|
) : null) : null;
|
|
5461
|
-
const more = collapse ? /* @__PURE__ */
|
|
5538
|
+
const more = collapse ? /* @__PURE__ */ React32.createElement(
|
|
5462
5539
|
Button,
|
|
5463
5540
|
{
|
|
5464
5541
|
ref: moreRef,
|
|
5465
5542
|
variant: "secondary",
|
|
5466
|
-
icon: /* @__PURE__ */
|
|
5543
|
+
icon: /* @__PURE__ */ React32.createElement(IconSlidersHorizontal, null),
|
|
5467
5544
|
className: "aura-filterbar__more",
|
|
5468
5545
|
"aria-haspopup": "dialog",
|
|
5469
5546
|
"aria-expanded": open,
|
|
@@ -5472,9 +5549,9 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5472
5549
|
sheet[1](true);
|
|
5473
5550
|
}
|
|
5474
5551
|
},
|
|
5475
|
-
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
|
|
5476
5553
|
) : null;
|
|
5477
|
-
return /* @__PURE__ */
|
|
5554
|
+
return /* @__PURE__ */ React32.createElement(
|
|
5478
5555
|
"div",
|
|
5479
5556
|
{
|
|
5480
5557
|
ref: rootRef,
|
|
@@ -5490,15 +5567,15 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5490
5567
|
props.className
|
|
5491
5568
|
)
|
|
5492
5569
|
},
|
|
5493
|
-
/* @__PURE__ */
|
|
5570
|
+
/* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar__row" }, collapse ? (
|
|
5494
5571
|
/* 5.42: the search and the Filters button share a row of their own below the breakpoint (count and actions
|
|
5495
5572
|
* wrap under them); from the breakpoint up this box is display: contents and the bar is as before. */
|
|
5496
|
-
/* @__PURE__ */
|
|
5497
|
-
) : searchBox, hasChildren && !open ? /* @__PURE__ */
|
|
5498
|
-
filters.length || props.onClearAll && anything ? /* @__PURE__ */
|
|
5499
|
-
return /* @__PURE__ */
|
|
5500
|
-
}), props.onClearAll && anything ? /* @__PURE__ */
|
|
5501
|
-
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(
|
|
5502
5579
|
Dialog,
|
|
5503
5580
|
{
|
|
5504
5581
|
open,
|
|
@@ -5510,7 +5587,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5510
5587
|
title: t.filters,
|
|
5511
5588
|
size: "sm",
|
|
5512
5589
|
className: "aura-filterbar__sheet",
|
|
5513
|
-
footer: /* @__PURE__ */
|
|
5590
|
+
footer: /* @__PURE__ */ React32.createElement(React32.Fragment, null, props.onClearAll && filters.length ? /* @__PURE__ */ React32.createElement(
|
|
5514
5591
|
Button,
|
|
5515
5592
|
{
|
|
5516
5593
|
variant: "secondary",
|
|
@@ -5521,7 +5598,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5521
5598
|
}
|
|
5522
5599
|
},
|
|
5523
5600
|
t.clearFilters
|
|
5524
|
-
) : null, /* @__PURE__ */
|
|
5601
|
+
) : null, /* @__PURE__ */ React32.createElement(
|
|
5525
5602
|
Button,
|
|
5526
5603
|
{
|
|
5527
5604
|
ref: doneRef,
|
|
@@ -5533,13 +5610,13 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5533
5610
|
t.done
|
|
5534
5611
|
))
|
|
5535
5612
|
},
|
|
5536
|
-
/* @__PURE__ */
|
|
5613
|
+
/* @__PURE__ */ React32.createElement(FilterSheet.Provider, { value: true }, /* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar aura-filterbar--sheet is-touch-always" }, props.children))
|
|
5537
5614
|
) : null
|
|
5538
5615
|
);
|
|
5539
5616
|
});
|
|
5540
5617
|
|
|
5541
5618
|
// src/Command.tsx
|
|
5542
|
-
var
|
|
5619
|
+
var React33 = __toESM(require("react"), 1);
|
|
5543
5620
|
var import_react_dom9 = require("react-dom");
|
|
5544
5621
|
function isMac() {
|
|
5545
5622
|
return typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
@@ -5548,21 +5625,21 @@ function Command(props) {
|
|
|
5548
5625
|
const t = useStrings();
|
|
5549
5626
|
const density = useDensity();
|
|
5550
5627
|
const id = uid(), listId = id + "-list";
|
|
5551
|
-
const box =
|
|
5552
|
-
const input =
|
|
5553
|
-
const qState =
|
|
5628
|
+
const box = React33.useRef(null);
|
|
5629
|
+
const input = React33.useRef(null);
|
|
5630
|
+
const qState = React33.useState(""), act = React33.useState(null);
|
|
5554
5631
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
5555
5632
|
function setQuery(v) {
|
|
5556
5633
|
if (props.query === void 0) qState[1](v);
|
|
5557
5634
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
5558
5635
|
}
|
|
5559
|
-
const openRef =
|
|
5636
|
+
const openRef = React33.useRef(props.open);
|
|
5560
5637
|
openRef.current = props.open;
|
|
5561
5638
|
const close = function() {
|
|
5562
5639
|
props.onOpenChange(false);
|
|
5563
5640
|
};
|
|
5564
5641
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
5565
|
-
|
|
5642
|
+
React33.useEffect(
|
|
5566
5643
|
function() {
|
|
5567
5644
|
if (props.hotkey === false) return;
|
|
5568
5645
|
function onKey2(e) {
|
|
@@ -5578,7 +5655,7 @@ function Command(props) {
|
|
|
5578
5655
|
},
|
|
5579
5656
|
[props.hotkey, props.onOpenChange]
|
|
5580
5657
|
);
|
|
5581
|
-
|
|
5658
|
+
React33.useEffect(
|
|
5582
5659
|
function() {
|
|
5583
5660
|
if (!props.open) {
|
|
5584
5661
|
if (query) setQuery("");
|
|
@@ -5618,7 +5695,7 @@ function Command(props) {
|
|
|
5618
5695
|
const optId = function(i2) {
|
|
5619
5696
|
return id + "-o" + i2;
|
|
5620
5697
|
};
|
|
5621
|
-
|
|
5698
|
+
React33.useEffect(
|
|
5622
5699
|
function() {
|
|
5623
5700
|
if (!box.current || active < 0) return;
|
|
5624
5701
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -5663,7 +5740,7 @@ function Command(props) {
|
|
|
5663
5740
|
if (!modal.ready) return null;
|
|
5664
5741
|
let i = -1;
|
|
5665
5742
|
return (0, import_react_dom9.createPortal)(
|
|
5666
|
-
/* @__PURE__ */
|
|
5743
|
+
/* @__PURE__ */ React33.createElement(
|
|
5667
5744
|
"div",
|
|
5668
5745
|
{
|
|
5669
5746
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -5673,8 +5750,8 @@ function Command(props) {
|
|
|
5673
5750
|
e.stopPropagation();
|
|
5674
5751
|
}
|
|
5675
5752
|
},
|
|
5676
|
-
/* @__PURE__ */
|
|
5677
|
-
/* @__PURE__ */
|
|
5753
|
+
/* @__PURE__ */ React33.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
5754
|
+
/* @__PURE__ */ React33.createElement(
|
|
5678
5755
|
"div",
|
|
5679
5756
|
{
|
|
5680
5757
|
ref: box,
|
|
@@ -5684,7 +5761,7 @@ function Command(props) {
|
|
|
5684
5761
|
tabIndex: -1,
|
|
5685
5762
|
className: cx("aura-command", props.className)
|
|
5686
5763
|
},
|
|
5687
|
-
/* @__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(
|
|
5688
5765
|
"input",
|
|
5689
5766
|
{
|
|
5690
5767
|
ref: input,
|
|
@@ -5707,8 +5784,8 @@ function Command(props) {
|
|
|
5707
5784
|
},
|
|
5708
5785
|
onKeyDown: onKey
|
|
5709
5786
|
}
|
|
5710
|
-
), /* @__PURE__ */
|
|
5711
|
-
/* @__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(
|
|
5712
5789
|
"div",
|
|
5713
5790
|
{
|
|
5714
5791
|
id: listId,
|
|
@@ -5718,7 +5795,7 @@ function Command(props) {
|
|
|
5718
5795
|
},
|
|
5719
5796
|
groups.map(function(g, gi) {
|
|
5720
5797
|
const gid = id + "-g" + gi;
|
|
5721
|
-
return /* @__PURE__ */
|
|
5798
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5722
5799
|
"div",
|
|
5723
5800
|
{
|
|
5724
5801
|
key: g.name || gi,
|
|
@@ -5726,11 +5803,11 @@ function Command(props) {
|
|
|
5726
5803
|
"aria-labelledby": g.name ? gid : void 0,
|
|
5727
5804
|
className: "aura-command__group"
|
|
5728
5805
|
},
|
|
5729
|
-
g.name ? /* @__PURE__ */
|
|
5806
|
+
g.name ? /* @__PURE__ */ React33.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
5730
5807
|
g.items.map(function(it) {
|
|
5731
5808
|
i++;
|
|
5732
5809
|
const n3 = i;
|
|
5733
|
-
return /* @__PURE__ */
|
|
5810
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5734
5811
|
"div",
|
|
5735
5812
|
{
|
|
5736
5813
|
key: it.id,
|
|
@@ -5754,16 +5831,16 @@ function Command(props) {
|
|
|
5754
5831
|
run(it);
|
|
5755
5832
|
}
|
|
5756
5833
|
},
|
|
5757
|
-
it.icon ? /* @__PURE__ */
|
|
5758
|
-
/* @__PURE__ */
|
|
5759
|
-
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
|
|
5760
5837
|
);
|
|
5761
5838
|
})
|
|
5762
5839
|
);
|
|
5763
5840
|
})
|
|
5764
5841
|
)),
|
|
5765
|
-
/* @__PURE__ */
|
|
5766
|
-
/* @__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"))
|
|
5767
5844
|
)
|
|
5768
5845
|
),
|
|
5769
5846
|
document.body
|
|
@@ -5771,7 +5848,7 @@ function Command(props) {
|
|
|
5771
5848
|
}
|
|
5772
5849
|
|
|
5773
5850
|
// src/DataTable.tsx
|
|
5774
|
-
var
|
|
5851
|
+
var React34 = __toESM(require("react"), 1);
|
|
5775
5852
|
var import_react_dom10 = require("react-dom");
|
|
5776
5853
|
function ownRowAttrs(p) {
|
|
5777
5854
|
if (!p) return null;
|
|
@@ -5807,7 +5884,7 @@ function hidePx(c) {
|
|
|
5807
5884
|
var ROW_H_DEFAULT = 48;
|
|
5808
5885
|
var OVERSCAN = 8;
|
|
5809
5886
|
var FLEX_MIN = 160;
|
|
5810
|
-
var DataTableImpl =
|
|
5887
|
+
var DataTableImpl = React34.forwardRef(function DataTable(props, ref) {
|
|
5811
5888
|
const t = useStrings();
|
|
5812
5889
|
const columns = props.columns || DEFAULT_COLUMNS;
|
|
5813
5890
|
const byKey = {};
|
|
@@ -5834,7 +5911,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5834
5911
|
);
|
|
5835
5912
|
const sort = sortState[0], setSort = sortState[1];
|
|
5836
5913
|
const selState = useMaybeControlled(props.selected, props.defaultSelected || [], null);
|
|
5837
|
-
const onSel =
|
|
5914
|
+
const onSel = React34.useRef(props.onSelectionChange);
|
|
5838
5915
|
onSel.current = props.onSelectionChange;
|
|
5839
5916
|
const canSelect = function(r2) {
|
|
5840
5917
|
return !!r2 && (!props.isRowSelectable || !!props.isRowSelectable(r2));
|
|
@@ -5854,7 +5931,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5854
5931
|
const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
|
|
5855
5932
|
return rejected[String(k)];
|
|
5856
5933
|
}).join("\0") + "#" + selected.join("\0");
|
|
5857
|
-
|
|
5934
|
+
React34.useEffect(
|
|
5858
5935
|
function() {
|
|
5859
5936
|
if (droppedSig !== "") setSelected(selected);
|
|
5860
5937
|
},
|
|
@@ -5891,19 +5968,19 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5891
5968
|
}),
|
|
5892
5969
|
props.onPinnedColumnsChange
|
|
5893
5970
|
);
|
|
5894
|
-
const widthState =
|
|
5971
|
+
const widthState = React34.useState({});
|
|
5895
5972
|
const widths = widthState[0], setWidths = widthState[1];
|
|
5896
|
-
const activeState =
|
|
5897
|
-
const scrollState =
|
|
5973
|
+
const activeState = React34.useState({ r: 1, c: 0 });
|
|
5974
|
+
const scrollState = React34.useState(0);
|
|
5898
5975
|
const scrollTop = scrollState[0], setScrollTop = scrollState[1];
|
|
5899
|
-
const scrolledX =
|
|
5900
|
-
const menuState =
|
|
5976
|
+
const scrolledX = React34.useState(false);
|
|
5977
|
+
const menuState = React34.useState(null);
|
|
5901
5978
|
const menu = menuState[0], setMenu = menuState[1];
|
|
5902
|
-
const dragState =
|
|
5979
|
+
const dragState = React34.useState(null);
|
|
5903
5980
|
const drag = dragState[0], setDrag = dragState[1];
|
|
5904
|
-
const gridRef =
|
|
5905
|
-
const wrapRef =
|
|
5906
|
-
const boxWidth =
|
|
5981
|
+
const gridRef = React34.useRef(null);
|
|
5982
|
+
const wrapRef = React34.useRef(null), wrapMerged = useMergedRef(ref, wrapRef);
|
|
5983
|
+
const boxWidth = React34.useState(null);
|
|
5907
5984
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
5908
5985
|
return c.hideBelow != null;
|
|
5909
5986
|
});
|
|
@@ -5913,7 +5990,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5913
5990
|
return px != null && a.indexOf(px) === i;
|
|
5914
5991
|
}).length
|
|
5915
5992
|
);
|
|
5916
|
-
|
|
5993
|
+
React34.useEffect(
|
|
5917
5994
|
function() {
|
|
5918
5995
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
5919
5996
|
const ro = new ResizeObserver(function(en) {
|
|
@@ -5959,8 +6036,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5959
6036
|
const px = hidePx(c);
|
|
5960
6037
|
return px != null && below(boxWidth[0], px);
|
|
5961
6038
|
}
|
|
5962
|
-
const scrollRef =
|
|
5963
|
-
const edgeState =
|
|
6039
|
+
const scrollRef = React34.useRef(null);
|
|
6040
|
+
const edgeState = React34.useState("");
|
|
5964
6041
|
const checkMoreX = function() {
|
|
5965
6042
|
const el = scrollRef.current;
|
|
5966
6043
|
if (!el) return;
|
|
@@ -5968,9 +6045,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5968
6045
|
const next = more ? [el.offsetTop, el.clientHeight, el.offsetWidth - el.clientWidth].join(" ") : "";
|
|
5969
6046
|
if (next !== edgeState[0]) edgeState[1](next);
|
|
5970
6047
|
};
|
|
5971
|
-
const checkRef =
|
|
6048
|
+
const checkRef = React34.useRef(checkMoreX);
|
|
5972
6049
|
checkRef.current = checkMoreX;
|
|
5973
|
-
|
|
6050
|
+
React34.useEffect(function() {
|
|
5974
6051
|
const el = scrollRef.current;
|
|
5975
6052
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
5976
6053
|
const ro = new ResizeObserver(function() {
|
|
@@ -5982,7 +6059,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5982
6059
|
ro.disconnect();
|
|
5983
6060
|
};
|
|
5984
6061
|
}, []);
|
|
5985
|
-
const tipState =
|
|
6062
|
+
const tipState = React34.useState(null), tip2 = tipState[0], setTip = tipState[1];
|
|
5986
6063
|
function showFull(e) {
|
|
5987
6064
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
5988
6065
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
@@ -5994,7 +6071,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5994
6071
|
setTip(null);
|
|
5995
6072
|
}
|
|
5996
6073
|
const tipEl = tip2 && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
5997
|
-
/* @__PURE__ */
|
|
6074
|
+
/* @__PURE__ */ React34.createElement(
|
|
5998
6075
|
"div",
|
|
5999
6076
|
{
|
|
6000
6077
|
className: "aura-tooltip aura-tooltip--above",
|
|
@@ -6005,7 +6082,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6005
6082
|
),
|
|
6006
6083
|
document.body
|
|
6007
6084
|
) : null;
|
|
6008
|
-
const rowH =
|
|
6085
|
+
const rowH = React34.useState(ROW_H_DEFAULT);
|
|
6009
6086
|
const ROW_H = rowH[0];
|
|
6010
6087
|
useIsoLayoutEffect(function() {
|
|
6011
6088
|
const el = wrapRef.current;
|
|
@@ -6013,8 +6090,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6013
6090
|
const v = parseFloat(getComputedStyle(el).getPropertyValue("--aura-table-row-height"));
|
|
6014
6091
|
if (v > 0 && v !== rowH[0]) rowH[1](v);
|
|
6015
6092
|
});
|
|
6016
|
-
const pending =
|
|
6017
|
-
const resizing =
|
|
6093
|
+
const pending = React34.useRef(null);
|
|
6094
|
+
const resizing = React34.useRef(false);
|
|
6018
6095
|
useIsoLayoutEffect(function() {
|
|
6019
6096
|
if (!gridRef.current || tabMode) return;
|
|
6020
6097
|
const els = gridRef.current.querySelectorAll(
|
|
@@ -6137,7 +6214,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6137
6214
|
return s;
|
|
6138
6215
|
}
|
|
6139
6216
|
const sortCol = sort && sort.key ? byKey[sort.key] : void 0;
|
|
6140
|
-
const view =
|
|
6217
|
+
const view = React34.useMemo(
|
|
6141
6218
|
function() {
|
|
6142
6219
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
6143
6220
|
const col = byKey[sort.key];
|
|
@@ -6179,8 +6256,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6179
6256
|
const pageRows = pageSize && !manual ? view.slice(first, first + pageSize) : view;
|
|
6180
6257
|
const canSortAny = !busy && (manual ? total > 1 : rows.length > 1);
|
|
6181
6258
|
const shownTotal = manual && props.totalRows == null ? first + rows.length : total;
|
|
6182
|
-
const prevCount =
|
|
6183
|
-
|
|
6259
|
+
const prevCount = React34.useRef(pageCount);
|
|
6260
|
+
React34.useEffect(
|
|
6184
6261
|
function() {
|
|
6185
6262
|
if (busy) return;
|
|
6186
6263
|
const before = prevCount.current;
|
|
@@ -6194,9 +6271,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6194
6271
|
[pageState[0], page, busy, pageCount]
|
|
6195
6272
|
);
|
|
6196
6273
|
const linkPaging = !!props.getPageHref && !props.onPageChange && !oneCallback;
|
|
6197
|
-
const prevLink =
|
|
6198
|
-
const jumpState =
|
|
6199
|
-
|
|
6274
|
+
const prevLink = React34.useRef(null), nextLink = React34.useRef(null), jumpLink = React34.useRef(null);
|
|
6275
|
+
const jumpState = React34.useState(null);
|
|
6276
|
+
React34.useEffect(
|
|
6200
6277
|
function() {
|
|
6201
6278
|
if (jumpState[0] == null) return;
|
|
6202
6279
|
if (jumpLink.current) jumpLink.current.click();
|
|
@@ -6247,7 +6324,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6247
6324
|
);
|
|
6248
6325
|
}
|
|
6249
6326
|
function rowLinkWrap(r2, content) {
|
|
6250
|
-
return rowHref ? /* @__PURE__ */
|
|
6327
|
+
return rowHref ? /* @__PURE__ */ React34.createElement(Link, { href: rowHref(r2), className: "aura-table__row-link" }, content) : content;
|
|
6251
6328
|
}
|
|
6252
6329
|
const height = props.height || 0;
|
|
6253
6330
|
const autoRows = props.rowHeight === "auto" && !height;
|
|
@@ -6291,8 +6368,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6291
6368
|
const acShown = nearestShown(ac, 1, function(cc) {
|
|
6292
6369
|
return !cardHidden[cc];
|
|
6293
6370
|
});
|
|
6294
|
-
const lastFocus =
|
|
6295
|
-
|
|
6371
|
+
const lastFocus = React34.useRef(null);
|
|
6372
|
+
React34.useEffect(
|
|
6296
6373
|
function() {
|
|
6297
6374
|
const was = lastFocus.current, g = gridRef.current;
|
|
6298
6375
|
if (!stacked || !was || !g || !g.contains(was) || was.getClientRects().length > 0) return;
|
|
@@ -6307,7 +6384,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6307
6384
|
if (!activeRendered) return r2 === 0 && c === ac ? 0 : -1;
|
|
6308
6385
|
return r2 === ar && c === acShown ? 0 : -1;
|
|
6309
6386
|
}
|
|
6310
|
-
|
|
6387
|
+
React34.useEffect(function() {
|
|
6311
6388
|
const p = pending.current;
|
|
6312
6389
|
if (!p || !gridRef.current) return;
|
|
6313
6390
|
let c = p.c;
|
|
@@ -6370,8 +6447,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6370
6447
|
return selSet[String(k)];
|
|
6371
6448
|
}).length;
|
|
6372
6449
|
const all = nSel > 0 && nSel === pageKeys.length;
|
|
6373
|
-
const anchor =
|
|
6374
|
-
const shiftClick =
|
|
6450
|
+
const anchor = React34.useRef(null);
|
|
6451
|
+
const shiftClick = React34.useRef(false);
|
|
6375
6452
|
function toggle(k, on, how) {
|
|
6376
6453
|
const same2 = function(x) {
|
|
6377
6454
|
return String(x) === String(k);
|
|
@@ -6527,14 +6604,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6527
6604
|
items2.push(
|
|
6528
6605
|
{
|
|
6529
6606
|
label: t.sortAsc,
|
|
6530
|
-
icon: /* @__PURE__ */
|
|
6607
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowUp, null),
|
|
6531
6608
|
onSelect: function() {
|
|
6532
6609
|
applySort({ key: c.key, dir: "asc" });
|
|
6533
6610
|
}
|
|
6534
6611
|
},
|
|
6535
6612
|
{
|
|
6536
6613
|
label: t.sortDesc,
|
|
6537
|
-
icon: /* @__PURE__ */
|
|
6614
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowDown, null),
|
|
6538
6615
|
onSelect: function() {
|
|
6539
6616
|
applySort({ key: c.key, dir: "desc" });
|
|
6540
6617
|
}
|
|
@@ -6544,7 +6621,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6544
6621
|
if (c.width != null)
|
|
6545
6622
|
items2.push({
|
|
6546
6623
|
label: isPinned(c) ? t.unpin : t.pin,
|
|
6547
|
-
icon: isPinned(c) ? /* @__PURE__ */
|
|
6624
|
+
icon: isPinned(c) ? /* @__PURE__ */ React34.createElement(IconPinOff, null) : /* @__PURE__ */ React34.createElement(IconPin, null),
|
|
6548
6625
|
onSelect: function() {
|
|
6549
6626
|
togglePin(c.key);
|
|
6550
6627
|
}
|
|
@@ -6553,7 +6630,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6553
6630
|
items2.push(
|
|
6554
6631
|
{
|
|
6555
6632
|
label: t.moveLeft,
|
|
6556
|
-
icon: /* @__PURE__ */
|
|
6633
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowLeft, null),
|
|
6557
6634
|
disabled: gi <= 0,
|
|
6558
6635
|
onSelect: function() {
|
|
6559
6636
|
moveCol(c.key, -1);
|
|
@@ -6561,7 +6638,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6561
6638
|
},
|
|
6562
6639
|
{
|
|
6563
6640
|
label: t.moveRight,
|
|
6564
|
-
icon: /* @__PURE__ */
|
|
6641
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowRight, null),
|
|
6565
6642
|
disabled: gi >= group.length - 1,
|
|
6566
6643
|
onSelect: function() {
|
|
6567
6644
|
moveCol(c.key, 1);
|
|
@@ -6572,7 +6649,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6572
6649
|
{ separator: true },
|
|
6573
6650
|
{
|
|
6574
6651
|
label: t.hideColumn,
|
|
6575
|
-
icon: /* @__PURE__ */
|
|
6652
|
+
icon: /* @__PURE__ */ React34.createElement(IconEyeOff, null),
|
|
6576
6653
|
disabled: shown.length <= 1,
|
|
6577
6654
|
onSelect: function() {
|
|
6578
6655
|
setHidden(c.key, true);
|
|
@@ -6593,7 +6670,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6593
6670
|
setHidden(k, on);
|
|
6594
6671
|
}
|
|
6595
6672
|
};
|
|
6596
|
-
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */
|
|
6673
|
+
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React34.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
|
|
6597
6674
|
}
|
|
6598
6675
|
function openMenu(kind, key, anchor2, rc) {
|
|
6599
6676
|
setMenu({ kind, key, anchor: anchor2, rc });
|
|
@@ -6670,10 +6747,10 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6670
6747
|
e.stopPropagation();
|
|
6671
6748
|
}
|
|
6672
6749
|
}
|
|
6673
|
-
const head = [/* @__PURE__ */
|
|
6750
|
+
const head = [/* @__PURE__ */ React34.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
6674
6751
|
if (selectable)
|
|
6675
6752
|
head.push(
|
|
6676
|
-
/* @__PURE__ */
|
|
6753
|
+
/* @__PURE__ */ React34.createElement(
|
|
6677
6754
|
"span",
|
|
6678
6755
|
{
|
|
6679
6756
|
key: "__sel",
|
|
@@ -6687,7 +6764,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6687
6764
|
activeState[1]({ r: 0, c: 0 });
|
|
6688
6765
|
}
|
|
6689
6766
|
},
|
|
6690
|
-
pageKeys.length ? /* @__PURE__ */
|
|
6767
|
+
pageKeys.length ? /* @__PURE__ */ React34.createElement(
|
|
6691
6768
|
Checkbox,
|
|
6692
6769
|
{
|
|
6693
6770
|
ref: props.selectAllRef,
|
|
@@ -6699,7 +6776,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6699
6776
|
onChange: toggleAll
|
|
6700
6777
|
}
|
|
6701
6778
|
) : null,
|
|
6702
|
-
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)
|
|
6703
6780
|
)
|
|
6704
6781
|
);
|
|
6705
6782
|
vis.forEach(function(c, i) {
|
|
@@ -6710,7 +6787,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6710
6787
|
const ariaSort = sort && canSortAny ? isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0 : own || (canSort ? "none" : void 0);
|
|
6711
6788
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
6712
6789
|
head.push(
|
|
6713
|
-
/* @__PURE__ */
|
|
6790
|
+
/* @__PURE__ */ React34.createElement(
|
|
6714
6791
|
"span",
|
|
6715
6792
|
{
|
|
6716
6793
|
key: c.key,
|
|
@@ -6761,7 +6838,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6761
6838
|
setDrag(null);
|
|
6762
6839
|
}
|
|
6763
6840
|
},
|
|
6764
|
-
/* @__PURE__ */
|
|
6841
|
+
/* @__PURE__ */ React34.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React34.createElement(
|
|
6765
6842
|
"button",
|
|
6766
6843
|
{
|
|
6767
6844
|
type: "button",
|
|
@@ -6773,14 +6850,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6773
6850
|
}
|
|
6774
6851
|
},
|
|
6775
6852
|
c.label,
|
|
6776
|
-
/* @__PURE__ */
|
|
6853
|
+
/* @__PURE__ */ React34.createElement(
|
|
6777
6854
|
Icon,
|
|
6778
6855
|
{
|
|
6779
|
-
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),
|
|
6780
6857
|
size: 12
|
|
6781
6858
|
}
|
|
6782
6859
|
)
|
|
6783
|
-
) : /* @__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(
|
|
6784
6861
|
"button",
|
|
6785
6862
|
{
|
|
6786
6863
|
type: "button",
|
|
@@ -6794,9 +6871,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6794
6871
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
6795
6872
|
}
|
|
6796
6873
|
},
|
|
6797
|
-
/* @__PURE__ */
|
|
6874
|
+
/* @__PURE__ */ React34.createElement(Icon, { name: /* @__PURE__ */ React34.createElement(IconEllipsis, null) })
|
|
6798
6875
|
) : null),
|
|
6799
|
-
canResize(c) ? /* @__PURE__ */
|
|
6876
|
+
canResize(c) ? /* @__PURE__ */ React34.createElement(
|
|
6800
6877
|
"span",
|
|
6801
6878
|
{
|
|
6802
6879
|
className: "aura-table__resize",
|
|
@@ -6818,7 +6895,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6818
6895
|
);
|
|
6819
6896
|
});
|
|
6820
6897
|
head.push(
|
|
6821
|
-
/* @__PURE__ */
|
|
6898
|
+
/* @__PURE__ */ React34.createElement(
|
|
6822
6899
|
"span",
|
|
6823
6900
|
{
|
|
6824
6901
|
key: "__gr",
|
|
@@ -6829,15 +6906,15 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6829
6906
|
);
|
|
6830
6907
|
function cellContent(c, r2) {
|
|
6831
6908
|
const v = r2[c.key];
|
|
6832
|
-
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;
|
|
6833
6910
|
}
|
|
6834
6911
|
function rowCells(r2, i, k, isSel) {
|
|
6835
6912
|
const ri = i + 1;
|
|
6836
6913
|
const selLabel = selectable && canSelect(r2) ? props.rowSelectLabel && props.rowSelectLabel(r2) || t.selectRow(k) : void 0;
|
|
6837
|
-
const cells = [/* @__PURE__ */
|
|
6914
|
+
const cells = [/* @__PURE__ */ React34.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
6838
6915
|
if (selectable)
|
|
6839
6916
|
cells.push(
|
|
6840
|
-
/* @__PURE__ */
|
|
6917
|
+
/* @__PURE__ */ React34.createElement(
|
|
6841
6918
|
"span",
|
|
6842
6919
|
{
|
|
6843
6920
|
key: "__sel",
|
|
@@ -6854,7 +6931,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6854
6931
|
shiftClick.current = e.shiftKey;
|
|
6855
6932
|
}
|
|
6856
6933
|
},
|
|
6857
|
-
canSelect(r2) ? /* @__PURE__ */
|
|
6934
|
+
canSelect(r2) ? /* @__PURE__ */ React34.createElement(
|
|
6858
6935
|
Checkbox,
|
|
6859
6936
|
{
|
|
6860
6937
|
hideLabel: true,
|
|
@@ -6873,7 +6950,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6873
6950
|
vis.forEach(function(c, j) {
|
|
6874
6951
|
const ci = j + (selectable ? 1 : 0), v = r2[c.key], pin = isPinned(c);
|
|
6875
6952
|
cells.push(
|
|
6876
|
-
/* @__PURE__ */
|
|
6953
|
+
/* @__PURE__ */ React34.createElement(
|
|
6877
6954
|
"span",
|
|
6878
6955
|
{
|
|
6879
6956
|
key: c.key,
|
|
@@ -6895,13 +6972,13 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6895
6972
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
6896
6973
|
}
|
|
6897
6974
|
},
|
|
6898
|
-
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)
|
|
6899
6976
|
)
|
|
6900
6977
|
);
|
|
6901
6978
|
});
|
|
6902
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
6979
|
+
if (hasFields) cells.push(/* @__PURE__ */ React34.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
6903
6980
|
cells.push(
|
|
6904
|
-
/* @__PURE__ */
|
|
6981
|
+
/* @__PURE__ */ React34.createElement(
|
|
6905
6982
|
"span",
|
|
6906
6983
|
{
|
|
6907
6984
|
key: "__gr",
|
|
@@ -6918,17 +6995,17 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6918
6995
|
const n3 = pageSize || props.skeletonRows || 5;
|
|
6919
6996
|
const skRows = body = [];
|
|
6920
6997
|
for (let i = 0; i < n3; i++) {
|
|
6921
|
-
const sk = [/* @__PURE__ */
|
|
6998
|
+
const sk = [/* @__PURE__ */ React34.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
6922
6999
|
if (selectable)
|
|
6923
7000
|
sk.push(
|
|
6924
|
-
/* @__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" }))
|
|
6925
7002
|
);
|
|
6926
7003
|
vis.forEach(function(c, j) {
|
|
6927
7004
|
const part = cardPart(c, j);
|
|
6928
7005
|
const action = part === "footer" || part === "actions";
|
|
6929
7006
|
const lines = c.pill ? 1 : Math.max(1, Math.min(10, Math.floor(Number(c.skeletonLines)) || 1));
|
|
6930
7007
|
const bar = function(n4) {
|
|
6931
|
-
return /* @__PURE__ */
|
|
7008
|
+
return /* @__PURE__ */ React34.createElement(
|
|
6932
7009
|
"span",
|
|
6933
7010
|
{
|
|
6934
7011
|
key: n4,
|
|
@@ -6940,7 +7017,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6940
7017
|
const bars2 = [];
|
|
6941
7018
|
for (let b = 0; b < lines; b++) bars2.push(bar(b));
|
|
6942
7019
|
sk.push(
|
|
6943
|
-
/* @__PURE__ */
|
|
7020
|
+
/* @__PURE__ */ React34.createElement(
|
|
6944
7021
|
"span",
|
|
6945
7022
|
{
|
|
6946
7023
|
key: c.key,
|
|
@@ -6953,7 +7030,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6953
7030
|
style: cellStyle(c, j),
|
|
6954
7031
|
...cardAttrs(c, j)
|
|
6955
7032
|
},
|
|
6956
|
-
action ? /* @__PURE__ */
|
|
7033
|
+
action ? /* @__PURE__ */ React34.createElement(
|
|
6957
7034
|
"span",
|
|
6958
7035
|
{
|
|
6959
7036
|
className: cx(
|
|
@@ -6962,16 +7039,16 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6962
7039
|
c.skeletonTouch && "is-touch"
|
|
6963
7040
|
)
|
|
6964
7041
|
}
|
|
6965
|
-
) : lines > 1 ? /* @__PURE__ */
|
|
7042
|
+
) : lines > 1 ? /* @__PURE__ */ React34.createElement("span", { className: "aura-skel-lines" }, bars2) : bars2[0]
|
|
6966
7043
|
)
|
|
6967
7044
|
);
|
|
6968
7045
|
});
|
|
6969
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
7046
|
+
if (hasFields) sk.push(/* @__PURE__ */ React34.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
6970
7047
|
sk.push(
|
|
6971
|
-
/* @__PURE__ */
|
|
7048
|
+
/* @__PURE__ */ React34.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
6972
7049
|
);
|
|
6973
7050
|
skRows.push(
|
|
6974
|
-
/* @__PURE__ */
|
|
7051
|
+
/* @__PURE__ */ React34.createElement(
|
|
6975
7052
|
"div",
|
|
6976
7053
|
{
|
|
6977
7054
|
key: "sk" + i,
|
|
@@ -6985,18 +7062,18 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6985
7062
|
}
|
|
6986
7063
|
} else if (!rows.length) {
|
|
6987
7064
|
const em = props.empty || {};
|
|
6988
|
-
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));
|
|
6989
7066
|
} else {
|
|
6990
7067
|
const bodyRows = body = [];
|
|
6991
7068
|
if (virtual && start > 0)
|
|
6992
7069
|
bodyRows.push(
|
|
6993
|
-
/* @__PURE__ */
|
|
7070
|
+
/* @__PURE__ */ React34.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
6994
7071
|
);
|
|
6995
7072
|
for (let ri = start; ri < end; ri++) {
|
|
6996
7073
|
(function(r2, i) {
|
|
6997
7074
|
const k = r2[rowKey], isSel = !!selSet[k];
|
|
6998
7075
|
bodyRows.push(
|
|
6999
|
-
/* @__PURE__ */
|
|
7076
|
+
/* @__PURE__ */ React34.createElement(
|
|
7000
7077
|
"div",
|
|
7001
7078
|
{
|
|
7002
7079
|
key: k,
|
|
@@ -7025,7 +7102,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7025
7102
|
}
|
|
7026
7103
|
if (virtual && end < pageRows.length)
|
|
7027
7104
|
bodyRows.push(
|
|
7028
|
-
/* @__PURE__ */
|
|
7105
|
+
/* @__PURE__ */ React34.createElement(
|
|
7029
7106
|
"div",
|
|
7030
7107
|
{
|
|
7031
7108
|
key: "__bot",
|
|
@@ -7038,9 +7115,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7038
7115
|
}
|
|
7039
7116
|
let foot = null;
|
|
7040
7117
|
function pagerButton(dir) {
|
|
7041
|
-
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);
|
|
7042
7119
|
if (props.getPageHref && !off)
|
|
7043
|
-
return /* @__PURE__ */
|
|
7120
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7044
7121
|
Link,
|
|
7045
7122
|
{
|
|
7046
7123
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -7055,9 +7132,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7055
7132
|
}
|
|
7056
7133
|
}
|
|
7057
7134
|
},
|
|
7058
|
-
/* @__PURE__ */
|
|
7135
|
+
/* @__PURE__ */ React34.createElement(Icon, { name: icon })
|
|
7059
7136
|
);
|
|
7060
|
-
return /* @__PURE__ */
|
|
7137
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7061
7138
|
IconButton,
|
|
7062
7139
|
{
|
|
7063
7140
|
icon,
|
|
@@ -7072,11 +7149,11 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7072
7149
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
7073
7150
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
7074
7151
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
7075
|
-
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)));
|
|
7076
7153
|
} else if (height && rows.length && !loading) {
|
|
7077
|
-
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));
|
|
7078
7155
|
}
|
|
7079
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
7156
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React34.createElement(
|
|
7080
7157
|
"div",
|
|
7081
7158
|
{
|
|
7082
7159
|
role: "row",
|
|
@@ -7085,8 +7162,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7085
7162
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
7086
7163
|
style: rowStyle
|
|
7087
7164
|
},
|
|
7088
|
-
/* @__PURE__ */
|
|
7089
|
-
selectable ? /* @__PURE__ */
|
|
7165
|
+
/* @__PURE__ */ React34.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
7166
|
+
selectable ? /* @__PURE__ */ React34.createElement(
|
|
7090
7167
|
"span",
|
|
7091
7168
|
{
|
|
7092
7169
|
role: "gridcell",
|
|
@@ -7101,7 +7178,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7101
7178
|
) : null,
|
|
7102
7179
|
vis.map(function(c, j) {
|
|
7103
7180
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
7104
|
-
return /* @__PURE__ */
|
|
7181
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7105
7182
|
"span",
|
|
7106
7183
|
{
|
|
7107
7184
|
key: c.key,
|
|
@@ -7127,8 +7204,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7127
7204
|
props.footer[c.key]
|
|
7128
7205
|
);
|
|
7129
7206
|
}),
|
|
7130
|
-
hasFields ? /* @__PURE__ */
|
|
7131
|
-
/* @__PURE__ */
|
|
7207
|
+
hasFields ? /* @__PURE__ */ React34.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
7208
|
+
/* @__PURE__ */ React34.createElement(
|
|
7132
7209
|
"span",
|
|
7133
7210
|
{
|
|
7134
7211
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -7142,7 +7219,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7142
7219
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
7143
7220
|
};
|
|
7144
7221
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
7145
|
-
const gridEl = /* @__PURE__ */
|
|
7222
|
+
const gridEl = /* @__PURE__ */ React34.createElement(
|
|
7146
7223
|
"div",
|
|
7147
7224
|
{
|
|
7148
7225
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -7163,8 +7240,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7163
7240
|
),
|
|
7164
7241
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
7165
7242
|
},
|
|
7166
|
-
refreshing ? /* @__PURE__ */
|
|
7167
|
-
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(
|
|
7168
7245
|
"span",
|
|
7169
7246
|
{
|
|
7170
7247
|
className: "aura-table__edge",
|
|
@@ -7176,7 +7253,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7176
7253
|
}
|
|
7177
7254
|
}
|
|
7178
7255
|
) : null,
|
|
7179
|
-
/* @__PURE__ */
|
|
7256
|
+
/* @__PURE__ */ React34.createElement(
|
|
7180
7257
|
"div",
|
|
7181
7258
|
{
|
|
7182
7259
|
ref: function(el) {
|
|
@@ -7214,7 +7291,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7214
7291
|
checkMoreX();
|
|
7215
7292
|
}
|
|
7216
7293
|
},
|
|
7217
|
-
/* @__PURE__ */
|
|
7294
|
+
/* @__PURE__ */ React34.createElement(
|
|
7218
7295
|
"div",
|
|
7219
7296
|
{
|
|
7220
7297
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -7227,11 +7304,11 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7227
7304
|
body,
|
|
7228
7305
|
totalRow
|
|
7229
7306
|
),
|
|
7230
|
-
busy ? /* @__PURE__ */
|
|
7231
|
-
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(
|
|
7232
7309
|
IconButton,
|
|
7233
7310
|
{
|
|
7234
|
-
icon: /* @__PURE__ */
|
|
7311
|
+
icon: /* @__PURE__ */ React34.createElement(IconColumns3, null),
|
|
7235
7312
|
label: t.showHideColumns,
|
|
7236
7313
|
"aria-haspopup": "menu",
|
|
7237
7314
|
onClick: function(e) {
|
|
@@ -7240,7 +7317,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7240
7317
|
}
|
|
7241
7318
|
)) : null,
|
|
7242
7319
|
foot,
|
|
7243
|
-
menu ? /* @__PURE__ */
|
|
7320
|
+
menu ? /* @__PURE__ */ React34.createElement(
|
|
7244
7321
|
Menu,
|
|
7245
7322
|
{
|
|
7246
7323
|
anchor: menu.anchor,
|
|
@@ -7250,13 +7327,13 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7250
7327
|
}
|
|
7251
7328
|
) : null,
|
|
7252
7329
|
tipEl,
|
|
7253
|
-
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
|
|
7254
7331
|
);
|
|
7255
7332
|
if (!levels.length) return gridEl;
|
|
7256
7333
|
let out = gridEl;
|
|
7257
7334
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
7258
7335
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
7259
|
-
out = /* @__PURE__ */
|
|
7336
|
+
out = /* @__PURE__ */ React34.createElement(
|
|
7260
7337
|
"div",
|
|
7261
7338
|
{
|
|
7262
7339
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -7265,7 +7342,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7265
7342
|
out
|
|
7266
7343
|
);
|
|
7267
7344
|
}
|
|
7268
|
-
return /* @__PURE__ */
|
|
7345
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7269
7346
|
"div",
|
|
7270
7347
|
{
|
|
7271
7348
|
ref,
|
|
@@ -7282,14 +7359,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7282
7359
|
var DataTable2 = DataTableImpl;
|
|
7283
7360
|
|
|
7284
7361
|
// src/Card.tsx
|
|
7285
|
-
var
|
|
7286
|
-
var Card =
|
|
7362
|
+
var React35 = __toESM(require("react"), 1);
|
|
7363
|
+
var Card = React35.forwardRef(function Card2(props, ref) {
|
|
7287
7364
|
return cardElement(props, ref);
|
|
7288
7365
|
});
|
|
7289
7366
|
|
|
7290
7367
|
// src/Tabs.tsx
|
|
7291
|
-
var
|
|
7292
|
-
var Tabs =
|
|
7368
|
+
var React36 = __toESM(require("react"), 1);
|
|
7369
|
+
var Tabs = React36.forwardRef(function Tabs2(props, ref) {
|
|
7293
7370
|
const items2 = props.tabs || [], base = uid();
|
|
7294
7371
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
7295
7372
|
return !!t.href;
|
|
@@ -7303,7 +7380,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7303
7380
|
props.onChange
|
|
7304
7381
|
);
|
|
7305
7382
|
const cur2 = asLinks && "value" in props ? props.value : st[0];
|
|
7306
|
-
const refs =
|
|
7383
|
+
const refs = React36.useRef({});
|
|
7307
7384
|
const current2 = items2.filter(function(t) {
|
|
7308
7385
|
return t.id === cur2;
|
|
7309
7386
|
})[0] || firstOn || items2[0];
|
|
@@ -7321,7 +7398,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7321
7398
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
7322
7399
|
};
|
|
7323
7400
|
const rootCls = cx("aura-tabs", seg && "aura-tabs--segmented", touchClass(props.touchHeight));
|
|
7324
|
-
const [focusId, setFocusId] =
|
|
7401
|
+
const [focusId, setFocusId] = React36.useState(null);
|
|
7325
7402
|
items2.forEach(function(t) {
|
|
7326
7403
|
const al = t.tabProps && t.tabProps["aria-label"];
|
|
7327
7404
|
if (al && al.toLowerCase().indexOf(String(t.label).toLowerCase()) !== 0)
|
|
@@ -7331,19 +7408,19 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7331
7408
|
);
|
|
7332
7409
|
});
|
|
7333
7410
|
if (asLinks)
|
|
7334
|
-
return /* @__PURE__ */
|
|
7411
|
+
return /* @__PURE__ */ React36.createElement(
|
|
7335
7412
|
"nav",
|
|
7336
7413
|
{
|
|
7337
7414
|
ref,
|
|
7338
7415
|
"aria-label": props.label,
|
|
7339
7416
|
className: cx(rootCls, "aura-tabs--links", props.className)
|
|
7340
7417
|
},
|
|
7341
|
-
/* @__PURE__ */
|
|
7418
|
+
/* @__PURE__ */ React36.createElement("div", { className: listCls }, items2.map(function(t) {
|
|
7342
7419
|
const on = t.id === cur2;
|
|
7343
7420
|
const inner = [
|
|
7344
|
-
t.icon ? /* @__PURE__ */
|
|
7421
|
+
t.icon ? /* @__PURE__ */ React36.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
7345
7422
|
t.label,
|
|
7346
|
-
t.count != null ? /* @__PURE__ */
|
|
7423
|
+
t.count != null ? /* @__PURE__ */ React36.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
7347
7424
|
];
|
|
7348
7425
|
const own = omit(t.tabProps || {}, [
|
|
7349
7426
|
"type",
|
|
@@ -7357,7 +7434,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7357
7434
|
"name",
|
|
7358
7435
|
"value"
|
|
7359
7436
|
]);
|
|
7360
|
-
return t.disabled ? /* @__PURE__ */
|
|
7437
|
+
return t.disabled ? /* @__PURE__ */ React36.createElement(
|
|
7361
7438
|
"span",
|
|
7362
7439
|
{
|
|
7363
7440
|
...omit(own, ["onClick"]),
|
|
@@ -7366,7 +7443,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7366
7443
|
"aria-disabled": true
|
|
7367
7444
|
},
|
|
7368
7445
|
inner
|
|
7369
|
-
) : /* @__PURE__ */
|
|
7446
|
+
) : /* @__PURE__ */ React36.createElement(
|
|
7370
7447
|
Link,
|
|
7371
7448
|
{
|
|
7372
7449
|
...own,
|
|
@@ -7396,7 +7473,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7396
7473
|
const stop2 = manual && focusId && items2.filter(function(t) {
|
|
7397
7474
|
return t.id === focusId && !t.disabled;
|
|
7398
7475
|
})[0] || current2;
|
|
7399
|
-
return /* @__PURE__ */
|
|
7476
|
+
return /* @__PURE__ */ React36.createElement("div", { ref, className: cx(rootCls, props.className) }, /* @__PURE__ */ React36.createElement(
|
|
7400
7477
|
"div",
|
|
7401
7478
|
{
|
|
7402
7479
|
role: "tablist",
|
|
@@ -7429,7 +7506,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7429
7506
|
items2.map(function(t) {
|
|
7430
7507
|
const on = current2 && t.id === current2.id;
|
|
7431
7508
|
const own = t.tabProps || {};
|
|
7432
|
-
return /* @__PURE__ */
|
|
7509
|
+
return /* @__PURE__ */ React36.createElement(
|
|
7433
7510
|
"button",
|
|
7434
7511
|
{
|
|
7435
7512
|
...own,
|
|
@@ -7456,9 +7533,9 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7456
7533
|
st[1](t.id);
|
|
7457
7534
|
}
|
|
7458
7535
|
},
|
|
7459
|
-
t.icon ? /* @__PURE__ */
|
|
7536
|
+
t.icon ? /* @__PURE__ */ React36.createElement(Icon, { name: t.icon }) : null,
|
|
7460
7537
|
t.label,
|
|
7461
|
-
t.count != null ? /* @__PURE__ */
|
|
7538
|
+
t.count != null ? /* @__PURE__ */ React36.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
7462
7539
|
);
|
|
7463
7540
|
})
|
|
7464
7541
|
), props.keepMounted ? (
|
|
@@ -7466,7 +7543,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7466
7543
|
items2.map(function(t) {
|
|
7467
7544
|
if (t.content === void 0) return null;
|
|
7468
7545
|
const on = current2 && t.id === current2.id;
|
|
7469
|
-
return /* @__PURE__ */
|
|
7546
|
+
return /* @__PURE__ */ React36.createElement(
|
|
7470
7547
|
"div",
|
|
7471
7548
|
{
|
|
7472
7549
|
key: t.id,
|
|
@@ -7480,7 +7557,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7480
7557
|
t.content
|
|
7481
7558
|
);
|
|
7482
7559
|
})
|
|
7483
|
-
) : current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
7560
|
+
) : current2 && current2.content !== void 0 ? /* @__PURE__ */ React36.createElement(
|
|
7484
7561
|
"div",
|
|
7485
7562
|
{
|
|
7486
7563
|
role: "tabpanel",
|
|
@@ -7494,14 +7571,14 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7494
7571
|
});
|
|
7495
7572
|
|
|
7496
7573
|
// src/SideNav.tsx
|
|
7497
|
-
var
|
|
7574
|
+
var React37 = __toESM(require("react"), 1);
|
|
7498
7575
|
var import_react_dom11 = require("react-dom");
|
|
7499
7576
|
function contains(it, id) {
|
|
7500
7577
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
7501
7578
|
return c.id === id || contains(c, id);
|
|
7502
7579
|
});
|
|
7503
7580
|
}
|
|
7504
|
-
var SideNav =
|
|
7581
|
+
var SideNav = React37.forwardRef(function SideNav2(props, ref) {
|
|
7505
7582
|
const t = useStrings();
|
|
7506
7583
|
const Link = useLinkComponent(props.linkComponent);
|
|
7507
7584
|
const base = uid();
|
|
@@ -7513,14 +7590,14 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7513
7590
|
const active = st[0];
|
|
7514
7591
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
7515
7592
|
const collapsed = col[0];
|
|
7516
|
-
const tipState =
|
|
7517
|
-
|
|
7593
|
+
const tipState = React37.useState(null), tip2 = tipState[0], setTip = tipState[1];
|
|
7594
|
+
React37.useEffect(
|
|
7518
7595
|
function() {
|
|
7519
7596
|
if (!collapsed) setTip(null);
|
|
7520
7597
|
},
|
|
7521
7598
|
[collapsed]
|
|
7522
7599
|
);
|
|
7523
|
-
|
|
7600
|
+
React37.useEffect(
|
|
7524
7601
|
function() {
|
|
7525
7602
|
if (!tip2) return;
|
|
7526
7603
|
function esc(e) {
|
|
@@ -7545,12 +7622,12 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7545
7622
|
return { onMouseEnter: show3, onFocus: show3, onMouseLeave: hide2, onBlur: hide2 };
|
|
7546
7623
|
}
|
|
7547
7624
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
7548
|
-
const openState =
|
|
7625
|
+
const openState = React37.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
7549
7626
|
function isOpen(it) {
|
|
7550
7627
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
7551
7628
|
return !!it.defaultOpen || contains(it, active);
|
|
7552
7629
|
}
|
|
7553
|
-
|
|
7630
|
+
React37.useEffect(
|
|
7554
7631
|
function() {
|
|
7555
7632
|
if (!active) return;
|
|
7556
7633
|
const next = {};
|
|
@@ -7572,7 +7649,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7572
7649
|
},
|
|
7573
7650
|
[active]
|
|
7574
7651
|
);
|
|
7575
|
-
const navRef =
|
|
7652
|
+
const navRef = React37.useRef(null);
|
|
7576
7653
|
function onKeyDown(e) {
|
|
7577
7654
|
const k = e.key;
|
|
7578
7655
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -7591,12 +7668,12 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7591
7668
|
function inner(it, group, open) {
|
|
7592
7669
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
7593
7670
|
return [
|
|
7594
|
-
it.icon ? /* @__PURE__ */
|
|
7595
|
-
collapsed && marked ? /* @__PURE__ */
|
|
7596
|
-
/* @__PURE__ */
|
|
7597
|
-
it.badge != null ? /* @__PURE__ */
|
|
7598
|
-
it.count != null ? /* @__PURE__ */
|
|
7599
|
-
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
|
|
7600
7677
|
];
|
|
7601
7678
|
}
|
|
7602
7679
|
function item(it, depth) {
|
|
@@ -7604,7 +7681,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7604
7681
|
const open = !collapsed && isOpen(it);
|
|
7605
7682
|
const listId = base + "-" + it.id;
|
|
7606
7683
|
const holdsActive = contains(it, active);
|
|
7607
|
-
return /* @__PURE__ */
|
|
7684
|
+
return /* @__PURE__ */ React37.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React37.createElement(
|
|
7608
7685
|
"button",
|
|
7609
7686
|
{
|
|
7610
7687
|
type: "button",
|
|
@@ -7633,7 +7710,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7633
7710
|
}
|
|
7634
7711
|
},
|
|
7635
7712
|
inner(it, true, open)
|
|
7636
|
-
), /* @__PURE__ */
|
|
7713
|
+
), /* @__PURE__ */ React37.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
7637
7714
|
return item(c, depth + 1);
|
|
7638
7715
|
})));
|
|
7639
7716
|
}
|
|
@@ -7652,9 +7729,9 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7652
7729
|
if (action && props.onAction) props.onAction(it.id);
|
|
7653
7730
|
}
|
|
7654
7731
|
};
|
|
7655
|
-
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)));
|
|
7656
7733
|
}
|
|
7657
|
-
return /* @__PURE__ */
|
|
7734
|
+
return /* @__PURE__ */ React37.createElement(
|
|
7658
7735
|
"nav",
|
|
7659
7736
|
{
|
|
7660
7737
|
ref: function(el) {
|
|
@@ -7674,14 +7751,14 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7674
7751
|
"aria-label": props.label || t.mainNav,
|
|
7675
7752
|
onKeyDown
|
|
7676
7753
|
},
|
|
7677
|
-
props.header ? /* @__PURE__ */
|
|
7678
|
-
/* @__PURE__ */
|
|
7679
|
-
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) {
|
|
7680
7757
|
return item(it, 0);
|
|
7681
7758
|
})));
|
|
7682
7759
|
})),
|
|
7683
|
-
props.footer ? /* @__PURE__ */
|
|
7684
|
-
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(
|
|
7685
7762
|
"button",
|
|
7686
7763
|
{
|
|
7687
7764
|
type: "button",
|
|
@@ -7692,12 +7769,12 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7692
7769
|
col[1](!collapsed);
|
|
7693
7770
|
}
|
|
7694
7771
|
},
|
|
7695
|
-
/* @__PURE__ */
|
|
7696
|
-
/* @__PURE__ */
|
|
7697
|
-
)) : 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(
|
|
7698
7775
|
IconButton,
|
|
7699
7776
|
{
|
|
7700
|
-
icon: collapsed ? /* @__PURE__ */
|
|
7777
|
+
icon: collapsed ? /* @__PURE__ */ React37.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React37.createElement(IconPanelLeftClose, null),
|
|
7701
7778
|
label: collapsed ? t.expandNav : t.collapseNav,
|
|
7702
7779
|
size: "md",
|
|
7703
7780
|
onClick: function() {
|
|
@@ -7707,7 +7784,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7707
7784
|
}
|
|
7708
7785
|
)) : null,
|
|
7709
7786
|
tip2 && typeof document !== "undefined" ? (0, import_react_dom11.createPortal)(
|
|
7710
|
-
/* @__PURE__ */
|
|
7787
|
+
/* @__PURE__ */ React37.createElement(
|
|
7711
7788
|
"div",
|
|
7712
7789
|
{
|
|
7713
7790
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -7722,8 +7799,8 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7722
7799
|
});
|
|
7723
7800
|
|
|
7724
7801
|
// src/Breadcrumb.tsx
|
|
7725
|
-
var
|
|
7726
|
-
var Breadcrumb =
|
|
7802
|
+
var React38 = __toESM(require("react"), 1);
|
|
7803
|
+
var Breadcrumb = React38.forwardRef(function Breadcrumb2(props, ref) {
|
|
7727
7804
|
const t = useStrings();
|
|
7728
7805
|
const Link = useLinkComponent(props.linkComponent);
|
|
7729
7806
|
const items2 = props.items || [];
|
|
@@ -7731,12 +7808,12 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7731
7808
|
const trail = items2.map(function(it) {
|
|
7732
7809
|
return it.label + "" + (it.href || "");
|
|
7733
7810
|
}).join("");
|
|
7734
|
-
const st =
|
|
7811
|
+
const st = React38.useState(null), expanded = st[0] === trail, setExpanded = function() {
|
|
7735
7812
|
st[1](trail);
|
|
7736
7813
|
};
|
|
7737
|
-
const listRef =
|
|
7738
|
-
const focusNext =
|
|
7739
|
-
|
|
7814
|
+
const listRef = React38.useRef(null);
|
|
7815
|
+
const focusNext = React38.useRef(false);
|
|
7816
|
+
React38.useEffect(
|
|
7740
7817
|
function() {
|
|
7741
7818
|
if (!expanded || !focusNext.current) return;
|
|
7742
7819
|
focusNext.current = false;
|
|
@@ -7751,8 +7828,8 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7751
7828
|
},
|
|
7752
7829
|
[expanded]
|
|
7753
7830
|
);
|
|
7754
|
-
const sep = /* @__PURE__ */
|
|
7755
|
-
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(
|
|
7756
7833
|
"button",
|
|
7757
7834
|
{
|
|
7758
7835
|
type: "button",
|
|
@@ -7775,23 +7852,23 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7775
7852
|
if (it.onClick) it.onClick();
|
|
7776
7853
|
} : void 0;
|
|
7777
7854
|
out.push(
|
|
7778
|
-
/* @__PURE__ */
|
|
7855
|
+
/* @__PURE__ */ React38.createElement(
|
|
7779
7856
|
"li",
|
|
7780
7857
|
{
|
|
7781
7858
|
key: i,
|
|
7782
7859
|
...it.itemProps,
|
|
7783
7860
|
className: cx(it.itemProps && it.itemProps.className, collapsible && !last && i > 0 && "aura-crumbs__middle") || void 0
|
|
7784
7861
|
},
|
|
7785
|
-
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) : (
|
|
7786
7863
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
7787
|
-
/* @__PURE__ */
|
|
7864
|
+
/* @__PURE__ */ React38.createElement("span", { ...plain, className: cx("aura-crumbs__text", lp.className) }, it.label)
|
|
7788
7865
|
),
|
|
7789
7866
|
last ? null : sep
|
|
7790
7867
|
)
|
|
7791
7868
|
);
|
|
7792
7869
|
if (i === 0 && more) out.push(more);
|
|
7793
7870
|
});
|
|
7794
|
-
return /* @__PURE__ */
|
|
7871
|
+
return /* @__PURE__ */ React38.createElement(
|
|
7795
7872
|
"nav",
|
|
7796
7873
|
{
|
|
7797
7874
|
ref,
|
|
@@ -7802,27 +7879,27 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7802
7879
|
props.className
|
|
7803
7880
|
)
|
|
7804
7881
|
},
|
|
7805
|
-
/* @__PURE__ */
|
|
7882
|
+
/* @__PURE__ */ React38.createElement("ol", { ref: listRef }, out)
|
|
7806
7883
|
);
|
|
7807
7884
|
});
|
|
7808
7885
|
|
|
7809
7886
|
// src/Avatar.tsx
|
|
7810
|
-
var
|
|
7811
|
-
var Avatar =
|
|
7812
|
-
const errState =
|
|
7887
|
+
var React39 = __toESM(require("react"), 1);
|
|
7888
|
+
var Avatar = React39.forwardRef(function Avatar2(props, ref) {
|
|
7889
|
+
const errState = React39.useState(null);
|
|
7813
7890
|
return avatarElement(props, ref, errState[0], function() {
|
|
7814
7891
|
errState[1](props.src || null);
|
|
7815
7892
|
});
|
|
7816
7893
|
});
|
|
7817
7894
|
|
|
7818
7895
|
// src/Stack.tsx
|
|
7819
|
-
var
|
|
7896
|
+
var React41 = __toESM(require("react"), 1);
|
|
7820
7897
|
|
|
7821
7898
|
// src/responsive.tsx
|
|
7822
|
-
var
|
|
7899
|
+
var React40 = __toESM(require("react"), 1);
|
|
7823
7900
|
var ORDER2 = ["base", "sm", "md", "lg", "xl"];
|
|
7824
7901
|
function useBreakpoint() {
|
|
7825
|
-
return
|
|
7902
|
+
return React40.useSyncExternalStore(subscribe, current, function() {
|
|
7826
7903
|
return "lg";
|
|
7827
7904
|
});
|
|
7828
7905
|
}
|
|
@@ -7848,8 +7925,8 @@ function useResponsive(value) {
|
|
|
7848
7925
|
}
|
|
7849
7926
|
|
|
7850
7927
|
// src/Stack.tsx
|
|
7851
|
-
var h5 =
|
|
7852
|
-
var Stack =
|
|
7928
|
+
var h5 = React41.createElement;
|
|
7929
|
+
var Stack = React41.forwardRef(function Stack2(props, ref) {
|
|
7853
7930
|
const style = Object.assign(
|
|
7854
7931
|
{},
|
|
7855
7932
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -7863,9 +7940,9 @@ var Stack = React40.forwardRef(function Stack2(props, ref) {
|
|
|
7863
7940
|
});
|
|
7864
7941
|
|
|
7865
7942
|
// src/Grid.tsx
|
|
7866
|
-
var
|
|
7867
|
-
var h6 =
|
|
7868
|
-
var Grid =
|
|
7943
|
+
var React42 = __toESM(require("react"), 1);
|
|
7944
|
+
var h6 = React42.createElement;
|
|
7945
|
+
var Grid = React42.forwardRef(function Grid2(props, ref) {
|
|
7869
7946
|
const style = Object.assign(
|
|
7870
7947
|
{},
|
|
7871
7948
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -7880,9 +7957,9 @@ var Grid = React41.forwardRef(function Grid2(props, ref) {
|
|
|
7880
7957
|
});
|
|
7881
7958
|
|
|
7882
7959
|
// src/Container.tsx
|
|
7883
|
-
var
|
|
7884
|
-
var h7 =
|
|
7885
|
-
var Container =
|
|
7960
|
+
var React43 = __toESM(require("react"), 1);
|
|
7961
|
+
var h7 = React43.createElement;
|
|
7962
|
+
var Container = React43.forwardRef(function Container2(props, ref) {
|
|
7886
7963
|
const attrs2 = {};
|
|
7887
7964
|
Object.keys(props).forEach(function(k) {
|
|
7888
7965
|
if (k === "id" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
@@ -7905,11 +7982,11 @@ var Container = React42.forwardRef(function Container2(props, ref) {
|
|
|
7905
7982
|
});
|
|
7906
7983
|
|
|
7907
7984
|
// src/PageHeaderClient.tsx
|
|
7908
|
-
var
|
|
7985
|
+
var React45 = __toESM(require("react"), 1);
|
|
7909
7986
|
|
|
7910
7987
|
// src/PageHeader.tsx
|
|
7911
|
-
var
|
|
7912
|
-
var h8 =
|
|
7988
|
+
var React44 = __toESM(require("react"), 1);
|
|
7989
|
+
var h8 = React44.createElement;
|
|
7913
7990
|
var LAZY = Symbol.for("react.lazy");
|
|
7914
7991
|
function chipsOnly(node) {
|
|
7915
7992
|
let el = 0;
|
|
@@ -7928,8 +8005,8 @@ function chipsOnly(node) {
|
|
|
7928
8005
|
}
|
|
7929
8006
|
return walk(value);
|
|
7930
8007
|
}
|
|
7931
|
-
if (
|
|
7932
|
-
if (n3.type ===
|
|
8008
|
+
if (React44.isValidElement(n3)) {
|
|
8009
|
+
if (n3.type === React44.Fragment) return walk(n3.props.children);
|
|
7933
8010
|
el++;
|
|
7934
8011
|
return true;
|
|
7935
8012
|
}
|
|
@@ -7937,7 +8014,7 @@ function chipsOnly(node) {
|
|
|
7937
8014
|
};
|
|
7938
8015
|
return walk(node) && el > 0;
|
|
7939
8016
|
}
|
|
7940
|
-
var PageHeader =
|
|
8017
|
+
var PageHeader = React44.forwardRef(function PageHeader2(props, ref) {
|
|
7941
8018
|
const attrs2 = {};
|
|
7942
8019
|
Object.keys(props).forEach(function(k) {
|
|
7943
8020
|
if (k === "id" || k === "lang" || k === "dir" || k === "role" || /^(aria|data)-/.test(k))
|
|
@@ -8017,12 +8094,12 @@ function trapped(el) {
|
|
|
8017
8094
|
}
|
|
8018
8095
|
return false;
|
|
8019
8096
|
}
|
|
8020
|
-
var PageHeader3 =
|
|
8021
|
-
const own =
|
|
8097
|
+
var PageHeader3 = React45.forwardRef(function PageHeader4(props, ref) {
|
|
8098
|
+
const own = React45.useRef(null);
|
|
8022
8099
|
const merged = useMergedRef(ref, own);
|
|
8023
8100
|
const bar = props.actionsBarBelow;
|
|
8024
8101
|
const hasActions = props.actions != null && props.actions !== false;
|
|
8025
|
-
|
|
8102
|
+
React45.useEffect(
|
|
8026
8103
|
function() {
|
|
8027
8104
|
if (bar !== "sm" && bar !== "md" || !hasActions || !own.current) return;
|
|
8028
8105
|
const el = own.current.querySelector(":scope > .aura-page-header__actions");
|
|
@@ -8061,20 +8138,20 @@ var PageHeader3 = React44.forwardRef(function PageHeader4(props, ref) {
|
|
|
8061
8138
|
[bar, hasActions]
|
|
8062
8139
|
);
|
|
8063
8140
|
const focusTitle = !!props.focusTitleOnMount;
|
|
8064
|
-
|
|
8141
|
+
React45.useEffect(function() {
|
|
8065
8142
|
if (!focusTitle || !own.current) return;
|
|
8066
8143
|
const t = own.current.querySelector(".aura-page-header__title");
|
|
8067
8144
|
if (t) t.focus({ preventScroll: true });
|
|
8068
8145
|
}, []);
|
|
8069
|
-
return /* @__PURE__ */
|
|
8146
|
+
return /* @__PURE__ */ React45.createElement(PageHeader, { ...props, ref: merged });
|
|
8070
8147
|
});
|
|
8071
8148
|
|
|
8072
8149
|
// src/StatusTile.tsx
|
|
8073
|
-
var
|
|
8150
|
+
var React47 = __toESM(require("react"), 1);
|
|
8074
8151
|
|
|
8075
8152
|
// src/tiles.tsx
|
|
8076
|
-
var
|
|
8077
|
-
var h9 =
|
|
8153
|
+
var React46 = __toESM(require("react"), 1);
|
|
8154
|
+
var h9 = React46.createElement;
|
|
8078
8155
|
var STATUS_ICON = {
|
|
8079
8156
|
down: IconCircleAlert,
|
|
8080
8157
|
problem: IconTriangleAlert,
|
|
@@ -8166,7 +8243,7 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
8166
8243
|
) : null
|
|
8167
8244
|
);
|
|
8168
8245
|
}
|
|
8169
|
-
var TileGrid =
|
|
8246
|
+
var TileGrid = React46.forwardRef(function TileGrid2(props, ref) {
|
|
8170
8247
|
const style = Object.assign(
|
|
8171
8248
|
{},
|
|
8172
8249
|
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
@@ -8182,16 +8259,16 @@ var TileGrid = React45.forwardRef(function TileGrid2(props, ref) {
|
|
|
8182
8259
|
}),
|
|
8183
8260
|
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
8184
8261
|
flat(props.children).map(function(c, i) {
|
|
8185
|
-
return h9("li", { key:
|
|
8262
|
+
return h9("li", { key: React46.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
8186
8263
|
})
|
|
8187
8264
|
);
|
|
8188
8265
|
});
|
|
8189
8266
|
function flat(children) {
|
|
8190
8267
|
const out = [];
|
|
8191
|
-
|
|
8192
|
-
if (
|
|
8268
|
+
React46.Children.toArray(children).forEach(function(c) {
|
|
8269
|
+
if (React46.isValidElement(c) && c.type === React46.Fragment)
|
|
8193
8270
|
flat(c.props.children).forEach(function(x) {
|
|
8194
|
-
out.push(
|
|
8271
|
+
out.push(React46.isValidElement(x) ? React46.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
8195
8272
|
});
|
|
8196
8273
|
else if (c !== "") out.push(c);
|
|
8197
8274
|
});
|
|
@@ -8205,7 +8282,7 @@ function r(n3) {
|
|
|
8205
8282
|
function num(v) {
|
|
8206
8283
|
return typeof v === "number" && isFinite(v) ? v : null;
|
|
8207
8284
|
}
|
|
8208
|
-
var Sparkline =
|
|
8285
|
+
var Sparkline = React46.forwardRef(function Sparkline2(props, ref) {
|
|
8209
8286
|
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
8210
8287
|
const W = wh[0], H = wh[1];
|
|
8211
8288
|
const data = (props.data || []).map(num);
|
|
@@ -8279,8 +8356,8 @@ var Sparkline = React45.forwardRef(function Sparkline2(props, ref) {
|
|
|
8279
8356
|
});
|
|
8280
8357
|
|
|
8281
8358
|
// src/StatusTile.tsx
|
|
8282
|
-
var useIsoLayoutEffect2 = typeof window !== "undefined" ?
|
|
8283
|
-
var StatusTile =
|
|
8359
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React47.useLayoutEffect : React47.useEffect;
|
|
8360
|
+
var StatusTile = React47.forwardRef(function StatusTile2(props, ref) {
|
|
8284
8361
|
const Link = useLinkComponent(props.linkComponent);
|
|
8285
8362
|
const t = useStrings();
|
|
8286
8363
|
useAutoTip();
|
|
@@ -8289,8 +8366,8 @@ var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
|
8289
8366
|
"status-tile-label",
|
|
8290
8367
|
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
8291
8368
|
);
|
|
8292
|
-
const titleRef =
|
|
8293
|
-
const check =
|
|
8369
|
+
const titleRef = React47.useRef(null);
|
|
8370
|
+
const check = React47.useCallback(function() {
|
|
8294
8371
|
const el = titleRef.current;
|
|
8295
8372
|
if (!el) return;
|
|
8296
8373
|
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
@@ -8300,7 +8377,7 @@ var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
|
8300
8377
|
}, []);
|
|
8301
8378
|
useIsoLayoutEffect2(check, [props.title, check]);
|
|
8302
8379
|
const linked = !!props.href;
|
|
8303
|
-
|
|
8380
|
+
React47.useEffect(
|
|
8304
8381
|
function() {
|
|
8305
8382
|
const el = titleRef.current;
|
|
8306
8383
|
if (!el) return;
|
|
@@ -8325,14 +8402,14 @@ var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
|
8325
8402
|
});
|
|
8326
8403
|
|
|
8327
8404
|
// src/AppShell.tsx
|
|
8328
|
-
var
|
|
8405
|
+
var React49 = __toESM(require("react"), 1);
|
|
8329
8406
|
|
|
8330
8407
|
// src/scrollHide.ts
|
|
8331
|
-
var
|
|
8408
|
+
var React48 = __toESM(require("react"), 1);
|
|
8332
8409
|
var STEP = 8;
|
|
8333
8410
|
function useHideOnScroll(enabled, el, media, from) {
|
|
8334
|
-
const st =
|
|
8335
|
-
|
|
8411
|
+
const st = React48.useState(false), hidden = st[0], setHidden = st[1];
|
|
8412
|
+
React48.useEffect(
|
|
8336
8413
|
function() {
|
|
8337
8414
|
if (!enabled || typeof window === "undefined") {
|
|
8338
8415
|
setHidden(false);
|
|
@@ -8425,32 +8502,32 @@ function useHideOnScroll(enabled, el, media, from) {
|
|
|
8425
8502
|
function pinned(bar) {
|
|
8426
8503
|
return getComputedStyle(bar).position !== "static";
|
|
8427
8504
|
}
|
|
8428
|
-
var AppShell =
|
|
8505
|
+
var AppShell = React49.forwardRef(function AppShell2(props, ref) {
|
|
8429
8506
|
const t = useStrings();
|
|
8430
8507
|
const bp = useBreakpoint();
|
|
8431
8508
|
const wide = bp === "lg" || bp === "xl";
|
|
8432
|
-
const st =
|
|
8433
|
-
|
|
8509
|
+
const st = React49.useState(false), open = st[0], setOpen = st[1];
|
|
8510
|
+
React49.useEffect(
|
|
8434
8511
|
function() {
|
|
8435
8512
|
if (wide) setOpen(false);
|
|
8436
8513
|
},
|
|
8437
8514
|
[wide]
|
|
8438
8515
|
);
|
|
8439
|
-
const navEl = props.nav &&
|
|
8516
|
+
const navEl = props.nav && React49.isValidElement(props.nav) ? props.nav : null;
|
|
8440
8517
|
const shared = !!navEl && navEl.props.value === void 0 && (navEl.props.defaultValue !== void 0 || navEl.props.sections !== void 0 || navEl.props.items !== void 0);
|
|
8441
|
-
const navState =
|
|
8518
|
+
const navState = React49.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
8442
8519
|
function onNav(id) {
|
|
8443
8520
|
if (shared) navState[1](id);
|
|
8444
8521
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
8445
8522
|
}
|
|
8446
|
-
const rootRef =
|
|
8447
|
-
const barRef =
|
|
8448
|
-
const probeRef =
|
|
8523
|
+
const rootRef = React49.useRef(null);
|
|
8524
|
+
const barRef = React49.useRef(null);
|
|
8525
|
+
const probeRef = React49.useRef(null);
|
|
8449
8526
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
8450
8527
|
const hasBar = !!(props.header || props.nav);
|
|
8451
|
-
const barH =
|
|
8528
|
+
const barH = React49.useState(null);
|
|
8452
8529
|
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8453
|
-
const awayRef =
|
|
8530
|
+
const awayRef = React49.useRef(away);
|
|
8454
8531
|
awayRef.current = away;
|
|
8455
8532
|
useIsoLayoutEffect(
|
|
8456
8533
|
function() {
|
|
@@ -8485,8 +8562,8 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8485
8562
|
},
|
|
8486
8563
|
[hasBar]
|
|
8487
8564
|
);
|
|
8488
|
-
const deskNav = navEl && shared ?
|
|
8489
|
-
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, {
|
|
8490
8567
|
value: shared ? navState[0] : navEl.props.value,
|
|
8491
8568
|
onChange: function(id) {
|
|
8492
8569
|
onNav(id);
|
|
@@ -8501,7 +8578,7 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8501
8578
|
collapsed: false,
|
|
8502
8579
|
collapsible: false
|
|
8503
8580
|
}) : props.nav;
|
|
8504
|
-
return /* @__PURE__ */
|
|
8581
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8505
8582
|
"div",
|
|
8506
8583
|
{
|
|
8507
8584
|
ref: mergedRef,
|
|
@@ -8516,8 +8593,8 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8516
8593
|
props.className
|
|
8517
8594
|
)
|
|
8518
8595
|
},
|
|
8519
|
-
props.nav ? /* @__PURE__ */
|
|
8520
|
-
props.nav ? /* @__PURE__ */
|
|
8596
|
+
props.nav ? /* @__PURE__ */ React49.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8597
|
+
props.nav ? /* @__PURE__ */ React49.createElement(
|
|
8521
8598
|
Drawer,
|
|
8522
8599
|
{
|
|
8523
8600
|
open,
|
|
@@ -8534,7 +8611,7 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8534
8611
|
},
|
|
8535
8612
|
drawerNav
|
|
8536
8613
|
) : null,
|
|
8537
|
-
/* @__PURE__ */
|
|
8614
|
+
/* @__PURE__ */ React49.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React49.createElement(
|
|
8538
8615
|
"header",
|
|
8539
8616
|
{
|
|
8540
8617
|
ref: barRef,
|
|
@@ -8546,11 +8623,11 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8546
8623
|
away && "is-away"
|
|
8547
8624
|
)
|
|
8548
8625
|
},
|
|
8549
|
-
props.nav ? /* @__PURE__ */
|
|
8626
|
+
props.nav ? /* @__PURE__ */ React49.createElement(
|
|
8550
8627
|
IconButton,
|
|
8551
8628
|
{
|
|
8552
8629
|
className: "aura-shell__menu",
|
|
8553
|
-
icon: /* @__PURE__ */
|
|
8630
|
+
icon: /* @__PURE__ */ React49.createElement(IconMenu, null),
|
|
8554
8631
|
label: props.menuLabel || t.openNav,
|
|
8555
8632
|
size: "md",
|
|
8556
8633
|
touchHeight: true,
|
|
@@ -8560,9 +8637,9 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8560
8637
|
"aria-expanded": open
|
|
8561
8638
|
}
|
|
8562
8639
|
) : null,
|
|
8563
|
-
/* @__PURE__ */
|
|
8564
|
-
/* @__PURE__ */
|
|
8565
|
-
) : 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(
|
|
8566
8643
|
"main",
|
|
8567
8644
|
{
|
|
8568
8645
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -8575,17 +8652,17 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8575
8652
|
});
|
|
8576
8653
|
|
|
8577
8654
|
// src/ActionBar.tsx
|
|
8578
|
-
var
|
|
8579
|
-
var ActionBar =
|
|
8655
|
+
var React50 = __toESM(require("react"), 1);
|
|
8656
|
+
var ActionBar = React50.forwardRef(function ActionBar2(props, ref) {
|
|
8580
8657
|
const t = useStrings();
|
|
8581
8658
|
const bulk = props.selected != null;
|
|
8582
8659
|
const idle = bulk && !props.selected;
|
|
8583
8660
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
8584
|
-
const hasStart =
|
|
8661
|
+
const hasStart = React50.Children.toArray(props.start).some(function(c) {
|
|
8585
8662
|
return c !== "";
|
|
8586
8663
|
});
|
|
8587
|
-
const cameFrom =
|
|
8588
|
-
const own =
|
|
8664
|
+
const cameFrom = React50.useRef(null);
|
|
8665
|
+
const own = React50.useRef(null);
|
|
8589
8666
|
function clear() {
|
|
8590
8667
|
props.onClearSelection();
|
|
8591
8668
|
setTimeout(function() {
|
|
@@ -8594,7 +8671,7 @@ var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
|
8594
8671
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
8595
8672
|
}, 0);
|
|
8596
8673
|
}
|
|
8597
|
-
return /* @__PURE__ */
|
|
8674
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8598
8675
|
"div",
|
|
8599
8676
|
{
|
|
8600
8677
|
ref: function(el) {
|
|
@@ -8616,16 +8693,16 @@ var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
|
8616
8693
|
props.className
|
|
8617
8694
|
)
|
|
8618
8695
|
},
|
|
8619
|
-
/* @__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)
|
|
8620
8697
|
);
|
|
8621
8698
|
});
|
|
8622
8699
|
|
|
8623
8700
|
// src/Separator.tsx
|
|
8624
|
-
var
|
|
8625
|
-
var Separator =
|
|
8701
|
+
var React51 = __toESM(require("react"), 1);
|
|
8702
|
+
var Separator = React51.forwardRef(function Separator2(props, ref) {
|
|
8626
8703
|
const vertical = props.orientation === "vertical";
|
|
8627
8704
|
const decorative = props.decorative !== false;
|
|
8628
|
-
return /* @__PURE__ */
|
|
8705
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8629
8706
|
"div",
|
|
8630
8707
|
{
|
|
8631
8708
|
ref,
|
|
@@ -8638,13 +8715,13 @@ var Separator = React50.forwardRef(function Separator2(props, ref) {
|
|
|
8638
8715
|
});
|
|
8639
8716
|
|
|
8640
8717
|
// src/Table.tsx
|
|
8641
|
-
var
|
|
8718
|
+
var React53 = __toESM(require("react"), 1);
|
|
8642
8719
|
|
|
8643
8720
|
// src/TableSkeleton.tsx
|
|
8644
|
-
var
|
|
8645
|
-
var h10 =
|
|
8721
|
+
var React52 = __toESM(require("react"), 1);
|
|
8722
|
+
var h10 = React52.createElement;
|
|
8646
8723
|
function inertProps() {
|
|
8647
|
-
return { inert: parseInt(
|
|
8724
|
+
return { inert: parseInt(React52.version, 10) >= 19 ? true : "", "aria-hidden": true };
|
|
8648
8725
|
}
|
|
8649
8726
|
function widthOf(w) {
|
|
8650
8727
|
return w == null || w === "" ? void 0 : typeof w === "number" ? w + "px" : w;
|
|
@@ -8802,12 +8879,12 @@ function TableSkeleton(props) {
|
|
|
8802
8879
|
}
|
|
8803
8880
|
|
|
8804
8881
|
// src/Table.tsx
|
|
8805
|
-
var StackLabels =
|
|
8806
|
-
var ColumnIndex =
|
|
8882
|
+
var StackLabels = React53.createContext(null);
|
|
8883
|
+
var ColumnIndex = React53.createContext(-1);
|
|
8807
8884
|
function flat2(children) {
|
|
8808
8885
|
const out = [];
|
|
8809
|
-
|
|
8810
|
-
if (
|
|
8886
|
+
React53.Children.toArray(children).forEach(function(c) {
|
|
8887
|
+
if (React53.isValidElement(c) && c.type === React53.Fragment)
|
|
8811
8888
|
out.push.apply(out, flat2(c.props.children));
|
|
8812
8889
|
else out.push(c);
|
|
8813
8890
|
});
|
|
@@ -8821,7 +8898,7 @@ function text(node) {
|
|
|
8821
8898
|
});
|
|
8822
8899
|
return parts.length ? parts.join("") : void 0;
|
|
8823
8900
|
}
|
|
8824
|
-
if (
|
|
8901
|
+
if (React53.isValidElement(node)) {
|
|
8825
8902
|
const p = node.props;
|
|
8826
8903
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8827
8904
|
return text(p.children);
|
|
@@ -8831,13 +8908,13 @@ function text(node) {
|
|
|
8831
8908
|
function headerLabels(children) {
|
|
8832
8909
|
let out = [];
|
|
8833
8910
|
flat2(children).forEach(function(c) {
|
|
8834
|
-
if (out.length || !
|
|
8911
|
+
if (out.length || !React53.isValidElement(c) || c.type !== THead) return;
|
|
8835
8912
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8836
|
-
return
|
|
8913
|
+
return React53.isValidElement(r2);
|
|
8837
8914
|
});
|
|
8838
8915
|
if (!row) return;
|
|
8839
8916
|
flat2(row.props.children).forEach(function(cell) {
|
|
8840
|
-
if (!
|
|
8917
|
+
if (!React53.isValidElement(cell)) return;
|
|
8841
8918
|
const p = cell.props;
|
|
8842
8919
|
const t = text(p.children);
|
|
8843
8920
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8850,13 +8927,13 @@ function headerLabels(children) {
|
|
|
8850
8927
|
function headerColumns(children) {
|
|
8851
8928
|
const out = [];
|
|
8852
8929
|
flat2(children).forEach(function(c) {
|
|
8853
|
-
if (out.length || !
|
|
8930
|
+
if (out.length || !React53.isValidElement(c) || c.type !== THead) return;
|
|
8854
8931
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8855
|
-
return
|
|
8932
|
+
return React53.isValidElement(r2);
|
|
8856
8933
|
});
|
|
8857
8934
|
if (!row) return;
|
|
8858
8935
|
flat2(row.props.children).forEach(function(cell) {
|
|
8859
|
-
if (!
|
|
8936
|
+
if (!React53.isValidElement(cell)) return;
|
|
8860
8937
|
const p = cell.props;
|
|
8861
8938
|
const t = text(p.children);
|
|
8862
8939
|
const style = p.style;
|
|
@@ -8874,7 +8951,7 @@ function headerColumns(children) {
|
|
|
8874
8951
|
});
|
|
8875
8952
|
return out;
|
|
8876
8953
|
}
|
|
8877
|
-
var Table =
|
|
8954
|
+
var Table = React53.forwardRef(function Table2(props, ref) {
|
|
8878
8955
|
const {
|
|
8879
8956
|
caption,
|
|
8880
8957
|
captionHidden,
|
|
@@ -8902,7 +8979,7 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8902
8979
|
);
|
|
8903
8980
|
const shownChildren = skeletonCols ? [
|
|
8904
8981
|
flat2(children).filter(function(c) {
|
|
8905
|
-
return
|
|
8982
|
+
return React53.isValidElement(c) && c.type === THead;
|
|
8906
8983
|
}),
|
|
8907
8984
|
skeletonBody(skeletonCols, loadingRows != null ? Math.max(0, loadingRows) : 5, !!stackBelow)
|
|
8908
8985
|
] : children;
|
|
@@ -8918,12 +8995,12 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8918
8995
|
"tbl-stack-labels",
|
|
8919
8996
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8920
8997
|
);
|
|
8921
|
-
const outer =
|
|
8998
|
+
const outer = React53.useContext(StackLabels);
|
|
8922
8999
|
const pageDensity = useDensity();
|
|
8923
9000
|
const capId = uid();
|
|
8924
|
-
const wrap =
|
|
8925
|
-
const sc =
|
|
8926
|
-
const wide =
|
|
9001
|
+
const wrap = React53.useRef(null);
|
|
9002
|
+
const sc = React53.useState(false), scrolls = sc[0];
|
|
9003
|
+
const wide = React53.useState(false);
|
|
8927
9004
|
useIsoLayoutEffect(function() {
|
|
8928
9005
|
const el = wrap.current;
|
|
8929
9006
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8940,7 +9017,7 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8940
9017
|
ro.disconnect();
|
|
8941
9018
|
};
|
|
8942
9019
|
}, []);
|
|
8943
|
-
const table = /* @__PURE__ */
|
|
9020
|
+
const table = /* @__PURE__ */ React53.createElement(
|
|
8944
9021
|
"div",
|
|
8945
9022
|
{
|
|
8946
9023
|
ref: wrap,
|
|
@@ -8965,7 +9042,7 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8965
9042
|
"aria-labelledby": scrolls && !loading ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8966
9043
|
"aria-label": scrolls && !loading && caption == null ? rest["aria-label"] : void 0
|
|
8967
9044
|
},
|
|
8968
|
-
/* @__PURE__ */
|
|
9045
|
+
/* @__PURE__ */ React53.createElement(
|
|
8969
9046
|
"table",
|
|
8970
9047
|
{
|
|
8971
9048
|
ref,
|
|
@@ -8982,12 +9059,12 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8982
9059
|
role: stackBelow ? "table" : void 0,
|
|
8983
9060
|
...rest
|
|
8984
9061
|
},
|
|
8985
|
-
caption != null ? /* @__PURE__ */
|
|
9062
|
+
caption != null ? /* @__PURE__ */ React53.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8986
9063
|
skeletonCols ? skeletonColgroup(skeletonCols) : null,
|
|
8987
|
-
labels ? /* @__PURE__ */
|
|
9064
|
+
labels ? /* @__PURE__ */ React53.createElement(StackLabels.Provider, { value: labels }, shownChildren) : outer ? /* @__PURE__ */ React53.createElement(StackLabels.Provider, { value: null }, shownChildren) : shownChildren
|
|
8988
9065
|
)
|
|
8989
9066
|
);
|
|
8990
|
-
return cards ? /* @__PURE__ */
|
|
9067
|
+
return cards ? /* @__PURE__ */ React53.createElement(
|
|
8991
9068
|
"div",
|
|
8992
9069
|
{
|
|
8993
9070
|
className: cx(
|
|
@@ -9000,10 +9077,10 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
9000
9077
|
) : table;
|
|
9001
9078
|
});
|
|
9002
9079
|
function section(tag, cls) {
|
|
9003
|
-
const C =
|
|
9080
|
+
const C = React53.forwardRef(function TableSection(props, ref) {
|
|
9004
9081
|
const { className, ...rest } = props;
|
|
9005
|
-
const stacked =
|
|
9006
|
-
return
|
|
9082
|
+
const stacked = React53.useContext(StackLabels) != null;
|
|
9083
|
+
return React53.createElement(
|
|
9007
9084
|
tag,
|
|
9008
9085
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
9009
9086
|
);
|
|
@@ -9016,14 +9093,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
9016
9093
|
TBody.displayName = "TBody";
|
|
9017
9094
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
9018
9095
|
TFoot.displayName = "TFoot";
|
|
9019
|
-
var Tr =
|
|
9096
|
+
var Tr = React53.forwardRef(function Tr2(props, ref) {
|
|
9020
9097
|
const { className, children, ...rest } = props;
|
|
9021
|
-
const stacked =
|
|
9098
|
+
const stacked = React53.useContext(StackLabels) != null;
|
|
9022
9099
|
let col = 0;
|
|
9023
|
-
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) {
|
|
9024
9101
|
const at = col;
|
|
9025
|
-
if (
|
|
9026
|
-
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);
|
|
9027
9104
|
}) : children);
|
|
9028
9105
|
});
|
|
9029
9106
|
function cellClass(base, p) {
|
|
@@ -9040,10 +9117,10 @@ function cellClass(base, p) {
|
|
|
9040
9117
|
p.className
|
|
9041
9118
|
);
|
|
9042
9119
|
}
|
|
9043
|
-
var Th =
|
|
9120
|
+
var Th = React53.forwardRef(function Th2(props, ref) {
|
|
9044
9121
|
const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, wrap, ...rest } = props;
|
|
9045
|
-
const stacked =
|
|
9046
|
-
return /* @__PURE__ */
|
|
9122
|
+
const stacked = React53.useContext(StackLabels) != null;
|
|
9123
|
+
return /* @__PURE__ */ React53.createElement(
|
|
9047
9124
|
"th",
|
|
9048
9125
|
{
|
|
9049
9126
|
ref,
|
|
@@ -9055,12 +9132,12 @@ var Th = React52.forwardRef(function Th2(props, ref) {
|
|
|
9055
9132
|
}
|
|
9056
9133
|
);
|
|
9057
9134
|
});
|
|
9058
|
-
var Td =
|
|
9135
|
+
var Td = React53.forwardRef(function Td2(props, ref) {
|
|
9059
9136
|
const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, wrap, ...rest } = props;
|
|
9060
|
-
const labels =
|
|
9137
|
+
const labels = React53.useContext(StackLabels), col = React53.useContext(ColumnIndex);
|
|
9061
9138
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
9062
9139
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
9063
|
-
return /* @__PURE__ */
|
|
9140
|
+
return /* @__PURE__ */ React53.createElement(
|
|
9064
9141
|
"td",
|
|
9065
9142
|
{
|
|
9066
9143
|
ref,
|
|
@@ -9074,8 +9151,8 @@ var Td = React52.forwardRef(function Td2(props, ref) {
|
|
|
9074
9151
|
});
|
|
9075
9152
|
|
|
9076
9153
|
// src/BottomNav.tsx
|
|
9077
|
-
var
|
|
9078
|
-
var BottomNav =
|
|
9154
|
+
var React54 = __toESM(require("react"), 1);
|
|
9155
|
+
var BottomNav = React54.forwardRef(function BottomNav2(props, ref) {
|
|
9079
9156
|
const t = useStrings();
|
|
9080
9157
|
const Link = useLinkComponent(props.linkComponent);
|
|
9081
9158
|
const st = useMaybeControlled(
|
|
@@ -9085,7 +9162,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9085
9162
|
);
|
|
9086
9163
|
const active = st[0];
|
|
9087
9164
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
9088
|
-
const own =
|
|
9165
|
+
const own = React54.useRef(null);
|
|
9089
9166
|
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
9090
9167
|
const away = useHideOnScroll(
|
|
9091
9168
|
!!props.hideOnScroll,
|
|
@@ -9093,7 +9170,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9093
9170
|
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
9094
9171
|
64
|
|
9095
9172
|
);
|
|
9096
|
-
const setRef =
|
|
9173
|
+
const setRef = React54.useCallback(
|
|
9097
9174
|
function(el) {
|
|
9098
9175
|
own.current = el;
|
|
9099
9176
|
if (typeof ref === "function") ref(el);
|
|
@@ -9101,7 +9178,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9101
9178
|
},
|
|
9102
9179
|
[ref]
|
|
9103
9180
|
);
|
|
9104
|
-
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(
|
|
9105
9182
|
"nav",
|
|
9106
9183
|
{
|
|
9107
9184
|
ref: setRef,
|
|
@@ -9114,7 +9191,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9114
9191
|
),
|
|
9115
9192
|
"aria-label": props.label || t.mainNav
|
|
9116
9193
|
},
|
|
9117
|
-
/* @__PURE__ */
|
|
9194
|
+
/* @__PURE__ */ React54.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
9118
9195
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
9119
9196
|
devWarnOnce(
|
|
9120
9197
|
"bottomnav-label-" + it.id,
|
|
@@ -9135,20 +9212,20 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9135
9212
|
}
|
|
9136
9213
|
};
|
|
9137
9214
|
const inner = [
|
|
9138
|
-
/* @__PURE__ */
|
|
9139
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
9140
|
-
/* @__PURE__ */
|
|
9141
|
-
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
|
|
9142
9219
|
];
|
|
9143
|
-
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));
|
|
9144
9221
|
}))
|
|
9145
9222
|
));
|
|
9146
9223
|
});
|
|
9147
9224
|
|
|
9148
9225
|
// src/Surface.tsx
|
|
9149
|
-
var
|
|
9150
|
-
var h11 =
|
|
9151
|
-
var Surface =
|
|
9226
|
+
var React55 = __toESM(require("react"), 1);
|
|
9227
|
+
var h11 = React55.createElement;
|
|
9228
|
+
var Surface = React55.forwardRef(function Surface2(props, ref) {
|
|
9152
9229
|
const t = props.texture || "mesh";
|
|
9153
9230
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
9154
9231
|
return h11(
|
|
@@ -9169,14 +9246,14 @@ var Surface = React54.forwardRef(function Surface2(props, ref) {
|
|
|
9169
9246
|
});
|
|
9170
9247
|
|
|
9171
9248
|
// src/Stat.tsx
|
|
9172
|
-
var
|
|
9173
|
-
var Stat =
|
|
9249
|
+
var React56 = __toESM(require("react"), 1);
|
|
9250
|
+
var Stat = React56.forwardRef(function Stat2(props, ref) {
|
|
9174
9251
|
const Link = useLinkComponent(props.linkComponent);
|
|
9175
9252
|
return statElement(props, ref, Link);
|
|
9176
9253
|
});
|
|
9177
9254
|
|
|
9178
9255
|
// src/TimePicker.tsx
|
|
9179
|
-
var
|
|
9256
|
+
var React57 = __toESM(require("react"), 1);
|
|
9180
9257
|
var import_react_dom12 = require("react-dom");
|
|
9181
9258
|
|
|
9182
9259
|
// src/text.ts
|
|
@@ -9218,7 +9295,7 @@ function toMin(t) {
|
|
|
9218
9295
|
function fromMin(n3) {
|
|
9219
9296
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
9220
9297
|
}
|
|
9221
|
-
var TimePicker =
|
|
9298
|
+
var TimePicker = React57.forwardRef(function TimePicker2(props, ref) {
|
|
9222
9299
|
const t = useStrings();
|
|
9223
9300
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
9224
9301
|
const st = useMaybeControlled(
|
|
@@ -9228,7 +9305,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9228
9305
|
);
|
|
9229
9306
|
const value = st[0];
|
|
9230
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;
|
|
9231
|
-
const slots =
|
|
9308
|
+
const slots = React57.useMemo(
|
|
9232
9309
|
function() {
|
|
9233
9310
|
const out = [];
|
|
9234
9311
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -9240,12 +9317,12 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9240
9317
|
const n3 = toMin(v);
|
|
9241
9318
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
9242
9319
|
}
|
|
9243
|
-
const openState =
|
|
9244
|
-
const editState =
|
|
9245
|
-
const aState =
|
|
9246
|
-
const errState =
|
|
9247
|
-
const pos =
|
|
9248
|
-
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);
|
|
9249
9326
|
const mounted = useMounted();
|
|
9250
9327
|
function nearest(v) {
|
|
9251
9328
|
const n3 = toMin(v);
|
|
@@ -9273,7 +9350,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9273
9350
|
},
|
|
9274
9351
|
[open]
|
|
9275
9352
|
);
|
|
9276
|
-
|
|
9353
|
+
React57.useEffect(
|
|
9277
9354
|
function() {
|
|
9278
9355
|
if (!open) return;
|
|
9279
9356
|
function outside(e) {
|
|
@@ -9295,7 +9372,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9295
9372
|
},
|
|
9296
9373
|
[open]
|
|
9297
9374
|
);
|
|
9298
|
-
|
|
9375
|
+
React57.useEffect(
|
|
9299
9376
|
function() {
|
|
9300
9377
|
if (!open || !listRef.current) return;
|
|
9301
9378
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -9394,9 +9471,9 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9394
9471
|
}
|
|
9395
9472
|
const error = errState[0] || props.error;
|
|
9396
9473
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
9397
|
-
/* @__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) {
|
|
9398
9475
|
const dis = blocked(s), sel = s === value;
|
|
9399
|
-
return /* @__PURE__ */
|
|
9476
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9400
9477
|
"li",
|
|
9401
9478
|
{
|
|
9402
9479
|
key: s,
|
|
@@ -9421,13 +9498,13 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9421
9498
|
if (active !== i) setActive(i);
|
|
9422
9499
|
}
|
|
9423
9500
|
},
|
|
9424
|
-
/* @__PURE__ */
|
|
9425
|
-
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
|
|
9426
9503
|
);
|
|
9427
9504
|
}))),
|
|
9428
9505
|
document.body
|
|
9429
9506
|
) : null;
|
|
9430
|
-
return /* @__PURE__ */
|
|
9507
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9431
9508
|
Field,
|
|
9432
9509
|
{
|
|
9433
9510
|
id,
|
|
@@ -9439,7 +9516,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9439
9516
|
disabled: props.disabled,
|
|
9440
9517
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
9441
9518
|
},
|
|
9442
|
-
/* @__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(
|
|
9443
9520
|
"input",
|
|
9444
9521
|
{
|
|
9445
9522
|
ref: inputMerged,
|
|
@@ -9479,7 +9556,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9479
9556
|
}, 0);
|
|
9480
9557
|
}
|
|
9481
9558
|
}
|
|
9482
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
9559
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React57.createElement(
|
|
9483
9560
|
"button",
|
|
9484
9561
|
{
|
|
9485
9562
|
type: "button",
|
|
@@ -9492,8 +9569,8 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9492
9569
|
if (inputRef.current) inputRef.current.focus();
|
|
9493
9570
|
}
|
|
9494
9571
|
},
|
|
9495
|
-
/* @__PURE__ */
|
|
9496
|
-
) : null, /* @__PURE__ */
|
|
9572
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconX, null) })
|
|
9573
|
+
) : null, /* @__PURE__ */ React57.createElement(
|
|
9497
9574
|
"button",
|
|
9498
9575
|
{
|
|
9499
9576
|
type: "button",
|
|
@@ -9511,14 +9588,14 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9511
9588
|
}
|
|
9512
9589
|
}
|
|
9513
9590
|
},
|
|
9514
|
-
/* @__PURE__ */
|
|
9591
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconChevronDown, null) })
|
|
9515
9592
|
)),
|
|
9516
9593
|
list
|
|
9517
9594
|
);
|
|
9518
9595
|
});
|
|
9519
9596
|
|
|
9520
9597
|
// src/FileUpload.tsx
|
|
9521
|
-
var
|
|
9598
|
+
var React58 = __toESM(require("react"), 1);
|
|
9522
9599
|
function matches(file, accept) {
|
|
9523
9600
|
if (!accept) return true;
|
|
9524
9601
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9542,24 +9619,24 @@ function describeAccept(accept, t) {
|
|
|
9542
9619
|
}).join(", ");
|
|
9543
9620
|
}
|
|
9544
9621
|
var seq = 0;
|
|
9545
|
-
var FileUpload =
|
|
9622
|
+
var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
|
|
9546
9623
|
const t = useStrings();
|
|
9547
9624
|
const auto = uid(), id = props.id || auto;
|
|
9548
9625
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9549
9626
|
const items2 = st[0] || [];
|
|
9550
|
-
const dragState =
|
|
9551
|
-
const inputRef =
|
|
9552
|
-
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({});
|
|
9553
9630
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9554
9631
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9555
|
-
|
|
9632
|
+
React58.useEffect(function() {
|
|
9556
9633
|
return function() {
|
|
9557
9634
|
Object.keys(urls.current).forEach(function(k) {
|
|
9558
9635
|
URL.revokeObjectURL(urls.current[k]);
|
|
9559
9636
|
});
|
|
9560
9637
|
};
|
|
9561
9638
|
}, []);
|
|
9562
|
-
|
|
9639
|
+
React58.useEffect(
|
|
9563
9640
|
function() {
|
|
9564
9641
|
const el = inputRef.current;
|
|
9565
9642
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9619,7 +9696,7 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9619
9696
|
if (inputRef.current) inputRef.current.focus();
|
|
9620
9697
|
}
|
|
9621
9698
|
const error = props.error;
|
|
9622
|
-
return /* @__PURE__ */
|
|
9699
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9623
9700
|
Field,
|
|
9624
9701
|
{
|
|
9625
9702
|
id,
|
|
@@ -9631,7 +9708,7 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9631
9708
|
disabled: props.disabled,
|
|
9632
9709
|
className: props.className
|
|
9633
9710
|
},
|
|
9634
|
-
/* @__PURE__ */
|
|
9711
|
+
/* @__PURE__ */ React58.createElement(
|
|
9635
9712
|
"div",
|
|
9636
9713
|
{
|
|
9637
9714
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9652,9 +9729,9 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9652
9729
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9653
9730
|
}
|
|
9654
9731
|
},
|
|
9655
|
-
/* @__PURE__ */
|
|
9656
|
-
/* @__PURE__ */
|
|
9657
|
-
/* @__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(
|
|
9658
9735
|
"input",
|
|
9659
9736
|
{
|
|
9660
9737
|
ref: inputMerged,
|
|
@@ -9676,12 +9753,12 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9676
9753
|
}
|
|
9677
9754
|
}
|
|
9678
9755
|
),
|
|
9679
|
-
/* @__PURE__ */
|
|
9680
|
-
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
|
|
9681
9758
|
),
|
|
9682
|
-
items2.length ? /* @__PURE__ */
|
|
9759
|
+
items2.length ? /* @__PURE__ */ React58.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9683
9760
|
const src = thumb(it);
|
|
9684
|
-
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(
|
|
9685
9762
|
"span",
|
|
9686
9763
|
{
|
|
9687
9764
|
className: "aura-upload__bar",
|
|
@@ -9691,11 +9768,11 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9691
9768
|
"aria-valuemax": 100,
|
|
9692
9769
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9693
9770
|
},
|
|
9694
|
-
/* @__PURE__ */
|
|
9695
|
-
) : null), /* @__PURE__ */
|
|
9771
|
+
/* @__PURE__ */ React58.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9772
|
+
) : null), /* @__PURE__ */ React58.createElement(
|
|
9696
9773
|
IconButton,
|
|
9697
9774
|
{
|
|
9698
|
-
icon: /* @__PURE__ */
|
|
9775
|
+
icon: /* @__PURE__ */ React58.createElement(IconX, null),
|
|
9699
9776
|
label: t.remove(it.name),
|
|
9700
9777
|
onClick: function() {
|
|
9701
9778
|
remove(it);
|
|
@@ -10011,9 +10088,9 @@ function createTheme(opts) {
|
|
|
10011
10088
|
}
|
|
10012
10089
|
|
|
10013
10090
|
// src/ThemeStyle.tsx
|
|
10014
|
-
var
|
|
10091
|
+
var React59 = __toESM(require("react"), 1);
|
|
10015
10092
|
function ThemeStyle(props) {
|
|
10016
|
-
const css =
|
|
10093
|
+
const css = React59.useMemo(
|
|
10017
10094
|
function() {
|
|
10018
10095
|
try {
|
|
10019
10096
|
return createTheme({
|
|
@@ -10030,11 +10107,11 @@ function ThemeStyle(props) {
|
|
|
10030
10107
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
10031
10108
|
);
|
|
10032
10109
|
if (css === null) return null;
|
|
10033
|
-
return /* @__PURE__ */
|
|
10110
|
+
return /* @__PURE__ */ React59.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
10034
10111
|
}
|
|
10035
10112
|
|
|
10036
10113
|
// src/colorScheme.tsx
|
|
10037
|
-
var
|
|
10114
|
+
var React60 = __toESM(require("react"), 1);
|
|
10038
10115
|
|
|
10039
10116
|
// src/colorSchemeScript.ts
|
|
10040
10117
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -10051,7 +10128,7 @@ function colorSchemeScript(options) {
|
|
|
10051
10128
|
|
|
10052
10129
|
// src/colorScheme.tsx
|
|
10053
10130
|
function ColorSchemeScript(props) {
|
|
10054
|
-
return /* @__PURE__ */
|
|
10131
|
+
return /* @__PURE__ */ React60.createElement(
|
|
10055
10132
|
"script",
|
|
10056
10133
|
{
|
|
10057
10134
|
"data-aura-color-scheme": "",
|
|
@@ -10076,7 +10153,7 @@ function apply(scheme) {
|
|
|
10076
10153
|
function useColorScheme(options) {
|
|
10077
10154
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
10078
10155
|
const fallback = options && options.defaultScheme || "system";
|
|
10079
|
-
const subscribe2 =
|
|
10156
|
+
const subscribe2 = React60.useCallback(
|
|
10080
10157
|
function(cb) {
|
|
10081
10158
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
10082
10159
|
function onSystem() {
|
|
@@ -10098,7 +10175,7 @@ function useColorScheme(options) {
|
|
|
10098
10175
|
},
|
|
10099
10176
|
[fallback, key]
|
|
10100
10177
|
);
|
|
10101
|
-
const snapshot =
|
|
10178
|
+
const snapshot = React60.useSyncExternalStore(
|
|
10102
10179
|
subscribe2,
|
|
10103
10180
|
function() {
|
|
10104
10181
|
const s = readScheme(fallback);
|
|
@@ -10109,7 +10186,7 @@ function useColorScheme(options) {
|
|
|
10109
10186
|
}
|
|
10110
10187
|
);
|
|
10111
10188
|
const parts = snapshot.split("|");
|
|
10112
|
-
const setScheme =
|
|
10189
|
+
const setScheme = React60.useCallback(
|
|
10113
10190
|
function(next) {
|
|
10114
10191
|
if (!valid(next)) return;
|
|
10115
10192
|
try {
|
|
@@ -10128,14 +10205,14 @@ function ColorSchemeToggle(props) {
|
|
|
10128
10205
|
const cs = useColorScheme(props);
|
|
10129
10206
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
10130
10207
|
const label = props.label || t.colorScheme;
|
|
10131
|
-
return /* @__PURE__ */
|
|
10208
|
+
return /* @__PURE__ */ React60.createElement(
|
|
10132
10209
|
DropdownMenu,
|
|
10133
10210
|
{
|
|
10134
10211
|
label,
|
|
10135
|
-
trigger: /* @__PURE__ */
|
|
10212
|
+
trigger: /* @__PURE__ */ React60.createElement(
|
|
10136
10213
|
IconButton,
|
|
10137
10214
|
{
|
|
10138
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
10215
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React60.createElement(IconMoon, null) : /* @__PURE__ */ React60.createElement(IconSun, null),
|
|
10139
10216
|
label: label + ": " + names[cs.scheme]
|
|
10140
10217
|
}
|
|
10141
10218
|
),
|
|
@@ -10153,14 +10230,14 @@ function ColorSchemeToggle(props) {
|
|
|
10153
10230
|
}
|
|
10154
10231
|
|
|
10155
10232
|
// src/Badge.tsx
|
|
10156
|
-
var
|
|
10157
|
-
var Badge =
|
|
10233
|
+
var React61 = __toESM(require("react"), 1);
|
|
10234
|
+
var Badge = React61.forwardRef(function Badge2(props, ref) {
|
|
10158
10235
|
return badgeElement(props, ref);
|
|
10159
10236
|
});
|
|
10160
10237
|
|
|
10161
10238
|
// src/Progress.tsx
|
|
10162
|
-
var
|
|
10163
|
-
var Progress =
|
|
10239
|
+
var React62 = __toESM(require("react"), 1);
|
|
10240
|
+
var Progress = React62.forwardRef(function Progress2(props, ref) {
|
|
10164
10241
|
const t = useStrings();
|
|
10165
10242
|
const auto = uid(), id = props.id || auto;
|
|
10166
10243
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -10170,7 +10247,7 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10170
10247
|
const keyed = !!props.legend && spct > 0;
|
|
10171
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;
|
|
10172
10249
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
10173
|
-
return /* @__PURE__ */
|
|
10250
|
+
return /* @__PURE__ */ React62.createElement(
|
|
10174
10251
|
"div",
|
|
10175
10252
|
{
|
|
10176
10253
|
ref,
|
|
@@ -10181,8 +10258,8 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10181
10258
|
props.className
|
|
10182
10259
|
)
|
|
10183
10260
|
},
|
|
10184
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
10185
|
-
/* @__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(
|
|
10186
10263
|
"div",
|
|
10187
10264
|
{
|
|
10188
10265
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -10194,8 +10271,8 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10194
10271
|
"aria-valuenow": det ? props.value : void 0,
|
|
10195
10272
|
"aria-valuetext": det ? valueText : void 0
|
|
10196
10273
|
},
|
|
10197
|
-
/* @__PURE__ */
|
|
10198
|
-
sec ? /* @__PURE__ */
|
|
10274
|
+
/* @__PURE__ */ React62.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
10275
|
+
sec ? /* @__PURE__ */ React62.createElement(
|
|
10199
10276
|
"span",
|
|
10200
10277
|
{
|
|
10201
10278
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -10203,20 +10280,20 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10203
10280
|
}
|
|
10204
10281
|
) : null
|
|
10205
10282
|
),
|
|
10206
|
-
keyed ? /* @__PURE__ */
|
|
10207
|
-
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
|
|
10208
10285
|
);
|
|
10209
10286
|
});
|
|
10210
10287
|
|
|
10211
10288
|
// src/Skeleton.tsx
|
|
10212
|
-
var
|
|
10213
|
-
var Skeleton =
|
|
10289
|
+
var React63 = __toESM(require("react"), 1);
|
|
10290
|
+
var Skeleton = React63.forwardRef(function Skeleton2(props, ref) {
|
|
10214
10291
|
const v = props.variant || "text";
|
|
10215
10292
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
10216
10293
|
const n3 = props.lines, rows = [];
|
|
10217
10294
|
for (let i = 0; i < n3; i++)
|
|
10218
|
-
rows.push(/* @__PURE__ */
|
|
10219
|
-
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(
|
|
10220
10297
|
"span",
|
|
10221
10298
|
{
|
|
10222
10299
|
ref,
|
|
@@ -10234,17 +10311,17 @@ var Skeleton = React62.forwardRef(function Skeleton2(props, ref) {
|
|
|
10234
10311
|
if (v === "circle") {
|
|
10235
10312
|
style.width = style.height = props.size || props.width || 40;
|
|
10236
10313
|
}
|
|
10237
|
-
return /* @__PURE__ */
|
|
10314
|
+
return /* @__PURE__ */ React63.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
10238
10315
|
});
|
|
10239
10316
|
|
|
10240
10317
|
// src/EmptyState.tsx
|
|
10241
|
-
var
|
|
10242
|
-
var EmptyState =
|
|
10318
|
+
var React64 = __toESM(require("react"), 1);
|
|
10319
|
+
var EmptyState = React64.forwardRef(function EmptyState2(props, ref) {
|
|
10243
10320
|
return emptyStateElement(props, ref);
|
|
10244
10321
|
});
|
|
10245
10322
|
|
|
10246
10323
|
// src/Pagination.tsx
|
|
10247
|
-
var
|
|
10324
|
+
var React65 = __toESM(require("react"), 1);
|
|
10248
10325
|
function pageList(page, count, sib) {
|
|
10249
10326
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
10250
10327
|
if (page - sib <= 3) {
|
|
@@ -10264,7 +10341,7 @@ function pageList(page, count, sib) {
|
|
|
10264
10341
|
if (count > 1) out.push(count);
|
|
10265
10342
|
return out;
|
|
10266
10343
|
}
|
|
10267
|
-
var Pagination =
|
|
10344
|
+
var Pagination = React65.forwardRef(function Pagination2(props, ref) {
|
|
10268
10345
|
const t = useStrings();
|
|
10269
10346
|
useAutoTip();
|
|
10270
10347
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -10284,7 +10361,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10284
10361
|
},
|
|
10285
10362
|
extra
|
|
10286
10363
|
);
|
|
10287
|
-
return link ? /* @__PURE__ */
|
|
10364
|
+
return link ? /* @__PURE__ */ React65.createElement(
|
|
10288
10365
|
Link,
|
|
10289
10366
|
{
|
|
10290
10367
|
href: link(p),
|
|
@@ -10297,7 +10374,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10297
10374
|
...common
|
|
10298
10375
|
},
|
|
10299
10376
|
label
|
|
10300
|
-
) : /* @__PURE__ */
|
|
10377
|
+
) : /* @__PURE__ */ React65.createElement(
|
|
10301
10378
|
"button",
|
|
10302
10379
|
{
|
|
10303
10380
|
type: "button",
|
|
@@ -10311,7 +10388,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10311
10388
|
}
|
|
10312
10389
|
function arrow(p, icon, label, rel, disabled) {
|
|
10313
10390
|
if (!link || disabled)
|
|
10314
|
-
return /* @__PURE__ */
|
|
10391
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10315
10392
|
IconButton,
|
|
10316
10393
|
{
|
|
10317
10394
|
icon,
|
|
@@ -10322,7 +10399,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10322
10399
|
}
|
|
10323
10400
|
}
|
|
10324
10401
|
);
|
|
10325
|
-
return /* @__PURE__ */
|
|
10402
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10326
10403
|
Link,
|
|
10327
10404
|
{
|
|
10328
10405
|
href: link(p),
|
|
@@ -10337,17 +10414,17 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10337
10414
|
}
|
|
10338
10415
|
}
|
|
10339
10416
|
},
|
|
10340
|
-
/* @__PURE__ */
|
|
10417
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: icon, size: "sm" })
|
|
10341
10418
|
);
|
|
10342
10419
|
}
|
|
10343
|
-
return /* @__PURE__ */
|
|
10344
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
10345
|
-
})), /* @__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));
|
|
10346
10423
|
});
|
|
10347
10424
|
|
|
10348
10425
|
// src/Accordion.tsx
|
|
10349
|
-
var
|
|
10350
|
-
var Accordion =
|
|
10426
|
+
var React66 = __toESM(require("react"), 1);
|
|
10427
|
+
var Accordion = React66.forwardRef(function Accordion2(props, ref) {
|
|
10351
10428
|
const auto = uid(), base = props.id || auto;
|
|
10352
10429
|
const multiple = props.type === "multiple";
|
|
10353
10430
|
const st = useMaybeControlled(
|
|
@@ -10385,9 +10462,9 @@ var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
|
10385
10462
|
n3.focus();
|
|
10386
10463
|
}
|
|
10387
10464
|
}
|
|
10388
|
-
return /* @__PURE__ */
|
|
10465
|
+
return /* @__PURE__ */ React66.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
10389
10466
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
10390
|
-
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(
|
|
10391
10468
|
"button",
|
|
10392
10469
|
{
|
|
10393
10470
|
type: "button",
|
|
@@ -10400,10 +10477,10 @@ var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
|
10400
10477
|
toggle(it.id);
|
|
10401
10478
|
}
|
|
10402
10479
|
},
|
|
10403
|
-
it.icon ? /* @__PURE__ */
|
|
10404
|
-
/* @__PURE__ */
|
|
10405
|
-
/* @__PURE__ */
|
|
10406
|
-
)), /* @__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(
|
|
10407
10484
|
"div",
|
|
10408
10485
|
{
|
|
10409
10486
|
id: pid,
|
|
@@ -10418,7 +10495,7 @@ var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
|
10418
10495
|
});
|
|
10419
10496
|
|
|
10420
10497
|
// src/Popover.tsx
|
|
10421
|
-
var
|
|
10498
|
+
var React67 = __toESM(require("react"), 1);
|
|
10422
10499
|
var import_react_dom13 = require("react-dom");
|
|
10423
10500
|
function position(anchor, pop, placement) {
|
|
10424
10501
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -10436,15 +10513,15 @@ function position(anchor, pop, placement) {
|
|
|
10436
10513
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
10437
10514
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
10438
10515
|
}
|
|
10439
|
-
var Popover =
|
|
10516
|
+
var Popover = React67.forwardRef(function Popover2(props, ref) {
|
|
10440
10517
|
const t = useStrings();
|
|
10441
10518
|
const density = useDensity();
|
|
10442
10519
|
const auto = uid(), id = props.id || auto;
|
|
10443
10520
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
10444
10521
|
const open = !!st[0];
|
|
10445
|
-
const wrap =
|
|
10446
|
-
const pos =
|
|
10447
|
-
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);
|
|
10448
10525
|
function trigger() {
|
|
10449
10526
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
10450
10527
|
}
|
|
@@ -10471,7 +10548,7 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10471
10548
|
},
|
|
10472
10549
|
[open, mounted, props.placement]
|
|
10473
10550
|
);
|
|
10474
|
-
|
|
10551
|
+
React67.useEffect(
|
|
10475
10552
|
function() {
|
|
10476
10553
|
if (!open || !mounted) return;
|
|
10477
10554
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10503,9 +10580,9 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10503
10580
|
},
|
|
10504
10581
|
[open, mounted]
|
|
10505
10582
|
);
|
|
10506
|
-
const child =
|
|
10583
|
+
const child = React67.Children.only(props.trigger);
|
|
10507
10584
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10508
|
-
/* @__PURE__ */
|
|
10585
|
+
/* @__PURE__ */ React67.createElement(
|
|
10509
10586
|
"div",
|
|
10510
10587
|
{
|
|
10511
10588
|
ref: popMerged,
|
|
@@ -10535,17 +10612,17 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10535
10612
|
} else trapTab(e, pop.current);
|
|
10536
10613
|
}
|
|
10537
10614
|
},
|
|
10538
|
-
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(
|
|
10539
10616
|
IconButton,
|
|
10540
10617
|
{
|
|
10541
|
-
icon: /* @__PURE__ */
|
|
10618
|
+
icon: /* @__PURE__ */ React67.createElement(IconX, null),
|
|
10542
10619
|
label: t.close,
|
|
10543
10620
|
onClick: function() {
|
|
10544
10621
|
close(true);
|
|
10545
10622
|
}
|
|
10546
10623
|
}
|
|
10547
10624
|
)) : null,
|
|
10548
|
-
/* @__PURE__ */
|
|
10625
|
+
/* @__PURE__ */ React67.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10549
10626
|
close: function() {
|
|
10550
10627
|
close(true);
|
|
10551
10628
|
}
|
|
@@ -10553,7 +10630,7 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10553
10630
|
),
|
|
10554
10631
|
document.body
|
|
10555
10632
|
) : null;
|
|
10556
|
-
return /* @__PURE__ */
|
|
10633
|
+
return /* @__PURE__ */ React67.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React67.cloneElement(child, {
|
|
10557
10634
|
onClick: function(e) {
|
|
10558
10635
|
if (child.props.onClick) child.props.onClick(e);
|
|
10559
10636
|
st[1](!open);
|
|
@@ -10565,7 +10642,7 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10565
10642
|
});
|
|
10566
10643
|
|
|
10567
10644
|
// src/NumberField.tsx
|
|
10568
|
-
var
|
|
10645
|
+
var React68 = __toESM(require("react"), 1);
|
|
10569
10646
|
function decimalsOf(n3) {
|
|
10570
10647
|
const s = String(n3);
|
|
10571
10648
|
const i = s.indexOf(".");
|
|
@@ -10578,7 +10655,7 @@ function parse(text2) {
|
|
|
10578
10655
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10579
10656
|
return Number(s);
|
|
10580
10657
|
}
|
|
10581
|
-
var NumberField =
|
|
10658
|
+
var NumberField = React68.forwardRef(function NumberField2(props, ref) {
|
|
10582
10659
|
const t = useStrings();
|
|
10583
10660
|
const auto = uid(), id = props.id || auto;
|
|
10584
10661
|
const step = props.step || 1;
|
|
@@ -10589,7 +10666,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10589
10666
|
props.onChange
|
|
10590
10667
|
);
|
|
10591
10668
|
const value = st[0], setValue = st[1];
|
|
10592
|
-
const draftState =
|
|
10669
|
+
const draftState = React68.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10593
10670
|
function fmt2(n3) {
|
|
10594
10671
|
if (n3 == null || isNaN(n3)) return "";
|
|
10595
10672
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10638,7 +10715,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10638
10715
|
};
|
|
10639
10716
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10640
10717
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10641
|
-
return /* @__PURE__ */
|
|
10718
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10642
10719
|
Field,
|
|
10643
10720
|
{
|
|
10644
10721
|
id,
|
|
@@ -10650,7 +10727,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10650
10727
|
disabled: props.disabled,
|
|
10651
10728
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10652
10729
|
},
|
|
10653
|
-
/* @__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(
|
|
10654
10731
|
"input",
|
|
10655
10732
|
{
|
|
10656
10733
|
ref,
|
|
@@ -10697,7 +10774,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10697
10774
|
},
|
|
10698
10775
|
onKeyDown
|
|
10699
10776
|
}
|
|
10700
|
-
), 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(
|
|
10701
10778
|
"button",
|
|
10702
10779
|
{
|
|
10703
10780
|
type: "button",
|
|
@@ -10713,8 +10790,8 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10713
10790
|
nudge(-step);
|
|
10714
10791
|
}
|
|
10715
10792
|
},
|
|
10716
|
-
/* @__PURE__ */
|
|
10717
|
-
), /* @__PURE__ */
|
|
10793
|
+
/* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconMinus, null) })
|
|
10794
|
+
), /* @__PURE__ */ React68.createElement(
|
|
10718
10795
|
"button",
|
|
10719
10796
|
{
|
|
10720
10797
|
type: "button",
|
|
@@ -10730,14 +10807,14 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10730
10807
|
nudge(step);
|
|
10731
10808
|
}
|
|
10732
10809
|
},
|
|
10733
|
-
/* @__PURE__ */
|
|
10810
|
+
/* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconPlus, null) })
|
|
10734
10811
|
)) : null)
|
|
10735
10812
|
);
|
|
10736
10813
|
});
|
|
10737
10814
|
|
|
10738
10815
|
// src/Stepper.tsx
|
|
10739
|
-
var
|
|
10740
|
-
var Stepper =
|
|
10816
|
+
var React69 = __toESM(require("react"), 1);
|
|
10817
|
+
var Stepper = React69.forwardRef(function Stepper2(props, ref) {
|
|
10741
10818
|
const t = useStrings();
|
|
10742
10819
|
const idBase = uid();
|
|
10743
10820
|
const steps = props.steps || [];
|
|
@@ -10748,22 +10825,22 @@ var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
|
10748
10825
|
if (at < 0) at = 0;
|
|
10749
10826
|
const vertical = props.orientation === "vertical";
|
|
10750
10827
|
const cur2 = steps[at];
|
|
10751
|
-
return /* @__PURE__ */
|
|
10828
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10752
10829
|
"nav",
|
|
10753
10830
|
{
|
|
10754
10831
|
ref,
|
|
10755
10832
|
"aria-label": props.label,
|
|
10756
10833
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10757
10834
|
},
|
|
10758
|
-
/* @__PURE__ */
|
|
10835
|
+
/* @__PURE__ */ React69.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10759
10836
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10760
10837
|
const error = s.status === "error";
|
|
10761
|
-
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);
|
|
10762
10839
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10763
10840
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10764
10841
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10765
10842
|
const descId = idBase + "-step-" + i;
|
|
10766
|
-
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(
|
|
10767
10844
|
"span",
|
|
10768
10845
|
{
|
|
10769
10846
|
className: "aura-stepper__desc",
|
|
@@ -10772,14 +10849,14 @@ var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
|
10772
10849
|
},
|
|
10773
10850
|
s.description
|
|
10774
10851
|
) : null);
|
|
10775
|
-
return /* @__PURE__ */
|
|
10852
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10776
10853
|
"li",
|
|
10777
10854
|
{
|
|
10778
10855
|
key: s.id,
|
|
10779
10856
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10780
10857
|
"aria-current": state === "current" ? "step" : void 0
|
|
10781
10858
|
},
|
|
10782
|
-
clickable ? /* @__PURE__ */
|
|
10859
|
+
clickable ? /* @__PURE__ */ React69.createElement(
|
|
10783
10860
|
"button",
|
|
10784
10861
|
{
|
|
10785
10862
|
type: "button",
|
|
@@ -10791,19 +10868,19 @@ var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
|
10791
10868
|
},
|
|
10792
10869
|
marker,
|
|
10793
10870
|
text2
|
|
10794
|
-
) : /* @__PURE__ */
|
|
10871
|
+
) : /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10795
10872
|
);
|
|
10796
10873
|
})),
|
|
10797
|
-
!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
|
|
10798
10875
|
);
|
|
10799
10876
|
});
|
|
10800
10877
|
|
|
10801
10878
|
// src/SegmentedControl.tsx
|
|
10802
|
-
var
|
|
10879
|
+
var React70 = __toESM(require("react"), 1);
|
|
10803
10880
|
function toOpt2(o) {
|
|
10804
10881
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10805
10882
|
}
|
|
10806
|
-
var SegmentedControl =
|
|
10883
|
+
var SegmentedControl = React70.forwardRef(
|
|
10807
10884
|
function SegmentedControl2(props, ref) {
|
|
10808
10885
|
const options = (props.options || []).map(toOpt2);
|
|
10809
10886
|
useAutoTip();
|
|
@@ -10817,7 +10894,7 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10817
10894
|
);
|
|
10818
10895
|
const value = st[0], setValue = st[1];
|
|
10819
10896
|
const auto = uid(), id = props.id || auto;
|
|
10820
|
-
const refs =
|
|
10897
|
+
const refs = React70.useRef([]);
|
|
10821
10898
|
const selIdx = options.findIndex(function(o) {
|
|
10822
10899
|
return o.value === value;
|
|
10823
10900
|
});
|
|
@@ -10850,7 +10927,7 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10850
10927
|
move(options.length, -1);
|
|
10851
10928
|
}
|
|
10852
10929
|
}
|
|
10853
|
-
return /* @__PURE__ */
|
|
10930
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10854
10931
|
"div",
|
|
10855
10932
|
{
|
|
10856
10933
|
ref,
|
|
@@ -10870,7 +10947,7 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10870
10947
|
options.map(function(o, i) {
|
|
10871
10948
|
const on = o.value === value;
|
|
10872
10949
|
const off = props.disabled || o.disabled;
|
|
10873
|
-
return /* @__PURE__ */
|
|
10950
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10874
10951
|
"button",
|
|
10875
10952
|
{
|
|
10876
10953
|
key: o.value,
|
|
@@ -10892,8 +10969,8 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10892
10969
|
onKeyDown(e, i);
|
|
10893
10970
|
}
|
|
10894
10971
|
},
|
|
10895
|
-
o.icon ? /* @__PURE__ */
|
|
10896
|
-
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)
|
|
10897
10974
|
);
|
|
10898
10975
|
})
|
|
10899
10976
|
);
|