@himal_bhattarai/nepali-datepicker 1.2.0 → 1.2.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.
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import je, { useState as C, useRef as
|
|
1
|
+
import je, { useState as C, useRef as ce, useEffect as de, useCallback as _e } from "react";
|
|
2
2
|
var Q = { exports: {} }, W = {};
|
|
3
3
|
var pe;
|
|
4
4
|
function Ee() {
|
|
5
5
|
if (pe) return W;
|
|
6
6
|
pe = 1;
|
|
7
|
-
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"),
|
|
8
|
-
function
|
|
7
|
+
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), l = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function g(c, d, i) {
|
|
9
9
|
var x = null;
|
|
10
10
|
if (i !== void 0 && (x = "" + i), d.key !== void 0 && (x = "" + d.key), "key" in d) {
|
|
11
11
|
i = {};
|
|
@@ -14,13 +14,13 @@ function Ee() {
|
|
|
14
14
|
} else i = d;
|
|
15
15
|
return d = i.ref, {
|
|
16
16
|
$$typeof: t,
|
|
17
|
-
type:
|
|
17
|
+
type: c,
|
|
18
18
|
key: x,
|
|
19
19
|
ref: d !== void 0 ? d : null,
|
|
20
20
|
props: i
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
return W.Fragment =
|
|
23
|
+
return W.Fragment = l, W.jsx = g, W.jsxs = g, W;
|
|
24
24
|
}
|
|
25
25
|
var V = {};
|
|
26
26
|
var ue;
|
|
@@ -34,7 +34,7 @@ function Se() {
|
|
|
34
34
|
switch (e) {
|
|
35
35
|
case w:
|
|
36
36
|
return "Fragment";
|
|
37
|
-
case
|
|
37
|
+
case b:
|
|
38
38
|
return "Profiler";
|
|
39
39
|
case T:
|
|
40
40
|
return "StrictMode";
|
|
@@ -69,12 +69,12 @@ function Se() {
|
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function l(e) {
|
|
73
73
|
return "" + e;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function g(e) {
|
|
76
76
|
try {
|
|
77
|
-
|
|
77
|
+
l(e);
|
|
78
78
|
var o = !1;
|
|
79
79
|
} catch {
|
|
80
80
|
o = !0;
|
|
@@ -86,10 +86,10 @@ function Se() {
|
|
|
86
86
|
o,
|
|
87
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
88
|
p
|
|
89
|
-
),
|
|
89
|
+
), l(e);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function c(e) {
|
|
93
93
|
if (e === w) return "<>";
|
|
94
94
|
if (typeof e == "object" && e !== null && e.$$typeof === B)
|
|
95
95
|
return "<...>";
|
|
@@ -196,7 +196,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
196
196
|
u
|
|
197
197
|
), Z[u + p] = !0);
|
|
198
198
|
}
|
|
199
|
-
if (u = null, s !== void 0 && (
|
|
199
|
+
if (u = null, s !== void 0 && (g(s), u = "" + s), x(o) && (g(o.key), u = "" + o.key), "key" in o) {
|
|
200
200
|
s = {};
|
|
201
201
|
for (var z in o)
|
|
202
202
|
z !== "key" && (s[z] = o[z]);
|
|
@@ -219,7 +219,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
219
219
|
function S(e) {
|
|
220
220
|
return typeof e == "object" && e !== null && e.$$typeof === M;
|
|
221
221
|
}
|
|
222
|
-
var v = je, M = /* @__PURE__ */ Symbol.for("react.transitional.element"), N = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), T = /* @__PURE__ */ Symbol.for("react.strict_mode"),
|
|
222
|
+
var v = je, M = /* @__PURE__ */ Symbol.for("react.transitional.element"), N = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), T = /* @__PURE__ */ Symbol.for("react.strict_mode"), b = /* @__PURE__ */ Symbol.for("react.profiler"), R = /* @__PURE__ */ Symbol.for("react.consumer"), h = /* @__PURE__ */ Symbol.for("react.context"), y = /* @__PURE__ */ Symbol.for("react.forward_ref"), Y = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), re = /* @__PURE__ */ Symbol.for("react.memo"), B = /* @__PURE__ */ Symbol.for("react.lazy"), ne = /* @__PURE__ */ Symbol.for("react.activity"), te = /* @__PURE__ */ Symbol.for("react.client.reference"), A = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, O = Object.prototype.hasOwnProperty, oe = Array.isArray, L = console.createTask ? console.createTask : function() {
|
|
223
223
|
return null;
|
|
224
224
|
};
|
|
225
225
|
v = {
|
|
@@ -230,7 +230,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
230
230
|
var q, J = {}, H = v.react_stack_bottom_frame.bind(
|
|
231
231
|
v,
|
|
232
232
|
i
|
|
233
|
-
)(), ae = L(
|
|
233
|
+
)(), ae = L(c(i)), Z = {};
|
|
234
234
|
V.Fragment = w, V.jsx = function(e, o, s) {
|
|
235
235
|
var p = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
236
236
|
return _(
|
|
@@ -239,7 +239,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
239
239
|
s,
|
|
240
240
|
!1,
|
|
241
241
|
p ? Error("react-stack-top-frame") : H,
|
|
242
|
-
p ? L(
|
|
242
|
+
p ? L(c(e)) : ae
|
|
243
243
|
);
|
|
244
244
|
}, V.jsxs = function(e, o, s) {
|
|
245
245
|
var p = 1e4 > A.recentlyCreatedOwnerStacks++;
|
|
@@ -249,7 +249,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
249
249
|
s,
|
|
250
250
|
!0,
|
|
251
251
|
p ? Error("react-stack-top-frame") : H,
|
|
252
|
-
p ? L(
|
|
252
|
+
p ? L(c(e)) : ae
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
255
|
})()), V;
|
|
@@ -352,50 +352,50 @@ const X = {
|
|
|
352
352
|
2089: [31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30],
|
|
353
353
|
2090: [31, 31, 32, 32, 31, 30, 30, 29, 30, 29, 30, 30]
|
|
354
354
|
}, ee = new Date(1943, 3, 14);
|
|
355
|
-
function Te(t,
|
|
356
|
-
let
|
|
355
|
+
function Te(t, l, g) {
|
|
356
|
+
let c = 0;
|
|
357
357
|
for (let i = 2e3; i < t; i++) {
|
|
358
358
|
const x = X[i];
|
|
359
|
-
x && (
|
|
359
|
+
x && (c += x.reduce((a, f) => a + f, 0));
|
|
360
360
|
}
|
|
361
361
|
const d = X[t] || [];
|
|
362
|
-
for (let i = 0; i <
|
|
363
|
-
return
|
|
362
|
+
for (let i = 0; i < l - 1; i++) c += d[i] || 30;
|
|
363
|
+
return c + g - 1;
|
|
364
364
|
}
|
|
365
|
-
function U(t,
|
|
366
|
-
const
|
|
367
|
-
return
|
|
365
|
+
function U(t, l, g) {
|
|
366
|
+
const c = new Date(ee);
|
|
367
|
+
return c.setDate(c.getDate() + Te(t, l, g)), c;
|
|
368
368
|
}
|
|
369
369
|
function Re(t) {
|
|
370
|
-
const
|
|
371
|
-
let
|
|
370
|
+
const l = new Date(t.getFullYear(), t.getMonth(), t.getDate()), g = new Date(ee.getFullYear(), ee.getMonth(), ee.getDate());
|
|
371
|
+
let c = Math.round((l - g) / 864e5), d = 2e3;
|
|
372
372
|
for (; d <= 2090; ) {
|
|
373
373
|
const a = X[d], f = a ? a.reduce((j, _) => j + _, 0) : 365;
|
|
374
|
-
if (
|
|
375
|
-
|
|
374
|
+
if (c < f) break;
|
|
375
|
+
c -= f, d++;
|
|
376
376
|
}
|
|
377
377
|
const i = X[d] || [];
|
|
378
378
|
let x = 1;
|
|
379
379
|
for (let a = 0; a < 12; a++) {
|
|
380
380
|
const f = i[a] || 30;
|
|
381
|
-
if (
|
|
381
|
+
if (c < f) {
|
|
382
382
|
x = a + 1;
|
|
383
383
|
break;
|
|
384
384
|
}
|
|
385
|
-
|
|
385
|
+
c -= f, a === 11 && (x = 12);
|
|
386
386
|
}
|
|
387
|
-
return { year: d, month: x, day:
|
|
387
|
+
return { year: d, month: x, day: c + 1 };
|
|
388
388
|
}
|
|
389
389
|
function K() {
|
|
390
390
|
return Re(/* @__PURE__ */ new Date());
|
|
391
391
|
}
|
|
392
|
-
function me(t,
|
|
393
|
-
return (X[t] || [])[
|
|
392
|
+
function me(t, l) {
|
|
393
|
+
return (X[t] || [])[l - 1] || 30;
|
|
394
394
|
}
|
|
395
|
-
function De(t,
|
|
396
|
-
return U(t,
|
|
395
|
+
function De(t, l) {
|
|
396
|
+
return U(t, l, 1).getDay();
|
|
397
397
|
}
|
|
398
|
-
const he = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "असोज", "कार्तिक", "मङ्सिर", "पुष", "माघ", "फागुन", "चैत्र"], xe = ["Baisakh", "Jestha", "Ashadh", "Shrawan", "Bhadra", "Ashwin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Ae = ["आइत", "सोम", "मङ्गल", "बुध", "बिही", "शुक्र", "शनि"], Oe = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Pe = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], G = (t) => String(t).split("").map((
|
|
398
|
+
const he = ["बैशाख", "जेठ", "असार", "श्रावण", "भाद्र", "असोज", "कार्तिक", "मङ्सिर", "पुष", "माघ", "फागुन", "चैत्र"], xe = ["Baisakh", "Jestha", "Ashadh", "Shrawan", "Bhadra", "Ashwin", "Kartik", "Mangsir", "Poush", "Magh", "Falgun", "Chaitra"], Ae = ["आइत", "सोम", "मङ्गल", "बुध", "बिही", "शुक्र", "शनि"], Oe = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], Pe = ["०", "१", "२", "३", "४", "५", "६", "७", "८", "९"], G = (t) => String(t).split("").map((l) => Pe[+l] ?? l).join(""), Ce = (t) => t ? t.toLocaleDateString("en-GB", { day: "numeric", month: "short", year: "numeric" }) : "", Me = `
|
|
399
399
|
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
|
|
400
400
|
|
|
401
401
|
.ndp{
|
|
@@ -569,6 +569,8 @@ const he = ["बैशाख", "जेठ", "असार", "श्रावण"
|
|
|
569
569
|
.ndp-cell.today:not(.picked){
|
|
570
570
|
background:var(--ndp-today-bg);
|
|
571
571
|
font-weight:700;color:var(--ndp-primary);
|
|
572
|
+
outline:1.5px solid var(--ndp-primary);
|
|
573
|
+
outline-offset:-1px;
|
|
572
574
|
}
|
|
573
575
|
.ndp-cell.picked{
|
|
574
576
|
background:var(--ndp-primary);color:#fff;font-weight:700;
|
|
@@ -597,25 +599,25 @@ const he = ["बैशाख", "जेठ", "असार", "श्रावण"
|
|
|
597
599
|
}
|
|
598
600
|
.ndp-today-btn:hover{background:#FDEECA;}
|
|
599
601
|
`;
|
|
600
|
-
let
|
|
602
|
+
let be = !1;
|
|
601
603
|
function Ye() {
|
|
602
|
-
if (!
|
|
604
|
+
if (!be && typeof document < "u") {
|
|
603
605
|
const t = document.createElement("style");
|
|
604
|
-
t.textContent = Me, document.head.appendChild(t),
|
|
606
|
+
t.textContent = Me, document.head.appendChild(t), be = !0;
|
|
605
607
|
}
|
|
606
608
|
}
|
|
607
609
|
function Le({
|
|
608
610
|
value: t,
|
|
609
|
-
onChange:
|
|
610
|
-
language:
|
|
611
|
-
placeholder:
|
|
611
|
+
onChange: l,
|
|
612
|
+
language: g = "np",
|
|
613
|
+
placeholder: c,
|
|
612
614
|
minYear: d = 2060,
|
|
613
615
|
maxYear: i = 2090,
|
|
614
616
|
className: x = "",
|
|
615
617
|
styles: a = {}
|
|
616
618
|
}) {
|
|
617
619
|
Ye();
|
|
618
|
-
const f =
|
|
620
|
+
const f = g !== "en", j = K(), [_, E] = C(!1), [S, v] = C(null), [M, N] = C(!1), [w, T] = C(!1), [b, R] = C(() => t?.year ?? K().year), [h, y] = C(() => t?.month ?? K().month), Y = ce(null), $ = ce(null);
|
|
619
621
|
de(() => {
|
|
620
622
|
const r = (m) => {
|
|
621
623
|
Y.current && !Y.current.contains(m.target) && (N(!1), T(!1));
|
|
@@ -631,15 +633,15 @@ function Le({
|
|
|
631
633
|
}, [w]);
|
|
632
634
|
const re = _e((r) => {
|
|
633
635
|
if (!r) return;
|
|
634
|
-
|
|
635
|
-
}, [
|
|
636
|
+
l?.({ year: b, month: h, day: r }, U(b, h, r)), E(!1);
|
|
637
|
+
}, [b, h, l]), B = () => {
|
|
636
638
|
v("right"), setTimeout(() => v(null), 200), h === 1 ? (y(12), R((r) => r - 1)) : y((r) => r - 1);
|
|
637
639
|
}, ne = () => {
|
|
638
640
|
v("left"), setTimeout(() => v(null), 200), h === 12 ? (y(1), R((r) => r + 1)) : y((r) => r + 1);
|
|
639
641
|
}, te = () => {
|
|
640
642
|
const r = K();
|
|
641
|
-
R(r.year), y(r.month),
|
|
642
|
-
}, A = me(
|
|
643
|
+
R(r.year), y(r.month), l?.(r, U(r.year, r.month, r.day)), E(!1);
|
|
644
|
+
}, A = me(b, h), O = De(b, h), oe = h === 1 ? 12 : h - 1, L = h === 1 ? b - 1 : b, q = me(L, oe), J = Array.from({ length: O }, (r, m) => ({
|
|
643
645
|
day: q - O + 1 + m,
|
|
644
646
|
overflow: "prev"
|
|
645
647
|
})), H = Array.from({ length: A }, (r, m) => ({
|
|
@@ -648,7 +650,7 @@ function Le({
|
|
|
648
650
|
})), Z = 42 - (O + A), e = Array.from({ length: Z }, (r, m) => ({
|
|
649
651
|
day: m + 1,
|
|
650
652
|
overflow: "next"
|
|
651
|
-
})), o = [...J, ...H, ...e], s = f ? he : xe, p = f ? Ae : Oe, D = s[h - 1], P = f ? G(
|
|
653
|
+
})), o = [...J, ...H, ...e], s = f ? he : xe, p = f ? Ae : Oe, D = s[h - 1], P = f ? G(b) : String(b), k = U(b, h, 1).toLocaleDateString("en-GB", { month: "short", year: "numeric" }), z = t ? f ? `${G(t.year)} ${he[t.month - 1]} ${G(t.day)}` : `${t.year} ${xe[t.month - 1]} ${t.day}` : "", se = f ? "मिति छान्नुहोस्" : "Select BS date", ie = t ? U(t.year, t.month, t.day) : null, ge = Array.from({ length: i - d + 1 }, (r, m) => d + m), ve = {
|
|
652
654
|
...a.primary && { "--ndp-primary": a.primary },
|
|
653
655
|
...a.primarySoft && { "--ndp-primary-soft": a.primarySoft },
|
|
654
656
|
...a.background && { "--ndp-background": a.background },
|
|
@@ -668,7 +670,7 @@ function Le({
|
|
|
668
670
|
readOnly: !0,
|
|
669
671
|
className: `ndp-input${_ ? " open" : ""}`,
|
|
670
672
|
value: z,
|
|
671
|
-
placeholder:
|
|
673
|
+
placeholder: c ?? se
|
|
672
674
|
}
|
|
673
675
|
),
|
|
674
676
|
/* @__PURE__ */ n.jsx("span", { className: "ndp-icon", children: /* @__PURE__ */ n.jsxs("svg", { width: "17", height: "17", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.2", strokeLinecap: "round", strokeLinejoin: "round", children: [
|
|
@@ -682,7 +684,7 @@ function Le({
|
|
|
682
684
|
r.target === r.currentTarget && (E(!1), N(!1), T(!1));
|
|
683
685
|
}, children: /* @__PURE__ */ n.jsxs("div", { className: "ndp-popup", children: [
|
|
684
686
|
/* @__PURE__ */ n.jsx("div", { className: "ndp-hd", children: /* @__PURE__ */ n.jsxs("div", { className: "ndp-hd-row", children: [
|
|
685
|
-
/* @__PURE__ */ n.jsx("button", { className: "ndp-nav", onClick: B, children: /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n.jsx("path", { d: "m15 18-6-6 6-6" }) }) }),
|
|
687
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", className: "ndp-nav", onClick: B, children: /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n.jsx("path", { d: "m15 18-6-6 6-6" }) }) }),
|
|
686
688
|
/* @__PURE__ */ n.jsxs("div", { className: `ndp-hd-center${S ? ` ndp-slide-${S}` : ""}`, children: [
|
|
687
689
|
/* @__PURE__ */ n.jsx("div", { className: "ndp-hd-month", children: D }),
|
|
688
690
|
/* @__PURE__ */ n.jsxs("div", { className: "ndp-hd-sub", children: [
|
|
@@ -691,13 +693,14 @@ function Le({
|
|
|
691
693
|
k
|
|
692
694
|
] })
|
|
693
695
|
] }),
|
|
694
|
-
/* @__PURE__ */ n.jsx("button", { className: "ndp-nav", onClick: ne, children: /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n.jsx("path", { d: "m9 18 6-6-6-6" }) }) })
|
|
696
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", className: "ndp-nav", onClick: ne, children: /* @__PURE__ */ n.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n.jsx("path", { d: "m9 18 6-6-6-6" }) }) })
|
|
695
697
|
] }) }),
|
|
696
698
|
/* @__PURE__ */ n.jsxs("div", { className: "ndp-controls", children: [
|
|
697
699
|
/* @__PURE__ */ n.jsxs("div", { className: "ndp-dd", children: [
|
|
698
700
|
/* @__PURE__ */ n.jsxs(
|
|
699
701
|
"button",
|
|
700
702
|
{
|
|
703
|
+
type: "button",
|
|
701
704
|
className: `ndp-dd-trigger${M ? " active" : ""}`,
|
|
702
705
|
onClick: () => {
|
|
703
706
|
N((r) => !r), T(!1);
|
|
@@ -724,6 +727,7 @@ function Le({
|
|
|
724
727
|
/* @__PURE__ */ n.jsxs(
|
|
725
728
|
"button",
|
|
726
729
|
{
|
|
730
|
+
type: "button",
|
|
727
731
|
className: `ndp-dd-trigger${w ? " active" : ""}`,
|
|
728
732
|
onClick: () => {
|
|
729
733
|
T((r) => !r), N(!1);
|
|
@@ -734,10 +738,10 @@ function Le({
|
|
|
734
738
|
]
|
|
735
739
|
}
|
|
736
740
|
),
|
|
737
|
-
w && /* @__PURE__ */ n.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ n.jsx("div", { className: "ndp-dd-years", ref: $, children:
|
|
741
|
+
w && /* @__PURE__ */ n.jsx("div", { className: "ndp-dd-panel", children: /* @__PURE__ */ n.jsx("div", { className: "ndp-dd-years", ref: $, children: ge.map((r) => /* @__PURE__ */ n.jsx(
|
|
738
742
|
"button",
|
|
739
743
|
{
|
|
740
|
-
className: `ndp-dd-year-item${
|
|
744
|
+
className: `ndp-dd-year-item${b === r ? " sel" : ""}`,
|
|
741
745
|
onClick: () => {
|
|
742
746
|
R(r), T(!1);
|
|
743
747
|
},
|
|
@@ -749,18 +753,19 @@ function Le({
|
|
|
749
753
|
] }),
|
|
750
754
|
/* @__PURE__ */ n.jsxs("div", { className: "ndp-body", children: [
|
|
751
755
|
/* @__PURE__ */ n.jsx("div", { className: "ndp-wdays", children: p.map((r, m) => /* @__PURE__ */ n.jsx("div", { className: "ndp-wday", children: r }, m)) }),
|
|
752
|
-
/* @__PURE__ */ n.jsx("div", { className: `ndp-grid${S ? ` ndp-slide-${S}` : ""}`, children: o.map(({ day: r, overflow: m },
|
|
753
|
-
const ye =
|
|
756
|
+
/* @__PURE__ */ n.jsx("div", { className: `ndp-grid${S ? ` ndp-slide-${S}` : ""}`, children: o.map(({ day: r, overflow: m }, le) => {
|
|
757
|
+
const ye = le % 7 === 6, F = m !== null, we = !F && r === j.day && h === j.month && b === j.year, ke = !F && t && r === t.day && h === t.month && b === t.year;
|
|
754
758
|
let I = "ndp-cell";
|
|
755
759
|
return F ? I += " overflow" : ye && (I += " wknd"), we && (I += " today"), ke && (I += " picked"), /* @__PURE__ */ n.jsx(
|
|
756
760
|
"button",
|
|
757
761
|
{
|
|
762
|
+
type: "button",
|
|
758
763
|
className: I,
|
|
759
764
|
disabled: F,
|
|
760
765
|
onClick: () => !F && re(r),
|
|
761
766
|
children: f ? G(r) : r
|
|
762
767
|
},
|
|
763
|
-
|
|
768
|
+
le
|
|
764
769
|
);
|
|
765
770
|
}) })
|
|
766
771
|
] }),
|
|
@@ -770,7 +775,7 @@ function Le({
|
|
|
770
775
|
" ",
|
|
771
776
|
Ce(ie)
|
|
772
777
|
] }) : /* @__PURE__ */ n.jsx("span", { style: { color: "var(--ndp-text-muted)", fontSize: 12 }, children: f ? "मिति छानिएको छैन" : "No date selected" }) }),
|
|
773
|
-
/* @__PURE__ */ n.jsx("button", { className: "ndp-today-btn", onClick: te, children: f ? "आज" : "Today" })
|
|
778
|
+
/* @__PURE__ */ n.jsx("button", { type: "button", className: "ndp-today-btn", onClick: te, children: f ? "आज" : "Today" })
|
|
774
779
|
] })
|
|
775
780
|
] }) })
|
|
776
781
|
] });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
(function(y,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(y=typeof globalThis<"u"?globalThis:y||self,x(y.NepaliDatePicker={},y.React))})(this,(function(y,x){"use strict";var Z={exports:{}},B={};var ce;function ve(){if(ce)return B;ce=1;var t=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function v(l,d,i){var
|
|
1
|
+
(function(y,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(y=typeof globalThis<"u"?globalThis:y||self,x(y.NepaliDatePicker={},y.React))})(this,(function(y,x){"use strict";var Z={exports:{}},B={};var ce;function ve(){if(ce)return B;ce=1;var t=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function v(l,d,i){var b=null;if(i!==void 0&&(b=""+i),d.key!==void 0&&(b=""+d.key),"key"in d){i={};for(var a in d)a!=="key"&&(i[a]=d[a])}else i=d;return d=i.ref,{$$typeof:t,type:l,key:b,ref:d!==void 0?d:null,props:i}}return B.Fragment=c,B.jsx=v,B.jsxs=v,B}var L={};var le;function ye(){return le||(le=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case j:return"Fragment";case g:return"Profiler";case D:return"StrictMode";case V:return"Suspense";case G:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case R:return"Portal";case h:return e.displayName||"Context";case A:return(e._context.displayName||"Context")+".Consumer";case k:var o=e.render;return e=e.displayName,e||(e=o.displayName||o.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case te:return o=e.displayName||null,o!==null?o:t(e.type)||"Memo";case U:o=e._payload,e=e._init;try{return t(e(o))}catch{}}return null}function c(e){return""+e}function v(e){try{c(e);var o=!1}catch{o=!0}if(o){o=console;var s=o.error,p=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(o,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",p),c(e)}}function l(e){if(e===j)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===U)return"<...>";try{var o=t(e);return o?"<"+o+">":"<...>"}catch{return"<...>"}}function d(){var e=C.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function b(e){if(M.call(e,"key")){var o=Object.getOwnPropertyDescriptor(e,"key").get;if(o&&o.isReactWarning)return!1}return e.key!==void 0}function a(e,o){function s(){K||(K=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",o))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function f(){var e=t(this.type);return q[e]||(q[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function _(e,o,s,p,O,Y){var u=s.ref;return e={$$typeof:W,type:e,key:o,props:s,_owner:p},(u!==void 0?u:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:f}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:O}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function E(e,o,s,p,O,Y){var u=o.children;if(u!==void 0)if(p)if(se(u)){for(p=0;p<u.length;p++)N(u[p]);Object.freeze&&Object.freeze(u)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else N(u);if(M.call(o,"key")){u=t(e);var S=Object.keys(o).filter(function(ie){return ie!=="key"});p=0<S.length?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}",re[u+p]||(S=0<S.length?"{"+S.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,p,u,S,u),re[u+p]=!0)}if(u=null,s!==void 0&&(v(s),u=""+s),
|
|
6
|
+
<%s key={someKey} {...props} />`,p,u,S,u),re[u+p]=!0)}if(u=null,s!==void 0&&(v(s),u=""+s),b(o)&&(v(o.key),u=""+o.key),"key"in o){s={};for(var J in o)J!=="key"&&(s[J]=o[J])}else s=o;return u&&a(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),_(e,u,s,d(),O,Y)}function N(e){T(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===U&&(e._payload.status==="fulfilled"?T(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function T(e){return typeof e=="object"&&e!==null&&e.$$typeof===W}var w=x,W=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),h=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ae=Symbol.for("react.client.reference"),C=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,se=Array.isArray,X=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(e){return e()}};var K,q={},ee=w.react_stack_bottom_frame.bind(w,i)(),de=X(l(i)),re={};L.Fragment=j,L.jsx=function(e,o,s){var p=1e4>C.recentlyCreatedOwnerStacks++;return E(e,o,s,!1,p?Error("react-stack-top-frame"):ee,p?X(l(e)):de)},L.jsxs=function(e,o,s){var p=1e4>C.recentlyCreatedOwnerStacks++;return E(e,o,s,!0,p?Error("react-stack-top-frame"):ee,p?X(l(e)):de)}})()),L}var pe;function we(){return pe||(pe=1,process.env.NODE_ENV==="production"?Z.exports=ve():Z.exports=ye()),Z.exports}var r=we();const z={2e3:[30,32,31,32,31,30,30,30,29,30,29,31],2001:[31,31,32,31,31,31,30,29,30,29,30,30],2002:[31,31,32,32,31,30,30,29,30,29,30,30],2003:[31,32,31,32,31,30,30,30,29,29,30,31],2004:[30,32,31,32,31,30,30,30,29,30,29,31],2005:[31,31,32,31,31,31,30,29,30,29,30,30],2006:[31,31,32,32,31,30,30,29,30,29,30,30],2007:[31,32,31,32,31,30,30,30,29,29,30,31],2008:[31,31,31,32,31,31,29,30,30,29,29,31],2009:[31,31,32,31,31,31,30,29,30,29,30,30],2010:[31,31,32,32,31,30,30,29,30,29,30,30],2011:[31,32,31,32,31,30,30,30,29,29,30,31],2012:[31,31,31,32,31,31,29,30,30,29,30,30],2013:[31,31,32,31,31,31,30,29,30,29,30,30],2014:[31,31,32,32,31,30,30,29,30,29,30,30],2015:[31,32,31,32,31,30,30,30,29,29,30,31],2016:[31,31,31,32,31,31,29,30,30,29,30,30],2017:[31,31,32,31,31,31,30,29,30,29,30,30],2018:[31,31,32,32,31,30,30,29,30,29,30,30],2019:[31,32,31,32,31,30,30,30,29,29,30,31],2020:[31,31,31,32,31,31,30,29,30,29,30,30],2021:[31,31,32,31,31,31,30,29,30,29,30,30],2022:[31,31,32,32,31,30,30,29,30,29,30,30],2023:[31,32,31,32,31,30,30,30,29,29,30,31],2024:[31,31,31,32,31,31,30,29,30,29,30,30],2025:[31,31,32,31,31,31,30,29,30,29,30,30],2026:[31,31,32,32,31,30,30,29,30,29,30,30],2027:[31,32,31,32,31,30,30,30,29,29,30,32],2028:[30,32,31,32,31,30,30,30,29,30,29,31],2029:[31,31,32,31,31,31,30,29,30,29,30,30],2030:[31,31,32,32,31,30,30,29,30,29,30,30],2031:[31,32,31,32,31,30,30,30,29,29,30,31],2032:[30,32,31,32,31,30,30,30,29,30,29,31],2033:[31,31,32,31,31,31,30,29,30,29,30,30],2034:[31,31,32,32,31,30,30,29,30,29,30,30],2035:[31,32,31,32,31,30,30,30,29,29,30,31],2036:[30,32,31,32,31,31,29,30,30,29,29,31],2037:[31,31,32,31,31,31,30,29,30,29,30,30],2038:[31,31,32,32,31,30,30,29,30,29,30,30],2039:[31,32,31,32,31,30,30,30,29,29,30,31],2040:[31,31,31,32,31,31,29,30,30,29,30,30],2041:[31,31,32,31,31,31,30,29,30,29,30,30],2042:[31,31,32,32,31,30,30,29,30,29,30,31],2043:[31,32,31,32,31,30,30,30,29,29,30,30],2044:[31,31,31,32,31,31,29,30,30,29,30,30],2045:[31,31,32,31,31,31,30,29,30,29,30,30],2046:[31,31,32,32,31,30,30,29,30,29,30,30],2047:[31,32,31,32,31,30,30,30,29,29,30,31],2048:[30,32,31,32,31,30,30,30,29,30,29,31],2049:[31,31,32,31,31,31,30,29,30,29,30,30],2050:[31,31,32,32,31,30,30,29,30,29,30,30],2051:[31,32,31,32,31,30,30,30,29,29,30,31],2052:[31,31,31,32,31,31,29,30,30,29,30,30],2053:[31,31,32,31,31,31,30,29,30,29,30,30],2054:[31,31,32,32,31,30,30,29,30,29,30,30],2055:[31,32,31,32,31,30,30,30,29,29,30,31],2056:[31,31,31,32,31,31,30,29,30,29,30,30],2057:[31,31,32,31,31,31,30,29,30,29,30,30],2058:[31,31,32,32,31,30,30,29,30,29,30,30],2059:[31,32,31,32,31,30,30,30,29,29,30,31],2060:[31,31,31,32,31,31,30,29,30,29,30,30],2061:[31,31,32,31,31,31,30,29,30,29,30,30],2062:[31,31,32,32,31,30,30,29,30,29,30,30],2063:[31,32,31,32,31,30,30,30,29,29,30,31],2064:[31,31,31,32,31,31,29,30,29,30,29,31],2065:[31,31,32,31,31,31,30,29,30,29,30,30],2066:[31,31,32,32,31,30,30,29,30,29,30,30],2067:[31,32,31,32,31,30,30,30,29,29,30,31],2068:[31,31,31,32,31,31,29,30,30,29,30,30],2069:[31,31,32,31,31,31,30,29,30,29,30,30],2070:[31,31,32,32,31,30,30,29,30,29,30,30],2071:[31,32,31,32,31,30,30,30,29,29,30,31],2072:[31,31,31,32,31,31,29,30,30,29,30,30],2073:[31,31,32,31,31,31,30,29,30,29,30,30],2074:[31,31,32,32,31,30,30,29,30,29,30,30],2075:[31,32,31,32,31,30,30,30,29,29,30,31],2076:[31,31,31,32,31,31,30,29,30,29,30,30],2077:[31,31,32,31,31,31,30,29,30,29,30,30],2078:[31,31,32,32,31,30,30,29,30,29,30,30],2079:[31,32,31,32,31,30,30,30,29,29,30,31],2080:[31,31,31,32,31,31,30,29,30,29,30,30],2081:[31,31,32,31,31,31,30,29,30,29,30,30],2082:[31,32,31,32,31,30,30,29,30,29,30,30],2083:[31,32,31,32,31,30,30,30,29,30,29,31],2084:[31,31,31,32,31,31,30,29,30,29,30,30],2085:[31,31,32,31,31,31,30,29,30,29,30,30],2086:[31,32,31,32,31,30,30,29,30,29,30,30],2087:[31,32,31,32,31,30,30,30,29,29,30,31],2088:[30,32,31,32,31,30,30,30,29,30,29,31],2089:[31,31,32,31,31,31,30,29,30,29,30,30],2090:[31,31,32,32,31,30,30,29,30,29,30,30]},Q=new Date(1943,3,14);function ke(t,c,v){let l=0;for(let i=2e3;i<t;i++){const b=z[i];b&&(l+=b.reduce((a,f)=>a+f,0))}const d=z[t]||[];for(let i=0;i<c-1;i++)l+=d[i]||30;return l+v-1}function P(t,c,v){const l=new Date(Q);return l.setDate(l.getDate()+ke(t,c,v)),l}function ue(t){const c=new Date(t.getFullYear(),t.getMonth(),t.getDate()),v=new Date(Q.getFullYear(),Q.getMonth(),Q.getDate());let l=Math.round((c-v)/864e5),d=2e3;for(;d<=2090;){const a=z[d],f=a?a.reduce((_,E)=>_+E,0):365;if(l<f)break;l-=f,d++}const i=z[d]||[];let b=1;for(let a=0;a<12;a++){const f=i[a]||30;if(l<f){b=a+1;break}l-=f,a===11&&(b=12)}return{year:d,month:b,day:l+1}}function F(){return ue(new Date)}function ne(t,c){return(z[t]||[])[c-1]||30}function fe(t,c){return P(t,c,1).getDay()}const me=["बैशाख","जेठ","असार","श्रावण","भाद्र","असोज","कार्तिक","मङ्सिर","पुष","माघ","फागुन","चैत्र"],he=["Baisakh","Jestha","Ashadh","Shrawan","Bhadra","Ashwin","Kartik","Mangsir","Poush","Magh","Falgun","Chaitra"],je=["आइत","सोम","मङ्गल","बुध","बिही","शुक्र","शनि"],Se=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],_e=["०","१","२","३","४","५","६","७","८","९"],I=t=>String(t).split("").map(c=>_e[+c]??c).join(""),Ee=t=>t?t.toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}):"",Ne=`
|
|
7
7
|
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Devanagari:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap');
|
|
8
8
|
|
|
9
9
|
.ndp{
|
|
@@ -177,6 +177,8 @@ React keys must be passed directly to JSX without using spread:
|
|
|
177
177
|
.ndp-cell.today:not(.picked){
|
|
178
178
|
background:var(--ndp-today-bg);
|
|
179
179
|
font-weight:700;color:var(--ndp-primary);
|
|
180
|
+
outline:1.5px solid var(--ndp-primary);
|
|
181
|
+
outline-offset:-1px;
|
|
180
182
|
}
|
|
181
183
|
.ndp-cell.picked{
|
|
182
184
|
background:var(--ndp-primary);color:#fff;font-weight:700;
|
|
@@ -204,4 +206,4 @@ React keys must be passed directly to JSX without using spread:
|
|
|
204
206
|
transition:background .15s;white-space:nowrap;
|
|
205
207
|
}
|
|
206
208
|
.ndp-today-btn:hover{background:#FDEECA;}
|
|
207
|
-
`;let xe=!1;function Te(){if(!xe&&typeof document<"u"){const t=document.createElement("style");t.textContent=Ne,document.head.appendChild(t),xe=!0}}function Re({value:t,onChange:c,language:v="np",placeholder:l,minYear:d=2060,maxYear:i=2090,className:
|
|
209
|
+
`;let xe=!1;function Te(){if(!xe&&typeof document<"u"){const t=document.createElement("style");t.textContent=Ne,document.head.appendChild(t),xe=!0}}function Re({value:t,onChange:c,language:v="np",placeholder:l,minYear:d=2060,maxYear:i=2090,className:b="",styles:a={}}){Te();const f=v!=="en",_=F(),[E,N]=x.useState(!1),[T,w]=x.useState(null),[W,R]=x.useState(!1),[j,D]=x.useState(!1),[g,A]=x.useState(()=>t?.year??F().year),[h,k]=x.useState(()=>t?.month??F().month),V=x.useRef(null),G=x.useRef(null);x.useEffect(()=>{const n=m=>{V.current&&!V.current.contains(m.target)&&(R(!1),D(!1))};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]),x.useEffect(()=>{t&&(A(t.year),k(t.month))},[t]),x.useEffect(()=>{if(j&&G.current){const n=G.current.querySelector(".sel");n&&n.scrollIntoView({block:"center"})}},[j]);const te=x.useCallback(n=>{if(!n)return;c?.({year:g,month:h,day:n},P(g,h,n)),N(!1)},[g,h,c]),U=()=>{w("right"),setTimeout(()=>w(null),200),h===1?(k(12),A(n=>n-1)):k(n=>n-1)},oe=()=>{w("left"),setTimeout(()=>w(null),200),h===12?(k(1),A(n=>n+1)):k(n=>n+1)},ae=()=>{const n=F();A(n.year),k(n.month),c?.(n,P(n.year,n.month,n.day)),N(!1)},C=ne(g,h),M=fe(g,h),se=h===1?12:h-1,X=h===1?g-1:g,K=ne(X,se),q=Array.from({length:M},(n,m)=>({day:K-M+1+m,overflow:"prev"})),ee=Array.from({length:C},(n,m)=>({day:m+1,overflow:null})),re=42-(M+C),e=Array.from({length:re},(n,m)=>({day:m+1,overflow:"next"})),o=[...q,...ee,...e],s=f?me:he,p=f?je:Se,O=s[h-1],Y=f?I(g):String(g),S=P(g,h,1).toLocaleDateString("en-GB",{month:"short",year:"numeric"}),J=t?f?`${I(t.year)} ${me[t.month-1]} ${I(t.day)}`:`${t.year} ${he[t.month-1]} ${t.day}`:"",ie=f?"मिति छान्नुहोस्":"Select BS date",be=t?P(t.year,t.month,t.day):null,De=Array.from({length:i-d+1},(n,m)=>d+m),Ae={...a.primary&&{"--ndp-primary":a.primary},...a.primarySoft&&{"--ndp-primary-soft":a.primarySoft},...a.background&&{"--ndp-background":a.background},...a.text&&{"--ndp-text":a.text},...a.textMuted&&{"--ndp-text-muted":a.textMuted},...a.border&&{"--ndp-border":a.border},...a.todayBg&&{"--ndp-today-bg":a.todayBg},...a.controlsBg&&{"--ndp-controls-bg":a.controlsBg},...a.radius&&{"--ndp-radius":a.radius},...a.shadow&&{"--ndp-shadow":a.shadow}};return r.jsxs("div",{className:`ndp${b?` ${b}`:""}`,ref:V,style:Ae,children:[r.jsxs("div",{className:"ndp-wrap",onClick:()=>N(n=>!n),children:[r.jsx("input",{readOnly:!0,className:`ndp-input${E?" open":""}`,value:J,placeholder:l??ie}),r.jsx("span",{className:"ndp-icon",children:r.jsxs("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),r.jsx("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),r.jsx("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),r.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]})})]}),E&&r.jsx("div",{className:"ndp-overlay",onMouseDown:n=>{n.target===n.currentTarget&&(N(!1),R(!1),D(!1))},children:r.jsxs("div",{className:"ndp-popup",children:[r.jsx("div",{className:"ndp-hd",children:r.jsxs("div",{className:"ndp-hd-row",children:[r.jsx("button",{type:"button",className:"ndp-nav",onClick:U,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m15 18-6-6 6-6"})})}),r.jsxs("div",{className:`ndp-hd-center${T?` ndp-slide-${T}`:""}`,children:[r.jsx("div",{className:"ndp-hd-month",children:O}),r.jsxs("div",{className:"ndp-hd-sub",children:[Y," BS · ",S]})]}),r.jsx("button",{type:"button",className:"ndp-nav",onClick:oe,children:r.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m9 18 6-6-6-6"})})})]})}),r.jsxs("div",{className:"ndp-controls",children:[r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{type:"button",className:`ndp-dd-trigger${W?" active":""}`,onClick:()=>{R(n=>!n),D(!1)},children:[r.jsx("span",{children:O}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),W&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-months",children:s.map((n,m)=>r.jsx("button",{className:`ndp-dd-month-item${h===m+1?" sel":""}`,onClick:()=>{w(m+1<h?"right":"left"),setTimeout(()=>w(null),200),k(m+1),R(!1)},children:n},m))})})]}),r.jsxs("div",{className:"ndp-dd",children:[r.jsxs("button",{type:"button",className:`ndp-dd-trigger${j?" active":""}`,onClick:()=>{D(n=>!n),R(!1)},children:[r.jsx("span",{children:Y}),r.jsx("span",{className:"ndp-dd-arrow",children:r.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:r.jsx("path",{d:"m6 9 6 6 6-6"})})})]}),j&&r.jsx("div",{className:"ndp-dd-panel",children:r.jsx("div",{className:"ndp-dd-years",ref:G,children:De.map(n=>r.jsx("button",{className:`ndp-dd-year-item${g===n?" sel":""}`,onClick:()=>{A(n),D(!1)},children:f?I(n):n},n))})})]})]}),r.jsxs("div",{className:"ndp-body",children:[r.jsx("div",{className:"ndp-wdays",children:p.map((n,m)=>r.jsx("div",{className:"ndp-wday",children:n},m))}),r.jsx("div",{className:`ndp-grid${T?` ndp-slide-${T}`:""}`,children:o.map(({day:n,overflow:m},ge)=>{const Oe=ge%7===6,H=m!==null,Pe=!H&&n===_.day&&h===_.month&&g===_.year,Ce=!H&&t&&n===t.day&&h===t.month&&g===t.year;let $="ndp-cell";return H?$+=" overflow":Oe&&($+=" wknd"),Pe&&($+=" today"),Ce&&($+=" picked"),r.jsx("button",{type:"button",className:$,disabled:H,onClick:()=>!H&&te(n),children:f?I(n):n},ge)})})]}),r.jsxs("div",{className:"ndp-ft",children:[r.jsx("span",{className:"ndp-ad",children:be?r.jsxs(r.Fragment,{children:[r.jsx("b",{children:"AD:"})," ",Ee(be)]}):r.jsx("span",{style:{color:"var(--ndp-text-muted)",fontSize:12},children:f?"मिति छानिएको छैन":"No date selected"})}),r.jsx("button",{type:"button",className:"ndp-today-btn",onClick:ae,children:f?"आज":"Today"})]})]})})]})}y.NepaliDatePicker=Re,y.adToBs=ue,y.bsToAd=P,y.getDaysInBSMonth=ne,y.getFirstDayOfWeekBS=fe,y.getTodayBS=F,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@himal_bhattarai/nepali-datepicker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "Nepali Bikram Sambat (BS) date picker React component with BS↔AD conversion",
|
|
5
5
|
"main": "./dist/nepali-datepicker.umd.js",
|
|
6
6
|
"module": "./dist/nepali-datepicker.es.js",
|