@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
|
@@ -12,6 +12,7 @@ import { resolveFrameFieldInvalid, resolveFrameFieldValue } from "../logic/frame
|
|
|
12
12
|
import { splitFrameHostProps } from "../logic/frame-prop-filter.js";
|
|
13
13
|
import { matchesSearch } from "../lib/search-filter.js";
|
|
14
14
|
import { mergeComponentPartProps, useComponentPart } from "../logic/component-parts.js";
|
|
15
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
15
16
|
|
|
16
17
|
const $$css = {
|
|
17
18
|
hash: 'svelte-124sfg',
|
|
@@ -444,16 +445,21 @@ export default function Select($$renderer, $$props) {
|
|
|
444
445
|
if (triggerContent()) {
|
|
445
446
|
$$renderer.push('<!--[0-->');
|
|
446
447
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
448
|
+
ComponentPartsBoundary($$renderer, {
|
|
449
|
+
children: ($$renderer) => {
|
|
450
|
+
triggerContent()($$renderer, {
|
|
451
|
+
value: resolvedValue(),
|
|
452
|
+
option: selectedOption(),
|
|
453
|
+
label: selectedLabel(),
|
|
454
|
+
placeholder: placeholder(),
|
|
455
|
+
open,
|
|
456
|
+
disabled: disabled()
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
$$renderer.push(`<!---->`);
|
|
460
|
+
},
|
|
461
|
+
$$slots: { default: true }
|
|
454
462
|
});
|
|
455
|
-
|
|
456
|
-
$$renderer.push(`<!---->`);
|
|
457
463
|
} else {
|
|
458
464
|
$$renderer.push('<!--[-1-->');
|
|
459
465
|
$$renderer.push(`${$.escape(selectedLabel() ?? placeholder() ?? ariaLabel() ?? "")}`);
|
|
@@ -489,8 +495,14 @@ export default function Select($$renderer, $$props) {
|
|
|
489
495
|
|
|
490
496
|
if (children()) {
|
|
491
497
|
$$renderer.push('<!--[0-->');
|
|
492
|
-
|
|
493
|
-
$$renderer
|
|
498
|
+
|
|
499
|
+
ComponentPartsBoundary($$renderer, {
|
|
500
|
+
children: ($$renderer) => {
|
|
501
|
+
children()($$renderer);
|
|
502
|
+
$$renderer.push(`<!---->`);
|
|
503
|
+
},
|
|
504
|
+
$$slots: { default: true }
|
|
505
|
+
});
|
|
494
506
|
} else {
|
|
495
507
|
$$renderer.push('<!--[-1-->');
|
|
496
508
|
|
|
@@ -8,6 +8,7 @@ import { SIDE_PANEL_APPEAR_MOTION, SIDE_PANEL_DISAPPEAR_MOTION } from "../motion
|
|
|
8
8
|
import { DIALOG_BACKDROP_MOTION_STYLE } from "../motion/presets/dialog.js";
|
|
9
9
|
import { getMotionTotalDurationMs } from "../motion/presets/utils.js";
|
|
10
10
|
import { provideComponentParts } from "../logic/component-parts.js";
|
|
11
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
11
12
|
import { ComponentIcon } from "../internal/component-icon/index.js";
|
|
12
13
|
import Frame from "./Frame.js";
|
|
13
14
|
|
|
@@ -428,7 +429,8 @@ export default function SidePanel($$renderer, $$props) {
|
|
|
428
429
|
enableResponsive,
|
|
429
430
|
enableDefaultMotion,
|
|
430
431
|
enableContext,
|
|
431
|
-
enableScaleObserver
|
|
432
|
+
enableScaleObserver,
|
|
433
|
+
componentParts: parts
|
|
432
434
|
},
|
|
433
435
|
rest,
|
|
434
436
|
{
|
|
@@ -498,8 +500,14 @@ export default function SidePanel($$renderer, $$props) {
|
|
|
498
500
|
|
|
499
501
|
if (children) {
|
|
500
502
|
$$renderer.push('<!--[0-->');
|
|
501
|
-
|
|
502
|
-
$$renderer
|
|
503
|
+
|
|
504
|
+
ComponentPartsBoundary($$renderer, {
|
|
505
|
+
children: ($$renderer) => {
|
|
506
|
+
children($$renderer);
|
|
507
|
+
$$renderer.push(`<!---->`);
|
|
508
|
+
},
|
|
509
|
+
$$slots: { default: true }
|
|
510
|
+
});
|
|
503
511
|
} else {
|
|
504
512
|
$$renderer.push('<!--[-1-->');
|
|
505
513
|
}
|
|
@@ -512,8 +520,14 @@ export default function SidePanel($$renderer, $$props) {
|
|
|
512
520
|
|
|
513
521
|
if (bottomLeading) {
|
|
514
522
|
$$renderer.push('<!--[0-->');
|
|
515
|
-
|
|
516
|
-
$$renderer
|
|
523
|
+
|
|
524
|
+
ComponentPartsBoundary($$renderer, {
|
|
525
|
+
children: ($$renderer) => {
|
|
526
|
+
bottomLeading($$renderer);
|
|
527
|
+
$$renderer.push(`<!---->`);
|
|
528
|
+
},
|
|
529
|
+
$$slots: { default: true }
|
|
530
|
+
});
|
|
517
531
|
} else {
|
|
518
532
|
$$renderer.push('<!--[-1-->');
|
|
519
533
|
$$renderer.push(`<!--[-->`);
|
|
@@ -533,8 +547,14 @@ export default function SidePanel($$renderer, $$props) {
|
|
|
533
547
|
|
|
534
548
|
if (bottomTrailing) {
|
|
535
549
|
$$renderer.push('<!--[0-->');
|
|
536
|
-
|
|
537
|
-
$$renderer
|
|
550
|
+
|
|
551
|
+
ComponentPartsBoundary($$renderer, {
|
|
552
|
+
children: ($$renderer) => {
|
|
553
|
+
bottomTrailing($$renderer);
|
|
554
|
+
$$renderer.push(`<!---->`);
|
|
555
|
+
},
|
|
556
|
+
$$slots: { default: true }
|
|
557
|
+
});
|
|
538
558
|
} else {
|
|
539
559
|
$$renderer.push('<!--[-1-->');
|
|
540
560
|
$$renderer.push(`<!--[-->`);
|
|
@@ -568,7 +588,7 @@ export default function SidePanel($$renderer, $$props) {
|
|
|
568
588
|
minSize: minWidth,
|
|
569
589
|
maxSize: maxWidth,
|
|
570
590
|
applySize: false,
|
|
571
|
-
ariaLabel:
|
|
591
|
+
ariaLabel: locale.t("sidePanel.resize"),
|
|
572
592
|
onSizeChange: handleWidthChange
|
|
573
593
|
});
|
|
574
594
|
|
|
@@ -3,12 +3,8 @@ import { setContext } from "svelte";
|
|
|
3
3
|
import { Button, Frame, Icon, Text, resizeManager } from "../index.js";
|
|
4
4
|
import { BUTTON_SIZE_CONTEXT_KEY } from "../keys.js";
|
|
5
5
|
import { TAB_INDICATOR_MOTION_STYLE } from "../motion/presets/tab.js";
|
|
6
|
-
|
|
7
|
-
import
|
|
8
|
-
mergeComponentPartProps,
|
|
9
|
-
provideComponentParts,
|
|
10
|
-
useComponentPart
|
|
11
|
-
} from "../logic/component-parts.js";
|
|
6
|
+
import { mergeComponentPartProps, useComponentPart } from "../logic/component-parts.js";
|
|
7
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
12
8
|
|
|
13
9
|
const $$css = {
|
|
14
10
|
hash: 'svelte-1m5828n',
|
|
@@ -76,8 +72,6 @@ export default function Tab($$renderer, $$props) {
|
|
|
76
72
|
'style'
|
|
77
73
|
]));
|
|
78
74
|
|
|
79
|
-
provideComponentParts(() => parts());
|
|
80
|
-
|
|
81
75
|
let rootEl = void 0;
|
|
82
76
|
let indicatorEl = null;
|
|
83
77
|
let initialized = false;
|
|
@@ -290,8 +284,14 @@ export default function Tab($$renderer, $$props) {
|
|
|
290
284
|
|
|
291
285
|
if (children()) {
|
|
292
286
|
$$renderer.push('<!--[0-->');
|
|
293
|
-
|
|
294
|
-
$$renderer
|
|
287
|
+
|
|
288
|
+
ComponentPartsBoundary($$renderer, {
|
|
289
|
+
children: ($$renderer) => {
|
|
290
|
+
children()($$renderer);
|
|
291
|
+
$$renderer.push(`<!---->`);
|
|
292
|
+
},
|
|
293
|
+
$$slots: { default: true }
|
|
294
|
+
});
|
|
295
295
|
} else {
|
|
296
296
|
$$renderer.push('<!--[-1-->');
|
|
297
297
|
$$renderer.push(`<!--[-->`);
|
|
@@ -301,49 +301,58 @@ export default function Tab($$renderer, $$props) {
|
|
|
301
301
|
for (let $$index = 0, $$length = each_array.length; $$index < $$length; $$index++) {
|
|
302
302
|
let item = each_array[$$index];
|
|
303
303
|
|
|
304
|
-
Button($$renderer,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
$$renderer
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
304
|
+
Button($$renderer, $.spread_props([
|
|
305
|
+
parts()?.Button,
|
|
306
|
+
{
|
|
307
|
+
as: 'item',
|
|
308
|
+
value: item.value,
|
|
309
|
+
disabled: item.disabled,
|
|
310
|
+
children: ($$renderer) => {
|
|
311
|
+
if (item.icon) {
|
|
312
|
+
$$renderer.push('<!--[0-->');
|
|
313
|
+
|
|
314
|
+
const ItemIcon = item.icon;
|
|
315
|
+
|
|
316
|
+
Icon($$renderer, $.spread_props([
|
|
317
|
+
parts()?.Icon,
|
|
318
|
+
{
|
|
319
|
+
children: ($$renderer) => {
|
|
320
|
+
if (ItemIcon) {
|
|
321
|
+
$$renderer.push('<!--[-->');
|
|
322
|
+
ItemIcon($$renderer, {});
|
|
323
|
+
$$renderer.push('<!--]-->');
|
|
324
|
+
} else {
|
|
325
|
+
$$renderer.push('<!--[!-->');
|
|
326
|
+
$$renderer.push('<!--]-->');
|
|
327
|
+
}
|
|
328
|
+
},
|
|
329
|
+
$$slots: { default: true }
|
|
330
|
+
}
|
|
331
|
+
]));
|
|
332
|
+
|
|
333
|
+
$$renderer.push(`<!---->`);
|
|
334
|
+
|
|
335
|
+
Text($$renderer, $.spread_props([
|
|
336
|
+
parts()?.Text,
|
|
337
|
+
{
|
|
338
|
+
children: ($$renderer) => {
|
|
339
|
+
$$renderer.push(`<!---->${$.escape(item.label)}`);
|
|
340
|
+
},
|
|
341
|
+
$$slots: { default: true }
|
|
323
342
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
$$renderer.push(`<!---->`);
|
|
338
|
-
} else {
|
|
339
|
-
$$renderer.push('<!--[-1-->');
|
|
340
|
-
$$renderer.push(`${$.escape(item.label)}`);
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
$$renderer.push(`<!--]-->`);
|
|
344
|
-
},
|
|
345
|
-
$$slots: { default: true }
|
|
346
|
-
});
|
|
343
|
+
]));
|
|
344
|
+
|
|
345
|
+
$$renderer.push(`<!---->`);
|
|
346
|
+
} else {
|
|
347
|
+
$$renderer.push('<!--[-1-->');
|
|
348
|
+
$$renderer.push(`${$.escape(item.label)}`);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
$$renderer.push(`<!--]-->`);
|
|
352
|
+
},
|
|
353
|
+
$$slots: { default: true }
|
|
354
|
+
}
|
|
355
|
+
]));
|
|
347
356
|
}
|
|
348
357
|
|
|
349
358
|
$$renderer.push(`<!--]-->`);
|
|
@@ -6,6 +6,7 @@ import TableCell from "./TableCell.js";
|
|
|
6
6
|
import Spinner from "./Spinner.js";
|
|
7
7
|
import { resizeManager } from "../logic/observer.js";
|
|
8
8
|
import { getTableContext } from "../lib/table-context.js";
|
|
9
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
9
10
|
import { ContinuousHoverController } from "../logic/continuous-hover.js";
|
|
10
11
|
import { CONTINUOUS_HOVER_MOTION_STYLE } from "../motion/presets/continuous-hover.js";
|
|
11
12
|
|
|
@@ -130,8 +131,14 @@ export default function TableBody($$renderer, $$props) {
|
|
|
130
131
|
|
|
131
132
|
if (children) {
|
|
132
133
|
$$renderer.push('<!--[0-->');
|
|
133
|
-
|
|
134
|
-
$$renderer
|
|
134
|
+
|
|
135
|
+
ComponentPartsBoundary($$renderer, {
|
|
136
|
+
children: ($$renderer) => {
|
|
137
|
+
children($$renderer);
|
|
138
|
+
$$renderer.push(`<!---->`);
|
|
139
|
+
},
|
|
140
|
+
$$slots: { default: true }
|
|
141
|
+
});
|
|
135
142
|
} else {
|
|
136
143
|
$$renderer.push('<!--[-1-->');
|
|
137
144
|
}
|
|
@@ -11,6 +11,8 @@ import { getTableRowContext } from "../lib/table-row-context.js";
|
|
|
11
11
|
import { SKELETON_CONTEXT_KEY } from "../keys.js";
|
|
12
12
|
import { tableSelectionFade } from "../lib/table-selection-fade.js";
|
|
13
13
|
import { getTableRoleBlurStyles } from "../lib/table-role-blur.js";
|
|
14
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
15
|
+
import { useLocale } from "../i18n/locale.js";
|
|
14
16
|
import { mergeComponentPartProps, useComponentPart } from "../logic/component-parts.js";
|
|
15
17
|
import { createEdgeFadeMaskImage } from "../lib/edge-fade.js";
|
|
16
18
|
|
|
@@ -29,6 +31,7 @@ export default function TableCell($$renderer, $$props) {
|
|
|
29
31
|
$$renderer.global.css.add($$css);
|
|
30
32
|
|
|
31
33
|
$$renderer.component(($$renderer) => {
|
|
34
|
+
const localeContext = useLocale();
|
|
32
35
|
const inheritedTableCellPart = useComponentPart("TableCell");
|
|
33
36
|
let { $$slots, $$events, ...explicitProps } = $$props;
|
|
34
37
|
|
|
@@ -214,7 +217,7 @@ export default function TableCell($$renderer, $$props) {
|
|
|
214
217
|
|
|
215
218
|
Checkbox($$renderer, {
|
|
216
219
|
checked: isSelected(),
|
|
217
|
-
ariaLabel:
|
|
220
|
+
ariaLabel: localeContext.t("tableCell.selectRow"),
|
|
218
221
|
onclick: (event) => event.stopPropagation(),
|
|
219
222
|
onCheckedChange: (checked) => {
|
|
220
223
|
if (rowId() !== undefined) table.setRowSelected(rowId(), checked);
|
|
@@ -238,8 +241,14 @@ export default function TableCell($$renderer, $$props) {
|
|
|
238
241
|
|
|
239
242
|
if (children()) {
|
|
240
243
|
$$renderer.push('<!--[0-->');
|
|
241
|
-
|
|
242
|
-
$$renderer
|
|
244
|
+
|
|
245
|
+
ComponentPartsBoundary($$renderer, {
|
|
246
|
+
children: ($$renderer) => {
|
|
247
|
+
children()($$renderer);
|
|
248
|
+
$$renderer.push(`<!---->`);
|
|
249
|
+
},
|
|
250
|
+
$$slots: { default: true }
|
|
251
|
+
});
|
|
243
252
|
} else if (rowId() !== undefined && defaultActions().length > 0) {
|
|
244
253
|
$$renderer.push('<!--[1-->');
|
|
245
254
|
|
|
@@ -262,8 +271,14 @@ export default function TableCell($$renderer, $$props) {
|
|
|
262
271
|
|
|
263
272
|
if (children()) {
|
|
264
273
|
$$renderer.push('<!--[0-->');
|
|
265
|
-
|
|
266
|
-
$$renderer
|
|
274
|
+
|
|
275
|
+
ComponentPartsBoundary($$renderer, {
|
|
276
|
+
children: ($$renderer) => {
|
|
277
|
+
children()($$renderer);
|
|
278
|
+
$$renderer.push(`<!---->`);
|
|
279
|
+
},
|
|
280
|
+
$$slots: { default: true }
|
|
281
|
+
});
|
|
267
282
|
} else {
|
|
268
283
|
$$renderer.push('<!--[-1-->');
|
|
269
284
|
}
|
|
@@ -280,8 +295,14 @@ export default function TableCell($$renderer, $$props) {
|
|
|
280
295
|
$$renderer.push(`${$.escape(tooltip())}`);
|
|
281
296
|
} else if (typeof tooltip() === "function") {
|
|
282
297
|
$$renderer.push('<!--[1-->');
|
|
283
|
-
|
|
284
|
-
$$renderer
|
|
298
|
+
|
|
299
|
+
ComponentPartsBoundary($$renderer, {
|
|
300
|
+
children: ($$renderer) => {
|
|
301
|
+
tooltip()($$renderer);
|
|
302
|
+
$$renderer.push(`<!---->`);
|
|
303
|
+
},
|
|
304
|
+
$$slots: { default: true }
|
|
305
|
+
});
|
|
285
306
|
} else {
|
|
286
307
|
$$renderer.push('<!--[-1-->');
|
|
287
308
|
$$renderer.push(`${$.escape(fullText)}`);
|
|
@@ -7,6 +7,8 @@ import Checkbox from "./Checkbox.js";
|
|
|
7
7
|
import { getTableContext } from "../lib/table-context.js";
|
|
8
8
|
import { tableSelectionFade } from "../lib/table-selection-fade.js";
|
|
9
9
|
import { getTableRoleBlurStyles } from "../lib/table-role-blur.js";
|
|
10
|
+
import ComponentPartsBoundary from "../logic/ComponentPartsBoundary.js";
|
|
11
|
+
import { useLocale } from "../i18n/locale.js";
|
|
10
12
|
|
|
11
13
|
const $$css = {
|
|
12
14
|
hash: 'svelte-vw4wqu',
|
|
@@ -18,6 +20,8 @@ export default function TableHead($$renderer, $$props) {
|
|
|
18
20
|
|
|
19
21
|
$$renderer.component(($$renderer) => {
|
|
20
22
|
// SnowUI 许可入口:首次阅读源码请先读 ../../LICENSE;访问文件不代表获得修改或移植权,官方维护授权及同任务去重见该文件。
|
|
23
|
+
const localeContext = useLocale();
|
|
24
|
+
|
|
21
25
|
function columnScope(node) {
|
|
22
26
|
node.setAttribute("scope", "col");
|
|
23
27
|
}
|
|
@@ -188,7 +192,7 @@ export default function TableHead($$renderer, $$props) {
|
|
|
188
192
|
Checkbox($$renderer, {
|
|
189
193
|
checked: selectionState().all,
|
|
190
194
|
indeterminate: selectionState().some,
|
|
191
|
-
ariaLabel:
|
|
195
|
+
ariaLabel: localeContext.t("tableHead.selectAll"),
|
|
192
196
|
onCheckedChange: (checked) => table.setAllRowsSelected(checked)
|
|
193
197
|
});
|
|
194
198
|
|
|
@@ -209,7 +213,15 @@ export default function TableHead($$renderer, $$props) {
|
|
|
209
213
|
}
|
|
210
214
|
|
|
211
215
|
$$renderer.push(`<!--]--></span> `);
|
|
212
|
-
|
|
216
|
+
|
|
217
|
+
ComponentPartsBoundary($$renderer, {
|
|
218
|
+
children: ($$renderer) => {
|
|
219
|
+
children($$renderer);
|
|
220
|
+
$$renderer.push(`<!---->`);
|
|
221
|
+
},
|
|
222
|
+
$$slots: { default: true }
|
|
223
|
+
});
|
|
224
|
+
|
|
213
225
|
$$renderer.push(`<!----></span>`);
|
|
214
226
|
} else {
|
|
215
227
|
$$renderer.push('<!--[-1-->');
|
|
@@ -222,8 +234,14 @@ export default function TableHead($$renderer, $$props) {
|
|
|
222
234
|
|
|
223
235
|
if (children) {
|
|
224
236
|
$$renderer.push('<!--[0-->');
|
|
225
|
-
|
|
226
|
-
$$renderer
|
|
237
|
+
|
|
238
|
+
ComponentPartsBoundary($$renderer, {
|
|
239
|
+
children: ($$renderer) => {
|
|
240
|
+
children($$renderer);
|
|
241
|
+
$$renderer.push(`<!---->`);
|
|
242
|
+
},
|
|
243
|
+
$$slots: { default: true }
|
|
244
|
+
});
|
|
227
245
|
} else {
|
|
228
246
|
$$renderer.push('<!--[-1-->');
|
|
229
247
|
}
|
|
@@ -259,8 +277,14 @@ export default function TableHead($$renderer, $$props) {
|
|
|
259
277
|
|
|
260
278
|
if (children) {
|
|
261
279
|
$$renderer.push('<!--[0-->');
|
|
262
|
-
|
|
263
|
-
$$renderer
|
|
280
|
+
|
|
281
|
+
ComponentPartsBoundary($$renderer, {
|
|
282
|
+
children: ($$renderer) => {
|
|
283
|
+
children($$renderer);
|
|
284
|
+
$$renderer.push(`<!---->`);
|
|
285
|
+
},
|
|
286
|
+
$$slots: { default: true }
|
|
287
|
+
});
|
|
264
288
|
} else {
|
|
265
289
|
$$renderer.push('<!--[-1-->');
|
|
266
290
|
}
|
|
@@ -331,7 +355,7 @@ export default function TableHead($$renderer, $$props) {
|
|
|
331
355
|
event.stopPropagation();
|
|
332
356
|
table.fitColumnWidth(resolvedColumnId(), resolvedMinWidth(), resolvedMaxWidth());
|
|
333
357
|
},
|
|
334
|
-
ariaLabel:
|
|
358
|
+
ariaLabel: localeContext.t("tableHead.resizeColumn", { column: resolvedColumnId() }),
|
|
335
359
|
onSizeChange: (next) => table.setColumnWidth(resolvedColumnId(), next)
|
|
336
360
|
});
|
|
337
361
|
} else {
|