@balikjs/mobile 0.1.10 → 0.1.12
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/Alert/Alert.module.css.js +18 -18
- package/dist/Avatar/Avatar.module.css.js +16 -16
- package/dist/BackToTop/BackToTop.module.css.js +6 -6
- package/dist/Badge/Badge.js +44 -43
- package/dist/Badge/Badge.module.css.js +36 -42
- package/dist/BottomNavigation/BottomNavigation.module.css.js +6 -6
- package/dist/BottomSheet/BottomSheet.js +61 -78
- package/dist/BottomSheet/BottomSheet.module.css.js +14 -20
- package/dist/Button/Button.js +29 -24
- package/dist/Button/Button.module.css.js +21 -19
- package/dist/Card/Card.module.css.js +1 -1
- package/dist/Checkbox/Checkbox.module.css.js +13 -13
- package/dist/Clipboard/Clipboard.js +31 -26
- package/dist/Clipboard/Clipboard.module.css.js +16 -16
- package/dist/CloseButton/CloseButton.js +1 -2
- package/dist/CloseButton/CloseButton.module.css.js +12 -12
- package/dist/Confirm/Confirm.js +31 -24
- package/dist/DatePicker/DatePicker.js +71 -59
- package/dist/DatePicker/DatePicker.module.css.js +36 -24
- package/dist/Dialog/Dialog.js +79 -63
- package/dist/Dialog/Dialog.module.css.js +16 -14
- package/dist/Divider/Divider.module.css.js +2 -2
- package/dist/Drawer/Drawer.module.css.js +2 -2
- package/dist/Fab/Fab.module.css.js +16 -16
- package/dist/Field/Field.module.css.js +14 -14
- package/dist/Fieldset/Fieldset.module.css.js +1 -1
- package/dist/FileUpload/FileUpload.module.css.js +26 -26
- package/dist/FilterGroup/FilterGroup.js +61 -58
- package/dist/FilterGroup/FilterGroup.module.css.js +12 -20
- package/dist/Input/Input.js +62 -40
- package/dist/Input/Input.module.css.js +36 -30
- package/dist/Link/Link.module.css.js +1 -1
- package/dist/MoneyInput/MoneyInput.module.css.js +6 -6
- package/dist/Pagination/Pagination.module.css.js +1 -1
- package/dist/Picker/Picker.module.css.js +8 -8
- package/dist/PickerView/PickerView.module.css.js +16 -16
- package/dist/PinInput/PinInput.module.css.js +14 -14
- package/dist/Popover/Popover.module.css.js +10 -10
- package/dist/Progress/Progress.module.css.js +14 -14
- package/dist/QrCode/QrCode.module.css.js +6 -6
- package/dist/RadioGroup/Radio.module.css.js +18 -18
- package/dist/RatingGroup/RatingGroup.js +6 -6
- package/dist/RatingGroup/RatingGroup.module.css.js +6 -6
- package/dist/SearchInput/SearchInput.module.css.js +1 -1
- package/dist/Select/Select.js +45 -44
- package/dist/Select/Select.module.css.js +20 -18
- package/dist/SelectPc/Select.js +50 -44
- package/dist/SelectPc/SelectPc.module.css.js +34 -28
- package/dist/SignaturePad/SignaturePad.js +116 -0
- package/dist/SignaturePad/SignaturePad.module.css.js +15 -0
- package/dist/Slider/Slider.module.css.js +10 -10
- package/dist/Spinner/Spinner.module.css.js +4 -4
- package/dist/Steps/Steps.js +87 -77
- package/dist/Steps/Steps.module.css.js +20 -22
- package/dist/StickyHeader/StickyHeader.module.css.js +2 -2
- package/dist/Switch/Switch.js +22 -18
- package/dist/Switch/Switch.module.css.js +22 -20
- package/dist/Tabs/Tabs.module.css.js +6 -6
- package/dist/Tag/Tag.js +34 -26
- package/dist/Tag/Tag.module.css.js +36 -32
- package/dist/Textarea/Textarea.module.css.js +10 -10
- package/dist/Toast/Toast.module.css.js +30 -30
- package/dist/Toggle/Toggle.module.css.js +1 -1
- package/dist/ToggleGroup/ToggleGroup.js +36 -21
- package/dist/ToggleGroup/ToggleGroup.module.css.js +22 -16
- package/dist/index.js +143 -135
- package/dist/styles.css +1 -1
- package/package.json +4 -1
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
const
|
|
2
|
-
base:
|
|
3
|
-
loadingOverlay:
|
|
4
|
-
loadingButton:
|
|
5
|
-
outline:
|
|
1
|
+
const e = "_base_zewfr_1", n = "_loadingOverlay_zewfr_22", t = "_loadingButton_zewfr_33", s = "_outline_zewfr_37", _ = "_solid_zewfr_48", i = "_intentDefault_zewfr_60", o = "_intentNeutral_zewfr_69", z = "_intentDanger_zewfr_78", r = "_sizeXs_zewfr_87", l = "_sizeSm_zewfr_95", a = "_sizeMd_zewfr_103", f = "_sizeLg_zewfr_111", c = "_sizeXl_zewfr_119", w = "_spinner_zewfr_127", d = {
|
|
2
|
+
base: e,
|
|
3
|
+
loadingOverlay: n,
|
|
4
|
+
loadingButton: t,
|
|
5
|
+
outline: s,
|
|
6
6
|
solid: _,
|
|
7
7
|
intentDefault: i,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
intentNeutral: o,
|
|
9
|
+
intentDanger: z,
|
|
10
|
+
sizeXs: r,
|
|
11
|
+
sizeSm: l,
|
|
11
12
|
sizeMd: a,
|
|
12
13
|
sizeLg: f,
|
|
13
|
-
sizeXl:
|
|
14
|
-
spinner:
|
|
14
|
+
sizeXl: c,
|
|
15
|
+
spinner: w
|
|
15
16
|
};
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
e as base,
|
|
18
19
|
d as default,
|
|
19
|
-
|
|
20
|
+
z as intentDanger,
|
|
20
21
|
i as intentDefault,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
o as intentNeutral,
|
|
23
|
+
t as loadingButton,
|
|
24
|
+
n as loadingOverlay,
|
|
25
|
+
s as outline,
|
|
24
26
|
f as sizeLg,
|
|
25
27
|
a as sizeMd,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
l as sizeSm,
|
|
29
|
+
c as sizeXl,
|
|
30
|
+
r as sizeXs,
|
|
29
31
|
_ as solid,
|
|
30
|
-
|
|
32
|
+
w as spinner
|
|
31
33
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
const
|
|
2
|
-
root:
|
|
3
|
-
control:
|
|
4
|
-
indicator:
|
|
5
|
-
label:
|
|
1
|
+
const o = "_root_3hi0o_1", s = "_control_3hi0o_17", i = "_indicator_3hi0o_56", _ = "_label_3hi0o_68", e = "_sizeXs_3hi0o_76", t = "_sizeSm_3hi0o_86", n = "_sizeMd_3hi0o_96", c = "_sizeLg_3hi0o_106", z = "_sizeXl_3hi0o_116", l = "_size2xl_3hi0o_126", d = "_rounded_3hi0o_136", r = {
|
|
2
|
+
root: o,
|
|
3
|
+
control: s,
|
|
4
|
+
indicator: i,
|
|
5
|
+
label: _,
|
|
6
6
|
sizeXs: e,
|
|
7
|
-
sizeSm:
|
|
8
|
-
sizeMd:
|
|
7
|
+
sizeSm: t,
|
|
8
|
+
sizeMd: n,
|
|
9
9
|
sizeLg: c,
|
|
10
10
|
sizeXl: z,
|
|
11
11
|
size2xl: l,
|
|
12
12
|
rounded: d
|
|
13
13
|
};
|
|
14
14
|
export {
|
|
15
|
-
|
|
15
|
+
s as control,
|
|
16
16
|
r as default,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
i as indicator,
|
|
18
|
+
_ as label,
|
|
19
|
+
o as root,
|
|
20
20
|
d as rounded,
|
|
21
21
|
l as size2xl,
|
|
22
22
|
c as sizeLg,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
n as sizeMd,
|
|
24
|
+
t as sizeSm,
|
|
25
25
|
z as sizeXl,
|
|
26
26
|
e as sizeXs
|
|
27
27
|
};
|
|
@@ -1,58 +1,63 @@
|
|
|
1
|
-
import { spread as
|
|
2
|
-
import { splitProps as
|
|
3
|
-
import { Check as
|
|
4
|
-
import { bem as
|
|
5
|
-
import { cn as
|
|
1
|
+
import { spread as g, mergeProps as b, insert as c, memo as f, createComponent as p, template as y } from "solid-js/web";
|
|
2
|
+
import { splitProps as C, mergeProps as h, createSignal as v, onCleanup as x } from "solid-js";
|
|
3
|
+
import { Check as z, Copy as T } from "lucide-solid";
|
|
4
|
+
import { bem as P } from "../utils/bem.js";
|
|
5
|
+
import { cn as R } from "../utils/cn.js";
|
|
6
6
|
import t from "./Clipboard.module.css.js";
|
|
7
|
-
var
|
|
8
|
-
const
|
|
7
|
+
var k = /* @__PURE__ */ y("<button>");
|
|
8
|
+
const w = {
|
|
9
9
|
xs: t.sizeXs,
|
|
10
10
|
sm: t.sizeSm,
|
|
11
11
|
md: t.sizeMd,
|
|
12
12
|
lg: t.sizeLg,
|
|
13
13
|
xl: t.sizeXl
|
|
14
|
-
},
|
|
14
|
+
}, S = {
|
|
15
15
|
size: "md",
|
|
16
16
|
copiedDuration: 2e3,
|
|
17
17
|
toastOnCopy: !1
|
|
18
18
|
};
|
|
19
|
-
function L(
|
|
20
|
-
const [o,
|
|
21
|
-
let
|
|
22
|
-
const
|
|
19
|
+
function L(d) {
|
|
20
|
+
const [o, m] = C(h(S, d), ["value", "size", "class", "copiedDuration", "toastOnCopy", "children"]), [r, i] = v(!1);
|
|
21
|
+
let a = null;
|
|
22
|
+
const u = async () => {
|
|
23
|
+
var e;
|
|
23
24
|
try {
|
|
24
|
-
await navigator.clipboard.writeText(o.value);
|
|
25
|
+
(e = navigator.clipboard) != null && e.writeText ? await navigator.clipboard.writeText(o.value) : s();
|
|
25
26
|
} catch {
|
|
26
|
-
|
|
27
|
-
e.value = o.value, e.style.position = "fixed", e.style.opacity = "0", document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
27
|
+
s();
|
|
28
28
|
}
|
|
29
|
-
i(!0), clearTimeout(
|
|
29
|
+
i(!0), clearTimeout(a), a = setTimeout(() => i(!1), o.copiedDuration);
|
|
30
|
+
}, s = () => {
|
|
31
|
+
const e = document.createElement("textarea");
|
|
32
|
+
e.value = o.value, e.setAttribute("readonly", ""), e.style.cssText = "position:fixed;top:0;left:0;width:2px;height:2px;padding:0;border:none;outline:none;box-shadow:none;background:transparent;opacity:0;pointer-events:none", document.body.appendChild(e);
|
|
33
|
+
const n = document.getSelection(), l = n && n.rangeCount > 0 ? n.getRangeAt(0) : null;
|
|
34
|
+
e.select(), e.setSelectionRange(0, o.value.length), document.execCommand("copy"), document.body.removeChild(e), l && n && (n.removeAllRanges(), n.addRange(l));
|
|
30
35
|
};
|
|
31
|
-
return
|
|
32
|
-
var e =
|
|
33
|
-
return
|
|
36
|
+
return x(() => clearTimeout(a)), (() => {
|
|
37
|
+
var e = k();
|
|
38
|
+
return g(e, b(m, {
|
|
34
39
|
type: "button",
|
|
35
40
|
"data-part": "root",
|
|
36
|
-
onClick:
|
|
41
|
+
onClick: u,
|
|
37
42
|
get class() {
|
|
38
|
-
return P(
|
|
43
|
+
return R(P("balik-clipboard", o.size), t.base, w[o.size], r() && t.copied, o.class);
|
|
39
44
|
}
|
|
40
|
-
}), !1, !0),
|
|
41
|
-
var
|
|
42
|
-
return () =>
|
|
45
|
+
}), !1, !0), c(e, (() => {
|
|
46
|
+
var n = f(() => !!r());
|
|
47
|
+
return () => n() ? p(z, {
|
|
43
48
|
"aria-hidden": "true",
|
|
44
49
|
get class() {
|
|
45
50
|
return t.icon;
|
|
46
51
|
},
|
|
47
52
|
"data-part": "icon"
|
|
48
|
-
}) :
|
|
53
|
+
}) : p(T, {
|
|
49
54
|
"aria-hidden": "true",
|
|
50
55
|
get class() {
|
|
51
56
|
return t.icon;
|
|
52
57
|
},
|
|
53
58
|
"data-part": "icon"
|
|
54
59
|
});
|
|
55
|
-
})(), null),
|
|
60
|
+
})(), null), c(e, () => o.children, null), e;
|
|
56
61
|
})();
|
|
57
62
|
}
|
|
58
63
|
export {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const s = "
|
|
1
|
+
const s = "_base_o8cik_1", i = "_icon_o8cik_36", e = "_copied_o8cik_42", o = "_sizeXs_o8cik_69", _ = "_sizeSm_o8cik_83", c = "_sizeMd_o8cik_97", z = "_sizeLg_o8cik_111", n = "_sizeXl_o8cik_125", t = {
|
|
2
2
|
base: s,
|
|
3
|
-
icon:
|
|
4
|
-
copied:
|
|
5
|
-
sizeXs:
|
|
6
|
-
sizeSm:
|
|
7
|
-
sizeMd:
|
|
8
|
-
sizeLg:
|
|
9
|
-
sizeXl:
|
|
3
|
+
icon: i,
|
|
4
|
+
copied: e,
|
|
5
|
+
sizeXs: o,
|
|
6
|
+
sizeSm: _,
|
|
7
|
+
sizeMd: c,
|
|
8
|
+
sizeLg: z,
|
|
9
|
+
sizeXl: n
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
s as base,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
e as copied,
|
|
14
|
+
t as default,
|
|
15
|
+
i as icon,
|
|
16
|
+
z as sizeLg,
|
|
17
|
+
c as sizeMd,
|
|
18
|
+
_ as sizeSm,
|
|
19
|
+
n as sizeXl,
|
|
20
|
+
o as sizeXs
|
|
21
21
|
};
|
|
@@ -4,7 +4,7 @@ import { X as u } from "lucide-solid";
|
|
|
4
4
|
import { bem as c } from "../utils/bem.js";
|
|
5
5
|
import { cn as z } from "../utils/cn.js";
|
|
6
6
|
import e from "./CloseButton.module.css.js";
|
|
7
|
-
var f = /* @__PURE__ */ n("<button>");
|
|
7
|
+
var f = /* @__PURE__ */ n("<button data-part=root>");
|
|
8
8
|
const b = {
|
|
9
9
|
xs: e.sizeXs,
|
|
10
10
|
sm: e.sizeSm,
|
|
@@ -22,7 +22,6 @@ function v(t) {
|
|
|
22
22
|
var s = f();
|
|
23
23
|
return i(s, l(o, {
|
|
24
24
|
type: "button",
|
|
25
|
-
"data-part": "root",
|
|
26
25
|
"aria-label": "Close",
|
|
27
26
|
get class() {
|
|
28
27
|
return z(c("balik-close-button", r.size), e.base, b[r.size], r.rounded && e.rounded, r.class);
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
const s = "
|
|
1
|
+
const s = "_base_r9hwl_1", e = "_sizeXs_r9hwl_31", _ = "_sizeSm_r9hwl_42", i = "_sizeMd_r9hwl_52", z = "_sizeLg_r9hwl_62", l = "_sizeXl_r9hwl_72", o = "_size2xl_r9hwl_82", n = "_rounded_r9hwl_92", r = {
|
|
2
2
|
base: s,
|
|
3
3
|
sizeXs: e,
|
|
4
4
|
sizeSm: _,
|
|
5
|
-
sizeMd:
|
|
6
|
-
sizeLg:
|
|
7
|
-
sizeXl:
|
|
8
|
-
size2xl:
|
|
9
|
-
rounded:
|
|
5
|
+
sizeMd: i,
|
|
6
|
+
sizeLg: z,
|
|
7
|
+
sizeXl: l,
|
|
8
|
+
size2xl: o,
|
|
9
|
+
rounded: n
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
s as base,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
r as default,
|
|
14
|
+
n as rounded,
|
|
15
|
+
o as size2xl,
|
|
16
|
+
z as sizeLg,
|
|
17
|
+
i as sizeMd,
|
|
18
18
|
_ as sizeSm,
|
|
19
|
-
|
|
19
|
+
l as sizeXl,
|
|
20
20
|
e as sizeXs
|
|
21
21
|
};
|
package/dist/Confirm/Confirm.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { createComponent as f, render as p, memo as h } from "solid-js/web";
|
|
2
2
|
import { splitProps as b, mergeProps as L, createRoot as w, createSignal as E, Show as v } from "solid-js";
|
|
3
|
-
import { Dialog as
|
|
4
|
-
import
|
|
3
|
+
import { Dialog as g } from "../Dialog/Dialog.js";
|
|
4
|
+
import s from "./Confirm.module.css.js";
|
|
5
5
|
const y = {
|
|
6
6
|
mode: "sheet",
|
|
7
|
+
title: "Confirm",
|
|
7
8
|
confirmLabel: "Confirm",
|
|
8
9
|
cancelLabel: "Cancel",
|
|
9
10
|
danger: !1,
|
|
10
11
|
loading: !1
|
|
11
12
|
};
|
|
12
|
-
function d(
|
|
13
|
-
const [e] = b(L(y,
|
|
14
|
-
return f(
|
|
13
|
+
function d(o) {
|
|
14
|
+
const [e] = b(L(y, o), ["mode", "open", "onOpenChange", "title", "confirmLabel", "cancelLabel", "danger", "loading", "onConfirm", "onCancel", "class", "children"]), r = !!e.onCancel;
|
|
15
|
+
return f(g, {
|
|
15
16
|
get mode() {
|
|
16
17
|
return e.mode;
|
|
17
18
|
},
|
|
@@ -22,6 +23,9 @@ function d(t) {
|
|
|
22
23
|
return e.onOpenChange;
|
|
23
24
|
},
|
|
24
25
|
closeable: !1,
|
|
26
|
+
get title() {
|
|
27
|
+
return e.title;
|
|
28
|
+
},
|
|
25
29
|
showCancel: r,
|
|
26
30
|
showConfirm: !0,
|
|
27
31
|
get cancelLabel() {
|
|
@@ -43,7 +47,7 @@ function d(t) {
|
|
|
43
47
|
return e.onCancel;
|
|
44
48
|
},
|
|
45
49
|
get footerClass() {
|
|
46
|
-
return r ? void 0 :
|
|
50
|
+
return r ? void 0 : s.footerCenter;
|
|
47
51
|
},
|
|
48
52
|
get class() {
|
|
49
53
|
return e.class;
|
|
@@ -53,22 +57,22 @@ function d(t) {
|
|
|
53
57
|
}
|
|
54
58
|
});
|
|
55
59
|
}
|
|
56
|
-
let i = null,
|
|
60
|
+
let i = null, t = null, m = null;
|
|
57
61
|
function S() {
|
|
58
62
|
if (m) return;
|
|
59
|
-
const
|
|
60
|
-
document.body.appendChild(
|
|
63
|
+
const o = document.createElement("div");
|
|
64
|
+
document.body.appendChild(o), w(() => {
|
|
61
65
|
const [e, r] = E(null);
|
|
62
66
|
m = r;
|
|
63
67
|
const c = (n) => {
|
|
64
68
|
const u = e();
|
|
65
69
|
if (n.prev) return;
|
|
66
|
-
const l = i, a =
|
|
67
|
-
if (i = null,
|
|
70
|
+
const l = i, a = t;
|
|
71
|
+
if (i = null, t = null, n.type === "confirm")
|
|
68
72
|
l == null || l();
|
|
69
73
|
else {
|
|
70
|
-
const
|
|
71
|
-
|
|
74
|
+
const C = new Error("Cancel");
|
|
75
|
+
C.code = "CANCEL", a == null || a(C);
|
|
72
76
|
}
|
|
73
77
|
r({
|
|
74
78
|
...u,
|
|
@@ -79,7 +83,7 @@ function S() {
|
|
|
79
83
|
get when() {
|
|
80
84
|
return e();
|
|
81
85
|
},
|
|
82
|
-
children: (n) => f(
|
|
86
|
+
children: (n) => f(g, {
|
|
83
87
|
get mode() {
|
|
84
88
|
return n().mode || "sheet";
|
|
85
89
|
},
|
|
@@ -87,6 +91,9 @@ function S() {
|
|
|
87
91
|
return n().open;
|
|
88
92
|
},
|
|
89
93
|
closeable: !1,
|
|
94
|
+
get title() {
|
|
95
|
+
return n().title || "Confirm";
|
|
96
|
+
},
|
|
90
97
|
get showCancel() {
|
|
91
98
|
return !n().noCancel;
|
|
92
99
|
},
|
|
@@ -101,7 +108,7 @@ function S() {
|
|
|
101
108
|
return n().danger;
|
|
102
109
|
},
|
|
103
110
|
get footerClass() {
|
|
104
|
-
return h(() => !!n().noCancel)() ?
|
|
111
|
+
return h(() => !!n().noCancel)() ? s.footerCenter : void 0;
|
|
105
112
|
},
|
|
106
113
|
onConfirm: () => c({
|
|
107
114
|
type: "confirm",
|
|
@@ -113,11 +120,11 @@ function S() {
|
|
|
113
120
|
}),
|
|
114
121
|
onOpenChange: (u) => {
|
|
115
122
|
if (!u.open) {
|
|
116
|
-
if (
|
|
123
|
+
if (t) {
|
|
117
124
|
const l = new Error("Cancel");
|
|
118
125
|
l.code = "CANCEL";
|
|
119
|
-
const a =
|
|
120
|
-
i = null,
|
|
126
|
+
const a = t;
|
|
127
|
+
i = null, t = null, a(l);
|
|
121
128
|
}
|
|
122
129
|
r(null);
|
|
123
130
|
}
|
|
@@ -126,16 +133,16 @@ function S() {
|
|
|
126
133
|
return n().children;
|
|
127
134
|
}
|
|
128
135
|
})
|
|
129
|
-
}),
|
|
136
|
+
}), o);
|
|
130
137
|
});
|
|
131
138
|
}
|
|
132
|
-
d.confirm = (
|
|
133
|
-
if (
|
|
139
|
+
d.confirm = (o = {}) => (S(), new Promise((e, r) => {
|
|
140
|
+
if (t) {
|
|
134
141
|
const c = new Error("Superseded by a newer confirm()");
|
|
135
|
-
c.code = "CANCEL",
|
|
142
|
+
c.code = "CANCEL", t(c);
|
|
136
143
|
}
|
|
137
|
-
i = e,
|
|
138
|
-
...
|
|
144
|
+
i = e, t = r, m({
|
|
145
|
+
...o,
|
|
139
146
|
open: !0
|
|
140
147
|
});
|
|
141
148
|
}));
|
|
@@ -1,39 +1,48 @@
|
|
|
1
|
-
import { insert as g, createComponent as
|
|
2
|
-
import { splitProps as
|
|
3
|
-
import { Calendar as
|
|
4
|
-
import { BottomSheet as
|
|
5
|
-
import { PickerView as
|
|
6
|
-
import { bem as
|
|
7
|
-
import { cn as
|
|
8
|
-
import
|
|
9
|
-
var Z = /* @__PURE__ */
|
|
10
|
-
const
|
|
11
|
-
function
|
|
12
|
-
return new Date(
|
|
1
|
+
import { insert as g, createComponent as y, effect as D, className as s, template as C, delegateEvents as U } from "solid-js/web";
|
|
2
|
+
import { splitProps as X, mergeProps as K, createSignal as h, createMemo as S, createEffect as _, onCleanup as j } from "solid-js";
|
|
3
|
+
import { Calendar as q } from "lucide-solid";
|
|
4
|
+
import { BottomSheet as G } from "../BottomSheet/BottomSheet.js";
|
|
5
|
+
import { PickerView as Q } from "../PickerView/PickerView.js";
|
|
6
|
+
import { bem as W } from "../utils/bem.js";
|
|
7
|
+
import { cn as A } from "../utils/cn.js";
|
|
8
|
+
import a from "./DatePicker.module.css.js";
|
|
9
|
+
var Z = /* @__PURE__ */ C("<button type=button data-part=trigger><span>"), ee = /* @__PURE__ */ C("<div><button type=button>Cancel</button><span></span><button type=button>Confirm"), te = /* @__PURE__ */ C("<div data-part=picker-body><p data-part=weekday>");
|
|
10
|
+
const L = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
11
|
+
function M(c, n) {
|
|
12
|
+
return new Date(c, n + 1, 0).getDate();
|
|
13
13
|
}
|
|
14
|
-
function ne(
|
|
15
|
-
return Math.max(n, Math.min(l,
|
|
14
|
+
function ne(c, n, l) {
|
|
15
|
+
return Math.max(n, Math.min(l, c));
|
|
16
16
|
}
|
|
17
17
|
const re = {
|
|
18
|
+
xs: a.sizeXs,
|
|
19
|
+
sm: a.sizeSm,
|
|
20
|
+
md: a.sizeMd,
|
|
21
|
+
lg: a.sizeLg,
|
|
22
|
+
xl: a.sizeXl
|
|
23
|
+
}, ae = {
|
|
18
24
|
title: "Select Date",
|
|
19
25
|
placeholder: "Select Date",
|
|
20
26
|
value: null,
|
|
21
|
-
disabled: !1
|
|
27
|
+
disabled: !1,
|
|
28
|
+
invalid: !1,
|
|
29
|
+
closeOnBackdrop: !1,
|
|
30
|
+
size: "md"
|
|
22
31
|
};
|
|
23
|
-
function
|
|
24
|
-
const [n] = K(
|
|
25
|
-
|
|
26
|
-
const e =
|
|
32
|
+
function me(c) {
|
|
33
|
+
const [n] = X(K(ae, c), ["value", "onValueChange", "onConfirm", "onCancel", "min", "max", "title", "placeholder", "size", "disabled", "invalid", "closeOnBackdrop", "class"]), l = /* @__PURE__ */ new Date(), w = n.min || new Date(l.getFullYear() - 100, 0, 1), x = n.max || new Date(l.getFullYear() + 10, 11, 31), m = w.getFullYear(), Y = x.getFullYear(), [z, p] = h(!1), [d, $] = h(l.getFullYear()), [v, F] = h(l.getMonth()), [f, b] = h(l.getDate()), O = S(() => M(d(), v()));
|
|
34
|
+
_(() => {
|
|
35
|
+
const e = O();
|
|
27
36
|
f() > e && b(e);
|
|
28
|
-
}),
|
|
29
|
-
if (
|
|
37
|
+
}), _(() => {
|
|
38
|
+
if (!z()) return;
|
|
30
39
|
const e = (r) => {
|
|
31
|
-
r.key === "Escape" &&
|
|
40
|
+
r.key === "Escape" && k();
|
|
32
41
|
};
|
|
33
|
-
document.addEventListener("keydown", e),
|
|
42
|
+
document.addEventListener("keydown", e), j(() => document.removeEventListener("keydown", e));
|
|
34
43
|
});
|
|
35
|
-
const
|
|
36
|
-
const e =
|
|
44
|
+
const T = S(() => {
|
|
45
|
+
const e = d();
|
|
37
46
|
return [{
|
|
38
47
|
flex: 1.1,
|
|
39
48
|
items: Array.from({
|
|
@@ -44,7 +53,7 @@ function ge(s) {
|
|
|
44
53
|
}))
|
|
45
54
|
}, {
|
|
46
55
|
circular: !0,
|
|
47
|
-
items:
|
|
56
|
+
items: L.map((r, t) => ({
|
|
48
57
|
label: r,
|
|
49
58
|
value: t,
|
|
50
59
|
disabled: e === m && t < w.getMonth() || e === Y && t > x.getMonth()
|
|
@@ -53,66 +62,69 @@ function ge(s) {
|
|
|
53
62
|
flex: 0.9,
|
|
54
63
|
circular: !0,
|
|
55
64
|
items: Array.from({
|
|
56
|
-
length:
|
|
65
|
+
length: O()
|
|
57
66
|
}, (r, t) => ({
|
|
58
67
|
label: String(t + 1).padStart(2, "0"),
|
|
59
68
|
value: t + 1
|
|
60
69
|
}))
|
|
61
70
|
}];
|
|
62
|
-
}),
|
|
63
|
-
|
|
64
|
-
},
|
|
71
|
+
}), V = () => [d(), v(), f()], N = ([e, r, t]) => {
|
|
72
|
+
$(e), F(r), b(ne(t, 1, M(e, r)));
|
|
73
|
+
}, J = S(() => new Date(d(), v(), f()).toLocaleDateString("en-US", {
|
|
65
74
|
weekday: "long"
|
|
66
|
-
})),
|
|
75
|
+
})), H = () => {
|
|
67
76
|
const e = n.value;
|
|
68
|
-
return e ? `${
|
|
77
|
+
return e ? `${L[e.getMonth()]} ${e.getDate()}, ${e.getFullYear()}` : n.placeholder;
|
|
69
78
|
};
|
|
70
|
-
function
|
|
79
|
+
function I() {
|
|
71
80
|
if (n.disabled) return;
|
|
72
81
|
const e = n.value || l;
|
|
73
|
-
|
|
82
|
+
$(e.getFullYear()), F(e.getMonth()), b(Math.min(e.getDate(), M(e.getFullYear(), e.getMonth()))), p(!0);
|
|
74
83
|
}
|
|
75
|
-
function
|
|
84
|
+
function R() {
|
|
76
85
|
var r, t;
|
|
77
|
-
const e = new Date(
|
|
86
|
+
const e = new Date(d(), v(), f());
|
|
78
87
|
(r = n.onValueChange) == null || r.call(n, e), (t = n.onConfirm) == null || t.call(n, e), p(!1);
|
|
79
88
|
}
|
|
80
|
-
function
|
|
89
|
+
function k() {
|
|
81
90
|
var e;
|
|
82
91
|
(e = n.onCancel) == null || e.call(n), p(!1);
|
|
83
92
|
}
|
|
84
93
|
return [(() => {
|
|
85
94
|
var e = Z(), r = e.firstChild;
|
|
86
|
-
return e.$$click =
|
|
95
|
+
return e.$$click = I, g(r, H), g(e, y(q, {
|
|
87
96
|
get class() {
|
|
88
|
-
return
|
|
97
|
+
return a.triggerIcon;
|
|
89
98
|
},
|
|
90
99
|
size: 18,
|
|
91
100
|
"stroke-width": 1.5
|
|
92
|
-
}), null),
|
|
93
|
-
var i =
|
|
94
|
-
return i !== t.e &&
|
|
101
|
+
}), null), D((t) => {
|
|
102
|
+
var i = A(W("balik-date-picker-trigger", n.size), a.trigger, re[n.size], n.disabled && a.triggerDisabled, n.invalid && a.invalid, n.class), o = n.disabled, u = A(a.triggerText, !n.value && a.triggerPlaceholder);
|
|
103
|
+
return i !== t.e && s(e, t.e = i), o !== t.t && (e.disabled = t.t = o), u !== t.a && s(r, t.a = u), t;
|
|
95
104
|
}, {
|
|
96
105
|
e: void 0,
|
|
97
106
|
t: void 0,
|
|
98
107
|
a: void 0
|
|
99
108
|
}), e;
|
|
100
|
-
})(),
|
|
109
|
+
})(), y(G, {
|
|
101
110
|
get open() {
|
|
102
|
-
return
|
|
111
|
+
return z();
|
|
103
112
|
},
|
|
104
113
|
get class() {
|
|
105
|
-
return
|
|
114
|
+
return a.sheet;
|
|
115
|
+
},
|
|
116
|
+
get dismissible() {
|
|
117
|
+
return n.closeOnBackdrop;
|
|
106
118
|
},
|
|
107
119
|
onOpenChange: (e) => {
|
|
108
|
-
e.open ||
|
|
120
|
+
e.open || k();
|
|
109
121
|
},
|
|
110
122
|
get children() {
|
|
111
123
|
return [(() => {
|
|
112
124
|
var e = ee(), r = e.firstChild, t = r.nextSibling, i = t.nextSibling;
|
|
113
|
-
return r.$$click =
|
|
114
|
-
var
|
|
115
|
-
return
|
|
125
|
+
return r.$$click = k, g(t, () => n.title), i.$$click = R, D((o) => {
|
|
126
|
+
var u = a.header, P = a.headerButton, B = a.headerTitle, E = a.headerButton;
|
|
127
|
+
return u !== o.e && s(e, o.e = u), P !== o.t && s(r, o.t = P), B !== o.a && s(t, o.a = B), E !== o.o && s(i, o.o = E), o;
|
|
116
128
|
}, {
|
|
117
129
|
e: void 0,
|
|
118
130
|
t: void 0,
|
|
@@ -121,20 +133,20 @@ function ge(s) {
|
|
|
121
133
|
}), e;
|
|
122
134
|
})(), (() => {
|
|
123
135
|
var e = te(), r = e.firstChild;
|
|
124
|
-
return g(e,
|
|
136
|
+
return g(e, y(Q, {
|
|
125
137
|
get class() {
|
|
126
|
-
return
|
|
138
|
+
return a.columns;
|
|
127
139
|
},
|
|
128
140
|
get columns() {
|
|
129
|
-
return
|
|
141
|
+
return T();
|
|
130
142
|
},
|
|
131
143
|
get value() {
|
|
132
|
-
return
|
|
144
|
+
return V();
|
|
133
145
|
},
|
|
134
|
-
onValueChange:
|
|
135
|
-
}), r), g(r,
|
|
136
|
-
var i =
|
|
137
|
-
return i !== t.e &&
|
|
146
|
+
onValueChange: N
|
|
147
|
+
}), r), g(r, J), D((t) => {
|
|
148
|
+
var i = a.pickerBody, o = a.weekday;
|
|
149
|
+
return i !== t.e && s(e, t.e = i), o !== t.t && s(r, t.t = o), t;
|
|
138
150
|
}, {
|
|
139
151
|
e: void 0,
|
|
140
152
|
t: void 0
|
|
@@ -143,7 +155,7 @@ function ge(s) {
|
|
|
143
155
|
}
|
|
144
156
|
})];
|
|
145
157
|
}
|
|
146
|
-
|
|
158
|
+
U(["click"]);
|
|
147
159
|
export {
|
|
148
|
-
|
|
160
|
+
me as DatePicker
|
|
149
161
|
};
|