@jirawatpyk/aura-react 5.26.0 → 5.28.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 +13 -2
- package/dist/aura.bundle.js +238 -185
- package/dist/cjs/index.cjs +238 -185
- package/dist/esm/Container.js +1 -1
- package/dist/esm/DataTable.js +14 -1
- package/dist/esm/Table.js +13 -1
- package/dist/esm/Tag.js +42 -15
- package/dist/index.d.cts +21 -10
- package/dist/index.d.ts +21 -10
- 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 +25 -17
- package/dist/styles.layer.css +25 -17
- package/package.json +1 -1
package/dist/aura.bundle.js
CHANGED
|
@@ -4396,21 +4396,146 @@ window.Aura = (() => {
|
|
|
4396
4396
|
);
|
|
4397
4397
|
|
|
4398
4398
|
// src/FilterBar.tsx
|
|
4399
|
-
var
|
|
4399
|
+
var React28 = __toESM(require_react(), 1);
|
|
4400
4400
|
|
|
4401
4401
|
// src/Tag.tsx
|
|
4402
|
+
var React27 = __toESM(require_react(), 1);
|
|
4403
|
+
|
|
4404
|
+
// src/Tooltip.tsx
|
|
4402
4405
|
var React26 = __toESM(require_react(), 1);
|
|
4403
|
-
|
|
4406
|
+
var import_react_dom7 = __toESM(require_react_dom(), 1);
|
|
4407
|
+
var Tooltip = React26.forwardRef(function Tooltip2(props, ref) {
|
|
4408
|
+
const id = uid(), st = React26.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
4409
|
+
const anchor = React26.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip = React26.useRef(null), timer = React26.useRef(void 0);
|
|
4410
|
+
const pos = React26.useState(null), mounted = useMounted();
|
|
4411
|
+
function show2(now) {
|
|
4412
|
+
clearTimeout(timer.current);
|
|
4413
|
+
timer.current = setTimeout(
|
|
4414
|
+
function() {
|
|
4415
|
+
set(true);
|
|
4416
|
+
},
|
|
4417
|
+
now ? 0 : props.delay == null ? 400 : props.delay
|
|
4418
|
+
);
|
|
4419
|
+
}
|
|
4420
|
+
function hide() {
|
|
4421
|
+
clearTimeout(timer.current);
|
|
4422
|
+
set(false);
|
|
4423
|
+
}
|
|
4424
|
+
function hideSoon() {
|
|
4425
|
+
clearTimeout(timer.current);
|
|
4426
|
+
timer.current = setTimeout(function() {
|
|
4427
|
+
set(false);
|
|
4428
|
+
}, 120);
|
|
4429
|
+
}
|
|
4430
|
+
React26.useEffect(function() {
|
|
4431
|
+
return function() {
|
|
4432
|
+
clearTimeout(timer.current);
|
|
4433
|
+
};
|
|
4434
|
+
}, []);
|
|
4435
|
+
function place() {
|
|
4436
|
+
if (!anchor.current || !tip.current) return;
|
|
4437
|
+
const r = anchor.current.getBoundingClientRect(), t = tip.current.getBoundingClientRect();
|
|
4438
|
+
const vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
4439
|
+
let side = props.side || "top";
|
|
4440
|
+
if (side === "top" && r.top - t.height - gap < m && r.bottom + gap + t.height <= vh - m) side = "bottom";
|
|
4441
|
+
else if (side === "bottom" && r.bottom + gap + t.height > vh - m && r.top - t.height - gap >= m) side = "top";
|
|
4442
|
+
else if (side === "left" && r.left - t.width - gap < m && r.right + gap + t.width <= vw - m) side = "right";
|
|
4443
|
+
else if (side === "right" && r.right + gap + t.width > vw - m && r.left - t.width - gap >= m) side = "left";
|
|
4444
|
+
const clampX = function(x) {
|
|
4445
|
+
return Math.max(m, Math.min(x, vw - t.width - m));
|
|
4446
|
+
};
|
|
4447
|
+
const clampY = function(y) {
|
|
4448
|
+
return Math.max(m, Math.min(y, vh - t.height - m));
|
|
4449
|
+
};
|
|
4450
|
+
let top, left;
|
|
4451
|
+
if (side === "top" || side === "bottom") {
|
|
4452
|
+
top = clampY(side === "top" ? r.top - t.height - gap : r.bottom + gap);
|
|
4453
|
+
left = clampX(r.left + r.width / 2 - t.width / 2);
|
|
4454
|
+
} else {
|
|
4455
|
+
left = side === "left" ? r.left - t.width - gap : r.right + gap;
|
|
4456
|
+
left = clampX(left);
|
|
4457
|
+
top = clampY(r.top + r.height / 2 - t.height / 2);
|
|
4458
|
+
}
|
|
4459
|
+
pos[1]({ top, left });
|
|
4460
|
+
}
|
|
4461
|
+
useIsoLayoutEffect(
|
|
4462
|
+
function() {
|
|
4463
|
+
if (!open) return;
|
|
4464
|
+
place();
|
|
4465
|
+
window.addEventListener("scroll", place, true);
|
|
4466
|
+
window.addEventListener("resize", place);
|
|
4467
|
+
return function() {
|
|
4468
|
+
window.removeEventListener("scroll", place, true);
|
|
4469
|
+
window.removeEventListener("resize", place);
|
|
4470
|
+
};
|
|
4471
|
+
},
|
|
4472
|
+
[open, mounted]
|
|
4473
|
+
);
|
|
4474
|
+
React26.useEffect(
|
|
4475
|
+
function() {
|
|
4476
|
+
if (!open) return;
|
|
4477
|
+
function esc(e) {
|
|
4478
|
+
if (e.key === "Escape") hide();
|
|
4479
|
+
}
|
|
4480
|
+
document.addEventListener("keydown", esc);
|
|
4481
|
+
return function() {
|
|
4482
|
+
document.removeEventListener("keydown", esc);
|
|
4483
|
+
};
|
|
4484
|
+
},
|
|
4485
|
+
[open]
|
|
4486
|
+
);
|
|
4487
|
+
const child = React26.Children.only(props.children);
|
|
4488
|
+
const trigger = /* @__PURE__ */ React26.createElement(
|
|
4489
|
+
"span",
|
|
4490
|
+
{
|
|
4491
|
+
ref: anchorMerged,
|
|
4492
|
+
className: "aura-tooltip-anchor",
|
|
4493
|
+
onMouseEnter: function() {
|
|
4494
|
+
show2(false);
|
|
4495
|
+
},
|
|
4496
|
+
onMouseLeave: hideSoon,
|
|
4497
|
+
onFocus: function() {
|
|
4498
|
+
show2(true);
|
|
4499
|
+
},
|
|
4500
|
+
onBlur: hide
|
|
4501
|
+
},
|
|
4502
|
+
React26.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
4503
|
+
);
|
|
4504
|
+
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, trigger, open && mounted ? (0, import_react_dom7.createPortal)(
|
|
4505
|
+
/* @__PURE__ */ React26.createElement(
|
|
4506
|
+
"div",
|
|
4507
|
+
{
|
|
4508
|
+
ref: tip,
|
|
4509
|
+
id,
|
|
4510
|
+
role: "tooltip",
|
|
4511
|
+
onMouseEnter: function() {
|
|
4512
|
+
clearTimeout(timer.current);
|
|
4513
|
+
},
|
|
4514
|
+
onMouseLeave: hideSoon,
|
|
4515
|
+
className: "aura-tooltip aura-tooltip--hoverable",
|
|
4516
|
+
style: { top: pos[0] ? pos[0].top : -9999, left: pos[0] ? pos[0].left : -9999 }
|
|
4517
|
+
},
|
|
4518
|
+
props.content
|
|
4519
|
+
),
|
|
4520
|
+
document.body
|
|
4521
|
+
) : null);
|
|
4522
|
+
});
|
|
4523
|
+
|
|
4524
|
+
// src/Tag.tsx
|
|
4525
|
+
function textOf2(node, all) {
|
|
4404
4526
|
if (node == null || typeof node === "boolean") return "";
|
|
4405
4527
|
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
4406
|
-
if (Array.isArray(node))
|
|
4407
|
-
|
|
4528
|
+
if (Array.isArray(node))
|
|
4529
|
+
return node.map(function(n3) {
|
|
4530
|
+
return textOf2(n3, all);
|
|
4531
|
+
}).join("");
|
|
4532
|
+
if (React27.isValidElement(node)) {
|
|
4408
4533
|
const p = node.props;
|
|
4409
|
-
return p["aria-hidden"] === true || p["aria-hidden"] === "true" ? "" : textOf2(p.children);
|
|
4534
|
+
return !all && (p["aria-hidden"] === true || p["aria-hidden"] === "true") ? "" : textOf2(p.children, all);
|
|
4410
4535
|
}
|
|
4411
4536
|
return "";
|
|
4412
4537
|
}
|
|
4413
|
-
var Tag =
|
|
4538
|
+
var Tag = React27.forwardRef(function Tag2(props, ref) {
|
|
4414
4539
|
const t = useStrings();
|
|
4415
4540
|
const selectable = props.onClick != null || props.selected != null;
|
|
4416
4541
|
const rest = omit(props, [
|
|
@@ -4423,12 +4548,32 @@ window.Aura = (() => {
|
|
|
4423
4548
|
"removeLabel",
|
|
4424
4549
|
"touchHeight"
|
|
4425
4550
|
]);
|
|
4551
|
+
const textRef = React27.useRef(null);
|
|
4552
|
+
const cutState = React27.useState(false), isCut = cutState[0];
|
|
4553
|
+
const check = React27.useCallback(function() {
|
|
4554
|
+
const el = textRef.current;
|
|
4555
|
+
if (el) cutState[1](el.scrollWidth > el.clientWidth + 1);
|
|
4556
|
+
}, []);
|
|
4557
|
+
useIsoLayoutEffect(check);
|
|
4558
|
+
useIsoLayoutEffect(
|
|
4559
|
+
function() {
|
|
4560
|
+
const el = textRef.current;
|
|
4561
|
+
if (!el || typeof ResizeObserver === "undefined") return;
|
|
4562
|
+
const ro = new ResizeObserver(check);
|
|
4563
|
+
ro.observe(el);
|
|
4564
|
+
return function() {
|
|
4565
|
+
ro.disconnect();
|
|
4566
|
+
};
|
|
4567
|
+
},
|
|
4568
|
+
[check]
|
|
4569
|
+
);
|
|
4570
|
+
const fullText = isCut ? textOf2(props.children, true).replace(/\s+/g, " ").trim() : "";
|
|
4426
4571
|
const inner = [
|
|
4427
|
-
props.icon ? /* @__PURE__ */
|
|
4428
|
-
/* @__PURE__ */
|
|
4572
|
+
props.icon ? /* @__PURE__ */ React27.createElement(Icon, { key: "i", name: props.icon, size: 14 }) : null,
|
|
4573
|
+
/* @__PURE__ */ React27.createElement("span", { key: "t", ref: textRef, className: "aura-tag__text", title: fullText || void 0 }, props.children)
|
|
4429
4574
|
];
|
|
4430
4575
|
if (selectable) {
|
|
4431
|
-
return /* @__PURE__ */
|
|
4576
|
+
return /* @__PURE__ */ React27.createElement(
|
|
4432
4577
|
"button",
|
|
4433
4578
|
{
|
|
4434
4579
|
...rest,
|
|
@@ -4443,7 +4588,7 @@ window.Aura = (() => {
|
|
|
4443
4588
|
props.className
|
|
4444
4589
|
)
|
|
4445
4590
|
},
|
|
4446
|
-
props.selected ? /* @__PURE__ */
|
|
4591
|
+
props.selected ? /* @__PURE__ */ React27.createElement(Icon, { name: /* @__PURE__ */ React27.createElement(IconCheck, null), size: 14 }) : inner[0],
|
|
4447
4592
|
inner[1]
|
|
4448
4593
|
);
|
|
4449
4594
|
}
|
|
@@ -4453,29 +4598,32 @@ window.Aura = (() => {
|
|
|
4453
4598
|
"tag-remove-label",
|
|
4454
4599
|
'Tag: the remove button has no name \u2014 its children have no text. Pass removeLabel (e.g. "Remove Acme AB").'
|
|
4455
4600
|
);
|
|
4456
|
-
return /* @__PURE__ */
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4601
|
+
return /* @__PURE__ */ React27.createElement("span", { ...rest, ref, className: cx("aura-tag", props.disabled && "is-disabled", props.className) }, inner, props.onRemove && !props.disabled ? function() {
|
|
4602
|
+
const btn = /* @__PURE__ */ React27.createElement(
|
|
4603
|
+
"button",
|
|
4604
|
+
{
|
|
4605
|
+
type: "button",
|
|
4606
|
+
className: "aura-tag__remove",
|
|
4607
|
+
"aria-label": props.removeLabel || t.remove(name),
|
|
4608
|
+
onClick: props.onRemove
|
|
4609
|
+
},
|
|
4610
|
+
/* @__PURE__ */ React27.createElement(Icon, { name: /* @__PURE__ */ React27.createElement(IconX, null), size: 12 })
|
|
4611
|
+
);
|
|
4612
|
+
return /* @__PURE__ */ React27.createElement(Tooltip, { content: fullText, open: fullText ? void 0 : false }, btn);
|
|
4613
|
+
}() : null);
|
|
4466
4614
|
});
|
|
4467
4615
|
|
|
4468
4616
|
// src/FilterBar.tsx
|
|
4469
|
-
var FilterBar =
|
|
4617
|
+
var FilterBar = React28.forwardRef(function FilterBar2(props, ref) {
|
|
4470
4618
|
const t = useStrings();
|
|
4471
4619
|
const id = uid();
|
|
4472
4620
|
const hasSearch = !!props.onSearchChange;
|
|
4473
|
-
const draft =
|
|
4474
|
-
const timer =
|
|
4475
|
-
const sent =
|
|
4476
|
-
const onChange =
|
|
4621
|
+
const draft = React28.useState(props.search || "");
|
|
4622
|
+
const timer = React28.useRef(null);
|
|
4623
|
+
const sent = React28.useRef(props.search || "");
|
|
4624
|
+
const onChange = React28.useRef(props.onSearchChange);
|
|
4477
4625
|
onChange.current = props.onSearchChange;
|
|
4478
|
-
|
|
4626
|
+
React28.useEffect(
|
|
4479
4627
|
function() {
|
|
4480
4628
|
if ((props.search || "") !== sent.current) {
|
|
4481
4629
|
sent.current = props.search || "";
|
|
@@ -4484,7 +4632,7 @@ window.Aura = (() => {
|
|
|
4484
4632
|
},
|
|
4485
4633
|
[props.search]
|
|
4486
4634
|
);
|
|
4487
|
-
|
|
4635
|
+
React28.useEffect(function() {
|
|
4488
4636
|
return function() {
|
|
4489
4637
|
if (timer.current) clearTimeout(timer.current);
|
|
4490
4638
|
};
|
|
@@ -4509,7 +4657,7 @@ window.Aura = (() => {
|
|
|
4509
4657
|
const filters = props.filters || [];
|
|
4510
4658
|
const anything = filters.length > 0 || !!(props.search || draft[0]);
|
|
4511
4659
|
const count = props.resultCount == null ? null : typeof props.resultCount === "number" ? t.results(props.resultCount) : props.resultCount;
|
|
4512
|
-
return /* @__PURE__ */
|
|
4660
|
+
return /* @__PURE__ */ React28.createElement(
|
|
4513
4661
|
"div",
|
|
4514
4662
|
{
|
|
4515
4663
|
ref,
|
|
@@ -4523,7 +4671,7 @@ window.Aura = (() => {
|
|
|
4523
4671
|
props.className
|
|
4524
4672
|
)
|
|
4525
4673
|
},
|
|
4526
|
-
/* @__PURE__ */
|
|
4674
|
+
/* @__PURE__ */ React28.createElement("div", { className: "aura-filterbar__row" }, hasSearch ? /* @__PURE__ */ React28.createElement("div", { className: "aura-input has-icon aura-filterbar__search" }, /* @__PURE__ */ React28.createElement(Icon, { name: /* @__PURE__ */ React28.createElement(IconSearch, null), className: "aura-input__icon" }), /* @__PURE__ */ React28.createElement(
|
|
4527
4675
|
"input",
|
|
4528
4676
|
{
|
|
4529
4677
|
id,
|
|
@@ -4544,10 +4692,10 @@ window.Aura = (() => {
|
|
|
4544
4692
|
}
|
|
4545
4693
|
}
|
|
4546
4694
|
}
|
|
4547
|
-
), draft[0] ? /* @__PURE__ */
|
|
4695
|
+
), draft[0] ? /* @__PURE__ */ React28.createElement(
|
|
4548
4696
|
IconButton,
|
|
4549
4697
|
{
|
|
4550
|
-
icon: /* @__PURE__ */
|
|
4698
|
+
icon: /* @__PURE__ */ React28.createElement(IconX, null),
|
|
4551
4699
|
label: t.clear((props.searchLabel || t.search).toLowerCase()),
|
|
4552
4700
|
className: "aura-filterbar__clear-search",
|
|
4553
4701
|
onClick: function() {
|
|
@@ -4555,10 +4703,10 @@ window.Aura = (() => {
|
|
|
4555
4703
|
send("");
|
|
4556
4704
|
}
|
|
4557
4705
|
}
|
|
4558
|
-
) : null) : null, props.children ? /* @__PURE__ */
|
|
4559
|
-
filters.length || props.onClearAll && anything ? /* @__PURE__ */
|
|
4560
|
-
return /* @__PURE__ */
|
|
4561
|
-
}), props.onClearAll && anything ? /* @__PURE__ */
|
|
4706
|
+
) : null) : null, props.children ? /* @__PURE__ */ React28.createElement("div", { className: "aura-filterbar__controls" }, props.children) : null, /* @__PURE__ */ React28.createElement("span", { className: "aura-filterbar__spacer" }), count != null ? /* @__PURE__ */ React28.createElement("span", { className: "aura-filterbar__count", "aria-live": "polite" }, count) : null, props.actions ? /* @__PURE__ */ React28.createElement("div", { className: "aura-filterbar__actions" }, props.actions) : null),
|
|
4707
|
+
filters.length || props.onClearAll && anything ? /* @__PURE__ */ React28.createElement("div", { className: "aura-filterbar__chips" }, filters.map(function(f) {
|
|
4708
|
+
return /* @__PURE__ */ React28.createElement(Tag, { key: f.id, onRemove: f.onRemove }, f.label);
|
|
4709
|
+
}), props.onClearAll && anything ? /* @__PURE__ */ React28.createElement(
|
|
4562
4710
|
"button",
|
|
4563
4711
|
{
|
|
4564
4712
|
type: "button",
|
|
@@ -4576,11 +4724,11 @@ window.Aura = (() => {
|
|
|
4576
4724
|
});
|
|
4577
4725
|
|
|
4578
4726
|
// src/Command.tsx
|
|
4579
|
-
var
|
|
4580
|
-
var
|
|
4727
|
+
var React30 = __toESM(require_react(), 1);
|
|
4728
|
+
var import_react_dom8 = __toESM(require_react_dom(), 1);
|
|
4581
4729
|
|
|
4582
4730
|
// src/useModal.tsx
|
|
4583
|
-
var
|
|
4731
|
+
var React29 = __toESM(require_react(), 1);
|
|
4584
4732
|
var locks = 0;
|
|
4585
4733
|
var savedOverflow = "";
|
|
4586
4734
|
function lockScroll() {
|
|
@@ -4607,11 +4755,11 @@ window.Aura = (() => {
|
|
|
4607
4755
|
}
|
|
4608
4756
|
function useModal(open, ref, opts) {
|
|
4609
4757
|
const mounted = useMounted();
|
|
4610
|
-
const prev =
|
|
4758
|
+
const prev = React29.useRef(null);
|
|
4611
4759
|
const o = opts || {};
|
|
4612
|
-
const latest =
|
|
4760
|
+
const latest = React29.useRef(o);
|
|
4613
4761
|
latest.current = o;
|
|
4614
|
-
|
|
4762
|
+
React29.useEffect(
|
|
4615
4763
|
function() {
|
|
4616
4764
|
if (!open || !mounted) return;
|
|
4617
4765
|
prev.current = document.activeElement;
|
|
@@ -4674,21 +4822,21 @@ window.Aura = (() => {
|
|
|
4674
4822
|
const t = useStrings();
|
|
4675
4823
|
const density = useDensity();
|
|
4676
4824
|
const id = uid(), listId = id + "-list";
|
|
4677
|
-
const box =
|
|
4678
|
-
const input =
|
|
4679
|
-
const qState =
|
|
4825
|
+
const box = React30.useRef(null);
|
|
4826
|
+
const input = React30.useRef(null);
|
|
4827
|
+
const qState = React30.useState(""), act = React30.useState(null);
|
|
4680
4828
|
const query = props.query !== void 0 ? props.query : qState[0];
|
|
4681
4829
|
function setQuery(v) {
|
|
4682
4830
|
if (props.query === void 0) qState[1](v);
|
|
4683
4831
|
if (props.onQueryChange) props.onQueryChange(v);
|
|
4684
4832
|
}
|
|
4685
|
-
const openRef =
|
|
4833
|
+
const openRef = React30.useRef(props.open);
|
|
4686
4834
|
openRef.current = props.open;
|
|
4687
4835
|
const close = function() {
|
|
4688
4836
|
props.onOpenChange(false);
|
|
4689
4837
|
};
|
|
4690
4838
|
const modal = useModal(props.open, box, { onEscape: close });
|
|
4691
|
-
|
|
4839
|
+
React30.useEffect(
|
|
4692
4840
|
function() {
|
|
4693
4841
|
if (props.hotkey === false) return;
|
|
4694
4842
|
function onKey2(e) {
|
|
@@ -4704,7 +4852,7 @@ window.Aura = (() => {
|
|
|
4704
4852
|
},
|
|
4705
4853
|
[props.hotkey, props.onOpenChange]
|
|
4706
4854
|
);
|
|
4707
|
-
|
|
4855
|
+
React30.useEffect(
|
|
4708
4856
|
function() {
|
|
4709
4857
|
if (!props.open) {
|
|
4710
4858
|
if (query) setQuery("");
|
|
@@ -4744,7 +4892,7 @@ window.Aura = (() => {
|
|
|
4744
4892
|
const optId = function(i2) {
|
|
4745
4893
|
return id + "-o" + i2;
|
|
4746
4894
|
};
|
|
4747
|
-
|
|
4895
|
+
React30.useEffect(
|
|
4748
4896
|
function() {
|
|
4749
4897
|
if (!box.current || active < 0) return;
|
|
4750
4898
|
const el = box.current.querySelector("#" + CSS.escape(optId(active)));
|
|
@@ -4788,8 +4936,8 @@ window.Aura = (() => {
|
|
|
4788
4936
|
}
|
|
4789
4937
|
if (!modal.ready) return null;
|
|
4790
4938
|
let i = -1;
|
|
4791
|
-
return (0,
|
|
4792
|
-
/* @__PURE__ */
|
|
4939
|
+
return (0, import_react_dom8.createPortal)(
|
|
4940
|
+
/* @__PURE__ */ React30.createElement(
|
|
4793
4941
|
"div",
|
|
4794
4942
|
{
|
|
4795
4943
|
className: "aura-dialog-layer aura-command-layer",
|
|
@@ -4799,8 +4947,8 @@ window.Aura = (() => {
|
|
|
4799
4947
|
e.stopPropagation();
|
|
4800
4948
|
}
|
|
4801
4949
|
},
|
|
4802
|
-
/* @__PURE__ */
|
|
4803
|
-
/* @__PURE__ */
|
|
4950
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-scrim", onClick: close, "aria-hidden": true }),
|
|
4951
|
+
/* @__PURE__ */ React30.createElement(
|
|
4804
4952
|
"div",
|
|
4805
4953
|
{
|
|
4806
4954
|
ref: box,
|
|
@@ -4810,7 +4958,7 @@ window.Aura = (() => {
|
|
|
4810
4958
|
tabIndex: -1,
|
|
4811
4959
|
className: cx("aura-command", props.className)
|
|
4812
4960
|
},
|
|
4813
|
-
/* @__PURE__ */
|
|
4961
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-command__search" }, /* @__PURE__ */ React30.createElement(Icon, { name: /* @__PURE__ */ React30.createElement(IconSearch, null), className: "aura-command__search-icon" }), /* @__PURE__ */ React30.createElement(
|
|
4814
4962
|
"input",
|
|
4815
4963
|
{
|
|
4816
4964
|
ref: input,
|
|
@@ -4833,8 +4981,8 @@ window.Aura = (() => {
|
|
|
4833
4981
|
},
|
|
4834
4982
|
onKeyDown: onKey
|
|
4835
4983
|
}
|
|
4836
|
-
), /* @__PURE__ */
|
|
4837
|
-
/* @__PURE__ */
|
|
4984
|
+
), /* @__PURE__ */ React30.createElement("kbd", { className: "aura-command__kbd" }, "Esc")),
|
|
4985
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-command__list", "aria-busy": props.loading || void 0 }, props.loading ? /* @__PURE__ */ React30.createElement("div", { className: "aura-command__loading" }, /* @__PURE__ */ React30.createElement(Icon, { name: /* @__PURE__ */ React30.createElement(IconLoaderCircle, null), className: "aura-spin" }), t.searching) : null, !flat2.length ? props.loading ? null : /* @__PURE__ */ React30.createElement("div", { className: "aura-command__empty" }, props.empty != null ? props.empty : props.emptyText || t.noMatches) : /* @__PURE__ */ React30.createElement(
|
|
4838
4986
|
"div",
|
|
4839
4987
|
{
|
|
4840
4988
|
id: listId,
|
|
@@ -4844,7 +4992,7 @@ window.Aura = (() => {
|
|
|
4844
4992
|
},
|
|
4845
4993
|
groups.map(function(g, gi) {
|
|
4846
4994
|
const gid = id + "-g" + gi;
|
|
4847
|
-
return /* @__PURE__ */
|
|
4995
|
+
return /* @__PURE__ */ React30.createElement(
|
|
4848
4996
|
"div",
|
|
4849
4997
|
{
|
|
4850
4998
|
key: g.name || gi,
|
|
@@ -4852,11 +5000,11 @@ window.Aura = (() => {
|
|
|
4852
5000
|
"aria-labelledby": g.name ? gid : void 0,
|
|
4853
5001
|
className: "aura-command__group"
|
|
4854
5002
|
},
|
|
4855
|
-
g.name ? /* @__PURE__ */
|
|
5003
|
+
g.name ? /* @__PURE__ */ React30.createElement("div", { className: "aura-command__heading", id: gid, role: "presentation" }, g.name) : null,
|
|
4856
5004
|
g.items.map(function(it) {
|
|
4857
5005
|
i++;
|
|
4858
5006
|
const n3 = i;
|
|
4859
|
-
return /* @__PURE__ */
|
|
5007
|
+
return /* @__PURE__ */ React30.createElement(
|
|
4860
5008
|
"div",
|
|
4861
5009
|
{
|
|
4862
5010
|
key: it.id,
|
|
@@ -4881,142 +5029,22 @@ window.Aura = (() => {
|
|
|
4881
5029
|
run(it);
|
|
4882
5030
|
}
|
|
4883
5031
|
},
|
|
4884
|
-
it.icon ? /* @__PURE__ */
|
|
4885
|
-
/* @__PURE__ */
|
|
4886
|
-
it.shortcut ? /* @__PURE__ */
|
|
5032
|
+
it.icon ? /* @__PURE__ */ React30.createElement(Icon, { name: it.icon }) : null,
|
|
5033
|
+
/* @__PURE__ */ React30.createElement("span", { className: "aura-command__text" }, /* @__PURE__ */ React30.createElement("span", { className: "aura-command__label", id: it.description ? optId(n3) + "-label" : void 0 }, it.label), it.description ? /* @__PURE__ */ React30.createElement("span", { className: "aura-command__desc", id: optId(n3) + "-desc" }, it.description) : null),
|
|
5034
|
+
it.shortcut ? /* @__PURE__ */ React30.createElement("kbd", { className: "aura-command__kbd", id: it.description ? optId(n3) + "-kbd" : void 0 }, it.shortcut) : null
|
|
4887
5035
|
);
|
|
4888
5036
|
})
|
|
4889
5037
|
);
|
|
4890
5038
|
})
|
|
4891
5039
|
)),
|
|
4892
|
-
/* @__PURE__ */
|
|
4893
|
-
/* @__PURE__ */
|
|
5040
|
+
/* @__PURE__ */ React30.createElement("span", { className: "aura-sr-only", role: "status" }, props.loading ? t.searching : query && !flat2.length ? t.noMatches : props.loading === false && query ? t.results(flat2.length) : ""),
|
|
5041
|
+
/* @__PURE__ */ React30.createElement("div", { className: "aura-command__foot", "aria-hidden": true }, t.commandHint, /* @__PURE__ */ React30.createElement("span", { className: "aura-command__mod" }, isMac() ? "\u2318K" : "Ctrl K"))
|
|
4894
5042
|
)
|
|
4895
5043
|
),
|
|
4896
5044
|
document.body
|
|
4897
5045
|
);
|
|
4898
5046
|
}
|
|
4899
5047
|
|
|
4900
|
-
// src/Tooltip.tsx
|
|
4901
|
-
var React30 = __toESM(require_react(), 1);
|
|
4902
|
-
var import_react_dom8 = __toESM(require_react_dom(), 1);
|
|
4903
|
-
var Tooltip = React30.forwardRef(function Tooltip2(props, ref) {
|
|
4904
|
-
const id = uid(), st = React30.useState(false), open = props.open !== void 0 ? props.open : st[0], set = st[1];
|
|
4905
|
-
const anchor = React30.useRef(null), anchorMerged = useMergedRef(ref, anchor), tip = React30.useRef(null), timer = React30.useRef(void 0);
|
|
4906
|
-
const pos = React30.useState(null), mounted = useMounted();
|
|
4907
|
-
function show2(now) {
|
|
4908
|
-
clearTimeout(timer.current);
|
|
4909
|
-
timer.current = setTimeout(
|
|
4910
|
-
function() {
|
|
4911
|
-
set(true);
|
|
4912
|
-
},
|
|
4913
|
-
now ? 0 : props.delay == null ? 400 : props.delay
|
|
4914
|
-
);
|
|
4915
|
-
}
|
|
4916
|
-
function hide() {
|
|
4917
|
-
clearTimeout(timer.current);
|
|
4918
|
-
set(false);
|
|
4919
|
-
}
|
|
4920
|
-
function hideSoon() {
|
|
4921
|
-
clearTimeout(timer.current);
|
|
4922
|
-
timer.current = setTimeout(function() {
|
|
4923
|
-
set(false);
|
|
4924
|
-
}, 120);
|
|
4925
|
-
}
|
|
4926
|
-
React30.useEffect(function() {
|
|
4927
|
-
return function() {
|
|
4928
|
-
clearTimeout(timer.current);
|
|
4929
|
-
};
|
|
4930
|
-
}, []);
|
|
4931
|
-
function place() {
|
|
4932
|
-
if (!anchor.current || !tip.current) return;
|
|
4933
|
-
const r = anchor.current.getBoundingClientRect(), t = tip.current.getBoundingClientRect();
|
|
4934
|
-
const vw = window.innerWidth, vh = window.innerHeight, gap = 8, m = 8;
|
|
4935
|
-
let side = props.side || "top";
|
|
4936
|
-
if (side === "top" && r.top - t.height - gap < m && r.bottom + gap + t.height <= vh - m) side = "bottom";
|
|
4937
|
-
else if (side === "bottom" && r.bottom + gap + t.height > vh - m && r.top - t.height - gap >= m) side = "top";
|
|
4938
|
-
else if (side === "left" && r.left - t.width - gap < m && r.right + gap + t.width <= vw - m) side = "right";
|
|
4939
|
-
else if (side === "right" && r.right + gap + t.width > vw - m && r.left - t.width - gap >= m) side = "left";
|
|
4940
|
-
const clampX = function(x) {
|
|
4941
|
-
return Math.max(m, Math.min(x, vw - t.width - m));
|
|
4942
|
-
};
|
|
4943
|
-
const clampY = function(y) {
|
|
4944
|
-
return Math.max(m, Math.min(y, vh - t.height - m));
|
|
4945
|
-
};
|
|
4946
|
-
let top, left;
|
|
4947
|
-
if (side === "top" || side === "bottom") {
|
|
4948
|
-
top = clampY(side === "top" ? r.top - t.height - gap : r.bottom + gap);
|
|
4949
|
-
left = clampX(r.left + r.width / 2 - t.width / 2);
|
|
4950
|
-
} else {
|
|
4951
|
-
left = side === "left" ? r.left - t.width - gap : r.right + gap;
|
|
4952
|
-
left = clampX(left);
|
|
4953
|
-
top = clampY(r.top + r.height / 2 - t.height / 2);
|
|
4954
|
-
}
|
|
4955
|
-
pos[1]({ top, left });
|
|
4956
|
-
}
|
|
4957
|
-
useIsoLayoutEffect(
|
|
4958
|
-
function() {
|
|
4959
|
-
if (!open) return;
|
|
4960
|
-
place();
|
|
4961
|
-
window.addEventListener("scroll", place, true);
|
|
4962
|
-
window.addEventListener("resize", place);
|
|
4963
|
-
return function() {
|
|
4964
|
-
window.removeEventListener("scroll", place, true);
|
|
4965
|
-
window.removeEventListener("resize", place);
|
|
4966
|
-
};
|
|
4967
|
-
},
|
|
4968
|
-
[open, mounted]
|
|
4969
|
-
);
|
|
4970
|
-
React30.useEffect(
|
|
4971
|
-
function() {
|
|
4972
|
-
if (!open) return;
|
|
4973
|
-
function esc(e) {
|
|
4974
|
-
if (e.key === "Escape") hide();
|
|
4975
|
-
}
|
|
4976
|
-
document.addEventListener("keydown", esc);
|
|
4977
|
-
return function() {
|
|
4978
|
-
document.removeEventListener("keydown", esc);
|
|
4979
|
-
};
|
|
4980
|
-
},
|
|
4981
|
-
[open]
|
|
4982
|
-
);
|
|
4983
|
-
const child = React30.Children.only(props.children);
|
|
4984
|
-
const trigger = /* @__PURE__ */ React30.createElement(
|
|
4985
|
-
"span",
|
|
4986
|
-
{
|
|
4987
|
-
ref: anchorMerged,
|
|
4988
|
-
className: "aura-tooltip-anchor",
|
|
4989
|
-
onMouseEnter: function() {
|
|
4990
|
-
show2(false);
|
|
4991
|
-
},
|
|
4992
|
-
onMouseLeave: hideSoon,
|
|
4993
|
-
onFocus: function() {
|
|
4994
|
-
show2(true);
|
|
4995
|
-
},
|
|
4996
|
-
onBlur: hide
|
|
4997
|
-
},
|
|
4998
|
-
React30.cloneElement(child, { "aria-describedby": open ? id : child.props["aria-describedby"] })
|
|
4999
|
-
);
|
|
5000
|
-
return /* @__PURE__ */ React30.createElement(React30.Fragment, null, trigger, open && mounted ? (0, import_react_dom8.createPortal)(
|
|
5001
|
-
/* @__PURE__ */ React30.createElement(
|
|
5002
|
-
"div",
|
|
5003
|
-
{
|
|
5004
|
-
ref: tip,
|
|
5005
|
-
id,
|
|
5006
|
-
role: "tooltip",
|
|
5007
|
-
onMouseEnter: function() {
|
|
5008
|
-
clearTimeout(timer.current);
|
|
5009
|
-
},
|
|
5010
|
-
onMouseLeave: hideSoon,
|
|
5011
|
-
className: "aura-tooltip aura-tooltip--hoverable",
|
|
5012
|
-
style: { top: pos[0] ? pos[0].top : -9999, left: pos[0] ? pos[0].left : -9999 }
|
|
5013
|
-
},
|
|
5014
|
-
props.content
|
|
5015
|
-
),
|
|
5016
|
-
document.body
|
|
5017
|
-
) : null);
|
|
5018
|
-
});
|
|
5019
|
-
|
|
5020
5048
|
// src/Dialog.tsx
|
|
5021
5049
|
var React31 = __toESM(require_react(), 1);
|
|
5022
5050
|
var import_react_dom9 = __toESM(require_react_dom(), 1);
|
|
@@ -6507,6 +6535,7 @@ window.Aura = (() => {
|
|
|
6507
6535
|
/* 5.26 (Chamber-OS 127): bleed and bordered={false}; the outermost element carries aura-bleed. */
|
|
6508
6536
|
props.bleed && "aura-bleed-frame",
|
|
6509
6537
|
props.bleed && !levels.length && "aura-bleed",
|
|
6538
|
+
props.bleed && props.bleedEnd && !levels.length && "aura-bleed-end",
|
|
6510
6539
|
props.bordered === false && "aura-table--borderless",
|
|
6511
6540
|
stacked && "aura-table--stacked",
|
|
6512
6541
|
noCardSel && "aura-table--cards-nosel",
|
|
@@ -6605,7 +6634,19 @@ window.Aura = (() => {
|
|
|
6605
6634
|
out
|
|
6606
6635
|
);
|
|
6607
6636
|
}
|
|
6608
|
-
return /* @__PURE__ */ React32.createElement(
|
|
6637
|
+
return /* @__PURE__ */ React32.createElement(
|
|
6638
|
+
"div",
|
|
6639
|
+
{
|
|
6640
|
+
ref,
|
|
6641
|
+
className: cx(
|
|
6642
|
+
"aura-table-box",
|
|
6643
|
+
props.bleed && "aura-bleed",
|
|
6644
|
+
props.bleed && props.bleedEnd && "aura-bleed-end",
|
|
6645
|
+
props.className
|
|
6646
|
+
)
|
|
6647
|
+
},
|
|
6648
|
+
out
|
|
6649
|
+
);
|
|
6609
6650
|
});
|
|
6610
6651
|
var DataTable2 = DataTableImpl;
|
|
6611
6652
|
|
|
@@ -7477,6 +7518,7 @@ window.Aura = (() => {
|
|
|
7477
7518
|
align,
|
|
7478
7519
|
bordered,
|
|
7479
7520
|
bleed,
|
|
7521
|
+
bleedEnd,
|
|
7480
7522
|
stickyHeader,
|
|
7481
7523
|
maxHeight,
|
|
7482
7524
|
stackStyle,
|
|
@@ -7530,6 +7572,7 @@ window.Aura = (() => {
|
|
|
7530
7572
|
/* 5.26 (Chamber-OS 127): the frame that bleeds; the outermost element carries aura-bleed. */
|
|
7531
7573
|
bleed && "aura-bleed-frame",
|
|
7532
7574
|
bleed && !cards && "aura-bleed",
|
|
7575
|
+
bleed && bleedEnd && !cards && "aura-bleed-end",
|
|
7533
7576
|
/* 5.26 (Chamber-OS 129): stickyHeader pins to the page, or inside the box when it has a maxHeight. */
|
|
7534
7577
|
stickyHeader && (maxHeight != null ? "is-sticky-box" : "is-sticky-page"),
|
|
7535
7578
|
maxHeight != null && "has-max",
|
|
@@ -7562,7 +7605,17 @@ window.Aura = (() => {
|
|
|
7562
7605
|
labels ? /* @__PURE__ */ React45.createElement(StackLabels.Provider, { value: labels }, children) : outer ? /* @__PURE__ */ React45.createElement(StackLabels.Provider, { value: null }, children) : children
|
|
7563
7606
|
)
|
|
7564
7607
|
);
|
|
7565
|
-
return cards ? /* @__PURE__ */ React45.createElement(
|
|
7608
|
+
return cards ? /* @__PURE__ */ React45.createElement(
|
|
7609
|
+
"div",
|
|
7610
|
+
{
|
|
7611
|
+
className: cx(
|
|
7612
|
+
"aura-tbl-cards aura-tbl-cards--" + stackBelow,
|
|
7613
|
+
bleed && "aura-bleed",
|
|
7614
|
+
bleed && bleedEnd && "aura-bleed-end"
|
|
7615
|
+
)
|
|
7616
|
+
},
|
|
7617
|
+
table
|
|
7618
|
+
) : table;
|
|
7566
7619
|
});
|
|
7567
7620
|
function section(tag, cls) {
|
|
7568
7621
|
const C = React45.forwardRef(function TableSection(props, ref) {
|