@max-ts/svelte 1.6.2 → 1.7.2
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/assets/src/components/Drawer/styles.css.ts.vanilla-BblmUQZx.css +130 -0
- package/dist/assets/src/components/RangeInput/{styles.css.ts.vanilla-B_0PcDN7.css → styles.css.ts.vanilla-B14tcXWf.css} +15 -12
- package/dist/components/Drawer/Close/Close.js +21 -0
- package/dist/components/Drawer/Close/Close.svelte.d.ts +4 -0
- package/dist/components/Drawer/Close/index.d.ts +1 -0
- package/dist/components/Drawer/Content/Content.js +129 -0
- package/dist/components/Drawer/Content/Content.svelte.d.ts +4 -0
- package/dist/components/Drawer/Content/index.d.ts +1 -0
- package/dist/components/Drawer/Description/Description.js +33 -0
- package/dist/components/Drawer/Description/Description.svelte.d.ts +4 -0
- package/dist/components/Drawer/Description/index.d.ts +1 -0
- package/dist/components/Drawer/Drawer.js +69 -0
- package/dist/components/Drawer/Drawer.svelte.d.ts +8 -0
- package/dist/components/Drawer/Footer/Footer.js +32 -0
- package/dist/components/Drawer/Footer/Footer.svelte.d.ts +4 -0
- package/dist/components/Drawer/Footer/index.d.ts +1 -0
- package/dist/components/Drawer/Header/Header.js +32 -0
- package/dist/components/Drawer/Header/Header.svelte.d.ts +4 -0
- package/dist/components/Drawer/Header/index.d.ts +1 -0
- package/dist/components/Drawer/Overlay/Overlay.js +43 -0
- package/dist/components/Drawer/Overlay/Overlay.svelte.d.ts +4 -0
- package/dist/components/Drawer/Overlay/index.d.ts +1 -0
- package/dist/components/Drawer/Portal/Portal.js +30 -0
- package/dist/components/Drawer/Portal/Portal.svelte.d.ts +3 -0
- package/dist/components/Drawer/Portal/index.d.ts +1 -0
- package/dist/components/Drawer/Title/Title.js +33 -0
- package/dist/components/Drawer/Title/Title.svelte.d.ts +4 -0
- package/dist/components/Drawer/Title/index.d.ts +1 -0
- package/dist/components/Drawer/Trigger/Trigger.js +21 -0
- package/dist/components/Drawer/Trigger/Trigger.svelte.d.ts +4 -0
- package/dist/components/Drawer/Trigger/index.d.ts +1 -0
- package/dist/components/Drawer/context.d.ts +7 -0
- package/dist/components/Drawer/context.js +9 -0
- package/dist/components/Drawer/index.d.ts +24 -0
- package/dist/components/Drawer/index.js +27 -0
- package/dist/components/Drawer/styles.css.d.ts +13 -0
- package/dist/components/Drawer/styles.css.js +19 -0
- package/dist/components/Drawer/types.d.ts +22 -0
- package/dist/components/RangeInput/RangeInput.js +84 -81
- package/dist/components/RangeInput/RangeInput.svelte.d.ts +1 -1
- package/dist/components/RangeInput/styles.css.d.ts +5 -4
- package/dist/components/RangeInput/styles.css.js +9 -8
- package/dist/components/RangeInput/types.d.ts +3 -3
- package/dist/components/RangeInput/utils.d.ts +2 -0
- package/dist/components/RangeInput/utils.js +10 -0
- package/dist/components/Slider/Slider.js +14 -13
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -1
- package/dist/stories/Drawer.stories.svelte.d.ts +19 -0
- package/package.json +10 -10
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import __default__ from "../styles.css.js";
|
|
2
|
+
import "svelte/internal/disclose-version";
|
|
3
|
+
import * as $ from "svelte/internal/client";
|
|
4
|
+
import { Dialog } from "bits-ui";
|
|
5
|
+
|
|
6
|
+
//#region src/components/Drawer/Title/Title.svelte
|
|
7
|
+
function Title($$anchor, $$props) {
|
|
8
|
+
$.push($$props, true);
|
|
9
|
+
const restProps = $.rest_props($$props, [
|
|
10
|
+
"$$slots",
|
|
11
|
+
"$$events",
|
|
12
|
+
"$$legacy",
|
|
13
|
+
"class"
|
|
14
|
+
]);
|
|
15
|
+
var fragment = $.comment();
|
|
16
|
+
var node = $.first_child(fragment);
|
|
17
|
+
{
|
|
18
|
+
let $0 = $.derived(() => [__default__.title, $$props.class]);
|
|
19
|
+
$.component(node, () => Dialog.Title, ($$anchor, DialogPrimitive_Title) => {
|
|
20
|
+
DialogPrimitive_Title($$anchor, $.spread_props({
|
|
21
|
+
"data-slot": "drawer-title",
|
|
22
|
+
get class() {
|
|
23
|
+
return $.get($0);
|
|
24
|
+
}
|
|
25
|
+
}, () => restProps));
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
$.append($$anchor, fragment);
|
|
29
|
+
$.pop();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Title as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Title } from './Title.svelte';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "svelte/internal/disclose-version";
|
|
2
|
+
import * as $ from "svelte/internal/client";
|
|
3
|
+
import { Dialog } from "bits-ui";
|
|
4
|
+
|
|
5
|
+
//#region src/components/Drawer/Trigger/Trigger.svelte
|
|
6
|
+
function Trigger($$anchor, $$props) {
|
|
7
|
+
let restProps = $.rest_props($$props, [
|
|
8
|
+
"$$slots",
|
|
9
|
+
"$$events",
|
|
10
|
+
"$$legacy"
|
|
11
|
+
]);
|
|
12
|
+
var fragment = $.comment();
|
|
13
|
+
var node = $.first_child(fragment);
|
|
14
|
+
$.component(node, () => Dialog.Trigger, ($$anchor, DialogPrimitive_Trigger) => {
|
|
15
|
+
DialogPrimitive_Trigger($$anchor, $.spread_props({ "data-slot": "drawer-trigger" }, () => restProps));
|
|
16
|
+
});
|
|
17
|
+
$.append($$anchor, fragment);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { Trigger as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Trigger } from './Trigger.svelte';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { getContext, setContext } from "svelte";
|
|
2
|
+
|
|
3
|
+
//#region src/components/Drawer/context.ts
|
|
4
|
+
const drawerContextKey = Symbol("drawer-context");
|
|
5
|
+
const setDrawerContext = (value) => setContext(drawerContextKey, value);
|
|
6
|
+
const getDrawerContext = () => getContext(drawerContextKey);
|
|
7
|
+
|
|
8
|
+
//#endregion
|
|
9
|
+
export { getDrawerContext, setDrawerContext };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const Drawer: {
|
|
2
|
+
Root: import("svelte").Component<{
|
|
3
|
+
open?: boolean;
|
|
4
|
+
onOpenChange?: import("node_modules/bits-ui/dist/internal/types").OnChangeFn<boolean>;
|
|
5
|
+
onOpenChangeComplete?: import("node_modules/bits-ui/dist/internal/types").OnChangeFn<boolean>;
|
|
6
|
+
} & {
|
|
7
|
+
children?: import("svelte").Snippet | undefined;
|
|
8
|
+
} & {
|
|
9
|
+
notCloseable?: boolean;
|
|
10
|
+
shouldScaleBackground?: boolean;
|
|
11
|
+
} & {
|
|
12
|
+
children?: import("svelte").Snippet;
|
|
13
|
+
}, {}, "open">;
|
|
14
|
+
Trigger: import("svelte").Component<import("bits-ui").AlertDialogTriggerProps, {}, "">;
|
|
15
|
+
Close: import("svelte").Component<import("bits-ui").AlertDialogTriggerProps, {}, "">;
|
|
16
|
+
Content: import("svelte").Component<import("./types").DrawerContentProps, {}, "">;
|
|
17
|
+
Overlay: import("svelte").Component<import("bits-ui").AlertDialogOverlayProps, {}, "">;
|
|
18
|
+
Portal: import("svelte").Component<import("bits-ui").PortalProps, {}, "">;
|
|
19
|
+
Header: import("svelte").Component<import("./types").DrawerHeaderProps, {}, "ref">;
|
|
20
|
+
Footer: import("svelte").Component<import("./types").DrawerFooterProps, {}, "ref">;
|
|
21
|
+
Title: import("svelte").Component<import("bits-ui").AlertDialogTitleProps, {}, "">;
|
|
22
|
+
Description: import("svelte").Component<import("bits-ui").AlertDialogDescriptionProps, {}, "">;
|
|
23
|
+
};
|
|
24
|
+
export type * from './types';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Close from "./Close/Close.js";
|
|
2
|
+
import Overlay from "./Overlay/Overlay.js";
|
|
3
|
+
import Portal from "./Portal/Portal.js";
|
|
4
|
+
import Content from "./Content/Content.js";
|
|
5
|
+
import Description from "./Description/Description.js";
|
|
6
|
+
import Drawer$1 from "./Drawer.js";
|
|
7
|
+
import Footer from "./Footer/Footer.js";
|
|
8
|
+
import Header from "./Header/Header.js";
|
|
9
|
+
import Title from "./Title/Title.js";
|
|
10
|
+
import Trigger from "./Trigger/Trigger.js";
|
|
11
|
+
|
|
12
|
+
//#region src/components/Drawer/index.ts
|
|
13
|
+
const Drawer = {
|
|
14
|
+
Root: Drawer$1,
|
|
15
|
+
Trigger,
|
|
16
|
+
Close,
|
|
17
|
+
Content,
|
|
18
|
+
Overlay,
|
|
19
|
+
Portal,
|
|
20
|
+
Header,
|
|
21
|
+
Footer,
|
|
22
|
+
Title,
|
|
23
|
+
Description
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { Drawer };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
overlay: string;
|
|
3
|
+
visuallyHidden: string;
|
|
4
|
+
handle: string;
|
|
5
|
+
closeButton: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
header: string;
|
|
9
|
+
footer: string;
|
|
10
|
+
content: string;
|
|
11
|
+
contentTransition: string;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "./../../assets/src/theme.css.ts.vanilla-HT3RGHeI.css";
|
|
2
|
+
import "./../../assets/src/components/Drawer/styles.css.ts.vanilla-BblmUQZx.css";
|
|
3
|
+
|
|
4
|
+
//#region src/components/Drawer/styles.css.ts
|
|
5
|
+
var __default__ = {
|
|
6
|
+
overlay: "styles_overlay__1rbt3ly3",
|
|
7
|
+
visuallyHidden: "styles_visuallyHidden__1rbt3lyc",
|
|
8
|
+
handle: "styles_handle__1rbt3lyb",
|
|
9
|
+
closeButton: "styles_closeButton__1rbt3lya",
|
|
10
|
+
title: "styles_title__1rbt3ly8",
|
|
11
|
+
description: "styles_description__1rbt3ly9",
|
|
12
|
+
header: "styles_header__1rbt3ly6",
|
|
13
|
+
footer: "styles_footer__1rbt3ly7",
|
|
14
|
+
content: "styles_content__1rbt3ly4",
|
|
15
|
+
contentTransition: "styles_contentTransition__1rbt3ly5"
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { __default__ as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Dialog as DialogPrimitive } from 'bits-ui';
|
|
2
|
+
import type { Snippet } from 'svelte';
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
+
import type { WithElementRef, WithoutChildrenOrChild } from '../../types';
|
|
5
|
+
export type DrawerProps = DialogPrimitive.RootProps & {
|
|
6
|
+
notCloseable?: boolean;
|
|
7
|
+
shouldScaleBackground?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type DrawerTriggerProps = DialogPrimitive.TriggerProps;
|
|
10
|
+
export type DrawerCloseProps = DialogPrimitive.CloseProps;
|
|
11
|
+
export type DrawerPortalProps = DialogPrimitive.PortalProps;
|
|
12
|
+
export type DrawerOverlayProps = DialogPrimitive.OverlayProps;
|
|
13
|
+
export type DrawerTitleProps = DialogPrimitive.TitleProps;
|
|
14
|
+
export type DrawerDescriptionProps = DialogPrimitive.DescriptionProps;
|
|
15
|
+
export type DrawerContentProps = WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {
|
|
16
|
+
showCloseButton?: boolean;
|
|
17
|
+
swipeCloseThreshold?: number;
|
|
18
|
+
portalProps?: WithoutChildrenOrChild<DrawerPortalProps>;
|
|
19
|
+
children?: Snippet;
|
|
20
|
+
};
|
|
21
|
+
export type DrawerHeaderProps = WithElementRef<HTMLAttributes<HTMLDivElement>>;
|
|
22
|
+
export type DrawerFooterProps = WithElementRef<HTMLAttributes<HTMLDivElement>>;
|
|
@@ -2,14 +2,15 @@ import Typography from "../Typography/Typography.js";
|
|
|
2
2
|
import { calculateSize } from "../../utils.js";
|
|
3
3
|
import Slider from "../Slider/Slider.js";
|
|
4
4
|
import __default__ from "./styles.css.js";
|
|
5
|
+
import { formatNumber, parseFormattedNumber } from "./utils.js";
|
|
5
6
|
import "svelte/internal/disclose-version";
|
|
6
7
|
import * as $ from "svelte/internal/client";
|
|
7
8
|
|
|
8
9
|
//#region src/components/RangeInput/RangeInput.svelte
|
|
9
|
-
var root = $.from_html(`<div><!>
|
|
10
|
+
var root = $.from_html(`<div><!> <input type="text" inputmode="numeric" name="min"/> <!> <input type="text" inputmode="numeric" name="max"/> <!> <!></div>`);
|
|
10
11
|
function RangeInput($$anchor, $$props) {
|
|
11
12
|
$.push($$props, true);
|
|
12
|
-
let
|
|
13
|
+
let min = $.prop($$props, "min", 3, 0), max = $.prop($$props, "max", 3, 100), minValue = $.prop($$props, "minValue", 31, () => $.proxy(min())), maxValue = $.prop($$props, "maxValue", 31, () => $.proxy(max())), width = $.prop($$props, "width", 3, 180), step = $.prop($$props, "step", 3, 1), size = $.prop($$props, "size", 3, "medium"), ref = $.prop($$props, "ref", 15, null), restProps = $.rest_props($$props, [
|
|
13
14
|
"$$slots",
|
|
14
15
|
"$$events",
|
|
15
16
|
"$$legacy",
|
|
@@ -18,155 +19,157 @@ function RangeInput($$anchor, $$props) {
|
|
|
18
19
|
"minValue",
|
|
19
20
|
"maxValue",
|
|
20
21
|
"width",
|
|
21
|
-
"
|
|
22
|
+
"step",
|
|
22
23
|
"unit",
|
|
23
24
|
"size",
|
|
24
25
|
"class",
|
|
25
26
|
"isActive",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"ref"
|
|
29
|
-
]);
|
|
30
|
-
const containerClass = $.derived(() => [
|
|
31
|
-
__default__.container,
|
|
32
|
-
__default__.sizes[size()],
|
|
33
|
-
{ [__default__.activeClass]: $$props.isActive },
|
|
34
|
-
$$props.class
|
|
27
|
+
"ref",
|
|
28
|
+
"onValueChange"
|
|
35
29
|
]);
|
|
30
|
+
let innerMin = $.state($.proxy(minValue()));
|
|
31
|
+
let innerMax = $.state($.proxy(maxValue()));
|
|
32
|
+
$.user_effect(() => {
|
|
33
|
+
$.set(innerMin, minValue() || min(), true);
|
|
34
|
+
$.set(innerMax, maxValue() || max(), true);
|
|
35
|
+
});
|
|
36
36
|
const calculatedWidth = $.derived(() => calculateSize(width()));
|
|
37
|
-
$.
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
const innerMinDisplay = $.derived(() => formatNumber($.get(innerMin)));
|
|
38
|
+
const innerMaxDisplay = $.derived(() => formatNumber($.get(innerMax)));
|
|
39
|
+
const adaptiveStep = $.derived(() => {
|
|
40
|
+
const range = max() - min();
|
|
41
|
+
return Math.max(step(), Math.ceil(range / 1e3));
|
|
40
42
|
});
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
function applyValues(newMin, newMax) {
|
|
44
|
+
const clampedMin = Math.max(min(), Math.min(newMin, newMax));
|
|
45
|
+
const clampedMax = Math.min(max(), Math.max(newMax, newMin));
|
|
46
|
+
$.set(innerMin, clampedMin, true);
|
|
47
|
+
$.set(innerMax, clampedMax, true);
|
|
48
|
+
minValue(clampedMin);
|
|
49
|
+
maxValue(clampedMax);
|
|
50
|
+
$$props.onValueChange?.([clampedMin, clampedMax]);
|
|
51
|
+
}
|
|
52
|
+
function handleInput(e) {
|
|
53
|
+
const target = e.target;
|
|
54
|
+
let value = parseFormattedNumber(target.value.replace(/[^\d\s]/g, ""));
|
|
55
|
+
if (Number.isNaN(value)) value = target.name === "min" ? min() : max();
|
|
56
|
+
if (target.name === "min") applyValues(Math.max(min(), Math.min(value, $.get(innerMax))), $.get(innerMax));
|
|
57
|
+
else applyValues($.get(innerMin), Math.min(max(), Math.max(value, $.get(innerMin))));
|
|
58
|
+
}
|
|
59
|
+
function handleBlur() {
|
|
60
|
+
applyValues($.get(innerMin), $.get(innerMax));
|
|
46
61
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
49
|
-
if (val === "") return;
|
|
50
|
-
const num = Number.parseFloat(val);
|
|
51
|
-
if (!Number.isNaN(num)) if (type === "min") minValue(num);
|
|
52
|
-
else maxValue(num);
|
|
62
|
+
function handleKeyDown(e) {
|
|
63
|
+
if (e.key === "Enter") e.target.blur();
|
|
53
64
|
}
|
|
54
|
-
function
|
|
55
|
-
if (
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (minValue() && maxValue() && minValue() > maxValue()) {
|
|
59
|
-
const temp = minValue();
|
|
60
|
-
minValue(maxValue());
|
|
61
|
-
maxValue(temp);
|
|
62
|
-
}
|
|
65
|
+
function handleSliderChange(value) {
|
|
66
|
+
if (value.length === 2) {
|
|
67
|
+
$.set(innerMin, value[0], true);
|
|
68
|
+
$.set(innerMax, value[1], true);
|
|
63
69
|
}
|
|
64
70
|
}
|
|
71
|
+
function handleSliderCommit(value) {
|
|
72
|
+
if (value.length === 2) applyValues(value[0], value[1]);
|
|
73
|
+
}
|
|
65
74
|
var div = root();
|
|
66
75
|
$.attribute_effect(div, () => ({
|
|
67
|
-
class:
|
|
76
|
+
class: [
|
|
77
|
+
__default__.container,
|
|
78
|
+
__default__.sizes[size()],
|
|
79
|
+
{ [__default__.active]: $$props.isActive },
|
|
80
|
+
$$props.class
|
|
81
|
+
],
|
|
68
82
|
...restProps,
|
|
69
83
|
[$.STYLE]: { width: $.get(calculatedWidth) }
|
|
70
84
|
}));
|
|
71
85
|
var node = $.child(div);
|
|
72
86
|
Typography(node, {
|
|
73
87
|
get class() {
|
|
74
|
-
return __default__.
|
|
88
|
+
return __default__.text;
|
|
75
89
|
},
|
|
76
90
|
color: "disabled",
|
|
77
91
|
variant: "body2",
|
|
78
92
|
children: ($$anchor, $$slotProps) => {
|
|
79
93
|
$.next();
|
|
80
|
-
var text = $.text();
|
|
81
|
-
$.template_effect(() => $.set_text(text, $$props.label));
|
|
94
|
+
var text = $.text("от");
|
|
82
95
|
$.append($$anchor, text);
|
|
83
96
|
},
|
|
84
97
|
$$slots: { default: true }
|
|
85
98
|
});
|
|
86
|
-
var
|
|
99
|
+
var input = $.sibling(node, 2);
|
|
100
|
+
$.remove_input_defaults(input);
|
|
101
|
+
input.__input = handleInput;
|
|
102
|
+
input.__keydown = handleKeyDown;
|
|
103
|
+
var node_1 = $.sibling(input, 2);
|
|
87
104
|
Typography(node_1, {
|
|
88
105
|
get class() {
|
|
89
|
-
return __default__.
|
|
106
|
+
return __default__.text;
|
|
90
107
|
},
|
|
91
108
|
color: "disabled",
|
|
92
109
|
variant: "body2",
|
|
93
110
|
children: ($$anchor, $$slotProps) => {
|
|
94
111
|
$.next();
|
|
95
|
-
var text_1 = $.text("
|
|
112
|
+
var text_1 = $.text("до");
|
|
96
113
|
$.append($$anchor, text_1);
|
|
97
114
|
},
|
|
98
115
|
$$slots: { default: true }
|
|
99
116
|
});
|
|
100
|
-
var
|
|
101
|
-
$.remove_input_defaults(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
var node_2 = $.sibling(input, 2);
|
|
117
|
+
var input_1 = $.sibling(node_1, 2);
|
|
118
|
+
$.remove_input_defaults(input_1);
|
|
119
|
+
input_1.__input = handleInput;
|
|
120
|
+
input_1.__keydown = handleKeyDown;
|
|
121
|
+
var node_2 = $.sibling(input_1, 2);
|
|
106
122
|
Typography(node_2, {
|
|
107
123
|
get class() {
|
|
108
|
-
return __default__.
|
|
124
|
+
return __default__.text;
|
|
109
125
|
},
|
|
110
126
|
color: "disabled",
|
|
111
127
|
variant: "body2",
|
|
112
128
|
children: ($$anchor, $$slotProps) => {
|
|
113
129
|
$.next();
|
|
114
|
-
var text_2 = $.text(
|
|
130
|
+
var text_2 = $.text();
|
|
131
|
+
$.template_effect(() => $.set_text(text_2, $$props.unit));
|
|
115
132
|
$.append($$anchor, text_2);
|
|
116
133
|
},
|
|
117
134
|
$$slots: { default: true }
|
|
118
135
|
});
|
|
119
|
-
var
|
|
120
|
-
$.remove_input_defaults(input_1);
|
|
121
|
-
input_1.__input = (e) => handleInput("max", e);
|
|
122
|
-
input_1.__keydown = onKeyDown;
|
|
123
|
-
$.bind_this(input_1, ($$value) => maxInputRef($$value), () => maxInputRef());
|
|
124
|
-
var node_3 = $.sibling(input_1, 2);
|
|
125
|
-
Typography(node_3, {
|
|
126
|
-
get class() {
|
|
127
|
-
return __default__.textClass;
|
|
128
|
-
},
|
|
129
|
-
color: "disabled",
|
|
130
|
-
variant: "body2",
|
|
131
|
-
children: ($$anchor, $$slotProps) => {
|
|
132
|
-
$.next();
|
|
133
|
-
var text_3 = $.text();
|
|
134
|
-
$.template_effect(() => $.set_text(text_3, $$props.unit));
|
|
135
|
-
$.append($$anchor, text_3);
|
|
136
|
-
},
|
|
137
|
-
$$slots: { default: true }
|
|
138
|
-
});
|
|
139
|
-
var node_4 = $.sibling(node_3, 2);
|
|
136
|
+
var node_3 = $.sibling(node_2, 2);
|
|
140
137
|
{
|
|
141
|
-
let $0 = $.derived(() => [
|
|
142
|
-
Slider(
|
|
138
|
+
let $0 = $.derived(() => [$.get(innerMin), $.get(innerMax)]);
|
|
139
|
+
Slider(node_3, {
|
|
143
140
|
get min() {
|
|
144
|
-
return
|
|
141
|
+
return min();
|
|
145
142
|
},
|
|
146
143
|
get max() {
|
|
147
|
-
return
|
|
144
|
+
return max();
|
|
148
145
|
},
|
|
149
146
|
get size() {
|
|
150
147
|
return size();
|
|
151
148
|
},
|
|
149
|
+
get step() {
|
|
150
|
+
return $.get(adaptiveStep);
|
|
151
|
+
},
|
|
152
152
|
get class() {
|
|
153
|
-
return __default__.
|
|
153
|
+
return __default__.slider;
|
|
154
154
|
},
|
|
155
155
|
type: "multiple",
|
|
156
156
|
get value() {
|
|
157
157
|
return $.get($0);
|
|
158
158
|
},
|
|
159
|
-
onValueChange
|
|
159
|
+
onValueChange: handleSliderChange,
|
|
160
|
+
onValueCommit: handleSliderCommit
|
|
160
161
|
});
|
|
161
162
|
}
|
|
162
163
|
$.reset(div);
|
|
163
164
|
$.bind_this(div, ($$value) => ref($$value), () => ref());
|
|
164
165
|
$.template_effect(() => {
|
|
165
|
-
$.set_class(input, 1, $.clsx(__default__.
|
|
166
|
-
$.
|
|
166
|
+
$.set_class(input, 1, $.clsx(__default__.input));
|
|
167
|
+
$.set_value(input, $.get(innerMinDisplay));
|
|
168
|
+
$.set_class(input_1, 1, $.clsx(__default__.input));
|
|
169
|
+
$.set_value(input_1, $.get(innerMaxDisplay));
|
|
167
170
|
});
|
|
168
|
-
$.
|
|
169
|
-
$.
|
|
171
|
+
$.event("blur", input, handleBlur);
|
|
172
|
+
$.event("blur", input_1, handleBlur);
|
|
170
173
|
$.append($$anchor, div);
|
|
171
174
|
$.pop();
|
|
172
175
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { RangeInputProps } from './types';
|
|
2
|
-
declare const RangeInput: import("svelte").Component<RangeInputProps, {}, "ref" | "minValue" | "maxValue"
|
|
2
|
+
declare const RangeInput: import("svelte").Component<RangeInputProps, {}, "ref" | "minValue" | "maxValue">;
|
|
3
3
|
type RangeInput = ReturnType<typeof RangeInput>;
|
|
4
4
|
export default RangeInput;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { RangeInputSize } from './types';
|
|
2
2
|
declare const _default: {
|
|
3
3
|
container: string;
|
|
4
|
-
|
|
4
|
+
active: string;
|
|
5
5
|
sizes: Record<RangeInputSize, string>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
text: string;
|
|
7
|
+
input: string;
|
|
8
|
+
slider: string;
|
|
9
|
+
fullWidth: string;
|
|
9
10
|
};
|
|
10
11
|
export default _default;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import "./../../assets/src/theme.css.ts.vanilla-HT3RGHeI.css";
|
|
2
|
-
import "./../../assets/src/components/RangeInput/styles.css.ts.vanilla-
|
|
2
|
+
import "./../../assets/src/components/RangeInput/styles.css.ts.vanilla-B14tcXWf.css";
|
|
3
3
|
|
|
4
4
|
//#region src/components/RangeInput/styles.css.ts
|
|
5
5
|
var __default__ = {
|
|
6
6
|
container: "styles_container__14rk0zx0",
|
|
7
|
-
|
|
7
|
+
active: "styles_active__14rk0zx2",
|
|
8
8
|
sizes: {
|
|
9
|
-
small: "
|
|
10
|
-
medium: "
|
|
11
|
-
large: "
|
|
9
|
+
small: "styles_sizes_small__14rk0zx3",
|
|
10
|
+
medium: "styles_sizes_medium__14rk0zx4",
|
|
11
|
+
large: "styles_sizes_large__14rk0zx5"
|
|
12
12
|
},
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
text: "styles_text__14rk0zx6",
|
|
14
|
+
input: "styles_input__14rk0zx7",
|
|
15
|
+
slider: "styles_slider__14rk0zx8",
|
|
16
|
+
fullWidth: "styles_fullWidth__14rk0zx1"
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
//#endregion
|
|
@@ -6,11 +6,11 @@ export interface RangeInputProps extends WithElementRef<HTMLAttributes<HTMLDivEl
|
|
|
6
6
|
maxValue?: number;
|
|
7
7
|
min: number;
|
|
8
8
|
max: number;
|
|
9
|
-
|
|
9
|
+
step?: number;
|
|
10
10
|
unit?: string;
|
|
11
11
|
width?: number | string;
|
|
12
12
|
size?: RangeInputSize;
|
|
13
13
|
isActive?: boolean;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
onValueChange?: (value: number[]) => void;
|
|
15
|
+
id?: string;
|
|
16
16
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/components/RangeInput/utils.ts
|
|
2
|
+
const formatNumber = (num) => {
|
|
3
|
+
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, " ");
|
|
4
|
+
};
|
|
5
|
+
const parseFormattedNumber = (str) => {
|
|
6
|
+
return parseFloat(str.replace(/\s/g, ""));
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { formatNumber, parseFormattedNumber };
|
|
@@ -17,8 +17,6 @@ function Slider$1($$anchor, $$props) {
|
|
|
17
17
|
"class",
|
|
18
18
|
"size"
|
|
19
19
|
]);
|
|
20
|
-
const thumbClass = $.derived(() => [__default__.thumb, __default__.thumbSizes[size()]]);
|
|
21
|
-
const trackClass = $.derived(() => [__default__.track, __default__.trackSizes[size()]]);
|
|
22
20
|
var fragment = $.comment();
|
|
23
21
|
var node = $.first_child(fragment);
|
|
24
22
|
{
|
|
@@ -40,22 +38,25 @@ function Slider$1($$anchor, $$props) {
|
|
|
40
38
|
$.each(node_2, 16, thumbItems, (thumb) => thumb, ($$anchor, thumb) => {
|
|
41
39
|
var fragment_2 = $.comment();
|
|
42
40
|
var node_3 = $.first_child(fragment_2);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
{
|
|
42
|
+
let $0 = $.derived(() => [__default__.thumb, __default__.thumbSizes[size()]]);
|
|
43
|
+
$.component(node_3, () => Slider.Thumb, ($$anchor, SliderPrimitive_Thumb) => {
|
|
44
|
+
SliderPrimitive_Thumb($$anchor, {
|
|
45
|
+
"data-slot": "slider-thumb",
|
|
46
|
+
get index() {
|
|
47
|
+
return thumb.index;
|
|
48
|
+
},
|
|
49
|
+
get class() {
|
|
50
|
+
return $.get($0);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
52
53
|
});
|
|
53
|
-
}
|
|
54
|
+
}
|
|
54
55
|
$.append($$anchor, fragment_2);
|
|
55
56
|
});
|
|
56
57
|
$.template_effect(() => {
|
|
57
58
|
$.set_attribute(span, "data-orientation", orientation());
|
|
58
|
-
$.set_class(span, 1, $.clsx(
|
|
59
|
+
$.set_class(span, 1, $.clsx([__default__.track, __default__.trackSizes[size()]]));
|
|
59
60
|
});
|
|
60
61
|
$.append($$anchor, fragment_1);
|
|
61
62
|
};
|
|
@@ -12,6 +12,7 @@ export { ContentState, type ContentStateErrorProps, type ContentStateProps, } fr
|
|
|
12
12
|
export { DataGrid, type DataGridColumn, type DataGridColumns, type DataGridProps, type DataGridState, } from './DataGrid';
|
|
13
13
|
export { DataGridSortHeader, type DataGridSortHeaderProps, type DataGridSorting, } from './DataGridSortHeader';
|
|
14
14
|
export { Dialog, type DialogCloseProps, type DialogContentProps, type DialogDescriptionProps, type DialogFooterProps, type DialogHeaderProps, type DialogProps, type DialogTitleProps, type DialogTriggerProps, } from './Dialog';
|
|
15
|
+
export { Drawer, type DrawerCloseProps, type DrawerContentProps, type DrawerDescriptionProps, type DrawerFooterProps, type DrawerHeaderProps, type DrawerOverlayProps, type DrawerPortalProps, type DrawerProps, type DrawerTitleProps, type DrawerTriggerProps, } from './Drawer';
|
|
15
16
|
export type { DropdownMenuProps } from './DropdownMenu';
|
|
16
17
|
export * as DropdownMenu from './DropdownMenu';
|
|
17
18
|
export { Empty, type EmptyMediaVariant } from './Empty';
|
package/dist/components/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import ContentState from "./ContentState/ContentState.js";
|
|
|
18
18
|
import DataGrid from "./DataGrid/DataGrid.js";
|
|
19
19
|
import DataGridSortHeader from "./DataGridSortHeader/DataGridSortHeader.js";
|
|
20
20
|
import { Dialog } from "./Dialog/index.js";
|
|
21
|
+
import { Drawer } from "./Drawer/index.js";
|
|
21
22
|
import { DropdownMenu_exports } from "./DropdownMenu/index.js";
|
|
22
23
|
import { Empty } from "./Empty/index.js";
|
|
23
24
|
import Label_1 from "./Label/Label.js";
|
|
@@ -32,4 +33,4 @@ import { Select } from "./Select/index.js";
|
|
|
32
33
|
import { Tabs } from "./Tabs/index.js";
|
|
33
34
|
import Tooltip from "./Tooltip/Tooltip.js";
|
|
34
35
|
|
|
35
|
-
export { Accordion, Alert, Badge, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, CircularProgress, ContentState, DataGrid, DataGridSortHeader, Dialog, DropdownMenu_exports as DropdownMenu, Empty, Field, Input, InputGroup, Item, Label_1 as Label, Placeholder, Popover, RangeInput, Select, Separator, Slider, Spinner, Tabs, Tooltip, Typography, badgeVariants, buttonVariants };
|
|
36
|
+
export { Accordion, Alert, Badge, Button, ButtonGroup, Calendar, Card, Carousel, Checkbox, CircularProgress, ContentState, DataGrid, DataGridSortHeader, Dialog, Drawer, DropdownMenu_exports as DropdownMenu, Empty, Field, Input, InputGroup, Item, Label_1 as Label, Placeholder, Popover, RangeInput, Select, Separator, Slider, Spinner, Tabs, Tooltip, Typography, badgeVariants, buttonVariants };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Drawer } from '../components';
|
|
2
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
3
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
4
|
+
$$bindings?: Bindings;
|
|
5
|
+
} & Exports;
|
|
6
|
+
(internal: unknown, props: {
|
|
7
|
+
$$events?: Events;
|
|
8
|
+
$$slots?: Slots;
|
|
9
|
+
}): Exports & {
|
|
10
|
+
$set?: any;
|
|
11
|
+
$on?: any;
|
|
12
|
+
};
|
|
13
|
+
z_$$bindings?: Bindings;
|
|
14
|
+
}
|
|
15
|
+
declare const Drawer: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
}, {}, {}, string>;
|
|
18
|
+
type Drawer = InstanceType<typeof Drawer>;
|
|
19
|
+
export default Drawer;
|