@esic-lab/data-core-ui 0.0.15 → 0.0.16
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/index.css +529 -12
- package/dist/index.d.mts +753 -12
- package/dist/index.d.ts +753 -12
- package/dist/index.js +2055 -100
- package/dist/index.mjs +2047 -94
- package/package.json +8 -3
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,457 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
// node_modules/dayjs/dayjs.min.js
|
|
28
|
+
var require_dayjs_min = __commonJS({
|
|
29
|
+
"node_modules/dayjs/dayjs.min.js"(exports, module) {
|
|
30
|
+
"use strict";
|
|
31
|
+
!(function(t, e) {
|
|
32
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
|
|
33
|
+
})(exports, (function() {
|
|
34
|
+
"use strict";
|
|
35
|
+
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(t2) {
|
|
36
|
+
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
37
|
+
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
38
|
+
} }, m = function(t2, e2, n2) {
|
|
39
|
+
var r2 = String(t2);
|
|
40
|
+
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
41
|
+
}, v = { s: m, z: function(t2) {
|
|
42
|
+
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
43
|
+
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
44
|
+
}, m: function t2(e2, n2) {
|
|
45
|
+
if (e2.date() < n2.date()) return -t2(n2, e2);
|
|
46
|
+
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, c), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), c);
|
|
47
|
+
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
48
|
+
}, a: function(t2) {
|
|
49
|
+
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
50
|
+
}, p: function(t2) {
|
|
51
|
+
return { M: c, y: h, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: f }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
|
|
52
|
+
}, u: function(t2) {
|
|
53
|
+
return void 0 === t2;
|
|
54
|
+
} }, g = "en", D = {};
|
|
55
|
+
D[g] = M;
|
|
56
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
57
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
58
|
+
}, w = function t2(e2, n2, r2) {
|
|
59
|
+
var i2;
|
|
60
|
+
if (!e2) return g;
|
|
61
|
+
if ("string" == typeof e2) {
|
|
62
|
+
var s2 = e2.toLowerCase();
|
|
63
|
+
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
64
|
+
var u2 = e2.split("-");
|
|
65
|
+
if (!i2 && u2.length > 1) return t2(u2[0]);
|
|
66
|
+
} else {
|
|
67
|
+
var a2 = e2.name;
|
|
68
|
+
D[a2] = e2, i2 = a2;
|
|
69
|
+
}
|
|
70
|
+
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
71
|
+
}, O = function(t2, e2) {
|
|
72
|
+
if (S(t2)) return t2.clone();
|
|
73
|
+
var n2 = "object" == typeof e2 ? e2 : {};
|
|
74
|
+
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
75
|
+
}, b = v;
|
|
76
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
77
|
+
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
78
|
+
};
|
|
79
|
+
var _ = (function() {
|
|
80
|
+
function M2(t2) {
|
|
81
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
82
|
+
}
|
|
83
|
+
var m2 = M2.prototype;
|
|
84
|
+
return m2.parse = function(t2) {
|
|
85
|
+
this.$d = (function(t3) {
|
|
86
|
+
var e2 = t3.date, n2 = t3.utc;
|
|
87
|
+
if (null === e2) return /* @__PURE__ */ new Date(NaN);
|
|
88
|
+
if (b.u(e2)) return /* @__PURE__ */ new Date();
|
|
89
|
+
if (e2 instanceof Date) return new Date(e2);
|
|
90
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
91
|
+
var r2 = e2.match($);
|
|
92
|
+
if (r2) {
|
|
93
|
+
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
94
|
+
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return new Date(e2);
|
|
98
|
+
})(t2), this.init();
|
|
99
|
+
}, m2.init = function() {
|
|
100
|
+
var t2 = this.$d;
|
|
101
|
+
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
|
|
102
|
+
}, m2.$utils = function() {
|
|
103
|
+
return b;
|
|
104
|
+
}, m2.isValid = function() {
|
|
105
|
+
return !(this.$d.toString() === l);
|
|
106
|
+
}, m2.isSame = function(t2, e2) {
|
|
107
|
+
var n2 = O(t2);
|
|
108
|
+
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
109
|
+
}, m2.isAfter = function(t2, e2) {
|
|
110
|
+
return O(t2) < this.startOf(e2);
|
|
111
|
+
}, m2.isBefore = function(t2, e2) {
|
|
112
|
+
return this.endOf(e2) < O(t2);
|
|
113
|
+
}, m2.$g = function(t2, e2, n2) {
|
|
114
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
115
|
+
}, m2.unix = function() {
|
|
116
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
117
|
+
}, m2.valueOf = function() {
|
|
118
|
+
return this.$d.getTime();
|
|
119
|
+
}, m2.startOf = function(t2, e2) {
|
|
120
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
121
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
122
|
+
return r2 ? i2 : i2.endOf(a);
|
|
123
|
+
}, $2 = function(t3, e3) {
|
|
124
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
125
|
+
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
126
|
+
switch (f2) {
|
|
127
|
+
case h:
|
|
128
|
+
return r2 ? l2(1, 0) : l2(31, 11);
|
|
129
|
+
case c:
|
|
130
|
+
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
131
|
+
case o:
|
|
132
|
+
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
133
|
+
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
134
|
+
case a:
|
|
135
|
+
case d:
|
|
136
|
+
return $2(v2 + "Hours", 0);
|
|
137
|
+
case u:
|
|
138
|
+
return $2(v2 + "Minutes", 1);
|
|
139
|
+
case s:
|
|
140
|
+
return $2(v2 + "Seconds", 2);
|
|
141
|
+
case i:
|
|
142
|
+
return $2(v2 + "Milliseconds", 3);
|
|
143
|
+
default:
|
|
144
|
+
return this.clone();
|
|
145
|
+
}
|
|
146
|
+
}, m2.endOf = function(t2) {
|
|
147
|
+
return this.startOf(t2, false);
|
|
148
|
+
}, m2.$set = function(t2, e2) {
|
|
149
|
+
var n2, o2 = b.p(t2), f2 = "set" + (this.$u ? "UTC" : ""), l2 = (n2 = {}, n2[a] = f2 + "Date", n2[d] = f2 + "Date", n2[c] = f2 + "Month", n2[h] = f2 + "FullYear", n2[u] = f2 + "Hours", n2[s] = f2 + "Minutes", n2[i] = f2 + "Seconds", n2[r] = f2 + "Milliseconds", n2)[o2], $2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
|
|
150
|
+
if (o2 === c || o2 === h) {
|
|
151
|
+
var y2 = this.clone().set(d, 1);
|
|
152
|
+
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
153
|
+
} else l2 && this.$d[l2]($2);
|
|
154
|
+
return this.init(), this;
|
|
155
|
+
}, m2.set = function(t2, e2) {
|
|
156
|
+
return this.clone().$set(t2, e2);
|
|
157
|
+
}, m2.get = function(t2) {
|
|
158
|
+
return this[b.p(t2)]();
|
|
159
|
+
}, m2.add = function(r2, f2) {
|
|
160
|
+
var d2, l2 = this;
|
|
161
|
+
r2 = Number(r2);
|
|
162
|
+
var $2 = b.p(f2), y2 = function(t2) {
|
|
163
|
+
var e2 = O(l2);
|
|
164
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
165
|
+
};
|
|
166
|
+
if ($2 === c) return this.set(c, this.$M + r2);
|
|
167
|
+
if ($2 === h) return this.set(h, this.$y + r2);
|
|
168
|
+
if ($2 === a) return y2(1);
|
|
169
|
+
if ($2 === o) return y2(7);
|
|
170
|
+
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
171
|
+
return b.w(m3, this);
|
|
172
|
+
}, m2.subtract = function(t2, e2) {
|
|
173
|
+
return this.add(-1 * t2, e2);
|
|
174
|
+
}, m2.format = function(t2) {
|
|
175
|
+
var e2 = this, n2 = this.$locale();
|
|
176
|
+
if (!this.isValid()) return n2.invalidDate || l;
|
|
177
|
+
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = b.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, c2 = n2.months, f2 = n2.meridiem, h2 = function(t3, n3, i3, s3) {
|
|
178
|
+
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
179
|
+
}, d2 = function(t3) {
|
|
180
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
181
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
182
|
+
var r3 = t3 < 12 ? "AM" : "PM";
|
|
183
|
+
return n3 ? r3.toLowerCase() : r3;
|
|
184
|
+
};
|
|
185
|
+
return r2.replace(y, (function(t3, r3) {
|
|
186
|
+
return r3 || (function(t4) {
|
|
187
|
+
switch (t4) {
|
|
188
|
+
case "YY":
|
|
189
|
+
return String(e2.$y).slice(-2);
|
|
190
|
+
case "YYYY":
|
|
191
|
+
return b.s(e2.$y, 4, "0");
|
|
192
|
+
case "M":
|
|
193
|
+
return a2 + 1;
|
|
194
|
+
case "MM":
|
|
195
|
+
return b.s(a2 + 1, 2, "0");
|
|
196
|
+
case "MMM":
|
|
197
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
198
|
+
case "MMMM":
|
|
199
|
+
return h2(c2, a2);
|
|
200
|
+
case "D":
|
|
201
|
+
return e2.$D;
|
|
202
|
+
case "DD":
|
|
203
|
+
return b.s(e2.$D, 2, "0");
|
|
204
|
+
case "d":
|
|
205
|
+
return String(e2.$W);
|
|
206
|
+
case "dd":
|
|
207
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
208
|
+
case "ddd":
|
|
209
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
210
|
+
case "dddd":
|
|
211
|
+
return o2[e2.$W];
|
|
212
|
+
case "H":
|
|
213
|
+
return String(s2);
|
|
214
|
+
case "HH":
|
|
215
|
+
return b.s(s2, 2, "0");
|
|
216
|
+
case "h":
|
|
217
|
+
return d2(1);
|
|
218
|
+
case "hh":
|
|
219
|
+
return d2(2);
|
|
220
|
+
case "a":
|
|
221
|
+
return $2(s2, u2, true);
|
|
222
|
+
case "A":
|
|
223
|
+
return $2(s2, u2, false);
|
|
224
|
+
case "m":
|
|
225
|
+
return String(u2);
|
|
226
|
+
case "mm":
|
|
227
|
+
return b.s(u2, 2, "0");
|
|
228
|
+
case "s":
|
|
229
|
+
return String(e2.$s);
|
|
230
|
+
case "ss":
|
|
231
|
+
return b.s(e2.$s, 2, "0");
|
|
232
|
+
case "SSS":
|
|
233
|
+
return b.s(e2.$ms, 3, "0");
|
|
234
|
+
case "Z":
|
|
235
|
+
return i2;
|
|
236
|
+
}
|
|
237
|
+
return null;
|
|
238
|
+
})(t3) || i2.replace(":", "");
|
|
239
|
+
}));
|
|
240
|
+
}, m2.utcOffset = function() {
|
|
241
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
242
|
+
}, m2.diff = function(r2, d2, l2) {
|
|
243
|
+
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
244
|
+
return b.m(y2, m3);
|
|
245
|
+
};
|
|
246
|
+
switch (M3) {
|
|
247
|
+
case h:
|
|
248
|
+
$2 = D2() / 12;
|
|
249
|
+
break;
|
|
250
|
+
case c:
|
|
251
|
+
$2 = D2();
|
|
252
|
+
break;
|
|
253
|
+
case f:
|
|
254
|
+
$2 = D2() / 3;
|
|
255
|
+
break;
|
|
256
|
+
case o:
|
|
257
|
+
$2 = (g2 - v2) / 6048e5;
|
|
258
|
+
break;
|
|
259
|
+
case a:
|
|
260
|
+
$2 = (g2 - v2) / 864e5;
|
|
261
|
+
break;
|
|
262
|
+
case u:
|
|
263
|
+
$2 = g2 / n;
|
|
264
|
+
break;
|
|
265
|
+
case s:
|
|
266
|
+
$2 = g2 / e;
|
|
267
|
+
break;
|
|
268
|
+
case i:
|
|
269
|
+
$2 = g2 / t;
|
|
270
|
+
break;
|
|
271
|
+
default:
|
|
272
|
+
$2 = g2;
|
|
273
|
+
}
|
|
274
|
+
return l2 ? $2 : b.a($2);
|
|
275
|
+
}, m2.daysInMonth = function() {
|
|
276
|
+
return this.endOf(c).$D;
|
|
277
|
+
}, m2.$locale = function() {
|
|
278
|
+
return D[this.$L];
|
|
279
|
+
}, m2.locale = function(t2, e2) {
|
|
280
|
+
if (!t2) return this.$L;
|
|
281
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
282
|
+
return r2 && (n2.$L = r2), n2;
|
|
283
|
+
}, m2.clone = function() {
|
|
284
|
+
return b.w(this.$d, this);
|
|
285
|
+
}, m2.toDate = function() {
|
|
286
|
+
return new Date(this.valueOf());
|
|
287
|
+
}, m2.toJSON = function() {
|
|
288
|
+
return this.isValid() ? this.toISOString() : null;
|
|
289
|
+
}, m2.toISOString = function() {
|
|
290
|
+
return this.$d.toISOString();
|
|
291
|
+
}, m2.toString = function() {
|
|
292
|
+
return this.$d.toUTCString();
|
|
293
|
+
}, M2;
|
|
294
|
+
})(), k = _.prototype;
|
|
295
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach((function(t2) {
|
|
296
|
+
k[t2[1]] = function(e2) {
|
|
297
|
+
return this.$g(e2, t2[0], t2[1]);
|
|
298
|
+
};
|
|
299
|
+
})), O.extend = function(t2, e2) {
|
|
300
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
301
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
302
|
+
return O(1e3 * t2);
|
|
303
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
304
|
+
}));
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
// node_modules/dayjs/locale/th.js
|
|
309
|
+
var require_th = __commonJS({
|
|
310
|
+
"node_modules/dayjs/locale/th.js"(exports, module) {
|
|
311
|
+
"use strict";
|
|
312
|
+
!(function(_, e) {
|
|
313
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = e(require_dayjs_min()) : "function" == typeof define && define.amd ? define(["dayjs"], e) : (_ = "undefined" != typeof globalThis ? globalThis : _ || self).dayjs_locale_th = e(_.dayjs);
|
|
314
|
+
})(exports, (function(_) {
|
|
315
|
+
"use strict";
|
|
316
|
+
function e(_2) {
|
|
317
|
+
return _2 && "object" == typeof _2 && "default" in _2 ? _2 : { default: _2 };
|
|
318
|
+
}
|
|
319
|
+
var t = e(_), d = { name: "th", weekdays: "\u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C_\u0E08\u0E31\u0E19\u0E17\u0E23\u0E4C_\u0E2D\u0E31\u0E07\u0E04\u0E32\u0E23_\u0E1E\u0E38\u0E18_\u0E1E\u0E24\u0E2B\u0E31\u0E2A\u0E1A\u0E14\u0E35_\u0E28\u0E38\u0E01\u0E23\u0E4C_\u0E40\u0E2A\u0E32\u0E23\u0E4C".split("_"), weekdaysShort: "\u0E2D\u0E32\u0E17\u0E34\u0E15\u0E22\u0E4C_\u0E08\u0E31\u0E19\u0E17\u0E23\u0E4C_\u0E2D\u0E31\u0E07\u0E04\u0E32\u0E23_\u0E1E\u0E38\u0E18_\u0E1E\u0E24\u0E2B\u0E31\u0E2A_\u0E28\u0E38\u0E01\u0E23\u0E4C_\u0E40\u0E2A\u0E32\u0E23\u0E4C".split("_"), weekdaysMin: "\u0E2D\u0E32._\u0E08._\u0E2D._\u0E1E._\u0E1E\u0E24._\u0E28._\u0E2A.".split("_"), months: "\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21_\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C_\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21_\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19_\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21_\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19_\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21_\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21_\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19_\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21_\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19_\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21".split("_"), monthsShort: "\u0E21.\u0E04._\u0E01.\u0E1E._\u0E21\u0E35.\u0E04._\u0E40\u0E21.\u0E22._\u0E1E.\u0E04._\u0E21\u0E34.\u0E22._\u0E01.\u0E04._\u0E2A.\u0E04._\u0E01.\u0E22._\u0E15.\u0E04._\u0E1E.\u0E22._\u0E18.\u0E04.".split("_"), formats: { LT: "H:mm", LTS: "H:mm:ss", L: "DD/MM/YYYY", LL: "D MMMM YYYY", LLL: "D MMMM YYYY \u0E40\u0E27\u0E25\u0E32 H:mm", LLLL: "\u0E27\u0E31\u0E19dddd\u0E17\u0E35\u0E48 D MMMM YYYY \u0E40\u0E27\u0E25\u0E32 H:mm" }, relativeTime: { future: "\u0E2D\u0E35\u0E01 %s", past: "%s\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27", s: "\u0E44\u0E21\u0E48\u0E01\u0E35\u0E48\u0E27\u0E34\u0E19\u0E32\u0E17\u0E35", m: "1 \u0E19\u0E32\u0E17\u0E35", mm: "%d \u0E19\u0E32\u0E17\u0E35", h: "1 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07", hh: "%d \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07", d: "1 \u0E27\u0E31\u0E19", dd: "%d \u0E27\u0E31\u0E19", M: "1 \u0E40\u0E14\u0E37\u0E2D\u0E19", MM: "%d \u0E40\u0E14\u0E37\u0E2D\u0E19", y: "1 \u0E1B\u0E35", yy: "%d \u0E1B\u0E35" }, ordinal: function(_2) {
|
|
320
|
+
return _2 + ".";
|
|
321
|
+
} };
|
|
322
|
+
return t.default.locale(d, null, true), d;
|
|
323
|
+
}));
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
|
|
327
|
+
// node_modules/dayjs/plugin/customParseFormat.js
|
|
328
|
+
var require_customParseFormat = __commonJS({
|
|
329
|
+
"node_modules/dayjs/plugin/customParseFormat.js"(exports, module) {
|
|
330
|
+
"use strict";
|
|
331
|
+
!(function(e, t) {
|
|
332
|
+
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
|
|
333
|
+
})(exports, (function() {
|
|
334
|
+
"use strict";
|
|
335
|
+
var e = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" }, t = /(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g, n = /\d/, r = /\d\d/, i = /\d\d?/, o = /\d*[^-_:/,()\s\d]+/, s = {}, a = function(e2) {
|
|
336
|
+
return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
|
|
337
|
+
};
|
|
338
|
+
var f = function(e2) {
|
|
339
|
+
return function(t2) {
|
|
340
|
+
this[e2] = +t2;
|
|
341
|
+
};
|
|
342
|
+
}, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
|
|
343
|
+
(this.zone || (this.zone = {})).offset = (function(e3) {
|
|
344
|
+
if (!e3) return 0;
|
|
345
|
+
if ("Z" === e3) return 0;
|
|
346
|
+
var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
|
|
347
|
+
return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
|
|
348
|
+
})(e2);
|
|
349
|
+
}], u = function(e2) {
|
|
350
|
+
var t2 = s[e2];
|
|
351
|
+
return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
|
|
352
|
+
}, d = function(e2, t2) {
|
|
353
|
+
var n2, r2 = s.meridiem;
|
|
354
|
+
if (r2) {
|
|
355
|
+
for (var i2 = 1; i2 <= 24; i2 += 1) if (e2.indexOf(r2(i2, 0, t2)) > -1) {
|
|
356
|
+
n2 = i2 > 12;
|
|
357
|
+
break;
|
|
358
|
+
}
|
|
359
|
+
} else n2 = e2 === (t2 ? "pm" : "PM");
|
|
360
|
+
return n2;
|
|
361
|
+
}, c = { A: [o, function(e2) {
|
|
362
|
+
this.afternoon = d(e2, false);
|
|
363
|
+
}], a: [o, function(e2) {
|
|
364
|
+
this.afternoon = d(e2, true);
|
|
365
|
+
}], Q: [n, function(e2) {
|
|
366
|
+
this.month = 3 * (e2 - 1) + 1;
|
|
367
|
+
}], S: [n, function(e2) {
|
|
368
|
+
this.milliseconds = 100 * +e2;
|
|
369
|
+
}], SS: [r, function(e2) {
|
|
370
|
+
this.milliseconds = 10 * +e2;
|
|
371
|
+
}], SSS: [/\d{3}/, function(e2) {
|
|
372
|
+
this.milliseconds = +e2;
|
|
373
|
+
}], s: [i, f("seconds")], ss: [i, f("seconds")], m: [i, f("minutes")], mm: [i, f("minutes")], H: [i, f("hours")], h: [i, f("hours")], HH: [i, f("hours")], hh: [i, f("hours")], D: [i, f("day")], DD: [r, f("day")], Do: [o, function(e2) {
|
|
374
|
+
var t2 = s.ordinal, n2 = e2.match(/\d+/);
|
|
375
|
+
if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
|
|
376
|
+
}], w: [i, f("week")], ww: [r, f("week")], M: [i, f("month")], MM: [r, f("month")], MMM: [o, function(e2) {
|
|
377
|
+
var t2 = u("months"), n2 = (u("monthsShort") || t2.map((function(e3) {
|
|
378
|
+
return e3.slice(0, 3);
|
|
379
|
+
}))).indexOf(e2) + 1;
|
|
380
|
+
if (n2 < 1) throw new Error();
|
|
381
|
+
this.month = n2 % 12 || n2;
|
|
382
|
+
}], MMMM: [o, function(e2) {
|
|
383
|
+
var t2 = u("months").indexOf(e2) + 1;
|
|
384
|
+
if (t2 < 1) throw new Error();
|
|
385
|
+
this.month = t2 % 12 || t2;
|
|
386
|
+
}], Y: [/[+-]?\d+/, f("year")], YY: [r, function(e2) {
|
|
387
|
+
this.year = a(e2);
|
|
388
|
+
}], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
|
|
389
|
+
function l(n2) {
|
|
390
|
+
var r2, i2;
|
|
391
|
+
r2 = n2, i2 = s && s.formats;
|
|
392
|
+
for (var o2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t2, n3, r3) {
|
|
393
|
+
var o3 = r3 && r3.toUpperCase();
|
|
394
|
+
return n3 || i2[r3] || e[r3] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e2, t3, n4) {
|
|
395
|
+
return t3 || n4.slice(1);
|
|
396
|
+
}));
|
|
397
|
+
}))).match(t), a2 = o2.length, f2 = 0; f2 < a2; f2 += 1) {
|
|
398
|
+
var h2 = o2[f2], u2 = c[h2], d2 = u2 && u2[0], l2 = u2 && u2[1];
|
|
399
|
+
o2[f2] = l2 ? { regex: d2, parser: l2 } : h2.replace(/^\[|\]$/g, "");
|
|
400
|
+
}
|
|
401
|
+
return function(e2) {
|
|
402
|
+
for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
|
|
403
|
+
var i3 = o2[n3];
|
|
404
|
+
if ("string" == typeof i3) r3 += i3.length;
|
|
405
|
+
else {
|
|
406
|
+
var s2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = s2.exec(h3)[0];
|
|
407
|
+
f3.call(t2, u3), e2 = e2.replace(u3, "");
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return (function(e3) {
|
|
411
|
+
var t3 = e3.afternoon;
|
|
412
|
+
if (void 0 !== t3) {
|
|
413
|
+
var n4 = e3.hours;
|
|
414
|
+
t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
|
|
415
|
+
}
|
|
416
|
+
})(t2), t2;
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
return function(e2, t2, n2) {
|
|
420
|
+
n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (a = e2.parseTwoDigitYear);
|
|
421
|
+
var r2 = t2.prototype, i2 = r2.parse;
|
|
422
|
+
r2.parse = function(e3) {
|
|
423
|
+
var t3 = e3.date, r3 = e3.utc, o2 = e3.args;
|
|
424
|
+
this.$u = r3;
|
|
425
|
+
var a2 = o2[1];
|
|
426
|
+
if ("string" == typeof a2) {
|
|
427
|
+
var f2 = true === o2[2], h2 = true === o2[3], u2 = f2 || h2, d2 = o2[2];
|
|
428
|
+
h2 && (d2 = o2[2]), s = this.$locale(), !f2 && d2 && (s = n2.Ls[d2]), this.$d = (function(e4, t4, n3, r4) {
|
|
429
|
+
try {
|
|
430
|
+
if (["x", "X"].indexOf(t4) > -1) return new Date(("X" === t4 ? 1e3 : 1) * e4);
|
|
431
|
+
var i3 = l(t4)(e4), o3 = i3.year, s2 = i3.month, a3 = i3.day, f3 = i3.hours, h3 = i3.minutes, u3 = i3.seconds, d3 = i3.milliseconds, c3 = i3.zone, m2 = i3.week, M2 = /* @__PURE__ */ new Date(), Y = a3 || (o3 || s2 ? 1 : M2.getDate()), p = o3 || M2.getFullYear(), v = 0;
|
|
432
|
+
o3 && !s2 || (v = s2 > 0 ? s2 - 1 : M2.getMonth());
|
|
433
|
+
var D, w = f3 || 0, g = h3 || 0, y = u3 || 0, L = d3 || 0;
|
|
434
|
+
return c3 ? new Date(Date.UTC(p, v, Y, w, g, y, L + 60 * c3.offset * 1e3)) : n3 ? new Date(Date.UTC(p, v, Y, w, g, y, L)) : (D = new Date(p, v, Y, w, g, y, L), m2 && (D = r4(D).week(m2).toDate()), D);
|
|
435
|
+
} catch (e5) {
|
|
436
|
+
return /* @__PURE__ */ new Date("");
|
|
437
|
+
}
|
|
438
|
+
})(t3, a2, r3, n2), this.init(), d2 && true !== d2 && (this.$L = this.locale(d2).$L), u2 && t3 != this.format(a2) && (this.$d = /* @__PURE__ */ new Date("")), s = {};
|
|
439
|
+
} else if (a2 instanceof Array) for (var c2 = a2.length, m = 1; m <= c2; m += 1) {
|
|
440
|
+
o2[1] = a2[m - 1];
|
|
441
|
+
var M = n2.apply(this, o2);
|
|
442
|
+
if (M.isValid()) {
|
|
443
|
+
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
444
|
+
break;
|
|
445
|
+
}
|
|
446
|
+
m === c2 && (this.$d = /* @__PURE__ */ new Date(""));
|
|
447
|
+
}
|
|
448
|
+
else i2.call(this, e3);
|
|
449
|
+
};
|
|
450
|
+
};
|
|
451
|
+
}));
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
|
|
1
455
|
// src/Button/PrimaryButton/PrimaryButton.tsx
|
|
2
456
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
457
|
function PrimaryButton({
|
|
@@ -6,13 +460,17 @@ function PrimaryButton({
|
|
|
6
460
|
iconLeft,
|
|
7
461
|
iconRight,
|
|
8
462
|
bgColor = "bg-primary-500",
|
|
9
|
-
textColor = "black"
|
|
463
|
+
textColor = "black",
|
|
464
|
+
disabled
|
|
10
465
|
}) {
|
|
11
466
|
return /* @__PURE__ */ jsx(
|
|
12
467
|
"button",
|
|
13
468
|
{
|
|
14
|
-
className: `flex justify-center w-full h-[42px] rounded-[6px] p-[10px] cursor-pointer ${bgColor} text-${textColor} body-1`,
|
|
15
469
|
onClick,
|
|
470
|
+
disabled,
|
|
471
|
+
className: `flex justify-center w-full h-[42px] rounded-[6px] p-[10px] body-1 transition
|
|
472
|
+
${disabled ? "text-gray-400 bg-gray-100 cursor-not-allowed" : `${bgColor} text-${textColor} cursor-pointer
|
|
473
|
+
hover:brightness-95 active:brightness-90`}`,
|
|
16
474
|
children: /* @__PURE__ */ jsxs("div", { className: "flex justify-center items-center gap-[10px]", children: [
|
|
17
475
|
iconLeft && /* @__PURE__ */ jsx("div", { children: iconLeft }),
|
|
18
476
|
title,
|
|
@@ -24,12 +482,13 @@ function PrimaryButton({
|
|
|
24
482
|
|
|
25
483
|
// src/Button/SecondaryButton/SecondaryButton.tsx
|
|
26
484
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
27
|
-
function SecondaryButton({ title, onClick, iconLeft, iconRight }) {
|
|
485
|
+
function SecondaryButton({ title, onClick, iconLeft, iconRight, disabled }) {
|
|
28
486
|
return /* @__PURE__ */ jsx2(
|
|
29
487
|
"button",
|
|
30
488
|
{
|
|
31
|
-
className: `flex justify-center w-full h-[42px] rounded-[6px] p-[10px] border-[1px] border-black cursor-pointer bg-white text-black body-1`,
|
|
32
489
|
onClick,
|
|
490
|
+
disabled,
|
|
491
|
+
className: `flex justify-center w-full h-[42px] rounded-[6px] p-[10px] border-[1px] body-1 transition ${disabled ? "text-gray-400 border-gray-400 bg-gray-100 cursor-not-allowed" : "cursor-pointer bg-white border-black text-black hover:bg-gray-100 active:bg-gray-200"}`,
|
|
33
492
|
children: /* @__PURE__ */ jsxs2("div", { className: "flex justify-center items-center gap-[10px]", children: [
|
|
34
493
|
iconLeft && /* @__PURE__ */ jsx2("div", { children: iconLeft }),
|
|
35
494
|
title,
|
|
@@ -41,12 +500,14 @@ function SecondaryButton({ title, onClick, iconLeft, iconRight }) {
|
|
|
41
500
|
|
|
42
501
|
// src/Button/GhostButton/GhostButton.tsx
|
|
43
502
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
44
|
-
function GhostButton({ title, onClick, iconLeft, iconRight }) {
|
|
503
|
+
function GhostButton({ title, onClick, iconLeft, iconRight, disabled }) {
|
|
45
504
|
return /* @__PURE__ */ jsx3(
|
|
46
505
|
"button",
|
|
47
506
|
{
|
|
48
|
-
className: `flex justify-center w-full h-[42px] rounded-[6px] p-[10px] cursor-pointer bg-[#E9E9E9] body-1`,
|
|
49
507
|
onClick,
|
|
508
|
+
disabled,
|
|
509
|
+
className: `flex justify-center w-full h-[42px] rounded-[6px] p-[10px] body-1 transition
|
|
510
|
+
${disabled ? "text-gray-400 bg-gray-100 cursor-not-allowed" : "bg-[#E9E9E9] cursor-pointer hover:bg-[#d6d6d6] active:bg-[#c4c4c4]"}`,
|
|
50
511
|
children: /* @__PURE__ */ jsxs3("div", { className: "flex justify-center items-center gap-[10px]", children: [
|
|
51
512
|
iconLeft && /* @__PURE__ */ jsx3("div", { children: iconLeft }),
|
|
52
513
|
title,
|
|
@@ -58,12 +519,19 @@ function GhostButton({ title, onClick, iconLeft, iconRight }) {
|
|
|
58
519
|
|
|
59
520
|
// src/Loader/Loader/Loader.tsx
|
|
60
521
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
61
|
-
function Loader({ size = 25 }) {
|
|
522
|
+
function Loader({ size = 25, color = "#000000" }) {
|
|
62
523
|
return /* @__PURE__ */ jsx4(
|
|
63
524
|
"div",
|
|
64
525
|
{
|
|
65
|
-
style: {
|
|
66
|
-
|
|
526
|
+
style: {
|
|
527
|
+
width: size,
|
|
528
|
+
height: size,
|
|
529
|
+
borderWidth: 4,
|
|
530
|
+
borderStyle: "solid",
|
|
531
|
+
borderColor: color,
|
|
532
|
+
borderTopColor: "transparent"
|
|
533
|
+
},
|
|
534
|
+
className: "rounded-full animate-spin"
|
|
67
535
|
}
|
|
68
536
|
);
|
|
69
537
|
}
|
|
@@ -71,42 +539,74 @@ function Loader({ size = 25 }) {
|
|
|
71
539
|
// src/Checkbox/Checkbox/Checkbox.tsx
|
|
72
540
|
import { IconCheck } from "@tabler/icons-react";
|
|
73
541
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
74
|
-
function Checkbox({ label, checked, onChange }) {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
542
|
+
function Checkbox({ label, checked, onChange, disabled }) {
|
|
543
|
+
const handleClick = () => {
|
|
544
|
+
if (!disabled) {
|
|
545
|
+
onChange(!checked);
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
return /* @__PURE__ */ jsxs4(
|
|
549
|
+
"div",
|
|
550
|
+
{
|
|
551
|
+
className: `flex gap-[10px] items-center
|
|
552
|
+
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}`,
|
|
553
|
+
"aria-disabled": disabled,
|
|
554
|
+
onClick: handleClick,
|
|
555
|
+
children: [
|
|
556
|
+
/* @__PURE__ */ jsx5(
|
|
557
|
+
"div",
|
|
84
558
|
{
|
|
85
|
-
className: `flex justify-center items-center transition-
|
|
559
|
+
className: `flex justify-center items-center border-[1px] border-black w-[24px] h-[24px] rounded-[8px] transition-colors duration-100
|
|
560
|
+
${checked ? "bg-black text-white" : "bg-white text-black"}
|
|
561
|
+
${disabled ? "pointer-events-none" : ""}`,
|
|
562
|
+
children: /* @__PURE__ */ jsx5(
|
|
563
|
+
"span",
|
|
564
|
+
{
|
|
565
|
+
className: `flex justify-center items-center transition-transform duration-150
|
|
86
566
|
${checked ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
87
|
-
|
|
567
|
+
children: /* @__PURE__ */ jsx5(IconCheck, { size: 20 })
|
|
568
|
+
}
|
|
569
|
+
)
|
|
88
570
|
}
|
|
89
|
-
)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
571
|
+
),
|
|
572
|
+
label && /* @__PURE__ */ jsx5("p", { className: "body-1 select-none", children: label })
|
|
573
|
+
]
|
|
574
|
+
}
|
|
575
|
+
);
|
|
94
576
|
}
|
|
95
577
|
|
|
96
578
|
// src/Checkbox/CheckboxGroup/CheckboxGroup.tsx
|
|
97
579
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
98
580
|
function CheckboxGroup({ options, onChange, alignment = "vertical" }) {
|
|
99
|
-
return /* @__PURE__ */ jsx6("div", { className: `flex gap-4 ${alignment === "vertical" ? "flex-col" : ""}`, children: options.map((opt) => /* @__PURE__ */ jsx6(
|
|
581
|
+
return /* @__PURE__ */ jsx6("div", { className: `flex gap-4 ${alignment === "vertical" ? "flex-col" : ""}`, children: options.map((opt) => /* @__PURE__ */ jsx6(
|
|
582
|
+
Checkbox,
|
|
583
|
+
{
|
|
584
|
+
checked: opt.checked,
|
|
585
|
+
label: opt.label,
|
|
586
|
+
onChange: () => onChange(opt.label),
|
|
587
|
+
disabled: opt.disabled
|
|
588
|
+
},
|
|
589
|
+
opt.label
|
|
590
|
+
)) });
|
|
100
591
|
}
|
|
101
592
|
|
|
102
593
|
// src/Radio/Radio/Radio.tsx
|
|
103
594
|
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
104
|
-
function Radio({ selected, onChange }) {
|
|
595
|
+
function Radio({ selected, onChange, disabled }) {
|
|
596
|
+
const handleClick = () => {
|
|
597
|
+
if (!disabled) {
|
|
598
|
+
onChange(!selected);
|
|
599
|
+
}
|
|
600
|
+
};
|
|
105
601
|
return /* @__PURE__ */ jsx7(
|
|
106
602
|
"div",
|
|
107
603
|
{
|
|
108
|
-
className:
|
|
109
|
-
|
|
604
|
+
className: `
|
|
605
|
+
flex justify-center items-center w-[16px] h-[16px] border-[1px] border-black rounded-full
|
|
606
|
+
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}
|
|
607
|
+
`,
|
|
608
|
+
onClick: handleClick,
|
|
609
|
+
"aria-disabled": disabled,
|
|
110
610
|
children: selected && /* @__PURE__ */ jsx7("div", { className: `bg-black w-[10px] h-[10px] rounded-full transition-all duration-300` })
|
|
111
611
|
}
|
|
112
612
|
);
|
|
@@ -116,28 +616,38 @@ function Radio({ selected, onChange }) {
|
|
|
116
616
|
import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
117
617
|
function RadioGroup({ options, value, onChange, alignment = "horizontal" }) {
|
|
118
618
|
return /* @__PURE__ */ jsx8("div", { className: `flex gap-2 ${alignment === "vertical" ? "flex-col" : ""}`, children: options.map((opt) => /* @__PURE__ */ jsxs5("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
119
|
-
/* @__PURE__ */ jsx8(Radio, { selected: value === opt.value, onChange: () => onChange(opt.value) }),
|
|
120
|
-
/* @__PURE__ */ jsx8("span", { className:
|
|
619
|
+
/* @__PURE__ */ jsx8(Radio, { selected: value === opt.value, onChange: () => onChange(opt.value), disabled: opt.disabled }),
|
|
620
|
+
/* @__PURE__ */ jsx8("span", { className: `body-1 ${opt.disabled ? "text-gray-400 cursor-not-allowed" : ""}`, children: opt.label })
|
|
121
621
|
] }, opt.value)) });
|
|
122
622
|
}
|
|
123
623
|
|
|
124
624
|
// src/Switch/Switch/Switch.tsx
|
|
125
625
|
import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
126
|
-
function Switch({ label, checked, onChange }) {
|
|
626
|
+
function Switch({ label, checked, onChange, disabled }) {
|
|
627
|
+
const handleClick = () => {
|
|
628
|
+
if (!disabled) {
|
|
629
|
+
onChange(!checked);
|
|
630
|
+
}
|
|
631
|
+
};
|
|
127
632
|
return /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-[10px]", children: [
|
|
128
|
-
label && /* @__PURE__ */ jsx9("p", { children: label }),
|
|
633
|
+
label && /* @__PURE__ */ jsx9("p", { className: `body-1 ${disabled ? "opacity-50 select-none" : ""}`, children: label }),
|
|
129
634
|
/* @__PURE__ */ jsx9(
|
|
130
635
|
"button",
|
|
131
636
|
{
|
|
132
637
|
type: "button",
|
|
133
|
-
onClick:
|
|
134
|
-
|
|
135
|
-
|
|
638
|
+
onClick: handleClick,
|
|
639
|
+
disabled,
|
|
640
|
+
"aria-disabled": disabled,
|
|
641
|
+
className: `
|
|
642
|
+
w-13 h-7 flex items-center rounded-full p-1 transition-colors duration-300
|
|
643
|
+
${checked ? "bg-blue-500" : "bg-gray-300"}
|
|
644
|
+
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}
|
|
645
|
+
`,
|
|
136
646
|
children: /* @__PURE__ */ jsx9(
|
|
137
647
|
"div",
|
|
138
648
|
{
|
|
139
649
|
className: `bg-white w-5 h-5 rounded-full shadow-md transform transition-transform duration-300
|
|
140
|
-
|
|
650
|
+
${checked ? "translate-x-6" : "translate-x-0"}`
|
|
141
651
|
}
|
|
142
652
|
)
|
|
143
653
|
}
|
|
@@ -169,54 +679,225 @@ function MenuNavBar({ menus, onClick }) {
|
|
|
169
679
|
] }, `menu_${menu.title}`)) });
|
|
170
680
|
}
|
|
171
681
|
|
|
682
|
+
// src/NavBar/MenuNavBar/Sidebar.tsx
|
|
683
|
+
import { IconChevronLeftPipe, IconChevronRightPipe } from "@tabler/icons-react";
|
|
684
|
+
import { createContext, useContext, useState } from "react";
|
|
685
|
+
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
686
|
+
var SidebarContext = createContext({ expanded: false });
|
|
687
|
+
function Sidebar({ children, logo }) {
|
|
688
|
+
const [expanded, setExpanded] = useState(true);
|
|
689
|
+
return /* @__PURE__ */ jsx11("aside", { className: "h-screen", children: /* @__PURE__ */ jsxs8("nav", { className: `h-full flex flex-col bg-white border-r shadow-sm duration-150 ${expanded ? "w-64" : "w-16"}`, children: [
|
|
690
|
+
/* @__PURE__ */ jsxs8("div", { className: "p-4 pb-2 flex justify-center items-center", children: [
|
|
691
|
+
expanded && logo && /* @__PURE__ */ jsx11("img", { src: logo, width: 120, className: "ml-auto" }),
|
|
692
|
+
/* @__PURE__ */ jsx11(
|
|
693
|
+
"button",
|
|
694
|
+
{
|
|
695
|
+
className: "p-1.5 rounded-lg bg-gray-50 hover:bg-gray-100 cursor-pointer ml-auto",
|
|
696
|
+
onClick: () => setExpanded((curr) => !curr),
|
|
697
|
+
children: expanded ? /* @__PURE__ */ jsx11(IconChevronLeftPipe, {}) : /* @__PURE__ */ jsx11(IconChevronRightPipe, {})
|
|
698
|
+
}
|
|
699
|
+
)
|
|
700
|
+
] }),
|
|
701
|
+
/* @__PURE__ */ jsx11(SidebarContext.Provider, { value: { expanded }, children: /* @__PURE__ */ jsx11("ul", { className: "flex-1 px-3", children }) })
|
|
702
|
+
] }) });
|
|
703
|
+
}
|
|
704
|
+
|
|
172
705
|
// src/NavBar/TopNavBar/TopNavBar.tsx
|
|
173
706
|
import { IconBellRinging } from "@tabler/icons-react";
|
|
174
|
-
import { jsx as
|
|
707
|
+
import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
175
708
|
function TopNavBar({ onClickNoti, logo }) {
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ jsxs9("div", { className: "w-full h-full flex", children: [
|
|
710
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-[20px] p-[10px]", children: [
|
|
178
711
|
logo,
|
|
179
|
-
/* @__PURE__ */
|
|
712
|
+
/* @__PURE__ */ jsx12("p", { className: "subtitle-1", children: "Project Management" })
|
|
180
713
|
] }),
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center ml-auto gap-[20px] p-[10px]", children: [
|
|
715
|
+
/* @__PURE__ */ jsx12("div", { children: "Search" }),
|
|
716
|
+
/* @__PURE__ */ jsx12("div", { children: /* @__PURE__ */ jsx12(IconBellRinging, { onClick: onClickNoti, className: "cursor-pointer" }) }),
|
|
717
|
+
/* @__PURE__ */ jsx12("div", { className: "w-[40px] h-[40px] bg-gray-400 rounded-full cursor-pointer" })
|
|
185
718
|
] })
|
|
186
719
|
] });
|
|
187
720
|
}
|
|
188
721
|
|
|
189
722
|
// src/Table/DataTable/DataTable.tsx
|
|
190
|
-
import {
|
|
191
|
-
|
|
723
|
+
import { IconSelector, IconSortAscending, IconSortDescending } from "@tabler/icons-react";
|
|
724
|
+
import { useState as useState2 } from "react";
|
|
725
|
+
|
|
726
|
+
// src/Table/Pagination/Pagination.tsx
|
|
727
|
+
import { IconArrowLeft, IconArrowRight } from "@tabler/icons-react";
|
|
728
|
+
import { useMemo } from "react";
|
|
729
|
+
import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
730
|
+
function Pagination({ totalItems, itemsPerPage, currentPage, onPageChange }) {
|
|
731
|
+
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
|
732
|
+
const getPages = useMemo(() => {
|
|
733
|
+
if (totalPages <= 7) {
|
|
734
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
735
|
+
}
|
|
736
|
+
const pages = [];
|
|
737
|
+
pages.push(1);
|
|
738
|
+
if (currentPage > 3) {
|
|
739
|
+
pages.push("...");
|
|
740
|
+
}
|
|
741
|
+
const start = Math.max(2, currentPage - 1);
|
|
742
|
+
const end = Math.min(totalPages - 1, currentPage + 1);
|
|
743
|
+
for (let i = start; i <= end; i++) {
|
|
744
|
+
pages.push(i);
|
|
745
|
+
}
|
|
746
|
+
if (currentPage < totalPages - 2) {
|
|
747
|
+
pages.push("...");
|
|
748
|
+
}
|
|
749
|
+
pages.push(totalPages);
|
|
750
|
+
return pages;
|
|
751
|
+
}, [totalPages, currentPage]);
|
|
752
|
+
if (totalPages <= 1) return null;
|
|
753
|
+
return /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-center gap-2 mt-4 body-1", children: [
|
|
754
|
+
/* @__PURE__ */ jsxs10(
|
|
755
|
+
"button",
|
|
756
|
+
{
|
|
757
|
+
className: "px-3 py-1 disabled:opacity-50 flex gap-[8px] cursor-pointer",
|
|
758
|
+
disabled: currentPage === 1,
|
|
759
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
760
|
+
children: [
|
|
761
|
+
/* @__PURE__ */ jsx13(IconArrowLeft, {}),
|
|
762
|
+
"\u0E22\u0E49\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A"
|
|
763
|
+
]
|
|
764
|
+
}
|
|
765
|
+
),
|
|
766
|
+
getPages.map(
|
|
767
|
+
(page, i) => typeof page === "string" ? /* @__PURE__ */ jsx13("span", { className: "px-2", children: page }, i) : /* @__PURE__ */ jsx13(
|
|
768
|
+
"button",
|
|
769
|
+
{
|
|
770
|
+
className: `w-[32px] h-[32px] rounded-[8px] px-3 py-1 cursor-pointer
|
|
771
|
+
${currentPage === page ? "bg-black text-white" : "hover:bg-gray-100"}`,
|
|
772
|
+
onClick: () => onPageChange(page),
|
|
773
|
+
children: page
|
|
774
|
+
},
|
|
775
|
+
i
|
|
776
|
+
)
|
|
777
|
+
),
|
|
778
|
+
/* @__PURE__ */ jsxs10(
|
|
779
|
+
"button",
|
|
780
|
+
{
|
|
781
|
+
className: "px-3 py-1 disabled:opacity-50 flex gap-[8px] cursor-pointer",
|
|
782
|
+
disabled: currentPage === totalPages,
|
|
783
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
784
|
+
children: [
|
|
785
|
+
"\u0E16\u0E31\u0E14\u0E44\u0E1B",
|
|
786
|
+
/* @__PURE__ */ jsx13(IconArrowRight, {})
|
|
787
|
+
]
|
|
788
|
+
}
|
|
789
|
+
)
|
|
790
|
+
] });
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
// src/Table/DataTable/DataTable.tsx
|
|
794
|
+
import { Fragment, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
795
|
+
function DataTable({ columns, data, onSort, isLoading }) {
|
|
192
796
|
const cols = Math.max(1, columns.length);
|
|
193
797
|
const gridClass = "grid [grid-template-columns:repeat(var(--cols),minmax(0,1fr))]";
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
798
|
+
const [sortConfig, setSortConfig] = useState2(null);
|
|
799
|
+
const [page, setPage] = useState2(1);
|
|
800
|
+
const onSorting = (config) => {
|
|
801
|
+
if (config) {
|
|
802
|
+
setSortConfig({ key: config?.key, direction: config?.direction });
|
|
803
|
+
onSort();
|
|
804
|
+
}
|
|
805
|
+
};
|
|
806
|
+
return /* @__PURE__ */ jsxs11("div", { className: "border rounded-md w-full h-full", children: [
|
|
807
|
+
/* @__PURE__ */ jsx14("div", { className: `${gridClass} font-semibold border-b border-gray-200`, style: { ["--cols"]: cols }, children: columns.map((col, i) => {
|
|
808
|
+
const isActive = sortConfig?.key === col.accessor;
|
|
809
|
+
const direction = isActive ? sortConfig?.direction : null;
|
|
810
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-[8px] py-[8px] px-[16px] body-4 truncate", children: [
|
|
811
|
+
col.header,
|
|
812
|
+
col.sortable && /* @__PURE__ */ jsxs11(Fragment, { children: [
|
|
813
|
+
direction === null && /* @__PURE__ */ jsx14(
|
|
814
|
+
IconSelector,
|
|
815
|
+
{
|
|
816
|
+
size: 15,
|
|
817
|
+
className: "hover:text-red-400 cursor-pointer",
|
|
818
|
+
onClick: () => onSorting({ key: col.accessor, direction: "asc" })
|
|
819
|
+
}
|
|
820
|
+
),
|
|
821
|
+
direction === "asc" && /* @__PURE__ */ jsx14(
|
|
822
|
+
IconSortAscending,
|
|
823
|
+
{
|
|
824
|
+
size: 15,
|
|
825
|
+
className: "cursor-pointer text-red-500",
|
|
826
|
+
onClick: () => onSorting({ key: col.accessor, direction: "desc" })
|
|
827
|
+
}
|
|
828
|
+
),
|
|
829
|
+
direction === "desc" && /* @__PURE__ */ jsx14(
|
|
830
|
+
IconSortDescending,
|
|
831
|
+
{
|
|
832
|
+
size: 15,
|
|
833
|
+
className: "cursor-pointer text-red-500",
|
|
834
|
+
onClick: () => onSorting({ key: col.accessor, direction: null })
|
|
835
|
+
}
|
|
836
|
+
)
|
|
837
|
+
] })
|
|
838
|
+
] }, i);
|
|
839
|
+
}) }),
|
|
840
|
+
isLoading ? /* @__PURE__ */ jsx14("div", { className: "flex justify-center items-center w-full h-full", children: /* @__PURE__ */ jsx14(Loader, {}) }) : /* @__PURE__ */ jsx14(Fragment, { children: data.map((row, i) => /* @__PURE__ */ jsx14(
|
|
197
841
|
"div",
|
|
198
842
|
{
|
|
199
|
-
className: `${gridClass} border-b border-gray-200 items-center`,
|
|
843
|
+
className: `${gridClass} ${data.length - 1 !== i ? "border-b border-gray-200" : ""} items-center`,
|
|
200
844
|
style: { ["--cols"]: cols },
|
|
201
|
-
children: columns.map((col, c) => /* @__PURE__ */
|
|
845
|
+
children: columns.map((col, c) => /* @__PURE__ */ jsx14("div", { className: "py-[8px] px-[16px] body-3 truncate", children: typeof col.accessor === "function" ? col.accessor(row) : String(row[col.accessor]) }, c))
|
|
202
846
|
},
|
|
203
847
|
i
|
|
204
|
-
))
|
|
848
|
+
)) }),
|
|
849
|
+
/* @__PURE__ */ jsx14("div", { children: /* @__PURE__ */ jsx14(Pagination, { currentPage: page, itemsPerPage: 5, totalItems: 10, onPageChange: setPage }) })
|
|
205
850
|
] });
|
|
206
851
|
}
|
|
207
852
|
|
|
853
|
+
// src/Table/DataTable/AntDataTable.tsx
|
|
854
|
+
import { Table } from "antd";
|
|
855
|
+
import { useState as useState3 } from "react";
|
|
856
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
857
|
+
function AntDataTable({
|
|
858
|
+
dataSource,
|
|
859
|
+
columns,
|
|
860
|
+
pageSize = 10,
|
|
861
|
+
rowCheckbox,
|
|
862
|
+
onRowSelect,
|
|
863
|
+
width,
|
|
864
|
+
height
|
|
865
|
+
}) {
|
|
866
|
+
const [selectedRowKeys, setSelectedRowKeys] = useState3([]);
|
|
867
|
+
const rowSelection = {
|
|
868
|
+
selectedRowKeys,
|
|
869
|
+
onChange: (newSelectedRowKeys) => {
|
|
870
|
+
setSelectedRowKeys(newSelectedRowKeys);
|
|
871
|
+
onRowSelect && onRowSelect(newSelectedRowKeys);
|
|
872
|
+
}
|
|
873
|
+
};
|
|
874
|
+
return /* @__PURE__ */ jsx15(
|
|
875
|
+
Table,
|
|
876
|
+
{
|
|
877
|
+
dataSource,
|
|
878
|
+
columns,
|
|
879
|
+
rowSelection: rowCheckbox ? rowSelection : void 0,
|
|
880
|
+
pagination: { position: ["bottomCenter"], pageSize },
|
|
881
|
+
style: { width },
|
|
882
|
+
scroll: { y: height }
|
|
883
|
+
}
|
|
884
|
+
);
|
|
885
|
+
}
|
|
886
|
+
|
|
208
887
|
// src/Calendar/Calendar/Calendar.tsx
|
|
209
|
-
import { useEffect, useRef, useState } from "react";
|
|
888
|
+
import { useEffect, useRef, useState as useState4 } from "react";
|
|
210
889
|
import FullCalendar from "@fullcalendar/react";
|
|
211
890
|
import dayGridPlugin from "@fullcalendar/daygrid";
|
|
212
891
|
import timeGridPlugin from "@fullcalendar/timegrid";
|
|
213
892
|
import interactionPlugin from "@fullcalendar/interaction";
|
|
214
|
-
import
|
|
215
|
-
import { IconChevronLeft, IconChevronRight } from "@tabler/icons-react";
|
|
216
|
-
import { Fragment, jsx as
|
|
893
|
+
import thLocale from "@fullcalendar/core/locales/th";
|
|
894
|
+
import { IconChevronLeft, IconChevronRight, IconX } from "@tabler/icons-react";
|
|
895
|
+
import { Fragment as Fragment2, jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
217
896
|
function Calendar({ events }) {
|
|
218
897
|
const calendarRef = useRef(null);
|
|
219
|
-
const [monthTitle, setMonthTitle] =
|
|
898
|
+
const [monthTitle, setMonthTitle] = useState4("");
|
|
899
|
+
const [openPopup, setOpenPopup] = useState4(false);
|
|
900
|
+
const [selectedEvent, setSelectedEvent] = useState4(null);
|
|
220
901
|
const updateTitle = () => {
|
|
221
902
|
const calendarApi = calendarRef.current?.getApi();
|
|
222
903
|
if (calendarApi) {
|
|
@@ -230,11 +911,11 @@ function Calendar({ events }) {
|
|
|
230
911
|
useEffect(() => {
|
|
231
912
|
updateTitle();
|
|
232
913
|
}, []);
|
|
233
|
-
return /* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
-
/* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
/* @__PURE__ */
|
|
914
|
+
return /* @__PURE__ */ jsxs12("div", { className: "fc w-full h-full relative z-10", children: [
|
|
915
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex mb-[8px]", children: [
|
|
916
|
+
/* @__PURE__ */ jsx16("p", { className: "headline-5", children: monthTitle }),
|
|
917
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex gap-[10px] ml-auto", children: [
|
|
918
|
+
/* @__PURE__ */ jsx16(
|
|
238
919
|
"p",
|
|
239
920
|
{
|
|
240
921
|
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
@@ -245,7 +926,7 @@ function Calendar({ events }) {
|
|
|
245
926
|
children: "\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49"
|
|
246
927
|
}
|
|
247
928
|
),
|
|
248
|
-
/* @__PURE__ */
|
|
929
|
+
/* @__PURE__ */ jsx16(
|
|
249
930
|
"p",
|
|
250
931
|
{
|
|
251
932
|
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
@@ -256,18 +937,18 @@ function Calendar({ events }) {
|
|
|
256
937
|
children: "Month"
|
|
257
938
|
}
|
|
258
939
|
),
|
|
259
|
-
/* @__PURE__ */
|
|
940
|
+
/* @__PURE__ */ jsx16(
|
|
260
941
|
"p",
|
|
261
942
|
{
|
|
262
943
|
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
263
944
|
onClick: () => {
|
|
264
|
-
changeView("
|
|
945
|
+
changeView("timeGridWeek");
|
|
265
946
|
updateTitle();
|
|
266
947
|
},
|
|
267
948
|
children: "Week"
|
|
268
949
|
}
|
|
269
950
|
),
|
|
270
|
-
/* @__PURE__ */
|
|
951
|
+
/* @__PURE__ */ jsx16(
|
|
271
952
|
"p",
|
|
272
953
|
{
|
|
273
954
|
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
@@ -278,7 +959,7 @@ function Calendar({ events }) {
|
|
|
278
959
|
children: "Day"
|
|
279
960
|
}
|
|
280
961
|
),
|
|
281
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ jsx16(
|
|
282
963
|
"button",
|
|
283
964
|
{
|
|
284
965
|
className: "cursor-pointer",
|
|
@@ -286,10 +967,10 @@ function Calendar({ events }) {
|
|
|
286
967
|
calendarRef.current?.getApi().prev();
|
|
287
968
|
updateTitle();
|
|
288
969
|
},
|
|
289
|
-
children: /* @__PURE__ */
|
|
970
|
+
children: /* @__PURE__ */ jsx16(IconChevronLeft, {})
|
|
290
971
|
}
|
|
291
972
|
),
|
|
292
|
-
/* @__PURE__ */
|
|
973
|
+
/* @__PURE__ */ jsx16(
|
|
293
974
|
"button",
|
|
294
975
|
{
|
|
295
976
|
className: "cursor-pointer",
|
|
@@ -297,44 +978,70 @@ function Calendar({ events }) {
|
|
|
297
978
|
calendarRef.current?.getApi().next();
|
|
298
979
|
updateTitle();
|
|
299
980
|
},
|
|
300
|
-
children: /* @__PURE__ */
|
|
981
|
+
children: /* @__PURE__ */ jsx16(IconChevronRight, {})
|
|
301
982
|
}
|
|
302
983
|
)
|
|
303
984
|
] })
|
|
304
985
|
] }),
|
|
305
|
-
/* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ jsx16("div", { className: "relative z-10", children: /* @__PURE__ */ jsx16(
|
|
306
987
|
FullCalendar,
|
|
307
988
|
{
|
|
308
989
|
ref: calendarRef,
|
|
309
990
|
plugins: [dayGridPlugin, timeGridPlugin, interactionPlugin],
|
|
310
991
|
events,
|
|
311
|
-
locale:
|
|
992
|
+
locale: thLocale,
|
|
312
993
|
slotLabelFormat: {
|
|
313
994
|
hour: "numeric",
|
|
314
995
|
minute: "2-digit"
|
|
315
996
|
},
|
|
316
997
|
firstDay: 0,
|
|
317
998
|
fixedWeekCount: false,
|
|
318
|
-
initialView: "dayGridMonth",
|
|
319
999
|
headerToolbar: false,
|
|
1000
|
+
initialView: "dayGridMonth",
|
|
320
1001
|
dayMaxEventRows: 4,
|
|
321
|
-
moreLinkText: "\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",
|
|
322
1002
|
editable: true,
|
|
323
1003
|
eventDrop: (info) => {
|
|
324
1004
|
console.log("Event \u0E02\u0E2D\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48:", info.event.startStr);
|
|
325
1005
|
},
|
|
1006
|
+
eventClick: (info) => {
|
|
1007
|
+
setOpenPopup(true);
|
|
1008
|
+
setSelectedEvent({
|
|
1009
|
+
title: info.event.title,
|
|
1010
|
+
start: info.event._instance?.range.start.toISOString(),
|
|
1011
|
+
end: info.event._instance?.range.end.toISOString()
|
|
1012
|
+
});
|
|
1013
|
+
},
|
|
326
1014
|
eventContent: (arg) => {
|
|
327
|
-
return /* @__PURE__ */
|
|
328
|
-
}
|
|
1015
|
+
return /* @__PURE__ */ jsx16(Fragment2, { children: /* @__PURE__ */ jsx16("div", { className: "flex items-center h-[28px] p-[4px] border-green-500 border-l-[10px] bg-red-400 rounded text-left text-white caption-1", children: arg.event.title }) });
|
|
1016
|
+
},
|
|
1017
|
+
moreLinkContent: (arg) => `+${arg.num} \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23`
|
|
329
1018
|
}
|
|
330
|
-
)
|
|
1019
|
+
) }),
|
|
1020
|
+
openPopup && /* @__PURE__ */ jsx16("div", { className: "fixed inset-0 flex justify-center items-center bg-black/50 z-50", children: /* @__PURE__ */ jsx16(EventPopUp, { event: selectedEvent, onClose: () => setOpenPopup(false) }) })
|
|
1021
|
+
] });
|
|
1022
|
+
}
|
|
1023
|
+
function EventPopUp({ event, onClose }) {
|
|
1024
|
+
return /* @__PURE__ */ jsxs12("div", { className: "w-[500px] h-auto rounded-2xl bg-white relative z-50 shadow-2xl overflow-hidden", children: [
|
|
1025
|
+
/* @__PURE__ */ jsx16("button", { className: "absolute top-3 right-3 rounded-full p-1 hover:bg-gray-200 transition", onClick: onClose, children: /* @__PURE__ */ jsx16(IconX, { className: "w-6 h-6 text-gray-600" }) }),
|
|
1026
|
+
/* @__PURE__ */ jsx16("div", { className: "bg-red-400 text-left text-white px-6 py-4 headline-5", children: /* @__PURE__ */ jsx16("h2", { className: "text-lg font-semibold", children: event.title }) }),
|
|
1027
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex flex-col w-full p-6 gap-3 text-gray-700 body-3", children: [
|
|
1028
|
+
/* @__PURE__ */ jsxs12("p", { children: [
|
|
1029
|
+
/* @__PURE__ */ jsx16("span", { className: "font-medium", children: "\u0E40\u0E23\u0E34\u0E48\u0E21: " }),
|
|
1030
|
+
event?.start?.toLocaleString?.() || String(event?.start)
|
|
1031
|
+
] }),
|
|
1032
|
+
/* @__PURE__ */ jsxs12("p", { children: [
|
|
1033
|
+
/* @__PURE__ */ jsx16("span", { className: "font-medium", children: "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14: " }),
|
|
1034
|
+
event?.end?.toLocaleString?.() || String(event?.end)
|
|
1035
|
+
] }),
|
|
1036
|
+
/* @__PURE__ */ jsx16("h3", { className: "text-sm font-semibold text-gray-500 uppercase mb-2 hover:underline cursor-pointer", children: "\u0E23\u0E32\u0E22\u0E25\u0E30\u0E40\u0E2D\u0E35\u0E22\u0E14\u0E40\u0E1E\u0E34\u0E48\u0E21\u0E40\u0E15\u0E34\u0E21" })
|
|
1037
|
+
] })
|
|
331
1038
|
] });
|
|
332
1039
|
}
|
|
333
1040
|
|
|
334
1041
|
// src/Input/TextInput/TextInput.tsx
|
|
335
1042
|
import { IconEye, IconEyeOff } from "@tabler/icons-react";
|
|
336
|
-
import { useState as
|
|
337
|
-
import { jsx as
|
|
1043
|
+
import { useState as useState5 } from "react";
|
|
1044
|
+
import { jsx as jsx17, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
338
1045
|
function TextInput({
|
|
339
1046
|
label,
|
|
340
1047
|
placeholder,
|
|
@@ -343,55 +1050,1301 @@ function TextInput({
|
|
|
343
1050
|
required,
|
|
344
1051
|
error,
|
|
345
1052
|
value,
|
|
346
|
-
onChange
|
|
1053
|
+
onChange,
|
|
1054
|
+
disabled
|
|
347
1055
|
}) {
|
|
348
|
-
const [showPassword, setShowPassword] =
|
|
1056
|
+
const [showPassword, setShowPassword] = useState5(false);
|
|
349
1057
|
const onShowPassword = () => {
|
|
350
1058
|
setShowPassword(!showPassword);
|
|
351
1059
|
};
|
|
352
1060
|
const inputType = type === "password" ? showPassword ? "text" : "password" : "text";
|
|
353
|
-
return /* @__PURE__ */
|
|
354
|
-
/* @__PURE__ */
|
|
1061
|
+
return /* @__PURE__ */ jsxs13("div", { children: [
|
|
1062
|
+
label && /* @__PURE__ */ jsxs13("p", { className: "body-1 mb-[8px]", children: [
|
|
355
1063
|
label,
|
|
356
|
-
required && /* @__PURE__ */
|
|
1064
|
+
required && /* @__PURE__ */ jsx17("span", { className: "text-red-600", children: "\xA0*" })
|
|
357
1065
|
] }),
|
|
358
|
-
/* @__PURE__ */
|
|
1066
|
+
/* @__PURE__ */ jsxs13(
|
|
359
1067
|
"div",
|
|
360
1068
|
{
|
|
361
|
-
className: `border-[1px] rounded-[8px] w-full h-[40px] flex justify-center items-center
|
|
1069
|
+
className: `border-[1px] rounded-[8px] w-full h-[40px] flex justify-center items-center
|
|
1070
|
+
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-600" : ""}`,
|
|
362
1071
|
children: [
|
|
363
|
-
/* @__PURE__ */
|
|
1072
|
+
/* @__PURE__ */ jsx17(
|
|
364
1073
|
"input",
|
|
365
1074
|
{
|
|
366
|
-
className:
|
|
1075
|
+
className: `w-full h-full px-[16px] ${disabled ? "cursor-not-allowed" : ""}`,
|
|
367
1076
|
style: { outline: "none" },
|
|
368
1077
|
placeholder,
|
|
369
1078
|
type: inputType,
|
|
370
1079
|
maxLength,
|
|
371
1080
|
value,
|
|
372
|
-
onChange: (e) => onChange(e.target.value)
|
|
1081
|
+
onChange: (e) => onChange(e.target.value),
|
|
1082
|
+
disabled
|
|
373
1083
|
}
|
|
374
1084
|
),
|
|
375
|
-
type === "password" && (showPassword ? /* @__PURE__ */
|
|
1085
|
+
type === "password" && (showPassword ? /* @__PURE__ */ jsx17(IconEye, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }) : /* @__PURE__ */ jsx17(IconEyeOff, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }))
|
|
376
1086
|
]
|
|
377
1087
|
}
|
|
378
1088
|
),
|
|
379
|
-
error && /* @__PURE__ */
|
|
1089
|
+
error && /* @__PURE__ */ jsx17("p", { className: "text-red-600 body-1", children: error })
|
|
1090
|
+
] });
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
// src/InputField/InputField.tsx
|
|
1094
|
+
import { ConfigProvider, Input } from "antd";
|
|
1095
|
+
import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1096
|
+
function InputField({
|
|
1097
|
+
value,
|
|
1098
|
+
onChange,
|
|
1099
|
+
placeholder,
|
|
1100
|
+
title,
|
|
1101
|
+
require: require2,
|
|
1102
|
+
bottomText,
|
|
1103
|
+
disabled,
|
|
1104
|
+
showError,
|
|
1105
|
+
errorMessage,
|
|
1106
|
+
addonBefore,
|
|
1107
|
+
addonAfter,
|
|
1108
|
+
defaultValue
|
|
1109
|
+
}) {
|
|
1110
|
+
return /* @__PURE__ */ jsx18(
|
|
1111
|
+
ConfigProvider,
|
|
1112
|
+
{
|
|
1113
|
+
theme: {
|
|
1114
|
+
token: {
|
|
1115
|
+
fontFamily: "Kanit"
|
|
1116
|
+
}
|
|
1117
|
+
},
|
|
1118
|
+
children: /* @__PURE__ */ jsxs14("div", { children: [
|
|
1119
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
1120
|
+
/* @__PURE__ */ jsx18("span", { className: "body-3", children: title }),
|
|
1121
|
+
" ",
|
|
1122
|
+
require2 && /* @__PURE__ */ jsx18("span", { className: "text-red-500", children: "*" })
|
|
1123
|
+
] }),
|
|
1124
|
+
/* @__PURE__ */ jsx18(
|
|
1125
|
+
Input,
|
|
1126
|
+
{
|
|
1127
|
+
value,
|
|
1128
|
+
placeholder,
|
|
1129
|
+
disabled,
|
|
1130
|
+
onChange: (e) => onChange(e.target.value || void 0),
|
|
1131
|
+
allowClear: true,
|
|
1132
|
+
addonBefore,
|
|
1133
|
+
addonAfter,
|
|
1134
|
+
defaultValue
|
|
1135
|
+
}
|
|
1136
|
+
),
|
|
1137
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
1138
|
+
/* @__PURE__ */ jsx18("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1139
|
+
" ",
|
|
1140
|
+
showError && /* @__PURE__ */ jsx18("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1141
|
+
] })
|
|
1142
|
+
] })
|
|
1143
|
+
}
|
|
1144
|
+
);
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
// src/Input/TextArea/TextArea.tsx
|
|
1148
|
+
import { Input as Input2 } from "antd";
|
|
1149
|
+
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1150
|
+
var { TextArea } = Input2;
|
|
1151
|
+
function TextAreaInput({
|
|
1152
|
+
label,
|
|
1153
|
+
height = 4,
|
|
1154
|
+
placeholder,
|
|
1155
|
+
onChange,
|
|
1156
|
+
value,
|
|
1157
|
+
maxLength,
|
|
1158
|
+
resizable,
|
|
1159
|
+
showCount,
|
|
1160
|
+
required,
|
|
1161
|
+
error,
|
|
1162
|
+
disabled
|
|
1163
|
+
}) {
|
|
1164
|
+
return /* @__PURE__ */ jsxs15("div", { children: [
|
|
1165
|
+
label && /* @__PURE__ */ jsxs15("p", { className: "body-1 mb-[8px]", children: [
|
|
1166
|
+
label,
|
|
1167
|
+
" ",
|
|
1168
|
+
required && /* @__PURE__ */ jsx19("span", { className: "text-red-500", children: "\xA0*" })
|
|
1169
|
+
] }),
|
|
1170
|
+
/* @__PURE__ */ jsx19(
|
|
1171
|
+
TextArea,
|
|
1172
|
+
{
|
|
1173
|
+
value,
|
|
1174
|
+
rows: height,
|
|
1175
|
+
style: {
|
|
1176
|
+
...error && resizable ? { borderColor: "red" } : {},
|
|
1177
|
+
...disabled || !resizable ? { resize: "none" } : {}
|
|
1178
|
+
},
|
|
1179
|
+
placeholder,
|
|
1180
|
+
maxLength,
|
|
1181
|
+
showCount,
|
|
1182
|
+
onChange: (e) => onChange(e.target.value),
|
|
1183
|
+
disabled
|
|
1184
|
+
}
|
|
1185
|
+
),
|
|
1186
|
+
error && /* @__PURE__ */ jsx19("p", { className: "text-red-600 body-1", children: error })
|
|
1187
|
+
] });
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// src/ColorPicker/ColorPicker.tsx
|
|
1191
|
+
import { ConfigProvider as ConfigProvider2, ColorPicker } from "antd";
|
|
1192
|
+
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
1193
|
+
function ColorPickerBasic({
|
|
1194
|
+
value,
|
|
1195
|
+
onChange,
|
|
1196
|
+
require: require2,
|
|
1197
|
+
title,
|
|
1198
|
+
bottomText,
|
|
1199
|
+
showError,
|
|
1200
|
+
errorMessage,
|
|
1201
|
+
disabled,
|
|
1202
|
+
allowClear,
|
|
1203
|
+
defaultFormat,
|
|
1204
|
+
className,
|
|
1205
|
+
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
|
|
1206
|
+
}) {
|
|
1207
|
+
return /* @__PURE__ */ jsx20(
|
|
1208
|
+
ConfigProvider2,
|
|
1209
|
+
{
|
|
1210
|
+
theme: {
|
|
1211
|
+
token: {
|
|
1212
|
+
fontFamily: "Kanit"
|
|
1213
|
+
}
|
|
1214
|
+
},
|
|
1215
|
+
children: /* @__PURE__ */ jsxs16("div", { children: [
|
|
1216
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
1217
|
+
/* @__PURE__ */ jsx20("span", { className: "body-3", children: title }),
|
|
1218
|
+
" ",
|
|
1219
|
+
require2 && /* @__PURE__ */ jsx20("span", { className: "text-red-500", children: "*" })
|
|
1220
|
+
] }),
|
|
1221
|
+
/* @__PURE__ */ jsx20(
|
|
1222
|
+
ColorPicker,
|
|
1223
|
+
{
|
|
1224
|
+
defaultFormat,
|
|
1225
|
+
className,
|
|
1226
|
+
value,
|
|
1227
|
+
defaultValue: "#ffff",
|
|
1228
|
+
onChange,
|
|
1229
|
+
allowClear,
|
|
1230
|
+
showText: (color) => {
|
|
1231
|
+
const hex = color.toHexString();
|
|
1232
|
+
if (!value) {
|
|
1233
|
+
return /* @__PURE__ */ jsx20("span", { children: placeholder });
|
|
1234
|
+
}
|
|
1235
|
+
return /* @__PURE__ */ jsxs16("span", { children: [
|
|
1236
|
+
"(",
|
|
1237
|
+
hex,
|
|
1238
|
+
")"
|
|
1239
|
+
] });
|
|
1240
|
+
},
|
|
1241
|
+
disabled
|
|
1242
|
+
}
|
|
1243
|
+
),
|
|
1244
|
+
/* @__PURE__ */ jsxs16("div", { children: [
|
|
1245
|
+
/* @__PURE__ */ jsx20("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1246
|
+
" ",
|
|
1247
|
+
showError && /* @__PURE__ */ jsx20("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1248
|
+
] })
|
|
1249
|
+
] })
|
|
1250
|
+
}
|
|
1251
|
+
);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1255
|
+
var import_dayjs = __toESM(require_dayjs_min());
|
|
1256
|
+
var import_th2 = __toESM(require_th());
|
|
1257
|
+
import { ConfigProvider as ConfigProvider3, DatePicker } from "antd";
|
|
1258
|
+
import thTH from "antd/locale/th_TH";
|
|
1259
|
+
import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
1260
|
+
function DatePickerBasic({
|
|
1261
|
+
value,
|
|
1262
|
+
onChange,
|
|
1263
|
+
require: require2,
|
|
1264
|
+
title,
|
|
1265
|
+
bottomText,
|
|
1266
|
+
showError,
|
|
1267
|
+
errorMessage,
|
|
1268
|
+
placeholder,
|
|
1269
|
+
disabled,
|
|
1270
|
+
defaultValue,
|
|
1271
|
+
minDate,
|
|
1272
|
+
maxDate,
|
|
1273
|
+
disabledDate,
|
|
1274
|
+
className,
|
|
1275
|
+
size
|
|
1276
|
+
}) {
|
|
1277
|
+
const dateFormat = "DD/MM/YYYY";
|
|
1278
|
+
import_dayjs.default.locale("th_TH");
|
|
1279
|
+
return /* @__PURE__ */ jsx21(
|
|
1280
|
+
ConfigProvider3,
|
|
1281
|
+
{
|
|
1282
|
+
locale: thTH,
|
|
1283
|
+
theme: {
|
|
1284
|
+
token: {
|
|
1285
|
+
fontFamily: "Kanit"
|
|
1286
|
+
}
|
|
1287
|
+
},
|
|
1288
|
+
children: /* @__PURE__ */ jsxs17("div", { children: [
|
|
1289
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
1290
|
+
/* @__PURE__ */ jsx21("span", { className: "body-3", children: title }),
|
|
1291
|
+
" ",
|
|
1292
|
+
require2 && /* @__PURE__ */ jsx21("span", { className: "text-red-500", children: "*" })
|
|
1293
|
+
] }),
|
|
1294
|
+
/* @__PURE__ */ jsx21(
|
|
1295
|
+
DatePicker,
|
|
1296
|
+
{
|
|
1297
|
+
className: `body-1 ${className ?? ""}`,
|
|
1298
|
+
value,
|
|
1299
|
+
placeholder,
|
|
1300
|
+
onChange,
|
|
1301
|
+
allowClear: true,
|
|
1302
|
+
disabled,
|
|
1303
|
+
format: dateFormat,
|
|
1304
|
+
defaultValue,
|
|
1305
|
+
minDate,
|
|
1306
|
+
maxDate,
|
|
1307
|
+
disabledDate,
|
|
1308
|
+
size
|
|
1309
|
+
}
|
|
1310
|
+
),
|
|
1311
|
+
/* @__PURE__ */ jsxs17("div", { children: [
|
|
1312
|
+
/* @__PURE__ */ jsx21("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1313
|
+
" ",
|
|
1314
|
+
showError && /* @__PURE__ */ jsx21("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1315
|
+
] })
|
|
1316
|
+
] })
|
|
1317
|
+
}
|
|
1318
|
+
);
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
// src/DatePicker/DatePickerRangePicker/DatePickerRangePicker.tsx
|
|
1322
|
+
var import_th3 = __toESM(require_th());
|
|
1323
|
+
var import_customParseFormat = __toESM(require_customParseFormat());
|
|
1324
|
+
var import_dayjs2 = __toESM(require_dayjs_min());
|
|
1325
|
+
import { ConfigProvider as ConfigProvider4, DatePicker as DatePicker2 } from "antd";
|
|
1326
|
+
import thTH2 from "antd/locale/th_TH";
|
|
1327
|
+
import { jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1328
|
+
import_dayjs2.default.extend(import_customParseFormat.default);
|
|
1329
|
+
function DatePickerRangePicker({
|
|
1330
|
+
value,
|
|
1331
|
+
onChange,
|
|
1332
|
+
placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
|
|
1333
|
+
title,
|
|
1334
|
+
require: require2,
|
|
1335
|
+
bottomText,
|
|
1336
|
+
showError,
|
|
1337
|
+
errorMessage,
|
|
1338
|
+
disabled,
|
|
1339
|
+
minDate,
|
|
1340
|
+
maxDate,
|
|
1341
|
+
disabledDate,
|
|
1342
|
+
size = "middle",
|
|
1343
|
+
className,
|
|
1344
|
+
onOpenChange,
|
|
1345
|
+
onCalendarChange
|
|
1346
|
+
}) {
|
|
1347
|
+
const dateFormat = "DD/MM/YYYY";
|
|
1348
|
+
import_dayjs2.default.locale("th_TH");
|
|
1349
|
+
return /* @__PURE__ */ jsx22(
|
|
1350
|
+
ConfigProvider4,
|
|
1351
|
+
{
|
|
1352
|
+
locale: thTH2,
|
|
1353
|
+
theme: {
|
|
1354
|
+
token: {
|
|
1355
|
+
fontFamily: "Kanit"
|
|
1356
|
+
}
|
|
1357
|
+
},
|
|
1358
|
+
children: /* @__PURE__ */ jsxs18("div", { children: [
|
|
1359
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
1360
|
+
/* @__PURE__ */ jsx22("span", { className: "body-3", children: title }),
|
|
1361
|
+
" ",
|
|
1362
|
+
require2 && /* @__PURE__ */ jsx22("span", { className: "text-red-500", children: "*" })
|
|
1363
|
+
] }),
|
|
1364
|
+
/* @__PURE__ */ jsx22(
|
|
1365
|
+
DatePicker2.RangePicker,
|
|
1366
|
+
{
|
|
1367
|
+
format: dateFormat,
|
|
1368
|
+
value,
|
|
1369
|
+
placeholder,
|
|
1370
|
+
className: `body-1 ${className ?? ""}`,
|
|
1371
|
+
onChange,
|
|
1372
|
+
allowClear: true,
|
|
1373
|
+
disabled,
|
|
1374
|
+
minDate,
|
|
1375
|
+
maxDate,
|
|
1376
|
+
disabledDate,
|
|
1377
|
+
size,
|
|
1378
|
+
onOpenChange,
|
|
1379
|
+
onCalendarChange
|
|
1380
|
+
}
|
|
1381
|
+
),
|
|
1382
|
+
/* @__PURE__ */ jsxs18("div", { children: [
|
|
1383
|
+
/* @__PURE__ */ jsx22("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1384
|
+
" ",
|
|
1385
|
+
showError && /* @__PURE__ */ jsx22("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1386
|
+
] })
|
|
1387
|
+
] })
|
|
1388
|
+
}
|
|
1389
|
+
);
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
// src/TimePicker/TimePickerBasic/TimePickerBasic.tsx
|
|
1393
|
+
import { ConfigProvider as ConfigProvider5, TimePicker } from "antd";
|
|
1394
|
+
import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
1395
|
+
function TimePickerBasic({
|
|
1396
|
+
value,
|
|
1397
|
+
onChange,
|
|
1398
|
+
require: require2,
|
|
1399
|
+
title,
|
|
1400
|
+
bottomText,
|
|
1401
|
+
showError,
|
|
1402
|
+
errorMessage,
|
|
1403
|
+
placeholder,
|
|
1404
|
+
disabled
|
|
1405
|
+
}) {
|
|
1406
|
+
return /* @__PURE__ */ jsx23(
|
|
1407
|
+
ConfigProvider5,
|
|
1408
|
+
{
|
|
1409
|
+
theme: {
|
|
1410
|
+
token: {
|
|
1411
|
+
fontFamily: "Kanit"
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
children: /* @__PURE__ */ jsxs19("div", { children: [
|
|
1415
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
1416
|
+
/* @__PURE__ */ jsx23("span", { className: "body-3", children: title }),
|
|
1417
|
+
" ",
|
|
1418
|
+
require2 && /* @__PURE__ */ jsx23("span", { className: "text-red-500", children: "*" })
|
|
1419
|
+
] }),
|
|
1420
|
+
/* @__PURE__ */ jsx23(
|
|
1421
|
+
TimePicker,
|
|
1422
|
+
{
|
|
1423
|
+
format: "HH:mm",
|
|
1424
|
+
className: "body-1",
|
|
1425
|
+
value,
|
|
1426
|
+
placeholder,
|
|
1427
|
+
onChange,
|
|
1428
|
+
allowClear: true,
|
|
1429
|
+
disabled
|
|
1430
|
+
}
|
|
1431
|
+
),
|
|
1432
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
1433
|
+
/* @__PURE__ */ jsx23("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1434
|
+
" ",
|
|
1435
|
+
showError && /* @__PURE__ */ jsx23("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1436
|
+
] })
|
|
1437
|
+
] })
|
|
1438
|
+
}
|
|
1439
|
+
);
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
// src/TimePicker/TimePickerRangePicker/TimerPickerRangePicker.tsx
|
|
1443
|
+
import { ConfigProvider as ConfigProvider6, TimePicker as TimePicker2 } from "antd";
|
|
1444
|
+
import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
1445
|
+
function TimePickerRangePicker({
|
|
1446
|
+
value,
|
|
1447
|
+
onChange,
|
|
1448
|
+
placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
|
|
1449
|
+
title,
|
|
1450
|
+
require: require2,
|
|
1451
|
+
bottomText,
|
|
1452
|
+
showError,
|
|
1453
|
+
errorMessage,
|
|
1454
|
+
disabled
|
|
1455
|
+
}) {
|
|
1456
|
+
return /* @__PURE__ */ jsx24(
|
|
1457
|
+
ConfigProvider6,
|
|
1458
|
+
{
|
|
1459
|
+
theme: {
|
|
1460
|
+
token: {
|
|
1461
|
+
fontFamily: "Kanit"
|
|
1462
|
+
}
|
|
1463
|
+
},
|
|
1464
|
+
children: /* @__PURE__ */ jsxs20("div", { children: [
|
|
1465
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
1466
|
+
/* @__PURE__ */ jsx24("span", { className: "body-3", children: title }),
|
|
1467
|
+
" ",
|
|
1468
|
+
require2 && /* @__PURE__ */ jsx24("span", { className: "text-red-500", children: "*" })
|
|
1469
|
+
] }),
|
|
1470
|
+
/* @__PURE__ */ jsx24(
|
|
1471
|
+
TimePicker2.RangePicker,
|
|
1472
|
+
{
|
|
1473
|
+
format: "HH:mm",
|
|
1474
|
+
value,
|
|
1475
|
+
placeholder,
|
|
1476
|
+
className: "body-1",
|
|
1477
|
+
onChange,
|
|
1478
|
+
allowClear: true,
|
|
1479
|
+
disabled
|
|
1480
|
+
}
|
|
1481
|
+
),
|
|
1482
|
+
/* @__PURE__ */ jsxs20("div", { children: [
|
|
1483
|
+
/* @__PURE__ */ jsx24("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1484
|
+
" ",
|
|
1485
|
+
showError && /* @__PURE__ */ jsx24("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1486
|
+
] })
|
|
1487
|
+
] })
|
|
1488
|
+
}
|
|
1489
|
+
);
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
// src/Select/SelectField/SelectField.tsx
|
|
1493
|
+
import { Select, ConfigProvider as ConfigProvider7 } from "antd";
|
|
1494
|
+
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
1495
|
+
function SelectField({
|
|
1496
|
+
value,
|
|
1497
|
+
onChange,
|
|
1498
|
+
placeholder,
|
|
1499
|
+
title,
|
|
1500
|
+
require: require2,
|
|
1501
|
+
bottomText,
|
|
1502
|
+
showError,
|
|
1503
|
+
errorMessage,
|
|
1504
|
+
disabled,
|
|
1505
|
+
defaultValue,
|
|
1506
|
+
options,
|
|
1507
|
+
mode,
|
|
1508
|
+
prefix,
|
|
1509
|
+
prefixSize = 20,
|
|
1510
|
+
handleSearch
|
|
1511
|
+
}) {
|
|
1512
|
+
return /* @__PURE__ */ jsx25(
|
|
1513
|
+
ConfigProvider7,
|
|
1514
|
+
{
|
|
1515
|
+
theme: {
|
|
1516
|
+
components: {
|
|
1517
|
+
Select: {
|
|
1518
|
+
hoverBorderColor: "#D9D9D9",
|
|
1519
|
+
activeBorderColor: "#D9D9D9",
|
|
1520
|
+
activeOutlineColor: "#D9D9D9"
|
|
1521
|
+
}
|
|
1522
|
+
},
|
|
1523
|
+
token: {
|
|
1524
|
+
fontFamily: "Kanit"
|
|
1525
|
+
}
|
|
1526
|
+
},
|
|
1527
|
+
children: /* @__PURE__ */ jsxs21("div", { children: [
|
|
1528
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
1529
|
+
/* @__PURE__ */ jsx25("span", { className: "body-3", children: title }),
|
|
1530
|
+
" ",
|
|
1531
|
+
require2 && /* @__PURE__ */ jsx25("span", { className: "text-red-500", children: "*" })
|
|
1532
|
+
] }),
|
|
1533
|
+
/* @__PURE__ */ jsx25(
|
|
1534
|
+
Select,
|
|
1535
|
+
{
|
|
1536
|
+
showSearch: true,
|
|
1537
|
+
value,
|
|
1538
|
+
defaultValue,
|
|
1539
|
+
onChange,
|
|
1540
|
+
className: "body-3 flex justify-center w-full",
|
|
1541
|
+
placeholder,
|
|
1542
|
+
optionFilterProp: "label",
|
|
1543
|
+
filterOption: (input, option) => (option?.label ?? "").toString().toLowerCase().includes(input.toLowerCase()),
|
|
1544
|
+
disabled,
|
|
1545
|
+
options,
|
|
1546
|
+
mode,
|
|
1547
|
+
onSearch: handleSearch,
|
|
1548
|
+
prefix: prefix ? /* @__PURE__ */ jsx25("span", { style: { width: prefixSize, height: prefixSize, display: "flex", alignItems: "center", justifyContent: "center" }, children: prefix }) : void 0,
|
|
1549
|
+
allowClear: true
|
|
1550
|
+
}
|
|
1551
|
+
),
|
|
1552
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
1553
|
+
/* @__PURE__ */ jsx25("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1554
|
+
" ",
|
|
1555
|
+
showError && /* @__PURE__ */ jsx25("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1556
|
+
] })
|
|
1557
|
+
] })
|
|
1558
|
+
}
|
|
1559
|
+
);
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
// src/Select/SelectFieldGroup/SelectFieldGroup.tsx
|
|
1563
|
+
import { Select as Select2, ConfigProvider as ConfigProvider8 } from "antd";
|
|
1564
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
1565
|
+
function SelectFieldGroup({
|
|
1566
|
+
value,
|
|
1567
|
+
onChange,
|
|
1568
|
+
placeholder,
|
|
1569
|
+
title,
|
|
1570
|
+
require: require2,
|
|
1571
|
+
bottomText,
|
|
1572
|
+
showError,
|
|
1573
|
+
errorMessage,
|
|
1574
|
+
disabled,
|
|
1575
|
+
defaultValue,
|
|
1576
|
+
options,
|
|
1577
|
+
mode,
|
|
1578
|
+
prefix,
|
|
1579
|
+
prefixSize = 20,
|
|
1580
|
+
handleSearch
|
|
1581
|
+
}) {
|
|
1582
|
+
return /* @__PURE__ */ jsx26(
|
|
1583
|
+
ConfigProvider8,
|
|
1584
|
+
{
|
|
1585
|
+
theme: {
|
|
1586
|
+
components: {
|
|
1587
|
+
Select: {
|
|
1588
|
+
hoverBorderColor: "#D9D9D9",
|
|
1589
|
+
activeBorderColor: "#D9D9D9",
|
|
1590
|
+
activeOutlineColor: "#D9D9D9"
|
|
1591
|
+
}
|
|
1592
|
+
},
|
|
1593
|
+
token: {
|
|
1594
|
+
fontFamily: "Kanit"
|
|
1595
|
+
}
|
|
1596
|
+
},
|
|
1597
|
+
children: /* @__PURE__ */ jsxs22("div", { children: [
|
|
1598
|
+
/* @__PURE__ */ jsxs22("div", { children: [
|
|
1599
|
+
/* @__PURE__ */ jsx26("span", { className: "body-3", children: title }),
|
|
1600
|
+
" ",
|
|
1601
|
+
require2 && /* @__PURE__ */ jsx26("span", { className: "text-red-500", children: "*" })
|
|
1602
|
+
] }),
|
|
1603
|
+
/* @__PURE__ */ jsx26(
|
|
1604
|
+
Select2,
|
|
1605
|
+
{
|
|
1606
|
+
showSearch: true,
|
|
1607
|
+
value,
|
|
1608
|
+
defaultValue,
|
|
1609
|
+
onChange,
|
|
1610
|
+
className: "body-3 flex justify-center w-full",
|
|
1611
|
+
placeholder,
|
|
1612
|
+
optionFilterProp: "label",
|
|
1613
|
+
filterOption: (input, option) => (option?.label ?? "").toString().toLowerCase().includes(input.toLowerCase()),
|
|
1614
|
+
disabled,
|
|
1615
|
+
options,
|
|
1616
|
+
mode,
|
|
1617
|
+
onSearch: handleSearch,
|
|
1618
|
+
prefix: prefix ? /* @__PURE__ */ jsx26(
|
|
1619
|
+
"span",
|
|
1620
|
+
{
|
|
1621
|
+
style: {
|
|
1622
|
+
width: prefixSize,
|
|
1623
|
+
height: prefixSize,
|
|
1624
|
+
display: "flex",
|
|
1625
|
+
alignItems: "center",
|
|
1626
|
+
justifyContent: "center"
|
|
1627
|
+
},
|
|
1628
|
+
children: prefix
|
|
1629
|
+
}
|
|
1630
|
+
) : void 0,
|
|
1631
|
+
allowClear: true
|
|
1632
|
+
}
|
|
1633
|
+
),
|
|
1634
|
+
/* @__PURE__ */ jsxs22("div", { children: [
|
|
1635
|
+
/* @__PURE__ */ jsx26("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1636
|
+
" ",
|
|
1637
|
+
showError && /* @__PURE__ */ jsx26("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1638
|
+
] })
|
|
1639
|
+
] })
|
|
1640
|
+
}
|
|
1641
|
+
);
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
1645
|
+
import { Select as Select3, ConfigProvider as ConfigProvider9 } from "antd";
|
|
1646
|
+
|
|
1647
|
+
// src/Select/SelectFieldStatus/StatusMockup.ts
|
|
1648
|
+
var status = [
|
|
1649
|
+
{ value: "1", label: "\u0E40\u0E1B\u0E34\u0E14", color: "var(--color-gray-500)" },
|
|
1650
|
+
{ value: "2", label: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23", color: "var(--color-yellow-400)" },
|
|
1651
|
+
{ value: "3", label: "\u0E23\u0E2D\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A", color: "var(--color-red-400)" },
|
|
1652
|
+
{ value: "4", label: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-green-400)" },
|
|
1653
|
+
{ value: "5", label: "\u0E16\u0E39\u0E01\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01", color: "var(--color-gray-300)" }
|
|
1654
|
+
];
|
|
1655
|
+
|
|
1656
|
+
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
1657
|
+
import { DownOutlined } from "@ant-design/icons";
|
|
1658
|
+
import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
1659
|
+
function SelectFieldStatus({
|
|
1660
|
+
value,
|
|
1661
|
+
onChange,
|
|
1662
|
+
placeholder,
|
|
1663
|
+
title,
|
|
1664
|
+
require: require2,
|
|
1665
|
+
bottomText,
|
|
1666
|
+
disabled,
|
|
1667
|
+
showError,
|
|
1668
|
+
errorMessage
|
|
1669
|
+
}) {
|
|
1670
|
+
const selectedItem = status.find((s) => s.value === value);
|
|
1671
|
+
return /* @__PURE__ */ jsx27(
|
|
1672
|
+
ConfigProvider9,
|
|
1673
|
+
{
|
|
1674
|
+
theme: {
|
|
1675
|
+
components: {
|
|
1676
|
+
Select: {
|
|
1677
|
+
selectorBg: selectedItem?.color || "#ffff",
|
|
1678
|
+
hoverBorderColor: "#D9D9D9",
|
|
1679
|
+
activeBorderColor: "#D9D9D9",
|
|
1680
|
+
activeOutlineColor: "#D9D9D9"
|
|
1681
|
+
}
|
|
1682
|
+
},
|
|
1683
|
+
token: {
|
|
1684
|
+
fontFamily: "Kanit"
|
|
1685
|
+
}
|
|
1686
|
+
},
|
|
1687
|
+
children: /* @__PURE__ */ jsxs23("div", { children: [
|
|
1688
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
1689
|
+
/* @__PURE__ */ jsx27("span", { className: "body-3", children: title }),
|
|
1690
|
+
" ",
|
|
1691
|
+
require2 && /* @__PURE__ */ jsx27("span", { className: "text-red-500", children: "*" })
|
|
1692
|
+
] }),
|
|
1693
|
+
/* @__PURE__ */ jsx27(
|
|
1694
|
+
Select3,
|
|
1695
|
+
{
|
|
1696
|
+
disabled,
|
|
1697
|
+
suffixIcon: /* @__PURE__ */ jsx27(DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
1698
|
+
value,
|
|
1699
|
+
onChange,
|
|
1700
|
+
className: "body-3 custom-select flex justify-center w-full",
|
|
1701
|
+
placeholder,
|
|
1702
|
+
optionFilterProp: "label",
|
|
1703
|
+
filterSort: (optionA, optionB) => (optionA?.label ?? "").toLowerCase().localeCompare((optionB?.label ?? "").toLowerCase()),
|
|
1704
|
+
options: status.map((s) => ({
|
|
1705
|
+
value: s.value,
|
|
1706
|
+
label: s.label,
|
|
1707
|
+
color: s.color
|
|
1708
|
+
}))
|
|
1709
|
+
}
|
|
1710
|
+
),
|
|
1711
|
+
/* @__PURE__ */ jsxs23("div", { children: [
|
|
1712
|
+
/* @__PURE__ */ jsx27("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1713
|
+
" ",
|
|
1714
|
+
showError && /* @__PURE__ */ jsx27("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1715
|
+
] })
|
|
1716
|
+
] })
|
|
1717
|
+
}
|
|
1718
|
+
);
|
|
1719
|
+
}
|
|
1720
|
+
|
|
1721
|
+
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
1722
|
+
import { Select as Select4, ConfigProvider as ConfigProvider10 } from "antd";
|
|
1723
|
+
|
|
1724
|
+
// src/Select/SelectFieldStatusReport/StatusReportMockup.ts
|
|
1725
|
+
var status2 = [
|
|
1726
|
+
{ value: "1", label: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-green-400)" },
|
|
1727
|
+
{ value: "2", label: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-red-500)" }
|
|
1728
|
+
];
|
|
1729
|
+
|
|
1730
|
+
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
1731
|
+
import { DownOutlined as DownOutlined2 } from "@ant-design/icons";
|
|
1732
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
1733
|
+
function SelectFieldStatusReport({
|
|
1734
|
+
value,
|
|
1735
|
+
onChange,
|
|
1736
|
+
placeholder,
|
|
1737
|
+
title,
|
|
1738
|
+
require: require2,
|
|
1739
|
+
bottomText,
|
|
1740
|
+
disabled,
|
|
1741
|
+
showError,
|
|
1742
|
+
errorMessage
|
|
1743
|
+
}) {
|
|
1744
|
+
const selectedItem = status2.find((s) => s.value === value);
|
|
1745
|
+
return /* @__PURE__ */ jsx28(
|
|
1746
|
+
ConfigProvider10,
|
|
1747
|
+
{
|
|
1748
|
+
theme: {
|
|
1749
|
+
components: {
|
|
1750
|
+
Select: {
|
|
1751
|
+
selectorBg: selectedItem?.color || "#ffff",
|
|
1752
|
+
hoverBorderColor: "#D9D9D9",
|
|
1753
|
+
activeBorderColor: "#D9D9D9",
|
|
1754
|
+
activeOutlineColor: "#D9D9D9"
|
|
1755
|
+
}
|
|
1756
|
+
},
|
|
1757
|
+
token: {
|
|
1758
|
+
fontFamily: "Kanit"
|
|
1759
|
+
}
|
|
1760
|
+
},
|
|
1761
|
+
children: /* @__PURE__ */ jsxs24("div", { children: [
|
|
1762
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
1763
|
+
/* @__PURE__ */ jsx28("span", { className: "body-3", children: title }),
|
|
1764
|
+
" ",
|
|
1765
|
+
require2 && /* @__PURE__ */ jsx28("span", { className: "text-red-500", children: "*" })
|
|
1766
|
+
] }),
|
|
1767
|
+
/* @__PURE__ */ jsx28(
|
|
1768
|
+
Select4,
|
|
1769
|
+
{
|
|
1770
|
+
disabled,
|
|
1771
|
+
suffixIcon: /* @__PURE__ */ jsx28(DownOutlined2, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
1772
|
+
value,
|
|
1773
|
+
onChange,
|
|
1774
|
+
className: "body-3 custom-select flex justify-center w-full",
|
|
1775
|
+
placeholder,
|
|
1776
|
+
optionFilterProp: "label",
|
|
1777
|
+
filterSort: (optionA, optionB) => (optionA?.label ?? "").toLowerCase().localeCompare((optionB?.label ?? "").toLowerCase()),
|
|
1778
|
+
options: status2.map((s) => ({
|
|
1779
|
+
value: s.value,
|
|
1780
|
+
label: s.label,
|
|
1781
|
+
color: s.color
|
|
1782
|
+
}))
|
|
1783
|
+
}
|
|
1784
|
+
),
|
|
1785
|
+
/* @__PURE__ */ jsxs24("div", { children: [
|
|
1786
|
+
/* @__PURE__ */ jsx28("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1787
|
+
" ",
|
|
1788
|
+
showError && /* @__PURE__ */ jsx28("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1789
|
+
] })
|
|
1790
|
+
] })
|
|
1791
|
+
}
|
|
1792
|
+
);
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
// src/Select/SelectFieldTag/SelectFieldTag.tsx
|
|
1796
|
+
import { Select as Select5, ConfigProvider as ConfigProvider11 } from "antd";
|
|
1797
|
+
import { useState as useState6 } from "react";
|
|
1798
|
+
import { jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
1799
|
+
function SelectFieldTag({
|
|
1800
|
+
title,
|
|
1801
|
+
require: require2,
|
|
1802
|
+
bottomText,
|
|
1803
|
+
placeholder,
|
|
1804
|
+
options,
|
|
1805
|
+
showError,
|
|
1806
|
+
errorMessage,
|
|
1807
|
+
value: controlledValue,
|
|
1808
|
+
onChange
|
|
1809
|
+
}) {
|
|
1810
|
+
const [internalValue, setInternalValue] = useState6([]);
|
|
1811
|
+
const isControlled = controlledValue !== void 0;
|
|
1812
|
+
const value = isControlled ? controlledValue : internalValue;
|
|
1813
|
+
const [searchWord, setSearchWord] = useState6("");
|
|
1814
|
+
const handleChange = (val) => {
|
|
1815
|
+
const trimValue = val.map((v) => v.trim());
|
|
1816
|
+
const filtered = trimValue.filter((v) => v.trim() !== "");
|
|
1817
|
+
const latest = filtered.slice(-1);
|
|
1818
|
+
if (!isControlled) {
|
|
1819
|
+
setInternalValue(latest);
|
|
1820
|
+
}
|
|
1821
|
+
setSearchWord("");
|
|
1822
|
+
onChange?.(latest);
|
|
1823
|
+
};
|
|
1824
|
+
const handleSearch = (text) => {
|
|
1825
|
+
setSearchWord(text.trimStart());
|
|
1826
|
+
if (!isControlled) {
|
|
1827
|
+
setInternalValue([]);
|
|
1828
|
+
}
|
|
1829
|
+
onChange?.([]);
|
|
1830
|
+
};
|
|
1831
|
+
return /* @__PURE__ */ jsx29(
|
|
1832
|
+
ConfigProvider11,
|
|
1833
|
+
{
|
|
1834
|
+
theme: {
|
|
1835
|
+
components: {
|
|
1836
|
+
Select: {
|
|
1837
|
+
hoverBorderColor: "#D9D9D9",
|
|
1838
|
+
activeBorderColor: "#D9D9D9",
|
|
1839
|
+
activeOutlineColor: "#D9D9D9"
|
|
1840
|
+
}
|
|
1841
|
+
},
|
|
1842
|
+
token: {
|
|
1843
|
+
fontFamily: "Kanit"
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
children: /* @__PURE__ */ jsxs25("div", { children: [
|
|
1847
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
1848
|
+
/* @__PURE__ */ jsx29("span", { className: "body-3", children: title }),
|
|
1849
|
+
" ",
|
|
1850
|
+
require2 && /* @__PURE__ */ jsx29("span", { className: "text-red-500", children: "*" })
|
|
1851
|
+
] }),
|
|
1852
|
+
/* @__PURE__ */ jsx29(
|
|
1853
|
+
Select5,
|
|
1854
|
+
{
|
|
1855
|
+
mode: "tags",
|
|
1856
|
+
className: "flex justify-center w-full",
|
|
1857
|
+
placeholder,
|
|
1858
|
+
value,
|
|
1859
|
+
onChange: handleChange,
|
|
1860
|
+
onSearch: handleSearch,
|
|
1861
|
+
filterOption: (input, option) => {
|
|
1862
|
+
if (!input.trim()) return true;
|
|
1863
|
+
return (option?.label).toLowerCase().includes(input.toLowerCase());
|
|
1864
|
+
},
|
|
1865
|
+
searchValue: searchWord,
|
|
1866
|
+
options,
|
|
1867
|
+
allowClear: true
|
|
1868
|
+
}
|
|
1869
|
+
),
|
|
1870
|
+
/* @__PURE__ */ jsxs25("div", { children: [
|
|
1871
|
+
/* @__PURE__ */ jsx29("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1872
|
+
" ",
|
|
1873
|
+
showError && /* @__PURE__ */ jsx29("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1874
|
+
] })
|
|
1875
|
+
] })
|
|
1876
|
+
}
|
|
1877
|
+
);
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
// src/SortFilter/SortFilter.tsx
|
|
1881
|
+
import { ConfigProvider as ConfigProvider12 } from "antd";
|
|
1882
|
+
import { CalendarOutlined } from "@ant-design/icons";
|
|
1883
|
+
|
|
1884
|
+
// src/SortFilter/DataMockSortFilter.ts
|
|
1885
|
+
var years = [
|
|
1886
|
+
{ value: "\u0E1B\u0E35 2566", label: "\u0E1B\u0E35 2566" },
|
|
1887
|
+
{ value: "\u0E1B\u0E35 2567", label: "\u0E1B\u0E35 2567" },
|
|
1888
|
+
{ value: "\u0E1B\u0E35 2568", label: "\u0E1B\u0E35 2568" }
|
|
1889
|
+
];
|
|
1890
|
+
var months = [
|
|
1891
|
+
{ value: "\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21", label: "\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21" },
|
|
1892
|
+
{ value: "\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C", label: "\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C" },
|
|
1893
|
+
{ value: "\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21", label: "\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21" },
|
|
1894
|
+
{ value: "\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19", label: "\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19" },
|
|
1895
|
+
{ value: "\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21", label: "\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21" },
|
|
1896
|
+
{ value: "\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19", label: "\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19" },
|
|
1897
|
+
{ value: "\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21", label: "\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21" },
|
|
1898
|
+
{ value: "\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21", label: "\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21" },
|
|
1899
|
+
{ value: "\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19", label: "\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19" },
|
|
1900
|
+
{ value: "\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21", label: "\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21" },
|
|
1901
|
+
{ value: "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19", label: "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19" },
|
|
1902
|
+
{ value: "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21", label: "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21" }
|
|
1903
|
+
];
|
|
1904
|
+
var quarters = [
|
|
1905
|
+
{ value: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 1", label: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 1" },
|
|
1906
|
+
{ value: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 2", label: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 2" },
|
|
1907
|
+
{ value: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 3", label: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 3" },
|
|
1908
|
+
{ value: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 4", label: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 4" }
|
|
1909
|
+
];
|
|
1910
|
+
|
|
1911
|
+
// src/SortFilter/SortFilter.tsx
|
|
1912
|
+
import { useState as useState7 } from "react";
|
|
1913
|
+
import { IconSortDescending as IconSortDescending2, IconFilter } from "@tabler/icons-react";
|
|
1914
|
+
import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
1915
|
+
function SortFilter({
|
|
1916
|
+
showYear = true,
|
|
1917
|
+
showQuarter = true,
|
|
1918
|
+
showMonth = true,
|
|
1919
|
+
onSortClick,
|
|
1920
|
+
onFilterClick
|
|
1921
|
+
}) {
|
|
1922
|
+
const [yearValue, setYearValue] = useState7();
|
|
1923
|
+
const [monthValue, setMonthValue] = useState7();
|
|
1924
|
+
const [quarterValue, setQuartersValue] = useState7();
|
|
1925
|
+
return /* @__PURE__ */ jsx30(
|
|
1926
|
+
ConfigProvider12,
|
|
1927
|
+
{
|
|
1928
|
+
theme: {
|
|
1929
|
+
token: {
|
|
1930
|
+
fontFamily: "Kanit"
|
|
1931
|
+
}
|
|
1932
|
+
},
|
|
1933
|
+
children: /* @__PURE__ */ jsxs26("div", { className: "w-full flex items-center justify-between", children: [
|
|
1934
|
+
/* @__PURE__ */ jsxs26("div", { className: "w-full flex gap-[10px]", children: [
|
|
1935
|
+
showYear && /* @__PURE__ */ jsx30("div", { className: "w-[200px]", children: /* @__PURE__ */ jsx30(
|
|
1936
|
+
SelectField,
|
|
1937
|
+
{
|
|
1938
|
+
prefix: /* @__PURE__ */ jsx30(CalendarOutlined, {}),
|
|
1939
|
+
onChange: setYearValue,
|
|
1940
|
+
options: years.map((s) => ({
|
|
1941
|
+
value: s.value,
|
|
1942
|
+
label: s.label
|
|
1943
|
+
})),
|
|
1944
|
+
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E1B\u0E35",
|
|
1945
|
+
value: yearValue
|
|
1946
|
+
}
|
|
1947
|
+
) }),
|
|
1948
|
+
showMonth && /* @__PURE__ */ jsx30("div", { className: "w-[200px]", children: /* @__PURE__ */ jsx30(
|
|
1949
|
+
SelectField,
|
|
1950
|
+
{
|
|
1951
|
+
prefix: /* @__PURE__ */ jsx30(CalendarOutlined, {}),
|
|
1952
|
+
onChange: setMonthValue,
|
|
1953
|
+
options: months.map((s) => ({
|
|
1954
|
+
value: s.value,
|
|
1955
|
+
label: s.label
|
|
1956
|
+
})),
|
|
1957
|
+
value: monthValue,
|
|
1958
|
+
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
1959
|
+
}
|
|
1960
|
+
) }),
|
|
1961
|
+
showQuarter && /* @__PURE__ */ jsx30("div", { className: "w-[200px]", children: /* @__PURE__ */ jsx30(
|
|
1962
|
+
SelectField,
|
|
1963
|
+
{
|
|
1964
|
+
prefix: /* @__PURE__ */ jsx30(CalendarOutlined, {}),
|
|
1965
|
+
onChange: setQuartersValue,
|
|
1966
|
+
options: quarters.map((s) => ({
|
|
1967
|
+
value: s.value,
|
|
1968
|
+
label: s.label
|
|
1969
|
+
})),
|
|
1970
|
+
value: quarterValue,
|
|
1971
|
+
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A"
|
|
1972
|
+
}
|
|
1973
|
+
) })
|
|
1974
|
+
] }),
|
|
1975
|
+
/* @__PURE__ */ jsxs26("div", { className: "flex gap-[10px]", children: [
|
|
1976
|
+
/* @__PURE__ */ jsx30(
|
|
1977
|
+
IconSortDescending2,
|
|
1978
|
+
{
|
|
1979
|
+
size: 24,
|
|
1980
|
+
className: "cursor-pointer",
|
|
1981
|
+
onClick: onSortClick
|
|
1982
|
+
}
|
|
1983
|
+
),
|
|
1984
|
+
/* @__PURE__ */ jsx30(
|
|
1985
|
+
IconFilter,
|
|
1986
|
+
{
|
|
1987
|
+
size: 24,
|
|
1988
|
+
className: "cursor-pointer",
|
|
1989
|
+
onClick: onFilterClick
|
|
1990
|
+
}
|
|
1991
|
+
)
|
|
1992
|
+
] })
|
|
1993
|
+
] })
|
|
1994
|
+
}
|
|
1995
|
+
);
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
// src/Upload/FileUploader/FileUploader.tsx
|
|
1999
|
+
import { IconPaperclip, IconUpload, IconTrash } from "@tabler/icons-react";
|
|
2000
|
+
import { useRef as useRef2, useState as useState8 } from "react";
|
|
2001
|
+
import { Fragment as Fragment3, jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
2002
|
+
function FileUploader({
|
|
2003
|
+
onUpload,
|
|
2004
|
+
onError,
|
|
2005
|
+
onRemove,
|
|
2006
|
+
accept,
|
|
2007
|
+
maxSize,
|
|
2008
|
+
disabled,
|
|
2009
|
+
mode = "drop",
|
|
2010
|
+
description,
|
|
2011
|
+
label
|
|
2012
|
+
}) {
|
|
2013
|
+
const [fileList, setFileList] = useState8([]);
|
|
2014
|
+
const [uploading, setUploading] = useState8(false);
|
|
2015
|
+
const [dragActive, setDragActive] = useState8(false);
|
|
2016
|
+
const inputRef = useRef2(null);
|
|
2017
|
+
const validateFile = (file) => {
|
|
2018
|
+
if (accept && !accept.includes(file.type)) {
|
|
2019
|
+
onError?.(`Invalid file type. file: ${file.name}`);
|
|
2020
|
+
throw new Error("Invalid file type");
|
|
2021
|
+
}
|
|
2022
|
+
if (maxSize && file.size > maxSize * 1024 * 1024) {
|
|
2023
|
+
onError?.(`Invalid file size. file: ${file.name}`);
|
|
2024
|
+
throw new Error("Invalid file size");
|
|
2025
|
+
}
|
|
2026
|
+
return true;
|
|
2027
|
+
};
|
|
2028
|
+
const handleUploadClick = () => {
|
|
2029
|
+
inputRef.current?.click();
|
|
2030
|
+
};
|
|
2031
|
+
const handleRemoveFile = async (index) => {
|
|
2032
|
+
try {
|
|
2033
|
+
if (onRemove) {
|
|
2034
|
+
await onRemove();
|
|
2035
|
+
}
|
|
2036
|
+
const updatedList = [...fileList];
|
|
2037
|
+
updatedList.splice(index, 1);
|
|
2038
|
+
setFileList(updatedList);
|
|
2039
|
+
} catch (error) {
|
|
2040
|
+
console.log(error);
|
|
2041
|
+
}
|
|
2042
|
+
};
|
|
2043
|
+
const handleUpload = (event) => {
|
|
2044
|
+
handleFileChange(event.target.files);
|
|
2045
|
+
};
|
|
2046
|
+
const handleDrop = (event) => {
|
|
2047
|
+
event.preventDefault();
|
|
2048
|
+
setDragActive(false);
|
|
2049
|
+
if (disabled) return;
|
|
2050
|
+
handleFileChange(event.dataTransfer.files);
|
|
2051
|
+
};
|
|
2052
|
+
const handleFileChange = async (files) => {
|
|
2053
|
+
if (!files) return;
|
|
2054
|
+
const fileArray = Array.from(files);
|
|
2055
|
+
for (const file of fileArray) {
|
|
2056
|
+
if (!validateFile(file)) continue;
|
|
2057
|
+
setUploading(true);
|
|
2058
|
+
try {
|
|
2059
|
+
if (onUpload) {
|
|
2060
|
+
await onUpload(file);
|
|
2061
|
+
}
|
|
2062
|
+
setFileList((prev) => [...prev, file]);
|
|
2063
|
+
} catch (err) {
|
|
2064
|
+
console.log("catch");
|
|
2065
|
+
console.error(err);
|
|
2066
|
+
} finally {
|
|
2067
|
+
setUploading(false);
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
if (inputRef.current) inputRef.current.value = "";
|
|
2071
|
+
};
|
|
2072
|
+
return /* @__PURE__ */ jsxs27("div", { className: "w-full", children: [
|
|
2073
|
+
label && /* @__PURE__ */ jsx31("p", { className: "body-1", children: label }),
|
|
2074
|
+
/* @__PURE__ */ jsxs27("div", { children: [
|
|
2075
|
+
mode === "upload" ? /* @__PURE__ */ jsx31(
|
|
2076
|
+
"button",
|
|
2077
|
+
{
|
|
2078
|
+
type: "button",
|
|
2079
|
+
onClick: handleUploadClick,
|
|
2080
|
+
className: `h-[34px] flex justify-center items-center gap-2 w-full rounded-[2px] border border-gray-200 body-1
|
|
2081
|
+
${disabled ? "cursor-not-allowed text-gray-400 bg-gray-100" : "cursor-pointer hover:text-primary-400 hover:border-primary-200 duration-300"}`,
|
|
2082
|
+
disabled: disabled ? disabled : uploading,
|
|
2083
|
+
children: uploading ? /* @__PURE__ */ jsxs27(Fragment3, { children: [
|
|
2084
|
+
/* @__PURE__ */ jsx31(Loader, { size: 15 }),
|
|
2085
|
+
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2086
|
+
] }) : /* @__PURE__ */ jsxs27(Fragment3, { children: [
|
|
2087
|
+
/* @__PURE__ */ jsx31(IconUpload, { size: 15, className: "text-gray-400" }),
|
|
2088
|
+
" \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
|
|
2089
|
+
] })
|
|
2090
|
+
}
|
|
2091
|
+
) : /* @__PURE__ */ jsx31(
|
|
2092
|
+
"div",
|
|
2093
|
+
{
|
|
2094
|
+
className: `min-w-[400px] min-h-[120px] flex justify-center items-center border-2 border-dashed rounded-md p-4 transition-colors body-1
|
|
2095
|
+
${dragActive ? "border-primary-500 bg-primary-50" : "border-gray-300 bg-white"}
|
|
2096
|
+
${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
2097
|
+
`,
|
|
2098
|
+
onClick: handleUploadClick,
|
|
2099
|
+
onDragOver: (e) => {
|
|
2100
|
+
e.preventDefault();
|
|
2101
|
+
if (!disabled) setDragActive(true);
|
|
2102
|
+
},
|
|
2103
|
+
onDragLeave: () => setDragActive(false),
|
|
2104
|
+
onDrop: handleDrop,
|
|
2105
|
+
children: uploading ? /* @__PURE__ */ jsxs27("div", { className: "flex justify-center items-center gap-2", children: [
|
|
2106
|
+
/* @__PURE__ */ jsx31(Loader, { size: 15 }),
|
|
2107
|
+
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2108
|
+
] }) : /* @__PURE__ */ jsxs27("div", { className: "flex flex-col items-center gap-2", children: [
|
|
2109
|
+
/* @__PURE__ */ jsx31(IconUpload, { size: 20 }),
|
|
2110
|
+
/* @__PURE__ */ jsx31("span", { className: "body-1", children: "\u0E04\u0E25\u0E34\u0E01\u0E2B\u0E23\u0E37\u0E2D\u0E25\u0E32\u0E01\u0E44\u0E1F\u0E25\u0E4C\u0E21\u0E32\u0E17\u0E35\u0E48\u0E1A\u0E23\u0E34\u0E40\u0E27\u0E13\u0E19\u0E35\u0E49\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14" }),
|
|
2111
|
+
/* @__PURE__ */ jsx31("span", { className: "text-gray-400 body-3", children: "\u0E23\u0E2D\u0E07\u0E23\u0E31\u0E1A\u0E01\u0E32\u0E23\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14\u0E41\u0E1A\u0E1A\u0E40\u0E14\u0E35\u0E48\u0E22\u0E27\u0E2B\u0E23\u0E37\u0E2D\u0E2B\u0E25\u0E32\u0E22\u0E44\u0E1F\u0E25\u0E4C" })
|
|
2112
|
+
] })
|
|
2113
|
+
}
|
|
2114
|
+
),
|
|
2115
|
+
/* @__PURE__ */ jsx31(
|
|
2116
|
+
"input",
|
|
2117
|
+
{
|
|
2118
|
+
type: "file",
|
|
2119
|
+
multiple: true,
|
|
2120
|
+
ref: inputRef,
|
|
2121
|
+
onChange: handleUpload,
|
|
2122
|
+
style: { display: "none" },
|
|
2123
|
+
accept: accept?.join(","),
|
|
2124
|
+
disabled
|
|
2125
|
+
}
|
|
2126
|
+
)
|
|
2127
|
+
] }),
|
|
2128
|
+
description && /* @__PURE__ */ jsx31("p", { className: "text-gray-400 body-4", children: description }),
|
|
2129
|
+
/* @__PURE__ */ jsx31("div", { className: "mt-[8px]", children: fileList.length !== 0 && fileList.map((file, index) => /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2 rounded-[4px] px-[8px] py-[4px] body-1", children: [
|
|
2130
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2 w-[75%] overflow-hidden", children: [
|
|
2131
|
+
/* @__PURE__ */ jsx31("div", { className: "w-[15px] h-[15px]", children: /* @__PURE__ */ jsx31(IconPaperclip, { size: 15 }) }),
|
|
2132
|
+
/* @__PURE__ */ jsx31("span", { className: "truncate", children: file.name })
|
|
2133
|
+
] }),
|
|
2134
|
+
/* @__PURE__ */ jsx31(
|
|
2135
|
+
IconTrash,
|
|
2136
|
+
{
|
|
2137
|
+
size: 20,
|
|
2138
|
+
className: "ml-auto hover:text-red-500 cursor-pointer",
|
|
2139
|
+
onClick: () => handleRemoveFile(index)
|
|
2140
|
+
}
|
|
2141
|
+
)
|
|
2142
|
+
] }, index)) })
|
|
380
2143
|
] });
|
|
381
2144
|
}
|
|
2145
|
+
|
|
2146
|
+
// src/Message/Message/Message.tsx
|
|
2147
|
+
var messageApi = null;
|
|
2148
|
+
function setMessageApi(api) {
|
|
2149
|
+
messageApi = api;
|
|
2150
|
+
}
|
|
2151
|
+
function messageSuccess(content) {
|
|
2152
|
+
messageApi?.success({ content, className: "message message-success" });
|
|
2153
|
+
}
|
|
2154
|
+
function messageError(content) {
|
|
2155
|
+
messageApi?.error({ content, className: "message message-error" });
|
|
2156
|
+
}
|
|
2157
|
+
function messageWarning(content) {
|
|
2158
|
+
messageApi?.warning({ content, className: "message message-warning" });
|
|
2159
|
+
}
|
|
2160
|
+
function messageInfo(content) {
|
|
2161
|
+
messageApi?.info({ content, className: "message message-info" });
|
|
2162
|
+
}
|
|
2163
|
+
function messageLoading(content, duration) {
|
|
2164
|
+
messageApi?.loading({ content, duration, className: "message message-loading" });
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
// src/Breadcrumb/Breadcrumb.tsx
|
|
2168
|
+
import { ConfigProvider as ConfigProvider13 } from "antd";
|
|
2169
|
+
import { Breadcrumb } from "antd";
|
|
2170
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
2171
|
+
function Breadcrumbs({
|
|
2172
|
+
items,
|
|
2173
|
+
separator,
|
|
2174
|
+
itemRender,
|
|
2175
|
+
classname,
|
|
2176
|
+
params
|
|
2177
|
+
}) {
|
|
2178
|
+
return /* @__PURE__ */ jsx32(
|
|
2179
|
+
ConfigProvider13,
|
|
2180
|
+
{
|
|
2181
|
+
theme: {
|
|
2182
|
+
token: {
|
|
2183
|
+
fontFamily: "Kanit"
|
|
2184
|
+
}
|
|
2185
|
+
},
|
|
2186
|
+
children: /* @__PURE__ */ jsx32(
|
|
2187
|
+
Breadcrumb,
|
|
2188
|
+
{
|
|
2189
|
+
items,
|
|
2190
|
+
separator,
|
|
2191
|
+
itemRender,
|
|
2192
|
+
className: classname,
|
|
2193
|
+
params
|
|
2194
|
+
}
|
|
2195
|
+
)
|
|
2196
|
+
}
|
|
2197
|
+
);
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
// src/HeadingPage/HeadingPage.tsx
|
|
2201
|
+
import { ConfigProvider as ConfigProvider14 } from "antd";
|
|
2202
|
+
import { jsx as jsx33, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
2203
|
+
function HeadingPage({ Heading }) {
|
|
2204
|
+
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
|
|
2205
|
+
weekday: "long",
|
|
2206
|
+
day: "numeric",
|
|
2207
|
+
month: "long",
|
|
2208
|
+
year: "numeric"
|
|
2209
|
+
});
|
|
2210
|
+
return /* @__PURE__ */ jsx33(
|
|
2211
|
+
ConfigProvider14,
|
|
2212
|
+
{
|
|
2213
|
+
theme: {
|
|
2214
|
+
token: {
|
|
2215
|
+
fontFamily: "Kanit"
|
|
2216
|
+
}
|
|
2217
|
+
},
|
|
2218
|
+
children: /* @__PURE__ */ jsxs28("div", { className: "flex flex-col gap-[10px] px-[20px] py-[10px]", children: [
|
|
2219
|
+
/* @__PURE__ */ jsx33("p", { className: "headline-5", children: Heading }),
|
|
2220
|
+
/* @__PURE__ */ jsxs28("p", { className: "body-1", children: [
|
|
2221
|
+
" \u0E27\u0E31\u0E19\u0E19\u0E35\u0E49 ",
|
|
2222
|
+
today
|
|
2223
|
+
] })
|
|
2224
|
+
] })
|
|
2225
|
+
}
|
|
2226
|
+
);
|
|
2227
|
+
}
|
|
2228
|
+
|
|
2229
|
+
// src/Progress/ProgressBar.tsx
|
|
2230
|
+
import { ConfigProvider as ConfigProvider15, Progress } from "antd";
|
|
2231
|
+
import { useEffect as useEffect2, useRef as useRef3, useState as useState9 } from "react";
|
|
2232
|
+
import { jsx as jsx34, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
2233
|
+
function ProgressBar({
|
|
2234
|
+
percent = 0,
|
|
2235
|
+
size = "default",
|
|
2236
|
+
checkpoints = [],
|
|
2237
|
+
showInfo,
|
|
2238
|
+
trailColor = "#DBE0E5",
|
|
2239
|
+
type,
|
|
2240
|
+
strokeLinecap,
|
|
2241
|
+
strokeWidth,
|
|
2242
|
+
steps,
|
|
2243
|
+
isCheckPoints
|
|
2244
|
+
}) {
|
|
2245
|
+
const [barWidth, setBarWidth] = useState9(0);
|
|
2246
|
+
const progressRef = useRef3(null);
|
|
2247
|
+
let strokeColor = "--color-green-500";
|
|
2248
|
+
const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
|
|
2249
|
+
const defaultSize = type === "circle" ? 43 : size;
|
|
2250
|
+
if (percent < 100 && checkpoints.length > 0) {
|
|
2251
|
+
const minCheckpoint = Math.min(...checkpoints);
|
|
2252
|
+
strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
|
|
2253
|
+
}
|
|
2254
|
+
useEffect2(() => {
|
|
2255
|
+
const inner = progressRef.current?.querySelector(
|
|
2256
|
+
".ant-progress-inner"
|
|
2257
|
+
);
|
|
2258
|
+
if (!inner) return;
|
|
2259
|
+
const observer = new ResizeObserver(() => {
|
|
2260
|
+
setBarWidth(inner.offsetWidth);
|
|
2261
|
+
});
|
|
2262
|
+
observer.observe(inner);
|
|
2263
|
+
return () => observer.disconnect();
|
|
2264
|
+
}, []);
|
|
2265
|
+
return /* @__PURE__ */ jsx34(
|
|
2266
|
+
ConfigProvider15,
|
|
2267
|
+
{
|
|
2268
|
+
theme: {
|
|
2269
|
+
token: {
|
|
2270
|
+
fontFamily: "Kanit"
|
|
2271
|
+
}
|
|
2272
|
+
},
|
|
2273
|
+
children: /* @__PURE__ */ jsxs29("div", { className: "relative w-full", ref: progressRef, children: [
|
|
2274
|
+
/* @__PURE__ */ jsx34(
|
|
2275
|
+
Progress,
|
|
2276
|
+
{
|
|
2277
|
+
className: "w-full",
|
|
2278
|
+
percent,
|
|
2279
|
+
size: defaultSize,
|
|
2280
|
+
type,
|
|
2281
|
+
showInfo,
|
|
2282
|
+
trailColor,
|
|
2283
|
+
format: (percent2) => `${percent2}%`,
|
|
2284
|
+
strokeLinecap,
|
|
2285
|
+
strokeWidth: defaultStrokeWidth,
|
|
2286
|
+
steps,
|
|
2287
|
+
strokeColor
|
|
2288
|
+
}
|
|
2289
|
+
),
|
|
2290
|
+
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ jsx34(
|
|
2291
|
+
"div",
|
|
2292
|
+
{
|
|
2293
|
+
className: "checkpoint absolute top-0",
|
|
2294
|
+
style: {
|
|
2295
|
+
left: `${cp / 100 * barWidth}px`,
|
|
2296
|
+
width: 0,
|
|
2297
|
+
height: 0,
|
|
2298
|
+
borderLeft: "6px solid transparent",
|
|
2299
|
+
borderRight: "6px solid transparent",
|
|
2300
|
+
borderTop: "10px solid red",
|
|
2301
|
+
transform: "translateX(-50%)"
|
|
2302
|
+
}
|
|
2303
|
+
},
|
|
2304
|
+
cp
|
|
2305
|
+
))
|
|
2306
|
+
] })
|
|
2307
|
+
}
|
|
2308
|
+
);
|
|
2309
|
+
}
|
|
382
2310
|
export {
|
|
2311
|
+
AntDataTable,
|
|
2312
|
+
Breadcrumbs,
|
|
383
2313
|
Calendar,
|
|
384
2314
|
Checkbox,
|
|
385
2315
|
CheckboxGroup,
|
|
2316
|
+
ColorPickerBasic,
|
|
386
2317
|
DataTable,
|
|
2318
|
+
DatePickerBasic,
|
|
2319
|
+
DatePickerRangePicker,
|
|
2320
|
+
FileUploader,
|
|
387
2321
|
GhostButton,
|
|
2322
|
+
HeadingPage,
|
|
2323
|
+
InputField,
|
|
388
2324
|
Loader,
|
|
389
2325
|
MenuNavBar,
|
|
390
2326
|
PrimaryButton,
|
|
2327
|
+
ProgressBar,
|
|
391
2328
|
Radio,
|
|
392
2329
|
RadioGroup,
|
|
393
2330
|
SecondaryButton,
|
|
2331
|
+
SelectField,
|
|
2332
|
+
SelectFieldGroup,
|
|
2333
|
+
SelectFieldStatus,
|
|
2334
|
+
SelectFieldStatusReport,
|
|
2335
|
+
SelectFieldTag,
|
|
2336
|
+
Sidebar,
|
|
2337
|
+
SortFilter,
|
|
394
2338
|
Switch,
|
|
2339
|
+
TextAreaInput,
|
|
395
2340
|
TextInput,
|
|
396
|
-
|
|
2341
|
+
TimePickerBasic,
|
|
2342
|
+
TimePickerRangePicker,
|
|
2343
|
+
TopNavBar,
|
|
2344
|
+
messageError,
|
|
2345
|
+
messageInfo,
|
|
2346
|
+
messageLoading,
|
|
2347
|
+
messageSuccess,
|
|
2348
|
+
messageWarning,
|
|
2349
|
+
setMessageApi
|
|
397
2350
|
};
|