@bysages/solid 0.1.1 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.d.mts +72 -22
- package/dist/index.mjs +662 -314
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import { Avatar as Avatar$1 } from "@ark-ui/solid/avatar";
|
|
|
12
12
|
import { DatePicker as DatePicker$1 } from "@ark-ui/solid/date-picker";
|
|
13
13
|
import { Carousel as Carousel$1 } from "@ark-ui/solid/carousel";
|
|
14
14
|
import { useEnvironmentContext } from "@ark-ui/solid/environment";
|
|
15
|
-
import { useLocaleContext } from "@ark-ui/solid/locale";
|
|
15
|
+
import { useFilter, useLocaleContext } from "@ark-ui/solid/locale";
|
|
16
16
|
import * as cascade from "@zag-js/cascade-select";
|
|
17
17
|
import { normalizeProps, useMachine } from "@zag-js/solid";
|
|
18
18
|
import { Checkbox as Checkbox$1 } from "@ark-ui/solid/checkbox";
|
|
@@ -50,7 +50,7 @@ import { RadioGroup as RadioGroup$1 } from "@ark-ui/solid/radio-group";
|
|
|
50
50
|
import { RatingGroup as RatingGroup$1 } from "@ark-ui/solid/rating-group";
|
|
51
51
|
import { ScrollArea as ScrollArea$1 } from "@ark-ui/solid/scroll-area";
|
|
52
52
|
import { SegmentGroup as SegmentGroup$1 } from "@ark-ui/solid/segment-group";
|
|
53
|
-
import { Select as Select$1 } from "@ark-ui/solid/select";
|
|
53
|
+
import { Select as Select$1, createListCollection } from "@ark-ui/solid/select";
|
|
54
54
|
import { SignaturePad as SignaturePad$1 } from "@ark-ui/solid/signature-pad";
|
|
55
55
|
import { Slider as Slider$1 } from "@ark-ui/solid/slider";
|
|
56
56
|
import { Splitter as Splitter$1 } from "@ark-ui/solid/splitter";
|
|
@@ -203,8 +203,8 @@ injectComponentStyle("field");
|
|
|
203
203
|
var _tmpl$$55 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"width=14 height=14 aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><path d="M8 13V3M3.5 7.5 8 3l4.5 4.5">`);
|
|
204
204
|
var _tmpl$2$28 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"width=14 height=14 aria-hidden=true><rect x=4.5 y=4.5 width=7 height=7 fill=currentColor>`);
|
|
205
205
|
var _tmpl$3$18 = /*#__PURE__*/ template(`<div data-scope=ai>`);
|
|
206
|
-
var _tmpl$4$
|
|
207
|
-
var _tmpl$5$
|
|
206
|
+
var _tmpl$4$14 = /*#__PURE__*/ template(`<div data-scope=ai data-part=prompt-footer><div data-scope=ai data-part=prompt-end>`);
|
|
207
|
+
var _tmpl$5$11 = /*#__PURE__*/ template(`<form><div data-scope=ai data-part=prompt-main>`);
|
|
208
208
|
function arrowUpGlyph() {
|
|
209
209
|
return _tmpl$$55();
|
|
210
210
|
}
|
|
@@ -278,7 +278,7 @@ function PromptInput(props) {
|
|
|
278
278
|
});
|
|
279
279
|
const trailing = () => own.footer != null ? own.trailing : own.trailing ?? seal();
|
|
280
280
|
return (() => {
|
|
281
|
-
var _el$4 = _tmpl$5$
|
|
281
|
+
var _el$4 = _tmpl$5$11(), _el$5 = _el$4.firstChild;
|
|
282
282
|
spread(_el$4, mergeProps(rest, {
|
|
283
283
|
"data-scope": "ai",
|
|
284
284
|
"data-part": "prompt",
|
|
@@ -317,7 +317,7 @@ function PromptInput(props) {
|
|
|
317
317
|
return own.footer != null;
|
|
318
318
|
},
|
|
319
319
|
get children() {
|
|
320
|
-
var _el$6 = _tmpl$4$
|
|
320
|
+
var _el$6 = _tmpl$4$14(), _el$7 = _el$6.firstChild;
|
|
321
321
|
insert(_el$6, () => own.footer, _el$7);
|
|
322
322
|
insert(_el$7, () => own.footerEnd, null);
|
|
323
323
|
insert(_el$7, seal, null);
|
|
@@ -371,19 +371,91 @@ function Reasoning(props) {
|
|
|
371
371
|
}
|
|
372
372
|
injectComponentStyle("ai");
|
|
373
373
|
//#endregion
|
|
374
|
+
//#region src/components/ai-response/code-copy.ts
|
|
375
|
+
/** The two glyphs a copy affordance needs: the stamp and its
|
|
376
|
+
* confirmation. Inline SVG keeps the enhancement framework-agnostic —
|
|
377
|
+
* it lives beside the renderer's generated code HTML. */
|
|
378
|
+
const COPY_CODE_ICON = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></svg>`;
|
|
379
|
+
const COPIED_CODE_ICON = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>`;
|
|
380
|
+
/** How long the confirmation stays before the stamp returns. */
|
|
381
|
+
const REVERT_MS = 1500;
|
|
382
|
+
/** Make sure every fenced block under `host` carries its copy stamp.
|
|
383
|
+
* The stamp anchors to a wrapper outside the scrolling `pre` — inside,
|
|
384
|
+
* it would fix to the overflow area and travel out of view with the
|
|
385
|
+
* code. The renderer rebuilds the markdown as one HTML string on every
|
|
386
|
+
* stream tick, so this stays idempotent and cheap enough to re-run
|
|
387
|
+
* after each patch. */
|
|
388
|
+
function decorateCodeCopy(host, copyLabel) {
|
|
389
|
+
for (const pre of host.querySelectorAll("pre")) {
|
|
390
|
+
let body = pre.parentElement;
|
|
391
|
+
if (!body || body.getAttribute("data-part") !== "code-body") {
|
|
392
|
+
body = document.createElement("div");
|
|
393
|
+
body.setAttribute("data-scope", "ai");
|
|
394
|
+
body.setAttribute("data-part", "code-body");
|
|
395
|
+
pre.replaceWith(body);
|
|
396
|
+
body.appendChild(pre);
|
|
397
|
+
}
|
|
398
|
+
let button = body.querySelector("[data-part=\"code-copy\"]");
|
|
399
|
+
if (!button) {
|
|
400
|
+
button = document.createElement("button");
|
|
401
|
+
button.type = "button";
|
|
402
|
+
button.setAttribute("data-scope", "ai");
|
|
403
|
+
button.setAttribute("data-part", "code-copy");
|
|
404
|
+
button.innerHTML = COPY_CODE_ICON;
|
|
405
|
+
body.appendChild(button);
|
|
406
|
+
}
|
|
407
|
+
button.title = copyLabel;
|
|
408
|
+
button.setAttribute("aria-label", copyLabel);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
/** The one delegated click for the whole response: copy the block's
|
|
412
|
+
* text and confirm in place, then return the stamp after a beat. */
|
|
413
|
+
async function clickCodeCopy(event, copyLabel, copiedLabel) {
|
|
414
|
+
const button = event.target?.closest("[data-part=\"code-copy\"]");
|
|
415
|
+
const pre = button?.closest("[data-part=\"code-body\"]")?.querySelector("pre");
|
|
416
|
+
if (!button || !pre) return;
|
|
417
|
+
await navigator.clipboard.writeText(pre.textContent ?? "");
|
|
418
|
+
button.innerHTML = COPIED_CODE_ICON;
|
|
419
|
+
button.setAttribute("data-state", "copied");
|
|
420
|
+
button.title = copiedLabel;
|
|
421
|
+
button.setAttribute("aria-label", copiedLabel);
|
|
422
|
+
setTimeout(() => {
|
|
423
|
+
if (!button.isConnected) return;
|
|
424
|
+
button.innerHTML = COPY_CODE_ICON;
|
|
425
|
+
button.removeAttribute("data-state");
|
|
426
|
+
button.title = copyLabel;
|
|
427
|
+
button.setAttribute("aria-label", copyLabel);
|
|
428
|
+
}, REVERT_MS);
|
|
429
|
+
}
|
|
430
|
+
//#endregion
|
|
374
431
|
//#region src/components/ai-response/index.tsx
|
|
375
432
|
var _tmpl$$52 = /*#__PURE__*/ template(`<div>`);
|
|
376
433
|
/** Markdown set on the paper. Rendering goes through
|
|
377
434
|
* `@tanstack/markdown`, whose defaults leave raw HTML and executable
|
|
378
435
|
* links inert — streaming-safe by construction. */
|
|
379
436
|
function Response(props) {
|
|
380
|
-
const [own, rest] = splitProps(props, [
|
|
437
|
+
const [own, rest] = splitProps(props, [
|
|
438
|
+
"content",
|
|
439
|
+
"highlighter",
|
|
440
|
+
"copyLabel",
|
|
441
|
+
"copiedLabel"
|
|
442
|
+
]);
|
|
381
443
|
const html = createMemo(() => renderHtml(own.content, own.highlighter ? { highlighter: own.highlighter } : void 0));
|
|
444
|
+
let root;
|
|
445
|
+
onMount(() => createEffect(() => {
|
|
446
|
+
html();
|
|
447
|
+
if (root) decorateCodeCopy(root, own.copyLabel ?? "Copy code");
|
|
448
|
+
}));
|
|
449
|
+
const onClick = (event) => {
|
|
450
|
+
clickCodeCopy(event, own.copyLabel ?? "Copy code", own.copiedLabel ?? "Copied");
|
|
451
|
+
};
|
|
382
452
|
return (() => {
|
|
383
453
|
var _el$ = _tmpl$$52();
|
|
454
|
+
use((el) => root = el, _el$);
|
|
384
455
|
spread(_el$, mergeProps(rest, {
|
|
385
456
|
"data-scope": "ai",
|
|
386
457
|
"data-part": "response",
|
|
458
|
+
"onClick": onClick,
|
|
387
459
|
get innerHTML() {
|
|
388
460
|
return html();
|
|
389
461
|
}
|
|
@@ -446,9 +518,9 @@ injectComponentStyle("ai");
|
|
|
446
518
|
var _tmpl$$50 = /*#__PURE__*/ template(`<span>`);
|
|
447
519
|
var _tmpl$2$25 = /*#__PURE__*/ template(`<span data-scope=ai data-part=tool-status>`);
|
|
448
520
|
var _tmpl$3$17 = /*#__PURE__*/ template(`<span data-scope=ai data-part=tool-label>Input`);
|
|
449
|
-
var _tmpl$4$
|
|
450
|
-
var _tmpl$5$
|
|
451
|
-
var _tmpl$6$
|
|
521
|
+
var _tmpl$4$13 = /*#__PURE__*/ template(`<pre>`);
|
|
522
|
+
var _tmpl$5$10 = /*#__PURE__*/ template(`<span data-scope=ai data-part=tool-label>Output`);
|
|
523
|
+
var _tmpl$6$7 = /*#__PURE__*/ template(`<div data-scope=ai data-part=tool-body>`);
|
|
452
524
|
/** A tool call: the shared collapsible as the vessel — the name it was
|
|
453
525
|
* reached by and the state it reached in on the trigger, its input and
|
|
454
526
|
* output folded inside. */
|
|
@@ -483,14 +555,14 @@ function Tool(props) {
|
|
|
483
555
|
} })
|
|
484
556
|
];
|
|
485
557
|
} }), createComponent(Collapsible.Content, { get children() {
|
|
486
|
-
var _el$3 = _tmpl$6$
|
|
558
|
+
var _el$3 = _tmpl$6$7();
|
|
487
559
|
insert(_el$3, createComponent(Show, {
|
|
488
560
|
get when() {
|
|
489
561
|
return own.input !== void 0;
|
|
490
562
|
},
|
|
491
563
|
get children() {
|
|
492
564
|
return [_tmpl$3$17(), (() => {
|
|
493
|
-
var _el$5 = _tmpl$4$
|
|
565
|
+
var _el$5 = _tmpl$4$13();
|
|
494
566
|
insert(_el$5, () => own.input);
|
|
495
567
|
return _el$5;
|
|
496
568
|
})()];
|
|
@@ -501,8 +573,8 @@ function Tool(props) {
|
|
|
501
573
|
return own.output !== void 0;
|
|
502
574
|
},
|
|
503
575
|
get children() {
|
|
504
|
-
return [_tmpl$5$
|
|
505
|
-
var _el$7 = _tmpl$4$
|
|
576
|
+
return [_tmpl$5$10(), (() => {
|
|
577
|
+
var _el$7 = _tmpl$4$13();
|
|
506
578
|
insert(_el$7, () => own.output);
|
|
507
579
|
return _el$7;
|
|
508
580
|
})()];
|
|
@@ -576,8 +648,8 @@ injectComponentStyle("ai");
|
|
|
576
648
|
var _tmpl$$48 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><rect x=2.5 y=3.5 width=11 height=9></rect><path d="M2.5 10.5 6 7l3 3 2-1.5 2.5 2"></path><circle cx=6 cy=6 r=0.75 fill=currentColor stroke=none>`);
|
|
577
649
|
var _tmpl$2$24 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><path d="M4 2.5h5l3 3V13.5H4z"></path><path d="M9 2.5v3h3">`);
|
|
578
650
|
var _tmpl$3$16 = /*#__PURE__*/ template(`<svg viewBox="0 0 16 16"width=12 height=12 aria-hidden=true fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=square><path d="M4 4l8 8M12 4l-8 8">`);
|
|
579
|
-
var _tmpl$4$
|
|
580
|
-
var _tmpl$5$
|
|
651
|
+
var _tmpl$4$12 = /*#__PURE__*/ template(`<span><span></span><button type=button data-remove>`);
|
|
652
|
+
var _tmpl$5$9 = /*#__PURE__*/ template(`<span>`);
|
|
581
653
|
function imageGlyph() {
|
|
582
654
|
return _tmpl$$48();
|
|
583
655
|
}
|
|
@@ -625,7 +697,7 @@ function Attachment(props) {
|
|
|
625
697
|
"onRemove"
|
|
626
698
|
]);
|
|
627
699
|
return (() => {
|
|
628
|
-
var _el$4 = _tmpl$4$
|
|
700
|
+
var _el$4 = _tmpl$4$12(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling;
|
|
629
701
|
spread(_el$4, mergeProps(rest, {
|
|
630
702
|
"data-scope": "ai",
|
|
631
703
|
"data-part": "attachment",
|
|
@@ -641,7 +713,7 @@ function Attachment(props) {
|
|
|
641
713
|
insert(_el$4, (() => {
|
|
642
714
|
var _c$2 = memo(() => own.size !== void 0);
|
|
643
715
|
return () => _c$2() ? (() => {
|
|
644
|
-
var _el$7 = _tmpl$5$
|
|
716
|
+
var _el$7 = _tmpl$5$9();
|
|
645
717
|
insert(_el$7, () => humanSize(own.size));
|
|
646
718
|
return _el$7;
|
|
647
719
|
})() : null;
|
|
@@ -655,7 +727,7 @@ function Attachment(props) {
|
|
|
655
727
|
/** The row the files ride in — a wrapping line of chips. */
|
|
656
728
|
function Attachments(props) {
|
|
657
729
|
return (() => {
|
|
658
|
-
var _el$8 = _tmpl$5$
|
|
730
|
+
var _el$8 = _tmpl$5$9();
|
|
659
731
|
spread(_el$8, mergeProps(props, {
|
|
660
732
|
"data-scope": "ai",
|
|
661
733
|
"data-part": "attachments"
|
|
@@ -670,7 +742,7 @@ delegateEvents(["click"]);
|
|
|
670
742
|
var _tmpl$$47 = /*#__PURE__*/ template(`<svg width=16 height=16 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.75 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path>`);
|
|
671
743
|
var _tmpl$2$23 = /*#__PURE__*/ template(`<div>`);
|
|
672
744
|
var _tmpl$3$15 = /*#__PURE__*/ template(`<span data-scope=alert data-part=icon>`);
|
|
673
|
-
var _tmpl$4$
|
|
745
|
+
var _tmpl$4$11 = /*#__PURE__*/ template(`<p>`);
|
|
674
746
|
const StatusContext = createContext(() => "ink");
|
|
675
747
|
function glyph(status) {
|
|
676
748
|
const paths = {
|
|
@@ -727,7 +799,7 @@ function Body$2(props) {
|
|
|
727
799
|
}
|
|
728
800
|
function Title$4(props) {
|
|
729
801
|
return (() => {
|
|
730
|
-
var _el$6 = _tmpl$4$
|
|
802
|
+
var _el$6 = _tmpl$4$11();
|
|
731
803
|
spread(_el$6, mergeProps(props, {
|
|
732
804
|
"data-scope": "alert",
|
|
733
805
|
"data-part": "title"
|
|
@@ -737,7 +809,7 @@ function Title$4(props) {
|
|
|
737
809
|
}
|
|
738
810
|
function Description$5(props) {
|
|
739
811
|
return (() => {
|
|
740
|
-
var _el$7 = _tmpl$4$
|
|
812
|
+
var _el$7 = _tmpl$4$11();
|
|
741
813
|
spread(_el$7, mergeProps(props, {
|
|
742
814
|
"data-scope": "alert",
|
|
743
815
|
"data-part": "description"
|
|
@@ -848,11 +920,14 @@ function AutoComplete(props) {
|
|
|
848
920
|
}
|
|
849
921
|
injectComponentStyle("combobox");
|
|
850
922
|
//#endregion
|
|
851
|
-
//#region src/components/avatar/index.
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
923
|
+
//#region src/components/avatar/index.tsx
|
|
924
|
+
function AvatarRoot(props) {
|
|
925
|
+
const [own, rest] = splitProps(props, ["size"]);
|
|
926
|
+
return createComponent(Avatar$1.Root, mergeProps(rest, { get ["data-size"]() {
|
|
927
|
+
return own.size;
|
|
928
|
+
} }));
|
|
929
|
+
}
|
|
930
|
+
const Avatar = Object.assign({}, Avatar$1, { Root: AvatarRoot });
|
|
856
931
|
injectComponentStyle("avatar");
|
|
857
932
|
//#endregion
|
|
858
933
|
//#region src/components/avatar-group/index.tsx
|
|
@@ -877,26 +952,55 @@ var _tmpl$2$22 = /*#__PURE__*/ template(`<svg width=16 height=16 viewBox="0 0 24
|
|
|
877
952
|
* floating control rises at the page's corner and returns the reader to
|
|
878
953
|
* the top. The scroll itself stays native — `window.scrollTo` defers to
|
|
879
954
|
* the stylesheet's `scroll-behavior: smooth`, which reduced motion turns
|
|
880
|
-
* back into an instant jump
|
|
881
|
-
*
|
|
955
|
+
* back into an instant jump (a moored control asks the media query
|
|
956
|
+
* directly, since a scroller of its own has no stylesheet to defer to).
|
|
957
|
+
* The button stays mounted either way so the entrance is a transition,
|
|
958
|
+
* never a pop.
|
|
882
959
|
*
|
|
883
960
|
* The control itself is the shared `Button` (outline, square) — the
|
|
884
961
|
* paper, hairline and halo are its; this family owns only the floating
|
|
885
962
|
* and the entrance.
|
|
886
963
|
*/
|
|
887
964
|
function BackTop(props) {
|
|
888
|
-
const [own, rest] = splitProps(props, [
|
|
965
|
+
const [own, rest] = splitProps(props, [
|
|
966
|
+
"threshold",
|
|
967
|
+
"label",
|
|
968
|
+
"scrollEl"
|
|
969
|
+
]);
|
|
889
970
|
const [visible, setVisible] = createSignal(false);
|
|
971
|
+
const scroller = () => own.scrollEl?.() ?? null;
|
|
890
972
|
const onScroll = () => {
|
|
891
|
-
|
|
973
|
+
const el = scroller();
|
|
974
|
+
setVisible((el ? el.scrollTop : window.scrollY) > (own.threshold ?? 400));
|
|
975
|
+
};
|
|
976
|
+
const toTop = () => {
|
|
977
|
+
const el = scroller();
|
|
978
|
+
if (!el) {
|
|
979
|
+
window.scrollTo({ top: 0 });
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
983
|
+
el.scrollTo({
|
|
984
|
+
top: 0,
|
|
985
|
+
behavior: reduce ? "auto" : "smooth"
|
|
986
|
+
});
|
|
892
987
|
};
|
|
893
988
|
onMount(() => {
|
|
989
|
+
const el = scroller();
|
|
894
990
|
onScroll();
|
|
895
|
-
|
|
991
|
+
if (el) el.addEventListener("scroll", onScroll, { passive: true });
|
|
992
|
+
else window.addEventListener("scroll", onScroll, { passive: true });
|
|
993
|
+
});
|
|
994
|
+
onCleanup(() => {
|
|
995
|
+
const el = scroller();
|
|
996
|
+
if (el) el.removeEventListener("scroll", onScroll);
|
|
997
|
+
else window.removeEventListener("scroll", onScroll);
|
|
896
998
|
});
|
|
897
|
-
onCleanup(() => window.removeEventListener("scroll", onScroll));
|
|
898
999
|
return (() => {
|
|
899
1000
|
var _el$ = _tmpl$$44();
|
|
1001
|
+
spread(_el$, mergeProps({ get ["data-state"]() {
|
|
1002
|
+
return visible() ? "shown" : "hidden";
|
|
1003
|
+
} }, () => scroller() ? { "data-container": "" } : {}), false, true);
|
|
900
1004
|
insert(_el$, createComponent(Button, mergeProps(rest, {
|
|
901
1005
|
variant: "outline",
|
|
902
1006
|
square: true,
|
|
@@ -910,12 +1014,11 @@ function BackTop(props) {
|
|
|
910
1014
|
get tabindex() {
|
|
911
1015
|
return visible() ? 0 : -1;
|
|
912
1016
|
},
|
|
913
|
-
onClick:
|
|
1017
|
+
onClick: toTop,
|
|
914
1018
|
get children() {
|
|
915
1019
|
return rest.children ?? chevronUp();
|
|
916
1020
|
}
|
|
917
1021
|
})));
|
|
918
|
-
effect(() => setAttribute(_el$, "data-state", visible() ? "shown" : "hidden"));
|
|
919
1022
|
return _el$;
|
|
920
1023
|
})();
|
|
921
1024
|
}
|
|
@@ -1319,17 +1422,57 @@ injectComponentStyle("card");
|
|
|
1319
1422
|
const Carousel = Carousel$1;
|
|
1320
1423
|
injectComponentStyle("carousel");
|
|
1321
1424
|
//#endregion
|
|
1425
|
+
//#region src/components/input/index.tsx
|
|
1426
|
+
var _tmpl$$38 = /*#__PURE__*/ template(`<input>`);
|
|
1427
|
+
/** The bare text input: the field recipe — border, surface, focus halo —
|
|
1428
|
+
* on a native control. Standing alone it styles itself from the `invalid`
|
|
1429
|
+
* prop; inside a `Field.Root` it consumes the field context, picking up
|
|
1430
|
+
* the label id, the described-by wiring and the invalid state for free,
|
|
1431
|
+
* which is also the seam the Form validation layer will drive. Disabled
|
|
1432
|
+
* rides the native attribute. */
|
|
1433
|
+
function Input(props) {
|
|
1434
|
+
const field = useFieldContext();
|
|
1435
|
+
const [own, rest] = splitProps(props, [
|
|
1436
|
+
"value",
|
|
1437
|
+
"size",
|
|
1438
|
+
"invalid",
|
|
1439
|
+
"onValueChange"
|
|
1440
|
+
]);
|
|
1441
|
+
return (() => {
|
|
1442
|
+
var _el$ = _tmpl$$38();
|
|
1443
|
+
spread(_el$, mergeProps(() => mergeProps$1(() => field?.().getInputProps() ?? {}, rest, {
|
|
1444
|
+
get value() {
|
|
1445
|
+
return own.value;
|
|
1446
|
+
},
|
|
1447
|
+
"data-scope": "input",
|
|
1448
|
+
"data-part": "root",
|
|
1449
|
+
get "data-size"() {
|
|
1450
|
+
return own.size ?? "md";
|
|
1451
|
+
},
|
|
1452
|
+
get "data-invalid"() {
|
|
1453
|
+
return own.invalid || field?.().getInputProps()["data-invalid"] != null ? "" : void 0;
|
|
1454
|
+
},
|
|
1455
|
+
onInput: (event) => own.onValueChange?.(event.currentTarget.value)
|
|
1456
|
+
})), false, false);
|
|
1457
|
+
return _el$;
|
|
1458
|
+
})();
|
|
1459
|
+
}
|
|
1460
|
+
injectComponentStyle("input");
|
|
1461
|
+
//#endregion
|
|
1322
1462
|
//#region src/components/cascade-select/index.tsx
|
|
1323
|
-
var _tmpl$$
|
|
1463
|
+
var _tmpl$$37 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m6 9 6 6 6-6">`);
|
|
1324
1464
|
var _tmpl$2$19 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 18 6-6-6-6">`);
|
|
1325
1465
|
var _tmpl$3$13 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
|
|
1326
|
-
var _tmpl$4$
|
|
1327
|
-
var _tmpl$5$
|
|
1328
|
-
var _tmpl$6$
|
|
1329
|
-
var _tmpl$7$2 = /*#__PURE__*/ template(`<div
|
|
1330
|
-
var _tmpl$8$2 = /*#__PURE__*/ template(`<div><div
|
|
1466
|
+
var _tmpl$4$10 = /*#__PURE__*/ template(`<ul>`);
|
|
1467
|
+
var _tmpl$5$8 = /*#__PURE__*/ template(`<span data-part=branch-indicator aria-hidden=true>`);
|
|
1468
|
+
var _tmpl$6$6 = /*#__PURE__*/ template(`<li><span></span><span>`);
|
|
1469
|
+
var _tmpl$7$2 = /*#__PURE__*/ template(`<div data-part=search>`);
|
|
1470
|
+
var _tmpl$8$2 = /*#__PURE__*/ template(`<div><div>`);
|
|
1471
|
+
var _tmpl$9$2 = /*#__PURE__*/ template(`<div><div><button><span></span><span>`);
|
|
1472
|
+
var _tmpl$0$2 = /*#__PURE__*/ template(`<p data-part=empty>Nothing matches`);
|
|
1473
|
+
var _tmpl$1$2 = /*#__PURE__*/ template(`<button type=button data-part=match>`);
|
|
1331
1474
|
function chevronDown$1() {
|
|
1332
|
-
return _tmpl$$
|
|
1475
|
+
return _tmpl$$37();
|
|
1333
1476
|
}
|
|
1334
1477
|
function chevronRight() {
|
|
1335
1478
|
return _tmpl$2$19();
|
|
@@ -1342,7 +1485,9 @@ function checkGlyph$2() {
|
|
|
1342
1485
|
* dissolves open beside it, until a leaf click settles the whole path.
|
|
1343
1486
|
* `value` is the selected path (or paths, when `multiple`) — the
|
|
1344
1487
|
* joined labels ride the trigger. `highlightTrigger: "hover"` turns the
|
|
1345
|
-
* classic cascading menu: pointing is enough to unfold.
|
|
1488
|
+
* classic cascading menu: pointing is enough to unfold. `filterable`
|
|
1489
|
+
* swaps the corridor for a flat list of matching paths while a query
|
|
1490
|
+
* runs — each hit still reads as its full route.
|
|
1346
1491
|
*/
|
|
1347
1492
|
function CascadeSelect(props) {
|
|
1348
1493
|
const [own, rest] = splitProps(props, [
|
|
@@ -1350,6 +1495,7 @@ function CascadeSelect(props) {
|
|
|
1350
1495
|
"data",
|
|
1351
1496
|
"placeholder",
|
|
1352
1497
|
"highlightTrigger",
|
|
1498
|
+
"filterable",
|
|
1353
1499
|
"multiple",
|
|
1354
1500
|
"disabled",
|
|
1355
1501
|
"onValueChange"
|
|
@@ -1381,6 +1527,42 @@ function CascadeSelect(props) {
|
|
|
1381
1527
|
}
|
|
1382
1528
|
}));
|
|
1383
1529
|
const api = createMemo(() => cascade.connect(service, normalizeProps));
|
|
1530
|
+
const [query, setQuery] = createSignal("");
|
|
1531
|
+
const filterFns = useFilter({ sensitivity: "base" });
|
|
1532
|
+
const filtering = () => own.filterable && query().trim().length > 0;
|
|
1533
|
+
/** The corridor's answer to a query: every leaf whose route matches —
|
|
1534
|
+
* the query may land on any hop, and the whole route still shows. */
|
|
1535
|
+
const matchPaths = createMemo(() => {
|
|
1536
|
+
if (!filtering()) return [];
|
|
1537
|
+
const q = query().trim();
|
|
1538
|
+
const hits = [];
|
|
1539
|
+
const walk = (nodes, path, labels, matched) => {
|
|
1540
|
+
for (const node of nodes ?? []) {
|
|
1541
|
+
const hit = matched || filterFns().contains(node.label, q);
|
|
1542
|
+
const nextPath = [...path, node.value];
|
|
1543
|
+
const nextLabels = [...labels, node.label];
|
|
1544
|
+
if (node.children?.length) walk(node.children, nextPath, nextLabels, hit);
|
|
1545
|
+
else if (hit) hits.push({
|
|
1546
|
+
path: nextPath,
|
|
1547
|
+
labels: nextLabels
|
|
1548
|
+
});
|
|
1549
|
+
}
|
|
1550
|
+
};
|
|
1551
|
+
walk(own.data, [], [], false);
|
|
1552
|
+
return hits;
|
|
1553
|
+
});
|
|
1554
|
+
const isSelected = (path) => (own.value ?? []).some((p) => p.join("/") === path.join("/"));
|
|
1555
|
+
function pickMatch(path) {
|
|
1556
|
+
if (own.multiple) {
|
|
1557
|
+
const current = own.value ?? [];
|
|
1558
|
+
const key = path.join("/");
|
|
1559
|
+
const next = current.some((p) => p.join("/") === key) ? current.filter((p) => p.join("/") !== key) : [...current, path];
|
|
1560
|
+
api().setValue(next);
|
|
1561
|
+
} else {
|
|
1562
|
+
api().selectValue(path);
|
|
1563
|
+
api().setOpen(false);
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1384
1566
|
/** The machine's `valueAsString` only updates through its select
|
|
1385
1567
|
* event, so an externally-set `value` would render the
|
|
1386
1568
|
* placeholder forever — resolve the labels from the data instead. */
|
|
@@ -1410,7 +1592,7 @@ function CascadeSelect(props) {
|
|
|
1410
1592
|
const nodeState = () => api().getItemState(nodeProps);
|
|
1411
1593
|
const children = collection().getNodeChildren(node);
|
|
1412
1594
|
const list = (() => {
|
|
1413
|
-
var _el$4 = _tmpl$4$
|
|
1595
|
+
var _el$4 = _tmpl$4$10();
|
|
1414
1596
|
spread(_el$4, mergeProps(() => mergeProps$1(() => api().getListProps(nodeProps))), false, true);
|
|
1415
1597
|
insert(_el$4, createComponent(For, {
|
|
1416
1598
|
each: children,
|
|
@@ -1423,7 +1605,7 @@ function CascadeSelect(props) {
|
|
|
1423
1605
|
};
|
|
1424
1606
|
const itemState = () => api().getItemState(itemProps);
|
|
1425
1607
|
return (() => {
|
|
1426
|
-
var _el$5 = _tmpl$6$
|
|
1608
|
+
var _el$5 = _tmpl$6$6(), _el$6 = _el$5.firstChild, _el$8 = _el$6.nextSibling;
|
|
1427
1609
|
spread(_el$5, mergeProps(() => mergeProps$1(() => api().getItemProps(itemProps))), false, true);
|
|
1428
1610
|
spread(_el$6, mergeProps(() => mergeProps$1(() => api().getItemTextProps(itemProps))), false, true);
|
|
1429
1611
|
insert(_el$6, () => item.label);
|
|
@@ -1432,7 +1614,7 @@ function CascadeSelect(props) {
|
|
|
1432
1614
|
return itemState().hasChildren;
|
|
1433
1615
|
},
|
|
1434
1616
|
get children() {
|
|
1435
|
-
var _el$7 = _tmpl$5$
|
|
1617
|
+
var _el$7 = _tmpl$5$8();
|
|
1436
1618
|
insert(_el$7, chevronRight);
|
|
1437
1619
|
return _el$7;
|
|
1438
1620
|
}
|
|
@@ -1449,27 +1631,83 @@ function CascadeSelect(props) {
|
|
|
1449
1631
|
return [list, next != null && collection().isBranchNode(next) ? renderColumn(next, [...indexPath, nodeState().highlightedIndex], [...valuePath, collection().getNodeValue(next)]) : null];
|
|
1450
1632
|
}
|
|
1451
1633
|
return (() => {
|
|
1452
|
-
var _el$9 = _tmpl$
|
|
1634
|
+
var _el$9 = _tmpl$9$2(), _el$0 = _el$9.firstChild, _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling;
|
|
1453
1635
|
spread(_el$9, mergeProps(rest, () => mergeProps$1(() => api().getRootProps())), false, true);
|
|
1454
1636
|
spread(_el$0, mergeProps(() => mergeProps$1(() => api().getControlProps())), false, true);
|
|
1455
|
-
spread(_el$1, mergeProps(() => mergeProps$1(() => api().getTriggerProps(), {
|
|
1456
|
-
|
|
1457
|
-
|
|
1637
|
+
spread(_el$1, mergeProps(() => mergeProps$1(() => api().getTriggerProps(), {
|
|
1638
|
+
get disabled() {
|
|
1639
|
+
return own.disabled || void 0;
|
|
1640
|
+
},
|
|
1641
|
+
onclick(event) {
|
|
1642
|
+
api().getTriggerProps().onclick?.(event);
|
|
1643
|
+
setQuery("");
|
|
1644
|
+
}
|
|
1645
|
+
})), false, true);
|
|
1458
1646
|
spread(_el$10, mergeProps(() => mergeProps$1(() => api().getValueTextProps())), false, true);
|
|
1459
1647
|
insert(_el$10, () => display() ?? own.placeholder ?? "Select…");
|
|
1460
1648
|
spread(_el$11, mergeProps(() => mergeProps$1(() => api().getIndicatorProps())), false, true);
|
|
1461
1649
|
insert(_el$11, chevronDown$1);
|
|
1462
1650
|
insert(_el$9, createComponent(Portal, { get children() {
|
|
1463
|
-
var _el$12 = _tmpl$
|
|
1651
|
+
var _el$12 = _tmpl$8$2(), _el$13 = _el$12.firstChild;
|
|
1464
1652
|
spread(_el$12, mergeProps(() => mergeProps$1(() => api().getPositionerProps())), false, true);
|
|
1465
1653
|
spread(_el$13, mergeProps(() => mergeProps$1(() => api().getContentProps())), false, true);
|
|
1466
|
-
insert(_el$13, (
|
|
1654
|
+
insert(_el$13, createComponent(Show, {
|
|
1655
|
+
get when() {
|
|
1656
|
+
return own.filterable;
|
|
1657
|
+
},
|
|
1658
|
+
get children() {
|
|
1659
|
+
var _el$14 = _tmpl$7$2();
|
|
1660
|
+
insert(_el$14, createComponent(Input, {
|
|
1661
|
+
size: "sm",
|
|
1662
|
+
get value() {
|
|
1663
|
+
return query();
|
|
1664
|
+
},
|
|
1665
|
+
onValueChange: setQuery,
|
|
1666
|
+
placeholder: "Filter…",
|
|
1667
|
+
"aria-label": "Filter options"
|
|
1668
|
+
}));
|
|
1669
|
+
return _el$14;
|
|
1670
|
+
}
|
|
1671
|
+
}), null);
|
|
1672
|
+
insert(_el$13, createComponent(Show, {
|
|
1673
|
+
get when() {
|
|
1674
|
+
return !filtering();
|
|
1675
|
+
},
|
|
1676
|
+
get fallback() {
|
|
1677
|
+
return createComponent(Show, {
|
|
1678
|
+
get when() {
|
|
1679
|
+
return matchPaths().length > 0;
|
|
1680
|
+
},
|
|
1681
|
+
get fallback() {
|
|
1682
|
+
return _tmpl$0$2();
|
|
1683
|
+
},
|
|
1684
|
+
get children() {
|
|
1685
|
+
return createComponent(For, {
|
|
1686
|
+
get each() {
|
|
1687
|
+
return matchPaths();
|
|
1688
|
+
},
|
|
1689
|
+
children: (hit) => (() => {
|
|
1690
|
+
var _el$16 = _tmpl$1$2();
|
|
1691
|
+
_el$16.$$click = () => pickMatch(hit.path);
|
|
1692
|
+
insert(_el$16, () => hit.labels.join(" / "));
|
|
1693
|
+
effect(() => setAttribute(_el$16, "data-selected", isSelected(hit.path) || void 0));
|
|
1694
|
+
return _el$16;
|
|
1695
|
+
})()
|
|
1696
|
+
});
|
|
1697
|
+
}
|
|
1698
|
+
});
|
|
1699
|
+
},
|
|
1700
|
+
get children() {
|
|
1701
|
+
return renderColumn(collection().rootNode, [], []);
|
|
1702
|
+
}
|
|
1703
|
+
}), null);
|
|
1467
1704
|
return _el$12;
|
|
1468
1705
|
} }), null);
|
|
1469
1706
|
return _el$9;
|
|
1470
1707
|
})();
|
|
1471
1708
|
}
|
|
1472
1709
|
injectComponentStyle("cascade-select");
|
|
1710
|
+
delegateEvents(["click"]);
|
|
1473
1711
|
//#endregion
|
|
1474
1712
|
//#region src/components/checkbox/index.ts
|
|
1475
1713
|
/** Ark's Checkbox, dressed in the paper-and-ink system: a square-cut seal
|
|
@@ -1480,26 +1718,32 @@ const Checkbox = Checkbox$1;
|
|
|
1480
1718
|
injectComponentStyle("checkbox");
|
|
1481
1719
|
//#endregion
|
|
1482
1720
|
//#region src/components/checkbox-group/index.tsx
|
|
1483
|
-
var _tmpl$$
|
|
1721
|
+
var _tmpl$$36 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
|
|
1484
1722
|
var _tmpl$2$18 = /*#__PURE__*/ template(`<div>`);
|
|
1485
1723
|
function checkGlyph$1() {
|
|
1486
|
-
return _tmpl$$
|
|
1724
|
+
return _tmpl$$36();
|
|
1487
1725
|
}
|
|
1488
1726
|
/**
|
|
1489
1727
|
* One question, many answers: a labelled stack (or row) of the seal-cut
|
|
1490
1728
|
* checkboxes bound to a single array. Toggling a box adds or removes its
|
|
1491
1729
|
* value; the group itself is semantics (`role="group"`), the boxes stay
|
|
1492
|
-
* the machine-driven originals.
|
|
1730
|
+
* the machine-driven originals. Inside a `Field.Root` the group picks up
|
|
1731
|
+
* the field context, so the invalid and disabled states a Form routes to
|
|
1732
|
+
* its name dress every box at once.
|
|
1493
1733
|
*/
|
|
1494
1734
|
function CheckboxGroup(props) {
|
|
1735
|
+
const field = useFieldContext();
|
|
1495
1736
|
const [own, rest] = splitProps(props, [
|
|
1496
1737
|
"value",
|
|
1497
1738
|
"options",
|
|
1498
1739
|
"layout",
|
|
1740
|
+
"invalid",
|
|
1499
1741
|
"disabled",
|
|
1500
1742
|
"onValueChange"
|
|
1501
1743
|
]);
|
|
1502
1744
|
const selected = () => new Set(own.value ?? []);
|
|
1745
|
+
const isInvalid = () => own.invalid || field?.().invalid === true;
|
|
1746
|
+
const isDisabled = () => own.disabled || field?.().disabled === true;
|
|
1503
1747
|
function toggle(value) {
|
|
1504
1748
|
const next = new Set(selected());
|
|
1505
1749
|
if (next.has(value)) next.delete(value);
|
|
@@ -1514,6 +1758,9 @@ function CheckboxGroup(props) {
|
|
|
1514
1758
|
"data-part": "root",
|
|
1515
1759
|
get ["data-layout"]() {
|
|
1516
1760
|
return own.layout ?? "vertical";
|
|
1761
|
+
},
|
|
1762
|
+
get ["data-invalid"]() {
|
|
1763
|
+
return isInvalid() ? "" : void 0;
|
|
1517
1764
|
}
|
|
1518
1765
|
}), false, true);
|
|
1519
1766
|
insert(_el$2, createComponent(For, {
|
|
@@ -1524,8 +1771,11 @@ function CheckboxGroup(props) {
|
|
|
1524
1771
|
get checked() {
|
|
1525
1772
|
return selected().has(option.value);
|
|
1526
1773
|
},
|
|
1774
|
+
get invalid() {
|
|
1775
|
+
return isInvalid();
|
|
1776
|
+
},
|
|
1527
1777
|
get disabled() {
|
|
1528
|
-
return
|
|
1778
|
+
return isDisabled() || option.disabled === true;
|
|
1529
1779
|
},
|
|
1530
1780
|
onCheckedChange: () => toggle(option.value),
|
|
1531
1781
|
get children() {
|
|
@@ -1550,7 +1800,7 @@ injectComponentStyle("checkbox-group");
|
|
|
1550
1800
|
injectComponentStyle("checkbox");
|
|
1551
1801
|
//#endregion
|
|
1552
1802
|
//#region src/components/chip/index.tsx
|
|
1553
|
-
var _tmpl$$
|
|
1803
|
+
var _tmpl$$35 = /*#__PURE__*/ template(`<span>`);
|
|
1554
1804
|
function Chip(props) {
|
|
1555
1805
|
const [own, rest] = splitProps(props, [
|
|
1556
1806
|
"value",
|
|
@@ -1559,7 +1809,7 @@ function Chip(props) {
|
|
|
1559
1809
|
"variant"
|
|
1560
1810
|
]);
|
|
1561
1811
|
return (() => {
|
|
1562
|
-
var _el$ = _tmpl$$
|
|
1812
|
+
var _el$ = _tmpl$$35();
|
|
1563
1813
|
spread(_el$, mergeProps(rest, {
|
|
1564
1814
|
"data-scope": "chip",
|
|
1565
1815
|
"data-part": "root",
|
|
@@ -1609,11 +1859,11 @@ const Combobox = Combobox$1;
|
|
|
1609
1859
|
injectComponentStyle("combobox");
|
|
1610
1860
|
//#endregion
|
|
1611
1861
|
//#region src/components/command/index.tsx
|
|
1612
|
-
var _tmpl$$
|
|
1862
|
+
var _tmpl$$34 = /*#__PURE__*/ template(`<span data-scope=command data-part=item-hint>`);
|
|
1613
1863
|
var _tmpl$2$17 = /*#__PURE__*/ template(`<div>`);
|
|
1614
1864
|
var _tmpl$3$12 = /*#__PURE__*/ template(`<span>`);
|
|
1615
|
-
var _tmpl$4$
|
|
1616
|
-
var _tmpl$5$
|
|
1865
|
+
var _tmpl$4$9 = /*#__PURE__*/ template(`<input>`);
|
|
1866
|
+
var _tmpl$5$7 = /*#__PURE__*/ template(`<div data-scope=command data-part=empty>`);
|
|
1617
1867
|
/** A command row: the machine's item grafted onto a vessel of our own,
|
|
1618
1868
|
* the label riding the machine's item text. */
|
|
1619
1869
|
function Row(props) {
|
|
@@ -1641,7 +1891,7 @@ function Row(props) {
|
|
|
1641
1891
|
return props.entry.hint;
|
|
1642
1892
|
},
|
|
1643
1893
|
get children() {
|
|
1644
|
-
var _el$2 = _tmpl$$
|
|
1894
|
+
var _el$2 = _tmpl$$34();
|
|
1645
1895
|
insert(_el$2, () => props.entry.hint);
|
|
1646
1896
|
return _el$2;
|
|
1647
1897
|
}
|
|
@@ -1754,7 +2004,7 @@ function Command(props) {
|
|
|
1754
2004
|
},
|
|
1755
2005
|
get children() {
|
|
1756
2006
|
return [createComponent(Combobox$1.Input, { asChild: (inputProps) => (() => {
|
|
1757
|
-
var _el$6 = _tmpl$4$
|
|
2007
|
+
var _el$6 = _tmpl$4$9();
|
|
1758
2008
|
spread(_el$6, mergeProps(inputProps, {
|
|
1759
2009
|
"type": "text",
|
|
1760
2010
|
get placeholder() {
|
|
@@ -1818,7 +2068,7 @@ function Command(props) {
|
|
|
1818
2068
|
return sections().length === 0;
|
|
1819
2069
|
},
|
|
1820
2070
|
get children() {
|
|
1821
|
-
var _el$8 = _tmpl$5$
|
|
2071
|
+
var _el$8 = _tmpl$5$7();
|
|
1822
2072
|
insert(_el$8, () => own.emptyText ?? "No matching commands");
|
|
1823
2073
|
return _el$8;
|
|
1824
2074
|
}
|
|
@@ -1839,12 +2089,12 @@ injectComponentStyle("command");
|
|
|
1839
2089
|
injectComponentStyle("dialog");
|
|
1840
2090
|
//#endregion
|
|
1841
2091
|
//#region src/components/comment/index.tsx
|
|
1842
|
-
var _tmpl$$
|
|
2092
|
+
var _tmpl$$33 = /*#__PURE__*/ template(`<div data-scope=comment data-part=avatar>`);
|
|
1843
2093
|
var _tmpl$2$16 = /*#__PURE__*/ template(`<span data-scope=comment data-part=author>`);
|
|
1844
2094
|
var _tmpl$3$11 = /*#__PURE__*/ template(`<time data-scope=comment data-part=datetime>`);
|
|
1845
|
-
var _tmpl$4$
|
|
1846
|
-
var _tmpl$5$
|
|
1847
|
-
var _tmpl$6$
|
|
2095
|
+
var _tmpl$4$8 = /*#__PURE__*/ template(`<header data-scope=comment data-part=header>`);
|
|
2096
|
+
var _tmpl$5$6 = /*#__PURE__*/ template(`<div data-scope=comment data-part=actions>`);
|
|
2097
|
+
var _tmpl$6$5 = /*#__PURE__*/ template(`<article><div data-scope=comment data-part=body><div data-scope=comment data-part=content>`);
|
|
1848
2098
|
/**
|
|
1849
2099
|
* A voice on the record: the portrait hangs left (the `avatar` prop),
|
|
1850
2100
|
* the body carries the byline from `author` and `datetime`, the ink is
|
|
@@ -1859,7 +2109,7 @@ function Comment(props) {
|
|
|
1859
2109
|
"children"
|
|
1860
2110
|
]);
|
|
1861
2111
|
return (() => {
|
|
1862
|
-
var _el$ = _tmpl$6$
|
|
2112
|
+
var _el$ = _tmpl$6$5(), _el$3 = _el$.firstChild, _el$7 = _el$3.firstChild;
|
|
1863
2113
|
spread(_el$, mergeProps(rest, {
|
|
1864
2114
|
"data-scope": "comment",
|
|
1865
2115
|
"data-part": "root"
|
|
@@ -1869,7 +2119,7 @@ function Comment(props) {
|
|
|
1869
2119
|
return own.avatar;
|
|
1870
2120
|
},
|
|
1871
2121
|
get children() {
|
|
1872
|
-
var _el$2 = _tmpl$$
|
|
2122
|
+
var _el$2 = _tmpl$$33();
|
|
1873
2123
|
insert(_el$2, () => own.avatar);
|
|
1874
2124
|
return _el$2;
|
|
1875
2125
|
}
|
|
@@ -1879,7 +2129,7 @@ function Comment(props) {
|
|
|
1879
2129
|
return own.author || own.datetime;
|
|
1880
2130
|
},
|
|
1881
2131
|
get children() {
|
|
1882
|
-
var _el$4 = _tmpl$4$
|
|
2132
|
+
var _el$4 = _tmpl$4$8();
|
|
1883
2133
|
insert(_el$4, createComponent(Show, {
|
|
1884
2134
|
get when() {
|
|
1885
2135
|
return own.author;
|
|
@@ -1910,7 +2160,7 @@ function Comment(props) {
|
|
|
1910
2160
|
return own.actions;
|
|
1911
2161
|
},
|
|
1912
2162
|
get children() {
|
|
1913
|
-
var _el$8 = _tmpl$5$
|
|
2163
|
+
var _el$8 = _tmpl$5$6();
|
|
1914
2164
|
insert(_el$8, () => own.actions);
|
|
1915
2165
|
return _el$8;
|
|
1916
2166
|
}
|
|
@@ -1921,7 +2171,7 @@ function Comment(props) {
|
|
|
1921
2171
|
injectComponentStyle("comment");
|
|
1922
2172
|
//#endregion
|
|
1923
2173
|
//#region src/components/config-provider/index.tsx
|
|
1924
|
-
var _tmpl$$
|
|
2174
|
+
var _tmpl$$32 = /*#__PURE__*/ template(`<div>`);
|
|
1925
2175
|
/** Solid context for the provider's snapshot — a custom part reads it
|
|
1926
2176
|
* with `useContext(ConfigContextKey)`. */
|
|
1927
2177
|
const ConfigContextKey = createContext(() => ({}));
|
|
@@ -1954,7 +2204,7 @@ function ConfigProvider(props) {
|
|
|
1954
2204
|
locale: own.locale
|
|
1955
2205
|
}),
|
|
1956
2206
|
get children() {
|
|
1957
|
-
var _el$ = _tmpl$$
|
|
2207
|
+
var _el$ = _tmpl$$32();
|
|
1958
2208
|
spread(_el$, mergeProps(rest, {
|
|
1959
2209
|
"data-scope": "config-provider",
|
|
1960
2210
|
"data-part": "root",
|
|
@@ -1978,11 +2228,11 @@ function ConfigProvider(props) {
|
|
|
1978
2228
|
}
|
|
1979
2229
|
//#endregion
|
|
1980
2230
|
//#region src/components/container/index.tsx
|
|
1981
|
-
var _tmpl$$
|
|
2231
|
+
var _tmpl$$31 = /*#__PURE__*/ template(`<div>`);
|
|
1982
2232
|
function Container(props) {
|
|
1983
2233
|
const [own, rest] = splitProps(props, ["size", "padding"]);
|
|
1984
2234
|
return (() => {
|
|
1985
|
-
var _el$ = _tmpl$$
|
|
2235
|
+
var _el$ = _tmpl$$31();
|
|
1986
2236
|
spread(_el$, mergeProps(rest, {
|
|
1987
2237
|
"data-scope": "container",
|
|
1988
2238
|
"data-part": "root",
|
|
@@ -2017,11 +2267,11 @@ const DatePicker = DatePicker$1;
|
|
|
2017
2267
|
injectComponentStyle("date-picker");
|
|
2018
2268
|
//#endregion
|
|
2019
2269
|
//#region src/components/descriptions/index.tsx
|
|
2020
|
-
var _tmpl$$
|
|
2270
|
+
var _tmpl$$30 = /*#__PURE__*/ template(`<dl>`);
|
|
2021
2271
|
function Root$6(props) {
|
|
2022
2272
|
const [own, rest] = splitProps(props, ["layout"]);
|
|
2023
2273
|
return (() => {
|
|
2024
|
-
var _el$ = _tmpl$$
|
|
2274
|
+
var _el$ = _tmpl$$30();
|
|
2025
2275
|
spread(_el$, mergeProps(rest, {
|
|
2026
2276
|
"data-scope": "descriptions",
|
|
2027
2277
|
"data-part": "root",
|
|
@@ -2071,43 +2321,6 @@ injectComponentStyle("dialog");
|
|
|
2071
2321
|
const Drawer = Drawer$1;
|
|
2072
2322
|
injectComponentStyle("drawer");
|
|
2073
2323
|
//#endregion
|
|
2074
|
-
//#region src/components/input/index.tsx
|
|
2075
|
-
var _tmpl$$30 = /*#__PURE__*/ template(`<input>`);
|
|
2076
|
-
/** The bare text input: the field recipe — border, surface, focus halo —
|
|
2077
|
-
* on a native control. Standing alone it styles itself from the `invalid`
|
|
2078
|
-
* prop; inside a `Field.Root` it consumes the field context, picking up
|
|
2079
|
-
* the label id, the described-by wiring and the invalid state for free,
|
|
2080
|
-
* which is also the seam the Form validation layer will drive. Disabled
|
|
2081
|
-
* rides the native attribute. */
|
|
2082
|
-
function Input(props) {
|
|
2083
|
-
const field = useFieldContext();
|
|
2084
|
-
const [own, rest] = splitProps(props, [
|
|
2085
|
-
"value",
|
|
2086
|
-
"size",
|
|
2087
|
-
"invalid",
|
|
2088
|
-
"onValueChange"
|
|
2089
|
-
]);
|
|
2090
|
-
return (() => {
|
|
2091
|
-
var _el$ = _tmpl$$30();
|
|
2092
|
-
spread(_el$, mergeProps(() => mergeProps$1(() => field?.().getInputProps() ?? {}, rest, {
|
|
2093
|
-
get value() {
|
|
2094
|
-
return own.value;
|
|
2095
|
-
},
|
|
2096
|
-
"data-scope": "input",
|
|
2097
|
-
"data-part": "root",
|
|
2098
|
-
get "data-size"() {
|
|
2099
|
-
return own.size ?? "md";
|
|
2100
|
-
},
|
|
2101
|
-
get "data-invalid"() {
|
|
2102
|
-
return own.invalid || field?.().getInputProps()["data-invalid"] != null ? "" : void 0;
|
|
2103
|
-
},
|
|
2104
|
-
onInput: (event) => own.onValueChange?.(event.currentTarget.value)
|
|
2105
|
-
})), false, false);
|
|
2106
|
-
return _el$;
|
|
2107
|
-
})();
|
|
2108
|
-
}
|
|
2109
|
-
injectComponentStyle("input");
|
|
2110
|
-
//#endregion
|
|
2111
2324
|
//#region src/components/dynamic-input/index.tsx
|
|
2112
2325
|
var _tmpl$$29 = /*#__PURE__*/ template(`<div><div data-scope=dynamic-input data-part=add>`);
|
|
2113
2326
|
var _tmpl$2$15 = /*#__PURE__*/ template(`<div data-scope=dynamic-input data-part=row>`);
|
|
@@ -2692,8 +2905,8 @@ injectComponentStyle("icon");
|
|
|
2692
2905
|
var _tmpl$$23 = /*#__PURE__*/ template(`<svg><rect x=3 y=4 width=18 height=16 rx=1.5></svg>`, false, true, false);
|
|
2693
2906
|
var _tmpl$2$12 = /*#__PURE__*/ template(`<svg><circle cx=9 cy=10 r=1.5></svg>`, false, true, false);
|
|
2694
2907
|
var _tmpl$3$9 = /*#__PURE__*/ template(`<svg><path d="m5.5 17.5 4.5-5 3 3.5 2.5-3 3 4.5"></svg>`, false, true, false);
|
|
2695
|
-
var _tmpl$4$
|
|
2696
|
-
var _tmpl$5$
|
|
2908
|
+
var _tmpl$4$7 = /*#__PURE__*/ template(`<div data-scope=image data-part=fallback>`);
|
|
2909
|
+
var _tmpl$5$5 = /*#__PURE__*/ template(`<figure><img data-scope=image data-part=img decoding=async>`, true, false, false);
|
|
2697
2910
|
/** The mark for a source that never arrived: a quiet mountain-and-sun,
|
|
2698
2911
|
* drawn in the stylesheet's stroke and hidden from the reader. */
|
|
2699
2912
|
function placeholderGlyph() {
|
|
@@ -2714,7 +2927,7 @@ function Image(props) {
|
|
|
2714
2927
|
const [state, setState] = createSignal("loading");
|
|
2715
2928
|
createEffect(on(() => own.src, () => setState("loading")));
|
|
2716
2929
|
return (() => {
|
|
2717
|
-
var _el$4 = _tmpl$5$
|
|
2930
|
+
var _el$4 = _tmpl$5$5(), _el$5 = _el$4.firstChild;
|
|
2718
2931
|
spread(_el$4, mergeProps(rest, {
|
|
2719
2932
|
"data-scope": "image",
|
|
2720
2933
|
"data-part": "root",
|
|
@@ -2732,7 +2945,7 @@ function Image(props) {
|
|
|
2732
2945
|
return state() === "error";
|
|
2733
2946
|
},
|
|
2734
2947
|
get children() {
|
|
2735
|
-
var _el$6 = _tmpl$4$
|
|
2948
|
+
var _el$6 = _tmpl$4$7();
|
|
2736
2949
|
insert(_el$6, () => own.fallback ?? placeholderGlyph());
|
|
2737
2950
|
return _el$6;
|
|
2738
2951
|
}
|
|
@@ -2765,9 +2978,9 @@ injectComponentStyle("image-cropper");
|
|
|
2765
2978
|
var _tmpl$$22 = /*#__PURE__*/ template(`<svg><circle cx=11 cy=11 r=7></svg>`, false, true, false);
|
|
2766
2979
|
var _tmpl$2$11 = /*#__PURE__*/ template(`<svg><path d="m16.2 16.2 4.8 4.8"></svg>`, false, true, false);
|
|
2767
2980
|
var _tmpl$3$8 = /*#__PURE__*/ template(`<svg><path d="M8 11h6"></svg>`, false, true, false);
|
|
2768
|
-
var _tmpl$4$
|
|
2769
|
-
var _tmpl$5$
|
|
2770
|
-
var _tmpl$6$
|
|
2981
|
+
var _tmpl$4$6 = /*#__PURE__*/ template(`<svg><path d="M11 8v6"></svg>`, false, true, false);
|
|
2982
|
+
var _tmpl$5$4 = /*#__PURE__*/ template(`<svg><path d="M20.49 12A8.5 8.5 0 1 1 18 6.06"></svg>`, false, true, false);
|
|
2983
|
+
var _tmpl$6$4 = /*#__PURE__*/ template(`<svg><path d="M20.5 3.5v4h-4"></svg>`, false, true, false);
|
|
2771
2984
|
var _tmpl$7$1 = /*#__PURE__*/ template(`<svg><path d="m6 6 12 12"></svg>`, false, true, false);
|
|
2772
2985
|
var _tmpl$8$1 = /*#__PURE__*/ template(`<svg><path d="M18 6 6 18"></svg>`, false, true, false);
|
|
2773
2986
|
var _tmpl$9$1 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true>`);
|
|
@@ -2782,14 +2995,14 @@ const TOOL_GLYPHS = {
|
|
|
2782
2995
|
_tmpl$$22(),
|
|
2783
2996
|
_tmpl$2$11(),
|
|
2784
2997
|
_tmpl$3$8(),
|
|
2785
|
-
_tmpl$4$
|
|
2998
|
+
_tmpl$4$6()
|
|
2786
2999
|
],
|
|
2787
3000
|
zoomOut: () => [
|
|
2788
3001
|
_tmpl$$22(),
|
|
2789
3002
|
_tmpl$2$11(),
|
|
2790
3003
|
_tmpl$3$8()
|
|
2791
3004
|
],
|
|
2792
|
-
rotate: () => [_tmpl$5$
|
|
3005
|
+
rotate: () => [_tmpl$5$4(), _tmpl$6$4()],
|
|
2793
3006
|
close: () => [_tmpl$7$1(), _tmpl$8$1()]
|
|
2794
3007
|
};
|
|
2795
3008
|
function ImageViewer(props) {
|
|
@@ -2959,16 +3172,15 @@ injectComponentStyle("kbd");
|
|
|
2959
3172
|
var _tmpl$$19 = /*#__PURE__*/ template(`<div>`);
|
|
2960
3173
|
var _tmpl$2$10 = /*#__PURE__*/ template(`<header>`);
|
|
2961
3174
|
var _tmpl$3$7 = /*#__PURE__*/ template(`<main>`);
|
|
2962
|
-
var _tmpl$4$
|
|
2963
|
-
var _tmpl$5$
|
|
2964
|
-
var _tmpl$6$
|
|
3175
|
+
var _tmpl$4$5 = /*#__PURE__*/ template(`<footer>`);
|
|
3176
|
+
var _tmpl$5$3 = /*#__PURE__*/ template(`<div data-scope=layout data-part=sider-resize role=separator aria-orientation=vertical tabindex=0 aria-label="Resize sidebar">`);
|
|
3177
|
+
var _tmpl$6$3 = /*#__PURE__*/ template(`<aside>`);
|
|
2965
3178
|
const LayoutContext = createContext();
|
|
2966
3179
|
/**
|
|
2967
3180
|
* The application skeleton: Root, Header, Sider, Content, Footer —
|
|
2968
|
-
* the admin arrangement
|
|
2969
|
-
*
|
|
2970
|
-
*
|
|
2971
|
-
* edge the rail stands on.
|
|
3181
|
+
* the admin arrangement dressed in the paper-and-ink surfaces. The
|
|
3182
|
+
* root is a full-height grid; a declared `sider` turns the columns
|
|
3183
|
+
* around to meet whichever edge the rail stands on.
|
|
2972
3184
|
*/
|
|
2973
3185
|
function LayoutRoot(props) {
|
|
2974
3186
|
const [own, rest] = splitProps(props, ["sider"]);
|
|
@@ -3009,7 +3221,7 @@ function LayoutContent(props) {
|
|
|
3009
3221
|
}
|
|
3010
3222
|
function LayoutFooter(props) {
|
|
3011
3223
|
return (() => {
|
|
3012
|
-
var _el$4 = _tmpl$4$
|
|
3224
|
+
var _el$4 = _tmpl$4$5();
|
|
3013
3225
|
spread(_el$4, mergeProps(props, {
|
|
3014
3226
|
"data-scope": "layout",
|
|
3015
3227
|
"data-part": "footer"
|
|
@@ -3080,7 +3292,7 @@ function LayoutSider(props) {
|
|
|
3080
3292
|
own.onWidthChange?.(`${next}px`);
|
|
3081
3293
|
};
|
|
3082
3294
|
const handle = () => own.resizable && !collapsed() ? (() => {
|
|
3083
|
-
var _el$5 = _tmpl$5$
|
|
3295
|
+
var _el$5 = _tmpl$5$3();
|
|
3084
3296
|
_el$5.$$keydown = onKeyDown;
|
|
3085
3297
|
_el$5.$$pointerup = onPointerUp;
|
|
3086
3298
|
_el$5.$$pointermove = onPointerMove;
|
|
@@ -3098,7 +3310,7 @@ function LayoutSider(props) {
|
|
|
3098
3310
|
})() : null;
|
|
3099
3311
|
const foldedWidth = () => own.collapsedWidth ?? "3.5rem";
|
|
3100
3312
|
return (() => {
|
|
3101
|
-
var _el$6 = _tmpl$6$
|
|
3313
|
+
var _el$6 = _tmpl$6$3();
|
|
3102
3314
|
use((el) => rail = el, _el$6);
|
|
3103
3315
|
spread(_el$6, mergeProps(rest, {
|
|
3104
3316
|
get style() {
|
|
@@ -3169,7 +3381,7 @@ injectComponentStyle("link");
|
|
|
3169
3381
|
var _tmpl$$17 = /*#__PURE__*/ template(`<ul>`);
|
|
3170
3382
|
var _tmpl$2$9 = /*#__PURE__*/ template(`<div data-scope=list data-part=title>`);
|
|
3171
3383
|
var _tmpl$3$6 = /*#__PURE__*/ template(`<div data-scope=list data-part=description>`);
|
|
3172
|
-
var _tmpl$4$
|
|
3384
|
+
var _tmpl$4$4 = /*#__PURE__*/ template(`<div>`);
|
|
3173
3385
|
/** A ledger of rows: Root is the list, Item one row, Leading the mark
|
|
3174
3386
|
* before the words, Content the title and its quiet echo, Actions the
|
|
3175
3387
|
* way out. The bordered variant draws the hairlines; the hoverable
|
|
@@ -3215,7 +3427,7 @@ function Content$1(props) {
|
|
|
3215
3427
|
"children"
|
|
3216
3428
|
]);
|
|
3217
3429
|
return (() => {
|
|
3218
|
-
var _el$2 = _tmpl$4$
|
|
3430
|
+
var _el$2 = _tmpl$4$4();
|
|
3219
3431
|
spread(_el$2, mergeProps(rest, {
|
|
3220
3432
|
"data-scope": "list",
|
|
3221
3433
|
"data-part": "content"
|
|
@@ -3911,7 +4123,7 @@ injectComponentStyle("progress");
|
|
|
3911
4123
|
var _tmpl$$10 = /*#__PURE__*/ template(`<div data-scope=progress-group data-part=legend>`);
|
|
3912
4124
|
var _tmpl$2$4 = /*#__PURE__*/ template(`<div><div data-scope=progress-group data-part=track>`);
|
|
3913
4125
|
var _tmpl$3$4 = /*#__PURE__*/ template(`<div data-scope=progress-group data-part=segment role=progressbar aria-valuemin=0>`);
|
|
3914
|
-
var _tmpl$4$
|
|
4126
|
+
var _tmpl$4$3 = /*#__PURE__*/ template(`<div data-scope=progress-group data-part=legend-item><span data-scope=progress-group data-part=swatch aria-hidden=true></span><span data-scope=progress-group data-part=legend-label></span><span data-scope=progress-group data-part=legend-value>`);
|
|
3915
4127
|
function ProgressGroup(props) {
|
|
3916
4128
|
const [own, rest] = splitProps(props, [
|
|
3917
4129
|
"segments",
|
|
@@ -3965,7 +4177,7 @@ function ProgressGroup(props) {
|
|
|
3965
4177
|
return own.segments;
|
|
3966
4178
|
},
|
|
3967
4179
|
children: (segment, index) => (() => {
|
|
3968
|
-
var _el$5 = _tmpl$4$
|
|
4180
|
+
var _el$5 = _tmpl$4$3(), _el$7 = _el$5.firstChild.nextSibling, _el$8 = _el$7.nextSibling;
|
|
3969
4181
|
insert(_el$7, () => nameOf(segment, index()));
|
|
3970
4182
|
insert(_el$8, () => String(segment.value));
|
|
3971
4183
|
effect(() => setAttribute(_el$5, "data-pigment", segment.pigment));
|
|
@@ -4344,21 +4556,34 @@ const Switch = Switch$1;
|
|
|
4344
4556
|
injectComponentStyle("switch");
|
|
4345
4557
|
//#endregion
|
|
4346
4558
|
//#region src/components/table/index.tsx
|
|
4347
|
-
var _tmpl$$3 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2
|
|
4348
|
-
var _tmpl$2$2 = /*#__PURE__*/ template(`<
|
|
4349
|
-
var _tmpl$3$2 = /*#__PURE__*/ template(`<
|
|
4350
|
-
var _tmpl$4$
|
|
4351
|
-
var _tmpl$5$
|
|
4352
|
-
var _tmpl$6$
|
|
4353
|
-
var _tmpl$7 = /*#__PURE__*/ template(`<
|
|
4354
|
-
var _tmpl$8 = /*#__PURE__*/ template(`<div
|
|
4355
|
-
var _tmpl$9 = /*#__PURE__*/ template(`<
|
|
4356
|
-
var _tmpl$0 = /*#__PURE__*/ template(`<div role=
|
|
4357
|
-
var _tmpl$1 = /*#__PURE__*/ template(`<div data-scope=table data-part=
|
|
4358
|
-
var _tmpl$10 = /*#__PURE__*/ template(`<div role=
|
|
4359
|
-
var _tmpl$11 = /*#__PURE__*/ template(`<div
|
|
4360
|
-
var _tmpl$12 = /*#__PURE__*/ template(`<div
|
|
4361
|
-
var _tmpl$13 = /*#__PURE__*/ template(`<
|
|
4559
|
+
var _tmpl$$3 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"width=14 height=14 fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path>`);
|
|
4560
|
+
var _tmpl$2$2 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"width=14 height=14 fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m6 9 6 6 6-6">`);
|
|
4561
|
+
var _tmpl$3$2 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 6 6 6-6 6">`);
|
|
4562
|
+
var _tmpl$4$2 = /*#__PURE__*/ template(`<input type=checkbox>`);
|
|
4563
|
+
var _tmpl$5$2 = /*#__PURE__*/ template(`<div data-scope=table data-part=cell-main><button type=button data-scope=table data-part=expander>`);
|
|
4564
|
+
var _tmpl$6$2 = /*#__PURE__*/ template(`<div role=cell data-scope=table data-part=cell>`);
|
|
4565
|
+
var _tmpl$7 = /*#__PURE__*/ template(`<div role=row data-scope=table data-part=row>`);
|
|
4566
|
+
var _tmpl$8 = /*#__PURE__*/ template(`<div role=columnheader data-scope=table data-part=header-cell>`);
|
|
4567
|
+
var _tmpl$9 = /*#__PURE__*/ template(`<input type=text data-scope=table data-part=header-filter placeholder=Filter>`);
|
|
4568
|
+
var _tmpl$0 = /*#__PURE__*/ template(`<div data-scope=table data-part=root><div data-scope=table data-part=viewport><div role=table data-scope=table data-part=table><div role=rowgroup data-scope=table data-part=header></div><div role=rowgroup data-scope=table data-part=body>`);
|
|
4569
|
+
var _tmpl$1 = /*#__PURE__*/ template(`<div data-scope=table data-part=toolbar><input type=search data-scope=table data-part=global-filter aria-label="Filter all columns">`);
|
|
4570
|
+
var _tmpl$10 = /*#__PURE__*/ template(`<div role=columnheader data-scope=table data-part=header-cell><input type=checkbox>`);
|
|
4571
|
+
var _tmpl$11 = /*#__PURE__*/ template(`<div data-scope=table data-part=empty>`);
|
|
4572
|
+
var _tmpl$12 = /*#__PURE__*/ template(`<div role=rowgroup data-scope=table data-part=footer>`);
|
|
4573
|
+
var _tmpl$13 = /*#__PURE__*/ template(`<div role=columnheader data-scope=table data-part=footer-cell>`);
|
|
4574
|
+
var _tmpl$14 = /*#__PURE__*/ template(`<div data-scope=table data-part=pagination><span data-scope=table data-part=page-status></span><div data-scope=table data-part=page-nav>`);
|
|
4575
|
+
/** The pagination bar's arrows — thin chevrons for the row of seals. */
|
|
4576
|
+
function pageGlyph(direction) {
|
|
4577
|
+
return (() => {
|
|
4578
|
+
var _el$ = _tmpl$$3(), _el$2 = _el$.firstChild;
|
|
4579
|
+
setAttribute(_el$2, "d", direction === "start" ? "m15 18-6-6 6-6" : "m9 18 6-6-6-6");
|
|
4580
|
+
return _el$;
|
|
4581
|
+
})();
|
|
4582
|
+
}
|
|
4583
|
+
/** The page-size select's pointing chevron. */
|
|
4584
|
+
function chevronDownGlyph() {
|
|
4585
|
+
return _tmpl$2$2();
|
|
4586
|
+
}
|
|
4362
4587
|
const SELECT_COL_ID = "__select";
|
|
4363
4588
|
const SELECT_COL_WIDTH = 48;
|
|
4364
4589
|
/** The list holding `id` and the index inside it, or null when absent. */
|
|
@@ -4409,7 +4634,7 @@ function mark(el, attr, on) {
|
|
|
4409
4634
|
if (on) el.setAttribute(attr, "");
|
|
4410
4635
|
else el.removeAttribute(attr);
|
|
4411
4636
|
}
|
|
4412
|
-
const chevronGlyph = _tmpl
|
|
4637
|
+
const chevronGlyph = _tmpl$3$2();
|
|
4413
4638
|
function DataTable(props) {
|
|
4414
4639
|
if (props.virtual && props.merge) console.warn("[DataTable] `virtual` and `merge` are mutually exclusive; merge wins.");
|
|
4415
4640
|
/** Features follow the construction-time switches: sorting, selection,
|
|
@@ -4491,24 +4716,30 @@ function DataTable(props) {
|
|
|
4491
4716
|
const rows = createMemo(() => table.getRowModel().rows);
|
|
4492
4717
|
/** The declared row height is the density-scale baseline; the live
|
|
4493
4718
|
* scale comes off the document so the virtual window matches what CSS
|
|
4494
|
-
* actually renders.
|
|
4719
|
+
* actually renders. It is read once and re-read only when the density
|
|
4720
|
+
* or scene attribute moves — estimateSize runs on every scroll frame. */
|
|
4495
4721
|
const baseRowHeight = () => props.rowHeight ?? 40;
|
|
4496
|
-
|
|
4722
|
+
let densityScale = 1;
|
|
4723
|
+
const readDensityScale = () => {
|
|
4497
4724
|
const value = Number(getComputedStyle(document.documentElement).getPropertyValue("--bs-density-scale"));
|
|
4498
|
-
|
|
4725
|
+
densityScale = Number.isFinite(value) && value > 0 ? value : 1;
|
|
4499
4726
|
};
|
|
4500
4727
|
const virtualizer = createVirtualizer({
|
|
4501
4728
|
get count() {
|
|
4502
4729
|
return rows().length;
|
|
4503
4730
|
},
|
|
4504
4731
|
getScrollElement: () => viewport(),
|
|
4505
|
-
estimateSize: () => baseRowHeight() * densityScale
|
|
4732
|
+
estimateSize: () => baseRowHeight() * densityScale,
|
|
4506
4733
|
getItemKey: (index) => rows()[index]?.id ?? index,
|
|
4507
4734
|
overscan: 8
|
|
4508
4735
|
});
|
|
4509
4736
|
onMount(() => {
|
|
4510
4737
|
if (typeof MutationObserver === "undefined") return;
|
|
4511
|
-
|
|
4738
|
+
readDensityScale();
|
|
4739
|
+
const densityObserver = new MutationObserver(() => {
|
|
4740
|
+
readDensityScale();
|
|
4741
|
+
virtualizer.measure();
|
|
4742
|
+
});
|
|
4512
4743
|
densityObserver.observe(document.documentElement, {
|
|
4513
4744
|
attributes: true,
|
|
4514
4745
|
attributeFilter: ["data-density", "data-scene"]
|
|
@@ -4717,26 +4948,26 @@ function DataTable(props) {
|
|
|
4717
4948
|
};
|
|
4718
4949
|
let content;
|
|
4719
4950
|
if (column.id === SELECT_COL_ID) content = (() => {
|
|
4720
|
-
var _el$
|
|
4721
|
-
spread(_el$
|
|
4951
|
+
var _el$5 = _tmpl$4$2();
|
|
4952
|
+
spread(_el$5, mergeProps({ get checked() {
|
|
4722
4953
|
return row.getIsSelected();
|
|
4723
4954
|
} }, { indeterminate: false }, {
|
|
4724
4955
|
"aria-label": "Select row",
|
|
4725
4956
|
"onchange": () => row.toggleSelected(!row.getIsSelected())
|
|
4726
4957
|
}), false, false);
|
|
4727
|
-
return _el$
|
|
4958
|
+
return _el$5;
|
|
4728
4959
|
})();
|
|
4729
4960
|
else if (isExpandHost) content = (() => {
|
|
4730
|
-
var _el$
|
|
4731
|
-
_el$
|
|
4732
|
-
insert(_el$
|
|
4733
|
-
insert(_el$
|
|
4961
|
+
var _el$6 = _tmpl$5$2(), _el$7 = _el$6.firstChild;
|
|
4962
|
+
_el$7.$$click = () => row.toggleExpanded();
|
|
4963
|
+
insert(_el$7, chevronGlyph);
|
|
4964
|
+
insert(_el$6, createComponent(FlexRender, { cell }), null);
|
|
4734
4965
|
effect((_p$) => {
|
|
4735
4966
|
var _v$ = String(row.depth), _v$2 = row.getIsExpanded() || void 0, _v$3 = !row.getCanExpand() || void 0, _v$4 = row.getIsExpanded() ? "Collapse row" : "Expand row";
|
|
4736
|
-
_v$ !== _p$.e && setStyleProperty(_el$
|
|
4737
|
-
_v$2 !== _p$.t && setAttribute(_el$
|
|
4738
|
-
_v$3 !== _p$.a && setAttribute(_el$
|
|
4739
|
-
_v$4 !== _p$.o && setAttribute(_el$
|
|
4967
|
+
_v$ !== _p$.e && setStyleProperty(_el$6, "--bs-table-depth", _p$.e = _v$);
|
|
4968
|
+
_v$2 !== _p$.t && setAttribute(_el$7, "data-expanded", _p$.t = _v$2);
|
|
4969
|
+
_v$3 !== _p$.a && setAttribute(_el$7, "data-leaf", _p$.a = _v$3);
|
|
4970
|
+
_v$4 !== _p$.o && setAttribute(_el$7, "aria-label", _p$.o = _v$4);
|
|
4740
4971
|
return _p$;
|
|
4741
4972
|
}, {
|
|
4742
4973
|
e: void 0,
|
|
@@ -4744,17 +4975,17 @@ function DataTable(props) {
|
|
|
4744
4975
|
a: void 0,
|
|
4745
4976
|
o: void 0
|
|
4746
4977
|
});
|
|
4747
|
-
return _el$
|
|
4978
|
+
return _el$6;
|
|
4748
4979
|
})();
|
|
4749
4980
|
else content = createComponent(FlexRender, { cell });
|
|
4750
4981
|
return (() => {
|
|
4751
|
-
var _el$
|
|
4752
|
-
setAttribute(_el$
|
|
4753
|
-
spread(_el$
|
|
4982
|
+
var _el$8 = _tmpl$6$2();
|
|
4983
|
+
setAttribute(_el$8, "data-spanned", rowSpan > 1 ? "" : void 0);
|
|
4984
|
+
spread(_el$8, mergeProps({ get ["data-numeric"]() {
|
|
4754
4985
|
return column.columnDef.meta?.numeric ? "" : void 0;
|
|
4755
4986
|
} }, pin, { "style": style }), false, true);
|
|
4756
|
-
insert(_el$
|
|
4757
|
-
return _el$
|
|
4987
|
+
insert(_el$8, content);
|
|
4988
|
+
return _el$8;
|
|
4758
4989
|
})();
|
|
4759
4990
|
}
|
|
4760
4991
|
function renderRow(row, virtualItem) {
|
|
@@ -4767,14 +4998,14 @@ function DataTable(props) {
|
|
|
4767
4998
|
} : {};
|
|
4768
4999
|
const draggable = rowDraggable();
|
|
4769
5000
|
return (() => {
|
|
4770
|
-
var _el$
|
|
4771
|
-
addEventListener(_el$
|
|
4772
|
-
addEventListener(_el$
|
|
4773
|
-
addEventListener(_el$
|
|
4774
|
-
addEventListener(_el$
|
|
4775
|
-
addEventListener(_el$
|
|
4776
|
-
setAttribute(_el$
|
|
4777
|
-
insert(_el$
|
|
5001
|
+
var _el$9 = _tmpl$7();
|
|
5002
|
+
addEventListener(_el$9, "dragend", draggable ? onRowDragEnd : void 0);
|
|
5003
|
+
addEventListener(_el$9, "drop", draggable ? (e) => onRowDrop(row, e) : void 0);
|
|
5004
|
+
addEventListener(_el$9, "dragleave", draggable ? onRowDragLeave : void 0);
|
|
5005
|
+
addEventListener(_el$9, "dragover", draggable ? (e) => onRowDragOver(row, e) : void 0);
|
|
5006
|
+
addEventListener(_el$9, "dragstart", draggable ? (e) => onRowDragStart(row, e) : void 0);
|
|
5007
|
+
setAttribute(_el$9, "draggable", draggable || void 0);
|
|
5008
|
+
insert(_el$9, createComponent(For, {
|
|
4778
5009
|
get each() {
|
|
4779
5010
|
return row.getVisibleCells();
|
|
4780
5011
|
},
|
|
@@ -4782,14 +5013,14 @@ function DataTable(props) {
|
|
|
4782
5013
|
}));
|
|
4783
5014
|
effect((_p$) => {
|
|
4784
5015
|
var _v$5 = row.getIsSelected() || void 0, _v$6 = style$1;
|
|
4785
|
-
_v$5 !== _p$.e && setAttribute(_el$
|
|
4786
|
-
_p$.t = style(_el$
|
|
5016
|
+
_v$5 !== _p$.e && setAttribute(_el$9, "data-selected", _p$.e = _v$5);
|
|
5017
|
+
_p$.t = style(_el$9, _v$6, _p$.t);
|
|
4787
5018
|
return _p$;
|
|
4788
5019
|
}, {
|
|
4789
5020
|
e: void 0,
|
|
4790
5021
|
t: void 0
|
|
4791
5022
|
});
|
|
4792
|
-
return _el$
|
|
5023
|
+
return _el$9;
|
|
4793
5024
|
})();
|
|
4794
5025
|
}
|
|
4795
5026
|
function renderHeaderCell(header) {
|
|
@@ -4799,13 +5030,13 @@ function DataTable(props) {
|
|
|
4799
5030
|
const canFilter = props.filterable && column.getCanFilter();
|
|
4800
5031
|
const canDrag = !!props.reorderable && column.id !== SELECT_COL_ID && !column.getIsPinned();
|
|
4801
5032
|
return (() => {
|
|
4802
|
-
var _el$
|
|
4803
|
-
setAttribute(_el$
|
|
4804
|
-
setAttribute(_el$
|
|
4805
|
-
setAttribute(_el$
|
|
4806
|
-
setAttribute(_el$
|
|
4807
|
-
setAttribute(_el$
|
|
4808
|
-
spread(_el$
|
|
5033
|
+
var _el$0 = _tmpl$8();
|
|
5034
|
+
setAttribute(_el$0, "data-sortable", canSort || void 0);
|
|
5035
|
+
setAttribute(_el$0, "data-sort", sorted || void 0);
|
|
5036
|
+
setAttribute(_el$0, "data-draggable", canDrag || void 0);
|
|
5037
|
+
setAttribute(_el$0, "draggable", canDrag || void 0);
|
|
5038
|
+
setAttribute(_el$0, "aria-sort", sorted === "asc" ? "ascending" : sorted === "desc" ? "descending" : void 0);
|
|
5039
|
+
spread(_el$0, mergeProps({
|
|
4809
5040
|
get ["data-numeric"]() {
|
|
4810
5041
|
return column.columnDef.meta?.numeric ? "" : void 0;
|
|
4811
5042
|
},
|
|
@@ -4820,43 +5051,43 @@ function DataTable(props) {
|
|
|
4820
5051
|
"ondrop": canDrag ? (e) => onColDrop(column, e) : void 0,
|
|
4821
5052
|
"ondragend": canDrag ? onColDragEnd : void 0
|
|
4822
5053
|
}), false, true);
|
|
4823
|
-
insert(_el$
|
|
4824
|
-
var _c$ = memo(() => !!header.isPlaceholder);
|
|
5054
|
+
insert(_el$0, (() => {
|
|
5055
|
+
var _c$ = memo(() => !!(header.isPlaceholder || header.column.columnDef.header === ""));
|
|
4825
5056
|
return () => _c$() ? null : createComponent(FlexRender, { header });
|
|
4826
5057
|
})(), null);
|
|
4827
|
-
insert(_el$
|
|
4828
|
-
var _el$
|
|
4829
|
-
_el$
|
|
4830
|
-
_el$
|
|
4831
|
-
_el$
|
|
4832
|
-
setAttribute(_el$
|
|
4833
|
-
effect(() => setAttribute(_el$
|
|
4834
|
-
effect(() => _el$
|
|
4835
|
-
return _el$
|
|
5058
|
+
insert(_el$0, canFilter ? (() => {
|
|
5059
|
+
var _el$1 = _tmpl$9();
|
|
5060
|
+
_el$1.$$input = (e) => column.setFilterValue(e.target.value);
|
|
5061
|
+
_el$1.addEventListener("dragstart", (e) => e.stopPropagation());
|
|
5062
|
+
_el$1.$$click = (e) => e.stopPropagation();
|
|
5063
|
+
setAttribute(_el$1, "draggable", false);
|
|
5064
|
+
effect(() => setAttribute(_el$1, "aria-label", `Filter ${column.id}`));
|
|
5065
|
+
effect(() => _el$1.value = column.getFilterValue() ?? "");
|
|
5066
|
+
return _el$1;
|
|
4836
5067
|
})() : null, null);
|
|
4837
|
-
return _el$
|
|
5068
|
+
return _el$0;
|
|
4838
5069
|
})();
|
|
4839
5070
|
}
|
|
4840
5071
|
return (() => {
|
|
4841
|
-
var _el$
|
|
4842
|
-
insert(_el$
|
|
4843
|
-
var _c$2 = memo(() => !!props.filterable);
|
|
5072
|
+
var _el$10 = _tmpl$0(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$13.nextSibling;
|
|
5073
|
+
insert(_el$10, (() => {
|
|
5074
|
+
var _c$2 = memo(() => !!(props.filterable && (props.showToolbar ?? true)));
|
|
4844
5075
|
return () => _c$2() ? (() => {
|
|
4845
|
-
var _el$
|
|
4846
|
-
_el$
|
|
4847
|
-
effect(() => setAttribute(_el$
|
|
4848
|
-
effect(() => _el$
|
|
4849
|
-
return _el$
|
|
5076
|
+
var _el$15 = _tmpl$1(), _el$16 = _el$15.firstChild;
|
|
5077
|
+
_el$16.$$input = (e) => table.setGlobalFilter(e.target.value);
|
|
5078
|
+
effect(() => setAttribute(_el$16, "placeholder", props.globalFilterPlaceholder));
|
|
5079
|
+
effect(() => _el$16.value = table.atoms.globalFilter.get() ?? "");
|
|
5080
|
+
return _el$15;
|
|
4850
5081
|
})() : null;
|
|
4851
|
-
})(), _el$
|
|
4852
|
-
use(setViewport, _el$
|
|
4853
|
-
insert(_el$
|
|
5082
|
+
})(), _el$11);
|
|
5083
|
+
use(setViewport, _el$11);
|
|
5084
|
+
insert(_el$13, createComponent(For, {
|
|
4854
5085
|
get each() {
|
|
4855
5086
|
return table.getHeaderGroups();
|
|
4856
5087
|
},
|
|
4857
5088
|
children: (group) => (() => {
|
|
4858
|
-
var _el$
|
|
4859
|
-
insert(_el$
|
|
5089
|
+
var _el$17 = _tmpl$7();
|
|
5090
|
+
insert(_el$17, createComponent(For, {
|
|
4860
5091
|
get each() {
|
|
4861
5092
|
return group.headers;
|
|
4862
5093
|
},
|
|
@@ -4865,21 +5096,21 @@ function DataTable(props) {
|
|
|
4865
5096
|
if (column.id !== SELECT_COL_ID) return renderHeaderCell(header);
|
|
4866
5097
|
const all = table.getIsAllRowsSelected();
|
|
4867
5098
|
return (() => {
|
|
4868
|
-
var _el$
|
|
4869
|
-
spread(_el$
|
|
4870
|
-
_el$
|
|
4871
|
-
spread(_el$
|
|
5099
|
+
var _el$18 = _tmpl$10(), _el$19 = _el$18.firstChild;
|
|
5100
|
+
spread(_el$18, mergeProps(() => pinAttrs(column)), false, true);
|
|
5101
|
+
_el$19.checked = all;
|
|
5102
|
+
spread(_el$19, mergeProps(() => ({ indeterminate: table.getIsSomeRowsSelected() && !all }), {
|
|
4872
5103
|
"aria-label": "Select all rows",
|
|
4873
5104
|
"onchange": () => table.toggleAllRowsSelected(!all)
|
|
4874
5105
|
}), false, false);
|
|
4875
|
-
return _el$
|
|
5106
|
+
return _el$18;
|
|
4876
5107
|
})();
|
|
4877
5108
|
}
|
|
4878
5109
|
}));
|
|
4879
|
-
return _el$
|
|
5110
|
+
return _el$17;
|
|
4880
5111
|
})()
|
|
4881
5112
|
}));
|
|
4882
|
-
insert(_el$
|
|
5113
|
+
insert(_el$14, (() => {
|
|
4883
5114
|
var _c$3 = memo(() => !!virtual());
|
|
4884
5115
|
return () => _c$3() ? createComponent(For, {
|
|
4885
5116
|
get each() {
|
|
@@ -4893,80 +5124,142 @@ function DataTable(props) {
|
|
|
4893
5124
|
children: (row) => renderRow(row)
|
|
4894
5125
|
});
|
|
4895
5126
|
})(), null);
|
|
4896
|
-
insert(_el$
|
|
5127
|
+
insert(_el$14, (() => {
|
|
4897
5128
|
var _c$4 = memo(() => rows().length === 0);
|
|
4898
5129
|
return () => _c$4() ? (() => {
|
|
4899
|
-
var _el$
|
|
4900
|
-
insert(_el$
|
|
4901
|
-
return _el$
|
|
5130
|
+
var _el$20 = _tmpl$11();
|
|
5131
|
+
insert(_el$20, () => props.emptyText);
|
|
5132
|
+
return _el$20;
|
|
4902
5133
|
})() : null;
|
|
4903
5134
|
})(), null);
|
|
4904
|
-
insert(_el$
|
|
5135
|
+
insert(_el$12, (() => {
|
|
4905
5136
|
var _c$5 = memo(() => !!(props.stickyFooter && table.getFooterGroups().some((group) => group.headers.some((header) => header.column.columnDef.footer))));
|
|
4906
5137
|
return () => _c$5() ? (() => {
|
|
4907
|
-
var _el$
|
|
4908
|
-
insert(_el$
|
|
5138
|
+
var _el$21 = _tmpl$12();
|
|
5139
|
+
insert(_el$21, createComponent(For, {
|
|
4909
5140
|
get each() {
|
|
4910
5141
|
return table.getFooterGroups();
|
|
4911
5142
|
},
|
|
4912
5143
|
children: (group) => (() => {
|
|
4913
|
-
var _el$
|
|
4914
|
-
insert(_el$
|
|
5144
|
+
var _el$22 = _tmpl$7();
|
|
5145
|
+
insert(_el$22, createComponent(For, {
|
|
4915
5146
|
get each() {
|
|
4916
5147
|
return group.headers;
|
|
4917
5148
|
},
|
|
4918
5149
|
children: (header) => (() => {
|
|
4919
|
-
var _el$
|
|
4920
|
-
spread(_el$
|
|
5150
|
+
var _el$23 = _tmpl$13();
|
|
5151
|
+
spread(_el$23, mergeProps({ get ["data-numeric"]() {
|
|
4921
5152
|
return header.column.columnDef.meta?.numeric ? "" : void 0;
|
|
4922
5153
|
} }, () => pinAttrs(header.column)), false, true);
|
|
4923
|
-
insert(_el$
|
|
5154
|
+
insert(_el$23, (() => {
|
|
4924
5155
|
var _c$7 = memo(() => !!header.isPlaceholder);
|
|
4925
5156
|
return () => _c$7() ? null : createComponent(FlexRender, { footer: header });
|
|
4926
5157
|
})());
|
|
4927
|
-
return _el$
|
|
5158
|
+
return _el$23;
|
|
4928
5159
|
})()
|
|
4929
5160
|
}));
|
|
4930
|
-
return _el$
|
|
5161
|
+
return _el$22;
|
|
4931
5162
|
})()
|
|
4932
5163
|
}));
|
|
4933
|
-
return _el$
|
|
5164
|
+
return _el$21;
|
|
4934
5165
|
})() : null;
|
|
4935
5166
|
})(), null);
|
|
4936
|
-
insert(_el$
|
|
5167
|
+
insert(_el$10, (() => {
|
|
4937
5168
|
var _c$6 = memo(() => !!props.paginated);
|
|
4938
5169
|
return () => _c$6() ? (() => {
|
|
4939
|
-
var _el$
|
|
4940
|
-
_el$
|
|
4941
|
-
_el$
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
get each() {
|
|
4945
|
-
return props.pageSizeOptions ?? [
|
|
5170
|
+
var _el$24 = _tmpl$14(), _el$25 = _el$24.firstChild, _el$26 = _el$25.nextSibling;
|
|
5171
|
+
insert(_el$25, () => `${table.getRowCount()} rows`);
|
|
5172
|
+
insert(_el$26, createComponent(Select.Root, {
|
|
5173
|
+
get collection() {
|
|
5174
|
+
return createListCollection({ items: (props.pageSizeOptions ?? [
|
|
4946
5175
|
10,
|
|
4947
5176
|
20,
|
|
4948
5177
|
50
|
|
4949
|
-
]
|
|
5178
|
+
]).map((size) => ({
|
|
5179
|
+
label: `${size} / page`,
|
|
5180
|
+
value: String(size)
|
|
5181
|
+
})) });
|
|
4950
5182
|
},
|
|
4951
|
-
|
|
4952
|
-
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
5183
|
+
get value() {
|
|
5184
|
+
return [String(table.atoms.pagination.get().pageSize)];
|
|
5185
|
+
},
|
|
5186
|
+
onValueChange: (details) => table.setPageSize(Number(details.value[0])),
|
|
5187
|
+
positioning: { placement: "top-start" },
|
|
5188
|
+
get children() {
|
|
5189
|
+
return [createComponent(Select.Control, { get children() {
|
|
5190
|
+
return createComponent(Select.Trigger, {
|
|
5191
|
+
"aria-label": "Rows per page",
|
|
5192
|
+
get children() {
|
|
5193
|
+
return [createComponent(Select.ValueText, {}), createComponent(Select.Indicator, { get children() {
|
|
5194
|
+
return chevronDownGlyph();
|
|
5195
|
+
} })];
|
|
5196
|
+
}
|
|
5197
|
+
});
|
|
5198
|
+
} }), createComponent(Select.Positioner, { get children() {
|
|
5199
|
+
return createComponent(Select.Content, { get children() {
|
|
5200
|
+
return createComponent(For, {
|
|
5201
|
+
get each() {
|
|
5202
|
+
return (props.pageSizeOptions ?? [
|
|
5203
|
+
10,
|
|
5204
|
+
20,
|
|
5205
|
+
50
|
|
5206
|
+
]).map((size) => ({
|
|
5207
|
+
label: `${size} / page`,
|
|
5208
|
+
value: String(size)
|
|
5209
|
+
}));
|
|
5210
|
+
},
|
|
5211
|
+
children: (item) => createComponent(Select.Item, {
|
|
5212
|
+
item,
|
|
5213
|
+
get children() {
|
|
5214
|
+
return [createComponent(Select.ItemText, { get children() {
|
|
5215
|
+
return item.label;
|
|
5216
|
+
} }), createComponent(Select.ItemIndicator, { children: "✓" })];
|
|
5217
|
+
}
|
|
5218
|
+
})
|
|
5219
|
+
});
|
|
5220
|
+
} });
|
|
5221
|
+
} })];
|
|
5222
|
+
}
|
|
5223
|
+
}), null);
|
|
5224
|
+
insert(_el$26, createComponent(Pagination.Root, {
|
|
5225
|
+
get count() {
|
|
5226
|
+
return table.getRowCount();
|
|
5227
|
+
},
|
|
5228
|
+
get pageSize() {
|
|
5229
|
+
return table.atoms.pagination.get().pageSize;
|
|
5230
|
+
},
|
|
5231
|
+
get page() {
|
|
5232
|
+
return table.atoms.pagination.get().pageIndex + 1;
|
|
5233
|
+
},
|
|
5234
|
+
onPageChange: (details) => table.setPageIndex(details.page - 1),
|
|
5235
|
+
get children() {
|
|
5236
|
+
return [
|
|
5237
|
+
createComponent(Pagination.PrevTrigger, { get children() {
|
|
5238
|
+
return pageGlyph("start");
|
|
5239
|
+
} }),
|
|
5240
|
+
createComponent(Pagination.Context, { children: (scope) => createComponent(For, {
|
|
5241
|
+
get each() {
|
|
5242
|
+
return scope().pages;
|
|
5243
|
+
},
|
|
5244
|
+
children: (page, index) => page.type === "ellipsis" ? createComponent(Pagination.Ellipsis, { get index() {
|
|
5245
|
+
return index();
|
|
5246
|
+
} }) : createComponent(Pagination.Item, {
|
|
5247
|
+
type: "page",
|
|
5248
|
+
get value() {
|
|
5249
|
+
return page.value;
|
|
5250
|
+
},
|
|
5251
|
+
get children() {
|
|
5252
|
+
return String(page.value);
|
|
5253
|
+
}
|
|
5254
|
+
})
|
|
5255
|
+
}) }),
|
|
5256
|
+
createComponent(Pagination.NextTrigger, { get children() {
|
|
5257
|
+
return pageGlyph("end");
|
|
5258
|
+
} })
|
|
5259
|
+
];
|
|
5260
|
+
}
|
|
5261
|
+
}), null);
|
|
5262
|
+
return _el$24;
|
|
4970
5263
|
})() : null;
|
|
4971
5264
|
})(), null);
|
|
4972
5265
|
effect((_p$) => {
|
|
@@ -4974,11 +5267,11 @@ function DataTable(props) {
|
|
|
4974
5267
|
position: "relative",
|
|
4975
5268
|
"block-size": `${virtualizer.getTotalSize()}px`
|
|
4976
5269
|
} : void 0;
|
|
4977
|
-
_v$7 !== _p$.e && setAttribute(_el$
|
|
4978
|
-
_v$8 !== _p$.t && setStyleProperty(_el$
|
|
4979
|
-
_v$9 !== _p$.a && setStyleProperty(_el$
|
|
4980
|
-
_v$0 !== _p$.o && setAttribute(_el$
|
|
4981
|
-
_p$.i = style(_el$
|
|
5270
|
+
_v$7 !== _p$.e && setAttribute(_el$10, "data-reorderable", _p$.e = _v$7);
|
|
5271
|
+
_v$8 !== _p$.t && setStyleProperty(_el$10, "--bs-table-row-height", _p$.t = _v$8);
|
|
5272
|
+
_v$9 !== _p$.a && setStyleProperty(_el$12, "--bs-table-cols", _p$.a = _v$9);
|
|
5273
|
+
_v$0 !== _p$.o && setAttribute(_el$14, "data-merge", _p$.o = _v$0);
|
|
5274
|
+
_p$.i = style(_el$14, _v$1, _p$.i);
|
|
4982
5275
|
return _p$;
|
|
4983
5276
|
}, {
|
|
4984
5277
|
e: void 0,
|
|
@@ -4987,7 +5280,7 @@ function DataTable(props) {
|
|
|
4987
5280
|
o: void 0,
|
|
4988
5281
|
i: void 0
|
|
4989
5282
|
});
|
|
4990
|
-
return _el$
|
|
5283
|
+
return _el$10;
|
|
4991
5284
|
})();
|
|
4992
5285
|
}
|
|
4993
5286
|
injectComponentStyle("table");
|
|
@@ -5112,9 +5405,9 @@ injectComponentStyle("toggle-group");
|
|
|
5112
5405
|
var _tmpl$$2 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=3 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m5 12.5 5 5L19 7">`);
|
|
5113
5406
|
var _tmpl$2$1 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=1.75 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path>`);
|
|
5114
5407
|
var _tmpl$3$1 = /*#__PURE__*/ template(`<div data-scope=transfer data-part=search>`);
|
|
5115
|
-
var _tmpl$4 = /*#__PURE__*/ template(`<div data-scope=transfer data-part=panel><div data-scope=transfer data-part=head><span data-scope=transfer data-part=title></span><span data-scope=transfer data-part=count></span></div><div data-scope=transfer data-part=list>`);
|
|
5116
|
-
var _tmpl$5 = /*#__PURE__*/ template(`<p data-scope=transfer data-part=empty>Nothing here`);
|
|
5117
|
-
var _tmpl$6 = /*#__PURE__*/ template(`<div><div data-scope=transfer data-part=operations>`);
|
|
5408
|
+
var _tmpl$4$1 = /*#__PURE__*/ template(`<div data-scope=transfer data-part=panel><div data-scope=transfer data-part=head><span data-scope=transfer data-part=title></span><span data-scope=transfer data-part=count></span></div><div data-scope=transfer data-part=list>`);
|
|
5409
|
+
var _tmpl$5$1 = /*#__PURE__*/ template(`<p data-scope=transfer data-part=empty>Nothing here`);
|
|
5410
|
+
var _tmpl$6$1 = /*#__PURE__*/ template(`<div><div data-scope=transfer data-part=operations>`);
|
|
5118
5411
|
function checkGlyph() {
|
|
5119
5412
|
return _tmpl$$2();
|
|
5120
5413
|
}
|
|
@@ -5164,7 +5457,7 @@ function Transfer(props) {
|
|
|
5164
5457
|
}
|
|
5165
5458
|
function panel(side, title, query, setQuery, checked, setChecked, items) {
|
|
5166
5459
|
return (() => {
|
|
5167
|
-
var _el$4 = _tmpl$4(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
|
|
5460
|
+
var _el$4 = _tmpl$4$1(), _el$5 = _el$4.firstChild, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$9 = _el$5.nextSibling;
|
|
5168
5461
|
setAttribute(_el$4, "data-side", side);
|
|
5169
5462
|
insert(_el$6, title);
|
|
5170
5463
|
insert(_el$7, () => String(items.length));
|
|
@@ -5191,7 +5484,7 @@ function Transfer(props) {
|
|
|
5191
5484
|
return items.length > 0;
|
|
5192
5485
|
},
|
|
5193
5486
|
get fallback() {
|
|
5194
|
-
return _tmpl$5();
|
|
5487
|
+
return _tmpl$5$1();
|
|
5195
5488
|
},
|
|
5196
5489
|
get children() {
|
|
5197
5490
|
return createComponent(For, {
|
|
@@ -5228,7 +5521,7 @@ function Transfer(props) {
|
|
|
5228
5521
|
})();
|
|
5229
5522
|
}
|
|
5230
5523
|
return (() => {
|
|
5231
|
-
var _el$1 = _tmpl$6(), _el$10 = _el$1.firstChild;
|
|
5524
|
+
var _el$1 = _tmpl$6$1(), _el$10 = _el$1.firstChild;
|
|
5232
5525
|
spread(_el$1, mergeProps(rest, {
|
|
5233
5526
|
"data-scope": "transfer",
|
|
5234
5527
|
"data-part": "root"
|
|
@@ -5287,7 +5580,10 @@ injectComponentStyle("tour");
|
|
|
5287
5580
|
//#region src/components/tree-select/index.tsx
|
|
5288
5581
|
var _tmpl$$1 = /*#__PURE__*/ template(`<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round aria-hidden=true><path d="m9 18 6-6-6-6">`);
|
|
5289
5582
|
var _tmpl$2 = /*#__PURE__*/ template(`<span>`);
|
|
5290
|
-
var _tmpl$3 = /*#__PURE__*/ template(`<
|
|
5583
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<div data-scope=tree-select data-part=search>`);
|
|
5584
|
+
var _tmpl$4 = /*#__PURE__*/ template(`<div data-scope=tree-select data-part=body>`);
|
|
5585
|
+
var _tmpl$5 = /*#__PURE__*/ template(`<button><span data-part=chevron aria-hidden=true>`);
|
|
5586
|
+
var _tmpl$6 = /*#__PURE__*/ template(`<p data-scope=tree-select data-part=empty>Nothing matches`);
|
|
5291
5587
|
function chevron() {
|
|
5292
5588
|
return _tmpl$$1();
|
|
5293
5589
|
}
|
|
@@ -5295,17 +5591,21 @@ function chevron() {
|
|
|
5295
5591
|
* A tree behind a field: the control reads like an input, the vessel
|
|
5296
5592
|
* below walks the hierarchy, and one leaf click closes the deal. Single
|
|
5297
5593
|
* selection — the chosen label rides on the control, its value rides in
|
|
5298
|
-
* `value`.
|
|
5594
|
+
* `value`. `filterable` puts a filter line at the top of the vessel;
|
|
5595
|
+
* matches keep their ancestors and the branches fan open.
|
|
5299
5596
|
*/
|
|
5300
5597
|
function TreeSelect(props) {
|
|
5301
5598
|
const [own, rest] = splitProps(props, [
|
|
5302
5599
|
"value",
|
|
5303
5600
|
"data",
|
|
5304
5601
|
"placeholder",
|
|
5602
|
+
"filterable",
|
|
5305
5603
|
"disabled",
|
|
5306
5604
|
"onValueChange"
|
|
5307
5605
|
]);
|
|
5308
5606
|
const [open, setOpen] = createSignal(false);
|
|
5607
|
+
const [query, setQuery] = createSignal("");
|
|
5608
|
+
const filterFns = useFilter({ sensitivity: "base" });
|
|
5309
5609
|
const collection = createMemo(() => createTreeCollection$1({
|
|
5310
5610
|
nodeToValue: (node) => node.value,
|
|
5311
5611
|
nodeToString: (node) => node.label,
|
|
@@ -5315,7 +5615,23 @@ function TreeSelect(props) {
|
|
|
5315
5615
|
children: own.data
|
|
5316
5616
|
}
|
|
5317
5617
|
}));
|
|
5618
|
+
const filtering = () => own.filterable && query().trim().length > 0;
|
|
5619
|
+
/** The collection pruned to the matches — each hit keeping its
|
|
5620
|
+
* ancestors, so a deep match still reads inside its hierarchy. */
|
|
5621
|
+
const visibleCollection = createMemo(() => filtering() ? collection().filter((node) => filterFns().contains(node.label, query().trim())) : collection());
|
|
5318
5622
|
const firstLevel = () => (own.data ?? []).map((node) => node.value);
|
|
5623
|
+
const expandedWhileFiltering = () => {
|
|
5624
|
+
if (!filtering()) return void 0;
|
|
5625
|
+
const values = [];
|
|
5626
|
+
const walk = (nodes) => {
|
|
5627
|
+
for (const node of nodes) if (node.children?.length) {
|
|
5628
|
+
values.push(node.value);
|
|
5629
|
+
walk(node.children);
|
|
5630
|
+
}
|
|
5631
|
+
};
|
|
5632
|
+
walk(visibleCollection().rootNode.children ?? []);
|
|
5633
|
+
return values;
|
|
5634
|
+
};
|
|
5319
5635
|
const label = () => {
|
|
5320
5636
|
let found;
|
|
5321
5637
|
const walk = (nodes) => {
|
|
@@ -5390,15 +5706,18 @@ function TreeSelect(props) {
|
|
|
5390
5706
|
get open() {
|
|
5391
5707
|
return open();
|
|
5392
5708
|
},
|
|
5393
|
-
onOpenChange: (details) =>
|
|
5709
|
+
onOpenChange: (details) => {
|
|
5710
|
+
setOpen(details.open);
|
|
5711
|
+
if (!details.open) setQuery("");
|
|
5712
|
+
},
|
|
5394
5713
|
positioning: {
|
|
5395
5714
|
sameWidth: true,
|
|
5396
5715
|
placement: "bottom-start"
|
|
5397
5716
|
},
|
|
5398
5717
|
get children() {
|
|
5399
5718
|
return [createComponent(Popover$1.Trigger, { asChild: (propsFn) => (() => {
|
|
5400
|
-
var _el$
|
|
5401
|
-
spread(_el$
|
|
5719
|
+
var _el$5 = _tmpl$5(), _el$6 = _el$5.firstChild;
|
|
5720
|
+
spread(_el$5, mergeProps(propsFn, {
|
|
5402
5721
|
"type": "button",
|
|
5403
5722
|
"data-scope": "tree-select",
|
|
5404
5723
|
"data-part": "control",
|
|
@@ -5412,43 +5731,72 @@ function TreeSelect(props) {
|
|
|
5412
5731
|
return own.disabled;
|
|
5413
5732
|
}
|
|
5414
5733
|
}), false, true);
|
|
5415
|
-
insert(_el$
|
|
5416
|
-
insert(_el$
|
|
5417
|
-
return _el$
|
|
5734
|
+
insert(_el$5, () => label() ?? own.placeholder ?? "Select…", _el$6);
|
|
5735
|
+
insert(_el$6, chevron);
|
|
5736
|
+
return _el$5;
|
|
5418
5737
|
})() }), createComponent(Portal, { get children() {
|
|
5419
5738
|
return createComponent(Popover$1.Positioner, { get children() {
|
|
5420
5739
|
return createComponent(Popover$1.Content, {
|
|
5421
5740
|
"data-scope": "tree-select",
|
|
5422
5741
|
"data-part": "content",
|
|
5423
5742
|
get children() {
|
|
5424
|
-
return createComponent(
|
|
5425
|
-
get
|
|
5426
|
-
return
|
|
5743
|
+
return [createComponent(Show, {
|
|
5744
|
+
get when() {
|
|
5745
|
+
return own.filterable;
|
|
5427
5746
|
},
|
|
5428
|
-
selectionMode: "single",
|
|
5429
|
-
get selectedValue() {
|
|
5430
|
-
return memo(() => !!own.value)() ? [own.value] : [];
|
|
5431
|
-
},
|
|
5432
|
-
get defaultExpandedValue() {
|
|
5433
|
-
return firstLevel();
|
|
5434
|
-
},
|
|
5435
|
-
onSelectionChange: pick,
|
|
5436
5747
|
get children() {
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
});
|
|
5449
|
-
} });
|
|
5748
|
+
var _el$3 = _tmpl$3();
|
|
5749
|
+
insert(_el$3, createComponent(Input, {
|
|
5750
|
+
size: "sm",
|
|
5751
|
+
get value() {
|
|
5752
|
+
return query();
|
|
5753
|
+
},
|
|
5754
|
+
onValueChange: setQuery,
|
|
5755
|
+
placeholder: "Filter…",
|
|
5756
|
+
"aria-label": "Filter options"
|
|
5757
|
+
}));
|
|
5758
|
+
return _el$3;
|
|
5450
5759
|
}
|
|
5451
|
-
})
|
|
5760
|
+
}), (() => {
|
|
5761
|
+
var _el$4 = _tmpl$4();
|
|
5762
|
+
insert(_el$4, createComponent(Show, {
|
|
5763
|
+
get when() {
|
|
5764
|
+
return (visibleCollection().rootNode.children ?? []).length > 0;
|
|
5765
|
+
},
|
|
5766
|
+
get fallback() {
|
|
5767
|
+
return _tmpl$6();
|
|
5768
|
+
},
|
|
5769
|
+
get children() {
|
|
5770
|
+
return createComponent(TreeView$1.Root, mergeProps({
|
|
5771
|
+
get collection() {
|
|
5772
|
+
return visibleCollection();
|
|
5773
|
+
},
|
|
5774
|
+
selectionMode: "single",
|
|
5775
|
+
get selectedValue() {
|
|
5776
|
+
return memo(() => !!own.value)() ? [own.value] : [];
|
|
5777
|
+
}
|
|
5778
|
+
}, () => filtering() ? { expandedValue: expandedWhileFiltering() } : { defaultExpandedValue: firstLevel() }, {
|
|
5779
|
+
onSelectionChange: pick,
|
|
5780
|
+
get children() {
|
|
5781
|
+
return createComponent(TreeView$1.Tree, { get children() {
|
|
5782
|
+
return createComponent(For, {
|
|
5783
|
+
get each() {
|
|
5784
|
+
return visibleCollection().rootNode.children;
|
|
5785
|
+
},
|
|
5786
|
+
children: (node, index) => createComponent(Row, {
|
|
5787
|
+
node,
|
|
5788
|
+
get indexPath() {
|
|
5789
|
+
return [index()];
|
|
5790
|
+
}
|
|
5791
|
+
})
|
|
5792
|
+
});
|
|
5793
|
+
} });
|
|
5794
|
+
}
|
|
5795
|
+
}));
|
|
5796
|
+
}
|
|
5797
|
+
}));
|
|
5798
|
+
return _el$4;
|
|
5799
|
+
})()];
|
|
5452
5800
|
}
|
|
5453
5801
|
});
|
|
5454
5802
|
} });
|