@likable-hair/svelte 3.0.53 → 3.0.55
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 +3 -1
- package/dist/components/composed/common/MenuOrDrawer.svelte.d.ts +2 -0
- package/dist/components/composed/common/MenuOrDrawerOptions.svelte +3 -1
- package/dist/components/composed/common/MenuOrDrawerOptions.svelte.d.ts +3 -0
- package/dist/components/{simple/dates → composed/forms}/DatePickerTextField.svelte +54 -35
- package/dist/components/{simple/dates → composed/forms}/DatePickerTextField.svelte.d.ts +16 -1
- package/dist/components/composed/search/FilterEditor.svelte +2 -2
- package/dist/components/composed/search/MobileFilterEditor.svelte +2 -2
- package/dist/components/layouts/UnstableDividedSideBarLayout.svelte +2 -2
- package/dist/components/simple/dates/DatePicker.svelte +1 -1
- package/dist/components/simple/dates/TimePicker.css +10 -0
- package/dist/components/simple/dates/TimePicker.svelte +170 -0
- package/dist/components/simple/dates/TimePicker.svelte.d.ts +24 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/utils/filters/builder.d.ts +13 -13
- package/dist/utils/filters/filters.d.ts +1 -1
- package/dist/utils/filters/modifiers/where.d.ts +4 -3
- package/package.json +1 -1
|
@@ -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", _boxShadow = "rgb(var(--global-color-grey-900), .5) 0px 2px 4px", _height = "fit-content", _width = void 0, _maxHeight = void 0, _minWidth = "100px", _borderRadius = "5px";
|
|
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";
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<MediaQuery let:mAndDown>
|
|
@@ -27,6 +27,8 @@ export let open = false, activator, drawerPosition = "bottom", menuAnchor = "bot
|
|
|
27
27
|
_borderRadius={_borderRadius}
|
|
28
28
|
_width={_width || ""}
|
|
29
29
|
anchor={menuAnchor}
|
|
30
|
+
bind:stayInViewport={stayInViewport}
|
|
31
|
+
bind:flipOnOverflow={flipOnOverflow}
|
|
30
32
|
>
|
|
31
33
|
<slot isDrawer={false} isMenu={true}></slot>
|
|
32
34
|
</Menu>
|
|
@@ -9,6 +9,8 @@ declare const __propDef: {
|
|
|
9
9
|
activator: HTMLElement;
|
|
10
10
|
drawerPosition?: ComponentProps<Drawer>['position'];
|
|
11
11
|
menuAnchor?: ComponentProps<Menu>['anchor'];
|
|
12
|
+
stayInViewport?: ComponentProps<Menu>['stayInViewport'];
|
|
13
|
+
flipOnOverflow?: ComponentProps<Menu>['flipOnOverflow'];
|
|
12
14
|
_boxShadow?: string | undefined;
|
|
13
15
|
_height?: string | undefined;
|
|
14
16
|
_width?: string | undefined;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<script>import "../../../css/main.css";
|
|
4
4
|
import MenuOrDrawer from "./MenuOrDrawer.svelte";
|
|
5
5
|
import SelectableVerticalList from "../../simple/lists/SelectableVerticalList.svelte";
|
|
6
|
-
export let open = false, activator, drawerPosition = "bottom", menuAnchor = "bottom-center", elements = [], _boxShadow = "rgb(var(--global-color-grey-900), .5) 0px 2px 4px", _height = "fit-content", _maxHeight = void 0, _minWidth = "100px", _borderRadius = "5px";
|
|
6
|
+
export let open = false, activator, drawerPosition = "bottom", menuAnchor = "bottom-center", elements = [], stayInViewport = true, flipOnOverflow = false, _boxShadow = "rgb(var(--global-color-grey-900), .5) 0px 2px 4px", _height = "fit-content", _maxHeight = void 0, _minWidth = "100px", _borderRadius = "5px";
|
|
7
7
|
let selected;
|
|
8
8
|
let focused;
|
|
9
9
|
$:
|
|
@@ -19,6 +19,8 @@ $:
|
|
|
19
19
|
bind:activator
|
|
20
20
|
bind:drawerPosition
|
|
21
21
|
bind:menuAnchor
|
|
22
|
+
bind:stayInViewport
|
|
23
|
+
bind:flipOnOverflow
|
|
22
24
|
{_boxShadow}
|
|
23
25
|
{_height}
|
|
24
26
|
{_maxHeight}
|
|
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
export type ArrayElement<ArrayType extends readonly unknown[]> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
3
3
|
import '../../../css/main.css';
|
|
4
4
|
import type { ComponentProps } from 'svelte';
|
|
5
|
+
import MenuOrDrawer from "./MenuOrDrawer.svelte";
|
|
5
6
|
import type Drawer from '../../simple/navigation/Drawer.svelte';
|
|
6
7
|
import type Menu from '../../simple/common/Menu.svelte';
|
|
7
8
|
import SelectableVerticalList from '../../simple/lists/SelectableVerticalList.svelte';
|
|
@@ -12,6 +13,8 @@ declare const __propDef: {
|
|
|
12
13
|
drawerPosition?: ComponentProps<Drawer>['position'];
|
|
13
14
|
menuAnchor?: ComponentProps<Menu>['anchor'];
|
|
14
15
|
elements?: ComponentProps<SelectableVerticalList>['elements'];
|
|
16
|
+
stayInViewport?: ComponentProps<MenuOrDrawer>['stayInViewport'];
|
|
17
|
+
flipOnOverflow?: ComponentProps<MenuOrDrawer>['flipOnOverflow'];
|
|
15
18
|
_boxShadow?: string | undefined;
|
|
16
19
|
_height?: string | undefined;
|
|
17
20
|
_maxHeight?: string | undefined;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<script>import IMask, { InputMask } from "imask";
|
|
2
|
-
import SimpleTextField from "
|
|
3
|
-
import DatePicker from "
|
|
4
|
-
import Menu from "
|
|
5
|
-
import Icon from "
|
|
2
|
+
import SimpleTextField from "../../simple/forms/SimpleTextField.svelte";
|
|
3
|
+
import DatePicker from "../../simple/dates/DatePicker.svelte";
|
|
4
|
+
import Menu from "../../simple/common/Menu.svelte";
|
|
5
|
+
import Icon from "../../simple/media/Icon.svelte";
|
|
6
6
|
import { onMount } from "svelte";
|
|
7
7
|
import { DateTime } from "luxon";
|
|
8
8
|
import { createEventDispatcher } from "svelte";
|
|
9
|
-
import MediaQuery from "
|
|
10
|
-
import Dialog from "
|
|
9
|
+
import MediaQuery from "../../simple/common/MediaQuery.svelte";
|
|
10
|
+
import Dialog from "../../simple/dialogs/Dialog.svelte";
|
|
11
|
+
let clazz = {};
|
|
12
|
+
export { clazz as class };
|
|
11
13
|
let dispatch = createEventDispatcher();
|
|
12
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;
|
|
13
15
|
let activator, refreshPosition = false, menuElement, inputElement, mask = {
|
|
@@ -66,7 +68,7 @@ onMount(() => {
|
|
|
66
68
|
function handleInputChange(event) {
|
|
67
69
|
setTimeout(() => {
|
|
68
70
|
const typedValue = mask.value;
|
|
69
|
-
if (
|
|
71
|
+
if (typedValue !== void 0 && typedValue !== null) {
|
|
70
72
|
const dayOfMonthIndex = pattern.indexOf("dd");
|
|
71
73
|
const dayOfMonth = typedValue.substring(dayOfMonthIndex, dayOfMonthIndex + 2);
|
|
72
74
|
const monthIndex = pattern.indexOf("MM");
|
|
@@ -120,36 +122,47 @@ $:
|
|
|
120
122
|
<MediaQuery let:mAndDown>
|
|
121
123
|
<div
|
|
122
124
|
bind:this={activator}
|
|
125
|
+
class="date-picker-activator {clazz.activator || ''}"
|
|
123
126
|
>
|
|
124
|
-
<
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
<slot
|
|
128
|
+
name="activator"
|
|
129
|
+
{mask}
|
|
130
|
+
{handleTextFieldFocus}
|
|
131
|
+
{handleInputChange}
|
|
132
|
+
{inputElement}
|
|
133
|
+
{placeholder}
|
|
130
134
|
>
|
|
131
|
-
<
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
135
|
+
<SimpleTextField
|
|
136
|
+
bind:value={mask.value}
|
|
137
|
+
on:focus={() => handleTextFieldFocus(mAndDown)}
|
|
138
|
+
on:keydown={handleInputChange}
|
|
139
|
+
bind:input={inputElement}
|
|
140
|
+
bind:placeholder
|
|
141
|
+
class={clazz.textfield}
|
|
142
|
+
>
|
|
143
|
+
<svelte:fragment slot="prepend-inner" let:prependInnerIcon let:iconSize>
|
|
144
|
+
<slot name="prepend-inner" {prependInnerIcon} {iconSize}>
|
|
145
|
+
<Icon
|
|
146
|
+
name="mdi-calendar"
|
|
147
|
+
click
|
|
148
|
+
on:click={() => menuOpened = !menuOpened}
|
|
149
|
+
></Icon>
|
|
150
|
+
</slot>
|
|
151
|
+
</svelte:fragment>
|
|
152
|
+
<svelte:fragment slot="append-inner" let:appendInnerIcon let:iconSize>
|
|
153
|
+
<slot name="append-inner" {appendInnerIcon} {iconSize}>
|
|
154
|
+
</slot>
|
|
155
|
+
</svelte:fragment>
|
|
156
|
+
<svelte:fragment slot="prepend" let:prependIcon let:iconSize>
|
|
157
|
+
<slot name="append-inner" {prependIcon} {iconSize}>
|
|
158
|
+
</slot>
|
|
159
|
+
</svelte:fragment>
|
|
160
|
+
<svelte:fragment slot="append" let:appendIcon let:iconSize>
|
|
161
|
+
<slot name="append-inner" {appendIcon} {iconSize}>
|
|
162
|
+
</slot>
|
|
163
|
+
</svelte:fragment>
|
|
164
|
+
</SimpleTextField>
|
|
165
|
+
</slot>
|
|
153
166
|
</div>
|
|
154
167
|
|
|
155
168
|
{#if mAndDown && mobileDialog}
|
|
@@ -204,3 +217,9 @@ $:
|
|
|
204
217
|
{/if}
|
|
205
218
|
</MediaQuery>
|
|
206
219
|
|
|
220
|
+
<style>
|
|
221
|
+
.date-picker-activator {
|
|
222
|
+
width: fit-content;
|
|
223
|
+
}
|
|
224
|
+
</style>
|
|
225
|
+
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import
|
|
2
|
+
import SimpleTextField from "../../simple/forms/SimpleTextField.svelte";
|
|
3
|
+
import { type ComponentProps } from 'svelte';
|
|
4
|
+
import type { DateStat } from '../../simple/dates/utils';
|
|
3
5
|
declare const __propDef: {
|
|
4
6
|
props: {
|
|
7
|
+
class?: {
|
|
8
|
+
activator?: string | undefined;
|
|
9
|
+
textfield?: ComponentProps<SimpleTextField>['class'];
|
|
10
|
+
} | undefined;
|
|
5
11
|
menuOpened?: boolean | undefined;
|
|
6
12
|
openingId?: string | undefined;
|
|
7
13
|
pattern?: string | undefined;
|
|
@@ -21,6 +27,15 @@ declare const __propDef: {
|
|
|
21
27
|
[evt: string]: CustomEvent<any>;
|
|
22
28
|
};
|
|
23
29
|
slots: {
|
|
30
|
+
activator: {
|
|
31
|
+
mask: {
|
|
32
|
+
value: string | undefined;
|
|
33
|
+
};
|
|
34
|
+
handleTextFieldFocus: (mobile: boolean) => void;
|
|
35
|
+
handleInputChange: (event: any) => void;
|
|
36
|
+
inputElement: HTMLElement;
|
|
37
|
+
placeholder: string | undefined;
|
|
38
|
+
};
|
|
24
39
|
'prepend-inner': {
|
|
25
40
|
prependInnerIcon: string | undefined;
|
|
26
41
|
iconSize: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import Dropdown, {} from "../forms/Dropdown.svelte";
|
|
2
2
|
import { GenericModes, SelectModes, StringModes } from "../../../utils/filters/filters";
|
|
3
3
|
import SimpleTextField from "../../simple/forms/SimpleTextField.svelte";
|
|
4
|
-
import DatePickerTextField from "
|
|
4
|
+
import DatePickerTextField from "../forms/DatePickerTextField.svelte";
|
|
5
5
|
import Button from "../../simple/buttons/Button.svelte";
|
|
6
6
|
import { createEventDispatcher } from "svelte";
|
|
7
7
|
import Validator from "../../../utils/filters/validator";
|
|
@@ -197,7 +197,7 @@ $:
|
|
|
197
197
|
bind:value={tmpFilter.value}
|
|
198
198
|
></Checkbox>
|
|
199
199
|
<span style:margin-left="10px">
|
|
200
|
-
{tmpFilter.
|
|
200
|
+
{tmpFilter.description}
|
|
201
201
|
</span>
|
|
202
202
|
</div>
|
|
203
203
|
{/if}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { GenericModes, SelectModes, StringModes } from "../../../utils/filters/filters";
|
|
2
2
|
import SimpleTextField from "../../simple/forms/SimpleTextField.svelte";
|
|
3
|
-
import DatePickerTextField from "
|
|
3
|
+
import DatePickerTextField from "../forms/DatePickerTextField.svelte";
|
|
4
4
|
import Button from "../../simple/buttons/Button.svelte";
|
|
5
5
|
import { createEventDispatcher } from "svelte";
|
|
6
6
|
import Validator from "../../../utils/filters/validator";
|
|
@@ -242,7 +242,7 @@ $:
|
|
|
242
242
|
bind:value={tmpFilter.value}
|
|
243
243
|
></Checkbox>
|
|
244
244
|
<span style:margin-left="10px">
|
|
245
|
-
{tmpFilter.
|
|
245
|
+
{tmpFilter.description}
|
|
246
246
|
</span>
|
|
247
247
|
</div>
|
|
248
248
|
{/if}
|
|
@@ -62,7 +62,7 @@ let sidebarExpanded = false;
|
|
|
62
62
|
on:keypress={() => {if(expandOn == 'click' && !mAndDown) sidebarExpanded = true}}
|
|
63
63
|
use:clickOutside
|
|
64
64
|
on:clickoutside={() => {if(expandOn == 'click') sidebarExpanded = false}}
|
|
65
|
-
class="side-bar {clazz.header}"
|
|
65
|
+
class="side-bar {clazz.header || ''}"
|
|
66
66
|
>
|
|
67
67
|
<div class="side-bar-content">
|
|
68
68
|
<slot name="sidebar" hamburgerVisible={mAndDown} {sidebarExpanded}>
|
|
@@ -140,7 +140,7 @@ let sidebarExpanded = false;
|
|
|
140
140
|
var(--unstable-divided-side-bar-layout-default-side-bar-padding)
|
|
141
141
|
);
|
|
142
142
|
z-index: 10;
|
|
143
|
-
overflow:
|
|
143
|
+
overflow: clip;
|
|
144
144
|
transition: all .2s cubic-bezier(.4,0,.2,1);
|
|
145
145
|
}
|
|
146
146
|
|
|
@@ -8,7 +8,7 @@ import Button from "../buttons/Button.svelte";
|
|
|
8
8
|
import { createEventDispatcher } from "svelte";
|
|
9
9
|
let clazz = {};
|
|
10
10
|
export { clazz as class };
|
|
11
|
-
export let selectedYear = (/* @__PURE__ */ new Date()).getFullYear(), selectedMonth = (/* @__PURE__ */ new Date()).getMonth(), selectedDate =
|
|
11
|
+
export let selectedYear = (/* @__PURE__ */ new Date()).getFullYear(), selectedMonth = (/* @__PURE__ */ new Date()).getMonth(), selectedDate = void 0, visibleMonth = selectedMonth, visibleYear = selectedYear, view = "day", locale = "it", selectableYears = [...Array(150).keys()].map(
|
|
12
12
|
(i) => i + ((/* @__PURE__ */ new Date()).getFullYear() - 75)
|
|
13
13
|
);
|
|
14
14
|
let dispatch = createEventDispatcher();
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--time-picker-default-primary-color: rgb(var(--global-color-primary-600));
|
|
3
|
+
--time-picker-default-height: 400px;
|
|
4
|
+
--time-picker-default-width: 100%;
|
|
5
|
+
--time-picker-default-header-background-color: rgb(var(--global-color-primary-600));
|
|
6
|
+
--time-picker-default-header-color: rgb(var(--global-color-grey-50));
|
|
7
|
+
--time-picker-default-box-shadow: 0 4px 6px -1px rgb(var(--global-color-contrast-300), .1),
|
|
8
|
+
0 2px 4px -2px rgb(var(--global-color-contrast-300), .1);
|
|
9
|
+
--time-picker-default-overflow: hidden;
|
|
10
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<script>import "../../../css/main.css";
|
|
2
|
+
import "./TimePicker.css";
|
|
3
|
+
import { DateTime } from "luxon";
|
|
4
|
+
import { createEventDispatcher } from "svelte";
|
|
5
|
+
import Icon from "../media/Icon.svelte";
|
|
6
|
+
let clazz = {};
|
|
7
|
+
export { clazz as class };
|
|
8
|
+
export let selectedTime = void 0, locale = "it-IT";
|
|
9
|
+
let hours = "00";
|
|
10
|
+
let dispatch = createEventDispatcher();
|
|
11
|
+
let buildUpHours = hours;
|
|
12
|
+
function handleHoursInput(e) {
|
|
13
|
+
setTimeout(() => {
|
|
14
|
+
let inserted = e.key;
|
|
15
|
+
if (inserted == "Backspace") {
|
|
16
|
+
if (Number(buildUpHours) < 10) {
|
|
17
|
+
buildUpHours = "00";
|
|
18
|
+
} else {
|
|
19
|
+
buildUpHours = "0" + (buildUpHours.at(0) || "0");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"].includes(inserted)) {
|
|
23
|
+
if (Number(buildUpHours) < 10) {
|
|
24
|
+
buildUpHours = `${Number(buildUpHours)}${inserted}`;
|
|
25
|
+
} else {
|
|
26
|
+
buildUpHours = `${buildUpHours.at(1)}${inserted}`;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
hours = buildUpHours;
|
|
30
|
+
}, 10);
|
|
31
|
+
}
|
|
32
|
+
$:
|
|
33
|
+
hours = buildUpHours;
|
|
34
|
+
$:
|
|
35
|
+
console.log(hours);
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<div
|
|
39
|
+
class="container {clazz.container || ''}"
|
|
40
|
+
>
|
|
41
|
+
<div
|
|
42
|
+
class="header {clazz.header || ''}"
|
|
43
|
+
>
|
|
44
|
+
<h2>
|
|
45
|
+
{#if !!selectedTime}
|
|
46
|
+
{DateTime.fromJSDate(selectedTime).setLocale(locale).toLocaleString(DateTime.TIME_24_SIMPLE)}
|
|
47
|
+
{/if}
|
|
48
|
+
</h2>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="body">
|
|
51
|
+
<div class="time-switch">
|
|
52
|
+
<button
|
|
53
|
+
class="icon-button"
|
|
54
|
+
>
|
|
55
|
+
<Icon
|
|
56
|
+
name="mdi-chevron-up"
|
|
57
|
+
--icon-size="20pt"
|
|
58
|
+
></Icon>
|
|
59
|
+
</button>
|
|
60
|
+
<input
|
|
61
|
+
type="text"
|
|
62
|
+
class="transparent-input"
|
|
63
|
+
bind:value={hours}
|
|
64
|
+
on:keydown={handleHoursInput}
|
|
65
|
+
/>
|
|
66
|
+
<button
|
|
67
|
+
class="icon-button"
|
|
68
|
+
>
|
|
69
|
+
<Icon
|
|
70
|
+
name="mdi-chevron-down"
|
|
71
|
+
--icon-size="20pt"
|
|
72
|
+
></Icon>
|
|
73
|
+
</button>
|
|
74
|
+
</div>
|
|
75
|
+
<div>:</div>
|
|
76
|
+
<input type="text" class="transparent-input" maxlength="2" />
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<style>
|
|
81
|
+
.container {
|
|
82
|
+
border-radius: 5px;
|
|
83
|
+
height: var(
|
|
84
|
+
--time-picker-height,
|
|
85
|
+
var(--time-picker-default-height)
|
|
86
|
+
);
|
|
87
|
+
width: var(
|
|
88
|
+
--time-picker-width,
|
|
89
|
+
var(--time-picker-default-width)
|
|
90
|
+
);
|
|
91
|
+
box-shadow: var(
|
|
92
|
+
--time-picker-box-shadow,
|
|
93
|
+
var(--time-picker-default-box-shadow)
|
|
94
|
+
);
|
|
95
|
+
overflow: var(
|
|
96
|
+
--time-picker-overflow,
|
|
97
|
+
var(--time-picker-default-overflow)
|
|
98
|
+
);
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: column;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.header {
|
|
104
|
+
border-radius: 5px 5px 0 0;
|
|
105
|
+
background-color: var(
|
|
106
|
+
--time-picker-header-background-color,
|
|
107
|
+
var(--time-picker-default-header-background-color)
|
|
108
|
+
);
|
|
109
|
+
height: calc(var(--time-picker-height, var(--time-picker-default-height)) / 4);
|
|
110
|
+
color: var(
|
|
111
|
+
--time-picker-header-color,
|
|
112
|
+
var(--time-picker-default-header-color)
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.header > h2 {
|
|
117
|
+
margin-left: 15px;
|
|
118
|
+
margin-top: 5px;
|
|
119
|
+
transition: 0.1s;
|
|
120
|
+
opacity: 0.8;
|
|
121
|
+
}
|
|
122
|
+
.header > h2:hover {
|
|
123
|
+
opacity: 1;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.body {
|
|
128
|
+
flex-grow: 1;
|
|
129
|
+
display: flex;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
align-items: center;
|
|
132
|
+
gap: 8px
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.transparent-input {
|
|
136
|
+
border: 2px solid rgb(var(--global-color-contrast-200));
|
|
137
|
+
border-radius: 5px;
|
|
138
|
+
width: 36px;
|
|
139
|
+
text-align: center;
|
|
140
|
+
outline: none;
|
|
141
|
+
background-color: transparent;
|
|
142
|
+
padding: 4px 8px;
|
|
143
|
+
color: rgb(var(--global-color-contrast-900));
|
|
144
|
+
transition: all .1s cubic-bezier(0.075, 0.82, 0.165, 1);
|
|
145
|
+
font-size: 24pt;
|
|
146
|
+
caret-color: transparent;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.transparent-input:hover, .transparent-input:focus {
|
|
150
|
+
border-color: rgb(var(--global-color-primary-500));
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.time-switch {
|
|
154
|
+
display: flex;
|
|
155
|
+
flex-direction: column;
|
|
156
|
+
gap: 8px;
|
|
157
|
+
align-items: center;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.icon-button {
|
|
161
|
+
background: none;
|
|
162
|
+
border: none;
|
|
163
|
+
padding: 0;
|
|
164
|
+
margin: 0;
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
outline: none;
|
|
167
|
+
color: inherit;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import '../../../css/main.css';
|
|
3
|
+
import './TimePicker.css';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
class?: {
|
|
7
|
+
container?: string | undefined;
|
|
8
|
+
header?: string | undefined;
|
|
9
|
+
selectorRow?: string | undefined;
|
|
10
|
+
} | undefined;
|
|
11
|
+
selectedTime?: Date | null | undefined;
|
|
12
|
+
locale?: "it-IT" | "en-EN" | undefined;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
};
|
|
17
|
+
slots: {};
|
|
18
|
+
};
|
|
19
|
+
export type TimePickerProps = typeof __propDef.props;
|
|
20
|
+
export type TimePickerEvents = typeof __propDef.events;
|
|
21
|
+
export type TimePickerSlots = typeof __propDef.slots;
|
|
22
|
+
export default class TimePicker extends SvelteComponentTyped<TimePickerProps, TimePickerEvents, TimePickerSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { default as Calendar } from './components/simple/dates/Calendar.svelte';
|
|
|
9
9
|
export { default as DatePicker } from './components/simple/dates/DatePicker.svelte';
|
|
10
10
|
export { default as MonthSelector } from './components/simple/dates/MonthSelector.svelte';
|
|
11
11
|
export { default as TimePickerTextField } from './components/simple/dates/TimePickerTextField.svelte';
|
|
12
|
-
export { default as DatePickerTextField } from './components/
|
|
12
|
+
export { default as DatePickerTextField } from './components/composed/forms/DatePickerTextField.svelte';
|
|
13
13
|
export { default as YearSelector } from './components/simple/dates/YearSelector.svelte';
|
|
14
14
|
export { default as Dialog } from './components/simple/dialogs/Dialog.svelte';
|
|
15
15
|
export { default as Autocomplete } from './components/simple/forms/Autocomplete.svelte';
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export { default as Calendar } from './components/simple/dates/Calendar.svelte';
|
|
|
9
9
|
export { default as DatePicker } from './components/simple/dates/DatePicker.svelte';
|
|
10
10
|
export { default as MonthSelector } from './components/simple/dates/MonthSelector.svelte';
|
|
11
11
|
export { default as TimePickerTextField } from './components/simple/dates/TimePickerTextField.svelte';
|
|
12
|
-
export { default as DatePickerTextField } from './components/
|
|
12
|
+
export { default as DatePickerTextField } from './components/composed/forms/DatePickerTextField.svelte';
|
|
13
13
|
export { default as YearSelector } from './components/simple/dates/YearSelector.svelte';
|
|
14
14
|
export { default as Dialog } from './components/simple/dialogs/Dialog.svelte';
|
|
15
15
|
export { default as Autocomplete } from './components/simple/forms/Autocomplete.svelte';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JoinModifier } from "./modifiers/join";
|
|
2
|
-
import type { WhereModifier } from "./modifiers/where";
|
|
2
|
+
import type { WhereModifier, WhereFilterValue } from "./modifiers/where";
|
|
3
3
|
export type Modifier = WhereModifier | JoinModifier;
|
|
4
4
|
export type JsonQuery = {
|
|
5
5
|
modifiers: Modifier[];
|
|
@@ -8,21 +8,21 @@ export default class Builder {
|
|
|
8
8
|
private modifiers;
|
|
9
9
|
constructor();
|
|
10
10
|
where(callback: (builder: Builder) => void): Builder;
|
|
11
|
-
where(key: Record<string,
|
|
12
|
-
where(key: string, value:
|
|
13
|
-
where(key: string, operator: string, value:
|
|
11
|
+
where(key: Record<string, WhereFilterValue>): Builder;
|
|
12
|
+
where(key: string, value: WhereFilterValue): Builder;
|
|
13
|
+
where(key: string, operator: string, value: WhereFilterValue | boolean): Builder;
|
|
14
14
|
whereNot(callback: (builder: Builder) => void): Builder;
|
|
15
|
-
whereNot(key: Record<string,
|
|
16
|
-
whereNot(key: string, value:
|
|
17
|
-
whereNot(key: string, operator: string, value:
|
|
15
|
+
whereNot(key: Record<string, WhereFilterValue>): Builder;
|
|
16
|
+
whereNot(key: string, value: WhereFilterValue): Builder;
|
|
17
|
+
whereNot(key: string, operator: string, value: WhereFilterValue): Builder;
|
|
18
18
|
orWhere(callback: (builder: Builder) => void): Builder;
|
|
19
|
-
orWhere(key: Record<string,
|
|
20
|
-
orWhere(key: string, value:
|
|
21
|
-
orWhere(key: string, operator: string, value:
|
|
19
|
+
orWhere(key: Record<string, WhereFilterValue>): Builder;
|
|
20
|
+
orWhere(key: string, value: WhereFilterValue): Builder;
|
|
21
|
+
orWhere(key: string, operator: string, value: WhereFilterValue): Builder;
|
|
22
22
|
orWhereNot(callback: (builder: Builder) => void): Builder;
|
|
23
|
-
orWhereNot(key: Record<string,
|
|
24
|
-
orWhereNot(key: string, value:
|
|
25
|
-
orWhereNot(key: string, operator: string, value:
|
|
23
|
+
orWhereNot(key: Record<string, WhereFilterValue>): Builder;
|
|
24
|
+
orWhereNot(key: string, value: WhereFilterValue): Builder;
|
|
25
|
+
orWhereNot(key: string, operator: string, value: WhereFilterValue): Builder;
|
|
26
26
|
private applyWhereClause;
|
|
27
27
|
join(table: string, onCallback: (onBuilder: OnClauseBuilder) => void): this;
|
|
28
28
|
leftJoin(table: string, onCallback: (onBuilder: OnClauseBuilder) => void): this;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type WhereFilterValue = string | number | Date | boolean;
|
|
1
2
|
type GroupedWhere = {
|
|
2
3
|
method: 'where';
|
|
3
4
|
kind: 'grouped';
|
|
@@ -8,7 +9,7 @@ type ObjectWhere = {
|
|
|
8
9
|
method: 'where';
|
|
9
10
|
kind: 'object';
|
|
10
11
|
logicalOperator?: 'and' | 'or' | 'andNot' | 'orNot';
|
|
11
|
-
values: Record<string,
|
|
12
|
+
values: Record<string, WhereFilterValue>;
|
|
12
13
|
};
|
|
13
14
|
type SimpleWhere = {
|
|
14
15
|
method: 'where';
|
|
@@ -16,14 +17,14 @@ type SimpleWhere = {
|
|
|
16
17
|
logicalOperator?: 'and' | 'or' | 'andNot' | 'orNot';
|
|
17
18
|
key: string;
|
|
18
19
|
operator?: string;
|
|
19
|
-
value:
|
|
20
|
+
value: WhereFilterValue | boolean;
|
|
20
21
|
};
|
|
21
22
|
type InWhere = {
|
|
22
23
|
method: 'where';
|
|
23
24
|
kind: 'in';
|
|
24
25
|
logicalOperator?: 'and' | 'or' | 'andNot' | 'orNot';
|
|
25
26
|
key: string;
|
|
26
|
-
value: (
|
|
27
|
+
value: (WhereFilterValue)[];
|
|
27
28
|
};
|
|
28
29
|
export type WhereModifier = SimpleWhere | ObjectWhere | GroupedWhere | InWhere;
|
|
29
30
|
export {};
|