@jirawatpyk/aura-react 5.66.0 → 5.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/aura.bundle.js +684 -598
- package/dist/cjs/index.cjs +683 -597
- package/dist/esm/CheckboxGroup.js +80 -0
- package/dist/esm/Field.js +9 -1
- package/dist/esm/RadioGroup.js +3 -4
- 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 +38 -0
- package/dist/index.d.ts +38 -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 +5 -0
- package/dist/styles.layer.css +5 -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
|
},
|
|
@@ -2059,12 +2063,19 @@ var Field = React13.forwardRef(function Field2(props, ref) {
|
|
|
2059
2063
|
) : null,
|
|
2060
2064
|
hasAddon(props.labelAddon) ? /* @__PURE__ */ React13.createElement("div", { className: "aura-field__addon", id: props.id + "-addon" }, props.labelAddon) : null,
|
|
2061
2065
|
props.children,
|
|
2062
|
-
|
|
2066
|
+
fieldNote(props.id, props.error, props.hint, props.errorLive)
|
|
2063
2067
|
);
|
|
2064
2068
|
});
|
|
2065
2069
|
function describedBy(id, p) {
|
|
2066
2070
|
return p.error ? id + "-error" : p.hint ? id + "-hint" : void 0;
|
|
2067
2071
|
}
|
|
2072
|
+
function fieldNote(id, error, hint, live) {
|
|
2073
|
+
const err = error ? /* @__PURE__ */ React13.createElement(React13.Fragment, null, /* @__PURE__ */ React13.createElement(Icon, { name: /* @__PURE__ */ React13.createElement(IconCircleAlert, null), size: 14 }), error) : null;
|
|
2074
|
+
const hintLine = hint ? /* @__PURE__ */ React13.createElement("p", { className: "aura-field__hint", id: id + "-hint" }, hint) : null;
|
|
2075
|
+
if (!live)
|
|
2076
|
+
return err ? /* @__PURE__ */ React13.createElement("p", { className: "aura-field__error", id: id + "-error" }, err) : hintLine;
|
|
2077
|
+
return /* @__PURE__ */ React13.createElement(React13.Fragment, null, err ? null : hintLine, /* @__PURE__ */ React13.createElement("p", { className: "aura-field__error", id: id == null ? void 0 : id + "-error", "aria-live": "polite" }, err));
|
|
2078
|
+
}
|
|
2068
2079
|
function hasAddon(n3) {
|
|
2069
2080
|
return n3 != null && typeof n3 !== "boolean" && n3 !== "";
|
|
2070
2081
|
}
|
|
@@ -3850,6 +3861,7 @@ var RadioGroup = React20.forwardRef(function RadioGroup2(props, ref) {
|
|
|
3850
3861
|
className: cx(
|
|
3851
3862
|
"aura-field aura-radio-group",
|
|
3852
3863
|
props.error && "is-invalid",
|
|
3864
|
+
props.disabled && "is-disabled",
|
|
3853
3865
|
touchClass(props.touchHeight),
|
|
3854
3866
|
props.className
|
|
3855
3867
|
),
|
|
@@ -3879,19 +3891,93 @@ var RadioGroup = React20.forwardRef(function RadioGroup2(props, ref) {
|
|
|
3879
3891
|
}
|
|
3880
3892
|
), /* @__PURE__ */ React20.createElement("span", { className: "aura-choice__text" }, /* @__PURE__ */ React20.createElement("span", { className: "aura-choice__label", id: oid ? oid + "-label" : void 0 }, v.label), v.description ? /* @__PURE__ */ React20.createElement("span", { className: "aura-choice__desc", id: oid + "-desc" }, v.description) : null));
|
|
3881
3893
|
})),
|
|
3882
|
-
|
|
3894
|
+
fieldNote(id, props.error, props.hint, props.errorLive)
|
|
3883
3895
|
);
|
|
3884
3896
|
});
|
|
3885
3897
|
|
|
3886
|
-
// src/
|
|
3898
|
+
// src/CheckboxGroup.tsx
|
|
3887
3899
|
var React21 = __toESM(require("react"), 1);
|
|
3888
|
-
var
|
|
3900
|
+
var CheckboxGroup = React21.forwardRef(
|
|
3901
|
+
function CheckboxGroup2(props, ref) {
|
|
3902
|
+
const t = useStrings();
|
|
3903
|
+
const auto = uid(), id = props.id || auto;
|
|
3904
|
+
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
3905
|
+
const picked = st[0] || [];
|
|
3906
|
+
const opts = (props.options || []).map(function(o) {
|
|
3907
|
+
return typeof o === "object" ? o : { value: o, label: o };
|
|
3908
|
+
});
|
|
3909
|
+
const name = props.name || id;
|
|
3910
|
+
const setRef = React21.useCallback(
|
|
3911
|
+
function(el) {
|
|
3912
|
+
if (el)
|
|
3913
|
+
el.focus = function(o) {
|
|
3914
|
+
const b = el.querySelector('input[type="checkbox"]:checked:not(:disabled)') || el.querySelector('input[type="checkbox"]:not(:disabled)');
|
|
3915
|
+
if (b) b.focus(o);
|
|
3916
|
+
};
|
|
3917
|
+
if (typeof ref === "function") ref(el);
|
|
3918
|
+
else if (ref) ref.current = el;
|
|
3919
|
+
},
|
|
3920
|
+
[ref]
|
|
3921
|
+
);
|
|
3922
|
+
return /* @__PURE__ */ React21.createElement(
|
|
3923
|
+
"fieldset",
|
|
3924
|
+
{
|
|
3925
|
+
ref: setRef,
|
|
3926
|
+
className: cx(
|
|
3927
|
+
"aura-field aura-radio-group aura-checkbox-group",
|
|
3928
|
+
props.error && "is-invalid",
|
|
3929
|
+
props.disabled && "is-disabled",
|
|
3930
|
+
touchClass(props.touchHeight),
|
|
3931
|
+
props.className
|
|
3932
|
+
),
|
|
3933
|
+
"aria-describedby": describedBy(id, props),
|
|
3934
|
+
disabled: props.disabled
|
|
3935
|
+
},
|
|
3936
|
+
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,
|
|
3937
|
+
/* @__PURE__ */ React21.createElement("div", { className: cx("aura-radio-group__list", props.orientation === "horizontal" && "is-horizontal") }, opts.map(function(v) {
|
|
3938
|
+
return /* @__PURE__ */ React21.createElement(
|
|
3939
|
+
Checkbox,
|
|
3940
|
+
{
|
|
3941
|
+
key: v.value,
|
|
3942
|
+
name,
|
|
3943
|
+
value: v.value,
|
|
3944
|
+
checked: picked.indexOf(v.value) >= 0,
|
|
3945
|
+
disabled: props.disabled || v.disabled,
|
|
3946
|
+
description: v.description,
|
|
3947
|
+
touchHeight: props.touchHeight,
|
|
3948
|
+
"aria-invalid": props.error ? true : void 0,
|
|
3949
|
+
"aria-describedby": props.error ? id + "-error" : void 0,
|
|
3950
|
+
onChange: function(on) {
|
|
3951
|
+
const known = opts.map(function(o) {
|
|
3952
|
+
return o.value;
|
|
3953
|
+
});
|
|
3954
|
+
const next = known.filter(function(val) {
|
|
3955
|
+
return val === v.value ? on : picked.indexOf(val) >= 0;
|
|
3956
|
+
}).concat(
|
|
3957
|
+
picked.filter(function(val) {
|
|
3958
|
+
return known.indexOf(val) < 0;
|
|
3959
|
+
})
|
|
3960
|
+
);
|
|
3961
|
+
st[1](next);
|
|
3962
|
+
}
|
|
3963
|
+
},
|
|
3964
|
+
v.label
|
|
3965
|
+
);
|
|
3966
|
+
})),
|
|
3967
|
+
fieldNote(id, props.error, props.hint, props.errorLive)
|
|
3968
|
+
);
|
|
3969
|
+
}
|
|
3970
|
+
);
|
|
3971
|
+
|
|
3972
|
+
// src/Switch.tsx
|
|
3973
|
+
var React22 = __toESM(require("react"), 1);
|
|
3974
|
+
var Switch = React22.forwardRef(function Switch2(props, ref) {
|
|
3889
3975
|
const auto = uid(), id = props.id || auto;
|
|
3890
3976
|
const st = useMaybeControlled(props.checked, !!props.defaultChecked, props.onChange);
|
|
3891
3977
|
const on = !!st[0];
|
|
3892
3978
|
const ro = !!props.readOnly && !props.disabled;
|
|
3893
3979
|
const described = [props.description ? id + "-desc" : "", props["aria-describedby"] || ""].filter(Boolean).join(" ");
|
|
3894
|
-
return /* @__PURE__ */
|
|
3980
|
+
return /* @__PURE__ */ React22.createElement(
|
|
3895
3981
|
"div",
|
|
3896
3982
|
{
|
|
3897
3983
|
className: cx("aura-switch-row", props.disabled && "is-disabled", ro && "is-readonly", props.className),
|
|
@@ -3901,7 +3987,7 @@ var Switch = React21.forwardRef(function Switch2(props, ref) {
|
|
|
3901
3987
|
st[1](!on);
|
|
3902
3988
|
}
|
|
3903
3989
|
},
|
|
3904
|
-
/* @__PURE__ */
|
|
3990
|
+
/* @__PURE__ */ React22.createElement(
|
|
3905
3991
|
"button",
|
|
3906
3992
|
{
|
|
3907
3993
|
ref,
|
|
@@ -3919,15 +4005,15 @@ var Switch = React21.forwardRef(function Switch2(props, ref) {
|
|
|
3919
4005
|
if (!ro) st[1](!on);
|
|
3920
4006
|
}
|
|
3921
4007
|
},
|
|
3922
|
-
/* @__PURE__ */
|
|
4008
|
+
/* @__PURE__ */ React22.createElement("span", { className: "aura-switch__thumb" })
|
|
3923
4009
|
),
|
|
3924
|
-
props.label ? /* @__PURE__ */
|
|
3925
|
-
props.icon ? /* @__PURE__ */
|
|
4010
|
+
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,
|
|
4011
|
+
props.icon ? /* @__PURE__ */ React22.createElement(Icon, { name: props.icon, className: "aura-switch-row__icon" }) : null
|
|
3926
4012
|
);
|
|
3927
4013
|
});
|
|
3928
4014
|
|
|
3929
4015
|
// src/Combobox.tsx
|
|
3930
|
-
var
|
|
4016
|
+
var React23 = __toESM(require("react"), 1);
|
|
3931
4017
|
var import_react_dom5 = require("react-dom");
|
|
3932
4018
|
function norm(s) {
|
|
3933
4019
|
return String(s == null ? "" : s).normalize("NFC").toLocaleLowerCase("th");
|
|
@@ -3942,7 +4028,7 @@ function defaultFilter(option, query) {
|
|
|
3942
4028
|
return norm(k).indexOf(q) >= 0;
|
|
3943
4029
|
});
|
|
3944
4030
|
}
|
|
3945
|
-
var Combobox =
|
|
4031
|
+
var Combobox = React23.forwardRef(
|
|
3946
4032
|
function Combobox2(all, ref) {
|
|
3947
4033
|
const props = all;
|
|
3948
4034
|
const multi = all.multiple === true;
|
|
@@ -3984,11 +4070,11 @@ var Combobox = React22.forwardRef(
|
|
|
3984
4070
|
return o.value === v;
|
|
3985
4071
|
})[0];
|
|
3986
4072
|
}).filter(Boolean) : [];
|
|
3987
|
-
const openState =
|
|
3988
|
-
const qState =
|
|
3989
|
-
const aState =
|
|
3990
|
-
const posState =
|
|
3991
|
-
const inputRef =
|
|
4073
|
+
const openState = React23.useState(false), open = openState[0], setOpen = openState[1];
|
|
4074
|
+
const qState = React23.useState(null), query = qState[0], setQuery = qState[1];
|
|
4075
|
+
const aState = React23.useState(0), active = aState[0], setActive = aState[1];
|
|
4076
|
+
const posState = React23.useState(null);
|
|
4077
|
+
const inputRef = React23.useRef(null), inputMerged = useMergedRef(ref, inputRef), boxRef = React23.useRef(null), listRef = React23.useRef(null);
|
|
3992
4078
|
const mounted = useMounted();
|
|
3993
4079
|
const limit = props.limit || 200;
|
|
3994
4080
|
const filter = props.filter || defaultFilter;
|
|
@@ -4018,7 +4104,7 @@ var Combobox = React22.forwardRef(
|
|
|
4018
4104
|
},
|
|
4019
4105
|
[open, shown.length, values.length]
|
|
4020
4106
|
);
|
|
4021
|
-
|
|
4107
|
+
React23.useEffect(
|
|
4022
4108
|
function() {
|
|
4023
4109
|
if (!open) return;
|
|
4024
4110
|
function outside(e) {
|
|
@@ -4041,7 +4127,7 @@ var Combobox = React22.forwardRef(
|
|
|
4041
4127
|
},
|
|
4042
4128
|
[open]
|
|
4043
4129
|
);
|
|
4044
|
-
|
|
4130
|
+
React23.useEffect(
|
|
4045
4131
|
function() {
|
|
4046
4132
|
if (!open || !listRef.current) return;
|
|
4047
4133
|
const el = listRef.current.querySelector('[data-idx="' + activeIdx + '"]');
|
|
@@ -4061,8 +4147,8 @@ var Combobox = React22.forwardRef(
|
|
|
4061
4147
|
setOpen(false);
|
|
4062
4148
|
setQuery(null);
|
|
4063
4149
|
}
|
|
4064
|
-
const committed =
|
|
4065
|
-
const commitRef =
|
|
4150
|
+
const committed = React23.useRef(false);
|
|
4151
|
+
const commitRef = React23.useRef(function() {
|
|
4066
4152
|
return false;
|
|
4067
4153
|
});
|
|
4068
4154
|
function commitTyped() {
|
|
@@ -4150,7 +4236,7 @@ var Combobox = React22.forwardRef(
|
|
|
4150
4236
|
function renderOpt(o, i) {
|
|
4151
4237
|
const isSel = multi ? isPicked(o.value) : !!selected && o.value === selected.value;
|
|
4152
4238
|
const blocked = o.disabled || multi && full && !isSel;
|
|
4153
|
-
return /* @__PURE__ */
|
|
4239
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4154
4240
|
"li",
|
|
4155
4241
|
{
|
|
4156
4242
|
key: o.value,
|
|
@@ -4176,9 +4262,9 @@ var Combobox = React22.forwardRef(
|
|
|
4176
4262
|
if (activeIdx !== i) setActive(i);
|
|
4177
4263
|
}
|
|
4178
4264
|
},
|
|
4179
|
-
o.icon ? /* @__PURE__ */
|
|
4180
|
-
/* @__PURE__ */
|
|
4181
|
-
isSel ? /* @__PURE__ */
|
|
4265
|
+
o.icon ? /* @__PURE__ */ React23.createElement(Icon, { name: o.icon }) : null,
|
|
4266
|
+
/* @__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),
|
|
4267
|
+
isSel ? /* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
4182
4268
|
);
|
|
4183
4269
|
}
|
|
4184
4270
|
function grouped(list2) {
|
|
@@ -4191,7 +4277,7 @@ var Combobox = React22.forwardRef(
|
|
|
4191
4277
|
return out;
|
|
4192
4278
|
}
|
|
4193
4279
|
const list = open && mounted && posState[0] ? (0, import_react_dom5.createPortal)(
|
|
4194
|
-
/* @__PURE__ */
|
|
4280
|
+
/* @__PURE__ */ React23.createElement(
|
|
4195
4281
|
"div",
|
|
4196
4282
|
{
|
|
4197
4283
|
ref: listRef,
|
|
@@ -4202,7 +4288,7 @@ var Combobox = React22.forwardRef(
|
|
|
4202
4288
|
e.preventDefault();
|
|
4203
4289
|
}
|
|
4204
4290
|
},
|
|
4205
|
-
live.length ? /* @__PURE__ */
|
|
4291
|
+
live.length ? /* @__PURE__ */ React23.createElement(
|
|
4206
4292
|
"ul",
|
|
4207
4293
|
{
|
|
4208
4294
|
id: listId,
|
|
@@ -4213,20 +4299,20 @@ var Combobox = React22.forwardRef(
|
|
|
4213
4299
|
},
|
|
4214
4300
|
grouped(live).map(function(seg) {
|
|
4215
4301
|
if (seg.g == null)
|
|
4216
|
-
return /* @__PURE__ */
|
|
4302
|
+
return /* @__PURE__ */ React23.createElement(React23.Fragment, { key: "u" + seg.items[0][1] }, seg.items.map(function(p) {
|
|
4217
4303
|
return renderOpt(p[0], p[1]);
|
|
4218
4304
|
}));
|
|
4219
4305
|
const gid = id + "-group-" + seg.g + "-" + seg.items[0][1];
|
|
4220
|
-
return /* @__PURE__ */
|
|
4306
|
+
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
4307
|
return renderOpt(p[0], p[1]);
|
|
4222
4308
|
})));
|
|
4223
4309
|
})
|
|
4224
4310
|
) : null,
|
|
4225
|
-
props.loading || !live.length || more ? /* @__PURE__ */
|
|
4311
|
+
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
4312
|
),
|
|
4227
4313
|
document.body
|
|
4228
4314
|
) : null;
|
|
4229
|
-
return /* @__PURE__ */
|
|
4315
|
+
return /* @__PURE__ */ React23.createElement(
|
|
4230
4316
|
Field,
|
|
4231
4317
|
{
|
|
4232
4318
|
id,
|
|
@@ -4239,8 +4325,8 @@ var Combobox = React22.forwardRef(
|
|
|
4239
4325
|
disabled: props.disabled,
|
|
4240
4326
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
4241
4327
|
},
|
|
4242
|
-
/* @__PURE__ */
|
|
4243
|
-
return /* @__PURE__ */
|
|
4328
|
+
/* @__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) {
|
|
4329
|
+
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
4330
|
"button",
|
|
4245
4331
|
{
|
|
4246
4332
|
type: "button",
|
|
@@ -4259,13 +4345,13 @@ var Combobox = React22.forwardRef(
|
|
|
4259
4345
|
if (inputRef.current) inputRef.current.focus();
|
|
4260
4346
|
}
|
|
4261
4347
|
},
|
|
4262
|
-
/* @__PURE__ */
|
|
4348
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconX, null) })
|
|
4263
4349
|
));
|
|
4264
|
-
})) : null, multi ? /* @__PURE__ */
|
|
4350
|
+
})) : null, multi ? /* @__PURE__ */ React23.createElement("span", { id: summaryId, className: "aura-sr-only" }, picked.length ? t.selectedCount(picked.length) + ": " + picked.map(function(o) {
|
|
4265
4351
|
return o.label;
|
|
4266
4352
|
}).join(", ") : "") : null, props.name ? multi ? values.map(function(v) {
|
|
4267
|
-
return /* @__PURE__ */
|
|
4268
|
-
}) : /* @__PURE__ */
|
|
4353
|
+
return /* @__PURE__ */ React23.createElement("input", { key: v, type: "hidden", name: props.name, value: v });
|
|
4354
|
+
}) : /* @__PURE__ */ React23.createElement("input", { type: "hidden", name: props.name, value: value == null ? "" : value }) : null, /* @__PURE__ */ React23.createElement(
|
|
4269
4355
|
"input",
|
|
4270
4356
|
{
|
|
4271
4357
|
ref: inputMerged,
|
|
@@ -4314,7 +4400,7 @@ var Combobox = React22.forwardRef(
|
|
|
4314
4400
|
}, 0);
|
|
4315
4401
|
}
|
|
4316
4402
|
}
|
|
4317
|
-
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */
|
|
4403
|
+
), props.clearable !== false && values.length && !props.disabled && !props.readOnly ? /* @__PURE__ */ React23.createElement(
|
|
4318
4404
|
"button",
|
|
4319
4405
|
{
|
|
4320
4406
|
type: "button",
|
|
@@ -4327,8 +4413,8 @@ var Combobox = React22.forwardRef(
|
|
|
4327
4413
|
if (inputRef.current) inputRef.current.focus();
|
|
4328
4414
|
}
|
|
4329
4415
|
},
|
|
4330
|
-
/* @__PURE__ */
|
|
4331
|
-
) : null, /* @__PURE__ */
|
|
4416
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconX, null) })
|
|
4417
|
+
) : null, /* @__PURE__ */ React23.createElement(
|
|
4332
4418
|
"button",
|
|
4333
4419
|
{
|
|
4334
4420
|
type: "button",
|
|
@@ -4346,7 +4432,7 @@ var Combobox = React22.forwardRef(
|
|
|
4346
4432
|
}
|
|
4347
4433
|
}
|
|
4348
4434
|
},
|
|
4349
|
-
/* @__PURE__ */
|
|
4435
|
+
/* @__PURE__ */ React23.createElement(Icon, { name: /* @__PURE__ */ React23.createElement(IconChevronDown, null) })
|
|
4350
4436
|
)),
|
|
4351
4437
|
list
|
|
4352
4438
|
);
|
|
@@ -4354,20 +4440,20 @@ var Combobox = React22.forwardRef(
|
|
|
4354
4440
|
);
|
|
4355
4441
|
|
|
4356
4442
|
// src/Alert.tsx
|
|
4357
|
-
var
|
|
4358
|
-
var Alert =
|
|
4443
|
+
var React24 = __toESM(require("react"), 1);
|
|
4444
|
+
var Alert = React24.forwardRef(function Alert2(props, ref) {
|
|
4359
4445
|
const t = useStrings();
|
|
4360
4446
|
const autoId = uid();
|
|
4361
4447
|
return alertElement(
|
|
4362
4448
|
props,
|
|
4363
4449
|
ref,
|
|
4364
|
-
props.onDismiss ? /* @__PURE__ */
|
|
4450
|
+
props.onDismiss ? /* @__PURE__ */ React24.createElement(IconButton, { icon: /* @__PURE__ */ React24.createElement(IconX, null), label: t.dismiss, className: "aura-alert__close", onClick: props.onDismiss }) : null,
|
|
4365
4451
|
autoId
|
|
4366
4452
|
);
|
|
4367
4453
|
});
|
|
4368
4454
|
|
|
4369
4455
|
// src/Toaster.tsx
|
|
4370
|
-
var
|
|
4456
|
+
var React25 = __toESM(require("react"), 1);
|
|
4371
4457
|
var import_react_dom6 = require("react-dom");
|
|
4372
4458
|
var MAX_VISIBLE = 3;
|
|
4373
4459
|
var toastState = {
|
|
@@ -4443,8 +4529,8 @@ function outsideToaster(el) {
|
|
|
4443
4529
|
function ToastItem(props) {
|
|
4444
4530
|
const str = useStrings();
|
|
4445
4531
|
const Link = useLinkComponent();
|
|
4446
|
-
const node =
|
|
4447
|
-
const origin =
|
|
4532
|
+
const node = React25.useRef(null);
|
|
4533
|
+
const origin = React25.useRef(null);
|
|
4448
4534
|
useIsoLayoutEffect(function() {
|
|
4449
4535
|
origin.current = outsideToaster(document.activeElement);
|
|
4450
4536
|
const el = node.current;
|
|
@@ -4460,8 +4546,8 @@ function ToastItem(props) {
|
|
|
4460
4546
|
}, 0);
|
|
4461
4547
|
};
|
|
4462
4548
|
}, []);
|
|
4463
|
-
const t = props.toast, timer2 =
|
|
4464
|
-
const hover =
|
|
4549
|
+
const t = props.toast, timer2 = React25.useRef(null), left = React25.useRef(t.duration || 5e3), since = React25.useRef(0);
|
|
4550
|
+
const hover = React25.useRef(false), focused = React25.useRef(false);
|
|
4465
4551
|
function syncFocus() {
|
|
4466
4552
|
if (focused.current && !(node.current && node.current.contains(document.activeElement))) focused.current = false;
|
|
4467
4553
|
}
|
|
@@ -4483,7 +4569,7 @@ function ToastItem(props) {
|
|
|
4483
4569
|
left.current -= Date.now() - since.current;
|
|
4484
4570
|
}
|
|
4485
4571
|
}
|
|
4486
|
-
|
|
4572
|
+
React25.useEffect(
|
|
4487
4573
|
function() {
|
|
4488
4574
|
if (timer2.current) clearTimeout(timer2.current);
|
|
4489
4575
|
timer2.current = null;
|
|
@@ -4502,7 +4588,7 @@ function ToastItem(props) {
|
|
|
4502
4588
|
if (a.onClick) a.onClick();
|
|
4503
4589
|
if (a.dismiss !== false) toast.dismiss(t.id);
|
|
4504
4590
|
}
|
|
4505
|
-
return /* @__PURE__ */
|
|
4591
|
+
return /* @__PURE__ */ React25.createElement(
|
|
4506
4592
|
"div",
|
|
4507
4593
|
{
|
|
4508
4594
|
ref: node,
|
|
@@ -4539,16 +4625,16 @@ function ToastItem(props) {
|
|
|
4539
4625
|
resume();
|
|
4540
4626
|
}
|
|
4541
4627
|
},
|
|
4542
|
-
/* @__PURE__ */
|
|
4628
|
+
/* @__PURE__ */ React25.createElement(
|
|
4543
4629
|
Icon,
|
|
4544
4630
|
{
|
|
4545
|
-
name: t.loading ? /* @__PURE__ */
|
|
4631
|
+
name: t.loading ? /* @__PURE__ */ React25.createElement(IconLoaderCircle, null) : React25.createElement(ALERT_ICON[t.tone] || IconInfo),
|
|
4546
4632
|
className: cx("aura-toast__icon", t.loading && "aura-spin")
|
|
4547
4633
|
}
|
|
4548
4634
|
),
|
|
4549
|
-
/* @__PURE__ */
|
|
4550
|
-
actions.length ? /* @__PURE__ */
|
|
4551
|
-
return a.href ? /* @__PURE__ */
|
|
4635
|
+
/* @__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),
|
|
4636
|
+
actions.length ? /* @__PURE__ */ React25.createElement("div", { className: "aura-toast__actions" }, actions.map(function(a, i) {
|
|
4637
|
+
return a.href ? /* @__PURE__ */ React25.createElement(
|
|
4552
4638
|
Link,
|
|
4553
4639
|
{
|
|
4554
4640
|
key: i,
|
|
@@ -4560,7 +4646,7 @@ function ToastItem(props) {
|
|
|
4560
4646
|
}
|
|
4561
4647
|
},
|
|
4562
4648
|
a.label
|
|
4563
|
-
) : /* @__PURE__ */
|
|
4649
|
+
) : /* @__PURE__ */ React25.createElement(
|
|
4564
4650
|
"button",
|
|
4565
4651
|
{
|
|
4566
4652
|
key: i,
|
|
@@ -4573,10 +4659,10 @@ function ToastItem(props) {
|
|
|
4573
4659
|
a.label
|
|
4574
4660
|
);
|
|
4575
4661
|
})) : null,
|
|
4576
|
-
/* @__PURE__ */
|
|
4662
|
+
/* @__PURE__ */ React25.createElement(
|
|
4577
4663
|
IconButton,
|
|
4578
4664
|
{
|
|
4579
|
-
icon: /* @__PURE__ */
|
|
4665
|
+
icon: /* @__PURE__ */ React25.createElement(IconX, null),
|
|
4580
4666
|
label: str.dismissToast,
|
|
4581
4667
|
className: "aura-toast__close",
|
|
4582
4668
|
onClick: function() {
|
|
@@ -4604,8 +4690,8 @@ function hotkeyMatcher(spec) {
|
|
|
4604
4690
|
function Toaster(props = {}) {
|
|
4605
4691
|
const t = useStrings();
|
|
4606
4692
|
const mounted = useMounted();
|
|
4607
|
-
const s =
|
|
4608
|
-
|
|
4693
|
+
const s = React25.useState(toastState.list);
|
|
4694
|
+
React25.useEffect(function() {
|
|
4609
4695
|
toastState.subs.push(s[1]);
|
|
4610
4696
|
s[1](toastState.list.slice());
|
|
4611
4697
|
return function() {
|
|
@@ -4614,9 +4700,9 @@ function Toaster(props = {}) {
|
|
|
4614
4700
|
});
|
|
4615
4701
|
};
|
|
4616
4702
|
}, []);
|
|
4617
|
-
const region =
|
|
4703
|
+
const region = React25.useRef(null);
|
|
4618
4704
|
const hotkey = props.hotkey === void 0 ? "Alt+T" : props.hotkey;
|
|
4619
|
-
|
|
4705
|
+
React25.useEffect(
|
|
4620
4706
|
function() {
|
|
4621
4707
|
if (!hotkey) return;
|
|
4622
4708
|
const match = hotkeyMatcher(hotkey);
|
|
@@ -4647,7 +4733,7 @@ function Toaster(props = {}) {
|
|
|
4647
4733
|
const pos = props.position || "bottom";
|
|
4648
4734
|
const offset = props.offset;
|
|
4649
4735
|
return (0, import_react_dom6.createPortal)(
|
|
4650
|
-
/* @__PURE__ */
|
|
4736
|
+
/* @__PURE__ */ React25.createElement(
|
|
4651
4737
|
"div",
|
|
4652
4738
|
{
|
|
4653
4739
|
ref: region,
|
|
@@ -4659,7 +4745,7 @@ function Toaster(props = {}) {
|
|
|
4659
4745
|
"aria-keyshortcuts": hotkey || void 0
|
|
4660
4746
|
},
|
|
4661
4747
|
s[0].map(function(t2) {
|
|
4662
|
-
return /* @__PURE__ */
|
|
4748
|
+
return /* @__PURE__ */ React25.createElement(ToastItem, { key: t2.id, toast: t2 });
|
|
4663
4749
|
})
|
|
4664
4750
|
),
|
|
4665
4751
|
document.body
|
|
@@ -4667,12 +4753,12 @@ function Toaster(props = {}) {
|
|
|
4667
4753
|
}
|
|
4668
4754
|
|
|
4669
4755
|
// src/PasswordField.tsx
|
|
4670
|
-
var
|
|
4671
|
-
var PasswordField =
|
|
4756
|
+
var React26 = __toESM(require("react"), 1);
|
|
4757
|
+
var PasswordField = React26.forwardRef(function PasswordField2(props, ref) {
|
|
4672
4758
|
const t = useStrings();
|
|
4673
|
-
const shown =
|
|
4759
|
+
const shown = React26.useState(false);
|
|
4674
4760
|
const rest = omit(props, ["toggle", "className"]);
|
|
4675
|
-
return /* @__PURE__ */
|
|
4761
|
+
return /* @__PURE__ */ React26.createElement(
|
|
4676
4762
|
TextField,
|
|
4677
4763
|
{
|
|
4678
4764
|
autoComplete: "current-password",
|
|
@@ -4682,10 +4768,10 @@ var PasswordField = React25.forwardRef(function PasswordField2(props, ref) {
|
|
|
4682
4768
|
spellCheck: false,
|
|
4683
4769
|
autoCapitalize: "none",
|
|
4684
4770
|
className: cx("aura-password", props.className),
|
|
4685
|
-
suffix: props.toggle === false ? void 0 : /* @__PURE__ */
|
|
4771
|
+
suffix: props.toggle === false ? void 0 : /* @__PURE__ */ React26.createElement(
|
|
4686
4772
|
IconButton,
|
|
4687
4773
|
{
|
|
4688
|
-
icon: shown[0] ? /* @__PURE__ */
|
|
4774
|
+
icon: shown[0] ? /* @__PURE__ */ React26.createElement(IconEyeOff, null) : /* @__PURE__ */ React26.createElement(IconEye, null),
|
|
4689
4775
|
label: t.showPassword,
|
|
4690
4776
|
"aria-pressed": shown[0],
|
|
4691
4777
|
disabled: props.disabled,
|
|
@@ -4699,7 +4785,7 @@ var PasswordField = React25.forwardRef(function PasswordField2(props, ref) {
|
|
|
4699
4785
|
});
|
|
4700
4786
|
|
|
4701
4787
|
// src/FormErrorSummary.tsx
|
|
4702
|
-
var
|
|
4788
|
+
var React27 = __toESM(require("react"), 1);
|
|
4703
4789
|
function items(errors) {
|
|
4704
4790
|
if (Array.isArray(errors)) return errors;
|
|
4705
4791
|
const out = [];
|
|
@@ -4728,16 +4814,16 @@ function fieldElement(field) {
|
|
|
4728
4814
|
}
|
|
4729
4815
|
return named;
|
|
4730
4816
|
}
|
|
4731
|
-
var FormErrorSummary =
|
|
4817
|
+
var FormErrorSummary = React27.forwardRef(
|
|
4732
4818
|
function FormErrorSummary2(props, ref) {
|
|
4733
4819
|
const t = useStrings();
|
|
4734
4820
|
const auto = uid(), id = props.id || auto;
|
|
4735
4821
|
const list = items(props.errors);
|
|
4736
|
-
const box =
|
|
4822
|
+
const box = React27.useRef(null);
|
|
4737
4823
|
const keyed = props.focusKey !== void 0;
|
|
4738
|
-
const lastKey =
|
|
4824
|
+
const lastKey = React27.useRef(null), armed = React27.useRef(false), hadErrors = React27.useRef(false);
|
|
4739
4825
|
const has = list.length > 0;
|
|
4740
|
-
|
|
4826
|
+
React27.useEffect(
|
|
4741
4827
|
function() {
|
|
4742
4828
|
const appeared = has && !hadErrors.current;
|
|
4743
4829
|
hadErrors.current = has;
|
|
@@ -4761,7 +4847,7 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4761
4847
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
4762
4848
|
[has, props.focusKey, keyed]
|
|
4763
4849
|
);
|
|
4764
|
-
|
|
4850
|
+
React27.useEffect(
|
|
4765
4851
|
function() {
|
|
4766
4852
|
if (!keyed) return;
|
|
4767
4853
|
function disarm() {
|
|
@@ -4780,7 +4866,7 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4780
4866
|
[keyed]
|
|
4781
4867
|
);
|
|
4782
4868
|
if (!list.length) return null;
|
|
4783
|
-
return /* @__PURE__ */
|
|
4869
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4784
4870
|
"div",
|
|
4785
4871
|
{
|
|
4786
4872
|
ref: function(el) {
|
|
@@ -4794,9 +4880,9 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4794
4880
|
"aria-labelledby": id + "-title",
|
|
4795
4881
|
className: cx("aura-alert aura-alert--danger aura-error-summary", props.className)
|
|
4796
4882
|
},
|
|
4797
|
-
/* @__PURE__ */
|
|
4798
|
-
/* @__PURE__ */
|
|
4799
|
-
return /* @__PURE__ */
|
|
4883
|
+
/* @__PURE__ */ React27.createElement(Icon, { name: /* @__PURE__ */ React27.createElement(IconCircleAlert, null), className: "aura-alert__icon" }),
|
|
4884
|
+
/* @__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) {
|
|
4885
|
+
return /* @__PURE__ */ React27.createElement("li", { key: e.field }, /* @__PURE__ */ React27.createElement(
|
|
4800
4886
|
"a",
|
|
4801
4887
|
{
|
|
4802
4888
|
href: "#" + e.field,
|
|
@@ -4821,14 +4907,14 @@ var FormErrorSummary = React26.forwardRef(
|
|
|
4821
4907
|
);
|
|
4822
4908
|
|
|
4823
4909
|
// src/FilterBar.tsx
|
|
4824
|
-
var
|
|
4910
|
+
var React32 = __toESM(require("react"), 1);
|
|
4825
4911
|
|
|
4826
4912
|
// src/Dialog.tsx
|
|
4827
|
-
var
|
|
4913
|
+
var React29 = __toESM(require("react"), 1);
|
|
4828
4914
|
var import_react_dom7 = require("react-dom");
|
|
4829
4915
|
|
|
4830
4916
|
// src/useModal.tsx
|
|
4831
|
-
var
|
|
4917
|
+
var React28 = __toESM(require("react"), 1);
|
|
4832
4918
|
var locks = 0;
|
|
4833
4919
|
var savedOverflow = "";
|
|
4834
4920
|
function lockScroll() {
|
|
@@ -4855,11 +4941,11 @@ function tabbable(el) {
|
|
|
4855
4941
|
}
|
|
4856
4942
|
function useModal(open, ref, opts) {
|
|
4857
4943
|
const mounted = useMounted();
|
|
4858
|
-
const prev =
|
|
4944
|
+
const prev = React28.useRef(null);
|
|
4859
4945
|
const o = opts || {};
|
|
4860
|
-
const latest =
|
|
4946
|
+
const latest = React28.useRef(o);
|
|
4861
4947
|
latest.current = o;
|
|
4862
|
-
|
|
4948
|
+
React28.useEffect(
|
|
4863
4949
|
function() {
|
|
4864
4950
|
if (!open || !mounted) return;
|
|
4865
4951
|
prev.current = document.activeElement;
|
|
@@ -4914,15 +5000,15 @@ function useModal(open, ref, opts) {
|
|
|
4914
5000
|
}
|
|
4915
5001
|
|
|
4916
5002
|
// src/Dialog.tsx
|
|
4917
|
-
var DialogClose =
|
|
5003
|
+
var DialogClose = React29.createContext(null);
|
|
4918
5004
|
function useDialogClose() {
|
|
4919
|
-
return
|
|
5005
|
+
return React29.useContext(DialogClose) || function() {
|
|
4920
5006
|
};
|
|
4921
5007
|
}
|
|
4922
|
-
var Dialog =
|
|
5008
|
+
var Dialog = React29.forwardRef(function Dialog2(props, ref) {
|
|
4923
5009
|
const t = useStrings();
|
|
4924
5010
|
const density = useDensity();
|
|
4925
|
-
const own =
|
|
5011
|
+
const own = React29.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
4926
5012
|
const openState = useMaybeControlled(props.open, false, null), open = openState[0];
|
|
4927
5013
|
if (props.open === void 0 && !props.trigger)
|
|
4928
5014
|
devWarnOnce("dialog-no-open", "Dialog has neither `open` nor `trigger`, so it can never open. Pass one of them.");
|
|
@@ -4950,7 +5036,7 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4950
5036
|
onCloseComplete: props.onCloseComplete
|
|
4951
5037
|
});
|
|
4952
5038
|
const trig = props.trigger;
|
|
4953
|
-
const trigger = trig &&
|
|
5039
|
+
const trigger = trig && React29.isValidElement(trig) ? React29.cloneElement(trig, {
|
|
4954
5040
|
"aria-haspopup": "dialog",
|
|
4955
5041
|
"aria-expanded": open,
|
|
4956
5042
|
"data-aura-trigger": trigId,
|
|
@@ -4985,7 +5071,7 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4985
5071
|
"aria-modal"
|
|
4986
5072
|
]);
|
|
4987
5073
|
const panel = (0, import_react_dom7.createPortal)(
|
|
4988
|
-
/* @__PURE__ */
|
|
5074
|
+
/* @__PURE__ */ React29.createElement("div", { className: "aura-dialog-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React29.createElement(
|
|
4989
5075
|
"div",
|
|
4990
5076
|
{
|
|
4991
5077
|
className: "aura-scrim",
|
|
@@ -4995,7 +5081,7 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
4995
5081
|
},
|
|
4996
5082
|
"aria-hidden": true
|
|
4997
5083
|
}
|
|
4998
|
-
), /* @__PURE__ */
|
|
5084
|
+
), /* @__PURE__ */ React29.createElement(
|
|
4999
5085
|
"div",
|
|
5000
5086
|
{
|
|
5001
5087
|
...rest,
|
|
@@ -5007,18 +5093,18 @@ var Dialog = React28.forwardRef(function Dialog2(props, ref) {
|
|
|
5007
5093
|
tabIndex: -1,
|
|
5008
5094
|
className: cx("aura-dialog", "aura-dialog--" + (props.size || "md"), props.className)
|
|
5009
5095
|
},
|
|
5010
|
-
/* @__PURE__ */
|
|
5011
|
-
props.description ? /* @__PURE__ */
|
|
5012
|
-
/* @__PURE__ */
|
|
5096
|
+
/* @__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),
|
|
5097
|
+
props.description ? /* @__PURE__ */ React29.createElement("p", { className: "aura-dialog__desc", id: descId }, props.description) : null,
|
|
5098
|
+
/* @__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
5099
|
)),
|
|
5014
5100
|
document.body
|
|
5015
5101
|
);
|
|
5016
|
-
return trigger ? /* @__PURE__ */
|
|
5102
|
+
return trigger ? /* @__PURE__ */ React29.createElement(React29.Fragment, null, trigger, panel) : panel;
|
|
5017
5103
|
});
|
|
5018
|
-
var Drawer =
|
|
5104
|
+
var Drawer = React29.forwardRef(function Drawer2(props, ref) {
|
|
5019
5105
|
const t = useStrings();
|
|
5020
5106
|
const density = useDensity();
|
|
5021
|
-
const own =
|
|
5107
|
+
const own = React29.useRef(null), merged = useMergedRef(ref, own), titleId = uid(), descId = uid();
|
|
5022
5108
|
function close() {
|
|
5023
5109
|
if (props.dismissible !== false && props.onClose) props.onClose();
|
|
5024
5110
|
}
|
|
@@ -5055,7 +5141,7 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5055
5141
|
]);
|
|
5056
5142
|
const drawerScrimCloses = props.dismissible !== false && props.dismissOnScrim !== false;
|
|
5057
5143
|
return (0, import_react_dom7.createPortal)(
|
|
5058
|
-
/* @__PURE__ */
|
|
5144
|
+
/* @__PURE__ */ React29.createElement("div", { className: "aura-dialog-layer aura-drawer-layer", "data-density": density, onKeyDown: modal.onKeyDown }, /* @__PURE__ */ React29.createElement(
|
|
5059
5145
|
"div",
|
|
5060
5146
|
{
|
|
5061
5147
|
className: "aura-scrim",
|
|
@@ -5065,7 +5151,7 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5065
5151
|
} : void 0,
|
|
5066
5152
|
"aria-hidden": true
|
|
5067
5153
|
}
|
|
5068
|
-
), /* @__PURE__ */
|
|
5154
|
+
), /* @__PURE__ */ React29.createElement(
|
|
5069
5155
|
"div",
|
|
5070
5156
|
{
|
|
5071
5157
|
...rest,
|
|
@@ -5078,11 +5164,11 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5078
5164
|
tabIndex: -1,
|
|
5079
5165
|
className: cx("aura-drawer", "aura-drawer--" + side, "aura-drawer--" + (props.size || "md"), props.className)
|
|
5080
5166
|
},
|
|
5081
|
-
props.title || props.dismissible !== false ? /* @__PURE__ */
|
|
5167
|
+
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
5168
|
IconButton,
|
|
5083
5169
|
{
|
|
5084
5170
|
...props.closeProps,
|
|
5085
|
-
icon: /* @__PURE__ */
|
|
5171
|
+
icon: /* @__PURE__ */ React29.createElement(IconX, null),
|
|
5086
5172
|
label: props.closeLabel || t.close,
|
|
5087
5173
|
onClick: function(e) {
|
|
5088
5174
|
const own2 = props.closeProps && props.closeProps.onClick;
|
|
@@ -5091,24 +5177,24 @@ var Drawer = React28.forwardRef(function Drawer2(props, ref) {
|
|
|
5091
5177
|
}
|
|
5092
5178
|
}
|
|
5093
5179
|
) : null) : null,
|
|
5094
|
-
props.description ? /* @__PURE__ */
|
|
5095
|
-
/* @__PURE__ */
|
|
5096
|
-
props.footer ? /* @__PURE__ */
|
|
5180
|
+
props.description ? /* @__PURE__ */ React29.createElement("p", { className: "aura-drawer__desc", id: descId }, props.description) : null,
|
|
5181
|
+
/* @__PURE__ */ React29.createElement("div", { className: "aura-drawer__body" }, props.children),
|
|
5182
|
+
props.footer ? /* @__PURE__ */ React29.createElement("div", { className: "aura-drawer__foot" }, props.footer) : null
|
|
5097
5183
|
)),
|
|
5098
5184
|
document.body
|
|
5099
5185
|
);
|
|
5100
5186
|
});
|
|
5101
5187
|
|
|
5102
5188
|
// src/Tag.tsx
|
|
5103
|
-
var
|
|
5189
|
+
var React31 = __toESM(require("react"), 1);
|
|
5104
5190
|
|
|
5105
5191
|
// src/Tooltip.tsx
|
|
5106
|
-
var
|
|
5192
|
+
var React30 = __toESM(require("react"), 1);
|
|
5107
5193
|
var import_react_dom8 = require("react-dom");
|
|
5108
|
-
var Tooltip =
|
|
5109
|
-
const id = uid(), st =
|
|
5110
|
-
const anchor =
|
|
5111
|
-
const pos =
|
|
5194
|
+
var Tooltip = React30.forwardRef(function Tooltip2(props, ref) {
|
|
5195
|
+
const id = uid(), st = React30.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
5196
|
+
const anchor = React30.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip2 = React30.useRef(null), timer2 = React30.useRef(void 0);
|
|
5197
|
+
const pos = React30.useState(null), mounted = useMounted();
|
|
5112
5198
|
function show3(now) {
|
|
5113
5199
|
clearTimeout(timer2.current);
|
|
5114
5200
|
timer2.current = setTimeout(
|
|
@@ -5128,7 +5214,7 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5128
5214
|
set(false);
|
|
5129
5215
|
}, 120);
|
|
5130
5216
|
}
|
|
5131
|
-
|
|
5217
|
+
React30.useEffect(function() {
|
|
5132
5218
|
return function() {
|
|
5133
5219
|
clearTimeout(timer2.current);
|
|
5134
5220
|
};
|
|
@@ -5172,7 +5258,7 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5172
5258
|
},
|
|
5173
5259
|
[open, mounted]
|
|
5174
5260
|
);
|
|
5175
|
-
|
|
5261
|
+
React30.useEffect(
|
|
5176
5262
|
function() {
|
|
5177
5263
|
if (!open) return;
|
|
5178
5264
|
function esc(e) {
|
|
@@ -5185,8 +5271,8 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5185
5271
|
},
|
|
5186
5272
|
[open]
|
|
5187
5273
|
);
|
|
5188
|
-
const child =
|
|
5189
|
-
const trigger = /* @__PURE__ */
|
|
5274
|
+
const child = React30.Children.only(props.children);
|
|
5275
|
+
const trigger = /* @__PURE__ */ React30.createElement(
|
|
5190
5276
|
"span",
|
|
5191
5277
|
{
|
|
5192
5278
|
ref: anchorMerged,
|
|
@@ -5200,10 +5286,10 @@ var Tooltip = React29.forwardRef(function Tooltip2(props, ref) {
|
|
|
5200
5286
|
},
|
|
5201
5287
|
onBlur: hide2
|
|
5202
5288
|
},
|
|
5203
|
-
|
|
5289
|
+
React30.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
5204
5290
|
);
|
|
5205
|
-
return /* @__PURE__ */
|
|
5206
|
-
/* @__PURE__ */
|
|
5291
|
+
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, trigger, open && mounted ? (0, import_react_dom8.createPortal)(
|
|
5292
|
+
/* @__PURE__ */ React30.createElement(
|
|
5207
5293
|
"div",
|
|
5208
5294
|
{
|
|
5209
5295
|
ref: tip2,
|
|
@@ -5230,13 +5316,13 @@ function textOf2(node, all) {
|
|
|
5230
5316
|
return node.map(function(n3) {
|
|
5231
5317
|
return textOf2(n3, all);
|
|
5232
5318
|
}).join("");
|
|
5233
|
-
if (
|
|
5319
|
+
if (React31.isValidElement(node)) {
|
|
5234
5320
|
const p = node.props;
|
|
5235
5321
|
return !all && (p["aria-hidden"] === true || p["aria-hidden"] === "true") ? "" : textOf2(p.children, all);
|
|
5236
5322
|
}
|
|
5237
5323
|
return "";
|
|
5238
5324
|
}
|
|
5239
|
-
var Tag =
|
|
5325
|
+
var Tag = React31.forwardRef(function Tag2(props, ref) {
|
|
5240
5326
|
const t = useStrings();
|
|
5241
5327
|
const selectable = props.onClick != null || props.selected != null;
|
|
5242
5328
|
const rest = omit(props, [
|
|
@@ -5249,10 +5335,10 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5249
5335
|
"removeLabel",
|
|
5250
5336
|
"touchHeight"
|
|
5251
5337
|
]);
|
|
5252
|
-
const textRef =
|
|
5338
|
+
const textRef = React31.useRef(null);
|
|
5253
5339
|
useAutoTip();
|
|
5254
|
-
const cutState =
|
|
5255
|
-
const check =
|
|
5340
|
+
const cutState = React31.useState(false), isCut = cutState[0];
|
|
5341
|
+
const check = React31.useCallback(function() {
|
|
5256
5342
|
const el = textRef.current;
|
|
5257
5343
|
if (el) cutState[1](el.scrollWidth > el.clientWidth + 1);
|
|
5258
5344
|
}, []);
|
|
@@ -5271,11 +5357,11 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5271
5357
|
);
|
|
5272
5358
|
const fullText = isCut ? textOf2(props.children, true).replace(/\s+/g, " ").trim() : "";
|
|
5273
5359
|
const inner = [
|
|
5274
|
-
props.icon ? /* @__PURE__ */
|
|
5275
|
-
/* @__PURE__ */
|
|
5360
|
+
props.icon ? /* @__PURE__ */ React31.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
|
|
5361
|
+
/* @__PURE__ */ React31.createElement("span", { key: "t", ref: textRef, className: "aura-tag__text", "data-aura-tip": fullText || void 0 }, props.children)
|
|
5276
5362
|
];
|
|
5277
5363
|
if (selectable) {
|
|
5278
|
-
return /* @__PURE__ */
|
|
5364
|
+
return /* @__PURE__ */ React31.createElement(
|
|
5279
5365
|
"button",
|
|
5280
5366
|
{
|
|
5281
5367
|
...rest,
|
|
@@ -5290,7 +5376,7 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5290
5376
|
props.className
|
|
5291
5377
|
)
|
|
5292
5378
|
},
|
|
5293
|
-
props.selected ? /* @__PURE__ */
|
|
5379
|
+
props.selected ? /* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconCheck, null), size: 14 }) : inner[0],
|
|
5294
5380
|
inner[1]
|
|
5295
5381
|
);
|
|
5296
5382
|
}
|
|
@@ -5300,8 +5386,8 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5300
5386
|
"tag-remove-label",
|
|
5301
5387
|
'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
|
|
5302
5388
|
);
|
|
5303
|
-
return /* @__PURE__ */
|
|
5304
|
-
const btn = /* @__PURE__ */
|
|
5389
|
+
return /* @__PURE__ */ React31.createElement("span", { ...rest, ref, className: cx("aura-tag", props.disabled && "is-disabled", props.className) }, inner, props.onRemove && !props.disabled ? function() {
|
|
5390
|
+
const btn = /* @__PURE__ */ React31.createElement(
|
|
5305
5391
|
"button",
|
|
5306
5392
|
{
|
|
5307
5393
|
type: "button",
|
|
@@ -5309,9 +5395,9 @@ var Tag = React30.forwardRef(function Tag2(props, ref) {
|
|
|
5309
5395
|
"aria-label": props.removeLabel || t.remove(name),
|
|
5310
5396
|
onClick: props.onRemove
|
|
5311
5397
|
},
|
|
5312
|
-
/* @__PURE__ */
|
|
5398
|
+
/* @__PURE__ */ React31.createElement(Icon, { name: /* @__PURE__ */ React31.createElement(IconX, null), size: 14 })
|
|
5313
5399
|
);
|
|
5314
|
-
return /* @__PURE__ */
|
|
5400
|
+
return /* @__PURE__ */ React31.createElement(Tooltip, { content: fullText, open: fullText ? void 0 : false }, btn);
|
|
5315
5401
|
}() : null);
|
|
5316
5402
|
});
|
|
5317
5403
|
|
|
@@ -5334,16 +5420,16 @@ var space = function(v) {
|
|
|
5334
5420
|
};
|
|
5335
5421
|
|
|
5336
5422
|
// src/FilterBar.tsx
|
|
5337
|
-
var FilterBar =
|
|
5423
|
+
var FilterBar = React32.forwardRef(function FilterBar2(props, ref) {
|
|
5338
5424
|
const t = useStrings();
|
|
5339
5425
|
const id = uid();
|
|
5340
5426
|
const hasSearch = !!props.onSearchChange;
|
|
5341
|
-
const draft =
|
|
5342
|
-
const timer2 =
|
|
5343
|
-
const sent =
|
|
5344
|
-
const onChange =
|
|
5427
|
+
const draft = React32.useState(props.search || "");
|
|
5428
|
+
const timer2 = React32.useRef(null);
|
|
5429
|
+
const sent = React32.useRef(props.search || "");
|
|
5430
|
+
const onChange = React32.useRef(props.onSearchChange);
|
|
5345
5431
|
onChange.current = props.onSearchChange;
|
|
5346
|
-
|
|
5432
|
+
React32.useEffect(
|
|
5347
5433
|
function() {
|
|
5348
5434
|
if ((props.search || "") !== sent.current) {
|
|
5349
5435
|
sent.current = props.search || "";
|
|
@@ -5352,7 +5438,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5352
5438
|
},
|
|
5353
5439
|
[props.search]
|
|
5354
5440
|
);
|
|
5355
|
-
|
|
5441
|
+
React32.useEffect(function() {
|
|
5356
5442
|
return function() {
|
|
5357
5443
|
if (timer2.current) clearTimeout(timer2.current);
|
|
5358
5444
|
};
|
|
@@ -5375,14 +5461,14 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5375
5461
|
);
|
|
5376
5462
|
}
|
|
5377
5463
|
const filters = props.filters || [];
|
|
5378
|
-
const hasChildren =
|
|
5464
|
+
const hasChildren = React32.Children.toArray(props.children).length > 0;
|
|
5379
5465
|
const collapse = props.collapseBelow && hasChildren ? props.collapseBelow : null;
|
|
5380
|
-
const sheet =
|
|
5466
|
+
const sheet = React32.useState(false), open = !!collapse && sheet[0];
|
|
5381
5467
|
const sheetId = id + "-filters";
|
|
5382
|
-
const doneRef =
|
|
5468
|
+
const doneRef = React32.useRef(null), moreRef = React32.useRef(null), own = React32.useRef(null), rootRef = useMergedRef(ref, own);
|
|
5383
5469
|
if (collapse)
|
|
5384
|
-
|
|
5385
|
-
if (!
|
|
5470
|
+
React32.Children.forEach(props.children, function(c) {
|
|
5471
|
+
if (!React32.isValidElement(c) || c.type === Button || c.type === IconButton) return;
|
|
5386
5472
|
const p = c.props;
|
|
5387
5473
|
if (p.defaultValue !== void 0 || p.defaultChecked !== void 0 || "label" in p && !("value" in p) && !("selected" in p) && !("checked" in p))
|
|
5388
5474
|
devWarnOnce(
|
|
@@ -5400,7 +5486,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5400
5486
|
) || bar.querySelector(".aura-filterbar__search input");
|
|
5401
5487
|
}
|
|
5402
5488
|
const applied = props.filterCount != null ? props.filterCount : filters.length;
|
|
5403
|
-
|
|
5489
|
+
React32.useEffect(
|
|
5404
5490
|
function() {
|
|
5405
5491
|
if (!open || !collapse || typeof window.matchMedia !== "function") return;
|
|
5406
5492
|
const mq = window.matchMedia("(min-width: " + breakpoints[collapse] + "px)");
|
|
@@ -5425,7 +5511,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5425
5511
|
}
|
|
5426
5512
|
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
5427
5513
|
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
5428
|
-
const searchBox = hasSearch ? /* @__PURE__ */
|
|
5514
|
+
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
5515
|
"input",
|
|
5430
5516
|
{
|
|
5431
5517
|
id,
|
|
@@ -5446,10 +5532,10 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5446
5532
|
}
|
|
5447
5533
|
}
|
|
5448
5534
|
}
|
|
5449
|
-
), draft[0] ? /* @__PURE__ */
|
|
5535
|
+
), draft[0] ? /* @__PURE__ */ React32.createElement(
|
|
5450
5536
|
IconButton,
|
|
5451
5537
|
{
|
|
5452
|
-
icon: /* @__PURE__ */
|
|
5538
|
+
icon: /* @__PURE__ */ React32.createElement(IconX, null),
|
|
5453
5539
|
label: t.clear((props.searchLabel || t.search).toLowerCase()),
|
|
5454
5540
|
className: "aura-filterbar__clear-search",
|
|
5455
5541
|
onClick: function() {
|
|
@@ -5458,12 +5544,12 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5458
5544
|
}
|
|
5459
5545
|
}
|
|
5460
5546
|
) : null) : null;
|
|
5461
|
-
const more = collapse ? /* @__PURE__ */
|
|
5547
|
+
const more = collapse ? /* @__PURE__ */ React32.createElement(
|
|
5462
5548
|
Button,
|
|
5463
5549
|
{
|
|
5464
5550
|
ref: moreRef,
|
|
5465
5551
|
variant: "secondary",
|
|
5466
|
-
icon: /* @__PURE__ */
|
|
5552
|
+
icon: /* @__PURE__ */ React32.createElement(IconSlidersHorizontal, null),
|
|
5467
5553
|
className: "aura-filterbar__more",
|
|
5468
5554
|
"aria-haspopup": "dialog",
|
|
5469
5555
|
"aria-expanded": open,
|
|
@@ -5472,9 +5558,9 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5472
5558
|
sheet[1](true);
|
|
5473
5559
|
}
|
|
5474
5560
|
},
|
|
5475
|
-
applied > 0 ? /* @__PURE__ */
|
|
5561
|
+
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
5562
|
) : null;
|
|
5477
|
-
return /* @__PURE__ */
|
|
5563
|
+
return /* @__PURE__ */ React32.createElement(
|
|
5478
5564
|
"div",
|
|
5479
5565
|
{
|
|
5480
5566
|
ref: rootRef,
|
|
@@ -5490,15 +5576,15 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5490
5576
|
props.className
|
|
5491
5577
|
)
|
|
5492
5578
|
},
|
|
5493
|
-
/* @__PURE__ */
|
|
5579
|
+
/* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar__row" }, collapse ? (
|
|
5494
5580
|
/* 5.42: the search and the Filters button share a row of their own below the breakpoint (count and actions
|
|
5495
5581
|
* 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__ */
|
|
5582
|
+
/* @__PURE__ */ React32.createElement("div", { className: cx("aura-filterbar__lead", !hasSearch && "is-alone") }, searchBox, more)
|
|
5583
|
+
) : 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),
|
|
5584
|
+
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
5585
|
+
return /* @__PURE__ */ React32.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
5586
|
+
}), props.onClearAll && anything ? /* @__PURE__ */ React32.createElement("button", { type: "button", className: "aura-filterbar__clear", onClick: clearAll }, t.clearFilters) : null) : null,
|
|
5587
|
+
collapse ? /* @__PURE__ */ React32.createElement(
|
|
5502
5588
|
Dialog,
|
|
5503
5589
|
{
|
|
5504
5590
|
open,
|
|
@@ -5510,7 +5596,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5510
5596
|
title: t.filters,
|
|
5511
5597
|
size: "sm",
|
|
5512
5598
|
className: "aura-filterbar__sheet",
|
|
5513
|
-
footer: /* @__PURE__ */
|
|
5599
|
+
footer: /* @__PURE__ */ React32.createElement(React32.Fragment, null, props.onClearAll && filters.length ? /* @__PURE__ */ React32.createElement(
|
|
5514
5600
|
Button,
|
|
5515
5601
|
{
|
|
5516
5602
|
variant: "secondary",
|
|
@@ -5521,7 +5607,7 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5521
5607
|
}
|
|
5522
5608
|
},
|
|
5523
5609
|
t.clearFilters
|
|
5524
|
-
) : null, /* @__PURE__ */
|
|
5610
|
+
) : null, /* @__PURE__ */ React32.createElement(
|
|
5525
5611
|
Button,
|
|
5526
5612
|
{
|
|
5527
5613
|
ref: doneRef,
|
|
@@ -5533,13 +5619,13 @@ var FilterBar = React31.forwardRef(function FilterBar2(props, ref) {
|
|
|
5533
5619
|
t.done
|
|
5534
5620
|
))
|
|
5535
5621
|
},
|
|
5536
|
-
/* @__PURE__ */
|
|
5622
|
+
/* @__PURE__ */ React32.createElement(FilterSheet.Provider, { value: true }, /* @__PURE__ */ React32.createElement("div", { className: "aura-filterbar aura-filterbar--sheet is-touch-always" }, props.children))
|
|
5537
5623
|
) : null
|
|
5538
5624
|
);
|
|
5539
5625
|
});
|
|
5540
5626
|
|
|
5541
5627
|
// src/Command.tsx
|
|
5542
|
-
var
|
|
5628
|
+
var React33 = __toESM(require("react"), 1);
|
|
5543
5629
|
var import_react_dom9 = require("react-dom");
|
|
5544
5630
|
function isMac() {
|
|
5545
5631
|
return typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent);
|
|
@@ -5548,21 +5634,21 @@ function Command(props) {
|
|
|
5548
5634
|
const t = useStrings();
|
|
5549
5635
|
const density = useDensity();
|
|
5550
5636
|
const id = uid(), listId = id + "-list";
|
|
5551
|
-
const box =
|
|
5552
|
-
const input =
|
|
5553
|
-
const qState =
|
|
5637
|
+
const box = React33.useRef(null);
|
|
5638
|
+
const input = React33.useRef(null);
|
|
5639
|
+
const qState = React33.useState(""), act = React33.useState(null);
|
|
5554
5640
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
5555
5641
|
function setQuery(v) {
|
|
5556
5642
|
if (props.query === void 0) qState[1](v);
|
|
5557
5643
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
5558
5644
|
}
|
|
5559
|
-
const openRef =
|
|
5645
|
+
const openRef = React33.useRef(props.open);
|
|
5560
5646
|
openRef.current = props.open;
|
|
5561
5647
|
const close = function() {
|
|
5562
5648
|
props.onOpenChange(false);
|
|
5563
5649
|
};
|
|
5564
5650
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
5565
|
-
|
|
5651
|
+
React33.useEffect(
|
|
5566
5652
|
function() {
|
|
5567
5653
|
if (props.hotkey === false) return;
|
|
5568
5654
|
function onKey2(e) {
|
|
@@ -5578,7 +5664,7 @@ function Command(props) {
|
|
|
5578
5664
|
},
|
|
5579
5665
|
[props.hotkey, props.onOpenChange]
|
|
5580
5666
|
);
|
|
5581
|
-
|
|
5667
|
+
React33.useEffect(
|
|
5582
5668
|
function() {
|
|
5583
5669
|
if (!props.open) {
|
|
5584
5670
|
if (query) setQuery("");
|
|
@@ -5618,7 +5704,7 @@ function Command(props) {
|
|
|
5618
5704
|
const optId = function(i2) {
|
|
5619
5705
|
return id + "-o" + i2;
|
|
5620
5706
|
};
|
|
5621
|
-
|
|
5707
|
+
React33.useEffect(
|
|
5622
5708
|
function() {
|
|
5623
5709
|
if (!box.current || active < 0) return;
|
|
5624
5710
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -5663,7 +5749,7 @@ function Command(props) {
|
|
|
5663
5749
|
if (!modal.ready) return null;
|
|
5664
5750
|
let i = -1;
|
|
5665
5751
|
return (0, import_react_dom9.createPortal)(
|
|
5666
|
-
/* @__PURE__ */
|
|
5752
|
+
/* @__PURE__ */ React33.createElement(
|
|
5667
5753
|
"div",
|
|
5668
5754
|
{
|
|
5669
5755
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -5673,8 +5759,8 @@ function Command(props) {
|
|
|
5673
5759
|
e.stopPropagation();
|
|
5674
5760
|
}
|
|
5675
5761
|
},
|
|
5676
|
-
/* @__PURE__ */
|
|
5677
|
-
/* @__PURE__ */
|
|
5762
|
+
/* @__PURE__ */ React33.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
5763
|
+
/* @__PURE__ */ React33.createElement(
|
|
5678
5764
|
"div",
|
|
5679
5765
|
{
|
|
5680
5766
|
ref: box,
|
|
@@ -5684,7 +5770,7 @@ function Command(props) {
|
|
|
5684
5770
|
tabIndex: -1,
|
|
5685
5771
|
className: cx("aura-command", props.className)
|
|
5686
5772
|
},
|
|
5687
|
-
/* @__PURE__ */
|
|
5773
|
+
/* @__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
5774
|
"input",
|
|
5689
5775
|
{
|
|
5690
5776
|
ref: input,
|
|
@@ -5707,8 +5793,8 @@ function Command(props) {
|
|
|
5707
5793
|
},
|
|
5708
5794
|
onKeyDown: onKey
|
|
5709
5795
|
}
|
|
5710
|
-
), /* @__PURE__ */
|
|
5711
|
-
/* @__PURE__ */
|
|
5796
|
+
), /* @__PURE__ */ React33.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
5797
|
+
/* @__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
5798
|
"div",
|
|
5713
5799
|
{
|
|
5714
5800
|
id: listId,
|
|
@@ -5718,7 +5804,7 @@ function Command(props) {
|
|
|
5718
5804
|
},
|
|
5719
5805
|
groups.map(function(g, gi) {
|
|
5720
5806
|
const gid = id + "-g" + gi;
|
|
5721
|
-
return /* @__PURE__ */
|
|
5807
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5722
5808
|
"div",
|
|
5723
5809
|
{
|
|
5724
5810
|
key: g.name || gi,
|
|
@@ -5726,11 +5812,11 @@ function Command(props) {
|
|
|
5726
5812
|
"aria-labelledby": g.name ? gid : void 0,
|
|
5727
5813
|
className: "aura-command__group"
|
|
5728
5814
|
},
|
|
5729
|
-
g.name ? /* @__PURE__ */
|
|
5815
|
+
g.name ? /* @__PURE__ */ React33.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
5730
5816
|
g.items.map(function(it) {
|
|
5731
5817
|
i++;
|
|
5732
5818
|
const n3 = i;
|
|
5733
|
-
return /* @__PURE__ */
|
|
5819
|
+
return /* @__PURE__ */ React33.createElement(
|
|
5734
5820
|
"div",
|
|
5735
5821
|
{
|
|
5736
5822
|
key: it.id,
|
|
@@ -5754,16 +5840,16 @@ function Command(props) {
|
|
|
5754
5840
|
run(it);
|
|
5755
5841
|
}
|
|
5756
5842
|
},
|
|
5757
|
-
it.icon ? /* @__PURE__ */
|
|
5758
|
-
/* @__PURE__ */
|
|
5759
|
-
it.shortcut ? /* @__PURE__ */
|
|
5843
|
+
it.icon ? /* @__PURE__ */ React33.createElement(Icon, { name: it.icon }) : null,
|
|
5844
|
+
/* @__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),
|
|
5845
|
+
it.shortcut ? /* @__PURE__ */ React33.createElement("kbd", { className: "aura-command__kbd", id: it.description ? optId(n3) + "-kbd" : void 0 }, it.shortcut) : null
|
|
5760
5846
|
);
|
|
5761
5847
|
})
|
|
5762
5848
|
);
|
|
5763
5849
|
})
|
|
5764
5850
|
)),
|
|
5765
|
-
/* @__PURE__ */
|
|
5766
|
-
/* @__PURE__ */
|
|
5851
|
+
/* @__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) : ""),
|
|
5852
|
+
/* @__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
5853
|
)
|
|
5768
5854
|
),
|
|
5769
5855
|
document.body
|
|
@@ -5771,7 +5857,7 @@ function Command(props) {
|
|
|
5771
5857
|
}
|
|
5772
5858
|
|
|
5773
5859
|
// src/DataTable.tsx
|
|
5774
|
-
var
|
|
5860
|
+
var React34 = __toESM(require("react"), 1);
|
|
5775
5861
|
var import_react_dom10 = require("react-dom");
|
|
5776
5862
|
function ownRowAttrs(p) {
|
|
5777
5863
|
if (!p) return null;
|
|
@@ -5807,7 +5893,7 @@ function hidePx(c) {
|
|
|
5807
5893
|
var ROW_H_DEFAULT = 48;
|
|
5808
5894
|
var OVERSCAN = 8;
|
|
5809
5895
|
var FLEX_MIN = 160;
|
|
5810
|
-
var DataTableImpl =
|
|
5896
|
+
var DataTableImpl = React34.forwardRef(function DataTable(props, ref) {
|
|
5811
5897
|
const t = useStrings();
|
|
5812
5898
|
const columns = props.columns || DEFAULT_COLUMNS;
|
|
5813
5899
|
const byKey = {};
|
|
@@ -5834,7 +5920,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5834
5920
|
);
|
|
5835
5921
|
const sort = sortState[0], setSort = sortState[1];
|
|
5836
5922
|
const selState = useMaybeControlled(props.selected, props.defaultSelected || [], null);
|
|
5837
|
-
const onSel =
|
|
5923
|
+
const onSel = React34.useRef(props.onSelectionChange);
|
|
5838
5924
|
onSel.current = props.onSelectionChange;
|
|
5839
5925
|
const canSelect = function(r2) {
|
|
5840
5926
|
return !!r2 && (!props.isRowSelectable || !!props.isRowSelectable(r2));
|
|
@@ -5854,7 +5940,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5854
5940
|
const droppedSig = selState[0].length === selected.length ? "" : "#" + selState[0].filter(function(k) {
|
|
5855
5941
|
return rejected[String(k)];
|
|
5856
5942
|
}).join("\0") + "#" + selected.join("\0");
|
|
5857
|
-
|
|
5943
|
+
React34.useEffect(
|
|
5858
5944
|
function() {
|
|
5859
5945
|
if (droppedSig !== "") setSelected(selected);
|
|
5860
5946
|
},
|
|
@@ -5891,19 +5977,19 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5891
5977
|
}),
|
|
5892
5978
|
props.onPinnedColumnsChange
|
|
5893
5979
|
);
|
|
5894
|
-
const widthState =
|
|
5980
|
+
const widthState = React34.useState({});
|
|
5895
5981
|
const widths = widthState[0], setWidths = widthState[1];
|
|
5896
|
-
const activeState =
|
|
5897
|
-
const scrollState =
|
|
5982
|
+
const activeState = React34.useState({ r: 1, c: 0 });
|
|
5983
|
+
const scrollState = React34.useState(0);
|
|
5898
5984
|
const scrollTop = scrollState[0], setScrollTop = scrollState[1];
|
|
5899
|
-
const scrolledX =
|
|
5900
|
-
const menuState =
|
|
5985
|
+
const scrolledX = React34.useState(false);
|
|
5986
|
+
const menuState = React34.useState(null);
|
|
5901
5987
|
const menu = menuState[0], setMenu = menuState[1];
|
|
5902
|
-
const dragState =
|
|
5988
|
+
const dragState = React34.useState(null);
|
|
5903
5989
|
const drag = dragState[0], setDrag = dragState[1];
|
|
5904
|
-
const gridRef =
|
|
5905
|
-
const wrapRef =
|
|
5906
|
-
const boxWidth =
|
|
5990
|
+
const gridRef = React34.useRef(null);
|
|
5991
|
+
const wrapRef = React34.useRef(null), wrapMerged = useMergedRef(ref, wrapRef);
|
|
5992
|
+
const boxWidth = React34.useState(null);
|
|
5907
5993
|
const measure = !!props.stackBelow || columns.some(function(c) {
|
|
5908
5994
|
return c.hideBelow != null;
|
|
5909
5995
|
});
|
|
@@ -5913,7 +5999,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5913
5999
|
return px != null && a.indexOf(px) === i;
|
|
5914
6000
|
}).length
|
|
5915
6001
|
);
|
|
5916
|
-
|
|
6002
|
+
React34.useEffect(
|
|
5917
6003
|
function() {
|
|
5918
6004
|
if (!measure || !wrapRef.current || typeof ResizeObserver === "undefined") return;
|
|
5919
6005
|
const ro = new ResizeObserver(function(en) {
|
|
@@ -5959,8 +6045,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5959
6045
|
const px = hidePx(c);
|
|
5960
6046
|
return px != null && below(boxWidth[0], px);
|
|
5961
6047
|
}
|
|
5962
|
-
const scrollRef =
|
|
5963
|
-
const edgeState =
|
|
6048
|
+
const scrollRef = React34.useRef(null);
|
|
6049
|
+
const edgeState = React34.useState("");
|
|
5964
6050
|
const checkMoreX = function() {
|
|
5965
6051
|
const el = scrollRef.current;
|
|
5966
6052
|
if (!el) return;
|
|
@@ -5968,9 +6054,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5968
6054
|
const next = more ? [el.offsetTop, el.clientHeight, el.offsetWidth - el.clientWidth].join(" ") : "";
|
|
5969
6055
|
if (next !== edgeState[0]) edgeState[1](next);
|
|
5970
6056
|
};
|
|
5971
|
-
const checkRef =
|
|
6057
|
+
const checkRef = React34.useRef(checkMoreX);
|
|
5972
6058
|
checkRef.current = checkMoreX;
|
|
5973
|
-
|
|
6059
|
+
React34.useEffect(function() {
|
|
5974
6060
|
const el = scrollRef.current;
|
|
5975
6061
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
5976
6062
|
const ro = new ResizeObserver(function() {
|
|
@@ -5982,7 +6068,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5982
6068
|
ro.disconnect();
|
|
5983
6069
|
};
|
|
5984
6070
|
}, []);
|
|
5985
|
-
const tipState =
|
|
6071
|
+
const tipState = React34.useState(null), tip2 = tipState[0], setTip = tipState[1];
|
|
5986
6072
|
function showFull(e) {
|
|
5987
6073
|
const el = e.target.closest ? e.target.closest(".aura-table__td") : null;
|
|
5988
6074
|
if (!el || el.scrollWidth <= el.clientWidth + 1 || el.querySelector("button, input, .aura-pill"))
|
|
@@ -5994,7 +6080,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
5994
6080
|
setTip(null);
|
|
5995
6081
|
}
|
|
5996
6082
|
const tipEl = tip2 && typeof document !== "undefined" ? (0, import_react_dom10.createPortal)(
|
|
5997
|
-
/* @__PURE__ */
|
|
6083
|
+
/* @__PURE__ */ React34.createElement(
|
|
5998
6084
|
"div",
|
|
5999
6085
|
{
|
|
6000
6086
|
className: "aura-tooltip aura-tooltip--above",
|
|
@@ -6005,7 +6091,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6005
6091
|
),
|
|
6006
6092
|
document.body
|
|
6007
6093
|
) : null;
|
|
6008
|
-
const rowH =
|
|
6094
|
+
const rowH = React34.useState(ROW_H_DEFAULT);
|
|
6009
6095
|
const ROW_H = rowH[0];
|
|
6010
6096
|
useIsoLayoutEffect(function() {
|
|
6011
6097
|
const el = wrapRef.current;
|
|
@@ -6013,8 +6099,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6013
6099
|
const v = parseFloat(getComputedStyle(el).getPropertyValue("--aura-table-row-height"));
|
|
6014
6100
|
if (v > 0 && v !== rowH[0]) rowH[1](v);
|
|
6015
6101
|
});
|
|
6016
|
-
const pending =
|
|
6017
|
-
const resizing =
|
|
6102
|
+
const pending = React34.useRef(null);
|
|
6103
|
+
const resizing = React34.useRef(false);
|
|
6018
6104
|
useIsoLayoutEffect(function() {
|
|
6019
6105
|
if (!gridRef.current || tabMode) return;
|
|
6020
6106
|
const els = gridRef.current.querySelectorAll(
|
|
@@ -6137,7 +6223,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6137
6223
|
return s;
|
|
6138
6224
|
}
|
|
6139
6225
|
const sortCol = sort && sort.key ? byKey[sort.key] : void 0;
|
|
6140
|
-
const view =
|
|
6226
|
+
const view = React34.useMemo(
|
|
6141
6227
|
function() {
|
|
6142
6228
|
if (manual || !sort || !sort.key || !byKey[sort.key]) return rows;
|
|
6143
6229
|
const col = byKey[sort.key];
|
|
@@ -6179,8 +6265,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6179
6265
|
const pageRows = pageSize && !manual ? view.slice(first, first + pageSize) : view;
|
|
6180
6266
|
const canSortAny = !busy && (manual ? total > 1 : rows.length > 1);
|
|
6181
6267
|
const shownTotal = manual && props.totalRows == null ? first + rows.length : total;
|
|
6182
|
-
const prevCount =
|
|
6183
|
-
|
|
6268
|
+
const prevCount = React34.useRef(pageCount);
|
|
6269
|
+
React34.useEffect(
|
|
6184
6270
|
function() {
|
|
6185
6271
|
if (busy) return;
|
|
6186
6272
|
const before = prevCount.current;
|
|
@@ -6194,9 +6280,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6194
6280
|
[pageState[0], page, busy, pageCount]
|
|
6195
6281
|
);
|
|
6196
6282
|
const linkPaging = !!props.getPageHref && !props.onPageChange && !oneCallback;
|
|
6197
|
-
const prevLink =
|
|
6198
|
-
const jumpState =
|
|
6199
|
-
|
|
6283
|
+
const prevLink = React34.useRef(null), nextLink = React34.useRef(null), jumpLink = React34.useRef(null);
|
|
6284
|
+
const jumpState = React34.useState(null);
|
|
6285
|
+
React34.useEffect(
|
|
6200
6286
|
function() {
|
|
6201
6287
|
if (jumpState[0] == null) return;
|
|
6202
6288
|
if (jumpLink.current) jumpLink.current.click();
|
|
@@ -6247,7 +6333,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6247
6333
|
);
|
|
6248
6334
|
}
|
|
6249
6335
|
function rowLinkWrap(r2, content) {
|
|
6250
|
-
return rowHref ? /* @__PURE__ */
|
|
6336
|
+
return rowHref ? /* @__PURE__ */ React34.createElement(Link, { href: rowHref(r2), className: "aura-table__row-link" }, content) : content;
|
|
6251
6337
|
}
|
|
6252
6338
|
const height = props.height || 0;
|
|
6253
6339
|
const autoRows = props.rowHeight === "auto" && !height;
|
|
@@ -6291,8 +6377,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6291
6377
|
const acShown = nearestShown(ac, 1, function(cc) {
|
|
6292
6378
|
return !cardHidden[cc];
|
|
6293
6379
|
});
|
|
6294
|
-
const lastFocus =
|
|
6295
|
-
|
|
6380
|
+
const lastFocus = React34.useRef(null);
|
|
6381
|
+
React34.useEffect(
|
|
6296
6382
|
function() {
|
|
6297
6383
|
const was = lastFocus.current, g = gridRef.current;
|
|
6298
6384
|
if (!stacked || !was || !g || !g.contains(was) || was.getClientRects().length > 0) return;
|
|
@@ -6307,7 +6393,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6307
6393
|
if (!activeRendered) return r2 === 0 && c === ac ? 0 : -1;
|
|
6308
6394
|
return r2 === ar && c === acShown ? 0 : -1;
|
|
6309
6395
|
}
|
|
6310
|
-
|
|
6396
|
+
React34.useEffect(function() {
|
|
6311
6397
|
const p = pending.current;
|
|
6312
6398
|
if (!p || !gridRef.current) return;
|
|
6313
6399
|
let c = p.c;
|
|
@@ -6370,8 +6456,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6370
6456
|
return selSet[String(k)];
|
|
6371
6457
|
}).length;
|
|
6372
6458
|
const all = nSel > 0 && nSel === pageKeys.length;
|
|
6373
|
-
const anchor =
|
|
6374
|
-
const shiftClick =
|
|
6459
|
+
const anchor = React34.useRef(null);
|
|
6460
|
+
const shiftClick = React34.useRef(false);
|
|
6375
6461
|
function toggle(k, on, how) {
|
|
6376
6462
|
const same2 = function(x) {
|
|
6377
6463
|
return String(x) === String(k);
|
|
@@ -6527,14 +6613,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6527
6613
|
items2.push(
|
|
6528
6614
|
{
|
|
6529
6615
|
label: t.sortAsc,
|
|
6530
|
-
icon: /* @__PURE__ */
|
|
6616
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowUp, null),
|
|
6531
6617
|
onSelect: function() {
|
|
6532
6618
|
applySort({ key: c.key, dir: "asc" });
|
|
6533
6619
|
}
|
|
6534
6620
|
},
|
|
6535
6621
|
{
|
|
6536
6622
|
label: t.sortDesc,
|
|
6537
|
-
icon: /* @__PURE__ */
|
|
6623
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowDown, null),
|
|
6538
6624
|
onSelect: function() {
|
|
6539
6625
|
applySort({ key: c.key, dir: "desc" });
|
|
6540
6626
|
}
|
|
@@ -6544,7 +6630,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6544
6630
|
if (c.width != null)
|
|
6545
6631
|
items2.push({
|
|
6546
6632
|
label: isPinned(c) ? t.unpin : t.pin,
|
|
6547
|
-
icon: isPinned(c) ? /* @__PURE__ */
|
|
6633
|
+
icon: isPinned(c) ? /* @__PURE__ */ React34.createElement(IconPinOff, null) : /* @__PURE__ */ React34.createElement(IconPin, null),
|
|
6548
6634
|
onSelect: function() {
|
|
6549
6635
|
togglePin(c.key);
|
|
6550
6636
|
}
|
|
@@ -6553,7 +6639,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6553
6639
|
items2.push(
|
|
6554
6640
|
{
|
|
6555
6641
|
label: t.moveLeft,
|
|
6556
|
-
icon: /* @__PURE__ */
|
|
6642
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowLeft, null),
|
|
6557
6643
|
disabled: gi <= 0,
|
|
6558
6644
|
onSelect: function() {
|
|
6559
6645
|
moveCol(c.key, -1);
|
|
@@ -6561,7 +6647,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6561
6647
|
},
|
|
6562
6648
|
{
|
|
6563
6649
|
label: t.moveRight,
|
|
6564
|
-
icon: /* @__PURE__ */
|
|
6650
|
+
icon: /* @__PURE__ */ React34.createElement(IconArrowRight, null),
|
|
6565
6651
|
disabled: gi >= group.length - 1,
|
|
6566
6652
|
onSelect: function() {
|
|
6567
6653
|
moveCol(c.key, 1);
|
|
@@ -6572,7 +6658,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6572
6658
|
{ separator: true },
|
|
6573
6659
|
{
|
|
6574
6660
|
label: t.hideColumn,
|
|
6575
|
-
icon: /* @__PURE__ */
|
|
6661
|
+
icon: /* @__PURE__ */ React34.createElement(IconEyeOff, null),
|
|
6576
6662
|
disabled: shown.length <= 1,
|
|
6577
6663
|
onSelect: function() {
|
|
6578
6664
|
setHidden(c.key, true);
|
|
@@ -6593,7 +6679,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6593
6679
|
setHidden(k, on);
|
|
6594
6680
|
}
|
|
6595
6681
|
};
|
|
6596
|
-
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */
|
|
6682
|
+
}).concat([{ separator: true }, { label: t.resetColumns, icon: /* @__PURE__ */ React34.createElement(IconRotateCcw, null), onSelect: resetColumns }]);
|
|
6597
6683
|
}
|
|
6598
6684
|
function openMenu(kind, key, anchor2, rc) {
|
|
6599
6685
|
setMenu({ kind, key, anchor: anchor2, rc });
|
|
@@ -6670,10 +6756,10 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6670
6756
|
e.stopPropagation();
|
|
6671
6757
|
}
|
|
6672
6758
|
}
|
|
6673
|
-
const head = [/* @__PURE__ */
|
|
6759
|
+
const head = [/* @__PURE__ */ React34.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
6674
6760
|
if (selectable)
|
|
6675
6761
|
head.push(
|
|
6676
|
-
/* @__PURE__ */
|
|
6762
|
+
/* @__PURE__ */ React34.createElement(
|
|
6677
6763
|
"span",
|
|
6678
6764
|
{
|
|
6679
6765
|
key: "__sel",
|
|
@@ -6687,7 +6773,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6687
6773
|
activeState[1]({ r: 0, c: 0 });
|
|
6688
6774
|
}
|
|
6689
6775
|
},
|
|
6690
|
-
pageKeys.length ? /* @__PURE__ */
|
|
6776
|
+
pageKeys.length ? /* @__PURE__ */ React34.createElement(
|
|
6691
6777
|
Checkbox,
|
|
6692
6778
|
{
|
|
6693
6779
|
ref: props.selectAllRef,
|
|
@@ -6699,7 +6785,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6699
6785
|
onChange: toggleAll
|
|
6700
6786
|
}
|
|
6701
6787
|
) : null,
|
|
6702
|
-
pageKeys.length ? /* @__PURE__ */
|
|
6788
|
+
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
6789
|
)
|
|
6704
6790
|
);
|
|
6705
6791
|
vis.forEach(function(c, i) {
|
|
@@ -6710,7 +6796,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6710
6796
|
const ariaSort = sort && canSortAny ? isSorted && canSort ? sort.dir === "desc" ? "descending" : "ascending" : canSort ? "none" : void 0 : own || (canSort ? "none" : void 0);
|
|
6711
6797
|
const pin = isPinned(c), edge = pin && i === nPinned - 1;
|
|
6712
6798
|
head.push(
|
|
6713
|
-
/* @__PURE__ */
|
|
6799
|
+
/* @__PURE__ */ React34.createElement(
|
|
6714
6800
|
"span",
|
|
6715
6801
|
{
|
|
6716
6802
|
key: c.key,
|
|
@@ -6761,7 +6847,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6761
6847
|
setDrag(null);
|
|
6762
6848
|
}
|
|
6763
6849
|
},
|
|
6764
|
-
/* @__PURE__ */
|
|
6850
|
+
/* @__PURE__ */ React34.createElement("span", { className: "aura-table__th-inner" }, canSort ? /* @__PURE__ */ React34.createElement(
|
|
6765
6851
|
"button",
|
|
6766
6852
|
{
|
|
6767
6853
|
type: "button",
|
|
@@ -6773,14 +6859,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6773
6859
|
}
|
|
6774
6860
|
},
|
|
6775
6861
|
c.label,
|
|
6776
|
-
/* @__PURE__ */
|
|
6862
|
+
/* @__PURE__ */ React34.createElement(
|
|
6777
6863
|
Icon,
|
|
6778
6864
|
{
|
|
6779
|
-
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */
|
|
6865
|
+
name: isSorted ? sort.dir === "desc" ? /* @__PURE__ */ React34.createElement(IconArrowDown, null) : /* @__PURE__ */ React34.createElement(IconArrowUp, null) : /* @__PURE__ */ React34.createElement(IconArrowUpDown, null),
|
|
6780
6866
|
size: 12
|
|
6781
6867
|
}
|
|
6782
6868
|
)
|
|
6783
|
-
) : /* @__PURE__ */
|
|
6869
|
+
) : /* @__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
6870
|
"button",
|
|
6785
6871
|
{
|
|
6786
6872
|
type: "button",
|
|
@@ -6794,9 +6880,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6794
6880
|
openMenu("col", c.key, e.currentTarget, { r: 0, c: ci });
|
|
6795
6881
|
}
|
|
6796
6882
|
},
|
|
6797
|
-
/* @__PURE__ */
|
|
6883
|
+
/* @__PURE__ */ React34.createElement(Icon, { name: /* @__PURE__ */ React34.createElement(IconEllipsis, null) })
|
|
6798
6884
|
) : null),
|
|
6799
|
-
canResize(c) ? /* @__PURE__ */
|
|
6885
|
+
canResize(c) ? /* @__PURE__ */ React34.createElement(
|
|
6800
6886
|
"span",
|
|
6801
6887
|
{
|
|
6802
6888
|
className: "aura-table__resize",
|
|
@@ -6818,7 +6904,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6818
6904
|
);
|
|
6819
6905
|
});
|
|
6820
6906
|
head.push(
|
|
6821
|
-
/* @__PURE__ */
|
|
6907
|
+
/* @__PURE__ */ React34.createElement(
|
|
6822
6908
|
"span",
|
|
6823
6909
|
{
|
|
6824
6910
|
key: "__gr",
|
|
@@ -6829,15 +6915,15 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6829
6915
|
);
|
|
6830
6916
|
function cellContent(c, r2) {
|
|
6831
6917
|
const v = r2[c.key];
|
|
6832
|
-
return c.render ? c.render(r2) : c.pill ? /* @__PURE__ */
|
|
6918
|
+
return c.render ? c.render(r2) : c.pill ? /* @__PURE__ */ React34.createElement(StatusPill, { ...{ tone: c.tones && c.tones[v] } }, v) : v;
|
|
6833
6919
|
}
|
|
6834
6920
|
function rowCells(r2, i, k, isSel) {
|
|
6835
6921
|
const ri = i + 1;
|
|
6836
6922
|
const selLabel = selectable && canSelect(r2) ? props.rowSelectLabel && props.rowSelectLabel(r2) || t.selectRow(k) : void 0;
|
|
6837
|
-
const cells = [/* @__PURE__ */
|
|
6923
|
+
const cells = [/* @__PURE__ */ React34.createElement("span", { key: "__gl", className: "aura-table__gutter", "aria-hidden": true })];
|
|
6838
6924
|
if (selectable)
|
|
6839
6925
|
cells.push(
|
|
6840
|
-
/* @__PURE__ */
|
|
6926
|
+
/* @__PURE__ */ React34.createElement(
|
|
6841
6927
|
"span",
|
|
6842
6928
|
{
|
|
6843
6929
|
key: "__sel",
|
|
@@ -6854,7 +6940,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6854
6940
|
shiftClick.current = e.shiftKey;
|
|
6855
6941
|
}
|
|
6856
6942
|
},
|
|
6857
|
-
canSelect(r2) ? /* @__PURE__ */
|
|
6943
|
+
canSelect(r2) ? /* @__PURE__ */ React34.createElement(
|
|
6858
6944
|
Checkbox,
|
|
6859
6945
|
{
|
|
6860
6946
|
hideLabel: true,
|
|
@@ -6873,7 +6959,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6873
6959
|
vis.forEach(function(c, j) {
|
|
6874
6960
|
const ci = j + (selectable ? 1 : 0), v = r2[c.key], pin = isPinned(c);
|
|
6875
6961
|
cells.push(
|
|
6876
|
-
/* @__PURE__ */
|
|
6962
|
+
/* @__PURE__ */ React34.createElement(
|
|
6877
6963
|
"span",
|
|
6878
6964
|
{
|
|
6879
6965
|
key: c.key,
|
|
@@ -6895,13 +6981,13 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6895
6981
|
if (activeState[0].r !== ri || activeState[0].c !== ci) activeState[1]({ r: ri, c: ci });
|
|
6896
6982
|
}
|
|
6897
6983
|
},
|
|
6898
|
-
autoRows ? /* @__PURE__ */
|
|
6984
|
+
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
6985
|
)
|
|
6900
6986
|
);
|
|
6901
6987
|
});
|
|
6902
|
-
if (hasFields) cells.push(/* @__PURE__ */
|
|
6988
|
+
if (hasFields) cells.push(/* @__PURE__ */ React34.createElement("span", { key: "__br", className: "aura-table__break", "aria-hidden": true }));
|
|
6903
6989
|
cells.push(
|
|
6904
|
-
/* @__PURE__ */
|
|
6990
|
+
/* @__PURE__ */ React34.createElement(
|
|
6905
6991
|
"span",
|
|
6906
6992
|
{
|
|
6907
6993
|
key: "__gr",
|
|
@@ -6918,17 +7004,17 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6918
7004
|
const n3 = pageSize || props.skeletonRows || 5;
|
|
6919
7005
|
const skRows = body = [];
|
|
6920
7006
|
for (let i = 0; i < n3; i++) {
|
|
6921
|
-
const sk = [/* @__PURE__ */
|
|
7007
|
+
const sk = [/* @__PURE__ */ React34.createElement("span", { key: "__gl", className: "aura-table__gutter" })];
|
|
6922
7008
|
if (selectable)
|
|
6923
7009
|
sk.push(
|
|
6924
|
-
/* @__PURE__ */
|
|
7010
|
+
/* @__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
7011
|
);
|
|
6926
7012
|
vis.forEach(function(c, j) {
|
|
6927
7013
|
const part = cardPart(c, j);
|
|
6928
7014
|
const action = part === "footer" || part === "actions";
|
|
6929
7015
|
const lines = c.pill ? 1 : Math.max(1, Math.min(10, Math.floor(Number(c.skeletonLines)) || 1));
|
|
6930
7016
|
const bar = function(n4) {
|
|
6931
|
-
return /* @__PURE__ */
|
|
7017
|
+
return /* @__PURE__ */ React34.createElement(
|
|
6932
7018
|
"span",
|
|
6933
7019
|
{
|
|
6934
7020
|
key: n4,
|
|
@@ -6940,7 +7026,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6940
7026
|
const bars2 = [];
|
|
6941
7027
|
for (let b = 0; b < lines; b++) bars2.push(bar(b));
|
|
6942
7028
|
sk.push(
|
|
6943
|
-
/* @__PURE__ */
|
|
7029
|
+
/* @__PURE__ */ React34.createElement(
|
|
6944
7030
|
"span",
|
|
6945
7031
|
{
|
|
6946
7032
|
key: c.key,
|
|
@@ -6953,7 +7039,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6953
7039
|
style: cellStyle(c, j),
|
|
6954
7040
|
...cardAttrs(c, j)
|
|
6955
7041
|
},
|
|
6956
|
-
action ? /* @__PURE__ */
|
|
7042
|
+
action ? /* @__PURE__ */ React34.createElement(
|
|
6957
7043
|
"span",
|
|
6958
7044
|
{
|
|
6959
7045
|
className: cx(
|
|
@@ -6962,16 +7048,16 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6962
7048
|
c.skeletonTouch && "is-touch"
|
|
6963
7049
|
)
|
|
6964
7050
|
}
|
|
6965
|
-
) : lines > 1 ? /* @__PURE__ */
|
|
7051
|
+
) : lines > 1 ? /* @__PURE__ */ React34.createElement("span", { className: "aura-skel-lines" }, bars2) : bars2[0]
|
|
6966
7052
|
)
|
|
6967
7053
|
);
|
|
6968
7054
|
});
|
|
6969
|
-
if (hasFields) sk.push(/* @__PURE__ */
|
|
7055
|
+
if (hasFields) sk.push(/* @__PURE__ */ React34.createElement("span", { key: "__br", className: "aura-table__break" }));
|
|
6970
7056
|
sk.push(
|
|
6971
|
-
/* @__PURE__ */
|
|
7057
|
+
/* @__PURE__ */ React34.createElement("span", { key: "__gr", className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker") })
|
|
6972
7058
|
);
|
|
6973
7059
|
skRows.push(
|
|
6974
|
-
/* @__PURE__ */
|
|
7060
|
+
/* @__PURE__ */ React34.createElement(
|
|
6975
7061
|
"div",
|
|
6976
7062
|
{
|
|
6977
7063
|
key: "sk" + i,
|
|
@@ -6985,18 +7071,18 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
6985
7071
|
}
|
|
6986
7072
|
} else if (!rows.length) {
|
|
6987
7073
|
const em = props.empty || {};
|
|
6988
|
-
body = /* @__PURE__ */
|
|
7074
|
+
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
7075
|
} else {
|
|
6990
7076
|
const bodyRows = body = [];
|
|
6991
7077
|
if (virtual && start > 0)
|
|
6992
7078
|
bodyRows.push(
|
|
6993
|
-
/* @__PURE__ */
|
|
7079
|
+
/* @__PURE__ */ React34.createElement("div", { key: "__top", className: "aura-table__spacer", style: { height: start * ROW_H + "px" }, "aria-hidden": true })
|
|
6994
7080
|
);
|
|
6995
7081
|
for (let ri = start; ri < end; ri++) {
|
|
6996
7082
|
(function(r2, i) {
|
|
6997
7083
|
const k = r2[rowKey], isSel = !!selSet[k];
|
|
6998
7084
|
bodyRows.push(
|
|
6999
|
-
/* @__PURE__ */
|
|
7085
|
+
/* @__PURE__ */ React34.createElement(
|
|
7000
7086
|
"div",
|
|
7001
7087
|
{
|
|
7002
7088
|
key: k,
|
|
@@ -7025,7 +7111,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7025
7111
|
}
|
|
7026
7112
|
if (virtual && end < pageRows.length)
|
|
7027
7113
|
bodyRows.push(
|
|
7028
|
-
/* @__PURE__ */
|
|
7114
|
+
/* @__PURE__ */ React34.createElement(
|
|
7029
7115
|
"div",
|
|
7030
7116
|
{
|
|
7031
7117
|
key: "__bot",
|
|
@@ -7038,9 +7124,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7038
7124
|
}
|
|
7039
7125
|
let foot = null;
|
|
7040
7126
|
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__ */
|
|
7127
|
+
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
7128
|
if (props.getPageHref && !off)
|
|
7043
|
-
return /* @__PURE__ */
|
|
7129
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7044
7130
|
Link,
|
|
7045
7131
|
{
|
|
7046
7132
|
ref: dir < 0 ? prevLink : nextLink,
|
|
@@ -7055,9 +7141,9 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7055
7141
|
}
|
|
7056
7142
|
}
|
|
7057
7143
|
},
|
|
7058
|
-
/* @__PURE__ */
|
|
7144
|
+
/* @__PURE__ */ React34.createElement(Icon, { name: icon })
|
|
7059
7145
|
);
|
|
7060
|
-
return /* @__PURE__ */
|
|
7146
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7061
7147
|
IconButton,
|
|
7062
7148
|
{
|
|
7063
7149
|
icon,
|
|
@@ -7072,11 +7158,11 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7072
7158
|
const openTotal = manual && props.totalRows == null && !!pageSize && rows.length >= pageSize;
|
|
7073
7159
|
if (pageSize && (rows.length || busy || page > 1)) {
|
|
7074
7160
|
const from = rows.length ? first + 1 : 0, to = manual ? first + rows.length : Math.min(first + pageSize, view.length);
|
|
7075
|
-
foot = /* @__PURE__ */
|
|
7161
|
+
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
7162
|
} else if (height && rows.length && !loading) {
|
|
7077
|
-
foot = /* @__PURE__ */
|
|
7163
|
+
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
7164
|
}
|
|
7079
|
-
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */
|
|
7165
|
+
const totalRow = props.footer && rows.length && !loading ? /* @__PURE__ */ React34.createElement(
|
|
7080
7166
|
"div",
|
|
7081
7167
|
{
|
|
7082
7168
|
role: "row",
|
|
@@ -7085,8 +7171,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7085
7171
|
className: cx("aura-table__row aura-table__total", props.stickyFooter && "is-sticky"),
|
|
7086
7172
|
style: rowStyle
|
|
7087
7173
|
},
|
|
7088
|
-
/* @__PURE__ */
|
|
7089
|
-
selectable ? /* @__PURE__ */
|
|
7174
|
+
/* @__PURE__ */ React34.createElement("span", { className: "aura-table__gutter", "aria-hidden": true }),
|
|
7175
|
+
selectable ? /* @__PURE__ */ React34.createElement(
|
|
7090
7176
|
"span",
|
|
7091
7177
|
{
|
|
7092
7178
|
role: "gridcell",
|
|
@@ -7101,7 +7187,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7101
7187
|
) : null,
|
|
7102
7188
|
vis.map(function(c, j) {
|
|
7103
7189
|
const pin = isPinned(c), ci = j + (selectable ? 1 : 0);
|
|
7104
|
-
return /* @__PURE__ */
|
|
7190
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7105
7191
|
"span",
|
|
7106
7192
|
{
|
|
7107
7193
|
key: c.key,
|
|
@@ -7127,8 +7213,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7127
7213
|
props.footer[c.key]
|
|
7128
7214
|
);
|
|
7129
7215
|
}),
|
|
7130
|
-
hasFields ? /* @__PURE__ */
|
|
7131
|
-
/* @__PURE__ */
|
|
7216
|
+
hasFields ? /* @__PURE__ */ React34.createElement("span", { className: "aura-table__break", "aria-hidden": true }) : null,
|
|
7217
|
+
/* @__PURE__ */ React34.createElement(
|
|
7132
7218
|
"span",
|
|
7133
7219
|
{
|
|
7134
7220
|
className: cx("aura-table__gutter aura-table__gutter--end", controls && "has-picker"),
|
|
@@ -7142,7 +7228,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7142
7228
|
scrollPaddingBottom: stickyTotal ? ROW_H + "px" : void 0
|
|
7143
7229
|
};
|
|
7144
7230
|
if (height) scrollStyle["--aura-table-h"] = height + "px";
|
|
7145
|
-
const gridEl = /* @__PURE__ */
|
|
7231
|
+
const gridEl = /* @__PURE__ */ React34.createElement(
|
|
7146
7232
|
"div",
|
|
7147
7233
|
{
|
|
7148
7234
|
ref: levels.length ? wrapRef : wrapMerged,
|
|
@@ -7163,8 +7249,8 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7163
7249
|
),
|
|
7164
7250
|
style: levels.length ? { ["--aura-q-back"]: String(levels[levels.length - 1].px / Q) } : void 0
|
|
7165
7251
|
},
|
|
7166
|
-
refreshing ? /* @__PURE__ */
|
|
7167
|
-
edgeState[0] && !stacked ? /* @__PURE__ */
|
|
7252
|
+
refreshing ? /* @__PURE__ */ React34.createElement("span", { className: "aura-table__busy-bar", "aria-hidden": true }) : null,
|
|
7253
|
+
edgeState[0] && !stacked ? /* @__PURE__ */ React34.createElement(
|
|
7168
7254
|
"span",
|
|
7169
7255
|
{
|
|
7170
7256
|
className: "aura-table__edge",
|
|
@@ -7176,7 +7262,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7176
7262
|
}
|
|
7177
7263
|
}
|
|
7178
7264
|
) : null,
|
|
7179
|
-
/* @__PURE__ */
|
|
7265
|
+
/* @__PURE__ */ React34.createElement(
|
|
7180
7266
|
"div",
|
|
7181
7267
|
{
|
|
7182
7268
|
ref: function(el) {
|
|
@@ -7214,7 +7300,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7214
7300
|
checkMoreX();
|
|
7215
7301
|
}
|
|
7216
7302
|
},
|
|
7217
|
-
/* @__PURE__ */
|
|
7303
|
+
/* @__PURE__ */ React34.createElement(
|
|
7218
7304
|
"div",
|
|
7219
7305
|
{
|
|
7220
7306
|
className: cx("aura-table__head", selectable && nRows > 0 && !busy && "has-select-all"),
|
|
@@ -7227,11 +7313,11 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7227
7313
|
body,
|
|
7228
7314
|
totalRow
|
|
7229
7315
|
),
|
|
7230
|
-
busy ? /* @__PURE__ */
|
|
7231
|
-
controls ? /* @__PURE__ */
|
|
7316
|
+
busy ? /* @__PURE__ */ React34.createElement("span", { className: "aura-sr-only", role: "status" }, t.loadingRows) : null,
|
|
7317
|
+
controls ? /* @__PURE__ */ React34.createElement("div", { className: "aura-table__picker" }, /* @__PURE__ */ React34.createElement(
|
|
7232
7318
|
IconButton,
|
|
7233
7319
|
{
|
|
7234
|
-
icon: /* @__PURE__ */
|
|
7320
|
+
icon: /* @__PURE__ */ React34.createElement(IconColumns3, null),
|
|
7235
7321
|
label: t.showHideColumns,
|
|
7236
7322
|
"aria-haspopup": "menu",
|
|
7237
7323
|
onClick: function(e) {
|
|
@@ -7240,7 +7326,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7240
7326
|
}
|
|
7241
7327
|
)) : null,
|
|
7242
7328
|
foot,
|
|
7243
|
-
menu ? /* @__PURE__ */
|
|
7329
|
+
menu ? /* @__PURE__ */ React34.createElement(
|
|
7244
7330
|
Menu,
|
|
7245
7331
|
{
|
|
7246
7332
|
anchor: menu.anchor,
|
|
@@ -7250,13 +7336,13 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7250
7336
|
}
|
|
7251
7337
|
) : null,
|
|
7252
7338
|
tipEl,
|
|
7253
|
-
jumpState[0] != null && props.getPageHref ? /* @__PURE__ */
|
|
7339
|
+
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
7340
|
);
|
|
7255
7341
|
if (!levels.length) return gridEl;
|
|
7256
7342
|
let out = gridEl;
|
|
7257
7343
|
for (let i = levels.length - 1; i >= 0; i--) {
|
|
7258
7344
|
const prev = i === 0 ? Q : levels[i - 1].px;
|
|
7259
|
-
out = /* @__PURE__ */
|
|
7345
|
+
out = /* @__PURE__ */ React34.createElement(
|
|
7260
7346
|
"div",
|
|
7261
7347
|
{
|
|
7262
7348
|
className: cx("aura-table-q", "aura-table-q--" + levels[i].name),
|
|
@@ -7265,7 +7351,7 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7265
7351
|
out
|
|
7266
7352
|
);
|
|
7267
7353
|
}
|
|
7268
|
-
return /* @__PURE__ */
|
|
7354
|
+
return /* @__PURE__ */ React34.createElement(
|
|
7269
7355
|
"div",
|
|
7270
7356
|
{
|
|
7271
7357
|
ref,
|
|
@@ -7282,14 +7368,14 @@ var DataTableImpl = React33.forwardRef(function DataTable(props, ref) {
|
|
|
7282
7368
|
var DataTable2 = DataTableImpl;
|
|
7283
7369
|
|
|
7284
7370
|
// src/Card.tsx
|
|
7285
|
-
var
|
|
7286
|
-
var Card =
|
|
7371
|
+
var React35 = __toESM(require("react"), 1);
|
|
7372
|
+
var Card = React35.forwardRef(function Card2(props, ref) {
|
|
7287
7373
|
return cardElement(props, ref);
|
|
7288
7374
|
});
|
|
7289
7375
|
|
|
7290
7376
|
// src/Tabs.tsx
|
|
7291
|
-
var
|
|
7292
|
-
var Tabs =
|
|
7377
|
+
var React36 = __toESM(require("react"), 1);
|
|
7378
|
+
var Tabs = React36.forwardRef(function Tabs2(props, ref) {
|
|
7293
7379
|
const items2 = props.tabs || [], base = uid();
|
|
7294
7380
|
const asLinks = items2.length > 0 && items2.every(function(t) {
|
|
7295
7381
|
return !!t.href;
|
|
@@ -7303,7 +7389,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7303
7389
|
props.onChange
|
|
7304
7390
|
);
|
|
7305
7391
|
const cur2 = asLinks && "value" in props ? props.value : st[0];
|
|
7306
|
-
const refs =
|
|
7392
|
+
const refs = React36.useRef({});
|
|
7307
7393
|
const current2 = items2.filter(function(t) {
|
|
7308
7394
|
return t.id === cur2;
|
|
7309
7395
|
})[0] || firstOn || items2[0];
|
|
@@ -7321,7 +7407,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7321
7407
|
return cx("aura-tab", on && "is-active", seg && "aura-segmented__option", seg && on && "is-selected", extra);
|
|
7322
7408
|
};
|
|
7323
7409
|
const rootCls = cx("aura-tabs", seg && "aura-tabs--segmented", touchClass(props.touchHeight));
|
|
7324
|
-
const [focusId, setFocusId] =
|
|
7410
|
+
const [focusId, setFocusId] = React36.useState(null);
|
|
7325
7411
|
items2.forEach(function(t) {
|
|
7326
7412
|
const al = t.tabProps && t.tabProps["aria-label"];
|
|
7327
7413
|
if (al && al.toLowerCase().indexOf(String(t.label).toLowerCase()) !== 0)
|
|
@@ -7331,19 +7417,19 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7331
7417
|
);
|
|
7332
7418
|
});
|
|
7333
7419
|
if (asLinks)
|
|
7334
|
-
return /* @__PURE__ */
|
|
7420
|
+
return /* @__PURE__ */ React36.createElement(
|
|
7335
7421
|
"nav",
|
|
7336
7422
|
{
|
|
7337
7423
|
ref,
|
|
7338
7424
|
"aria-label": props.label,
|
|
7339
7425
|
className: cx(rootCls, "aura-tabs--links", props.className)
|
|
7340
7426
|
},
|
|
7341
|
-
/* @__PURE__ */
|
|
7427
|
+
/* @__PURE__ */ React36.createElement("div", { className: listCls }, items2.map(function(t) {
|
|
7342
7428
|
const on = t.id === cur2;
|
|
7343
7429
|
const inner = [
|
|
7344
|
-
t.icon ? /* @__PURE__ */
|
|
7430
|
+
t.icon ? /* @__PURE__ */ React36.createElement(Icon, { key: "i", name: t.icon }) : null,
|
|
7345
7431
|
t.label,
|
|
7346
|
-
t.count != null ? /* @__PURE__ */
|
|
7432
|
+
t.count != null ? /* @__PURE__ */ React36.createElement("span", { key: "c", className: "aura-tab__count" }, t.count) : null
|
|
7347
7433
|
];
|
|
7348
7434
|
const own = omit(t.tabProps || {}, [
|
|
7349
7435
|
"type",
|
|
@@ -7357,7 +7443,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7357
7443
|
"name",
|
|
7358
7444
|
"value"
|
|
7359
7445
|
]);
|
|
7360
|
-
return t.disabled ? /* @__PURE__ */
|
|
7446
|
+
return t.disabled ? /* @__PURE__ */ React36.createElement(
|
|
7361
7447
|
"span",
|
|
7362
7448
|
{
|
|
7363
7449
|
...omit(own, ["onClick"]),
|
|
@@ -7366,7 +7452,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7366
7452
|
"aria-disabled": true
|
|
7367
7453
|
},
|
|
7368
7454
|
inner
|
|
7369
|
-
) : /* @__PURE__ */
|
|
7455
|
+
) : /* @__PURE__ */ React36.createElement(
|
|
7370
7456
|
Link,
|
|
7371
7457
|
{
|
|
7372
7458
|
...own,
|
|
@@ -7396,7 +7482,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7396
7482
|
const stop2 = manual && focusId && items2.filter(function(t) {
|
|
7397
7483
|
return t.id === focusId && !t.disabled;
|
|
7398
7484
|
})[0] || current2;
|
|
7399
|
-
return /* @__PURE__ */
|
|
7485
|
+
return /* @__PURE__ */ React36.createElement("div", { ref, className: cx(rootCls, props.className) }, /* @__PURE__ */ React36.createElement(
|
|
7400
7486
|
"div",
|
|
7401
7487
|
{
|
|
7402
7488
|
role: "tablist",
|
|
@@ -7429,7 +7515,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7429
7515
|
items2.map(function(t) {
|
|
7430
7516
|
const on = current2 && t.id === current2.id;
|
|
7431
7517
|
const own = t.tabProps || {};
|
|
7432
|
-
return /* @__PURE__ */
|
|
7518
|
+
return /* @__PURE__ */ React36.createElement(
|
|
7433
7519
|
"button",
|
|
7434
7520
|
{
|
|
7435
7521
|
...own,
|
|
@@ -7456,9 +7542,9 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7456
7542
|
st[1](t.id);
|
|
7457
7543
|
}
|
|
7458
7544
|
},
|
|
7459
|
-
t.icon ? /* @__PURE__ */
|
|
7545
|
+
t.icon ? /* @__PURE__ */ React36.createElement(Icon, { name: t.icon }) : null,
|
|
7460
7546
|
t.label,
|
|
7461
|
-
t.count != null ? /* @__PURE__ */
|
|
7547
|
+
t.count != null ? /* @__PURE__ */ React36.createElement("span", { className: "aura-tab__count" }, t.count) : null
|
|
7462
7548
|
);
|
|
7463
7549
|
})
|
|
7464
7550
|
), props.keepMounted ? (
|
|
@@ -7466,7 +7552,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7466
7552
|
items2.map(function(t) {
|
|
7467
7553
|
if (t.content === void 0) return null;
|
|
7468
7554
|
const on = current2 && t.id === current2.id;
|
|
7469
|
-
return /* @__PURE__ */
|
|
7555
|
+
return /* @__PURE__ */ React36.createElement(
|
|
7470
7556
|
"div",
|
|
7471
7557
|
{
|
|
7472
7558
|
key: t.id,
|
|
@@ -7480,7 +7566,7 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7480
7566
|
t.content
|
|
7481
7567
|
);
|
|
7482
7568
|
})
|
|
7483
|
-
) : current2 && current2.content !== void 0 ? /* @__PURE__ */
|
|
7569
|
+
) : current2 && current2.content !== void 0 ? /* @__PURE__ */ React36.createElement(
|
|
7484
7570
|
"div",
|
|
7485
7571
|
{
|
|
7486
7572
|
role: "tabpanel",
|
|
@@ -7494,14 +7580,14 @@ var Tabs = React35.forwardRef(function Tabs2(props, ref) {
|
|
|
7494
7580
|
});
|
|
7495
7581
|
|
|
7496
7582
|
// src/SideNav.tsx
|
|
7497
|
-
var
|
|
7583
|
+
var React37 = __toESM(require("react"), 1);
|
|
7498
7584
|
var import_react_dom11 = require("react-dom");
|
|
7499
7585
|
function contains(it, id) {
|
|
7500
7586
|
return !!id && !!it.children && it.children.some(function(c) {
|
|
7501
7587
|
return c.id === id || contains(c, id);
|
|
7502
7588
|
});
|
|
7503
7589
|
}
|
|
7504
|
-
var SideNav =
|
|
7590
|
+
var SideNav = React37.forwardRef(function SideNav2(props, ref) {
|
|
7505
7591
|
const t = useStrings();
|
|
7506
7592
|
const Link = useLinkComponent(props.linkComponent);
|
|
7507
7593
|
const base = uid();
|
|
@@ -7513,14 +7599,14 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7513
7599
|
const active = st[0];
|
|
7514
7600
|
const col = useMaybeControlled(props.collapsed, !!props.defaultCollapsed, props.onCollapsedChange);
|
|
7515
7601
|
const collapsed = col[0];
|
|
7516
|
-
const tipState =
|
|
7517
|
-
|
|
7602
|
+
const tipState = React37.useState(null), tip2 = tipState[0], setTip = tipState[1];
|
|
7603
|
+
React37.useEffect(
|
|
7518
7604
|
function() {
|
|
7519
7605
|
if (!collapsed) setTip(null);
|
|
7520
7606
|
},
|
|
7521
7607
|
[collapsed]
|
|
7522
7608
|
);
|
|
7523
|
-
|
|
7609
|
+
React37.useEffect(
|
|
7524
7610
|
function() {
|
|
7525
7611
|
if (!tip2) return;
|
|
7526
7612
|
function esc(e) {
|
|
@@ -7545,12 +7631,12 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7545
7631
|
return { onMouseEnter: show3, onFocus: show3, onMouseLeave: hide2, onBlur: hide2 };
|
|
7546
7632
|
}
|
|
7547
7633
|
const sections = props.sections || [{ items: props.items || [] }];
|
|
7548
|
-
const openState =
|
|
7634
|
+
const openState = React37.useState({}), toggled = openState[0], setToggled = openState[1];
|
|
7549
7635
|
function isOpen(it) {
|
|
7550
7636
|
if (toggled[it.id] != null) return toggled[it.id];
|
|
7551
7637
|
return !!it.defaultOpen || contains(it, active);
|
|
7552
7638
|
}
|
|
7553
|
-
|
|
7639
|
+
React37.useEffect(
|
|
7554
7640
|
function() {
|
|
7555
7641
|
if (!active) return;
|
|
7556
7642
|
const next = {};
|
|
@@ -7572,7 +7658,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7572
7658
|
},
|
|
7573
7659
|
[active]
|
|
7574
7660
|
);
|
|
7575
|
-
const navRef =
|
|
7661
|
+
const navRef = React37.useRef(null);
|
|
7576
7662
|
function onKeyDown(e) {
|
|
7577
7663
|
const k = e.key;
|
|
7578
7664
|
if (k !== "ArrowDown" && k !== "ArrowUp" && k !== "Home" && k !== "End") return;
|
|
@@ -7591,12 +7677,12 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7591
7677
|
function inner(it, group, open) {
|
|
7592
7678
|
const marked = it.count != null && it.count > 0 || it.badge != null;
|
|
7593
7679
|
return [
|
|
7594
|
-
it.icon ? /* @__PURE__ */
|
|
7595
|
-
collapsed && marked ? /* @__PURE__ */
|
|
7596
|
-
/* @__PURE__ */
|
|
7597
|
-
it.badge != null ? /* @__PURE__ */
|
|
7598
|
-
it.count != null ? /* @__PURE__ */
|
|
7599
|
-
group ? /* @__PURE__ */
|
|
7680
|
+
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,
|
|
7681
|
+
collapsed && marked ? /* @__PURE__ */ React37.createElement("span", { key: "d", className: "aura-nav__dot", "aria-hidden": "true" }) : null,
|
|
7682
|
+
/* @__PURE__ */ React37.createElement("span", { key: "l", className: "aura-nav__label" }, it.label),
|
|
7683
|
+
it.badge != null ? /* @__PURE__ */ React37.createElement("span", { key: "b", className: "aura-nav__badge" }, it.badge) : null,
|
|
7684
|
+
it.count != null ? /* @__PURE__ */ React37.createElement("span", { key: "c", className: "aura-nav__count" }, it.count) : null,
|
|
7685
|
+
group ? /* @__PURE__ */ React37.createElement(Icon, { key: "g", name: /* @__PURE__ */ React37.createElement(IconChevronDown, null), className: cx("aura-nav__chevron", open && "is-open") }) : null
|
|
7600
7686
|
];
|
|
7601
7687
|
}
|
|
7602
7688
|
function item(it, depth) {
|
|
@@ -7604,7 +7690,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7604
7690
|
const open = !collapsed && isOpen(it);
|
|
7605
7691
|
const listId = base + "-" + it.id;
|
|
7606
7692
|
const holdsActive = contains(it, active);
|
|
7607
|
-
return /* @__PURE__ */
|
|
7693
|
+
return /* @__PURE__ */ React37.createElement("li", { key: it.id, className: "aura-nav__group" }, /* @__PURE__ */ React37.createElement(
|
|
7608
7694
|
"button",
|
|
7609
7695
|
{
|
|
7610
7696
|
type: "button",
|
|
@@ -7633,7 +7719,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7633
7719
|
}
|
|
7634
7720
|
},
|
|
7635
7721
|
inner(it, true, open)
|
|
7636
|
-
), /* @__PURE__ */
|
|
7722
|
+
), /* @__PURE__ */ React37.createElement("ul", { id: listId, className: "aura-nav__list aura-nav__sub", hidden: !open }, it.children.map(function(c) {
|
|
7637
7723
|
return item(c, depth + 1);
|
|
7638
7724
|
})));
|
|
7639
7725
|
}
|
|
@@ -7652,9 +7738,9 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7652
7738
|
if (action && props.onAction) props.onAction(it.id);
|
|
7653
7739
|
}
|
|
7654
7740
|
};
|
|
7655
|
-
return /* @__PURE__ */
|
|
7741
|
+
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
7742
|
}
|
|
7657
|
-
return /* @__PURE__ */
|
|
7743
|
+
return /* @__PURE__ */ React37.createElement(
|
|
7658
7744
|
"nav",
|
|
7659
7745
|
{
|
|
7660
7746
|
ref: function(el) {
|
|
@@ -7674,14 +7760,14 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7674
7760
|
"aria-label": props.label || t.mainNav,
|
|
7675
7761
|
onKeyDown
|
|
7676
7762
|
},
|
|
7677
|
-
props.header ? /* @__PURE__ */
|
|
7678
|
-
/* @__PURE__ */
|
|
7679
|
-
return /* @__PURE__ */
|
|
7763
|
+
props.header ? /* @__PURE__ */ React37.createElement("div", { className: "aura-nav__header" }, props.header) : null,
|
|
7764
|
+
/* @__PURE__ */ React37.createElement("div", { className: "aura-nav__scroll" }, sections.map(function(s, i) {
|
|
7765
|
+
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
7766
|
return item(it, 0);
|
|
7681
7767
|
})));
|
|
7682
7768
|
})),
|
|
7683
|
-
props.footer ? /* @__PURE__ */
|
|
7684
|
-
props.collapsible && props.collapseToggle === "row" ? /* @__PURE__ */
|
|
7769
|
+
props.footer ? /* @__PURE__ */ React37.createElement("div", { className: "aura-nav__footer" }, props.footer) : null,
|
|
7770
|
+
props.collapsible && props.collapseToggle === "row" ? /* @__PURE__ */ React37.createElement("div", { className: "aura-nav__toggle aura-nav__toggle--row" }, /* @__PURE__ */ React37.createElement(
|
|
7685
7771
|
"button",
|
|
7686
7772
|
{
|
|
7687
7773
|
type: "button",
|
|
@@ -7692,12 +7778,12 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7692
7778
|
col[1](!collapsed);
|
|
7693
7779
|
}
|
|
7694
7780
|
},
|
|
7695
|
-
/* @__PURE__ */
|
|
7696
|
-
/* @__PURE__ */
|
|
7697
|
-
)) : props.collapsible ? /* @__PURE__ */
|
|
7781
|
+
/* @__PURE__ */ React37.createElement(Icon, { name: collapsed ? /* @__PURE__ */ React37.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React37.createElement(IconPanelLeftClose, null) }),
|
|
7782
|
+
/* @__PURE__ */ React37.createElement("span", { className: "aura-nav__label" }, collapsed ? t.expandNav : t.collapseNav)
|
|
7783
|
+
)) : props.collapsible ? /* @__PURE__ */ React37.createElement("div", { className: "aura-nav__toggle" }, /* @__PURE__ */ React37.createElement(
|
|
7698
7784
|
IconButton,
|
|
7699
7785
|
{
|
|
7700
|
-
icon: collapsed ? /* @__PURE__ */
|
|
7786
|
+
icon: collapsed ? /* @__PURE__ */ React37.createElement(IconPanelLeftOpen, null) : /* @__PURE__ */ React37.createElement(IconPanelLeftClose, null),
|
|
7701
7787
|
label: collapsed ? t.expandNav : t.collapseNav,
|
|
7702
7788
|
size: "md",
|
|
7703
7789
|
onClick: function() {
|
|
@@ -7707,7 +7793,7 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7707
7793
|
}
|
|
7708
7794
|
)) : null,
|
|
7709
7795
|
tip2 && typeof document !== "undefined" ? (0, import_react_dom11.createPortal)(
|
|
7710
|
-
/* @__PURE__ */
|
|
7796
|
+
/* @__PURE__ */ React37.createElement(
|
|
7711
7797
|
"div",
|
|
7712
7798
|
{
|
|
7713
7799
|
className: "aura-tooltip aura-tooltip--right",
|
|
@@ -7722,8 +7808,8 @@ var SideNav = React36.forwardRef(function SideNav2(props, ref) {
|
|
|
7722
7808
|
});
|
|
7723
7809
|
|
|
7724
7810
|
// src/Breadcrumb.tsx
|
|
7725
|
-
var
|
|
7726
|
-
var Breadcrumb =
|
|
7811
|
+
var React38 = __toESM(require("react"), 1);
|
|
7812
|
+
var Breadcrumb = React38.forwardRef(function Breadcrumb2(props, ref) {
|
|
7727
7813
|
const t = useStrings();
|
|
7728
7814
|
const Link = useLinkComponent(props.linkComponent);
|
|
7729
7815
|
const items2 = props.items || [];
|
|
@@ -7731,12 +7817,12 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7731
7817
|
const trail = items2.map(function(it) {
|
|
7732
7818
|
return it.label + "" + (it.href || "");
|
|
7733
7819
|
}).join("");
|
|
7734
|
-
const st =
|
|
7820
|
+
const st = React38.useState(null), expanded = st[0] === trail, setExpanded = function() {
|
|
7735
7821
|
st[1](trail);
|
|
7736
7822
|
};
|
|
7737
|
-
const listRef =
|
|
7738
|
-
const focusNext =
|
|
7739
|
-
|
|
7823
|
+
const listRef = React38.useRef(null);
|
|
7824
|
+
const focusNext = React38.useRef(false);
|
|
7825
|
+
React38.useEffect(
|
|
7740
7826
|
function() {
|
|
7741
7827
|
if (!expanded || !focusNext.current) return;
|
|
7742
7828
|
focusNext.current = false;
|
|
@@ -7751,8 +7837,8 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7751
7837
|
},
|
|
7752
7838
|
[expanded]
|
|
7753
7839
|
);
|
|
7754
|
-
const sep = /* @__PURE__ */
|
|
7755
|
-
const more = collapsible && !expanded ? /* @__PURE__ */
|
|
7840
|
+
const sep = /* @__PURE__ */ React38.createElement(Icon, { name: /* @__PURE__ */ React38.createElement(IconChevronRight, null), size: 12, className: "aura-crumbs__sep" });
|
|
7841
|
+
const more = collapsible && !expanded ? /* @__PURE__ */ React38.createElement("li", { key: "more", className: "aura-crumbs__more" }, /* @__PURE__ */ React38.createElement(
|
|
7756
7842
|
"button",
|
|
7757
7843
|
{
|
|
7758
7844
|
type: "button",
|
|
@@ -7775,23 +7861,23 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7775
7861
|
if (it.onClick) it.onClick();
|
|
7776
7862
|
} : void 0;
|
|
7777
7863
|
out.push(
|
|
7778
|
-
/* @__PURE__ */
|
|
7864
|
+
/* @__PURE__ */ React38.createElement(
|
|
7779
7865
|
"li",
|
|
7780
7866
|
{
|
|
7781
7867
|
key: i,
|
|
7782
7868
|
...it.itemProps,
|
|
7783
7869
|
className: cx(it.itemProps && it.itemProps.className, collapsible && !last && i > 0 && "aura-crumbs__middle") || void 0
|
|
7784
7870
|
},
|
|
7785
|
-
last ? /* @__PURE__ */
|
|
7871
|
+
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
7872
|
/* 5.7: a segment with no page and no action is text, not a button that does nothing. */
|
|
7787
|
-
/* @__PURE__ */
|
|
7873
|
+
/* @__PURE__ */ React38.createElement("span", { ...plain, className: cx("aura-crumbs__text", lp.className) }, it.label)
|
|
7788
7874
|
),
|
|
7789
7875
|
last ? null : sep
|
|
7790
7876
|
)
|
|
7791
7877
|
);
|
|
7792
7878
|
if (i === 0 && more) out.push(more);
|
|
7793
7879
|
});
|
|
7794
|
-
return /* @__PURE__ */
|
|
7880
|
+
return /* @__PURE__ */ React38.createElement(
|
|
7795
7881
|
"nav",
|
|
7796
7882
|
{
|
|
7797
7883
|
ref,
|
|
@@ -7802,27 +7888,27 @@ var Breadcrumb = React37.forwardRef(function Breadcrumb2(props, ref) {
|
|
|
7802
7888
|
props.className
|
|
7803
7889
|
)
|
|
7804
7890
|
},
|
|
7805
|
-
/* @__PURE__ */
|
|
7891
|
+
/* @__PURE__ */ React38.createElement("ol", { ref: listRef }, out)
|
|
7806
7892
|
);
|
|
7807
7893
|
});
|
|
7808
7894
|
|
|
7809
7895
|
// src/Avatar.tsx
|
|
7810
|
-
var
|
|
7811
|
-
var Avatar =
|
|
7812
|
-
const errState =
|
|
7896
|
+
var React39 = __toESM(require("react"), 1);
|
|
7897
|
+
var Avatar = React39.forwardRef(function Avatar2(props, ref) {
|
|
7898
|
+
const errState = React39.useState(null);
|
|
7813
7899
|
return avatarElement(props, ref, errState[0], function() {
|
|
7814
7900
|
errState[1](props.src || null);
|
|
7815
7901
|
});
|
|
7816
7902
|
});
|
|
7817
7903
|
|
|
7818
7904
|
// src/Stack.tsx
|
|
7819
|
-
var
|
|
7905
|
+
var React41 = __toESM(require("react"), 1);
|
|
7820
7906
|
|
|
7821
7907
|
// src/responsive.tsx
|
|
7822
|
-
var
|
|
7908
|
+
var React40 = __toESM(require("react"), 1);
|
|
7823
7909
|
var ORDER2 = ["base", "sm", "md", "lg", "xl"];
|
|
7824
7910
|
function useBreakpoint() {
|
|
7825
|
-
return
|
|
7911
|
+
return React40.useSyncExternalStore(subscribe, current, function() {
|
|
7826
7912
|
return "lg";
|
|
7827
7913
|
});
|
|
7828
7914
|
}
|
|
@@ -7848,8 +7934,8 @@ function useResponsive(value) {
|
|
|
7848
7934
|
}
|
|
7849
7935
|
|
|
7850
7936
|
// src/Stack.tsx
|
|
7851
|
-
var h5 =
|
|
7852
|
-
var Stack =
|
|
7937
|
+
var h5 = React41.createElement;
|
|
7938
|
+
var Stack = React41.forwardRef(function Stack2(props, ref) {
|
|
7853
7939
|
const style = Object.assign(
|
|
7854
7940
|
{},
|
|
7855
7941
|
respVars("aura-stack-dir", props.direction || "column"),
|
|
@@ -7863,9 +7949,9 @@ var Stack = React40.forwardRef(function Stack2(props, ref) {
|
|
|
7863
7949
|
});
|
|
7864
7950
|
|
|
7865
7951
|
// src/Grid.tsx
|
|
7866
|
-
var
|
|
7867
|
-
var h6 =
|
|
7868
|
-
var Grid =
|
|
7952
|
+
var React42 = __toESM(require("react"), 1);
|
|
7953
|
+
var h6 = React42.createElement;
|
|
7954
|
+
var Grid = React42.forwardRef(function Grid2(props, ref) {
|
|
7869
7955
|
const style = Object.assign(
|
|
7870
7956
|
{},
|
|
7871
7957
|
respVars("aura-grid-gap", props.gap == null ? 6 : props.gap, space),
|
|
@@ -7880,9 +7966,9 @@ var Grid = React41.forwardRef(function Grid2(props, ref) {
|
|
|
7880
7966
|
});
|
|
7881
7967
|
|
|
7882
7968
|
// src/Container.tsx
|
|
7883
|
-
var
|
|
7884
|
-
var h7 =
|
|
7885
|
-
var Container =
|
|
7969
|
+
var React43 = __toESM(require("react"), 1);
|
|
7970
|
+
var h7 = React43.createElement;
|
|
7971
|
+
var Container = React43.forwardRef(function Container2(props, ref) {
|
|
7886
7972
|
const attrs2 = {};
|
|
7887
7973
|
Object.keys(props).forEach(function(k) {
|
|
7888
7974
|
if (k === "id" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
@@ -7905,11 +7991,11 @@ var Container = React42.forwardRef(function Container2(props, ref) {
|
|
|
7905
7991
|
});
|
|
7906
7992
|
|
|
7907
7993
|
// src/PageHeaderClient.tsx
|
|
7908
|
-
var
|
|
7994
|
+
var React45 = __toESM(require("react"), 1);
|
|
7909
7995
|
|
|
7910
7996
|
// src/PageHeader.tsx
|
|
7911
|
-
var
|
|
7912
|
-
var h8 =
|
|
7997
|
+
var React44 = __toESM(require("react"), 1);
|
|
7998
|
+
var h8 = React44.createElement;
|
|
7913
7999
|
var LAZY = Symbol.for("react.lazy");
|
|
7914
8000
|
function chipsOnly(node) {
|
|
7915
8001
|
let el = 0;
|
|
@@ -7928,8 +8014,8 @@ function chipsOnly(node) {
|
|
|
7928
8014
|
}
|
|
7929
8015
|
return walk(value);
|
|
7930
8016
|
}
|
|
7931
|
-
if (
|
|
7932
|
-
if (n3.type ===
|
|
8017
|
+
if (React44.isValidElement(n3)) {
|
|
8018
|
+
if (n3.type === React44.Fragment) return walk(n3.props.children);
|
|
7933
8019
|
el++;
|
|
7934
8020
|
return true;
|
|
7935
8021
|
}
|
|
@@ -7937,7 +8023,7 @@ function chipsOnly(node) {
|
|
|
7937
8023
|
};
|
|
7938
8024
|
return walk(node) && el > 0;
|
|
7939
8025
|
}
|
|
7940
|
-
var PageHeader =
|
|
8026
|
+
var PageHeader = React44.forwardRef(function PageHeader2(props, ref) {
|
|
7941
8027
|
const attrs2 = {};
|
|
7942
8028
|
Object.keys(props).forEach(function(k) {
|
|
7943
8029
|
if (k === "id" || k === "lang" || k === "dir" || k === "role" || /^(aria|data)-/.test(k))
|
|
@@ -8017,12 +8103,12 @@ function trapped(el) {
|
|
|
8017
8103
|
}
|
|
8018
8104
|
return false;
|
|
8019
8105
|
}
|
|
8020
|
-
var PageHeader3 =
|
|
8021
|
-
const own =
|
|
8106
|
+
var PageHeader3 = React45.forwardRef(function PageHeader4(props, ref) {
|
|
8107
|
+
const own = React45.useRef(null);
|
|
8022
8108
|
const merged = useMergedRef(ref, own);
|
|
8023
8109
|
const bar = props.actionsBarBelow;
|
|
8024
8110
|
const hasActions = props.actions != null && props.actions !== false;
|
|
8025
|
-
|
|
8111
|
+
React45.useEffect(
|
|
8026
8112
|
function() {
|
|
8027
8113
|
if (bar !== "sm" && bar !== "md" || !hasActions || !own.current) return;
|
|
8028
8114
|
const el = own.current.querySelector(":scope > .aura-page-header__actions");
|
|
@@ -8061,20 +8147,20 @@ var PageHeader3 = React44.forwardRef(function PageHeader4(props, ref) {
|
|
|
8061
8147
|
[bar, hasActions]
|
|
8062
8148
|
);
|
|
8063
8149
|
const focusTitle = !!props.focusTitleOnMount;
|
|
8064
|
-
|
|
8150
|
+
React45.useEffect(function() {
|
|
8065
8151
|
if (!focusTitle || !own.current) return;
|
|
8066
8152
|
const t = own.current.querySelector(".aura-page-header__title");
|
|
8067
8153
|
if (t) t.focus({ preventScroll: true });
|
|
8068
8154
|
}, []);
|
|
8069
|
-
return /* @__PURE__ */
|
|
8155
|
+
return /* @__PURE__ */ React45.createElement(PageHeader, { ...props, ref: merged });
|
|
8070
8156
|
});
|
|
8071
8157
|
|
|
8072
8158
|
// src/StatusTile.tsx
|
|
8073
|
-
var
|
|
8159
|
+
var React47 = __toESM(require("react"), 1);
|
|
8074
8160
|
|
|
8075
8161
|
// src/tiles.tsx
|
|
8076
|
-
var
|
|
8077
|
-
var h9 =
|
|
8162
|
+
var React46 = __toESM(require("react"), 1);
|
|
8163
|
+
var h9 = React46.createElement;
|
|
8078
8164
|
var STATUS_ICON = {
|
|
8079
8165
|
down: IconCircleAlert,
|
|
8080
8166
|
problem: IconTriangleAlert,
|
|
@@ -8166,7 +8252,7 @@ function statusTileElement(props, ref, Link, t, titleRef) {
|
|
|
8166
8252
|
) : null
|
|
8167
8253
|
);
|
|
8168
8254
|
}
|
|
8169
|
-
var TileGrid =
|
|
8255
|
+
var TileGrid = React46.forwardRef(function TileGrid2(props, ref) {
|
|
8170
8256
|
const style = Object.assign(
|
|
8171
8257
|
{},
|
|
8172
8258
|
respVars("aura-grid-cols", props.columns == null ? { base: 2, md: 3 } : props.columns),
|
|
@@ -8182,16 +8268,16 @@ var TileGrid = React45.forwardRef(function TileGrid2(props, ref) {
|
|
|
8182
8268
|
}),
|
|
8183
8269
|
/* toArray drops null and booleans and keys each element; a Fragment's children are items too. */
|
|
8184
8270
|
flat(props.children).map(function(c, i) {
|
|
8185
|
-
return h9("li", { key:
|
|
8271
|
+
return h9("li", { key: React46.isValidElement(c) && c.key != null ? c.key : i }, c);
|
|
8186
8272
|
})
|
|
8187
8273
|
);
|
|
8188
8274
|
});
|
|
8189
8275
|
function flat(children) {
|
|
8190
8276
|
const out = [];
|
|
8191
|
-
|
|
8192
|
-
if (
|
|
8277
|
+
React46.Children.toArray(children).forEach(function(c) {
|
|
8278
|
+
if (React46.isValidElement(c) && c.type === React46.Fragment)
|
|
8193
8279
|
flat(c.props.children).forEach(function(x) {
|
|
8194
|
-
out.push(
|
|
8280
|
+
out.push(React46.isValidElement(x) ? React46.cloneElement(x, { key: String(c.key) + "/" + String(x.key) }) : x);
|
|
8195
8281
|
});
|
|
8196
8282
|
else if (c !== "") out.push(c);
|
|
8197
8283
|
});
|
|
@@ -8205,7 +8291,7 @@ function r(n3) {
|
|
|
8205
8291
|
function num(v) {
|
|
8206
8292
|
return typeof v === "number" && isFinite(v) ? v : null;
|
|
8207
8293
|
}
|
|
8208
|
-
var Sparkline =
|
|
8294
|
+
var Sparkline = React46.forwardRef(function Sparkline2(props, ref) {
|
|
8209
8295
|
const wh = SIZES2[props.size || "sm"] || SIZES2.sm;
|
|
8210
8296
|
const W = wh[0], H = wh[1];
|
|
8211
8297
|
const data = (props.data || []).map(num);
|
|
@@ -8279,8 +8365,8 @@ var Sparkline = React45.forwardRef(function Sparkline2(props, ref) {
|
|
|
8279
8365
|
});
|
|
8280
8366
|
|
|
8281
8367
|
// src/StatusTile.tsx
|
|
8282
|
-
var useIsoLayoutEffect2 = typeof window !== "undefined" ?
|
|
8283
|
-
var StatusTile =
|
|
8368
|
+
var useIsoLayoutEffect2 = typeof window !== "undefined" ? React47.useLayoutEffect : React47.useEffect;
|
|
8369
|
+
var StatusTile = React47.forwardRef(function StatusTile2(props, ref) {
|
|
8284
8370
|
const Link = useLinkComponent(props.linkComponent);
|
|
8285
8371
|
const t = useStrings();
|
|
8286
8372
|
useAutoTip();
|
|
@@ -8289,8 +8375,8 @@ var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
|
8289
8375
|
"status-tile-label",
|
|
8290
8376
|
"StatusTile `aria-label` needs `href`: without a link the tile is a plain box, where a name is not allowed."
|
|
8291
8377
|
);
|
|
8292
|
-
const titleRef =
|
|
8293
|
-
const check =
|
|
8378
|
+
const titleRef = React47.useRef(null);
|
|
8379
|
+
const check = React47.useCallback(function() {
|
|
8294
8380
|
const el = titleRef.current;
|
|
8295
8381
|
if (!el) return;
|
|
8296
8382
|
const cut = el.scrollHeight > el.clientHeight + 1;
|
|
@@ -8300,7 +8386,7 @@ var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
|
8300
8386
|
}, []);
|
|
8301
8387
|
useIsoLayoutEffect2(check, [props.title, check]);
|
|
8302
8388
|
const linked = !!props.href;
|
|
8303
|
-
|
|
8389
|
+
React47.useEffect(
|
|
8304
8390
|
function() {
|
|
8305
8391
|
const el = titleRef.current;
|
|
8306
8392
|
if (!el) return;
|
|
@@ -8325,14 +8411,14 @@ var StatusTile = React46.forwardRef(function StatusTile2(props, ref) {
|
|
|
8325
8411
|
});
|
|
8326
8412
|
|
|
8327
8413
|
// src/AppShell.tsx
|
|
8328
|
-
var
|
|
8414
|
+
var React49 = __toESM(require("react"), 1);
|
|
8329
8415
|
|
|
8330
8416
|
// src/scrollHide.ts
|
|
8331
|
-
var
|
|
8417
|
+
var React48 = __toESM(require("react"), 1);
|
|
8332
8418
|
var STEP = 8;
|
|
8333
8419
|
function useHideOnScroll(enabled, el, media, from) {
|
|
8334
|
-
const st =
|
|
8335
|
-
|
|
8420
|
+
const st = React48.useState(false), hidden = st[0], setHidden = st[1];
|
|
8421
|
+
React48.useEffect(
|
|
8336
8422
|
function() {
|
|
8337
8423
|
if (!enabled || typeof window === "undefined") {
|
|
8338
8424
|
setHidden(false);
|
|
@@ -8425,32 +8511,32 @@ function useHideOnScroll(enabled, el, media, from) {
|
|
|
8425
8511
|
function pinned(bar) {
|
|
8426
8512
|
return getComputedStyle(bar).position !== "static";
|
|
8427
8513
|
}
|
|
8428
|
-
var AppShell =
|
|
8514
|
+
var AppShell = React49.forwardRef(function AppShell2(props, ref) {
|
|
8429
8515
|
const t = useStrings();
|
|
8430
8516
|
const bp = useBreakpoint();
|
|
8431
8517
|
const wide = bp === "lg" || bp === "xl";
|
|
8432
|
-
const st =
|
|
8433
|
-
|
|
8518
|
+
const st = React49.useState(false), open = st[0], setOpen = st[1];
|
|
8519
|
+
React49.useEffect(
|
|
8434
8520
|
function() {
|
|
8435
8521
|
if (wide) setOpen(false);
|
|
8436
8522
|
},
|
|
8437
8523
|
[wide]
|
|
8438
8524
|
);
|
|
8439
|
-
const navEl = props.nav &&
|
|
8525
|
+
const navEl = props.nav && React49.isValidElement(props.nav) ? props.nav : null;
|
|
8440
8526
|
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 =
|
|
8527
|
+
const navState = React49.useState(navEl ? navEl.props.defaultValue : void 0);
|
|
8442
8528
|
function onNav(id) {
|
|
8443
8529
|
if (shared) navState[1](id);
|
|
8444
8530
|
if (navEl && navEl.props.onChange) navEl.props.onChange(id);
|
|
8445
8531
|
}
|
|
8446
|
-
const rootRef =
|
|
8447
|
-
const barRef =
|
|
8448
|
-
const probeRef =
|
|
8532
|
+
const rootRef = React49.useRef(null);
|
|
8533
|
+
const barRef = React49.useRef(null);
|
|
8534
|
+
const probeRef = React49.useRef(null);
|
|
8449
8535
|
const mergedRef = useMergedRef(ref, rootRef);
|
|
8450
8536
|
const hasBar = !!(props.header || props.nav);
|
|
8451
|
-
const barH =
|
|
8537
|
+
const barH = React49.useState(null);
|
|
8452
8538
|
const away = useHideOnScroll(!!props.headerHideOnScroll && hasBar, barRef, "(max-width: 1023.98px)", barH[0] || 56);
|
|
8453
|
-
const awayRef =
|
|
8539
|
+
const awayRef = React49.useRef(away);
|
|
8454
8540
|
awayRef.current = away;
|
|
8455
8541
|
useIsoLayoutEffect(
|
|
8456
8542
|
function() {
|
|
@@ -8485,8 +8571,8 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8485
8571
|
},
|
|
8486
8572
|
[hasBar]
|
|
8487
8573
|
);
|
|
8488
|
-
const deskNav = navEl && shared ?
|
|
8489
|
-
const drawerNav = navEl ?
|
|
8574
|
+
const deskNav = navEl && shared ? React49.cloneElement(navEl, { value: navState[0], onChange: onNav }) : props.nav;
|
|
8575
|
+
const drawerNav = navEl ? React49.cloneElement(navEl, {
|
|
8490
8576
|
value: shared ? navState[0] : navEl.props.value,
|
|
8491
8577
|
onChange: function(id) {
|
|
8492
8578
|
onNav(id);
|
|
@@ -8501,7 +8587,7 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8501
8587
|
collapsed: false,
|
|
8502
8588
|
collapsible: false
|
|
8503
8589
|
}) : props.nav;
|
|
8504
|
-
return /* @__PURE__ */
|
|
8590
|
+
return /* @__PURE__ */ React49.createElement(
|
|
8505
8591
|
"div",
|
|
8506
8592
|
{
|
|
8507
8593
|
ref: mergedRef,
|
|
@@ -8516,8 +8602,8 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8516
8602
|
props.className
|
|
8517
8603
|
)
|
|
8518
8604
|
},
|
|
8519
|
-
props.nav ? /* @__PURE__ */
|
|
8520
|
-
props.nav ? /* @__PURE__ */
|
|
8605
|
+
props.nav ? /* @__PURE__ */ React49.createElement("div", { className: "aura-shell__nav" }, deskNav) : null,
|
|
8606
|
+
props.nav ? /* @__PURE__ */ React49.createElement(
|
|
8521
8607
|
Drawer,
|
|
8522
8608
|
{
|
|
8523
8609
|
open,
|
|
@@ -8534,7 +8620,7 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8534
8620
|
},
|
|
8535
8621
|
drawerNav
|
|
8536
8622
|
) : null,
|
|
8537
|
-
/* @__PURE__ */
|
|
8623
|
+
/* @__PURE__ */ React49.createElement("div", { className: "aura-shell__main" }, props.header || props.nav ? /* @__PURE__ */ React49.createElement(
|
|
8538
8624
|
"header",
|
|
8539
8625
|
{
|
|
8540
8626
|
ref: barRef,
|
|
@@ -8546,11 +8632,11 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8546
8632
|
away && "is-away"
|
|
8547
8633
|
)
|
|
8548
8634
|
},
|
|
8549
|
-
props.nav ? /* @__PURE__ */
|
|
8635
|
+
props.nav ? /* @__PURE__ */ React49.createElement(
|
|
8550
8636
|
IconButton,
|
|
8551
8637
|
{
|
|
8552
8638
|
className: "aura-shell__menu",
|
|
8553
|
-
icon: /* @__PURE__ */
|
|
8639
|
+
icon: /* @__PURE__ */ React49.createElement(IconMenu, null),
|
|
8554
8640
|
label: props.menuLabel || t.openNav,
|
|
8555
8641
|
size: "md",
|
|
8556
8642
|
touchHeight: true,
|
|
@@ -8560,9 +8646,9 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8560
8646
|
"aria-expanded": open
|
|
8561
8647
|
}
|
|
8562
8648
|
) : null,
|
|
8563
|
-
/* @__PURE__ */
|
|
8564
|
-
/* @__PURE__ */
|
|
8565
|
-
) : null, /* @__PURE__ */
|
|
8649
|
+
/* @__PURE__ */ React49.createElement("div", { className: "aura-shell__bar-content" }, props.header),
|
|
8650
|
+
/* @__PURE__ */ React49.createElement("span", { className: "aura-shell__probe", "aria-hidden": "true", ref: probeRef })
|
|
8651
|
+
) : null, /* @__PURE__ */ React49.createElement(
|
|
8566
8652
|
"main",
|
|
8567
8653
|
{
|
|
8568
8654
|
className: cx("aura-shell__content", props.contentPadding === false && "is-flush"),
|
|
@@ -8575,17 +8661,17 @@ var AppShell = React48.forwardRef(function AppShell2(props, ref) {
|
|
|
8575
8661
|
});
|
|
8576
8662
|
|
|
8577
8663
|
// src/ActionBar.tsx
|
|
8578
|
-
var
|
|
8579
|
-
var ActionBar =
|
|
8664
|
+
var React50 = __toESM(require("react"), 1);
|
|
8665
|
+
var ActionBar = React50.forwardRef(function ActionBar2(props, ref) {
|
|
8580
8666
|
const t = useStrings();
|
|
8581
8667
|
const bulk = props.selected != null;
|
|
8582
8668
|
const idle = bulk && !props.selected;
|
|
8583
8669
|
const count = bulk && props.selected ? t.selectedCount(props.selected) : null;
|
|
8584
|
-
const hasStart =
|
|
8670
|
+
const hasStart = React50.Children.toArray(props.start).some(function(c) {
|
|
8585
8671
|
return c !== "";
|
|
8586
8672
|
});
|
|
8587
|
-
const cameFrom =
|
|
8588
|
-
const own =
|
|
8673
|
+
const cameFrom = React50.useRef(null);
|
|
8674
|
+
const own = React50.useRef(null);
|
|
8589
8675
|
function clear() {
|
|
8590
8676
|
props.onClearSelection();
|
|
8591
8677
|
setTimeout(function() {
|
|
@@ -8594,7 +8680,7 @@ var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
|
8594
8680
|
if ((!a || a === document.body || !a.isConnected) && back && back.isConnected) back.focus();
|
|
8595
8681
|
}, 0);
|
|
8596
8682
|
}
|
|
8597
|
-
return /* @__PURE__ */
|
|
8683
|
+
return /* @__PURE__ */ React50.createElement(
|
|
8598
8684
|
"div",
|
|
8599
8685
|
{
|
|
8600
8686
|
ref: function(el) {
|
|
@@ -8616,16 +8702,16 @@ var ActionBar = React49.forwardRef(function ActionBar2(props, ref) {
|
|
|
8616
8702
|
props.className
|
|
8617
8703
|
)
|
|
8618
8704
|
},
|
|
8619
|
-
/* @__PURE__ */
|
|
8705
|
+
/* @__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
8706
|
);
|
|
8621
8707
|
});
|
|
8622
8708
|
|
|
8623
8709
|
// src/Separator.tsx
|
|
8624
|
-
var
|
|
8625
|
-
var Separator =
|
|
8710
|
+
var React51 = __toESM(require("react"), 1);
|
|
8711
|
+
var Separator = React51.forwardRef(function Separator2(props, ref) {
|
|
8626
8712
|
const vertical = props.orientation === "vertical";
|
|
8627
8713
|
const decorative = props.decorative !== false;
|
|
8628
|
-
return /* @__PURE__ */
|
|
8714
|
+
return /* @__PURE__ */ React51.createElement(
|
|
8629
8715
|
"div",
|
|
8630
8716
|
{
|
|
8631
8717
|
ref,
|
|
@@ -8638,13 +8724,13 @@ var Separator = React50.forwardRef(function Separator2(props, ref) {
|
|
|
8638
8724
|
});
|
|
8639
8725
|
|
|
8640
8726
|
// src/Table.tsx
|
|
8641
|
-
var
|
|
8727
|
+
var React53 = __toESM(require("react"), 1);
|
|
8642
8728
|
|
|
8643
8729
|
// src/TableSkeleton.tsx
|
|
8644
|
-
var
|
|
8645
|
-
var h10 =
|
|
8730
|
+
var React52 = __toESM(require("react"), 1);
|
|
8731
|
+
var h10 = React52.createElement;
|
|
8646
8732
|
function inertProps() {
|
|
8647
|
-
return { inert: parseInt(
|
|
8733
|
+
return { inert: parseInt(React52.version, 10) >= 19 ? true : "", "aria-hidden": true };
|
|
8648
8734
|
}
|
|
8649
8735
|
function widthOf(w) {
|
|
8650
8736
|
return w == null || w === "" ? void 0 : typeof w === "number" ? w + "px" : w;
|
|
@@ -8802,12 +8888,12 @@ function TableSkeleton(props) {
|
|
|
8802
8888
|
}
|
|
8803
8889
|
|
|
8804
8890
|
// src/Table.tsx
|
|
8805
|
-
var StackLabels =
|
|
8806
|
-
var ColumnIndex =
|
|
8891
|
+
var StackLabels = React53.createContext(null);
|
|
8892
|
+
var ColumnIndex = React53.createContext(-1);
|
|
8807
8893
|
function flat2(children) {
|
|
8808
8894
|
const out = [];
|
|
8809
|
-
|
|
8810
|
-
if (
|
|
8895
|
+
React53.Children.toArray(children).forEach(function(c) {
|
|
8896
|
+
if (React53.isValidElement(c) && c.type === React53.Fragment)
|
|
8811
8897
|
out.push.apply(out, flat2(c.props.children));
|
|
8812
8898
|
else out.push(c);
|
|
8813
8899
|
});
|
|
@@ -8821,7 +8907,7 @@ function text(node) {
|
|
|
8821
8907
|
});
|
|
8822
8908
|
return parts.length ? parts.join("") : void 0;
|
|
8823
8909
|
}
|
|
8824
|
-
if (
|
|
8910
|
+
if (React53.isValidElement(node)) {
|
|
8825
8911
|
const p = node.props;
|
|
8826
8912
|
if (p["aria-hidden"] === true || p["aria-hidden"] === "true") return void 0;
|
|
8827
8913
|
return text(p.children);
|
|
@@ -8831,13 +8917,13 @@ function text(node) {
|
|
|
8831
8917
|
function headerLabels(children) {
|
|
8832
8918
|
let out = [];
|
|
8833
8919
|
flat2(children).forEach(function(c) {
|
|
8834
|
-
if (out.length || !
|
|
8920
|
+
if (out.length || !React53.isValidElement(c) || c.type !== THead) return;
|
|
8835
8921
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8836
|
-
return
|
|
8922
|
+
return React53.isValidElement(r2);
|
|
8837
8923
|
});
|
|
8838
8924
|
if (!row) return;
|
|
8839
8925
|
flat2(row.props.children).forEach(function(cell) {
|
|
8840
|
-
if (!
|
|
8926
|
+
if (!React53.isValidElement(cell)) return;
|
|
8841
8927
|
const p = cell.props;
|
|
8842
8928
|
const t = text(p.children);
|
|
8843
8929
|
const label = p.label != null ? p.label : t != null ? t.replace(/\s+/g, " ").trim() || void 0 : void 0;
|
|
@@ -8850,13 +8936,13 @@ function headerLabels(children) {
|
|
|
8850
8936
|
function headerColumns(children) {
|
|
8851
8937
|
const out = [];
|
|
8852
8938
|
flat2(children).forEach(function(c) {
|
|
8853
|
-
if (out.length || !
|
|
8939
|
+
if (out.length || !React53.isValidElement(c) || c.type !== THead) return;
|
|
8854
8940
|
const row = flat2(c.props.children).find(function(r2) {
|
|
8855
|
-
return
|
|
8941
|
+
return React53.isValidElement(r2);
|
|
8856
8942
|
});
|
|
8857
8943
|
if (!row) return;
|
|
8858
8944
|
flat2(row.props.children).forEach(function(cell) {
|
|
8859
|
-
if (!
|
|
8945
|
+
if (!React53.isValidElement(cell)) return;
|
|
8860
8946
|
const p = cell.props;
|
|
8861
8947
|
const t = text(p.children);
|
|
8862
8948
|
const style = p.style;
|
|
@@ -8874,7 +8960,7 @@ function headerColumns(children) {
|
|
|
8874
8960
|
});
|
|
8875
8961
|
return out;
|
|
8876
8962
|
}
|
|
8877
|
-
var Table =
|
|
8963
|
+
var Table = React53.forwardRef(function Table2(props, ref) {
|
|
8878
8964
|
const {
|
|
8879
8965
|
caption,
|
|
8880
8966
|
captionHidden,
|
|
@@ -8902,7 +8988,7 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8902
8988
|
);
|
|
8903
8989
|
const shownChildren = skeletonCols ? [
|
|
8904
8990
|
flat2(children).filter(function(c) {
|
|
8905
|
-
return
|
|
8991
|
+
return React53.isValidElement(c) && c.type === THead;
|
|
8906
8992
|
}),
|
|
8907
8993
|
skeletonBody(skeletonCols, loadingRows != null ? Math.max(0, loadingRows) : 5, !!stackBelow)
|
|
8908
8994
|
] : children;
|
|
@@ -8918,12 +9004,12 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8918
9004
|
"tbl-stack-labels",
|
|
8919
9005
|
"Table stackBelow: no THead > Tr > Th found among its children, so cells have no labels. Pass `label` on each Td."
|
|
8920
9006
|
);
|
|
8921
|
-
const outer =
|
|
9007
|
+
const outer = React53.useContext(StackLabels);
|
|
8922
9008
|
const pageDensity = useDensity();
|
|
8923
9009
|
const capId = uid();
|
|
8924
|
-
const wrap =
|
|
8925
|
-
const sc =
|
|
8926
|
-
const wide =
|
|
9010
|
+
const wrap = React53.useRef(null);
|
|
9011
|
+
const sc = React53.useState(false), scrolls = sc[0];
|
|
9012
|
+
const wide = React53.useState(false);
|
|
8927
9013
|
useIsoLayoutEffect(function() {
|
|
8928
9014
|
const el = wrap.current;
|
|
8929
9015
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
@@ -8940,7 +9026,7 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8940
9026
|
ro.disconnect();
|
|
8941
9027
|
};
|
|
8942
9028
|
}, []);
|
|
8943
|
-
const table = /* @__PURE__ */
|
|
9029
|
+
const table = /* @__PURE__ */ React53.createElement(
|
|
8944
9030
|
"div",
|
|
8945
9031
|
{
|
|
8946
9032
|
ref: wrap,
|
|
@@ -8965,7 +9051,7 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8965
9051
|
"aria-labelledby": scrolls && !loading ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
8966
9052
|
"aria-label": scrolls && !loading && caption == null ? rest["aria-label"] : void 0
|
|
8967
9053
|
},
|
|
8968
|
-
/* @__PURE__ */
|
|
9054
|
+
/* @__PURE__ */ React53.createElement(
|
|
8969
9055
|
"table",
|
|
8970
9056
|
{
|
|
8971
9057
|
ref,
|
|
@@ -8982,12 +9068,12 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
8982
9068
|
role: stackBelow ? "table" : void 0,
|
|
8983
9069
|
...rest
|
|
8984
9070
|
},
|
|
8985
|
-
caption != null ? /* @__PURE__ */
|
|
9071
|
+
caption != null ? /* @__PURE__ */ React53.createElement("caption", { id: capId, className: cx("aura-tbl__caption", captionHidden && "aura-sr-only") }, caption) : null,
|
|
8986
9072
|
skeletonCols ? skeletonColgroup(skeletonCols) : null,
|
|
8987
|
-
labels ? /* @__PURE__ */
|
|
9073
|
+
labels ? /* @__PURE__ */ React53.createElement(StackLabels.Provider, { value: labels }, shownChildren) : outer ? /* @__PURE__ */ React53.createElement(StackLabels.Provider, { value: null }, shownChildren) : shownChildren
|
|
8988
9074
|
)
|
|
8989
9075
|
);
|
|
8990
|
-
return cards ? /* @__PURE__ */
|
|
9076
|
+
return cards ? /* @__PURE__ */ React53.createElement(
|
|
8991
9077
|
"div",
|
|
8992
9078
|
{
|
|
8993
9079
|
className: cx(
|
|
@@ -9000,10 +9086,10 @@ var Table = React52.forwardRef(function Table2(props, ref) {
|
|
|
9000
9086
|
) : table;
|
|
9001
9087
|
});
|
|
9002
9088
|
function section(tag, cls) {
|
|
9003
|
-
const C =
|
|
9089
|
+
const C = React53.forwardRef(function TableSection(props, ref) {
|
|
9004
9090
|
const { className, ...rest } = props;
|
|
9005
|
-
const stacked =
|
|
9006
|
-
return
|
|
9091
|
+
const stacked = React53.useContext(StackLabels) != null;
|
|
9092
|
+
return React53.createElement(
|
|
9007
9093
|
tag,
|
|
9008
9094
|
Object.assign({ ref, className: cx(cls, className), role: stacked ? "rowgroup" : void 0 }, rest)
|
|
9009
9095
|
);
|
|
@@ -9016,14 +9102,14 @@ var TBody = section("tbody", "aura-tbl__body");
|
|
|
9016
9102
|
TBody.displayName = "TBody";
|
|
9017
9103
|
var TFoot = section("tfoot", "aura-tbl__foot");
|
|
9018
9104
|
TFoot.displayName = "TFoot";
|
|
9019
|
-
var Tr =
|
|
9105
|
+
var Tr = React53.forwardRef(function Tr2(props, ref) {
|
|
9020
9106
|
const { className, children, ...rest } = props;
|
|
9021
|
-
const stacked =
|
|
9107
|
+
const stacked = React53.useContext(StackLabels) != null;
|
|
9022
9108
|
let col = 0;
|
|
9023
|
-
return /* @__PURE__ */
|
|
9109
|
+
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
9110
|
const at = col;
|
|
9025
|
-
if (
|
|
9026
|
-
return /* @__PURE__ */
|
|
9111
|
+
if (React53.isValidElement(c)) col += Math.max(1, Number(c.props.colSpan) || 1);
|
|
9112
|
+
return /* @__PURE__ */ React53.createElement(ColumnIndex.Provider, { key: React53.isValidElement(c) && c.key != null ? c.key : at, value: at }, c);
|
|
9027
9113
|
}) : children);
|
|
9028
9114
|
});
|
|
9029
9115
|
function cellClass(base, p) {
|
|
@@ -9040,10 +9126,10 @@ function cellClass(base, p) {
|
|
|
9040
9126
|
p.className
|
|
9041
9127
|
);
|
|
9042
9128
|
}
|
|
9043
|
-
var Th =
|
|
9129
|
+
var Th = React53.forwardRef(function Th2(props, ref) {
|
|
9044
9130
|
const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, wrap, ...rest } = props;
|
|
9045
|
-
const stacked =
|
|
9046
|
-
return /* @__PURE__ */
|
|
9131
|
+
const stacked = React53.useContext(StackLabels) != null;
|
|
9132
|
+
return /* @__PURE__ */ React53.createElement(
|
|
9047
9133
|
"th",
|
|
9048
9134
|
{
|
|
9049
9135
|
ref,
|
|
@@ -9055,12 +9141,12 @@ var Th = React52.forwardRef(function Th2(props, ref) {
|
|
|
9055
9141
|
}
|
|
9056
9142
|
);
|
|
9057
9143
|
});
|
|
9058
|
-
var Td =
|
|
9144
|
+
var Td = React53.forwardRef(function Td2(props, ref) {
|
|
9059
9145
|
const { align, numeric, mono, className, scope, label, card, skeleton, skeletonWidth, wrap, ...rest } = props;
|
|
9060
|
-
const labels =
|
|
9146
|
+
const labels = React53.useContext(StackLabels), col = React53.useContext(ColumnIndex);
|
|
9061
9147
|
const slot = labels && (card === "title" || card === "action") ? card : void 0;
|
|
9062
9148
|
const shown = labels && !slot ? label != null ? label : col >= 0 ? labels[col] : void 0 : void 0;
|
|
9063
|
-
return /* @__PURE__ */
|
|
9149
|
+
return /* @__PURE__ */ React53.createElement(
|
|
9064
9150
|
"td",
|
|
9065
9151
|
{
|
|
9066
9152
|
ref,
|
|
@@ -9074,8 +9160,8 @@ var Td = React52.forwardRef(function Td2(props, ref) {
|
|
|
9074
9160
|
});
|
|
9075
9161
|
|
|
9076
9162
|
// src/BottomNav.tsx
|
|
9077
|
-
var
|
|
9078
|
-
var BottomNav =
|
|
9163
|
+
var React54 = __toESM(require("react"), 1);
|
|
9164
|
+
var BottomNav = React54.forwardRef(function BottomNav2(props, ref) {
|
|
9079
9165
|
const t = useStrings();
|
|
9080
9166
|
const Link = useLinkComponent(props.linkComponent);
|
|
9081
9167
|
const st = useMaybeControlled(
|
|
@@ -9085,7 +9171,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9085
9171
|
);
|
|
9086
9172
|
const active = st[0];
|
|
9087
9173
|
const hide2 = props.hideFrom === false ? "always" : "below-" + (props.hideFrom || "lg");
|
|
9088
|
-
const own =
|
|
9174
|
+
const own = React54.useRef(null);
|
|
9089
9175
|
const hf = props.hideFrom === false ? null : props.hideFrom || "lg";
|
|
9090
9176
|
const away = useHideOnScroll(
|
|
9091
9177
|
!!props.hideOnScroll,
|
|
@@ -9093,7 +9179,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9093
9179
|
hf ? "(max-width: " + (breakpoints[hf] - 0.02) + "px)" : "all",
|
|
9094
9180
|
64
|
|
9095
9181
|
);
|
|
9096
|
-
const setRef =
|
|
9182
|
+
const setRef = React54.useCallback(
|
|
9097
9183
|
function(el) {
|
|
9098
9184
|
own.current = el;
|
|
9099
9185
|
if (typeof ref === "function") ref(el);
|
|
@@ -9101,7 +9187,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9101
9187
|
},
|
|
9102
9188
|
[ref]
|
|
9103
9189
|
);
|
|
9104
|
-
return /* @__PURE__ */
|
|
9190
|
+
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
9191
|
"nav",
|
|
9106
9192
|
{
|
|
9107
9193
|
ref: setRef,
|
|
@@ -9114,7 +9200,7 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9114
9200
|
),
|
|
9115
9201
|
"aria-label": props.label || t.mainNav
|
|
9116
9202
|
},
|
|
9117
|
-
/* @__PURE__ */
|
|
9203
|
+
/* @__PURE__ */ React54.createElement("ul", { className: "aura-bottomnav__list" }, props.items.map(function(it) {
|
|
9118
9204
|
if (it.ariaLabel && typeof it.label === "string" && it.ariaLabel.toLowerCase().indexOf(it.label.toLowerCase()) < 0)
|
|
9119
9205
|
devWarnOnce(
|
|
9120
9206
|
"bottomnav-label-" + it.id,
|
|
@@ -9135,20 +9221,20 @@ var BottomNav = React53.forwardRef(function BottomNav2(props, ref) {
|
|
|
9135
9221
|
}
|
|
9136
9222
|
};
|
|
9137
9223
|
const inner = [
|
|
9138
|
-
/* @__PURE__ */
|
|
9139
|
-
it.ariaLabel ? /* @__PURE__ */
|
|
9140
|
-
/* @__PURE__ */
|
|
9141
|
-
suffix && !it.ariaLabel ? /* @__PURE__ */
|
|
9224
|
+
/* @__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),
|
|
9225
|
+
it.ariaLabel ? /* @__PURE__ */ React54.createElement("span", { key: "n", className: "aura-sr-only" }, it.ariaLabel + suffix) : null,
|
|
9226
|
+
/* @__PURE__ */ React54.createElement("span", { key: "l", className: "aura-bottomnav__label", "aria-hidden": it.ariaLabel ? true : void 0 }, it.label),
|
|
9227
|
+
suffix && !it.ariaLabel ? /* @__PURE__ */ React54.createElement("span", { key: "s", className: "aura-sr-only" }, suffix) : null
|
|
9142
9228
|
];
|
|
9143
|
-
return /* @__PURE__ */
|
|
9229
|
+
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
9230
|
}))
|
|
9145
9231
|
));
|
|
9146
9232
|
});
|
|
9147
9233
|
|
|
9148
9234
|
// src/Surface.tsx
|
|
9149
|
-
var
|
|
9150
|
-
var h11 =
|
|
9151
|
-
var Surface =
|
|
9235
|
+
var React55 = __toESM(require("react"), 1);
|
|
9236
|
+
var h11 = React55.createElement;
|
|
9237
|
+
var Surface = React55.forwardRef(function Surface2(props, ref) {
|
|
9152
9238
|
const t = props.texture || "mesh";
|
|
9153
9239
|
const rest = omit(props, ["texture", "className", "children", "as"]);
|
|
9154
9240
|
return h11(
|
|
@@ -9169,14 +9255,14 @@ var Surface = React54.forwardRef(function Surface2(props, ref) {
|
|
|
9169
9255
|
});
|
|
9170
9256
|
|
|
9171
9257
|
// src/Stat.tsx
|
|
9172
|
-
var
|
|
9173
|
-
var Stat =
|
|
9258
|
+
var React56 = __toESM(require("react"), 1);
|
|
9259
|
+
var Stat = React56.forwardRef(function Stat2(props, ref) {
|
|
9174
9260
|
const Link = useLinkComponent(props.linkComponent);
|
|
9175
9261
|
return statElement(props, ref, Link);
|
|
9176
9262
|
});
|
|
9177
9263
|
|
|
9178
9264
|
// src/TimePicker.tsx
|
|
9179
|
-
var
|
|
9265
|
+
var React57 = __toESM(require("react"), 1);
|
|
9180
9266
|
var import_react_dom12 = require("react-dom");
|
|
9181
9267
|
|
|
9182
9268
|
// src/text.ts
|
|
@@ -9218,7 +9304,7 @@ function toMin(t) {
|
|
|
9218
9304
|
function fromMin(n3) {
|
|
9219
9305
|
return pad3(Math.floor(n3 / 60)) + ":" + pad3(n3 % 60);
|
|
9220
9306
|
}
|
|
9221
|
-
var TimePicker =
|
|
9307
|
+
var TimePicker = React57.forwardRef(function TimePicker2(props, ref) {
|
|
9222
9308
|
const t = useStrings();
|
|
9223
9309
|
const auto = uid(), id = props.id || auto, listId = id + "-list";
|
|
9224
9310
|
const st = useMaybeControlled(
|
|
@@ -9228,7 +9314,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9228
9314
|
);
|
|
9229
9315
|
const value = st[0];
|
|
9230
9316
|
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 =
|
|
9317
|
+
const slots = React57.useMemo(
|
|
9232
9318
|
function() {
|
|
9233
9319
|
const out = [];
|
|
9234
9320
|
for (let m = lo; m <= hi; m += step) out.push(fromMin(m));
|
|
@@ -9240,12 +9326,12 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9240
9326
|
const n3 = toMin(v);
|
|
9241
9327
|
return n3 == null || n3 < lo || n3 > hi || props.isTimeDisabled && props.isTimeDisabled(v);
|
|
9242
9328
|
}
|
|
9243
|
-
const openState =
|
|
9244
|
-
const editState =
|
|
9245
|
-
const aState =
|
|
9246
|
-
const errState =
|
|
9247
|
-
const pos =
|
|
9248
|
-
const boxRef =
|
|
9329
|
+
const openState = React57.useState(false), open = openState[0], setOpen = openState[1];
|
|
9330
|
+
const editState = React57.useState(null), editing = editState[0], setEditing = editState[1];
|
|
9331
|
+
const aState = React57.useState(0), active = aState[0], setActive = aState[1];
|
|
9332
|
+
const errState = React57.useState(null);
|
|
9333
|
+
const pos = React57.useState(null);
|
|
9334
|
+
const boxRef = React57.useRef(null), inputRef = React57.useRef(null), listRef = React57.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9249
9335
|
const mounted = useMounted();
|
|
9250
9336
|
function nearest(v) {
|
|
9251
9337
|
const n3 = toMin(v);
|
|
@@ -9273,7 +9359,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9273
9359
|
},
|
|
9274
9360
|
[open]
|
|
9275
9361
|
);
|
|
9276
|
-
|
|
9362
|
+
React57.useEffect(
|
|
9277
9363
|
function() {
|
|
9278
9364
|
if (!open) return;
|
|
9279
9365
|
function outside(e) {
|
|
@@ -9295,7 +9381,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9295
9381
|
},
|
|
9296
9382
|
[open]
|
|
9297
9383
|
);
|
|
9298
|
-
|
|
9384
|
+
React57.useEffect(
|
|
9299
9385
|
function() {
|
|
9300
9386
|
if (!open || !listRef.current) return;
|
|
9301
9387
|
const el = listRef.current.querySelector('[data-idx="' + active + '"]');
|
|
@@ -9394,9 +9480,9 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9394
9480
|
}
|
|
9395
9481
|
const error = errState[0] || props.error;
|
|
9396
9482
|
const list = open && mounted && pos[0] ? (0, import_react_dom12.createPortal)(
|
|
9397
|
-
/* @__PURE__ */
|
|
9483
|
+
/* @__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
9484
|
const dis = blocked(s), sel = s === value;
|
|
9399
|
-
return /* @__PURE__ */
|
|
9485
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9400
9486
|
"li",
|
|
9401
9487
|
{
|
|
9402
9488
|
key: s,
|
|
@@ -9421,13 +9507,13 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9421
9507
|
if (active !== i) setActive(i);
|
|
9422
9508
|
}
|
|
9423
9509
|
},
|
|
9424
|
-
/* @__PURE__ */
|
|
9425
|
-
sel ? /* @__PURE__ */
|
|
9510
|
+
/* @__PURE__ */ React57.createElement("span", { className: "aura-combo__label" }, s),
|
|
9511
|
+
sel ? /* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
9426
9512
|
);
|
|
9427
9513
|
}))),
|
|
9428
9514
|
document.body
|
|
9429
9515
|
) : null;
|
|
9430
|
-
return /* @__PURE__ */
|
|
9516
|
+
return /* @__PURE__ */ React57.createElement(
|
|
9431
9517
|
Field,
|
|
9432
9518
|
{
|
|
9433
9519
|
id,
|
|
@@ -9439,7 +9525,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9439
9525
|
disabled: props.disabled,
|
|
9440
9526
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
9441
9527
|
},
|
|
9442
|
-
/* @__PURE__ */
|
|
9528
|
+
/* @__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
9529
|
"input",
|
|
9444
9530
|
{
|
|
9445
9531
|
ref: inputMerged,
|
|
@@ -9479,7 +9565,7 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9479
9565
|
}, 0);
|
|
9480
9566
|
}
|
|
9481
9567
|
}
|
|
9482
|
-
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */
|
|
9568
|
+
), props.clearable !== false && value != null && !props.disabled ? /* @__PURE__ */ React57.createElement(
|
|
9483
9569
|
"button",
|
|
9484
9570
|
{
|
|
9485
9571
|
type: "button",
|
|
@@ -9492,8 +9578,8 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9492
9578
|
if (inputRef.current) inputRef.current.focus();
|
|
9493
9579
|
}
|
|
9494
9580
|
},
|
|
9495
|
-
/* @__PURE__ */
|
|
9496
|
-
) : null, /* @__PURE__ */
|
|
9581
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconX, null) })
|
|
9582
|
+
) : null, /* @__PURE__ */ React57.createElement(
|
|
9497
9583
|
"button",
|
|
9498
9584
|
{
|
|
9499
9585
|
type: "button",
|
|
@@ -9511,14 +9597,14 @@ var TimePicker = React56.forwardRef(function TimePicker2(props, ref) {
|
|
|
9511
9597
|
}
|
|
9512
9598
|
}
|
|
9513
9599
|
},
|
|
9514
|
-
/* @__PURE__ */
|
|
9600
|
+
/* @__PURE__ */ React57.createElement(Icon, { name: /* @__PURE__ */ React57.createElement(IconChevronDown, null) })
|
|
9515
9601
|
)),
|
|
9516
9602
|
list
|
|
9517
9603
|
);
|
|
9518
9604
|
});
|
|
9519
9605
|
|
|
9520
9606
|
// src/FileUpload.tsx
|
|
9521
|
-
var
|
|
9607
|
+
var React58 = __toESM(require("react"), 1);
|
|
9522
9608
|
function matches(file, accept) {
|
|
9523
9609
|
if (!accept) return true;
|
|
9524
9610
|
const name = (file.name || "").toLowerCase(), type = (file.type || "").toLowerCase();
|
|
@@ -9542,24 +9628,24 @@ function describeAccept(accept, t) {
|
|
|
9542
9628
|
}).join(", ");
|
|
9543
9629
|
}
|
|
9544
9630
|
var seq = 0;
|
|
9545
|
-
var FileUpload =
|
|
9631
|
+
var FileUpload = React58.forwardRef(function FileUpload2(props, ref) {
|
|
9546
9632
|
const t = useStrings();
|
|
9547
9633
|
const auto = uid(), id = props.id || auto;
|
|
9548
9634
|
const st = useMaybeControlled(props.value, props.defaultValue || [], props.onChange);
|
|
9549
9635
|
const items2 = st[0] || [];
|
|
9550
|
-
const dragState =
|
|
9551
|
-
const inputRef =
|
|
9552
|
-
const urls =
|
|
9636
|
+
const dragState = React58.useState(false), over = dragState[0];
|
|
9637
|
+
const inputRef = React58.useRef(null), inputMerged = useMergedRef(ref, inputRef);
|
|
9638
|
+
const urls = React58.useRef({});
|
|
9553
9639
|
const maxFiles = props.multiple ? props.maxFiles : 1;
|
|
9554
9640
|
const note = t.accepts(describeAccept(props.accept, t), props.maxSize ? formatBytes(props.maxSize) : "");
|
|
9555
|
-
|
|
9641
|
+
React58.useEffect(function() {
|
|
9556
9642
|
return function() {
|
|
9557
9643
|
Object.keys(urls.current).forEach(function(k) {
|
|
9558
9644
|
URL.revokeObjectURL(urls.current[k]);
|
|
9559
9645
|
});
|
|
9560
9646
|
};
|
|
9561
9647
|
}, []);
|
|
9562
|
-
|
|
9648
|
+
React58.useEffect(
|
|
9563
9649
|
function() {
|
|
9564
9650
|
const el = inputRef.current;
|
|
9565
9651
|
if (!el || !props.name || typeof DataTransfer === "undefined") return;
|
|
@@ -9619,7 +9705,7 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9619
9705
|
if (inputRef.current) inputRef.current.focus();
|
|
9620
9706
|
}
|
|
9621
9707
|
const error = props.error;
|
|
9622
|
-
return /* @__PURE__ */
|
|
9708
|
+
return /* @__PURE__ */ React58.createElement(
|
|
9623
9709
|
Field,
|
|
9624
9710
|
{
|
|
9625
9711
|
id,
|
|
@@ -9631,7 +9717,7 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9631
9717
|
disabled: props.disabled,
|
|
9632
9718
|
className: props.className
|
|
9633
9719
|
},
|
|
9634
|
-
/* @__PURE__ */
|
|
9720
|
+
/* @__PURE__ */ React58.createElement(
|
|
9635
9721
|
"div",
|
|
9636
9722
|
{
|
|
9637
9723
|
className: cx("aura-upload", over && "is-over", props.disabled && "is-disabled", error && "is-invalid"),
|
|
@@ -9652,9 +9738,9 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9652
9738
|
add(e.dataTransfer && e.dataTransfer.files);
|
|
9653
9739
|
}
|
|
9654
9740
|
},
|
|
9655
|
-
/* @__PURE__ */
|
|
9656
|
-
/* @__PURE__ */
|
|
9657
|
-
/* @__PURE__ */
|
|
9741
|
+
/* @__PURE__ */ React58.createElement(Icon, { name: /* @__PURE__ */ React58.createElement(IconCloudUpload, null), size: "lg", className: "aura-upload__icon" }),
|
|
9742
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-upload__text" }, t.dropFiles, " "),
|
|
9743
|
+
/* @__PURE__ */ React58.createElement(
|
|
9658
9744
|
"input",
|
|
9659
9745
|
{
|
|
9660
9746
|
ref: inputMerged,
|
|
@@ -9676,12 +9762,12 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9676
9762
|
}
|
|
9677
9763
|
}
|
|
9678
9764
|
),
|
|
9679
|
-
/* @__PURE__ */
|
|
9680
|
-
note ? /* @__PURE__ */
|
|
9765
|
+
/* @__PURE__ */ React58.createElement("span", { className: "aura-upload__browse", "aria-hidden": true }, props.multiple ? t.browse : t.browseOne),
|
|
9766
|
+
note ? /* @__PURE__ */ React58.createElement("span", { className: "aura-upload__note", id: id + "-note" }, note) : null
|
|
9681
9767
|
),
|
|
9682
|
-
items2.length ? /* @__PURE__ */
|
|
9768
|
+
items2.length ? /* @__PURE__ */ React58.createElement("ul", { className: "aura-upload__list", "aria-live": "polite" }, items2.map(function(it) {
|
|
9683
9769
|
const src = thumb(it);
|
|
9684
|
-
return /* @__PURE__ */
|
|
9770
|
+
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
9771
|
"span",
|
|
9686
9772
|
{
|
|
9687
9773
|
className: "aura-upload__bar",
|
|
@@ -9691,11 +9777,11 @@ var FileUpload = React57.forwardRef(function FileUpload2(props, ref) {
|
|
|
9691
9777
|
"aria-valuemax": 100,
|
|
9692
9778
|
"aria-valuenow": it.progress != null ? Math.round(it.progress) : void 0
|
|
9693
9779
|
},
|
|
9694
|
-
/* @__PURE__ */
|
|
9695
|
-
) : null), /* @__PURE__ */
|
|
9780
|
+
/* @__PURE__ */ React58.createElement("span", { style: { width: (it.progress || 0) + "%" } })
|
|
9781
|
+
) : null), /* @__PURE__ */ React58.createElement(
|
|
9696
9782
|
IconButton,
|
|
9697
9783
|
{
|
|
9698
|
-
icon: /* @__PURE__ */
|
|
9784
|
+
icon: /* @__PURE__ */ React58.createElement(IconX, null),
|
|
9699
9785
|
label: t.remove(it.name),
|
|
9700
9786
|
onClick: function() {
|
|
9701
9787
|
remove(it);
|
|
@@ -10011,9 +10097,9 @@ function createTheme(opts) {
|
|
|
10011
10097
|
}
|
|
10012
10098
|
|
|
10013
10099
|
// src/ThemeStyle.tsx
|
|
10014
|
-
var
|
|
10100
|
+
var React59 = __toESM(require("react"), 1);
|
|
10015
10101
|
function ThemeStyle(props) {
|
|
10016
|
-
const css =
|
|
10102
|
+
const css = React59.useMemo(
|
|
10017
10103
|
function() {
|
|
10018
10104
|
try {
|
|
10019
10105
|
return createTheme({
|
|
@@ -10030,11 +10116,11 @@ function ThemeStyle(props) {
|
|
|
10030
10116
|
[props.brand, props.signal, props.primary, props.name, props.selector]
|
|
10031
10117
|
);
|
|
10032
10118
|
if (css === null) return null;
|
|
10033
|
-
return /* @__PURE__ */
|
|
10119
|
+
return /* @__PURE__ */ React59.createElement("style", { "data-aura-theme": props.name || props.brand, dangerouslySetInnerHTML: { __html: css } });
|
|
10034
10120
|
}
|
|
10035
10121
|
|
|
10036
10122
|
// src/colorScheme.tsx
|
|
10037
|
-
var
|
|
10123
|
+
var React60 = __toESM(require("react"), 1);
|
|
10038
10124
|
|
|
10039
10125
|
// src/colorSchemeScript.ts
|
|
10040
10126
|
var DEFAULT_KEY = "aura-color-scheme";
|
|
@@ -10051,7 +10137,7 @@ function colorSchemeScript(options) {
|
|
|
10051
10137
|
|
|
10052
10138
|
// src/colorScheme.tsx
|
|
10053
10139
|
function ColorSchemeScript(props) {
|
|
10054
|
-
return /* @__PURE__ */
|
|
10140
|
+
return /* @__PURE__ */ React60.createElement(
|
|
10055
10141
|
"script",
|
|
10056
10142
|
{
|
|
10057
10143
|
"data-aura-color-scheme": "",
|
|
@@ -10076,7 +10162,7 @@ function apply(scheme) {
|
|
|
10076
10162
|
function useColorScheme(options) {
|
|
10077
10163
|
const key = options && options.storageKey || DEFAULT_KEY;
|
|
10078
10164
|
const fallback = options && options.defaultScheme || "system";
|
|
10079
|
-
const subscribe2 =
|
|
10165
|
+
const subscribe2 = React60.useCallback(
|
|
10080
10166
|
function(cb) {
|
|
10081
10167
|
const mq = window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
|
|
10082
10168
|
function onSystem() {
|
|
@@ -10098,7 +10184,7 @@ function useColorScheme(options) {
|
|
|
10098
10184
|
},
|
|
10099
10185
|
[fallback, key]
|
|
10100
10186
|
);
|
|
10101
|
-
const snapshot =
|
|
10187
|
+
const snapshot = React60.useSyncExternalStore(
|
|
10102
10188
|
subscribe2,
|
|
10103
10189
|
function() {
|
|
10104
10190
|
const s = readScheme(fallback);
|
|
@@ -10109,7 +10195,7 @@ function useColorScheme(options) {
|
|
|
10109
10195
|
}
|
|
10110
10196
|
);
|
|
10111
10197
|
const parts = snapshot.split("|");
|
|
10112
|
-
const setScheme =
|
|
10198
|
+
const setScheme = React60.useCallback(
|
|
10113
10199
|
function(next) {
|
|
10114
10200
|
if (!valid(next)) return;
|
|
10115
10201
|
try {
|
|
@@ -10128,14 +10214,14 @@ function ColorSchemeToggle(props) {
|
|
|
10128
10214
|
const cs = useColorScheme(props);
|
|
10129
10215
|
const names = { light: t.schemeLight, dark: t.schemeDark, system: t.schemeSystem };
|
|
10130
10216
|
const label = props.label || t.colorScheme;
|
|
10131
|
-
return /* @__PURE__ */
|
|
10217
|
+
return /* @__PURE__ */ React60.createElement(
|
|
10132
10218
|
DropdownMenu,
|
|
10133
10219
|
{
|
|
10134
10220
|
label,
|
|
10135
|
-
trigger: /* @__PURE__ */
|
|
10221
|
+
trigger: /* @__PURE__ */ React60.createElement(
|
|
10136
10222
|
IconButton,
|
|
10137
10223
|
{
|
|
10138
|
-
icon: cs.resolved === "dark" ? /* @__PURE__ */
|
|
10224
|
+
icon: cs.resolved === "dark" ? /* @__PURE__ */ React60.createElement(IconMoon, null) : /* @__PURE__ */ React60.createElement(IconSun, null),
|
|
10139
10225
|
label: label + ": " + names[cs.scheme]
|
|
10140
10226
|
}
|
|
10141
10227
|
),
|
|
@@ -10153,14 +10239,14 @@ function ColorSchemeToggle(props) {
|
|
|
10153
10239
|
}
|
|
10154
10240
|
|
|
10155
10241
|
// src/Badge.tsx
|
|
10156
|
-
var
|
|
10157
|
-
var Badge =
|
|
10242
|
+
var React61 = __toESM(require("react"), 1);
|
|
10243
|
+
var Badge = React61.forwardRef(function Badge2(props, ref) {
|
|
10158
10244
|
return badgeElement(props, ref);
|
|
10159
10245
|
});
|
|
10160
10246
|
|
|
10161
10247
|
// src/Progress.tsx
|
|
10162
|
-
var
|
|
10163
|
-
var Progress =
|
|
10248
|
+
var React62 = __toESM(require("react"), 1);
|
|
10249
|
+
var Progress = React62.forwardRef(function Progress2(props, ref) {
|
|
10164
10250
|
const t = useStrings();
|
|
10165
10251
|
const auto = uid(), id = props.id || auto;
|
|
10166
10252
|
const max = props.max || 100, det = props.value != null;
|
|
@@ -10170,7 +10256,7 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10170
10256
|
const keyed = !!props.legend && spct > 0;
|
|
10171
10257
|
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
10258
|
const shown = props.valueLabel != null ? props.valueLabel : det ? Math.round(pct) + "%" : null;
|
|
10173
|
-
return /* @__PURE__ */
|
|
10259
|
+
return /* @__PURE__ */ React62.createElement(
|
|
10174
10260
|
"div",
|
|
10175
10261
|
{
|
|
10176
10262
|
ref,
|
|
@@ -10181,8 +10267,8 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10181
10267
|
props.className
|
|
10182
10268
|
)
|
|
10183
10269
|
},
|
|
10184
|
-
props.label || props.showValue && shown ? /* @__PURE__ */
|
|
10185
|
-
/* @__PURE__ */
|
|
10270
|
+
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,
|
|
10271
|
+
/* @__PURE__ */ React62.createElement(
|
|
10186
10272
|
"div",
|
|
10187
10273
|
{
|
|
10188
10274
|
className: cx("aura-progress__track", !det && "is-indeterminate"),
|
|
@@ -10194,8 +10280,8 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10194
10280
|
"aria-valuenow": det ? props.value : void 0,
|
|
10195
10281
|
"aria-valuetext": det ? valueText : void 0
|
|
10196
10282
|
},
|
|
10197
|
-
/* @__PURE__ */
|
|
10198
|
-
sec ? /* @__PURE__ */
|
|
10283
|
+
/* @__PURE__ */ React62.createElement("span", { className: "aura-progress__bar", style: det ? { width: pct + "%" } : void 0 }),
|
|
10284
|
+
sec ? /* @__PURE__ */ React62.createElement(
|
|
10199
10285
|
"span",
|
|
10200
10286
|
{
|
|
10201
10287
|
className: "aura-progress__bar aura-progress__bar--reserved",
|
|
@@ -10203,20 +10289,20 @@ var Progress = React61.forwardRef(function Progress2(props, ref) {
|
|
|
10203
10289
|
}
|
|
10204
10290
|
) : null
|
|
10205
10291
|
),
|
|
10206
|
-
keyed ? /* @__PURE__ */
|
|
10207
|
-
props.hint ? /* @__PURE__ */
|
|
10292
|
+
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,
|
|
10293
|
+
props.hint ? /* @__PURE__ */ React62.createElement("p", { className: "aura-progress__hint" }, props.hint) : null
|
|
10208
10294
|
);
|
|
10209
10295
|
});
|
|
10210
10296
|
|
|
10211
10297
|
// src/Skeleton.tsx
|
|
10212
|
-
var
|
|
10213
|
-
var Skeleton =
|
|
10298
|
+
var React63 = __toESM(require("react"), 1);
|
|
10299
|
+
var Skeleton = React63.forwardRef(function Skeleton2(props, ref) {
|
|
10214
10300
|
const v = props.variant || "text";
|
|
10215
10301
|
if (v === "text" && (props.lines || 1) > 1) {
|
|
10216
10302
|
const n3 = props.lines, rows = [];
|
|
10217
10303
|
for (let i = 0; i < n3; i++)
|
|
10218
|
-
rows.push(/* @__PURE__ */
|
|
10219
|
-
return /* @__PURE__ */
|
|
10304
|
+
rows.push(/* @__PURE__ */ React63.createElement("span", { key: i, className: "aura-skel aura-skel--text", style: { width: i === n3 - 1 ? "60%" : "100%" } }));
|
|
10305
|
+
return /* @__PURE__ */ React63.createElement(
|
|
10220
10306
|
"span",
|
|
10221
10307
|
{
|
|
10222
10308
|
ref,
|
|
@@ -10234,17 +10320,17 @@ var Skeleton = React62.forwardRef(function Skeleton2(props, ref) {
|
|
|
10234
10320
|
if (v === "circle") {
|
|
10235
10321
|
style.width = style.height = props.size || props.width || 40;
|
|
10236
10322
|
}
|
|
10237
|
-
return /* @__PURE__ */
|
|
10323
|
+
return /* @__PURE__ */ React63.createElement("span", { ref, "aria-hidden": true, className: cx("aura-skel", "aura-skel--" + v, props.className), style });
|
|
10238
10324
|
});
|
|
10239
10325
|
|
|
10240
10326
|
// src/EmptyState.tsx
|
|
10241
|
-
var
|
|
10242
|
-
var EmptyState =
|
|
10327
|
+
var React64 = __toESM(require("react"), 1);
|
|
10328
|
+
var EmptyState = React64.forwardRef(function EmptyState2(props, ref) {
|
|
10243
10329
|
return emptyStateElement(props, ref);
|
|
10244
10330
|
});
|
|
10245
10331
|
|
|
10246
10332
|
// src/Pagination.tsx
|
|
10247
|
-
var
|
|
10333
|
+
var React65 = __toESM(require("react"), 1);
|
|
10248
10334
|
function pageList(page, count, sib) {
|
|
10249
10335
|
let out = [], lo = Math.max(2, page - sib), hi = Math.min(count - 1, page + sib);
|
|
10250
10336
|
if (page - sib <= 3) {
|
|
@@ -10264,7 +10350,7 @@ function pageList(page, count, sib) {
|
|
|
10264
10350
|
if (count > 1) out.push(count);
|
|
10265
10351
|
return out;
|
|
10266
10352
|
}
|
|
10267
|
-
var Pagination =
|
|
10353
|
+
var Pagination = React65.forwardRef(function Pagination2(props, ref) {
|
|
10268
10354
|
const t = useStrings();
|
|
10269
10355
|
useAutoTip();
|
|
10270
10356
|
const count = Math.max(1, props.pageCount || 1);
|
|
@@ -10284,7 +10370,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10284
10370
|
},
|
|
10285
10371
|
extra
|
|
10286
10372
|
);
|
|
10287
|
-
return link ? /* @__PURE__ */
|
|
10373
|
+
return link ? /* @__PURE__ */ React65.createElement(
|
|
10288
10374
|
Link,
|
|
10289
10375
|
{
|
|
10290
10376
|
href: link(p),
|
|
@@ -10297,7 +10383,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10297
10383
|
...common
|
|
10298
10384
|
},
|
|
10299
10385
|
label
|
|
10300
|
-
) : /* @__PURE__ */
|
|
10386
|
+
) : /* @__PURE__ */ React65.createElement(
|
|
10301
10387
|
"button",
|
|
10302
10388
|
{
|
|
10303
10389
|
type: "button",
|
|
@@ -10311,7 +10397,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10311
10397
|
}
|
|
10312
10398
|
function arrow(p, icon, label, rel, disabled) {
|
|
10313
10399
|
if (!link || disabled)
|
|
10314
|
-
return /* @__PURE__ */
|
|
10400
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10315
10401
|
IconButton,
|
|
10316
10402
|
{
|
|
10317
10403
|
icon,
|
|
@@ -10322,7 +10408,7 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10322
10408
|
}
|
|
10323
10409
|
}
|
|
10324
10410
|
);
|
|
10325
|
-
return /* @__PURE__ */
|
|
10411
|
+
return /* @__PURE__ */ React65.createElement(
|
|
10326
10412
|
Link,
|
|
10327
10413
|
{
|
|
10328
10414
|
href: link(p),
|
|
@@ -10337,17 +10423,17 @@ var Pagination = React64.forwardRef(function Pagination2(props, ref) {
|
|
|
10337
10423
|
}
|
|
10338
10424
|
}
|
|
10339
10425
|
},
|
|
10340
|
-
/* @__PURE__ */
|
|
10426
|
+
/* @__PURE__ */ React65.createElement(Icon, { name: icon, size: "sm" })
|
|
10341
10427
|
);
|
|
10342
10428
|
}
|
|
10343
|
-
return /* @__PURE__ */
|
|
10344
|
-
return typeof p === "number" ? /* @__PURE__ */
|
|
10345
|
-
})), /* @__PURE__ */
|
|
10429
|
+
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) {
|
|
10430
|
+
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");
|
|
10431
|
+
})), /* @__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
10432
|
});
|
|
10347
10433
|
|
|
10348
10434
|
// src/Accordion.tsx
|
|
10349
|
-
var
|
|
10350
|
-
var Accordion =
|
|
10435
|
+
var React66 = __toESM(require("react"), 1);
|
|
10436
|
+
var Accordion = React66.forwardRef(function Accordion2(props, ref) {
|
|
10351
10437
|
const auto = uid(), base = props.id || auto;
|
|
10352
10438
|
const multiple = props.type === "multiple";
|
|
10353
10439
|
const st = useMaybeControlled(
|
|
@@ -10385,9 +10471,9 @@ var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
|
10385
10471
|
n3.focus();
|
|
10386
10472
|
}
|
|
10387
10473
|
}
|
|
10388
|
-
return /* @__PURE__ */
|
|
10474
|
+
return /* @__PURE__ */ React66.createElement("div", { ref, className: cx("aura-accordion", props.className), onKeyDown: onKey }, items2.map(function(it) {
|
|
10389
10475
|
const on = open.indexOf(it.id) >= 0, bid = base + "-btn-" + it.id, pid = base + "-panel-" + it.id;
|
|
10390
|
-
return /* @__PURE__ */
|
|
10476
|
+
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
10477
|
"button",
|
|
10392
10478
|
{
|
|
10393
10479
|
type: "button",
|
|
@@ -10400,10 +10486,10 @@ var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
|
10400
10486
|
toggle(it.id);
|
|
10401
10487
|
}
|
|
10402
10488
|
},
|
|
10403
|
-
it.icon ? /* @__PURE__ */
|
|
10404
|
-
/* @__PURE__ */
|
|
10405
|
-
/* @__PURE__ */
|
|
10406
|
-
)), /* @__PURE__ */
|
|
10489
|
+
it.icon ? /* @__PURE__ */ React66.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
10490
|
+
/* @__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),
|
|
10491
|
+
/* @__PURE__ */ React66.createElement(Icon, { name: /* @__PURE__ */ React66.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
10492
|
+
)), /* @__PURE__ */ React66.createElement(
|
|
10407
10493
|
"div",
|
|
10408
10494
|
{
|
|
10409
10495
|
id: pid,
|
|
@@ -10418,7 +10504,7 @@ var Accordion = React65.forwardRef(function Accordion2(props, ref) {
|
|
|
10418
10504
|
});
|
|
10419
10505
|
|
|
10420
10506
|
// src/Popover.tsx
|
|
10421
|
-
var
|
|
10507
|
+
var React67 = __toESM(require("react"), 1);
|
|
10422
10508
|
var import_react_dom13 = require("react-dom");
|
|
10423
10509
|
function position(anchor, pop, placement) {
|
|
10424
10510
|
const r2 = anchor.getBoundingClientRect(), pw = pop.offsetWidth, ph = pop.scrollHeight, vw = window.innerWidth, vh = window.innerHeight, gap = 6;
|
|
@@ -10436,15 +10522,15 @@ function position(anchor, pop, placement) {
|
|
|
10436
10522
|
const left = align === "end" ? r2.right - pw : align === "center" ? r2.left + r2.width / 2 - pw / 2 : r2.left;
|
|
10437
10523
|
return { top: Math.max(8, top), left: Math.max(8, Math.min(left, vw - pw - 8)), side, maxHeight };
|
|
10438
10524
|
}
|
|
10439
|
-
var Popover =
|
|
10525
|
+
var Popover = React67.forwardRef(function Popover2(props, ref) {
|
|
10440
10526
|
const t = useStrings();
|
|
10441
10527
|
const density = useDensity();
|
|
10442
10528
|
const auto = uid(), id = props.id || auto;
|
|
10443
10529
|
const st = useMaybeControlled(props.open, !!props.defaultOpen, props.onOpenChange);
|
|
10444
10530
|
const open = !!st[0];
|
|
10445
|
-
const wrap =
|
|
10446
|
-
const pos =
|
|
10447
|
-
const inTree =
|
|
10531
|
+
const wrap = React67.useRef(null), pop = React67.useRef(null), popMerged = useMergedRef(ref, pop);
|
|
10532
|
+
const pos = React67.useState(null), mounted = useMounted();
|
|
10533
|
+
const inTree = React67.useRef(false);
|
|
10448
10534
|
function trigger() {
|
|
10449
10535
|
return wrap.current && (wrap.current.querySelector('button, [role="button"], a, input') || wrap.current.firstElementChild);
|
|
10450
10536
|
}
|
|
@@ -10471,7 +10557,7 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10471
10557
|
},
|
|
10472
10558
|
[open, mounted, props.placement]
|
|
10473
10559
|
);
|
|
10474
|
-
|
|
10560
|
+
React67.useEffect(
|
|
10475
10561
|
function() {
|
|
10476
10562
|
if (!open || !mounted) return;
|
|
10477
10563
|
if (props.autoFocus !== false && pop.current) {
|
|
@@ -10503,9 +10589,9 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10503
10589
|
},
|
|
10504
10590
|
[open, mounted]
|
|
10505
10591
|
);
|
|
10506
|
-
const child =
|
|
10592
|
+
const child = React67.Children.only(props.trigger);
|
|
10507
10593
|
const panel = open && mounted ? (0, import_react_dom13.createPortal)(
|
|
10508
|
-
/* @__PURE__ */
|
|
10594
|
+
/* @__PURE__ */ React67.createElement(
|
|
10509
10595
|
"div",
|
|
10510
10596
|
{
|
|
10511
10597
|
ref: popMerged,
|
|
@@ -10535,17 +10621,17 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10535
10621
|
} else trapTab(e, pop.current);
|
|
10536
10622
|
}
|
|
10537
10623
|
},
|
|
10538
|
-
props.title ? /* @__PURE__ */
|
|
10624
|
+
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
10625
|
IconButton,
|
|
10540
10626
|
{
|
|
10541
|
-
icon: /* @__PURE__ */
|
|
10627
|
+
icon: /* @__PURE__ */ React67.createElement(IconX, null),
|
|
10542
10628
|
label: t.close,
|
|
10543
10629
|
onClick: function() {
|
|
10544
10630
|
close(true);
|
|
10545
10631
|
}
|
|
10546
10632
|
}
|
|
10547
10633
|
)) : null,
|
|
10548
|
-
/* @__PURE__ */
|
|
10634
|
+
/* @__PURE__ */ React67.createElement("div", { className: "aura-popover__body" }, typeof props.children === "function" ? props.children({
|
|
10549
10635
|
close: function() {
|
|
10550
10636
|
close(true);
|
|
10551
10637
|
}
|
|
@@ -10553,7 +10639,7 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10553
10639
|
),
|
|
10554
10640
|
document.body
|
|
10555
10641
|
) : null;
|
|
10556
|
-
return /* @__PURE__ */
|
|
10642
|
+
return /* @__PURE__ */ React67.createElement("span", { ref: wrap, className: "aura-popover-anchor" }, React67.cloneElement(child, {
|
|
10557
10643
|
onClick: function(e) {
|
|
10558
10644
|
if (child.props.onClick) child.props.onClick(e);
|
|
10559
10645
|
st[1](!open);
|
|
@@ -10565,7 +10651,7 @@ var Popover = React66.forwardRef(function Popover2(props, ref) {
|
|
|
10565
10651
|
});
|
|
10566
10652
|
|
|
10567
10653
|
// src/NumberField.tsx
|
|
10568
|
-
var
|
|
10654
|
+
var React68 = __toESM(require("react"), 1);
|
|
10569
10655
|
function decimalsOf(n3) {
|
|
10570
10656
|
const s = String(n3);
|
|
10571
10657
|
const i = s.indexOf(".");
|
|
@@ -10578,7 +10664,7 @@ function parse(text2) {
|
|
|
10578
10664
|
if (!/^-?(\d+\.?\d*|\.\d+)$/.test(s)) return NaN;
|
|
10579
10665
|
return Number(s);
|
|
10580
10666
|
}
|
|
10581
|
-
var NumberField =
|
|
10667
|
+
var NumberField = React68.forwardRef(function NumberField2(props, ref) {
|
|
10582
10668
|
const t = useStrings();
|
|
10583
10669
|
const auto = uid(), id = props.id || auto;
|
|
10584
10670
|
const step = props.step || 1;
|
|
@@ -10589,7 +10675,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10589
10675
|
props.onChange
|
|
10590
10676
|
);
|
|
10591
10677
|
const value = st[0], setValue = st[1];
|
|
10592
|
-
const draftState =
|
|
10678
|
+
const draftState = React68.useState(null), draft = draftState[0], setDraft = draftState[1];
|
|
10593
10679
|
function fmt2(n3) {
|
|
10594
10680
|
if (n3 == null || isNaN(n3)) return "";
|
|
10595
10681
|
return n3.toLocaleString("en", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
@@ -10638,7 +10724,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10638
10724
|
};
|
|
10639
10725
|
const valueText = value == null ? void 0 : [affixText(props.prefix), fmt2(value), affixText(props.suffix)].join(" ").trim();
|
|
10640
10726
|
const stepper = props.stepper !== false && !props.readOnly;
|
|
10641
|
-
return /* @__PURE__ */
|
|
10727
|
+
return /* @__PURE__ */ React68.createElement(
|
|
10642
10728
|
Field,
|
|
10643
10729
|
{
|
|
10644
10730
|
id,
|
|
@@ -10650,7 +10736,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10650
10736
|
disabled: props.disabled,
|
|
10651
10737
|
className: cx(touchClass(props.touchHeight), props.className)
|
|
10652
10738
|
},
|
|
10653
|
-
/* @__PURE__ */
|
|
10739
|
+
/* @__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
10740
|
"input",
|
|
10655
10741
|
{
|
|
10656
10742
|
ref,
|
|
@@ -10697,7 +10783,7 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10697
10783
|
},
|
|
10698
10784
|
onKeyDown
|
|
10699
10785
|
}
|
|
10700
|
-
), props.suffix != null ? /* @__PURE__ */
|
|
10786
|
+
), 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
10787
|
"button",
|
|
10702
10788
|
{
|
|
10703
10789
|
type: "button",
|
|
@@ -10713,8 +10799,8 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10713
10799
|
nudge(-step);
|
|
10714
10800
|
}
|
|
10715
10801
|
},
|
|
10716
|
-
/* @__PURE__ */
|
|
10717
|
-
), /* @__PURE__ */
|
|
10802
|
+
/* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconMinus, null) })
|
|
10803
|
+
), /* @__PURE__ */ React68.createElement(
|
|
10718
10804
|
"button",
|
|
10719
10805
|
{
|
|
10720
10806
|
type: "button",
|
|
@@ -10730,14 +10816,14 @@ var NumberField = React67.forwardRef(function NumberField2(props, ref) {
|
|
|
10730
10816
|
nudge(step);
|
|
10731
10817
|
}
|
|
10732
10818
|
},
|
|
10733
|
-
/* @__PURE__ */
|
|
10819
|
+
/* @__PURE__ */ React68.createElement(Icon, { name: /* @__PURE__ */ React68.createElement(IconPlus, null) })
|
|
10734
10820
|
)) : null)
|
|
10735
10821
|
);
|
|
10736
10822
|
});
|
|
10737
10823
|
|
|
10738
10824
|
// src/Stepper.tsx
|
|
10739
|
-
var
|
|
10740
|
-
var Stepper =
|
|
10825
|
+
var React69 = __toESM(require("react"), 1);
|
|
10826
|
+
var Stepper = React69.forwardRef(function Stepper2(props, ref) {
|
|
10741
10827
|
const t = useStrings();
|
|
10742
10828
|
const idBase = uid();
|
|
10743
10829
|
const steps = props.steps || [];
|
|
@@ -10748,22 +10834,22 @@ var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
|
10748
10834
|
if (at < 0) at = 0;
|
|
10749
10835
|
const vertical = props.orientation === "vertical";
|
|
10750
10836
|
const cur2 = steps[at];
|
|
10751
|
-
return /* @__PURE__ */
|
|
10837
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10752
10838
|
"nav",
|
|
10753
10839
|
{
|
|
10754
10840
|
ref,
|
|
10755
10841
|
"aria-label": props.label,
|
|
10756
10842
|
className: cx("aura-stepper", vertical ? "aura-stepper--vertical" : "aura-stepper--horizontal", props.className)
|
|
10757
10843
|
},
|
|
10758
|
-
/* @__PURE__ */
|
|
10844
|
+
/* @__PURE__ */ React69.createElement("ol", { className: "aura-stepper__list" }, steps.map(function(s, i) {
|
|
10759
10845
|
const state = i < at ? "done" : i === at ? "current" : "upcoming";
|
|
10760
10846
|
const error = s.status === "error";
|
|
10761
|
-
const marker = /* @__PURE__ */
|
|
10847
|
+
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
10848
|
const note = error ? t.stepError : state === "done" ? t.stepDone : "";
|
|
10763
10849
|
const clickable = state === "done" && !!props.onStepClick;
|
|
10764
10850
|
const named = clickable && (typeof s.label === "string" || typeof s.label === "number") && String(s.label).trim() !== "";
|
|
10765
10851
|
const descId = idBase + "-step-" + i;
|
|
10766
|
-
const text2 = /* @__PURE__ */
|
|
10852
|
+
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
10853
|
"span",
|
|
10768
10854
|
{
|
|
10769
10855
|
className: "aura-stepper__desc",
|
|
@@ -10772,14 +10858,14 @@ var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
|
10772
10858
|
},
|
|
10773
10859
|
s.description
|
|
10774
10860
|
) : null);
|
|
10775
|
-
return /* @__PURE__ */
|
|
10861
|
+
return /* @__PURE__ */ React69.createElement(
|
|
10776
10862
|
"li",
|
|
10777
10863
|
{
|
|
10778
10864
|
key: s.id,
|
|
10779
10865
|
className: cx("aura-stepper__item", "is-" + state, error && "is-error"),
|
|
10780
10866
|
"aria-current": state === "current" ? "step" : void 0
|
|
10781
10867
|
},
|
|
10782
|
-
clickable ? /* @__PURE__ */
|
|
10868
|
+
clickable ? /* @__PURE__ */ React69.createElement(
|
|
10783
10869
|
"button",
|
|
10784
10870
|
{
|
|
10785
10871
|
type: "button",
|
|
@@ -10791,19 +10877,19 @@ var Stepper = React68.forwardRef(function Stepper2(props, ref) {
|
|
|
10791
10877
|
},
|
|
10792
10878
|
marker,
|
|
10793
10879
|
text2
|
|
10794
|
-
) : /* @__PURE__ */
|
|
10880
|
+
) : /* @__PURE__ */ React69.createElement("span", { className: "aura-stepper__step" }, marker, text2)
|
|
10795
10881
|
);
|
|
10796
10882
|
})),
|
|
10797
|
-
!vertical && cur2 ? /* @__PURE__ */
|
|
10883
|
+
!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
10884
|
);
|
|
10799
10885
|
});
|
|
10800
10886
|
|
|
10801
10887
|
// src/SegmentedControl.tsx
|
|
10802
|
-
var
|
|
10888
|
+
var React70 = __toESM(require("react"), 1);
|
|
10803
10889
|
function toOpt2(o) {
|
|
10804
10890
|
return typeof o === "object" ? o : { value: o, label: o };
|
|
10805
10891
|
}
|
|
10806
|
-
var SegmentedControl =
|
|
10892
|
+
var SegmentedControl = React70.forwardRef(
|
|
10807
10893
|
function SegmentedControl2(props, ref) {
|
|
10808
10894
|
const options = (props.options || []).map(toOpt2);
|
|
10809
10895
|
useAutoTip();
|
|
@@ -10817,7 +10903,7 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10817
10903
|
);
|
|
10818
10904
|
const value = st[0], setValue = st[1];
|
|
10819
10905
|
const auto = uid(), id = props.id || auto;
|
|
10820
|
-
const refs =
|
|
10906
|
+
const refs = React70.useRef([]);
|
|
10821
10907
|
const selIdx = options.findIndex(function(o) {
|
|
10822
10908
|
return o.value === value;
|
|
10823
10909
|
});
|
|
@@ -10850,7 +10936,7 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10850
10936
|
move(options.length, -1);
|
|
10851
10937
|
}
|
|
10852
10938
|
}
|
|
10853
|
-
return /* @__PURE__ */
|
|
10939
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10854
10940
|
"div",
|
|
10855
10941
|
{
|
|
10856
10942
|
ref,
|
|
@@ -10870,7 +10956,7 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10870
10956
|
options.map(function(o, i) {
|
|
10871
10957
|
const on = o.value === value;
|
|
10872
10958
|
const off = props.disabled || o.disabled;
|
|
10873
|
-
return /* @__PURE__ */
|
|
10959
|
+
return /* @__PURE__ */ React70.createElement(
|
|
10874
10960
|
"button",
|
|
10875
10961
|
{
|
|
10876
10962
|
key: o.value,
|
|
@@ -10892,8 +10978,8 @@ var SegmentedControl = React69.forwardRef(
|
|
|
10892
10978
|
onKeyDown(e, i);
|
|
10893
10979
|
}
|
|
10894
10980
|
},
|
|
10895
|
-
o.icon ? /* @__PURE__ */
|
|
10896
|
-
o.iconOnly ? null : /* @__PURE__ */
|
|
10981
|
+
o.icon ? /* @__PURE__ */ React70.createElement(Icon, { name: o.icon }) : null,
|
|
10982
|
+
o.iconOnly ? null : /* @__PURE__ */ React70.createElement("span", null, o.label)
|
|
10897
10983
|
);
|
|
10898
10984
|
})
|
|
10899
10985
|
);
|