@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.
- package/dist/components/composed/common/MenuOrDrawer.svelte +2 -1
- package/dist/components/composed/common/MenuOrDrawer.svelte.d.ts +1 -0
- package/dist/components/composed/common/QuickActions.css +11 -0
- package/dist/components/composed/common/QuickActions.svelte +364 -0
- package/dist/components/composed/common/QuickActions.svelte.d.ts +37 -0
- package/dist/components/composed/forms/ConfirmOrCancelButtons.svelte +5 -0
- package/dist/components/composed/forms/CountriesAutocomplete.svelte +1 -2
- package/dist/components/composed/forms/CountriesAutocomplete.svelte.d.ts +1 -0
- package/dist/components/composed/forms/LabelAndSelect.svelte +66 -0
- package/dist/components/composed/forms/LabelAndSelect.svelte.d.ts +38 -0
- package/dist/components/composed/forms/LabelAndTextField.svelte +87 -0
- package/dist/components/composed/forms/LabelAndTextField.svelte.d.ts +44 -0
- package/dist/components/composed/list/DynamicTable.css +18 -0
- package/dist/components/composed/list/DynamicTable.svelte +1717 -0
- package/dist/components/composed/list/DynamicTable.svelte.d.ts +406 -0
- package/dist/components/composed/search/DynamicFilters.svelte +182 -0
- package/dist/components/composed/search/DynamicFilters.svelte.d.ts +29 -0
- package/dist/components/composed/search/FilterEditor.svelte +12 -8
- package/dist/components/composed/search/Filters.svelte +18 -3
- package/dist/components/composed/search/Filters.svelte.d.ts +3 -2
- package/dist/components/composed/search/MobileFilterEditor.svelte +5 -5
- package/dist/components/simple/common/Divider.css +3 -0
- package/dist/components/simple/common/Divider.svelte +13 -0
- package/dist/components/simple/common/Divider.svelte.d.ts +22 -0
- package/dist/components/simple/common/InfiniteScroll.svelte +37 -0
- package/dist/components/simple/common/InfiniteScroll.svelte.d.ts +21 -0
- package/dist/components/simple/common/VerticalDraggableList.svelte +52 -0
- package/dist/components/simple/common/VerticalDraggableList.svelte.d.ts +34 -0
- package/dist/components/simple/dates/DatePicker.svelte +2 -2
- package/dist/components/simple/forms/Checkbox.svelte +24 -1
- package/dist/components/simple/forms/Checkbox.svelte.d.ts +3 -1
- package/dist/components/simple/forms/Select.css +14 -0
- package/dist/components/simple/forms/Select.svelte +92 -0
- package/dist/components/simple/forms/Select.svelte.d.ts +28 -0
- package/dist/components/simple/forms/Switch.css +14 -0
- package/dist/components/simple/forms/Switch.svelte +85 -72
- package/dist/components/simple/forms/Switch.svelte.d.ts +7 -10
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/utils/filters/filters.d.ts +11 -7
- package/dist/utils/filters/filters.js +15 -3
- package/dist/utils/filters/quickFilters.d.ts +109 -0
- package/dist/utils/filters/quickFilters.js +1 -0
- package/package.json +3 -2
|
@@ -8,6 +8,7 @@ import MediaQuery from "../../simple/common/MediaQuery.svelte";
|
|
|
8
8
|
import Button from "../../simple/buttons/Button.svelte";
|
|
9
9
|
import Icon from "../../simple/media/Icon.svelte";
|
|
10
10
|
import { createEventDispatcher } from "svelte";
|
|
11
|
+
import { isDateMode, isSelectMode, isStringMode } from "../../../utils/filters/filters";
|
|
11
12
|
import SelectableVerticalList from "../../simple/lists/SelectableVerticalList.svelte";
|
|
12
13
|
import Chip from "../../simple/navigation/Chip.svelte";
|
|
13
14
|
import FilterEditor from "./FilterEditor.svelte";
|
|
@@ -228,6 +229,8 @@ function handleRemoveAllFilters(e) {
|
|
|
228
229
|
singleFilterMenuOpened = false;
|
|
229
230
|
}
|
|
230
231
|
filters = filters;
|
|
232
|
+
tmpFilters = {};
|
|
233
|
+
customToBeInitialized = false;
|
|
231
234
|
dispatch("removeAllFilters");
|
|
232
235
|
}
|
|
233
236
|
function handleMultiEditApplyClick() {
|
|
@@ -252,13 +255,24 @@ function handleApplyMultiFilterClick() {
|
|
|
252
255
|
filters = filters;
|
|
253
256
|
handleMultiEditApplyClick();
|
|
254
257
|
}
|
|
255
|
-
function updateMultiFilterValues(filterName, newValue) {
|
|
258
|
+
function updateMultiFilterValues(filterName, newValue, newValid, mode) {
|
|
256
259
|
let filter = filters.find((f) => f.name === filterName);
|
|
257
260
|
if (!filter)
|
|
258
261
|
throw new Error("cannot find filter with name " + filterName);
|
|
259
262
|
if (!tmpFilters[filterName])
|
|
260
263
|
tmpFilters[filterName] = { ...filter };
|
|
261
264
|
let tmpFilter = tmpFilters[filterName];
|
|
265
|
+
if ("mode" in tmpFilter && !!mode) {
|
|
266
|
+
if (tmpFilter.type == "date" && isDateMode(mode)) {
|
|
267
|
+
tmpFilter.mode = mode;
|
|
268
|
+
} else if (tmpFilter.type == "number" && isDateMode(mode)) {
|
|
269
|
+
tmpFilter.mode = mode;
|
|
270
|
+
} else if (tmpFilter.type == "string" && isStringMode(mode)) {
|
|
271
|
+
tmpFilter.mode = mode;
|
|
272
|
+
} else if (tmpFilter.type == "select" && isSelectMode(mode)) {
|
|
273
|
+
tmpFilter.mode = mode;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
262
276
|
if (tmpFilter.type == "select") {
|
|
263
277
|
tmpFilter.values = newValue;
|
|
264
278
|
} else if ("mode" in tmpFilter && tmpFilter.mode == "between") {
|
|
@@ -267,6 +281,7 @@ function updateMultiFilterValues(filterName, newValue) {
|
|
|
267
281
|
} else {
|
|
268
282
|
tmpFilter.value = newValue;
|
|
269
283
|
}
|
|
284
|
+
tmpFilter.active = newValid;
|
|
270
285
|
}
|
|
271
286
|
let customToBeInitialized = true;
|
|
272
287
|
$:
|
|
@@ -512,7 +527,7 @@ let moreItemsActivator;
|
|
|
512
527
|
<h1>{addFilterLabel}</h1>
|
|
513
528
|
</div>
|
|
514
529
|
<div class="body">
|
|
515
|
-
<slot name="content" {mAndDown} {updateMultiFilterValues} {filters}>
|
|
530
|
+
<slot name="content" {mAndDown} {updateMultiFilterValues} {handleRemoveAllFilters} {filters}>
|
|
516
531
|
<div class="multi-filters-container" style:grid-template-columns={mAndDown ? '1fr' : '1fr 1fr'}>
|
|
517
532
|
{#each filters as filter, i}
|
|
518
533
|
<div class="filter">
|
|
@@ -680,7 +695,7 @@ let moreItemsActivator;
|
|
|
680
695
|
<h1>{addFilterLabel}</h1>
|
|
681
696
|
</div>
|
|
682
697
|
<div class="body">
|
|
683
|
-
<slot name="content" {mAndDown} {updateMultiFilterValues} {filters}>
|
|
698
|
+
<slot name="content" {mAndDown} {updateMultiFilterValues} {handleRemoveAllFilters} {filters}>
|
|
684
699
|
<div class="multi-filters-container" style:grid-template-columns={mAndDown ? '1fr' : '1fr 1fr'}>
|
|
685
700
|
{#each filters as filter, i}
|
|
686
701
|
<div class="filter" class:wide={filter.type === 'select' || filter.type === 'custom'}>
|
|
@@ -8,7 +8,7 @@ export type LabelMapper = {
|
|
|
8
8
|
};
|
|
9
9
|
import './Filters.css';
|
|
10
10
|
import '../../../css/main.css';
|
|
11
|
-
import type
|
|
11
|
+
import { type DateMode, type Filter, type NumberMode, type SelectMode, type StringMode } from '../../../utils/filters/filters';
|
|
12
12
|
import type { Locale } from '../../simple/dates/utils';
|
|
13
13
|
declare const __propDef: {
|
|
14
14
|
props: {
|
|
@@ -51,7 +51,8 @@ declare const __propDef: {
|
|
|
51
51
|
};
|
|
52
52
|
content: {
|
|
53
53
|
mAndDown: boolean;
|
|
54
|
-
updateMultiFilterValues: (filterName: string, newValue: any) => void;
|
|
54
|
+
updateMultiFilterValues: (filterName: string, newValue: any, newValid: boolean, mode?: NumberMode | StringMode | SelectMode | DateMode) => void;
|
|
55
|
+
handleRemoveAllFilters: (e?: MouseEvent) => void;
|
|
55
56
|
filters: Filter[];
|
|
56
57
|
};
|
|
57
58
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script>import {
|
|
1
|
+
<script>import { GENERIC_MODES, SELECT_MODES, STRING_MODES } from "../../../utils/filters/filters";
|
|
2
2
|
import SimpleTextField from "../../simple/forms/SimpleTextField.svelte";
|
|
3
3
|
import DatePickerTextField from "../forms/DatePickerTextField.svelte";
|
|
4
4
|
import Button from "../../simple/buttons/Button.svelte";
|
|
@@ -39,13 +39,13 @@ $:
|
|
|
39
39
|
if (!!tmpFilter) {
|
|
40
40
|
let modes;
|
|
41
41
|
if (tmpFilter.type == "string") {
|
|
42
|
-
modes =
|
|
42
|
+
modes = STRING_MODES;
|
|
43
43
|
} else if (tmpFilter.type == "date") {
|
|
44
|
-
modes =
|
|
44
|
+
modes = GENERIC_MODES;
|
|
45
45
|
} else if (tmpFilter.type == "number") {
|
|
46
|
-
modes =
|
|
46
|
+
modes = GENERIC_MODES;
|
|
47
47
|
} else if (tmpFilter.type == "select") {
|
|
48
|
-
modes =
|
|
48
|
+
modes = SELECT_MODES;
|
|
49
49
|
}
|
|
50
50
|
if (!!modes) {
|
|
51
51
|
advancedModeOptions = modes.map((mode) => {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script>import "./Divider.css";
|
|
2
|
+
export let weight = "1px", radius = "0.5px", marginTop = "10px", marginBottom = "10px", marginLeft = "5px", marginRight = "5px";
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div
|
|
6
|
+
style:background-color={'var(--divider-color, var(--divider-default-color))'}
|
|
7
|
+
style:border-radius={radius}
|
|
8
|
+
style:height={weight}
|
|
9
|
+
style:margin-top={marginTop}
|
|
10
|
+
style:margin-bottom={marginBottom}
|
|
11
|
+
style:margin-right={marginRight}
|
|
12
|
+
style:margin-left={marginLeft}
|
|
13
|
+
/>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import './Divider.css';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
weight?: string | undefined;
|
|
6
|
+
radius?: string | undefined;
|
|
7
|
+
marginTop?: string | undefined;
|
|
8
|
+
marginBottom?: string | undefined;
|
|
9
|
+
marginLeft?: string | undefined;
|
|
10
|
+
marginRight?: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export type DividerProps = typeof __propDef.props;
|
|
18
|
+
export type DividerEvents = typeof __propDef.events;
|
|
19
|
+
export type DividerSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Divider extends SvelteComponent<DividerProps, DividerEvents, DividerSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script>import { onDestroy, createEventDispatcher } from "svelte";
|
|
2
|
+
export let treshold = 0, horizontal = false, elementScroll = null, hasMore = true;
|
|
3
|
+
const dispatch = createEventDispatcher();
|
|
4
|
+
let isLoadMore = false, component;
|
|
5
|
+
function onScroll(e) {
|
|
6
|
+
const element = e.target;
|
|
7
|
+
const offset = horizontal ? element.scrollWidth - element.clientWidth - element.scrollLeft : element.scrollHeight - element.clientHeight - element.scrollTop;
|
|
8
|
+
if (offset <= treshold) {
|
|
9
|
+
if (!isLoadMore && hasMore) {
|
|
10
|
+
dispatch("loadMore");
|
|
11
|
+
}
|
|
12
|
+
isLoadMore = true;
|
|
13
|
+
} else {
|
|
14
|
+
isLoadMore = false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
$: {
|
|
18
|
+
if (component || elementScroll) {
|
|
19
|
+
const element = elementScroll ? elementScroll : component.parentNode;
|
|
20
|
+
if (element) {
|
|
21
|
+
element.addEventListener("scroll", onScroll);
|
|
22
|
+
element.addEventListener("resize", onScroll);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
onDestroy(() => {
|
|
27
|
+
if (component || elementScroll) {
|
|
28
|
+
const element = elementScroll ? elementScroll : component.parentNode;
|
|
29
|
+
if (element) {
|
|
30
|
+
element.removeEventListener("scroll", onScroll);
|
|
31
|
+
element.removeEventListener("resize", onScroll);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<div bind:this={component} style:width="0px" />
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
treshold?: number | undefined;
|
|
5
|
+
horizontal?: boolean | undefined;
|
|
6
|
+
elementScroll?: HTMLElement | null | undefined;
|
|
7
|
+
hasMore?: boolean | undefined;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
loadMore: CustomEvent<undefined>;
|
|
11
|
+
} & {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type InfiniteScrollProps = typeof __propDef.props;
|
|
17
|
+
export type InfiniteScrollEvents = typeof __propDef.events;
|
|
18
|
+
export type InfiniteScrollSlots = typeof __propDef.slots;
|
|
19
|
+
export default class InfiniteScroll extends SvelteComponent<InfiniteScrollProps, InfiniteScrollEvents, InfiniteScrollSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script>import { flip } from "svelte/animate";
|
|
2
|
+
import { dndzone } from "svelte-dnd-action";
|
|
3
|
+
import { createEventDispatcher } from "svelte";
|
|
4
|
+
import { Icon } from "../../..";
|
|
5
|
+
let clazz = "";
|
|
6
|
+
export { clazz as class };
|
|
7
|
+
export let items = [];
|
|
8
|
+
const flipDurationMs = 300;
|
|
9
|
+
function handleDndConsider(e) {
|
|
10
|
+
items = e.detail.items;
|
|
11
|
+
}
|
|
12
|
+
function handleDndFinalize(e) {
|
|
13
|
+
items = e.detail.items;
|
|
14
|
+
dispatch("changeOrder", { items });
|
|
15
|
+
}
|
|
16
|
+
let dispatch = createEventDispatcher();
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
<section
|
|
21
|
+
use:dndzone={{items, flipDurationMs, dropTargetStyle: {border: '0px dashed #000'}}}
|
|
22
|
+
on:consider={handleDndConsider}
|
|
23
|
+
on:finalize={handleDndFinalize}
|
|
24
|
+
>
|
|
25
|
+
{#each items as item(item.id)}
|
|
26
|
+
<div
|
|
27
|
+
animate:flip="{{duration: flipDurationMs}}"
|
|
28
|
+
style="margin-bottom: 12px;"
|
|
29
|
+
>
|
|
30
|
+
<div
|
|
31
|
+
class="item-container {clazz}"
|
|
32
|
+
>
|
|
33
|
+
<Icon
|
|
34
|
+
name="mdi-drag"
|
|
35
|
+
/>
|
|
36
|
+
<slot name="item" {item}>
|
|
37
|
+
{item.name}
|
|
38
|
+
</slot>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
{/each}
|
|
42
|
+
</section>
|
|
43
|
+
|
|
44
|
+
<style>
|
|
45
|
+
.item-container {
|
|
46
|
+
display: grid;
|
|
47
|
+
gap: 12px;
|
|
48
|
+
padding: 8px;
|
|
49
|
+
cursor: move;
|
|
50
|
+
grid-template-columns: 10px auto;
|
|
51
|
+
}
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
class?: string | undefined;
|
|
5
|
+
items?: {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
}[] | undefined;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
changeOrder: CustomEvent<{
|
|
12
|
+
items: {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}[];
|
|
16
|
+
}>;
|
|
17
|
+
} & {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
};
|
|
20
|
+
slots: {
|
|
21
|
+
item: {
|
|
22
|
+
item: {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type VerticalDraggableListProps = typeof __propDef.props;
|
|
30
|
+
export type VerticalDraggableListEvents = typeof __propDef.events;
|
|
31
|
+
export type VerticalDraggableListSlots = typeof __propDef.slots;
|
|
32
|
+
export default class VerticalDraggableList extends SvelteComponent<VerticalDraggableListProps, VerticalDraggableListEvents, VerticalDraggableListSlots> {
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -68,7 +68,7 @@ function handleMonthChange() {
|
|
|
68
68
|
</script>
|
|
69
69
|
|
|
70
70
|
<div
|
|
71
|
-
class="container {clazz.container || ''}"
|
|
71
|
+
class="date-picker-container {clazz.container || ''}"
|
|
72
72
|
>
|
|
73
73
|
<div
|
|
74
74
|
class="header {clazz.header || ''}"
|
|
@@ -168,7 +168,7 @@ function handleMonthChange() {
|
|
|
168
168
|
</div>
|
|
169
169
|
|
|
170
170
|
<style>
|
|
171
|
-
.container {
|
|
171
|
+
.date-picker-container {
|
|
172
172
|
border-radius: 5px;
|
|
173
173
|
height: var(
|
|
174
174
|
--date-picker-height,
|
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
<script>import "./Checkbox.css";
|
|
2
2
|
import "../../../css/main.css";
|
|
3
|
+
import { createEventDispatcher, onMount } from "svelte";
|
|
3
4
|
export let value = false, id = void 0, disabled = false;
|
|
5
|
+
onMount(() => {
|
|
6
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
7
|
+
window.addEventListener("keyup", handleKeyUp);
|
|
8
|
+
return () => {
|
|
9
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
10
|
+
window.removeEventListener("keyup", handleKeyUp);
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
function handleKeyDown(event) {
|
|
14
|
+
if (event.key == "Shift") {
|
|
15
|
+
shiftKeyPressed = true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function handleKeyUp(event) {
|
|
19
|
+
if (event.key == "Shift") {
|
|
20
|
+
shiftKeyPressed = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
let dispatch = createEventDispatcher(), shiftKeyPressed = false;
|
|
24
|
+
function handleChange() {
|
|
25
|
+
dispatch("change", { shiftKeyPressed });
|
|
26
|
+
}
|
|
4
27
|
</script>
|
|
5
28
|
|
|
6
29
|
<input
|
|
7
30
|
{id}
|
|
8
31
|
type="checkbox"
|
|
9
32
|
bind:checked={value}
|
|
10
|
-
on:change
|
|
33
|
+
on:change={handleChange}
|
|
11
34
|
{disabled}
|
|
12
35
|
/>
|
|
13
36
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--select-default-border: 1.3px solid rgb(var(--global-color-contrast-300), .3);
|
|
3
|
+
--select-default-active-border-color: rgb(var(--global-color-primary-500));
|
|
4
|
+
--option-default-border-color: rgb(var(--global-color-contrast-200));
|
|
5
|
+
--option-default-background-color: rgb(var(--global-color-background-200));
|
|
6
|
+
--option-default-color: rgb(var(--global-color-contrast-700));
|
|
7
|
+
--select-default-border-radius: 5px;
|
|
8
|
+
--select-default-padding-right: 5px;
|
|
9
|
+
--select-default-padding-left: 5px;
|
|
10
|
+
--select-default-background-color: transparent;
|
|
11
|
+
--select-default-color: rgb(var(--global-color-contrast-900));
|
|
12
|
+
--select-default-width: 100%;
|
|
13
|
+
--select-default-height: 36px;
|
|
14
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script context="module">import "./Select.css";
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<script>import { Icon } from "../../..";
|
|
5
|
+
export let options, name = void 0, value = void 0, disabled = false, placeholder = void 0;
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<select
|
|
9
|
+
{name}
|
|
10
|
+
bind:value
|
|
11
|
+
on:change
|
|
12
|
+
{placeholder}
|
|
13
|
+
class="select"
|
|
14
|
+
{disabled}
|
|
15
|
+
>
|
|
16
|
+
{#each options as option}
|
|
17
|
+
<option value={option.value} class="option">
|
|
18
|
+
{#if !!option.icon}
|
|
19
|
+
<Icon name={option.icon} />
|
|
20
|
+
{/if}
|
|
21
|
+
{option.text}
|
|
22
|
+
</option>
|
|
23
|
+
{/each}
|
|
24
|
+
</select>
|
|
25
|
+
|
|
26
|
+
<style>
|
|
27
|
+
.select {
|
|
28
|
+
height: var(
|
|
29
|
+
--select-height,
|
|
30
|
+
var(--select-default-height)
|
|
31
|
+
);
|
|
32
|
+
width: var(
|
|
33
|
+
--select-width,
|
|
34
|
+
var(--select-default-width)
|
|
35
|
+
);
|
|
36
|
+
color: var(
|
|
37
|
+
--select-color,
|
|
38
|
+
var(--select-default-color)
|
|
39
|
+
);
|
|
40
|
+
background-color: var(
|
|
41
|
+
--select-background-color,
|
|
42
|
+
var(--select-default-background-color)
|
|
43
|
+
);
|
|
44
|
+
padding-left: var(
|
|
45
|
+
--select-padding-left,
|
|
46
|
+
var(--select-default-padding-left)
|
|
47
|
+
);
|
|
48
|
+
padding-right: var(
|
|
49
|
+
--select-padding-right,
|
|
50
|
+
var(--select-default-padding-right)
|
|
51
|
+
);
|
|
52
|
+
font-size: inherit;
|
|
53
|
+
font-family: inherit;
|
|
54
|
+
text-overflow: ellipsis;
|
|
55
|
+
border-radius: var(
|
|
56
|
+
--select-border-radius,
|
|
57
|
+
var(--select-default-border-radius)
|
|
58
|
+
);
|
|
59
|
+
border: var(
|
|
60
|
+
--select-border,
|
|
61
|
+
var(--select-default-border)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.select:focus,
|
|
66
|
+
.select:active {
|
|
67
|
+
border-color: var(
|
|
68
|
+
--selecr-active-border-color,
|
|
69
|
+
var(--select-default-active-border-color)
|
|
70
|
+
) !important;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.option {
|
|
74
|
+
padding: 10px;
|
|
75
|
+
color: var(
|
|
76
|
+
--option-color,
|
|
77
|
+
var(--option-default-color)
|
|
78
|
+
);
|
|
79
|
+
background-color: var(
|
|
80
|
+
--option-background-color,
|
|
81
|
+
var(--option-default-background-color)
|
|
82
|
+
);
|
|
83
|
+
border-color: var(
|
|
84
|
+
--option-border-color,
|
|
85
|
+
var(--option-default-border-color)
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.select:focus {
|
|
90
|
+
outline: none;
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import './Select.css';
|
|
3
|
+
export type Option = {
|
|
4
|
+
icon?: string;
|
|
5
|
+
value: string | number | undefined;
|
|
6
|
+
text: string;
|
|
7
|
+
};
|
|
8
|
+
declare const __propDef: {
|
|
9
|
+
props: {
|
|
10
|
+
options: Option[];
|
|
11
|
+
name?: string | undefined;
|
|
12
|
+
value?: string | number | undefined;
|
|
13
|
+
disabled?: boolean | undefined;
|
|
14
|
+
placeholder?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
events: {
|
|
17
|
+
change: Event;
|
|
18
|
+
} & {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {};
|
|
22
|
+
};
|
|
23
|
+
export type SelectProps = typeof __propDef.props;
|
|
24
|
+
export type SelectEvents = typeof __propDef.events;
|
|
25
|
+
export type SelectSlots = typeof __propDef.slots;
|
|
26
|
+
export default class Select extends SvelteComponent<SelectProps, SelectEvents, SelectSlots> {
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--switch-default-padding: 1px;
|
|
3
|
+
--switch-default-width: 40px;
|
|
4
|
+
--switch-default-background-color: rgb(var(--global-color-background-300), 0.5);
|
|
5
|
+
--switch-default-border-radius: 9999px;
|
|
6
|
+
--switch-default-box-shadow: none;
|
|
7
|
+
--switch-default-active-toggle-color: rgb(var(--global-color-contrast-900));
|
|
8
|
+
--switch-default-active-background-color: rgb(var(--global-color-contrast-900));
|
|
9
|
+
--switch-default-inactive-toggle-color: rgb(var(--global-color-contrast-900));
|
|
10
|
+
--switch-default-inactive-background-color: rgb(var(--global-color-contrast-900));
|
|
11
|
+
--switch-default-label-width: 'auto';
|
|
12
|
+
--switch-default-font-size: 16px;
|
|
13
|
+
--switch-default-gap: 0.5em;
|
|
14
|
+
}
|