@likable-hair/svelte 3.2.11 → 3.3.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.
Files changed (44) 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 +11 -0
  4. package/dist/components/composed/common/QuickActions.svelte +364 -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/dates/DatePicker.svelte +2 -2
  30. package/dist/components/simple/forms/Checkbox.svelte +24 -1
  31. package/dist/components/simple/forms/Checkbox.svelte.d.ts +3 -1
  32. package/dist/components/simple/forms/Select.css +14 -0
  33. package/dist/components/simple/forms/Select.svelte +92 -0
  34. package/dist/components/simple/forms/Select.svelte.d.ts +28 -0
  35. package/dist/components/simple/forms/Switch.css +14 -0
  36. package/dist/components/simple/forms/Switch.svelte +85 -72
  37. package/dist/components/simple/forms/Switch.svelte.d.ts +7 -10
  38. package/dist/index.d.ts +7 -0
  39. package/dist/index.js +7 -0
  40. package/dist/utils/filters/filters.d.ts +11 -7
  41. package/dist/utils/filters/filters.js +15 -3
  42. package/dist/utils/filters/quickFilters.d.ts +109 -0
  43. package/dist/utils/filters/quickFilters.js +1 -0
  44. 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,11 @@
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
+ }
@@ -0,0 +1,364 @@
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);
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, var(--quick-actions-default-buttons-color));
117
+ --button-disabled-color: var(--quick-actions-buttons-color-disabled);
118
+ --button-box-shadow: none;
119
+ margin-left: 8px;
120
+ '
121
+ --button-height="20px"
122
+ disabled={disabled || loading}
123
+ on:click={(e) => {
124
+ openMoreActions = !openMoreActions;
125
+ }}
126
+ >
127
+ <div class="action">
128
+ <Icon name="mdi-dots-vertical" />
129
+ More
130
+ </div>
131
+ </Button>
132
+ </div>
133
+ {/if}
134
+ </div>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ {/if}
139
+
140
+ {#if moreActionsActivator}
141
+ <div class="menu-or-drawer">
142
+ <MenuOrDrawer
143
+ bind:open={openMoreActions}
144
+ activator={moreActionsActivator}
145
+ drawerPosition={position == 'bottom' ? 'top' : 'bottom'}
146
+ menuAnchor='bottom-center'
147
+ openingId='more-actions'
148
+ _drawerOverflow='hidden'
149
+ let:isMenu
150
+ let:isDrawer
151
+ >
152
+ <div
153
+ class:more-actions-container-menu={isMenu}
154
+ class:more-actions-container-drawer={isDrawer}
155
+ class:more-actions-container-bottom={isMenu && position == 'bottom'}
156
+ >
157
+ {#each extraActions as action}
158
+ <Button
159
+ style='
160
+ --button-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
161
+ --button-active-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
162
+ --button-focus-background-color: var(--quick-actions-buttons-background-color, var(--quick-actions-default-buttons-background-color));
163
+ --button-hover-background-color: var(--quick-actions-buttons-background-color-hover, var(--quick-actions-default-buttons-background-color-hover));
164
+ --button-disabled-background-color: var(--quick-actions-buttons-background-color-disabled, var(--quick-actions-default-buttons-background-color-disabled));
165
+ --button-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
166
+ --button-hover-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
167
+ --button-focus-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
168
+ --button-disabled-color: var(--quick-actions-buttons-color, var(--quick-actions-default-buttons-color));
169
+ --button-disabled-color: var(--quick-actions-buttons-color-disabled);
170
+ --button-box-shadow: none;
171
+ '
172
+ --button-height="35px"
173
+ disabled={action.disabled}
174
+ on:click={action.onClick}
175
+ >
176
+ <div class="action" bind:this={disabledInfoActivators[action.label]}>
177
+ {#if action.icon}
178
+ <Icon name={action.icon} --icon-size='16px'/>
179
+ {/if}
180
+ {#if !!action.info && !action.disabled}
181
+ <div bind:this={infoActivators[action.label]}>
182
+ <Icon
183
+ name="mdi-help-circle-outline"
184
+ --icon-size="16px"
185
+ />
186
+ </div>
187
+ <ToolTip
188
+ appearTimeout={1000}
189
+ activator={infoActivators[action.label]}
190
+ >
191
+ <div
192
+ style:background-color='rgb(var(--global-color-background-300), .95)'
193
+ style:border-radius="5px"
194
+ style:padding="10px"
195
+ style:color='rgb(var(--global-color-contrast-900))'
196
+ >
197
+ {action.info}
198
+ </div>
199
+ </ToolTip>
200
+ {/if}
201
+ {action.label}
202
+ {#if !!action.disabledInfo && action.disabled}
203
+ <ToolTip
204
+ appearTimeout={1000}
205
+ activator={disabledInfoActivators[action.label]}
206
+ >
207
+ <div
208
+ style:background-color='rgb(var(--global-color-background-300), .95)'
209
+ style:border-radius="5px"
210
+ style:padding="10px"
211
+ style:color='rgb(var(--global-color-contrast-900))'
212
+ >
213
+ {action.disabledInfo}
214
+ </div>
215
+ </ToolTip>
216
+ {/if}
217
+ </div>
218
+ </Button>
219
+ {/each}
220
+ </div>
221
+ </MenuOrDrawer>
222
+ </div>
223
+ {/if}
224
+
225
+ <style>
226
+ .container-top, .container-bottom {
227
+ position: fixed;
228
+ z-index: var(
229
+ --quick-actions-z-index,
230
+ var(--quick-actions-default-z-index)
231
+ );
232
+ width: 100%;
233
+ }
234
+
235
+ .container-top {
236
+ top: 16px;
237
+ }
238
+
239
+ .container-bottom {
240
+ bottom: 64px;
241
+ }
242
+
243
+ @media (max-width: 1025px) {
244
+ .container-top, .container-bottom {
245
+ position: fixed;
246
+ z-index: 48;
247
+ width: 80%;
248
+ }
249
+
250
+ .container-top {
251
+ top: 16px;
252
+ }
253
+
254
+ .container-bottom {
255
+ bottom: 64px;
256
+ }
257
+ }
258
+
259
+ .select-container {
260
+ display: flex;
261
+ width: 80%;
262
+ height: fit-content;
263
+ background-color: var(
264
+ --quick-actions-background-color,
265
+ var(--quick-actions-default-background-color)
266
+ );
267
+ border-radius: 8px;
268
+ padding: 5px;
269
+ margin-bottom: 10px;
270
+ }
271
+
272
+ .select-info {
273
+ height: 35px;
274
+ padding: 0 10px;
275
+ border-radius: 8px;
276
+ border: none;
277
+ background-color: var(
278
+ --quick-actions-selected-items-button-background-color,
279
+ var(--quick-actions-default-selected-items-button-background-color)
280
+ );
281
+ color: rgb(var(--global-color-contrast-900))
282
+ }
283
+
284
+ .select-info:hover {
285
+ background-color: var(
286
+ --quick-actions-selected-items-button-background-color-hover,
287
+ var(--quick-actions-default-selected-items-button-background-color-hover)
288
+ );
289
+ }
290
+
291
+ .select-actions-container {
292
+ align-items: center;
293
+ display: flex;
294
+ flex: 1;
295
+ overflow: hidden;
296
+ }
297
+
298
+ .select-actions {
299
+ display: flex;
300
+ margin: 0 8px;
301
+ justify-content: flex-end;
302
+ width: 100%;
303
+ gap: 8px;
304
+ }
305
+
306
+ .action {
307
+ display: flex;
308
+ justify-content: center;
309
+ gap: 4px;
310
+ }
311
+
312
+ .menu-or-drawer {
313
+ z-index: 50;
314
+ }
315
+
316
+ .more-actions-container-menu {
317
+ display: grid;
318
+ grid-template-columns: 1fr;
319
+ justify-content: center;
320
+ align-items: center;
321
+ box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
322
+ position: fixed;
323
+ padding: 10px;
324
+ border-radius: 10px;
325
+ background-color: var(
326
+ --quick-actions-background-color,
327
+ var(--quick-actions-default-background-color)
328
+ );
329
+ gap: 15px;
330
+ left: 79dvw;
331
+ }
332
+
333
+ .more-actions-container-drawer {
334
+ display: flex;
335
+ flex-direction: column;
336
+ gap: 8px;
337
+ justify-content: center;
338
+ align-items: center;
339
+ --button-width: 100%;
340
+ }
341
+
342
+ .more-actions-container-bottom {
343
+ bottom: 121px;
344
+ }
345
+
346
+ @media (max-width: 1500px) {
347
+ .more-actions-container-menu {
348
+ display: grid;
349
+ grid-template-columns: 1fr;
350
+ justify-content: center;
351
+ align-items: center;
352
+ box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.2);
353
+ position: fixed;
354
+ padding: 10px;
355
+ border-radius: 10px;
356
+ background-color: var(
357
+ --quick-actions-background-color,
358
+ var(--quick-actions-default-background-color)
359
+ );
360
+ gap: 15px;
361
+ left: 73dvw;
362
+ }
363
+ }
364
+ </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
+