@likable-hair/svelte 3.2.12 → 3.3.1

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 (43) hide show
  1. package/dist/components/composed/common/MenuOrDrawer.svelte +2 -1
  2. package/dist/components/composed/common/MenuOrDrawer.svelte.d.ts +1 -0
  3. package/dist/components/composed/common/QuickActions.css +12 -0
  4. package/dist/components/composed/common/QuickActions.svelte +362 -0
  5. package/dist/components/composed/common/QuickActions.svelte.d.ts +37 -0
  6. package/dist/components/composed/forms/ConfirmOrCancelButtons.svelte +5 -0
  7. package/dist/components/composed/forms/CountriesAutocomplete.svelte +1 -2
  8. package/dist/components/composed/forms/CountriesAutocomplete.svelte.d.ts +1 -0
  9. package/dist/components/composed/forms/LabelAndSelect.svelte +66 -0
  10. package/dist/components/composed/forms/LabelAndSelect.svelte.d.ts +38 -0
  11. package/dist/components/composed/forms/LabelAndTextField.svelte +87 -0
  12. package/dist/components/composed/forms/LabelAndTextField.svelte.d.ts +44 -0
  13. package/dist/components/composed/list/DynamicTable.css +18 -0
  14. package/dist/components/composed/list/DynamicTable.svelte +1717 -0
  15. package/dist/components/composed/list/DynamicTable.svelte.d.ts +406 -0
  16. package/dist/components/composed/search/DynamicFilters.svelte +182 -0
  17. package/dist/components/composed/search/DynamicFilters.svelte.d.ts +29 -0
  18. package/dist/components/composed/search/FilterEditor.svelte +12 -8
  19. package/dist/components/composed/search/Filters.svelte +18 -3
  20. package/dist/components/composed/search/Filters.svelte.d.ts +3 -2
  21. package/dist/components/composed/search/MobileFilterEditor.svelte +5 -5
  22. package/dist/components/simple/common/Divider.css +3 -0
  23. package/dist/components/simple/common/Divider.svelte +13 -0
  24. package/dist/components/simple/common/Divider.svelte.d.ts +22 -0
  25. package/dist/components/simple/common/InfiniteScroll.svelte +37 -0
  26. package/dist/components/simple/common/InfiniteScroll.svelte.d.ts +21 -0
  27. package/dist/components/simple/common/VerticalDraggableList.svelte +52 -0
  28. package/dist/components/simple/common/VerticalDraggableList.svelte.d.ts +34 -0
  29. package/dist/components/simple/forms/Checkbox.svelte +24 -1
  30. package/dist/components/simple/forms/Checkbox.svelte.d.ts +3 -1
  31. package/dist/components/simple/forms/Select.css +14 -0
  32. package/dist/components/simple/forms/Select.svelte +92 -0
  33. package/dist/components/simple/forms/Select.svelte.d.ts +28 -0
  34. package/dist/components/simple/forms/Switch.css +14 -0
  35. package/dist/components/simple/forms/Switch.svelte +85 -72
  36. package/dist/components/simple/forms/Switch.svelte.d.ts +7 -10
  37. package/dist/index.d.ts +7 -0
  38. package/dist/index.js +7 -0
  39. package/dist/utils/filters/filters.d.ts +11 -7
  40. package/dist/utils/filters/filters.js +15 -3
  41. package/dist/utils/filters/quickFilters.d.ts +109 -0
  42. package/dist/utils/filters/quickFilters.js +1 -0
  43. package/package.json +3 -2
@@ -2,7 +2,7 @@
2
2
  import Drawer from "../../simple/navigation/Drawer.svelte";
3
3
  import Menu from "../../simple/common/Menu.svelte";
4
4
  import MediaQuery from "../../simple/common/MediaQuery.svelte";
