@lavalogic/scoria 0.40.31 → 0.40.33

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 (137) hide show
  1. package/README.md +58 -58
  2. package/dist/Components/AccordionGroup.svelte +28 -28
  3. package/dist/Components/AccordionGroupButton.svelte +60 -60
  4. package/dist/Components/Action.svelte +48 -48
  5. package/dist/Components/AlertModal.svelte +102 -102
  6. package/dist/Components/Base/ContextWrapper.svelte +45 -45
  7. package/dist/Components/Base/Pagination.svelte +135 -135
  8. package/dist/Components/Base/Snippets.svelte +25 -25
  9. package/dist/Components/BigRadioSet.svelte +34 -34
  10. package/dist/Components/Bubble.svelte +38 -38
  11. package/dist/Components/Button.svelte +83 -83
  12. package/dist/Components/Checkbox.svelte +71 -71
  13. package/dist/Components/CollapsibleCard.svelte +59 -59
  14. package/dist/Components/CollapsibleMenuGroup.svelte +43 -43
  15. package/dist/Components/ConditionBuilder/ConditionBuilder.svelte +101 -101
  16. package/dist/Components/Contexts/ContextMenu.svelte +76 -76
  17. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  18. package/dist/Components/Contexts/ContextMenuOption.svelte +38 -38
  19. package/dist/Components/Contexts/Toast.svelte +71 -71
  20. package/dist/Components/Contexts/ToastContainer.svelte +34 -34
  21. package/dist/Components/Contexts/Tooltip.svelte +32 -32
  22. package/dist/Components/DataMatrixIcon.svelte +37 -37
  23. package/dist/Components/DateInput.svelte +80 -80
  24. package/dist/Components/DatePicker.svelte +86 -86
  25. package/dist/Components/DesktopModal.svelte +65 -65
  26. package/dist/Components/Dial.svelte +35 -35
  27. package/dist/Components/DimensionInput.svelte +95 -95
  28. package/dist/Components/DragMenu/DragMenuHolder.svelte +53 -53
  29. package/dist/Components/DragMenu/DraggableCard.svelte +49 -49
  30. package/dist/Components/FileCard.svelte +18 -18
  31. package/dist/Components/FileUpload.svelte +115 -115
  32. package/dist/Components/GridInput.svelte +123 -123
  33. package/dist/Components/GridInputSet.svelte +21 -21
  34. package/dist/Components/HorizontalTabGroup.svelte +54 -54
  35. package/dist/Components/HorizontalTabGroupButton.svelte +32 -32
  36. package/dist/Components/Icon.svelte +68 -68
  37. package/dist/Components/Icons.d.ts +3 -3
  38. package/dist/Components/Icons.js +11 -11
  39. package/dist/Components/InfoAlert.svelte +32 -32
  40. package/dist/Components/LoadingAnimation.svelte +228 -227
  41. package/dist/Components/LoadingModal.svelte +19 -19
  42. package/dist/Components/LoadingOverlay.svelte +20 -20
  43. package/dist/Components/Modal.svelte +127 -127
  44. package/dist/Components/MultiSelect.svelte +126 -126
  45. package/dist/Components/Nav/Nav.svelte +71 -71
  46. package/dist/Components/Nav/NavServiceMenuList.svelte +37 -37
  47. package/dist/Components/Nav/NavTab.svelte +46 -46
  48. package/dist/Components/Nav/ServiceMenuItem.svelte +62 -62
  49. package/dist/Components/Nav/ServicesNav.svelte +50 -50
  50. package/dist/Components/NumberInput.svelte +98 -98
  51. package/dist/Components/OptionCards.svelte +58 -58
  52. package/dist/Components/PageHeading.svelte +21 -21
  53. package/dist/Components/PasswordInput.svelte +61 -61
  54. package/dist/Components/PopoverButton.svelte +53 -53
  55. package/dist/Components/Portal.svelte +7 -7
  56. package/dist/Components/ProgressBubble.svelte +42 -42
  57. package/dist/Components/QuerySelect.svelte +102 -102
  58. package/dist/Components/ResourceCalendar/ResourceCalendar.svelte +241 -241
  59. package/dist/Components/SidebarPanel.svelte +32 -32
  60. package/dist/Components/SingleSelect.svelte +122 -122
  61. package/dist/Components/StepButton.svelte +48 -48
  62. package/dist/Components/StepForm.svelte +58 -58
  63. package/dist/Components/Switch.svelte +43 -43
  64. package/dist/Components/Table/ARCHITECTURE.md +298 -298
  65. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +30 -30
  66. package/dist/Components/Table/Body/Rows/ColumnList.svelte +24 -24
  67. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +165 -165
  68. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +13 -13
  69. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +120 -120
  70. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +81 -81
  71. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +92 -92
  72. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +110 -110
  73. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +54 -54
  74. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +35 -35
  75. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +64 -64
  76. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +82 -82
  77. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +88 -88
  78. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +90 -90
  79. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +96 -96
  80. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +71 -71
  81. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +124 -124
  82. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +91 -91
  83. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +88 -88
  84. package/dist/Components/Table/Body/Rows/TableRow.svelte +127 -127
  85. package/dist/Components/Table/Body/TableBody.svelte +92 -92
  86. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +25 -25
  87. package/dist/Components/Table/Headers/SelectAllHeader.svelte +20 -20
  88. package/dist/Components/Table/Headers/TableHead.svelte +175 -175
  89. package/dist/Components/Table/Misc/ColumnPanel.svelte +32 -32
  90. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +29 -29
  91. package/dist/Components/Table/Misc/FilterInput.svelte +326 -326
  92. package/dist/Components/Table/Misc/FilterPanel.svelte +79 -79
  93. package/dist/Components/Table/Misc/FilterPanelModal.svelte +21 -21
  94. package/dist/Components/Table/Misc/ShareViewModal.svelte +118 -118
  95. package/dist/Components/Table/Misc/SidePanel.svelte +24 -24
  96. package/dist/Components/Table/Misc/TableConfigurationModal.svelte +318 -318
  97. package/dist/Components/Table/Misc/TableFooter.svelte +201 -201
  98. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +112 -112
  99. package/dist/Components/Table/Misc/TableSidebar.svelte +116 -116
  100. package/dist/Components/Table/Misc/TableViewDropdown.svelte +25 -25
  101. package/dist/Components/Table/Misc/ToolboxPanel.svelte +60 -60
  102. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +63 -63
  103. package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +101 -101
  104. package/dist/Components/Table/NestedTable.svelte +29 -29
  105. package/dist/Components/Table/Table.svelte +140 -140
  106. package/dist/Components/Test/TestContextConsumer.svelte +8 -8
  107. package/dist/Components/TextArea.svelte +92 -90
  108. package/dist/Components/TextInput.svelte +128 -117
  109. package/dist/Components/ThreeStateRadio.svelte +101 -101
  110. package/dist/Components/Touch/BoolCard.svelte +27 -27
  111. package/dist/Components/Touch/DateModal.svelte +98 -98
  112. package/dist/Components/Touch/EditCard.svelte +44 -44
  113. package/dist/Components/Touch/InfoCard.svelte +25 -25
  114. package/dist/Components/Touch/InfoTextCard.svelte +22 -22
  115. package/dist/Components/Touch/ModalExplanation.svelte +13 -13
  116. package/dist/Components/Touch/NumberKeyboard.svelte +81 -81
  117. package/dist/Components/Touch/NumberModal.svelte +49 -49
  118. package/dist/Components/Touch/PlusMinusCard.svelte +40 -40
  119. package/dist/Components/Touch/SelectModal.svelte +86 -86
  120. package/dist/Components/Touch/SummaryCard.svelte +74 -74
  121. package/dist/Components/Touch/TextAreaModal.svelte +53 -53
  122. package/dist/Components/Touch/TextModal.svelte +56 -56
  123. package/dist/Components/Touch/TouchCard.svelte +28 -28
  124. package/dist/Components/Touch/TouchModal.svelte +141 -141
  125. package/dist/Components/Touch/UtilityButton.svelte +63 -63
  126. package/dist/Components/VerticalTabGroup.svelte +38 -38
  127. package/dist/Components/VerticalTabGroupButton.svelte +46 -46
  128. package/dist/Helpers/Datamatrix.d.ts +19 -19
  129. package/dist/Helpers/Datamatrix.js +291 -291
  130. package/dist/Types/Examples/ExampleModal.svelte +27 -27
  131. package/dist/paraglide/README.md +1 -1
  132. package/dist/scss/_basics.scss +12 -12
  133. package/dist/scss/_colours.scss +140 -140
  134. package/dist/scss/_motion.scss +57 -57
  135. package/dist/scss/_sizing.scss +85 -85
  136. package/dist/scss/_transitions.scss +8 -8
  137. package/package.json +1 -1
