@max-ts/svelte 1.10.1 → 1.10.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.
|
@@ -9,7 +9,7 @@ import * as $ from "svelte/internal/client";
|
|
|
9
9
|
var root = $.from_html(`<div><!> <input type="text" inputmode="numeric" name="min"/> <!> <input type="text" inputmode="numeric" name="max"/> <!> <!></div>`);
|
|
10
10
|
function RangeInput($$anchor, $$props) {
|
|
11
11
|
$.push($$props, true);
|
|
12
|
-
let min = $.prop($$props, "min", 3, 0), max = $.prop($$props, "max", 3, 100), value = $.prop($$props, "value",
|
|
12
|
+
let min = $.prop($$props, "min", 3, 0), max = $.prop($$props, "max", 3, 100), value = $.prop($$props, "value", 15), width = $.prop($$props, "width", 3, 180), step = $.prop($$props, "step", 3, 1), size = $.prop($$props, "size", 3, "medium"), ref = $.prop($$props, "ref", 15, null), minInputId = $.prop($$props, "minInputId", 3, "range-input-min"), maxInputId = $.prop($$props, "maxInputId", 3, "range-input-max"), restProps = $.rest_props($$props, [
|
|
13
13
|
"$$slots",
|
|
14
14
|
"$$events",
|
|
15
15
|
"$$legacy",
|
|
@@ -30,8 +30,8 @@ function RangeInput($$anchor, $$props) {
|
|
|
30
30
|
]);
|
|
31
31
|
let timerId;
|
|
32
32
|
const calculatedWidth = $.derived(() => calculateSize(width()));
|
|
33
|
-
let innerMin = $.derived(() => formatNumber(value()[0]));
|
|
34
|
-
let innerMax = $.derived(() => formatNumber(value()[1]));
|
|
33
|
+
let innerMin = $.derived(() => formatNumber(value()?.[0] || min()));
|
|
34
|
+
let innerMax = $.derived(() => formatNumber(value()?.[1] || max()));
|
|
35
35
|
const adaptiveStep = $.derived(() => {
|
|
36
36
|
const range = max() - min();
|
|
37
37
|
return Math.max(step(), Math.ceil(range / 1e3));
|
|
@@ -47,8 +47,8 @@ function RangeInput($$anchor, $$props) {
|
|
|
47
47
|
const target = e.target;
|
|
48
48
|
let newValue = parseFormattedNumber(target.value.replace(/[^\d\s]/g, ""));
|
|
49
49
|
if (Number.isNaN(value())) newValue = target.name === "min" ? min() : max();
|
|
50
|
-
if (target.name === "min") applyValues([newValue, value()[1]]);
|
|
51
|
-
else applyValues([value()[0], newValue]);
|
|
50
|
+
if (target.name === "min") applyValues([newValue, value()?.[1] || max()]);
|
|
51
|
+
else applyValues([value()?.[0] || min(), newValue]);
|
|
52
52
|
}, 700);
|
|
53
53
|
}
|
|
54
54
|
function handleKeyDown(e) {
|
|
@@ -8,7 +8,10 @@ import { Tooltip } from "bits-ui";
|
|
|
8
8
|
var root_2 = $.from_html(`<!> <!>`, 1);
|
|
9
9
|
function Tooltip$1($$anchor, $$props) {
|
|
10
10
|
$.push($$props, true);
|
|
11
|
-
let open = $.prop($$props, "open", 15, false), alignOffset = $.prop($$props, "alignOffset", 3, 0), sideOffset = $.prop($$props, "sideOffset", 3, 4), side = $.prop($$props, "side", 3, "top")
|
|
11
|
+
let open = $.prop($$props, "open", 15, false), alignOffset = $.prop($$props, "alignOffset", 3, 0), sideOffset = $.prop($$props, "sideOffset", 3, 4), side = $.prop($$props, "side", 3, "top");
|
|
12
|
+
$.prop($$props, "triggerId", 3, null);
|
|
13
|
+
$.prop($$props, "payload", 3, null);
|
|
14
|
+
let restProps = $.rest_props($$props, [
|
|
12
15
|
"$$slots",
|
|
13
16
|
"$$events",
|
|
14
17
|
"$$legacy",
|
|
@@ -40,22 +43,9 @@ function Tooltip$1($$anchor, $$props) {
|
|
|
40
43
|
children: ($$anchor, $$slotProps) => {
|
|
41
44
|
var fragment_2 = root_2();
|
|
42
45
|
var node_1 = $.first_child(fragment_2);
|
|
43
|
-
Trigger(node_1, {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
children: ($$anchor, $$slotProps) => {
|
|
48
|
-
var fragment_3 = $.comment();
|
|
49
|
-
var node_2 = $.first_child(fragment_3);
|
|
50
|
-
$.snippet(node_2, () => $$props.children ?? $.noop, () => ({
|
|
51
|
-
open: open(),
|
|
52
|
-
triggerId: triggerId(),
|
|
53
|
-
payload: payload()
|
|
54
|
-
}));
|
|
55
|
-
$.append($$anchor, fragment_3);
|
|
56
|
-
},
|
|
57
|
-
$$slots: { default: true }
|
|
58
|
-
});
|
|
46
|
+
Trigger(node_1, { get child() {
|
|
47
|
+
return $$props.child;
|
|
48
|
+
} });
|
|
59
49
|
Content($.sibling(node_1, 2), {
|
|
60
50
|
get class() {
|
|
61
51
|
return $$props.class;
|
|
@@ -77,24 +67,24 @@ function Tooltip$1($$anchor, $$props) {
|
|
|
77
67
|
},
|
|
78
68
|
hideWhenDetached: true,
|
|
79
69
|
children: ($$anchor, $$slotProps) => {
|
|
80
|
-
var
|
|
81
|
-
var
|
|
70
|
+
var fragment_3 = $.comment();
|
|
71
|
+
var node_3 = $.first_child(fragment_3);
|
|
82
72
|
var consequent = ($$anchor) => {
|
|
83
73
|
var text = $.text();
|
|
84
74
|
$.template_effect(() => $.set_text(text, $$props.content));
|
|
85
75
|
$.append($$anchor, text);
|
|
86
76
|
};
|
|
87
77
|
var alternate = ($$anchor) => {
|
|
88
|
-
var
|
|
89
|
-
var
|
|
90
|
-
$.snippet(
|
|
91
|
-
$.append($$anchor,
|
|
78
|
+
var fragment_5 = $.comment();
|
|
79
|
+
var node_4 = $.first_child(fragment_5);
|
|
80
|
+
$.snippet(node_4, () => $$props.content ?? $.noop);
|
|
81
|
+
$.append($$anchor, fragment_5);
|
|
92
82
|
};
|
|
93
|
-
$.if(
|
|
83
|
+
$.if(node_3, ($$render) => {
|
|
94
84
|
if (typeof $$props.content === "string") $$render(consequent);
|
|
95
85
|
else $$render(alternate, -1);
|
|
96
86
|
});
|
|
97
|
-
$.append($$anchor,
|
|
87
|
+
$.append($$anchor, fragment_3);
|
|
98
88
|
},
|
|
99
89
|
$$slots: { default: true }
|
|
100
90
|
});
|