@esic-lab/data-core-ui 0.0.14 → 0.0.16

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