@esic-lab/data-core-ui 0.0.26 → 0.0.27
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/STO-logo-ADYYAPS3.svg +92 -0
- package/dist/index.css +9 -1
- package/dist/index.d.mts +56 -64
- package/dist/index.d.ts +56 -64
- package/dist/index.js +2361 -373
- package/dist/index.mjs +2354 -365
- package/package.json +1 -2
package/dist/index.js
CHANGED
|
@@ -369,7 +369,6 @@ __export(index_exports, {
|
|
|
369
369
|
GhostButton: () => GhostButton,
|
|
370
370
|
HeadingPage: () => HeadingPage,
|
|
371
371
|
InputField: () => InputField,
|
|
372
|
-
InputFieldNumber: () => InputFieldNumber,
|
|
373
372
|
KpiSection: () => KpiSection,
|
|
374
373
|
Loader: () => Loader,
|
|
375
374
|
MenuNavBar: () => MenuNavBar,
|
|
@@ -1022,13 +1021,13 @@ function TextInput({
|
|
|
1022
1021
|
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { children: [
|
|
1023
1022
|
label && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("p", { className: "body-1 mb-[8px]", children: [
|
|
1024
1023
|
label,
|
|
1025
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-red-
|
|
1024
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "text-red-600", children: "\xA0*" })
|
|
1026
1025
|
] }),
|
|
1027
1026
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1028
1027
|
"div",
|
|
1029
1028
|
{
|
|
1030
1029
|
className: `border-[1px] rounded-[8px] w-full h-[40px] flex justify-center items-center
|
|
1031
|
-
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-
|
|
1030
|
+
${disabled ? "bg-gray-100 text-gray-400" : error ? "border-red-600" : ""}`,
|
|
1032
1031
|
children: [
|
|
1033
1032
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1034
1033
|
"input",
|
|
@@ -1047,21 +1046,23 @@ function TextInput({
|
|
|
1047
1046
|
]
|
|
1048
1047
|
}
|
|
1049
1048
|
),
|
|
1050
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-red-
|
|
1049
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "text-red-600 body-1", children: error })
|
|
1051
1050
|
] });
|
|
1052
1051
|
}
|
|
1053
1052
|
|
|
1054
|
-
// src/
|
|
1053
|
+
// src/InputField/InputField.tsx
|
|
1055
1054
|
var import_antd2 = require("antd");
|
|
1056
1055
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1057
1056
|
function InputField({
|
|
1058
1057
|
value,
|
|
1059
1058
|
onChange,
|
|
1060
1059
|
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
1061
|
-
|
|
1062
|
-
|
|
1060
|
+
title,
|
|
1061
|
+
require: require2,
|
|
1062
|
+
bottomText,
|
|
1063
1063
|
disabled,
|
|
1064
|
-
|
|
1064
|
+
showError,
|
|
1065
|
+
errorMessage,
|
|
1065
1066
|
addonBefore,
|
|
1066
1067
|
addonAfter,
|
|
1067
1068
|
defaultValue,
|
|
@@ -1078,9 +1079,9 @@ function InputField({
|
|
|
1078
1079
|
},
|
|
1079
1080
|
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "container-input", children: [
|
|
1080
1081
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
1081
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "body-1", children:
|
|
1082
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "body-1", children: title }),
|
|
1082
1083
|
" ",
|
|
1083
|
-
|
|
1084
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1084
1085
|
] }),
|
|
1085
1086
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1086
1087
|
import_antd2.Input,
|
|
@@ -1097,7 +1098,11 @@ function InputField({
|
|
|
1097
1098
|
onClear
|
|
1098
1099
|
}
|
|
1099
1100
|
),
|
|
1100
|
-
|
|
1101
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
1102
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1103
|
+
" ",
|
|
1104
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1105
|
+
] })
|
|
1101
1106
|
] })
|
|
1102
1107
|
}
|
|
1103
1108
|
);
|
|
@@ -1152,107 +1157,46 @@ function TextAreaInput({
|
|
|
1152
1157
|
disabled
|
|
1153
1158
|
}
|
|
1154
1159
|
),
|
|
1155
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-red-
|
|
1160
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-red-600 body-1", children: error })
|
|
1156
1161
|
] })
|
|
1157
1162
|
}
|
|
1158
1163
|
) });
|
|
1159
1164
|
}
|
|
1160
1165
|
|
|
1161
|
-
// src/
|
|
1166
|
+
// src/ColorPicker/ColorPicker.tsx
|
|
1162
1167
|
var import_antd4 = require("antd");
|
|
1163
1168
|
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1164
|
-
function
|
|
1169
|
+
function ColorPickerBasic({
|
|
1165
1170
|
value,
|
|
1166
1171
|
onChange,
|
|
1167
|
-
|
|
1172
|
+
require: require2,
|
|
1168
1173
|
title,
|
|
1169
|
-
|
|
1174
|
+
bottomText,
|
|
1175
|
+
showError,
|
|
1176
|
+
errorMessage,
|
|
1170
1177
|
disabled,
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
addonAfter,
|
|
1174
|
-
defaultValue,
|
|
1178
|
+
allowClear,
|
|
1179
|
+
defaultFormat,
|
|
1175
1180
|
className,
|
|
1176
|
-
|
|
1177
|
-
min,
|
|
1178
|
-
controls,
|
|
1179
|
-
size,
|
|
1180
|
-
changeOnWheel,
|
|
1181
|
-
formatter,
|
|
1182
|
-
parser
|
|
1181
|
+
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
|
|
1183
1182
|
}) {
|
|
1184
1183
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1185
1184
|
import_antd4.ConfigProvider,
|
|
1186
1185
|
{
|
|
1187
1186
|
theme: {
|
|
1188
1187
|
token: {
|
|
1189
|
-
fontFamily: "Kanit"
|
|
1188
|
+
fontFamily: "Kanit",
|
|
1189
|
+
fontSize: 16
|
|
1190
1190
|
}
|
|
1191
1191
|
},
|
|
1192
1192
|
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "container-input", children: [
|
|
1193
1193
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
1194
1194
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "body-1", children: title }),
|
|
1195
1195
|
" ",
|
|
1196
|
-
|
|
1196
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1197
1197
|
] }),
|
|
1198
1198
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1199
|
-
import_antd4.
|
|
1200
|
-
{
|
|
1201
|
-
value: value ?? void 0,
|
|
1202
|
-
onChange: (val) => onChange(val),
|
|
1203
|
-
placeholder,
|
|
1204
|
-
disabled,
|
|
1205
|
-
className: `body-1 w-full ${className ?? ""}`,
|
|
1206
|
-
addonBefore,
|
|
1207
|
-
addonAfter,
|
|
1208
|
-
defaultValue,
|
|
1209
|
-
max,
|
|
1210
|
-
min,
|
|
1211
|
-
controls,
|
|
1212
|
-
size,
|
|
1213
|
-
changeOnWheel,
|
|
1214
|
-
formatter,
|
|
1215
|
-
parser
|
|
1216
|
-
}
|
|
1217
|
-
),
|
|
1218
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1219
|
-
] })
|
|
1220
|
-
}
|
|
1221
|
-
);
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
// src/ColorPicker/ColorPicker.tsx
|
|
1225
|
-
var import_antd5 = require("antd");
|
|
1226
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1227
|
-
function ColorPickerBasic({
|
|
1228
|
-
value,
|
|
1229
|
-
onChange,
|
|
1230
|
-
required,
|
|
1231
|
-
label,
|
|
1232
|
-
error,
|
|
1233
|
-
disabled,
|
|
1234
|
-
allowClear,
|
|
1235
|
-
defaultFormat,
|
|
1236
|
-
className,
|
|
1237
|
-
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
|
|
1238
|
-
}) {
|
|
1239
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1240
|
-
import_antd5.ConfigProvider,
|
|
1241
|
-
{
|
|
1242
|
-
theme: {
|
|
1243
|
-
token: {
|
|
1244
|
-
fontFamily: "Kanit",
|
|
1245
|
-
fontSize: 16
|
|
1246
|
-
}
|
|
1247
|
-
},
|
|
1248
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "container-input", children: [
|
|
1249
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
1250
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "body-1", children: label }),
|
|
1251
|
-
" ",
|
|
1252
|
-
required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1253
|
-
] }),
|
|
1254
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1255
|
-
import_antd5.ColorPicker,
|
|
1199
|
+
import_antd4.ColorPicker,
|
|
1256
1200
|
{
|
|
1257
1201
|
defaultFormat,
|
|
1258
1202
|
className: `body-1 w-full ${className ?? ""}`,
|
|
@@ -1263,9 +1207,9 @@ function ColorPickerBasic({
|
|
|
1263
1207
|
showText: (color) => {
|
|
1264
1208
|
const hex = color.toHexString();
|
|
1265
1209
|
if (!value) {
|
|
1266
|
-
return /* @__PURE__ */ (0,
|
|
1210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { children: placeholder });
|
|
1267
1211
|
}
|
|
1268
|
-
return /* @__PURE__ */ (0,
|
|
1212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { children: [
|
|
1269
1213
|
"(",
|
|
1270
1214
|
hex,
|
|
1271
1215
|
")"
|
|
@@ -1274,19 +1218,2012 @@ function ColorPickerBasic({
|
|
|
1274
1218
|
disabled
|
|
1275
1219
|
}
|
|
1276
1220
|
),
|
|
1277
|
-
|
|
1221
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
|
|
1222
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
1223
|
+
" ",
|
|
1224
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
1225
|
+
] })
|
|
1278
1226
|
] })
|
|
1279
1227
|
}
|
|
1280
1228
|
);
|
|
1281
1229
|
}
|
|
1282
1230
|
|
|
1283
1231
|
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1284
|
-
var
|
|
1232
|
+
var import_antd5 = require("antd");
|
|
1285
1233
|
var import_th_TH2 = __toESM(require("antd/locale/th_TH"));
|
|
1286
1234
|
var import_dayjs = __toESM(require_dayjs_min());
|
|
1287
|
-
|
|
1235
|
+
|
|
1236
|
+
// node_modules/date-fns/constants.js
|
|
1237
|
+
var daysInYear = 365.2425;
|
|
1238
|
+
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
|
|
1239
|
+
var minTime = -maxTime;
|
|
1240
|
+
var millisecondsInWeek = 6048e5;
|
|
1241
|
+
var millisecondsInDay = 864e5;
|
|
1242
|
+
var secondsInHour = 3600;
|
|
1243
|
+
var secondsInDay = secondsInHour * 24;
|
|
1244
|
+
var secondsInWeek = secondsInDay * 7;
|
|
1245
|
+
var secondsInYear = secondsInDay * daysInYear;
|
|
1246
|
+
var secondsInMonth = secondsInYear / 12;
|
|
1247
|
+
var secondsInQuarter = secondsInMonth * 3;
|
|
1248
|
+
var constructFromSymbol = Symbol.for("constructDateFrom");
|
|
1249
|
+
|
|
1250
|
+
// node_modules/date-fns/constructFrom.js
|
|
1251
|
+
function constructFrom(date, value) {
|
|
1252
|
+
if (typeof date === "function") return date(value);
|
|
1253
|
+
if (date && typeof date === "object" && constructFromSymbol in date)
|
|
1254
|
+
return date[constructFromSymbol](value);
|
|
1255
|
+
if (date instanceof Date) return new date.constructor(value);
|
|
1256
|
+
return new Date(value);
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
// node_modules/date-fns/toDate.js
|
|
1260
|
+
function toDate(argument, context) {
|
|
1261
|
+
return constructFrom(context || argument, argument);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
// node_modules/date-fns/_lib/defaultOptions.js
|
|
1265
|
+
var defaultOptions = {};
|
|
1266
|
+
function getDefaultOptions() {
|
|
1267
|
+
return defaultOptions;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// node_modules/date-fns/startOfWeek.js
|
|
1271
|
+
function startOfWeek(date, options) {
|
|
1272
|
+
const defaultOptions2 = getDefaultOptions();
|
|
1273
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
1274
|
+
const _date = toDate(date, options?.in);
|
|
1275
|
+
const day = _date.getDay();
|
|
1276
|
+
const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
|
|
1277
|
+
_date.setDate(_date.getDate() - diff);
|
|
1278
|
+
_date.setHours(0, 0, 0, 0);
|
|
1279
|
+
return _date;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
// node_modules/date-fns/startOfISOWeek.js
|
|
1283
|
+
function startOfISOWeek(date, options) {
|
|
1284
|
+
return startOfWeek(date, { ...options, weekStartsOn: 1 });
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
// node_modules/date-fns/getISOWeekYear.js
|
|
1288
|
+
function getISOWeekYear(date, options) {
|
|
1289
|
+
const _date = toDate(date, options?.in);
|
|
1290
|
+
const year = _date.getFullYear();
|
|
1291
|
+
const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
|
|
1292
|
+
fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
|
|
1293
|
+
fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
|
|
1294
|
+
const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
|
|
1295
|
+
const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
|
|
1296
|
+
fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
|
|
1297
|
+
fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
|
|
1298
|
+
const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
|
|
1299
|
+
if (_date.getTime() >= startOfNextYear.getTime()) {
|
|
1300
|
+
return year + 1;
|
|
1301
|
+
} else if (_date.getTime() >= startOfThisYear.getTime()) {
|
|
1302
|
+
return year;
|
|
1303
|
+
} else {
|
|
1304
|
+
return year - 1;
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
// node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
|
|
1309
|
+
function getTimezoneOffsetInMilliseconds(date) {
|
|
1310
|
+
const _date = toDate(date);
|
|
1311
|
+
const utcDate = new Date(
|
|
1312
|
+
Date.UTC(
|
|
1313
|
+
_date.getFullYear(),
|
|
1314
|
+
_date.getMonth(),
|
|
1315
|
+
_date.getDate(),
|
|
1316
|
+
_date.getHours(),
|
|
1317
|
+
_date.getMinutes(),
|
|
1318
|
+
_date.getSeconds(),
|
|
1319
|
+
_date.getMilliseconds()
|
|
1320
|
+
)
|
|
1321
|
+
);
|
|
1322
|
+
utcDate.setUTCFullYear(_date.getFullYear());
|
|
1323
|
+
return +date - +utcDate;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
// node_modules/date-fns/_lib/normalizeDates.js
|
|
1327
|
+
function normalizeDates(context, ...dates) {
|
|
1328
|
+
const normalize = constructFrom.bind(
|
|
1329
|
+
null,
|
|
1330
|
+
context || dates.find((date) => typeof date === "object")
|
|
1331
|
+
);
|
|
1332
|
+
return dates.map(normalize);
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
// node_modules/date-fns/startOfDay.js
|
|
1336
|
+
function startOfDay(date, options) {
|
|
1337
|
+
const _date = toDate(date, options?.in);
|
|
1338
|
+
_date.setHours(0, 0, 0, 0);
|
|
1339
|
+
return _date;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
// node_modules/date-fns/differenceInCalendarDays.js
|
|
1343
|
+
function differenceInCalendarDays(laterDate, earlierDate, options) {
|
|
1344
|
+
const [laterDate_, earlierDate_] = normalizeDates(
|
|
1345
|
+
options?.in,
|
|
1346
|
+
laterDate,
|
|
1347
|
+
earlierDate
|
|
1348
|
+
);
|
|
1349
|
+
const laterStartOfDay = startOfDay(laterDate_);
|
|
1350
|
+
const earlierStartOfDay = startOfDay(earlierDate_);
|
|
1351
|
+
const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
|
|
1352
|
+
const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
|
|
1353
|
+
return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
// node_modules/date-fns/startOfISOWeekYear.js
|
|
1357
|
+
function startOfISOWeekYear(date, options) {
|
|
1358
|
+
const year = getISOWeekYear(date, options);
|
|
1359
|
+
const fourthOfJanuary = constructFrom(options?.in || date, 0);
|
|
1360
|
+
fourthOfJanuary.setFullYear(year, 0, 4);
|
|
1361
|
+
fourthOfJanuary.setHours(0, 0, 0, 0);
|
|
1362
|
+
return startOfISOWeek(fourthOfJanuary);
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
// node_modules/date-fns/isDate.js
|
|
1366
|
+
function isDate(value) {
|
|
1367
|
+
return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
// node_modules/date-fns/isValid.js
|
|
1371
|
+
function isValid(date) {
|
|
1372
|
+
return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
// node_modules/date-fns/startOfYear.js
|
|
1376
|
+
function startOfYear(date, options) {
|
|
1377
|
+
const date_ = toDate(date, options?.in);
|
|
1378
|
+
date_.setFullYear(date_.getFullYear(), 0, 1);
|
|
1379
|
+
date_.setHours(0, 0, 0, 0);
|
|
1380
|
+
return date_;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
// node_modules/date-fns/locale/en-US/_lib/formatDistance.js
|
|
1384
|
+
var formatDistanceLocale = {
|
|
1385
|
+
lessThanXSeconds: {
|
|
1386
|
+
one: "less than a second",
|
|
1387
|
+
other: "less than {{count}} seconds"
|
|
1388
|
+
},
|
|
1389
|
+
xSeconds: {
|
|
1390
|
+
one: "1 second",
|
|
1391
|
+
other: "{{count}} seconds"
|
|
1392
|
+
},
|
|
1393
|
+
halfAMinute: "half a minute",
|
|
1394
|
+
lessThanXMinutes: {
|
|
1395
|
+
one: "less than a minute",
|
|
1396
|
+
other: "less than {{count}} minutes"
|
|
1397
|
+
},
|
|
1398
|
+
xMinutes: {
|
|
1399
|
+
one: "1 minute",
|
|
1400
|
+
other: "{{count}} minutes"
|
|
1401
|
+
},
|
|
1402
|
+
aboutXHours: {
|
|
1403
|
+
one: "about 1 hour",
|
|
1404
|
+
other: "about {{count}} hours"
|
|
1405
|
+
},
|
|
1406
|
+
xHours: {
|
|
1407
|
+
one: "1 hour",
|
|
1408
|
+
other: "{{count}} hours"
|
|
1409
|
+
},
|
|
1410
|
+
xDays: {
|
|
1411
|
+
one: "1 day",
|
|
1412
|
+
other: "{{count}} days"
|
|
1413
|
+
},
|
|
1414
|
+
aboutXWeeks: {
|
|
1415
|
+
one: "about 1 week",
|
|
1416
|
+
other: "about {{count}} weeks"
|
|
1417
|
+
},
|
|
1418
|
+
xWeeks: {
|
|
1419
|
+
one: "1 week",
|
|
1420
|
+
other: "{{count}} weeks"
|
|
1421
|
+
},
|
|
1422
|
+
aboutXMonths: {
|
|
1423
|
+
one: "about 1 month",
|
|
1424
|
+
other: "about {{count}} months"
|
|
1425
|
+
},
|
|
1426
|
+
xMonths: {
|
|
1427
|
+
one: "1 month",
|
|
1428
|
+
other: "{{count}} months"
|
|
1429
|
+
},
|
|
1430
|
+
aboutXYears: {
|
|
1431
|
+
one: "about 1 year",
|
|
1432
|
+
other: "about {{count}} years"
|
|
1433
|
+
},
|
|
1434
|
+
xYears: {
|
|
1435
|
+
one: "1 year",
|
|
1436
|
+
other: "{{count}} years"
|
|
1437
|
+
},
|
|
1438
|
+
overXYears: {
|
|
1439
|
+
one: "over 1 year",
|
|
1440
|
+
other: "over {{count}} years"
|
|
1441
|
+
},
|
|
1442
|
+
almostXYears: {
|
|
1443
|
+
one: "almost 1 year",
|
|
1444
|
+
other: "almost {{count}} years"
|
|
1445
|
+
}
|
|
1446
|
+
};
|
|
1447
|
+
var formatDistance = (token, count, options) => {
|
|
1448
|
+
let result;
|
|
1449
|
+
const tokenValue = formatDistanceLocale[token];
|
|
1450
|
+
if (typeof tokenValue === "string") {
|
|
1451
|
+
result = tokenValue;
|
|
1452
|
+
} else if (count === 1) {
|
|
1453
|
+
result = tokenValue.one;
|
|
1454
|
+
} else {
|
|
1455
|
+
result = tokenValue.other.replace("{{count}}", count.toString());
|
|
1456
|
+
}
|
|
1457
|
+
if (options?.addSuffix) {
|
|
1458
|
+
if (options.comparison && options.comparison > 0) {
|
|
1459
|
+
return "in " + result;
|
|
1460
|
+
} else {
|
|
1461
|
+
return result + " ago";
|
|
1462
|
+
}
|
|
1463
|
+
}
|
|
1464
|
+
return result;
|
|
1465
|
+
};
|
|
1466
|
+
|
|
1467
|
+
// node_modules/date-fns/locale/_lib/buildFormatLongFn.js
|
|
1468
|
+
function buildFormatLongFn(args) {
|
|
1469
|
+
return (options = {}) => {
|
|
1470
|
+
const width = options.width ? String(options.width) : args.defaultWidth;
|
|
1471
|
+
const format2 = args.formats[width] || args.formats[args.defaultWidth];
|
|
1472
|
+
return format2;
|
|
1473
|
+
};
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
// node_modules/date-fns/locale/en-US/_lib/formatLong.js
|
|
1477
|
+
var dateFormats = {
|
|
1478
|
+
full: "EEEE, MMMM do, y",
|
|
1479
|
+
long: "MMMM do, y",
|
|
1480
|
+
medium: "MMM d, y",
|
|
1481
|
+
short: "MM/dd/yyyy"
|
|
1482
|
+
};
|
|
1483
|
+
var timeFormats = {
|
|
1484
|
+
full: "h:mm:ss a zzzz",
|
|
1485
|
+
long: "h:mm:ss a z",
|
|
1486
|
+
medium: "h:mm:ss a",
|
|
1487
|
+
short: "h:mm a"
|
|
1488
|
+
};
|
|
1489
|
+
var dateTimeFormats = {
|
|
1490
|
+
full: "{{date}} 'at' {{time}}",
|
|
1491
|
+
long: "{{date}} 'at' {{time}}",
|
|
1492
|
+
medium: "{{date}}, {{time}}",
|
|
1493
|
+
short: "{{date}}, {{time}}"
|
|
1494
|
+
};
|
|
1495
|
+
var formatLong = {
|
|
1496
|
+
date: buildFormatLongFn({
|
|
1497
|
+
formats: dateFormats,
|
|
1498
|
+
defaultWidth: "full"
|
|
1499
|
+
}),
|
|
1500
|
+
time: buildFormatLongFn({
|
|
1501
|
+
formats: timeFormats,
|
|
1502
|
+
defaultWidth: "full"
|
|
1503
|
+
}),
|
|
1504
|
+
dateTime: buildFormatLongFn({
|
|
1505
|
+
formats: dateTimeFormats,
|
|
1506
|
+
defaultWidth: "full"
|
|
1507
|
+
})
|
|
1508
|
+
};
|
|
1509
|
+
|
|
1510
|
+
// node_modules/date-fns/locale/en-US/_lib/formatRelative.js
|
|
1511
|
+
var formatRelativeLocale = {
|
|
1512
|
+
lastWeek: "'last' eeee 'at' p",
|
|
1513
|
+
yesterday: "'yesterday at' p",
|
|
1514
|
+
today: "'today at' p",
|
|
1515
|
+
tomorrow: "'tomorrow at' p",
|
|
1516
|
+
nextWeek: "eeee 'at' p",
|
|
1517
|
+
other: "P"
|
|
1518
|
+
};
|
|
1519
|
+
var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];
|
|
1520
|
+
|
|
1521
|
+
// node_modules/date-fns/locale/_lib/buildLocalizeFn.js
|
|
1522
|
+
function buildLocalizeFn(args) {
|
|
1523
|
+
return (value, options) => {
|
|
1524
|
+
const context = options?.context ? String(options.context) : "standalone";
|
|
1525
|
+
let valuesArray;
|
|
1526
|
+
if (context === "formatting" && args.formattingValues) {
|
|
1527
|
+
const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
1528
|
+
const width = options?.width ? String(options.width) : defaultWidth;
|
|
1529
|
+
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
1530
|
+
} else {
|
|
1531
|
+
const defaultWidth = args.defaultWidth;
|
|
1532
|
+
const width = options?.width ? String(options.width) : args.defaultWidth;
|
|
1533
|
+
valuesArray = args.values[width] || args.values[defaultWidth];
|
|
1534
|
+
}
|
|
1535
|
+
const index = args.argumentCallback ? args.argumentCallback(value) : value;
|
|
1536
|
+
return valuesArray[index];
|
|
1537
|
+
};
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
// node_modules/date-fns/locale/en-US/_lib/localize.js
|
|
1541
|
+
var eraValues = {
|
|
1542
|
+
narrow: ["B", "A"],
|
|
1543
|
+
abbreviated: ["BC", "AD"],
|
|
1544
|
+
wide: ["Before Christ", "Anno Domini"]
|
|
1545
|
+
};
|
|
1546
|
+
var quarterValues = {
|
|
1547
|
+
narrow: ["1", "2", "3", "4"],
|
|
1548
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
1549
|
+
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
|
|
1550
|
+
};
|
|
1551
|
+
var monthValues = {
|
|
1552
|
+
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
|
|
1553
|
+
abbreviated: [
|
|
1554
|
+
"Jan",
|
|
1555
|
+
"Feb",
|
|
1556
|
+
"Mar",
|
|
1557
|
+
"Apr",
|
|
1558
|
+
"May",
|
|
1559
|
+
"Jun",
|
|
1560
|
+
"Jul",
|
|
1561
|
+
"Aug",
|
|
1562
|
+
"Sep",
|
|
1563
|
+
"Oct",
|
|
1564
|
+
"Nov",
|
|
1565
|
+
"Dec"
|
|
1566
|
+
],
|
|
1567
|
+
wide: [
|
|
1568
|
+
"January",
|
|
1569
|
+
"February",
|
|
1570
|
+
"March",
|
|
1571
|
+
"April",
|
|
1572
|
+
"May",
|
|
1573
|
+
"June",
|
|
1574
|
+
"July",
|
|
1575
|
+
"August",
|
|
1576
|
+
"September",
|
|
1577
|
+
"October",
|
|
1578
|
+
"November",
|
|
1579
|
+
"December"
|
|
1580
|
+
]
|
|
1581
|
+
};
|
|
1582
|
+
var dayValues = {
|
|
1583
|
+
narrow: ["S", "M", "T", "W", "T", "F", "S"],
|
|
1584
|
+
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
|
|
1585
|
+
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
|
1586
|
+
wide: [
|
|
1587
|
+
"Sunday",
|
|
1588
|
+
"Monday",
|
|
1589
|
+
"Tuesday",
|
|
1590
|
+
"Wednesday",
|
|
1591
|
+
"Thursday",
|
|
1592
|
+
"Friday",
|
|
1593
|
+
"Saturday"
|
|
1594
|
+
]
|
|
1595
|
+
};
|
|
1596
|
+
var dayPeriodValues = {
|
|
1597
|
+
narrow: {
|
|
1598
|
+
am: "a",
|
|
1599
|
+
pm: "p",
|
|
1600
|
+
midnight: "mi",
|
|
1601
|
+
noon: "n",
|
|
1602
|
+
morning: "morning",
|
|
1603
|
+
afternoon: "afternoon",
|
|
1604
|
+
evening: "evening",
|
|
1605
|
+
night: "night"
|
|
1606
|
+
},
|
|
1607
|
+
abbreviated: {
|
|
1608
|
+
am: "AM",
|
|
1609
|
+
pm: "PM",
|
|
1610
|
+
midnight: "midnight",
|
|
1611
|
+
noon: "noon",
|
|
1612
|
+
morning: "morning",
|
|
1613
|
+
afternoon: "afternoon",
|
|
1614
|
+
evening: "evening",
|
|
1615
|
+
night: "night"
|
|
1616
|
+
},
|
|
1617
|
+
wide: {
|
|
1618
|
+
am: "a.m.",
|
|
1619
|
+
pm: "p.m.",
|
|
1620
|
+
midnight: "midnight",
|
|
1621
|
+
noon: "noon",
|
|
1622
|
+
morning: "morning",
|
|
1623
|
+
afternoon: "afternoon",
|
|
1624
|
+
evening: "evening",
|
|
1625
|
+
night: "night"
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
var formattingDayPeriodValues = {
|
|
1629
|
+
narrow: {
|
|
1630
|
+
am: "a",
|
|
1631
|
+
pm: "p",
|
|
1632
|
+
midnight: "mi",
|
|
1633
|
+
noon: "n",
|
|
1634
|
+
morning: "in the morning",
|
|
1635
|
+
afternoon: "in the afternoon",
|
|
1636
|
+
evening: "in the evening",
|
|
1637
|
+
night: "at night"
|
|
1638
|
+
},
|
|
1639
|
+
abbreviated: {
|
|
1640
|
+
am: "AM",
|
|
1641
|
+
pm: "PM",
|
|
1642
|
+
midnight: "midnight",
|
|
1643
|
+
noon: "noon",
|
|
1644
|
+
morning: "in the morning",
|
|
1645
|
+
afternoon: "in the afternoon",
|
|
1646
|
+
evening: "in the evening",
|
|
1647
|
+
night: "at night"
|
|
1648
|
+
},
|
|
1649
|
+
wide: {
|
|
1650
|
+
am: "a.m.",
|
|
1651
|
+
pm: "p.m.",
|
|
1652
|
+
midnight: "midnight",
|
|
1653
|
+
noon: "noon",
|
|
1654
|
+
morning: "in the morning",
|
|
1655
|
+
afternoon: "in the afternoon",
|
|
1656
|
+
evening: "in the evening",
|
|
1657
|
+
night: "at night"
|
|
1658
|
+
}
|
|
1659
|
+
};
|
|
1660
|
+
var ordinalNumber = (dirtyNumber, _options) => {
|
|
1661
|
+
const number = Number(dirtyNumber);
|
|
1662
|
+
const rem100 = number % 100;
|
|
1663
|
+
if (rem100 > 20 || rem100 < 10) {
|
|
1664
|
+
switch (rem100 % 10) {
|
|
1665
|
+
case 1:
|
|
1666
|
+
return number + "st";
|
|
1667
|
+
case 2:
|
|
1668
|
+
return number + "nd";
|
|
1669
|
+
case 3:
|
|
1670
|
+
return number + "rd";
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
return number + "th";
|
|
1674
|
+
};
|
|
1675
|
+
var localize = {
|
|
1676
|
+
ordinalNumber,
|
|
1677
|
+
era: buildLocalizeFn({
|
|
1678
|
+
values: eraValues,
|
|
1679
|
+
defaultWidth: "wide"
|
|
1680
|
+
}),
|
|
1681
|
+
quarter: buildLocalizeFn({
|
|
1682
|
+
values: quarterValues,
|
|
1683
|
+
defaultWidth: "wide",
|
|
1684
|
+
argumentCallback: (quarter) => quarter - 1
|
|
1685
|
+
}),
|
|
1686
|
+
month: buildLocalizeFn({
|
|
1687
|
+
values: monthValues,
|
|
1688
|
+
defaultWidth: "wide"
|
|
1689
|
+
}),
|
|
1690
|
+
day: buildLocalizeFn({
|
|
1691
|
+
values: dayValues,
|
|
1692
|
+
defaultWidth: "wide"
|
|
1693
|
+
}),
|
|
1694
|
+
dayPeriod: buildLocalizeFn({
|
|
1695
|
+
values: dayPeriodValues,
|
|
1696
|
+
defaultWidth: "wide",
|
|
1697
|
+
formattingValues: formattingDayPeriodValues,
|
|
1698
|
+
defaultFormattingWidth: "wide"
|
|
1699
|
+
})
|
|
1700
|
+
};
|
|
1701
|
+
|
|
1702
|
+
// node_modules/date-fns/locale/_lib/buildMatchFn.js
|
|
1703
|
+
function buildMatchFn(args) {
|
|
1704
|
+
return (string, options = {}) => {
|
|
1705
|
+
const width = options.width;
|
|
1706
|
+
const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
1707
|
+
const matchResult = string.match(matchPattern);
|
|
1708
|
+
if (!matchResult) {
|
|
1709
|
+
return null;
|
|
1710
|
+
}
|
|
1711
|
+
const matchedString = matchResult[0];
|
|
1712
|
+
const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
1713
|
+
const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
|
|
1714
|
+
// [TODO] -- I challenge you to fix the type
|
|
1715
|
+
findKey(parsePatterns, (pattern) => pattern.test(matchedString))
|
|
1716
|
+
);
|
|
1717
|
+
let value;
|
|
1718
|
+
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
1719
|
+
value = options.valueCallback ? (
|
|
1720
|
+
// [TODO] -- I challenge you to fix the type
|
|
1721
|
+
options.valueCallback(value)
|
|
1722
|
+
) : value;
|
|
1723
|
+
const rest = string.slice(matchedString.length);
|
|
1724
|
+
return { value, rest };
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
function findKey(object, predicate) {
|
|
1728
|
+
for (const key in object) {
|
|
1729
|
+
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
|
|
1730
|
+
return key;
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
return void 0;
|
|
1734
|
+
}
|
|
1735
|
+
function findIndex(array, predicate) {
|
|
1736
|
+
for (let key = 0; key < array.length; key++) {
|
|
1737
|
+
if (predicate(array[key])) {
|
|
1738
|
+
return key;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
return void 0;
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1744
|
+
// node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
|
|
1745
|
+
function buildMatchPatternFn(args) {
|
|
1746
|
+
return (string, options = {}) => {
|
|
1747
|
+
const matchResult = string.match(args.matchPattern);
|
|
1748
|
+
if (!matchResult) return null;
|
|
1749
|
+
const matchedString = matchResult[0];
|
|
1750
|
+
const parseResult = string.match(args.parsePattern);
|
|
1751
|
+
if (!parseResult) return null;
|
|
1752
|
+
let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
1753
|
+
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
1754
|
+
const rest = string.slice(matchedString.length);
|
|
1755
|
+
return { value, rest };
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
// node_modules/date-fns/locale/en-US/_lib/match.js
|
|
1760
|
+
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
|
|
1761
|
+
var parseOrdinalNumberPattern = /\d+/i;
|
|
1762
|
+
var matchEraPatterns = {
|
|
1763
|
+
narrow: /^(b|a)/i,
|
|
1764
|
+
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
|
|
1765
|
+
wide: /^(before christ|before common era|anno domini|common era)/i
|
|
1766
|
+
};
|
|
1767
|
+
var parseEraPatterns = {
|
|
1768
|
+
any: [/^b/i, /^(a|c)/i]
|
|
1769
|
+
};
|
|
1770
|
+
var matchQuarterPatterns = {
|
|
1771
|
+
narrow: /^[1234]/i,
|
|
1772
|
+
abbreviated: /^q[1234]/i,
|
|
1773
|
+
wide: /^[1234](th|st|nd|rd)? quarter/i
|
|
1774
|
+
};
|
|
1775
|
+
var parseQuarterPatterns = {
|
|
1776
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
1777
|
+
};
|
|
1778
|
+
var matchMonthPatterns = {
|
|
1779
|
+
narrow: /^[jfmasond]/i,
|
|
1780
|
+
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
|
|
1781
|
+
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
|
|
1782
|
+
};
|
|
1783
|
+
var parseMonthPatterns = {
|
|
1784
|
+
narrow: [
|
|
1785
|
+
/^j/i,
|
|
1786
|
+
/^f/i,
|
|
1787
|
+
/^m/i,
|
|
1788
|
+
/^a/i,
|
|
1789
|
+
/^m/i,
|
|
1790
|
+
/^j/i,
|
|
1791
|
+
/^j/i,
|
|
1792
|
+
/^a/i,
|
|
1793
|
+
/^s/i,
|
|
1794
|
+
/^o/i,
|
|
1795
|
+
/^n/i,
|
|
1796
|
+
/^d/i
|
|
1797
|
+
],
|
|
1798
|
+
any: [
|
|
1799
|
+
/^ja/i,
|
|
1800
|
+
/^f/i,
|
|
1801
|
+
/^mar/i,
|
|
1802
|
+
/^ap/i,
|
|
1803
|
+
/^may/i,
|
|
1804
|
+
/^jun/i,
|
|
1805
|
+
/^jul/i,
|
|
1806
|
+
/^au/i,
|
|
1807
|
+
/^s/i,
|
|
1808
|
+
/^o/i,
|
|
1809
|
+
/^n/i,
|
|
1810
|
+
/^d/i
|
|
1811
|
+
]
|
|
1812
|
+
};
|
|
1813
|
+
var matchDayPatterns = {
|
|
1814
|
+
narrow: /^[smtwf]/i,
|
|
1815
|
+
short: /^(su|mo|tu|we|th|fr|sa)/i,
|
|
1816
|
+
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
|
|
1817
|
+
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
|
|
1818
|
+
};
|
|
1819
|
+
var parseDayPatterns = {
|
|
1820
|
+
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
|
|
1821
|
+
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
|
|
1822
|
+
};
|
|
1823
|
+
var matchDayPeriodPatterns = {
|
|
1824
|
+
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
|
|
1825
|
+
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
|
|
1826
|
+
};
|
|
1827
|
+
var parseDayPeriodPatterns = {
|
|
1828
|
+
any: {
|
|
1829
|
+
am: /^a/i,
|
|
1830
|
+
pm: /^p/i,
|
|
1831
|
+
midnight: /^mi/i,
|
|
1832
|
+
noon: /^no/i,
|
|
1833
|
+
morning: /morning/i,
|
|
1834
|
+
afternoon: /afternoon/i,
|
|
1835
|
+
evening: /evening/i,
|
|
1836
|
+
night: /night/i
|
|
1837
|
+
}
|
|
1838
|
+
};
|
|
1839
|
+
var match = {
|
|
1840
|
+
ordinalNumber: buildMatchPatternFn({
|
|
1841
|
+
matchPattern: matchOrdinalNumberPattern,
|
|
1842
|
+
parsePattern: parseOrdinalNumberPattern,
|
|
1843
|
+
valueCallback: (value) => parseInt(value, 10)
|
|
1844
|
+
}),
|
|
1845
|
+
era: buildMatchFn({
|
|
1846
|
+
matchPatterns: matchEraPatterns,
|
|
1847
|
+
defaultMatchWidth: "wide",
|
|
1848
|
+
parsePatterns: parseEraPatterns,
|
|
1849
|
+
defaultParseWidth: "any"
|
|
1850
|
+
}),
|
|
1851
|
+
quarter: buildMatchFn({
|
|
1852
|
+
matchPatterns: matchQuarterPatterns,
|
|
1853
|
+
defaultMatchWidth: "wide",
|
|
1854
|
+
parsePatterns: parseQuarterPatterns,
|
|
1855
|
+
defaultParseWidth: "any",
|
|
1856
|
+
valueCallback: (index) => index + 1
|
|
1857
|
+
}),
|
|
1858
|
+
month: buildMatchFn({
|
|
1859
|
+
matchPatterns: matchMonthPatterns,
|
|
1860
|
+
defaultMatchWidth: "wide",
|
|
1861
|
+
parsePatterns: parseMonthPatterns,
|
|
1862
|
+
defaultParseWidth: "any"
|
|
1863
|
+
}),
|
|
1864
|
+
day: buildMatchFn({
|
|
1865
|
+
matchPatterns: matchDayPatterns,
|
|
1866
|
+
defaultMatchWidth: "wide",
|
|
1867
|
+
parsePatterns: parseDayPatterns,
|
|
1868
|
+
defaultParseWidth: "any"
|
|
1869
|
+
}),
|
|
1870
|
+
dayPeriod: buildMatchFn({
|
|
1871
|
+
matchPatterns: matchDayPeriodPatterns,
|
|
1872
|
+
defaultMatchWidth: "any",
|
|
1873
|
+
parsePatterns: parseDayPeriodPatterns,
|
|
1874
|
+
defaultParseWidth: "any"
|
|
1875
|
+
})
|
|
1876
|
+
};
|
|
1877
|
+
|
|
1878
|
+
// node_modules/date-fns/locale/en-US.js
|
|
1879
|
+
var enUS = {
|
|
1880
|
+
code: "en-US",
|
|
1881
|
+
formatDistance,
|
|
1882
|
+
formatLong,
|
|
1883
|
+
formatRelative,
|
|
1884
|
+
localize,
|
|
1885
|
+
match,
|
|
1886
|
+
options: {
|
|
1887
|
+
weekStartsOn: 0,
|
|
1888
|
+
firstWeekContainsDate: 1
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
|
|
1892
|
+
// node_modules/date-fns/getDayOfYear.js
|
|
1893
|
+
function getDayOfYear(date, options) {
|
|
1894
|
+
const _date = toDate(date, options?.in);
|
|
1895
|
+
const diff = differenceInCalendarDays(_date, startOfYear(_date));
|
|
1896
|
+
const dayOfYear = diff + 1;
|
|
1897
|
+
return dayOfYear;
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1900
|
+
// node_modules/date-fns/getISOWeek.js
|
|
1901
|
+
function getISOWeek(date, options) {
|
|
1902
|
+
const _date = toDate(date, options?.in);
|
|
1903
|
+
const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
|
|
1904
|
+
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
// node_modules/date-fns/getWeekYear.js
|
|
1908
|
+
function getWeekYear(date, options) {
|
|
1909
|
+
const _date = toDate(date, options?.in);
|
|
1910
|
+
const year = _date.getFullYear();
|
|
1911
|
+
const defaultOptions2 = getDefaultOptions();
|
|
1912
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
1913
|
+
const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
|
|
1914
|
+
firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
|
|
1915
|
+
firstWeekOfNextYear.setHours(0, 0, 0, 0);
|
|
1916
|
+
const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
|
|
1917
|
+
const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
|
|
1918
|
+
firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
|
|
1919
|
+
firstWeekOfThisYear.setHours(0, 0, 0, 0);
|
|
1920
|
+
const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
|
|
1921
|
+
if (+_date >= +startOfNextYear) {
|
|
1922
|
+
return year + 1;
|
|
1923
|
+
} else if (+_date >= +startOfThisYear) {
|
|
1924
|
+
return year;
|
|
1925
|
+
} else {
|
|
1926
|
+
return year - 1;
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
// node_modules/date-fns/startOfWeekYear.js
|
|
1931
|
+
function startOfWeekYear(date, options) {
|
|
1932
|
+
const defaultOptions2 = getDefaultOptions();
|
|
1933
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
1934
|
+
const year = getWeekYear(date, options);
|
|
1935
|
+
const firstWeek = constructFrom(options?.in || date, 0);
|
|
1936
|
+
firstWeek.setFullYear(year, 0, firstWeekContainsDate);
|
|
1937
|
+
firstWeek.setHours(0, 0, 0, 0);
|
|
1938
|
+
const _date = startOfWeek(firstWeek, options);
|
|
1939
|
+
return _date;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
// node_modules/date-fns/getWeek.js
|
|
1943
|
+
function getWeek(date, options) {
|
|
1944
|
+
const _date = toDate(date, options?.in);
|
|
1945
|
+
const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
|
|
1946
|
+
return Math.round(diff / millisecondsInWeek) + 1;
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
// node_modules/date-fns/_lib/addLeadingZeros.js
|
|
1950
|
+
function addLeadingZeros(number, targetLength) {
|
|
1951
|
+
const sign = number < 0 ? "-" : "";
|
|
1952
|
+
const output = Math.abs(number).toString().padStart(targetLength, "0");
|
|
1953
|
+
return sign + output;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
// node_modules/date-fns/_lib/format/lightFormatters.js
|
|
1957
|
+
var lightFormatters = {
|
|
1958
|
+
// Year
|
|
1959
|
+
y(date, token) {
|
|
1960
|
+
const signedYear = date.getFullYear();
|
|
1961
|
+
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
1962
|
+
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
|
|
1963
|
+
},
|
|
1964
|
+
// Month
|
|
1965
|
+
M(date, token) {
|
|
1966
|
+
const month = date.getMonth();
|
|
1967
|
+
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
|
|
1968
|
+
},
|
|
1969
|
+
// Day of the month
|
|
1970
|
+
d(date, token) {
|
|
1971
|
+
return addLeadingZeros(date.getDate(), token.length);
|
|
1972
|
+
},
|
|
1973
|
+
// AM or PM
|
|
1974
|
+
a(date, token) {
|
|
1975
|
+
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
|
|
1976
|
+
switch (token) {
|
|
1977
|
+
case "a":
|
|
1978
|
+
case "aa":
|
|
1979
|
+
return dayPeriodEnumValue.toUpperCase();
|
|
1980
|
+
case "aaa":
|
|
1981
|
+
return dayPeriodEnumValue;
|
|
1982
|
+
case "aaaaa":
|
|
1983
|
+
return dayPeriodEnumValue[0];
|
|
1984
|
+
case "aaaa":
|
|
1985
|
+
default:
|
|
1986
|
+
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
|
|
1987
|
+
}
|
|
1988
|
+
},
|
|
1989
|
+
// Hour [1-12]
|
|
1990
|
+
h(date, token) {
|
|
1991
|
+
return addLeadingZeros(date.getHours() % 12 || 12, token.length);
|
|
1992
|
+
},
|
|
1993
|
+
// Hour [0-23]
|
|
1994
|
+
H(date, token) {
|
|
1995
|
+
return addLeadingZeros(date.getHours(), token.length);
|
|
1996
|
+
},
|
|
1997
|
+
// Minute
|
|
1998
|
+
m(date, token) {
|
|
1999
|
+
return addLeadingZeros(date.getMinutes(), token.length);
|
|
2000
|
+
},
|
|
2001
|
+
// Second
|
|
2002
|
+
s(date, token) {
|
|
2003
|
+
return addLeadingZeros(date.getSeconds(), token.length);
|
|
2004
|
+
},
|
|
2005
|
+
// Fraction of second
|
|
2006
|
+
S(date, token) {
|
|
2007
|
+
const numberOfDigits = token.length;
|
|
2008
|
+
const milliseconds = date.getMilliseconds();
|
|
2009
|
+
const fractionalSeconds = Math.trunc(
|
|
2010
|
+
milliseconds * Math.pow(10, numberOfDigits - 3)
|
|
2011
|
+
);
|
|
2012
|
+
return addLeadingZeros(fractionalSeconds, token.length);
|
|
2013
|
+
}
|
|
2014
|
+
};
|
|
2015
|
+
|
|
2016
|
+
// node_modules/date-fns/_lib/format/formatters.js
|
|
2017
|
+
var dayPeriodEnum = {
|
|
2018
|
+
am: "am",
|
|
2019
|
+
pm: "pm",
|
|
2020
|
+
midnight: "midnight",
|
|
2021
|
+
noon: "noon",
|
|
2022
|
+
morning: "morning",
|
|
2023
|
+
afternoon: "afternoon",
|
|
2024
|
+
evening: "evening",
|
|
2025
|
+
night: "night"
|
|
2026
|
+
};
|
|
2027
|
+
var formatters = {
|
|
2028
|
+
// Era
|
|
2029
|
+
G: function(date, token, localize3) {
|
|
2030
|
+
const era = date.getFullYear() > 0 ? 1 : 0;
|
|
2031
|
+
switch (token) {
|
|
2032
|
+
// AD, BC
|
|
2033
|
+
case "G":
|
|
2034
|
+
case "GG":
|
|
2035
|
+
case "GGG":
|
|
2036
|
+
return localize3.era(era, { width: "abbreviated" });
|
|
2037
|
+
// A, B
|
|
2038
|
+
case "GGGGG":
|
|
2039
|
+
return localize3.era(era, { width: "narrow" });
|
|
2040
|
+
// Anno Domini, Before Christ
|
|
2041
|
+
case "GGGG":
|
|
2042
|
+
default:
|
|
2043
|
+
return localize3.era(era, { width: "wide" });
|
|
2044
|
+
}
|
|
2045
|
+
},
|
|
2046
|
+
// Year
|
|
2047
|
+
y: function(date, token, localize3) {
|
|
2048
|
+
if (token === "yo") {
|
|
2049
|
+
const signedYear = date.getFullYear();
|
|
2050
|
+
const year = signedYear > 0 ? signedYear : 1 - signedYear;
|
|
2051
|
+
return localize3.ordinalNumber(year, { unit: "year" });
|
|
2052
|
+
}
|
|
2053
|
+
return lightFormatters.y(date, token);
|
|
2054
|
+
},
|
|
2055
|
+
// Local week-numbering year
|
|
2056
|
+
Y: function(date, token, localize3, options) {
|
|
2057
|
+
const signedWeekYear = getWeekYear(date, options);
|
|
2058
|
+
const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
|
|
2059
|
+
if (token === "YY") {
|
|
2060
|
+
const twoDigitYear = weekYear % 100;
|
|
2061
|
+
return addLeadingZeros(twoDigitYear, 2);
|
|
2062
|
+
}
|
|
2063
|
+
if (token === "Yo") {
|
|
2064
|
+
return localize3.ordinalNumber(weekYear, { unit: "year" });
|
|
2065
|
+
}
|
|
2066
|
+
return addLeadingZeros(weekYear, token.length);
|
|
2067
|
+
},
|
|
2068
|
+
// ISO week-numbering year
|
|
2069
|
+
R: function(date, token) {
|
|
2070
|
+
const isoWeekYear = getISOWeekYear(date);
|
|
2071
|
+
return addLeadingZeros(isoWeekYear, token.length);
|
|
2072
|
+
},
|
|
2073
|
+
// Extended year. This is a single number designating the year of this calendar system.
|
|
2074
|
+
// The main difference between `y` and `u` localizers are B.C. years:
|
|
2075
|
+
// | Year | `y` | `u` |
|
|
2076
|
+
// |------|-----|-----|
|
|
2077
|
+
// | AC 1 | 1 | 1 |
|
|
2078
|
+
// | BC 1 | 1 | 0 |
|
|
2079
|
+
// | BC 2 | 2 | -1 |
|
|
2080
|
+
// Also `yy` always returns the last two digits of a year,
|
|
2081
|
+
// while `uu` pads single digit years to 2 characters and returns other years unchanged.
|
|
2082
|
+
u: function(date, token) {
|
|
2083
|
+
const year = date.getFullYear();
|
|
2084
|
+
return addLeadingZeros(year, token.length);
|
|
2085
|
+
},
|
|
2086
|
+
// Quarter
|
|
2087
|
+
Q: function(date, token, localize3) {
|
|
2088
|
+
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
2089
|
+
switch (token) {
|
|
2090
|
+
// 1, 2, 3, 4
|
|
2091
|
+
case "Q":
|
|
2092
|
+
return String(quarter);
|
|
2093
|
+
// 01, 02, 03, 04
|
|
2094
|
+
case "QQ":
|
|
2095
|
+
return addLeadingZeros(quarter, 2);
|
|
2096
|
+
// 1st, 2nd, 3rd, 4th
|
|
2097
|
+
case "Qo":
|
|
2098
|
+
return localize3.ordinalNumber(quarter, { unit: "quarter" });
|
|
2099
|
+
// Q1, Q2, Q3, Q4
|
|
2100
|
+
case "QQQ":
|
|
2101
|
+
return localize3.quarter(quarter, {
|
|
2102
|
+
width: "abbreviated",
|
|
2103
|
+
context: "formatting"
|
|
2104
|
+
});
|
|
2105
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2106
|
+
case "QQQQQ":
|
|
2107
|
+
return localize3.quarter(quarter, {
|
|
2108
|
+
width: "narrow",
|
|
2109
|
+
context: "formatting"
|
|
2110
|
+
});
|
|
2111
|
+
// 1st quarter, 2nd quarter, ...
|
|
2112
|
+
case "QQQQ":
|
|
2113
|
+
default:
|
|
2114
|
+
return localize3.quarter(quarter, {
|
|
2115
|
+
width: "wide",
|
|
2116
|
+
context: "formatting"
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
},
|
|
2120
|
+
// Stand-alone quarter
|
|
2121
|
+
q: function(date, token, localize3) {
|
|
2122
|
+
const quarter = Math.ceil((date.getMonth() + 1) / 3);
|
|
2123
|
+
switch (token) {
|
|
2124
|
+
// 1, 2, 3, 4
|
|
2125
|
+
case "q":
|
|
2126
|
+
return String(quarter);
|
|
2127
|
+
// 01, 02, 03, 04
|
|
2128
|
+
case "qq":
|
|
2129
|
+
return addLeadingZeros(quarter, 2);
|
|
2130
|
+
// 1st, 2nd, 3rd, 4th
|
|
2131
|
+
case "qo":
|
|
2132
|
+
return localize3.ordinalNumber(quarter, { unit: "quarter" });
|
|
2133
|
+
// Q1, Q2, Q3, Q4
|
|
2134
|
+
case "qqq":
|
|
2135
|
+
return localize3.quarter(quarter, {
|
|
2136
|
+
width: "abbreviated",
|
|
2137
|
+
context: "standalone"
|
|
2138
|
+
});
|
|
2139
|
+
// 1, 2, 3, 4 (narrow quarter; could be not numerical)
|
|
2140
|
+
case "qqqqq":
|
|
2141
|
+
return localize3.quarter(quarter, {
|
|
2142
|
+
width: "narrow",
|
|
2143
|
+
context: "standalone"
|
|
2144
|
+
});
|
|
2145
|
+
// 1st quarter, 2nd quarter, ...
|
|
2146
|
+
case "qqqq":
|
|
2147
|
+
default:
|
|
2148
|
+
return localize3.quarter(quarter, {
|
|
2149
|
+
width: "wide",
|
|
2150
|
+
context: "standalone"
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
},
|
|
2154
|
+
// Month
|
|
2155
|
+
M: function(date, token, localize3) {
|
|
2156
|
+
const month = date.getMonth();
|
|
2157
|
+
switch (token) {
|
|
2158
|
+
case "M":
|
|
2159
|
+
case "MM":
|
|
2160
|
+
return lightFormatters.M(date, token);
|
|
2161
|
+
// 1st, 2nd, ..., 12th
|
|
2162
|
+
case "Mo":
|
|
2163
|
+
return localize3.ordinalNumber(month + 1, { unit: "month" });
|
|
2164
|
+
// Jan, Feb, ..., Dec
|
|
2165
|
+
case "MMM":
|
|
2166
|
+
return localize3.month(month, {
|
|
2167
|
+
width: "abbreviated",
|
|
2168
|
+
context: "formatting"
|
|
2169
|
+
});
|
|
2170
|
+
// J, F, ..., D
|
|
2171
|
+
case "MMMMM":
|
|
2172
|
+
return localize3.month(month, {
|
|
2173
|
+
width: "narrow",
|
|
2174
|
+
context: "formatting"
|
|
2175
|
+
});
|
|
2176
|
+
// January, February, ..., December
|
|
2177
|
+
case "MMMM":
|
|
2178
|
+
default:
|
|
2179
|
+
return localize3.month(month, { width: "wide", context: "formatting" });
|
|
2180
|
+
}
|
|
2181
|
+
},
|
|
2182
|
+
// Stand-alone month
|
|
2183
|
+
L: function(date, token, localize3) {
|
|
2184
|
+
const month = date.getMonth();
|
|
2185
|
+
switch (token) {
|
|
2186
|
+
// 1, 2, ..., 12
|
|
2187
|
+
case "L":
|
|
2188
|
+
return String(month + 1);
|
|
2189
|
+
// 01, 02, ..., 12
|
|
2190
|
+
case "LL":
|
|
2191
|
+
return addLeadingZeros(month + 1, 2);
|
|
2192
|
+
// 1st, 2nd, ..., 12th
|
|
2193
|
+
case "Lo":
|
|
2194
|
+
return localize3.ordinalNumber(month + 1, { unit: "month" });
|
|
2195
|
+
// Jan, Feb, ..., Dec
|
|
2196
|
+
case "LLL":
|
|
2197
|
+
return localize3.month(month, {
|
|
2198
|
+
width: "abbreviated",
|
|
2199
|
+
context: "standalone"
|
|
2200
|
+
});
|
|
2201
|
+
// J, F, ..., D
|
|
2202
|
+
case "LLLLL":
|
|
2203
|
+
return localize3.month(month, {
|
|
2204
|
+
width: "narrow",
|
|
2205
|
+
context: "standalone"
|
|
2206
|
+
});
|
|
2207
|
+
// January, February, ..., December
|
|
2208
|
+
case "LLLL":
|
|
2209
|
+
default:
|
|
2210
|
+
return localize3.month(month, { width: "wide", context: "standalone" });
|
|
2211
|
+
}
|
|
2212
|
+
},
|
|
2213
|
+
// Local week of year
|
|
2214
|
+
w: function(date, token, localize3, options) {
|
|
2215
|
+
const week = getWeek(date, options);
|
|
2216
|
+
if (token === "wo") {
|
|
2217
|
+
return localize3.ordinalNumber(week, { unit: "week" });
|
|
2218
|
+
}
|
|
2219
|
+
return addLeadingZeros(week, token.length);
|
|
2220
|
+
},
|
|
2221
|
+
// ISO week of year
|
|
2222
|
+
I: function(date, token, localize3) {
|
|
2223
|
+
const isoWeek = getISOWeek(date);
|
|
2224
|
+
if (token === "Io") {
|
|
2225
|
+
return localize3.ordinalNumber(isoWeek, { unit: "week" });
|
|
2226
|
+
}
|
|
2227
|
+
return addLeadingZeros(isoWeek, token.length);
|
|
2228
|
+
},
|
|
2229
|
+
// Day of the month
|
|
2230
|
+
d: function(date, token, localize3) {
|
|
2231
|
+
if (token === "do") {
|
|
2232
|
+
return localize3.ordinalNumber(date.getDate(), { unit: "date" });
|
|
2233
|
+
}
|
|
2234
|
+
return lightFormatters.d(date, token);
|
|
2235
|
+
},
|
|
2236
|
+
// Day of year
|
|
2237
|
+
D: function(date, token, localize3) {
|
|
2238
|
+
const dayOfYear = getDayOfYear(date);
|
|
2239
|
+
if (token === "Do") {
|
|
2240
|
+
return localize3.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
|
|
2241
|
+
}
|
|
2242
|
+
return addLeadingZeros(dayOfYear, token.length);
|
|
2243
|
+
},
|
|
2244
|
+
// Day of week
|
|
2245
|
+
E: function(date, token, localize3) {
|
|
2246
|
+
const dayOfWeek = date.getDay();
|
|
2247
|
+
switch (token) {
|
|
2248
|
+
// Tue
|
|
2249
|
+
case "E":
|
|
2250
|
+
case "EE":
|
|
2251
|
+
case "EEE":
|
|
2252
|
+
return localize3.day(dayOfWeek, {
|
|
2253
|
+
width: "abbreviated",
|
|
2254
|
+
context: "formatting"
|
|
2255
|
+
});
|
|
2256
|
+
// T
|
|
2257
|
+
case "EEEEE":
|
|
2258
|
+
return localize3.day(dayOfWeek, {
|
|
2259
|
+
width: "narrow",
|
|
2260
|
+
context: "formatting"
|
|
2261
|
+
});
|
|
2262
|
+
// Tu
|
|
2263
|
+
case "EEEEEE":
|
|
2264
|
+
return localize3.day(dayOfWeek, {
|
|
2265
|
+
width: "short",
|
|
2266
|
+
context: "formatting"
|
|
2267
|
+
});
|
|
2268
|
+
// Tuesday
|
|
2269
|
+
case "EEEE":
|
|
2270
|
+
default:
|
|
2271
|
+
return localize3.day(dayOfWeek, {
|
|
2272
|
+
width: "wide",
|
|
2273
|
+
context: "formatting"
|
|
2274
|
+
});
|
|
2275
|
+
}
|
|
2276
|
+
},
|
|
2277
|
+
// Local day of week
|
|
2278
|
+
e: function(date, token, localize3, options) {
|
|
2279
|
+
const dayOfWeek = date.getDay();
|
|
2280
|
+
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
2281
|
+
switch (token) {
|
|
2282
|
+
// Numerical value (Nth day of week with current locale or weekStartsOn)
|
|
2283
|
+
case "e":
|
|
2284
|
+
return String(localDayOfWeek);
|
|
2285
|
+
// Padded numerical value
|
|
2286
|
+
case "ee":
|
|
2287
|
+
return addLeadingZeros(localDayOfWeek, 2);
|
|
2288
|
+
// 1st, 2nd, ..., 7th
|
|
2289
|
+
case "eo":
|
|
2290
|
+
return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
2291
|
+
case "eee":
|
|
2292
|
+
return localize3.day(dayOfWeek, {
|
|
2293
|
+
width: "abbreviated",
|
|
2294
|
+
context: "formatting"
|
|
2295
|
+
});
|
|
2296
|
+
// T
|
|
2297
|
+
case "eeeee":
|
|
2298
|
+
return localize3.day(dayOfWeek, {
|
|
2299
|
+
width: "narrow",
|
|
2300
|
+
context: "formatting"
|
|
2301
|
+
});
|
|
2302
|
+
// Tu
|
|
2303
|
+
case "eeeeee":
|
|
2304
|
+
return localize3.day(dayOfWeek, {
|
|
2305
|
+
width: "short",
|
|
2306
|
+
context: "formatting"
|
|
2307
|
+
});
|
|
2308
|
+
// Tuesday
|
|
2309
|
+
case "eeee":
|
|
2310
|
+
default:
|
|
2311
|
+
return localize3.day(dayOfWeek, {
|
|
2312
|
+
width: "wide",
|
|
2313
|
+
context: "formatting"
|
|
2314
|
+
});
|
|
2315
|
+
}
|
|
2316
|
+
},
|
|
2317
|
+
// Stand-alone local day of week
|
|
2318
|
+
c: function(date, token, localize3, options) {
|
|
2319
|
+
const dayOfWeek = date.getDay();
|
|
2320
|
+
const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
|
|
2321
|
+
switch (token) {
|
|
2322
|
+
// Numerical value (same as in `e`)
|
|
2323
|
+
case "c":
|
|
2324
|
+
return String(localDayOfWeek);
|
|
2325
|
+
// Padded numerical value
|
|
2326
|
+
case "cc":
|
|
2327
|
+
return addLeadingZeros(localDayOfWeek, token.length);
|
|
2328
|
+
// 1st, 2nd, ..., 7th
|
|
2329
|
+
case "co":
|
|
2330
|
+
return localize3.ordinalNumber(localDayOfWeek, { unit: "day" });
|
|
2331
|
+
case "ccc":
|
|
2332
|
+
return localize3.day(dayOfWeek, {
|
|
2333
|
+
width: "abbreviated",
|
|
2334
|
+
context: "standalone"
|
|
2335
|
+
});
|
|
2336
|
+
// T
|
|
2337
|
+
case "ccccc":
|
|
2338
|
+
return localize3.day(dayOfWeek, {
|
|
2339
|
+
width: "narrow",
|
|
2340
|
+
context: "standalone"
|
|
2341
|
+
});
|
|
2342
|
+
// Tu
|
|
2343
|
+
case "cccccc":
|
|
2344
|
+
return localize3.day(dayOfWeek, {
|
|
2345
|
+
width: "short",
|
|
2346
|
+
context: "standalone"
|
|
2347
|
+
});
|
|
2348
|
+
// Tuesday
|
|
2349
|
+
case "cccc":
|
|
2350
|
+
default:
|
|
2351
|
+
return localize3.day(dayOfWeek, {
|
|
2352
|
+
width: "wide",
|
|
2353
|
+
context: "standalone"
|
|
2354
|
+
});
|
|
2355
|
+
}
|
|
2356
|
+
},
|
|
2357
|
+
// ISO day of week
|
|
2358
|
+
i: function(date, token, localize3) {
|
|
2359
|
+
const dayOfWeek = date.getDay();
|
|
2360
|
+
const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
|
|
2361
|
+
switch (token) {
|
|
2362
|
+
// 2
|
|
2363
|
+
case "i":
|
|
2364
|
+
return String(isoDayOfWeek);
|
|
2365
|
+
// 02
|
|
2366
|
+
case "ii":
|
|
2367
|
+
return addLeadingZeros(isoDayOfWeek, token.length);
|
|
2368
|
+
// 2nd
|
|
2369
|
+
case "io":
|
|
2370
|
+
return localize3.ordinalNumber(isoDayOfWeek, { unit: "day" });
|
|
2371
|
+
// Tue
|
|
2372
|
+
case "iii":
|
|
2373
|
+
return localize3.day(dayOfWeek, {
|
|
2374
|
+
width: "abbreviated",
|
|
2375
|
+
context: "formatting"
|
|
2376
|
+
});
|
|
2377
|
+
// T
|
|
2378
|
+
case "iiiii":
|
|
2379
|
+
return localize3.day(dayOfWeek, {
|
|
2380
|
+
width: "narrow",
|
|
2381
|
+
context: "formatting"
|
|
2382
|
+
});
|
|
2383
|
+
// Tu
|
|
2384
|
+
case "iiiiii":
|
|
2385
|
+
return localize3.day(dayOfWeek, {
|
|
2386
|
+
width: "short",
|
|
2387
|
+
context: "formatting"
|
|
2388
|
+
});
|
|
2389
|
+
// Tuesday
|
|
2390
|
+
case "iiii":
|
|
2391
|
+
default:
|
|
2392
|
+
return localize3.day(dayOfWeek, {
|
|
2393
|
+
width: "wide",
|
|
2394
|
+
context: "formatting"
|
|
2395
|
+
});
|
|
2396
|
+
}
|
|
2397
|
+
},
|
|
2398
|
+
// AM or PM
|
|
2399
|
+
a: function(date, token, localize3) {
|
|
2400
|
+
const hours = date.getHours();
|
|
2401
|
+
const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
2402
|
+
switch (token) {
|
|
2403
|
+
case "a":
|
|
2404
|
+
case "aa":
|
|
2405
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2406
|
+
width: "abbreviated",
|
|
2407
|
+
context: "formatting"
|
|
2408
|
+
});
|
|
2409
|
+
case "aaa":
|
|
2410
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2411
|
+
width: "abbreviated",
|
|
2412
|
+
context: "formatting"
|
|
2413
|
+
}).toLowerCase();
|
|
2414
|
+
case "aaaaa":
|
|
2415
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2416
|
+
width: "narrow",
|
|
2417
|
+
context: "formatting"
|
|
2418
|
+
});
|
|
2419
|
+
case "aaaa":
|
|
2420
|
+
default:
|
|
2421
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2422
|
+
width: "wide",
|
|
2423
|
+
context: "formatting"
|
|
2424
|
+
});
|
|
2425
|
+
}
|
|
2426
|
+
},
|
|
2427
|
+
// AM, PM, midnight, noon
|
|
2428
|
+
b: function(date, token, localize3) {
|
|
2429
|
+
const hours = date.getHours();
|
|
2430
|
+
let dayPeriodEnumValue;
|
|
2431
|
+
if (hours === 12) {
|
|
2432
|
+
dayPeriodEnumValue = dayPeriodEnum.noon;
|
|
2433
|
+
} else if (hours === 0) {
|
|
2434
|
+
dayPeriodEnumValue = dayPeriodEnum.midnight;
|
|
2435
|
+
} else {
|
|
2436
|
+
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
|
|
2437
|
+
}
|
|
2438
|
+
switch (token) {
|
|
2439
|
+
case "b":
|
|
2440
|
+
case "bb":
|
|
2441
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2442
|
+
width: "abbreviated",
|
|
2443
|
+
context: "formatting"
|
|
2444
|
+
});
|
|
2445
|
+
case "bbb":
|
|
2446
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2447
|
+
width: "abbreviated",
|
|
2448
|
+
context: "formatting"
|
|
2449
|
+
}).toLowerCase();
|
|
2450
|
+
case "bbbbb":
|
|
2451
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2452
|
+
width: "narrow",
|
|
2453
|
+
context: "formatting"
|
|
2454
|
+
});
|
|
2455
|
+
case "bbbb":
|
|
2456
|
+
default:
|
|
2457
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2458
|
+
width: "wide",
|
|
2459
|
+
context: "formatting"
|
|
2460
|
+
});
|
|
2461
|
+
}
|
|
2462
|
+
},
|
|
2463
|
+
// in the morning, in the afternoon, in the evening, at night
|
|
2464
|
+
B: function(date, token, localize3) {
|
|
2465
|
+
const hours = date.getHours();
|
|
2466
|
+
let dayPeriodEnumValue;
|
|
2467
|
+
if (hours >= 17) {
|
|
2468
|
+
dayPeriodEnumValue = dayPeriodEnum.evening;
|
|
2469
|
+
} else if (hours >= 12) {
|
|
2470
|
+
dayPeriodEnumValue = dayPeriodEnum.afternoon;
|
|
2471
|
+
} else if (hours >= 4) {
|
|
2472
|
+
dayPeriodEnumValue = dayPeriodEnum.morning;
|
|
2473
|
+
} else {
|
|
2474
|
+
dayPeriodEnumValue = dayPeriodEnum.night;
|
|
2475
|
+
}
|
|
2476
|
+
switch (token) {
|
|
2477
|
+
case "B":
|
|
2478
|
+
case "BB":
|
|
2479
|
+
case "BBB":
|
|
2480
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2481
|
+
width: "abbreviated",
|
|
2482
|
+
context: "formatting"
|
|
2483
|
+
});
|
|
2484
|
+
case "BBBBB":
|
|
2485
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2486
|
+
width: "narrow",
|
|
2487
|
+
context: "formatting"
|
|
2488
|
+
});
|
|
2489
|
+
case "BBBB":
|
|
2490
|
+
default:
|
|
2491
|
+
return localize3.dayPeriod(dayPeriodEnumValue, {
|
|
2492
|
+
width: "wide",
|
|
2493
|
+
context: "formatting"
|
|
2494
|
+
});
|
|
2495
|
+
}
|
|
2496
|
+
},
|
|
2497
|
+
// Hour [1-12]
|
|
2498
|
+
h: function(date, token, localize3) {
|
|
2499
|
+
if (token === "ho") {
|
|
2500
|
+
let hours = date.getHours() % 12;
|
|
2501
|
+
if (hours === 0) hours = 12;
|
|
2502
|
+
return localize3.ordinalNumber(hours, { unit: "hour" });
|
|
2503
|
+
}
|
|
2504
|
+
return lightFormatters.h(date, token);
|
|
2505
|
+
},
|
|
2506
|
+
// Hour [0-23]
|
|
2507
|
+
H: function(date, token, localize3) {
|
|
2508
|
+
if (token === "Ho") {
|
|
2509
|
+
return localize3.ordinalNumber(date.getHours(), { unit: "hour" });
|
|
2510
|
+
}
|
|
2511
|
+
return lightFormatters.H(date, token);
|
|
2512
|
+
},
|
|
2513
|
+
// Hour [0-11]
|
|
2514
|
+
K: function(date, token, localize3) {
|
|
2515
|
+
const hours = date.getHours() % 12;
|
|
2516
|
+
if (token === "Ko") {
|
|
2517
|
+
return localize3.ordinalNumber(hours, { unit: "hour" });
|
|
2518
|
+
}
|
|
2519
|
+
return addLeadingZeros(hours, token.length);
|
|
2520
|
+
},
|
|
2521
|
+
// Hour [1-24]
|
|
2522
|
+
k: function(date, token, localize3) {
|
|
2523
|
+
let hours = date.getHours();
|
|
2524
|
+
if (hours === 0) hours = 24;
|
|
2525
|
+
if (token === "ko") {
|
|
2526
|
+
return localize3.ordinalNumber(hours, { unit: "hour" });
|
|
2527
|
+
}
|
|
2528
|
+
return addLeadingZeros(hours, token.length);
|
|
2529
|
+
},
|
|
2530
|
+
// Minute
|
|
2531
|
+
m: function(date, token, localize3) {
|
|
2532
|
+
if (token === "mo") {
|
|
2533
|
+
return localize3.ordinalNumber(date.getMinutes(), { unit: "minute" });
|
|
2534
|
+
}
|
|
2535
|
+
return lightFormatters.m(date, token);
|
|
2536
|
+
},
|
|
2537
|
+
// Second
|
|
2538
|
+
s: function(date, token, localize3) {
|
|
2539
|
+
if (token === "so") {
|
|
2540
|
+
return localize3.ordinalNumber(date.getSeconds(), { unit: "second" });
|
|
2541
|
+
}
|
|
2542
|
+
return lightFormatters.s(date, token);
|
|
2543
|
+
},
|
|
2544
|
+
// Fraction of second
|
|
2545
|
+
S: function(date, token) {
|
|
2546
|
+
return lightFormatters.S(date, token);
|
|
2547
|
+
},
|
|
2548
|
+
// Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
|
|
2549
|
+
X: function(date, token, _localize) {
|
|
2550
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
2551
|
+
if (timezoneOffset === 0) {
|
|
2552
|
+
return "Z";
|
|
2553
|
+
}
|
|
2554
|
+
switch (token) {
|
|
2555
|
+
// Hours and optional minutes
|
|
2556
|
+
case "X":
|
|
2557
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
2558
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
2559
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2560
|
+
// so this token always has the same output as `XX`
|
|
2561
|
+
case "XXXX":
|
|
2562
|
+
case "XX":
|
|
2563
|
+
return formatTimezone(timezoneOffset);
|
|
2564
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
2565
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2566
|
+
// so this token always has the same output as `XXX`
|
|
2567
|
+
case "XXXXX":
|
|
2568
|
+
case "XXX":
|
|
2569
|
+
// Hours and minutes with `:` delimiter
|
|
2570
|
+
default:
|
|
2571
|
+
return formatTimezone(timezoneOffset, ":");
|
|
2572
|
+
}
|
|
2573
|
+
},
|
|
2574
|
+
// Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
|
|
2575
|
+
x: function(date, token, _localize) {
|
|
2576
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
2577
|
+
switch (token) {
|
|
2578
|
+
// Hours and optional minutes
|
|
2579
|
+
case "x":
|
|
2580
|
+
return formatTimezoneWithOptionalMinutes(timezoneOffset);
|
|
2581
|
+
// Hours, minutes and optional seconds without `:` delimiter
|
|
2582
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2583
|
+
// so this token always has the same output as `xx`
|
|
2584
|
+
case "xxxx":
|
|
2585
|
+
case "xx":
|
|
2586
|
+
return formatTimezone(timezoneOffset);
|
|
2587
|
+
// Hours, minutes and optional seconds with `:` delimiter
|
|
2588
|
+
// Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
|
|
2589
|
+
// so this token always has the same output as `xxx`
|
|
2590
|
+
case "xxxxx":
|
|
2591
|
+
case "xxx":
|
|
2592
|
+
// Hours and minutes with `:` delimiter
|
|
2593
|
+
default:
|
|
2594
|
+
return formatTimezone(timezoneOffset, ":");
|
|
2595
|
+
}
|
|
2596
|
+
},
|
|
2597
|
+
// Timezone (GMT)
|
|
2598
|
+
O: function(date, token, _localize) {
|
|
2599
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
2600
|
+
switch (token) {
|
|
2601
|
+
// Short
|
|
2602
|
+
case "O":
|
|
2603
|
+
case "OO":
|
|
2604
|
+
case "OOO":
|
|
2605
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
2606
|
+
// Long
|
|
2607
|
+
case "OOOO":
|
|
2608
|
+
default:
|
|
2609
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
2610
|
+
}
|
|
2611
|
+
},
|
|
2612
|
+
// Timezone (specific non-location)
|
|
2613
|
+
z: function(date, token, _localize) {
|
|
2614
|
+
const timezoneOffset = date.getTimezoneOffset();
|
|
2615
|
+
switch (token) {
|
|
2616
|
+
// Short
|
|
2617
|
+
case "z":
|
|
2618
|
+
case "zz":
|
|
2619
|
+
case "zzz":
|
|
2620
|
+
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
|
|
2621
|
+
// Long
|
|
2622
|
+
case "zzzz":
|
|
2623
|
+
default:
|
|
2624
|
+
return "GMT" + formatTimezone(timezoneOffset, ":");
|
|
2625
|
+
}
|
|
2626
|
+
},
|
|
2627
|
+
// Seconds timestamp
|
|
2628
|
+
t: function(date, token, _localize) {
|
|
2629
|
+
const timestamp = Math.trunc(+date / 1e3);
|
|
2630
|
+
return addLeadingZeros(timestamp, token.length);
|
|
2631
|
+
},
|
|
2632
|
+
// Milliseconds timestamp
|
|
2633
|
+
T: function(date, token, _localize) {
|
|
2634
|
+
return addLeadingZeros(+date, token.length);
|
|
2635
|
+
}
|
|
2636
|
+
};
|
|
2637
|
+
function formatTimezoneShort(offset, delimiter = "") {
|
|
2638
|
+
const sign = offset > 0 ? "-" : "+";
|
|
2639
|
+
const absOffset = Math.abs(offset);
|
|
2640
|
+
const hours = Math.trunc(absOffset / 60);
|
|
2641
|
+
const minutes = absOffset % 60;
|
|
2642
|
+
if (minutes === 0) {
|
|
2643
|
+
return sign + String(hours);
|
|
2644
|
+
}
|
|
2645
|
+
return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
|
|
2646
|
+
}
|
|
2647
|
+
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
|
|
2648
|
+
if (offset % 60 === 0) {
|
|
2649
|
+
const sign = offset > 0 ? "-" : "+";
|
|
2650
|
+
return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
|
|
2651
|
+
}
|
|
2652
|
+
return formatTimezone(offset, delimiter);
|
|
2653
|
+
}
|
|
2654
|
+
function formatTimezone(offset, delimiter = "") {
|
|
2655
|
+
const sign = offset > 0 ? "-" : "+";
|
|
2656
|
+
const absOffset = Math.abs(offset);
|
|
2657
|
+
const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
|
|
2658
|
+
const minutes = addLeadingZeros(absOffset % 60, 2);
|
|
2659
|
+
return sign + hours + delimiter + minutes;
|
|
2660
|
+
}
|
|
2661
|
+
|
|
2662
|
+
// node_modules/date-fns/_lib/format/longFormatters.js
|
|
2663
|
+
var dateLongFormatter = (pattern, formatLong3) => {
|
|
2664
|
+
switch (pattern) {
|
|
2665
|
+
case "P":
|
|
2666
|
+
return formatLong3.date({ width: "short" });
|
|
2667
|
+
case "PP":
|
|
2668
|
+
return formatLong3.date({ width: "medium" });
|
|
2669
|
+
case "PPP":
|
|
2670
|
+
return formatLong3.date({ width: "long" });
|
|
2671
|
+
case "PPPP":
|
|
2672
|
+
default:
|
|
2673
|
+
return formatLong3.date({ width: "full" });
|
|
2674
|
+
}
|
|
2675
|
+
};
|
|
2676
|
+
var timeLongFormatter = (pattern, formatLong3) => {
|
|
2677
|
+
switch (pattern) {
|
|
2678
|
+
case "p":
|
|
2679
|
+
return formatLong3.time({ width: "short" });
|
|
2680
|
+
case "pp":
|
|
2681
|
+
return formatLong3.time({ width: "medium" });
|
|
2682
|
+
case "ppp":
|
|
2683
|
+
return formatLong3.time({ width: "long" });
|
|
2684
|
+
case "pppp":
|
|
2685
|
+
default:
|
|
2686
|
+
return formatLong3.time({ width: "full" });
|
|
2687
|
+
}
|
|
2688
|
+
};
|
|
2689
|
+
var dateTimeLongFormatter = (pattern, formatLong3) => {
|
|
2690
|
+
const matchResult = pattern.match(/(P+)(p+)?/) || [];
|
|
2691
|
+
const datePattern = matchResult[1];
|
|
2692
|
+
const timePattern = matchResult[2];
|
|
2693
|
+
if (!timePattern) {
|
|
2694
|
+
return dateLongFormatter(pattern, formatLong3);
|
|
2695
|
+
}
|
|
2696
|
+
let dateTimeFormat;
|
|
2697
|
+
switch (datePattern) {
|
|
2698
|
+
case "P":
|
|
2699
|
+
dateTimeFormat = formatLong3.dateTime({ width: "short" });
|
|
2700
|
+
break;
|
|
2701
|
+
case "PP":
|
|
2702
|
+
dateTimeFormat = formatLong3.dateTime({ width: "medium" });
|
|
2703
|
+
break;
|
|
2704
|
+
case "PPP":
|
|
2705
|
+
dateTimeFormat = formatLong3.dateTime({ width: "long" });
|
|
2706
|
+
break;
|
|
2707
|
+
case "PPPP":
|
|
2708
|
+
default:
|
|
2709
|
+
dateTimeFormat = formatLong3.dateTime({ width: "full" });
|
|
2710
|
+
break;
|
|
2711
|
+
}
|
|
2712
|
+
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong3)).replace("{{time}}", timeLongFormatter(timePattern, formatLong3));
|
|
2713
|
+
};
|
|
2714
|
+
var longFormatters = {
|
|
2715
|
+
p: timeLongFormatter,
|
|
2716
|
+
P: dateTimeLongFormatter
|
|
2717
|
+
};
|
|
2718
|
+
|
|
2719
|
+
// node_modules/date-fns/_lib/protectedTokens.js
|
|
2720
|
+
var dayOfYearTokenRE = /^D+$/;
|
|
2721
|
+
var weekYearTokenRE = /^Y+$/;
|
|
2722
|
+
var throwTokens = ["D", "DD", "YY", "YYYY"];
|
|
2723
|
+
function isProtectedDayOfYearToken(token) {
|
|
2724
|
+
return dayOfYearTokenRE.test(token);
|
|
2725
|
+
}
|
|
2726
|
+
function isProtectedWeekYearToken(token) {
|
|
2727
|
+
return weekYearTokenRE.test(token);
|
|
2728
|
+
}
|
|
2729
|
+
function warnOrThrowProtectedError(token, format2, input) {
|
|
2730
|
+
const _message = message(token, format2, input);
|
|
2731
|
+
console.warn(_message);
|
|
2732
|
+
if (throwTokens.includes(token)) throw new RangeError(_message);
|
|
2733
|
+
}
|
|
2734
|
+
function message(token, format2, input) {
|
|
2735
|
+
const subject = token[0] === "Y" ? "years" : "days of the month";
|
|
2736
|
+
return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format2}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
|
|
2737
|
+
}
|
|
2738
|
+
|
|
2739
|
+
// node_modules/date-fns/format.js
|
|
2740
|
+
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
|
|
2741
|
+
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
|
|
2742
|
+
var escapedStringRegExp = /^'([^]*?)'?$/;
|
|
2743
|
+
var doubleQuoteRegExp = /''/g;
|
|
2744
|
+
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
|
|
2745
|
+
function format(date, formatStr, options) {
|
|
2746
|
+
const defaultOptions2 = getDefaultOptions();
|
|
2747
|
+
const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
|
|
2748
|
+
const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
|
|
2749
|
+
const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
|
|
2750
|
+
const originalDate = toDate(date, options?.in);
|
|
2751
|
+
if (!isValid(originalDate)) {
|
|
2752
|
+
throw new RangeError("Invalid time value");
|
|
2753
|
+
}
|
|
2754
|
+
let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
|
|
2755
|
+
const firstCharacter = substring[0];
|
|
2756
|
+
if (firstCharacter === "p" || firstCharacter === "P") {
|
|
2757
|
+
const longFormatter = longFormatters[firstCharacter];
|
|
2758
|
+
return longFormatter(substring, locale.formatLong);
|
|
2759
|
+
}
|
|
2760
|
+
return substring;
|
|
2761
|
+
}).join("").match(formattingTokensRegExp).map((substring) => {
|
|
2762
|
+
if (substring === "''") {
|
|
2763
|
+
return { isToken: false, value: "'" };
|
|
2764
|
+
}
|
|
2765
|
+
const firstCharacter = substring[0];
|
|
2766
|
+
if (firstCharacter === "'") {
|
|
2767
|
+
return { isToken: false, value: cleanEscapedString(substring) };
|
|
2768
|
+
}
|
|
2769
|
+
if (formatters[firstCharacter]) {
|
|
2770
|
+
return { isToken: true, value: substring };
|
|
2771
|
+
}
|
|
2772
|
+
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
|
|
2773
|
+
throw new RangeError(
|
|
2774
|
+
"Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
|
|
2775
|
+
);
|
|
2776
|
+
}
|
|
2777
|
+
return { isToken: false, value: substring };
|
|
2778
|
+
});
|
|
2779
|
+
if (locale.localize.preprocessor) {
|
|
2780
|
+
parts = locale.localize.preprocessor(originalDate, parts);
|
|
2781
|
+
}
|
|
2782
|
+
const formatterOptions = {
|
|
2783
|
+
firstWeekContainsDate,
|
|
2784
|
+
weekStartsOn,
|
|
2785
|
+
locale
|
|
2786
|
+
};
|
|
2787
|
+
return parts.map((part) => {
|
|
2788
|
+
if (!part.isToken) return part.value;
|
|
2789
|
+
const token = part.value;
|
|
2790
|
+
if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
|
|
2791
|
+
warnOrThrowProtectedError(token, formatStr, String(date));
|
|
2792
|
+
}
|
|
2793
|
+
const formatter = formatters[token[0]];
|
|
2794
|
+
return formatter(originalDate, token, locale.localize, formatterOptions);
|
|
2795
|
+
}).join("");
|
|
2796
|
+
}
|
|
2797
|
+
function cleanEscapedString(input) {
|
|
2798
|
+
const matched = input.match(escapedStringRegExp);
|
|
2799
|
+
if (!matched) {
|
|
2800
|
+
return input;
|
|
2801
|
+
}
|
|
2802
|
+
return matched[1].replace(doubleQuoteRegExp, "'");
|
|
2803
|
+
}
|
|
2804
|
+
|
|
2805
|
+
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1288
2806
|
var import_buddhistEra = __toESM(require_buddhistEra());
|
|
1289
|
-
|
|
2807
|
+
|
|
2808
|
+
// node_modules/date-fns/locale/th/_lib/formatDistance.js
|
|
2809
|
+
var formatDistanceLocale2 = {
|
|
2810
|
+
lessThanXSeconds: {
|
|
2811
|
+
one: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 1 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35",
|
|
2812
|
+
other: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 {{count}} \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"
|
|
2813
|
+
},
|
|
2814
|
+
xSeconds: {
|
|
2815
|
+
one: "1 \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35",
|
|
2816
|
+
other: "{{count}} \u0E27\u0E34\u0E19\u0E32\u0E17\u0E35"
|
|
2817
|
+
},
|
|
2818
|
+
halfAMinute: "\u0E04\u0E23\u0E36\u0E48\u0E07\u0E19\u0E32\u0E17\u0E35",
|
|
2819
|
+
lessThanXMinutes: {
|
|
2820
|
+
one: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 1 \u0E19\u0E32\u0E17\u0E35",
|
|
2821
|
+
other: "\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32 {{count}} \u0E19\u0E32\u0E17\u0E35"
|
|
2822
|
+
},
|
|
2823
|
+
xMinutes: {
|
|
2824
|
+
one: "1 \u0E19\u0E32\u0E17\u0E35",
|
|
2825
|
+
other: "{{count}} \u0E19\u0E32\u0E17\u0E35"
|
|
2826
|
+
},
|
|
2827
|
+
aboutXHours: {
|
|
2828
|
+
one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07",
|
|
2829
|
+
other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07"
|
|
2830
|
+
},
|
|
2831
|
+
xHours: {
|
|
2832
|
+
one: "1 \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07",
|
|
2833
|
+
other: "{{count}} \u0E0A\u0E31\u0E48\u0E27\u0E42\u0E21\u0E07"
|
|
2834
|
+
},
|
|
2835
|
+
xDays: {
|
|
2836
|
+
one: "1 \u0E27\u0E31\u0E19",
|
|
2837
|
+
other: "{{count}} \u0E27\u0E31\u0E19"
|
|
2838
|
+
},
|
|
2839
|
+
aboutXWeeks: {
|
|
2840
|
+
one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C",
|
|
2841
|
+
other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C"
|
|
2842
|
+
},
|
|
2843
|
+
xWeeks: {
|
|
2844
|
+
one: "1 \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C",
|
|
2845
|
+
other: "{{count}} \u0E2A\u0E31\u0E1B\u0E14\u0E32\u0E2B\u0E4C"
|
|
2846
|
+
},
|
|
2847
|
+
aboutXMonths: {
|
|
2848
|
+
one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E40\u0E14\u0E37\u0E2D\u0E19",
|
|
2849
|
+
other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
2850
|
+
},
|
|
2851
|
+
xMonths: {
|
|
2852
|
+
one: "1 \u0E40\u0E14\u0E37\u0E2D\u0E19",
|
|
2853
|
+
other: "{{count}} \u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
2854
|
+
},
|
|
2855
|
+
aboutXYears: {
|
|
2856
|
+
one: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 1 \u0E1B\u0E35",
|
|
2857
|
+
other: "\u0E1B\u0E23\u0E30\u0E21\u0E32\u0E13 {{count}} \u0E1B\u0E35"
|
|
2858
|
+
},
|
|
2859
|
+
xYears: {
|
|
2860
|
+
one: "1 \u0E1B\u0E35",
|
|
2861
|
+
other: "{{count}} \u0E1B\u0E35"
|
|
2862
|
+
},
|
|
2863
|
+
overXYears: {
|
|
2864
|
+
one: "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32 1 \u0E1B\u0E35",
|
|
2865
|
+
other: "\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32 {{count}} \u0E1B\u0E35"
|
|
2866
|
+
},
|
|
2867
|
+
almostXYears: {
|
|
2868
|
+
one: "\u0E40\u0E01\u0E37\u0E2D\u0E1A 1 \u0E1B\u0E35",
|
|
2869
|
+
other: "\u0E40\u0E01\u0E37\u0E2D\u0E1A {{count}} \u0E1B\u0E35"
|
|
2870
|
+
}
|
|
2871
|
+
};
|
|
2872
|
+
var formatDistance2 = (token, count, options) => {
|
|
2873
|
+
let result;
|
|
2874
|
+
const tokenValue = formatDistanceLocale2[token];
|
|
2875
|
+
if (typeof tokenValue === "string") {
|
|
2876
|
+
result = tokenValue;
|
|
2877
|
+
} else if (count === 1) {
|
|
2878
|
+
result = tokenValue.one;
|
|
2879
|
+
} else {
|
|
2880
|
+
result = tokenValue.other.replace("{{count}}", String(count));
|
|
2881
|
+
}
|
|
2882
|
+
if (options?.addSuffix) {
|
|
2883
|
+
if (options.comparison && options.comparison > 0) {
|
|
2884
|
+
if (token === "halfAMinute") {
|
|
2885
|
+
return "\u0E43\u0E19" + result;
|
|
2886
|
+
} else {
|
|
2887
|
+
return "\u0E43\u0E19 " + result;
|
|
2888
|
+
}
|
|
2889
|
+
} else {
|
|
2890
|
+
return result + "\u0E17\u0E35\u0E48\u0E1C\u0E48\u0E32\u0E19\u0E21\u0E32";
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
return result;
|
|
2894
|
+
};
|
|
2895
|
+
|
|
2896
|
+
// node_modules/date-fns/locale/th/_lib/formatLong.js
|
|
2897
|
+
var dateFormats2 = {
|
|
2898
|
+
full: "\u0E27\u0E31\u0E19EEEE\u0E17\u0E35\u0E48 do MMMM y",
|
|
2899
|
+
long: "do MMMM y",
|
|
2900
|
+
medium: "d MMM y",
|
|
2901
|
+
short: "dd/MM/yyyy"
|
|
2902
|
+
};
|
|
2903
|
+
var timeFormats2 = {
|
|
2904
|
+
full: "H:mm:ss \u0E19. zzzz",
|
|
2905
|
+
long: "H:mm:ss \u0E19. z",
|
|
2906
|
+
medium: "H:mm:ss \u0E19.",
|
|
2907
|
+
short: "H:mm \u0E19."
|
|
2908
|
+
};
|
|
2909
|
+
var dateTimeFormats2 = {
|
|
2910
|
+
full: "{{date}} '\u0E40\u0E27\u0E25\u0E32' {{time}}",
|
|
2911
|
+
long: "{{date}} '\u0E40\u0E27\u0E25\u0E32' {{time}}",
|
|
2912
|
+
medium: "{{date}}, {{time}}",
|
|
2913
|
+
short: "{{date}}, {{time}}"
|
|
2914
|
+
};
|
|
2915
|
+
var formatLong2 = {
|
|
2916
|
+
date: buildFormatLongFn({
|
|
2917
|
+
formats: dateFormats2,
|
|
2918
|
+
defaultWidth: "full"
|
|
2919
|
+
}),
|
|
2920
|
+
time: buildFormatLongFn({
|
|
2921
|
+
formats: timeFormats2,
|
|
2922
|
+
defaultWidth: "medium"
|
|
2923
|
+
}),
|
|
2924
|
+
dateTime: buildFormatLongFn({
|
|
2925
|
+
formats: dateTimeFormats2,
|
|
2926
|
+
defaultWidth: "full"
|
|
2927
|
+
})
|
|
2928
|
+
};
|
|
2929
|
+
|
|
2930
|
+
// node_modules/date-fns/locale/th/_lib/formatRelative.js
|
|
2931
|
+
var formatRelativeLocale2 = {
|
|
2932
|
+
lastWeek: "eeee'\u0E17\u0E35\u0E48\u0E41\u0E25\u0E49\u0E27\u0E40\u0E27\u0E25\u0E32' p",
|
|
2933
|
+
yesterday: "'\u0E40\u0E21\u0E37\u0E48\u0E2D\u0E27\u0E32\u0E19\u0E19\u0E35\u0E49\u0E40\u0E27\u0E25\u0E32' p",
|
|
2934
|
+
today: "'\u0E27\u0E31\u0E19\u0E19\u0E35\u0E49\u0E40\u0E27\u0E25\u0E32' p",
|
|
2935
|
+
tomorrow: "'\u0E1E\u0E23\u0E38\u0E48\u0E07\u0E19\u0E35\u0E49\u0E40\u0E27\u0E25\u0E32' p",
|
|
2936
|
+
nextWeek: "eeee '\u0E40\u0E27\u0E25\u0E32' p",
|
|
2937
|
+
other: "P"
|
|
2938
|
+
};
|
|
2939
|
+
var formatRelative2 = (token, _date, _baseDate, _options) => formatRelativeLocale2[token];
|
|
2940
|
+
|
|
2941
|
+
// node_modules/date-fns/locale/th/_lib/localize.js
|
|
2942
|
+
var eraValues2 = {
|
|
2943
|
+
narrow: ["B", "\u0E04\u0E28"],
|
|
2944
|
+
abbreviated: ["BC", "\u0E04.\u0E28."],
|
|
2945
|
+
wide: ["\u0E1B\u0E35\u0E01\u0E48\u0E2D\u0E19\u0E04\u0E23\u0E34\u0E2A\u0E15\u0E01\u0E32\u0E25", "\u0E04\u0E23\u0E34\u0E2A\u0E15\u0E4C\u0E28\u0E31\u0E01\u0E23\u0E32\u0E0A"]
|
|
2946
|
+
};
|
|
2947
|
+
var quarterValues2 = {
|
|
2948
|
+
narrow: ["1", "2", "3", "4"],
|
|
2949
|
+
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
|
|
2950
|
+
wide: ["\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E41\u0E23\u0E01", "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E17\u0E35\u0E48\u0E2A\u0E2D\u0E07", "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E17\u0E35\u0E48\u0E2A\u0E32\u0E21", "\u0E44\u0E15\u0E23\u0E21\u0E32\u0E2A\u0E17\u0E35\u0E48\u0E2A\u0E35\u0E48"]
|
|
2951
|
+
};
|
|
2952
|
+
var dayValues2 = {
|
|
2953
|
+
narrow: ["\u0E2D\u0E32.", "\u0E08.", "\u0E2D.", "\u0E1E.", "\u0E1E\u0E24.", "\u0E28.", "\u0E2A."],
|
|
2954
|
+
short: ["\u0E2D\u0E32.", "\u0E08.", "\u0E2D.", "\u0E1E.", "\u0E1E\u0E24.", "\u0E28.", "\u0E2A."],
|
|
2955
|
+
abbreviated: ["\u0E2D\u0E32.", "\u0E08.", "\u0E2D.", "\u0E1E.", "\u0E1E\u0E24.", "\u0E28.", "\u0E2A."],
|
|
2956
|
+
wide: ["\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"]
|
|
2957
|
+
};
|
|
2958
|
+
var monthValues2 = {
|
|
2959
|
+
narrow: [
|
|
2960
|
+
"\u0E21.\u0E04.",
|
|
2961
|
+
"\u0E01.\u0E1E.",
|
|
2962
|
+
"\u0E21\u0E35.\u0E04.",
|
|
2963
|
+
"\u0E40\u0E21.\u0E22.",
|
|
2964
|
+
"\u0E1E.\u0E04.",
|
|
2965
|
+
"\u0E21\u0E34.\u0E22.",
|
|
2966
|
+
"\u0E01.\u0E04.",
|
|
2967
|
+
"\u0E2A.\u0E04.",
|
|
2968
|
+
"\u0E01.\u0E22.",
|
|
2969
|
+
"\u0E15.\u0E04.",
|
|
2970
|
+
"\u0E1E.\u0E22.",
|
|
2971
|
+
"\u0E18.\u0E04."
|
|
2972
|
+
],
|
|
2973
|
+
abbreviated: [
|
|
2974
|
+
"\u0E21.\u0E04.",
|
|
2975
|
+
"\u0E01.\u0E1E.",
|
|
2976
|
+
"\u0E21\u0E35.\u0E04.",
|
|
2977
|
+
"\u0E40\u0E21.\u0E22.",
|
|
2978
|
+
"\u0E1E.\u0E04.",
|
|
2979
|
+
"\u0E21\u0E34.\u0E22.",
|
|
2980
|
+
"\u0E01.\u0E04.",
|
|
2981
|
+
"\u0E2A.\u0E04.",
|
|
2982
|
+
"\u0E01.\u0E22.",
|
|
2983
|
+
"\u0E15.\u0E04.",
|
|
2984
|
+
"\u0E1E.\u0E22.",
|
|
2985
|
+
"\u0E18.\u0E04."
|
|
2986
|
+
],
|
|
2987
|
+
wide: [
|
|
2988
|
+
"\u0E21\u0E01\u0E23\u0E32\u0E04\u0E21",
|
|
2989
|
+
"\u0E01\u0E38\u0E21\u0E20\u0E32\u0E1E\u0E31\u0E19\u0E18\u0E4C",
|
|
2990
|
+
"\u0E21\u0E35\u0E19\u0E32\u0E04\u0E21",
|
|
2991
|
+
"\u0E40\u0E21\u0E29\u0E32\u0E22\u0E19",
|
|
2992
|
+
"\u0E1E\u0E24\u0E29\u0E20\u0E32\u0E04\u0E21",
|
|
2993
|
+
"\u0E21\u0E34\u0E16\u0E38\u0E19\u0E32\u0E22\u0E19",
|
|
2994
|
+
"\u0E01\u0E23\u0E01\u0E0E\u0E32\u0E04\u0E21",
|
|
2995
|
+
"\u0E2A\u0E34\u0E07\u0E2B\u0E32\u0E04\u0E21",
|
|
2996
|
+
"\u0E01\u0E31\u0E19\u0E22\u0E32\u0E22\u0E19",
|
|
2997
|
+
"\u0E15\u0E38\u0E25\u0E32\u0E04\u0E21",
|
|
2998
|
+
"\u0E1E\u0E24\u0E28\u0E08\u0E34\u0E01\u0E32\u0E22\u0E19",
|
|
2999
|
+
"\u0E18\u0E31\u0E19\u0E27\u0E32\u0E04\u0E21"
|
|
3000
|
+
]
|
|
3001
|
+
};
|
|
3002
|
+
var dayPeriodValues2 = {
|
|
3003
|
+
narrow: {
|
|
3004
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3005
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3006
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3007
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3008
|
+
morning: "\u0E40\u0E0A\u0E49\u0E32",
|
|
3009
|
+
afternoon: "\u0E1A\u0E48\u0E32\u0E22",
|
|
3010
|
+
evening: "\u0E40\u0E22\u0E47\u0E19",
|
|
3011
|
+
night: "\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3012
|
+
},
|
|
3013
|
+
abbreviated: {
|
|
3014
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3015
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3016
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3017
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3018
|
+
morning: "\u0E40\u0E0A\u0E49\u0E32",
|
|
3019
|
+
afternoon: "\u0E1A\u0E48\u0E32\u0E22",
|
|
3020
|
+
evening: "\u0E40\u0E22\u0E47\u0E19",
|
|
3021
|
+
night: "\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3022
|
+
},
|
|
3023
|
+
wide: {
|
|
3024
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3025
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3026
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3027
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3028
|
+
morning: "\u0E40\u0E0A\u0E49\u0E32",
|
|
3029
|
+
afternoon: "\u0E1A\u0E48\u0E32\u0E22",
|
|
3030
|
+
evening: "\u0E40\u0E22\u0E47\u0E19",
|
|
3031
|
+
night: "\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3032
|
+
}
|
|
3033
|
+
};
|
|
3034
|
+
var formattingDayPeriodValues2 = {
|
|
3035
|
+
narrow: {
|
|
3036
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3037
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3038
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3039
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3040
|
+
morning: "\u0E15\u0E2D\u0E19\u0E40\u0E0A\u0E49\u0E32",
|
|
3041
|
+
afternoon: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E27\u0E31\u0E19",
|
|
3042
|
+
evening: "\u0E15\u0E2D\u0E19\u0E40\u0E22\u0E47\u0E19",
|
|
3043
|
+
night: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3044
|
+
},
|
|
3045
|
+
abbreviated: {
|
|
3046
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3047
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3048
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3049
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3050
|
+
morning: "\u0E15\u0E2D\u0E19\u0E40\u0E0A\u0E49\u0E32",
|
|
3051
|
+
afternoon: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E27\u0E31\u0E19",
|
|
3052
|
+
evening: "\u0E15\u0E2D\u0E19\u0E40\u0E22\u0E47\u0E19",
|
|
3053
|
+
night: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3054
|
+
},
|
|
3055
|
+
wide: {
|
|
3056
|
+
am: "\u0E01\u0E48\u0E2D\u0E19\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3057
|
+
pm: "\u0E2B\u0E25\u0E31\u0E07\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3058
|
+
midnight: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07\u0E04\u0E37\u0E19",
|
|
3059
|
+
noon: "\u0E40\u0E17\u0E35\u0E48\u0E22\u0E07",
|
|
3060
|
+
morning: "\u0E15\u0E2D\u0E19\u0E40\u0E0A\u0E49\u0E32",
|
|
3061
|
+
afternoon: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E27\u0E31\u0E19",
|
|
3062
|
+
evening: "\u0E15\u0E2D\u0E19\u0E40\u0E22\u0E47\u0E19",
|
|
3063
|
+
night: "\u0E15\u0E2D\u0E19\u0E01\u0E25\u0E32\u0E07\u0E04\u0E37\u0E19"
|
|
3064
|
+
}
|
|
3065
|
+
};
|
|
3066
|
+
var ordinalNumber2 = (dirtyNumber, _options) => {
|
|
3067
|
+
return String(dirtyNumber);
|
|
3068
|
+
};
|
|
3069
|
+
var localize2 = {
|
|
3070
|
+
ordinalNumber: ordinalNumber2,
|
|
3071
|
+
era: buildLocalizeFn({
|
|
3072
|
+
values: eraValues2,
|
|
3073
|
+
defaultWidth: "wide"
|
|
3074
|
+
}),
|
|
3075
|
+
quarter: buildLocalizeFn({
|
|
3076
|
+
values: quarterValues2,
|
|
3077
|
+
defaultWidth: "wide",
|
|
3078
|
+
argumentCallback: (quarter) => quarter - 1
|
|
3079
|
+
}),
|
|
3080
|
+
month: buildLocalizeFn({
|
|
3081
|
+
values: monthValues2,
|
|
3082
|
+
defaultWidth: "wide"
|
|
3083
|
+
}),
|
|
3084
|
+
day: buildLocalizeFn({
|
|
3085
|
+
values: dayValues2,
|
|
3086
|
+
defaultWidth: "wide"
|
|
3087
|
+
}),
|
|
3088
|
+
dayPeriod: buildLocalizeFn({
|
|
3089
|
+
values: dayPeriodValues2,
|
|
3090
|
+
defaultWidth: "wide",
|
|
3091
|
+
formattingValues: formattingDayPeriodValues2,
|
|
3092
|
+
defaultFormattingWidth: "wide"
|
|
3093
|
+
})
|
|
3094
|
+
};
|
|
3095
|
+
|
|
3096
|
+
// node_modules/date-fns/locale/th/_lib/match.js
|
|
3097
|
+
var matchOrdinalNumberPattern2 = /^\d+/i;
|
|
3098
|
+
var parseOrdinalNumberPattern2 = /\d+/i;
|
|
3099
|
+
var matchEraPatterns2 = {
|
|
3100
|
+
narrow: /^([bB]|[aA]|คศ)/i,
|
|
3101
|
+
abbreviated: /^([bB]\.?\s?[cC]\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?|ค\.?ศ\.?)/i,
|
|
3102
|
+
wide: /^(ก่อนคริสตกาล|คริสต์ศักราช|คริสตกาล)/i
|
|
3103
|
+
};
|
|
3104
|
+
var parseEraPatterns2 = {
|
|
3105
|
+
any: [/^[bB]/i, /^(^[aA]|ค\.?ศ\.?|คริสตกาล|คริสต์ศักราช|)/i]
|
|
3106
|
+
};
|
|
3107
|
+
var matchQuarterPatterns2 = {
|
|
3108
|
+
narrow: /^[1234]/i,
|
|
3109
|
+
abbreviated: /^q[1234]/i,
|
|
3110
|
+
wide: /^ไตรมาส(ที่)? ?[1234]/i
|
|
3111
|
+
};
|
|
3112
|
+
var parseQuarterPatterns2 = {
|
|
3113
|
+
any: [/(1|แรก|หนึ่ง)/i, /(2|สอง)/i, /(3|สาม)/i, /(4|สี่)/i]
|
|
3114
|
+
};
|
|
3115
|
+
var matchMonthPatterns2 = {
|
|
3116
|
+
narrow: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?)/i,
|
|
3117
|
+
abbreviated: /^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?')/i,
|
|
3118
|
+
wide: /^(มกราคม|กุมภาพันธ์|มีนาคม|เมษายน|พฤษภาคม|มิถุนายน|กรกฎาคม|สิงหาคม|กันยายน|ตุลาคม|พฤศจิกายน|ธันวาคม)/i
|
|
3119
|
+
};
|
|
3120
|
+
var parseMonthPatterns2 = {
|
|
3121
|
+
wide: [
|
|
3122
|
+
/^มก/i,
|
|
3123
|
+
/^กุม/i,
|
|
3124
|
+
/^มี/i,
|
|
3125
|
+
/^เม/i,
|
|
3126
|
+
/^พฤษ/i,
|
|
3127
|
+
/^มิ/i,
|
|
3128
|
+
/^กรก/i,
|
|
3129
|
+
/^ส/i,
|
|
3130
|
+
/^กัน/i,
|
|
3131
|
+
/^ต/i,
|
|
3132
|
+
/^พฤศ/i,
|
|
3133
|
+
/^ธ/i
|
|
3134
|
+
],
|
|
3135
|
+
any: [
|
|
3136
|
+
/^ม\.?ค\.?/i,
|
|
3137
|
+
/^ก\.?พ\.?/i,
|
|
3138
|
+
/^มี\.?ค\.?/i,
|
|
3139
|
+
/^เม\.?ย\.?/i,
|
|
3140
|
+
/^พ\.?ค\.?/i,
|
|
3141
|
+
/^มิ\.?ย\.?/i,
|
|
3142
|
+
/^ก\.?ค\.?/i,
|
|
3143
|
+
/^ส\.?ค\.?/i,
|
|
3144
|
+
/^ก\.?ย\.?/i,
|
|
3145
|
+
/^ต\.?ค\.?/i,
|
|
3146
|
+
/^พ\.?ย\.?/i,
|
|
3147
|
+
/^ธ\.?ค\.?/i
|
|
3148
|
+
]
|
|
3149
|
+
};
|
|
3150
|
+
var matchDayPatterns2 = {
|
|
3151
|
+
narrow: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
|
|
3152
|
+
short: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
|
|
3153
|
+
abbreviated: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
|
|
3154
|
+
wide: /^(อาทิตย์|จันทร์|อังคาร|พุธ|พฤหัสบดี|ศุกร์|เสาร์)/i
|
|
3155
|
+
};
|
|
3156
|
+
var parseDayPatterns2 = {
|
|
3157
|
+
wide: [/^อา/i, /^จั/i, /^อั/i, /^พุธ/i, /^พฤ/i, /^ศ/i, /^เส/i],
|
|
3158
|
+
any: [/^อา/i, /^จ/i, /^อ/i, /^พ(?!ฤ)/i, /^พฤ/i, /^ศ/i, /^ส/i]
|
|
3159
|
+
};
|
|
3160
|
+
var matchDayPeriodPatterns2 = {
|
|
3161
|
+
any: /^(ก่อนเที่ยง|หลังเที่ยง|เที่ยงคืน|เที่ยง|(ตอน.*?)?.*(เที่ยง|เช้า|บ่าย|เย็น|กลางคืน))/i
|
|
3162
|
+
};
|
|
3163
|
+
var parseDayPeriodPatterns2 = {
|
|
3164
|
+
any: {
|
|
3165
|
+
am: /^ก่อนเที่ยง/i,
|
|
3166
|
+
pm: /^หลังเที่ยง/i,
|
|
3167
|
+
midnight: /^เที่ยงคืน/i,
|
|
3168
|
+
noon: /^เที่ยง/i,
|
|
3169
|
+
morning: /เช้า/i,
|
|
3170
|
+
afternoon: /บ่าย/i,
|
|
3171
|
+
evening: /เย็น/i,
|
|
3172
|
+
night: /กลางคืน/i
|
|
3173
|
+
}
|
|
3174
|
+
};
|
|
3175
|
+
var match2 = {
|
|
3176
|
+
ordinalNumber: buildMatchPatternFn({
|
|
3177
|
+
matchPattern: matchOrdinalNumberPattern2,
|
|
3178
|
+
parsePattern: parseOrdinalNumberPattern2,
|
|
3179
|
+
valueCallback: (value) => parseInt(value, 10)
|
|
3180
|
+
}),
|
|
3181
|
+
era: buildMatchFn({
|
|
3182
|
+
matchPatterns: matchEraPatterns2,
|
|
3183
|
+
defaultMatchWidth: "wide",
|
|
3184
|
+
parsePatterns: parseEraPatterns2,
|
|
3185
|
+
defaultParseWidth: "any"
|
|
3186
|
+
}),
|
|
3187
|
+
quarter: buildMatchFn({
|
|
3188
|
+
matchPatterns: matchQuarterPatterns2,
|
|
3189
|
+
defaultMatchWidth: "wide",
|
|
3190
|
+
parsePatterns: parseQuarterPatterns2,
|
|
3191
|
+
defaultParseWidth: "any",
|
|
3192
|
+
valueCallback: (index) => index + 1
|
|
3193
|
+
}),
|
|
3194
|
+
month: buildMatchFn({
|
|
3195
|
+
matchPatterns: matchMonthPatterns2,
|
|
3196
|
+
defaultMatchWidth: "wide",
|
|
3197
|
+
parsePatterns: parseMonthPatterns2,
|
|
3198
|
+
defaultParseWidth: "any"
|
|
3199
|
+
}),
|
|
3200
|
+
day: buildMatchFn({
|
|
3201
|
+
matchPatterns: matchDayPatterns2,
|
|
3202
|
+
defaultMatchWidth: "wide",
|
|
3203
|
+
parsePatterns: parseDayPatterns2,
|
|
3204
|
+
defaultParseWidth: "any"
|
|
3205
|
+
}),
|
|
3206
|
+
dayPeriod: buildMatchFn({
|
|
3207
|
+
matchPatterns: matchDayPeriodPatterns2,
|
|
3208
|
+
defaultMatchWidth: "any",
|
|
3209
|
+
parsePatterns: parseDayPeriodPatterns2,
|
|
3210
|
+
defaultParseWidth: "any"
|
|
3211
|
+
})
|
|
3212
|
+
};
|
|
3213
|
+
|
|
3214
|
+
// node_modules/date-fns/locale/th.js
|
|
3215
|
+
var th = {
|
|
3216
|
+
code: "th",
|
|
3217
|
+
formatDistance: formatDistance2,
|
|
3218
|
+
formatLong: formatLong2,
|
|
3219
|
+
formatRelative: formatRelative2,
|
|
3220
|
+
localize: localize2,
|
|
3221
|
+
match: match2,
|
|
3222
|
+
options: {
|
|
3223
|
+
weekStartsOn: 0,
|
|
3224
|
+
firstWeekContainsDate: 1
|
|
3225
|
+
}
|
|
3226
|
+
};
|
|
1290
3227
|
|
|
1291
3228
|
// src/DatePicker/convertToBuddhist.ts
|
|
1292
3229
|
var import_th_TH = __toESM(require("antd/es/date-picker/locale/th_TH"));
|
|
@@ -1302,7 +3239,7 @@ var buddhistLocale = {
|
|
|
1302
3239
|
};
|
|
1303
3240
|
|
|
1304
3241
|
// src/DatePicker/DatePickerBasic/DatePickerBasic.tsx
|
|
1305
|
-
var
|
|
3242
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1306
3243
|
import_dayjs.default.extend(import_buddhistEra.default);
|
|
1307
3244
|
function DatePickerBasic({
|
|
1308
3245
|
value,
|
|
@@ -1319,8 +3256,8 @@ function DatePickerBasic({
|
|
|
1319
3256
|
className,
|
|
1320
3257
|
size
|
|
1321
3258
|
}) {
|
|
1322
|
-
return /* @__PURE__ */ (0,
|
|
1323
|
-
|
|
3259
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3260
|
+
import_antd5.ConfigProvider,
|
|
1324
3261
|
{
|
|
1325
3262
|
locale: import_th_TH2.default,
|
|
1326
3263
|
theme: {
|
|
@@ -1329,13 +3266,13 @@ function DatePickerBasic({
|
|
|
1329
3266
|
fontSize: 16
|
|
1330
3267
|
}
|
|
1331
3268
|
},
|
|
1332
|
-
children: /* @__PURE__ */ (0,
|
|
1333
|
-
/* @__PURE__ */ (0,
|
|
1334
|
-
/* @__PURE__ */ (0,
|
|
1335
|
-
required && /* @__PURE__ */ (0,
|
|
3269
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "container-input", children: [
|
|
3270
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
3271
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "body-1", children: label }),
|
|
3272
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1336
3273
|
] }),
|
|
1337
|
-
/* @__PURE__ */ (0,
|
|
1338
|
-
|
|
3274
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3275
|
+
import_antd5.DatePicker,
|
|
1339
3276
|
{
|
|
1340
3277
|
className: `body-1 w-full ${className ?? ""}`,
|
|
1341
3278
|
value: value ? (0, import_dayjs.default)(value) : null,
|
|
@@ -1345,7 +3282,7 @@ function DatePickerBasic({
|
|
|
1345
3282
|
},
|
|
1346
3283
|
allowClear: true,
|
|
1347
3284
|
disabled,
|
|
1348
|
-
format: (date) => date ?
|
|
3285
|
+
format: (date) => date ? format(date.toDate(), "dd/MM/yyyy", { locale: th }).replace(
|
|
1349
3286
|
/\d{4}$/,
|
|
1350
3287
|
(y) => String(parseInt(y) + 543)
|
|
1351
3288
|
) : "",
|
|
@@ -1357,21 +3294,19 @@ function DatePickerBasic({
|
|
|
1357
3294
|
locale: buddhistLocale
|
|
1358
3295
|
}
|
|
1359
3296
|
),
|
|
1360
|
-
error && /* @__PURE__ */ (0,
|
|
3297
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1361
3298
|
] })
|
|
1362
3299
|
}
|
|
1363
3300
|
);
|
|
1364
3301
|
}
|
|
1365
3302
|
|
|
1366
3303
|
// src/DatePicker/DatePickerRangePicker/DatePickerRangePicker.tsx
|
|
1367
|
-
var
|
|
3304
|
+
var import_antd6 = require("antd");
|
|
1368
3305
|
var import_th_TH3 = __toESM(require("antd/locale/th_TH"));
|
|
1369
3306
|
var import_th2 = __toESM(require_th());
|
|
1370
3307
|
var import_dayjs2 = __toESM(require_dayjs_min());
|
|
1371
3308
|
var import_buddhistEra2 = __toESM(require_buddhistEra());
|
|
1372
|
-
var
|
|
1373
|
-
var import_locale2 = require("date-fns/locale");
|
|
1374
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3309
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1375
3310
|
import_dayjs2.default.extend(import_buddhistEra2.default);
|
|
1376
3311
|
function DatePickerRangePicker({
|
|
1377
3312
|
value,
|
|
@@ -1389,8 +3324,8 @@ function DatePickerRangePicker({
|
|
|
1389
3324
|
onOpenChange,
|
|
1390
3325
|
onCalendarChange
|
|
1391
3326
|
}) {
|
|
1392
|
-
return /* @__PURE__ */ (0,
|
|
1393
|
-
|
|
3327
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3328
|
+
import_antd6.ConfigProvider,
|
|
1394
3329
|
{
|
|
1395
3330
|
locale: import_th_TH3.default,
|
|
1396
3331
|
theme: {
|
|
@@ -1399,16 +3334,16 @@ function DatePickerRangePicker({
|
|
|
1399
3334
|
fontSize: 16
|
|
1400
3335
|
}
|
|
1401
3336
|
},
|
|
1402
|
-
children: /* @__PURE__ */ (0,
|
|
1403
|
-
/* @__PURE__ */ (0,
|
|
1404
|
-
/* @__PURE__ */ (0,
|
|
3337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "container-input", children: [
|
|
3338
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { children: [
|
|
3339
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "body-1", children: label }),
|
|
1405
3340
|
" ",
|
|
1406
|
-
required && /* @__PURE__ */ (0,
|
|
3341
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1407
3342
|
] }),
|
|
1408
|
-
/* @__PURE__ */ (0,
|
|
1409
|
-
|
|
3343
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3344
|
+
import_antd6.DatePicker.RangePicker,
|
|
1410
3345
|
{
|
|
1411
|
-
format: (date) => date ?
|
|
3346
|
+
format: (date) => date ? format(date.toDate(), "dd/MM/yyyy", { locale: th }).replace(
|
|
1412
3347
|
/\d{4}$/,
|
|
1413
3348
|
(y) => String(parseInt(y) + 543)
|
|
1414
3349
|
) : "",
|
|
@@ -1452,17 +3387,17 @@ function DatePickerRangePicker({
|
|
|
1452
3387
|
locale: buddhistLocale
|
|
1453
3388
|
}
|
|
1454
3389
|
),
|
|
1455
|
-
error && /* @__PURE__ */ (0,
|
|
3390
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1456
3391
|
] })
|
|
1457
3392
|
}
|
|
1458
3393
|
);
|
|
1459
3394
|
}
|
|
1460
3395
|
|
|
1461
3396
|
// src/TimePicker/TimePickerBasic/TimePickerBasic.tsx
|
|
1462
|
-
var
|
|
3397
|
+
var import_antd7 = require("antd");
|
|
1463
3398
|
var import_dayjs3 = __toESM(require_dayjs_min());
|
|
1464
3399
|
var import_th_TH4 = __toESM(require("antd/locale/th_TH"));
|
|
1465
|
-
var
|
|
3400
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1466
3401
|
function TimePickerBasic({
|
|
1467
3402
|
value,
|
|
1468
3403
|
onChange,
|
|
@@ -1473,8 +3408,8 @@ function TimePickerBasic({
|
|
|
1473
3408
|
disabled,
|
|
1474
3409
|
className
|
|
1475
3410
|
}) {
|
|
1476
|
-
return /* @__PURE__ */ (0,
|
|
1477
|
-
|
|
3411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3412
|
+
import_antd7.ConfigProvider,
|
|
1478
3413
|
{
|
|
1479
3414
|
locale: import_th_TH4.default,
|
|
1480
3415
|
theme: {
|
|
@@ -1482,14 +3417,14 @@ function TimePickerBasic({
|
|
|
1482
3417
|
fontFamily: "Kanit"
|
|
1483
3418
|
}
|
|
1484
3419
|
},
|
|
1485
|
-
children: /* @__PURE__ */ (0,
|
|
1486
|
-
/* @__PURE__ */ (0,
|
|
1487
|
-
/* @__PURE__ */ (0,
|
|
3420
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: "container-input", children: [
|
|
3421
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { children: [
|
|
3422
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "body-1", children: label }),
|
|
1488
3423
|
" ",
|
|
1489
|
-
required && /* @__PURE__ */ (0,
|
|
3424
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1490
3425
|
] }),
|
|
1491
|
-
/* @__PURE__ */ (0,
|
|
1492
|
-
|
|
3426
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3427
|
+
import_antd7.TimePicker,
|
|
1493
3428
|
{
|
|
1494
3429
|
format: "HH:mm",
|
|
1495
3430
|
className: `body-1 w-full ${className ?? ""}`,
|
|
@@ -1502,17 +3437,17 @@ function TimePickerBasic({
|
|
|
1502
3437
|
disabled
|
|
1503
3438
|
}
|
|
1504
3439
|
),
|
|
1505
|
-
error && /* @__PURE__ */ (0,
|
|
3440
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1506
3441
|
] })
|
|
1507
3442
|
}
|
|
1508
3443
|
);
|
|
1509
3444
|
}
|
|
1510
3445
|
|
|
1511
3446
|
// src/TimePicker/TimePickerRangePicker/TimerPickerRangePicker.tsx
|
|
1512
|
-
var
|
|
3447
|
+
var import_antd8 = require("antd");
|
|
1513
3448
|
var import_th_TH5 = __toESM(require("antd/locale/th_TH"));
|
|
1514
3449
|
var import_dayjs4 = __toESM(require_dayjs_min());
|
|
1515
|
-
var
|
|
3450
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1516
3451
|
function TimePickerRangePicker({
|
|
1517
3452
|
value,
|
|
1518
3453
|
onChange,
|
|
@@ -1523,8 +3458,8 @@ function TimePickerRangePicker({
|
|
|
1523
3458
|
disabled,
|
|
1524
3459
|
className
|
|
1525
3460
|
}) {
|
|
1526
|
-
return /* @__PURE__ */ (0,
|
|
1527
|
-
|
|
3461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3462
|
+
import_antd8.ConfigProvider,
|
|
1528
3463
|
{
|
|
1529
3464
|
locale: import_th_TH5.default,
|
|
1530
3465
|
theme: {
|
|
@@ -1532,14 +3467,14 @@ function TimePickerRangePicker({
|
|
|
1532
3467
|
fontFamily: "Kanit"
|
|
1533
3468
|
}
|
|
1534
3469
|
},
|
|
1535
|
-
children: /* @__PURE__ */ (0,
|
|
1536
|
-
/* @__PURE__ */ (0,
|
|
1537
|
-
/* @__PURE__ */ (0,
|
|
3470
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "container-input", children: [
|
|
3471
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { children: [
|
|
3472
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "body-1", children: label }),
|
|
1538
3473
|
" ",
|
|
1539
|
-
required && /* @__PURE__ */ (0,
|
|
3474
|
+
required && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "text-red-500", children: "*" })
|
|
1540
3475
|
] }),
|
|
1541
|
-
/* @__PURE__ */ (0,
|
|
1542
|
-
|
|
3476
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3477
|
+
import_antd8.TimePicker.RangePicker,
|
|
1543
3478
|
{
|
|
1544
3479
|
format: "HH:mm",
|
|
1545
3480
|
value: value ? [
|
|
@@ -1563,14 +3498,14 @@ function TimePickerRangePicker({
|
|
|
1563
3498
|
showNow: true
|
|
1564
3499
|
}
|
|
1565
3500
|
),
|
|
1566
|
-
error && /* @__PURE__ */ (0,
|
|
3501
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-red-500 caption-1", children: error })
|
|
1567
3502
|
] })
|
|
1568
3503
|
}
|
|
1569
3504
|
);
|
|
1570
3505
|
}
|
|
1571
3506
|
|
|
1572
3507
|
// src/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
1573
|
-
var
|
|
3508
|
+
var import_antd9 = require("antd");
|
|
1574
3509
|
|
|
1575
3510
|
// node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
1576
3511
|
function _typeof(o) {
|
|
@@ -1613,13 +3548,13 @@ function _defineProperty(e, r, t) {
|
|
|
1613
3548
|
// node_modules/@ant-design/fast-color/es/FastColor.js
|
|
1614
3549
|
var round = Math.round;
|
|
1615
3550
|
function splitColorStr(str, parseNum) {
|
|
1616
|
-
const
|
|
1617
|
-
const numList =
|
|
3551
|
+
const match3 = str.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [];
|
|
3552
|
+
const numList = match3.map((item) => parseFloat(item));
|
|
1618
3553
|
for (let i = 0; i < 3; i += 1) {
|
|
1619
|
-
numList[i] = parseNum(numList[i] || 0,
|
|
3554
|
+
numList[i] = parseNum(numList[i] || 0, match3[i] || "", i);
|
|
1620
3555
|
}
|
|
1621
|
-
if (
|
|
1622
|
-
numList[3] =
|
|
3556
|
+
if (match3[3]) {
|
|
3557
|
+
numList[3] = match3[3].includes("%") ? numList[3] / 100 : numList[3];
|
|
1623
3558
|
} else {
|
|
1624
3559
|
numList[3] = 1;
|
|
1625
3560
|
}
|
|
@@ -2272,7 +4207,7 @@ var greyDark = ["#151515", "#1f1f1f", "#2d2d2d", "#393939", "#494949", "#5a5a5a"
|
|
|
2272
4207
|
greyDark.primary = greyDark[5];
|
|
2273
4208
|
|
|
2274
4209
|
// src/ColorPalettePickerBasic/ColorPalettePickerBasic.tsx
|
|
2275
|
-
var
|
|
4210
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
2276
4211
|
function genPresets(presets = presetPalettes) {
|
|
2277
4212
|
return Object.entries(presets).map(([label, colors]) => ({
|
|
2278
4213
|
label,
|
|
@@ -2283,9 +4218,11 @@ function genPresets(presets = presetPalettes) {
|
|
|
2283
4218
|
function ColorPalettePickerBasic({
|
|
2284
4219
|
value,
|
|
2285
4220
|
onChange,
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
4221
|
+
require: require2,
|
|
4222
|
+
title,
|
|
4223
|
+
bottomText,
|
|
4224
|
+
showError,
|
|
4225
|
+
errorMessage,
|
|
2289
4226
|
disabled,
|
|
2290
4227
|
allowClear,
|
|
2291
4228
|
defaultFormat,
|
|
@@ -2293,14 +4230,14 @@ function ColorPalettePickerBasic({
|
|
|
2293
4230
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35",
|
|
2294
4231
|
onClear
|
|
2295
4232
|
}) {
|
|
2296
|
-
const { token } =
|
|
4233
|
+
const { token } = import_antd9.theme.useToken();
|
|
2297
4234
|
const presets = genPresets({
|
|
2298
4235
|
primary: generate(token.colorPrimary),
|
|
2299
4236
|
red,
|
|
2300
4237
|
green
|
|
2301
4238
|
});
|
|
2302
|
-
return /* @__PURE__ */ (0,
|
|
2303
|
-
|
|
4239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4240
|
+
import_antd9.ConfigProvider,
|
|
2304
4241
|
{
|
|
2305
4242
|
theme: {
|
|
2306
4243
|
token: {
|
|
@@ -2308,14 +4245,14 @@ function ColorPalettePickerBasic({
|
|
|
2308
4245
|
fontSize: 16
|
|
2309
4246
|
}
|
|
2310
4247
|
},
|
|
2311
|
-
children: /* @__PURE__ */ (0,
|
|
2312
|
-
/* @__PURE__ */ (0,
|
|
2313
|
-
/* @__PURE__ */ (0,
|
|
4248
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "container-input", children: [
|
|
4249
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
4250
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "body-1", children: title }),
|
|
2314
4251
|
" ",
|
|
2315
|
-
|
|
4252
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2316
4253
|
] }),
|
|
2317
|
-
/* @__PURE__ */ (0,
|
|
2318
|
-
|
|
4254
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
4255
|
+
import_antd9.ColorPicker,
|
|
2319
4256
|
{
|
|
2320
4257
|
defaultFormat,
|
|
2321
4258
|
className: `body-1 w-full ${className ?? ""}`,
|
|
@@ -2327,9 +4264,9 @@ function ColorPalettePickerBasic({
|
|
|
2327
4264
|
showText: (color) => {
|
|
2328
4265
|
const hex = color.toHexString();
|
|
2329
4266
|
if (!value) {
|
|
2330
|
-
return /* @__PURE__ */ (0,
|
|
4267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { children: placeholder });
|
|
2331
4268
|
}
|
|
2332
|
-
return /* @__PURE__ */ (0,
|
|
4269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("span", { children: [
|
|
2333
4270
|
"(",
|
|
2334
4271
|
hex,
|
|
2335
4272
|
")"
|
|
@@ -2339,22 +4276,28 @@ function ColorPalettePickerBasic({
|
|
|
2339
4276
|
onClear
|
|
2340
4277
|
}
|
|
2341
4278
|
),
|
|
2342
|
-
|
|
4279
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
|
|
4280
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
4281
|
+
" ",
|
|
4282
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
4283
|
+
] })
|
|
2343
4284
|
] })
|
|
2344
4285
|
}
|
|
2345
4286
|
);
|
|
2346
4287
|
}
|
|
2347
4288
|
|
|
2348
4289
|
// src/Select/SelectField/SelectField.tsx
|
|
2349
|
-
var
|
|
2350
|
-
var
|
|
4290
|
+
var import_antd10 = require("antd");
|
|
4291
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2351
4292
|
function SelectField({
|
|
2352
4293
|
value,
|
|
2353
4294
|
onChange,
|
|
2354
4295
|
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
4296
|
+
title,
|
|
4297
|
+
require: require2,
|
|
4298
|
+
bottomText,
|
|
4299
|
+
showError,
|
|
4300
|
+
errorMessage,
|
|
2358
4301
|
disabled,
|
|
2359
4302
|
defaultValue,
|
|
2360
4303
|
options,
|
|
@@ -2365,8 +4308,8 @@ function SelectField({
|
|
|
2365
4308
|
className,
|
|
2366
4309
|
onClear
|
|
2367
4310
|
}) {
|
|
2368
|
-
return /* @__PURE__ */ (0,
|
|
2369
|
-
|
|
4311
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4312
|
+
import_antd10.ConfigProvider,
|
|
2370
4313
|
{
|
|
2371
4314
|
theme: {
|
|
2372
4315
|
token: {
|
|
@@ -2374,14 +4317,14 @@ function SelectField({
|
|
|
2374
4317
|
fontSize: 16
|
|
2375
4318
|
}
|
|
2376
4319
|
},
|
|
2377
|
-
children: /* @__PURE__ */ (0,
|
|
2378
|
-
/* @__PURE__ */ (0,
|
|
2379
|
-
/* @__PURE__ */ (0,
|
|
4320
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "container-input", children: [
|
|
4321
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
4322
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "body-1", children: title }),
|
|
2380
4323
|
" ",
|
|
2381
|
-
|
|
4324
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2382
4325
|
] }),
|
|
2383
|
-
/* @__PURE__ */ (0,
|
|
2384
|
-
|
|
4326
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
4327
|
+
import_antd10.Select,
|
|
2385
4328
|
{
|
|
2386
4329
|
showSearch: true,
|
|
2387
4330
|
value,
|
|
@@ -2395,27 +4338,33 @@ function SelectField({
|
|
|
2395
4338
|
options,
|
|
2396
4339
|
mode,
|
|
2397
4340
|
onSearch: handleSearch,
|
|
2398
|
-
prefix: prefix ? /* @__PURE__ */ (0,
|
|
4341
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { style: { width: prefixSize, height: prefixSize, display: "flex", alignItems: "center", justifyContent: "center" }, children: prefix }) : void 0,
|
|
2399
4342
|
allowClear: true,
|
|
2400
4343
|
onClear
|
|
2401
4344
|
}
|
|
2402
4345
|
),
|
|
2403
|
-
|
|
4346
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { children: [
|
|
4347
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
4348
|
+
" ",
|
|
4349
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
4350
|
+
] })
|
|
2404
4351
|
] })
|
|
2405
4352
|
}
|
|
2406
4353
|
);
|
|
2407
4354
|
}
|
|
2408
4355
|
|
|
2409
4356
|
// src/Select/SelectFieldGroup/SelectFieldGroup.tsx
|
|
2410
|
-
var
|
|
2411
|
-
var
|
|
4357
|
+
var import_antd11 = require("antd");
|
|
4358
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
2412
4359
|
function SelectFieldGroup({
|
|
2413
4360
|
value,
|
|
2414
4361
|
onChange,
|
|
2415
4362
|
placeholder = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
4363
|
+
title,
|
|
4364
|
+
require: require2,
|
|
4365
|
+
bottomText,
|
|
4366
|
+
showError,
|
|
4367
|
+
errorMessage,
|
|
2419
4368
|
disabled,
|
|
2420
4369
|
defaultValue,
|
|
2421
4370
|
options,
|
|
@@ -2425,22 +4374,22 @@ function SelectFieldGroup({
|
|
|
2425
4374
|
handleSearch,
|
|
2426
4375
|
className
|
|
2427
4376
|
}) {
|
|
2428
|
-
return /* @__PURE__ */ (0,
|
|
2429
|
-
|
|
4377
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4378
|
+
import_antd11.ConfigProvider,
|
|
2430
4379
|
{
|
|
2431
4380
|
theme: {
|
|
2432
4381
|
token: {
|
|
2433
4382
|
fontFamily: "Kanit"
|
|
2434
4383
|
}
|
|
2435
4384
|
},
|
|
2436
|
-
children: /* @__PURE__ */ (0,
|
|
2437
|
-
/* @__PURE__ */ (0,
|
|
2438
|
-
/* @__PURE__ */ (0,
|
|
4385
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "container-input", children: [
|
|
4386
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
4387
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "body-1", children: title }),
|
|
2439
4388
|
" ",
|
|
2440
|
-
|
|
4389
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2441
4390
|
] }),
|
|
2442
|
-
/* @__PURE__ */ (0,
|
|
2443
|
-
|
|
4391
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
4392
|
+
import_antd11.Select,
|
|
2444
4393
|
{
|
|
2445
4394
|
showSearch: true,
|
|
2446
4395
|
value,
|
|
@@ -2454,7 +4403,7 @@ function SelectFieldGroup({
|
|
|
2454
4403
|
options,
|
|
2455
4404
|
mode,
|
|
2456
4405
|
onSearch: handleSearch,
|
|
2457
|
-
prefix: prefix ? /* @__PURE__ */ (0,
|
|
4406
|
+
prefix: prefix ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
2458
4407
|
"span",
|
|
2459
4408
|
{
|
|
2460
4409
|
style: {
|
|
@@ -2470,14 +4419,18 @@ function SelectFieldGroup({
|
|
|
2470
4419
|
allowClear: true
|
|
2471
4420
|
}
|
|
2472
4421
|
),
|
|
2473
|
-
|
|
4422
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { children: [
|
|
4423
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
4424
|
+
" ",
|
|
4425
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
4426
|
+
] })
|
|
2474
4427
|
] })
|
|
2475
4428
|
}
|
|
2476
4429
|
);
|
|
2477
4430
|
}
|
|
2478
4431
|
|
|
2479
4432
|
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
2480
|
-
var
|
|
4433
|
+
var import_antd12 = require("antd");
|
|
2481
4434
|
|
|
2482
4435
|
// src/Select/SelectFieldStatus/StatusMockup.ts
|
|
2483
4436
|
var status = [
|
|
@@ -2490,21 +4443,23 @@ var status = [
|
|
|
2490
4443
|
|
|
2491
4444
|
// src/Select/SelectFieldStatus/SelectFieldStatus.tsx
|
|
2492
4445
|
var import_icons = require("@ant-design/icons");
|
|
2493
|
-
var
|
|
4446
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2494
4447
|
function SelectFieldStatus({
|
|
2495
4448
|
value,
|
|
2496
4449
|
onChange,
|
|
2497
4450
|
placeholder,
|
|
2498
|
-
|
|
2499
|
-
|
|
4451
|
+
title,
|
|
4452
|
+
require: require2,
|
|
4453
|
+
bottomText,
|
|
2500
4454
|
disabled,
|
|
2501
|
-
|
|
4455
|
+
showError,
|
|
4456
|
+
errorMessage,
|
|
2502
4457
|
options,
|
|
2503
4458
|
className
|
|
2504
4459
|
}) {
|
|
2505
4460
|
const selectedItem = status.find((s) => s.value === value);
|
|
2506
|
-
return /* @__PURE__ */ (0,
|
|
2507
|
-
|
|
4461
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4462
|
+
import_antd12.ConfigProvider,
|
|
2508
4463
|
{
|
|
2509
4464
|
theme: {
|
|
2510
4465
|
components: {
|
|
@@ -2519,17 +4474,17 @@ function SelectFieldStatus({
|
|
|
2519
4474
|
fontFamily: "Kanit"
|
|
2520
4475
|
}
|
|
2521
4476
|
},
|
|
2522
|
-
children: /* @__PURE__ */ (0,
|
|
2523
|
-
/* @__PURE__ */ (0,
|
|
2524
|
-
/* @__PURE__ */ (0,
|
|
4477
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "container-input", children: [
|
|
4478
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
4479
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "body-1", children: title }),
|
|
2525
4480
|
" ",
|
|
2526
|
-
|
|
4481
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2527
4482
|
] }),
|
|
2528
|
-
/* @__PURE__ */ (0,
|
|
2529
|
-
|
|
4483
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
4484
|
+
import_antd12.Select,
|
|
2530
4485
|
{
|
|
2531
4486
|
disabled,
|
|
2532
|
-
suffixIcon: /* @__PURE__ */ (0,
|
|
4487
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_icons.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2533
4488
|
value,
|
|
2534
4489
|
onChange,
|
|
2535
4490
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2540,14 +4495,18 @@ function SelectFieldStatus({
|
|
|
2540
4495
|
showSearch: true
|
|
2541
4496
|
}
|
|
2542
4497
|
),
|
|
2543
|
-
|
|
4498
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { children: [
|
|
4499
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
4500
|
+
" ",
|
|
4501
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
4502
|
+
] })
|
|
2544
4503
|
] })
|
|
2545
4504
|
}
|
|
2546
4505
|
);
|
|
2547
4506
|
}
|
|
2548
4507
|
|
|
2549
4508
|
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
2550
|
-
var
|
|
4509
|
+
var import_antd13 = require("antd");
|
|
2551
4510
|
|
|
2552
4511
|
// src/Select/SelectFieldStatusReport/StatusReportMockup.ts
|
|
2553
4512
|
var status2 = [
|
|
@@ -2557,21 +4516,23 @@ var status2 = [
|
|
|
2557
4516
|
|
|
2558
4517
|
// src/Select/SelectFieldStatusReport/SelectFieldStatusReport.tsx
|
|
2559
4518
|
var import_icons2 = require("@ant-design/icons");
|
|
2560
|
-
var
|
|
4519
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2561
4520
|
function SelectFieldStatusReport({
|
|
2562
4521
|
value,
|
|
2563
4522
|
onChange,
|
|
2564
4523
|
placeholder,
|
|
2565
|
-
|
|
2566
|
-
|
|
4524
|
+
title,
|
|
4525
|
+
require: require2,
|
|
4526
|
+
bottomText,
|
|
2567
4527
|
disabled,
|
|
2568
|
-
|
|
4528
|
+
showError,
|
|
4529
|
+
errorMessage,
|
|
2569
4530
|
className,
|
|
2570
4531
|
options
|
|
2571
4532
|
}) {
|
|
2572
4533
|
const selectedItem = status2.find((s) => s.value === value);
|
|
2573
|
-
return /* @__PURE__ */ (0,
|
|
2574
|
-
|
|
4534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4535
|
+
import_antd13.ConfigProvider,
|
|
2575
4536
|
{
|
|
2576
4537
|
theme: {
|
|
2577
4538
|
components: {
|
|
@@ -2586,17 +4547,17 @@ function SelectFieldStatusReport({
|
|
|
2586
4547
|
fontFamily: "Kanit"
|
|
2587
4548
|
}
|
|
2588
4549
|
},
|
|
2589
|
-
children: /* @__PURE__ */ (0,
|
|
2590
|
-
/* @__PURE__ */ (0,
|
|
2591
|
-
/* @__PURE__ */ (0,
|
|
4550
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "container-input", children: [
|
|
4551
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
4552
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "body-1", children: title }),
|
|
2592
4553
|
" ",
|
|
2593
|
-
|
|
4554
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2594
4555
|
] }),
|
|
2595
|
-
/* @__PURE__ */ (0,
|
|
2596
|
-
|
|
4556
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
4557
|
+
import_antd13.Select,
|
|
2597
4558
|
{
|
|
2598
4559
|
disabled,
|
|
2599
|
-
suffixIcon: /* @__PURE__ */ (0,
|
|
4560
|
+
suffixIcon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_icons2.DownOutlined, { style: { color: value ? "#fff" : "#D9D9D9" } }),
|
|
2600
4561
|
value,
|
|
2601
4562
|
onChange,
|
|
2602
4563
|
className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2607,22 +4568,28 @@ function SelectFieldStatusReport({
|
|
|
2607
4568
|
showSearch: true
|
|
2608
4569
|
}
|
|
2609
4570
|
),
|
|
2610
|
-
|
|
4571
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { children: [
|
|
4572
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
4573
|
+
" ",
|
|
4574
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
4575
|
+
] })
|
|
2611
4576
|
] })
|
|
2612
4577
|
}
|
|
2613
4578
|
);
|
|
2614
4579
|
}
|
|
2615
4580
|
|
|
2616
4581
|
// src/Select/SelectFieldTag/SelectFieldTag.tsx
|
|
2617
|
-
var
|
|
4582
|
+
var import_antd14 = require("antd");
|
|
2618
4583
|
var import_react8 = require("react");
|
|
2619
|
-
var
|
|
4584
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2620
4585
|
function SelectFieldTag({
|
|
2621
|
-
|
|
2622
|
-
|
|
4586
|
+
title,
|
|
4587
|
+
require: require2,
|
|
4588
|
+
bottomText,
|
|
2623
4589
|
placeholder,
|
|
2624
4590
|
options,
|
|
2625
|
-
|
|
4591
|
+
showError,
|
|
4592
|
+
errorMessage,
|
|
2626
4593
|
value: controlledValue,
|
|
2627
4594
|
className,
|
|
2628
4595
|
onChange,
|
|
@@ -2649,22 +4616,22 @@ function SelectFieldTag({
|
|
|
2649
4616
|
}
|
|
2650
4617
|
onChange?.([]);
|
|
2651
4618
|
};
|
|
2652
|
-
return /* @__PURE__ */ (0,
|
|
2653
|
-
|
|
4619
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4620
|
+
import_antd14.ConfigProvider,
|
|
2654
4621
|
{
|
|
2655
4622
|
theme: {
|
|
2656
4623
|
token: {
|
|
2657
4624
|
fontFamily: "Kanit"
|
|
2658
4625
|
}
|
|
2659
4626
|
},
|
|
2660
|
-
children: /* @__PURE__ */ (0,
|
|
2661
|
-
/* @__PURE__ */ (0,
|
|
2662
|
-
/* @__PURE__ */ (0,
|
|
4627
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "container-input", children: [
|
|
4628
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
4629
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "body-1", children: title }),
|
|
2663
4630
|
" ",
|
|
2664
|
-
|
|
4631
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2665
4632
|
] }),
|
|
2666
|
-
/* @__PURE__ */ (0,
|
|
2667
|
-
|
|
4633
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4634
|
+
import_antd14.Select,
|
|
2668
4635
|
{
|
|
2669
4636
|
mode: "tags",
|
|
2670
4637
|
className: `body-1 flex justify-center w-full ${className ?? ""}`,
|
|
@@ -2682,7 +4649,11 @@ function SelectFieldTag({
|
|
|
2682
4649
|
onClear
|
|
2683
4650
|
}
|
|
2684
4651
|
),
|
|
2685
|
-
|
|
4652
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { children: [
|
|
4653
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
4654
|
+
" ",
|
|
4655
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
4656
|
+
] })
|
|
2686
4657
|
] })
|
|
2687
4658
|
}
|
|
2688
4659
|
);
|
|
@@ -2690,16 +4661,18 @@ function SelectFieldTag({
|
|
|
2690
4661
|
|
|
2691
4662
|
// src/Select/SelectCustom/SelectCustom.tsx
|
|
2692
4663
|
var import_icons_react8 = require("@tabler/icons-react");
|
|
2693
|
-
var
|
|
4664
|
+
var import_antd15 = require("antd");
|
|
2694
4665
|
var import_react9 = require("react");
|
|
2695
|
-
var
|
|
4666
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2696
4667
|
function SelectCustom({
|
|
2697
|
-
|
|
4668
|
+
title = "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
|
|
2698
4669
|
placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01",
|
|
2699
4670
|
options,
|
|
2700
|
-
|
|
4671
|
+
require: require2 = false,
|
|
2701
4672
|
onChange,
|
|
2702
|
-
|
|
4673
|
+
bottomText,
|
|
4674
|
+
showError,
|
|
4675
|
+
errorMessage,
|
|
2703
4676
|
onClear
|
|
2704
4677
|
}) {
|
|
2705
4678
|
const [value, setValue] = (0, import_react9.useState)([]);
|
|
@@ -2721,8 +4694,8 @@ function SelectCustom({
|
|
|
2721
4694
|
});
|
|
2722
4695
|
};
|
|
2723
4696
|
const filteredOptions = options.filter((opt) => !valueList.includes(opt.value)).map((opt) => ({ value: opt.value, label: opt.label }));
|
|
2724
|
-
return /* @__PURE__ */ (0,
|
|
2725
|
-
|
|
4697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4698
|
+
import_antd15.ConfigProvider,
|
|
2726
4699
|
{
|
|
2727
4700
|
theme: {
|
|
2728
4701
|
token: {
|
|
@@ -2730,14 +4703,14 @@ function SelectCustom({
|
|
|
2730
4703
|
fontSize: 16
|
|
2731
4704
|
}
|
|
2732
4705
|
},
|
|
2733
|
-
children: /* @__PURE__ */ (0,
|
|
2734
|
-
/* @__PURE__ */ (0,
|
|
2735
|
-
/* @__PURE__ */ (0,
|
|
4706
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "container-input", children: [
|
|
4707
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
4708
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "body-1", children: title }),
|
|
2736
4709
|
" ",
|
|
2737
|
-
|
|
4710
|
+
require2 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "text-red-500", children: "*" })
|
|
2738
4711
|
] }),
|
|
2739
|
-
/* @__PURE__ */ (0,
|
|
2740
|
-
|
|
4712
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4713
|
+
import_antd15.Select,
|
|
2741
4714
|
{
|
|
2742
4715
|
value,
|
|
2743
4716
|
onChange: handleChange,
|
|
@@ -2747,20 +4720,24 @@ function SelectCustom({
|
|
|
2747
4720
|
onClear
|
|
2748
4721
|
}
|
|
2749
4722
|
),
|
|
2750
|
-
|
|
2751
|
-
|
|
4723
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
|
|
4724
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "caption-1 text-gray-500", children: bottomText }),
|
|
4725
|
+
" ",
|
|
4726
|
+
showError && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { className: "caption-1 text-red-500 ", children: errorMessage })
|
|
4727
|
+
] }),
|
|
4728
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "w-full p-[2px] overflow-y-auto", children: valueList.map((v, index) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
2752
4729
|
"div",
|
|
2753
4730
|
{
|
|
2754
4731
|
className: "flex justify-between items-center py-[2px] body-1",
|
|
2755
4732
|
children: [
|
|
2756
|
-
/* @__PURE__ */ (0,
|
|
2757
|
-
/* @__PURE__ */ (0,
|
|
4733
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "flex flex-row gap-[8px]", children: [
|
|
4734
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("p", { children: [
|
|
2758
4735
|
index + 1,
|
|
2759
4736
|
"."
|
|
2760
4737
|
] }),
|
|
2761
|
-
/* @__PURE__ */ (0,
|
|
4738
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("p", { children: v })
|
|
2762
4739
|
] }),
|
|
2763
|
-
/* @__PURE__ */ (0,
|
|
4740
|
+
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2764
4741
|
import_icons_react8.IconTrash,
|
|
2765
4742
|
{
|
|
2766
4743
|
className: "cursor-pointer",
|
|
@@ -2777,7 +4754,7 @@ function SelectCustom({
|
|
|
2777
4754
|
}
|
|
2778
4755
|
|
|
2779
4756
|
// src/SortFilter/SortFilter.tsx
|
|
2780
|
-
var
|
|
4757
|
+
var import_antd16 = require("antd");
|
|
2781
4758
|
var import_icons3 = require("@ant-design/icons");
|
|
2782
4759
|
|
|
2783
4760
|
// src/SortFilter/DataMockSortFilter.ts
|
|
@@ -2810,7 +4787,7 @@ var quarters = [
|
|
|
2810
4787
|
// src/SortFilter/SortFilter.tsx
|
|
2811
4788
|
var import_react10 = require("react");
|
|
2812
4789
|
var import_icons_react9 = require("@tabler/icons-react");
|
|
2813
|
-
var
|
|
4790
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2814
4791
|
function SortFilter({
|
|
2815
4792
|
showYear = true,
|
|
2816
4793
|
showQuarter = true,
|
|
@@ -2821,20 +4798,20 @@ function SortFilter({
|
|
|
2821
4798
|
const [yearValue, setYearValue] = (0, import_react10.useState)();
|
|
2822
4799
|
const [monthValue, setMonthValue] = (0, import_react10.useState)();
|
|
2823
4800
|
const [quarterValue, setQuartersValue] = (0, import_react10.useState)();
|
|
2824
|
-
return /* @__PURE__ */ (0,
|
|
2825
|
-
|
|
4801
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
4802
|
+
import_antd16.ConfigProvider,
|
|
2826
4803
|
{
|
|
2827
4804
|
theme: {
|
|
2828
4805
|
token: {
|
|
2829
4806
|
fontFamily: "Kanit"
|
|
2830
4807
|
}
|
|
2831
4808
|
},
|
|
2832
|
-
children: /* @__PURE__ */ (0,
|
|
2833
|
-
/* @__PURE__ */ (0,
|
|
2834
|
-
showYear && /* @__PURE__ */ (0,
|
|
4809
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "w-full flex items-center justify-between", children: [
|
|
4810
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "w-full flex gap-[10px]", children: [
|
|
4811
|
+
showYear && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2835
4812
|
SelectField,
|
|
2836
4813
|
{
|
|
2837
|
-
prefix: /* @__PURE__ */ (0,
|
|
4814
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2838
4815
|
onChange: setYearValue,
|
|
2839
4816
|
options: years.map((s) => ({
|
|
2840
4817
|
value: s.value,
|
|
@@ -2844,10 +4821,10 @@ function SortFilter({
|
|
|
2844
4821
|
value: yearValue
|
|
2845
4822
|
}
|
|
2846
4823
|
) }),
|
|
2847
|
-
showMonth && /* @__PURE__ */ (0,
|
|
4824
|
+
showMonth && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2848
4825
|
SelectField,
|
|
2849
4826
|
{
|
|
2850
|
-
prefix: /* @__PURE__ */ (0,
|
|
4827
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2851
4828
|
onChange: setMonthValue,
|
|
2852
4829
|
options: months.map((s) => ({
|
|
2853
4830
|
value: s.value,
|
|
@@ -2857,10 +4834,10 @@ function SortFilter({
|
|
|
2857
4834
|
placeholder: "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E40\u0E14\u0E37\u0E2D\u0E19"
|
|
2858
4835
|
}
|
|
2859
4836
|
) }),
|
|
2860
|
-
showQuarter && /* @__PURE__ */ (0,
|
|
4837
|
+
showQuarter && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "w-[200px]", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2861
4838
|
SelectField,
|
|
2862
4839
|
{
|
|
2863
|
-
prefix: /* @__PURE__ */ (0,
|
|
4840
|
+
prefix: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_icons3.CalendarOutlined, {}),
|
|
2864
4841
|
onChange: setQuartersValue,
|
|
2865
4842
|
options: quarters.map((s) => ({
|
|
2866
4843
|
value: s.value,
|
|
@@ -2871,8 +4848,8 @@ function SortFilter({
|
|
|
2871
4848
|
}
|
|
2872
4849
|
) })
|
|
2873
4850
|
] }),
|
|
2874
|
-
/* @__PURE__ */ (0,
|
|
2875
|
-
/* @__PURE__ */ (0,
|
|
4851
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex gap-[10px]", children: [
|
|
4852
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2876
4853
|
import_icons_react9.IconSortDescending,
|
|
2877
4854
|
{
|
|
2878
4855
|
size: 24,
|
|
@@ -2880,7 +4857,7 @@ function SortFilter({
|
|
|
2880
4857
|
onClick: onSortClick
|
|
2881
4858
|
}
|
|
2882
4859
|
),
|
|
2883
|
-
/* @__PURE__ */ (0,
|
|
4860
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2884
4861
|
import_icons_react9.IconFilter,
|
|
2885
4862
|
{
|
|
2886
4863
|
size: 24,
|
|
@@ -2897,7 +4874,7 @@ function SortFilter({
|
|
|
2897
4874
|
// src/Upload/FileUploader/FileUploader.tsx
|
|
2898
4875
|
var import_icons_react10 = require("@tabler/icons-react");
|
|
2899
4876
|
var import_react11 = require("react");
|
|
2900
|
-
var
|
|
4877
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2901
4878
|
function FileUploader({
|
|
2902
4879
|
onUpload,
|
|
2903
4880
|
onError,
|
|
@@ -2930,7 +4907,7 @@ function FileUploader({
|
|
|
2930
4907
|
const handleRemoveFile = async (index) => {
|
|
2931
4908
|
try {
|
|
2932
4909
|
if (onRemove) {
|
|
2933
|
-
await onRemove(
|
|
4910
|
+
await onRemove();
|
|
2934
4911
|
}
|
|
2935
4912
|
const updatedList = [...fileList];
|
|
2936
4913
|
updatedList.splice(index, 1);
|
|
@@ -2968,10 +4945,10 @@ function FileUploader({
|
|
|
2968
4945
|
}
|
|
2969
4946
|
if (inputRef.current) inputRef.current.value = "";
|
|
2970
4947
|
};
|
|
2971
|
-
return /* @__PURE__ */ (0,
|
|
2972
|
-
label && /* @__PURE__ */ (0,
|
|
2973
|
-
/* @__PURE__ */ (0,
|
|
2974
|
-
mode === "upload" ? /* @__PURE__ */ (0,
|
|
4948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "w-full", children: [
|
|
4949
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "body-1", children: label }),
|
|
4950
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { children: [
|
|
4951
|
+
mode === "upload" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2975
4952
|
"button",
|
|
2976
4953
|
{
|
|
2977
4954
|
type: "button",
|
|
@@ -2979,15 +4956,15 @@ function FileUploader({
|
|
|
2979
4956
|
className: `h-[34px] flex justify-center items-center gap-2 w-full rounded-[2px] border border-gray-200 body-1
|
|
2980
4957
|
${disabled ? "cursor-not-allowed text-gray-400 bg-gray-100" : "cursor-pointer hover:text-primary-400 hover:border-primary-200 duration-300"}`,
|
|
2981
4958
|
disabled: disabled ? disabled : uploading,
|
|
2982
|
-
children: uploading ? /* @__PURE__ */ (0,
|
|
2983
|
-
/* @__PURE__ */ (0,
|
|
4959
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
4960
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Loader, { size: 15 }),
|
|
2984
4961
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
2985
|
-
] }) : /* @__PURE__ */ (0,
|
|
2986
|
-
/* @__PURE__ */ (0,
|
|
4962
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
4963
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons_react10.IconUpload, { size: 15, className: "text-gray-400" }),
|
|
2987
4964
|
" \u0E41\u0E19\u0E1A\u0E44\u0E1F\u0E25\u0E4C"
|
|
2988
4965
|
] })
|
|
2989
4966
|
}
|
|
2990
|
-
) : /* @__PURE__ */ (0,
|
|
4967
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2991
4968
|
"div",
|
|
2992
4969
|
{
|
|
2993
4970
|
className: `min-w-[400px] min-h-[120px] flex justify-center items-center border-2 border-dashed rounded-md p-4 transition-colors body-1
|
|
@@ -3001,17 +4978,17 @@ function FileUploader({
|
|
|
3001
4978
|
},
|
|
3002
4979
|
onDragLeave: () => setDragActive(false),
|
|
3003
4980
|
onDrop: handleDrop,
|
|
3004
|
-
children: uploading ? /* @__PURE__ */ (0,
|
|
3005
|
-
/* @__PURE__ */ (0,
|
|
4981
|
+
children: uploading ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex justify-center items-center gap-2", children: [
|
|
4982
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Loader, { size: 15 }),
|
|
3006
4983
|
" \u0E01\u0E33\u0E25\u0E31\u0E07\u0E2D\u0E31\u0E1B\u0E42\u0E2B\u0E25\u0E14"
|
|
3007
|
-
] }) : /* @__PURE__ */ (0,
|
|
3008
|
-
/* @__PURE__ */ (0,
|
|
3009
|
-
/* @__PURE__ */ (0,
|
|
3010
|
-
/* @__PURE__ */ (0,
|
|
4984
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex flex-col items-center gap-2", children: [
|
|
4985
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons_react10.IconUpload, { size: 20 }),
|
|
4986
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.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" }),
|
|
4987
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.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" })
|
|
3011
4988
|
] })
|
|
3012
4989
|
}
|
|
3013
4990
|
),
|
|
3014
|
-
/* @__PURE__ */ (0,
|
|
4991
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3015
4992
|
"input",
|
|
3016
4993
|
{
|
|
3017
4994
|
type: "file",
|
|
@@ -3024,13 +5001,13 @@ function FileUploader({
|
|
|
3024
5001
|
}
|
|
3025
5002
|
)
|
|
3026
5003
|
] }),
|
|
3027
|
-
description && /* @__PURE__ */ (0,
|
|
3028
|
-
/* @__PURE__ */ (0,
|
|
3029
|
-
/* @__PURE__ */ (0,
|
|
3030
|
-
/* @__PURE__ */ (0,
|
|
3031
|
-
/* @__PURE__ */ (0,
|
|
5004
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { className: "text-gray-400 body-4", children: description }),
|
|
5005
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "mt-[8px]", children: fileList.length !== 0 && fileList.map((file, index) => /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2 rounded-[4px] px-[8px] py-[4px] body-1", children: [
|
|
5006
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2 w-[75%] overflow-hidden", children: [
|
|
5007
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "w-[15px] h-[15px]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_icons_react10.IconPaperclip, { size: 15 }) }),
|
|
5008
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "truncate", children: file.name })
|
|
3032
5009
|
] }),
|
|
3033
|
-
/* @__PURE__ */ (0,
|
|
5010
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
3034
5011
|
import_icons_react10.IconTrash,
|
|
3035
5012
|
{
|
|
3036
5013
|
size: 20,
|
|
@@ -3064,9 +5041,9 @@ function messageLoading(content, duration) {
|
|
|
3064
5041
|
}
|
|
3065
5042
|
|
|
3066
5043
|
// src/Breadcrumb/Breadcrumb.tsx
|
|
5044
|
+
var import_antd17 = require("antd");
|
|
3067
5045
|
var import_antd18 = require("antd");
|
|
3068
|
-
var
|
|
3069
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
5046
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
3070
5047
|
function Breadcrumbs({
|
|
3071
5048
|
items,
|
|
3072
5049
|
separator,
|
|
@@ -3074,16 +5051,16 @@ function Breadcrumbs({
|
|
|
3074
5051
|
classname,
|
|
3075
5052
|
params
|
|
3076
5053
|
}) {
|
|
3077
|
-
return /* @__PURE__ */ (0,
|
|
3078
|
-
|
|
5054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5055
|
+
import_antd17.ConfigProvider,
|
|
3079
5056
|
{
|
|
3080
5057
|
theme: {
|
|
3081
5058
|
token: {
|
|
3082
5059
|
fontFamily: "Kanit"
|
|
3083
5060
|
}
|
|
3084
5061
|
},
|
|
3085
|
-
children: /* @__PURE__ */ (0,
|
|
3086
|
-
|
|
5062
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
5063
|
+
import_antd18.Breadcrumb,
|
|
3087
5064
|
{
|
|
3088
5065
|
items,
|
|
3089
5066
|
separator,
|
|
@@ -3097,8 +5074,8 @@ function Breadcrumbs({
|
|
|
3097
5074
|
}
|
|
3098
5075
|
|
|
3099
5076
|
// src/HeadingPage/HeadingPage.tsx
|
|
3100
|
-
var
|
|
3101
|
-
var
|
|
5077
|
+
var import_antd19 = require("antd");
|
|
5078
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3102
5079
|
function HeadingPage({ Heading }) {
|
|
3103
5080
|
const today = (/* @__PURE__ */ new Date()).toLocaleDateString("th-TH", {
|
|
3104
5081
|
weekday: "long",
|
|
@@ -3106,17 +5083,17 @@ function HeadingPage({ Heading }) {
|
|
|
3106
5083
|
month: "long",
|
|
3107
5084
|
year: "numeric"
|
|
3108
5085
|
});
|
|
3109
|
-
return /* @__PURE__ */ (0,
|
|
3110
|
-
|
|
5086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
5087
|
+
import_antd19.ConfigProvider,
|
|
3111
5088
|
{
|
|
3112
5089
|
theme: {
|
|
3113
5090
|
token: {
|
|
3114
5091
|
fontFamily: "Kanit"
|
|
3115
5092
|
}
|
|
3116
5093
|
},
|
|
3117
|
-
children: /* @__PURE__ */ (0,
|
|
3118
|
-
/* @__PURE__ */ (0,
|
|
3119
|
-
/* @__PURE__ */ (0,
|
|
5094
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex flex-col gap-[10px] px-[20px] py-[10px]", children: [
|
|
5095
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "headline-5", children: Heading }),
|
|
5096
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("p", { className: "body-1", children: [
|
|
3120
5097
|
" \u0E27\u0E31\u0E19\u0E19\u0E35\u0E49 ",
|
|
3121
5098
|
today
|
|
3122
5099
|
] })
|
|
@@ -3126,9 +5103,9 @@ function HeadingPage({ Heading }) {
|
|
|
3126
5103
|
}
|
|
3127
5104
|
|
|
3128
5105
|
// src/Progress/ProgressBar.tsx
|
|
3129
|
-
var
|
|
5106
|
+
var import_antd20 = require("antd");
|
|
3130
5107
|
var import_react12 = require("react");
|
|
3131
|
-
var
|
|
5108
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
3132
5109
|
function ProgressBar({
|
|
3133
5110
|
percent = 0,
|
|
3134
5111
|
size = "default",
|
|
@@ -3161,17 +5138,17 @@ function ProgressBar({
|
|
|
3161
5138
|
observer.observe(inner);
|
|
3162
5139
|
return () => observer.disconnect();
|
|
3163
5140
|
}, []);
|
|
3164
|
-
return /* @__PURE__ */ (0,
|
|
3165
|
-
|
|
5141
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5142
|
+
import_antd20.ConfigProvider,
|
|
3166
5143
|
{
|
|
3167
5144
|
theme: {
|
|
3168
5145
|
token: {
|
|
3169
5146
|
fontFamily: "Kanit"
|
|
3170
5147
|
}
|
|
3171
5148
|
},
|
|
3172
|
-
children: /* @__PURE__ */ (0,
|
|
3173
|
-
/* @__PURE__ */ (0,
|
|
3174
|
-
|
|
5149
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "relative w-full", ref: progressRef, children: [
|
|
5150
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
5151
|
+
import_antd20.Progress,
|
|
3175
5152
|
{
|
|
3176
5153
|
className: "w-full",
|
|
3177
5154
|
percent,
|
|
@@ -3186,7 +5163,7 @@ function ProgressBar({
|
|
|
3186
5163
|
strokeColor
|
|
3187
5164
|
}
|
|
3188
5165
|
),
|
|
3189
|
-
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ (0,
|
|
5166
|
+
barWidth > 0 && isCheckPoints && type !== "circle" && checkpoints.map((cp) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
3190
5167
|
"div",
|
|
3191
5168
|
{
|
|
3192
5169
|
className: "checkpoint absolute top-0",
|
|
@@ -3208,7 +5185,7 @@ function ProgressBar({
|
|
|
3208
5185
|
}
|
|
3209
5186
|
|
|
3210
5187
|
// src/KpiSection/KpiSection.tsx
|
|
3211
|
-
var
|
|
5188
|
+
var import_antd21 = require("antd");
|
|
3212
5189
|
var import_react14 = require("react");
|
|
3213
5190
|
|
|
3214
5191
|
// src/KpiSection/hooks/useGetKpiSection.ts
|
|
@@ -3359,7 +5336,7 @@ function useGetKpiSection() {
|
|
|
3359
5336
|
|
|
3360
5337
|
// src/KpiSection/KpiSection.tsx
|
|
3361
5338
|
var import_icons_react11 = require("@tabler/icons-react");
|
|
3362
|
-
var
|
|
5339
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
3363
5340
|
function KpiSection({ type, onChangeKpiList }) {
|
|
3364
5341
|
const {
|
|
3365
5342
|
handleAddKpi,
|
|
@@ -3379,7 +5356,7 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3379
5356
|
itemErrors,
|
|
3380
5357
|
setItemErrors
|
|
3381
5358
|
} = useGetKpiSection();
|
|
3382
|
-
const [messageApi2, messageContainer] =
|
|
5359
|
+
const [messageApi2, messageContainer] = import_antd21.message.useMessage();
|
|
3383
5360
|
const [hasShownError, setHasShownError] = (0, import_react14.useState)(false);
|
|
3384
5361
|
(0, import_react14.useEffect)(() => {
|
|
3385
5362
|
setMessageApi(messageApi2);
|
|
@@ -3389,8 +5366,8 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3389
5366
|
onChangeKpiList(kpiList);
|
|
3390
5367
|
}
|
|
3391
5368
|
}, [kpiList]);
|
|
3392
|
-
return /* @__PURE__ */ (0,
|
|
3393
|
-
|
|
5369
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
5370
|
+
import_antd21.ConfigProvider,
|
|
3394
5371
|
{
|
|
3395
5372
|
theme: {
|
|
3396
5373
|
token: {
|
|
@@ -3398,27 +5375,30 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3398
5375
|
fontSize: 16
|
|
3399
5376
|
}
|
|
3400
5377
|
},
|
|
3401
|
-
children: /* @__PURE__ */ (0,
|
|
5378
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "container-input", children: [
|
|
3402
5379
|
messageContainer,
|
|
3403
|
-
type === "number" && /* @__PURE__ */ (0,
|
|
3404
|
-
/* @__PURE__ */ (0,
|
|
3405
|
-
/* @__PURE__ */ (0,
|
|
5380
|
+
type === "number" && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "space-y-4", children: [
|
|
5381
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "grid grid-cols-[1fr_200px_200px_50px] w-full gap-[24px] items-start", children: [
|
|
5382
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3406
5383
|
InputField,
|
|
3407
5384
|
{
|
|
3408
5385
|
value: nameKpi,
|
|
3409
|
-
|
|
5386
|
+
title: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
|
|
3410
5387
|
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
5388
|
+
require: true,
|
|
3411
5389
|
onChange: (value) => setNameKpi(value ?? ""),
|
|
3412
5390
|
className: "h-[32px]",
|
|
3413
|
-
|
|
5391
|
+
showError: !!errors.nameKpi,
|
|
5392
|
+
errorMessage: errors.nameKpi
|
|
3414
5393
|
}
|
|
3415
5394
|
),
|
|
3416
|
-
/* @__PURE__ */ (0,
|
|
5395
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3417
5396
|
InputField,
|
|
3418
5397
|
{
|
|
3419
5398
|
value: kpiValue,
|
|
3420
|
-
|
|
5399
|
+
title: "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
|
|
3421
5400
|
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
5401
|
+
require: true,
|
|
3422
5402
|
onChange: (value) => {
|
|
3423
5403
|
if (value === void 0 || value === "") {
|
|
3424
5404
|
setKpiValue("");
|
|
@@ -3433,25 +5413,28 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3433
5413
|
}
|
|
3434
5414
|
}
|
|
3435
5415
|
},
|
|
3436
|
-
|
|
5416
|
+
showError: !!errors.kpiValue,
|
|
5417
|
+
errorMessage: errors.kpiValue
|
|
3437
5418
|
}
|
|
3438
5419
|
),
|
|
3439
|
-
/* @__PURE__ */ (0,
|
|
5420
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3440
5421
|
InputField,
|
|
3441
5422
|
{
|
|
3442
5423
|
value: unitValue,
|
|
3443
|
-
|
|
5424
|
+
title: "\u0E2B\u0E19\u0E48\u0E27\u0E22",
|
|
3444
5425
|
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
5426
|
+
require: true,
|
|
3445
5427
|
onChange: (value) => setUnitValue(value ?? ""),
|
|
3446
5428
|
className: "h-[32px]",
|
|
3447
|
-
|
|
5429
|
+
showError: !!errors.unitValue,
|
|
5430
|
+
errorMessage: errors.unitValue
|
|
3448
5431
|
}
|
|
3449
5432
|
),
|
|
3450
|
-
/* @__PURE__ */ (0,
|
|
5433
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3451
5434
|
"div",
|
|
3452
5435
|
{
|
|
3453
5436
|
className: `flex justify-end mt-[28px]`,
|
|
3454
|
-
children: /* @__PURE__ */ (0,
|
|
5437
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3455
5438
|
import_icons_react11.IconCirclePlus,
|
|
3456
5439
|
{
|
|
3457
5440
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3462,17 +5445,17 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3462
5445
|
}
|
|
3463
5446
|
)
|
|
3464
5447
|
] }),
|
|
3465
|
-
/* @__PURE__ */ (0,
|
|
5448
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3466
5449
|
"div",
|
|
3467
5450
|
{
|
|
3468
5451
|
className: "grid grid-cols-[30px_1fr_100px_120px_80px] items-start py-2 body-1 gap-[8px]",
|
|
3469
5452
|
children: [
|
|
3470
|
-
/* @__PURE__ */ (0,
|
|
5453
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3471
5454
|
index + 1,
|
|
3472
5455
|
"."
|
|
3473
5456
|
] }),
|
|
3474
|
-
kpi.isEditing ? /* @__PURE__ */ (0,
|
|
3475
|
-
/* @__PURE__ */ (0,
|
|
5457
|
+
kpi.isEditing ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5458
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3476
5459
|
InputField,
|
|
3477
5460
|
{
|
|
3478
5461
|
value: kpi.name,
|
|
@@ -3481,10 +5464,11 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3481
5464
|
(item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item
|
|
3482
5465
|
)
|
|
3483
5466
|
),
|
|
3484
|
-
|
|
5467
|
+
showError: !!itemErrors[kpi.id]?.name,
|
|
5468
|
+
errorMessage: itemErrors[kpi.id]?.name
|
|
3485
5469
|
}
|
|
3486
5470
|
),
|
|
3487
|
-
/* @__PURE__ */ (0,
|
|
5471
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3488
5472
|
InputField,
|
|
3489
5473
|
{
|
|
3490
5474
|
value: kpi.value?.toString(),
|
|
@@ -3510,10 +5494,11 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3510
5494
|
}
|
|
3511
5495
|
}
|
|
3512
5496
|
},
|
|
3513
|
-
|
|
5497
|
+
showError: !!itemErrors[kpi.id]?.value,
|
|
5498
|
+
errorMessage: itemErrors[kpi.id]?.value
|
|
3514
5499
|
}
|
|
3515
5500
|
),
|
|
3516
|
-
/* @__PURE__ */ (0,
|
|
5501
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3517
5502
|
InputField,
|
|
3518
5503
|
{
|
|
3519
5504
|
value: kpi.unit,
|
|
@@ -3522,22 +5507,23 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3522
5507
|
(item) => item.id === kpi.id ? { ...item, unit: value ?? "" } : item
|
|
3523
5508
|
)
|
|
3524
5509
|
),
|
|
3525
|
-
|
|
5510
|
+
showError: !!itemErrors[kpi.id]?.unit,
|
|
5511
|
+
errorMessage: itemErrors[kpi.id]?.unit
|
|
3526
5512
|
}
|
|
3527
5513
|
),
|
|
3528
|
-
/* @__PURE__ */ (0,
|
|
5514
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3529
5515
|
"div",
|
|
3530
5516
|
{
|
|
3531
5517
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.value || !!itemErrors[kpi.id]?.unit || !!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3532
5518
|
children: [
|
|
3533
|
-
/* @__PURE__ */ (0,
|
|
5519
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3534
5520
|
import_icons_react11.IconCheck,
|
|
3535
5521
|
{
|
|
3536
5522
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3537
5523
|
onClick: () => handleSave(kpi.id, type)
|
|
3538
5524
|
}
|
|
3539
5525
|
),
|
|
3540
|
-
/* @__PURE__ */ (0,
|
|
5526
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3541
5527
|
import_icons_react11.IconX,
|
|
3542
5528
|
{
|
|
3543
5529
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
@@ -3547,19 +5533,19 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3547
5533
|
]
|
|
3548
5534
|
}
|
|
3549
5535
|
)
|
|
3550
|
-
] }) : /* @__PURE__ */ (0,
|
|
3551
|
-
/* @__PURE__ */ (0,
|
|
3552
|
-
/* @__PURE__ */ (0,
|
|
3553
|
-
/* @__PURE__ */ (0,
|
|
3554
|
-
/* @__PURE__ */ (0,
|
|
3555
|
-
/* @__PURE__ */ (0,
|
|
5536
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5537
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "body-1", children: kpi.name }),
|
|
5538
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "body-1", children: kpi.value }),
|
|
5539
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "body-1", children: kpi.unit }),
|
|
5540
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex gap-3 justify-end", children: [
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3556
5542
|
import_icons_react11.IconPencil,
|
|
3557
5543
|
{
|
|
3558
5544
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3559
5545
|
onClick: () => handleEdit(kpi.id)
|
|
3560
5546
|
}
|
|
3561
5547
|
),
|
|
3562
|
-
/* @__PURE__ */ (0,
|
|
5548
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3563
5549
|
import_icons_react11.IconTrash,
|
|
3564
5550
|
{
|
|
3565
5551
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
@@ -3573,24 +5559,26 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3573
5559
|
kpi.id
|
|
3574
5560
|
)) })
|
|
3575
5561
|
] }),
|
|
3576
|
-
type === "text" && /* @__PURE__ */ (0,
|
|
3577
|
-
/* @__PURE__ */ (0,
|
|
3578
|
-
/* @__PURE__ */ (0,
|
|
5562
|
+
type === "text" && /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "space-y-4", children: [
|
|
5563
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "grid grid-cols-[1fr_50px] w-full gap-[24px] items-start", children: [
|
|
5564
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3579
5565
|
InputField,
|
|
3580
5566
|
{
|
|
3581
5567
|
value: nameKpi,
|
|
3582
|
-
|
|
5568
|
+
title: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
|
|
3583
5569
|
placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
|
|
5570
|
+
require: true,
|
|
3584
5571
|
onChange: (value) => setNameKpi(value ?? ""),
|
|
3585
5572
|
className: "h-[32px]",
|
|
3586
|
-
|
|
5573
|
+
showError: !!errors.nameKpi,
|
|
5574
|
+
errorMessage: errors.nameKpi
|
|
3587
5575
|
}
|
|
3588
5576
|
),
|
|
3589
|
-
/* @__PURE__ */ (0,
|
|
5577
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3590
5578
|
"div",
|
|
3591
5579
|
{
|
|
3592
5580
|
className: `flex justify-end mt-[28px]`,
|
|
3593
|
-
children: /* @__PURE__ */ (0,
|
|
5581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3594
5582
|
import_icons_react11.IconCirclePlus,
|
|
3595
5583
|
{
|
|
3596
5584
|
className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
|
|
@@ -3601,17 +5589,17 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3601
5589
|
}
|
|
3602
5590
|
)
|
|
3603
5591
|
] }),
|
|
3604
|
-
/* @__PURE__ */ (0,
|
|
5592
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3605
5593
|
"div",
|
|
3606
5594
|
{
|
|
3607
5595
|
className: "grid grid-cols-[30px_1fr_80px] items-start py-2 body-1 gap-[8px]",
|
|
3608
5596
|
children: [
|
|
3609
|
-
/* @__PURE__ */ (0,
|
|
5597
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
|
|
3610
5598
|
index + 1,
|
|
3611
5599
|
"."
|
|
3612
5600
|
] }),
|
|
3613
|
-
kpi.isEditing ? /* @__PURE__ */ (0,
|
|
3614
|
-
/* @__PURE__ */ (0,
|
|
5601
|
+
kpi.isEditing ? /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5602
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3615
5603
|
InputField,
|
|
3616
5604
|
{
|
|
3617
5605
|
value: kpi.name,
|
|
@@ -3620,22 +5608,23 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3620
5608
|
(item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item
|
|
3621
5609
|
)
|
|
3622
5610
|
),
|
|
3623
|
-
|
|
5611
|
+
showError: !!itemErrors[kpi.id]?.name,
|
|
5612
|
+
errorMessage: itemErrors[kpi.id]?.name
|
|
3624
5613
|
}
|
|
3625
5614
|
),
|
|
3626
|
-
/* @__PURE__ */ (0,
|
|
5615
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
3627
5616
|
"div",
|
|
3628
5617
|
{
|
|
3629
5618
|
className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
|
|
3630
5619
|
children: [
|
|
3631
|
-
/* @__PURE__ */ (0,
|
|
5620
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3632
5621
|
import_icons_react11.IconCheck,
|
|
3633
5622
|
{
|
|
3634
5623
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3635
5624
|
onClick: () => handleSave(kpi.id, type)
|
|
3636
5625
|
}
|
|
3637
5626
|
),
|
|
3638
|
-
/* @__PURE__ */ (0,
|
|
5627
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3639
5628
|
import_icons_react11.IconX,
|
|
3640
5629
|
{
|
|
3641
5630
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
@@ -3645,17 +5634,17 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3645
5634
|
]
|
|
3646
5635
|
}
|
|
3647
5636
|
)
|
|
3648
|
-
] }) : /* @__PURE__ */ (0,
|
|
3649
|
-
/* @__PURE__ */ (0,
|
|
3650
|
-
/* @__PURE__ */ (0,
|
|
3651
|
-
/* @__PURE__ */ (0,
|
|
5637
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
|
|
5638
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "body-1", children: kpi.name }),
|
|
5639
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "flex gap-3 justify-end", children: [
|
|
5640
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3652
5641
|
import_icons_react11.IconPencil,
|
|
3653
5642
|
{
|
|
3654
5643
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
3655
5644
|
onClick: () => handleEdit(kpi.id)
|
|
3656
5645
|
}
|
|
3657
5646
|
),
|
|
3658
|
-
/* @__PURE__ */ (0,
|
|
5647
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
3659
5648
|
import_icons_react11.IconTrash,
|
|
3660
5649
|
{
|
|
3661
5650
|
className: "w-[30px] h-[30px] cursor-pointer",
|
|
@@ -3689,7 +5678,6 @@ function KpiSection({ type, onChangeKpiList }) {
|
|
|
3689
5678
|
GhostButton,
|
|
3690
5679
|
HeadingPage,
|
|
3691
5680
|
InputField,
|
|
3692
|
-
InputFieldNumber,
|
|
3693
5681
|
KpiSection,
|
|
3694
5682
|
Loader,
|
|
3695
5683
|
MenuNavBar,
|