@esic-lab/data-core-ui 0.0.35 → 0.0.37
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.cjs +4084 -0
- package/dist/index.d.cts +573 -0
- package/dist/index.d.mts +1 -63
- package/dist/index.d.ts +1 -63
- package/dist/index.js +242 -988
- package/dist/index.mjs +225 -990
- package/package.json +2 -10
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,4084 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all)
|
|
13
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from))
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
19
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// node_modules/dayjs/dayjs.min.js
|
|
34
|
+
var require_dayjs_min = __commonJS({
|
|
35
|
+
"node_modules/dayjs/dayjs.min.js"(exports2, module2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
!(function(t, e) {
|
|
38
|
+
"object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs = e();
|
|
39
|
+
})(exports2, (function() {
|
|
40
|
+
"use strict";
|
|
41
|
+
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) {
|
|
42
|
+
var e2 = ["th", "st", "nd", "rd"], n2 = t2 % 100;
|
|
43
|
+
return "[" + t2 + (e2[(n2 - 20) % 10] || e2[n2] || e2[0]) + "]";
|
|
44
|
+
} }, m = function(t2, e2, n2) {
|
|
45
|
+
var r2 = String(t2);
|
|
46
|
+
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
|
|
47
|
+
}, v = { s: m, z: function(t2) {
|
|
48
|
+
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
|
|
49
|
+
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
|
|
50
|
+
}, m: function t2(e2, n2) {
|
|
51
|
+
if (e2.date() < n2.date()) return -t2(n2, e2);
|
|
52
|
+
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);
|
|
53
|
+
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
|
|
54
|
+
}, a: function(t2) {
|
|
55
|
+
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
|
|
56
|
+
}, p: function(t2) {
|
|
57
|
+
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$/, "");
|
|
58
|
+
}, u: function(t2) {
|
|
59
|
+
return void 0 === t2;
|
|
60
|
+
} }, g = "en", D = {};
|
|
61
|
+
D[g] = M;
|
|
62
|
+
var p = "$isDayjsObject", S = function(t2) {
|
|
63
|
+
return t2 instanceof _ || !(!t2 || !t2[p]);
|
|
64
|
+
}, w = function t2(e2, n2, r2) {
|
|
65
|
+
var i2;
|
|
66
|
+
if (!e2) return g;
|
|
67
|
+
if ("string" == typeof e2) {
|
|
68
|
+
var s2 = e2.toLowerCase();
|
|
69
|
+
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
|
|
70
|
+
var u2 = e2.split("-");
|
|
71
|
+
if (!i2 && u2.length > 1) return t2(u2[0]);
|
|
72
|
+
} else {
|
|
73
|
+
var a2 = e2.name;
|
|
74
|
+
D[a2] = e2, i2 = a2;
|
|
75
|
+
}
|
|
76
|
+
return !r2 && i2 && (g = i2), i2 || !r2 && g;
|
|
77
|
+
}, O = function(t2, e2) {
|
|
78
|
+
if (S(t2)) return t2.clone();
|
|
79
|
+
var n2 = "object" == typeof e2 ? e2 : {};
|
|
80
|
+
return n2.date = t2, n2.args = arguments, new _(n2);
|
|
81
|
+
}, b = v;
|
|
82
|
+
b.l = w, b.i = S, b.w = function(t2, e2) {
|
|
83
|
+
return O(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
|
|
84
|
+
};
|
|
85
|
+
var _ = (function() {
|
|
86
|
+
function M2(t2) {
|
|
87
|
+
this.$L = w(t2.locale, null, true), this.parse(t2), this.$x = this.$x || t2.x || {}, this[p] = true;
|
|
88
|
+
}
|
|
89
|
+
var m2 = M2.prototype;
|
|
90
|
+
return m2.parse = function(t2) {
|
|
91
|
+
this.$d = (function(t3) {
|
|
92
|
+
var e2 = t3.date, n2 = t3.utc;
|
|
93
|
+
if (null === e2) return /* @__PURE__ */ new Date(NaN);
|
|
94
|
+
if (b.u(e2)) return /* @__PURE__ */ new Date();
|
|
95
|
+
if (e2 instanceof Date) return new Date(e2);
|
|
96
|
+
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
|
|
97
|
+
var r2 = e2.match($);
|
|
98
|
+
if (r2) {
|
|
99
|
+
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
|
|
100
|
+
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);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return new Date(e2);
|
|
104
|
+
})(t2), this.init();
|
|
105
|
+
}, m2.init = function() {
|
|
106
|
+
var t2 = this.$d;
|
|
107
|
+
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();
|
|
108
|
+
}, m2.$utils = function() {
|
|
109
|
+
return b;
|
|
110
|
+
}, m2.isValid = function() {
|
|
111
|
+
return !(this.$d.toString() === l);
|
|
112
|
+
}, m2.isSame = function(t2, e2) {
|
|
113
|
+
var n2 = O(t2);
|
|
114
|
+
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
|
|
115
|
+
}, m2.isAfter = function(t2, e2) {
|
|
116
|
+
return O(t2) < this.startOf(e2);
|
|
117
|
+
}, m2.isBefore = function(t2, e2) {
|
|
118
|
+
return this.endOf(e2) < O(t2);
|
|
119
|
+
}, m2.$g = function(t2, e2, n2) {
|
|
120
|
+
return b.u(t2) ? this[e2] : this.set(n2, t2);
|
|
121
|
+
}, m2.unix = function() {
|
|
122
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
123
|
+
}, m2.valueOf = function() {
|
|
124
|
+
return this.$d.getTime();
|
|
125
|
+
}, m2.startOf = function(t2, e2) {
|
|
126
|
+
var n2 = this, r2 = !!b.u(e2) || e2, f2 = b.p(t2), l2 = function(t3, e3) {
|
|
127
|
+
var i2 = b.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
|
|
128
|
+
return r2 ? i2 : i2.endOf(a);
|
|
129
|
+
}, $2 = function(t3, e3) {
|
|
130
|
+
return b.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
|
|
131
|
+
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, v2 = "set" + (this.$u ? "UTC" : "");
|
|
132
|
+
switch (f2) {
|
|
133
|
+
case h:
|
|
134
|
+
return r2 ? l2(1, 0) : l2(31, 11);
|
|
135
|
+
case c:
|
|
136
|
+
return r2 ? l2(1, M3) : l2(0, M3 + 1);
|
|
137
|
+
case o:
|
|
138
|
+
var g2 = this.$locale().weekStart || 0, D2 = (y2 < g2 ? y2 + 7 : y2) - g2;
|
|
139
|
+
return l2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
|
|
140
|
+
case a:
|
|
141
|
+
case d:
|
|
142
|
+
return $2(v2 + "Hours", 0);
|
|
143
|
+
case u:
|
|
144
|
+
return $2(v2 + "Minutes", 1);
|
|
145
|
+
case s:
|
|
146
|
+
return $2(v2 + "Seconds", 2);
|
|
147
|
+
case i:
|
|
148
|
+
return $2(v2 + "Milliseconds", 3);
|
|
149
|
+
default:
|
|
150
|
+
return this.clone();
|
|
151
|
+
}
|
|
152
|
+
}, m2.endOf = function(t2) {
|
|
153
|
+
return this.startOf(t2, false);
|
|
154
|
+
}, m2.$set = function(t2, e2) {
|
|
155
|
+
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;
|
|
156
|
+
if (o2 === c || o2 === h) {
|
|
157
|
+
var y2 = this.clone().set(d, 1);
|
|
158
|
+
y2.$d[l2]($2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
|
|
159
|
+
} else l2 && this.$d[l2]($2);
|
|
160
|
+
return this.init(), this;
|
|
161
|
+
}, m2.set = function(t2, e2) {
|
|
162
|
+
return this.clone().$set(t2, e2);
|
|
163
|
+
}, m2.get = function(t2) {
|
|
164
|
+
return this[b.p(t2)]();
|
|
165
|
+
}, m2.add = function(r2, f2) {
|
|
166
|
+
var d2, l2 = this;
|
|
167
|
+
r2 = Number(r2);
|
|
168
|
+
var $2 = b.p(f2), y2 = function(t2) {
|
|
169
|
+
var e2 = O(l2);
|
|
170
|
+
return b.w(e2.date(e2.date() + Math.round(t2 * r2)), l2);
|
|
171
|
+
};
|
|
172
|
+
if ($2 === c) return this.set(c, this.$M + r2);
|
|
173
|
+
if ($2 === h) return this.set(h, this.$y + r2);
|
|
174
|
+
if ($2 === a) return y2(1);
|
|
175
|
+
if ($2 === o) return y2(7);
|
|
176
|
+
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[$2] || 1, m3 = this.$d.getTime() + r2 * M3;
|
|
177
|
+
return b.w(m3, this);
|
|
178
|
+
}, m2.subtract = function(t2, e2) {
|
|
179
|
+
return this.add(-1 * t2, e2);
|
|
180
|
+
}, m2.format = function(t2) {
|
|
181
|
+
var e2 = this, n2 = this.$locale();
|
|
182
|
+
if (!this.isValid()) return n2.invalidDate || l;
|
|
183
|
+
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) {
|
|
184
|
+
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].slice(0, s3);
|
|
185
|
+
}, d2 = function(t3) {
|
|
186
|
+
return b.s(s2 % 12 || 12, t3, "0");
|
|
187
|
+
}, $2 = f2 || function(t3, e3, n3) {
|
|
188
|
+
var r3 = t3 < 12 ? "AM" : "PM";
|
|
189
|
+
return n3 ? r3.toLowerCase() : r3;
|
|
190
|
+
};
|
|
191
|
+
return r2.replace(y, (function(t3, r3) {
|
|
192
|
+
return r3 || (function(t4) {
|
|
193
|
+
switch (t4) {
|
|
194
|
+
case "YY":
|
|
195
|
+
return String(e2.$y).slice(-2);
|
|
196
|
+
case "YYYY":
|
|
197
|
+
return b.s(e2.$y, 4, "0");
|
|
198
|
+
case "M":
|
|
199
|
+
return a2 + 1;
|
|
200
|
+
case "MM":
|
|
201
|
+
return b.s(a2 + 1, 2, "0");
|
|
202
|
+
case "MMM":
|
|
203
|
+
return h2(n2.monthsShort, a2, c2, 3);
|
|
204
|
+
case "MMMM":
|
|
205
|
+
return h2(c2, a2);
|
|
206
|
+
case "D":
|
|
207
|
+
return e2.$D;
|
|
208
|
+
case "DD":
|
|
209
|
+
return b.s(e2.$D, 2, "0");
|
|
210
|
+
case "d":
|
|
211
|
+
return String(e2.$W);
|
|
212
|
+
case "dd":
|
|
213
|
+
return h2(n2.weekdaysMin, e2.$W, o2, 2);
|
|
214
|
+
case "ddd":
|
|
215
|
+
return h2(n2.weekdaysShort, e2.$W, o2, 3);
|
|
216
|
+
case "dddd":
|
|
217
|
+
return o2[e2.$W];
|
|
218
|
+
case "H":
|
|
219
|
+
return String(s2);
|
|
220
|
+
case "HH":
|
|
221
|
+
return b.s(s2, 2, "0");
|
|
222
|
+
case "h":
|
|
223
|
+
return d2(1);
|
|
224
|
+
case "hh":
|
|
225
|
+
return d2(2);
|
|
226
|
+
case "a":
|
|
227
|
+
return $2(s2, u2, true);
|
|
228
|
+
case "A":
|
|
229
|
+
return $2(s2, u2, false);
|
|
230
|
+
case "m":
|
|
231
|
+
return String(u2);
|
|
232
|
+
case "mm":
|
|
233
|
+
return b.s(u2, 2, "0");
|
|
234
|
+
case "s":
|
|
235
|
+
return String(e2.$s);
|
|
236
|
+
case "ss":
|
|
237
|
+
return b.s(e2.$s, 2, "0");
|
|
238
|
+
case "SSS":
|
|
239
|
+
return b.s(e2.$ms, 3, "0");
|
|
240
|
+
case "Z":
|
|
241
|
+
return i2;
|
|
242
|
+
}
|
|
243
|
+
return null;
|
|
244
|
+
})(t3) || i2.replace(":", "");
|
|
245
|
+
}));
|
|
246
|
+
}, m2.utcOffset = function() {
|
|
247
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
248
|
+
}, m2.diff = function(r2, d2, l2) {
|
|
249
|
+
var $2, y2 = this, M3 = b.p(d2), m3 = O(r2), v2 = (m3.utcOffset() - this.utcOffset()) * e, g2 = this - m3, D2 = function() {
|
|
250
|
+
return b.m(y2, m3);
|
|
251
|
+
};
|
|
252
|
+
switch (M3) {
|
|
253
|
+
case h:
|
|
254
|
+
$2 = D2() / 12;
|
|
255
|
+
break;
|
|
256
|
+
case c:
|
|
257
|
+
$2 = D2();
|
|
258
|
+
break;
|
|
259
|
+
case f:
|
|
260
|
+
$2 = D2() / 3;
|
|
261
|
+
break;
|
|
262
|
+
case o:
|
|
263
|
+
$2 = (g2 - v2) / 6048e5;
|
|
264
|
+
break;
|
|
265
|
+
case a:
|
|
266
|
+
$2 = (g2 - v2) / 864e5;
|
|
267
|
+
break;
|
|
268
|
+
case u:
|
|
269
|
+
$2 = g2 / n;
|
|
270
|
+
break;
|
|
271
|
+
case s:
|
|
272
|
+
$2 = g2 / e;
|
|
273
|
+
break;
|
|
274
|
+
case i:
|
|
275
|
+
$2 = g2 / t;
|
|
276
|
+
break;
|
|
277
|
+
default:
|
|
278
|
+
$2 = g2;
|
|
279
|
+
}
|
|
280
|
+
return l2 ? $2 : b.a($2);
|
|
281
|
+
}, m2.daysInMonth = function() {
|
|
282
|
+
return this.endOf(c).$D;
|
|
283
|
+
}, m2.$locale = function() {
|
|
284
|
+
return D[this.$L];
|
|
285
|
+
}, m2.locale = function(t2, e2) {
|
|
286
|
+
if (!t2) return this.$L;
|
|
287
|
+
var n2 = this.clone(), r2 = w(t2, e2, true);
|
|
288
|
+
return r2 && (n2.$L = r2), n2;
|
|
289
|
+
}, m2.clone = function() {
|
|
290
|
+
return b.w(this.$d, this);
|
|
291
|
+
}, m2.toDate = function() {
|
|
292
|
+
return new Date(this.valueOf());
|
|
293
|
+
}, m2.toJSON = function() {
|
|
294
|
+
return this.isValid() ? this.toISOString() : null;
|
|
295
|
+
}, m2.toISOString = function() {
|
|
296
|
+
return this.$d.toISOString();
|
|
297
|
+
}, m2.toString = function() {
|
|
298
|
+
return this.$d.toUTCString();
|
|
299
|
+
}, M2;
|
|
300
|
+
})(), k = _.prototype;
|
|
301
|
+
return O.prototype = k, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", c], ["$y", h], ["$D", d]].forEach((function(t2) {
|
|
302
|
+
k[t2[1]] = function(e2) {
|
|
303
|
+
return this.$g(e2, t2[0], t2[1]);
|
|
304
|
+
};
|
|
305
|
+
})), O.extend = function(t2, e2) {
|
|
306
|
+
return t2.$i || (t2(e2, _, O), t2.$i = true), O;
|
|
307
|
+
}, O.locale = w, O.isDayjs = S, O.unix = function(t2) {
|
|
308
|
+
return O(1e3 * t2);
|
|
309
|
+
}, O.en = D[g], O.Ls = D, O.p = {}, O;
|
|
310
|
+
}));
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
// node_modules/dayjs/locale/th.js
|
|
315
|
+
var require_th = __commonJS({
|
|
316
|
+
"node_modules/dayjs/locale/th.js"(exports2, module2) {
|
|
317
|
+
"use strict";
|
|
318
|
+
!(function(_, e) {
|
|
319
|
+
"object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e(require_dayjs_min()) : "function" == typeof define && define.amd ? define(["dayjs"], e) : (_ = "undefined" != typeof globalThis ? globalThis : _ || self).dayjs_locale_th = e(_.dayjs);
|
|
320
|
+
})(exports2, (function(_) {
|
|
321
|
+
"use strict";
|
|
322
|
+
function e(_2) {
|
|
323
|
+
return _2 && "object" == typeof _2 && "default" in _2 ? _2 : { default: _2 };
|
|
324
|
+
}
|
|
325
|
+
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) {
|
|
326
|
+
return _2 + ".";
|
|
327
|
+
} };
|
|
328
|
+
return t.default.locale(d, null, true), d;
|
|
329
|
+
}));
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
// node_modules/dayjs/plugin/buddhistEra.js
|
|
334
|
+
var require_buddhistEra = __commonJS({
|
|
335
|
+
"node_modules/dayjs/plugin/buddhistEra.js"(exports2, module2) {
|
|
336
|
+
"use strict";
|
|
337
|
+
!(function(t, e) {
|
|
338
|
+
"object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).dayjs_plugin_buddhistEra = e();
|
|
339
|
+
})(exports2, (function() {
|
|
340
|
+
"use strict";
|
|
341
|
+
return function(t, e) {
|
|
342
|
+
var n = e.prototype, i = n.format;
|
|
343
|
+
n.format = function(t2) {
|
|
344
|
+
var e2 = this, n2 = (t2 || "YYYY-MM-DDTHH:mm:ssZ").replace(/(\[[^\]]+])|BBBB|BB/g, (function(t3, n3) {
|
|
345
|
+
var i2, o = String(e2.$y + 543), f = "BB" === t3 ? [o.slice(-2), 2] : [o, 4];
|
|
346
|
+
return n3 || (i2 = e2.$utils()).s.apply(i2, f.concat(["0"]));
|
|
347
|
+
}));
|
|
348
|
+
return i.bind(this)(n2);
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
}));
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
// node_modules/dayjs/plugin/customParseFormat.js
|
|
356
|
+
var require_customParseFormat = __commonJS({
|
|
357
|
+
"node_modules/dayjs/plugin/customParseFormat.js"(exports2, module2) {
|
|
358
|
+
"use strict";
|
|
359
|
+
!(function(e, t) {
|
|
360
|
+
"object" == typeof exports2 && "undefined" != typeof module2 ? module2.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = "undefined" != typeof globalThis ? globalThis : e || self).dayjs_plugin_customParseFormat = t();
|
|
361
|
+
})(exports2, (function() {
|
|
362
|
+
"use strict";
|
|
363
|
+
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) {
|
|
364
|
+
return (e2 = +e2) + (e2 > 68 ? 1900 : 2e3);
|
|
365
|
+
};
|
|
366
|
+
var f = function(e2) {
|
|
367
|
+
return function(t2) {
|
|
368
|
+
this[e2] = +t2;
|
|
369
|
+
};
|
|
370
|
+
}, h = [/[+-]\d\d:?(\d\d)?|Z/, function(e2) {
|
|
371
|
+
(this.zone || (this.zone = {})).offset = (function(e3) {
|
|
372
|
+
if (!e3) return 0;
|
|
373
|
+
if ("Z" === e3) return 0;
|
|
374
|
+
var t2 = e3.match(/([+-]|\d\d)/g), n2 = 60 * t2[1] + (+t2[2] || 0);
|
|
375
|
+
return 0 === n2 ? 0 : "+" === t2[0] ? -n2 : n2;
|
|
376
|
+
})(e2);
|
|
377
|
+
}], u = function(e2) {
|
|
378
|
+
var t2 = s[e2];
|
|
379
|
+
return t2 && (t2.indexOf ? t2 : t2.s.concat(t2.f));
|
|
380
|
+
}, d = function(e2, t2) {
|
|
381
|
+
var n2, r2 = s.meridiem;
|
|
382
|
+
if (r2) {
|
|
383
|
+
for (var i2 = 1; i2 <= 24; i2 += 1) if (e2.indexOf(r2(i2, 0, t2)) > -1) {
|
|
384
|
+
n2 = i2 > 12;
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
} else n2 = e2 === (t2 ? "pm" : "PM");
|
|
388
|
+
return n2;
|
|
389
|
+
}, c = { A: [o, function(e2) {
|
|
390
|
+
this.afternoon = d(e2, false);
|
|
391
|
+
}], a: [o, function(e2) {
|
|
392
|
+
this.afternoon = d(e2, true);
|
|
393
|
+
}], Q: [n, function(e2) {
|
|
394
|
+
this.month = 3 * (e2 - 1) + 1;
|
|
395
|
+
}], S: [n, function(e2) {
|
|
396
|
+
this.milliseconds = 100 * +e2;
|
|
397
|
+
}], SS: [r, function(e2) {
|
|
398
|
+
this.milliseconds = 10 * +e2;
|
|
399
|
+
}], SSS: [/\d{3}/, function(e2) {
|
|
400
|
+
this.milliseconds = +e2;
|
|
401
|
+
}], 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) {
|
|
402
|
+
var t2 = s.ordinal, n2 = e2.match(/\d+/);
|
|
403
|
+
if (this.day = n2[0], t2) for (var r2 = 1; r2 <= 31; r2 += 1) t2(r2).replace(/\[|\]/g, "") === e2 && (this.day = r2);
|
|
404
|
+
}], w: [i, f("week")], ww: [r, f("week")], M: [i, f("month")], MM: [r, f("month")], MMM: [o, function(e2) {
|
|
405
|
+
var t2 = u("months"), n2 = (u("monthsShort") || t2.map((function(e3) {
|
|
406
|
+
return e3.slice(0, 3);
|
|
407
|
+
}))).indexOf(e2) + 1;
|
|
408
|
+
if (n2 < 1) throw new Error();
|
|
409
|
+
this.month = n2 % 12 || n2;
|
|
410
|
+
}], MMMM: [o, function(e2) {
|
|
411
|
+
var t2 = u("months").indexOf(e2) + 1;
|
|
412
|
+
if (t2 < 1) throw new Error();
|
|
413
|
+
this.month = t2 % 12 || t2;
|
|
414
|
+
}], Y: [/[+-]?\d+/, f("year")], YY: [r, function(e2) {
|
|
415
|
+
this.year = a(e2);
|
|
416
|
+
}], YYYY: [/\d{4}/, f("year")], Z: h, ZZ: h };
|
|
417
|
+
function l(n2) {
|
|
418
|
+
var r2, i2;
|
|
419
|
+
r2 = n2, i2 = s && s.formats;
|
|
420
|
+
for (var o2 = (n2 = r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(t2, n3, r3) {
|
|
421
|
+
var o3 = r3 && r3.toUpperCase();
|
|
422
|
+
return n3 || i2[r3] || e[r3] || i2[o3].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (function(e2, t3, n4) {
|
|
423
|
+
return t3 || n4.slice(1);
|
|
424
|
+
}));
|
|
425
|
+
}))).match(t), a2 = o2.length, f2 = 0; f2 < a2; f2 += 1) {
|
|
426
|
+
var h2 = o2[f2], u2 = c[h2], d2 = u2 && u2[0], l2 = u2 && u2[1];
|
|
427
|
+
o2[f2] = l2 ? { regex: d2, parser: l2 } : h2.replace(/^\[|\]$/g, "");
|
|
428
|
+
}
|
|
429
|
+
return function(e2) {
|
|
430
|
+
for (var t2 = {}, n3 = 0, r3 = 0; n3 < a2; n3 += 1) {
|
|
431
|
+
var i3 = o2[n3];
|
|
432
|
+
if ("string" == typeof i3) r3 += i3.length;
|
|
433
|
+
else {
|
|
434
|
+
var s2 = i3.regex, f3 = i3.parser, h3 = e2.slice(r3), u3 = s2.exec(h3)[0];
|
|
435
|
+
f3.call(t2, u3), e2 = e2.replace(u3, "");
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
return (function(e3) {
|
|
439
|
+
var t3 = e3.afternoon;
|
|
440
|
+
if (void 0 !== t3) {
|
|
441
|
+
var n4 = e3.hours;
|
|
442
|
+
t3 ? n4 < 12 && (e3.hours += 12) : 12 === n4 && (e3.hours = 0), delete e3.afternoon;
|
|
443
|
+
}
|
|
444
|
+
})(t2), t2;
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
return function(e2, t2, n2) {
|
|
448
|
+
n2.p.customParseFormat = true, e2 && e2.parseTwoDigitYear && (a = e2.parseTwoDigitYear);
|
|
449
|
+
var r2 = t2.prototype, i2 = r2.parse;
|
|
450
|
+
r2.parse = function(e3) {
|
|
451
|
+
var t3 = e3.date, r3 = e3.utc, o2 = e3.args;
|
|
452
|
+
this.$u = r3;
|
|
453
|
+
var a2 = o2[1];
|
|
454
|
+
if ("string" == typeof a2) {
|
|
455
|
+
var f2 = true === o2[2], h2 = true === o2[3], u2 = f2 || h2, d2 = o2[2];
|
|
456
|
+
h2 && (d2 = o2[2]), s = this.$locale(), !f2 && d2 && (s = n2.Ls[d2]), this.$d = (function(e4, t4, n3, r4) {
|
|
457
|
+
try {
|
|
458
|
+
if (["x", "X"].indexOf(t4) > -1) return new Date(("X" === t4 ? 1e3 : 1) * e4);
|
|
459
|
+
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;
|
|
460
|
+
o3 && !s2 || (v = s2 > 0 ? s2 - 1 : M2.getMonth());
|
|
461
|
+
var D, w = f3 || 0, g = h3 || 0, y = u3 || 0, L = d3 || 0;
|
|
462
|
+
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);
|
|
463
|
+
} catch (e5) {
|
|
464
|
+
return /* @__PURE__ */ new Date("");
|
|
465
|
+
}
|
|
466
|
+
})(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 = {};
|
|
467
|
+
} else if (a2 instanceof Array) for (var c2 = a2.length, m = 1; m <= c2; m += 1) {
|
|
468
|
+
o2[1] = a2[m - 1];
|
|
469
|
+
var M = n2.apply(this, o2);
|
|
470
|
+
if (M.isValid()) {
|
|
471
|
+
this.$d = M.$d, this.$L = M.$L, this.init();
|
|
472
|
+
break;
|
|
473
|
+
}
|
|
474
|
+
m === c2 && (this.$d = /* @__PURE__ */ new Date(""));
|
|
475
|
+
}
|
|
476
|
+
else i2.call(this, e3);
|
|
477
|
+
};
|
|
478
|
+
};
|
|
479
|
+
}));
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
// src/index.ts
|
|
484
|
+
var index_exports = {};
|
|
485
|
+
__export(index_exports, {
|
|
486
|
+
AntDModal: () => AntDModal,
|
|
487
|
+
AntDataTable: () => AntDataTable,
|
|
488
|
+
Breadcrumbs: () => Breadcrumbs,
|
|
489
|
+
Calendar: () => Calendar,
|
|
490
|
+
Checkbox: () => Checkbox,
|
|
491
|
+
CheckboxGroup: () => CheckboxGroup,
|
|
492
|
+
ColorPalettePickerBasic: () => ColorPalettePickerBasic,
|
|
493
|
+
ColorPickerBasic: () => ColorPickerBasic,
|
|
494
|
+
DataTable: () => DataTable,
|
|
495
|
+
DatePickerBasic: () => DatePickerBasic,
|
|
496
|
+
DatePickerRangePicker: () => DatePickerRangePicker,
|
|
497
|
+
FileUploader: () => FileUploader,
|
|
498
|
+
FilterPopUp: () => FilterPopUp,
|
|
499
|
+
GhostButton: () => GhostButton,
|
|
500
|
+
HeadingPage: () => HeadingPage,
|
|
501
|
+
Indicator: () => Indicator,
|
|
502
|
+
InputField: () => InputField,
|
|
503
|
+
InputFieldNumber: () => InputFieldNumber,
|
|
504
|
+
KpiSection: () => KpiSection,
|
|
505
|
+
Loader: () => Loader,
|
|
506
|
+
MenuNavBar: () => MenuNavBar,
|
|
507
|
+
PrimaryButton: () => PrimaryButton,
|
|
508
|
+
ProgressBar: () => ProgressBar,
|
|
509
|
+
Radio: () => Radio,
|
|
510
|
+
RadioGroup: () => RadioGroup,
|
|
511
|
+
SecondaryButton: () => SecondaryButton,
|
|
512
|
+
SelectCustom: () => SelectCustom,
|
|
513
|
+
SelectField: () => SelectField,
|
|
514
|
+
SelectFieldGroup: () => SelectFieldGroup,
|
|
515
|
+
SelectFieldStatus: () => SelectFieldStatus,
|
|
516
|
+
SelectFieldStatusReport: () => SelectFieldStatusReport,
|
|
517
|
+
SelectFieldTag: () => SelectFieldTag,
|
|
518
|
+
Sidebar: () => Sidebar,
|
|
519
|
+
SortFilter: () => SortFilter,
|
|
520
|
+
Switch: () => Switch,
|
|
521
|
+
SwitchSelect: () => SwitchSelect,
|
|
522
|
+
TabSelectionButton: () => TabSelectionButton,
|
|
523
|
+
TextAreaInput: () => TextAreaInput,
|
|
524
|
+
TextInput: () => TextInput,
|
|
525
|
+
TimePickerBasic: () => TimePickerBasic,
|
|
526
|
+
TimePickerRangePicker: () => TimePickerRangePicker,
|
|
527
|
+
TopNavBar: () => TopNavBar,
|
|
528
|
+
messageError: () => messageError,
|
|
529
|
+
messageInfo: () => messageInfo,
|
|
530
|
+
messageLoading: () => messageLoading,
|
|
531
|
+
messageSuccess: () => messageSuccess,
|
|
532
|
+
messageWarning: () => messageWarning,
|
|
533
|
+
setMessageApi: () => setMessageApi
|
|
534
|
+
});
|
|
535
|
+
module.exports = __toCommonJS(index_exports);
|
|
536
|
+
|
|
537
|
+
// src/Button/PrimaryButton/PrimaryButton.tsx
|
|
538
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
539
|
+
function PrimaryButton({
|
|
540
|
+
title,
|
|
541
|
+
onClick,
|
|
542
|
+
iconLeft,
|
|
543
|
+
iconRight,
|
|
544
|
+
bgColor = "bg-primary-500",
|
|
545
|
+
textColor = "black",
|
|
546
|
+
disabled
|
|
547
|
+
}) {
|
|
548
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
549
|
+
"button",
|
|
550
|
+
{
|
|
551
|
+
onClick,
|
|
552
|
+
disabled,
|
|
553
|
+
className: `flex justify-center w-full h-[42px] rounded-[6px] p-[10px] body-1 transition
|
|
554
|
+
${disabled ? "text-gray-400 bg-gray-100 cursor-not-allowed" : `${bgColor} text-${textColor} cursor-pointer
|
|
555
|
+
hover:brightness-95 active:brightness-90`}`,
|
|
556
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex justify-center items-center gap-[10px]", children: [
|
|
557
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: iconLeft }),
|
|
558
|
+
title,
|
|
559
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: iconRight })
|
|
560
|
+
] })
|
|
561
|
+
}
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
// src/Button/SecondaryButton/SecondaryButton.tsx
|
|
566
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
567
|
+
function SecondaryButton({ title, onClick, iconLeft, iconRight, disabled }) {
|
|
568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
569
|
+
"button",
|
|
570
|
+
{
|
|
571
|
+
onClick,
|
|
572
|
+
disabled,
|
|
573
|
+
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"}`,
|
|
574
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex justify-center items-center gap-[10px]", children: [
|
|
575
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: iconLeft }),
|
|
576
|
+
title,
|
|
577
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: iconRight })
|
|
578
|
+
] })
|
|
579
|
+
}
|
|
580
|
+
);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
// src/Button/GhostButton/GhostButton.tsx
|
|
584
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
585
|
+
function GhostButton({ title, onClick, iconLeft, iconRight, disabled }) {
|
|
586
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
587
|
+
"button",
|
|
588
|
+
{
|
|
589
|
+
onClick,
|
|
590
|
+
disabled,
|
|
591
|
+
className: `flex justify-center w-full h-[42px] rounded-[6px] p-[10px] body-1 transition
|
|
592
|
+
${disabled ? "text-gray-400 bg-gray-100 cursor-not-allowed" : "bg-[#E9E9E9] cursor-pointer hover:bg-[#d6d6d6] active:bg-[#c4c4c4]"}`,
|
|
593
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex justify-center items-center gap-[10px]", children: [
|
|
594
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: iconLeft }),
|
|
595
|
+
title,
|
|
596
|
+
iconRight && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { children: iconRight })
|
|
597
|
+
] })
|
|
598
|
+
}
|
|
599
|
+
);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
// src/Button/TabSelectionButton/TabSelectionButton.tsx
|
|
603
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
604
|
+
var TabSelectionButton = ({ title, now, onClickGoto }) => {
|
|
605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "flex subtitle-2", children: [
|
|
606
|
+
title.map((text) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
607
|
+
"button",
|
|
608
|
+
{
|
|
609
|
+
onClick: () => onClickGoto(text.path),
|
|
610
|
+
className: `text-nowrap px-2 cursor-pointer ${now === text.path ? "border-b-primary-700 text-primary-700 border-b-2" : "border-b-gray-200 border-b-2"}`,
|
|
611
|
+
children: text.name
|
|
612
|
+
}
|
|
613
|
+
)),
|
|
614
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "border-b-gray-200 border-b-2 w-full" })
|
|
615
|
+
] });
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
// src/Loader/Loader/Loader.tsx
|
|
619
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
620
|
+
function Loader({ size = 25, color = "#000000" }) {
|
|
621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
622
|
+
"div",
|
|
623
|
+
{
|
|
624
|
+
style: {
|
|
625
|
+
width: size,
|
|
626
|
+
height: size,
|
|
627
|
+
borderWidth: 4,
|
|
628
|
+
borderStyle: "solid",
|
|
629
|
+
borderColor: color,
|
|
630
|
+
borderTopColor: "transparent"
|
|
631
|
+
},
|
|
632
|
+
className: "rounded-full animate-spin"
|
|
633
|
+
}
|
|
634
|
+
);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// src/Checkbox/Checkbox/Checkbox.tsx
|
|
638
|
+
var import_icons_react = require("@tabler/icons-react");
|
|
639
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
640
|
+
function Checkbox({ label, checked, onChange, disabled }) {
|
|
641
|
+
const handleClick = () => {
|
|
642
|
+
if (!disabled) {
|
|
643
|
+
onChange(!checked);
|
|
644
|
+
}
|
|
645
|
+
};
|
|
646
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
647
|
+
"div",
|
|
648
|
+
{
|
|
649
|
+
className: `flex gap-[10px] items-center
|
|
650
|
+
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}`,
|
|
651
|
+
"aria-disabled": disabled,
|
|
652
|
+
onClick: handleClick,
|
|
653
|
+
children: [
|
|
654
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
655
|
+
"div",
|
|
656
|
+
{
|
|
657
|
+
className: `flex justify-center items-center border-[1px] border-black w-[24px] h-[24px] rounded-[8px] transition-colors duration-100
|
|
658
|
+
${checked ? "bg-black text-white" : "bg-white text-black"}
|
|
659
|
+
${disabled ? "pointer-events-none" : ""}`,
|
|
660
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
661
|
+
"span",
|
|
662
|
+
{
|
|
663
|
+
className: `flex justify-center items-center transition-transform duration-150
|
|
664
|
+
${checked ? "scale-100 opacity-100" : "scale-0 opacity-0"}`,
|
|
665
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_icons_react.IconCheck, { size: 20 })
|
|
666
|
+
}
|
|
667
|
+
)
|
|
668
|
+
}
|
|
669
|
+
),
|
|
670
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "body-1 select-none", children: label })
|
|
671
|
+
]
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// src/Checkbox/CheckboxGroup/CheckboxGroup.tsx
|
|
677
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
678
|
+
function CheckboxGroup({ options, onChange, alignment = "vertical" }) {
|
|
679
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: `flex gap-4 ${alignment === "vertical" ? "flex-col" : ""}`, children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
680
|
+
Checkbox,
|
|
681
|
+
{
|
|
682
|
+
checked: opt.checked,
|
|
683
|
+
label: opt.label,
|
|
684
|
+
onChange: () => onChange(opt.label),
|
|
685
|
+
disabled: opt.disabled
|
|
686
|
+
},
|
|
687
|
+
opt.label
|
|
688
|
+
)) });
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
// src/Radio/Radio/Radio.tsx
|
|
692
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
693
|
+
function Radio({ selected, onChange, disabled }) {
|
|
694
|
+
const handleClick = () => {
|
|
695
|
+
if (!disabled) {
|
|
696
|
+
onChange(!selected);
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
700
|
+
"div",
|
|
701
|
+
{
|
|
702
|
+
className: `
|
|
703
|
+
flex justify-center items-center w-[16px] h-[16px] border-[1px] border-black rounded-full
|
|
704
|
+
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}
|
|
705
|
+
`,
|
|
706
|
+
onClick: handleClick,
|
|
707
|
+
"aria-disabled": disabled,
|
|
708
|
+
children: selected && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `bg-black w-[10px] h-[10px] rounded-full transition-all duration-300` })
|
|
709
|
+
}
|
|
710
|
+
);
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
// src/Radio/RadioGroup/RadioGroup.tsx
|
|
714
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
715
|
+
function RadioGroup({ options, value, onChange, alignment = "horizontal" }) {
|
|
716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `flex gap-2 ${alignment === "vertical" ? "flex-col" : ""}`, children: options.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [
|
|
717
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Radio, { selected: value === opt.value, onChange: () => onChange(opt.value), disabled: opt.disabled }),
|
|
718
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: `body-1 ${opt.disabled ? "text-gray-400 cursor-not-allowed" : ""}`, children: opt.label })
|
|
719
|
+
] }, opt.value)) });
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
// src/Switch/Switch/Switch.tsx
|
|
723
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
724
|
+
function Switch({ label, checked, onChange, disabled }) {
|
|
725
|
+
const handleClick = () => {
|
|
726
|
+
if (!disabled) {
|
|
727
|
+
onChange(!checked);
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-col gap-[10px]", children: [
|
|
731
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: `body-1 ${disabled ? "opacity-50 select-none" : ""}`, children: label }),
|
|
732
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
733
|
+
"button",
|
|
734
|
+
{
|
|
735
|
+
type: "button",
|
|
736
|
+
onClick: handleClick,
|
|
737
|
+
disabled,
|
|
738
|
+
"aria-disabled": disabled,
|
|
739
|
+
className: `
|
|
740
|
+
w-13 h-7 flex items-center rounded-full p-1 transition-colors duration-300
|
|
741
|
+
${checked ? "bg-blue-500" : "bg-gray-300"}
|
|
742
|
+
${disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"}
|
|
743
|
+
`,
|
|
744
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
745
|
+
"div",
|
|
746
|
+
{
|
|
747
|
+
className: `bg-white w-5 h-5 rounded-full shadow-md transform transition-transform duration-300
|
|
748
|
+
${checked ? "translate-x-6" : "translate-x-0"}`
|
|
749
|
+
}
|
|
750
|
+
)
|
|
751
|
+
}
|
|
752
|
+
)
|
|
753
|
+
] });
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
// src/Switch/SwitchSelect/SwitchSelect.tsx
|
|
757
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
758
|
+
function SwitchSelect({
|
|
759
|
+
option,
|
|
760
|
+
onClick,
|
|
761
|
+
value,
|
|
762
|
+
label,
|
|
763
|
+
required,
|
|
764
|
+
color
|
|
765
|
+
}) {
|
|
766
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "flex flex-col container-input", children: [
|
|
767
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: `body-1`, children: [
|
|
768
|
+
label,
|
|
769
|
+
" ",
|
|
770
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "text-red-500", children: "*" })
|
|
771
|
+
] }),
|
|
772
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "flex", children: option.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
773
|
+
"button",
|
|
774
|
+
{
|
|
775
|
+
onClick: () => onClick(item.value),
|
|
776
|
+
className: `
|
|
777
|
+
body-1 border-y-1 border-primary-500 cursor-pointer h-[32px] px-2
|
|
778
|
+
${item.value === value ? `${color ? `bg-[${color}]` : `bg-primary-500`} text-white` : "bg-white text-primary-500"}
|
|
779
|
+
${index === 0 ? "border-l-1 rounded-l-lg" : index === option.length - 1 ? "border-r-1 rounded-r-lg" : "border-x-1"}
|
|
780
|
+
`,
|
|
781
|
+
children: item.label
|
|
782
|
+
},
|
|
783
|
+
item.value
|
|
784
|
+
)) })
|
|
785
|
+
] });
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// src/NavBar/MenuNavBar/MenuNavBar.tsx
|
|
789
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
790
|
+
function MenuNavBar({ menus, onClick }) {
|
|
791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "w-full h-full p-[10px] bg-white", children: menus?.map((menu, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `p-[10px] ${index !== 0 ? "mt-[10px]" : ""}`, children: [
|
|
792
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "p-[10px] w-[202px] h-[47px] subtitle-1", children: menu.title }),
|
|
793
|
+
menu?.subMenus.map((subMenu) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
794
|
+
"div",
|
|
795
|
+
{
|
|
796
|
+
className: "group flex justify-center items-center gap-[10px] p-[10px] w-[202px] h-[47px] rounded-[6px] subtitle-2 cursor-pointer hover:bg-red-100 active:bg-primary-500 hover:text-white active:text-white",
|
|
797
|
+
onClick: () => onClick(subMenu.path),
|
|
798
|
+
children: [
|
|
799
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "flex justify-center items-center w-[24px] h-[24px] text-[20px]", children: [
|
|
800
|
+
subMenu.icon && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: `block ${subMenu.iconActive ? "group-active:hidden" : ""}`, children: subMenu.icon }),
|
|
801
|
+
subMenu.iconActive && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "hidden group-active:block", children: subMenu.iconActive })
|
|
802
|
+
] }),
|
|
803
|
+
subMenu.title,
|
|
804
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "flex ml-auto", children: subMenu.customNode && subMenu.customNode })
|
|
805
|
+
]
|
|
806
|
+
},
|
|
807
|
+
`sub_${subMenu.title}`
|
|
808
|
+
))
|
|
809
|
+
] }, `menu_${menu.title}`)) });
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// src/NavBar/MenuNavBar/Sidebar.tsx
|
|
813
|
+
var import_icons_react2 = require("@tabler/icons-react");
|
|
814
|
+
var import_react = require("react");
|
|
815
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
816
|
+
var SidebarContext = (0, import_react.createContext)({ expanded: false });
|
|
817
|
+
function Sidebar({ children, logo }) {
|
|
818
|
+
const [expanded, setExpanded] = (0, import_react.useState)(true);
|
|
819
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("aside", { className: "h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("nav", { className: `h-full flex flex-col bg-white border-r shadow-sm duration-150 ${expanded ? "w-64" : "w-16"}`, children: [
|
|
820
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "p-4 pb-2 flex justify-center items-center", children: [
|
|
821
|
+
expanded && logo && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("img", { src: logo, width: 120, className: "ml-auto" }),
|
|
822
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
823
|
+
"button",
|
|
824
|
+
{
|
|
825
|
+
className: "p-1.5 rounded-lg bg-gray-50 hover:bg-gray-100 cursor-pointer ml-auto",
|
|
826
|
+
onClick: () => setExpanded((curr) => !curr),
|
|
827
|
+
children: expanded ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react2.IconChevronLeftPipe, {}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_icons_react2.IconChevronRightPipe, {})
|
|
828
|
+
}
|
|
829
|
+
)
|
|
830
|
+
] }),
|
|
831
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SidebarContext.Provider, { value: { expanded }, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "flex-1 px-3", children }) })
|
|
832
|
+
] }) });
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
// src/NavBar/TopNavBar/TopNavBar.tsx
|
|
836
|
+
var import_icons_react3 = require("@tabler/icons-react");
|
|
837
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
838
|
+
function TopNavBar({ onClickNoti, logo }) {
|
|
839
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "w-full h-full flex", children: [
|
|
840
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-[20px] p-[10px]", children: [
|
|
841
|
+
logo,
|
|
842
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "subtitle-1", children: "Project Management" })
|
|
843
|
+
] }),
|
|
844
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center ml-auto gap-[20px] p-[10px]", children: [
|
|
845
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: "Search" }),
|
|
846
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_icons_react3.IconBellRinging, { onClick: onClickNoti, className: "cursor-pointer" }) }),
|
|
847
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "w-[40px] h-[40px] bg-gray-400 rounded-full cursor-pointer" })
|
|
848
|
+
] })
|
|
849
|
+
] });
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
// src/Table/DataTable/DataTable.tsx
|
|
853
|
+
var import_icons_react5 = require("@tabler/icons-react");
|
|
854
|
+
var import_react3 = require("react");
|
|
855
|
+
|
|
856
|
+
// src/Table/Pagination/Pagination.tsx
|
|
857
|
+
var import_icons_react4 = require("@tabler/icons-react");
|
|
858
|
+
var import_react2 = require("react");
|
|
859
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
860
|
+
function Pagination({ totalItems, itemsPerPage, currentPage, onPageChange }) {
|
|
861
|
+
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
|
862
|
+
const getPages = (0, import_react2.useMemo)(() => {
|
|
863
|
+
if (totalPages <= 7) {
|
|
864
|
+
return Array.from({ length: totalPages }, (_, i) => i + 1);
|
|
865
|
+
}
|
|
866
|
+
const pages = [];
|
|
867
|
+
pages.push(1);
|
|
868
|
+
if (currentPage > 3) {
|
|
869
|
+
pages.push("...");
|
|
870
|
+
}
|
|
871
|
+
const start = Math.max(2, currentPage - 1);
|
|
872
|
+
const end = Math.min(totalPages - 1, currentPage + 1);
|
|
873
|
+
for (let i = start; i <= end; i++) {
|
|
874
|
+
pages.push(i);
|
|
875
|
+
}
|
|
876
|
+
if (currentPage < totalPages - 2) {
|
|
877
|
+
pages.push("...");
|
|
878
|
+
}
|
|
879
|
+
pages.push(totalPages);
|
|
880
|
+
return pages;
|
|
881
|
+
}, [totalPages, currentPage]);
|
|
882
|
+
if (totalPages <= 1) return null;
|
|
883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "flex items-center justify-center gap-2 mt-4 body-1", children: [
|
|
884
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
885
|
+
"button",
|
|
886
|
+
{
|
|
887
|
+
className: "px-3 py-1 disabled:opacity-50 flex gap-[8px] cursor-pointer",
|
|
888
|
+
disabled: currentPage === 1,
|
|
889
|
+
onClick: () => onPageChange(currentPage - 1),
|
|
890
|
+
children: [
|
|
891
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react4.IconArrowLeft, {}),
|
|
892
|
+
"\u0E22\u0E49\u0E2D\u0E19\u0E01\u0E25\u0E31\u0E1A"
|
|
893
|
+
]
|
|
894
|
+
}
|
|
895
|
+
),
|
|
896
|
+
getPages.map(
|
|
897
|
+
(page, i) => typeof page === "string" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: "px-2", children: page }, i) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
898
|
+
"button",
|
|
899
|
+
{
|
|
900
|
+
className: `w-[32px] h-[32px] rounded-[8px] px-3 py-1 cursor-pointer
|
|
901
|
+
${currentPage === page ? "bg-black text-white" : "hover:bg-gray-100"}`,
|
|
902
|
+
onClick: () => onPageChange(page),
|
|
903
|
+
children: page
|
|
904
|
+
},
|
|
905
|
+
i
|
|
906
|
+
)
|
|
907
|
+
),
|
|
908
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
909
|
+
"button",
|
|
910
|
+
{
|
|
911
|
+
className: "px-3 py-1 disabled:opacity-50 flex gap-[8px] cursor-pointer",
|
|
912
|
+
disabled: currentPage === totalPages,
|
|
913
|
+
onClick: () => onPageChange(currentPage + 1),
|
|
914
|
+
children: [
|
|
915
|
+
"\u0E16\u0E31\u0E14\u0E44\u0E1B",
|
|
916
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_icons_react4.IconArrowRight, {})
|
|
917
|
+
]
|
|
918
|
+
}
|
|
919
|
+
)
|
|
920
|
+
] });
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
// src/Table/DataTable/DataTable.tsx
|
|
924
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
925
|
+
function DataTable({ columns, data, onSort, isLoading }) {
|
|
926
|
+
const cols = Math.max(1, columns.length);
|
|
927
|
+
const gridClass = "grid [grid-template-columns:repeat(var(--cols),minmax(0,1fr))]";
|
|
928
|
+
const [sortConfig, setSortConfig] = (0, import_react3.useState)(null);
|
|
929
|
+
const [page, setPage] = (0, import_react3.useState)(1);
|
|
930
|
+
const onSorting = (config) => {
|
|
931
|
+
if (config) {
|
|
932
|
+
setSortConfig({ key: config?.key, direction: config?.direction });
|
|
933
|
+
onSort();
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "border rounded-md w-full h-full", children: [
|
|
937
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: `${gridClass} font-semibold border-b border-gray-200`, style: { ["--cols"]: cols }, children: columns.map((col, i) => {
|
|
938
|
+
const isActive = sortConfig?.key === col.accessor;
|
|
939
|
+
const direction = isActive ? sortConfig?.direction : null;
|
|
940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center gap-[8px] py-[8px] px-[16px] body-4 truncate", children: [
|
|
941
|
+
col.header,
|
|
942
|
+
col.sortable && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
943
|
+
direction === null && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
944
|
+
import_icons_react5.IconSelector,
|
|
945
|
+
{
|
|
946
|
+
size: 15,
|
|
947
|
+
className: "hover:text-red-400 cursor-pointer",
|
|
948
|
+
onClick: () => onSorting({ key: col.accessor, direction: "asc" })
|
|
949
|
+
}
|
|
950
|
+
),
|
|
951
|
+
direction === "asc" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
952
|
+
import_icons_react5.IconSortAscending,
|
|
953
|
+
{
|
|
954
|
+
size: 15,
|
|
955
|
+
className: "cursor-pointer text-red-500",
|
|
956
|
+
onClick: () => onSorting({ key: col.accessor, direction: "desc" })
|
|
957
|
+
}
|
|
958
|
+
),
|
|
959
|
+
direction === "desc" && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
960
|
+
import_icons_react5.IconSortDescending,
|
|
961
|
+
{
|
|
962
|
+
size: 15,
|
|
963
|
+
className: "cursor-pointer text-red-500",
|
|
964
|
+
onClick: () => onSorting({ key: col.accessor, direction: null })
|
|
965
|
+
}
|
|
966
|
+
)
|
|
967
|
+
] })
|
|
968
|
+
] }, i);
|
|
969
|
+
}) }),
|
|
970
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "flex justify-center items-center w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Loader, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: data.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
971
|
+
"div",
|
|
972
|
+
{
|
|
973
|
+
className: `${gridClass} ${data.length - 1 !== i ? "border-b border-gray-200" : ""} items-center`,
|
|
974
|
+
style: { ["--cols"]: cols },
|
|
975
|
+
children: columns.map((col, c) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "py-[8px] px-[16px] body-3 truncate", children: typeof col.accessor === "function" ? col.accessor(row) : String(row[col.accessor]) }, c))
|
|
976
|
+
},
|
|
977
|
+
i
|
|
978
|
+
)) }),
|
|
979
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Pagination, { currentPage: page, itemsPerPage: 5, totalItems: 10, onPageChange: setPage }) })
|
|
980
|
+
] });
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// src/Table/DataTable/AntDataTable.tsx
|
|
984
|
+
var import_antd = require("antd");
|
|
985
|
+
var import_react4 = require("react");
|
|
986
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
987
|
+
function AntDataTable({
|
|
988
|
+
dataSource,
|
|
989
|
+
columns,
|
|
990
|
+
pageSize = 10,
|
|
991
|
+
rowCheckbox,
|
|
992
|
+
onRowSelect,
|
|
993
|
+
// onFilteredDataChange,
|
|
994
|
+
onFilter,
|
|
995
|
+
onChange,
|
|
996
|
+
width,
|
|
997
|
+
height,
|
|
998
|
+
pagination
|
|
999
|
+
}) {
|
|
1000
|
+
const [selectedRowKeys, setSelectedRowKeys] = (0, import_react4.useState)([]);
|
|
1001
|
+
const rowSelection = {
|
|
1002
|
+
selectedRowKeys,
|
|
1003
|
+
onChange: (newSelectedRowKeys) => {
|
|
1004
|
+
setSelectedRowKeys(newSelectedRowKeys);
|
|
1005
|
+
onRowSelect && onRowSelect(newSelectedRowKeys);
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
const handleChange = (paginationArgs, filters, sorter, extra) => {
|
|
1009
|
+
onChange?.(paginationArgs, filters, sorter, extra);
|
|
1010
|
+
onFilter(filters);
|
|
1011
|
+
};
|
|
1012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_jsx_runtime17.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1013
|
+
import_antd.ConfigProvider,
|
|
1014
|
+
{
|
|
1015
|
+
theme: {
|
|
1016
|
+
components: {},
|
|
1017
|
+
token: {
|
|
1018
|
+
fontFamily: "Kanit",
|
|
1019
|
+
fontSize: 14
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1023
|
+
import_antd.Table,
|
|
1024
|
+
{
|
|
1025
|
+
dataSource,
|
|
1026
|
+
columns,
|
|
1027
|
+
rowSelection: rowCheckbox ? rowSelection : void 0,
|
|
1028
|
+
onChange: handleChange,
|
|
1029
|
+
pagination: pagination ? { position: ["bottomCenter"], pageSize } : false,
|
|
1030
|
+
style: { width },
|
|
1031
|
+
scroll: { y: height }
|
|
1032
|
+
}
|
|
1033
|
+
)
|
|
1034
|
+
}
|
|
1035
|
+
) });
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
// src/Calendar/Calendar/Calendar.tsx
|
|
1039
|
+
var import_react5 = require("react");
|
|
1040
|
+
var import_react6 = __toESM(require("@fullcalendar/react"), 1);
|
|
1041
|
+
var import_daygrid = __toESM(require("@fullcalendar/daygrid"), 1);
|
|
1042
|
+
var import_timegrid = __toESM(require("@fullcalendar/timegrid"), 1);
|
|
1043
|
+
var import_interaction = __toESM(require("@fullcalendar/interaction"), 1);
|
|
1044
|
+
var import_th = __toESM(require("@fullcalendar/core/locales/th"), 1);
|
|
1045
|
+
var import_icons_react6 = require("@tabler/icons-react");
|
|
1046
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1047
|
+
function Calendar({ events }) {
|
|
1048
|
+
const calendarRef = (0, import_react5.useRef)(null);
|
|
1049
|
+
const [monthTitle, setMonthTitle] = (0, import_react5.useState)("");
|
|
1050
|
+
const [openPopup, setOpenPopup] = (0, import_react5.useState)(false);
|
|
1051
|
+
const [selectedEvent, setSelectedEvent] = (0, import_react5.useState)(null);
|
|
1052
|
+
const updateTitle = () => {
|
|
1053
|
+
const calendarApi = calendarRef.current?.getApi();
|
|
1054
|
+
if (calendarApi) {
|
|
1055
|
+
setMonthTitle(calendarApi.view.title);
|
|
1056
|
+
}
|
|
1057
|
+
};
|
|
1058
|
+
const changeView = (viewName) => {
|
|
1059
|
+
const calendarApi = calendarRef.current?.getApi();
|
|
1060
|
+
calendarApi?.changeView(viewName);
|
|
1061
|
+
};
|
|
1062
|
+
(0, import_react5.useEffect)(() => {
|
|
1063
|
+
updateTitle();
|
|
1064
|
+
}, []);
|
|
1065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "fc w-full h-full relative z-10", children: [
|
|
1066
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex mb-[8px]", children: [
|
|
1067
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "headline-5", children: monthTitle }),
|
|
1068
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex gap-[10px] ml-auto", children: [
|
|
1069
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1070
|
+
"p",
|
|
1071
|
+
{
|
|
1072
|
+
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
1073
|
+
onClick: () => {
|
|
1074
|
+
calendarRef.current.getApi().today();
|
|
1075
|
+
updateTitle();
|
|
1076
|
+
},
|
|
1077
|
+
children: "\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49"
|
|
1078
|
+
}
|
|
1079
|
+
),
|
|
1080
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1081
|
+
"p",
|
|
1082
|
+
{
|
|
1083
|
+
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
1084
|
+
onClick: () => {
|
|
1085
|
+
changeView("dayGridMonth");
|
|
1086
|
+
updateTitle();
|
|
1087
|
+
},
|
|
1088
|
+
children: "Month"
|
|
1089
|
+
}
|
|
1090
|
+
),
|
|
1091
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1092
|
+
"p",
|
|
1093
|
+
{
|
|
1094
|
+
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
1095
|
+
onClick: () => {
|
|
1096
|
+
changeView("timeGridWeek");
|
|
1097
|
+
updateTitle();
|
|
1098
|
+
},
|
|
1099
|
+
children: "Week"
|
|
1100
|
+
}
|
|
1101
|
+
),
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1103
|
+
"p",
|
|
1104
|
+
{
|
|
1105
|
+
className: "w-[80px] h-[35px] border-[1px] flex justify-center items-center rounded-[2px] body-3 cursor-pointer",
|
|
1106
|
+
onClick: () => {
|
|
1107
|
+
changeView("timeGridDay");
|
|
1108
|
+
updateTitle();
|
|
1109
|
+
},
|
|
1110
|
+
children: "Day"
|
|
1111
|
+
}
|
|
1112
|
+
),
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1114
|
+
"button",
|
|
1115
|
+
{
|
|
1116
|
+
className: "cursor-pointer",
|
|
1117
|
+
onClick: () => {
|
|
1118
|
+
calendarRef.current?.getApi().prev();
|
|
1119
|
+
updateTitle();
|
|
1120
|
+
},
|
|
1121
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons_react6.IconChevronLeft, {})
|
|
1122
|
+
}
|
|
1123
|
+
),
|
|
1124
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1125
|
+
"button",
|
|
1126
|
+
{
|
|
1127
|
+
className: "cursor-pointer",
|
|
1128
|
+
onClick: () => {
|
|
1129
|
+
calendarRef.current?.getApi().next();
|
|
1130
|
+
updateTitle();
|
|
1131
|
+
},
|
|
1132
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons_react6.IconChevronRight, {})
|
|
1133
|
+
}
|
|
1134
|
+
)
|
|
1135
|
+
] })
|
|
1136
|
+
] }),
|
|
1137
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1138
|
+
import_react6.default,
|
|
1139
|
+
{
|
|
1140
|
+
ref: calendarRef,
|
|
1141
|
+
plugins: [import_daygrid.default, import_timegrid.default, import_interaction.default],
|
|
1142
|
+
events,
|
|
1143
|
+
locale: import_th.default,
|
|
1144
|
+
slotLabelFormat: {
|
|
1145
|
+
hour: "numeric",
|
|
1146
|
+
minute: "2-digit"
|
|
1147
|
+
},
|
|
1148
|
+
firstDay: 0,
|
|
1149
|
+
fixedWeekCount: false,
|
|
1150
|
+
headerToolbar: false,
|
|
1151
|
+
initialView: "dayGridMonth",
|
|
1152
|
+
dayMaxEventRows: 4,
|
|
1153
|
+
editable: true,
|
|
1154
|
+
eventDrop: (info) => {
|
|
1155
|
+
console.log("Event \u0E02\u0E2D\u0E07\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48:", info.event.startStr);
|
|
1156
|
+
},
|
|
1157
|
+
eventClick: (info) => {
|
|
1158
|
+
setOpenPopup(true);
|
|
1159
|
+
setSelectedEvent({
|
|
1160
|
+
title: info.event.title,
|
|
1161
|
+
start: info.event._instance?.range.start.toISOString(),
|
|
1162
|
+
end: info.event._instance?.range.end.toISOString()
|
|
1163
|
+
});
|
|
1164
|
+
},
|
|
1165
|
+
eventContent: (arg) => {
|
|
1166
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_jsx_runtime18.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("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 }) });
|
|
1167
|
+
},
|
|
1168
|
+
moreLinkContent: (arg) => `+${arg.num} \u0E23\u0E32\u0E22\u0E01\u0E32\u0E23`
|
|
1169
|
+
}
|
|
1170
|
+
) }),
|
|
1171
|
+
openPopup && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "fixed inset-0 flex justify-center items-center bg-black/50 z-50", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(EventPopUp, { event: selectedEvent, onClose: () => setOpenPopup(false) }) })
|
|
1172
|
+
] });
|
|
1173
|
+
}
|
|
1174
|
+
function EventPopUp({ event, onClose }) {
|
|
1175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "w-[500px] h-auto rounded-2xl bg-white relative z-50 shadow-2xl overflow-hidden", children: [
|
|
1176
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("button", { className: "absolute top-3 right-3 rounded-full p-1 hover:bg-gray-200 transition", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_icons_react6.IconX, { className: "w-6 h-6 text-gray-600" }) }),
|
|
1177
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "bg-red-400 text-left text-white px-6 py-4 headline-5", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h2", { className: "text-lg font-semibold", children: event.title }) }),
|
|
1178
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex flex-col w-full p-6 gap-3 text-gray-700 body-3", children: [
|
|
1179
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { children: [
|
|
1180
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "font-medium", children: "\u0E40\u0E23\u0E34\u0E48\u0E21: " }),
|
|
1181
|
+
event?.start?.toLocaleString?.() || String(event?.start)
|
|
1182
|
+
] }),
|
|
1183
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("p", { children: [
|
|
1184
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "font-medium", children: "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14: " }),
|
|
1185
|
+
event?.end?.toLocaleString?.() || String(event?.end)
|
|
1186
|
+
] }),
|
|
1187
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("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" })
|
|
1188
|
+
] })
|
|
1189
|
+
] });
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
// src/Input/TextInput/TextInput.tsx
|
|
1193
|
+
var import_icons_react7 = require("@tabler/icons-react");
|
|
1194
|
+
var import_react7 = require("react");
|
|
1195
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1196
|
+
function TextInput({
|
|
1197
|
+
label,
|
|
1198
|
+
placeholder,
|
|
1199
|
+
type = "text",
|
|
1200
|
+
maxLength,
|
|
1201
|
+
required,
|
|
1202
|
+
error,
|
|
1203
|
+
value,
|
|
1204
|
+
onChange,
|
|
1205
|
+
disabled
|
|
1206
|
+
}) {
|
|
1207
|
+
const [showPassword, setShowPassword] = (0, import_react7.useState)(false);
|
|
1208
|
+
const onShowPassword = () => {
|
|
1209
|
+
setShowPassword(!showPassword);
|
|
1210
|
+
};
|
|
1211
|
+
const inputType = type === "password" ? showPassword ? "text" : "password" : "text";
|
|
1212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { children: [
|
|
1213
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "body-1 mb-[8px]", children: [
|
|
1214
|
+
label,
|
|
1215
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "text-red-500", children: "\xA0*" })
|
|
1216
|
+
] }),
|
|
1217
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1218
|
+
"div",
|
|
1219
|
+
{
|
|
1220
|
+
className: `border-[1px] rounded-[8px] w-full h-[40px] flex justify-center items-center
|
|
1221
|
+
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-500" : ""}`,
|
|
1222
|
+
children: [
|
|
1223
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1224
|
+
"input",
|
|
1225
|
+
{
|
|
1226
|
+
className: `w-full h-full px-[16px] ${disabled ? "cursor-not-allowed" : ""}`,
|
|
1227
|
+
style: { outline: "none" },
|
|
1228
|
+
placeholder,
|
|
1229
|
+
type: inputType,
|
|
1230
|
+
maxLength,
|
|
1231
|
+
value,
|
|
1232
|
+
onChange: (e) => onChange(e.target.value),
|
|
1233
|
+
disabled
|
|
1234
|
+
}
|
|
1235
|
+
),
|
|
1236
|
+
type === "password" && (showPassword ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons_react7.IconEye, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_icons_react7.IconEyeOff, { className: "text-gray-600 mr-[8px] cursor-pointer", onClick: onShowPassword }))
|
|
1237
|
+
]
|
|
1238
|
+
}
|
|
1239
|
+
),
|
|
1240
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-red-500 body-1", children: error })
|
|
1241
|
+
] });
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
// src/Input/TextArea/TextArea.tsx
|
|
1245
|
+
var import_antd2 = require("antd");
|
|
1246
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1247
|
+
var { TextArea } = import_antd2.Input;
|
|
1248
|
+
function TextAreaInput({
|
|
1249
|
+
label,
|
|
1250
|
+
height = 4,
|
|
1251
|
+
placeholder,
|
|
1252
|
+
onChange,
|
|
1253
|
+
value,
|
|
1254
|
+
maxLength,
|
|
1255
|
+
resizable,
|
|
1256
|
+
showCount,
|
|
1257
|
+
required,
|
|
1258
|
+
error,
|
|
1259
|
+
disabled
|
|
1260
|
+
}) {
|
|
1261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1262
|
+
import_antd2.ConfigProvider,
|
|
1263
|
+
{
|
|
1264
|
+
theme: {
|
|
1265
|
+
components: {},
|
|
1266
|
+
token: {
|
|
1267
|
+
fontFamily: "Kanit",
|
|
1268
|
+
fontSize: 16
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
1272
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("p", { className: "body-1 mb-[8px]", children: [
|
|
1273
|
+
label,
|
|
1274
|
+
" ",
|
|
1275
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-red-500", children: "\xA0*" })
|
|
1276
|
+
] }),
|
|
1277
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1278
|
+
TextArea,
|
|
1279
|
+
{
|
|
1280
|
+
value,
|
|
1281
|
+
rows: height,
|
|
1282
|
+
style: {
|
|
1283
|
+
...error && resizable ? { borderColor: "red" } : {},
|
|
1284
|
+
...disabled || !resizable ? { resize: "none" } : {}
|
|
1285
|
+
},
|
|
1286
|
+
placeholder,
|
|
1287
|
+
maxLength,
|
|
1288
|
+
showCount,
|
|
1289
|
+
onChange: (e) => onChange(e.target.value),
|
|
1290
|
+
disabled
|
|
1291
|
+
}
|
|
1292
|
+
),
|
|
1293
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-red-500 body-1", children: error })
|
|
1294
|
+
] })
|
|
1295
|
+
}
|
|
1296
|
+
) });
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
// src/Input/InputField/InputField.tsx
|
|
1300
|
+
var import_antd3 = require("antd");
|
|
1301
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1302
|
+
function InputField({
|
|
1303
|
+
value,
|
|
1304
|
+
onChange,
|
|
1305
|
+
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
1306
|
+
label,
|
|
1307
|
+
required,
|
|
1308
|
+
disabled,
|
|
1309
|
+
error,
|
|
1310
|
+
addonBefore,
|
|
1311
|
+
addonAfter,
|
|
1312
|
+
defaultValue,
|
|
1313
|
+
className,
|
|
1314
|
+
onClear,
|
|
1315
|
+
statickey
|
|
1316
|
+
}) {
|
|
1317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1318
|
+
import_antd3.ConfigProvider,
|
|
1319
|
+
{
|
|
1320
|
+
theme: {
|
|
1321
|
+
token: {
|
|
1322
|
+
fontFamily: "Kanit"
|
|
1323
|
+
}
|
|
1324
|
+
},
|
|
1325
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "container-input", children: [
|
|
1326
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
1327
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "body-1", children: label }),
|
|
1328
|
+
" ",
|
|
1329
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1330
|
+
] }),
|
|
1331
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_antd3.Space.Compact, { children: [
|
|
1332
|
+
statickey && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "items-center flex px-2 bg-gray-300 rounded-l-md body-1", children: statickey }),
|
|
1333
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1334
|
+
import_antd3.Input,
|
|
1335
|
+
{
|
|
1336
|
+
value,
|
|
1337
|
+
placeholder,
|
|
1338
|
+
disabled,
|
|
1339
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
1340
|
+
onChange: (e) => onChange(e.target.value || void 0),
|
|
1341
|
+
allowClear: true,
|
|
1342
|
+
addonBefore,
|
|
1343
|
+
addonAfter,
|
|
1344
|
+
defaultValue,
|
|
1345
|
+
onClear
|
|
1346
|
+
}
|
|
1347
|
+
)
|
|
1348
|
+
] }),
|
|
1349
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1350
|
+
] })
|
|
1351
|
+
}
|
|
1352
|
+
);
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
// src/Input/InputFieldNumber/InputFieldNumber.tsx
|
|
1356
|
+
var import_antd4 = require("antd");
|
|
1357
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1358
|
+
function InputFieldNumber({
|
|
1359
|
+
value,
|
|
1360
|
+
onChange,
|
|
1361
|
+
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
1362
|
+
label,
|
|
1363
|
+
required,
|
|
1364
|
+
disabled,
|
|
1365
|
+
error,
|
|
1366
|
+
addonBefore,
|
|
1367
|
+
addonAfter,
|
|
1368
|
+
defaultValue,
|
|
1369
|
+
className,
|
|
1370
|
+
max,
|
|
1371
|
+
min,
|
|
1372
|
+
controls,
|
|
1373
|
+
size,
|
|
1374
|
+
changeOnWheel,
|
|
1375
|
+
formatter,
|
|
1376
|
+
parser
|
|
1377
|
+
}) {
|
|
1378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1379
|
+
import_antd4.ConfigProvider,
|
|
1380
|
+
{
|
|
1381
|
+
theme: {
|
|
1382
|
+
token: {
|
|
1383
|
+
fontFamily: "Kanit"
|
|
1384
|
+
}
|
|
1385
|
+
},
|
|
1386
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "container-input", children: [
|
|
1387
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
1388
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "body-1", children: label }),
|
|
1389
|
+
" ",
|
|
1390
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1391
|
+
] }),
|
|
1392
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1393
|
+
import_antd4.InputNumber,
|
|
1394
|
+
{
|
|
1395
|
+
value: value ?? void 0,
|
|
1396
|
+
onChange: (val) => onChange(val),
|
|
1397
|
+
placeholder,
|
|
1398
|
+
disabled,
|
|
1399
|
+
className: `body-1 !w-full ${className ?? ""}`,
|
|
1400
|
+
addonBefore,
|
|
1401
|
+
addonAfter,
|
|
1402
|
+
defaultValue,
|
|
1403
|
+
max,
|
|
1404
|
+
min,
|
|
1405
|
+
controls,
|
|
1406
|
+
size,
|
|
1407
|
+
changeOnWheel,
|
|
1408
|
+
formatter,
|
|
1409
|
+
parser
|
|
1410
|
+
}
|
|
1411
|
+
),
|
|
1412
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1413
|
+
] })
|
|
1414
|
+
}
|
|
1415
|
+
);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1419
|
+
var import_antd5 = require("antd");
|
|
1420
|
+
var import_dayjs = __toESM(require_dayjs_min(), 1);
|
|
1421
|
+
var import_th_TH = __toESM(require("antd/es/date-picker/locale/th_TH.js"), 1);
|
|
1422
|
+
var import_th_TH2 = __toESM(require("antd/locale/th_TH.js"), 1);
|
|
1423
|
+
var import_th2 = __toESM(require_th(), 1);
|
|
1424
|
+
var import_locale = require("date-fns/locale");
|
|
1425
|
+
var import_date_fns = require("date-fns");
|
|
1426
|
+
var import_buddhistEra = __toESM(require_buddhistEra(), 1);
|
|
1427
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1428
|
+
import_dayjs.default.extend(import_buddhistEra.default);
|
|
1429
|
+
function DatePickerBasic({
|
|
1430
|
+
value,
|
|
1431
|
+
onChange,
|
|
1432
|
+
required,
|
|
1433
|
+
label,
|
|
1434
|
+
error,
|
|
1435
|
+
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48",
|
|
1436
|
+
disabled,
|
|
1437
|
+
defaultValue,
|
|
1438
|
+
minDate,
|
|
1439
|
+
maxDate,
|
|
1440
|
+
disabledDate,
|
|
1441
|
+
className,
|
|
1442
|
+
size
|
|
1443
|
+
}) {
|
|
1444
|
+
const dateFormat = "DD/MM/YYYY";
|
|
1445
|
+
import_dayjs.default.locale("th_TH");
|
|
1446
|
+
const buddhistLocale = {
|
|
1447
|
+
...import_th_TH.default,
|
|
1448
|
+
lang: {
|
|
1449
|
+
...import_th_TH.default.lang,
|
|
1450
|
+
fieldDateFormat: "BBBB-MM-DD",
|
|
1451
|
+
fieldDateTimeFormat: "BBBB-MM-DD HH:mm:ss",
|
|
1452
|
+
yearFormat: "BBBB",
|
|
1453
|
+
cellYearFormat: "BBBB"
|
|
1454
|
+
}
|
|
1455
|
+
};
|
|
1456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1457
|
+
import_antd5.ConfigProvider,
|
|
1458
|
+
{
|
|
1459
|
+
locale: import_th_TH2.default,
|
|
1460
|
+
theme: {
|
|
1461
|
+
token: {
|
|
1462
|
+
fontFamily: "Kanit",
|
|
1463
|
+
fontSize: 16
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "container-input", children: [
|
|
1467
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
1468
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "body-1", children: label }),
|
|
1469
|
+
" ",
|
|
1470
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1471
|
+
] }),
|
|
1472
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
1473
|
+
import_antd5.DatePicker,
|
|
1474
|
+
{
|
|
1475
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
1476
|
+
value,
|
|
1477
|
+
placeholder,
|
|
1478
|
+
onChange,
|
|
1479
|
+
allowClear: true,
|
|
1480
|
+
disabled,
|
|
1481
|
+
format: (date) => date ? (0, import_date_fns.format)(date.toDate(), "dd/MM/yyyy", { locale: import_locale.th }).replace(
|
|
1482
|
+
/\d{4}$/,
|
|
1483
|
+
(y) => String(parseInt(y) + 543)
|
|
1484
|
+
) : "",
|
|
1485
|
+
defaultValue,
|
|
1486
|
+
disabledDate: (d) => disabledDate ? disabledDate(d.toDate()) : false,
|
|
1487
|
+
minDate: minDate ? (0, import_dayjs.default)(minDate) : void 0,
|
|
1488
|
+
maxDate: maxDate ? (0, import_dayjs.default)(maxDate) : void 0,
|
|
1489
|
+
size,
|
|
1490
|
+
locale: buddhistLocale
|
|
1491
|
+
}
|
|
1492
|
+
),
|
|
1493
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1494
|
+
] })
|
|
1495
|
+
}
|
|
1496
|
+
);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
// src/DatePicker/DatePickerRangePicker/DatePickerRangePicker.tsx
|
|
1500
|
+
var import_antd6 = require("antd");
|
|
1501
|
+
var import_th_TH3 = __toESM(require("antd/locale/th_TH.js"), 1);
|
|
1502
|
+
var import_th3 = __toESM(require_th(), 1);
|
|
1503
|
+
var import_th_TH4 = __toESM(require("antd/es/date-picker/locale/th_TH.js"), 1);
|
|
1504
|
+
var import_customParseFormat = __toESM(require_customParseFormat(), 1);
|
|
1505
|
+
var import_dayjs2 = __toESM(require_dayjs_min(), 1);
|
|
1506
|
+
var import_date_fns2 = require("date-fns");
|
|
1507
|
+
var import_locale2 = require("date-fns/locale");
|
|
1508
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1509
|
+
import_dayjs2.default.extend(import_customParseFormat.default);
|
|
1510
|
+
function DatePickerRangePicker({
|
|
1511
|
+
value,
|
|
1512
|
+
onChange,
|
|
1513
|
+
placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
|
|
1514
|
+
label,
|
|
1515
|
+
required,
|
|
1516
|
+
error,
|
|
1517
|
+
disabled,
|
|
1518
|
+
minDate,
|
|
1519
|
+
maxDate,
|
|
1520
|
+
disabledDate,
|
|
1521
|
+
size = "middle",
|
|
1522
|
+
className,
|
|
1523
|
+
onOpenChange,
|
|
1524
|
+
onCalendarChange
|
|
1525
|
+
}) {
|
|
1526
|
+
const dateFormat = "DD/MM/YYYY";
|
|
1527
|
+
import_dayjs2.default.locale("th_TH");
|
|
1528
|
+
const buddhistLocale = {
|
|
1529
|
+
...import_th_TH4.default,
|
|
1530
|
+
lang: {
|
|
1531
|
+
...import_th_TH4.default.lang,
|
|
1532
|
+
fieldDateFormat: "BBBB-MM-DD",
|
|
1533
|
+
fieldDateTimeFormat: "BBBB-MM-DD HH:mm:ss",
|
|
1534
|
+
yearFormat: "BBBB",
|
|
1535
|
+
cellYearFormat: "BBBB"
|
|
1536
|
+
}
|
|
1537
|
+
};
|
|
1538
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1539
|
+
import_antd6.ConfigProvider,
|
|
1540
|
+
{
|
|
1541
|
+
locale: import_th_TH3.default,
|
|
1542
|
+
theme: {
|
|
1543
|
+
token: {
|
|
1544
|
+
fontFamily: "Kanit",
|
|
1545
|
+
fontSize: 16
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1548
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "container-input", children: [
|
|
1549
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
1550
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "body-1", children: label }),
|
|
1551
|
+
" ",
|
|
1552
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1553
|
+
] }),
|
|
1554
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
1555
|
+
import_antd6.DatePicker.RangePicker,
|
|
1556
|
+
{
|
|
1557
|
+
format: (date) => date ? (0, import_date_fns2.format)(date.toDate(), "dd/MM/yyyy", { locale: import_locale2.th }).replace(
|
|
1558
|
+
/\d{4}$/,
|
|
1559
|
+
(y) => String(parseInt(y) + 543)
|
|
1560
|
+
) : "",
|
|
1561
|
+
value: value ? [value[0] ? (0, import_dayjs2.default)(value[0]) : null, value[1] ? (0, import_dayjs2.default)(value[1]) : null] : null,
|
|
1562
|
+
placeholder,
|
|
1563
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
1564
|
+
onChange: (dates, dateStrings) => {
|
|
1565
|
+
if (!dates) {
|
|
1566
|
+
onChange(null);
|
|
1567
|
+
} else {
|
|
1568
|
+
onChange([dates[0] ? dates[0].toDate() : null, dates[1] ? dates[1].toDate() : null]);
|
|
1569
|
+
}
|
|
1570
|
+
},
|
|
1571
|
+
allowClear: true,
|
|
1572
|
+
disabled,
|
|
1573
|
+
minDate: minDate ? (0, import_dayjs2.default)(minDate) : void 0,
|
|
1574
|
+
maxDate: maxDate ? (0, import_dayjs2.default)(maxDate) : void 0,
|
|
1575
|
+
disabledDate: (d) => disabledDate ? disabledDate(d.toDate()) : false,
|
|
1576
|
+
size,
|
|
1577
|
+
onOpenChange,
|
|
1578
|
+
onCalendarChange: (dates, dateStrings, info) => {
|
|
1579
|
+
if (!dates) {
|
|
1580
|
+
onCalendarChange?.([null, null], dateStrings, info);
|
|
1581
|
+
} else {
|
|
1582
|
+
onCalendarChange?.(
|
|
1583
|
+
[dates[0] ? dates[0].toDate() : null, dates[1] ? dates[1].toDate() : null],
|
|
1584
|
+
dateStrings,
|
|
1585
|
+
info
|
|
1586
|
+
);
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
locale: buddhistLocale
|
|
1590
|
+
}
|
|
1591
|
+
),
|
|
1592
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1593
|
+
] })
|
|
1594
|
+
}
|
|
1595
|
+
);
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
// src/TimePicker/TimePickerBasic/TimePickerBasic.tsx
|
|
1599
|
+
var import_antd7 = require("antd");
|
|
1600
|
+
var import_dayjs3 = __toESM(require_dayjs_min(), 1);
|
|
1601
|
+
var import_th_TH5 = __toESM(require("antd/locale/th_TH.js"), 1);
|
|
1602
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
1603
|
+
function TimePickerBasic({
|
|
1604
|
+
value,
|
|
1605
|
+
onChange,
|
|
1606
|
+
required,
|
|
1607
|
+
label,
|
|
1608
|
+
error,
|
|
1609
|
+
placeholder,
|
|
1610
|
+
disabled,
|
|
1611
|
+
className
|
|
1612
|
+
}) {
|
|
1613
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1614
|
+
import_antd7.ConfigProvider,
|
|
1615
|
+
{
|
|
1616
|
+
locale: import_th_TH5.default,
|
|
1617
|
+
theme: {
|
|
1618
|
+
token: {
|
|
1619
|
+
fontFamily: "Kanit"
|
|
1620
|
+
}
|
|
1621
|
+
},
|
|
1622
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "container-input", children: [
|
|
1623
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
1624
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "body-1", children: label }),
|
|
1625
|
+
" ",
|
|
1626
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1627
|
+
] }),
|
|
1628
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
1629
|
+
import_antd7.TimePicker,
|
|
1630
|
+
{
|
|
1631
|
+
format: "HH:mm",
|
|
1632
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
1633
|
+
value: value ? (0, import_dayjs3.default)(value) : null,
|
|
1634
|
+
placeholder,
|
|
1635
|
+
onChange: (time) => {
|
|
1636
|
+
onChange(time ? time.toDate() : null);
|
|
1637
|
+
},
|
|
1638
|
+
allowClear: true,
|
|
1639
|
+
disabled
|
|
1640
|
+
}
|
|
1641
|
+
),
|
|
1642
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1643
|
+
] })
|
|
1644
|
+
}
|
|
1645
|
+
);
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
// src/TimePicker/TimePickerRangePicker/TimerPickerRangePicker.tsx
|
|
1649
|
+
var import_antd8 = require("antd");
|
|
1650
|
+
var import_dayjs4 = __toESM(require_dayjs_min(), 1);
|
|
1651
|
+
var import_th_TH6 = __toESM(require("antd/locale/th_TH.js"), 1);
|
|
1652
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
1653
|
+
function TimePickerRangePicker({
|
|
1654
|
+
value,
|
|
1655
|
+
onChange,
|
|
1656
|
+
placeholder = ["\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19", "\u0E2A\u0E34\u0E49\u0E19\u0E2A\u0E38\u0E14"],
|
|
1657
|
+
label,
|
|
1658
|
+
required,
|
|
1659
|
+
error,
|
|
1660
|
+
disabled,
|
|
1661
|
+
className
|
|
1662
|
+
}) {
|
|
1663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1664
|
+
import_antd8.ConfigProvider,
|
|
1665
|
+
{
|
|
1666
|
+
locale: import_th_TH6.default,
|
|
1667
|
+
theme: {
|
|
1668
|
+
token: {
|
|
1669
|
+
fontFamily: "Kanit"
|
|
1670
|
+
}
|
|
1671
|
+
},
|
|
1672
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "container-input", children: [
|
|
1673
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
1674
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "body-1", children: label }),
|
|
1675
|
+
" ",
|
|
1676
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1677
|
+
] }),
|
|
1678
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1679
|
+
import_antd8.TimePicker.RangePicker,
|
|
1680
|
+
{
|
|
1681
|
+
format: "HH:mm",
|
|
1682
|
+
value: value ? [value[0] ? (0, import_dayjs4.default)(value[0]) : null, value[1] ? (0, import_dayjs4.default)(value[1]) : null] : null,
|
|
1683
|
+
placeholder,
|
|
1684
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
1685
|
+
onChange: (dates, dateStrings) => {
|
|
1686
|
+
if (!dates) {
|
|
1687
|
+
onChange(null);
|
|
1688
|
+
} else {
|
|
1689
|
+
onChange([dates[0] ? dates[0].toDate() : null, dates[1] ? dates[1].toDate() : null]);
|
|
1690
|
+
}
|
|
1691
|
+
},
|
|
1692
|
+
allowClear: true,
|
|
1693
|
+
disabled,
|
|
1694
|
+
showNow: true
|
|
1695
|
+
}
|
|
1696
|
+
),
|
|
1697
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1698
|
+
] })
|
|
1699
|
+
}
|
|
1700
|
+
);
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
// src/ColorPicker/ColorPickerBasic/ColorPicker.tsx
|
|
1704
|
+
var import_antd9 = require("antd");
|
|
1705
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1706
|
+
function ColorPickerBasic({
|
|
1707
|
+
value,
|
|
1708
|
+
onChange,
|
|
1709
|
+
required,
|
|
1710
|
+
label,
|
|
1711
|
+
error,
|
|
1712
|
+
disabled,
|
|
1713
|
+
allowClear,
|
|
1714
|
+
defaultFormat,
|
|
1715
|
+
className,
|
|
1716
|
+
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
|
|
1717
|
+
}) {
|
|
1718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1719
|
+
import_antd9.ConfigProvider,
|
|
1720
|
+
{
|
|
1721
|
+
theme: {
|
|
1722
|
+
token: {
|
|
1723
|
+
fontFamily: "Kanit",
|
|
1724
|
+
fontSize: 16
|
|
1725
|
+
}
|
|
1726
|
+
},
|
|
1727
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "container-input", children: [
|
|
1728
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
1729
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "body-1", children: label }),
|
|
1730
|
+
" ",
|
|
1731
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1732
|
+
] }),
|
|
1733
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1734
|
+
import_antd9.ColorPicker,
|
|
1735
|
+
{
|
|
1736
|
+
defaultFormat,
|
|
1737
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
1738
|
+
value,
|
|
1739
|
+
defaultValue: "#ffff",
|
|
1740
|
+
onChange,
|
|
1741
|
+
allowClear,
|
|
1742
|
+
showText: (color) => {
|
|
1743
|
+
const hex = color.toHexString();
|
|
1744
|
+
if (!value) {
|
|
1745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: placeholder });
|
|
1746
|
+
}
|
|
1747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("span", { children: [
|
|
1748
|
+
"(",
|
|
1749
|
+
hex,
|
|
1750
|
+
")"
|
|
1751
|
+
] });
|
|
1752
|
+
},
|
|
1753
|
+
disabled
|
|
1754
|
+
}
|
|
1755
|
+
),
|
|
1756
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1757
|
+
] })
|
|
1758
|
+
}
|
|
1759
|
+
);
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
// src/ColorPicker/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
1763
|
+
var import_antd10 = require("antd");
|
|
1764
|
+
|
|
1765
|
+
// node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
1766
|
+
function _typeof(o) {
|
|
1767
|
+
"@babel/helpers - typeof";
|
|
1768
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
1769
|
+
return typeof o2;
|
|
1770
|
+
} : function(o2) {
|
|
1771
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
1772
|
+
}, _typeof(o);
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
// node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
1776
|
+
function toPrimitive(t, r) {
|
|
1777
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
1778
|
+
var e = t[Symbol.toPrimitive];
|
|
1779
|
+
if (void 0 !== e) {
|
|
1780
|
+
var i = e.call(t, r || "default");
|
|
1781
|
+
if ("object" != _typeof(i)) return i;
|
|
1782
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1783
|
+
}
|
|
1784
|
+
return ("string" === r ? String : Number)(t);
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
// node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
1788
|
+
function toPropertyKey(t) {
|
|
1789
|
+
var i = toPrimitive(t, "string");
|
|
1790
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
// node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
1794
|
+
function _defineProperty(e, r, t) {
|
|
1795
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
1796
|
+
value: t,
|
|
1797
|
+
enumerable: true,
|
|
1798
|
+
configurable: true,
|
|
1799
|
+
writable: true
|
|
1800
|
+
}) : e[r] = t, e;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
// node_modules/@ant-design/fast-color/es/FastColor.js
|
|
1804
|
+
var round = Math.round;
|
|
1805
|
+
function splitColorStr(str, parseNum) {
|
|
1806
|
+
const match = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [];
|
|
1807
|
+
const numList = match.map((item) => parseFloat(item));
|
|
1808
|
+
for (let i = 0; i < 3; i += 1) {
|
|
1809
|
+
numList[i] = parseNum(numList[i] || 0, match[i] || "", i);
|
|
1810
|
+
}
|
|
1811
|
+
if (match[3]) {
|
|
1812
|
+
numList[3] = match[3].includes("%") ? numList[3] / 100 : numList[3];
|
|
1813
|
+
} else {
|
|
1814
|
+
numList[3] = 1;
|
|
1815
|
+
}
|
|
1816
|
+
return numList;
|
|
1817
|
+
}
|
|
1818
|
+
var parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
|
|
1819
|
+
function limitRange(value, max) {
|
|
1820
|
+
const mergedMax = max || 255;
|
|
1821
|
+
if (value > mergedMax) {
|
|
1822
|
+
return mergedMax;
|
|
1823
|
+
}
|
|
1824
|
+
if (value < 0) {
|
|
1825
|
+
return 0;
|
|
1826
|
+
}
|
|
1827
|
+
return value;
|
|
1828
|
+
}
|
|
1829
|
+
var FastColor = class _FastColor {
|
|
1830
|
+
constructor(input) {
|
|
1831
|
+
_defineProperty(this, "isValid", true);
|
|
1832
|
+
_defineProperty(this, "r", 0);
|
|
1833
|
+
_defineProperty(this, "g", 0);
|
|
1834
|
+
_defineProperty(this, "b", 0);
|
|
1835
|
+
_defineProperty(this, "a", 1);
|
|
1836
|
+
_defineProperty(this, "_h", void 0);
|
|
1837
|
+
_defineProperty(this, "_s", void 0);
|
|
1838
|
+
_defineProperty(this, "_l", void 0);
|
|
1839
|
+
_defineProperty(this, "_v", void 0);
|
|
1840
|
+
_defineProperty(this, "_max", void 0);
|
|
1841
|
+
_defineProperty(this, "_min", void 0);
|
|
1842
|
+
_defineProperty(this, "_brightness", void 0);
|
|
1843
|
+
function matchFormat(str) {
|
|
1844
|
+
return str[0] in input && str[1] in input && str[2] in input;
|
|
1845
|
+
}
|
|
1846
|
+
if (!input) {
|
|
1847
|
+
} else if (typeof input === "string") {
|
|
1848
|
+
let matchPrefix2 = function(prefix) {
|
|
1849
|
+
return trimStr.startsWith(prefix);
|
|
1850
|
+
};
|
|
1851
|
+
var matchPrefix = matchPrefix2;
|
|
1852
|
+
const trimStr = input.trim();
|
|
1853
|
+
if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
|
|
1854
|
+
this.fromHexString(trimStr);
|
|
1855
|
+
} else if (matchPrefix2("rgb")) {
|
|
1856
|
+
this.fromRgbString(trimStr);
|
|
1857
|
+
} else if (matchPrefix2("hsl")) {
|
|
1858
|
+
this.fromHslString(trimStr);
|
|
1859
|
+
} else if (matchPrefix2("hsv") || matchPrefix2("hsb")) {
|
|
1860
|
+
this.fromHsvString(trimStr);
|
|
1861
|
+
}
|
|
1862
|
+
} else if (input instanceof _FastColor) {
|
|
1863
|
+
this.r = input.r;
|
|
1864
|
+
this.g = input.g;
|
|
1865
|
+
this.b = input.b;
|
|
1866
|
+
this.a = input.a;
|
|
1867
|
+
this._h = input._h;
|
|
1868
|
+
this._s = input._s;
|
|
1869
|
+
this._l = input._l;
|
|
1870
|
+
this._v = input._v;
|
|
1871
|
+
} else if (matchFormat("rgb")) {
|
|
1872
|
+
this.r = limitRange(input.r);
|
|
1873
|
+
this.g = limitRange(input.g);
|
|
1874
|
+
this.b = limitRange(input.b);
|
|
1875
|
+
this.a = typeof input.a === "number" ? limitRange(input.a, 1) : 1;
|
|
1876
|
+
} else if (matchFormat("hsl")) {
|
|
1877
|
+
this.fromHsl(input);
|
|
1878
|
+
} else if (matchFormat("hsv")) {
|
|
1879
|
+
this.fromHsv(input);
|
|
1880
|
+
} else {
|
|
1881
|
+
throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(input));
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
// ======================= Setter =======================
|
|
1885
|
+
setR(value) {
|
|
1886
|
+
return this._sc("r", value);
|
|
1887
|
+
}
|
|
1888
|
+
setG(value) {
|
|
1889
|
+
return this._sc("g", value);
|
|
1890
|
+
}
|
|
1891
|
+
setB(value) {
|
|
1892
|
+
return this._sc("b", value);
|
|
1893
|
+
}
|
|
1894
|
+
setA(value) {
|
|
1895
|
+
return this._sc("a", value, 1);
|
|
1896
|
+
}
|
|
1897
|
+
setHue(value) {
|
|
1898
|
+
const hsv = this.toHsv();
|
|
1899
|
+
hsv.h = value;
|
|
1900
|
+
return this._c(hsv);
|
|
1901
|
+
}
|
|
1902
|
+
// ======================= Getter =======================
|
|
1903
|
+
/**
|
|
1904
|
+
* Returns the perceived luminance of a color, from 0-1.
|
|
1905
|
+
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
1906
|
+
*/
|
|
1907
|
+
getLuminance() {
|
|
1908
|
+
function adjustGamma(raw) {
|
|
1909
|
+
const val = raw / 255;
|
|
1910
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
1911
|
+
}
|
|
1912
|
+
const R = adjustGamma(this.r);
|
|
1913
|
+
const G = adjustGamma(this.g);
|
|
1914
|
+
const B = adjustGamma(this.b);
|
|
1915
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
1916
|
+
}
|
|
1917
|
+
getHue() {
|
|
1918
|
+
if (typeof this._h === "undefined") {
|
|
1919
|
+
const delta = this.getMax() - this.getMin();
|
|
1920
|
+
if (delta === 0) {
|
|
1921
|
+
this._h = 0;
|
|
1922
|
+
} else {
|
|
1923
|
+
this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
|
|
1924
|
+
}
|
|
1925
|
+
}
|
|
1926
|
+
return this._h;
|
|
1927
|
+
}
|
|
1928
|
+
getSaturation() {
|
|
1929
|
+
if (typeof this._s === "undefined") {
|
|
1930
|
+
const delta = this.getMax() - this.getMin();
|
|
1931
|
+
if (delta === 0) {
|
|
1932
|
+
this._s = 0;
|
|
1933
|
+
} else {
|
|
1934
|
+
this._s = delta / this.getMax();
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
return this._s;
|
|
1938
|
+
}
|
|
1939
|
+
getLightness() {
|
|
1940
|
+
if (typeof this._l === "undefined") {
|
|
1941
|
+
this._l = (this.getMax() + this.getMin()) / 510;
|
|
1942
|
+
}
|
|
1943
|
+
return this._l;
|
|
1944
|
+
}
|
|
1945
|
+
getValue() {
|
|
1946
|
+
if (typeof this._v === "undefined") {
|
|
1947
|
+
this._v = this.getMax() / 255;
|
|
1948
|
+
}
|
|
1949
|
+
return this._v;
|
|
1950
|
+
}
|
|
1951
|
+
/**
|
|
1952
|
+
* Returns the perceived brightness of the color, from 0-255.
|
|
1953
|
+
* Note: this is not the b of HSB
|
|
1954
|
+
* @see http://www.w3.org/TR/AERT#color-contrast
|
|
1955
|
+
*/
|
|
1956
|
+
getBrightness() {
|
|
1957
|
+
if (typeof this._brightness === "undefined") {
|
|
1958
|
+
this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3;
|
|
1959
|
+
}
|
|
1960
|
+
return this._brightness;
|
|
1961
|
+
}
|
|
1962
|
+
// ======================== Func ========================
|
|
1963
|
+
darken(amount = 10) {
|
|
1964
|
+
const h = this.getHue();
|
|
1965
|
+
const s = this.getSaturation();
|
|
1966
|
+
let l = this.getLightness() - amount / 100;
|
|
1967
|
+
if (l < 0) {
|
|
1968
|
+
l = 0;
|
|
1969
|
+
}
|
|
1970
|
+
return this._c({
|
|
1971
|
+
h,
|
|
1972
|
+
s,
|
|
1973
|
+
l,
|
|
1974
|
+
a: this.a
|
|
1975
|
+
});
|
|
1976
|
+
}
|
|
1977
|
+
lighten(amount = 10) {
|
|
1978
|
+
const h = this.getHue();
|
|
1979
|
+
const s = this.getSaturation();
|
|
1980
|
+
let l = this.getLightness() + amount / 100;
|
|
1981
|
+
if (l > 1) {
|
|
1982
|
+
l = 1;
|
|
1983
|
+
}
|
|
1984
|
+
return this._c({
|
|
1985
|
+
h,
|
|
1986
|
+
s,
|
|
1987
|
+
l,
|
|
1988
|
+
a: this.a
|
|
1989
|
+
});
|
|
1990
|
+
}
|
|
1991
|
+
/**
|
|
1992
|
+
* Mix the current color a given amount with another color, from 0 to 100.
|
|
1993
|
+
* 0 means no mixing (return current color).
|
|
1994
|
+
*/
|
|
1995
|
+
mix(input, amount = 50) {
|
|
1996
|
+
const color = this._c(input);
|
|
1997
|
+
const p = amount / 100;
|
|
1998
|
+
const calc = (key) => (color[key] - this[key]) * p + this[key];
|
|
1999
|
+
const rgba = {
|
|
2000
|
+
r: round(calc("r")),
|
|
2001
|
+
g: round(calc("g")),
|
|
2002
|
+
b: round(calc("b")),
|
|
2003
|
+
a: round(calc("a") * 100) / 100
|
|
2004
|
+
};
|
|
2005
|
+
return this._c(rgba);
|
|
2006
|
+
}
|
|
2007
|
+
/**
|
|
2008
|
+
* Mix the color with pure white, from 0 to 100.
|
|
2009
|
+
* Providing 0 will do nothing, providing 100 will always return white.
|
|
2010
|
+
*/
|
|
2011
|
+
tint(amount = 10) {
|
|
2012
|
+
return this.mix({
|
|
2013
|
+
r: 255,
|
|
2014
|
+
g: 255,
|
|
2015
|
+
b: 255,
|
|
2016
|
+
a: 1
|
|
2017
|
+
}, amount);
|
|
2018
|
+
}
|
|
2019
|
+
/**
|
|
2020
|
+
* Mix the color with pure black, from 0 to 100.
|
|
2021
|
+
* Providing 0 will do nothing, providing 100 will always return black.
|
|
2022
|
+
*/
|
|
2023
|
+
shade(amount = 10) {
|
|
2024
|
+
return this.mix({
|
|
2025
|
+
r: 0,
|
|
2026
|
+
g: 0,
|
|
2027
|
+
b: 0,
|
|
2028
|
+
a: 1
|
|
2029
|
+
}, amount);
|
|
2030
|
+
}
|
|
2031
|
+
onBackground(background) {
|
|
2032
|
+
const bg = this._c(background);
|
|
2033
|
+
const alpha = this.a + bg.a * (1 - this.a);
|
|
2034
|
+
const calc = (key) => {
|
|
2035
|
+
return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
|
|
2036
|
+
};
|
|
2037
|
+
return this._c({
|
|
2038
|
+
r: calc("r"),
|
|
2039
|
+
g: calc("g"),
|
|
2040
|
+
b: calc("b"),
|
|
2041
|
+
a: alpha
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
// ======================= Status =======================
|
|
2045
|
+
isDark() {
|
|
2046
|
+
return this.getBrightness() < 128;
|
|
2047
|
+
}
|
|
2048
|
+
isLight() {
|
|
2049
|
+
return this.getBrightness() >= 128;
|
|
2050
|
+
}
|
|
2051
|
+
// ======================== MISC ========================
|
|
2052
|
+
equals(other) {
|
|
2053
|
+
return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
|
|
2054
|
+
}
|
|
2055
|
+
clone() {
|
|
2056
|
+
return this._c(this);
|
|
2057
|
+
}
|
|
2058
|
+
// ======================= Format =======================
|
|
2059
|
+
toHexString() {
|
|
2060
|
+
let hex = "#";
|
|
2061
|
+
const rHex = (this.r || 0).toString(16);
|
|
2062
|
+
hex += rHex.length === 2 ? rHex : "0" + rHex;
|
|
2063
|
+
const gHex = (this.g || 0).toString(16);
|
|
2064
|
+
hex += gHex.length === 2 ? gHex : "0" + gHex;
|
|
2065
|
+
const bHex = (this.b || 0).toString(16);
|
|
2066
|
+
hex += bHex.length === 2 ? bHex : "0" + bHex;
|
|
2067
|
+
if (typeof this.a === "number" && this.a >= 0 && this.a < 1) {
|
|
2068
|
+
const aHex = round(this.a * 255).toString(16);
|
|
2069
|
+
hex += aHex.length === 2 ? aHex : "0" + aHex;
|
|
2070
|
+
}
|
|
2071
|
+
return hex;
|
|
2072
|
+
}
|
|
2073
|
+
/** CSS support color pattern */
|
|
2074
|
+
toHsl() {
|
|
2075
|
+
return {
|
|
2076
|
+
h: this.getHue(),
|
|
2077
|
+
s: this.getSaturation(),
|
|
2078
|
+
l: this.getLightness(),
|
|
2079
|
+
a: this.a
|
|
2080
|
+
};
|
|
2081
|
+
}
|
|
2082
|
+
/** CSS support color pattern */
|
|
2083
|
+
toHslString() {
|
|
2084
|
+
const h = this.getHue();
|
|
2085
|
+
const s = round(this.getSaturation() * 100);
|
|
2086
|
+
const l = round(this.getLightness() * 100);
|
|
2087
|
+
return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;
|
|
2088
|
+
}
|
|
2089
|
+
/** Same as toHsb */
|
|
2090
|
+
toHsv() {
|
|
2091
|
+
return {
|
|
2092
|
+
h: this.getHue(),
|
|
2093
|
+
s: this.getSaturation(),
|
|
2094
|
+
v: this.getValue(),
|
|
2095
|
+
a: this.a
|
|
2096
|
+
};
|
|
2097
|
+
}
|
|
2098
|
+
toRgb() {
|
|
2099
|
+
return {
|
|
2100
|
+
r: this.r,
|
|
2101
|
+
g: this.g,
|
|
2102
|
+
b: this.b,
|
|
2103
|
+
a: this.a
|
|
2104
|
+
};
|
|
2105
|
+
}
|
|
2106
|
+
toRgbString() {
|
|
2107
|
+
return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
|
|
2108
|
+
}
|
|
2109
|
+
toString() {
|
|
2110
|
+
return this.toRgbString();
|
|
2111
|
+
}
|
|
2112
|
+
// ====================== Privates ======================
|
|
2113
|
+
/** Return a new FastColor object with one channel changed */
|
|
2114
|
+
_sc(rgb, value, max) {
|
|
2115
|
+
const clone = this.clone();
|
|
2116
|
+
clone[rgb] = limitRange(value, max);
|
|
2117
|
+
return clone;
|
|
2118
|
+
}
|
|
2119
|
+
_c(input) {
|
|
2120
|
+
return new this.constructor(input);
|
|
2121
|
+
}
|
|
2122
|
+
getMax() {
|
|
2123
|
+
if (typeof this._max === "undefined") {
|
|
2124
|
+
this._max = Math.max(this.r, this.g, this.b);
|
|
2125
|
+
}
|
|
2126
|
+
return this._max;
|
|
2127
|
+
}
|
|
2128
|
+
getMin() {
|
|
2129
|
+
if (typeof this._min === "undefined") {
|
|
2130
|
+
this._min = Math.min(this.r, this.g, this.b);
|
|
2131
|
+
}
|
|
2132
|
+
return this._min;
|
|
2133
|
+
}
|
|
2134
|
+
fromHexString(trimStr) {
|
|
2135
|
+
const withoutPrefix = trimStr.replace("#", "");
|
|
2136
|
+
function connectNum(index1, index2) {
|
|
2137
|
+
return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
|
|
2138
|
+
}
|
|
2139
|
+
if (withoutPrefix.length < 6) {
|
|
2140
|
+
this.r = connectNum(0);
|
|
2141
|
+
this.g = connectNum(1);
|
|
2142
|
+
this.b = connectNum(2);
|
|
2143
|
+
this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
|
|
2144
|
+
} else {
|
|
2145
|
+
this.r = connectNum(0, 1);
|
|
2146
|
+
this.g = connectNum(2, 3);
|
|
2147
|
+
this.b = connectNum(4, 5);
|
|
2148
|
+
this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
fromHsl({
|
|
2152
|
+
h,
|
|
2153
|
+
s,
|
|
2154
|
+
l,
|
|
2155
|
+
a
|
|
2156
|
+
}) {
|
|
2157
|
+
this._h = h % 360;
|
|
2158
|
+
this._s = s;
|
|
2159
|
+
this._l = l;
|
|
2160
|
+
this.a = typeof a === "number" ? a : 1;
|
|
2161
|
+
if (s <= 0) {
|
|
2162
|
+
const rgb = round(l * 255);
|
|
2163
|
+
this.r = rgb;
|
|
2164
|
+
this.g = rgb;
|
|
2165
|
+
this.b = rgb;
|
|
2166
|
+
}
|
|
2167
|
+
let r = 0, g = 0, b = 0;
|
|
2168
|
+
const huePrime = h / 60;
|
|
2169
|
+
const chroma = (1 - Math.abs(2 * l - 1)) * s;
|
|
2170
|
+
const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
2171
|
+
if (huePrime >= 0 && huePrime < 1) {
|
|
2172
|
+
r = chroma;
|
|
2173
|
+
g = secondComponent;
|
|
2174
|
+
} else if (huePrime >= 1 && huePrime < 2) {
|
|
2175
|
+
r = secondComponent;
|
|
2176
|
+
g = chroma;
|
|
2177
|
+
} else if (huePrime >= 2 && huePrime < 3) {
|
|
2178
|
+
g = chroma;
|
|
2179
|
+
b = secondComponent;
|
|
2180
|
+
} else if (huePrime >= 3 && huePrime < 4) {
|
|
2181
|
+
g = secondComponent;
|
|
2182
|
+
b = chroma;
|
|
2183
|
+
} else if (huePrime >= 4 && huePrime < 5) {
|
|
2184
|
+
r = secondComponent;
|
|
2185
|
+
b = chroma;
|
|
2186
|
+
} else if (huePrime >= 5 && huePrime < 6) {
|
|
2187
|
+
r = chroma;
|
|
2188
|
+
b = secondComponent;
|
|
2189
|
+
}
|
|
2190
|
+
const lightnessModification = l - chroma / 2;
|
|
2191
|
+
this.r = round((r + lightnessModification) * 255);
|
|
2192
|
+
this.g = round((g + lightnessModification) * 255);
|
|
2193
|
+
this.b = round((b + lightnessModification) * 255);
|
|
2194
|
+
}
|
|
2195
|
+
fromHsv({
|
|
2196
|
+
h,
|
|
2197
|
+
s,
|
|
2198
|
+
v,
|
|
2199
|
+
a
|
|
2200
|
+
}) {
|
|
2201
|
+
this._h = h % 360;
|
|
2202
|
+
this._s = s;
|
|
2203
|
+
this._v = v;
|
|
2204
|
+
this.a = typeof a === "number" ? a : 1;
|
|
2205
|
+
const vv = round(v * 255);
|
|
2206
|
+
this.r = vv;
|
|
2207
|
+
this.g = vv;
|
|
2208
|
+
this.b = vv;
|
|
2209
|
+
if (s <= 0) {
|
|
2210
|
+
return;
|
|
2211
|
+
}
|
|
2212
|
+
const hh = h / 60;
|
|
2213
|
+
const i = Math.floor(hh);
|
|
2214
|
+
const ff = hh - i;
|
|
2215
|
+
const p = round(v * (1 - s) * 255);
|
|
2216
|
+
const q = round(v * (1 - s * ff) * 255);
|
|
2217
|
+
const t = round(v * (1 - s * (1 - ff)) * 255);
|
|
2218
|
+
switch (i) {
|
|
2219
|
+
case 0:
|
|
2220
|
+
this.g = t;
|
|
2221
|
+
this.b = p;
|
|
2222
|
+
break;
|
|
2223
|
+
case 1:
|
|
2224
|
+
this.r = q;
|
|
2225
|
+
this.b = p;
|
|
2226
|
+
break;
|
|
2227
|
+
case 2:
|
|
2228
|
+
this.r = p;
|
|
2229
|
+
this.b = t;
|
|
2230
|
+
break;
|
|
2231
|
+
case 3:
|
|
2232
|
+
this.r = p;
|
|
2233
|
+
this.g = q;
|
|
2234
|
+
break;
|
|
2235
|
+
case 4:
|
|
2236
|
+
this.r = t;
|
|
2237
|
+
this.g = p;
|
|
2238
|
+
break;
|
|
2239
|
+
case 5:
|
|
2240
|
+
default:
|
|
2241
|
+
this.g = p;
|
|
2242
|
+
this.b = q;
|
|
2243
|
+
break;
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
fromHsvString(trimStr) {
|
|
2247
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
2248
|
+
this.fromHsv({
|
|
2249
|
+
h: cells[0],
|
|
2250
|
+
s: cells[1],
|
|
2251
|
+
v: cells[2],
|
|
2252
|
+
a: cells[3]
|
|
2253
|
+
});
|
|
2254
|
+
}
|
|
2255
|
+
fromHslString(trimStr) {
|
|
2256
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
2257
|
+
this.fromHsl({
|
|
2258
|
+
h: cells[0],
|
|
2259
|
+
s: cells[1],
|
|
2260
|
+
l: cells[2],
|
|
2261
|
+
a: cells[3]
|
|
2262
|
+
});
|
|
2263
|
+
}
|
|
2264
|
+
fromRgbString(trimStr) {
|
|
2265
|
+
const cells = splitColorStr(trimStr, (num, txt) => (
|
|
2266
|
+
// Convert percentage to number. e.g. 50% -> 128
|
|
2267
|
+
txt.includes("%") ? round(num / 100 * 255) : num
|
|
2268
|
+
));
|
|
2269
|
+
this.r = cells[0];
|
|
2270
|
+
this.g = cells[1];
|
|
2271
|
+
this.b = cells[2];
|
|
2272
|
+
this.a = cells[3];
|
|
2273
|
+
}
|
|
2274
|
+
};
|
|
2275
|
+
|
|
2276
|
+
// node_modules/@ant-design/colors/es/generate.js
|
|
2277
|
+
var hueStep = 2;
|
|
2278
|
+
var saturationStep = 0.16;
|
|
2279
|
+
var saturationStep2 = 0.05;
|
|
2280
|
+
var brightnessStep1 = 0.05;
|
|
2281
|
+
var brightnessStep2 = 0.15;
|
|
2282
|
+
var lightColorCount = 5;
|
|
2283
|
+
var darkColorCount = 4;
|
|
2284
|
+
var darkColorMap = [{
|
|
2285
|
+
index: 7,
|
|
2286
|
+
amount: 15
|
|
2287
|
+
}, {
|
|
2288
|
+
index: 6,
|
|
2289
|
+
amount: 25
|
|
2290
|
+
}, {
|
|
2291
|
+
index: 5,
|
|
2292
|
+
amount: 30
|
|
2293
|
+
}, {
|
|
2294
|
+
index: 5,
|
|
2295
|
+
amount: 45
|
|
2296
|
+
}, {
|
|
2297
|
+
index: 5,
|
|
2298
|
+
amount: 65
|
|
2299
|
+
}, {
|
|
2300
|
+
index: 5,
|
|
2301
|
+
amount: 85
|
|
2302
|
+
}, {
|
|
2303
|
+
index: 4,
|
|
2304
|
+
amount: 90
|
|
2305
|
+
}, {
|
|
2306
|
+
index: 3,
|
|
2307
|
+
amount: 95
|
|
2308
|
+
}, {
|
|
2309
|
+
index: 2,
|
|
2310
|
+
amount: 97
|
|
2311
|
+
}, {
|
|
2312
|
+
index: 1,
|
|
2313
|
+
amount: 98
|
|
2314
|
+
}];
|
|
2315
|
+
function getHue(hsv, i, light) {
|
|
2316
|
+
var hue;
|
|
2317
|
+
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
|
2318
|
+
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
|
2319
|
+
} else {
|
|
2320
|
+
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
|
2321
|
+
}
|
|
2322
|
+
if (hue < 0) {
|
|
2323
|
+
hue += 360;
|
|
2324
|
+
} else if (hue >= 360) {
|
|
2325
|
+
hue -= 360;
|
|
2326
|
+
}
|
|
2327
|
+
return hue;
|
|
2328
|
+
}
|
|
2329
|
+
function getSaturation(hsv, i, light) {
|
|
2330
|
+
if (hsv.h === 0 && hsv.s === 0) {
|
|
2331
|
+
return hsv.s;
|
|
2332
|
+
}
|
|
2333
|
+
var saturation;
|
|
2334
|
+
if (light) {
|
|
2335
|
+
saturation = hsv.s - saturationStep * i;
|
|
2336
|
+
} else if (i === darkColorCount) {
|
|
2337
|
+
saturation = hsv.s + saturationStep;
|
|
2338
|
+
} else {
|
|
2339
|
+
saturation = hsv.s + saturationStep2 * i;
|
|
2340
|
+
}
|
|
2341
|
+
if (saturation > 1) {
|
|
2342
|
+
saturation = 1;
|
|
2343
|
+
}
|
|
2344
|
+
if (light && i === lightColorCount && saturation > 0.1) {
|
|
2345
|
+
saturation = 0.1;
|
|
2346
|
+
}
|
|
2347
|
+
if (saturation < 0.06) {
|
|
2348
|
+
saturation = 0.06;
|
|
2349
|
+
}
|
|
2350
|
+
return Math.round(saturation * 100) / 100;
|
|
2351
|
+
}
|
|
2352
|
+
function getValue(hsv, i, light) {
|
|
2353
|
+
var value;
|
|
2354
|
+
if (light) {
|
|
2355
|
+
value = hsv.v + brightnessStep1 * i;
|
|
2356
|
+
} else {
|
|
2357
|
+
value = hsv.v - brightnessStep2 * i;
|
|
2358
|
+
}
|
|
2359
|
+
value = Math.max(0, Math.min(1, value));
|
|
2360
|
+
return Math.round(value * 100) / 100;
|
|
2361
|
+
}
|
|
2362
|
+
function generate(color) {
|
|
2363
|
+
var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
2364
|
+
var patterns = [];
|
|
2365
|
+
var pColor = new FastColor(color);
|
|
2366
|
+
var hsv = pColor.toHsv();
|
|
2367
|
+
for (var i = lightColorCount; i > 0; i -= 1) {
|
|
2368
|
+
var c = new FastColor({
|
|
2369
|
+
h: getHue(hsv, i, true),
|
|
2370
|
+
s: getSaturation(hsv, i, true),
|
|
2371
|
+
v: getValue(hsv, i, true)
|
|
2372
|
+
});
|
|
2373
|
+
patterns.push(c);
|
|
2374
|
+
}
|
|
2375
|
+
patterns.push(pColor);
|
|
2376
|
+
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
|
2377
|
+
var _c = new FastColor({
|
|
2378
|
+
h: getHue(hsv, _i),
|
|
2379
|
+
s: getSaturation(hsv, _i),
|
|
2380
|
+
v: getValue(hsv, _i)
|
|
2381
|
+
});
|
|
2382
|
+
patterns.push(_c);
|
|
2383
|
+
}
|
|
2384
|
+
if (opts.theme === "dark") {
|
|
2385
|
+
return darkColorMap.map(function(_ref) {
|
|
2386
|
+
var index = _ref.index, amount = _ref.amount;
|
|
2387
|
+
return new FastColor(opts.backgroundColor || "#141414").mix(patterns[index], amount).toHexString();
|
|
2388
|
+
});
|
|
2389
|
+
}
|
|
2390
|
+
return patterns.map(function(c2) {
|
|
2391
|
+
return c2.toHexString();
|
|
2392
|
+
});
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2395
|
+
// node_modules/@ant-design/colors/es/presets.js
|
|
2396
|
+
var red = ["#fff1f0", "#ffccc7", "#ffa39e", "#ff7875", "#ff4d4f", "#f5222d", "#cf1322", "#a8071a", "#820014", "#5c0011"];
|
|
2397
|
+
red.primary = red[5];
|
|
2398
|
+
var volcano = ["#fff2e8", "#ffd8bf", "#ffbb96", "#ff9c6e", "#ff7a45", "#fa541c", "#d4380d", "#ad2102", "#871400", "#610b00"];
|
|
2399
|
+
volcano.primary = volcano[5];
|
|
2400
|
+
var orange = ["#fff7e6", "#ffe7ba", "#ffd591", "#ffc069", "#ffa940", "#fa8c16", "#d46b08", "#ad4e00", "#873800", "#612500"];
|
|
2401
|
+
orange.primary = orange[5];
|
|
2402
|
+
var gold = ["#fffbe6", "#fff1b8", "#ffe58f", "#ffd666", "#ffc53d", "#faad14", "#d48806", "#ad6800", "#874d00", "#613400"];
|
|
2403
|
+
gold.primary = gold[5];
|
|
2404
|
+
var yellow = ["#feffe6", "#ffffb8", "#fffb8f", "#fff566", "#ffec3d", "#fadb14", "#d4b106", "#ad8b00", "#876800", "#614700"];
|
|
2405
|
+
yellow.primary = yellow[5];
|
|
2406
|
+
var lime = ["#fcffe6", "#f4ffb8", "#eaff8f", "#d3f261", "#bae637", "#a0d911", "#7cb305", "#5b8c00", "#3f6600", "#254000"];
|
|
2407
|
+
lime.primary = lime[5];
|
|
2408
|
+
var green = ["#f6ffed", "#d9f7be", "#b7eb8f", "#95de64", "#73d13d", "#52c41a", "#389e0d", "#237804", "#135200", "#092b00"];
|
|
2409
|
+
green.primary = green[5];
|
|
2410
|
+
var cyan = ["#e6fffb", "#b5f5ec", "#87e8de", "#5cdbd3", "#36cfc9", "#13c2c2", "#08979c", "#006d75", "#00474f", "#002329"];
|
|
2411
|
+
cyan.primary = cyan[5];
|
|
2412
|
+
var blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
|
|
2413
|
+
blue.primary = blue[5];
|
|
2414
|
+
var geekblue = ["#f0f5ff", "#d6e4ff", "#adc6ff", "#85a5ff", "#597ef7", "#2f54eb", "#1d39c4", "#10239e", "#061178", "#030852"];
|
|
2415
|
+
geekblue.primary = geekblue[5];
|
|
2416
|
+
var purple = ["#f9f0ff", "#efdbff", "#d3adf7", "#b37feb", "#9254de", "#722ed1", "#531dab", "#391085", "#22075e", "#120338"];
|
|
2417
|
+
purple.primary = purple[5];
|
|
2418
|
+
var magenta = ["#fff0f6", "#ffd6e7", "#ffadd2", "#ff85c0", "#f759ab", "#eb2f96", "#c41d7f", "#9e1068", "#780650", "#520339"];
|
|
2419
|
+
magenta.primary = magenta[5];
|
|
2420
|
+
var grey = ["#a6a6a6", "#999999", "#8c8c8c", "#808080", "#737373", "#666666", "#404040", "#1a1a1a", "#000000", "#000000"];
|
|
2421
|
+
grey.primary = grey[5];
|
|
2422
|
+
var presetPalettes = {
|
|
2423
|
+
red,
|
|
2424
|
+
volcano,
|
|
2425
|
+
orange,
|
|
2426
|
+
gold,
|
|
2427
|
+
yellow,
|
|
2428
|
+
lime,
|
|
2429
|
+
green,
|
|
2430
|
+
cyan,
|
|
2431
|
+
blue,
|
|
2432
|
+
geekblue,
|
|
2433
|
+
purple,
|
|
2434
|
+
magenta,
|
|
2435
|
+
grey
|
|
2436
|
+
};
|
|
2437
|
+
var redDark = ["#2a1215", "#431418", "#58181c", "#791a1f", "#a61d24", "#d32029", "#e84749", "#f37370", "#f89f9a", "#fac8c3"];
|
|
2438
|
+
redDark.primary = redDark[5];
|
|
2439
|
+
var volcanoDark = ["#2b1611", "#441d12", "#592716", "#7c3118", "#aa3e19", "#d84a1b", "#e87040", "#f3956a", "#f8b692", "#fad4bc"];
|
|
2440
|
+
volcanoDark.primary = volcanoDark[5];
|
|
2441
|
+
var orangeDark = ["#2b1d11", "#442a11", "#593815", "#7c4a15", "#aa6215", "#d87a16", "#e89a3c", "#f3b765", "#f8cf8d", "#fae3b7"];
|
|
2442
|
+
orangeDark.primary = orangeDark[5];
|
|
2443
|
+
var goldDark = ["#2b2111", "#443111", "#594214", "#7c5914", "#aa7714", "#d89614", "#e8b339", "#f3cc62", "#f8df8b", "#faedb5"];
|
|
2444
|
+
goldDark.primary = goldDark[5];
|
|
2445
|
+
var yellowDark = ["#2b2611", "#443b11", "#595014", "#7c6e14", "#aa9514", "#d8bd14", "#e8d639", "#f3ea62", "#f8f48b", "#fafab5"];
|
|
2446
|
+
yellowDark.primary = yellowDark[5];
|
|
2447
|
+
var limeDark = ["#1f2611", "#2e3c10", "#3e4f13", "#536d13", "#6f9412", "#8bbb11", "#a9d134", "#c9e75d", "#e4f88b", "#f0fab5"];
|
|
2448
|
+
limeDark.primary = limeDark[5];
|
|
2449
|
+
var greenDark = ["#162312", "#1d3712", "#274916", "#306317", "#3c8618", "#49aa19", "#6abe39", "#8fd460", "#b2e58b", "#d5f2bb"];
|
|
2450
|
+
greenDark.primary = greenDark[5];
|
|
2451
|
+
var cyanDark = ["#112123", "#113536", "#144848", "#146262", "#138585", "#13a8a8", "#33bcb7", "#58d1c9", "#84e2d8", "#b2f1e8"];
|
|
2452
|
+
cyanDark.primary = cyanDark[5];
|
|
2453
|
+
var blueDark = ["#111a2c", "#112545", "#15325b", "#15417e", "#1554ad", "#1668dc", "#3c89e8", "#65a9f3", "#8dc5f8", "#b7dcfa"];
|
|
2454
|
+
blueDark.primary = blueDark[5];
|
|
2455
|
+
var geekblueDark = ["#131629", "#161d40", "#1c2755", "#203175", "#263ea0", "#2b4acb", "#5273e0", "#7f9ef3", "#a8c1f8", "#d2e0fa"];
|
|
2456
|
+
geekblueDark.primary = geekblueDark[5];
|
|
2457
|
+
var purpleDark = ["#1a1325", "#24163a", "#301c4d", "#3e2069", "#51258f", "#642ab5", "#854eca", "#ab7ae0", "#cda8f0", "#ebd7fa"];
|
|
2458
|
+
purpleDark.primary = purpleDark[5];
|
|
2459
|
+
var magentaDark = ["#291321", "#40162f", "#551c3b", "#75204f", "#a02669", "#cb2b83", "#e0529c", "#f37fb7", "#f8a8cc", "#fad2e3"];
|
|
2460
|
+
magentaDark.primary = magentaDark[5];
|
|
2461
|
+
var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a", "#6a6a6a", "#7b7b7b", "#888888", "#969696"];
|
|
2462
|
+
greyDark.primary = greyDark[5];
|
|
2463
|
+
|
|
2464
|
+
// src/ColorPicker/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
2465
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2466
|
+
function genPresets(presets = presetPalettes) {
|
|
2467
|
+
return Object.entries(presets).map(([label, colors]) => ({
|
|
2468
|
+
label,
|
|
2469
|
+
colors,
|
|
2470
|
+
key: label
|
|
2471
|
+
}));
|
|
2472
|
+
}
|
|
2473
|
+
function ColorPalettePickerBasic({
|
|
2474
|
+
value,
|
|
2475
|
+
onChange,
|
|
2476
|
+
required,
|
|
2477
|
+
label,
|
|
2478
|
+
error,
|
|
2479
|
+
disabled,
|
|
2480
|
+
allowClear,
|
|
2481
|
+
defaultFormat,
|
|
2482
|
+
className,
|
|
2483
|
+
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35",
|
|
2484
|
+
onClear
|
|
2485
|
+
}) {
|
|
2486
|
+
const { token } = import_antd10.theme.useToken();
|
|
2487
|
+
const presets = genPresets({
|
|
2488
|
+
primary: generate(token.colorPrimary),
|
|
2489
|
+
red,
|
|
2490
|
+
green
|
|
2491
|
+
});
|
|
2492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2493
|
+
import_antd10.ConfigProvider,
|
|
2494
|
+
{
|
|
2495
|
+
theme: {
|
|
2496
|
+
token: {
|
|
2497
|
+
fontFamily: "Kanit",
|
|
2498
|
+
fontSize: 16
|
|
2499
|
+
}
|
|
2500
|
+
},
|
|
2501
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "container-input", children: [
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
2503
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "body-1", children: label }),
|
|
2504
|
+
" ",
|
|
2505
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2506
|
+
] }),
|
|
2507
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
2508
|
+
import_antd10.ColorPicker,
|
|
2509
|
+
{
|
|
2510
|
+
defaultFormat,
|
|
2511
|
+
className: `body-1 w-full ${className ?? ""}`,
|
|
2512
|
+
presets,
|
|
2513
|
+
value,
|
|
2514
|
+
defaultValue: "#ffff",
|
|
2515
|
+
onChange,
|
|
2516
|
+
allowClear,
|
|
2517
|
+
showText: (color) => {
|
|
2518
|
+
const hex = color.toHexString();
|
|
2519
|
+
if (!value) {
|
|
2520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { children: placeholder });
|
|
2521
|
+
}
|
|
2522
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { children: [
|
|
2523
|
+
"(",
|
|
2524
|
+
hex,
|
|
2525
|
+
")"
|
|
2526
|
+
] });
|
|
2527
|
+
},
|
|
2528
|
+
disabled,
|
|
2529
|
+
onClear
|
|
2530
|
+
}
|
|
2531
|
+
),
|
|
2532
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2533
|
+
] })
|
|
2534
|
+
}
|
|
2535
|
+
);
|
|
2536
|
+
}
|
|
2537
|
+
|
|
2538
|
+
// src/Select/SelectField/SelectField.tsx
|
|
2539
|
+
var import_antd11 = require("antd");
|
|
2540
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2541
|
+
function SelectField({
|
|
2542
|
+
value,
|
|
2543
|
+
onChange,
|
|
2544
|
+
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
2545
|
+
label,
|
|
2546
|
+
required,
|
|
2547
|
+
error,
|
|
2548
|
+
disabled,
|
|
2549
|
+
defaultValue,
|
|
2550
|
+
options,
|
|
2551
|
+
mode,
|
|
2552
|
+
prefix,
|
|
2553
|
+
prefixSize = 20,
|
|
2554
|
+
handleSearch,
|
|
2555
|
+
className,
|
|
2556
|
+
onClear
|
|
2557
|
+
}) {
|
|
2558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2559
|
+
import_antd11.ConfigProvider,
|
|
2560
|
+
{
|
|
2561
|
+
theme: {
|
|
2562
|
+
token: {
|
|
2563
|
+
fontFamily: "Kanit",
|
|
2564
|
+
fontSize: 16
|
|
2565
|
+
}
|
|
2566
|
+
},
|
|
2567
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "container-input", children: [
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
2569
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "body-1", children: label }),
|
|
2570
|
+
" ",
|
|
2571
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2572
|
+
] }),
|
|
2573
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2574
|
+
import_antd11.Select,
|
|
2575
|
+
{
|
|
2576
|
+
showSearch: true,
|
|
2577
|
+
value,
|
|
2578
|
+
defaultValue,
|
|
2579
|
+
onChange,
|
|
2580
|
+
className: `body-1 flex justify-center w-full ${className ?? ""}`,
|
|
2581
|
+
placeholder,
|
|
2582
|
+
optionFilterProp: "label",
|
|
2583
|
+
filterOption: (input, option) => (option?.label ?? "").toString().toLowerCase().includes(input.toLowerCase()),
|
|
2584
|
+
disabled,
|
|
2585
|
+
options,
|
|
2586
|
+
mode,
|
|
2587
|
+
onSearch: handleSearch,
|
|
2588
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
2589
|
+
"span",
|
|
2590
|
+
{
|
|
2591
|
+
style: {
|
|
2592
|
+
width: prefixSize,
|
|
2593
|
+
height: prefixSize,
|
|
2594
|
+
display: "flex",
|
|
2595
|
+
alignItems: "center",
|
|
2596
|
+
justifyContent: "center"
|
|
2597
|
+
},
|
|
2598
|
+
children: prefix
|
|
2599
|
+
}
|
|
2600
|
+
) : void 0,
|
|
2601
|
+
allowClear: true,
|
|
2602
|
+
onClear
|
|
2603
|
+
}
|
|
2604
|
+
),
|
|
2605
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2606
|
+
] })
|
|
2607
|
+
}
|
|
2608
|
+
);
|
|
2609
|
+
}
|
|
2610
|
+
|
|
2611
|
+
// src/Select/SelectFieldGroup/SelectFieldGroup.tsx
|
|
2612
|
+
var import_antd12 = require("antd");
|
|
2613
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2614
|
+
function SelectFieldGroup({
|
|
2615
|
+
value,
|
|
2616
|
+
onChange,
|
|
2617
|
+
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
2618
|
+
label,
|
|
2619
|
+
required,
|
|
2620
|
+
error,
|
|
2621
|
+
disabled,
|
|
2622
|
+
defaultValue,
|
|
2623
|
+
options,
|
|
2624
|
+
mode,
|
|
2625
|
+
prefix,
|
|
2626
|
+
prefixSize = 20,
|
|
2627
|
+
handleSearch,
|
|
2628
|
+
className
|
|
2629
|
+
}) {
|
|
2630
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2631
|
+
import_antd12.ConfigProvider,
|
|
2632
|
+
{
|
|
2633
|
+
theme: {
|
|
2634
|
+
token: {
|
|
2635
|
+
fontFamily: "Kanit"
|
|
2636
|
+
}
|
|
2637
|
+
},
|
|
2638
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "container-input", children: [
|
|
2639
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
2640
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "body-1", children: label }),
|
|
2641
|
+
" ",
|
|
2642
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2643
|
+
] }),
|
|
2644
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2645
|
+
import_antd12.Select,
|
|
2646
|
+
{
|
|
2647
|
+
showSearch: true,
|
|
2648
|
+
value,
|
|
2649
|
+
defaultValue,
|
|
2650
|
+
onChange,
|
|
2651
|
+
className: `body-1 flex justify-center w-full ${className ?? ""}`,
|
|
2652
|
+
placeholder,
|
|
2653
|
+
optionFilterProp: "label",
|
|
2654
|
+
filterOption: (input, option) => (option?.label ?? "").toString().toLowerCase().includes(input.toLowerCase()),
|
|
2655
|
+
disabled,
|
|
2656
|
+
options,
|
|
2657
|
+
mode,
|
|
2658
|
+
onSearch: handleSearch,
|
|
2659
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
2660
|
+
"span",
|
|
2661
|
+
{
|
|
2662
|
+
style: {
|
|
2663
|
+
width: prefixSize,
|
|
2664
|
+
height: prefixSize,
|
|
2665
|
+
display: "flex",
|
|
2666
|
+
alignItems: "center",
|
|
2667
|
+
justifyContent: "center"
|
|
2668
|
+
},
|
|
2669
|
+
children: prefix
|
|
2670
|
+
}
|
|
2671
|
+
) : void 0,
|
|
2672
|
+
allowClear: true
|
|
2673
|
+
}
|
|
2674
|
+
),
|
|
2675
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2676
|
+
] })
|
|
2677
|
+
}
|
|
2678
|
+
);
|
|
2679
|
+
}
|
|
2680
|
+
|
|
2681
|
+
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
2682
|
+
var import_antd13 = require("antd");
|
|
2683
|
+
|
|
2684
|
+
// src/Select/SelectFieldStatus/StatusMockup.ts
|
|
2685
|
+
var status = [
|
|
2686
|
+
{ value: "1", label: "\u0E40\u0E1B\u0E34\u0E14", color: "var(--color-gray-500)" },
|
|
2687
|
+
{ value: "2", label: "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E14\u0E33\u0E40\u0E19\u0E34\u0E19\u0E01\u0E32\u0E23", color: "var(--color-yellow-400)" },
|
|
2688
|
+
{ value: "3", label: "\u0E23\u0E2D\u0E15\u0E23\u0E27\u0E08\u0E2A\u0E2D\u0E1A", color: "var(--color-red-400)" },
|
|
2689
|
+
{ value: "4", label: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-green-400)" },
|
|
2690
|
+
{ value: "5", label: "\u0E16\u0E39\u0E01\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01", color: "var(--color-gray-300)" }
|
|
2691
|
+
];
|
|
2692
|
+
|
|
2693
|
+
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
2694
|
+
var import_icons = require("@ant-design/icons");
|
|
2695
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2696
|
+
function SelectFieldStatus({
|
|
2697
|
+
value,
|
|
2698
|
+
onChange,
|
|
2699
|
+
placeholder,
|
|
2700
|
+
label,
|
|
2701
|
+
required,
|
|
2702
|
+
disabled,
|
|
2703
|
+
error,
|
|
2704
|
+
options,
|
|
2705
|
+
className
|
|
2706
|
+
}) {
|
|
2707
|
+
const selectedItem = status.find((s) => s.value === value);
|
|
2708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2709
|
+
import_antd13.ConfigProvider,
|
|
2710
|
+
{
|
|
2711
|
+
theme: {
|
|
2712
|
+
components: {
|
|
2713
|
+
Select: {
|
|
2714
|
+
selectorBg: selectedItem?.color || "#ffff",
|
|
2715
|
+
hoverBorderColor: "#D9D9D9",
|
|
2716
|
+
activeBorderColor: "#D9D9D9",
|
|
2717
|
+
activeOutlineColor: "#D9D9D9"
|
|
2718
|
+
}
|
|
2719
|
+
},
|
|
2720
|
+
token: {
|
|
2721
|
+
fontFamily: "Kanit"
|
|
2722
|
+
}
|
|
2723
|
+
},
|
|
2724
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "container-input", children: [
|
|
2725
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
2726
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "body-1", children: label }),
|
|
2727
|
+
" ",
|
|
2728
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2729
|
+
] }),
|
|
2730
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2731
|
+
import_antd13.Select,
|
|
2732
|
+
{
|
|
2733
|
+
disabled,
|
|
2734
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_icons.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2735
|
+
value,
|
|
2736
|
+
onChange,
|
|
2737
|
+
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
2738
|
+
placeholder,
|
|
2739
|
+
optionFilterProp: "label",
|
|
2740
|
+
filterOption: (input, option) => (option?.label ?? "").toString().toLowerCase().includes(input.toLowerCase()),
|
|
2741
|
+
options,
|
|
2742
|
+
showSearch: true
|
|
2743
|
+
}
|
|
2744
|
+
),
|
|
2745
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2746
|
+
] })
|
|
2747
|
+
}
|
|
2748
|
+
);
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
2752
|
+
var import_antd14 = require("antd");
|
|
2753
|
+
|
|
2754
|
+
// src/Select/SelectFieldStatusReport/StatusReportMockup.ts
|
|
2755
|
+
var status2 = [
|
|
2756
|
+
{ value: "1", label: "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-green-400)" },
|
|
2757
|
+
{ value: "2", label: "\u0E22\u0E31\u0E07\u0E44\u0E21\u0E48\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19", color: "var(--color-red-500)" }
|
|
2758
|
+
];
|
|
2759
|
+
|
|
2760
|
+
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
2761
|
+
var import_icons2 = require("@ant-design/icons");
|
|
2762
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2763
|
+
function SelectFieldStatusReport({
|
|
2764
|
+
value,
|
|
2765
|
+
onChange,
|
|
2766
|
+
placeholder,
|
|
2767
|
+
label,
|
|
2768
|
+
required,
|
|
2769
|
+
disabled,
|
|
2770
|
+
error,
|
|
2771
|
+
className,
|
|
2772
|
+
options
|
|
2773
|
+
}) {
|
|
2774
|
+
const selectedItem = status2.find((s) => s.value === value);
|
|
2775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2776
|
+
import_antd14.ConfigProvider,
|
|
2777
|
+
{
|
|
2778
|
+
theme: {
|
|
2779
|
+
components: {
|
|
2780
|
+
Select: {
|
|
2781
|
+
selectorBg: selectedItem?.color || "#ffff",
|
|
2782
|
+
hoverBorderColor: "#D9D9D9",
|
|
2783
|
+
activeBorderColor: "#D9D9D9",
|
|
2784
|
+
activeOutlineColor: "#D9D9D9"
|
|
2785
|
+
}
|
|
2786
|
+
},
|
|
2787
|
+
token: {
|
|
2788
|
+
fontFamily: "Kanit"
|
|
2789
|
+
}
|
|
2790
|
+
},
|
|
2791
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "container-input", children: [
|
|
2792
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { children: [
|
|
2793
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "body-1", children: label }),
|
|
2794
|
+
" ",
|
|
2795
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2796
|
+
] }),
|
|
2797
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2798
|
+
import_antd14.Select,
|
|
2799
|
+
{
|
|
2800
|
+
disabled,
|
|
2801
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_icons2.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2802
|
+
value,
|
|
2803
|
+
onChange,
|
|
2804
|
+
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
2805
|
+
placeholder,
|
|
2806
|
+
optionFilterProp: "label",
|
|
2807
|
+
filterOption: (input, option) => (option?.label ?? "").toString().toLowerCase().includes(input.toLowerCase()),
|
|
2808
|
+
options,
|
|
2809
|
+
showSearch: true
|
|
2810
|
+
}
|
|
2811
|
+
),
|
|
2812
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2813
|
+
] })
|
|
2814
|
+
}
|
|
2815
|
+
);
|
|
2816
|
+
}
|
|
2817
|
+
|
|
2818
|
+
// src/Select/SelectFieldTag/SelectFieldTag.tsx
|
|
2819
|
+
var import_antd15 = require("antd");
|
|
2820
|
+
var import_react8 = require("react");
|
|
2821
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2822
|
+
function SelectFieldTag({
|
|
2823
|
+
label,
|
|
2824
|
+
required,
|
|
2825
|
+
placeholder,
|
|
2826
|
+
options,
|
|
2827
|
+
error,
|
|
2828
|
+
value: controlledValue,
|
|
2829
|
+
className,
|
|
2830
|
+
onChange,
|
|
2831
|
+
onClear
|
|
2832
|
+
}) {
|
|
2833
|
+
const [internalValue, setInternalValue] = (0, import_react8.useState)([]);
|
|
2834
|
+
const isControlled = controlledValue !== void 0;
|
|
2835
|
+
const value = isControlled ? controlledValue : internalValue;
|
|
2836
|
+
const [searchWord, setSearchWord] = (0, import_react8.useState)("");
|
|
2837
|
+
const handleChange = (val) => {
|
|
2838
|
+
const trimValue = val.map((v) => v.trim());
|
|
2839
|
+
const filtered = trimValue.filter((v) => v.trim() !== "");
|
|
2840
|
+
const latest = filtered.slice(-1);
|
|
2841
|
+
if (!isControlled) {
|
|
2842
|
+
setInternalValue(latest);
|
|
2843
|
+
}
|
|
2844
|
+
setSearchWord("");
|
|
2845
|
+
onChange?.(latest);
|
|
2846
|
+
};
|
|
2847
|
+
const handleSearch = (text) => {
|
|
2848
|
+
setSearchWord(text.trimStart());
|
|
2849
|
+
if (!isControlled) {
|
|
2850
|
+
setInternalValue([]);
|
|
2851
|
+
}
|
|
2852
|
+
onChange?.([]);
|
|
2853
|
+
};
|
|
2854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2855
|
+
import_antd15.ConfigProvider,
|
|
2856
|
+
{
|
|
2857
|
+
theme: {
|
|
2858
|
+
token: {
|
|
2859
|
+
fontFamily: "Kanit"
|
|
2860
|
+
}
|
|
2861
|
+
},
|
|
2862
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "container-input", children: [
|
|
2863
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
2864
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "body-1", children: label }),
|
|
2865
|
+
" ",
|
|
2866
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2867
|
+
] }),
|
|
2868
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2869
|
+
import_antd15.Select,
|
|
2870
|
+
{
|
|
2871
|
+
mode: "tags",
|
|
2872
|
+
className: `body-1 flex justify-center w-full ${className ?? ""}`,
|
|
2873
|
+
placeholder,
|
|
2874
|
+
value,
|
|
2875
|
+
onChange: handleChange,
|
|
2876
|
+
onSearch: handleSearch,
|
|
2877
|
+
filterOption: (input, option) => {
|
|
2878
|
+
if (!input.trim()) return true;
|
|
2879
|
+
return (option?.label).toLowerCase().includes(input.toLowerCase());
|
|
2880
|
+
},
|
|
2881
|
+
searchValue: searchWord,
|
|
2882
|
+
options,
|
|
2883
|
+
allowClear: true,
|
|
2884
|
+
onClear
|
|
2885
|
+
}
|
|
2886
|
+
),
|
|
2887
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
2888
|
+
] })
|
|
2889
|
+
}
|
|
2890
|
+
);
|
|
2891
|
+
}
|
|
2892
|
+
|
|
2893
|
+
// src/Select/SelectCustom/SelectCustom.tsx
|
|
2894
|
+
var import_icons_react8 = require("@tabler/icons-react");
|
|
2895
|
+
var import_antd16 = require("antd");
|
|
2896
|
+
var import_react9 = require("react");
|
|
2897
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2898
|
+
function SelectCustom({
|
|
2899
|
+
label = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
|
|
2900
|
+
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
2901
|
+
options,
|
|
2902
|
+
required = false,
|
|
2903
|
+
onChange,
|
|
2904
|
+
error,
|
|
2905
|
+
onClear
|
|
2906
|
+
}) {
|
|
2907
|
+
const [value, setValue] = (0, import_react9.useState)([]);
|
|
2908
|
+
const [valueList, setValueList] = (0, import_react9.useState)([]);
|
|
2909
|
+
const handleChange = (selectedValues) => {
|
|
2910
|
+
const newValues = selectedValues.filter((v) => !valueList.includes(v));
|
|
2911
|
+
setValueList((prev) => {
|
|
2912
|
+
const updated = [...prev, ...newValues];
|
|
2913
|
+
onChange && onChange(updated);
|
|
2914
|
+
return updated;
|
|
2915
|
+
});
|
|
2916
|
+
setValue([]);
|
|
2917
|
+
};
|
|
2918
|
+
const handleDelete = (val) => {
|
|
2919
|
+
setValueList((prev) => {
|
|
2920
|
+
const updated = prev.filter((v) => v !== val);
|
|
2921
|
+
onChange && onChange(updated);
|
|
2922
|
+
return updated;
|
|
2923
|
+
});
|
|
2924
|
+
};
|
|
2925
|
+
const filteredOptions = options.filter((opt) => !valueList.includes(opt.value)).map((opt) => ({ value: opt.value, label: opt.label }));
|
|
2926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2927
|
+
import_antd16.ConfigProvider,
|
|
2928
|
+
{
|
|
2929
|
+
theme: {
|
|
2930
|
+
token: {
|
|
2931
|
+
fontFamily: "Kanit",
|
|
2932
|
+
fontSize: 16
|
|
2933
|
+
}
|
|
2934
|
+
},
|
|
2935
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "container-input", children: [
|
|
2936
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { children: [
|
|
2937
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "body-1", children: label }),
|
|
2938
|
+
" ",
|
|
2939
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2940
|
+
] }),
|
|
2941
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
2942
|
+
import_antd16.Select,
|
|
2943
|
+
{
|
|
2944
|
+
value,
|
|
2945
|
+
onChange: handleChange,
|
|
2946
|
+
placeholder,
|
|
2947
|
+
options: filteredOptions,
|
|
2948
|
+
mode: "tags",
|
|
2949
|
+
onClear
|
|
2950
|
+
}
|
|
2951
|
+
),
|
|
2952
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { className: "text-red-500 caption-1", children: error }),
|
|
2953
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "w-full p-[2px] overflow-y-auto", children: valueList.map((v, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex justify-between items-center py-[2px] body-1", children: [
|
|
2954
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex flex-row gap-[8px]", children: [
|
|
2955
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("p", { children: [
|
|
2956
|
+
index + 1,
|
|
2957
|
+
"."
|
|
2958
|
+
] }),
|
|
2959
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("p", { children: v })
|
|
2960
|
+
] }),
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_icons_react8.IconTrash, { className: "cursor-pointer", onClick: () => handleDelete(v) })
|
|
2962
|
+
] }, index)) })
|
|
2963
|
+
] })
|
|
2964
|
+
}
|
|
2965
|
+
);
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
// src/SortFilter/SortFilter.tsx
|
|
2969
|
+
var import_antd17 = require("antd");
|
|
2970
|
+
var import_icons3 = require("@ant-design/icons");
|
|
2971
|
+
|
|
2972
|
+
// src/SortFilter/DataMockSortFilter.ts
|
|
2973
|
+
var years = [
|
|
2974
|
+
{ value: "\u0E1B\u0E35 2566", label: "\u0E1B\u0E35 2566" },
|
|
2975
|
+
{ value: "\u0E1B\u0E35 2567", label: "\u0E1B\u0E35 2567" },
|
|
2976
|
+
{ value: "\u0E1B\u0E35 2568", label: "\u0E1B\u0E35 2568" }
|
|
2977
|
+
];
|
|
2978
|
+
var months = [
|
|
2979
|
+
{ value: "\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21", label: "\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21" },
|
|
2980
|
+
{ value: "\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C", label: "\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C" },
|
|
2981
|
+
{ value: "\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21", label: "\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21" },
|
|
2982
|
+
{ value: "\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19", label: "\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19" },
|
|
2983
|
+
{ value: "\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21", label: "\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21" },
|
|
2984
|
+
{ value: "\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19", label: "\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19" },
|
|
2985
|
+
{ value: "\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21", label: "\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21" },
|
|
2986
|
+
{ value: "\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21", label: "\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21" },
|
|
2987
|
+
{ value: "\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19", label: "\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19" },
|
|
2988
|
+
{ value: "\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21", label: "\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21" },
|
|
2989
|
+
{ value: "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19", label: "\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19" },
|
|
2990
|
+
{ value: "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21", label: "\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21" }
|
|
2991
|
+
];
|
|
2992
|
+
var quarters = [
|
|
2993
|
+
{ value: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 1", label: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 1" },
|
|
2994
|
+
{ value: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 2", label: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 2" },
|
|
2995
|
+
{ value: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 3", label: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 3" },
|
|
2996
|
+
{ value: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 4", label: "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A 4" }
|
|
2997
|
+
];
|
|
2998
|
+
|
|
2999
|
+
// src/SortFilter/SortFilter.tsx
|
|
3000
|
+
var import_react10 = require("react");
|
|
3001
|
+
var import_icons_react9 = require("@tabler/icons-react");
|
|
3002
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3003
|
+
function SortFilter({
|
|
3004
|
+
showYear = true,
|
|
3005
|
+
showQuarter = true,
|
|
3006
|
+
showMonth = true,
|
|
3007
|
+
onSortClick,
|
|
3008
|
+
onFilterClick
|
|
3009
|
+
}) {
|
|
3010
|
+
const [yearValue, setYearValue] = (0, import_react10.useState)();
|
|
3011
|
+
const [monthValue, setMonthValue] = (0, import_react10.useState)();
|
|
3012
|
+
const [quarterValue, setQuartersValue] = (0, import_react10.useState)();
|
|
3013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3014
|
+
import_antd17.ConfigProvider,
|
|
3015
|
+
{
|
|
3016
|
+
theme: {
|
|
3017
|
+
token: {
|
|
3018
|
+
fontFamily: "Kanit"
|
|
3019
|
+
}
|
|
3020
|
+
},
|
|
3021
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "w-full flex items-center justify-between", children: [
|
|
3022
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "w-full flex gap-[10px]", children: [
|
|
3023
|
+
showYear && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3024
|
+
SelectField,
|
|
3025
|
+
{
|
|
3026
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons3.CalendarOutlined, {}),
|
|
3027
|
+
onChange: setYearValue,
|
|
3028
|
+
options: years.map((s) => ({
|
|
3029
|
+
value: s.value,
|
|
3030
|
+
label: s.label
|
|
3031
|
+
})),
|
|
3032
|
+
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E1B\u0E35",
|
|
3033
|
+
value: yearValue
|
|
3034
|
+
}
|
|
3035
|
+
) }),
|
|
3036
|
+
showMonth && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3037
|
+
SelectField,
|
|
3038
|
+
{
|
|
3039
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons3.CalendarOutlined, {}),
|
|
3040
|
+
onChange: setMonthValue,
|
|
3041
|
+
options: months.map((s) => ({
|
|
3042
|
+
value: s.value,
|
|
3043
|
+
label: s.label
|
|
3044
|
+
})),
|
|
3045
|
+
value: monthValue,
|
|
3046
|
+
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
3047
|
+
}
|
|
3048
|
+
) }),
|
|
3049
|
+
showQuarter && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3050
|
+
SelectField,
|
|
3051
|
+
{
|
|
3052
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_icons3.CalendarOutlined, {}),
|
|
3053
|
+
onChange: setQuartersValue,
|
|
3054
|
+
options: quarters.map((s) => ({
|
|
3055
|
+
value: s.value,
|
|
3056
|
+
label: s.label
|
|
3057
|
+
})),
|
|
3058
|
+
value: quarterValue,
|
|
3059
|
+
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A"
|
|
3060
|
+
}
|
|
3061
|
+
) })
|
|
3062
|
+
] }),
|
|
3063
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex gap-[10px]", children: [
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3065
|
+
import_icons_react9.IconSortDescending,
|
|
3066
|
+
{
|
|
3067
|
+
size: 24,
|
|
3068
|
+
className: "cursor-pointer",
|
|
3069
|
+
onClick: onSortClick
|
|
3070
|
+
}
|
|
3071
|
+
),
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
3073
|
+
import_icons_react9.IconFilter,
|
|
3074
|
+
{
|
|
3075
|
+
size: 24,
|
|
3076
|
+
className: "cursor-pointer",
|
|
3077
|
+
onClick: onFilterClick
|
|
3078
|
+
}
|
|
3079
|
+
)
|
|
3080
|
+
] })
|
|
3081
|
+
] })
|
|
3082
|
+
}
|
|
3083
|
+
);
|
|
3084
|
+
}
|
|
3085
|
+
|
|
3086
|
+
// src/Upload/FileUploader/FileUploader.tsx
|
|
3087
|
+
var import_icons_react10 = require("@tabler/icons-react");
|
|
3088
|
+
var import_react11 = require("react");
|
|
3089
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3090
|
+
function FileUploader({
|
|
3091
|
+
onUpload,
|
|
3092
|
+
onError,
|
|
3093
|
+
onRemove,
|
|
3094
|
+
accept,
|
|
3095
|
+
maxSize,
|
|
3096
|
+
disabled,
|
|
3097
|
+
mode = "drop",
|
|
3098
|
+
description,
|
|
3099
|
+
label
|
|
3100
|
+
}) {
|
|
3101
|
+
const [fileList, setFileList] = (0, import_react11.useState)([]);
|
|
3102
|
+
const [uploading, setUploading] = (0, import_react11.useState)(false);
|
|
3103
|
+
const [dragActive, setDragActive] = (0, import_react11.useState)(false);
|
|
3104
|
+
const inputRef = (0, import_react11.useRef)(null);
|
|
3105
|
+
const validateFile = (file) => {
|
|
3106
|
+
if (accept && !accept.includes(file.type)) {
|
|
3107
|
+
onError?.(`Invalid file type. file: ${file.name}`);
|
|
3108
|
+
throw new Error("Invalid file type");
|
|
3109
|
+
}
|
|
3110
|
+
if (maxSize && file.size > maxSize * 1024 * 1024) {
|
|
3111
|
+
onError?.(`Invalid file size. file: ${file.name}`);
|
|
3112
|
+
throw new Error("Invalid file size");
|
|
3113
|
+
}
|
|
3114
|
+
return true;
|
|
3115
|
+
};
|
|
3116
|
+
const handleUploadClick = () => {
|
|
3117
|
+
inputRef.current?.click();
|
|
3118
|
+
};
|
|
3119
|
+
const handleRemoveFile = async (index) => {
|
|
3120
|
+
try {
|
|
3121
|
+
if (onRemove) {
|
|
3122
|
+
await onRemove(index);
|
|
3123
|
+
}
|
|
3124
|
+
const updatedList = [...fileList];
|
|
3125
|
+
updatedList.splice(index, 1);
|
|
3126
|
+
setFileList(updatedList);
|
|
3127
|
+
} catch (error) {
|
|
3128
|
+
console.log(error);
|
|
3129
|
+
}
|
|
3130
|
+
};
|
|
3131
|
+
const handleUpload = (event) => {
|
|
3132
|
+
handleFileChange(event.target.files);
|
|
3133
|
+
};
|
|
3134
|
+
const handleDrop = (event) => {
|
|
3135
|
+
event.preventDefault();
|
|
3136
|
+
setDragActive(false);
|
|
3137
|
+
if (disabled) return;
|
|
3138
|
+
handleFileChange(event.dataTransfer.files);
|
|
3139
|
+
};
|
|
3140
|
+
const handleFileChange = async (files) => {
|
|
3141
|
+
if (!files) return;
|
|
3142
|
+
const fileArray = Array.from(files);
|
|
3143
|
+
for (const file of fileArray) {
|
|
3144
|
+
if (!validateFile(file)) continue;
|
|
3145
|
+
setUploading(true);
|
|
3146
|
+
try {
|
|
3147
|
+
if (onUpload) {
|
|
3148
|
+
await onUpload(file);
|
|
3149
|
+
}
|
|
3150
|
+
setFileList((prev) => [...prev, file]);
|
|
3151
|
+
} catch (err) {
|
|
3152
|
+
console.log("catch");
|
|
3153
|
+
console.error(err);
|
|
3154
|
+
} finally {
|
|
3155
|
+
setUploading(false);
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
if (inputRef.current) inputRef.current.value = "";
|
|
3159
|
+
};
|
|
3160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "w-full", children: [
|
|
3161
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "body-1", children: label }),
|
|
3162
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { children: [
|
|
3163
|
+
mode === "upload" ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3164
|
+
"button",
|
|
3165
|
+
{
|
|
3166
|
+
type: "button",
|
|
3167
|
+
onClick: handleUploadClick,
|
|
3168
|
+
className: `h-[34px] flex justify-center items-center gap-2 w-full rounded-[2px] border border-gray-200 body-1
|
|
3169
|
+
${disabled ? "cursor-not-allowed text-gray-400 bg-gray-100" : "cursor-pointer hover:text-primary-400 hover:border-primary-200 duration-300"}`,
|
|
3170
|
+
disabled: disabled ? disabled : uploading,
|
|
3171
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
3172
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Loader, { size: 15 }),
|
|
3173
|
+
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
3174
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
3175
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons_react10.IconUpload, { size: 15, className: "text-gray-400" }),
|
|
3176
|
+
" \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
|
|
3177
|
+
] })
|
|
3178
|
+
}
|
|
3179
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3180
|
+
"div",
|
|
3181
|
+
{
|
|
3182
|
+
className: `min-w-[400px] min-h-[120px] flex justify-center items-center border-2 border-dashed rounded-md p-4 transition-colors body-1
|
|
3183
|
+
${dragActive ? "border-primary-500 bg-primary-50" : "border-gray-300 bg-white"}
|
|
3184
|
+
${disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
3185
|
+
`,
|
|
3186
|
+
onClick: handleUploadClick,
|
|
3187
|
+
onDragOver: (e) => {
|
|
3188
|
+
e.preventDefault();
|
|
3189
|
+
if (!disabled) setDragActive(true);
|
|
3190
|
+
},
|
|
3191
|
+
onDragLeave: () => setDragActive(false),
|
|
3192
|
+
onDrop: handleDrop,
|
|
3193
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex justify-center items-center gap-2", children: [
|
|
3194
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Loader, { size: 15 }),
|
|
3195
|
+
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
3196
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [
|
|
3197
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons_react10.IconUpload, { size: 20 }),
|
|
3198
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("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" }),
|
|
3199
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("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" })
|
|
3200
|
+
] })
|
|
3201
|
+
}
|
|
3202
|
+
),
|
|
3203
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3204
|
+
"input",
|
|
3205
|
+
{
|
|
3206
|
+
type: "file",
|
|
3207
|
+
multiple: true,
|
|
3208
|
+
ref: inputRef,
|
|
3209
|
+
onChange: handleUpload,
|
|
3210
|
+
style: { display: "none" },
|
|
3211
|
+
accept: accept?.join(","),
|
|
3212
|
+
disabled
|
|
3213
|
+
}
|
|
3214
|
+
)
|
|
3215
|
+
] }),
|
|
3216
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "text-gray-400 body-4", children: description }),
|
|
3217
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "mt-[8px]", children: fileList.length !== 0 && fileList.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-2 rounded-[4px] px-[8px] py-[4px] body-1", children: [
|
|
3218
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-2 w-[75%] overflow-hidden", children: [
|
|
3219
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-[15px] h-[15px]", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_icons_react10.IconPaperclip, { size: 15 }) }),
|
|
3220
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("span", { className: "truncate", children: file.name })
|
|
3221
|
+
] }),
|
|
3222
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3223
|
+
import_icons_react10.IconTrash,
|
|
3224
|
+
{
|
|
3225
|
+
size: 20,
|
|
3226
|
+
className: "ml-auto hover:text-red-500 cursor-pointer",
|
|
3227
|
+
onClick: () => handleRemoveFile(index)
|
|
3228
|
+
}
|
|
3229
|
+
)
|
|
3230
|
+
] }, index)) })
|
|
3231
|
+
] });
|
|
3232
|
+
}
|
|
3233
|
+
|
|
3234
|
+
// src/Message/Message/Message.tsx
|
|
3235
|
+
var messageApi = null;
|
|
3236
|
+
function setMessageApi(api) {
|
|
3237
|
+
messageApi = api;
|
|
3238
|
+
}
|
|
3239
|
+
function messageSuccess(content) {
|
|
3240
|
+
messageApi?.success({ content, className: "message message-success" });
|
|
3241
|
+
}
|
|
3242
|
+
function messageError(content) {
|
|
3243
|
+
messageApi?.error({ content, className: "message message-error" });
|
|
3244
|
+
}
|
|
3245
|
+
function messageWarning(content) {
|
|
3246
|
+
messageApi?.warning({ content, className: "message message-warning" });
|
|
3247
|
+
}
|
|
3248
|
+
function messageInfo(content) {
|
|
3249
|
+
messageApi?.info({ content, className: "message message-info" });
|
|
3250
|
+
}
|
|
3251
|
+
function messageLoading(content, duration) {
|
|
3252
|
+
messageApi?.loading({ content, duration, className: "message message-loading" });
|
|
3253
|
+
}
|
|
3254
|
+
|
|
3255
|
+
// src/Breadcrumb/Breadcrumb.tsx
|
|
3256
|
+
var import_antd18 = require("antd");
|
|
3257
|
+
var import_antd19 = require("antd");
|
|
3258
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3259
|
+
function Breadcrumbs({
|
|
3260
|
+
items,
|
|
3261
|
+
separator,
|
|
3262
|
+
itemRender,
|
|
3263
|
+
classname,
|
|
3264
|
+
params
|
|
3265
|
+
}) {
|
|
3266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3267
|
+
import_antd18.ConfigProvider,
|
|
3268
|
+
{
|
|
3269
|
+
theme: {
|
|
3270
|
+
token: {
|
|
3271
|
+
fontFamily: "Kanit"
|
|
3272
|
+
}
|
|
3273
|
+
},
|
|
3274
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3275
|
+
import_antd19.Breadcrumb,
|
|
3276
|
+
{
|
|
3277
|
+
items,
|
|
3278
|
+
separator,
|
|
3279
|
+
itemRender,
|
|
3280
|
+
className: classname,
|
|
3281
|
+
params
|
|
3282
|
+
}
|
|
3283
|
+
)
|
|
3284
|
+
}
|
|
3285
|
+
);
|
|
3286
|
+
}
|
|
3287
|
+
|
|
3288
|
+
// src/HeadingPage/HeadingPage.tsx
|
|
3289
|
+
var import_antd20 = require("antd");
|
|
3290
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3291
|
+
function HeadingPage({ Heading }) {
|
|
3292
|
+
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
|
|
3293
|
+
weekday: "long",
|
|
3294
|
+
day: "numeric",
|
|
3295
|
+
month: "long",
|
|
3296
|
+
year: "numeric"
|
|
3297
|
+
});
|
|
3298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
3299
|
+
import_antd20.ConfigProvider,
|
|
3300
|
+
{
|
|
3301
|
+
theme: {
|
|
3302
|
+
token: {
|
|
3303
|
+
fontFamily: "Kanit"
|
|
3304
|
+
}
|
|
3305
|
+
},
|
|
3306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("div", { className: "flex flex-col gap-[10px] px-[20px] py-[10px]", children: [
|
|
3307
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "headline-5", children: Heading }),
|
|
3308
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsxs)("p", { className: "body-1", children: [
|
|
3309
|
+
" \u0E27\u0E31\u0E19\u0E19\u0E35\u0E49 ",
|
|
3310
|
+
today
|
|
3311
|
+
] })
|
|
3312
|
+
] })
|
|
3313
|
+
}
|
|
3314
|
+
);
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
// src/Progress/ProgressBar.tsx
|
|
3318
|
+
var import_antd21 = require("antd");
|
|
3319
|
+
var import_react12 = require("react");
|
|
3320
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3321
|
+
function ProgressBar({
|
|
3322
|
+
percent = 0,
|
|
3323
|
+
size = "default",
|
|
3324
|
+
checkpoints = [],
|
|
3325
|
+
showInfo,
|
|
3326
|
+
trailColor = "#DBE0E5",
|
|
3327
|
+
type,
|
|
3328
|
+
strokeLinecap,
|
|
3329
|
+
strokeWidth,
|
|
3330
|
+
steps,
|
|
3331
|
+
isCheckPoints
|
|
3332
|
+
}) {
|
|
3333
|
+
const [barWidth, setBarWidth] = (0, import_react12.useState)(0);
|
|
3334
|
+
const progressRef = (0, import_react12.useRef)(null);
|
|
3335
|
+
let strokeColor = "--color-green-500";
|
|
3336
|
+
const defaultStrokeWidth = type === "circle" ? 13 : strokeWidth ?? 8;
|
|
3337
|
+
const defaultSize = type === "circle" ? 43 : size;
|
|
3338
|
+
if (percent < 100 && checkpoints.length > 0) {
|
|
3339
|
+
const minCheckpoint = Math.min(...checkpoints);
|
|
3340
|
+
strokeColor = percent >= minCheckpoint ? "var(--color-green-500)" : "var(--color-red-500)";
|
|
3341
|
+
}
|
|
3342
|
+
(0, import_react12.useEffect)(() => {
|
|
3343
|
+
const inner = progressRef.current?.querySelector(".ant-progress-inner");
|
|
3344
|
+
if (!inner) return;
|
|
3345
|
+
const observer = new ResizeObserver(() => {
|
|
3346
|
+
setBarWidth(inner.offsetWidth);
|
|
3347
|
+
});
|
|
3348
|
+
observer.observe(inner);
|
|
3349
|
+
return () => observer.disconnect();
|
|
3350
|
+
}, []);
|
|
3351
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3352
|
+
import_antd21.ConfigProvider,
|
|
3353
|
+
{
|
|
3354
|
+
theme: {
|
|
3355
|
+
token: {
|
|
3356
|
+
fontFamily: "Kanit"
|
|
3357
|
+
}
|
|
3358
|
+
},
|
|
3359
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "relative w-full", ref: progressRef, children: [
|
|
3360
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3361
|
+
import_antd21.Progress,
|
|
3362
|
+
{
|
|
3363
|
+
className: "w-full",
|
|
3364
|
+
percent,
|
|
3365
|
+
size: defaultSize,
|
|
3366
|
+
type,
|
|
3367
|
+
showInfo,
|
|
3368
|
+
trailColor,
|
|
3369
|
+
format: (percent2) => `${percent2}%`,
|
|
3370
|
+
strokeLinecap,
|
|
3371
|
+
strokeWidth: defaultStrokeWidth,
|
|
3372
|
+
steps,
|
|
3373
|
+
strokeColor
|
|
3374
|
+
}
|
|
3375
|
+
),
|
|
3376
|
+
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
3377
|
+
"div",
|
|
3378
|
+
{
|
|
3379
|
+
className: "checkpoint absolute top-0",
|
|
3380
|
+
style: {
|
|
3381
|
+
left: `${cp / 100 * barWidth}px`,
|
|
3382
|
+
width: 0,
|
|
3383
|
+
height: 0,
|
|
3384
|
+
borderLeft: "6px solid transparent",
|
|
3385
|
+
borderRight: "6px solid transparent",
|
|
3386
|
+
borderTop: "10px solid red",
|
|
3387
|
+
transform: "translateX(-50%)"
|
|
3388
|
+
}
|
|
3389
|
+
},
|
|
3390
|
+
cp
|
|
3391
|
+
))
|
|
3392
|
+
] })
|
|
3393
|
+
}
|
|
3394
|
+
);
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3397
|
+
// src/KpiSection/KpiSection.tsx
|
|
3398
|
+
var import_antd22 = require("antd");
|
|
3399
|
+
var import_react14 = require("react");
|
|
3400
|
+
|
|
3401
|
+
// src/KpiSection/hooks/useGetKpiSection.ts
|
|
3402
|
+
var import_react13 = require("react");
|
|
3403
|
+
var import_cuid = __toESM(require("cuid"), 1);
|
|
3404
|
+
function useGetKpiSection() {
|
|
3405
|
+
const [nameKpi, setNameKpi] = (0, import_react13.useState)("");
|
|
3406
|
+
const [kpiValue, setKpiValue] = (0, import_react13.useState)("");
|
|
3407
|
+
const [unitValue, setUnitValue] = (0, import_react13.useState)("");
|
|
3408
|
+
const [kpiList, setKpiList] = (0, import_react13.useState)([]);
|
|
3409
|
+
const [editingBackup, setEditingBackup] = (0, import_react13.useState)({});
|
|
3410
|
+
const [selected, setSelected] = (0, import_react13.useState)("2");
|
|
3411
|
+
const [errors, setErrors] = (0, import_react13.useState)({
|
|
3412
|
+
nameKpi: "",
|
|
3413
|
+
kpiValue: "",
|
|
3414
|
+
unitValue: ""
|
|
3415
|
+
});
|
|
3416
|
+
const [itemErrors, setItemErrors] = (0, import_react13.useState)({});
|
|
3417
|
+
const options = [
|
|
3418
|
+
{ value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
3419
|
+
{ value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
|
|
3420
|
+
];
|
|
3421
|
+
const handleAddKpi = (type) => {
|
|
3422
|
+
let newErrors = { nameKpi: "", kpiValue: "", unitValue: "" };
|
|
3423
|
+
let hasError = false;
|
|
3424
|
+
if (!nameKpi) {
|
|
3425
|
+
newErrors.nameKpi = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
|
|
3426
|
+
hasError = true;
|
|
3427
|
+
}
|
|
3428
|
+
if (type === "number") {
|
|
3429
|
+
if (!kpiValue) {
|
|
3430
|
+
newErrors.kpiValue = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
|
|
3431
|
+
hasError = true;
|
|
3432
|
+
}
|
|
3433
|
+
if (!unitValue) {
|
|
3434
|
+
newErrors.unitValue = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
|
|
3435
|
+
hasError = true;
|
|
3436
|
+
}
|
|
3437
|
+
}
|
|
3438
|
+
setErrors(newErrors);
|
|
3439
|
+
if (hasError) return;
|
|
3440
|
+
const newKpi = {
|
|
3441
|
+
id: (0, import_cuid.default)(),
|
|
3442
|
+
name: nameKpi,
|
|
3443
|
+
value: kpiValue,
|
|
3444
|
+
unit: unitValue,
|
|
3445
|
+
isEditing: false
|
|
3446
|
+
};
|
|
3447
|
+
setKpiList([...kpiList, newKpi]);
|
|
3448
|
+
setNameKpi("");
|
|
3449
|
+
setKpiValue("");
|
|
3450
|
+
setUnitValue("");
|
|
3451
|
+
setErrors({ nameKpi: "", kpiValue: "", unitValue: "" });
|
|
3452
|
+
};
|
|
3453
|
+
const handleEdit = (id) => {
|
|
3454
|
+
const current = kpiList.find((kpi) => kpi.id === id);
|
|
3455
|
+
if (current) {
|
|
3456
|
+
setEditingBackup((prev) => ({ ...prev, [id]: { ...current } }));
|
|
3457
|
+
}
|
|
3458
|
+
setKpiList(
|
|
3459
|
+
(prev) => prev.map((item) => item.id === id ? { ...item, isEditing: true } : item)
|
|
3460
|
+
);
|
|
3461
|
+
};
|
|
3462
|
+
const handleSave = (id, type) => {
|
|
3463
|
+
setKpiList((prev) => {
|
|
3464
|
+
return prev.map((item) => {
|
|
3465
|
+
if (item.id === id) {
|
|
3466
|
+
let hasError = false;
|
|
3467
|
+
const errorsForItem = {};
|
|
3468
|
+
if (!item.name) {
|
|
3469
|
+
errorsForItem.name = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
|
|
3470
|
+
hasError = true;
|
|
3471
|
+
}
|
|
3472
|
+
if (type === "number") {
|
|
3473
|
+
if (!item.value) {
|
|
3474
|
+
errorsForItem.value = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
|
|
3475
|
+
hasError = true;
|
|
3476
|
+
}
|
|
3477
|
+
if (!item.unit) {
|
|
3478
|
+
errorsForItem.unit = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
|
|
3479
|
+
hasError = true;
|
|
3480
|
+
}
|
|
3481
|
+
}
|
|
3482
|
+
if (hasError) {
|
|
3483
|
+
setItemErrors((prev2) => ({ ...prev2, [id]: errorsForItem }));
|
|
3484
|
+
return item;
|
|
3485
|
+
}
|
|
3486
|
+
setItemErrors((prev2) => {
|
|
3487
|
+
const copy = { ...prev2 };
|
|
3488
|
+
delete copy[id];
|
|
3489
|
+
return copy;
|
|
3490
|
+
});
|
|
3491
|
+
return { ...item, isEditing: false };
|
|
3492
|
+
}
|
|
3493
|
+
return item;
|
|
3494
|
+
});
|
|
3495
|
+
});
|
|
3496
|
+
};
|
|
3497
|
+
const handleCancel = (id) => {
|
|
3498
|
+
const backup = editingBackup[id];
|
|
3499
|
+
if (backup) {
|
|
3500
|
+
setKpiList(
|
|
3501
|
+
(prev) => prev.map(
|
|
3502
|
+
(item) => item.id === id ? { ...backup, isEditing: false } : item
|
|
3503
|
+
)
|
|
3504
|
+
);
|
|
3505
|
+
setEditingBackup((prev) => {
|
|
3506
|
+
const copy = { ...prev };
|
|
3507
|
+
delete copy[id];
|
|
3508
|
+
return copy;
|
|
3509
|
+
});
|
|
3510
|
+
} else {
|
|
3511
|
+
setKpiList(
|
|
3512
|
+
(prev) => prev.map(
|
|
3513
|
+
(item) => item.id === id ? { ...item, isEditing: false } : item
|
|
3514
|
+
)
|
|
3515
|
+
);
|
|
3516
|
+
}
|
|
3517
|
+
};
|
|
3518
|
+
const handleDelete = (id) => {
|
|
3519
|
+
setKpiList((prev) => prev.filter((item) => item.id !== id));
|
|
3520
|
+
};
|
|
3521
|
+
return {
|
|
3522
|
+
handleAddKpi,
|
|
3523
|
+
handleEdit,
|
|
3524
|
+
handleSave,
|
|
3525
|
+
handleCancel,
|
|
3526
|
+
handleDelete,
|
|
3527
|
+
nameKpi,
|
|
3528
|
+
setNameKpi,
|
|
3529
|
+
kpiValue,
|
|
3530
|
+
setKpiValue,
|
|
3531
|
+
unitValue,
|
|
3532
|
+
setUnitValue,
|
|
3533
|
+
kpiList,
|
|
3534
|
+
setKpiList,
|
|
3535
|
+
editingBackup,
|
|
3536
|
+
setEditingBackup,
|
|
3537
|
+
options,
|
|
3538
|
+
selected,
|
|
3539
|
+
setSelected,
|
|
3540
|
+
errors,
|
|
3541
|
+
setErrors,
|
|
3542
|
+
itemErrors,
|
|
3543
|
+
setItemErrors
|
|
3544
|
+
};
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
// src/KpiSection/KpiSection.tsx
|
|
3548
|
+
var import_icons_react11 = require("@tabler/icons-react");
|
|
3549
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3550
|
+
function KpiSection({ type, onChangeKpiList }) {
|
|
3551
|
+
const {
|
|
3552
|
+
handleAddKpi,
|
|
3553
|
+
handleEdit,
|
|
3554
|
+
handleSave,
|
|
3555
|
+
handleCancel,
|
|
3556
|
+
handleDelete,
|
|
3557
|
+
nameKpi,
|
|
3558
|
+
setNameKpi,
|
|
3559
|
+
kpiValue,
|
|
3560
|
+
setKpiValue,
|
|
3561
|
+
unitValue,
|
|
3562
|
+
setUnitValue,
|
|
3563
|
+
kpiList,
|
|
3564
|
+
setKpiList,
|
|
3565
|
+
errors,
|
|
3566
|
+
itemErrors,
|
|
3567
|
+
setItemErrors
|
|
3568
|
+
} = useGetKpiSection();
|
|
3569
|
+
const [messageApi2, messageContainer] = import_antd22.message.useMessage();
|
|
3570
|
+
const [hasShownError, setHasShownError] = (0, import_react14.useState)(false);
|
|
3571
|
+
(0, import_react14.useEffect)(() => {
|
|
3572
|
+
setMessageApi(messageApi2);
|
|
3573
|
+
}, [messageApi2]);
|
|
3574
|
+
(0, import_react14.useEffect)(() => {
|
|
3575
|
+
if (onChangeKpiList) {
|
|
3576
|
+
onChangeKpiList(kpiList);
|
|
3577
|
+
}
|
|
3578
|
+
}, [kpiList]);
|
|
3579
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3580
|
+
import_antd22.ConfigProvider,
|
|
3581
|
+
{
|
|
3582
|
+
theme: {
|
|
3583
|
+
token: {
|
|
3584
|
+
fontFamily: "Kanit",
|
|
3585
|
+
fontSize: 16
|
|
3586
|
+
}
|
|
3587
|
+
},
|
|
3588
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "container-input", children: [
|
|
3589
|
+
messageContainer,
|
|
3590
|
+
type === "number" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "space-y-4", children: [
|
|
3591
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid grid-cols-[1fr_200px_200px_50px] w-full gap-[24px] items-start", children: [
|
|
3592
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3593
|
+
InputField,
|
|
3594
|
+
{
|
|
3595
|
+
value: nameKpi,
|
|
3596
|
+
label: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
|
|
3597
|
+
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
3598
|
+
required: true,
|
|
3599
|
+
onChange: (value) => setNameKpi(value ?? ""),
|
|
3600
|
+
className: "h-[32px]",
|
|
3601
|
+
error: errors.nameKpi
|
|
3602
|
+
}
|
|
3603
|
+
),
|
|
3604
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3605
|
+
InputField,
|
|
3606
|
+
{
|
|
3607
|
+
value: kpiValue,
|
|
3608
|
+
label: "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
|
|
3609
|
+
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
3610
|
+
required: true,
|
|
3611
|
+
onChange: (value) => {
|
|
3612
|
+
if (value === void 0 || value === "") {
|
|
3613
|
+
setKpiValue("");
|
|
3614
|
+
setHasShownError(false);
|
|
3615
|
+
} else if (/^\d*\.?\d*$/.test(value)) {
|
|
3616
|
+
setKpiValue(value);
|
|
3617
|
+
setHasShownError(false);
|
|
3618
|
+
} else {
|
|
3619
|
+
if (!hasShownError) {
|
|
3620
|
+
messageError("\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E40\u0E17\u0E48\u0E32\u0E19\u0E31\u0E49\u0E19");
|
|
3621
|
+
setHasShownError(true);
|
|
3622
|
+
}
|
|
3623
|
+
}
|
|
3624
|
+
},
|
|
3625
|
+
error: errors.kpiValue
|
|
3626
|
+
}
|
|
3627
|
+
),
|
|
3628
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3629
|
+
InputField,
|
|
3630
|
+
{
|
|
3631
|
+
value: unitValue,
|
|
3632
|
+
label: "\u0E2B\u0E19\u0E48\u0E27\u0E22",
|
|
3633
|
+
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
3634
|
+
required: true,
|
|
3635
|
+
onChange: (value) => setUnitValue(value ?? ""),
|
|
3636
|
+
className: "h-[32px]",
|
|
3637
|
+
error: errors.unitValue
|
|
3638
|
+
}
|
|
3639
|
+
),
|
|
3640
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3641
|
+
import_icons_react11.IconCirclePlus,
|
|
3642
|
+
{
|
|
3643
|
+
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
3644
|
+
stroke: 1,
|
|
3645
|
+
onClick: () => handleAddKpi(type)
|
|
3646
|
+
}
|
|
3647
|
+
) })
|
|
3648
|
+
] }),
|
|
3649
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3650
|
+
"div",
|
|
3651
|
+
{
|
|
3652
|
+
className: "grid grid-cols-[30px_1fr_100px_120px_80px] items-start py-2 body-1 gap-[8px]",
|
|
3653
|
+
children: [
|
|
3654
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3655
|
+
index + 1,
|
|
3656
|
+
"."
|
|
3657
|
+
] }),
|
|
3658
|
+
kpi.isEditing ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3659
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3660
|
+
InputField,
|
|
3661
|
+
{
|
|
3662
|
+
value: kpi.name,
|
|
3663
|
+
onChange: (value) => setKpiList(
|
|
3664
|
+
(prev) => prev.map((item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item)
|
|
3665
|
+
),
|
|
3666
|
+
error: itemErrors[kpi.id]?.name
|
|
3667
|
+
}
|
|
3668
|
+
),
|
|
3669
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3670
|
+
InputField,
|
|
3671
|
+
{
|
|
3672
|
+
value: kpi.value?.toString(),
|
|
3673
|
+
onChange: (value) => {
|
|
3674
|
+
if (value === void 0 || value === "") {
|
|
3675
|
+
setKpiList(
|
|
3676
|
+
(prev) => prev.map((item) => item.id === kpi.id ? { ...item, value: "" } : item)
|
|
3677
|
+
);
|
|
3678
|
+
setHasShownError(false);
|
|
3679
|
+
} else if (/^\d*\.?\d*$/.test(value)) {
|
|
3680
|
+
setKpiList(
|
|
3681
|
+
(prev) => prev.map((item) => item.id === kpi.id ? { ...item, value } : item)
|
|
3682
|
+
);
|
|
3683
|
+
setHasShownError(false);
|
|
3684
|
+
} else {
|
|
3685
|
+
if (!hasShownError) {
|
|
3686
|
+
messageError("\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E40\u0E17\u0E48\u0E32\u0E19\u0E31\u0E49\u0E19");
|
|
3687
|
+
setHasShownError(true);
|
|
3688
|
+
}
|
|
3689
|
+
}
|
|
3690
|
+
},
|
|
3691
|
+
error: itemErrors[kpi.id]?.value
|
|
3692
|
+
}
|
|
3693
|
+
),
|
|
3694
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3695
|
+
InputField,
|
|
3696
|
+
{
|
|
3697
|
+
value: kpi.unit,
|
|
3698
|
+
onChange: (value) => setKpiList(
|
|
3699
|
+
(prev) => prev.map((item) => item.id === kpi.id ? { ...item, unit: value ?? "" } : item)
|
|
3700
|
+
),
|
|
3701
|
+
error: itemErrors[kpi.id]?.unit
|
|
3702
|
+
}
|
|
3703
|
+
),
|
|
3704
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3705
|
+
"div",
|
|
3706
|
+
{
|
|
3707
|
+
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.value || !!itemErrors[kpi.id]?.unit || !!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3708
|
+
children: [
|
|
3709
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3710
|
+
import_icons_react11.IconCheck,
|
|
3711
|
+
{
|
|
3712
|
+
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3713
|
+
onClick: () => handleSave(kpi.id, type)
|
|
3714
|
+
}
|
|
3715
|
+
),
|
|
3716
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconX, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3717
|
+
]
|
|
3718
|
+
}
|
|
3719
|
+
)
|
|
3720
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3721
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "body-1", children: kpi.name }),
|
|
3722
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "body-1", children: kpi.value }),
|
|
3723
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "body-1", children: kpi.unit }),
|
|
3724
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex gap-3 justify-end", children: [
|
|
3725
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3726
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconTrash, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3727
|
+
] })
|
|
3728
|
+
] })
|
|
3729
|
+
]
|
|
3730
|
+
},
|
|
3731
|
+
kpi.id
|
|
3732
|
+
)) })
|
|
3733
|
+
] }),
|
|
3734
|
+
type === "text" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "space-y-4", children: [
|
|
3735
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid grid-cols-[1fr_50px] w-full gap-[24px] items-start", children: [
|
|
3736
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3737
|
+
InputField,
|
|
3738
|
+
{
|
|
3739
|
+
value: nameKpi,
|
|
3740
|
+
label: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
|
|
3741
|
+
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
3742
|
+
required: true,
|
|
3743
|
+
onChange: (value) => setNameKpi(value ?? ""),
|
|
3744
|
+
className: "h-[32px]",
|
|
3745
|
+
error: errors.nameKpi
|
|
3746
|
+
}
|
|
3747
|
+
),
|
|
3748
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `flex justify-end mt-[28px]`, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3749
|
+
import_icons_react11.IconCirclePlus,
|
|
3750
|
+
{
|
|
3751
|
+
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
3752
|
+
stroke: 1,
|
|
3753
|
+
onClick: () => handleAddKpi(type)
|
|
3754
|
+
}
|
|
3755
|
+
) })
|
|
3756
|
+
] }),
|
|
3757
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "grid grid-cols-[30px_1fr_80px] items-start py-2 body-1 gap-[8px]", children: [
|
|
3758
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3759
|
+
index + 1,
|
|
3760
|
+
"."
|
|
3761
|
+
] }),
|
|
3762
|
+
kpi.isEditing ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3764
|
+
InputField,
|
|
3765
|
+
{
|
|
3766
|
+
value: kpi.name,
|
|
3767
|
+
onChange: (value) => setKpiList(
|
|
3768
|
+
(prev) => prev.map((item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item)
|
|
3769
|
+
),
|
|
3770
|
+
error: itemErrors[kpi.id]?.name
|
|
3771
|
+
}
|
|
3772
|
+
),
|
|
3773
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3774
|
+
"div",
|
|
3775
|
+
{
|
|
3776
|
+
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3777
|
+
children: [
|
|
3778
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3779
|
+
import_icons_react11.IconCheck,
|
|
3780
|
+
{
|
|
3781
|
+
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3782
|
+
onClick: () => handleSave(kpi.id, type)
|
|
3783
|
+
}
|
|
3784
|
+
),
|
|
3785
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconX, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleCancel(kpi.id) })
|
|
3786
|
+
]
|
|
3787
|
+
}
|
|
3788
|
+
)
|
|
3789
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3790
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "body-1", children: kpi.name }),
|
|
3791
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex gap-3 justify-end", children: [
|
|
3792
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconPencil, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleEdit(kpi.id) }),
|
|
3793
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_icons_react11.IconTrash, { className: "w-[30px] h-[30px] cursor-pointer", onClick: () => handleDelete(kpi.id) })
|
|
3794
|
+
] })
|
|
3795
|
+
] })
|
|
3796
|
+
] }, kpi.id)) })
|
|
3797
|
+
] })
|
|
3798
|
+
] })
|
|
3799
|
+
}
|
|
3800
|
+
);
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
// src/Modal/Modal/Modal.tsx
|
|
3804
|
+
var import_antd23 = require("antd");
|
|
3805
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3806
|
+
function AntDModal({ children, isOpen, width, onCancel }) {
|
|
3807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_antd23.Modal, { open: isOpen, onCancel, width, centered: true, footer: null, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { children }) }) });
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3810
|
+
// src/Indicator/Indicator/Indicator.tsx
|
|
3811
|
+
var import_icons_react12 = require("@tabler/icons-react");
|
|
3812
|
+
var import_react15 = require("react");
|
|
3813
|
+
var import_antd24 = require("antd");
|
|
3814
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3815
|
+
function Indicator({
|
|
3816
|
+
option = [
|
|
3817
|
+
{ value: "TEXT", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
|
|
3818
|
+
{ value: "NUMBER", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
|
|
3819
|
+
],
|
|
3820
|
+
type,
|
|
3821
|
+
arrayData,
|
|
3822
|
+
setArrayData
|
|
3823
|
+
}) {
|
|
3824
|
+
const [valueSwitch, setValueSwitch] = (0, import_react15.useState)("TEXT");
|
|
3825
|
+
const [cacheData, setCacheData] = (0, import_react15.useState)({
|
|
3826
|
+
indicatorType: type,
|
|
3827
|
+
inputType: valueSwitch,
|
|
3828
|
+
textValue: "",
|
|
3829
|
+
numberValue: "",
|
|
3830
|
+
unit: ""
|
|
3831
|
+
});
|
|
3832
|
+
const [cacheEditData, setCacheEditData] = (0, import_react15.useState)({
|
|
3833
|
+
indicatorType: type,
|
|
3834
|
+
inputType: valueSwitch,
|
|
3835
|
+
textValue: "",
|
|
3836
|
+
numberValue: "",
|
|
3837
|
+
unit: ""
|
|
3838
|
+
});
|
|
3839
|
+
const [editIndex, setEditIndex] = (0, import_react15.useState)(null);
|
|
3840
|
+
const handleAddIndicator = () => {
|
|
3841
|
+
if (cacheData.textValue.trim() === "") return;
|
|
3842
|
+
setArrayData([
|
|
3843
|
+
...arrayData,
|
|
3844
|
+
valueSwitch === "TEXT" ? {
|
|
3845
|
+
indicatorType: type,
|
|
3846
|
+
inputType: "TEXT",
|
|
3847
|
+
textValue: cacheData.textValue
|
|
3848
|
+
} : cacheData
|
|
3849
|
+
]);
|
|
3850
|
+
setCacheData({
|
|
3851
|
+
indicatorType: type,
|
|
3852
|
+
inputType: valueSwitch,
|
|
3853
|
+
textValue: "",
|
|
3854
|
+
numberValue: "",
|
|
3855
|
+
unit: ""
|
|
3856
|
+
});
|
|
3857
|
+
};
|
|
3858
|
+
const handleChangeCashData = (key, value) => {
|
|
3859
|
+
setCacheData((prev) => ({
|
|
3860
|
+
...prev,
|
|
3861
|
+
[key]: value
|
|
3862
|
+
}));
|
|
3863
|
+
console.log(cacheData);
|
|
3864
|
+
};
|
|
3865
|
+
const handleClick = (active) => {
|
|
3866
|
+
handleChangeCashData("inputType", active);
|
|
3867
|
+
setValueSwitch(active);
|
|
3868
|
+
};
|
|
3869
|
+
const handleDeleteIndicator = (index) => {
|
|
3870
|
+
const newData = arrayData.filter((_, i) => i !== index);
|
|
3871
|
+
setArrayData(newData);
|
|
3872
|
+
setEditIndex(null);
|
|
3873
|
+
};
|
|
3874
|
+
const handleEditIndicator = (index) => {
|
|
3875
|
+
setCacheEditData(arrayData[index]);
|
|
3876
|
+
setEditIndex(index);
|
|
3877
|
+
};
|
|
3878
|
+
const handleCancelEditIndicator = () => {
|
|
3879
|
+
setEditIndex(null);
|
|
3880
|
+
};
|
|
3881
|
+
const handleConfirmEditIndicator = (index) => {
|
|
3882
|
+
if (cacheEditData.textValue.trim() === "") return;
|
|
3883
|
+
const newData = [...arrayData];
|
|
3884
|
+
newData[index] = cacheEditData;
|
|
3885
|
+
setArrayData(newData);
|
|
3886
|
+
setEditIndex(null);
|
|
3887
|
+
};
|
|
3888
|
+
const handleChangeEditCashData = (e) => {
|
|
3889
|
+
const { name, value } = e.target;
|
|
3890
|
+
setCacheEditData((prev) => ({
|
|
3891
|
+
...prev,
|
|
3892
|
+
[name]: value
|
|
3893
|
+
}));
|
|
3894
|
+
console.log(cacheEditData);
|
|
3895
|
+
};
|
|
3896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "w-full", children: [
|
|
3897
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3898
|
+
"div",
|
|
3899
|
+
{
|
|
3900
|
+
className: `space-x-2 grid ${valueSwitch === "TEXT" ? `grid-cols-[140px_1fr_50px]` : `grid-cols-[140px_1fr_200px_200px_50px]`} items-start`,
|
|
3901
|
+
children: [
|
|
3902
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(SwitchSelect, { option, onClick: handleClick, value: valueSwitch, label: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17", required: true }),
|
|
3903
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3904
|
+
InputField,
|
|
3905
|
+
{
|
|
3906
|
+
label: `\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3907
|
+
value: cacheData.textValue,
|
|
3908
|
+
className: "h-[32px]",
|
|
3909
|
+
onChange: (e) => handleChangeCashData("textValue", String(e)),
|
|
3910
|
+
placeholder: `\u0E23\u0E30\u0E1A\u0E38\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3911
|
+
required: true
|
|
3912
|
+
}
|
|
3913
|
+
),
|
|
3914
|
+
valueSwitch === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
3915
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3916
|
+
InputFieldNumber,
|
|
3917
|
+
{
|
|
3918
|
+
label: `\u0E04\u0E48\u0E32\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3919
|
+
value: cacheData.numberValue ?? "",
|
|
3920
|
+
className: "h-[32px]",
|
|
3921
|
+
onChange: (e) => handleChangeCashData("numberValue", String(e)),
|
|
3922
|
+
placeholder: `\u0E23\u0E30\u0E1A\u0E38\u0E04\u0E48\u0E32\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3923
|
+
required: true
|
|
3924
|
+
}
|
|
3925
|
+
),
|
|
3926
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3927
|
+
InputField,
|
|
3928
|
+
{
|
|
3929
|
+
label: `\u0E2B\u0E19\u0E48\u0E27\u0E22`,
|
|
3930
|
+
value: cacheData.unit ?? "",
|
|
3931
|
+
className: "h-[32px]",
|
|
3932
|
+
onChange: (e) => handleChangeCashData("unit", String(e)),
|
|
3933
|
+
placeholder: "\u0E23\u0E30\u0E1A\u0E38\u0E2B\u0E19\u0E48\u0E27\u0E22",
|
|
3934
|
+
required: true
|
|
3935
|
+
}
|
|
3936
|
+
)
|
|
3937
|
+
] }),
|
|
3938
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react12.IconCirclePlus, { onClick: handleAddIndicator, className: "mt-7 cursor-pointer", size: 32 })
|
|
3939
|
+
]
|
|
3940
|
+
}
|
|
3941
|
+
),
|
|
3942
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: arrayData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
3943
|
+
"div",
|
|
3944
|
+
{
|
|
3945
|
+
className: `space-y-4 grid ${item.inputType === "TEXT" ? `grid-cols-[140px_1fr_50px_50px]` : `grid-cols-[140px_1fr_200px_150px_50px_50px]`} items-start`,
|
|
3946
|
+
children: [
|
|
3947
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2", children: item.inputType === "TEXT" ? "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" : "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }),
|
|
3948
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3949
|
+
import_antd24.Input,
|
|
3950
|
+
{
|
|
3951
|
+
className: "body-1 mt-2",
|
|
3952
|
+
variant: "underlined",
|
|
3953
|
+
value: cacheEditData.textValue,
|
|
3954
|
+
name: "textValue",
|
|
3955
|
+
onChange: (e) => handleChangeEditCashData(e)
|
|
3956
|
+
}
|
|
3957
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3958
|
+
item.inputType === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
|
|
3959
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3960
|
+
import_antd24.Input,
|
|
3961
|
+
{
|
|
3962
|
+
className: "body-1 mt-2",
|
|
3963
|
+
variant: "underlined",
|
|
3964
|
+
value: cacheEditData.numberValue,
|
|
3965
|
+
name: "numberValue",
|
|
3966
|
+
onChange: (e) => handleChangeEditCashData(e)
|
|
3967
|
+
}
|
|
3968
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3969
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3970
|
+
import_antd24.Input,
|
|
3971
|
+
{
|
|
3972
|
+
className: "body-1 mt-2",
|
|
3973
|
+
variant: "underlined",
|
|
3974
|
+
value: cacheEditData.unit,
|
|
3975
|
+
name: "unit",
|
|
3976
|
+
onChange: (e) => handleChangeEditCashData(e)
|
|
3977
|
+
}
|
|
3978
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2", children: item.unit })
|
|
3979
|
+
] }),
|
|
3980
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2 flex", children: editIndex !== null ? editIndex === index ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex", children: [
|
|
3981
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
3982
|
+
import_icons_react12.IconCheck,
|
|
3983
|
+
{
|
|
3984
|
+
className: "cursor-pointer text-green-600",
|
|
3985
|
+
onClick: () => handleConfirmEditIndicator(index)
|
|
3986
|
+
}
|
|
3987
|
+
),
|
|
3988
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react12.IconX, { className: "cursor-pointer text-red-600", onClick: handleCancelEditIndicator })
|
|
3989
|
+
] }) : void 0 : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react12.IconPencil, { className: "cursor-pointer", onClick: () => handleEditIndicator(index) }) }),
|
|
3990
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "body-1 mt-2 cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react12.IconTrash, { onClick: () => handleDeleteIndicator(index) }) })
|
|
3991
|
+
]
|
|
3992
|
+
}
|
|
3993
|
+
)) })
|
|
3994
|
+
] });
|
|
3995
|
+
}
|
|
3996
|
+
|
|
3997
|
+
// src/FilterPopUp/FilterPopUp.tsx
|
|
3998
|
+
var import_icons_react13 = require("@tabler/icons-react");
|
|
3999
|
+
var import_react16 = require("react");
|
|
4000
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
4001
|
+
var FilterPopUp = (filter) => {
|
|
4002
|
+
const [isAction, setIsAction] = (0, import_react16.useState)(true);
|
|
4003
|
+
const [filterArray, setFilterArray] = (0, import_react16.useState)([""]);
|
|
4004
|
+
const handleClearFilter = () => {
|
|
4005
|
+
setFilterArray([]);
|
|
4006
|
+
};
|
|
4007
|
+
const handleSubmitFilter = () => {
|
|
4008
|
+
filter.handleSearch(filterArray);
|
|
4009
|
+
};
|
|
4010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "relative", children: [
|
|
4011
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("button", { className: "flex px-2 py-1 rounded-lg border-1", onClick: () => setIsAction(!isAction), children: [
|
|
4012
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons_react13.IconFilter, {}),
|
|
4013
|
+
"filter"
|
|
4014
|
+
] }),
|
|
4015
|
+
isAction ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "absolute bg-white p-5 rounded-lg shadow-2xl w-[600px]", children: [
|
|
4016
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex justify-end", children: [
|
|
4017
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex justify-end text-nowrap gap-2", children: [
|
|
4018
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(GhostButton, { title: "\u0E43\u0E0A\u0E49\u0E1F\u0E34\u0E25\u0E40\u0E15\u0E2D\u0E23\u0E4C", onClick: handleSubmitFilter, iconLeft: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons_react13.IconCheck, {}) }),
|
|
4019
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(GhostButton, { title: "\u0E25\u0E49\u0E32\u0E07\u0E17\u0E31\u0E49\u0E07\u0E2B\u0E21\u0E14", onClick: handleClearFilter, iconLeft: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_icons_react13.IconTrash, {}) })
|
|
4020
|
+
] }),
|
|
4021
|
+
""
|
|
4022
|
+
] }),
|
|
4023
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
4024
|
+
SelectCustom,
|
|
4025
|
+
{
|
|
4026
|
+
options: filter.selectionFilter,
|
|
4027
|
+
onChange: (list) => setFilterArray(list),
|
|
4028
|
+
label: "\u0E04\u0E49\u0E19\u0E2B\u0E32\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01"
|
|
4029
|
+
}
|
|
4030
|
+
)
|
|
4031
|
+
] }) : void 0
|
|
4032
|
+
] });
|
|
4033
|
+
};
|
|
4034
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
4035
|
+
0 && (module.exports = {
|
|
4036
|
+
AntDModal,
|
|
4037
|
+
AntDataTable,
|
|
4038
|
+
Breadcrumbs,
|
|
4039
|
+
Calendar,
|
|
4040
|
+
Checkbox,
|
|
4041
|
+
CheckboxGroup,
|
|
4042
|
+
ColorPalettePickerBasic,
|
|
4043
|
+
ColorPickerBasic,
|
|
4044
|
+
DataTable,
|
|
4045
|
+
DatePickerBasic,
|
|
4046
|
+
DatePickerRangePicker,
|
|
4047
|
+
FileUploader,
|
|
4048
|
+
FilterPopUp,
|
|
4049
|
+
GhostButton,
|
|
4050
|
+
HeadingPage,
|
|
4051
|
+
Indicator,
|
|
4052
|
+
InputField,
|
|
4053
|
+
InputFieldNumber,
|
|
4054
|
+
KpiSection,
|
|
4055
|
+
Loader,
|
|
4056
|
+
MenuNavBar,
|
|
4057
|
+
PrimaryButton,
|
|
4058
|
+
ProgressBar,
|
|
4059
|
+
Radio,
|
|
4060
|
+
RadioGroup,
|
|
4061
|
+
SecondaryButton,
|
|
4062
|
+
SelectCustom,
|
|
4063
|
+
SelectField,
|
|
4064
|
+
SelectFieldGroup,
|
|
4065
|
+
SelectFieldStatus,
|
|
4066
|
+
SelectFieldStatusReport,
|
|
4067
|
+
SelectFieldTag,
|
|
4068
|
+
Sidebar,
|
|
4069
|
+
SortFilter,
|
|
4070
|
+
Switch,
|
|
4071
|
+
SwitchSelect,
|
|
4072
|
+
TabSelectionButton,
|
|
4073
|
+
TextAreaInput,
|
|
4074
|
+
TextInput,
|
|
4075
|
+
TimePickerBasic,
|
|
4076
|
+
TimePickerRangePicker,
|
|
4077
|
+
TopNavBar,
|
|
4078
|
+
messageError,
|
|
4079
|
+
messageInfo,
|
|
4080
|
+
messageLoading,
|
|
4081
|
+
messageSuccess,
|
|
4082
|
+
messageWarning,
|
|
4083
|
+
setMessageApi
|
|
4084
|
+
});
|