5
- export let open = false, activator, drawerPosition = "bottom", menuAnchor = "bottom-center", stayInViewport = true, flipOnOverflow = false, _boxShadow = "rgb(var(--global-color-grey-900), .5) 0px 2px 4px", _height = "fit-content", _width = void 0, _maxHeight = void 0, _minWidth = "100px", _borderRadius = "5px", openingId = void 0;
5
+ export let open = false, activator, drawerPosition = "bottom", menuAnchor = "bottom-center", stayInViewport = true, flipOnOverflow = false, _boxShadow = "rgb(var(--global-color-grey-900), .5) 0px 2px 4px", _height = "fit-content", _width = void 0, _maxHeight = void 0, _minWidth = "100px", _borderRadius = "5px", openingId = void 0, _drawerOverflow = void 0;
6
6
  </script>
7
7
 
8
8
  <MediaQuery let:mAndDown>
@@ -12,6 +12,7 @@ export let open = false, activator, drawerPosition = "bottom", menuAnchor = "bot
12
12
  bind:position={drawerPosition}
13
13
  on:close
14
14
  on:item-click
15
+ _overflow={_drawerOverflow}
15
16
  >
16
17
  <slot isDrawer={true} isMenu={false}></slot>
17
18
  </Drawer>
@@ -18,6 +18,7 @@ declare const __propDef: {
18
18
  _minWidth?: string | undefined;
19
19
  _borderRadius?: string | undefined;
20
20
  openingId?: ComponentProps<Menu>['openingId'];
21
+ _drawerOverflow?: string | undefined;
21
22
  };
