@snowui-design-system/components 0.3.0-alpha.2 → 0.3.0-alpha.4
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/THIRD_PARTY_NOTICES.md +14 -0
- package/dist/client/blocks/Sidebar.js +56 -41
- package/dist/client/blocks/SidebarSection.js +3 -1
- 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 +99 -59
- package/dist/client/components/Textarea.js +7 -1
- package/dist/client/components/Toast.js +8 -1
- package/dist/client/i18n/messages.d.ts +1 -1
- package/dist/client/i18n/messages.js +114 -0
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/lib/number-format.js +6 -0
- package/dist/client/lib/progressive-blur.d.ts +13 -0
- package/dist/client/lib/progressive-blur.js +54 -0
- package/dist/client/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/client/logic/ComponentPartsBoundary.js +15 -0
- package/dist/client/logic/overflow-actions.d.ts +3 -2
- package/dist/client/styles/layout.css +12 -2
- package/dist/server/blocks/Sidebar.js +19 -5
- package/dist/server/blocks/SidebarSection.js +3 -1
- 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 +46 -10
- package/dist/server/components/Textarea.js +4 -1
- package/dist/server/components/Toast.js +4 -1
- package/dist/server/i18n/messages.d.ts +1 -1
- package/dist/server/i18n/messages.js +114 -0
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/lib/number-format.js +6 -0
- package/dist/server/lib/progressive-blur.d.ts +13 -0
- package/dist/server/lib/progressive-blur.js +54 -0
- package/dist/server/logic/ComponentPartsBoundary.d.ts +7 -0
- package/dist/server/logic/ComponentPartsBoundary.js +12 -0
- package/dist/server/logic/overflow-actions.d.ts +3 -2
- package/dist/server/styles/layout.css +12 -2
- package/package.json +4 -3
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
# 第三方声明
|
|
2
2
|
运行依赖保留各自许可;SnowUI 的商业许可不替代以下条款。
|
|
3
3
|
|
|
4
|
+
## Phosphor Icons(内置功能图标快照;MIT)
|
|
5
|
+
|
|
6
|
+
本包内置的部分功能图标由 `@snowui-design-system/resource-svelte@1.0.29` 的 Phosphor collection 生成,具体图标在 `src/internal/component-icon/builtin-icon-data.ts` 标为 `sourceCollection: "phosphor"`。原始项目:[Phosphor Icons](https://github.com/phosphor-icons/core)。以下 MIT 声明适用于这些图形,不改变 SnowUI 自有代码和图形的许可。
|
|
7
|
+
|
|
8
|
+
MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2023 Phosphor Icons
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
17
|
+
|
|
4
18
|
## svelte 5.56.4 (MIT)
|
|
5
19
|
|
|
6
20
|
Copyright (c) 2016-2025 [Svelte Contributors](https://github.com/sveltejs/svelte/graphs/contributors)
|
|
@@ -19,6 +19,7 @@ import Frame from "../components/Frame.js";
|
|
|
19
19
|
import SidebarSection from "./SidebarSection.js";
|
|
20
20
|
import SidebarItem from "./SidebarItem.js";
|
|
21
21
|
import { SIDEBAR_CONTEXT_KEY } from "./sidebar-context.js";
|
|
22
|
+
import { useLocale } from "../i18n/locale.js";
|
|
22
23
|
|
|
23
24
|
var rest_excludes = new Set([
|
|
24
25
|
'$$slots',
|
|
@@ -99,6 +100,8 @@ export default function Sidebar($$anchor, $$props) {
|
|
|
99
100
|
enableDefaultMotion = $.prop($$props, 'enableDefaultMotion', 3, true),
|
|
100
101
|
rest = $.rest_props($$props, rest_excludes);
|
|
101
102
|
|
|
103
|
+
const localeContext = useLocale();
|
|
104
|
+
|
|
102
105
|
// 可绑定 Prop 负责输入/回传,本地 state 保持连续交互时的显示状态。
|
|
103
106
|
let isCollapsed = $.state($.proxy(untrack(() => collapsed() ?? defaultCollapsed())));
|
|
104
107
|
|
|
@@ -458,25 +461,29 @@ export default function Sidebar($$anchor, $$props) {
|
|
|
458
461
|
|
|
459
462
|
$.set(collapsedSections, restoredCollapsedSections, true);
|
|
460
463
|
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
464
|
+
const targetItemId = activeItemId() ?? restored.activeItemId;
|
|
465
|
+
const targetItem = targetItemId ? findItem(targetItemId) : undefined;
|
|
466
|
+
|
|
467
|
+
const targetSectionId = targetItemId
|
|
468
|
+
? targetItem
|
|
469
|
+
? findItemSectionId(targetItemId)
|
|
470
|
+
: targetItemId === restored.activeItemId ? restored.activeItemSectionId : undefined
|
|
471
|
+
: undefined;
|
|
472
|
+
|
|
473
|
+
if (targetSectionId && $.get(collapsedSections)[targetSectionId] === true) {
|
|
474
|
+
$.set(collapsedSections, { ...$.get(collapsedSections), [targetSectionId]: false }, true);
|
|
470
475
|
}
|
|
471
476
|
|
|
472
477
|
await tick();
|
|
473
478
|
|
|
474
|
-
if (restored.activeItemId && findItem(restored.activeItemId)) {
|
|
479
|
+
if (!activeItemId() && restored.activeItemId && findItem(restored.activeItemId)) {
|
|
475
480
|
$.set(internalActiveItemId, restored.activeItemId, true);
|
|
476
|
-
$.set(activeItemSectionId, findItemSectionId(restored.activeItemId)
|
|
481
|
+
$.set(activeItemSectionId, findItemSectionId(restored.activeItemId), true);
|
|
477
482
|
onActiveItemChange()?.(restored.activeItemId);
|
|
478
483
|
await tick();
|
|
479
484
|
expandActiveItemSection(restored.activeItemId);
|
|
485
|
+
} else if (activeItemId()) {
|
|
486
|
+
$.set(activeItemSectionId, findItem(activeItemId()) ? findItemSectionId(activeItemId()) : targetSectionId, true);
|
|
480
487
|
} else {
|
|
481
488
|
$.set(collapsedSections, restoredCollapsedSections, true);
|
|
482
489
|
}
|
|
@@ -496,7 +503,9 @@ export default function Sidebar($$anchor, $$props) {
|
|
|
496
503
|
version: 1,
|
|
497
504
|
activeItemId: $.get(resolvedActiveItemId),
|
|
498
505
|
activeItemSectionId: $.get(resolvedActiveItemId)
|
|
499
|
-
?
|
|
506
|
+
? findItem($.get(resolvedActiveItemId))
|
|
507
|
+
? findItemSectionId($.get(resolvedActiveItemId))
|
|
508
|
+
: $.get(activeItemSectionId)
|
|
500
509
|
: undefined,
|
|
501
510
|
collapsedSections: $.get(collapsedSections)
|
|
502
511
|
};
|
|
@@ -801,35 +810,41 @@ export default function Sidebar($$anchor, $$props) {
|
|
|
801
810
|
|
|
802
811
|
{
|
|
803
812
|
var consequent_3 = ($$anchor) => {
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
813
|
+
{
|
|
814
|
+
let $0 = $.derived(() => localeContext.t("sidebar.resize"));
|
|
815
|
+
|
|
816
|
+
Indicator($$anchor, $.spread_props(() => parts()?.Indicator, {
|
|
817
|
+
get target() {
|
|
818
|
+
return $.get(rootElement);
|
|
819
|
+
},
|
|
820
|
+
|
|
821
|
+
get revealTarget() {
|
|
822
|
+
return $.get(rootElement);
|
|
823
|
+
},
|
|
824
|
+
axis: 'width',
|
|
825
|
+
edge: 'end',
|
|
826
|
+
pinOffset: 'var(--snowui-sidebar-resize-indicator-offset-override, var(--padding-1))',
|
|
827
|
+
class: 'snowui-sidebar-resize-indicator',
|
|
828
|
+
get value() {
|
|
829
|
+
return $.get(resolvedWidth);
|
|
830
|
+
},
|
|
831
|
+
|
|
832
|
+
get minSize() {
|
|
833
|
+
return minWidth();
|
|
834
|
+
},
|
|
835
|
+
|
|
836
|
+
get maxSize() {
|
|
837
|
+
return maxWidth();
|
|
838
|
+
},
|
|
839
|
+
applySize: false,
|
|
840
|
+
get ariaLabel() {
|
|
841
|
+
return $.get($0);
|
|
842
|
+
},
|
|
843
|
+
onResizeStart: startWidthResize,
|
|
844
|
+
onSizeChange: handleWidthChange,
|
|
845
|
+
onResizeEnd: (next) => void finishWidthResize(next)
|
|
846
|
+
}));
|
|
847
|
+
}
|
|
833
848
|
};
|
|
834
849
|
|
|
835
850
|
$.if(node_13, ($$render) => {
|
|
@@ -63,7 +63,9 @@ export default function SidebarSection($$anchor, $$props) {
|
|
|
63
63
|
const next = !$.get(isCollapsed);
|
|
64
64
|
|
|
65
65
|
$.set(internalCollapsed, next);
|
|
66
|
-
|
|
66
|
+
|
|
67
|
+
if (collapsed() !== undefined) collapsed(next);
|
|
68
|
+
|
|
67
69
|
sidebar?.setSectionCollapsed($$props.id, next);
|
|
68
70
|
onCollapsedChange()?.(next);
|
|
69
71
|
}
|
|
@@ -4,6 +4,7 @@ import { setContext } from "svelte";
|
|
|
4
4
|
import Frame from "./Frame.js";
|
|
5
5
|
import Button from "./Button.js";
|
|
6
6
|
import Text from "./Text.js";
|
|
7
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
7
8
|
import { BREADCRUMB_CONTEXT_KEY, BUTTON_COLLECTION_CONTEXT_KEY } from "../context.js";
|
|
8
9
|
|
|
9
10
|
var rest_excludes = new Set([
|
|
@@ -291,20 +292,25 @@ export default function Breadcrumb($$anchor, $$props) {
|
|
|
291
292
|
|
|
292
293
|
{
|
|
293
294
|
var consequent = ($$anchor) => {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
295
|
+
ComponentPartsBoundary($$anchor, {
|
|
296
|
+
children: ($$anchor, $$slotProps) => {
|
|
297
|
+
var fragment_3 = $.comment();
|
|
298
|
+
var node_2 = $.first_child(fragment_3);
|
|
299
|
+
|
|
300
|
+
$.snippet(node_2, () => $$props.children);
|
|
301
|
+
$.append($$anchor, fragment_3);
|
|
302
|
+
},
|
|
303
|
+
$$slots: { default: true }
|
|
304
|
+
});
|
|
299
305
|
};
|
|
300
306
|
|
|
301
307
|
var alternate = ($$anchor) => {
|
|
302
|
-
var
|
|
303
|
-
var node_3 = $.first_child(
|
|
308
|
+
var fragment_4 = $.comment();
|
|
309
|
+
var node_3 = $.first_child(fragment_4);
|
|
304
310
|
|
|
305
311
|
$.each(node_3, 19, items, (item, index) => `${item.href ?? "current"}:${item.label}:${index}`, ($$anchor, item, index) => {
|
|
306
|
-
var
|
|
307
|
-
var node_4 = $.first_child(
|
|
312
|
+
var fragment_5 = root();
|
|
313
|
+
var node_4 = $.first_child(fragment_5);
|
|
308
314
|
|
|
309
315
|
{
|
|
310
316
|
var consequent_1 = ($$anchor) => {
|
|
@@ -350,10 +356,10 @@ export default function Breadcrumb($$anchor, $$props) {
|
|
|
350
356
|
$$slots: { default: true }
|
|
351
357
|
});
|
|
352
358
|
|
|
353
|
-
$.append($$anchor,
|
|
359
|
+
$.append($$anchor, fragment_5);
|
|
354
360
|
});
|
|
355
361
|
|
|
356
|
-
$.append($$anchor,
|
|
362
|
+
$.append($$anchor, fragment_4);
|
|
357
363
|
};
|
|
358
364
|
|
|
359
365
|
$.if(node_1, ($$render) => {
|
|
@@ -100,7 +100,7 @@ var root_11 = $.from_svg(`<rect class="snowui-circular-chart-cell-hit-area" x="0
|
|
|
100
100
|
var root_12 = $.from_svg(`<path class="snowui-circular-chart-segment-hit-area" fill="transparent" style="cursor: pointer;" tabindex="0" role="button"></path>`);
|
|
101
101
|
var root_13 = $.from_html(`<span data-role="value"> </span> <span data-role="name"> </span>`, 1);
|
|
102
102
|
var root_14 = $.from_html(`<!> <!>`, 1);
|
|
103
|
-
var root_15 = $.from_html(`<div class="snowui-circular-chart-body"><svg class="snowui-circular-chart-svg"
|
|
103
|
+
var root_15 = $.from_html(`<div class="snowui-circular-chart-body"><svg class="snowui-circular-chart-svg" role="presentation"><defs></defs><!><g class="snowui-circular-chart-fill-layer"></g><!><!></svg> <!></div> <!>`, 1);
|
|
104
104
|
|
|
105
105
|
const $$css = {
|
|
106
106
|
hash: 'svelte-1pno2lj',
|
|
@@ -1005,7 +1005,7 @@ export default function CircularChart($$anchor, $$props) {
|
|
|
1005
1005
|
get style() {
|
|
1006
1006
|
return $.get(rootStyle);
|
|
1007
1007
|
},
|
|
1008
|
-
role: '
|
|
1008
|
+
role: 'group',
|
|
1009
1009
|
'aria-label': '圆形图表',
|
|
1010
1010
|
get element() {
|
|
1011
1011
|
return $.get(rootElement);
|