react-table-edit 0.6.8 → 0.7.0
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +252 -337
- package/dist/index.mjs +189 -274
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3,8 +3,6 @@ import { Fragment as Fragment17, forwardRef as forwardRef3, useEffect as useEffe
|
|
|
3
3
|
import { Button as Button5, DropdownMenu as DropdownMenu3, DropdownToggle as DropdownToggle3, Input as Input8, UncontrolledDropdown, UncontrolledTooltip as UncontrolledTooltip3 } from "reactstrap";
|
|
4
4
|
import classnames9 from "classnames";
|
|
5
5
|
import { useTranslation as useTranslation12 } from "react-i18next";
|
|
6
|
-
import Select3 from "react-select";
|
|
7
|
-
import AsyncSelect from "react-select/async";
|
|
8
6
|
import { AlertCircle, Info as Info2, Settings } from "becoxy-icons";
|
|
9
7
|
|
|
10
8
|
// test-app/src/component/react-input/index.tsx
|
|
@@ -277,21 +275,6 @@ var roundNumber = (num, fraction) => {
|
|
|
277
275
|
return result;
|
|
278
276
|
};
|
|
279
277
|
|
|
280
|
-
// test-app/src/component/icon/index.tsx
|
|
281
|
-
import * as Icon from "becoxy-icons";
|
|
282
|
-
import { Fragment as Fragment3 } from "react";
|
|
283
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
284
|
-
var IconCustom = (props) => {
|
|
285
|
-
const { iconName, size } = props;
|
|
286
|
-
if (iconName === "") {
|
|
287
|
-
return null;
|
|
288
|
-
} else {
|
|
289
|
-
const TagIcon = iconName === "" ? "" : Icon[iconName];
|
|
290
|
-
return /* @__PURE__ */ jsx3(Fragment3, { children: iconName === "" ? "" : /* @__PURE__ */ jsx3(TagIcon, { fontSize: size }) });
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
var icon_default = IconCustom;
|
|
294
|
-
|
|
295
278
|
// test-app/src/component/table/index.tsx
|
|
296
279
|
import moment2 from "moment";
|
|
297
280
|
|
|
@@ -317,28 +300,28 @@ import classNames2 from "classnames";
|
|
|
317
300
|
import { Controller } from "react-hook-form";
|
|
318
301
|
import { Input as Input2, Label, FormFeedback } from "reactstrap";
|
|
319
302
|
import classnames from "classnames";
|
|
320
|
-
import { Fragment as
|
|
303
|
+
import { Fragment as Fragment3 } from "react";
|
|
321
304
|
import { useTranslation } from "react-i18next";
|
|
322
|
-
import { jsx as
|
|
305
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
323
306
|
var TextInput = (props) => {
|
|
324
307
|
const { t } = useTranslation();
|
|
325
308
|
const { control, id, name, min, max, type, label, labelSize, required, errors, height, disabled, row, isLabel, placeholder, autoFocus, inLine, callback, readOnly, classes, ...rest } = props;
|
|
326
309
|
const renderLabel = () => {
|
|
327
|
-
return /* @__PURE__ */
|
|
310
|
+
return /* @__PURE__ */ jsx3(Fragment3, { children: isLabel === false ? "" : /* @__PURE__ */ jsxs3(Label, { for: name, children: [
|
|
328
311
|
t(label ? label : ""),
|
|
329
312
|
" ",
|
|
330
|
-
required ? /* @__PURE__ */
|
|
313
|
+
required ? /* @__PURE__ */ jsx3("span", { className: "text-danger", children: "*" }) : "",
|
|
331
314
|
" "
|
|
332
315
|
] }) });
|
|
333
316
|
};
|
|
334
317
|
const renderInput = () => {
|
|
335
|
-
return /* @__PURE__ */ jsxs3(
|
|
336
|
-
/* @__PURE__ */
|
|
318
|
+
return /* @__PURE__ */ jsxs3(Fragment3, { children: [
|
|
319
|
+
/* @__PURE__ */ jsx3(
|
|
337
320
|
Controller,
|
|
338
321
|
{
|
|
339
322
|
name,
|
|
340
323
|
control,
|
|
341
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */
|
|
324
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ jsx3(
|
|
342
325
|
Input2,
|
|
343
326
|
{
|
|
344
327
|
id,
|
|
@@ -380,10 +363,10 @@ var TextInput = (props) => {
|
|
|
380
363
|
)
|
|
381
364
|
}
|
|
382
365
|
),
|
|
383
|
-
errors && /* @__PURE__ */
|
|
366
|
+
errors && /* @__PURE__ */ jsx3(FormFeedback, { children: errors?.message })
|
|
384
367
|
] });
|
|
385
368
|
};
|
|
386
|
-
return /* @__PURE__ */
|
|
369
|
+
return /* @__PURE__ */ jsx3(Fragment3, { children: /* @__PURE__ */ jsxs3(
|
|
387
370
|
"div",
|
|
388
371
|
{
|
|
389
372
|
className: classnames(
|
|
@@ -397,7 +380,7 @@ var TextInput = (props) => {
|
|
|
397
380
|
),
|
|
398
381
|
children: [
|
|
399
382
|
renderLabel(),
|
|
400
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ jsx3("div", { className: classnames("form-input-content", { "hidden-label": isLabel === false }), children: renderInput() })
|
|
401
384
|
]
|
|
402
385
|
}
|
|
403
386
|
) });
|
|
@@ -409,9 +392,9 @@ import { Controller as Controller2 } from "react-hook-form";
|
|
|
409
392
|
import { Label as Label2, FormFeedback as FormFeedback2 } from "reactstrap";
|
|
410
393
|
import Select from "react-select";
|
|
411
394
|
import classnames2 from "classnames";
|
|
412
|
-
import { Fragment as
|
|
395
|
+
import { Fragment as Fragment4 } from "react";
|
|
413
396
|
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
414
|
-
import { jsx as
|
|
397
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
415
398
|
var SelectBox = (props) => {
|
|
416
399
|
const { t } = useTranslation2();
|
|
417
400
|
const { control, id, placeholder, fieldValue, confirmHandle, disabled, name, options, label, isLabel, labelSize, classes, required, errors, isMulti, isClearable, labelComponent, callback, inLine, onInputChange, ref, menuPosition, ...rest } = props;
|
|
@@ -422,14 +405,14 @@ var SelectBox = (props) => {
|
|
|
422
405
|
}
|
|
423
406
|
};
|
|
424
407
|
const renderSelect = () => {
|
|
425
|
-
return /* @__PURE__ */ jsxs4(
|
|
426
|
-
/* @__PURE__ */
|
|
408
|
+
return /* @__PURE__ */ jsxs4(Fragment4, { children: [
|
|
409
|
+
/* @__PURE__ */ jsx4(
|
|
427
410
|
Controller2,
|
|
428
411
|
{
|
|
429
412
|
name,
|
|
430
413
|
control,
|
|
431
414
|
render: ({ field: { value, onChange } }) => {
|
|
432
|
-
return /* @__PURE__ */
|
|
415
|
+
return /* @__PURE__ */ jsx4(
|
|
433
416
|
Select,
|
|
434
417
|
{
|
|
435
418
|
...rest,
|
|
@@ -464,10 +447,10 @@ var SelectBox = (props) => {
|
|
|
464
447
|
}
|
|
465
448
|
}
|
|
466
449
|
),
|
|
467
|
-
errors && /* @__PURE__ */
|
|
450
|
+
errors && /* @__PURE__ */ jsx4(FormFeedback2, { children: errors?.message })
|
|
468
451
|
] });
|
|
469
452
|
};
|
|
470
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ jsx4(Fragment4, { children: /* @__PURE__ */ jsxs4(
|
|
471
454
|
"div",
|
|
472
455
|
{
|
|
473
456
|
className: classnames2(
|
|
@@ -483,10 +466,10 @@ var SelectBox = (props) => {
|
|
|
483
466
|
isLabel === false ? "" : /* @__PURE__ */ jsxs4(Label2, { className: "form-label", for: name, children: [
|
|
484
467
|
t(label ? label : ""),
|
|
485
468
|
" ",
|
|
486
|
-
required ? /* @__PURE__ */
|
|
469
|
+
required ? /* @__PURE__ */ jsx4("span", { className: "text-danger", children: "*" }) : "",
|
|
487
470
|
" "
|
|
488
471
|
] }),
|
|
489
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ jsx4("div", { className: classnames2("form-input-content", { "hidden-label": isLabel === false }), children: renderSelect() })
|
|
490
473
|
]
|
|
491
474
|
}
|
|
492
475
|
) });
|
|
@@ -497,14 +480,14 @@ var select_default = SelectBox;
|
|
|
497
480
|
import { Controller as Controller3 } from "react-hook-form";
|
|
498
481
|
import { Label as Label3, FormFeedback as FormFeedback3 } from "reactstrap";
|
|
499
482
|
import classnames3 from "classnames";
|
|
500
|
-
import { Fragment as
|
|
483
|
+
import { Fragment as Fragment5 } from "react";
|
|
501
484
|
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
502
485
|
import CreatableSelect from "react-select/creatable";
|
|
503
|
-
import { jsx as
|
|
486
|
+
import { jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
504
487
|
var CreatableSelectBox = (props) => {
|
|
505
488
|
const { t } = useTranslation3();
|
|
506
489
|
const { isMulti, id, isLabel, control, placeholder, fieldValue, name, options, label, labelSize, required, errors, inLine, isClearable, labelComponent, onInputChange, callback, ...rest } = props;
|
|
507
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ jsx5(Fragment5, { children: /* @__PURE__ */ jsxs5(
|
|
508
491
|
"div",
|
|
509
492
|
{
|
|
510
493
|
className: classnames3(
|
|
@@ -519,16 +502,16 @@ var CreatableSelectBox = (props) => {
|
|
|
519
502
|
isLabel === false ? "" : /* @__PURE__ */ jsxs5(Label3, { className: "form-label", for: name, children: [
|
|
520
503
|
t(label),
|
|
521
504
|
" ",
|
|
522
|
-
required ? /* @__PURE__ */
|
|
505
|
+
required ? /* @__PURE__ */ jsx5("span", { className: "text-danger", children: "*" }) : "",
|
|
523
506
|
" "
|
|
524
507
|
] }),
|
|
525
508
|
/* @__PURE__ */ jsxs5("div", { className: classnames3("form-input-content", { "hidden-label": isLabel === false }), children: [
|
|
526
|
-
/* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ jsx5(
|
|
527
510
|
Controller3,
|
|
528
511
|
{
|
|
529
512
|
name,
|
|
530
513
|
control,
|
|
531
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */
|
|
514
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ jsx5(
|
|
532
515
|
CreatableSelect,
|
|
533
516
|
{
|
|
534
517
|
...rest,
|
|
@@ -556,7 +539,7 @@ var CreatableSelectBox = (props) => {
|
|
|
556
539
|
)
|
|
557
540
|
}
|
|
558
541
|
),
|
|
559
|
-
errors && /* @__PURE__ */
|
|
542
|
+
errors && /* @__PURE__ */ jsx5(FormFeedback3, { children: errors?.message })
|
|
560
543
|
] })
|
|
561
544
|
]
|
|
562
545
|
}
|
|
@@ -568,9 +551,9 @@ var creactable_select_default = CreatableSelectBox;
|
|
|
568
551
|
import { Controller as Controller4 } from "react-hook-form";
|
|
569
552
|
import { Input as Input3, Label as Label4, FormFeedback as FormFeedback4 } from "reactstrap";
|
|
570
553
|
import classnames4 from "classnames";
|
|
571
|
-
import { Fragment as
|
|
554
|
+
import { Fragment as Fragment6 } from "react";
|
|
572
555
|
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
573
|
-
import { jsx as
|
|
556
|
+
import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
574
557
|
var NumberInput = (props) => {
|
|
575
558
|
const { t } = useTranslation4();
|
|
576
559
|
const {
|
|
@@ -600,21 +583,21 @@ var NumberInput = (props) => {
|
|
|
600
583
|
...rest
|
|
601
584
|
} = props;
|
|
602
585
|
const renderLabel = () => {
|
|
603
|
-
return /* @__PURE__ */
|
|
586
|
+
return /* @__PURE__ */ jsx6(Fragment6, { children: isLabel === false ? "" : /* @__PURE__ */ jsxs6(Label4, { className: "form-label", for: name, children: [
|
|
604
587
|
t(label ? label : ""),
|
|
605
588
|
" ",
|
|
606
|
-
required ? /* @__PURE__ */
|
|
589
|
+
required ? /* @__PURE__ */ jsx6("span", { className: "text-danger", children: "*" }) : "",
|
|
607
590
|
" "
|
|
608
591
|
] }) });
|
|
609
592
|
};
|
|
610
593
|
const renderInput = () => {
|
|
611
|
-
return /* @__PURE__ */ jsxs6(
|
|
612
|
-
/* @__PURE__ */
|
|
594
|
+
return /* @__PURE__ */ jsxs6(Fragment6, { children: [
|
|
595
|
+
/* @__PURE__ */ jsx6(
|
|
613
596
|
Controller4,
|
|
614
597
|
{
|
|
615
598
|
name,
|
|
616
599
|
control,
|
|
617
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */
|
|
600
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ jsx6(
|
|
618
601
|
Input3,
|
|
619
602
|
{
|
|
620
603
|
id,
|
|
@@ -674,10 +657,10 @@ var NumberInput = (props) => {
|
|
|
674
657
|
)
|
|
675
658
|
}
|
|
676
659
|
),
|
|
677
|
-
errors && /* @__PURE__ */
|
|
660
|
+
errors && /* @__PURE__ */ jsx6(FormFeedback4, { children: errors?.message })
|
|
678
661
|
] });
|
|
679
662
|
};
|
|
680
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ jsx6(Fragment6, { children: /* @__PURE__ */ jsxs6(
|
|
681
664
|
"div",
|
|
682
665
|
{
|
|
683
666
|
className: classnames4(
|
|
@@ -691,7 +674,7 @@ var NumberInput = (props) => {
|
|
|
691
674
|
),
|
|
692
675
|
children: [
|
|
693
676
|
renderLabel(),
|
|
694
|
-
/* @__PURE__ */
|
|
677
|
+
/* @__PURE__ */ jsx6("div", { className: classnames4("form-input-content", { "hidden-label": isLabel === false }), children: renderInput() })
|
|
695
678
|
]
|
|
696
679
|
}
|
|
697
680
|
) });
|
|
@@ -699,7 +682,7 @@ var NumberInput = (props) => {
|
|
|
699
682
|
var input_number_default = NumberInput;
|
|
700
683
|
|
|
701
684
|
// test-app/src/component/edit-form/index.tsx
|
|
702
|
-
import { Fragment as
|
|
685
|
+
import { Fragment as Fragment7, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
703
686
|
var defaultWidth = 200;
|
|
704
687
|
var EditForm = forwardRef((props, ref) => {
|
|
705
688
|
const {
|
|
@@ -869,9 +852,9 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
869
852
|
}
|
|
870
853
|
};
|
|
871
854
|
const renderForm = (rows) => {
|
|
872
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ jsx7(Row, { className: "gy-25", children: rows.map((item, index) => {
|
|
873
856
|
if (item.type === "numeric") {
|
|
874
|
-
return /* @__PURE__ */
|
|
857
|
+
return /* @__PURE__ */ jsx7(Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ jsx7(
|
|
875
858
|
input_number_default,
|
|
876
859
|
{
|
|
877
860
|
id: `form-element-${field}-${index}`,
|
|
@@ -891,7 +874,7 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
891
874
|
index
|
|
892
875
|
) }, index);
|
|
893
876
|
} else if (item.type === "text") {
|
|
894
|
-
return /* @__PURE__ */
|
|
877
|
+
return /* @__PURE__ */ jsx7(Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ jsx7(
|
|
895
878
|
input_text_default,
|
|
896
879
|
{
|
|
897
880
|
id: `form-element-${field}-${index}`,
|
|
@@ -908,7 +891,7 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
908
891
|
index
|
|
909
892
|
) }, index);
|
|
910
893
|
} else if (item.type === "select") {
|
|
911
|
-
return /* @__PURE__ */
|
|
894
|
+
return /* @__PURE__ */ jsx7(Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ jsx7(
|
|
912
895
|
select_default,
|
|
913
896
|
{
|
|
914
897
|
id: `form-element-${field}-${index}`,
|
|
@@ -927,7 +910,7 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
927
910
|
index
|
|
928
911
|
) }, index);
|
|
929
912
|
} else if (item.type === "selectCreatable") {
|
|
930
|
-
return /* @__PURE__ */
|
|
913
|
+
return /* @__PURE__ */ jsx7(Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ jsx7(
|
|
931
914
|
creactable_select_default,
|
|
932
915
|
{
|
|
933
916
|
id: `form-element-${field}-${index}`,
|
|
@@ -948,20 +931,20 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
948
931
|
}
|
|
949
932
|
}) });
|
|
950
933
|
};
|
|
951
|
-
return /* @__PURE__ */
|
|
934
|
+
return /* @__PURE__ */ jsx7(
|
|
952
935
|
"div",
|
|
953
936
|
{
|
|
954
937
|
className: "form-edit",
|
|
955
938
|
ref,
|
|
956
939
|
id,
|
|
957
|
-
children: /* @__PURE__ */
|
|
940
|
+
children: /* @__PURE__ */ jsx7("div", { ref: editFormRef, children: /* @__PURE__ */ jsxs7(
|
|
958
941
|
Dropdown,
|
|
959
942
|
{
|
|
960
943
|
isOpen: dropdownOpen,
|
|
961
944
|
toggle: () => {
|
|
962
945
|
},
|
|
963
946
|
children: [
|
|
964
|
-
/* @__PURE__ */
|
|
947
|
+
/* @__PURE__ */ jsx7(DropdownToggle, { tag: "div", children: /* @__PURE__ */ jsx7(
|
|
965
948
|
Input4,
|
|
966
949
|
{
|
|
967
950
|
style: { backgroundColor: "#FFF", textAlign: textAlign ?? "left" },
|
|
@@ -976,7 +959,7 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
976
959
|
readOnly: true
|
|
977
960
|
}
|
|
978
961
|
) }),
|
|
979
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ jsx7(
|
|
980
963
|
DropdownMenu,
|
|
981
964
|
{
|
|
982
965
|
className: "formula-dropdown icon-dropdown p-0",
|
|
@@ -987,8 +970,8 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
987
970
|
borderRadius: 8,
|
|
988
971
|
zIndex: 1056
|
|
989
972
|
},
|
|
990
|
-
children: /* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
973
|
+
children: /* @__PURE__ */ jsx7(DropdownItem, { className: "p-0", style: { borderRadius: "6px" }, tag: "div", header: true, children: /* @__PURE__ */ jsxs7(Form, { className: "todo-modal", onKeyDown: (e) => formKeyDown(e, handleSubmit(handleOnSubmit)), children: [
|
|
974
|
+
/* @__PURE__ */ jsx7(
|
|
992
975
|
"div",
|
|
993
976
|
{
|
|
994
977
|
className: "p-1",
|
|
@@ -1000,8 +983,8 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
1000
983
|
}
|
|
1001
984
|
),
|
|
1002
985
|
/* @__PURE__ */ jsxs7("div", { className: "d-flex justify-content-between p-50", style: { boxShadow: "0 4px 24px 0 rgb(34 41 47 / 10%)" }, children: [
|
|
1003
|
-
/* @__PURE__ */
|
|
1004
|
-
!onChangeField ? /* @__PURE__ */
|
|
986
|
+
/* @__PURE__ */ jsx7("div", { className: "text-primary py-25", style: { fontSize: 12 }, children: footerTemplate ? footerTemplate(rowData) : "" }),
|
|
987
|
+
!onChangeField ? /* @__PURE__ */ jsx7(Fragment7, { children: /* @__PURE__ */ jsx7(
|
|
1005
988
|
Button,
|
|
1006
989
|
{
|
|
1007
990
|
ref: buttonRef,
|
|
@@ -1015,7 +998,7 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
1015
998
|
},
|
|
1016
999
|
children: t("Save")
|
|
1017
1000
|
}
|
|
1018
|
-
) }) : /* @__PURE__ */
|
|
1001
|
+
) }) : /* @__PURE__ */ jsx7(Fragment7, {})
|
|
1019
1002
|
] })
|
|
1020
1003
|
] }) })
|
|
1021
1004
|
}
|
|
@@ -1029,7 +1012,7 @@ var EditForm = forwardRef((props, ref) => {
|
|
|
1029
1012
|
var edit_form_default = EditForm;
|
|
1030
1013
|
|
|
1031
1014
|
// test-app/src/component/sidebar-setting-column/index.tsx
|
|
1032
|
-
import { Fragment as
|
|
1015
|
+
import { Fragment as Fragment9, useEffect as useEffect5, useState as useState4 } from "react";
|
|
1033
1016
|
import { Button as Button2, Input as Input5 } from "reactstrap";
|
|
1034
1017
|
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
1035
1018
|
|
|
@@ -1037,23 +1020,23 @@ import { useTranslation as useTranslation7 } from "react-i18next";
|
|
|
1037
1020
|
import { Edit, Info, Plus, X as X2 } from "becoxy-icons";
|
|
1038
1021
|
import classNames3 from "classnames";
|
|
1039
1022
|
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
1040
|
-
import { Fragment as
|
|
1023
|
+
import { Fragment as Fragment8, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1041
1024
|
var ModalHeader = (props) => {
|
|
1042
1025
|
const { title, handleModal, typeModal = "Edit", component } = props;
|
|
1043
1026
|
const { t } = useTranslation6();
|
|
1044
1027
|
const handleModalIcon = () => {
|
|
1045
1028
|
if (typeModal === "Edit" || typeModal === "Approval") {
|
|
1046
|
-
return /* @__PURE__ */
|
|
1029
|
+
return /* @__PURE__ */ jsx8(Edit, { fontSize: 17, className: "me-1" });
|
|
1047
1030
|
} else if (typeModal === "View") {
|
|
1048
|
-
return /* @__PURE__ */
|
|
1031
|
+
return /* @__PURE__ */ jsx8(Info, { fontSize: 17, className: "me-1" });
|
|
1049
1032
|
} else if (typeModal === "Detail") {
|
|
1050
|
-
return /* @__PURE__ */
|
|
1033
|
+
return /* @__PURE__ */ jsx8(Info, { fontSize: 17, className: "me-1" });
|
|
1051
1034
|
} else if (typeModal === "Order") {
|
|
1052
|
-
return /* @__PURE__ */
|
|
1035
|
+
return /* @__PURE__ */ jsx8("span", { className: "e-icons e-sorting-1 me-1", style: { fontSize: "14px" } });
|
|
1053
1036
|
} else if (typeModal === "Process") {
|
|
1054
|
-
return /* @__PURE__ */
|
|
1037
|
+
return /* @__PURE__ */ jsx8("span", { className: "e-flat e-icons e-paste-match-destination me-1", style: { fontSize: "14px" } });
|
|
1055
1038
|
} else {
|
|
1056
|
-
return /* @__PURE__ */
|
|
1039
|
+
return /* @__PURE__ */ jsx8(Plus, { fontSize: 17, className: "me-1" });
|
|
1057
1040
|
}
|
|
1058
1041
|
};
|
|
1059
1042
|
return /* @__PURE__ */ jsxs8("div", { className: "modal-header d-flex align-items-center justify-content-between mb-1", children: [
|
|
@@ -1063,9 +1046,9 @@ var ModalHeader = (props) => {
|
|
|
1063
1046
|
" ",
|
|
1064
1047
|
t(title)
|
|
1065
1048
|
] }),
|
|
1066
|
-
component ? component() : /* @__PURE__ */
|
|
1049
|
+
component ? component() : /* @__PURE__ */ jsx8(Fragment8, {})
|
|
1067
1050
|
] }),
|
|
1068
|
-
/* @__PURE__ */
|
|
1051
|
+
/* @__PURE__ */ jsx8("div", { className: "todo-item-action d-flex align-items-center", children: /* @__PURE__ */ jsx8(
|
|
1069
1052
|
X2,
|
|
1070
1053
|
{
|
|
1071
1054
|
className: classNames3("fw-normal mt-25 cursor-pointer", { "d-none": !handleModal }),
|
|
@@ -1081,7 +1064,7 @@ var modal_header_default = ModalHeader;
|
|
|
1081
1064
|
import { ChevronLeft, ChevronRight } from "becoxy-icons";
|
|
1082
1065
|
import classNames4 from "classnames";
|
|
1083
1066
|
import { useEffect as useEffect4, useState as useState3 } from "react";
|
|
1084
|
-
import { jsx as
|
|
1067
|
+
import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1085
1068
|
var Sidebar = (props) => {
|
|
1086
1069
|
const {
|
|
1087
1070
|
open,
|
|
@@ -1124,7 +1107,7 @@ var Sidebar = (props) => {
|
|
|
1124
1107
|
}
|
|
1125
1108
|
},
|
|
1126
1109
|
children: [
|
|
1127
|
-
/* @__PURE__ */
|
|
1110
|
+
/* @__PURE__ */ jsx9(
|
|
1128
1111
|
"div",
|
|
1129
1112
|
{
|
|
1130
1113
|
className: classNames4("offcanvas-backdrop fade", {
|
|
@@ -1166,8 +1149,8 @@ var Sidebar = (props) => {
|
|
|
1166
1149
|
setIsFullScreen(!isFullScreen);
|
|
1167
1150
|
},
|
|
1168
1151
|
children: [
|
|
1169
|
-
/* @__PURE__ */
|
|
1170
|
-
/* @__PURE__ */
|
|
1152
|
+
/* @__PURE__ */ jsx9(ChevronLeft, { className: `${isFullScreen ? "d-none" : ""}`, fontSize: 16 }),
|
|
1153
|
+
/* @__PURE__ */ jsx9(ChevronRight, { className: `${!isFullScreen ? "d-none" : ""}`, fontSize: 15 })
|
|
1171
1154
|
]
|
|
1172
1155
|
}
|
|
1173
1156
|
),
|
|
@@ -1183,7 +1166,7 @@ var sidebar_default = Sidebar;
|
|
|
1183
1166
|
|
|
1184
1167
|
// test-app/src/component/sidebar-setting-column/index.tsx
|
|
1185
1168
|
import classnames5 from "classnames";
|
|
1186
|
-
import { Fragment as
|
|
1169
|
+
import { Fragment as Fragment10, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1187
1170
|
var SidebarSetColumn = (props) => {
|
|
1188
1171
|
const { column, setColumn, openSidebar, handleSidebar } = props;
|
|
1189
1172
|
const { t } = useTranslation7();
|
|
@@ -1217,13 +1200,13 @@ var SidebarSetColumn = (props) => {
|
|
|
1217
1200
|
};
|
|
1218
1201
|
}, []);
|
|
1219
1202
|
const renderFooterButtons = () => {
|
|
1220
|
-
return /* @__PURE__ */ jsxs10(
|
|
1221
|
-
/* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ jsxs10(Fragment9, { children: [
|
|
1204
|
+
/* @__PURE__ */ jsx10(Button2, { color: "primary", onClick: handleSubmit, className: "me-1", children: t("Confirm") }),
|
|
1205
|
+
/* @__PURE__ */ jsx10(Button2, { color: "secondary", onClick: handleCancel, outline: true, children: t("Close") })
|
|
1223
1206
|
] });
|
|
1224
1207
|
};
|
|
1225
1208
|
const visibleTemplate = (item, index) => {
|
|
1226
|
-
return /* @__PURE__ */
|
|
1209
|
+
return /* @__PURE__ */ jsx10(
|
|
1227
1210
|
Input5,
|
|
1228
1211
|
{
|
|
1229
1212
|
defaultChecked: item.visible ?? true,
|
|
@@ -1241,7 +1224,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1241
1224
|
);
|
|
1242
1225
|
};
|
|
1243
1226
|
const fixColumnTemplate = (item, index) => {
|
|
1244
|
-
return /* @__PURE__ */
|
|
1227
|
+
return /* @__PURE__ */ jsx10(
|
|
1245
1228
|
Input5,
|
|
1246
1229
|
{
|
|
1247
1230
|
defaultChecked: item.fixedType === "left" || item.fixedType === "right",
|
|
@@ -1270,7 +1253,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1270
1253
|
field: "headerText",
|
|
1271
1254
|
headerText: "Column name",
|
|
1272
1255
|
template: (e) => {
|
|
1273
|
-
return /* @__PURE__ */
|
|
1256
|
+
return /* @__PURE__ */ jsx10(Fragment10, { children: t(e.headerText) });
|
|
1274
1257
|
},
|
|
1275
1258
|
visible: true,
|
|
1276
1259
|
width: 175,
|
|
@@ -1308,10 +1291,10 @@ var SidebarSetColumn = (props) => {
|
|
|
1308
1291
|
}
|
|
1309
1292
|
];
|
|
1310
1293
|
const renderHeaderCol = (col, indexCol) => {
|
|
1311
|
-
return /* @__PURE__ */
|
|
1312
|
-
|
|
1294
|
+
return /* @__PURE__ */ jsx10(
|
|
1295
|
+
Fragment9,
|
|
1313
1296
|
{
|
|
1314
|
-
children: col.visible !== false && /* @__PURE__ */
|
|
1297
|
+
children: col.visible !== false && /* @__PURE__ */ jsx10(
|
|
1315
1298
|
"th",
|
|
1316
1299
|
{
|
|
1317
1300
|
className: classnames5(
|
|
@@ -1324,7 +1307,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1324
1307
|
top: `${0 * 42}px`,
|
|
1325
1308
|
maxWidth: col.maxWidth
|
|
1326
1309
|
},
|
|
1327
|
-
children: /* @__PURE__ */
|
|
1310
|
+
children: /* @__PURE__ */ jsx10(
|
|
1328
1311
|
"div",
|
|
1329
1312
|
{
|
|
1330
1313
|
role: "textbox",
|
|
@@ -1350,13 +1333,13 @@ var SidebarSetColumn = (props) => {
|
|
|
1350
1333
|
toggleSidebar: handleCancel,
|
|
1351
1334
|
width: 700,
|
|
1352
1335
|
children: [
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */
|
|
1336
|
+
/* @__PURE__ */ jsx10(modal_header_default, { typeModal: "Edit", handleModal: handleCancel, title: "Column setup" }),
|
|
1337
|
+
/* @__PURE__ */ jsx10("div", { className: "ms-2 react-table-edit", children: /* @__PURE__ */ jsx10("div", { className: "r-grid", children: /* @__PURE__ */ jsx10("div", { className: "r-gridtable", style: { height: windowSize.innerHeight - 120 }, children: /* @__PURE__ */ jsxs10("table", { style: { width: "100%" }, children: [
|
|
1338
|
+
/* @__PURE__ */ jsx10("thead", { className: "r-gridheader", children: /* @__PURE__ */ jsx10("tr", { className: "r-row", role: "row", children: columns.map((col, index) => {
|
|
1356
1339
|
return renderHeaderCol(col, index);
|
|
1357
1340
|
}) }) }),
|
|
1358
|
-
/* @__PURE__ */
|
|
1359
|
-
return /* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ jsx10("tbody", { className: "r-gridcontent", children: dataSource?.map((row, indexRow) => {
|
|
1342
|
+
return /* @__PURE__ */ jsx10(
|
|
1360
1343
|
"tr",
|
|
1361
1344
|
{
|
|
1362
1345
|
className: classnames5("r-row", { "last-row": indexRow === dataSource.length - 1 }, { "fisrt-row": indexRow === 0 }),
|
|
@@ -1365,7 +1348,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1365
1348
|
if (col.editType === "numeric" || col.editTypeCondition && col.editTypeCondition(row) === "numeric") {
|
|
1366
1349
|
value = formartNumberic(row[col.field], ",", ".", col.numericSettings?.fraction, true) ?? 0;
|
|
1367
1350
|
}
|
|
1368
|
-
return /* @__PURE__ */
|
|
1351
|
+
return /* @__PURE__ */ jsx10(Fragment9, { children: col.visible !== false && /* @__PURE__ */ jsx10(
|
|
1369
1352
|
"td",
|
|
1370
1353
|
{
|
|
1371
1354
|
className: classnames5(
|
|
@@ -1391,21 +1374,21 @@ var SidebarSetColumn = (props) => {
|
|
|
1391
1374
|
e.stopPropagation();
|
|
1392
1375
|
}
|
|
1393
1376
|
},
|
|
1394
|
-
children: /* @__PURE__ */
|
|
1377
|
+
children: /* @__PURE__ */ jsx10(
|
|
1395
1378
|
"div",
|
|
1396
1379
|
{
|
|
1397
1380
|
className: classnames5("r-rowcell-div"),
|
|
1398
1381
|
style: {
|
|
1399
1382
|
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto"
|
|
1400
1383
|
},
|
|
1401
|
-
children: /* @__PURE__ */
|
|
1384
|
+
children: /* @__PURE__ */ jsx10(
|
|
1402
1385
|
"div",
|
|
1403
1386
|
{
|
|
1404
1387
|
className: classnames5("r-rowcell-content"),
|
|
1405
1388
|
style: {
|
|
1406
1389
|
margin: "7px 9px"
|
|
1407
1390
|
},
|
|
1408
|
-
children: /* @__PURE__ */
|
|
1391
|
+
children: /* @__PURE__ */ jsx10("div", { className: "r-cell-text", children: col.template ? col.template(row, indexRow) : value })
|
|
1409
1392
|
}
|
|
1410
1393
|
)
|
|
1411
1394
|
}
|
|
@@ -1419,7 +1402,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1419
1402
|
);
|
|
1420
1403
|
}) })
|
|
1421
1404
|
] }) }) }) }),
|
|
1422
|
-
/* @__PURE__ */
|
|
1405
|
+
/* @__PURE__ */ jsx10(
|
|
1423
1406
|
"div",
|
|
1424
1407
|
{
|
|
1425
1408
|
className: "d-flex justify-content-end p-1 ",
|
|
@@ -1439,10 +1422,10 @@ import { DropDownTreeComponent } from "@syncfusion/ej2-react-dropdowns";
|
|
|
1439
1422
|
// test-app/src/component/paging/index.tsx
|
|
1440
1423
|
import { ChevronRight as ChevronRight2, ChevronLeft as ChevronLeft2, ChevronsLeft, ChevronsRight } from "becoxy-icons";
|
|
1441
1424
|
import classNames5 from "classnames";
|
|
1442
|
-
import { Fragment as
|
|
1425
|
+
import { Fragment as Fragment11, useEffect as useEffect6, useState as useState5 } from "react";
|
|
1443
1426
|
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
1444
1427
|
import Select2 from "react-select";
|
|
1445
|
-
import { jsx as
|
|
1428
|
+
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1446
1429
|
var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
|
|
1447
1430
|
const { t } = useTranslation8();
|
|
1448
1431
|
const [countPage, setCountPage] = useState5(0);
|
|
@@ -1457,7 +1440,7 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
1457
1440
|
const arr = [];
|
|
1458
1441
|
for (let index = (number - 1) * 5 + 1; index <= number * 5 && index <= Math.floor(totalItem / pageSize) + (Math.floor(totalItem / pageSize) === totalItem / pageSize ? 0 : 1); index++) {
|
|
1459
1442
|
arr.push(
|
|
1460
|
-
/* @__PURE__ */
|
|
1443
|
+
/* @__PURE__ */ jsx11(
|
|
1461
1444
|
"div",
|
|
1462
1445
|
{
|
|
1463
1446
|
className: classNames5("r-number", { "r-active": index === currentPage }),
|
|
@@ -1472,11 +1455,11 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
1472
1455
|
}
|
|
1473
1456
|
return arr;
|
|
1474
1457
|
};
|
|
1475
|
-
return /* @__PURE__ */
|
|
1458
|
+
return /* @__PURE__ */ jsx11(Fragment11, { children: /* @__PURE__ */ jsxs11("div", { className: "r-pager", children: [
|
|
1476
1459
|
/* @__PURE__ */ jsxs11("div", { className: "r-pagercontainer", children: [
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
/* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1460
|
+
/* @__PURE__ */ jsx11("button", { className: "r-button", type: "button", disabled: countPage <= 1 || currentPage === 1, onClick: () => onChangePage({ totalItem, pageSize, currentPage: 1, old: currentPage }), children: /* @__PURE__ */ jsx11(ChevronsLeft, { fontSize: 16 }) }),
|
|
1461
|
+
/* @__PURE__ */ jsx11("button", { className: "r-button", type: "button", disabled: countPage <= 1 || currentPage === 1, onClick: () => onChangePage({ totalItem, pageSize, currentPage: currentPage - 1, old: currentPage }), children: /* @__PURE__ */ jsx11(ChevronLeft2, { fontSize: 16 }) }),
|
|
1462
|
+
/* @__PURE__ */ jsx11(
|
|
1480
1463
|
"button",
|
|
1481
1464
|
{
|
|
1482
1465
|
className: classNames5("r-button", { "d-none": currentPageNumber === 1 }),
|
|
@@ -1489,7 +1472,7 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
1489
1472
|
}
|
|
1490
1473
|
),
|
|
1491
1474
|
renderPageNumber(currentPageNumber),
|
|
1492
|
-
/* @__PURE__ */
|
|
1475
|
+
/* @__PURE__ */ jsx11(
|
|
1493
1476
|
"button",
|
|
1494
1477
|
{
|
|
1495
1478
|
className: classNames5("r-button", { "d-none": currentPageNumber * 5 >= countPage }),
|
|
@@ -1501,9 +1484,9 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
1501
1484
|
children: "..."
|
|
1502
1485
|
}
|
|
1503
1486
|
),
|
|
1504
|
-
/* @__PURE__ */
|
|
1505
|
-
/* @__PURE__ */
|
|
1506
|
-
/* @__PURE__ */
|
|
1487
|
+
/* @__PURE__ */ jsx11("button", { className: "r-button", type: "button", disabled: countPage <= 1 || countPage === currentPage, onClick: () => onChangePage({ totalItem, pageSize, currentPage: currentPage + 1, old: currentPage }), children: /* @__PURE__ */ jsx11(ChevronRight2, { fontSize: 16 }) }),
|
|
1488
|
+
/* @__PURE__ */ jsx11("button", { className: "r-button", type: "button", disabled: countPage <= 1 || countPage === currentPage, onClick: () => onChangePage({ totalItem, pageSize, currentPage: Math.floor(totalItem / pageSize) + (Math.floor(totalItem / pageSize) === totalItem / pageSize ? 0 : 1), old: currentPage }), children: /* @__PURE__ */ jsx11(ChevronsRight, { fontSize: 16 }) }),
|
|
1489
|
+
/* @__PURE__ */ jsx11("div", { className: "r-pagesize", children: /* @__PURE__ */ jsx11(
|
|
1507
1490
|
Select2,
|
|
1508
1491
|
{
|
|
1509
1492
|
value: { value: pageSize, label: pageSize },
|
|
@@ -1516,14 +1499,14 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
1516
1499
|
classNamePrefix: "select-pagesize"
|
|
1517
1500
|
}
|
|
1518
1501
|
) }),
|
|
1519
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ jsx11("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("pagerDropDown") })
|
|
1520
1503
|
] }),
|
|
1521
|
-
/* @__PURE__ */
|
|
1504
|
+
/* @__PURE__ */ jsx11("div", { className: "r-parentmsgbar", children: t("totalItemsInfo", { page: currentPage, countPage, totalItem }) })
|
|
1522
1505
|
] }) });
|
|
1523
1506
|
};
|
|
1524
1507
|
|
|
1525
1508
|
// test-app/src/component/select-table/index.tsx
|
|
1526
|
-
import { forwardRef as forwardRef2, Fragment as
|
|
1509
|
+
import { forwardRef as forwardRef2, Fragment as Fragment12, useEffect as useEffect7, useMemo, useRef as useRef2, useState as useState6 } from "react";
|
|
1527
1510
|
import {
|
|
1528
1511
|
DropdownItem as DropdownItem2,
|
|
1529
1512
|
DropdownMenu as DropdownMenu2,
|
|
@@ -1538,7 +1521,7 @@ import { useTranslation as useTranslation9 } from "react-i18next";
|
|
|
1538
1521
|
import classnames6 from "classnames";
|
|
1539
1522
|
import moment from "moment";
|
|
1540
1523
|
import { Plus as Plus2 } from "becoxy-icons";
|
|
1541
|
-
import { Fragment as
|
|
1524
|
+
import { Fragment as Fragment13, jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1542
1525
|
var defaultMaxHeight = 300;
|
|
1543
1526
|
var SelectTable = forwardRef2((props, ref) => {
|
|
1544
1527
|
const {
|
|
@@ -1618,17 +1601,12 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1618
1601
|
}
|
|
1619
1602
|
}
|
|
1620
1603
|
}, [dropdownOpen]);
|
|
1621
|
-
let timeOutBlur;
|
|
1622
1604
|
useEffect7(() => {
|
|
1623
1605
|
if (inputRef && !isDisabled) {
|
|
1624
1606
|
inputRef.current.addEventListener("blur", function() {
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
setSearchTerm("");
|
|
1629
|
-
setIsFocus(false);
|
|
1630
|
-
}
|
|
1631
|
-
}, 100);
|
|
1607
|
+
setDropdownOpen(false);
|
|
1608
|
+
setSearchTerm("");
|
|
1609
|
+
setIsFocus(false);
|
|
1632
1610
|
});
|
|
1633
1611
|
inputRef.current.addEventListener("focus", function() {
|
|
1634
1612
|
if (!isFocus) {
|
|
@@ -1753,10 +1731,10 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1753
1731
|
}, 100);
|
|
1754
1732
|
};
|
|
1755
1733
|
const renderHeaderCol = (col, indexCol) => {
|
|
1756
|
-
return /* @__PURE__ */
|
|
1757
|
-
|
|
1734
|
+
return /* @__PURE__ */ jsx12(
|
|
1735
|
+
Fragment12,
|
|
1758
1736
|
{
|
|
1759
|
-
children: col.visible !== false && /* @__PURE__ */
|
|
1737
|
+
children: col.visible !== false && /* @__PURE__ */ jsx12(
|
|
1760
1738
|
"th",
|
|
1761
1739
|
{
|
|
1762
1740
|
className: classnames6(
|
|
@@ -1769,7 +1747,7 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1769
1747
|
top: `${0 * 35}px`,
|
|
1770
1748
|
maxWidth: col.maxWidth
|
|
1771
1749
|
},
|
|
1772
|
-
children: /* @__PURE__ */
|
|
1750
|
+
children: /* @__PURE__ */ jsx12(
|
|
1773
1751
|
"div",
|
|
1774
1752
|
{
|
|
1775
1753
|
role: "textbox",
|
|
@@ -1822,7 +1800,7 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1822
1800
|
style: { paddingLeft: 10 * level },
|
|
1823
1801
|
className: classnames6("r-select-row", { "last-row": indexRow === (optionsLoad ? optionsLoad : options).length - 1 }, { "fisrt-row": indexRow === 0 }),
|
|
1824
1802
|
children: [
|
|
1825
|
-
isMulti && /* @__PURE__ */
|
|
1803
|
+
isMulti && /* @__PURE__ */ jsx12(
|
|
1826
1804
|
"td",
|
|
1827
1805
|
{
|
|
1828
1806
|
className: classnames6(`r-select-rowcell`, { "r-select-move": indexFocus === indexRow, "r-select-active": !isMulti && value && value[fieldValue ?? "value"] === row[fieldValue ?? "value"] }),
|
|
@@ -1846,7 +1824,7 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1846
1824
|
e.stopPropagation();
|
|
1847
1825
|
}
|
|
1848
1826
|
},
|
|
1849
|
-
children: /* @__PURE__ */
|
|
1827
|
+
children: /* @__PURE__ */ jsx12(
|
|
1850
1828
|
Input6,
|
|
1851
1829
|
{
|
|
1852
1830
|
checked: isSelected,
|
|
@@ -1868,8 +1846,8 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1868
1846
|
} else if (col.type === "datetime") {
|
|
1869
1847
|
valueDisplay = valueDisplay ? moment(valueDisplay).format("DD/MM/yyyy HH:mm") : "";
|
|
1870
1848
|
}
|
|
1871
|
-
return /* @__PURE__ */ jsxs12(
|
|
1872
|
-
col.visible !== false && /* @__PURE__ */
|
|
1849
|
+
return /* @__PURE__ */ jsxs12(Fragment12, { children: [
|
|
1850
|
+
col.visible !== false && /* @__PURE__ */ jsx12(
|
|
1873
1851
|
"td",
|
|
1874
1852
|
{
|
|
1875
1853
|
id: `select-${id}-${indexRow}-${indexCol}`,
|
|
@@ -1914,7 +1892,7 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1914
1892
|
},
|
|
1915
1893
|
`col-${indexRow}-${indexCol}`
|
|
1916
1894
|
),
|
|
1917
|
-
checkOverflow(indexRow, indexCol) && /* @__PURE__ */
|
|
1895
|
+
checkOverflow(indexRow, indexCol) && /* @__PURE__ */ jsx12(UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `select-${id}-${indexRow}-${indexCol}`, children: col.template ? col.template(row, indexRow) : valueDisplay })
|
|
1918
1896
|
] }, indexCol);
|
|
1919
1897
|
})
|
|
1920
1898
|
]
|
|
@@ -1925,15 +1903,15 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1925
1903
|
const RenderTable = (props2) => {
|
|
1926
1904
|
const {} = props2;
|
|
1927
1905
|
let countDisplay = 0;
|
|
1928
|
-
return /* @__PURE__ */ jsxs12(
|
|
1906
|
+
return /* @__PURE__ */ jsxs12(Fragment13, { children: [
|
|
1929
1907
|
/* @__PURE__ */ jsxs12("table", { style: { width: "100%" }, children: [
|
|
1930
|
-
/* @__PURE__ */
|
|
1931
|
-
isMulti && /* @__PURE__ */
|
|
1908
|
+
/* @__PURE__ */ jsx12("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ jsxs12("tr", { className: "r-select-row", role: "row", children: [
|
|
1909
|
+
isMulti && /* @__PURE__ */ jsx12("th", { className: classnames6(`r-select-headercell`), style: { width: 40, top: `0px` }, children: /* @__PURE__ */ jsx12(
|
|
1932
1910
|
"div",
|
|
1933
1911
|
{
|
|
1934
1912
|
style: { justifyContent: "center" },
|
|
1935
1913
|
className: classnames6("r-select-headercell-div"),
|
|
1936
|
-
children: /* @__PURE__ */
|
|
1914
|
+
children: /* @__PURE__ */ jsx12(
|
|
1937
1915
|
Input6,
|
|
1938
1916
|
{
|
|
1939
1917
|
checked: isSelectedAll,
|
|
@@ -1959,37 +1937,37 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1959
1937
|
return renderHeaderCol(col, index);
|
|
1960
1938
|
})
|
|
1961
1939
|
] }) }),
|
|
1962
|
-
(optionsLoad ? optionsLoad : options).length > 0 && !isLoading && /* @__PURE__ */
|
|
1940
|
+
(optionsLoad ? optionsLoad : options).length > 0 && !isLoading && /* @__PURE__ */ jsx12(Fragment13, { children: /* @__PURE__ */ jsx12("tbody", { className: "r-select-gridcontent", children: (optionsLoad ? optionsLoad : options)?.map((row, indexRow) => {
|
|
1963
1941
|
if (!isMulti && loadOptions || checkSearch(searchTerm, row, columns ? columns : defaultColumns)) {
|
|
1964
1942
|
const isSelected = isMulti && value?.some((x) => x === row[fieldValue ?? "value"]);
|
|
1965
1943
|
countDisplay++;
|
|
1966
|
-
return /* @__PURE__ */
|
|
1944
|
+
return /* @__PURE__ */ jsx12(RenderElement, { isSelected, indexRow, row }, `select-table-${indexRow}`);
|
|
1967
1945
|
}
|
|
1968
1946
|
}) }) })
|
|
1969
1947
|
] }),
|
|
1970
1948
|
countDisplay === 0 && !isLoading && /* @__PURE__ */ jsxs12("div", { className: "r-no-data", children: [
|
|
1971
|
-
/* @__PURE__ */
|
|
1972
|
-
/* @__PURE__ */
|
|
1949
|
+
/* @__PURE__ */ jsx12("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ jsxs12("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [
|
|
1950
|
+
/* @__PURE__ */ jsx12("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }),
|
|
1973
1951
|
/* @__PURE__ */ jsxs12("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [
|
|
1974
|
-
/* @__PURE__ */
|
|
1975
|
-
/* @__PURE__ */
|
|
1952
|
+
/* @__PURE__ */ jsx12("path", { d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z" }),
|
|
1953
|
+
/* @__PURE__ */ jsx12("path", { d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z", fill: "#fafafa" })
|
|
1976
1954
|
] })
|
|
1977
1955
|
] }) }),
|
|
1978
1956
|
t("No data available.")
|
|
1979
1957
|
] }),
|
|
1980
1958
|
isLoading && /* @__PURE__ */ jsxs12("div", { className: "r-no-data", children: [
|
|
1981
|
-
/* @__PURE__ */
|
|
1959
|
+
/* @__PURE__ */ jsx12(Spinner, { className: "me-1", children: " " }),
|
|
1982
1960
|
t("Loading...")
|
|
1983
1961
|
] })
|
|
1984
1962
|
] });
|
|
1985
1963
|
};
|
|
1986
|
-
return /* @__PURE__ */
|
|
1964
|
+
return /* @__PURE__ */ jsx12(
|
|
1987
1965
|
"div",
|
|
1988
1966
|
{
|
|
1989
1967
|
className: classnames6("react-select-table", { "is-invalid": invalid }),
|
|
1990
1968
|
ref,
|
|
1991
1969
|
id,
|
|
1992
|
-
children: /* @__PURE__ */
|
|
1970
|
+
children: /* @__PURE__ */ jsx12("div", { ref: selectTableRef, children: /* @__PURE__ */ jsxs12(
|
|
1993
1971
|
Dropdown2,
|
|
1994
1972
|
{
|
|
1995
1973
|
isOpen: dropdownOpen,
|
|
@@ -1999,20 +1977,18 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
1999
1977
|
/* @__PURE__ */ jsxs12(
|
|
2000
1978
|
DropdownToggle2,
|
|
2001
1979
|
{
|
|
2002
|
-
onClick: () => {
|
|
1980
|
+
onClick: (e) => {
|
|
2003
1981
|
if (!isDisabled) {
|
|
2004
1982
|
inputRef?.current.focus();
|
|
2005
|
-
if (dropdownOpen) {
|
|
2006
|
-
clearTimeout(timeOutBlur);
|
|
2007
|
-
}
|
|
2008
1983
|
handleOpenClose();
|
|
2009
1984
|
}
|
|
1985
|
+
e.preventDefault();
|
|
2010
1986
|
},
|
|
2011
1987
|
tag: "div",
|
|
2012
1988
|
className: classnames6("select-table-control", { "r-select-is-disabled": isDisabled }, { "r-select-is-open": dropdownOpen }, { "r-select-is-focus": isFocus }, { "r-select-is-invalid": invalid }),
|
|
2013
1989
|
children: [
|
|
2014
1990
|
/* @__PURE__ */ jsxs12("div", { className: "select-table-container", children: [
|
|
2015
|
-
isMulti ? /* @__PURE__ */
|
|
1991
|
+
isMulti ? /* @__PURE__ */ jsx12(Fragment13, { children: /* @__PURE__ */ jsx12("div", { className: classnames6("select-value is-mutil", { "d-none": searchTerm }), children: value?.map((ele, index) => {
|
|
2016
1992
|
const element = (optionsLoad ? optionsLoad : options).find((e) => e[fieldValue ?? "value"] === ele);
|
|
2017
1993
|
if (element) {
|
|
2018
1994
|
return /* @__PURE__ */ jsxs12("span", { children: [
|
|
@@ -2020,12 +1996,12 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
2020
1996
|
element[fieldLabel ?? "label"]
|
|
2021
1997
|
] }, index);
|
|
2022
1998
|
}
|
|
2023
|
-
}) }) }) : /* @__PURE__ */
|
|
1999
|
+
}) }) }) : /* @__PURE__ */ jsx12(Fragment13, { children: /* @__PURE__ */ jsxs12("div", { className: classnames6("select-value", { "d-none": searchTerm }), children: [
|
|
2024
2000
|
value ? formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? "label"] : "",
|
|
2025
2001
|
" "
|
|
2026
2002
|
] }) }),
|
|
2027
|
-
!((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && /* @__PURE__ */
|
|
2028
|
-
/* @__PURE__ */
|
|
2003
|
+
!((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && /* @__PURE__ */ jsx12("div", { className: classnames6("select-placeholder"), children: placeholder }),
|
|
2004
|
+
/* @__PURE__ */ jsx12("div", { className: "input-container", children: /* @__PURE__ */ jsx12(
|
|
2029
2005
|
"input",
|
|
2030
2006
|
{
|
|
2031
2007
|
style: { textAlign: textAlign ?? "left" },
|
|
@@ -2046,11 +2022,11 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
2046
2022
|
) })
|
|
2047
2023
|
] }),
|
|
2048
2024
|
isLoading && /* @__PURE__ */ jsxs12("div", { className: classnames6("select-table-indicator d-flex align-items-center"), children: [
|
|
2049
|
-
/* @__PURE__ */
|
|
2050
|
-
/* @__PURE__ */
|
|
2051
|
-
/* @__PURE__ */
|
|
2025
|
+
/* @__PURE__ */ jsx12(Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }),
|
|
2026
|
+
/* @__PURE__ */ jsx12(Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }),
|
|
2027
|
+
/* @__PURE__ */ jsx12(Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" })
|
|
2052
2028
|
] }),
|
|
2053
|
-
isClearable && value && !isDisabled && /* @__PURE__ */
|
|
2029
|
+
isClearable && value && !isDisabled && /* @__PURE__ */ jsx12(
|
|
2054
2030
|
"div",
|
|
2055
2031
|
{
|
|
2056
2032
|
className: classnames6("cursor-pointer"),
|
|
@@ -2058,14 +2034,14 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
2058
2034
|
onChange(isMulti ? [] : void 0);
|
|
2059
2035
|
e.stopPropagation();
|
|
2060
2036
|
},
|
|
2061
|
-
children: /* @__PURE__ */
|
|
2037
|
+
children: /* @__PURE__ */ jsx12("svg", { height: "20", width: "20", color: "#c4c4c4", viewBox: "0 0 20 20", "aria-hidden": "true", focusable: "false", className: "css-tj5bde-Svg", children: /* @__PURE__ */ jsx12("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" }) })
|
|
2062
2038
|
}
|
|
2063
2039
|
),
|
|
2064
|
-
!isDisabled && /* @__PURE__ */
|
|
2040
|
+
!isDisabled && /* @__PURE__ */ jsx12("div", { className: "select-table-indicator", children: /* @__PURE__ */ jsx12("svg", { height: "20", width: "20", viewBox: "0 0 20 20", children: /* @__PURE__ */ jsx12("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" }) }) })
|
|
2065
2041
|
]
|
|
2066
2042
|
}
|
|
2067
2043
|
),
|
|
2068
|
-
/* @__PURE__ */
|
|
2044
|
+
/* @__PURE__ */ jsx12(
|
|
2069
2045
|
DropdownMenu2,
|
|
2070
2046
|
{
|
|
2071
2047
|
container: component,
|
|
@@ -2075,20 +2051,19 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
2075
2051
|
position: "fixed",
|
|
2076
2052
|
zIndex: 9999
|
|
2077
2053
|
},
|
|
2078
|
-
children: /* @__PURE__ */
|
|
2054
|
+
children: /* @__PURE__ */ jsx12(DropdownItem2, { className: classnames6("p-0 menu-select-table"), style: { borderRadius: "6px" }, tag: "div", header: true, children: /* @__PURE__ */ jsx12(
|
|
2079
2055
|
"div",
|
|
2080
2056
|
{
|
|
2081
2057
|
onMouseDown: (e) => {
|
|
2082
2058
|
if (!isDisabled) {
|
|
2083
2059
|
inputRef?.current.focus();
|
|
2084
|
-
clearTimeout(timeOutBlur);
|
|
2085
2060
|
e.preventDefault();
|
|
2086
2061
|
}
|
|
2087
2062
|
},
|
|
2088
2063
|
children: /* @__PURE__ */ jsxs12("div", { className: "r-select-grid", children: [
|
|
2089
|
-
/* @__PURE__ */
|
|
2090
|
-
/* @__PURE__ */
|
|
2091
|
-
/* @__PURE__ */
|
|
2064
|
+
/* @__PURE__ */ jsx12("div", { className: "r-select-gridtable", ref: selectMenuTableRef, style: { minWidth: selectTableRef?.current?.clientWidth, maxHeight: maxHeight ?? defaultMaxHeight }, children: /* @__PURE__ */ jsx12(RenderTable, {}) }),
|
|
2065
|
+
/* @__PURE__ */ jsx12("div", { className: classnames6("r-select-footer", { "d-none": !(showFooter === true || handleAdd) }), children: /* @__PURE__ */ jsxs12(Button3, { outline: true, color: "primary", onClick: handleAdd, className: classnames6("r-btn-add d-flex align-items-center", { "d-none": !handleAdd }), children: [
|
|
2066
|
+
/* @__PURE__ */ jsx12(Plus2, { className: "me-50", fontSize: 16 }),
|
|
2092
2067
|
t("AddNew"),
|
|
2093
2068
|
" (F9)"
|
|
2094
2069
|
] }) })
|
|
@@ -2105,11 +2080,11 @@ var SelectTable = forwardRef2((props, ref) => {
|
|
|
2105
2080
|
});
|
|
2106
2081
|
|
|
2107
2082
|
// test-app/src/component/table/header.tsx
|
|
2108
|
-
import { Fragment as
|
|
2083
|
+
import { Fragment as Fragment14 } from "react";
|
|
2109
2084
|
import classnames7 from "classnames";
|
|
2110
2085
|
import { Input as Input7 } from "reactstrap";
|
|
2111
2086
|
import { useTranslation as useTranslation10 } from "react-i18next";
|
|
2112
|
-
import { jsx as
|
|
2087
|
+
import { jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
2113
2088
|
var HeaderTableCol = (props) => {
|
|
2114
2089
|
const {
|
|
2115
2090
|
selectEnable,
|
|
@@ -2124,7 +2099,7 @@ var HeaderTableCol = (props) => {
|
|
|
2124
2099
|
isMulti
|
|
2125
2100
|
} = props;
|
|
2126
2101
|
const { t } = useTranslation10();
|
|
2127
|
-
return /* @__PURE__ */
|
|
2102
|
+
return /* @__PURE__ */ jsx13(Fragment14, { children: col.visible !== false && /* @__PURE__ */ jsx13(
|
|
2128
2103
|
"th",
|
|
2129
2104
|
{
|
|
2130
2105
|
rowSpan: col.rowspan !== 1 ? col.rowspan : void 0,
|
|
@@ -2144,7 +2119,7 @@ var HeaderTableCol = (props) => {
|
|
|
2144
2119
|
style: { justifyContent: col.textAlign ?? "left" },
|
|
2145
2120
|
className: classnames7("r-headercell-div"),
|
|
2146
2121
|
children: [
|
|
2147
|
-
col.field === "checkbox" && /* @__PURE__ */
|
|
2122
|
+
col.field === "checkbox" && /* @__PURE__ */ jsx13(
|
|
2148
2123
|
Input7,
|
|
2149
2124
|
{
|
|
2150
2125
|
checked: totalCount > 0 && selectedRows?.length >= totalCount,
|
|
@@ -2178,6 +2153,23 @@ import { Fragment as Fragment16 } from "react";
|
|
|
2178
2153
|
import classnames8 from "classnames";
|
|
2179
2154
|
import { Button as Button4, UncontrolledTooltip as UncontrolledTooltip2 } from "reactstrap";
|
|
2180
2155
|
import { useTranslation as useTranslation11 } from "react-i18next";
|
|
2156
|
+
|
|
2157
|
+
// test-app/src/component/icon/index.tsx
|
|
2158
|
+
import * as Icon from "becoxy-icons";
|
|
2159
|
+
import { Fragment as Fragment15 } from "react";
|
|
2160
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
2161
|
+
var IconCustom = (props) => {
|
|
2162
|
+
const { iconName, size } = props;
|
|
2163
|
+
if (iconName === "") {
|
|
2164
|
+
return null;
|
|
2165
|
+
} else {
|
|
2166
|
+
const TagIcon = iconName === "" ? "" : Icon[iconName];
|
|
2167
|
+
return /* @__PURE__ */ jsx14(Fragment15, { children: iconName === "" ? "" : /* @__PURE__ */ jsx14(TagIcon, { fontSize: size }) });
|
|
2168
|
+
}
|
|
2169
|
+
};
|
|
2170
|
+
var icon_default = IconCustom;
|
|
2171
|
+
|
|
2172
|
+
// test-app/src/component/table/command.tsx
|
|
2181
2173
|
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2182
2174
|
var CommandElement = (props) => {
|
|
2183
2175
|
const { commandItems, rowData, indexRow, handleCommandClick, indexFocus, setIndexFocus } = props;
|
|
@@ -2186,7 +2178,7 @@ var CommandElement = (props) => {
|
|
|
2186
2178
|
return /* @__PURE__ */ jsxs14(
|
|
2187
2179
|
Button4,
|
|
2188
2180
|
{
|
|
2189
|
-
id: `command-item-${indexRow}`,
|
|
2181
|
+
id: `command-item-${indexRow}-${index}`,
|
|
2190
2182
|
tabIndex: -1,
|
|
2191
2183
|
style: { padding: "5px", minWidth: 45, height: "100%" },
|
|
2192
2184
|
className: classnames8("command-item", {
|
|
@@ -2202,7 +2194,7 @@ var CommandElement = (props) => {
|
|
|
2202
2194
|
},
|
|
2203
2195
|
children: [
|
|
2204
2196
|
item.icon && /* @__PURE__ */ jsx15(icon_default, { iconName: item.icon, size: 16 }),
|
|
2205
|
-
/* @__PURE__ */ jsx15(UncontrolledTooltip2, { className: "r-tooltip", target: `command-item-${index}`, place: "top", children: t(item.tooltip ?? "") })
|
|
2197
|
+
/* @__PURE__ */ jsx15(UncontrolledTooltip2, { className: "r-tooltip", target: `command-item-${indexRow}-${index}`, place: "top", children: t(item.tooltip ?? "") })
|
|
2206
2198
|
]
|
|
2207
2199
|
},
|
|
2208
2200
|
`command-${index}`
|
|
@@ -2472,6 +2464,12 @@ var TableEdit = forwardRef3((props, ref) => {
|
|
|
2472
2464
|
onKeyDown: (e) => {
|
|
2473
2465
|
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
2474
2466
|
}
|
|
2467
|
+
},
|
|
2468
|
+
onPaste: (e) => {
|
|
2469
|
+
if (toolbarSetting?.showBottomToolbar && !editDisable && !addDisable) {
|
|
2470
|
+
pasteDataFromExcel(indexRow, indexCol, e);
|
|
2471
|
+
e.preventDefault();
|
|
2472
|
+
}
|
|
2475
2473
|
}
|
|
2476
2474
|
}
|
|
2477
2475
|
);
|
|
@@ -2495,118 +2493,34 @@ var TableEdit = forwardRef3((props, ref) => {
|
|
|
2495
2493
|
onKeyDown: (e) => {
|
|
2496
2494
|
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
2497
2495
|
}
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
);
|
|
2501
|
-
case "asyncSelect":
|
|
2502
|
-
let optionAsyncSelects = [];
|
|
2503
|
-
if (col.selectSettings?.optionsField) {
|
|
2504
|
-
optionAsyncSelects = row[col.selectSettings?.optionsField] ? row[col.selectSettings?.optionsField] : [];
|
|
2505
|
-
} else {
|
|
2506
|
-
optionAsyncSelects = col.selectSettings?.options ? col.selectSettings?.validateOption ? col.selectSettings?.options.filter((item) => col.selectSettings?.validateOption(item, row)) : col.selectSettings?.options : [];
|
|
2507
|
-
}
|
|
2508
|
-
let valueAsyncSelect = !isNullOrUndefined(row[col.field]) && row[col.field] !== "" ? optionAsyncSelects?.find((val) => val[col.selectSettings?.fieldValue ?? "value"] === row[col.field]) : void 0;
|
|
2509
|
-
if (!valueAsyncSelect && col.selectSettings?.defaultValue) {
|
|
2510
|
-
valueAsyncSelect = col.selectSettings?.defaultValue(row);
|
|
2511
|
-
}
|
|
2512
|
-
return /* @__PURE__ */ jsxs15("div", { className: classnames9("d-flex select-group", { "is-invalid": col.validate && col.validate(row[col.field], row) }), children: [
|
|
2513
|
-
/* @__PURE__ */ jsx16(
|
|
2514
|
-
AsyncSelect,
|
|
2515
|
-
{
|
|
2516
|
-
menuPosition: "fixed",
|
|
2517
|
-
value: valueAsyncSelect,
|
|
2518
|
-
defaultOptions: optionAsyncSelects,
|
|
2519
|
-
onChange: (val) => {
|
|
2520
|
-
row[col.field] = val ? val[col.selectSettings?.fieldValue ?? "value"] : void 0;
|
|
2521
|
-
if (col.callback) {
|
|
2522
|
-
col.callback(val, indexRow);
|
|
2523
|
-
}
|
|
2524
|
-
handleDataChange(row, col, indexRow);
|
|
2525
|
-
},
|
|
2526
|
-
menuPortalTarget: document.body,
|
|
2527
|
-
isClearable: col.selectSettings?.isClearable ?? false,
|
|
2528
|
-
classNamePrefix: col.selectSettings?.widthPopup ? `select-${col.selectSettings?.widthPopup}` : "select",
|
|
2529
|
-
placeholder: t("Select"),
|
|
2530
|
-
id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
|
|
2531
|
-
loadOptions: col.selectSettings?.loadOptions,
|
|
2532
|
-
className: classnames9("react-select"),
|
|
2533
|
-
onKeyDown: (e) => {
|
|
2534
|
-
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
2535
|
-
}
|
|
2536
|
-
}
|
|
2537
|
-
}
|
|
2538
|
-
),
|
|
2539
|
-
/* @__PURE__ */ jsx16(
|
|
2540
|
-
"span",
|
|
2541
|
-
{
|
|
2542
|
-
onClick: () => {
|
|
2543
|
-
if (col.selectSettings?.handAddNew) {
|
|
2544
|
-
col.selectSettings?.handAddNew("right");
|
|
2545
|
-
}
|
|
2546
|
-
},
|
|
2547
|
-
className: classnames9("input-group-text", { "d-none": !col.selectSettings?.iconGroup }),
|
|
2548
|
-
children: /* @__PURE__ */ jsx16(icon_default, { iconName: col.selectSettings?.iconGroup ?? "", size: 16 })
|
|
2549
|
-
}
|
|
2550
|
-
)
|
|
2551
|
-
] });
|
|
2552
|
-
case "select":
|
|
2553
|
-
let valueSelect;
|
|
2554
|
-
let options = [];
|
|
2555
|
-
if (col.selectSettings?.optionsField) {
|
|
2556
|
-
options = row[col.selectSettings?.optionsField] ? row[col.selectSettings?.optionsField] : [];
|
|
2557
|
-
} else {
|
|
2558
|
-
options = col.selectSettings?.options ? col.selectSettings?.validateOption ? col.selectSettings?.options.filter((item) => col.selectSettings?.validateOption(item, row)) : col.selectSettings?.options : [];
|
|
2559
|
-
}
|
|
2560
|
-
if (col.selectSettings?.isMulti) {
|
|
2561
|
-
valueSelect = !isNullOrUndefined(row[col.field]) && row[col.field]?.length > 0 ? options?.filter((val) => row[col.field]?.includes(val[col.selectSettings?.fieldValue ?? "value"])) : [];
|
|
2562
|
-
} else {
|
|
2563
|
-
valueSelect = !isNullOrUndefined(row[col.field]) && row[col.field] !== "" ? options?.find((val) => val[col.selectSettings?.fieldValue ?? "value"] === row[col.field]) : "";
|
|
2564
|
-
}
|
|
2565
|
-
return /* @__PURE__ */ jsx16(
|
|
2566
|
-
Select3,
|
|
2567
|
-
{
|
|
2568
|
-
menuPosition: "fixed",
|
|
2569
|
-
id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
|
|
2570
|
-
value: valueSelect,
|
|
2571
|
-
options,
|
|
2572
|
-
onChange: (val) => {
|
|
2573
|
-
row[col.field] = col.selectSettings?.isMulti ? val?.map((item) => item[col.selectSettings?.fieldValue ?? "value"]) ?? [] : val ? val[col.selectSettings?.fieldValue ?? "value"] : void 0;
|
|
2574
|
-
if (col.callback) {
|
|
2575
|
-
col.callback(val, indexRow);
|
|
2576
|
-
}
|
|
2577
|
-
handleDataChange(row, col, indexRow);
|
|
2578
2496
|
},
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
placeholder: t("Select"),
|
|
2584
|
-
className: classnames9("react-select", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
|
|
2585
|
-
onKeyDown: (e) => {
|
|
2586
|
-
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
2497
|
+
onPaste: (e) => {
|
|
2498
|
+
if (toolbarSetting?.showBottomToolbar && !editDisable && !addDisable) {
|
|
2499
|
+
pasteDataFromExcel(indexRow, indexCol, e);
|
|
2500
|
+
e.preventDefault();
|
|
2587
2501
|
}
|
|
2588
2502
|
}
|
|
2589
2503
|
}
|
|
2590
2504
|
);
|
|
2591
2505
|
case "selectTable":
|
|
2592
|
-
let
|
|
2593
|
-
let
|
|
2506
|
+
let valueSelect;
|
|
2507
|
+
let optionsSelect = [];
|
|
2594
2508
|
if (col.selectSettings?.optionsField) {
|
|
2595
|
-
|
|
2509
|
+
optionsSelect = row[col.selectSettings?.optionsField] ? row[col.selectSettings?.optionsField] : [];
|
|
2596
2510
|
} else {
|
|
2597
|
-
|
|
2511
|
+
optionsSelect = col.selectSettings?.options ? col.selectSettings?.validateOption ? col.selectSettings?.options.filter((item) => col.selectSettings?.validateOption(item, row)) : col.selectSettings?.options : [];
|
|
2598
2512
|
}
|
|
2599
2513
|
if (col.selectSettings?.isMulti) {
|
|
2600
|
-
|
|
2514
|
+
valueSelect = !isNullOrUndefined(row[col.field]) && row[col.field]?.length > 0 ? optionsSelect?.filter((val) => row[col.field]?.includes(val[col.selectSettings?.fieldValue ?? "value"])) : [];
|
|
2601
2515
|
} else {
|
|
2602
|
-
|
|
2516
|
+
valueSelect = !isNullOrUndefined(row[col.field]) && row[col.field] !== "" ? optionsSelect?.find((val) => val[col.selectSettings?.fieldValue ?? "value"] === row[col.field]) : "";
|
|
2603
2517
|
}
|
|
2604
2518
|
return /* @__PURE__ */ jsx16(
|
|
2605
2519
|
SelectTable,
|
|
2606
2520
|
{
|
|
2607
2521
|
id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
|
|
2608
|
-
value:
|
|
2609
|
-
options:
|
|
2522
|
+
value: valueSelect,
|
|
2523
|
+
options: optionsSelect,
|
|
2610
2524
|
rowData: row,
|
|
2611
2525
|
onChange: (val) => {
|
|
2612
2526
|
row[col.field] = col.selectSettings?.isMulti ? val?.map((item) => item[col.selectSettings?.fieldValue ?? "value"]) ?? [] : val ? val[col.selectSettings?.fieldValue ?? "value"] : void 0;
|
|
@@ -3615,9 +3529,10 @@ var TableEdit = forwardRef3((props, ref) => {
|
|
|
3615
3529
|
selectedRows,
|
|
3616
3530
|
setSelectedRows,
|
|
3617
3531
|
totalCount
|
|
3618
|
-
}
|
|
3532
|
+
},
|
|
3533
|
+
`header-${indexParent}-${index}`
|
|
3619
3534
|
);
|
|
3620
|
-
}) }, indexParent);
|
|
3535
|
+
}) }, `header-${-indexParent}`);
|
|
3621
3536
|
}) }),
|
|
3622
3537
|
/* @__PURE__ */ jsx16("tbody", { className: "r-gridcontent", children: renderData() }),
|
|
3623
3538
|
/* @__PURE__ */ jsx16("tfoot", { className: "r-gridfoot", children: haveSum == true ? /* @__PURE__ */ jsx16("tr", { className: "r-row", children: contentColumns.map((col, index) => {
|
|
@@ -3790,11 +3705,11 @@ var TabsMenuComponent = ({
|
|
|
3790
3705
|
};
|
|
3791
3706
|
|
|
3792
3707
|
// index.ts
|
|
3793
|
-
var
|
|
3708
|
+
var Table_edit_default = table_default;
|
|
3794
3709
|
export {
|
|
3795
3710
|
SelectTable,
|
|
3796
3711
|
TabsMenuComponent,
|
|
3797
|
-
|
|
3712
|
+
Table_edit_default as default,
|
|
3798
3713
|
formartNumberic,
|
|
3799
3714
|
generateUUID,
|
|
3800
3715
|
isNullOrUndefined,
|