@@ -1,20 +1,20 @@
1
- <svelte:options runes />
2
-
3
- <!--
4
- @component
5
- Live region for the {@link ToastContext}. Iterates the context's
6
- queue and renders one `Toast` per message, providing the
7
- copy-to-clipboard callback (the container owns the clipboard logic
8
- because the toast itself only knows the message it should copy).
9
-
10
- The wrapping `<section>` carries `role="region"` plus
11
- `aria-live="polite"` so multiple toast appearances are announced as
12
- a single rolling region without interrupting the user; individual
13
- `Toast` elements override `aria-live` to `assertive` for hard errors.
14
-
15
- Mounted once at the app root by `ContextWrapper`; consumers should
16
- not render this directly.
17
- -->
1
+ <svelte:options runes />
2
+
3
+ <!--
4
+ @component
5
+ Live region for the {@link ToastContext}. Iterates the context's
6
+ queue and renders one `Toast` per message, providing the
7
+ copy-to-clipboard callback (the container owns the clipboard logic
8
+ because the toast itself only knows the message it should copy).
9
+
10
+ The wrapping `<section>` carries `role="region"` plus
11
+ `aria-live="polite"` so multiple toast appearances are announced as
12
+ a single rolling region without interrupting the user; individual
13
+ `Toast` elements override `aria-live` to `assertive` for hard errors.
14
+
15
+ Mounted once at the app root by `ContextWrapper`; consumers should
16
+ not render this directly.
17
+ -->
18
18
  <script lang="ts">import { m as i18n } from "../../paraglide/messages.js";