22
23
  events: {
23
24
  close: CustomEvent<{}>;
@@ -0,0 +1,12 @@
1
+ :root {
2
+ --quick-actions-default-background-color: rgb(var(--global-color-background-200));
3
+ --quick-actions-default-selected-items-button-background-color: rgb(var(--global-color-background-500));
4
+ --quick-actions-default-selected-items-button-background-color-hover: rgb(var(--global-color-background-300));
5
+ --quick-actions-default-z-index: 48;
6
+
7
+ --quick-actions-default-buttons-background-color: var(--quick-actions-background-color, var(--quick-actions-default-background-color));
8
+ --quick-actions-default-buttons-background-color-disabled: rgb(var(--global-color-background-300), .5);
9
+ --quick-actions-default-buttons-background-color-hover: rgb(var(--global-color-background-300));
10
+ --quick-actions-default-buttons-color: rgb(var(--global-color-contrast-900));
11
+ --quick-actions-default-buttons-color-disabled: rgb(var(--global-color-contrast-900), .5)
12
+ }
@@ -0,0 +1,362 @@
1
+ <script context="module"></script>
2
+
3
+ <script>import { Button, Icon, mediaQuery, ToolTip } from "../../..";
4
+ import DynamicTable from "../list/DynamicTable.svelte";
5
+ import { fly } from "svelte/transition";
6
+ import { cubicIn } from "svelte/easing";
7
+ import MenuOrDrawer from "./MenuOrDrawer.svelte";
8
+ import "./QuickActions.css";
9
+ export let selectedItems, showSelectContainer, isSelectedAll, totalRows, slotSelectActionsContainer, disabled, loading, actionsForSelectedItems, position = "top";
10
+ let actions = [], extraActions = [], moreActionsActivator, openMoreActions = false, infoActivators = {}, disabledInfoActivators = {};
11
+ $: {
12
+ if (!!slotSelectActionsContainer) {
13
+ let numberOfSplit = $mediaQuery.xl ? 5 : $mediaQuery.l ? 5 : $mediaQuery.m ? 2 : $mediaQuery.s ? 0 : $mediaQuery.xs ? 0 : 3;
14
+ if (actionsForSelectedItems.length > numberOfSplit) {
15
+ extraActions = actionsForSelectedItems.slice(numberOfSplit);
16
+ actions = actionsForSelectedItems.slice(0, numberOfSplit);
17
+ } else {
18
+ actions = actionsForSelectedItems;
19
+ extraActions = [];
20
+ }
21
+ }
22
+ }
23
+ </script>
24
+
25
+ {#if selectedItems && selectedItems.length > 0 && showSelectContainer}
26
+ <div
27
+ class="container-{position}"
28
+ transition:fly={{ delay: 150, duration: 150, y: -10, easing: cubicIn }}
29
+ >
30
+ <div
31
+ class="select-container"
32
+ >
33
+ <div>
34
+ <button class="select-info" on:click={() => (selectedItems = [], infoActivators = {}, disabledInfoActivators = {})}>
35
+ {!!isSelectedAll ? totalRows : selectedItems.length} items selected
36
+ <Icon name="mdi-close" />
37
+ </button>
38
+ </div>
39
+ <div class="select-actions-container">
40
+ <div class="select-actions" bind:this={slotSelectActionsContainer}>
41
+ {#each actions as action}
42
+ <Button
43
+ style='
44
+ --button-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
45
+ --button-active-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
46
+ --button-focus-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
47
+ --button-hover-background-color: var(--quick-actions-buttons-background-color-hover, var(--quick-actions-default-buttons-background-color-hover));
48
+ --button-disabled-background-color: var(--quick-actions-buttons-background-color-disabled, var(--quick-actions-default-buttons-background-color-disabled));
49
+ --button-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
50
+ --button-hover-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
51
+ --button-focus-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
52
+ --button-disabled-color: var(--quick-actions-buttons-color-disabled, var(--quick-actions-default-buttons-color-disabled));
53
+ --button-box-shadow: none;
54
+ '
55
+ --button-height="20px"
56
+ disabled={action.disabled}
57
+ on:click={action.onClick}
58
+ >
59
+ <div class="action" bind:this={disabledInfoActivators[action.label]}>
60
+ {#if action.icon}
61
+ <Icon name={action.icon} --icon-size='16px'/>
62
+ {/if}
63
+ {#if !!action.info && !action.disabled}
64
+ <div bind:this={infoActivators[action.label]}>
65
+ <Icon
66
+ name="mdi-help-circle-outline"
67
+ --icon-size="16px"
68
+ />
69
+ </div>
70
+ <ToolTip
71
+ appearTimeout={1000}
72
+ activator={infoActivators[action.label]}
73
+ >
74
+ <div
75
+ style:background-color='rgb(var(--global-color-background-300), .95)'
76
+ style:border-radius="5px"
77
+ style:padding="10px"
78
+ style:color='rgb(var(--global-color-contrast-900))'
79
+ >
80
+ {action.info}
81
+ </div>
82
+ </ToolTip>
83
+ {/if}
84
+ {action.label}
85
+ {#if !!action.disabledInfo && action.disabled}
86
+ <ToolTip
87
+ appearTimeout={1000}
88
+ activator={disabledInfoActivators[action.label]}
89
+ >
90
+ <div
91
+ style:background-color='rgb(var(--global-color-background-300), .95)'
92
+ style:border-radius="5px"
93
+ style:padding="10px"
94
+ style:color='rgb(var(--global-color-contrast-900))'
95
+ >
96
+ {action.disabledInfo}
97
+ </div>
98
+ </ToolTip>
99
+ {/if}
100
+ </div>
101
+ </Button>
102
+ {/each}
103
+
104
+ {#if extraActions.length > 0}
105
+ <div id="more-actions" bind:this={moreActionsActivator}>
106
+ <Button
107
+ style='
108
+ --button-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
109
+ --button-active-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
110
+ --button-focus-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
111
+ --button-hover-background-color: var(--quick-actions-buttons-background-color-hover, var(--quick-actions-default-buttons-background-color-hover));
112
+ --button-disabled-background-color: var(--quick-actions-buttons-background-color-disabled, var(--quick-actions-default-buttons-background-color-disabled));
113
+ --button-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
114
+ --button-hover-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
115
+ --button-focus-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
116
+ --button-disabled-color: var(--quick-actions-buttons-color-disabled, var(--quick-actions-default-buttons-color-disabled));
117
+ --button-box-shadow: none;
118
+ margin-left: 8px;
119
+ '
120
+ --button-height="20px"
121
+ disabled={disabled || loading}
122
+ on:click={(e) => {
123
+ openMoreActions = !openMoreActions;
124
+ }}
125
+ >
126
+ <div class="action">
127
+ <Icon name="mdi-dots-vertical" />
128
+ More
129
+ </div>
130
+ </Button>
131
+ </div>
132
+ {/if}
133
+ </div>
134
+ </div>
135
+ </div>
136
+ </div>
137
+ {/if}
138
+
139
+ {#if moreActionsActivator}
140
+ <div class="menu-or-drawer">
141
+ <MenuOrDrawer
142
+ bind:open={openMoreActions}
143
+ activator={moreActionsActivator}
144
+ drawerPosition={position == 'bottom' ? 'top' : 'bottom'}
145
+ menuAnchor='bottom-center'
146
+ openingId='more-actions'
147
+ _drawerOverflow='hidden'
148
+ let:isMenu
149
+ let:isDrawer
150
+ >
151
+ <div
152
+ class:more-actions-container-menu={isMenu}
153
+ class:more-actions-container-drawer={isDrawer}
154
+ class:more-actions-container-bottom={isMenu && position == 'bottom'}
155
+ >
156
+ {#each extraActions as action}
157
+ <Button
158
+ style='
159
+ --button-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
160
+ --button-active-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
161
+ --button-focus-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
162
+ --button-hover-background-color: var(--quick-actions-buttons-background-color-hover, var(--quick-actions-default-buttons-background-color-hover));
163
+ --button-disabled-background-color: var(--quick-actions-buttons-background-color-disabled, var(--quick-actions-default-buttons-background-color-disabled));
164
+ --button-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
165
+ --button-hover-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
166
+ --button-focus-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
167
+ --button-disabled-color: var(--quick-actions-buttons-color-disabled, var(--quick-actions-default-buttons-color-disabled));
168
+ --button-box-shadow: none;
169
+ '
170
+ --button-height="35px"
171
+ disabled={action.disabled}
172
+ on:click={action.onClick}
173
+ >
174
+ <div class="action" bind:this={disabledInfoActivators[action.label]}>
175
+ {#if action.icon}
176
+ <Icon name={action.icon} --icon-size='16px'/>
177
+ {/if}
178
+ {#if !!action.info && !action.disabled}
179
+ <div bind:this={infoActivators[action.label]}>
180
+ <Icon
181
+ name="mdi-help-circle-outline"
182
+ --icon-size="16px"
183
+ />
184
+ </div>
185
+ <ToolTip
186
+ appearTimeout={1000}
187
+ activator={infoActivators[action.label]}
188
+ >
189
+ <div
190
+ style:background-color='rgb(var(--global-color-background-300), .95)'
191
+ style:border-radius="5px"
192
+ style:padding="10px"
193
+ style:color='rgb(var(--global-color-contrast-900))'
194
+ >
195
+ {action.info}
196
+ </div>
197
+ </ToolTip>
198
+ {/if}
199
+ {action.label}
200
+ {#if !!action.disabledInfo && action.disabled}
201
+ <ToolTip
202
+ appearTimeout={1000}
203
+ activator={disabledInfoActivators[action.label]}
204
+ >
205
+ <div
206
+ style:background-color='rgb(var(--global-color-background-300), .95)'
207
+ style:border-radius="5px"
208
+ style:padding="10px"
209
+ style:color='rgb(var(--global-color-contrast-900))'
210
+ >
211
+ {action.disabledInfo}
212
+ </div>
213
+ </ToolTip>
214
+ {/if}
215
+ </div>
216
+ </Button>
217
+ {/each}
218
+ </div>
219
+ </MenuOrDrawer>
220
+ </div>
221
+ {/if}
222
+
223
+ <style>
224
+ .container-top, .container-bottom {
225
+ position: fixed;
226
+ z-index: var(
227
+ --quick-actions-z-index,
228
+ var(--quick-actions-default-z-index)
229
+ );
230
+ width: 100%;
231
+ }
232
+
233
+ .container-top {
234
+ top: 16px;
235
+ }
236
+
237
+ .container-bottom {
238
+ bottom: 64px;
239
+ }
240
+
241
+ @media (max-width: 1025px) {
242
+ .container-top, .container-bottom {
243
+ position: fixed;
244
+ z-index: 48;
245
+ width: 80%;
246
+ }
247
+
248
+ .container-top {
249
+ top: 16px;
250
+ }
251
+
252
+ .container-bottom {
253
+ bottom: 64px;
254
+ }
255
+ }
256
+
257
+ .select-container {
258
+ display: flex;
259
+ width: 80%;
260
+ height: fit-content;
261
+ background-color: var(
262
+ --quick-actions-background-color,
263
+ var(--quick-actions-default-background-color)
264
+ );
265
+ border-radius: 8px;
266
+ padding: 5px;
267
+ margin-bottom: 10px;
268
+ }
269
+
270
+ .select-info {
271
+ height: 35px;
272
+ padding: 0 10px;
273
+ border-radius: 8px;
274
+ border: none;
275
+ background-color: var(
276
+ --quick-actions-selected-items-button-background-color,
277
+ var(--quick-actions-default-selected-items-button-background-color)
278
+ );
279
+ color: rgb(var(--global-color-contrast-900))
280
+ }
281
+
282
+ .select-info:hover {
283
+ background-color: var(
284
+ --quick-actions-selected-items-button-background-color-hover,
285
+ var(--quick-actions-default-selected-items-button-background-color-hover)
286
+ );
287
+ }
288
+
289
+ .select-actions-container {
290
+ align-items: center;
291
+ display: flex;
292
+ flex: 1;
293
+ overflow: hidden;
294
+ }
295
+
296
+ .select-actions {
297
+ display: flex;
298
+ margin: 0 8px;
299
+ justify-content: flex-end;
300
+ width: 100%;
301
+ gap: 8px;
302
+ }
303
+
304
+ .action {
305
+ display: flex;
306
+ justify-content: center;
307
+ gap: 4px;
308
+ }
309
+
310
+ .menu-or-drawer {
311
+ z-index: 50;
312
+ }
313
+
314
+ .more-actions-container-menu {
315
+ display: grid;
316
+ grid-template-columns: 1fr;
317
+ justify-content: center;
318
+ align-items: center;
319
+ box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
320
+ position: fixed;
321
+ padding: 10px;
322
+ border-radius: 10px;
323
+ background-color: var(
324
+ --quick-actions-background-color,
325
+ var(--quick-actions-default-background-color)
326
+ );
327
+ gap: 15px;
328
+ left: 79dvw;
329
+ }
330
+
331
+ .more-actions-container-drawer {
332
+ display: flex;
333
+ flex-direction: column;
334
+ gap: 8px;
335
+ justify-content: center;
336
+ align-items: center;
337
+ --button-width: 100%;
338
+ }
339
+
340
+ .more-actions-container-bottom {
341
+ bottom: 121px;
342
+ }
343
+
344
+ @media (max-width: 1500px) {
345
+ .more-actions-container-menu {
346
+ display: grid;
347
+ grid-template-columns: 1fr;
348
+ justify-content: center;
349
+ align-items: center;
350
+ box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
351
+ position: fixed;
352
+ padding: 10px;
353
+ border-radius: 10px;
354
+ background-color: var(
355
+ --quick-actions-background-color,
356
+ var(--quick-actions-default-background-color)
357
+ );
358
+ gap: 15px;
359
+ left: 73dvw;
360
+ }
361
+ }
362
+ </style>
@@ -0,0 +1,37 @@
1
+ import { SvelteComponent } from "svelte";
2
+ export type Action = {
3
+ label: string;
4
+ icon?: string;
5
+ disabled?: boolean;
6
+ info?: string;
7
+ disabledInfo?: string;
8
+ onClick: (e: CustomEvent<{
9
+ nativeEvent: MouseEvent;
10
+ }>) => void;
11
+ };
12
+ import type { ComponentProps } from "svelte";
13
+ import DynamicTable from "../list/DynamicTable.svelte";
14
+ import './QuickActions.css';
15
+ declare const __propDef: {
16
+ props: {
17
+ selectedItems: ComponentProps<DynamicTable["selectedItems"]>[];
18
+ showSelectContainer: boolean;
19
+ isSelectedAll: boolean;
20
+ totalRows: number;
21
+ slotSelectActionsContainer: HTMLElement | undefined;
22
+ disabled: boolean;
23
+ loading: boolean;
24
+ actionsForSelectedItems: Action[];
25
+ position?: "bottom" | "top" | undefined;
26
+ };
27
+ events: {
28
+ [evt: string]: CustomEvent<any>;
29
+ };
30
+ slots: {};
31
+ };
32
+ export type QuickActionsProps = typeof __propDef.props;
33
+ export type QuickActionsEvents = typeof __propDef.events;
34
+ export type QuickActionsSlots = typeof __propDef.slots;
35
+ export default class QuickActions extends SvelteComponent<QuickActionsProps, QuickActionsEvents, QuickActionsSlots> {
36
+ }
37
+ export {};
@@ -69,6 +69,11 @@ import Button from "../../simple/buttons/Button.svelte";
69
69
  padding: 0;
70
70
  background-color: transparent;
71
71
  background-image: none;
72
+ border: none;
73
+ }
74
+
75
+ .text-button:hover {
76
+ cursor: pointer;
72
77
  }
73
78
 
74
79
  .button-container {
@@ -4,8 +4,7 @@ import { countriesOptions } from "../../../utils/countries";
4
4
  import FlagIcon from "../../simple/media/FlagIcon.svelte";
5
5
  let clazz = {};
6
6
  export { clazz as class };
7
- export let autocompleteProps = {}, selected = [];
8
- let items = countriesOptions;
7
+ export let autocompleteProps = {}, selected = [], items = countriesOptions;
9
8
  </script>
10
9
 
11
10
  <Autocomplete
@@ -40,6 +40,7 @@ declare const __propDef: {
40
40
  menuWidth?: string | null | undefined;
41
41
  }, "items"> | undefined;
42
42
  selected?: Item[] | undefined;
43
+ items?: Item[] | undefined;
43
44
  };
44
45
  events: {
45
46
  blur: FocusEvent;
@@ -0,0 +1,66 @@
1
+ <script context="module"></script>
2
+
3
+ <script>import { Icon, ToolTip } from "../../..";
4
+ import Select from "../../simple/forms/Select.svelte";
5
+ let clazz = {};
6
+ export { clazz as class };
7
+ export let value = void 0, label, description = void 0, info = void 0, name, options, disabled = false, orientation = "vertical";
8
+ let infoActivator;
9
+ </script>
10
+
11
+ <div
12
+ style:display={orientation === 'horizontal' ? 'grid' : 'block'}
13
+ style:grid-template-columns="1fr 1fr"
14
+ style:gap="15px"
15
+ >
16
+ <div
17
+ style:grid-column="1"
18
+ style:grid-row="1"
19
+ >
20
+ <div
21
+ bind:this={infoActivator}
22
+ >
23
+ <label
24
+ style:font-weight="500"
25
+ style:margin-left="4px"
26
+ for={name}
27
+ class={clazz.label}
28
+ >
29
+ {label || ''}
30
+ </label>
31
+ {#if !!info}
32
+ <Icon
33
+ name="mdi-help-circle-outline"
34
+ --icon-size="16px"
35
+ />
36
+ {/if}
37
+ </div>
38
+ <div
39
+ style:font-weight="200"
40
+ >
41
+ {description || ''}
42
+ </div>
43
+ {#if !!info}
44
+ <ToolTip
45
+ appearTimeout={1000}
46
+ activator={infoActivator}
47
+ >
48
+ <div
49
+ style:background-color='rgb(var(--global-color-background-600), .95)'
50
+ style:border-radius="5px"
51
+ style:padding="10px"
52
+ >
53
+ {info}
54
+ </div>
55
+ </ToolTip>
56
+ {/if}
57
+ </div>
58
+
59
+ <div
60
+ style:margin-top="8px"
61
+ style:grid-column="2"
62
+ style:grid-row="1"
63
+ >
64
+ <Select bind:value {options} {disabled} on:change />
65
+ </div>
66
+ </div>
@@ -0,0 +1,38 @@
1
+ import { SvelteComponent } from "svelte";
2
+ export type Option = {
3
+ icon?: string;
4
+ value: string | number | undefined;
5
+ text: string;
6
+ };
7
+ declare const __propDef: {
8
+ props: {
9
+ class?: {
10
+ label?: string | undefined;
11
+ input?: {
12
+ container?: string | undefined;
13
+ row?: string | undefined;
14
+ input?: string | undefined;
15
+ } | undefined;
16
+ } | undefined;
17
+ value?: string | number | undefined;
18
+ label: string;
19
+ description?: string | undefined;
20
+ info?: string | undefined;
21
+ name: string;
22
+ options: Option[];
23
+ disabled?: boolean | undefined;
24
+ orientation?: "horizontal" | "vertical" | undefined;
25
+ };
26
+ events: {
27
+ change: Event;
28
+ } & {
29
+ [evt: string]: CustomEvent<any>;
30
+ };
31
+ slots: {};
32
+ };
33
+ export type LabelAndSelectProps = typeof __propDef.props;
34
+ export type LabelAndSelectEvents = typeof __propDef.events;
35
+ export type LabelAndSelectSlots = typeof __propDef.slots;
36
+ export default class LabelAndSelect extends SvelteComponent<LabelAndSelectProps, LabelAndSelectEvents, LabelAndSelectSlots> {
37
+ }
38
+ export {};
@@ -0,0 +1,87 @@
1
+ <script>import { Icon, ToolTip, SimpleTextField } from "../../..";
2
+ let clazz = {};
3
+ export { clazz as class };
4
+ export let value = void 0, label = void 0, description = void 0, info = void 0, placeholder = "", name, type = "text", readonly = false, error = false, errorText = "", disabled = false, orientation = "vertical";
5
+ let infoActivator;
6
+ </script>
7
+
8
+ <div
9
+ style:display={orientation === 'horizontal' ? 'grid' : 'block'}
10
+ style:grid-template-columns="1fr 1fr"
11
+ style:gap="15px"
12
+ >
13
+ {#if !!label}
14
+ <div
15
+ style:grid-column="1"
16
+ style:grid-row="1"
17
+ >
18
+ <div
19
+ bind:this={infoActivator}
20
+ >
21
+ <label
22
+ style:font-weight="500"
23
+ style:margin-left="4px"
24
+ for={name}
25
+ class={clazz.label}
26
+ >
27
+ {label || ''}
28
+ </label>
29
+ {#if !!info}
30
+ <Icon
31
+ name="mdi-help-circle-outline"
32
+ --icon-size="16px"
33
+ />
34
+ {/if}
35
+ </div>
36
+ <div
37
+ style:font-weight="200"
38
+ >
39
+ {description || ''}
40
+ </div>
41
+ {#if !!info}
42
+ <ToolTip
43
+ appearTimeout={1000}
44
+ activator={infoActivator}
45
+ >
46
+ <div
47
+ style:background-color='rgb(var(--global-color-background-600), .95)'
48
+ style:border-radius="5px"
49
+ style:padding="10px"
50
+ >
51
+ {info}
52
+ </div>
53
+ </ToolTip>
54
+ {/if}
55
+ </div>
56
+ {/if}
57
+
58
+ <div
59
+ style:margin-top="8px"
60
+ style:grid-column="2"
61
+ style:grid-row="1"
62
+ >
63
+ <SimpleTextField
64
+ bind:value
65
+ {type}
66
+ {readonly}
67
+ {errorText}
68
+ bind:error
69
+ {disabled}
70
+ {placeholder}
71
+ on:input
72
+ on:focus
73
+ on:keydown
74
+ class={clazz.input}
75
+ --simple-textfield-border={error ? "1px solid red" : "0"}
76
+ >
77
+ <svelte:fragment slot="prepend-inner">
78
+ <slot name="prepend-inner" />
79
+ </svelte:fragment>
80
+ <svelte:fragment slot="append-inner">
81
+ <slot name="append-inner" />
82
+ </svelte:fragment>
83
+ </SimpleTextField>
84
+ </div>
85
+ </div>
86
+
87
+