@streamscloud/kit 0.2.11 → 0.2.12

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.
Files changed (25) hide show
  1. package/dist/styles/_responsive.scss +48 -0
  2. package/dist/ui/button/cmp.button.svelte +2 -2
  3. package/dist/ui/button/cmp.button.svelte.d.ts +2 -2
  4. package/dist/ui/button/cmp.options-button.svelte +2 -2
  5. package/dist/ui/button/resources/button-base.svelte +3 -3
  6. package/dist/ui/button/resources/button-theme.svelte +2 -2
  7. package/dist/ui/dropdown/cmp.dropdown.svelte +8 -3
  8. package/dist/ui/icon-text/cmp.icon-text.svelte +2 -2
  9. package/dist/ui/icon-text/cmp.icon-text.svelte.d.ts +2 -0
  10. package/dist/ui/player/carousel/cmp.carousel.svelte +20 -11
  11. package/dist/ui/player/carousel/cmp.carousel.svelte.d.ts +4 -0
  12. package/dist/ui/seek-bar/cmp.seek-bar.svelte +5 -3
  13. package/dist/ui/table/cmp.table.svelte +5 -3
  14. package/dist/ui/table/table-columns-manager/cmp.table-columns-manager.svelte +4 -2
  15. package/dist/ui/table/table-columns-manager/table-columns-manager-localization.d.ts +4 -0
  16. package/dist/ui/table/table-columns-manager/table-columns-manager-localization.js +19 -0
  17. package/dist/ui/table/table-group-actions/cmp.table-group-actions.svelte +3 -1
  18. package/dist/ui/table/table-group-actions/table-group-actions-localization.d.ts +3 -0
  19. package/dist/ui/table/table-group-actions/table-group-actions-localization.js +12 -0
  20. package/dist/ui/table/table-headers/table-header-sortable-localization.d.ts +7 -0
  21. package/dist/ui/table/table-headers/table-header-sortable-localization.js +40 -0
  22. package/dist/ui/table/table-headers/table-header-sortable.svelte +7 -5
  23. package/dist/ui/table/table-localization.d.ts +6 -0
  24. package/dist/ui/table/table-localization.js +33 -0
  25. package/package.json +1 -1
@@ -68,3 +68,51 @@ $layout-breakpoints: (
68
68
  @content;
69
69
  }
70
70
  }
