@snowui-design-system/components 1.1.0 → 1.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/dist/client/components/Avatar.d.ts +1 -1
- package/dist/client/components/Avatar.js +32 -16
- package/dist/client/components/Button.d.ts +9 -0
- package/dist/client/components/Button.js +133 -18
- package/dist/client/components/Gradient.d.ts +2 -3
- package/dist/client/components/Gradient.js +10 -36
- package/dist/client/components/OverflowAction.d.ts +6 -1
- package/dist/client/components/OverflowAction.js +67 -12
- package/dist/client/components/OverflowActions.d.ts +12 -6
- package/dist/client/components/OverflowActions.js +303 -125
- package/dist/client/components/Select.d.ts +2 -0
- package/dist/client/components/SelectButton.d.ts +2 -0
- package/dist/client/components/SidePanel.js +3 -1
- package/dist/client/components/Skeleton.d.ts +2 -22
- package/dist/client/components/Skeleton.js +63 -391
- package/dist/client/components/Text.d.ts +1 -1
- package/dist/client/components/Text.js +46 -31
- package/dist/client/context.d.ts +8 -0
- package/dist/client/context.js +4 -1
- package/dist/client/index.d.ts +1 -0
- package/dist/client/keys.d.ts +1 -0
- package/dist/client/keys.js +1 -0
- package/dist/client/logic/frame-dom-runtime.d.ts +15 -15
- package/dist/client/logic/frame-dom-runtime.js +70 -30
- package/dist/client/logic/frame-responsive.js +72 -13
- package/dist/client/logic/gradient-static.d.ts +6 -0
- package/dist/client/logic/gradient-static.js +38 -0
- package/dist/client/logic/overflow-actions.d.ts +2 -0
- package/dist/client/logic/skeleton-layouts.d.ts +25 -0
- package/dist/client/logic/skeleton-layouts.js +240 -0
- package/dist/client/logic/tooltip-prop.d.ts +13 -0
- package/dist/client/logic/tooltip-prop.js +29 -0
- package/dist/server/components/Avatar.d.ts +1 -1
- package/dist/server/components/Avatar.js +13 -8
- package/dist/server/components/Button.d.ts +9 -0
- package/dist/server/components/Button.js +82 -5
- package/dist/server/components/Gradient.d.ts +2 -3
- package/dist/server/components/Gradient.js +9 -36
- package/dist/server/components/OverflowAction.d.ts +6 -1
- package/dist/server/components/OverflowAction.js +55 -8
- package/dist/server/components/OverflowActions.d.ts +12 -6
- package/dist/server/components/OverflowActions.js +180 -65
- package/dist/server/components/Select.d.ts +2 -0
- package/dist/server/components/SelectButton.d.ts +2 -0
- package/dist/server/components/SidePanel.js +3 -1
- package/dist/server/components/Skeleton.d.ts +2 -22
- package/dist/server/components/Skeleton.js +35 -378
- package/dist/server/components/Text.d.ts +1 -1
- package/dist/server/components/Text.js +31 -22
- package/dist/server/context.d.ts +8 -0
- package/dist/server/context.js +4 -1
- package/dist/server/index.d.ts +1 -0
- package/dist/server/keys.d.ts +1 -0
- package/dist/server/keys.js +1 -0
- package/dist/server/logic/frame-dom-runtime.d.ts +15 -15
- package/dist/server/logic/frame-dom-runtime.js +70 -30
- package/dist/server/logic/frame-responsive.js +72 -13
- package/dist/server/logic/gradient-static.d.ts +6 -0
- package/dist/server/logic/gradient-static.js +38 -0
- package/dist/server/logic/overflow-actions.d.ts +2 -0
- package/dist/server/logic/skeleton-layouts.d.ts +25 -0
- package/dist/server/logic/skeleton-layouts.js +240 -0
- package/dist/server/logic/tooltip-prop.d.ts +13 -0
- package/dist/server/logic/tooltip-prop.js +29 -0
- package/package.json +1 -1
|
@@ -4,9 +4,6 @@ import { onDestroy, onMount, setContext, tick } from "svelte";
|
|
|
4
4
|
import { ComponentIcon } from "../internal/component-icon/index.js";
|
|
5
5
|
import Frame from "./Frame.js";
|
|
6
6
|
import Button from "./Button.js";
|
|
7
|
-
import SelectButton from "./SelectButton.js";
|
|
8
|
-
import Listbox from "./Listbox.js";
|
|
9
|
-
import MenuItem from "./MenuItem.js";
|
|
10
7
|
import Separator from "./Separator.js";
|
|
11
8
|
import OverflowAction from "./OverflowAction.js";
|
|
12
9
|
import { createOverflowActionsMotion } from "../lib/overflow-actions-motion.js";
|
|
@@ -64,6 +61,7 @@ var rest_excludes = new Set([
|
|
|
64
61
|
'moreLabel',
|
|
65
62
|
'align',
|
|
66
63
|
'disabled',
|
|
64
|
+
'tooltip',
|
|
67
65
|
'buttonProps',
|
|
68
66
|
'children',
|
|
69
67
|
'parts',
|
|
@@ -74,7 +72,8 @@ var rest_excludes = new Set([
|
|
|
74
72
|
var root = $.from_html(`<span data-as="leading"><!></span>`);
|
|
75
73
|
var root_1 = $.from_html(`<!> <span class="snowui-menu-item-label"> </span>`, 1);
|
|
76
74
|
var root_2 = $.from_html(`<span class="snowui-overflow-actions-more-visual"><!></span>`);
|
|
77
|
-
var root_3 = $.from_html(
|
|
75
|
+
var root_3 = $.from_html(`<span class="snowui-overflow-actions-fade-measure" aria-hidden="true" inert=""></span> <span class="snowui-overflow-actions-more-measure" aria-hidden="true" inert=""><span><!></span></span>`, 1);
|
|
76
|
+
var root_4 = $.from_html(`<!> <!> <!>`, 1);
|
|
78
77
|
|
|
79
78
|
const $$css = {
|
|
80
79
|
hash: 'svelte-ewzjdd',
|
|
@@ -85,6 +84,7 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
85
84
|
$.push($$props, true);
|
|
86
85
|
$.append_styles($$anchor, $$css);
|
|
87
86
|
|
|
87
|
+
/** Default tooltip toggle for child OverflowAction items and the overflow More button; disabled by default. */
|
|
88
88
|
let items = $.prop($$props, 'items', 19, () => []),
|
|
89
89
|
compact = $.prop($$props, 'compact', 3, "auto"),
|
|
90
90
|
overflow = $.prop($$props, 'overflow', 3, undefined),
|
|
@@ -94,6 +94,7 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
94
94
|
moreLabel = $.prop($$props, 'moreLabel', 3, undefined),
|
|
95
95
|
align = $.prop($$props, 'align', 3, "end"),
|
|
96
96
|
disabled = $.prop($$props, 'disabled', 3, false),
|
|
97
|
+
tooltip = $.prop($$props, 'tooltip', 3, undefined),
|
|
97
98
|
buttonProps = $.prop($$props, 'buttonProps', 3, undefined),
|
|
98
99
|
children = $.prop($$props, 'children', 3, undefined),
|
|
99
100
|
parts = $.prop($$props, 'parts', 3, undefined),
|
|
@@ -117,8 +118,9 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
117
118
|
|
|
118
119
|
const resolvedMoreLabel = $.derived(() => moreLabel() ?? locale.t("overflowActions.more"));
|
|
119
120
|
let rootElement = $.state(undefined);
|
|
121
|
+
let moreVisualElement = $.state(undefined);
|
|
120
122
|
let moreMeasureElement = $.state(undefined);
|
|
121
|
-
let fadeMeasureElement;
|
|
123
|
+
let fadeMeasureElement = $.state(undefined);
|
|
122
124
|
const separatorWidths = new Map();
|
|
123
125
|
const actionWidths = new Map();
|
|
124
126
|
let modes = $.state($.proxy({}));
|
|
@@ -134,11 +136,42 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
134
136
|
let movement;
|
|
135
137
|
let layoutKey;
|
|
136
138
|
let layoutRevision = 0;
|
|
137
|
-
let isMounted = false;
|
|
139
|
+
let isMounted = $.state(false);
|
|
138
140
|
const registrations = new Map();
|
|
139
141
|
const resolvedButtonProps = $.derived(() => mergeComponentPartProps(buttonProps(), parts()?.Button ?? {}));
|
|
140
142
|
const resolvedMoreButtonProps = $.derived(() => mergeComponentPartProps($.get(resolvedButtonProps), parts()?.SelectButton ?? {}));
|
|
141
143
|
|
|
144
|
+
const resolvedMoreMeasureButtonProps = $.derived(() => {
|
|
145
|
+
const {
|
|
146
|
+
value: _value,
|
|
147
|
+
defaultValue: _defaultValue,
|
|
148
|
+
options: _options,
|
|
149
|
+
placeholder: _placeholder,
|
|
150
|
+
name: _name,
|
|
151
|
+
form: _form,
|
|
152
|
+
required: _required,
|
|
153
|
+
readonly: _readonly,
|
|
154
|
+
invalid: _invalid,
|
|
155
|
+
ariaLabel: _ariaLabel,
|
|
156
|
+
showIndicator: _showIndicator,
|
|
157
|
+
search: _search,
|
|
158
|
+
selectionMode: _selectionMode,
|
|
159
|
+
label: _label,
|
|
160
|
+
indicator: _indicator,
|
|
161
|
+
parts: _parts,
|
|
162
|
+
onchange: _onchange,
|
|
163
|
+
onAction: _onAction,
|
|
164
|
+
...restButtonProps
|
|
165
|
+
} = $.get(resolvedMoreButtonProps);
|
|
166
|
+
|
|
167
|
+
return restButtonProps;
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
let OverflowMenuParts = $.state(undefined);
|
|
171
|
+
let overflowMenuLoading = false;
|
|
172
|
+
let pendingMoreFocus = false;
|
|
173
|
+
let pendingMoreOpen = false;
|
|
174
|
+
|
|
142
175
|
const context = {
|
|
143
176
|
register(action) {
|
|
144
177
|
if (registrations.has(action.id) && false) {
|
|
@@ -168,11 +201,23 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
168
201
|
return disabled();
|
|
169
202
|
},
|
|
170
203
|
|
|
204
|
+
get tooltip() {
|
|
205
|
+
return tooltip();
|
|
206
|
+
},
|
|
207
|
+
|
|
171
208
|
get buttonProps() {
|
|
172
209
|
return $.get(resolvedButtonProps);
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
get tooltipPart() {
|
|
213
|
+
return parts()?.Tooltip;
|
|
173
214
|
}
|
|
174
215
|
};
|
|
175
216
|
|
|
217
|
+
const resolvedGroupTooltip = $.derived(() => tooltip() ?? (typeof buttonProps()?.tooltip === "boolean"
|
|
218
|
+
? buttonProps().tooltip
|
|
219
|
+
: Boolean(buttonProps()?.tooltip)));
|
|
220
|
+
|
|
176
221
|
setContext(OVERFLOW_ACTIONS_CONTEXT_KEY, context);
|
|
177
222
|
|
|
178
223
|
function runAction(id, source, originalEvent) {
|
|
@@ -204,7 +249,7 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
204
249
|
}
|
|
205
250
|
|
|
206
251
|
function scheduleLayout() {
|
|
207
|
-
if (
|
|
252
|
+
if (!$.get(isMounted) || layoutFrame) return;
|
|
208
253
|
|
|
209
254
|
layoutFrame = requestAnimationFrame(() => {
|
|
210
255
|
void flushLayout();
|
|
@@ -217,7 +262,7 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
217
262
|
layoutFrame = 0;
|
|
218
263
|
await tick();
|
|
219
264
|
|
|
220
|
-
if (isMounted) updateLayout();
|
|
265
|
+
if ($.get(isMounted)) updateLayout();
|
|
221
266
|
}
|
|
222
267
|
|
|
223
268
|
function directEntries() {
|
|
@@ -378,7 +423,7 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
378
423
|
|
|
379
424
|
const fadingActions = actions.filter((action) => nextModes[action.id] !== "hidden" && upcoming.nextModes[action.id] === "hidden");
|
|
380
425
|
|
|
381
|
-
const opacity = exit.update(width, required, fadeMeasureElement?.getBoundingClientRect().width ?? 0, fadingActions.length
|
|
426
|
+
const opacity = exit.update(width, required, $.get(fadeMeasureElement)?.getBoundingClientRect().width ?? 0, fadingActions.length
|
|
382
427
|
? JSON.stringify(fadingActions.map((action) => action.id))
|
|
383
428
|
: '');
|
|
384
429
|
|
|
@@ -422,10 +467,17 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
422
467
|
$.set(menuEntries, nextMenuEntries.filter((entry) => entry.type === "action"), true);
|
|
423
468
|
$.set(hasOverflow, $.get(menuEntries).length > 0);
|
|
424
469
|
|
|
470
|
+
if (!$.get(hasOverflow)) {
|
|
471
|
+
pendingMoreFocus = false;
|
|
472
|
+
pendingMoreOpen = false;
|
|
473
|
+
} else if (moveFocus && !$.get(OverflowMenuParts)) {
|
|
474
|
+
pendingMoreFocus = true;
|
|
475
|
+
}
|
|
476
|
+
|
|
425
477
|
if (before || moveFocus) void tick().then(() => {
|
|
426
|
-
if (
|
|
478
|
+
if (!$.get(isMounted) || revision !== layoutRevision) return;
|
|
427
479
|
if (before) movement?.play(before);
|
|
428
|
-
if (moveFocus) $.get(
|
|
480
|
+
if (moveFocus) $.get(moreVisualElement)?.querySelector('button')?.focus({ preventScroll: true });
|
|
429
481
|
});
|
|
430
482
|
}
|
|
431
483
|
|
|
@@ -444,7 +496,7 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
444
496
|
}
|
|
445
497
|
|
|
446
498
|
onMount(() => {
|
|
447
|
-
isMounted
|
|
499
|
+
$.set(isMounted, true);
|
|
448
500
|
|
|
449
501
|
if ($.get(rootElement)) movement = createOverflowActionsMotion($.get(rootElement));
|
|
450
502
|
|
|
@@ -454,7 +506,7 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
454
506
|
});
|
|
455
507
|
|
|
456
508
|
onDestroy(() => {
|
|
457
|
-
isMounted
|
|
509
|
+
$.set(isMounted, false);
|
|
458
510
|
|
|
459
511
|
if (typeof window !== 'undefined') window.removeEventListener('resize', handleViewportResize);
|
|
460
512
|
if (typeof document !== 'undefined') document.fonts?.removeEventListener('loadingdone', requestLayout);
|
|
@@ -496,7 +548,49 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
496
548
|
$.get(resolvedAvailableWidth);
|
|
497
549
|
|
|
498
550
|
// 外部列宽也可能逐帧变化;只更新预算,不使固有宽度缓存失效。
|
|
499
|
-
if (isMounted) void flushLayout();
|
|
551
|
+
if ($.get(isMounted)) void flushLayout();
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
$.user_effect(() => {
|
|
555
|
+
if (!$.get(hasOverflow) || $.get(OverflowMenuParts) || overflowMenuLoading) return;
|
|
556
|
+
|
|
557
|
+
overflowMenuLoading = true;
|
|
558
|
+
|
|
559
|
+
void Promise.all([
|
|
560
|
+
import("./SelectButton.js"),
|
|
561
|
+
import("./Listbox.js"),
|
|
562
|
+
import("./MenuItem.js")
|
|
563
|
+
]).then(async ([selectButtonMod, listboxMod, menuItemMod]) => {
|
|
564
|
+
const shouldFocus = pendingMoreFocus || Boolean(typeof document !== "undefined" && $.get(moreVisualElement)?.contains(document.activeElement));
|
|
565
|
+
const shouldOpen = pendingMoreOpen;
|
|
566
|
+
|
|
567
|
+
pendingMoreFocus = false;
|
|
568
|
+
pendingMoreOpen = false;
|
|
569
|
+
|
|
570
|
+
$.set(
|
|
571
|
+
OverflowMenuParts,
|
|
572
|
+
{
|
|
573
|
+
SelectButton: selectButtonMod.default,
|
|
574
|
+
Listbox: listboxMod.default,
|
|
575
|
+
MenuItem: menuItemMod.default
|
|
576
|
+
},
|
|
577
|
+
true
|
|
578
|
+
);
|
|
579
|
+
|
|
580
|
+
if (!$.get(isMounted) || !$.get(hasOverflow) || !shouldFocus && !shouldOpen) return;
|
|
581
|
+
|
|
582
|
+
await tick();
|
|
583
|
+
|
|
584
|
+
if (!$.get(isMounted) || !$.get(hasOverflow)) return;
|
|
585
|
+
|
|
586
|
+
const trigger = $.get(moreVisualElement)?.querySelector("button");
|
|
587
|
+
|
|
588
|
+
if (shouldFocus) trigger?.focus({ preventScroll: true });
|
|
589
|
+
|
|
590
|
+
if (shouldOpen && trigger?.getAttribute("aria-expanded") !== "true") {
|
|
591
|
+
trigger?.click();
|
|
592
|
+
}
|
|
593
|
+
});
|
|
500
594
|
});
|
|
501
595
|
|
|
502
596
|
{
|
|
@@ -533,7 +627,7 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
533
627
|
},
|
|
534
628
|
|
|
535
629
|
children: ($$anchor, $$slotProps) => {
|
|
536
|
-
var fragment_4 =
|
|
630
|
+
var fragment_4 = root_4();
|
|
537
631
|
var node_3 = $.first_child(fragment_4);
|
|
538
632
|
|
|
539
633
|
{
|
|
@@ -592,6 +686,10 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
592
686
|
return $.get(item).rel;
|
|
593
687
|
},
|
|
594
688
|
|
|
689
|
+
get tooltip() {
|
|
690
|
+
return $.get(item).tooltip;
|
|
691
|
+
},
|
|
692
|
+
|
|
595
693
|
get onclick() {
|
|
596
694
|
return $.get(item).onAction;
|
|
597
695
|
}
|
|
@@ -617,147 +715,227 @@ export default function OverflowActions($$anchor, $$props) {
|
|
|
617
715
|
var node_7 = $.sibling(node_3, 2);
|
|
618
716
|
|
|
619
717
|
{
|
|
620
|
-
var
|
|
718
|
+
var consequent_6 = ($$anchor) => {
|
|
621
719
|
var span = root_2();
|
|
622
720
|
var node_8 = $.child(span);
|
|
623
721
|
|
|
624
722
|
{
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
return disabled();
|
|
645
|
-
},
|
|
646
|
-
onAction: handleMenuAction,
|
|
647
|
-
get parts() {
|
|
648
|
-
return $.get($0);
|
|
649
|
-
},
|
|
650
|
-
label,
|
|
651
|
-
children: ($$anchor, $$slotProps) => {
|
|
652
|
-
Listbox($$anchor, {
|
|
653
|
-
search: false,
|
|
654
|
-
showCheck: false,
|
|
655
|
-
placementMode: 'bottom',
|
|
656
|
-
get align() {
|
|
657
|
-
return align();
|
|
658
|
-
},
|
|
659
|
-
|
|
660
|
-
children: ($$anchor, $$slotProps) => {
|
|
661
|
-
var fragment_12 = $.comment();
|
|
662
|
-
var node_9 = $.first_child(fragment_12);
|
|
663
|
-
|
|
664
|
-
$.each(node_9, 17, () => $.get(menuEntries), $.index, ($$anchor, entry) => {
|
|
665
|
-
{
|
|
666
|
-
let $0 = $.derived(() => disabled() || $.get(entry).action.disabled);
|
|
667
|
-
|
|
668
|
-
MenuItem($$anchor, {
|
|
669
|
-
as: 'item',
|
|
670
|
-
get value() {
|
|
671
|
-
return $.get(entry).action.id;
|
|
672
|
-
},
|
|
723
|
+
var consequent_5 = ($$anchor) => {
|
|
724
|
+
const OverflowSelectButton = $.derived(() => $.get(OverflowMenuParts).SelectButton);
|
|
725
|
+
const OverflowListbox = $.derived(() => $.get(OverflowMenuParts).Listbox);
|
|
726
|
+
const OverflowMenuItem = $.derived(() => $.get(OverflowMenuParts).MenuItem);
|
|
727
|
+
var fragment_10 = $.comment();
|
|
728
|
+
var node_9 = $.first_child(fragment_10);
|
|
729
|
+
|
|
730
|
+
{
|
|
731
|
+
const label = ($$anchor) => {
|
|
732
|
+
ComponentIcon($$anchor, { name: 'three-dots', 'aria-hidden': 'true' });
|
|
733
|
+
};
|
|
734
|
+
|
|
735
|
+
let $0 = $.derived(() => $.get(resolvedGroupTooltip) ? $.get(resolvedMoreLabel) : false);
|
|
736
|
+
|
|
737
|
+
let $1 = $.derived(() => ({
|
|
738
|
+
Listbox: parts()?.Listbox,
|
|
739
|
+
MenuItem: parts()?.MenuItem,
|
|
740
|
+
Tooltip: parts()?.Tooltip
|
|
741
|
+
}));
|
|
673
742
|
|
|
674
|
-
|
|
675
|
-
|
|
743
|
+
$.component(node_9, () => $.get(OverflowSelectButton), ($$anchor, OverflowSelectButton_1) => {
|
|
744
|
+
OverflowSelectButton_1($$anchor, $.spread_props(() => $.get(resolvedMoreButtonProps), {
|
|
745
|
+
iconOnly: true,
|
|
746
|
+
showIndicator: false,
|
|
747
|
+
selectionMode: 'action',
|
|
748
|
+
get ariaLabel() {
|
|
749
|
+
return $.get(resolvedMoreLabel);
|
|
750
|
+
},
|
|
751
|
+
|
|
752
|
+
get tooltip() {
|
|
753
|
+
return $.get($0);
|
|
754
|
+
},
|
|
755
|
+
|
|
756
|
+
get disabled() {
|
|
757
|
+
return disabled();
|
|
758
|
+
},
|
|
759
|
+
onAction: handleMenuAction,
|
|
760
|
+
get parts() {
|
|
761
|
+
return $.get($1);
|
|
762
|
+
},
|
|
763
|
+
label,
|
|
764
|
+
children: ($$anchor, $$slotProps) => {
|
|
765
|
+
var fragment_12 = $.comment();
|
|
766
|
+
var node_10 = $.first_child(fragment_12);
|
|
767
|
+
|
|
768
|
+
$.component(node_10, () => $.get(OverflowListbox), ($$anchor, OverflowListbox_1) => {
|
|
769
|
+
OverflowListbox_1($$anchor, {
|
|
770
|
+
search: false,
|
|
771
|
+
showCheck: false,
|
|
772
|
+
placementMode: 'bottom',
|
|
773
|
+
get align() {
|
|
774
|
+
return align();
|
|
676
775
|
},
|
|
677
776
|
|
|
678
777
|
children: ($$anchor, $$slotProps) => {
|
|
679
|
-
var
|
|
680
|
-
var
|
|
681
|
-
|
|
682
|
-
{
|
|
683
|
-
var
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
$.
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
778
|
+
var fragment_13 = $.comment();
|
|
779
|
+
var node_11 = $.first_child(fragment_13);
|
|
780
|
+
|
|
781
|
+
$.each(node_11, 17, () => $.get(menuEntries), $.index, ($$anchor, entry) => {
|
|
782
|
+
var fragment_14 = $.comment();
|
|
783
|
+
var node_12 = $.first_child(fragment_14);
|
|
784
|
+
|
|
785
|
+
{
|
|
786
|
+
let $0 = $.derived(() => disabled() || $.get(entry).action.disabled);
|
|
787
|
+
|
|
788
|
+
$.component(node_12, () => $.get(OverflowMenuItem), ($$anchor, OverflowMenuItem_1) => {
|
|
789
|
+
OverflowMenuItem_1($$anchor, {
|
|
790
|
+
as: 'item',
|
|
791
|
+
get value() {
|
|
792
|
+
return $.get(entry).action.id;
|
|
793
|
+
},
|
|
794
|
+
|
|
795
|
+
get disabled() {
|
|
796
|
+
return $.get($0);
|
|
797
|
+
},
|
|
798
|
+
|
|
799
|
+
children: ($$anchor, $$slotProps) => {
|
|
800
|
+
var fragment_15 = root_1();
|
|
801
|
+
var node_13 = $.first_child(fragment_15);
|
|
802
|
+
|
|
803
|
+
{
|
|
804
|
+
var consequent_4 = ($$anchor) => {
|
|
805
|
+
var span_1 = root();
|
|
806
|
+
var node_14 = $.child(span_1);
|
|
807
|
+
|
|
808
|
+
renderMenuIcon(node_14, () => $.get(entry).action.icon);
|
|
809
|
+
$.reset(span_1);
|
|
810
|
+
$.append($$anchor, span_1);
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
$.if(node_13, ($$render) => {
|
|
814
|
+
if ($.get(entry).action.icon) $$render(consequent_4);
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
var span_2 = $.sibling(node_13, 2);
|
|
819
|
+
var text = $.child(span_2, true);
|
|
820
|
+
|
|
821
|
+
$.reset(span_2);
|
|
822
|
+
$.template_effect(() => $.set_text(text, $.get(entry).action.label));
|
|
823
|
+
$.append($$anchor, fragment_15);
|
|
824
|
+
},
|
|
825
|
+
$$slots: { default: true }
|
|
826
|
+
});
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
$.append($$anchor, fragment_14);
|
|
831
|
+
});
|
|
832
|
+
|
|
833
|
+
$.append($$anchor, fragment_13);
|
|
703
834
|
},
|
|
704
835
|
$$slots: { default: true }
|
|
705
836
|
});
|
|
706
|
-
}
|
|
707
|
-
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
$.append($$anchor, fragment_12);
|
|
840
|
+
},
|
|
841
|
+
$$slots: { label: true, default: true }
|
|
842
|
+
}));
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
$.append($$anchor, fragment_10);
|
|
847
|
+
};
|
|
848
|
+
|
|
849
|
+
var alternate_2 = ($$anchor) => {
|
|
850
|
+
{
|
|
851
|
+
let $0 = $.derived(() => $.get(resolvedMoreMeasureButtonProps).scaleOnHover ?? false);
|
|
708
852
|
|
|
709
|
-
|
|
853
|
+
Button($$anchor, $.spread_props(() => $.get(resolvedMoreMeasureButtonProps), {
|
|
854
|
+
get scaleOnHover() {
|
|
855
|
+
return $.get($0);
|
|
856
|
+
},
|
|
857
|
+
iconOnly: true,
|
|
858
|
+
get 'aria-label'() {
|
|
859
|
+
return $.get(resolvedMoreLabel);
|
|
860
|
+
},
|
|
861
|
+
'aria-haspopup': 'listbox',
|
|
862
|
+
'aria-expanded': 'false',
|
|
863
|
+
tooltip: false,
|
|
864
|
+
get disabled() {
|
|
865
|
+
return disabled();
|
|
866
|
+
},
|
|
867
|
+
|
|
868
|
+
onclick: () => {
|
|
869
|
+
pendingMoreOpen = true;
|
|
870
|
+
},
|
|
871
|
+
|
|
872
|
+
children: ($$anchor, $$slotProps) => {
|
|
873
|
+
ComponentIcon($$anchor, { name: 'three-dots', 'aria-hidden': 'true' });
|
|
710
874
|
},
|
|
711
875
|
$$slots: { default: true }
|
|
712
|
-
});
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
|
|
876
|
+
}));
|
|
877
|
+
}
|
|
878
|
+
};
|
|
879
|
+
|
|
880
|
+
$.if(node_8, ($$render) => {
|
|
881
|
+
if ($.get(OverflowMenuParts)) $$render(consequent_5); else $$render(alternate_2, -1);
|
|
882
|
+
});
|
|
716
883
|
}
|
|
717
884
|
|
|
718
885
|
$.reset(span);
|
|
886
|
+
$.bind_this(span, ($$value) => $.set(moreVisualElement, $$value), () => $.get(moreVisualElement));
|
|
719
887
|
$.append($$anchor, span);
|
|
720
888
|
};
|
|
721
889
|
|
|
722
890
|
$.if(node_7, ($$render) => {
|
|
723
|
-
if ($.get(hasOverflow)) $$render(
|
|
891
|
+
if ($.get(hasOverflow)) $$render(consequent_6);
|
|
724
892
|
});
|
|
725
893
|
}
|
|
726
894
|
|
|
727
|
-
var
|
|
895
|
+
var node_15 = $.sibling(node_7, 2);
|
|
896
|
+
|
|
897
|
+
{
|
|
898
|
+
var consequent_7 = ($$anchor) => {
|
|
899
|
+
var fragment_18 = root_3();
|
|
900
|
+
var span_3 = $.first_child(fragment_18);
|
|
728
901
|
|
|
729
|
-
|
|
902
|
+
$.bind_this(span_3, ($$value) => $.set(fadeMeasureElement, $$value), () => $.get(fadeMeasureElement));
|
|
730
903
|
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
904
|
+
var span_4 = $.sibling(span_3, 2);
|
|
905
|
+
var span_5 = $.child(span_4);
|
|
906
|
+
var node_16 = $.child(span_5);
|
|
734
907
|
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
908
|
+
{
|
|
909
|
+
let $0 = $.derived(() => $.get(resolvedMoreMeasureButtonProps).scaleOnHover ?? false);
|
|
910
|
+
|
|
911
|
+
Button(node_16, $.spread_props(() => $.get(resolvedMoreMeasureButtonProps), {
|
|
912
|
+
get scaleOnHover() {
|
|
913
|
+
return $.get($0);
|
|
914
|
+
},
|
|
915
|
+
iconOnly: true,
|
|
916
|
+
get 'aria-label'() {
|
|
917
|
+
return $.get(resolvedMoreLabel);
|
|
918
|
+
},
|
|
919
|
+
tooltip: false,
|
|
920
|
+
tabindex: -1,
|
|
921
|
+
children: ($$anchor, $$slotProps) => {
|
|
922
|
+
ComponentIcon($$anchor, { name: 'three-dots', 'aria-hidden': 'true' });
|
|
923
|
+
},
|
|
924
|
+
$$slots: { default: true }
|
|
925
|
+
}));
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
$.reset(span_5);
|
|
929
|
+
$.bind_this(span_5, ($$value) => $.set(moreMeasureElement, $$value), () => $.get(moreMeasureElement));
|
|
930
|
+
$.reset(span_4);
|
|
931
|
+
$.append($$anchor, fragment_18);
|
|
738
932
|
};
|
|
739
933
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
iconOnly: true,
|
|
744
|
-
showIndicator: false,
|
|
745
|
-
selectionMode: 'action',
|
|
746
|
-
get ariaLabel() {
|
|
747
|
-
return $.get(resolvedMoreLabel);
|
|
748
|
-
},
|
|
749
|
-
tabindex: -1,
|
|
750
|
-
get parts() {
|
|
751
|
-
return $.get($0);
|
|
752
|
-
},
|
|
753
|
-
label,
|
|
754
|
-
$$slots: { label: true }
|
|
755
|
-
}));
|
|
934
|
+
$.if(node_15, ($$render) => {
|
|
935
|
+
if ($.get(isMounted)) $$render(consequent_7);
|
|
936
|
+
});
|
|
756
937
|
}
|
|
757
938
|
|
|
758
|
-
$.reset(span_5);
|
|
759
|
-
$.bind_this(span_5, ($$value) => $.set(moreMeasureElement, $$value), () => $.get(moreMeasureElement));
|
|
760
|
-
$.reset(span_4);
|
|
761
939
|
$.append($$anchor, fragment_4);
|
|
762
940
|
},
|
|
763
941
|
$$slots: { default: true }
|
|
@@ -4,6 +4,7 @@ import Button from "./Button.js";
|
|
|
4
4
|
import Input from "./Input.js";
|
|
5
5
|
import Listbox, { type ListboxItem } from "./Listbox.js";
|
|
6
6
|
import MenuItem from "./MenuItem.js";
|
|
7
|
+
import type Tooltip from "./Tooltip.js";
|
|
7
8
|
import { type ComponentPartsOf } from "../logic/component-parts.js";
|
|
8
9
|
export type SelectValue = string | number | undefined;
|
|
9
10
|
export type SelectOption = ListboxItem;
|
|
@@ -19,6 +20,7 @@ type SelectParts = ComponentPartsOf<{
|
|
|
19
20
|
Listbox: typeof Listbox;
|
|
20
21
|
Input: typeof Input;
|
|
21
22
|
MenuItem: typeof MenuItem;
|
|
23
|
+
Tooltip: typeof Tooltip;
|
|
22
24
|
}> & {
|
|
23
25
|
Button?: Omit<ComponentProps<typeof Button>, "children" | "onclick" | "onkeydown" | "disabled">;
|
|
24
26
|
};
|
|
@@ -4,6 +4,7 @@ import { type SelectOption, type SelectValue } from "./Select.js";
|
|
|
4
4
|
import Input from "./Input.js";
|
|
5
5
|
import Listbox from "./Listbox.js";
|
|
6
6
|
import MenuItem from "./MenuItem.js";
|
|
7
|
+
import type Tooltip from "./Tooltip.js";
|
|
7
8
|
import type { ComponentPartsOf } from "../logic/component-parts.js";
|
|
8
9
|
export interface SelectButtonLabelContext {
|
|
9
10
|
value: SelectValue;
|
|
@@ -39,6 +40,7 @@ interface Props extends Omit<ButtonProps, ControlledButtonKeys> {
|
|
|
39
40
|
Listbox: typeof Listbox;
|
|
40
41
|
Input: typeof Input;
|
|
41
42
|
MenuItem: typeof MenuItem;
|
|
43
|
+
Tooltip: typeof Tooltip;
|
|
42
44
|
}>;
|
|
43
45
|
onchange?: (event: Event) => void;
|
|
44
46
|
onAction?: (value: string) => void;
|
|
@@ -786,7 +786,9 @@ export default function SidePanel($$anchor, $$props) {
|
|
|
786
786
|
|
|
787
787
|
function place(nextEnabled) {
|
|
788
788
|
if (nextEnabled) {
|
|
789
|
-
document.body
|
|
789
|
+
const container = marker.parentElement?.closest("[data-snowui-overlay-root]") ?? document.body;
|
|
790
|
+
|
|
791
|
+
container.appendChild(node);
|
|
790
792
|
|
|
791
793
|
return;
|
|
792
794
|
}
|
|
@@ -1,28 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
export type SkeletonVariant = "line" | "circle" | "rect" | "text" | "circular" | "rectangular";
|
|
3
|
-
export interface SkeletonItem {
|
|
4
|
-
shape: "line" | "circle" | "rect";
|
|
5
|
-
width?: string;
|
|
6
|
-
height?: string;
|
|
7
|
-
radius?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface SkeletonLayout {
|
|
11
|
-
key: string;
|
|
12
|
-
known: boolean;
|
|
13
|
-
items: SkeletonItem[];
|
|
14
|
-
}
|
|
15
|
-
export declare function getSkeletonComponentKey(componentClass?: string): string | undefined;
|
|
16
|
-
export declare function resolveSkeletonLayout(options?: {
|
|
17
|
-
componentClass?: string;
|
|
18
|
-
renderHints?: RenderHints;
|
|
19
|
-
variant?: SkeletonVariant;
|
|
20
|
-
width?: string | number;
|
|
21
|
-
height?: string | number;
|
|
22
|
-
}): SkeletonLayout;
|
|
1
|
+
export { getSkeletonComponentKey, resolveSkeletonLayout, type SkeletonItem, type SkeletonLayout, type SkeletonVariant, } from "../logic/skeleton-layouts";
|
|
23
2
|
import type { Snippet } from "svelte";
|
|
24
3
|
import type { RenderHints as FrameRenderHints } from "../logic/frame-types";
|
|
25
4
|
import { type ResponsiveConfig } from "../logic/responsive.js";
|
|
5
|
+
import { type SkeletonVariant } from "../logic/skeleton-layouts";
|
|
26
6
|
interface Props {
|
|
27
7
|
variant?: SkeletonVariant;
|
|
28
8
|
width?: string | number;
|