19
19
  import { ToastContext } from "../../Contexts/ToastContext.svelte.js";
20
20
  import { devCatch } from "../../Helpers/Helpers.svelte.js";
@@ -43,22 +43,22 @@ function copyDataToClipboard(text) {
43
43
  copyable: false
44
44
  });
45
45
  }
46
- </script>
47
-
48
- <section
49
- aria-live="polite"
50
- aria-label={i18n['scoria.label.notifications']()}
51
- >
52
- {#each toastContext.toasts as toast (toast.id)}
53
- <Toast
54
- {toast}
55
- copy={() => {
56
- copyDataToClipboard(toast.getVerbose?.() ?? toast.message);
57
- }}
58
- />
59
- {/each}
60
- </section>
61
-
46
+ </script>
47
+
48
+ <section
49
+ aria-live="polite"
50
+ aria-label={i18n['scoria.label.notifications']()}
51
+ >
52
+ {#each toastContext.toasts as toast (toast.id)}
53
+ <Toast
54
+ {toast}
55
+ copy={() => {
56
+ copyDataToClipboard(toast.getVerbose?.() ?? toast.message);
57
+ }}
58
+ />
59
+ {/each}
60
+ </section>
61
+
62
62
  <style>section {
63
63
  user-select: none;
64
64
  gap: 0.5rem;
@@ -70,4 +70,4 @@ function copyDataToClipboard(text) {
70
70
  justify-content: flex-end;
71
71
  align-items: flex-end;
72
72
  z-index: 99999;
73
- }</style>
73
+ }</style>
@@ -1,38 +1,38 @@
1
- <svelte:options runes />
2
-
3
- <!--
4
- @component
5
- Visual host for `TooltipContext`. Renders a fixed-position tooltip at
6
- the coordinates the context exposes, with a CSS arrow that points
7
- back toward the anchored element on the configured side.
8
-
9
- The tooltip just appears and disappears; no transition is applied,
10
- which is the conservative choice for `prefers-reduced-motion`. Reads
11
- the context with `getContext` and relies on `ContextWrapper` to have
12
- set it up at the app root.
13
- -->
1
+ <svelte:options runes />
2
+
3
+ <!--
4
+ @component
5
+ Visual host for `TooltipContext`. Renders a fixed-position tooltip at
6
+ the coordinates the context exposes, with a CSS arrow that points
7
+ back toward the anchored element on the configured side.
8
+
9
+ The tooltip just appears and disappears; no transition is applied,
10
+ which is the conservative choice for `prefers-reduced-motion`. Reads
11
+ the context with `getContext` and relies on `ContextWrapper` to have
12
+ set it up at the app root.
13
+ -->
14
14
  <script lang="ts">import { TooltipContext } from "../../Contexts/TooltipContext.svelte.js";
15
15
  import { Side } from "../../Types/Internal/Side.js";
16
16
  import { getContext } from "svelte";
17
17
  const tooltipContext = getContext(TooltipContext.identifier);
18
- </script>
19
-
20
- {#if tooltipContext.isShowingTooltip}
21
- <div
22
- role="tooltip"
23
- style="--y: {tooltipContext.y}px; --x: {tooltipContext.x}px;"
24
- class="tooltip-wrapper"
25
- class:top-arrow={tooltipContext.anchor === Side.Top}
26
- class:bottom-arrow={tooltipContext.anchor === Side.Bottom}
27
- class:left-arrow={tooltipContext.anchor === Side.Left}
28
- class:right-arrow={tooltipContext.anchor === Side.Right}
29
- >
30
- <div class="tooltip">
31
- {tooltipContext.text}
32
- </div>
33
- </div>
34
- {/if}
35
-
18
+ </script>
19
+
20
+ {#if tooltipContext.isShowingTooltip}
21
+ <div
22
+ role="tooltip"
23
+ style="--y: {tooltipContext.y}px; --x: {tooltipContext.x}px;"
24
+ class="tooltip-wrapper"
25
+ class:top-arrow={tooltipContext.anchor === Side.Top}
26
+ class:bottom-arrow={tooltipContext.anchor === Side.Bottom}
27
+ class:left-arrow={tooltipContext.anchor === Side.Left}
28
+ class:right-arrow={tooltipContext.anchor === Side.Right}
29
+ >
30
+ <div class="tooltip">
31
+ {tooltipContext.text}
32
+ </div>
33
+ </div>
34
+ {/if}
35
+
36
36
  <style>.tooltip-wrapper {
37
37
  position: fixed;
38
38
  z-index: 99999;
@@ -122,4 +122,4 @@ const tooltipContext = getContext(TooltipContext.identifier);
122
122
  transform: rotate(45deg);
123
123
  background-color: #3a4952;
124
124
  border: solid 2px #dae0e5;
125
- }</style>
125
+ }</style>
@@ -1,5 +1,5 @@
1
- <svelte:options runes />
2
-
1
+ <svelte:options runes />
2
+
3
3
  <script lang="ts">import { m as i18n } from "../paraglide/messages.js";
4
4
  import { passthrough } from "../Helpers/Helpers.svelte.js";
5
5
  import Icon from "./Icon.svelte";
@@ -63,40 +63,40 @@ $effect(() => {
63
63
  lastSvg = source;
64
64
  }
65
65
  });
66
- </script>
67
-
68
- {#if interactive}
69
- <button
70
- aria-label={ariaLabel}
71
- onkeydown={passthrough}
72
- title={i18n['scoria.text.barcode_edit_hint']({ name: title })}
73
- oncontextmenu={(e) => {
74
- if (oncontextmenu) {
75
- e.preventDefault();
76
- oncontextmenu(e);
77
- }
78
- }}
79
- >
80
- <div
81
- class="fit"
82
- bind:this={svgContainer}
83
- >
84
- {#if icon.kind === 'icon-props'}
85
- <Icon {...icon.iconProps} />
86
- {/if}
87
- </div>
88
- </button>
89
- {:else}
90
- <div
91
- class="fit"
92
- bind:this={svgContainer}
93
- >
94
- {#if icon.kind === 'icon-props'}
95
- <Icon {...icon.iconProps} />
96
- {/if}
97
- </div>
98
- {/if}
99
-
66
+ </script>
67
+
68
+ {#if interactive}
69
+ <button
70
+ aria-label={ariaLabel}
71
+ onkeydown={passthrough}
72
+ title={i18n['scoria.text.barcode_edit_hint']({ name: title })}
73
+ oncontextmenu={(e) => {
74
+ if (oncontextmenu) {
75
+ e.preventDefault();
76
+ oncontextmenu(e);
77
+ }
78
+ }}
79
+ >
80
+ <div
81
+ class="fit"
82
+ bind:this={svgContainer}
83
+ >
84
+ {#if icon.kind === 'icon-props'}
85
+ <Icon {...icon.iconProps} />
86
+ {/if}
87
+ </div>
88
+ </button>
89
+ {:else}
90
+ <div
91
+ class="fit"
92
+ bind:this={svgContainer}
93
+ >
94
+ {#if icon.kind === 'icon-props'}
95
+ <Icon {...icon.iconProps} />
96
+ {/if}
97
+ </div>
98
+ {/if}
99
+
100
100
  <style>button {
101
101
  display: contents;
102
102
  cursor: pointer;
@@ -106,4 +106,4 @@ div.fit {
106
106
  background-color: #ffffff;
107
107
  display: flex;
108
108
  padding: 0.5rem;
109
- }</style>
109
+ }</style>
@@ -1,8 +1,8 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- lang="ts"
5
- module
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ lang="ts"
5
+ module
6
6
  >import { m as i18n } from "../paraglide/messages.js";
7
7
  import { cssLength } from "../Helpers/Helpers.svelte.js";
8
8
  import { InputVariant } from "../Types/Internal/InputVariant.js";
@@ -20,8 +20,8 @@ function submitAncestorForm(e) {
20
20
  const form = target?.closest("form");
21
21
  form?.requestSubmit();
22
22
  }
23
- </script>
24
-
23
+ </script>
24
+
25
25
  <script lang="ts">let { value = $bindable(""), label, placeholder, required = false, optional, variant = InputVariant.Default, min, max, type, disabled, leftIcon, rightIcon, inputRef = $bindable(), invalid, onblur, onfocus, onchange } = $props();
26
26
  // Null-safe: a fresh `<DateInput>` with no value passes `value=null`
27
27
  // through the prop. The old `value.trim()` crashed with "Cannot read
@@ -48,78 +48,78 @@ function handleChange(e) {
48
48
  const next = e.target.value;
49
49
  void onchange?.(next === "" ? null : next);
50
50
  }
51
- </script>
52
-
53
- <div
54
- class="error-wrapper"
55
- class:for-modal={variant == InputVariant.Modal}
56
- class:for-table={variant == InputVariant.Table}
57
- >
58
- <label class:for-modal={variant == InputVariant.Modal}>
59
- {#if label}
60
- <span
61
- class="top-label"
62
- class:for-default={variant === InputVariant.Default}
63
- class:invalid={isInvalid}
64
- >{label}{#if optional}<i>&nbsp;- {i18n['scoria.label.optional']()}</i>{/if}</span
65
- >
66
- {#if variant === InputVariant.Default}
67
- <span
68
- aria-hidden="true"
69
- class="border"
70
- class:invalid={isInvalid}
71
- >{label}{#if optional}<i>&nbsp;- {i18n['scoria.label.optional']()}</i>{/if}</span
72
- >
73
- {/if}
74
- {/if}
75
- <div class="icon-container">
76
- {#if leftIcon}
77
- <Icon
78
- name={leftIcon.name}
79
- size={leftIcon.size ?? Size.Medium}
80
- float
81
- left={cssLength('0.75rem')}
82
- top={cssLength('50%')}
83
- anchorX={cssLength('0')}
84
- anchorY={cssLength('-50%')}
85
- />
86
- {/if}
87
- <input
88
- step={type === 'datetime-local' ? 1 : type === 'time' ? 60 : 'any'}
89
- class:invalid={isInvalid}
90
- class:left-pad={leftIcon != undefined}
91
- class:right-pad={rightIcon != undefined}
92
- aria-invalid={isInvalid || undefined}
93
- {type}
94
- bind:value
95
- {onblur}
96
- {onfocus}
97
- {ondblclick}
98
- {onauxclick}
99
- bind:this={inputRef}
100
- {min}
101
- {max}
102
- {placeholder}
103
- {required}
104
- {disabled}
105
- {onkeydown}
106
- onchange={handleChange}
107
- />
108
- {#if rightIcon}
109
- <Icon
110
- name={rightIcon.name}
111
- size={rightIcon.size ?? Size.Medium}
112
- float
113
- right={cssLength('0.5rem')}
114
- top={cssLength('50%')}
115
- anchorX={cssLength('0')}
116
- anchorY={cssLength('-50%')}
117
- />
118
- {/if}
119
- </div>
120
- </label>
121
- </div>
122
-
51
+ </script>
52
+
53
+ <div
54
+ class="error-wrapper"
55
+ class:for-modal={variant == InputVariant.Modal}
56
+ class:for-table={variant == InputVariant.Table}
57
+ >
58
+ <label class:for-modal={variant == InputVariant.Modal}>
59
+ {#if label}
60
+ <span
61
+ class="top-label"
62
+ class:for-default={variant === InputVariant.Default}
63
+ class:invalid={isInvalid}
64
+ >{label}{#if optional}<i>&nbsp;- {i18n['scoria.label.optional']()}</i>{/if}</span
65
+ >
66
+ {#if variant === InputVariant.Default}
67
+ <span
68
+ aria-hidden="true"
69
+ class="border"
70
+ class:invalid={isInvalid}
71
+ >{label}{#if optional}<i>&nbsp;- {i18n['scoria.label.optional']()}</i>{/if}</span
72
+ >
73
+ {/if}
74
+ {/if}
75
+ <div class="icon-container">
76
+ {#if leftIcon}
77
+ <Icon
78
+ name={leftIcon.name}
79
+ size={leftIcon.size ?? Size.Medium}
80
+ float
81
+ left={cssLength('0.75rem')}
82
+ top={cssLength('50%')}
83
+ anchorX={cssLength('0')}
84
+ anchorY={cssLength('-50%')}
85
+ />
86
+ {/if}
87
+ <input
88
+ step={type === 'datetime-local' ? 1 : type === 'time' ? 60 : 'any'}
89
+ class:invalid={isInvalid}
90
+ class:left-pad={leftIcon != undefined}
91
+ class:right-pad={rightIcon != undefined}
92
+ aria-invalid={isInvalid || undefined}
93
+ {type}
94
+ bind:value
95
+ {onblur}
96
+ {onfocus}
97
+ {ondblclick}
98
+ {onauxclick}
99
+ bind:this={inputRef}
100
+ {min}
101
+ {max}
102
+ {placeholder}
103
+ {required}
104
+ {disabled}
105
+ {onkeydown}
106
+ onchange={handleChange}
107
+ />
108
+ {#if rightIcon}
109
+ <Icon
110
+ name={rightIcon.name}
111
+ size={rightIcon.size ?? Size.Medium}
112
+ float
113
+ right={cssLength('0.5rem')}
114
+ top={cssLength('50%')}
115
+ anchorX={cssLength('0')}
116
+ anchorY={cssLength('-50%')}
117
+ />
118
+ {/if}
119
+ </div>
120
+ </label>
121
+ </div>
122
+
123
123
  <style>input {
124
124
  box-sizing: border-box;
125
125
  height: 100%;
@@ -347,4 +347,4 @@ label.for-table {
347
347
  }
348
348
  label.for-table input {
349
349
  height: unset;
350
- }</style>
350
+ }</style>
@@ -1,8 +1,8 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- module
5
- lang="ts"
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ module
5
+ lang="ts"
6
6
  >// Use Intl.DateTimeFormat with en-GB locale for weekday and month names.
7
7
  const WEEKDAY_FMT = new Intl.DateTimeFormat("en-GB", { weekday: "long" });
8
8
  const MONTH_FULL_FMT = new Intl.DateTimeFormat("en-GB", { month: "short" });
@@ -40,8 +40,8 @@ const MONTHS_LABELS_NAMED = Object.freeze(Array.from({ length: 12 }, (_, i) => M
40
40
  // not reallocated on every $derived read.
41
41
  const HOURS = Object.freeze(Array.from({ length: 24 }, (_, i) => i));
42
42
  const MINUTES_SECONDS = Object.freeze(Array.from({ length: 60 }, (_, i) => i));
43
- </script>
44
-
43
+ </script>
44
+
45
45
  <script lang="ts">import { devCatch } from "../Helpers/Helpers.svelte.js";
46
46
  import { DatePickerType } from "../Types/Internal/DatePickerType.js";
47
47
  import { onMount, tick } from "svelte";
@@ -180,84 +180,84 @@ onMount(() => {
180
180
  }
181
181
  })().catch(devCatch);
182
182
  });
183
- </script>
184
-
185
- <div>
186
- <div class="touch-date-wrapper">
187
- <div class="date-line">
188
- {date.getDate()}
189
- {MONTHS_LABELS_NAMED[date.getMonth()]}
190
- {date.getFullYear()}
191
- </div>
192
- <p class="day-line">{WEEKDAY[date.getDay()]}</p>
193
- <div class="touch-date-picker">
194
- <Dial
195
- type={DatePickerType.Day}
196
- bind:ref={dayRef}
197
- entries={dayEntries}
198
- selected={date.getDate()}
199
- onchange={dateChanged}
200
- {onsubmit}
201
- {onPrevious}
202
- {onNext}
203
- />
204
- <Dial
205
- type={DatePickerType.Month}
206
- bind:ref={monthRef}
207
- entries={monthEntries}
208
- selected={date.getMonth()}
209
- onchange={dateChanged}
210
- {onsubmit}
211
- {onPrevious}
212
- {onNext}
213
- />
214
- <Dial
215
- bind:ref={yearRef}
216
- type={DatePickerType.Year}
217
- entries={yearEntries}
218
- selected={date.getFullYear()}
219
- onchange={dateChanged}
220
- {onsubmit}
221
- {onPrevious}
222
- {onNext}
223
- />
224
-
225
- {#if showTime}
226
- <Dial
227
- bind:ref={hoursRef}
228
- type={DatePickerType.Hours}
229
- entries={hourEntries}
230
- selected={date.getHours()}
231
- onchange={dateChanged}
232
- {onsubmit}
233
- {onPrevious}
234
- {onNext}
235
- />
236
- <Dial
237
- bind:ref={minutesRef}
238
- type={DatePickerType.Minutes}
239
- entries={minuteSecondEntries}
240
- selected={date.getMinutes()}
241
- onchange={dateChanged}
242
- {onsubmit}
243
- {onPrevious}
244
- {onNext}
245
- />
246
- <Dial
247
- bind:ref={secondsRef}
248
- type={DatePickerType.Seconds}
249
- entries={minuteSecondEntries}
250
- selected={date.getSeconds()}
251
- onchange={dateChanged}
252
- {onsubmit}
253
- {onPrevious}
254
- {onNext}
255
- />
256
- {/if}
257
- </div>
258
- </div>
259
- </div>
260
-
183
+ </script>
184
+
185
+ <div>
186
+ <div class="touch-date-wrapper">
187
+ <div class="date-line">
188
+ {date.getDate()}
189
+ {MONTHS_LABELS_NAMED[date.getMonth()]}
190
+ {date.getFullYear()}
191
+ </div>
192
+ <p class="day-line">{WEEKDAY[date.getDay()]}</p>
193
+ <div class="touch-date-picker">
194
+ <Dial
195
+ type={DatePickerType.Day}
196
+ bind:ref={dayRef}
197
+ entries={dayEntries}
198
+ selected={date.getDate()}
199
+ onchange={dateChanged}
200
+ {onsubmit}
201
+ {onPrevious}
202
+ {onNext}
203
+ />
204
+ <Dial
205
+ type={DatePickerType.Month}
206
+ bind:ref={monthRef}
207
+ entries={monthEntries}
208
+ selected={date.getMonth()}
209
+ onchange={dateChanged}
210
+ {onsubmit}
211
+ {onPrevious}
212
+ {onNext}
213
+ />
214
+ <Dial
215
+ bind:ref={yearRef}
216
+ type={DatePickerType.Year}
217
+ entries={yearEntries}
218
+ selected={date.getFullYear()}
219
+ onchange={dateChanged}
220
+ {onsubmit}
221
+ {onPrevious}
222
+ {onNext}
223
+ />
224
+
225
+ {#if showTime}
226
+ <Dial
227
+ bind:ref={hoursRef}
228
+ type={DatePickerType.Hours}
229
+ entries={hourEntries}
230
+ selected={date.getHours()}
231
+ onchange={dateChanged}
232
+ {onsubmit}
233
+ {onPrevious}
234
+ {onNext}
235
+ />
236
+ <Dial
237
+ bind:ref={minutesRef}
238
+ type={DatePickerType.Minutes}
239
+ entries={minuteSecondEntries}
240
+ selected={date.getMinutes()}
241
+ onchange={dateChanged}
242
+ {onsubmit}
243
+ {onPrevious}
244
+ {onNext}
245
+ />
246
+ <Dial
247
+ bind:ref={secondsRef}
248
+ type={DatePickerType.Seconds}
249
+ entries={minuteSecondEntries}
250
+ selected={date.getSeconds()}
251
+ onchange={dateChanged}
252
+ {onsubmit}
253
+ {onPrevious}
254
+ {onNext}
255
+ />
256
+ {/if}
257
+ </div>
258
+ </div>
259
+ </div>
260
+
261
261
  <style>.touch-date-wrapper {
262
262
  display: flex;
263
263
  justify-content: center;
@@ -277,4 +277,4 @@ onMount(() => {
277
277
 
278
278
  .day-line {
279
279
  margin: 2px;
280
- }</style>
280
+ }</style>