@esic-lab/data-core-ui 0.0.20 → 0.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1118,7 +1118,8 @@ function InputField({
1118
1118
  addonBefore,
1119
1119
  addonAfter,
1120
1120
  defaultValue,
1121
- className
1121
+ className,
1122
+ onClear
1122
1123
  }) {
1123
1124
  return /* @__PURE__ */ jsx18(
1124
1125
  ConfigProvider2,
@@ -1145,7 +1146,8 @@ function InputField({
1145
1146
  allowClear: true,
1146
1147
  addonBefore,
1147
1148
  addonAfter,
1148
- defaultValue
1149
+ defaultValue,
1150
+ onClear
1149
1151
  }
1150
1152
  ),
1151
1153
  /* @__PURE__ */ jsxs14("div", { children: [
@@ -2232,7 +2234,8 @@ function ColorPalettePickerBasic({
2232
2234
  allowClear,
2233
2235
  defaultFormat,
2234
2236
  className,
2235
- placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35"
2237
+ placeholder = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E2A\u0E35",
2238
+ onClear
2236
2239
  }) {
2237
2240
  const { token } = theme.useToken();
2238
2241
  const presets = genPresets({
@@ -2276,7 +2279,8 @@ function ColorPalettePickerBasic({
2276
2279
  ")"
2277
2280
  ] });
2278
2281
  },
2279
- disabled
2282
+ disabled,
2283
+ onClear
2280
2284
  }
2281
2285
  ),
2282
2286
  /* @__PURE__ */ jsxs21("div", { children: [
@@ -2308,7 +2312,8 @@ function SelectField({
2308
2312
  prefix,
2309
2313
  prefixSize = 20,
2310
2314
  handleSearch,
2311
- className
2315
+ className,
2316
+ onClear
2312
2317
  }) {
2313
2318
  return /* @__PURE__ */ jsx26(
2314
2319
  ConfigProvider10,
@@ -2341,7 +2346,8 @@ function SelectField({
2341
2346
  mode,
2342
2347
  onSearch: handleSearch,
2343
2348
  prefix: prefix ? /* @__PURE__ */ jsx26("span", { style: { width: prefixSize, height: prefixSize, display: "flex", alignItems: "center", justifyContent: "center" }, children: prefix }) : void 0,
2344
- allowClear: true
2349
+ allowClear: true,
2350
+ onClear
2345
2351
  }
2346
2352
  ),
2347
2353
  /* @__PURE__ */ jsxs22("div", { children: [
@@ -2492,7 +2498,8 @@ function SelectFieldStatus({
2492
2498
  placeholder,
2493
2499
  optionFilterProp: "label",
2494
2500
  filterOption: (input, option) => (option?.label ?? "").toString().toLowerCase().includes(input.toLowerCase()),
2495
- options
2501
+ options,
2502
+ showSearch: true
2496
2503
  }
2497
2504
  ),
2498
2505
  /* @__PURE__ */ jsxs24("div", { children: [
@@ -2527,7 +2534,8 @@ function SelectFieldStatusReport({
2527
2534
  disabled,
2528
2535
  showError,
2529
2536
  errorMessage,
2530
- className
2537
+ className,
2538
+ options
2531
2539
  }) {
2532
2540
  const selectedItem = status2.find((s) => s.value === value);
2533
2541
  return /* @__PURE__ */ jsx29(
@@ -2562,12 +2570,9 @@ function SelectFieldStatusReport({
2562
2570
  className: `body-3 custom-select flex justify-center w-full ${className ?? ""}`,
2563
2571
  placeholder,
2564
2572
  optionFilterProp: "label",
2565
- filterSort: (optionA, optionB) => (optionA?.label ?? "").toLowerCase().localeCompare((optionB?.label ?? "").toLowerCase()),
2566
- options: status2.map((s) => ({
2567
- value: s.value,
2568
- label: s.label,
2569
- color: s.color
2570
- }))
2573
+ filterOption: (input, option) => (option?.label ?? "").toString().toLowerCase().includes(input.toLowerCase()),
2574
+ options,
2575
+ showSearch: true
2571
2576
  }
2572
2577
  ),
2573
2578
  /* @__PURE__ */ jsxs25("div", { children: [
@@ -2594,7 +2599,8 @@ function SelectFieldTag({
2594
2599
  errorMessage,
2595
2600
  value: controlledValue,
2596
2601
  className,
2597
- onChange
2602
+ onChange,
2603
+ onClear
2598
2604
  }) {
2599
2605
  const [internalValue, setInternalValue] = useState6([]);
2600
2606
  const isControlled = controlledValue !== void 0;
@@ -2646,7 +2652,8 @@ function SelectFieldTag({
2646
2652
  },
2647
2653
  searchValue: searchWord,
2648
2654
  options,
2649
- allowClear: true
2655
+ allowClear: true,
2656
+ onClear
2650
2657
  }
2651
2658
  ),
2652
2659
  /* @__PURE__ */ jsxs26("div", { children: [
@@ -3089,6 +3096,479 @@ function ProgressBar({
3089
3096
  }
3090
3097
  );
3091
3098
  }
3099
+
3100
+ // src/KpiSection/KpiSection.tsx
3101
+ import { ConfigProvider as ConfigProvider19, message } from "antd";
3102
+ import { useEffect as useEffect3, useState as useState11 } from "react";
3103
+
3104
+ // src/KpiSection/hooks/useGetKpiSection.ts
3105
+ import { useState as useState10 } from "react";
3106
+ import cuid from "cuid";
3107
+ function useGetKpiSection() {
3108
+ const [nameKpi, setNameKpi] = useState10("");
3109
+ const [kpiValue, setKpiValue] = useState10("");
3110
+ const [unitValue, setUnitValue] = useState10("");
3111
+ const [kpiList, setKpiList] = useState10([]);
3112
+ const [editingBackup, setEditingBackup] = useState10({});
3113
+ const [selected, setSelected] = useState10("2");
3114
+ const [errors, setErrors] = useState10({
3115
+ nameKpi: "",
3116
+ kpiValue: "",
3117
+ unitValue: ""
3118
+ });
3119
+ const [itemErrors, setItemErrors] = useState10({});
3120
+ const options = [
3121
+ { value: "1", label: "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" },
3122
+ { value: "2", label: "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }
3123
+ ];
3124
+ const handleAddKpi = (type) => {
3125
+ let newErrors = { nameKpi: "", kpiValue: "", unitValue: "" };
3126
+ let hasError = false;
3127
+ if (!nameKpi) {
3128
+ newErrors.nameKpi = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
3129
+ hasError = true;
3130
+ }
3131
+ if (type === "number") {
3132
+ if (!kpiValue) {
3133
+ newErrors.kpiValue = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
3134
+ hasError = true;
3135
+ }
3136
+ if (!unitValue) {
3137
+ newErrors.unitValue = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
3138
+ hasError = true;
3139
+ }
3140
+ }
3141
+ setErrors(newErrors);
3142
+ if (hasError) return;
3143
+ const newKpi = {
3144
+ id: cuid(),
3145
+ name: nameKpi,
3146
+ value: kpiValue,
3147
+ unit: unitValue,
3148
+ isEditing: false
3149
+ };
3150
+ setKpiList([...kpiList, newKpi]);
3151
+ setNameKpi("");
3152
+ setKpiValue("");
3153
+ setUnitValue("");
3154
+ setErrors({ nameKpi: "", kpiValue: "", unitValue: "" });
3155
+ };
3156
+ const handleEdit = (id) => {
3157
+ const current = kpiList.find((kpi) => kpi.id === id);
3158
+ if (current) {
3159
+ setEditingBackup((prev) => ({ ...prev, [id]: { ...current } }));
3160
+ }
3161
+ setKpiList(
3162
+ (prev) => prev.map((item) => item.id === id ? { ...item, isEditing: true } : item)
3163
+ );
3164
+ };
3165
+ const handleSave = (id, type) => {
3166
+ setKpiList((prev) => {
3167
+ return prev.map((item) => {
3168
+ if (item.id === id) {
3169
+ let hasError = false;
3170
+ const errorsForItem = {};
3171
+ if (!item.name) {
3172
+ errorsForItem.name = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
3173
+ hasError = true;
3174
+ }
3175
+ if (type === "number") {
3176
+ if (!item.value) {
3177
+ errorsForItem.value = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
3178
+ hasError = true;
3179
+ }
3180
+ if (!item.unit) {
3181
+ errorsForItem.unit = "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38";
3182
+ hasError = true;
3183
+ }
3184
+ }
3185
+ if (hasError) {
3186
+ setItemErrors((prev2) => ({ ...prev2, [id]: errorsForItem }));
3187
+ return item;
3188
+ }
3189
+ setItemErrors((prev2) => {
3190
+ const copy = { ...prev2 };
3191
+ delete copy[id];
3192
+ return copy;
3193
+ });
3194
+ return { ...item, isEditing: false };
3195
+ }
3196
+ return item;
3197
+ });
3198
+ });
3199
+ };
3200
+ const handleCancel = (id) => {
3201
+ const backup = editingBackup[id];
3202
+ if (backup) {
3203
+ setKpiList(
3204
+ (prev) => prev.map(
3205
+ (item) => item.id === id ? { ...backup, isEditing: false } : item
3206
+ )
3207
+ );
3208
+ setEditingBackup((prev) => {
3209
+ const copy = { ...prev };
3210
+ delete copy[id];
3211
+ return copy;
3212
+ });
3213
+ } else {
3214
+ setKpiList(
3215
+ (prev) => prev.map(
3216
+ (item) => item.id === id ? { ...item, isEditing: false } : item
3217
+ )
3218
+ );
3219
+ }
3220
+ };
3221
+ const handleDelete = (id) => {
3222
+ setKpiList((prev) => prev.filter((item) => item.id !== id));
3223
+ };
3224
+ return {
3225
+ handleAddKpi,
3226
+ handleEdit,
3227
+ handleSave,
3228
+ handleCancel,
3229
+ handleDelete,
3230
+ nameKpi,
3231
+ setNameKpi,
3232
+ kpiValue,
3233
+ setKpiValue,
3234
+ unitValue,
3235
+ setUnitValue,
3236
+ kpiList,
3237
+ setKpiList,
3238
+ editingBackup,
3239
+ setEditingBackup,
3240
+ options,
3241
+ selected,
3242
+ setSelected,
3243
+ errors,
3244
+ setErrors,
3245
+ itemErrors,
3246
+ setItemErrors
3247
+ };
3248
+ }
3249
+
3250
+ // src/KpiSection/KpiSection.tsx
3251
+ import {
3252
+ IconCheck as IconCheck2,
3253
+ IconCirclePlus,
3254
+ IconPencil,
3255
+ IconTrash as IconTrash2,
3256
+ IconX as IconX2
3257
+ } from "@tabler/icons-react";
3258
+ import { Fragment as Fragment6, jsx as jsx36, jsxs as jsxs31 } from "react/jsx-runtime";
3259
+ function KpiSection({ type, onChangeKpiList }) {
3260
+ const {
3261
+ handleAddKpi,
3262
+ handleEdit,
3263
+ handleSave,
3264
+ handleCancel,
3265
+ handleDelete,
3266
+ nameKpi,
3267
+ setNameKpi,
3268
+ kpiValue,
3269
+ setKpiValue,
3270
+ unitValue,
3271
+ setUnitValue,
3272
+ kpiList,
3273
+ setKpiList,
3274
+ errors,
3275
+ itemErrors,
3276
+ setItemErrors
3277
+ } = useGetKpiSection();
3278
+ const [messageApi2, messageContainer] = message.useMessage();
3279
+ const [hasShownError, setHasShownError] = useState11(false);
3280
+ useEffect3(() => {
3281
+ setMessageApi(messageApi2);
3282
+ }, [messageApi2]);
3283
+ useEffect3(() => {
3284
+ if (onChangeKpiList) {
3285
+ onChangeKpiList(kpiList);
3286
+ }
3287
+ }, [kpiList]);
3288
+ return /* @__PURE__ */ jsx36(
3289
+ ConfigProvider19,
3290
+ {
3291
+ theme: {
3292
+ token: {
3293
+ fontFamily: "Kanit",
3294
+ fontSize: 16
3295
+ }
3296
+ },
3297
+ children: /* @__PURE__ */ jsxs31("div", { className: "container-input", children: [
3298
+ messageContainer,
3299
+ type === "number" && /* @__PURE__ */ jsxs31("div", { className: "space-y-4", children: [
3300
+ /* @__PURE__ */ jsxs31("div", { className: "grid grid-cols-[1fr_200px_200px_50px] w-full gap-[24px] items-start", children: [
3301
+ /* @__PURE__ */ jsx36(
3302
+ InputField,
3303
+ {
3304
+ value: nameKpi,
3305
+ title: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
3306
+ placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
3307
+ require: true,
3308
+ onChange: (value) => setNameKpi(value ?? ""),
3309
+ className: "h-[32px]",
3310
+ showError: !!errors.nameKpi,
3311
+ errorMessage: errors.nameKpi
3312
+ }
3313
+ ),
3314
+ /* @__PURE__ */ jsx36(
3315
+ InputField,
3316
+ {
3317
+ value: kpiValue,
3318
+ title: "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
3319
+ placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
3320
+ require: true,
3321
+ onChange: (value) => {
3322
+ if (value === void 0 || value === "") {
3323
+ setKpiValue("");
3324
+ setHasShownError(false);
3325
+ } else if (/^\d*\.?\d*$/.test(value)) {
3326
+ setKpiValue(value);
3327
+ setHasShownError(false);
3328
+ } else {
3329
+ if (!hasShownError) {
3330
+ messageError("\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E40\u0E17\u0E48\u0E32\u0E19\u0E31\u0E49\u0E19");
3331
+ setHasShownError(true);
3332
+ }
3333
+ }
3334
+ },
3335
+ showError: !!errors.kpiValue,
3336
+ errorMessage: errors.kpiValue
3337
+ }
3338
+ ),
3339
+ /* @__PURE__ */ jsx36(
3340
+ InputField,
3341
+ {
3342
+ value: unitValue,
3343
+ title: "\u0E2B\u0E19\u0E48\u0E27\u0E22",
3344
+ placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
3345
+ require: true,
3346
+ onChange: (value) => setUnitValue(value ?? ""),
3347
+ className: "h-[32px]",
3348
+ showError: !!errors.unitValue,
3349
+ errorMessage: errors.unitValue
3350
+ }
3351
+ ),
3352
+ /* @__PURE__ */ jsx36("div", { className: "absolute top-21 right-5", children: /* @__PURE__ */ jsx36(
3353
+ IconCirclePlus,
3354
+ {
3355
+ className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
3356
+ stroke: 1,
3357
+ onClick: () => handleAddKpi(type)
3358
+ }
3359
+ ) })
3360
+ ] }),
3361
+ /* @__PURE__ */ jsx36("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ jsxs31(
3362
+ "div",
3363
+ {
3364
+ className: "grid grid-cols-[30px_1fr_100px_120px_80px] items-start py-2 body-1 gap-[8px]",
3365
+ children: [
3366
+ /* @__PURE__ */ jsxs31("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
3367
+ index + 1,
3368
+ "."
3369
+ ] }),
3370
+ kpi.isEditing ? /* @__PURE__ */ jsxs31(Fragment6, { children: [
3371
+ /* @__PURE__ */ jsx36(
3372
+ InputField,
3373
+ {
3374
+ value: kpi.name,
3375
+ onChange: (value) => setKpiList(
3376
+ (prev) => prev.map(
3377
+ (item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item
3378
+ )
3379
+ ),
3380
+ showError: !!itemErrors[kpi.id]?.name,
3381
+ errorMessage: itemErrors[kpi.id]?.name
3382
+ }
3383
+ ),
3384
+ /* @__PURE__ */ jsx36(
3385
+ InputField,
3386
+ {
3387
+ value: kpi.value?.toString(),
3388
+ onChange: (value) => {
3389
+ if (value === void 0 || value === "") {
3390
+ setKpiList(
3391
+ (prev) => prev.map(
3392
+ (item) => item.id === kpi.id ? { ...item, value: "" } : item
3393
+ )
3394
+ );
3395
+ setHasShownError(false);
3396
+ } else if (/^\d*\.?\d*$/.test(value)) {
3397
+ setKpiList(
3398
+ (prev) => prev.map(
3399
+ (item) => item.id === kpi.id ? { ...item, value } : item
3400
+ )
3401
+ );
3402
+ setHasShownError(false);
3403
+ } else {
3404
+ if (!hasShownError) {
3405
+ messageError("\u0E01\u0E23\u0E38\u0E13\u0E32\u0E01\u0E23\u0E2D\u0E01\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E40\u0E17\u0E48\u0E32\u0E19\u0E31\u0E49\u0E19");
3406
+ setHasShownError(true);
3407
+ }
3408
+ }
3409
+ },
3410
+ showError: !!itemErrors[kpi.id]?.value,
3411
+ errorMessage: itemErrors[kpi.id]?.value
3412
+ }
3413
+ ),
3414
+ /* @__PURE__ */ jsx36(
3415
+ InputField,
3416
+ {
3417
+ value: kpi.unit,
3418
+ onChange: (value) => setKpiList(
3419
+ (prev) => prev.map(
3420
+ (item) => item.id === kpi.id ? { ...item, unit: value ?? "" } : item
3421
+ )
3422
+ ),
3423
+ showError: !!itemErrors[kpi.id]?.unit,
3424
+ errorMessage: itemErrors[kpi.id]?.unit
3425
+ }
3426
+ ),
3427
+ /* @__PURE__ */ jsxs31(
3428
+ "div",
3429
+ {
3430
+ className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.value || !!itemErrors[kpi.id]?.unit || !!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
3431
+ children: [
3432
+ /* @__PURE__ */ jsx36(
3433
+ IconCheck2,
3434
+ {
3435
+ className: "w-[30px] h-[30px] cursor-pointer",
3436
+ onClick: () => handleSave(kpi.id, type)
3437
+ }
3438
+ ),
3439
+ /* @__PURE__ */ jsx36(
3440
+ IconX2,
3441
+ {
3442
+ className: "w-[30px] h-[30px] cursor-pointer",
3443
+ onClick: () => handleCancel(kpi.id)
3444
+ }
3445
+ )
3446
+ ]
3447
+ }
3448
+ )
3449
+ ] }) : /* @__PURE__ */ jsxs31(Fragment6, { children: [
3450
+ /* @__PURE__ */ jsx36("p", { className: "body-1", children: kpi.name }),
3451
+ /* @__PURE__ */ jsx36("p", { className: "body-1", children: kpi.value }),
3452
+ /* @__PURE__ */ jsx36("p", { className: "body-1", children: kpi.unit }),
3453
+ /* @__PURE__ */ jsxs31("div", { className: "flex gap-3 justify-end", children: [
3454
+ /* @__PURE__ */ jsx36(
3455
+ IconPencil,
3456
+ {
3457
+ className: "w-[30px] h-[30px] cursor-pointer",
3458
+ onClick: () => handleEdit(kpi.id)
3459
+ }
3460
+ ),
3461
+ /* @__PURE__ */ jsx36(
3462
+ IconTrash2,
3463
+ {
3464
+ className: "w-[30px] h-[30px] cursor-pointer",
3465
+ onClick: () => handleDelete(kpi.id)
3466
+ }
3467
+ )
3468
+ ] })
3469
+ ] })
3470
+ ]
3471
+ },
3472
+ kpi.id
3473
+ )) })
3474
+ ] }),
3475
+ type === "text" && /* @__PURE__ */ jsxs31("div", { className: "space-y-4", children: [
3476
+ /* @__PURE__ */ jsxs31("div", { className: "grid grid-cols-[1fr_50px] w-full gap-[24px] items-start", children: [
3477
+ /* @__PURE__ */ jsx36(
3478
+ InputField,
3479
+ {
3480
+ value: nameKpi,
3481
+ title: "\u0E0A\u0E37\u0E48\u0E2D\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C\u0E17\u0E35\u0E48\u0E04\u0E32\u0E14\u0E2B\u0E27\u0E31\u0E07 (KPI)",
3482
+ placeholder: "\u0E42\u0E1B\u0E23\u0E14\u0E23\u0E30\u0E1A\u0E38",
3483
+ require: true,
3484
+ onChange: (value) => setNameKpi(value ?? ""),
3485
+ className: "h-[32px]",
3486
+ showError: !!errors.nameKpi,
3487
+ errorMessage: errors.nameKpi
3488
+ }
3489
+ ),
3490
+ /* @__PURE__ */ jsx36("div", { className: "absolute top-21 right-5", children: /* @__PURE__ */ jsx36(
3491
+ IconCirclePlus,
3492
+ {
3493
+ className: "w-[40px] h-[40px] cursor-pointer hover:scale-110 transition",
3494
+ stroke: 1,
3495
+ onClick: () => handleAddKpi(type)
3496
+ }
3497
+ ) })
3498
+ ] }),
3499
+ /* @__PURE__ */ jsx36("div", { children: kpiList.map((kpi, index) => /* @__PURE__ */ jsxs31(
3500
+ "div",
3501
+ {
3502
+ className: "grid grid-cols-[30px_1fr_80px] items-start py-2 body-1 gap-[8px]",
3503
+ children: [
3504
+ /* @__PURE__ */ jsxs31("p", { className: `body-1 ${kpi.isEditing ? "mt-[12px]" : ""}`, children: [
3505
+ index + 1,
3506
+ "."
3507
+ ] }),
3508
+ kpi.isEditing ? /* @__PURE__ */ jsxs31(Fragment6, { children: [
3509
+ /* @__PURE__ */ jsx36(
3510
+ InputField,
3511
+ {
3512
+ value: kpi.name,
3513
+ onChange: (value) => setKpiList(
3514
+ (prev) => prev.map(
3515
+ (item) => item.id === kpi.id ? { ...item, name: value ?? "" } : item
3516
+ )
3517
+ ),
3518
+ showError: !!itemErrors[kpi.id]?.name,
3519
+ errorMessage: itemErrors[kpi.id]?.name
3520
+ }
3521
+ ),
3522
+ /* @__PURE__ */ jsxs31(
3523
+ "div",
3524
+ {
3525
+ className: `flex gap-2 justify-end self-center ${!!itemErrors[kpi.id]?.name ? "mt-[-12px]" : ""}`,
3526
+ children: [
3527
+ /* @__PURE__ */ jsx36(
3528
+ IconCheck2,
3529
+ {
3530
+ className: "w-[30px] h-[30px] cursor-pointer",
3531
+ onClick: () => handleSave(kpi.id, type)
3532
+ }
3533
+ ),
3534
+ /* @__PURE__ */ jsx36(
3535
+ IconX2,
3536
+ {
3537
+ className: "w-[30px] h-[30px] cursor-pointer",
3538
+ onClick: () => handleCancel(kpi.id)
3539
+ }
3540
+ )
3541
+ ]
3542
+ }
3543
+ )
3544
+ ] }) : /* @__PURE__ */ jsxs31(Fragment6, { children: [
3545
+ /* @__PURE__ */ jsx36("p", { className: "body-1", children: kpi.name }),
3546
+ /* @__PURE__ */ jsxs31("div", { className: "flex gap-3 justify-end", children: [
3547
+ /* @__PURE__ */ jsx36(
3548
+ IconPencil,
3549
+ {
3550
+ className: "w-[30px] h-[30px] cursor-pointer",
3551
+ onClick: () => handleEdit(kpi.id)
3552
+ }
3553
+ ),
3554
+ /* @__PURE__ */ jsx36(
3555
+ IconTrash2,
3556
+ {
3557
+ className: "w-[30px] h-[30px] cursor-pointer",
3558
+ onClick: () => handleDelete(kpi.id)
3559
+ }
3560
+ )
3561
+ ] })
3562
+ ] })
3563
+ ]
3564
+ },
3565
+ kpi.id
3566
+ )) })
3567
+ ] })
3568
+ ] })
3569
+ }
3570
+ );
3571
+ }
3092
3572
  export {
3093
3573
  AntDataTable,
3094
3574
  Breadcrumbs,
@@ -3104,6 +3584,7 @@ export {
3104
3584
  GhostButton,
3105
3585
  HeadingPage,
3106
3586
  InputField,
3587
+ KpiSection,
3107
3588
  Loader,
3108
3589
  MenuNavBar,
3109
3590
  PrimaryButton,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esic-lab/data-core-ui",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -64,8 +64,9 @@
64
64
  "@tabler/icons-react": "^3.35.0",
65
65
  "antd": "^5.27.3",
66
66
  "classnames": "^2.5.1",
67
- "fullcalendar": "^6.1.19",
67
+ "cuid": "^3.0.0",
68
68
  "d3": "^7.9.0",
69
+ "fullcalendar": "^6.1.19",
69
70
  "qrcode": "^1.5.4"
70
71
  },
71
72
  "publishConfig": {