@likable-hair/svelte 3.0.56 → 3.0.58
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/ToolTip.svelte +42 -0
- package/dist/components/composed/common/ToolTip.svelte.d.ts +46 -0
- package/dist/components/composed/forms/CountriesAutocomplete.svelte.d.ts +1 -0
- package/dist/components/composed/forms/DatePickerTextField.svelte +3 -3
- package/dist/components/composed/forms/DatePickerTextField.svelte.d.ts +2 -0
- package/dist/components/composed/forms/IconsDropdown.svelte +15 -0
- package/dist/components/composed/forms/IconsDropdown.svelte.d.ts +6 -0
- package/dist/components/composed/progress/HorizontalStackedProgress.css +3 -0
- package/dist/components/composed/progress/HorizontalStackedProgress.svelte +117 -0
- package/dist/components/composed/progress/HorizontalStackedProgress.svelte.d.ts +24 -0
- package/dist/components/simple/forms/Autocomplete.svelte +3 -1
- package/dist/components/simple/forms/Autocomplete.svelte.d.ts +1 -0
- package/dist/components/simple/forms/FileInput.css +7 -0
- package/dist/components/simple/forms/FileInput.svelte +34 -17
- package/dist/components/simple/forms/FileInput.svelte.d.ts +4 -6
- package/dist/components/simple/forms/FileInputList.css +11 -0
- package/dist/components/simple/forms/FileInputList.svelte +60 -23
- package/dist/components/simple/forms/FileInputList.svelte.d.ts +3 -11
- package/dist/components/simple/progress/ProgressBar.css +7 -0
- package/dist/components/simple/progress/ProgressBar.svelte +28 -8
- package/dist/components/simple/progress/ProgressBar.svelte.d.ts +2 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script>import "../../../css/main.css";
|
|
2
|
+
import Menu from "../../simple/common/Menu.svelte";
|
|
3
|
+
export let activator, menuOpen = false, menuProps = {}, appearTimeout = void 0;
|
|
4
|
+
let mouseEnterHandler = void 0, mouseLeaveHandler = void 0, appearTimeoutId = void 0;
|
|
5
|
+
$:
|
|
6
|
+
if (!!activator) {
|
|
7
|
+
if (!!mouseEnterHandler)
|
|
8
|
+
activator.removeEventListener("mouseenter", mouseEnterHandler);
|
|
9
|
+
if (!!mouseLeaveHandler)
|
|
10
|
+
activator.removeEventListener("mouseleave", mouseLeaveHandler);
|
|
11
|
+
mouseEnterHandler = () => {
|
|
12
|
+
if (appearTimeout !== void 0) {
|
|
13
|
+
if (appearTimeoutId !== void 0)
|
|
14
|
+
clearTimeout(appearTimeoutId);
|
|
15
|
+
appearTimeoutId = setTimeout(() => {
|
|
16
|
+
menuOpen = true;
|
|
17
|
+
}, appearTimeout);
|
|
18
|
+
} else {
|
|
19
|
+
menuOpen = true;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
activator.addEventListener("mouseenter", mouseEnterHandler);
|
|
23
|
+
mouseLeaveHandler = () => {
|
|
24
|
+
if (appearTimeoutId !== void 0)
|
|
25
|
+
clearTimeout(appearTimeoutId);
|
|
26
|
+
menuOpen = false;
|
|
27
|
+
};
|
|
28
|
+
activator.addEventListener("mouseleave", mouseLeaveHandler);
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<Menu
|
|
33
|
+
bind:open={menuOpen}
|
|
34
|
+
bind:activator
|
|
35
|
+
anchor="bottom-center"
|
|
36
|
+
stayInViewport={true}
|
|
37
|
+
flipOnOverflow={true}
|
|
38
|
+
{...menuProps}
|
|
39
|
+
>
|
|
40
|
+
<slot></slot>
|
|
41
|
+
</Menu>
|
|
42
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import '../../../css/main.css';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
activator: HTMLElement;
|
|
6
|
+
menuOpen?: boolean | undefined;
|
|
7
|
+
menuProps?: {
|
|
8
|
+
_top?: number | undefined;
|
|
9
|
+
_left?: number | undefined;
|
|
10
|
+
_width?: string | undefined;
|
|
11
|
+
_height?: string | undefined;
|
|
12
|
+
_maxHeight?: string | undefined;
|
|
13
|
+
_minWidth?: string | undefined;
|
|
14
|
+
_overflow?: string | undefined;
|
|
15
|
+
_boxShadow?: string | undefined;
|
|
16
|
+
_borderRadius?: string | undefined;
|
|
17
|
+
_activatorGap?: number | undefined;
|
|
18
|
+
open?: boolean | undefined;
|
|
19
|
+
refreshPosition?: boolean | undefined;
|
|
20
|
+
activator?: HTMLElement | undefined;
|
|
21
|
+
anchor?: "bottom" | "bottom-center" | "right-center" | undefined;
|
|
22
|
+
closeOnClickOutside?: boolean | undefined;
|
|
23
|
+
inAnimation?: ((node: Element, params?: import("svelte/transition").SlideParams | import("svelte/transition").FlyParams | import("svelte/transition").FadeParams | undefined) => import("svelte/transition").TransitionConfig) | undefined;
|
|
24
|
+
inAnimationConfig?: import("svelte/transition").SlideParams | import("svelte/transition").FlyParams | import("svelte/transition").FadeParams | undefined;
|
|
25
|
+
outAnimation?: ((node: Element, params?: import("svelte/transition").SlideParams | import("svelte/transition").FlyParams | import("svelte/transition").FadeParams | undefined) => import("svelte/transition").TransitionConfig) | undefined;
|
|
26
|
+
outAnimationConfig?: import("svelte/transition").SlideParams | import("svelte/transition").FlyParams | import("svelte/transition").FadeParams | undefined;
|
|
27
|
+
menuElement?: HTMLElement | undefined;
|
|
28
|
+
flipOnOverflow?: boolean | undefined;
|
|
29
|
+
stayInViewport?: boolean | undefined;
|
|
30
|
+
openingId?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
appearTimeout?: number | undefined;
|
|
33
|
+
};
|
|
34
|
+
events: {
|
|
35
|
+
[evt: string]: CustomEvent<any>;
|
|
36
|
+
};
|
|
37
|
+
slots: {
|
|
38
|
+
default: {};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type ToolTipProps = typeof __propDef.props;
|
|
42
|
+
export type ToolTipEvents = typeof __propDef.events;
|
|
43
|
+
export type ToolTipSlots = typeof __propDef.slots;
|
|
44
|
+
export default class ToolTip extends SvelteComponentTyped<ToolTipProps, ToolTipEvents, ToolTipSlots> {
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
@@ -31,6 +31,7 @@ declare const __propDef: {
|
|
|
31
31
|
searchText?: string | undefined;
|
|
32
32
|
maxVisibleChips?: number | undefined;
|
|
33
33
|
menuOpened?: boolean | undefined;
|
|
34
|
+
closeOnSelect?: boolean | undefined;
|
|
34
35
|
menuBoxShadow?: string | undefined;
|
|
35
36
|
menuBorderRadius?: string | undefined;
|
|
36
37
|
mobileDrawer?: boolean | undefined;
|
|
@@ -11,7 +11,7 @@ import Dialog from "../../simple/dialogs/Dialog.svelte";
|
|
|
11
11
|
let clazz = {};
|
|
12
12
|
export { clazz as class };
|
|
13
13
|
let dispatch = createEventDispatcher();
|
|
14
|
-
export let menuOpened = false, openingId = "date-picker-text-field", pattern = "dd/MM/yyyy", selectedMonth = void 0, selectedYear = void 0, visibleMonth = void 0, visibleYear = void 0, selectedDate = void 0, placeholder = void 0, mobileDialog = true;
|
|
14
|
+
export let menuOpened = false, openingId = "date-picker-text-field", pattern = "dd/MM/yyyy", selectedMonth = void 0, selectedYear = void 0, visibleMonth = void 0, visibleYear = void 0, selectedDate = void 0, placeholder = void 0, mobileDialog = true, maxYearInRange = 2100, minYearInRange = 1970;
|
|
15
15
|
let activator, refreshPosition = false, menuElement, inputElement, mask = {
|
|
16
16
|
value: void 0
|
|
17
17
|
}, maskFactoryArgs = {
|
|
@@ -26,8 +26,8 @@ let activator, refreshPosition = false, menuElement, inputElement, mask = {
|
|
|
26
26
|
blocks: {
|
|
27
27
|
yyyy: {
|
|
28
28
|
mask: IMask.MaskedRange,
|
|
29
|
-
from:
|
|
30
|
-
to:
|
|
29
|
+
from: minYearInRange,
|
|
30
|
+
to: maxYearInRange
|
|
31
31
|
},
|
|
32
32
|
MM: {
|
|
33
33
|
mask: IMask.MaskedRange,
|
|
@@ -18,6 +18,8 @@ declare const __propDef: {
|
|
|
18
18
|
selectedDate?: Date | undefined;
|
|
19
19
|
placeholder?: string | undefined;
|
|
20
20
|
mobileDialog?: boolean | undefined;
|
|
21
|
+
maxYearInRange?: number | undefined;
|
|
22
|
+
minYearInRange?: number | undefined;
|
|
21
23
|
};
|
|
22
24
|
events: {
|
|
23
25
|
'day-click': CustomEvent<{
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
<script>import Dropdown, {} from "./Dropdown.svelte";
|
|
4
4
|
import Icon from "../../simple/media/Icon.svelte";
|
|
5
|
+
import { createEventDispatcher } from "svelte";
|
|
6
|
+
let dispatch = createEventDispatcher();
|
|
5
7
|
export let items = [], values = [], clearable = false;
|
|
6
8
|
let dropdownValues = [];
|
|
7
9
|
$:
|
|
@@ -26,6 +28,19 @@ function handleChange(event) {
|
|
|
26
28
|
icon: e.data.icon,
|
|
27
29
|
data: e.data
|
|
28
30
|
}));
|
|
31
|
+
dispatch("change", {
|
|
32
|
+
unselect: !!event.detail.unselect ? {
|
|
33
|
+
value: event.detail.unselect.value,
|
|
34
|
+
icon: event.detail.unselect.data.icon,
|
|
35
|
+
data: event.detail.unselect.data
|
|
36
|
+
} : void 0,
|
|
37
|
+
select: !!event.detail.select ? {
|
|
38
|
+
value: event.detail.select.value,
|
|
39
|
+
icon: event.detail.select.data.icon,
|
|
40
|
+
data: event.detail.select.data
|
|
41
|
+
} : void 0,
|
|
42
|
+
selection: values
|
|
43
|
+
});
|
|
29
44
|
}
|
|
30
45
|
</script>
|
|
31
46
|
|
|
@@ -11,6 +11,12 @@ declare const __propDef: {
|
|
|
11
11
|
clearable?: boolean | undefined;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
|
+
change: CustomEvent<{
|
|
15
|
+
unselect: IconItem | undefined;
|
|
16
|
+
select: IconItem | undefined;
|
|
17
|
+
selection: IconItem[];
|
|
18
|
+
}>;
|
|
19
|
+
} & {
|
|
14
20
|
[evt: string]: CustomEvent<any>;
|
|
15
21
|
};
|
|
16
22
|
slots: {};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
<script context="module">export function isProgressItem(obj) {
|
|
2
|
+
return (obj.label === void 0 || typeof obj.label === "string") && (obj.color === void 0 || typeof obj.color === "string") && typeof obj.value === "number";
|
|
3
|
+
}
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<script>import "./HorizontalStackedProgress.css";
|
|
7
|
+
import ProgressBar from "../../simple/progress/ProgressBar.svelte";
|
|
8
|
+
export let progresses = [], labelVisible = true;
|
|
9
|
+
let colors = [
|
|
10
|
+
"rgb(var(--global-color-primary-500))",
|
|
11
|
+
"rgb(var(--global-color-primary-300))",
|
|
12
|
+
"rgb(var(--global-color-primary-700))",
|
|
13
|
+
"rgb(var(--global-color-primary-500), .5)",
|
|
14
|
+
"rgb(var(--global-color-primary-600), .5)",
|
|
15
|
+
"rgb(var(--global-color-primary-700), .5)"
|
|
16
|
+
];
|
|
17
|
+
$:
|
|
18
|
+
total = progresses.reduce((p, c, i, a) => {
|
|
19
|
+
if (isProgressItem(c)) {
|
|
20
|
+
return p + c.value;
|
|
21
|
+
} else {
|
|
22
|
+
return p + c;
|
|
23
|
+
}
|
|
24
|
+
}, 0);
|
|
25
|
+
$:
|
|
26
|
+
progressesItems = progresses.map((p, i) => {
|
|
27
|
+
let item;
|
|
28
|
+
let value = isProgressItem(p) ? p.value : p;
|
|
29
|
+
let percentage = Number((100 * value / total).toFixed(2));
|
|
30
|
+
let color = isProgressItem(p) ? p.color : colors[i % colors.length];
|
|
31
|
+
item = {
|
|
32
|
+
...isProgressItem(p) ? p : {},
|
|
33
|
+
color,
|
|
34
|
+
value,
|
|
35
|
+
percentage
|
|
36
|
+
};
|
|
37
|
+
return item;
|
|
38
|
+
}).filter((p) => p.value !== 0);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<div
|
|
42
|
+
class="stacked-container"
|
|
43
|
+
>
|
|
44
|
+
{#each progressesItems as progress}
|
|
45
|
+
<div
|
|
46
|
+
style:width={progress.percentage + '%'}
|
|
47
|
+
class="single-progress-container"
|
|
48
|
+
>
|
|
49
|
+
<ProgressBar
|
|
50
|
+
total={progress.value}
|
|
51
|
+
value={progress.value}
|
|
52
|
+
--progress-bar-highlight-color={progress.color}
|
|
53
|
+
></ProgressBar>
|
|
54
|
+
{#if progress.label && labelVisible}
|
|
55
|
+
<div class="label">
|
|
56
|
+
<div class="label-text">{progress.label}</div>
|
|
57
|
+
<div class="label-value">
|
|
58
|
+
<div
|
|
59
|
+
class="dot"
|
|
60
|
+
style:background-color={progress.color || 'rgb(var(--global-color-background-300))'}
|
|
61
|
+
></div>
|
|
62
|
+
<div class="value-text">
|
|
63
|
+
{progress.value}
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
{/if}
|
|
68
|
+
</div>
|
|
69
|
+
{/each}
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<style>
|
|
73
|
+
.stacked-container {
|
|
74
|
+
overflow: hidden;
|
|
75
|
+
display: flex;
|
|
76
|
+
gap: var(
|
|
77
|
+
--horizontal-stacked-progress-gap,
|
|
78
|
+
var(--horizontal-stacked-progress-default-gap)
|
|
79
|
+
);
|
|
80
|
+
width: var(
|
|
81
|
+
--horizontal-stacked-progress-width,
|
|
82
|
+
var(--horizontal-stacked-progress-default-width)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.single-progress-container {
|
|
87
|
+
transition: width 300ms cubic-bezier(0.215, 0.610, 0.355, 1);
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.label-text {
|
|
93
|
+
font-size: .8rem;
|
|
94
|
+
font-weight: 300;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.label {
|
|
98
|
+
margin-top: 12px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.label-value {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: 8px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.value-text {
|
|
108
|
+
font-size: 1.1rem;
|
|
109
|
+
font-weight: 700;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.dot {
|
|
113
|
+
height: 10px;
|
|
114
|
+
width: 10px;
|
|
115
|
+
border-radius: 9999px;
|
|
116
|
+
}
|
|
117
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export type ProgressItem = {
|
|
3
|
+
label?: string;
|
|
4
|
+
color?: string;
|
|
5
|
+
value: number;
|
|
6
|
+
};
|
|
7
|
+
export declare function isProgressItem(obj: any): obj is ProgressItem;
|
|
8
|
+
import './HorizontalStackedProgress.css';
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: {
|
|
11
|
+
progresses?: (number | ProgressItem)[] | undefined;
|
|
12
|
+
labelVisible?: boolean | undefined;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {};
|
|
18
|
+
};
|
|
19
|
+
export type HorizontalStackedProgressProps = typeof __propDef.props;
|
|
20
|
+
export type HorizontalStackedProgressEvents = typeof __propDef.events;
|
|
21
|
+
export type HorizontalStackedProgressSlots = typeof __propDef.slots;
|
|
22
|
+
export default class HorizontalStackedProgress extends SvelteComponentTyped<HorizontalStackedProgressProps, HorizontalStackedProgressEvents, HorizontalStackedProgressSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -5,7 +5,7 @@ import "./Autocomplete.css";
|
|
|
5
5
|
import { scrollInMenu } from "../common/scroller";
|
|
6
6
|
let clazz = {};
|
|
7
7
|
export { clazz as class };
|
|
8
|
-
export let values = [], items, searchFunction = void 0, multiple = false, disabled = false, mandatory = false, placeholder = "", width = "auto", height = "auto", maxWidth = void 0, openingId = "autocomplete-menu", searchText = void 0, maxVisibleChips = void 0, menuOpened = false, menuBoxShadow = "rgb(var(--global-color-background-300), .5) 0px 2px 4px", menuBorderRadius = "5px", mobileDrawer = false;
|
|
8
|
+
export let values = [], items, searchFunction = void 0, multiple = false, disabled = false, mandatory = false, placeholder = "", width = "auto", height = "auto", maxWidth = void 0, openingId = "autocomplete-menu", searchText = void 0, maxVisibleChips = void 0, menuOpened = false, closeOnSelect = false, menuBoxShadow = "rgb(var(--global-color-background-300), .5) 0px 2px 4px", menuBorderRadius = "5px", mobileDrawer = false;
|
|
9
9
|
let dispatch = createEventDispatcher();
|
|
10
10
|
function select(item) {
|
|
11
11
|
const alreadyPresent = values.findIndex((i) => i.value === item.value) != -1;
|
|
@@ -21,6 +21,8 @@ function select(item) {
|
|
|
21
21
|
selection: values
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
+
if (!multiple && closeOnSelect)
|
|
25
|
+
menuOpened = false;
|
|
24
26
|
}
|
|
25
27
|
function unselect(item) {
|
|
26
28
|
if (values.length == 1 && mandatory)
|
|
@@ -29,6 +29,7 @@ declare const __propDef: {
|
|
|
29
29
|
searchText?: string | undefined;
|
|
30
30
|
maxVisibleChips?: number | undefined;
|
|
31
31
|
menuOpened?: boolean | undefined;
|
|
32
|
+
closeOnSelect?: boolean | undefined;
|
|
32
33
|
menuBoxShadow?: string | undefined;
|
|
33
34
|
menuBorderRadius?: string | undefined;
|
|
34
35
|
mobileDrawer?: boolean | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--file-input-default-height: 64px;
|
|
3
|
+
--file-input-default-background-color: rgb(var(--global-color-background-300));
|
|
4
|
+
--file-input-default-color: rgb(var(--global-color-contrast-900));
|
|
5
|
+
--file-input-default-focus-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 0 #0000, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
|
|
6
|
+
--file-input-default-border-radius: 5px;
|
|
7
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
|
|
1
|
+
<script>import "../../../css/main.css";
|
|
2
|
+
import "./FileInput.css";
|
|
3
|
+
import { createEventDispatcher } from "svelte";
|
|
4
|
+
let clazz = "";
|
|
5
|
+
export { clazz as class };
|
|
6
|
+
export let files = void 0, placeholder = void 0, persistOverUpload = true, disabled = false;
|
|
3
7
|
let inputElement = void 0;
|
|
4
8
|
let dropAreaActive = false;
|
|
5
9
|
const highlight = (highlighted) => {
|
|
@@ -35,7 +39,6 @@ function handleFileFromInput(event) {
|
|
|
35
39
|
</script>
|
|
36
40
|
|
|
37
41
|
<div
|
|
38
|
-
class="drop-area"
|
|
39
42
|
on:click={() => inputElement?.click()}
|
|
40
43
|
on:keypress={() => inputElement?.click()}
|
|
41
44
|
on:dragover|preventDefault={() => highlight(true)}
|
|
@@ -44,18 +47,11 @@ function handleFileFromInput(event) {
|
|
|
44
47
|
on:drop|preventDefault={(e) => {
|
|
45
48
|
if (!disabled) handleFileDrop(e);
|
|
46
49
|
}}
|
|
47
|
-
on:mouseenter={() => highlight(true)}
|
|
48
|
-
on:mouseleave={() => highlight(false)}
|
|
49
|
-
style:height
|
|
50
|
-
style:width
|
|
51
|
-
style:background-color={backgroundColor}
|
|
52
|
-
style:color={textColor}
|
|
53
|
-
class:rounded
|
|
54
50
|
class:disabled
|
|
55
|
-
|
|
51
|
+
class="drop-area {clazz}"
|
|
56
52
|
>
|
|
57
53
|
<slot name="body" active={dropAreaActive}>
|
|
58
|
-
<span> Drop file here or click to upload </span>
|
|
54
|
+
<span> { placeholder || 'Drop file here or click to upload'} </span>
|
|
59
55
|
</slot>
|
|
60
56
|
|
|
61
57
|
<input
|
|
@@ -69,6 +65,26 @@ function handleFileFromInput(event) {
|
|
|
69
65
|
|
|
70
66
|
<style>
|
|
71
67
|
.drop-area {
|
|
68
|
+
border-radius: var(
|
|
69
|
+
--file-input-border-radius,
|
|
70
|
+
var(--file-input-default-border-radius)
|
|
71
|
+
);
|
|
72
|
+
height: var(
|
|
73
|
+
--file-input-height,
|
|
74
|
+
var(--file-input-default-height)
|
|
75
|
+
);
|
|
76
|
+
width: var(
|
|
77
|
+
--file-input-width,
|
|
78
|
+
var(--file-input-default-width)
|
|
79
|
+
);
|
|
80
|
+
color: var(
|
|
81
|
+
--file-input-color,
|
|
82
|
+
var(--file-input-default-color)
|
|
83
|
+
);
|
|
84
|
+
background-color: var(
|
|
85
|
+
--file-input-background-color,
|
|
86
|
+
var(--file-input-default-background-color)
|
|
87
|
+
);
|
|
72
88
|
display: flex;
|
|
73
89
|
align-items: center;
|
|
74
90
|
justify-content: center;
|
|
@@ -76,6 +92,7 @@ function handleFileFromInput(event) {
|
|
|
76
92
|
cursor: pointer;
|
|
77
93
|
transition: 0.2s;
|
|
78
94
|
}
|
|
95
|
+
|
|
79
96
|
.disabled {
|
|
80
97
|
opacity: 0.5;
|
|
81
98
|
cursor: default;
|
|
@@ -83,10 +100,10 @@ function handleFileFromInput(event) {
|
|
|
83
100
|
.drop-area > input {
|
|
84
101
|
display: none;
|
|
85
102
|
}
|
|
86
|
-
.drop-area:hover:not(.disabled) {
|
|
87
|
-
box-shadow: var(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
103
|
+
.drop-area:hover:not(.disabled) {
|
|
104
|
+
box-shadow: var(
|
|
105
|
+
--file-input-focus-shadow,
|
|
106
|
+
var(--file-input-default-focus-shadow)
|
|
107
|
+
);
|
|
91
108
|
}
|
|
92
109
|
</style>
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import '../../../css/main.css';
|
|
3
|
+
import './FileInput.css';
|
|
2
4
|
declare const __propDef: {
|
|
3
5
|
props: {
|
|
6
|
+
class?: string | undefined;
|
|
4
7
|
files?: File[] | undefined;
|
|
8
|
+
placeholder?: string | undefined;
|
|
5
9
|
persistOverUpload?: boolean | undefined;
|
|
6
|
-
height?: string | undefined;
|
|
7
|
-
width?: string | undefined;
|
|
8
|
-
backgroundColor?: string | undefined;
|
|
9
|
-
textColor?: string | undefined;
|
|
10
|
-
rounded?: boolean | undefined;
|
|
11
10
|
disabled?: boolean | undefined;
|
|
12
|
-
focusShadow?: string | undefined;
|
|
13
11
|
};
|
|
14
12
|
events: {
|
|
15
13
|
fileDrop: CustomEvent<{
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--file-input-list-default-height : 64px;
|
|
3
|
+
--file-input-list-default-background-color : rgb(var(--global-color-background-300));
|
|
4
|
+
--file-input-list-default-color : rgb(var(--global-color-contrast-900));
|
|
5
|
+
--file-input-list-default-selected-row-color : rgb(var(--global-color-contrast-1000));
|
|
6
|
+
--file-input-list-default-selected-row-background : rgb(var(--global-color-background-500));
|
|
7
|
+
--file-input-list-default-hover-color : rgb(var(--global-color-contrast-900));
|
|
8
|
+
--file-input-list-default-border-color : rgb(var(--global-color-primary-100));
|
|
9
|
+
--file-input-list-default-border-radius : 5px
|
|
10
|
+
}
|
|
11
|
+
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import "../../../css/main.css";
|
|
2
|
+
import "./FileInputList.css";
|
|
3
|
+
import Button from "../buttons/Button.svelte";
|
|
2
4
|
import FileInput from "./FileInput.svelte";
|
|
3
5
|
import Icon from "../media/Icon.svelte";
|
|
4
|
-
|
|
6
|
+
let clazz = "";
|
|
7
|
+
export { clazz as class };
|
|
8
|
+
export let files = [], persistOverUpload = true, dropAreaActive = true, icon = "mdi-folder";
|
|
5
9
|
let fileActive = null;
|
|
6
10
|
function handleFileMouseEnter(file) {
|
|
7
11
|
dropAreaActive = false;
|
|
@@ -21,20 +25,15 @@ function handleRemove(file) {
|
|
|
21
25
|
}
|
|
22
26
|
</script>
|
|
23
27
|
|
|
24
|
-
<div
|
|
25
|
-
class="card-container"
|
|
26
|
-
style:--file-input-list-hover-color={hoverColor}
|
|
27
|
-
style:--file-input-list-border-color={borderColor}
|
|
28
|
-
>
|
|
28
|
+
<div class="card-container {clazz}">
|
|
29
29
|
<FileInput
|
|
30
|
-
{persistOverUpload}
|
|
31
|
-
{height}
|
|
32
|
-
{width}
|
|
33
|
-
{backgroundColor}
|
|
34
|
-
{rounded}
|
|
35
30
|
bind:files
|
|
36
|
-
{
|
|
37
|
-
|
|
31
|
+
{persistOverUpload}
|
|
32
|
+
--file-input-border-radius="var(--file-input-list-border-radius,var(--file-input-list-default-border-radius))"
|
|
33
|
+
--file-input-background-color="var(--file-input-list-background-color,var(--file-input-list-default-background-color))"
|
|
34
|
+
--file-input-color="var(--file-input-list-color,var(--file-input-list-default-color))"
|
|
35
|
+
--file-input-height="var(--file-input-list-height,var(--file-input-list-default-height))"
|
|
36
|
+
--file-input-width="var(--file-input-list-width,var(--file-input-list-default-width))"
|
|
38
37
|
>
|
|
39
38
|
<span
|
|
40
39
|
slot="body"
|
|
@@ -60,11 +59,9 @@ function handleRemove(file) {
|
|
|
60
59
|
handleFileMouseLeave();
|
|
61
60
|
}}
|
|
62
61
|
class:file-active={fileActive == file}
|
|
63
|
-
style:--selected-color={selectedRowColor}
|
|
64
|
-
style:--selected-background={selectedRowBackground}
|
|
65
62
|
>
|
|
66
63
|
<td>
|
|
67
|
-
<Icon name={icon}
|
|
64
|
+
<Icon name={icon} />
|
|
68
65
|
</td>
|
|
69
66
|
<td class="file-name">
|
|
70
67
|
{file.name}
|
|
@@ -91,6 +88,11 @@ function handleRemove(file) {
|
|
|
91
88
|
</div>
|
|
92
89
|
|
|
93
90
|
<style>
|
|
91
|
+
.body-span {
|
|
92
|
+
height: 100px;
|
|
93
|
+
width: 100%;
|
|
94
|
+
display: flex;
|
|
95
|
+
}
|
|
94
96
|
.card-container {
|
|
95
97
|
display: flex;
|
|
96
98
|
justify-content: center;
|
|
@@ -98,13 +100,34 @@ function handleRemove(file) {
|
|
|
98
100
|
flex-direction: column;
|
|
99
101
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
|
100
102
|
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
|
103
|
+
border-color: var(
|
|
104
|
+
--file-input-list-border-color,
|
|
105
|
+
var(--file-input-list-default-border-color)
|
|
106
|
+
);
|
|
107
|
+
height: var(--file-input-list-height,var(--file-input-list-default-height));
|
|
108
|
+
width: var(--file-input-list-background-width,var(--file-input-list-default-width));
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.card-container:hover {
|
|
112
|
+
color: var(
|
|
113
|
+
--file-input-list-hover-color,
|
|
114
|
+
var(--file-input-list-default-hover-color)
|
|
115
|
+
);
|
|
101
116
|
}
|
|
117
|
+
|
|
102
118
|
.body-container {
|
|
103
|
-
border: dotted
|
|
104
|
-
border-
|
|
105
|
-
|
|
119
|
+
border: dotted;
|
|
120
|
+
border-color: var(
|
|
121
|
+
--file-input-list-border-color,
|
|
122
|
+
var(--file-input-list-default-border-color)
|
|
123
|
+
);
|
|
124
|
+
border-radius: var(
|
|
125
|
+
--file-input-list-border-radius,
|
|
126
|
+
var(--file-input-list-default-border-radius)
|
|
127
|
+
);
|
|
106
128
|
width: calc(100% - 20px);
|
|
107
129
|
height: calc(100% - 20px);
|
|
130
|
+
box-sizing: border-box;
|
|
108
131
|
margin: auto;
|
|
109
132
|
position: relative;
|
|
110
133
|
display: flex;
|
|
@@ -113,12 +136,26 @@ function handleRemove(file) {
|
|
|
113
136
|
transition: 0.2s;
|
|
114
137
|
overflow-y: auto;
|
|
115
138
|
}
|
|
139
|
+
|
|
116
140
|
.active {
|
|
117
|
-
border-color: var(
|
|
141
|
+
border-color: var(
|
|
142
|
+
--file-input-list-selected-row-background,
|
|
143
|
+
var(--file-input-list-default-selected-row-background)
|
|
144
|
+
);
|
|
145
|
+
color: var(
|
|
146
|
+
--file-input-list-selected-row-color,
|
|
147
|
+
var(--file-input-list-default-selected-row-color)
|
|
148
|
+
);
|
|
118
149
|
}
|
|
119
150
|
.file-active {
|
|
120
|
-
color: var(
|
|
121
|
-
|
|
151
|
+
color: var(
|
|
152
|
+
--file-input-list-selected-row-color,
|
|
153
|
+
var(--file-input-list-default-selected-row-color)
|
|
154
|
+
);
|
|
155
|
+
background-color: var(
|
|
156
|
+
--file-input-list-selected-row-background,
|
|
157
|
+
var(--file-input-list-default-selected-row-background)
|
|
158
|
+
);
|
|
122
159
|
}
|
|
123
160
|
.file-list {
|
|
124
161
|
width: 100%;
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import "../../../css/main.css";
|
|
3
|
+
import "./FileInputList.css";
|
|
2
4
|
declare const __propDef: {
|
|
3
5
|
props: {
|
|
6
|
+
class?: string | undefined;
|
|
4
7
|
files?: File[] | undefined;
|
|
5
8
|
persistOverUpload?: boolean | undefined;
|
|
6
|
-
height?: string | undefined;
|
|
7
|
-
width?: string | undefined;
|
|
8
|
-
backgroundColor?: string | undefined;
|
|
9
|
-
textColor?: string | undefined;
|
|
10
|
-
rounded?: boolean | undefined;
|
|
11
|
-
focusShadow?: string | undefined;
|
|
12
9
|
dropAreaActive?: boolean | undefined;
|
|
13
10
|
icon?: string | undefined;
|
|
14
|
-
iconSize?: number | undefined;
|
|
15
|
-
selectedRowColor?: string | undefined;
|
|
16
|
-
selectedRowBackground?: string | undefined;
|
|
17
|
-
hoverColor?: string | undefined;
|
|
18
|
-
borderColor?: string | undefined;
|
|
19
11
|
};
|
|
20
12
|
events: {
|
|
21
13
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--progress-bar-default-background-color: rgb(var(--global-color-background-300), .3);
|
|
3
|
+
--progress-bar-default-highlight-color: rgb(var(--global-color-primary-500));
|
|
4
|
+
--progress-bar-default-height: 5px;
|
|
5
|
+
--progress-bar-default-width: 100%;
|
|
6
|
+
--progress-bar-default-border-radius: 2px;
|
|
7
|
+
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script>import "../../../css/main.css";
|
|
2
|
+
import "./ProgressBar.css";
|
|
3
|
+
export let value = 0, total = 100;
|
|
2
4
|
$:
|
|
3
5
|
hundredBasedProgress = total === 0 ? 100 : value * 100 / total;
|
|
4
6
|
$:
|
|
@@ -11,16 +13,10 @@ $:
|
|
|
11
13
|
|
|
12
14
|
<div
|
|
13
15
|
style={cssVariables}
|
|
14
|
-
style:height
|
|
15
|
-
style:width
|
|
16
|
-
style:border-radius={radius}
|
|
17
|
-
style:background-color={backgroundColor}
|
|
18
16
|
class="progress-bar-container"
|
|
19
17
|
>
|
|
20
18
|
<div
|
|
21
|
-
style:height
|
|
22
19
|
style:width={hundredBasedProgress + "%"}
|
|
23
|
-
style:background-color={color}
|
|
24
20
|
class="progress"
|
|
25
21
|
/>
|
|
26
22
|
</div>
|
|
@@ -28,10 +24,34 @@ $:
|
|
|
28
24
|
<style>
|
|
29
25
|
.progress-bar-container {
|
|
30
26
|
overflow: hidden;
|
|
27
|
+
background-color: var(
|
|
28
|
+
--progress-bar-background-color,
|
|
29
|
+
var(--progress-bar-default-background-color)
|
|
30
|
+
);
|
|
31
|
+
height: var(
|
|
32
|
+
--progress-bar-height,
|
|
33
|
+
var(--progress-bar-default-height)
|
|
34
|
+
);
|
|
35
|
+
width: var(
|
|
36
|
+
--progress-bar-width,
|
|
37
|
+
var(--progress-bar-default-width)
|
|
38
|
+
);
|
|
39
|
+
border-radius: var(
|
|
40
|
+
--progress-bar-border-radius,
|
|
41
|
+
var(--progress-bar-default-border-radius)
|
|
42
|
+
);
|
|
31
43
|
}
|
|
32
44
|
|
|
33
45
|
.progress {
|
|
34
46
|
max-width: 100%;
|
|
35
|
-
|
|
47
|
+
height: var(
|
|
48
|
+
--progress-bar-height,
|
|
49
|
+
var(--progress-bar-default-height)
|
|
50
|
+
);
|
|
51
|
+
background-color: var(
|
|
52
|
+
--progress-bar-highlight-color,
|
|
53
|
+
var(--progress-bar-default-highlight-color)
|
|
54
|
+
);
|
|
55
|
+
transition: width 300ms cubic-bezier(0.215, 0.610, 0.355, 1);
|
|
36
56
|
}
|
|
37
57
|
</style>
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import '../../../css/main.css';
|
|
3
|
+
import './ProgressBar.css';
|
|
2
4
|
declare const __propDef: {
|
|
3
5
|
props: {
|
|
4
6
|
value?: number | undefined;
|
|
5
7
|
total?: number | undefined;
|
|
6
|
-
height?: string | undefined;
|
|
7
|
-
width?: string | undefined;
|
|
8
|
-
radius?: string | undefined;
|
|
9
|
-
backgroundColor?: string | undefined;
|
|
10
|
-
color?: string | undefined;
|
|
11
8
|
};
|
|
12
9
|
events: {
|
|
13
10
|
[evt: string]: CustomEvent<any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export { default as TabSwitcher } from './components/simple/navigation/TabSwitch
|
|
|
47
47
|
export { default as ProgressBar } from './components/simple/progress/ProgressBar.svelte';
|
|
48
48
|
export { default as ProductCard } from './components/composed/shop/ProductCard.svelte';
|
|
49
49
|
export { default as ProductsGrid } from './components/composed/shop/ProductsGrid.svelte';
|
|
50
|
+
export { default as HorizontalStackedProgress } from './components/composed/progress/HorizontalStackedProgress.svelte';
|
|
50
51
|
export { default as ActivableButton } from './components/composed/buttons/ActivableButton.svelte';
|
|
51
52
|
export { default as IconsDropdown } from './components/composed/forms/IconsDropdown.svelte';
|
|
52
53
|
export { default as PaginatedTable } from './components/composed/list/PaginatedTable.svelte';
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ export { default as TabSwitcher } from './components/simple/navigation/TabSwitch
|
|
|
47
47
|
export { default as ProgressBar } from './components/simple/progress/ProgressBar.svelte';
|
|
48
48
|
export { default as ProductCard } from './components/composed/shop/ProductCard.svelte';
|
|
49
49
|
export { default as ProductsGrid } from './components/composed/shop/ProductsGrid.svelte';
|
|
50
|
+
export { default as HorizontalStackedProgress } from './components/composed/progress/HorizontalStackedProgress.svelte';
|
|
50
51
|
export { default as ActivableButton } from './components/composed/buttons/ActivableButton.svelte';
|
|
51
52
|
export { default as IconsDropdown } from './components/composed/forms/IconsDropdown.svelte';
|
|
52
53
|
export { default as PaginatedTable } from './components/composed/list/PaginatedTable.svelte';
|