@snowui-design-system/components 0.3.0-alpha.1 → 0.3.0-alpha.3
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/AGENTS.md +21 -0
- package/LICENSE +133 -89
- package/README.md +21 -7
- package/component-catalog.json +505 -84
- package/dist/client/blocks/Sidebar.js +75 -46
- package/dist/client/blocks/SidebarSection.js +3 -1
- package/dist/client/blocks/index.js +2 -0
- package/dist/client/compat.js +2 -0
- package/dist/client/components/BarChart.js +1 -1
- package/dist/client/components/Breadcrumb.js +17 -11
- package/dist/client/components/CircularChart.js +2 -2
- package/dist/client/components/CodeBlock.js +278 -225
- package/dist/client/components/CopyButton.js +5 -2
- package/dist/client/components/ExpandButton.js +10 -3
- package/dist/client/components/Frame.js +15 -9
- package/dist/client/components/GaugeChart.js +2 -2
- package/dist/client/components/ImageViewer.js +51 -27
- package/dist/client/components/Indicator.js +5 -3
- package/dist/client/components/Input.js +27 -17
- package/dist/client/components/LineChart.js +1 -1
- package/dist/client/components/Link.d.ts +1 -1
- package/dist/client/components/Link.js +43 -22
- package/dist/client/components/Listbox.js +26 -15
- package/dist/client/components/OverflowAction.d.ts +2 -0
- package/dist/client/components/OverflowAction.js +146 -65
- package/dist/client/components/OverflowActions.d.ts +2 -0
- package/dist/client/components/OverflowActions.js +67 -16
- package/dist/client/components/Pagination.js +71 -48
- package/dist/client/components/Select.js +29 -18
- package/dist/client/components/SidePanel.js +76 -50
- package/dist/client/components/Tab.js +30 -31
- package/dist/client/components/TableBody.js +10 -4
- package/dist/client/components/TableCell.js +57 -32
- package/dist/client/components/TableHead.js +69 -38
- package/dist/client/components/TableToolbar.js +112 -79
- package/dist/client/components/Text.js +103 -47
- package/dist/client/components/Textarea.js +7 -1
- package/dist/client/components/Toast.js +8 -1
- package/dist/client/components/Tooltip.js +200 -195
- package/dist/client/context.js +2 -0
- package/dist/client/dev.js +2 -0
- package/dist/client/i18n/messages.d.ts +2 -2
- package/dist/client/i18n/messages.js +117 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +3 -1
- package/dist/client/internal/code-block/prettier-svelte.d.ts +2 -0
- package/dist/client/internal/component-icon/index.js +2 -0
- package/dist/client/internal/snow-ui-logo/emoji-metrics.js +2 -0
- package/dist/client/keys.js +2 -0
- package/dist/client/lib/adaptive-contrast-renderer.js +2 -0
- package/dist/client/lib/chart/appearance-timeline.js +2 -0
- package/dist/client/lib/chart/arc-path.js +2 -0
- package/dist/client/lib/chart/colors.js +2 -0
- package/dist/client/lib/chart/size.js +2 -0
- package/dist/client/lib/clipboard.js +2 -0
- package/dist/client/lib/color.js +2 -0
- package/dist/client/lib/date-format.js +2 -0
- package/dist/client/lib/edge-fade.js +2 -0
- package/dist/client/lib/number-format.js +8 -0
- package/dist/client/lib/overflow-actions-motion.js +2 -0
- package/dist/client/lib/overlay-trigger-timing.js +2 -0
- package/dist/client/lib/progressive-blur.d.ts +13 -0
- package/dist/client/lib/progressive-blur.js +54 -0
- package/dist/client/lib/responsive-exit.js +2 -0
- package/dist/client/lib/search-filter.js +2 -0
- package/dist/client/lib/side-panel.js +2 -0
- package/dist/client/lib/split-pane.js +2 -0
- package/dist/client/lib/table-column-motion.js +2 -0
- package/dist/client/lib/table-responsive.js +2 -0
- package/dist/client/lib/table-selection-fade.js +2 -0
- package/dist/client/lib/table-truncation.js +2 -0
- package/dist/client/lib/text-motion/animation.js +2 -0
- package/dist/client/lib/text-motion/character.js +2 -0
- package/dist/client/lib/text-motion/color.js +2 -0
- package/dist/client/lib/text-motion/layout.js +2 -0
- package/dist/client/lib/text-motion/preference.js +2 -0
- package/dist/client/lib/text-motion/sequence.js +2 -0
- package/dist/client/lib/text-motion/typography.js +2 -0
- package/dist/client/lib/tooltip-delay.js +2 -0
- package/dist/client/lib/tooltip-motion-dismiss.js +2 -0
- package/dist/client/lib/tooltip-pointer-speed.js +2 -0
- package/dist/client/lib/truncate.js +2 -0
- package/dist/client/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/client/logic/ComponentPartsBoundary.js +15 -0
- package/dist/client/logic/frame-field-control.js +2 -0
- package/dist/client/logic/frame-motion-defaults.js +2 -0
- package/dist/client/logic/frame-prop-filter.js +2 -0
- package/dist/client/logic/geometry-cache.js +2 -0
- package/dist/client/logic/layout-flip.js +2 -0
- package/dist/client/logic/morph.js +2 -0
- package/dist/client/logic/motion-engine.js +2 -0
- package/dist/client/logic/motion-orchestration.js +2 -0
- package/dist/client/logic/motion-types.js +2 -0
- package/dist/client/logic/overflow-actions.d.ts +3 -2
- package/dist/client/logic/wc-adapter.js +2 -0
- package/dist/client/motion/bridge.js +2 -0
- package/dist/client/motion/content-crossfade.js +2 -0
- package/dist/client/motion/expand.js +2 -0
- package/dist/client/motion/fade-in.js +2 -0
- package/dist/client/motion/fade-out.js +2 -0
- package/dist/client/motion/morph.js +2 -0
- package/dist/client/motion/move.js +2 -0
- package/dist/client/motion/number.js +2 -0
- package/dist/client/motion/replace.js +2 -0
- package/dist/client/motion/rotate.css +2 -0
- package/dist/client/motion/rotate.js +2 -0
- package/dist/client/motion/scale-in.js +2 -0
- package/dist/client/motion/tokens.js +2 -0
- package/dist/client/motion/while-2xl.js +2 -0
- package/dist/client/motion/while-active.js +2 -0
- package/dist/client/motion/while-appear.js +2 -0
- package/dist/client/motion/while-click.js +2 -0
- package/dist/client/motion/while-collapsed.js +2 -0
- package/dist/client/motion/while-disabled.js +2 -0
- package/dist/client/motion/while-disappear.js +2 -0
- package/dist/client/motion/while-drag.js +2 -0
- package/dist/client/motion/while-editing.js +2 -0
- package/dist/client/motion/while-expanded.js +2 -0
- package/dist/client/motion/while-focus.js +2 -0
- package/dist/client/motion/while-hover.js +2 -0
- package/dist/client/motion/while-idle.js +2 -0
- package/dist/client/motion/while-key.js +2 -0
- package/dist/client/motion/while-lg.js +2 -0
- package/dist/client/motion/while-load.js +2 -0
- package/dist/client/motion/while-md.js +2 -0
- package/dist/client/motion/while-reload.js +2 -0
- package/dist/client/motion/while-scroll.js +2 -0
- package/dist/client/motion/while-sm.js +2 -0
- package/dist/client/motion/while-uploading.js +2 -0
- package/dist/client/motion/while-validating.js +2 -0
- package/dist/client/motion/while-xl.js +2 -0
- package/dist/client/motion/while-xs.js +2 -0
- package/dist/client/styles/auto-layout.css +3 -1
- package/dist/client/styles/backdrop.css +2 -0
- package/dist/client/styles/components.css +6 -4
- package/dist/client/styles/index.css +2 -0
- package/dist/client/styles/layout.css +20 -4
- package/dist/client/styles/scale.css +2 -0
- package/dist/client/styles/scrollbar.css +3 -1
- package/dist/client/styles/tokens.css +2 -0
- package/dist/client/vite-env.d.ts +2 -0
- package/dist/server/blocks/Sidebar.js +41 -21
- package/dist/server/blocks/SidebarSection.js +3 -1
- package/dist/server/blocks/index.js +2 -0
- package/dist/server/compat.js +2 -0
- package/dist/server/components/BarChart.js +1 -1
- package/dist/server/components/Breadcrumb.js +9 -2
- package/dist/server/components/CircularChart.js +2 -2
- package/dist/server/components/CodeBlock.js +25 -13
- package/dist/server/components/CopyButton.js +6 -2
- package/dist/server/components/ExpandButton.js +7 -3
- package/dist/server/components/Frame.js +10 -3
- package/dist/server/components/GaugeChart.js +2 -2
- package/dist/server/components/ImageViewer.js +6 -3
- package/dist/server/components/Indicator.js +5 -3
- package/dist/server/components/Input.js +14 -17
- package/dist/server/components/LineChart.js +1 -1
- package/dist/server/components/Link.d.ts +1 -1
- package/dist/server/components/Link.js +20 -3
- package/dist/server/components/Listbox.js +17 -4
- package/dist/server/components/OverflowAction.d.ts +2 -0
- package/dist/server/components/OverflowAction.js +70 -26
- package/dist/server/components/OverflowActions.d.ts +2 -0
- package/dist/server/components/OverflowActions.js +49 -14
- package/dist/server/components/Pagination.js +21 -10
- package/dist/server/components/Select.js +23 -11
- package/dist/server/components/SidePanel.js +28 -8
- package/dist/server/components/Tab.js +61 -52
- package/dist/server/components/TableBody.js +9 -2
- package/dist/server/components/TableCell.js +28 -7
- package/dist/server/components/TableHead.js +31 -7
- package/dist/server/components/TableToolbar.js +57 -30
- package/dist/server/components/Text.js +52 -12
- package/dist/server/components/Textarea.js +4 -1
- package/dist/server/components/Toast.js +4 -1
- package/dist/server/components/Tooltip.js +10 -10
- package/dist/server/context.js +2 -0
- package/dist/server/dev.js +2 -0
- package/dist/server/i18n/messages.d.ts +2 -2
- package/dist/server/i18n/messages.js +117 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +3 -1
- package/dist/server/internal/code-block/prettier-svelte.d.ts +2 -0
- package/dist/server/internal/component-icon/index.js +2 -0
- package/dist/server/internal/snow-ui-logo/emoji-metrics.js +2 -0
- package/dist/server/keys.js +2 -0
- package/dist/server/lib/adaptive-contrast-renderer.js +2 -0
- package/dist/server/lib/chart/appearance-timeline.js +2 -0
- package/dist/server/lib/chart/arc-path.js +2 -0
- package/dist/server/lib/chart/colors.js +2 -0
- package/dist/server/lib/chart/size.js +2 -0
- package/dist/server/lib/clipboard.js +2 -0
- package/dist/server/lib/color.js +2 -0
- package/dist/server/lib/date-format.js +2 -0
- package/dist/server/lib/edge-fade.js +2 -0
- package/dist/server/lib/number-format.js +8 -0
- package/dist/server/lib/overflow-actions-motion.js +2 -0
- package/dist/server/lib/overlay-trigger-timing.js +2 -0
- package/dist/server/lib/progressive-blur.d.ts +13 -0
- package/dist/server/lib/progressive-blur.js +54 -0
- package/dist/server/lib/responsive-exit.js +2 -0
- package/dist/server/lib/search-filter.js +2 -0
- package/dist/server/lib/side-panel.js +2 -0
- package/dist/server/lib/split-pane.js +2 -0
- package/dist/server/lib/table-column-motion.js +2 -0
- package/dist/server/lib/table-responsive.js +2 -0
- package/dist/server/lib/table-selection-fade.js +2 -0
- package/dist/server/lib/table-truncation.js +2 -0
- package/dist/server/lib/text-motion/animation.js +2 -0
- package/dist/server/lib/text-motion/character.js +2 -0
- package/dist/server/lib/text-motion/color.js +2 -0
- package/dist/server/lib/text-motion/layout.js +2 -0
- package/dist/server/lib/text-motion/preference.js +2 -0
- package/dist/server/lib/text-motion/sequence.js +2 -0
- package/dist/server/lib/text-motion/typography.js +2 -0
- package/dist/server/lib/tooltip-delay.js +2 -0
- package/dist/server/lib/tooltip-motion-dismiss.js +2 -0
- package/dist/server/lib/tooltip-pointer-speed.js +2 -0
- package/dist/server/lib/truncate.js +2 -0
- package/dist/server/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/server/logic/ComponentPartsBoundary.js +12 -0
- package/dist/server/logic/frame-field-control.js +2 -0
- package/dist/server/logic/frame-motion-defaults.js +2 -0
- package/dist/server/logic/frame-prop-filter.js +2 -0
- package/dist/server/logic/geometry-cache.js +2 -0
- package/dist/server/logic/layout-flip.js +2 -0
- package/dist/server/logic/morph.js +2 -0
- package/dist/server/logic/motion-engine.js +2 -0
- package/dist/server/logic/motion-orchestration.js +2 -0
- package/dist/server/logic/motion-types.js +2 -0
- package/dist/server/logic/overflow-actions.d.ts +3 -2
- package/dist/server/logic/wc-adapter.js +2 -0
- package/dist/server/motion/bridge.js +2 -0
- package/dist/server/motion/content-crossfade.js +2 -0
- package/dist/server/motion/expand.js +2 -0
- package/dist/server/motion/fade-in.js +2 -0
- package/dist/server/motion/fade-out.js +2 -0
- package/dist/server/motion/morph.js +2 -0
- package/dist/server/motion/move.js +2 -0
- package/dist/server/motion/number.js +2 -0
- package/dist/server/motion/replace.js +2 -0
- package/dist/server/motion/rotate.css +2 -0
- package/dist/server/motion/rotate.js +2 -0
- package/dist/server/motion/scale-in.js +2 -0
- package/dist/server/motion/tokens.js +2 -0
- package/dist/server/motion/while-2xl.js +2 -0
- package/dist/server/motion/while-active.js +2 -0
- package/dist/server/motion/while-appear.js +2 -0
- package/dist/server/motion/while-click.js +2 -0
- package/dist/server/motion/while-collapsed.js +2 -0
- package/dist/server/motion/while-disabled.js +2 -0
- package/dist/server/motion/while-disappear.js +2 -0
- package/dist/server/motion/while-drag.js +2 -0
- package/dist/server/motion/while-editing.js +2 -0
- package/dist/server/motion/while-expanded.js +2 -0
- package/dist/server/motion/while-focus.js +2 -0
- package/dist/server/motion/while-hover.js +2 -0
- package/dist/server/motion/while-idle.js +2 -0
- package/dist/server/motion/while-key.js +2 -0
- package/dist/server/motion/while-lg.js +2 -0
- package/dist/server/motion/while-load.js +2 -0
- package/dist/server/motion/while-md.js +2 -0
- package/dist/server/motion/while-reload.js +2 -0
- package/dist/server/motion/while-scroll.js +2 -0
- package/dist/server/motion/while-sm.js +2 -0
- package/dist/server/motion/while-uploading.js +2 -0
- package/dist/server/motion/while-validating.js +2 -0
- package/dist/server/motion/while-xl.js +2 -0
- package/dist/server/motion/while-xs.js +2 -0
- package/dist/server/styles/auto-layout.css +3 -1
- package/dist/server/styles/backdrop.css +2 -0
- package/dist/server/styles/components.css +6 -4
- package/dist/server/styles/index.css +2 -0
- package/dist/server/styles/layout.css +20 -4
- package/dist/server/styles/scale.css +2 -0
- package/dist/server/styles/scrollbar.css +3 -1
- package/dist/server/styles/tokens.css +2 -0
- package/dist/server/vite-env.d.ts +2 -0
- package/llms.txt +5 -0
- package/package.json +14 -6
|
@@ -5,6 +5,7 @@ import Frame from "./Frame.js";
|
|
|
5
5
|
import Button from "./Button.js";
|
|
6
6
|
import Tooltip from "./Tooltip.js";
|
|
7
7
|
import { ComponentIcon } from "../internal/component-icon/index.js";
|
|
8
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
8
9
|
import { fitTextToElement } from "../lib/truncate.js";
|
|
9
10
|
import { TextTruncation } from "../logic/frame-truncation.js";
|
|
10
11
|
import { collapse, findConstraintHost } from "../logic/text-collapse.js";
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
import { resolveParentStateValue } from "../logic/frame-state-value.js";
|
|
19
20
|
import { useOverlayScrollbar } from "../lib/overlay-scrollbar.js";
|
|
20
21
|
import { resizeManager } from "../logic/observer.js";
|
|
22
|
+
import { useLocale } from "../i18n/locale.js";
|
|
21
23
|
|
|
22
24
|
var rest_excludes = new Set([
|
|
23
25
|
'$$slots',
|
|
@@ -60,6 +62,8 @@ export default function Text($$anchor, $$props) {
|
|
|
60
62
|
$.append_styles($$anchor, $$css);
|
|
61
63
|
|
|
62
64
|
// SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
|
|
65
|
+
const localeContext = useLocale();
|
|
66
|
+
|
|
63
67
|
const isTooltipConfigObject = (value) => {
|
|
64
68
|
return typeof value === "object" && value !== null && typeof value !== "function";
|
|
65
69
|
};
|
|
@@ -543,7 +547,17 @@ export default function Text($$anchor, $$props) {
|
|
|
543
547
|
var div = root_1();
|
|
544
548
|
var node_2 = $.child(div);
|
|
545
549
|
|
|
546
|
-
|
|
550
|
+
ComponentPartsBoundary(node_2, {
|
|
551
|
+
children: ($$anchor, $$slotProps) => {
|
|
552
|
+
var fragment_1 = $.comment();
|
|
553
|
+
var node_3 = $.first_child(fragment_1);
|
|
554
|
+
|
|
555
|
+
$.snippet(node_3, () => $$props.children, () => ({ breakpoint: "md" }));
|
|
556
|
+
$.append($$anchor, fragment_1);
|
|
557
|
+
},
|
|
558
|
+
$$slots: { default: true }
|
|
559
|
+
});
|
|
560
|
+
|
|
547
561
|
$.reset(div);
|
|
548
562
|
$.bind_this(div, ($$value) => $.set(skeletonProbe, $$value), () => $.get(skeletonProbe));
|
|
549
563
|
$.append($$anchor, div);
|
|
@@ -554,19 +568,19 @@ export default function Text($$anchor, $$props) {
|
|
|
554
568
|
});
|
|
555
569
|
}
|
|
556
570
|
|
|
557
|
-
var
|
|
571
|
+
var node_4 = $.sibling(node_1, 2);
|
|
558
572
|
|
|
559
573
|
{
|
|
560
574
|
const children = ($$anchor, $$arg0) => {
|
|
561
575
|
let breakpoint = () => ($$arg0?.()).breakpoint;
|
|
562
|
-
var
|
|
563
|
-
var
|
|
576
|
+
var fragment_2 = root_7();
|
|
577
|
+
var node_5 = $.first_child(fragment_2);
|
|
564
578
|
|
|
565
579
|
{
|
|
566
580
|
var consequent_5 = ($$anchor) => {
|
|
567
|
-
var
|
|
568
|
-
var div_1 = $.first_child(
|
|
569
|
-
var
|
|
581
|
+
var fragment_3 = root_3();
|
|
582
|
+
var div_1 = $.first_child(fragment_3);
|
|
583
|
+
var node_6 = $.child(div_1);
|
|
570
584
|
|
|
571
585
|
{
|
|
572
586
|
var consequent_1 = ($$anchor) => {
|
|
@@ -577,32 +591,47 @@ export default function Text($$anchor, $$props) {
|
|
|
577
591
|
};
|
|
578
592
|
|
|
579
593
|
var consequent_2 = ($$anchor) => {
|
|
580
|
-
|
|
594
|
+
ComponentPartsBoundary($$anchor, {
|
|
595
|
+
children: ($$anchor, $$slotProps) => {
|
|
596
|
+
var fragment_6 = $.comment();
|
|
597
|
+
var node_7 = $.first_child(fragment_6);
|
|
598
|
+
|
|
599
|
+
$.snippet(node_7, () => $$props.children, () => ({ breakpoint: breakpoint() }));
|
|
600
|
+
$.append($$anchor, fragment_6);
|
|
601
|
+
},
|
|
602
|
+
$$slots: { default: true }
|
|
603
|
+
});
|
|
581
604
|
};
|
|
582
605
|
|
|
583
|
-
$.if(
|
|
606
|
+
$.if(node_6, ($$render) => {
|
|
584
607
|
if ($.get(resolvedStateText) !== undefined) $$render(consequent_1); else if ($$props.children) $$render(consequent_2, 1);
|
|
585
608
|
});
|
|
586
609
|
}
|
|
587
610
|
|
|
588
|
-
var
|
|
611
|
+
var node_8 = $.sibling(node_6, 2);
|
|
589
612
|
|
|
590
613
|
{
|
|
591
614
|
var consequent_3 = ($$anchor) => {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
615
|
+
{
|
|
616
|
+
let $0 = $.derived(() => localeContext.t("text.expand"));
|
|
617
|
+
|
|
618
|
+
Button($$anchor, $.spread_props(() => parts()?.Button, {
|
|
619
|
+
as: 'more',
|
|
620
|
+
iconOnly: true,
|
|
621
|
+
get 'aria-label'() {
|
|
622
|
+
return $.get($0);
|
|
623
|
+
},
|
|
624
|
+
backgroundBlur: true,
|
|
625
|
+
class: 'snowui-text-built-in-more',
|
|
626
|
+
children: ($$anchor, $$slotProps) => {
|
|
627
|
+
ComponentIcon($$anchor, { name: 'arrow-line-down', 'aria-hidden': 'true' });
|
|
628
|
+
},
|
|
629
|
+
$$slots: { default: true }
|
|
630
|
+
}));
|
|
631
|
+
}
|
|
603
632
|
};
|
|
604
633
|
|
|
605
|
-
$.if(
|
|
634
|
+
$.if(node_8, ($$render) => {
|
|
606
635
|
if (more()) $$render(consequent_3);
|
|
607
636
|
});
|
|
608
637
|
}
|
|
@@ -610,7 +639,7 @@ export default function Text($$anchor, $$props) {
|
|
|
610
639
|
$.reset(div_1);
|
|
611
640
|
$.bind_this(div_1, ($$value) => $.set(truncateWrapperElement, $$value), () => $.get(truncateWrapperElement));
|
|
612
641
|
|
|
613
|
-
var
|
|
642
|
+
var node_9 = $.sibling(div_1, 2);
|
|
614
643
|
|
|
615
644
|
{
|
|
616
645
|
var consequent_4 = ($$anchor) => {
|
|
@@ -628,7 +657,7 @@ export default function Text($$anchor, $$props) {
|
|
|
628
657
|
$.append($$anchor, div_2);
|
|
629
658
|
};
|
|
630
659
|
|
|
631
|
-
$.if(
|
|
660
|
+
$.if(node_9, ($$render) => {
|
|
632
661
|
if ($.get(scrollMode)) $$render(consequent_4);
|
|
633
662
|
});
|
|
634
663
|
}
|
|
@@ -645,13 +674,13 @@ export default function Text($$anchor, $$props) {
|
|
|
645
674
|
]
|
|
646
675
|
);
|
|
647
676
|
|
|
648
|
-
$.append($$anchor,
|
|
677
|
+
$.append($$anchor, fragment_3);
|
|
649
678
|
};
|
|
650
679
|
|
|
651
680
|
var consequent_9 = ($$anchor) => {
|
|
652
681
|
var span = root_5();
|
|
653
682
|
var span_1 = $.child(span);
|
|
654
|
-
var
|
|
683
|
+
var node_10 = $.child(span_1);
|
|
655
684
|
|
|
656
685
|
{
|
|
657
686
|
var consequent_6 = ($$anchor) => {
|
|
@@ -662,10 +691,19 @@ export default function Text($$anchor, $$props) {
|
|
|
662
691
|
};
|
|
663
692
|
|
|
664
693
|
var consequent_7 = ($$anchor) => {
|
|
665
|
-
|
|
694
|
+
ComponentPartsBoundary($$anchor, {
|
|
695
|
+
children: ($$anchor, $$slotProps) => {
|
|
696
|
+
var fragment_11 = $.comment();
|
|
697
|
+
var node_11 = $.first_child(fragment_11);
|
|
698
|
+
|
|
699
|
+
$.snippet(node_11, () => $$props.children, () => ({ breakpoint: breakpoint() }));
|
|
700
|
+
$.append($$anchor, fragment_11);
|
|
701
|
+
},
|
|
702
|
+
$$slots: { default: true }
|
|
703
|
+
});
|
|
666
704
|
};
|
|
667
705
|
|
|
668
|
-
$.if(
|
|
706
|
+
$.if(node_10, ($$render) => {
|
|
669
707
|
if ($.get(resolvedStateText) !== undefined) $$render(consequent_6); else if ($$props.children) $$render(consequent_7, 1);
|
|
670
708
|
});
|
|
671
709
|
}
|
|
@@ -675,7 +713,7 @@ export default function Text($$anchor, $$props) {
|
|
|
675
713
|
|
|
676
714
|
var span_2 = $.sibling(span_1, 2);
|
|
677
715
|
var text_2 = $.child(span_2, true);
|
|
678
|
-
var
|
|
716
|
+
var node_12 = $.sibling(text_2);
|
|
679
717
|
|
|
680
718
|
{
|
|
681
719
|
var consequent_8 = ($$anchor) => {
|
|
@@ -684,7 +722,7 @@ export default function Text($$anchor, $$props) {
|
|
|
684
722
|
$.append($$anchor, span_3);
|
|
685
723
|
};
|
|
686
724
|
|
|
687
|
-
$.if(
|
|
725
|
+
$.if(node_12, ($$render) => {
|
|
688
726
|
if (truncation.isTruncated) $$render(consequent_8);
|
|
689
727
|
});
|
|
690
728
|
}
|
|
@@ -697,7 +735,7 @@ export default function Text($$anchor, $$props) {
|
|
|
697
735
|
|
|
698
736
|
var consequent_12 = ($$anchor) => {
|
|
699
737
|
var span_4 = root_6();
|
|
700
|
-
var
|
|
738
|
+
var node_13 = $.child(span_4);
|
|
701
739
|
|
|
702
740
|
{
|
|
703
741
|
var consequent_10 = ($$anchor) => {
|
|
@@ -708,10 +746,19 @@ export default function Text($$anchor, $$props) {
|
|
|
708
746
|
};
|
|
709
747
|
|
|
710
748
|
var consequent_11 = ($$anchor) => {
|
|
711
|
-
|
|
749
|
+
ComponentPartsBoundary($$anchor, {
|
|
750
|
+
children: ($$anchor, $$slotProps) => {
|
|
751
|
+
var fragment_14 = $.comment();
|
|
752
|
+
var node_14 = $.first_child(fragment_14);
|
|
753
|
+
|
|
754
|
+
$.snippet(node_14, () => $$props.children, () => ({ breakpoint: breakpoint() }));
|
|
755
|
+
$.append($$anchor, fragment_14);
|
|
756
|
+
},
|
|
757
|
+
$$slots: { default: true }
|
|
758
|
+
});
|
|
712
759
|
};
|
|
713
760
|
|
|
714
|
-
$.if(
|
|
761
|
+
$.if(node_13, ($$render) => {
|
|
715
762
|
if ($.get(resolvedStateText) !== undefined) $$render(consequent_10); else if ($$props.children) $$render(consequent_11, 1);
|
|
716
763
|
});
|
|
717
764
|
}
|
|
@@ -736,22 +783,31 @@ export default function Text($$anchor, $$props) {
|
|
|
736
783
|
};
|
|
737
784
|
|
|
738
785
|
var consequent_14 = ($$anchor) => {
|
|
739
|
-
|
|
786
|
+
ComponentPartsBoundary($$anchor, {
|
|
787
|
+
children: ($$anchor, $$slotProps) => {
|
|
788
|
+
var fragment_17 = $.comment();
|
|
789
|
+
var node_15 = $.first_child(fragment_17);
|
|
790
|
+
|
|
791
|
+
$.snippet(node_15, () => $$props.children, () => ({ breakpoint: breakpoint() }));
|
|
792
|
+
$.append($$anchor, fragment_17);
|
|
793
|
+
},
|
|
794
|
+
$$slots: { default: true }
|
|
795
|
+
});
|
|
740
796
|
};
|
|
741
797
|
|
|
742
|
-
$.if(
|
|
798
|
+
$.if(node_5, ($$render) => {
|
|
743
799
|
if (lines() === 0) $$render(consequent_5); else if (lines() === 1) $$render(consequent_9, 1); else if (lines() === 2 || lines() === 3) $$render(consequent_12, 2); else if ($.get(resolvedStateText) !== undefined) $$render(consequent_13, 3); else if ($$props.children) $$render(consequent_14, 4);
|
|
744
800
|
});
|
|
745
801
|
}
|
|
746
802
|
|
|
747
|
-
var
|
|
803
|
+
var node_16 = $.sibling(node_5, 2);
|
|
748
804
|
|
|
749
805
|
{
|
|
750
806
|
var consequent_17 = ($$anchor) => {
|
|
751
807
|
Tooltip($$anchor, $.spread_props(() => $.get(tooltipConfig), {
|
|
752
808
|
children: ($$anchor, $$slotProps) => {
|
|
753
|
-
var
|
|
754
|
-
var
|
|
809
|
+
var fragment_19 = $.comment();
|
|
810
|
+
var node_17 = $.first_child(fragment_19);
|
|
755
811
|
|
|
756
812
|
{
|
|
757
813
|
var consequent_15 = ($$anchor) => {
|
|
@@ -762,30 +818,30 @@ export default function Text($$anchor, $$props) {
|
|
|
762
818
|
};
|
|
763
819
|
|
|
764
820
|
var consequent_16 = ($$anchor) => {
|
|
765
|
-
var
|
|
766
|
-
var
|
|
821
|
+
var fragment_21 = $.comment();
|
|
822
|
+
var node_18 = $.first_child(fragment_21);
|
|
767
823
|
|
|
768
|
-
$.snippet(
|
|
769
|
-
$.append($$anchor,
|
|
824
|
+
$.snippet(node_18, () => $.get(tooltipContent));
|
|
825
|
+
$.append($$anchor, fragment_21);
|
|
770
826
|
};
|
|
771
827
|
|
|
772
|
-
$.if(
|
|
828
|
+
$.if(node_17, ($$render) => {
|
|
773
829
|
if (typeof $.get(tooltipContent) === "string") $$render(consequent_15); else if (typeof $.get(tooltipContent) === "function") $$render(consequent_16, 1);
|
|
774
830
|
});
|
|
775
831
|
}
|
|
776
832
|
|
|
777
|
-
$.append($$anchor,
|
|
833
|
+
$.append($$anchor, fragment_19);
|
|
778
834
|
},
|
|
779
835
|
$$slots: { default: true }
|
|
780
836
|
}));
|
|
781
837
|
};
|
|
782
838
|
|
|
783
|
-
$.if(
|
|
839
|
+
$.if(node_16, ($$render) => {
|
|
784
840
|
if ($.get(needTooltip)) $$render(consequent_17);
|
|
785
841
|
});
|
|
786
842
|
}
|
|
787
843
|
|
|
788
|
-
$.append($$anchor,
|
|
844
|
+
$.append($$anchor, fragment_2);
|
|
789
845
|
};
|
|
790
846
|
|
|
791
847
|
let $0 = $.derived(() => $.get(shouldTruncate) ? String(lines()) : undefined);
|
|
@@ -794,7 +850,7 @@ export default function Text($$anchor, $$props) {
|
|
|
794
850
|
let $3 = $.derived(() => lines() === 0 ? $.get(isExpanding) ? "true" : "false" : undefined);
|
|
795
851
|
let $4 = $.derived(() => $.get(scrollMode) ? "true" : undefined);
|
|
796
852
|
|
|
797
|
-
Frame(
|
|
853
|
+
Frame(node_4, $.spread_props(
|
|
798
854
|
{
|
|
799
855
|
get enableResponsive() {
|
|
800
856
|
return enableResponsive();
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import { resizeManager } from "../logic/observer.js";
|
|
14
14
|
import { splitFrameHostProps } from "../logic/frame-prop-filter.js";
|
|
15
15
|
import { useOverlayScrollbar } from "../lib/overlay-scrollbar.js";
|
|
16
|
+
import { useLocale } from "../i18n/locale.js";
|
|
16
17
|
|
|
17
18
|
var rest_excludes = new Set([
|
|
18
19
|
'$$slots',
|
|
@@ -77,6 +78,8 @@ export default function Textarea($$anchor, $$props) {
|
|
|
77
78
|
$.append_styles($$anchor, $$css);
|
|
78
79
|
|
|
79
80
|
// SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
|
|
81
|
+
const localeContext = useLocale();
|
|
82
|
+
|
|
80
83
|
let value = $.prop($$props, 'value', 15),
|
|
81
84
|
defaultValue = $.prop($$props, 'defaultValue', 3, undefined),
|
|
82
85
|
placeholder = $.prop($$props, 'placeholder', 3, undefined),
|
|
@@ -429,6 +432,7 @@ export default function Textarea($$anchor, $$props) {
|
|
|
429
432
|
var consequent_1 = ($$anchor) => {
|
|
430
433
|
{
|
|
431
434
|
let $0 = $.derived(() => $.get(indicatorAxis) === "width" ? $.get(resizeWidth) : $.get(resizeHeight));
|
|
435
|
+
let $1 = $.derived(() => localeContext.t("textarea.resize"));
|
|
432
436
|
|
|
433
437
|
Indicator($$anchor, {
|
|
434
438
|
as: 'resize-handle',
|
|
@@ -450,7 +454,9 @@ export default function Textarea($$anchor, $$props) {
|
|
|
450
454
|
minWidth: 120,
|
|
451
455
|
minHeight: 60,
|
|
452
456
|
applySize: false,
|
|
453
|
-
ariaLabel
|
|
457
|
+
get ariaLabel() {
|
|
458
|
+
return $.get($1);
|
|
459
|
+
},
|
|
454
460
|
onSizeChange: handleIndicatorSize
|
|
455
461
|
});
|
|
456
462
|
}
|
|
@@ -5,6 +5,7 @@ import { onMount, onDestroy } from "svelte";
|
|
|
5
5
|
import { Frame } from "../index.js";
|
|
6
6
|
import { GENERIC_SCALE_APPEAR_MOTION } from "../motion/presets/generic.js";
|
|
7
7
|
import { ComponentIcon } from "../internal/component-icon/index.js";
|
|
8
|
+
import { useLocale } from "../i18n/locale.js";
|
|
8
9
|
import { registerToastTemplate, unregisterToastTemplate, showToast } from "../logic/toast.js";
|
|
9
10
|
import { mergeComponentPartProps, useComponentPart } from "../logic/component-parts.js";
|
|
10
11
|
|
|
@@ -23,6 +24,8 @@ export default function Toast($$anchor, $$props) {
|
|
|
23
24
|
$.append_styles($$anchor, $$css);
|
|
24
25
|
|
|
25
26
|
// SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
|
|
27
|
+
const localeContext = useLocale();
|
|
28
|
+
|
|
26
29
|
/** 内置图标按钮配置;事件与角色由所属组件控制。 */
|
|
27
30
|
/** 模版模式 id;配合 template=true 后可通过 showToast(id) 触发;Inline 模式自动生成 */
|
|
28
31
|
/** 模版模式:只注册为命令式 Toast 模板,不直接渲染 */
|
|
@@ -287,13 +290,17 @@ export default function Toast($$anchor, $$props) {
|
|
|
287
290
|
var consequent_3 = ($$anchor) => {
|
|
288
291
|
{
|
|
289
292
|
let $0 = $.derived(() => `snowui-clear-icon-btn snowui-toast-close-btn${$.get(parts)?.Button?.class ? ` ${$.get(parts).Button.class}` : ""}`);
|
|
293
|
+
let $1 = $.derived(() => localeContext.t("toast.close"));
|
|
290
294
|
|
|
291
295
|
Button($$anchor, $.spread_props({ bare: true, emphasis: 'muted', size: 'sm' }, () => $.get(parts)?.Button, {
|
|
292
296
|
type: 'button',
|
|
293
297
|
get class() {
|
|
294
298
|
return $.get($0);
|
|
295
299
|
},
|
|
296
|
-
|
|
300
|
+
|
|
301
|
+
get 'aria-label'() {
|
|
302
|
+
return $.get($1);
|
|
303
|
+
},
|
|
297
304
|
onclick: () => $.get(onDismiss)?.(),
|
|
298
305
|
onmousedown: (e) => e.preventDefault(),
|
|
299
306
|
tabindex: -1,
|