71
+
72
+ @mixin layout($breakpoint) {
73
+ @media screen and (max-width: map.get($layout-breakpoints, $breakpoint)) {
74
+ @content;
75
+ }
76
+ }
77
+
78
+ @mixin layout-mobile() {
79
+ @include layout(sm) {
80
+ @content;
81
+ }
82
+ }
83
+
84
+ @mixin layout-tablet() {
85
+ @include layout(md) {
86
+ @content;
87
+ }
88
+ }
89
+
90
+ @mixin layout-laptop() {
91
+ @include layout(lg) {
92
+ @content;
93
+ }
94
+ }
95
+
96
+ @mixin layout-narrow-desktop() {
97
+ @include layout(xl) {
98
+ @content;
99
+ }
100
+ }
101
+
102
+ @mixin layout-desktop() {
103
+ @include layout(xxl) {
104
+ @content;
105
+ }
106
+ }
107
+
108
+ @mixin layout-fhd() {
109
+ @include layout(fhd) {
110
+ @content;
111
+ }
112
+ }
113
+
114
+ @mixin layout-fhd-p() {
115
+ @include layout(fhd-p) {
116
+ @content;
117
+ }
118
+ }
@@ -31,8 +31,8 @@ A themed button component combining `ButtonBase` (structure) and `ButtonTheme` (
31
31
  | `--sc-kit--button--border` | Border shorthand | `none` |
32
32
  | `--sc-kit--button--border--disabled` | Border when disabled | inherits `--border` |
33
33
  | `--sc-kit--button--border-radius` | Corner rounding | `0.25em` |
34
- | `--sc-kit--button--padding--vertical` | Vertical padding | `0` |
35
- | `--sc-kit--button--padding--horizontal` | Horizontal padding | `1em` |
34
+ | `--sc-kit--button--padding--block` | Block (vertical) padding | `0` |
35
+ | `--sc-kit--button--padding--inline` | Inline (horizontal) padding | `1em` |
36
36
  | `--sc-kit--button--min-width` | Minimum width | `0` |
37
37
  | `--sc-kit--button--width` | Explicit width | `auto` |
38
38
  | `--sc-kit--button--height` | Button height | `2em` |
@@ -35,8 +35,8 @@ type Props = {
35
35
  * | `--sc-kit--button--border` | Border shorthand | `none` |
36
36
  * | `--sc-kit--button--border--disabled` | Border when disabled | inherits `--border` |
37
37
  * | `--sc-kit--button--border-radius` | Corner rounding | `0.25em` |
38
- * | `--sc-kit--button--padding--vertical` | Vertical padding | `0` |
39
- * | `--sc-kit--button--padding--horizontal` | Horizontal padding | `1em` |
38
+ * | `--sc-kit--button--padding--block` | Block (vertical) padding | `0` |
39
+ * | `--sc-kit--button--padding--inline` | Inline (horizontal) padding | `1em` |
40
40
  * | `--sc-kit--button--min-width` | Minimum width | `0` |
41
41
  * | `--sc-kit--button--width` | Explicit width | `auto` |
42
42
  * | `--sc-kit--button--height` | Button height | `2em` |
@@ -134,7 +134,7 @@ Inherits all `--sc-kit--button--*` base and variant properties from `Button`.
134
134
  --_options-button--border: var(--sc-kit--button--border, none);
135
135
  --_options-button--border-radius: var(--sc-kit--button--border-radius, 0.25em);
136
136
  --_options-button--box-shadow: var(--sc-kit--button--box-shadow, none);
137
- --_options-button--padding--vertical: var(--sc-kit--button--padding--vertical, 0);
137
+ --_options-button--padding--block: var(--sc-kit--button--padding--block, 0);
138
138
  --_options-button--min-width: var(--sc-kit--button--min-width, 0);
139
139
  --_options-button--height: var(--sc-kit--button--height, 2em);
140
140
  --_options-button--separator--border: 1px solid var(--_options-button--font--color);
@@ -186,7 +186,7 @@ Inherits all `--sc-kit--button--*` base and variant properties from `Button`.
186
186
  height: 100%;
187
187
  font-size: var(--_options-button--text--font-size);
188
188
  border-radius: var(--_options-button--border-radius);
189
- padding: var(--_options-button--padding--vertical) 0.5em;
189
+ padding: var(--_options-button--padding--block) 0.5em;
190
190
  color: inherit;
191
191
  background: transparent;
192
192
  border: none;
@@ -30,15 +30,15 @@ export {};
30
30
  --_button--border: var(--sc-kit--button--border, none);
31
31
  --_button--border--disabled: var(--sc-kit--button--border--disabled, var(--_button--border));
32
32
  --_button--border-radius: var(--sc-kit--button--border-radius, 0.25em);
33
- --_button--padding--vertical: var(--sc-kit--button--padding--vertical, 0);
34
- --_button--padding--horizontal: var(--sc-kit--button--padding--horizontal, 1em);
33
+ --_button--padding--block: var(--sc-kit--button--padding--block, 0);
34
+ --_button--padding--inline: var(--sc-kit--button--padding--inline, 1em);
35
35
  --_button--min-width: var(--sc-kit--button--min-width, 0);
36
36
  --_button--width: var(--sc-kit--button--width, auto);
37
37
  --_button--height: var(--sc-kit--button--height, 2em);
38
38
  --_button--box-shadow: var(--sc-kit--button--box-shadow, none);
39
39
  font-size: var(--_button--font--size);
40
40
  font-weight: var(--_button--font-weight);
41
- padding: var(--_button--padding--vertical) var(--_button--padding--horizontal);
41
+ padding: var(--_button--padding--block) var(--_button--padding--inline);
42
42
  color: var(--_button--font--color);
43
43
  background: var(--_button--background);
44
44
  box-shadow: var(--_button--box-shadow);
@@ -323,13 +323,13 @@ export {};
323
323
  --sc-kit--button--height: 2.5em;
324
324
  --sc-kit--button--text--font-size: 1.125em;
325
325
  --sc-kit--button--icon--font-size: 1.25em;
326
- --sc-kit--button--padding--horizontal: 1.5em;
326
+ --sc-kit--button--padding--inline: 1.5em;
327
327
  --sc-kit--button--border-radius: 0.375em;
328
328
  --_button--shadow-y: 3px;
329
329
  }
330
330
  .button-theme--size-small {
331
331
  --sc-kit--button--height: 1.75em;
332
332
  --sc-kit--button--text--font-size: 0.75em;
333
- --sc-kit--button--padding--horizontal: 0.75em;
333
+ --sc-kit--button--padding--inline: 0.75em;
334
334
  --_button--shadow-y: 1.5px;
335
335
  }</style>
@@ -6,6 +6,7 @@ import { untrack } from 'svelte';
6
6
  let { position = 'bottom-start', disabled = false, keepDropdownOpen = false, fixedPosition = false, offset = 4, boundaryMargin = 8, backdrop = false, isOpenRequested, matchTriggerWidth = false, panel = true, on, children, trigger } = $props();
7
7
  let opened = $state(false);
8
8
  let dropdownEl = $state(null);
9
+ let triggerEl = $state(null);
9
10
  let actualPlacement = $state(untrack(() => position));
10
11
  $effect(() => untrack(() => {
11
12
  on?.mounted?.({
@@ -68,7 +69,9 @@ const handleClick = (event) => {
68
69
  open();
69
70
  return;
70
71
  }
71
- if (canClose(event.target, event.currentTarget)) {
72
+ const target = event.target;
73
+ const isTriggerClick = triggerEl?.contains(target) ?? false;
74
+ if (isTriggerClick || canClose(target, event.currentTarget)) {
72
75
  close();
73
76
  }
74
77
  };
@@ -86,7 +89,9 @@ const canClose = (target, container) => {
86
89
  return true;
87
90
  };
88
91
  const initPopper = (node) => {
89
- const triggerEl = node.previousElementSibling;
92
+ if (!triggerEl) {
93
+ return;
94
+ }
90
95
  const popper = createPopper(triggerEl, node, {
91
96
  placement: position,
92
97
  strategy: fixedPosition ? 'fixed' : 'absolute',
@@ -145,7 +150,7 @@ const initPopper = (node) => {
145
150
  </div>
146
151
  {/if}
147
152
  <div class="dropdown" class:dropdown--disabled={disabled} bind:this={dropdownEl} onclick={handleClick} onkeydown={() => ({})} role="none">
148
- <button type="button" class="dropdown__trigger">
153
+ <button type="button" class="dropdown__trigger" bind:this={triggerEl}>
149
154
  {#if trigger}
150
155
  {@render trigger()}
151
156
  {:else}
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">import { Icon } from '../icon';
2
- let { icon, iconColor, iconPosition = 'left', secondaryIcon, secondaryIconColor, trimText = false, children } = $props();
2
+ let { icon, iconColor, iconPosition = 'left', secondaryIcon, secondaryIconColor, trimText = false, hideText = false, children } = $props();
3
3
  const iconAsSnippet = $derived(icon && typeof icon === 'function' ? icon : null);
4
4
  const iconAsString = $derived(icon && typeof icon !== 'function' ? icon : null);
5
5
  const secondaryIconAsSnippet = $derived(secondaryIcon && typeof secondaryIcon === 'function' ? secondaryIcon : null);
@@ -14,7 +14,7 @@ const secondaryIconAsString = $derived(secondaryIcon && typeof secondaryIcon !==
14
14
  <Icon src={iconAsString} color={iconColor} />
15
15
  {/if}
16
16
  </span>
17
- {#if children}
17
+ {#if children && !hideText}
18
18
  <span class="icon-text__text" class:icon-text__text--trim={trimText}>
19
19
  {@render children()}
20
20
  </span>
@@ -13,6 +13,8 @@ type Props = {
13
13
  secondaryIconColor?: IconColor | null;
14
14
  /** Truncate text with ellipsis on overflow */
15
15
  trimText?: boolean;
16
+ /** Hide text, showing only the icon(s) */
17
+ hideText?: boolean;
16
18
  children?: Snippet;
17
19
  };
18
20
  /**
@@ -284,6 +284,10 @@ A horizontal slide carousel with infinite looping, touch swipe support, keyboard
284
284
  | `--sc-kit--carousel--dot-color` | Dot indicator color (fill when active, border when inactive) | `white` |
285
285
  | `--sc-kit--carousel--dot-size` | Dot indicator diameter | `0.5rem` |
286
286
  | `--sc-kit--carousel--text-color` | Arrow button icon and counter text color | `white` |
287
+ | `--sc-kit--carousel--counts--font-size` | Counter text font size | `0.9375rem` |
288
+ | `--sc-kit--carousel--counts--width` | Counter container width | `5.625rem` |
289
+ | `--sc-kit--carousel--counts--text-shadow` | Counter text shadow | `0 1px 0/3px/6px rgba(0,0,0,...)` |
290
+ | `--sc-kit--carousel--navigation-button--size` | Navigation button width and height | `1.875rem` |
287
291
  -->
288
292
 
289
293
  <style>@charset "UTF-8";
@@ -293,6 +297,15 @@ A horizontal slide carousel with infinite looping, touch swipe support, keyboard
293
297
  --_carousel--dot-color: var(--sc-kit--carousel--dot-color, #ffffff);
294
298
  --_carousel--dot-size: var(--sc-kit--carousel--dot-size, 0.5rem);
295
299
  --_carousel--text-color: var(--sc-kit--carousel--text-color, #ffffff);
300
+ --_carousel--counts--font-size: var(--sc-kit--carousel--counts--font-size, 0.9375rem);
301
+ --_carousel--counts--width: var(--sc-kit--carousel--counts--width, 5.625rem);
302
+ --_carousel--counts--text-shadow: var(
303
+ --sc-kit--carousel--counts--text-shadow,
304
+ 0 1px 0 rgba(0, 0, 0, 0.1),
305
+ 0 1px 3px rgba(0, 0, 0, 0.1),
306
+ 0 1px 6px rgba(0, 0, 0, 0.05)
307
+ );
308
+ --_carousel--navigation-button--size: var(--sc-kit--carousel--navigation-button--size, 1.875rem);
296
309
  --_carousel--animation: var(--carousel--animation);
297
310
  /* Mode control — overridden by modifiers */
298
311
  --_carousel--nav-display: block;
@@ -375,8 +388,8 @@ A horizontal slide carousel with infinite looping, touch swipe support, keyboard
375
388
  .carousel__navigation-button {
376
389
  display: var(--_carousel--nav-display);
377
390
  font-size: 0.75rem;
378
- width: 1.875rem;
379
- height: 1.875rem;
391
+ width: var(--_carousel--navigation-button--size);
392
+ height: var(--_carousel--navigation-button--size);
380
393
  background-color: var(--_carousel--button-color);
381
394
  border-radius: 50%;
382
395
  text-align: center;
@@ -387,9 +400,8 @@ A horizontal slide carousel with infinite looping, touch swipe support, keyboard
387
400
  opacity: var(--_carousel--nav-opacity);
388
401
  visibility: var(--_carousel--nav-visibility);
389
402
  transition: opacity 0.2s, visibility 0.2s;
390
- /* Set 'container-type: inline-size;' to reference container*/
391
403
  }
392
- @container (width < 576px) {
404
+ @media screen and (max-width: 768px) {
393
405
  .carousel__navigation-button {
394
406
  opacity: 1;
395
407
  visibility: visible;
@@ -417,12 +429,12 @@ A horizontal slide carousel with infinite looping, touch swipe support, keyboard
417
429
  z-index: 1;
418
430
  }
419
431
  .carousel__counts {
420
- font-size: 0.9375rem;
432
+ font-size: var(--_carousel--counts--font-size);
421
433
  font-weight: 300;
422
- width: 5.625rem;
434
+ width: var(--_carousel--counts--width);
423
435
  text-align: center;
424
436
  color: var(--_carousel--text-color);
425
- text-shadow: 0 1px 0 rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 6px rgba(0, 0, 0, 0.05);
437
+ text-shadow: var(--_carousel--counts--text-shadow);
426
438
  }
427
439
  .carousel__counts-navigation-button {
428
440
  font-size: 0.75rem;
@@ -440,10 +452,7 @@ A horizontal slide carousel with infinite looping, touch swipe support, keyboard
440
452
  opacity: 0.5;
441
453
  cursor: default;
442
454
  }
443
- .carousel__counts-navigation-button {
444
- /* Set 'container-type: inline-size;' to reference container*/
445
- }
446
- @container (width < 576px) {
455
+ @media screen and (max-width: 768px) {
447
456
  .carousel__counts-navigation-button {
448
457
  opacity: 1;
449
458
  visibility: visible;
@@ -52,6 +52,10 @@ interface $$IsomorphicComponent {
52
52
  * | `--sc-kit--carousel--dot-color` | Dot indicator color (fill when active, border when inactive) | `white` |
53
53
  * | `--sc-kit--carousel--dot-size` | Dot indicator diameter | `0.5rem` |
54
54
  * | `--sc-kit--carousel--text-color` | Arrow button icon and counter text color | `white` |
55
+ * | `--sc-kit--carousel--counts--font-size` | Counter text font size | `0.9375rem` |
56
+ * | `--sc-kit--carousel--counts--width` | Counter container width | `5.625rem` |
57
+ * | `--sc-kit--carousel--counts--text-shadow` | Counter text shadow | `0 1px 0/3px/6px rgba(0,0,0,...)` |
58
+ * | `--sc-kit--carousel--navigation-button--size` | Navigation button width and height | `1.875rem` |
55
59
  */
56
60
  declare const Cmp: $$IsomorphicComponent;
57
61
  type Cmp<T> = InstanceType<typeof Cmp<T>>;
@@ -121,14 +121,16 @@ A draggable media seek bar with a track, filled portion, and scrubber handle. Su
121
121
  -->
122
122
 
123
123
  <style>.seek-bar {
124
- cursor: pointer;
125
- position: relative;
126
- padding: 0.3125rem 0;
124
+ --_seek-bar--padding-block: var(--seek-bar--padding-block, 0.3125rem);
127
125
  --_seek-bar--container-color: var(--sc-kit--seek-bar--container-color, #9ca3af);
128
126
  --_seek-bar--value-color: var(--sc-kit--seek-bar--value-color, #ffffff);
129
127
  --_seek-bar--scrubber-color: var(--sc-kit--seek-bar--scrubber-color, #ffffff);
130
128
  --_seek-bar--scrubber-border-color: var(--sc-kit--seek-bar--scrubber-border-color, #9ca3af);
131
129
  --_seek-bar--scrubber-opacity: 0;
130
+ cursor: pointer;
131
+ position: relative;
132
+ padding: var(--_seek-bar--padding-block) 0;
133
+ user-select: none;
132
134
  }
133
135
  .seek-bar:hover {
134
136
  --_seek-bar--scrubber-opacity: 1;
@@ -6,11 +6,13 @@ import { IconText } from '../icon-text';
6
6
  import { Placeholder } from '../placeholder';
7
7
  import { TableActionsCell, TableBadgeCell, TableButtonCell, TableByCell, TableCheckboxCell, TableHideableCell, TableIconCell, TableImageCell, TableMoveRowCell, TableCustomCell, TableSelectCell, TableTextCell, TableTextInputCell } from './table-cells';
8
8
  import { ResolvedColumn } from './table-column-models.svelte';
9
+ import { TableLocalization } from './table-localization';
9
10
  import IconReorderDotsHorizontal from '@fluentui/svg-icons/icons/re_order_dots_horizontal_20_regular.svg?raw';
10
11
  import { untrack } from 'svelte';
11
12
  import { flip } from 'svelte/animate';
12
13
  import { dndzone } from 'svelte-dnd-action';
13
14
  let { model, rowsDraggable = false, showPlaceholder = false, showAlternativeView = false, on, alternativeView, placeholderRow, customNoItemsPlaceholder } = $props();
15
+ const localization = new TableLocalization();
14
16
  let showNoItemsPlaceholder = $state(false);
15
17
  let showNoItemsTimeout = 0;
16
18
  let showNoItemsPlaceholderFn = null;
@@ -151,7 +153,7 @@ const getEditorColumnOrDefault = (column, editMode) => {
151
153
  {:else if customNoItemsPlaceholder}
152
154
  {@render customNoItemsPlaceholder()}
153
155
  {:else}
154
- <Placeholder imageSrc="/placeholders/default.svg" title="No Items <span>Found</span>" body="No data found. Create one to get started" />
156
+ <Placeholder imageSrc="/placeholders/default.svg" title={localization.noItemsFoundTitle} body={localization.noItemsFoundBody} />
155
157
  {/if}
156
158
  </div>
157
159
  </td>
@@ -164,8 +166,8 @@ const getEditorColumnOrDefault = (column, editMode) => {
164
166
  {#if anyVisibleItemActions(item)}
165
167
  {#if editMode}
166
168
  <div class="table__save-cancel">
167
- <Button size="small" variant="transparent-success" on={{ click: () => on?.saveChanges?.(item) }}>Save</Button>
168
- <Button size="small" variant="gray" on={{ click: () => on?.cancelChanges?.() }}>Cancel</Button>
169
+ <Button size="small" variant="transparent-success" on={{ click: () => on?.saveChanges?.(item) }}>{localization.save}</Button>
170
+ <Button size="small" variant="gray" on={{ click: () => on?.cancelChanges?.() }}>{localization.cancel}</Button>
169
171
  </div>
170
172
  {:else}
171
173
  <TableActionsCell dropdownPosition={model.styles?.actionsDropdownTopDirection ? 'top' : 'bottom'}>
@@ -2,19 +2,21 @@
2
2
  import { Dropdown } from '../../dropdown';
3
3
  import { IconText } from '../../icon-text';
4
4
  import { Toggle } from '../../toggle';
5
+ import { TableColumnsManagerLocalization } from './table-columns-manager-localization';
5
6
  import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
6
7
  import IconColumnTwo from '@fluentui/svg-icons/icons/text_column_two_20_regular.svg?raw';
7
8
  let { columns } = $props();
9
+ const localization = new TableColumnsManagerLocalization();
8
10
  </script>
9
11
 
10
12
  <Dropdown position="bottom-end" keepDropdownOpen>
11
13
  {#snippet trigger()}
12
14
  <Button variant="standard" size="small">
13
- <IconText icon={IconColumnTwo} iconColor="blue" secondaryIcon={IconChevronDown}>Columns</IconText>
15
+ <IconText icon={IconColumnTwo} iconColor="blue" secondaryIcon={IconChevronDown}>{localization.columns}</IconText>
14
16
  </Button>
15
17
  {/snippet}
16
18
  <div class="columns-manager">
17
- <div class="columns-manager__title">Select Columns</div>
19
+ <div class="columns-manager__title">{localization.selectColumns}</div>
18
20
  <div class="columns-manager__body">
19
21
  {#each columns.filter((c) => c.hideable) as column (column)}
20
22
  <div class="columns-manager__item">
@@ -0,0 +1,4 @@
1
+ export declare class TableColumnsManagerLocalization {
2
+ get columns(): string;
3
+ get selectColumns(): string;
4
+ }
@@ -0,0 +1,19 @@
1
+ import { AppLocale } from '../../../core/locale';
2
+ export class TableColumnsManagerLocalization {
3
+ get columns() {
4
+ return loc.columns[AppLocale.current];
5
+ }
6
+ get selectColumns() {
7
+ return loc.selectColumns[AppLocale.current];
8
+ }
9
+ }
10
+ const loc = {
11
+ columns: {
12
+ en: 'Columns',
13
+ no: 'Kolonner'
14
+ },
15
+ selectColumns: {
16
+ en: 'Select Columns',
17
+ no: 'Velg kolonner'
18
+ }
19
+ };
@@ -1,8 +1,10 @@
1
1
  <script lang="ts" generics="T extends {id: string}">import { Button } from '../../button';
2
2
  import { Dropdown, DropdownItem } from '../../dropdown';
3
3
  import { IconText } from '../../icon-text';
4
+ import { TableGroupActionsLocalization } from './table-group-actions-localization';
4
5
  import IconChevronDown from '@fluentui/svg-icons/icons/chevron_down_20_regular.svg?raw';
5
6
  let { groupActions, selection } = $props();
7
+ const localization = new TableGroupActionsLocalization();
6
8
  const isActionVisible = (action, items) => {
7
9
  return action.visibilityFactory ? action.visibilityFactory(items) : true;
8
10
  };
@@ -16,7 +18,7 @@ const singleGroupAction = $derived(availableGroupActions[0]);
16
18
  <Dropdown position="bottom-end">
17
19
  {#snippet trigger()}
18
20
  <Button variant="standard" size="small">
19
- <IconText icon={IconChevronDown} iconPosition="right">Actions</IconText>
21
+ <IconText icon={IconChevronDown} iconPosition="right">{localization.actions}</IconText>
20
22
  </Button>
21
23
  {/snippet}
22
24
  {#each groupActions as action (action)}
@@ -0,0 +1,3 @@
1
+ export declare class TableGroupActionsLocalization {
2
+ get actions(): string;
3
+ }
@@ -0,0 +1,12 @@
1
+ import { AppLocale } from '../../../core/locale';
2
+ export class TableGroupActionsLocalization {
3
+ get actions() {
4
+ return loc.actions[AppLocale.current];
5
+ }
6
+ }
7
+ const loc = {
8
+ actions: {
9
+ en: 'Actions',
10
+ no: 'Handlinger'
11
+ }
12
+ };
@@ -0,0 +1,7 @@
1
+ export declare class TableHeaderSortableLocalization {
2
+ get orderBy(): string;
3
+ get newestFirst(): string;
4
+ get oldestFirst(): string;
5
+ get ascending(): string;
6
+ get descending(): string;
7
+ }
@@ -0,0 +1,40 @@
1
+ import { AppLocale } from '../../../core/locale';
2
+ export class TableHeaderSortableLocalization {
3
+ get orderBy() {
4
+ return loc.orderBy[AppLocale.current];
5
+ }
6
+ get newestFirst() {
7
+ return loc.newestFirst[AppLocale.current];
8
+ }
9
+ get oldestFirst() {
10
+ return loc.oldestFirst[AppLocale.current];
11
+ }
12
+ get ascending() {
13
+ return loc.ascending[AppLocale.current];
14
+ }
15
+ get descending() {
16
+ return loc.descending[AppLocale.current];
17
+ }
18
+ }
19
+ const loc = {
20
+ orderBy: {
21
+ en: 'Order by:',
22
+ no: 'Sorter etter:'
23
+ },
24
+ newestFirst: {
25
+ en: 'Newest first',
26
+ no: 'Nyeste først'
27
+ },
28
+ oldestFirst: {
29
+ en: 'Oldest first',
30
+ no: 'Eldste først'
31
+ },
32
+ ascending: {
33
+ en: 'A → Z',
34
+ no: 'A → Å'
35
+ },
36
+ descending: {
37
+ en: 'Z → A',
38
+ no: 'Å → A'
39
+ }
40
+ };
@@ -1,10 +1,12 @@
1
1
  <script lang="ts">import { Checkbox } from '../../checkbox';
2
2
  import { Dropdown } from '../../dropdown';
3
3
  import { Icon } from '../../icon';
4
+ import { TableHeaderSortableLocalization } from './table-header-sortable-localization';
4
5
  import TableHeader from './table-header.svelte';
5
6
  import IconCaretDownFilled from '@fluentui/svg-icons/icons/caret_down_16_filled.svg?raw';
6
7
  import {} from 'svelte';
7
8
  let { column, on, children } = $props();
9
+ const localization = new TableHeaderSortableLocalization();
8
10
  const changeSort = (direction) => {
9
11
  if (column.sortDirection === direction) {
10
12
  direction = 'none';
@@ -30,23 +32,23 @@ const changeSort = (direction) => {
30
32
  {/snippet}
31
33
 
32
34
  <div class="th-sortable__dropdown">
33
- <div class="th-sortable__dropdown-title">Order by:</div>
35
+ <div class="th-sortable__dropdown-title">{localization.orderBy}</div>
34
36
  {#if column.type === 'by'}
35
37
  <div class="th-sortable__dropdown-option">
36
- Newest first
38
+ {localization.newestFirst}
37
39
  <Checkbox checked={column.sortDirection === 'desc'} on={{ change: () => changeSort('desc') }} />
38
40
  </div>
39
41
  <div class="th-sortable__dropdown-option">
40
- Oldest first
42
+ {localization.oldestFirst}
41
43
  <Checkbox checked={column.sortDirection === 'asc'} on={{ change: () => changeSort('asc') }} />
42
44
  </div>
43
45
  {:else}
44
46
  <div class="th-sortable__dropdown-option">
45
- A → Z
47
+ {localization.ascending}
46
48
  <Checkbox checked={column.sortDirection === 'asc'} on={{ change: () => changeSort('asc') }} />
47
49
  </div>
48
50
  <div class="th-sortable__dropdown-option">
49
- Z → A
51
+ {localization.descending}
50
52
  <Checkbox checked={column.sortDirection === 'desc'} on={{ change: () => changeSort('desc') }} />
51
53
  </div>
52
54
  {/if}
@@ -0,0 +1,6 @@
1
+ export declare class TableLocalization {
2
+ get noItemsFoundTitle(): string;
3
+ get noItemsFoundBody(): string;
4
+ get save(): string;
5
+ get cancel(): string;
6
+ }
@@ -0,0 +1,33 @@
1
+ import { AppLocale } from '../../core/locale';
2
+ export class TableLocalization {
3
+ get noItemsFoundTitle() {
4
+ return loc.noItemsFoundTitle[AppLocale.current];
5
+ }
6
+ get noItemsFoundBody() {
7
+ return loc.noItemsFoundBody[AppLocale.current];
8
+ }
9
+ get save() {
10
+ return loc.save[AppLocale.current];
11
+ }
12
+ get cancel() {
13
+ return loc.cancel[AppLocale.current];
14
+ }
15
+ }
16
+ const loc = {
17
+ noItemsFoundTitle: {
18
+ en: 'No Items <span>Found</span>',
19
+ no: 'Ingen elementer <span>funnet</span>'
20
+ },
21
+ noItemsFoundBody: {
22
+ en: 'No data found. Create one to get started',
23
+ no: 'Ingen data funnet. Opprett en for å komme i gang'
24
+ },
25
+ save: {
26
+ en: 'Save',
27
+ no: 'Lagre'
28
+ },
29
+ cancel: {
30
+ en: 'Cancel',
31
+ no: 'Avbryt'
32
+ }
33
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",