@jirawatpyk/aura-react 5.25.0 → 5.27.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 +43 -2
- package/dist/aura.bundle.js +1979 -1731
- package/dist/cjs/index.cjs +1978 -1730
- package/dist/esm/Accordion.js +14 -2
- package/dist/esm/Checkbox.js +4 -2
- package/dist/esm/Combobox.js +3 -1
- package/dist/esm/Command.js +4 -2
- package/dist/esm/Container.js +14 -4
- package/dist/esm/DataTable.js +18 -1
- package/dist/esm/DatePicker.js +2 -0
- package/dist/esm/FilterDateRange.js +157 -0
- package/dist/esm/RadioGroup.js +5 -2
- package/dist/esm/Table.js +41 -5
- package/dist/esm/dates.js +14 -0
- package/dist/esm/index.js +2 -0
- package/dist/index.d.cts +86 -4
- package/dist/index.d.ts +86 -4
- package/dist/server/index.cjs +31 -5
- package/dist/server/index.d.cts +18 -0
- package/dist/server/index.d.ts +18 -0
- package/dist/server/index.js +31 -5
- package/dist/styles.css +64 -4
- package/dist/styles.layer.css +64 -4
- package/package.json +1 -1
package/dist/esm/Accordion.js
CHANGED
|
@@ -49,6 +49,8 @@ const Accordion = React.forwardRef(function Accordion2(props, ref) {
|
|
|
49
49
|
{
|
|
50
50
|
type: "button",
|
|
51
51
|
id: bid,
|
|
52
|
+
"aria-labelledby": it.description ? bid + "-title" : void 0,
|
|
53
|
+
"aria-describedby": it.description ? bid + "-desc" : void 0,
|
|
52
54
|
"aria-expanded": on,
|
|
53
55
|
"aria-controls": pid,
|
|
54
56
|
disabled: it.disabled,
|
|
@@ -57,9 +59,19 @@ const Accordion = React.forwardRef(function Accordion2(props, ref) {
|
|
|
57
59
|
}
|
|
58
60
|
},
|
|
59
61
|
it.icon ? /* @__PURE__ */ React.createElement(Icon, { name: it.icon, className: "aura-accordion__lead" }) : null,
|
|
60
|
-
/* @__PURE__ */ React.createElement("span", { className: "aura-accordion__title" }, it.title, it.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-accordion__desc" }, it.description) : null),
|
|
62
|
+
/* @__PURE__ */ React.createElement("span", { className: "aura-accordion__title" }, /* @__PURE__ */ React.createElement("span", { id: it.description ? bid + "-title" : void 0 }, it.title), it.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-accordion__desc", id: bid + "-desc" }, it.description) : null),
|
|
61
63
|
/* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconChevronDown, null), className: "aura-accordion__chevron" })
|
|
62
|
-
)), /* @__PURE__ */ React.createElement(
|
|
64
|
+
)), /* @__PURE__ */ React.createElement(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
id: pid,
|
|
68
|
+
role: "region",
|
|
69
|
+
"aria-labelledby": it.description ? bid + "-title" : bid,
|
|
70
|
+
className: "aura-accordion__panel",
|
|
71
|
+
hidden: !on
|
|
72
|
+
},
|
|
73
|
+
it.content
|
|
74
|
+
));
|
|
63
75
|
}));
|
|
64
76
|
});
|
|
65
77
|
export {
|
package/dist/esm/Checkbox.js
CHANGED
|
@@ -33,6 +33,7 @@ const Checkbox = React.forwardRef(function Checkbox2(props, ref) {
|
|
|
33
33
|
"Checkbox `label` is only the accessible name: it is not shown. In 6.0 it will be shown beside the box, like Switch and TextField. For visible text now pass it as children; for a bare box (a table row) add `hideLabel`."
|
|
34
34
|
);
|
|
35
35
|
const descId = props.description ? (props.id || auto) + "-desc" : void 0;
|
|
36
|
+
const labelId = labelled && descId && !props["aria-label"] && !props["aria-labelledby"] ? (props.id || auto) + "-label" : void 0;
|
|
36
37
|
const ha = props.hitArea;
|
|
37
38
|
const hit = !labelled && ha && ha !== "box" ? ha === "target" ? { x: 4, y: 4 } : ha : null;
|
|
38
39
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -61,7 +62,8 @@ const Checkbox = React.forwardRef(function Checkbox2(props, ref) {
|
|
|
61
62
|
tabIndex: props.tabIndex,
|
|
62
63
|
disabled: props.disabled,
|
|
63
64
|
"aria-describedby": cx(props["aria-describedby"], descId) || void 0,
|
|
64
|
-
"aria-label": labelled ? void 0 : props.label,
|
|
65
|
+
"aria-label": (labelled ? void 0 : props.label) || props["aria-label"] || void 0,
|
|
66
|
+
"aria-labelledby": labelId || props["aria-labelledby"],
|
|
65
67
|
onChange: function(e) {
|
|
66
68
|
st[1](e.target.checked);
|
|
67
69
|
}
|
|
@@ -69,7 +71,7 @@ const Checkbox = React.forwardRef(function Checkbox2(props, ref) {
|
|
|
69
71
|
),
|
|
70
72
|
/* @__PURE__ */ React.createElement("span", { className: "aura-check__box", "aria-hidden": true }, props.indeterminate ? /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconMinus, null), size: 12, strokeWidth: 3 }) : on ? /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconCheck, null), size: 12, strokeWidth: 3 }) : null),
|
|
71
73
|
!labelled && props.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-sr-only", id: descId }, props.description) : null,
|
|
72
|
-
labelled ? /* @__PURE__ */ React.createElement("span", { className: "aura-check__text" }, /* @__PURE__ */ React.createElement("span", { className: "aura-check__label" }, text), props.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-check__desc", id: descId }, props.description) : null) : null
|
|
74
|
+
labelled ? /* @__PURE__ */ React.createElement("span", { className: "aura-check__text" }, /* @__PURE__ */ React.createElement("span", { className: "aura-check__label", id: labelId }, text), props.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-check__desc", id: descId }, props.description) : null) : null
|
|
73
75
|
);
|
|
74
76
|
});
|
|
75
77
|
export {
|
package/dist/esm/Combobox.js
CHANGED
|
@@ -234,6 +234,8 @@ const Combobox = React.forwardRef(
|
|
|
234
234
|
id: optId(i),
|
|
235
235
|
role: "option",
|
|
236
236
|
"data-idx": i,
|
|
237
|
+
"aria-labelledby": o.description ? optId(i) + "-label" : void 0,
|
|
238
|
+
"aria-describedby": o.description ? optId(i) + "-desc" : void 0,
|
|
237
239
|
"aria-selected": isSel,
|
|
238
240
|
"aria-disabled": blocked || void 0,
|
|
239
241
|
className: cx(
|
|
@@ -253,7 +255,7 @@ const Combobox = React.forwardRef(
|
|
|
253
255
|
}
|
|
254
256
|
},
|
|
255
257
|
o.icon ? /* @__PURE__ */ React.createElement(Icon, { name: o.icon }) : null,
|
|
256
|
-
/* @__PURE__ */ React.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React.createElement("span", { className: "aura-combo__label" }, o.label), o.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-combo__desc" }, o.description) : null),
|
|
258
|
+
/* @__PURE__ */ React.createElement("span", { className: "aura-combo__text" }, /* @__PURE__ */ React.createElement("span", { className: "aura-combo__label", id: o.description ? optId(i) + "-label" : void 0 }, o.label), o.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-combo__desc", id: optId(i) + "-desc" }, o.description) : null),
|
|
257
259
|
isSel ? /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconCheck, null), className: "aura-combo__check" }) : null
|
|
258
260
|
);
|
|
259
261
|
}
|
package/dist/esm/Command.js
CHANGED
|
@@ -202,6 +202,8 @@ function Command(props) {
|
|
|
202
202
|
key: it.id,
|
|
203
203
|
id: optId(n),
|
|
204
204
|
role: "option",
|
|
205
|
+
"aria-labelledby": it.description ? optId(n) + "-label" + (it.shortcut ? " " + optId(n) + "-kbd" : "") : void 0,
|
|
206
|
+
"aria-describedby": it.description ? optId(n) + "-desc" : void 0,
|
|
205
207
|
"aria-selected": n === active,
|
|
206
208
|
"aria-disabled": it.disabled || void 0,
|
|
207
209
|
className: cx(
|
|
@@ -220,8 +222,8 @@ function Command(props) {
|
|
|
220
222
|
}
|
|
221
223
|
},
|
|
222
224
|
it.icon ? /* @__PURE__ */ React.createElement(Icon, { name: it.icon }) : null,
|
|
223
|
-
/* @__PURE__ */ React.createElement("span", { className: "aura-command__text" }, /* @__PURE__ */ React.createElement("span", { className: "aura-command__label" }, it.label), it.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-command__desc" }, it.description) : null),
|
|
224
|
-
it.shortcut ? /* @__PURE__ */ React.createElement("kbd", { className: "aura-command__kbd" }, it.shortcut) : null
|
|
225
|
+
/* @__PURE__ */ React.createElement("span", { className: "aura-command__text" }, /* @__PURE__ */ React.createElement("span", { className: "aura-command__label", id: it.description ? optId(n) + "-label" : void 0 }, it.label), it.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-command__desc", id: optId(n) + "-desc" }, it.description) : null),
|
|
226
|
+
it.shortcut ? /* @__PURE__ */ React.createElement("kbd", { className: "aura-command__kbd", id: it.description ? optId(n) + "-kbd" : void 0 }, it.shortcut) : null
|
|
225
227
|
);
|
|
226
228
|
})
|
|
227
229
|
);
|
package/dist/esm/Container.js
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { cx } from "./
|
|
3
|
+
import { cx } from "./classes.js";
|
|
4
4
|
const h = React.createElement;
|
|
5
5
|
const Container = React.forwardRef(function Container2(props, ref) {
|
|
6
|
+
const attrs = {};
|
|
7
|
+
Object.keys(props).forEach(function(k) {
|
|
8
|
+
if (k === "id" || k === "lang" || k === "dir" || /^(aria|data)-/.test(k))
|
|
9
|
+
attrs[k] = props[k];
|
|
10
|
+
});
|
|
6
11
|
return h(
|
|
7
12
|
props.as || "div",
|
|
8
|
-
{
|
|
13
|
+
Object.assign(attrs, {
|
|
9
14
|
ref,
|
|
10
|
-
className: cx(
|
|
15
|
+
className: cx(
|
|
16
|
+
"aura-container",
|
|
17
|
+
props.size === "narrow" && "is-narrow",
|
|
18
|
+
props.align === "start" && "is-start",
|
|
19
|
+
props.className
|
|
20
|
+
),
|
|
11
21
|
style: props.style
|
|
12
|
-
},
|
|
22
|
+
}),
|
|
13
23
|
props.children
|
|
14
24
|
);
|
|
15
25
|
});
|
package/dist/esm/DataTable.js
CHANGED
|
@@ -1318,6 +1318,11 @@ const DataTableImpl = React.forwardRef(function DataTable(props, ref) {
|
|
|
1318
1318
|
"data-density": props.density,
|
|
1319
1319
|
className: cx(
|
|
1320
1320
|
"aura-table",
|
|
1321
|
+
/* 5.26 (Chamber-OS 127): bleed and bordered={false}; the outermost element carries aura-bleed. */
|
|
1322
|
+
props.bleed && "aura-bleed-frame",
|
|
1323
|
+
props.bleed && !levels.length && "aura-bleed",
|
|
1324
|
+
props.bleed && props.bleedEnd && !levels.length && "aura-bleed-end",
|
|
1325
|
+
props.bordered === false && "aura-table--borderless",
|
|
1321
1326
|
stacked && "aura-table--stacked",
|
|
1322
1327
|
noCardSel && "aura-table--cards-nosel",
|
|
1323
1328
|
scrolledX[0] && "is-scrolled-x",
|
|
@@ -1415,7 +1420,19 @@ const DataTableImpl = React.forwardRef(function DataTable(props, ref) {
|
|
|
1415
1420
|
out
|
|
1416
1421
|
);
|
|
1417
1422
|
}
|
|
1418
|
-
return /* @__PURE__ */ React.createElement(
|
|
1423
|
+
return /* @__PURE__ */ React.createElement(
|
|
1424
|
+
"div",
|
|
1425
|
+
{
|
|
1426
|
+
ref,
|
|
1427
|
+
className: cx(
|
|
1428
|
+
"aura-table-box",
|
|
1429
|
+
props.bleed && "aura-bleed",
|
|
1430
|
+
props.bleed && props.bleedEnd && "aura-bleed-end",
|
|
1431
|
+
props.className
|
|
1432
|
+
)
|
|
1433
|
+
},
|
|
1434
|
+
out
|
|
1435
|
+
);
|
|
1419
1436
|
});
|
|
1420
1437
|
const DataTable2 = DataTableImpl;
|
|
1421
1438
|
export {
|
package/dist/esm/DatePicker.js
CHANGED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { Calendar, allowedDate, useCalendarPopover } from "./DatePicker.js";
|
|
5
|
+
import { Button } from "./Button.js";
|
|
6
|
+
import { Icon } from "./Icon.js";
|
|
7
|
+
import { IconChevronDown } from "./icons.js";
|
|
8
|
+
import { cx, trapTab, uid, useMaybeControlled, useMergedRef } from "./internal.js";
|
|
9
|
+
import { useAuraLocale } from "./locale.js";
|
|
10
|
+
import { dateText, defaultCalendar, formatDateRange } from "./dates.js";
|
|
11
|
+
const NONE = { start: null, end: null };
|
|
12
|
+
const FilterDateRange = React.forwardRef(
|
|
13
|
+
function FilterDateRange2(props, ref) {
|
|
14
|
+
const auto = uid(), id = props.id || auto, dialogId = id + "-cal";
|
|
15
|
+
const ctx = useAuraLocale(), locale = props.locale || ctx.locale || "en", calendar = props.calendar || ctx.calendar || defaultCalendar(locale), dt = dateText(locale);
|
|
16
|
+
const st = useMaybeControlled(props.value, props.defaultValue || NONE, props.onChange);
|
|
17
|
+
const raw = st[0] || NONE;
|
|
18
|
+
const v = raw.start && raw.end ? raw.start <= raw.end ? raw : { start: raw.end, end: raw.start } : NONE;
|
|
19
|
+
const draft = React.useState(null);
|
|
20
|
+
const boxRef = React.useRef(null), faceRef = React.useRef(null);
|
|
21
|
+
const pop = useCalendarPopover(boxRef);
|
|
22
|
+
const anyLabel = props.anyLabel || dt.anyTime;
|
|
23
|
+
const value = v.start && v.end ? formatDateRange(v.start, v.end, { locale, calendar }) : anyLabel;
|
|
24
|
+
const setFace = useMergedRef(ref, faceRef);
|
|
25
|
+
const limits = {
|
|
26
|
+
min: props.min,
|
|
27
|
+
max: props.max,
|
|
28
|
+
today: props.today,
|
|
29
|
+
timeZone: props.timeZone || ctx.timeZone,
|
|
30
|
+
isDateDisabled: props.isDateDisabled
|
|
31
|
+
};
|
|
32
|
+
function close() {
|
|
33
|
+
pop.setOpen(false);
|
|
34
|
+
draft[1](null);
|
|
35
|
+
if (faceRef.current) faceRef.current.focus();
|
|
36
|
+
}
|
|
37
|
+
function choose(r) {
|
|
38
|
+
if (r.start !== raw.start || r.end !== raw.end) st[1](r);
|
|
39
|
+
close();
|
|
40
|
+
}
|
|
41
|
+
function pick(iso) {
|
|
42
|
+
if (!iso) return;
|
|
43
|
+
if (!draft[0]) {
|
|
44
|
+
draft[1](iso);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const a = draft[0];
|
|
48
|
+
choose(a <= iso ? { start: a, end: iso } : { start: iso, end: a });
|
|
49
|
+
}
|
|
50
|
+
const isAny = !v.start || !v.end;
|
|
51
|
+
const attrs = {};
|
|
52
|
+
Object.keys(props).forEach(function(k) {
|
|
53
|
+
if (k === "style" || /^(aria|data)-/.test(k) && k !== "aria-label")
|
|
54
|
+
attrs[k] = props[k];
|
|
55
|
+
});
|
|
56
|
+
const presetBtn = function(label, r, on, key) {
|
|
57
|
+
return /* @__PURE__ */ React.createElement(
|
|
58
|
+
Button,
|
|
59
|
+
{
|
|
60
|
+
key,
|
|
61
|
+
size: "sm",
|
|
62
|
+
variant: "ghost",
|
|
63
|
+
touchHeight: true,
|
|
64
|
+
disabled: !!r.start && !!r.end && !(allowedDate(r.start, limits) && allowedDate(r.end, limits)),
|
|
65
|
+
className: cx("aura-filterdate__preset", on && "is-selected"),
|
|
66
|
+
"aria-pressed": on,
|
|
67
|
+
onClick: function() {
|
|
68
|
+
choose(r);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
label
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
const cal = pop.open && pop.mounted && pop.pos ? createPortal(
|
|
75
|
+
/* @__PURE__ */ React.createElement(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
ref: pop.popRef,
|
|
79
|
+
id: dialogId,
|
|
80
|
+
role: "dialog",
|
|
81
|
+
"aria-modal": false,
|
|
82
|
+
"aria-label": props.label,
|
|
83
|
+
className: "aura-cal__popover aura-filterdate__pop",
|
|
84
|
+
style: Object.assign({}, pop.pos, {
|
|
85
|
+
maxHeight: window.innerHeight - (pop.pos.top != null ? pop.pos.top : pop.pos.bottom) - 8
|
|
86
|
+
}),
|
|
87
|
+
onKeyDown: function(e) {
|
|
88
|
+
if (e.key === "Escape") {
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
close();
|
|
91
|
+
} else trapTab(e, pop.popRef.current);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
/* @__PURE__ */ React.createElement("div", { className: "aura-filterdate__presets" }, presetBtn(anyLabel, NONE, isAny, "__any"), (props.presets || []).map(function(p, i) {
|
|
95
|
+
return presetBtn(
|
|
96
|
+
p.label,
|
|
97
|
+
p.range,
|
|
98
|
+
!isAny && p.range.start === v.start && p.range.end === v.end,
|
|
99
|
+
"p" + i
|
|
100
|
+
);
|
|
101
|
+
})),
|
|
102
|
+
/* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("p", { className: "aura-cal__hint", "aria-live": "polite" }, draft[0] ? dt.chooseEnd : dt.chooseStart), /* @__PURE__ */ React.createElement(
|
|
103
|
+
Calendar,
|
|
104
|
+
{
|
|
105
|
+
range: true,
|
|
106
|
+
locale,
|
|
107
|
+
calendar,
|
|
108
|
+
weekStartsOn: props.weekStartsOn,
|
|
109
|
+
min: props.min,
|
|
110
|
+
max: props.max,
|
|
111
|
+
timeZone: props.timeZone,
|
|
112
|
+
today: props.today,
|
|
113
|
+
isDateDisabled: props.isDateDisabled,
|
|
114
|
+
start: draft[0] || v.start,
|
|
115
|
+
end: draft[0] ? null : v.end,
|
|
116
|
+
focus: draft[0] || v.start,
|
|
117
|
+
footer: false,
|
|
118
|
+
onSelect: pick
|
|
119
|
+
}
|
|
120
|
+
))
|
|
121
|
+
),
|
|
122
|
+
document.body
|
|
123
|
+
) : null;
|
|
124
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
ref: boxRef,
|
|
128
|
+
className: cx("aura-filterselect", pop.open && "is-open", props.disabled && "is-disabled", props.className)
|
|
129
|
+
},
|
|
130
|
+
/* @__PURE__ */ React.createElement(
|
|
131
|
+
"button",
|
|
132
|
+
{
|
|
133
|
+
...attrs,
|
|
134
|
+
ref: setFace,
|
|
135
|
+
id,
|
|
136
|
+
type: "button",
|
|
137
|
+
className: "aura-filterselect__face",
|
|
138
|
+
disabled: props.disabled,
|
|
139
|
+
"aria-label": props["aria-label"] || props.label + ": " + value,
|
|
140
|
+
"aria-haspopup": "dialog",
|
|
141
|
+
"aria-expanded": pop.open,
|
|
142
|
+
"aria-controls": pop.open ? dialogId : void 0,
|
|
143
|
+
onClick: function() {
|
|
144
|
+
pop.setOpen(!pop.open);
|
|
145
|
+
draft[1](null);
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
/* @__PURE__ */ React.createElement("span", { className: "aura-filterselect__name" }, props.label),
|
|
149
|
+
/* @__PURE__ */ React.createElement("span", { className: "aura-filterselect__value" }, value),
|
|
150
|
+
/* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconChevronDown, null), className: "aura-filterselect__chevron" })
|
|
151
|
+
)
|
|
152
|
+
), cal);
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
export {
|
|
156
|
+
FilterDateRange
|
|
157
|
+
};
|
package/dist/esm/RadioGroup.js
CHANGED
|
@@ -34,8 +34,9 @@ const RadioGroup = React.forwardRef(function RadioGroup2(props, ref) {
|
|
|
34
34
|
disabled: props.disabled
|
|
35
35
|
},
|
|
36
36
|
props.label ? /* @__PURE__ */ React.createElement("legend", { className: "aura-field__label" }, props.label, props.required ? /* @__PURE__ */ React.createElement("span", { className: "aura-field__req", "aria-hidden": true }, " *") : null) : null,
|
|
37
|
-
/* @__PURE__ */ React.createElement("div", { className: cx("aura-radio-group__list", props.orientation === "horizontal" && "is-horizontal") }, (props.options || []).map(function(o) {
|
|
37
|
+
/* @__PURE__ */ React.createElement("div", { className: cx("aura-radio-group__list", props.orientation === "horizontal" && "is-horizontal") }, (props.options || []).map(function(o, i) {
|
|
38
38
|
const v = typeof o === "object" ? o : { value: o, label: o };
|
|
39
|
+
const oid = v.description ? id + "-opt-" + i : "";
|
|
39
40
|
return /* @__PURE__ */ React.createElement("label", { key: v.value, className: cx("aura-choice", v.disabled && "is-disabled") }, /* @__PURE__ */ React.createElement(
|
|
40
41
|
"input",
|
|
41
42
|
{
|
|
@@ -45,12 +46,14 @@ const RadioGroup = React.forwardRef(function RadioGroup2(props, ref) {
|
|
|
45
46
|
value: v.value,
|
|
46
47
|
disabled: v.disabled,
|
|
47
48
|
required: props.required || void 0,
|
|
49
|
+
"aria-labelledby": oid ? oid + "-label" : void 0,
|
|
50
|
+
"aria-describedby": oid ? oid + "-desc" : void 0,
|
|
48
51
|
checked: st[0] === v.value,
|
|
49
52
|
onChange: function() {
|
|
50
53
|
st[1](v.value);
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
|
-
), /* @__PURE__ */ React.createElement("span", { className: "aura-choice__text" }, /* @__PURE__ */ React.createElement("span", { className: "aura-choice__label" }, v.label), v.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-choice__desc" }, v.description) : null));
|
|
56
|
+
), /* @__PURE__ */ React.createElement("span", { className: "aura-choice__text" }, /* @__PURE__ */ React.createElement("span", { className: "aura-choice__label", id: oid ? oid + "-label" : void 0 }, v.label), v.description ? /* @__PURE__ */ React.createElement("span", { className: "aura-choice__desc", id: oid + "-desc" }, v.description) : null));
|
|
54
57
|
})),
|
|
55
58
|
props.error ? /* @__PURE__ */ React.createElement("p", { className: "aura-field__error", id: id + "-error" }, /* @__PURE__ */ React.createElement(Icon, { name: /* @__PURE__ */ React.createElement(IconCircleAlert, null), size: 14 }), props.error) : props.hint ? /* @__PURE__ */ React.createElement("p", { className: "aura-field__hint", id: id + "-hint" }, props.hint) : null
|
|
56
59
|
);
|
package/dist/esm/Table.js
CHANGED
|
@@ -55,6 +55,10 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
55
55
|
stackBelow,
|
|
56
56
|
align,
|
|
57
57
|
bordered,
|
|
58
|
+
bleed,
|
|
59
|
+
bleedEnd,
|
|
60
|
+
stickyHeader,
|
|
61
|
+
maxHeight,
|
|
58
62
|
stackStyle,
|
|
59
63
|
rowHeight,
|
|
60
64
|
className,
|
|
@@ -62,6 +66,11 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
62
66
|
...rest
|
|
63
67
|
} = props;
|
|
64
68
|
const cards = !!stackBelow && stackStyle === "cards";
|
|
69
|
+
if (maxHeight != null && caption == null && !rest["aria-label"] && !rest["aria-labelledby"])
|
|
70
|
+
devWarnOnce(
|
|
71
|
+
"tbl-max-name",
|
|
72
|
+
"Table maxHeight: the box scrolls, so keyboard users get it as a focusable region \u2014 give the table a `caption` (captionHidden keeps it for screen readers) or an `aria-label` to name it."
|
|
73
|
+
);
|
|
65
74
|
const labels = stackBelow ? headerLabels(children) : null;
|
|
66
75
|
if (labels && !labels.length)
|
|
67
76
|
devWarnOnce(
|
|
@@ -73,15 +82,19 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
73
82
|
const capId = uid();
|
|
74
83
|
const wrap = React.useRef(null);
|
|
75
84
|
const sc = React.useState(false), scrolls = sc[0];
|
|
85
|
+
const wide = React.useState(false);
|
|
76
86
|
useIsoLayoutEffect(function() {
|
|
77
87
|
const el = wrap.current;
|
|
78
88
|
if (!el || typeof ResizeObserver === "undefined") return;
|
|
79
89
|
function check() {
|
|
80
|
-
|
|
90
|
+
const sideways = el.scrollWidth > el.clientWidth + 1;
|
|
91
|
+
wide[1](sideways);
|
|
92
|
+
sc[1](sideways || el.scrollHeight > el.clientHeight + 1);
|
|
81
93
|
}
|
|
82
94
|
check();
|
|
83
95
|
const ro = new ResizeObserver(check);
|
|
84
96
|
ro.observe(el);
|
|
97
|
+
if (el.firstElementChild) ro.observe(el.firstElementChild);
|
|
85
98
|
return function() {
|
|
86
99
|
ro.disconnect();
|
|
87
100
|
};
|
|
@@ -90,11 +103,24 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
90
103
|
"div",
|
|
91
104
|
{
|
|
92
105
|
ref: wrap,
|
|
93
|
-
className: cx(
|
|
106
|
+
className: cx(
|
|
107
|
+
"aura-tbl-wrap",
|
|
108
|
+
stackBelow && "is-stackable",
|
|
109
|
+
bordered === false && "is-flush",
|
|
110
|
+
/* 5.26 (Chamber-OS 127): the frame that bleeds; the outermost element carries aura-bleed. */
|
|
111
|
+
bleed && "aura-bleed-frame",
|
|
112
|
+
bleed && !cards && "aura-bleed",
|
|
113
|
+
bleed && bleedEnd && !cards && "aura-bleed-end",
|
|
114
|
+
/* 5.26 (Chamber-OS 129): stickyHeader pins to the page, or inside the box when it has a maxHeight. */
|
|
115
|
+
stickyHeader && (maxHeight != null ? "is-sticky-box" : "is-sticky-page"),
|
|
116
|
+
maxHeight != null && "has-max",
|
|
117
|
+
wide[0] && "is-wide"
|
|
118
|
+
),
|
|
119
|
+
style: maxHeight != null ? { maxHeight: typeof maxHeight === "number" ? maxHeight + "px" : maxHeight } : void 0,
|
|
94
120
|
"data-density": density || pageDensity,
|
|
95
121
|
tabIndex: scrolls ? 0 : void 0,
|
|
96
|
-
role: scrolls && (caption != null || rest["aria-label"]) ? "region" : void 0,
|
|
97
|
-
"aria-labelledby": scrolls
|
|
122
|
+
role: scrolls && (caption != null || rest["aria-label"] || rest["aria-labelledby"]) ? "region" : void 0,
|
|
123
|
+
"aria-labelledby": scrolls ? caption != null ? capId : rest["aria-labelledby"] : void 0,
|
|
98
124
|
"aria-label": scrolls && caption == null ? rest["aria-label"] : void 0
|
|
99
125
|
},
|
|
100
126
|
/* @__PURE__ */ React.createElement(
|
|
@@ -117,7 +143,17 @@ const Table = React.forwardRef(function Table2(props, ref) {
|
|
|
117
143
|
labels ? /* @__PURE__ */ React.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
118
144
|
)
|
|
119
145
|
);
|
|
120
|
-
return cards ? /* @__PURE__ */ React.createElement(
|
|
146
|
+
return cards ? /* @__PURE__ */ React.createElement(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
className: cx(
|
|
150
|
+
"aura-tbl-cards aura-tbl-cards--" + stackBelow,
|
|
151
|
+
bleed && "aura-bleed",
|
|
152
|
+
bleed && bleedEnd && "aura-bleed-end"
|
|
153
|
+
)
|
|
154
|
+
},
|
|
155
|
+
table
|
|
156
|
+
) : table;
|
|
121
157
|
});
|
|
122
158
|
function section(tag, cls) {
|
|
123
159
|
const C = React.forwardRef(function TableSection(props, ref) {
|
package/dist/esm/dates.js
CHANGED
|
@@ -56,6 +56,7 @@ const DATE_TEXT = {
|
|
|
56
56
|
clearDates: "\u0E25\u0E49\u0E32\u0E07\u0E0A\u0E48\u0E27\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
|
|
57
57
|
chooseStart: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
|
|
58
58
|
chooseEnd: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14",
|
|
59
|
+
anyTime: "\u0E17\u0E38\u0E01\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32",
|
|
59
60
|
dateUnavailable: "\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E19\u0E35\u0E49\u0E44\u0E21\u0E48\u0E44\u0E14\u0E49 \u0E25\u0E2D\u0E07\u0E40\u0E1B\u0E34\u0E14\u0E1B\u0E0F\u0E34\u0E17\u0E34\u0E19\u0E14\u0E39\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E14\u0E49"
|
|
60
61
|
},
|
|
61
62
|
en: {
|
|
@@ -74,6 +75,7 @@ const DATE_TEXT = {
|
|
|
74
75
|
clearDates: "Clear dates",
|
|
75
76
|
chooseStart: "Choose the start date",
|
|
76
77
|
chooseEnd: "Choose the end date",
|
|
78
|
+
anyTime: "Any time",
|
|
77
79
|
dateUnavailable: "That date can't be chosen. Open the calendar to see the dates you can pick."
|
|
78
80
|
},
|
|
79
81
|
sv: {
|
|
@@ -92,6 +94,7 @@ const DATE_TEXT = {
|
|
|
92
94
|
clearDates: "Rensa datumen",
|
|
93
95
|
chooseStart: "V\xE4lj startdatum",
|
|
94
96
|
chooseEnd: "V\xE4lj slutdatum",
|
|
97
|
+
anyTime: "N\xE4r som helst",
|
|
95
98
|
dateUnavailable: "Det datumet g\xE5r inte att v\xE4lja. \xD6ppna kalendern f\xF6r att se vilka datum som g\xE5r."
|
|
96
99
|
}
|
|
97
100
|
};
|
|
@@ -116,6 +119,16 @@ function formatDate(iso, opts) {
|
|
|
116
119
|
const loc = o.locale || "en";
|
|
117
120
|
return fmt(localeTag(loc, o.calendar || defaultCalendar(loc)), f, d).replace(ERA, "");
|
|
118
121
|
}
|
|
122
|
+
function formatDateRange(start, end, opts) {
|
|
123
|
+
const o = opts || {}, a = fromISO(start), b = fromISO(end);
|
|
124
|
+
if (!a || !b) return "";
|
|
125
|
+
if (start > end) return formatDateRange(end, start, opts);
|
|
126
|
+
const loc = o.locale || "en", tag = localeTag(loc, o.calendar || defaultCalendar(loc)), f = PRESETS.short;
|
|
127
|
+
const k = tag + JSON.stringify(f);
|
|
128
|
+
if (!fmtCache[k]) fmtCache[k] = new Intl.DateTimeFormat(tag, f);
|
|
129
|
+
const F = fmtCache[k];
|
|
130
|
+
return F.formatRange ? F.formatRange(a, b).replace(/\s?(พ\.ศ\.|\bBE\b)\s?/g, " ").replace(/[\s\u2009\u202f]*[–-][\s\u2009\u202f]*/g, " \u2013 ").trim() : start === end ? formatDate(start, o) : formatDate(start, o) + " \u2013 " + formatDate(end, o);
|
|
131
|
+
}
|
|
119
132
|
let MONTHS = null;
|
|
120
133
|
function monthIndex(word) {
|
|
121
134
|
if (!MONTHS) {
|
|
@@ -188,6 +201,7 @@ export {
|
|
|
188
201
|
fmt,
|
|
189
202
|
fmtCache,
|
|
190
203
|
formatDate,
|
|
204
|
+
formatDateRange,
|
|
191
205
|
fromISO,
|
|
192
206
|
localeTag,
|
|
193
207
|
makeDate,
|
package/dist/esm/index.js
CHANGED
|
@@ -11,6 +11,7 @@ import { TextField } from "./TextField.js";
|
|
|
11
11
|
import { Textarea } from "./Textarea.js";
|
|
12
12
|
import { Select } from "./Select.js";
|
|
13
13
|
import { FilterSelect } from "./FilterSelect.js";
|
|
14
|
+
import { FilterDateRange } from "./FilterDateRange.js";
|
|
14
15
|
import { RadioGroup } from "./RadioGroup.js";
|
|
15
16
|
import { Switch } from "./Switch.js";
|
|
16
17
|
import { Combobox, defaultFilter } from "./Combobox.js";
|
|
@@ -88,6 +89,7 @@ export {
|
|
|
88
89
|
Field,
|
|
89
90
|
FileUpload,
|
|
90
91
|
FilterBar,
|
|
92
|
+
FilterDateRange,
|
|
91
93
|
FilterSelect,
|
|
92
94
|
FormErrorSummary,
|
|
93
95
|
Grid,
|