@placeholderco/placeholder-ui 1.0.11 → 2.0.0
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/LICENSE +1 -1
- package/README.md +134 -130
- package/dist/app.css +178 -0
- package/dist/bootstrap.min.css +3600 -0
- package/dist/cards/GitCard.svelte +115 -0
- package/dist/cards/GitCard.svelte.d.ts +22 -0
- package/dist/display/Avatar.svelte +29 -17
- package/dist/display/Avatar.svelte.d.ts +12 -2
- package/dist/display/LinkCollection.svelte +40 -18
- package/dist/display/LinkCollection.svelte.d.ts +9 -2
- package/dist/display/Paper.svelte +31 -19
- package/dist/display/Paper.svelte.d.ts +12 -3
- package/dist/display/alert/Alert.svelte +129 -0
- package/dist/display/alert/Alert.svelte.d.ts +15 -0
- package/dist/display/alert/AlertVariant.d.ts +1 -0
- package/dist/display/alert/AlertVariant.js +1 -0
- package/dist/display/filetree/FileTree.svelte +259 -0
- package/dist/display/filetree/FileTree.svelte.d.ts +76 -0
- package/dist/display/filetree/FileTreeItem.svelte +396 -0
- package/dist/display/filetree/FileTreeItem.svelte.d.ts +40 -0
- package/dist/display/filetree/FileTreeNode.d.ts +46 -0
- package/dist/display/filetree/FileTreeNode.js +115 -0
- package/dist/display/filetree/index.d.ts +5 -0
- package/dist/display/filetree/index.js +3 -0
- package/dist/editors/CodeMirror.svelte +306 -0
- package/dist/editors/CodeMirror.svelte.d.ts +31 -0
- package/dist/editors/tiptap/LinkActionMenu.svelte +307 -0
- package/dist/editors/tiptap/LinkActionMenu.svelte.d.ts +8 -0
- package/dist/editors/tiptap/TipTap.svelte +856 -0
- package/dist/editors/tiptap/TipTap.svelte.d.ts +54 -0
- package/dist/editors/tiptap/TipTapBubble.svelte +790 -0
- package/dist/editors/tiptap/TipTapBubble.svelte.d.ts +44 -0
- package/dist/editors/tiptap/collaboration.d.ts +55 -0
- package/dist/editors/tiptap/collaboration.js +1 -0
- package/dist/editors/tiptap/extensions/Alert.d.ts +18 -0
- package/dist/editors/tiptap/extensions/Alert.js +72 -0
- package/dist/editors/tiptap/extensions/CodeBlockEditor.d.ts +21 -0
- package/dist/editors/tiptap/extensions/CodeBlockEditor.js +326 -0
- package/dist/editors/tiptap/extensions/Div.d.ts +19 -0
- package/dist/editors/tiptap/extensions/Div.js +89 -0
- package/dist/editors/tiptap/extensions/Span.d.ts +5 -0
- package/dist/editors/tiptap/extensions/Span.js +56 -0
- package/dist/editors/tiptap/extensions/codeBlockEditor.css +236 -0
- package/dist/editors/tiptap/extensions/codeBlockLanguages.d.ts +17 -0
- package/dist/editors/tiptap/extensions/codeBlockLanguages.js +124 -0
- package/dist/editors/tiptap/extensions/index.d.ts +7 -0
- package/dist/editors/tiptap/extensions/index.js +5 -0
- package/dist/editors/tiptap/toolbar/AlertButton.svelte +261 -0
- package/dist/editors/tiptap/toolbar/AlertButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignCenterButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignJustifyButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignLeftButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/AlignRightButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/AlignRightButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/BoldButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/BoldButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/BulletListButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/BulletListButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/CodeBlockButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/CodeButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/CodeButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ColorButton.svelte +299 -0
- package/dist/editors/tiptap/toolbar/ColorButton.svelte.d.ts +20 -0
- package/dist/editors/tiptap/toolbar/DocumentButton.svelte +58 -0
- package/dist/editors/tiptap/toolbar/DocumentButton.svelte.d.ts +9 -0
- package/dist/editors/tiptap/toolbar/HeadingButton.svelte +30 -0
- package/dist/editors/tiptap/toolbar/HeadingButton.svelte.d.ts +8 -0
- package/dist/editors/tiptap/toolbar/HtmlButton.svelte +68 -0
- package/dist/editors/tiptap/toolbar/HtmlButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ImageButton.svelte +54 -0
- package/dist/editors/tiptap/toolbar/ImageButton.svelte.d.ts +8 -0
- package/dist/editors/tiptap/toolbar/ItalicButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/ItalicButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/LinkButton.svelte +257 -0
- package/dist/editors/tiptap/toolbar/LinkButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/OrderedListButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/OrderedListButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/RedoButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/RedoButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/StrikethroughButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/SubscriptButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/SubscriptButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/SuperscriptButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/TableButton.svelte +258 -0
- package/dist/editors/tiptap/toolbar/TableButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/ToolbarButton.svelte +84 -0
- package/dist/editors/tiptap/toolbar/ToolbarButton.svelte.d.ts +10 -0
- package/dist/editors/tiptap/toolbar/UnderlineButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/UnderlineButton.svelte.d.ts +7 -0
- package/dist/editors/tiptap/toolbar/UndoButton.svelte +18 -0
- package/dist/editors/tiptap/toolbar/UndoButton.svelte.d.ts +7 -0
- package/dist/form/Autocomplete.svelte +270 -137
- package/dist/form/Autocomplete.svelte.d.ts +58 -10
- package/dist/form/AutocompleteMulti.svelte +385 -227
- package/dist/form/AutocompleteMulti.svelte.d.ts +59 -10
- package/dist/form/Checkbox.svelte +124 -43
- package/dist/form/Checkbox.svelte.d.ts +26 -2
- package/dist/form/Chips.svelte +47 -17
- package/dist/form/Chips.svelte.d.ts +24 -3
- package/dist/form/ComboBox.svelte +30 -20
- package/dist/form/ComboBox.svelte.d.ts +1 -1
- package/dist/form/ComboBoxItemBuilder.svelte +161 -188
- package/dist/form/ComboBoxItemBuilder.svelte.d.ts +19 -2
- package/dist/form/ComboBoxMulti.svelte +38 -24
- package/dist/form/ComboBoxMulti.svelte.d.ts +1 -1
- package/dist/form/CronBuilder.svelte +84 -67
- package/dist/form/CronBuilder.svelte.d.ts +16 -3
- package/dist/form/DatePicker.svelte +177 -191
- package/dist/form/DatePicker.svelte.d.ts +17 -2
- package/dist/form/DateRangePicker.svelte +775 -0
- package/dist/form/DateRangePicker.svelte.d.ts +23 -0
- package/dist/form/DateTimePicker.svelte +168 -209
- package/dist/form/DateTimePicker.svelte.d.ts +10 -2
- package/dist/form/FormGroup.svelte +33 -10
- package/dist/form/FormGroup.svelte.d.ts +12 -2
- package/dist/form/Number.svelte +71 -29
- package/dist/form/Number.svelte.d.ts +39 -6
- package/dist/form/Radio.svelte +174 -0
- package/dist/form/Radio.svelte.d.ts +21 -0
- package/dist/form/RadioGroup.svelte +52 -138
- package/dist/form/RadioGroup.svelte.d.ts +19 -2
- package/dist/form/SegmentedControl.svelte +103 -57
- package/dist/form/SegmentedControl.svelte.d.ts +12 -2
- package/dist/form/Select.svelte +160 -229
- package/dist/form/Select.svelte.d.ts +35 -6
- package/dist/form/SelectMulti.svelte +166 -277
- package/dist/form/SelectMulti.svelte.d.ts +37 -6
- package/dist/form/Slider.svelte +185 -268
- package/dist/form/Slider.svelte.d.ts +33 -16
- package/dist/form/StringArrayBuilder.svelte +249 -0
- package/dist/form/StringArrayBuilder.svelte.d.ts +15 -0
- package/dist/form/Switch.svelte +164 -106
- package/dist/form/Switch.svelte.d.ts +22 -3
- package/dist/form/TextArea.svelte +80 -45
- package/dist/form/TextArea.svelte.d.ts +35 -10
- package/dist/form/Textbox.svelte +80 -47
- package/dist/form/Textbox.svelte.d.ts +41 -8
- package/dist/form/TimePicker.svelte +42 -47
- package/dist/form/TimePicker.svelte.d.ts +12 -2
- package/dist/form/comboBoxCore.svelte.d.ts +99 -0
- package/dist/form/comboBoxCore.svelte.js +243 -0
- package/dist/icon/Icon.svelte +8 -3
- package/dist/icon/Icon.svelte.d.ts +8 -3
- package/dist/icon/cube-send.svg +1 -0
- package/dist/icon/file-type-bmp.svg +1 -0
- package/dist/icon/file-type-csv.svg +1 -0
- package/dist/icon/file-type-doc.svg +1 -0
- package/dist/icon/file-type-docx.svg +1 -0
- package/dist/icon/file-type-jpg.svg +1 -0
- package/dist/icon/file-type-pdf.svg +1 -0
- package/dist/icon/file-type-png.svg +1 -0
- package/dist/icon/file-type-ppt.svg +1 -0
- package/dist/icon/file-type-svg.svg +1 -0
- package/dist/icon/file-type-txt.svg +1 -0
- package/dist/icon/file-type-xls.svg +1 -0
- package/dist/icon/file-type-zip.svg +1 -0
- package/dist/icon/index.d.ts +166 -145
- package/dist/icon/index.js +166 -146
- package/dist/icon/layout-sidebar-left-collapse.svg +1 -0
- package/dist/icon/layout-sidebar-left-expand.svg +1 -0
- package/dist/icon/logo-placeholder.svg +6 -0
- package/dist/icon/paperclip.svg +1 -0
- package/dist/icon/source-code.svg +1 -0
- package/dist/icon/sun-moon.svg +1 -0
- package/dist/icon/table.svg +6 -0
- package/dist/icon/thumb-down.svg +1 -0
- package/dist/icon/thumb-up.svg +1 -0
- package/dist/index.d.ts +93 -22
- package/dist/index.js +28 -27
- package/dist/layout/AppShell.svelte +12 -162
- package/dist/layout/AppShell.svelte.d.ts +6 -27
- package/dist/layout/CustomNavbar.svelte +9 -7
- package/dist/layout/CustomNavbar.svelte.d.ts +4 -2
- package/dist/layout/Navbar.svelte +158 -110
- package/dist/layout/Navbar.svelte.d.ts +26 -12
- package/dist/layout/NavbarItemDisplay.svelte +2 -2
- package/dist/layout/NavbarItemView.svelte +182 -0
- package/dist/layout/NavbarItemView.svelte.d.ts +10 -0
- package/dist/layout/Sidenav.svelte +280 -341
- package/dist/layout/Sidenav.svelte.d.ts +36 -4
- package/dist/models/ComboBoxItem.d.ts +2 -0
- package/dist/models/Employee.d.ts +53 -0
- package/dist/models/Employee.js +23 -0
- package/dist/models/Hyperlink.d.ts +3 -1
- package/dist/models/LinkCollectionItem.d.ts +3 -1
- package/dist/models/NavbarItem.d.ts +6 -2
- package/dist/theme.svelte.d.ts +0 -1
- package/dist/theme.svelte.js +46 -58
- package/dist/ui/Accordion.svelte +81 -242
- package/dist/ui/Accordion.svelte.d.ts +37 -14
- package/dist/ui/AccordionItem.svelte +303 -0
- package/dist/ui/AccordionItem.svelte.d.ts +21 -0
- package/dist/ui/ActionIcon.svelte +25 -21
- package/dist/ui/ActionIcon.svelte.d.ts +15 -2
- package/dist/ui/Badge.svelte +170 -161
- package/dist/ui/Badge.svelte.d.ts +16 -4
- package/dist/ui/Button.svelte +178 -205
- package/dist/ui/Button.svelte.d.ts +19 -2
- package/dist/ui/ButtonVariant.d.ts +15 -1
- package/dist/ui/ContextMenu.svelte +146 -0
- package/dist/ui/ContextMenu.svelte.d.ts +37 -0
- package/dist/ui/ContextMenuList.svelte +188 -0
- package/dist/ui/ContextMenuList.svelte.d.ts +12 -0
- package/dist/ui/Dialog.svelte +183 -104
- package/dist/ui/Dialog.svelte.d.ts +21 -2
- package/dist/ui/Drawer.svelte +237 -184
- package/dist/ui/Drawer.svelte.d.ts +20 -2
- package/dist/ui/Dropdown.svelte +24 -14
- package/dist/ui/Dropdown.svelte.d.ts +11 -2
- package/dist/ui/Dropzone.svelte +159 -57
- package/dist/ui/Dropzone.svelte.d.ts +29 -2
- package/dist/ui/Link.svelte +12 -4
- package/dist/ui/Link.svelte.d.ts +8 -2
- package/dist/ui/Loader.svelte +23 -18
- package/dist/ui/Loader.svelte.d.ts +5 -2
- package/dist/ui/Logo.svelte +37 -0
- package/dist/ui/Logo.svelte.d.ts +16 -0
- package/dist/ui/MultiSortable.svelte +287 -0
- package/dist/ui/MultiSortable.svelte.d.ts +50 -0
- package/dist/ui/Pagination.svelte +12 -6
- package/dist/ui/Pagination.svelte.d.ts +6 -2
- package/dist/ui/Popover.svelte +43 -65
- package/dist/ui/Popover.svelte.d.ts +14 -5
- package/dist/ui/ProgressBar.svelte +169 -0
- package/dist/ui/ProgressBar.svelte.d.ts +30 -0
- package/dist/ui/ProgressBarVariant.d.ts +7 -0
- package/dist/ui/ProgressBarVariant.js +1 -0
- package/dist/ui/SegmentedControl.svelte +0 -0
- package/dist/ui/SegmentedControl.svelte.d.ts +26 -0
- package/dist/ui/Sortable.svelte +163 -0
- package/dist/ui/Sortable.svelte.d.ts +47 -0
- package/dist/ui/Table.svelte +497 -56
- package/dist/ui/Table.svelte.d.ts +64 -2
- package/dist/ui/Tabs.svelte +22 -18
- package/dist/ui/Tabs.svelte.d.ts +6 -2
- package/dist/ui/ThemeSwitcher.svelte +26 -7
- package/dist/ui/ThemeSwitcher.svelte.d.ts +4 -2
- package/dist/ui/Tooltip.svelte +312 -180
- package/dist/ui/Tooltip.svelte.d.ts +4 -3
- package/dist/uiTheme.svelte.d.ts +86 -0
- package/dist/uiTheme.svelte.js +214 -0
- package/dist/util/DateFunctions.js +1 -1
- package/dist/util/DragDrop.d.ts +50 -0
- package/dist/util/DragDrop.js +154 -0
- package/dist/util/NavigateTo.js +2 -2
- package/dist/util/dayjs.d.ts +4 -0
- package/dist/util/dayjs.js +15 -0
- package/dist/util/interceptLinkClick.d.ts +13 -0
- package/dist/util/interceptLinkClick.js +33 -0
- package/package.json +66 -26
- package/dist/display/Alert.svelte +0 -179
- package/dist/display/Alert.svelte.d.ts +0 -13
- package/dist/form/FileInput.svelte +0 -235
- package/dist/form/FileInput.svelte.d.ts +0 -23
- package/dist/form/PasswordInput.svelte +0 -252
- package/dist/form/PasswordInput.svelte.d.ts +0 -33
- package/dist/form/Rating.svelte +0 -235
- package/dist/form/Rating.svelte.d.ts +0 -21
- package/dist/styles/components.css +0 -199
- package/dist/styles/dark.css +0 -146
- package/dist/styles/index.css +0 -116
- package/dist/styles/reset.css +0 -110
- package/dist/styles/semantic.css +0 -86
- package/dist/styles/tokens.css +0 -203
- package/dist/styles/utilities.css +0 -523
- package/dist/ui/Breadcrumbs.svelte +0 -131
- package/dist/ui/Breadcrumbs.svelte.d.ts +0 -16
- package/dist/ui/LoadingOverlay.svelte +0 -53
- package/dist/ui/LoadingOverlay.svelte.d.ts +0 -11
- package/dist/ui/Progress.svelte +0 -191
- package/dist/ui/Progress.svelte.d.ts +0 -15
- package/dist/ui/RingProgress.svelte +0 -141
- package/dist/ui/RingProgress.svelte.d.ts +0 -18
- package/dist/ui/Skeleton.svelte +0 -85
- package/dist/ui/Skeleton.svelte.d.ts +0 -12
- package/dist/ui/Stepper.svelte +0 -355
- package/dist/ui/Stepper.svelte.d.ts +0 -24
- package/dist/ui/Timeline.svelte +0 -225
- package/dist/ui/Timeline.svelte.d.ts +0 -23
- /package/dist/{actions → util}/ClickOutside.d.ts +0 -0
- /package/dist/{actions → util}/ClickOutside.js +0 -0
- /package/dist/{transitions → util}/Transitions.d.ts +0 -0
- /package/dist/{transitions → util}/Transitions.js +0 -0
|
@@ -1,22 +1,33 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import Number from './Number.svelte';
|
|
5
|
-
import { themeState } from '../theme.svelte.js';
|
|
6
|
-
import customParseFormat from 'dayjs/plugin/customParseFormat.js';
|
|
7
|
-
|
|
8
|
-
interface Props {
|
|
1
|
+
<script module lang="ts">
|
|
2
|
+
export interface TimePickerProps {
|
|
3
|
+
/** Label text displayed above the picker */
|
|
9
4
|
label?: string;
|
|
5
|
+
/** Disable the time picker */
|
|
10
6
|
disabled?: boolean;
|
|
7
|
+
/** Mark field as required (shows asterisk) */
|
|
11
8
|
required?: boolean;
|
|
9
|
+
/** CSS classes for the container element */
|
|
12
10
|
containerClass?: string;
|
|
11
|
+
/** Selected time value in HH:mm format (bindable) */
|
|
13
12
|
value?: string | undefined;
|
|
13
|
+
/** Use rounded time increments */
|
|
14
14
|
rounded?: boolean;
|
|
15
|
+
/** Minimum selectable time */
|
|
15
16
|
minDate?: string | undefined;
|
|
17
|
+
/** Maximum selectable time */
|
|
16
18
|
maxDate?: string | undefined;
|
|
19
|
+
/** Currently selected date (for date-time combinations) */
|
|
17
20
|
selectedDate?: string | undefined;
|
|
21
|
+
/** Callback when selected time changes */
|
|
18
22
|
onchange?: (date: string | undefined) => void;
|
|
19
23
|
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<script lang="ts">
|
|
27
|
+
import dayjs from '../util/dayjs.js';
|
|
28
|
+
import Button from '../ui/Button.svelte';
|
|
29
|
+
import Number from './Number.svelte';
|
|
30
|
+
import { themeState } from '../theme.svelte.js';
|
|
20
31
|
|
|
21
32
|
let {
|
|
22
33
|
label,
|
|
@@ -29,9 +40,8 @@
|
|
|
29
40
|
minDate,
|
|
30
41
|
maxDate,
|
|
31
42
|
selectedDate
|
|
32
|
-
}:
|
|
43
|
+
}: TimePickerProps = $props();
|
|
33
44
|
|
|
34
|
-
dayjs.extend(customParseFormat);
|
|
35
45
|
let time: dayjs.Dayjs = $derived(value ? dayjs(value, ['HH:mm:ss', 'HH:mm']) : dayjs());
|
|
36
46
|
|
|
37
47
|
let amPm: 'am' | 'pm' = $derived(time.hour() >= 12 ? 'pm' : 'am');
|
|
@@ -144,9 +154,9 @@
|
|
|
144
154
|
</script>
|
|
145
155
|
|
|
146
156
|
<div class="element-container {rounded && 'rounded'} {containerClass}">
|
|
147
|
-
<div class="
|
|
148
|
-
<div class="
|
|
149
|
-
<div class="time-container">
|
|
157
|
+
<div class="mb-1">{label}</div>
|
|
158
|
+
<div class="d-flex justify-content-between align-items-center">
|
|
159
|
+
<div class="time-container d-flex justify-content-between align-items-center flex-grow-1 gap-1">
|
|
150
160
|
<Number
|
|
151
161
|
{disabled}
|
|
152
162
|
bind:value={hours}
|
|
@@ -174,7 +184,7 @@
|
|
|
174
184
|
amPm = amPm === 'am' ? 'pm' : 'am';
|
|
175
185
|
UpdateTime();
|
|
176
186
|
}}
|
|
177
|
-
variant={themeState.isDarkMode ? '
|
|
187
|
+
variant={themeState.isDarkMode ? 'accent' : 'primary'}
|
|
178
188
|
>
|
|
179
189
|
{amPm.toUpperCase()}
|
|
180
190
|
</Button>
|
|
@@ -183,38 +193,23 @@
|
|
|
183
193
|
</div>
|
|
184
194
|
|
|
185
195
|
<style>
|
|
186
|
-
.time-label {
|
|
187
|
-
margin-bottom: var(--pui-spacing-1);
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
.time-wrapper {
|
|
191
|
-
display: flex;
|
|
192
|
-
justify-content: space-between;
|
|
193
|
-
align-items: center;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
196
|
.time-picker-container {
|
|
197
|
-
border-radius:
|
|
197
|
+
border-radius: 1rem;
|
|
198
198
|
overflow: hidden;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
.time-container {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
gap: var(--pui-spacing-1);
|
|
207
|
-
background-color: var(--pui-color-gray-100);
|
|
208
|
-
border: 1px solid var(--pui-border-default);
|
|
209
|
-
border-top-left-radius: var(--pui-radius-md);
|
|
210
|
-
border-bottom-left-radius: var(--pui-radius-md);
|
|
202
|
+
background-color: #f8f9fa;
|
|
203
|
+
border: 1px solid var(--border-color);
|
|
204
|
+
border-top-left-radius: 0.5rem;
|
|
205
|
+
border-bottom-left-radius: 0.5rem;
|
|
211
206
|
|
|
212
207
|
:global(.number-container) {
|
|
213
208
|
flex-grow: 1;
|
|
214
209
|
|
|
215
210
|
:global(.number-input input) {
|
|
216
211
|
text-align: center;
|
|
217
|
-
background-color:
|
|
212
|
+
background-color: #f8f9fa;
|
|
218
213
|
}
|
|
219
214
|
}
|
|
220
215
|
}
|
|
@@ -225,43 +220,43 @@
|
|
|
225
220
|
}
|
|
226
221
|
|
|
227
222
|
.time-container :global(.number-container:first-child .number:hover) {
|
|
228
|
-
border-right: 1px solid var(--
|
|
229
|
-
background-color: var(--
|
|
223
|
+
border-right: 1px solid var(--border-color) !important;
|
|
224
|
+
background-color: rgba(var(--accent-text-color-rgb), 0.2) !important;
|
|
230
225
|
}
|
|
231
226
|
|
|
232
227
|
.time-container :global(.number-container:last-child .number:hover) {
|
|
233
|
-
border-left: 1px solid var(--
|
|
234
|
-
background-color: var(--
|
|
228
|
+
border-left: 1px solid var(--border-color) !important;
|
|
229
|
+
background-color: rgba(var(--accent-text-color-rgb), 0.2) !important;
|
|
235
230
|
}
|
|
236
231
|
|
|
237
232
|
.time-container :global(.number-container:first-child .number) {
|
|
238
|
-
border-top-left-radius:
|
|
239
|
-
border-bottom-left-radius:
|
|
233
|
+
border-top-left-radius: 0.5rem;
|
|
234
|
+
border-bottom-left-radius: 0.5rem;
|
|
240
235
|
}
|
|
241
236
|
|
|
242
237
|
.am-pm-container :global(.pui-button) {
|
|
243
238
|
border-radius: 0;
|
|
244
|
-
border-top-right-radius:
|
|
245
|
-
border-bottom-right-radius:
|
|
239
|
+
border-top-right-radius: 0.5rem;
|
|
240
|
+
border-bottom-right-radius: 0.5rem;
|
|
246
241
|
}
|
|
247
242
|
|
|
248
243
|
:global(.dark) {
|
|
249
244
|
.time-container {
|
|
250
|
-
background-color:
|
|
245
|
+
background-color: #252529;
|
|
251
246
|
|
|
252
247
|
:global(.number-container) {
|
|
253
248
|
:global(.number-input input) {
|
|
254
|
-
background-color:
|
|
249
|
+
background-color: #252529;
|
|
255
250
|
}
|
|
256
251
|
}
|
|
257
252
|
}
|
|
258
253
|
|
|
259
254
|
.time-container :global(.number-container:first-child .number:hover) {
|
|
260
|
-
background-color: var(--
|
|
255
|
+
background-color: rgba(var(--accent-text-color-rgb), 0.1) !important;
|
|
261
256
|
}
|
|
262
257
|
|
|
263
258
|
.time-container :global(.number-container:last-child .number:hover) {
|
|
264
|
-
background-color: var(--
|
|
259
|
+
background-color: rgba(var(--accent-text-color-rgb), 0.1) !important;
|
|
265
260
|
}
|
|
266
261
|
}
|
|
267
262
|
</style>
|
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
interface
|
|
1
|
+
export interface TimePickerProps {
|
|
2
|
+
/** Label text displayed above the picker */
|
|
2
3
|
label?: string;
|
|
4
|
+
/** Disable the time picker */
|
|
3
5
|
disabled?: boolean;
|
|
6
|
+
/** Mark field as required (shows asterisk) */
|
|
4
7
|
required?: boolean;
|
|
8
|
+
/** CSS classes for the container element */
|
|
5
9
|
containerClass?: string;
|
|
10
|
+
/** Selected time value in HH:mm format (bindable) */
|
|
6
11
|
value?: string | undefined;
|
|
12
|
+
/** Use rounded time increments */
|
|
7
13
|
rounded?: boolean;
|
|
14
|
+
/** Minimum selectable time */
|
|
8
15
|
minDate?: string | undefined;
|
|
16
|
+
/** Maximum selectable time */
|
|
9
17
|
maxDate?: string | undefined;
|
|
18
|
+
/** Currently selected date (for date-time combinations) */
|
|
10
19
|
selectedDate?: string | undefined;
|
|
20
|
+
/** Callback when selected time changes */
|
|
11
21
|
onchange?: (date: string | undefined) => void;
|
|
12
22
|
}
|
|
13
|
-
declare const TimePicker: import("svelte").Component<
|
|
23
|
+
declare const TimePicker: import("svelte").Component<TimePickerProps, {}, "value">;
|
|
14
24
|
type TimePicker = ReturnType<typeof TimePicker>;
|
|
15
25
|
export default TimePicker;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { ComboBoxGroup, ComboBoxItem, FetchFunctionType, RetrieveLabelFunctionType, SearchFunctionType } from '../models/ComboBoxItem.js';
|
|
2
|
+
/**
|
|
3
|
+
* Option/search lifecycle shared by every option-driven input regardless of
|
|
4
|
+
* whether it holds a single value or many. Value-specific concerns
|
|
5
|
+
* (selected-state, value preloading) are supplied by the subclasses.
|
|
6
|
+
*
|
|
7
|
+
* Value/rawValue accessors live on the subclass configs because they are
|
|
8
|
+
* `$bindable` props on the host component and can't be referenced from here.
|
|
9
|
+
*/
|
|
10
|
+
export interface ComboBoxDataConfig {
|
|
11
|
+
/** Current flat options, read reactively */
|
|
12
|
+
getOptions: () => ComboBoxItem[];
|
|
13
|
+
/** Current grouped options, read reactively */
|
|
14
|
+
getGroupedOptions: () => ComboBoxGroup[];
|
|
15
|
+
getFetchFunction: () => FetchFunctionType | null;
|
|
16
|
+
getSearchFunction: () => SearchFunctionType | null;
|
|
17
|
+
getRetrieveLabelFunction: () => RetrieveLabelFunctionType | null;
|
|
18
|
+
/** Called after options are (re)applied so the host can re-run its active filter */
|
|
19
|
+
onOptionsChanged?: () => void;
|
|
20
|
+
}
|
|
21
|
+
/** Config for single-value inputs (Select, Autocomplete). */
|
|
22
|
+
export interface ComboBoxCoreConfig extends ComboBoxDataConfig {
|
|
23
|
+
/** Current bound value, read reactively */
|
|
24
|
+
getValue: () => string | undefined;
|
|
25
|
+
/** Update the bound value */
|
|
26
|
+
setValue: (value: string | undefined) => void;
|
|
27
|
+
/** Update the bound rawValue */
|
|
28
|
+
setRawValue: (raw: ComboBoxItem | undefined) => void;
|
|
29
|
+
/**
|
|
30
|
+
* When the value isn't among static options, clear it (Select — so forms don't
|
|
31
|
+
* submit a stale key) instead of keeping it as freeform text (Autocomplete).
|
|
32
|
+
*/
|
|
33
|
+
clearUnknownStatic?: boolean;
|
|
34
|
+
/** Called after preloadValues clears the value via the static-unknown path */
|
|
35
|
+
onValueCleared?: () => void;
|
|
36
|
+
/** Called once an async retrieveLabel resolves a rawValue */
|
|
37
|
+
onRawValueResolved?: (raw: ComboBoxItem | undefined) => void;
|
|
38
|
+
}
|
|
39
|
+
/** Config for multi-value inputs (SelectMulti, AutocompleteMulti). */
|
|
40
|
+
export interface ComboBoxMultiCoreConfig extends ComboBoxDataConfig {
|
|
41
|
+
/** Current bound values, read reactively */
|
|
42
|
+
getValues: () => string[];
|
|
43
|
+
/**
|
|
44
|
+
* Snapshot of the caller-supplied initial rawValues. Used as a label source for
|
|
45
|
+
* values the options can't resolve, so parents can preset selections with known
|
|
46
|
+
* labels without a retrieveLabel round-trip. A snapshot (not the live binding) so
|
|
47
|
+
* items selected later still go through the normal stale-value cleanup.
|
|
48
|
+
*/
|
|
49
|
+
initialRawValues?: ComboBoxItem[];
|
|
50
|
+
/** Update the bound values */
|
|
51
|
+
setValues: (values: string[]) => void;
|
|
52
|
+
/** Update the bound rawValues */
|
|
53
|
+
setRawValues: (raw: ComboBoxItem[]) => void;
|
|
54
|
+
/** Drop values not found among static options (SelectMulti) instead of keeping them (AutocompleteMulti) */
|
|
55
|
+
clearUnknownStatic?: boolean;
|
|
56
|
+
/** Called after preloadValues drops unknown static values */
|
|
57
|
+
onValuesCleared?: () => void;
|
|
58
|
+
/** Called once async retrieveLabel calls resolve the rawValues */
|
|
59
|
+
onRawValuesResolved?: (raw: ComboBoxItem[]) => void;
|
|
60
|
+
}
|
|
61
|
+
export declare function flattenItems(groups: ComboBoxGroup[]): ComboBoxItem[];
|
|
62
|
+
export declare function findItemByValue(groups: ComboBoxGroup[], value: string | undefined): ComboBoxItem | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Owns the option/search data lifecycle shared by the single- and multi-value
|
|
65
|
+
* inputs: converting options into groups, reacting to option-prop changes,
|
|
66
|
+
* one-shot fetch, debounced remote search and local filtering.
|
|
67
|
+
*
|
|
68
|
+
* Instantiate (via a subclass) at the top of a component `<script>` so its
|
|
69
|
+
* `$effect`s register in that component's lifecycle.
|
|
70
|
+
*/
|
|
71
|
+
export declare abstract class ComboBoxDataCore<TConfig extends ComboBoxDataConfig> {
|
|
72
|
+
#private;
|
|
73
|
+
allGroups: ComboBoxGroup[];
|
|
74
|
+
filteredGroups: ComboBoxGroup[];
|
|
75
|
+
preloading: boolean;
|
|
76
|
+
searching: boolean;
|
|
77
|
+
protected config: TConfig;
|
|
78
|
+
constructor(config: TConfig);
|
|
79
|
+
/** Whether an option should render as selected for the current value(s). */
|
|
80
|
+
protected abstract isSelected(item: ComboBoxItem): boolean;
|
|
81
|
+
/** Resolve rawValue(s) for the current value(s). Returns true if it changed the value(s). */
|
|
82
|
+
abstract preloadValues(): boolean;
|
|
83
|
+
convertOptions(options: ComboBoxItem[]): void;
|
|
84
|
+
convertGroupOptions(groups: ComboBoxGroup[]): void;
|
|
85
|
+
/** Debounced remote search via searchFunction. */
|
|
86
|
+
search(filterValue: string, onComplete?: () => void): void;
|
|
87
|
+
/** Case-insensitive local filter over already-loaded options. */
|
|
88
|
+
filterLocal(filterValue: string): void;
|
|
89
|
+
}
|
|
90
|
+
/** Single-value data core (Select, Autocomplete). */
|
|
91
|
+
export declare class ComboBoxCore extends ComboBoxDataCore<ComboBoxCoreConfig> {
|
|
92
|
+
protected isSelected(item: ComboBoxItem): boolean;
|
|
93
|
+
preloadValues(): boolean;
|
|
94
|
+
}
|
|
95
|
+
/** Multi-value data core (SelectMulti, AutocompleteMulti). */
|
|
96
|
+
export declare class ComboBoxMultiCore extends ComboBoxDataCore<ComboBoxMultiCoreConfig> {
|
|
97
|
+
protected isSelected(item: ComboBoxItem): boolean;
|
|
98
|
+
preloadValues(): boolean;
|
|
99
|
+
}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
export function flattenItems(groups) {
|
|
2
|
+
return groups.flatMap((group) => group.items);
|
|
3
|
+
}
|
|
4
|
+
export function findItemByValue(groups, value) {
|
|
5
|
+
if (value === undefined || value === '')
|
|
6
|
+
return undefined;
|
|
7
|
+
return flattenItems(groups).find((item) => item.value === value);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Owns the option/search data lifecycle shared by the single- and multi-value
|
|
11
|
+
* inputs: converting options into groups, reacting to option-prop changes,
|
|
12
|
+
* one-shot fetch, debounced remote search and local filtering.
|
|
13
|
+
*
|
|
14
|
+
* Instantiate (via a subclass) at the top of a component `<script>` so its
|
|
15
|
+
* `$effect`s register in that component's lifecycle.
|
|
16
|
+
*/
|
|
17
|
+
export class ComboBoxDataCore {
|
|
18
|
+
allGroups = $state([]);
|
|
19
|
+
filteredGroups = $state([]);
|
|
20
|
+
preloading = $state(false);
|
|
21
|
+
searching = $state(false);
|
|
22
|
+
config;
|
|
23
|
+
#timeout;
|
|
24
|
+
#fetchInitialized = false;
|
|
25
|
+
#lastOptionsRef;
|
|
26
|
+
#lastGroupedRef;
|
|
27
|
+
constructor(config) {
|
|
28
|
+
this.config = config;
|
|
29
|
+
$effect(() => {
|
|
30
|
+
const cfg = this.config;
|
|
31
|
+
// fetchFunction is one-shot on mount; ignore later prop changes.
|
|
32
|
+
const fetchFunction = cfg.getFetchFunction();
|
|
33
|
+
if (fetchFunction) {
|
|
34
|
+
if (this.#fetchInitialized)
|
|
35
|
+
return;
|
|
36
|
+
this.#fetchInitialized = true;
|
|
37
|
+
this.preloading = true;
|
|
38
|
+
fetchFunction().then((response) => {
|
|
39
|
+
this.convertOptions(response.object ?? []);
|
|
40
|
+
this.preloadValues();
|
|
41
|
+
this.preloading = false;
|
|
42
|
+
});
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
// Reference guard: skip rebuilds when the parent re-rendered the same arrays.
|
|
46
|
+
const options = cfg.getOptions();
|
|
47
|
+
const grouped = cfg.getGroupedOptions();
|
|
48
|
+
if (options === this.#lastOptionsRef && grouped === this.#lastGroupedRef)
|
|
49
|
+
return;
|
|
50
|
+
this.#lastOptionsRef = options;
|
|
51
|
+
this.#lastGroupedRef = grouped;
|
|
52
|
+
if (grouped.length) {
|
|
53
|
+
this.convertGroupOptions(grouped);
|
|
54
|
+
}
|
|
55
|
+
else if (options.length) {
|
|
56
|
+
this.convertOptions(options);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.allGroups = [];
|
|
60
|
+
this.filteredGroups = [];
|
|
61
|
+
}
|
|
62
|
+
this.preloadValues();
|
|
63
|
+
cfg.onOptionsChanged?.();
|
|
64
|
+
});
|
|
65
|
+
$effect(() => () => clearTimeout(this.#timeout));
|
|
66
|
+
}
|
|
67
|
+
convertOptions(options) {
|
|
68
|
+
const items = options.map((option) => ({ ...option, selected: this.isSelected(option) }));
|
|
69
|
+
this.allGroups = [{ label: '', items: [...items] }];
|
|
70
|
+
this.filteredGroups = [{ label: '', items: [...items] }];
|
|
71
|
+
}
|
|
72
|
+
convertGroupOptions(groups) {
|
|
73
|
+
this.allGroups = groups.map((group) => ({
|
|
74
|
+
...group,
|
|
75
|
+
items: group.items.map((option) => ({
|
|
76
|
+
...option,
|
|
77
|
+
selected: this.isSelected(option),
|
|
78
|
+
groupName: group.label
|
|
79
|
+
}))
|
|
80
|
+
}));
|
|
81
|
+
this.filteredGroups = [...this.allGroups];
|
|
82
|
+
}
|
|
83
|
+
/** Debounced remote search via searchFunction. */
|
|
84
|
+
search(filterValue, onComplete) {
|
|
85
|
+
clearTimeout(this.#timeout);
|
|
86
|
+
this.searching = true;
|
|
87
|
+
this.#timeout = setTimeout(() => {
|
|
88
|
+
this.config.getSearchFunction()(filterValue).then((response) => {
|
|
89
|
+
this.convertOptions(response.object ?? []);
|
|
90
|
+
this.searching = false;
|
|
91
|
+
onComplete?.();
|
|
92
|
+
});
|
|
93
|
+
}, 300);
|
|
94
|
+
}
|
|
95
|
+
/** Case-insensitive local filter over already-loaded options. */
|
|
96
|
+
filterLocal(filterValue) {
|
|
97
|
+
if (filterValue.length === 0) {
|
|
98
|
+
this.filteredGroups = this.allGroups;
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const needle = filterValue.toLowerCase();
|
|
102
|
+
this.filteredGroups = this.allGroups
|
|
103
|
+
.map((group) => ({
|
|
104
|
+
...group,
|
|
105
|
+
items: group.items.filter((item) => item.label.toLowerCase().includes(needle))
|
|
106
|
+
}))
|
|
107
|
+
.filter((group) => group.items.length > 0);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/** Single-value data core (Select, Autocomplete). */
|
|
111
|
+
export class ComboBoxCore extends ComboBoxDataCore {
|
|
112
|
+
isSelected(item) {
|
|
113
|
+
return item.value === this.config.getValue();
|
|
114
|
+
}
|
|
115
|
+
preloadValues() {
|
|
116
|
+
const cfg = this.config;
|
|
117
|
+
const value = cfg.getValue();
|
|
118
|
+
if (!value) {
|
|
119
|
+
cfg.setRawValue(undefined);
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
const found = findItemByValue(this.allGroups, value);
|
|
123
|
+
if (found !== undefined) {
|
|
124
|
+
cfg.setRawValue(found);
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
const retrieveLabelFunction = cfg.getRetrieveLabelFunction();
|
|
128
|
+
if (cfg.getSearchFunction() && retrieveLabelFunction) {
|
|
129
|
+
// Show the loader while resolving; discard if the value changes first.
|
|
130
|
+
cfg.setRawValue(undefined);
|
|
131
|
+
this.preloading = true;
|
|
132
|
+
const valueAtCall = value;
|
|
133
|
+
retrieveLabelFunction(value).then((response) => {
|
|
134
|
+
if (valueAtCall !== cfg.getValue())
|
|
135
|
+
return;
|
|
136
|
+
const raw = {
|
|
137
|
+
label: response.object ?? String(valueAtCall),
|
|
138
|
+
value: valueAtCall
|
|
139
|
+
};
|
|
140
|
+
cfg.setRawValue(raw);
|
|
141
|
+
this.preloading = false;
|
|
142
|
+
cfg.onRawValueResolved?.(raw);
|
|
143
|
+
});
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
if (cfg.getFetchFunction()) {
|
|
147
|
+
// Async source may still resolve this value — keep it with a fallback label.
|
|
148
|
+
cfg.setRawValue({ label: String(value), value });
|
|
149
|
+
return false;
|
|
150
|
+
}
|
|
151
|
+
if (cfg.clearUnknownStatic) {
|
|
152
|
+
cfg.setValue(undefined);
|
|
153
|
+
cfg.setRawValue(undefined);
|
|
154
|
+
cfg.onValueCleared?.();
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
// Freeform (Autocomplete): leave the typed value in place.
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/** Multi-value data core (SelectMulti, AutocompleteMulti). */
|
|
162
|
+
export class ComboBoxMultiCore extends ComboBoxDataCore {
|
|
163
|
+
isSelected(item) {
|
|
164
|
+
return this.config.getValues().includes(item.value);
|
|
165
|
+
}
|
|
166
|
+
preloadValues() {
|
|
167
|
+
const cfg = this.config;
|
|
168
|
+
const values = cfg.getValues() ?? [];
|
|
169
|
+
const items = flattenItems(this.allGroups);
|
|
170
|
+
for (const option of items)
|
|
171
|
+
option.selected = false;
|
|
172
|
+
if (values.length === 0) {
|
|
173
|
+
cfg.setRawValues([]);
|
|
174
|
+
return false;
|
|
175
|
+
}
|
|
176
|
+
const newRawValues = [];
|
|
177
|
+
const validValues = [];
|
|
178
|
+
const promises = [];
|
|
179
|
+
let droppedAny = false;
|
|
180
|
+
const searchFunction = cfg.getSearchFunction();
|
|
181
|
+
const retrieveLabelFunction = cfg.getRetrieveLabelFunction();
|
|
182
|
+
const fetchFunction = cfg.getFetchFunction();
|
|
183
|
+
for (const value of values) {
|
|
184
|
+
const found = items.find((x) => x.value === value);
|
|
185
|
+
if (found !== undefined) {
|
|
186
|
+
found.selected = true;
|
|
187
|
+
newRawValues.push({ ...found });
|
|
188
|
+
validValues.push(value);
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const provided = cfg.initialRawValues?.find((x) => x.value === value);
|
|
192
|
+
if (provided !== undefined) {
|
|
193
|
+
// Caller vouched for this item up front — keep its label, skip async resolution
|
|
194
|
+
newRawValues.push({ ...provided, selected: true });
|
|
195
|
+
validValues.push(value);
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (searchFunction && retrieveLabelFunction) {
|
|
199
|
+
// Capture value to discard stale responses if the selection changes mid-request
|
|
200
|
+
const valueAtCall = value;
|
|
201
|
+
const placeholder = { label: String(value), value, selected: true };
|
|
202
|
+
promises.push(retrieveLabelFunction(value).then((response) => {
|
|
203
|
+
if (!cfg.getValues().includes(valueAtCall))
|
|
204
|
+
return;
|
|
205
|
+
placeholder.label = response.object ?? String(valueAtCall);
|
|
206
|
+
}));
|
|
207
|
+
newRawValues.push(placeholder);
|
|
208
|
+
validValues.push(value);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
if (fetchFunction) {
|
|
212
|
+
// Async data source may still resolve this value — preserve with fallback label
|
|
213
|
+
newRawValues.push({ label: String(value), value, selected: true });
|
|
214
|
+
validValues.push(value);
|
|
215
|
+
continue;
|
|
216
|
+
}
|
|
217
|
+
if (cfg.clearUnknownStatic) {
|
|
218
|
+
// Static options + unknown value: drop so form submits don't carry stale keys
|
|
219
|
+
droppedAny = true;
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
// Freeform (AutocompleteMulti): keep the value as its own chip
|
|
223
|
+
newRawValues.push({ label: String(value), value, selected: true });
|
|
224
|
+
validValues.push(value);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
cfg.setRawValues(newRawValues);
|
|
228
|
+
if (promises.length > 0) {
|
|
229
|
+
this.preloading = true;
|
|
230
|
+
Promise.all(promises).then(() => {
|
|
231
|
+
cfg.setRawValues([...newRawValues]);
|
|
232
|
+
this.preloading = false;
|
|
233
|
+
cfg.onRawValuesResolved?.(newRawValues);
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
if (droppedAny) {
|
|
237
|
+
cfg.setValues(validValues);
|
|
238
|
+
cfg.onValuesCleared?.();
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
}
|
package/dist/icon/Icon.svelte
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export interface IconProps {
|
|
3
|
+
/** Raw SVG HTML string. Do NOT use external/user input - it will be executed in the browser */
|
|
4
4
|
svg: string;
|
|
5
|
+
/** Stroke color for the icon */
|
|
5
6
|
stroke?: string;
|
|
7
|
+
/** Fill color for the icon */
|
|
6
8
|
fill?: string;
|
|
9
|
+
/** Size of the icon (width and height) */
|
|
7
10
|
size?: string;
|
|
11
|
+
/** Flip the icon horizontally */
|
|
8
12
|
flip?: boolean;
|
|
13
|
+
/** Additional CSS classes */
|
|
9
14
|
class?: string;
|
|
10
15
|
}
|
|
11
16
|
|
|
@@ -16,7 +21,7 @@
|
|
|
16
21
|
size = '',
|
|
17
22
|
flip = false,
|
|
18
23
|
class: classes = ''
|
|
19
|
-
}:
|
|
24
|
+
}: IconProps = $props();
|
|
20
25
|
|
|
21
26
|
let sizeStyle = $derived(size ? `width:${size};height:${size};` : '');
|
|
22
27
|
</script>
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export interface IconProps {
|
|
2
|
+
/** Raw SVG HTML string. Do NOT use external/user input - it will be executed in the browser */
|
|
3
3
|
svg: string;
|
|
4
|
+
/** Stroke color for the icon */
|
|
4
5
|
stroke?: string;
|
|
6
|
+
/** Fill color for the icon */
|
|
5
7
|
fill?: string;
|
|
8
|
+
/** Size of the icon (width and height) */
|
|
6
9
|
size?: string;
|
|
10
|
+
/** Flip the icon horizontally */
|
|
7
11
|
flip?: boolean;
|
|
12
|
+
/** Additional CSS classes */
|
|
8
13
|
class?: string;
|
|
9
14
|
}
|
|
10
|
-
declare const Icon: import("svelte").Component<
|
|
15
|
+
declare const Icon: import("svelte").Component<IconProps, {}, "">;
|
|
11
16
|
type Icon = ReturnType<typeof Icon>;
|
|
12
17
|
export default Icon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-cube-send"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M16 12.5l-5 -3l5 -3l5 3v5.5l-5 3l0 -5.5" /><path d="M11 9.5v5.5l5 3" /><path d="M16 12.545l5 -3.03" /><path d="M7 9h-5" /><path d="M7 12h-3" /><path d="M7 15h-1" /></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-bmp"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M18 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"></path><path d="M4 21h1.5a1.5 1.5 0 0 0 0 -3h-1.5h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"></path><path d="M10 21v-6l2.5 3l2.5 -3v6"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-csv"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M7 16.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0"></path><path d="M10 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"></path><path d="M16 15l2 6l2 -6"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-doc"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M5 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1"></path><path d="M20 16.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0"></path><path d="M12.5 15a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1 -3 0v-3a1.5 1.5 0 0 1 1.5 -1.5"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-docx"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M2 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1"></path><path d="M17 16.5a1.5 1.5 0 0 0 -3 0v3a1.5 1.5 0 0 0 3 0"></path><path d="M9.5 15a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1 -3 0v-3a1.5 1.5 0 0 1 1.5 -1.5"></path><path d="M19.5 15l3 6"></path><path d="M19.5 21l3 -6"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-jpg"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M11 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"></path><path d="M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"></path><path d="M5 15h3v4.5a1.5 1.5 0 0 1 -3 0"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-pdf"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"></path><path d="M17 18h2"></path><path d="M20 15h-3v6"></path><path d="M11 15v6h1a2 2 0 0 0 2 -2v-2a2 2 0 0 0 -2 -2h-1"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-png"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"></path><path d="M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"></path><path d="M11 21v-6l3 6v-6"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-ppt"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M5 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"></path><path d="M11 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"></path><path d="M16.5 15h3"></path><path d="M18 15v6"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-svg"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M4 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"></path><path d="M10 15l2 6l2 -6"></path><path d="M20 15h-1a2 2 0 0 0 -2 2v2a2 2 0 0 0 2 2h1v-3"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-txt"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M16.5 15h3"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M4.5 15h3"></path><path d="M6 15v6"></path><path d="M18 15v6"></path><path d="M10 15l4 6"></path><path d="M10 21l4 -6"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-xls"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M4 15l4 6"></path><path d="M4 21l4 -6"></path><path d="M17 20.25c0 .414 .336 .75 .75 .75h1.25a1 1 0 0 0 1 -1v-1a1 1 0 0 0 -1 -1h-1a1 1 0 0 1 -1 -1v-1a1 1 0 0 1 1 -1h1.25a.75 .75 0 0 1 .75 .75"></path><path d="M11 15v6h3"></path></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file-type-zip"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M5 12v-7a2 2 0 0 1 2 -2h7l5 5v4"></path><path d="M16 18h1.5a1.5 1.5 0 0 0 0 -3h-1.5v6"></path><path d="M12 15v6"></path><path d="M5 15h3l-3 6h3"></path></svg>
|