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.js
CHANGED
|
@@ -28,11 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
30
|
// index.ts
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
31
|
+
var Table_edit_exports = {};
|
|
32
|
+
__export(Table_edit_exports, {
|
|
33
33
|
SelectTable: () => SelectTable,
|
|
34
34
|
TabsMenuComponent: () => TabsMenuComponent,
|
|
35
|
-
default: () =>
|
|
35
|
+
default: () => Table_edit_default,
|
|
36
36
|
formartNumberic: () => formartNumberic,
|
|
37
37
|
generateUUID: () => generateUUID,
|
|
38
38
|
isNullOrUndefined: () => isNullOrUndefined,
|
|
@@ -49,15 +49,13 @@ __export(Table_Edit_exports, {
|
|
|
49
49
|
roundNumber: () => roundNumber,
|
|
50
50
|
useOnClickOutside: () => useOnClickOutside
|
|
51
51
|
});
|
|
52
|
-
module.exports = __toCommonJS(
|
|
52
|
+
module.exports = __toCommonJS(Table_edit_exports);
|
|
53
53
|
|
|
54
54
|
// test-app/src/component/table/index.tsx
|
|
55
55
|
var import_react16 = require("react");
|
|
56
56
|
var import_reactstrap11 = require("reactstrap");
|
|
57
57
|
var import_classnames14 = __toESM(require("classnames"));
|
|
58
58
|
var import_react_i18next12 = require("react-i18next");
|
|
59
|
-
var import_react_select3 = __toESM(require("react-select"));
|
|
60
|
-
var import_async = __toESM(require("react-select/async"));
|
|
61
59
|
var import_becoxy_icons6 = require("becoxy-icons");
|
|
62
60
|
|
|
63
61
|
// test-app/src/component/react-input/index.tsx
|
|
@@ -330,26 +328,11 @@ var roundNumber = (num, fraction) => {
|
|
|
330
328
|
return result;
|
|
331
329
|
};
|
|
332
330
|
|
|
333
|
-
// test-app/src/component/icon/index.tsx
|
|
334
|
-
var Icon = __toESM(require("becoxy-icons"));
|
|
335
|
-
var import_react4 = require("react");
|
|
336
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
337
|
-
var IconCustom = (props) => {
|
|
338
|
-
const { iconName, size } = props;
|
|
339
|
-
if (iconName === "") {
|
|
340
|
-
return null;
|
|
341
|
-
} else {
|
|
342
|
-
const TagIcon = iconName === "" ? "" : Icon[iconName];
|
|
343
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Fragment, { children: iconName === "" ? "" : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(TagIcon, { fontSize: size }) });
|
|
344
|
-
}
|
|
345
|
-
};
|
|
346
|
-
var icon_default = IconCustom;
|
|
347
|
-
|
|
348
331
|
// test-app/src/component/table/index.tsx
|
|
349
332
|
var import_moment2 = __toESM(require("moment"));
|
|
350
333
|
|
|
351
334
|
// test-app/src/component/edit-form/index.tsx
|
|
352
|
-
var
|
|
335
|
+
var import_react8 = require("react");
|
|
353
336
|
var import_reactstrap6 = require("reactstrap");
|
|
354
337
|
var import_react_hook_form5 = require("react-hook-form");
|
|
355
338
|
var import_yup = require("@hookform/resolvers/yup");
|
|
@@ -360,28 +343,28 @@ var import_classnames6 = __toESM(require("classnames"));
|
|
|
360
343
|
var import_react_hook_form = require("react-hook-form");
|
|
361
344
|
var import_reactstrap2 = require("reactstrap");
|
|
362
345
|
var import_classnames2 = __toESM(require("classnames"));
|
|
363
|
-
var
|
|
346
|
+
var import_react4 = require("react");
|
|
364
347
|
var import_react_i18next = require("react-i18next");
|
|
365
|
-
var
|
|
348
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
366
349
|
var TextInput = (props) => {
|
|
367
350
|
const { t } = (0, import_react_i18next.useTranslation)();
|
|
368
351
|
const { control, id, name, min, max, type, label, labelSize, required, errors, height, disabled, row, isLabel, placeholder, autoFocus, inLine, callback, readOnly, classes, ...rest } = props;
|
|
369
352
|
const renderLabel = () => {
|
|
370
|
-
return /* @__PURE__ */ (0,
|
|
353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Fragment, { children: isLabel === false ? "" : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_reactstrap2.Label, { for: name, children: [
|
|
371
354
|
t(label ? label : ""),
|
|
372
355
|
" ",
|
|
373
|
-
required ? /* @__PURE__ */ (0,
|
|
356
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-danger", children: "*" }) : "",
|
|
374
357
|
" "
|
|
375
358
|
] }) });
|
|
376
359
|
};
|
|
377
360
|
const renderInput = () => {
|
|
378
|
-
return /* @__PURE__ */ (0,
|
|
379
|
-
/* @__PURE__ */ (0,
|
|
361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react4.Fragment, { children: [
|
|
362
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
380
363
|
import_react_hook_form.Controller,
|
|
381
364
|
{
|
|
382
365
|
name,
|
|
383
366
|
control,
|
|
384
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0,
|
|
367
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
385
368
|
import_reactstrap2.Input,
|
|
386
369
|
{
|
|
387
370
|
id,
|
|
@@ -423,10 +406,10 @@ var TextInput = (props) => {
|
|
|
423
406
|
)
|
|
424
407
|
}
|
|
425
408
|
),
|
|
426
|
-
errors && /* @__PURE__ */ (0,
|
|
409
|
+
errors && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_reactstrap2.FormFeedback, { children: errors?.message })
|
|
427
410
|
] });
|
|
428
411
|
};
|
|
429
|
-
return /* @__PURE__ */ (0,
|
|
412
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
430
413
|
"div",
|
|
431
414
|
{
|
|
432
415
|
className: (0, import_classnames2.default)(
|
|
@@ -440,7 +423,7 @@ var TextInput = (props) => {
|
|
|
440
423
|
),
|
|
441
424
|
children: [
|
|
442
425
|
renderLabel(),
|
|
443
|
-
/* @__PURE__ */ (0,
|
|
426
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: (0, import_classnames2.default)("form-input-content", { "hidden-label": isLabel === false }), children: renderInput() })
|
|
444
427
|
]
|
|
445
428
|
}
|
|
446
429
|
) });
|
|
@@ -452,9 +435,9 @@ var import_react_hook_form2 = require("react-hook-form");
|
|
|
452
435
|
var import_reactstrap3 = require("reactstrap");
|
|
453
436
|
var import_react_select = __toESM(require("react-select"));
|
|
454
437
|
var import_classnames3 = __toESM(require("classnames"));
|
|
455
|
-
var
|
|
438
|
+
var import_react5 = require("react");
|
|
456
439
|
var import_react_i18next2 = require("react-i18next");
|
|
457
|
-
var
|
|
440
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
458
441
|
var SelectBox = (props) => {
|
|
459
442
|
const { t } = (0, import_react_i18next2.useTranslation)();
|
|
460
443
|
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;
|
|
@@ -465,14 +448,14 @@ var SelectBox = (props) => {
|
|
|
465
448
|
}
|
|
466
449
|
};
|
|
467
450
|
const renderSelect = () => {
|
|
468
|
-
return /* @__PURE__ */ (0,
|
|
469
|
-
/* @__PURE__ */ (0,
|
|
451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react5.Fragment, { children: [
|
|
452
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
470
453
|
import_react_hook_form2.Controller,
|
|
471
454
|
{
|
|
472
455
|
name,
|
|
473
456
|
control,
|
|
474
457
|
render: ({ field: { value, onChange } }) => {
|
|
475
|
-
return /* @__PURE__ */ (0,
|
|
458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
476
459
|
import_react_select.default,
|
|
477
460
|
{
|
|
478
461
|
...rest,
|
|
@@ -507,10 +490,10 @@ var SelectBox = (props) => {
|
|
|
507
490
|
}
|
|
508
491
|
}
|
|
509
492
|
),
|
|
510
|
-
errors && /* @__PURE__ */ (0,
|
|
493
|
+
errors && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_reactstrap3.FormFeedback, { children: errors?.message })
|
|
511
494
|
] });
|
|
512
495
|
};
|
|
513
|
-
return /* @__PURE__ */ (0,
|
|
496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
514
497
|
"div",
|
|
515
498
|
{
|
|
516
499
|
className: (0, import_classnames3.default)(
|
|
@@ -523,13 +506,13 @@ var SelectBox = (props) => {
|
|
|
523
506
|
}
|
|
524
507
|
),
|
|
525
508
|
children: [
|
|
526
|
-
isLabel === false ? "" : /* @__PURE__ */ (0,
|
|
509
|
+
isLabel === false ? "" : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_reactstrap3.Label, { className: "form-label", for: name, children: [
|
|
527
510
|
t(label ? label : ""),
|
|
528
511
|
" ",
|
|
529
|
-
required ? /* @__PURE__ */ (0,
|
|
512
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-danger", children: "*" }) : "",
|
|
530
513
|
" "
|
|
531
514
|
] }),
|
|
532
|
-
/* @__PURE__ */ (0,
|
|
515
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_classnames3.default)("form-input-content", { "hidden-label": isLabel === false }), children: renderSelect() })
|
|
533
516
|
]
|
|
534
517
|
}
|
|
535
518
|
) });
|
|
@@ -540,14 +523,14 @@ var select_default = SelectBox;
|
|
|
540
523
|
var import_react_hook_form3 = require("react-hook-form");
|
|
541
524
|
var import_reactstrap4 = require("reactstrap");
|
|
542
525
|
var import_classnames4 = __toESM(require("classnames"));
|
|
543
|
-
var
|
|
526
|
+
var import_react6 = require("react");
|
|
544
527
|
var import_react_i18next3 = require("react-i18next");
|
|
545
528
|
var import_creatable = __toESM(require("react-select/creatable"));
|
|
546
|
-
var
|
|
529
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
547
530
|
var CreatableSelectBox = (props) => {
|
|
548
531
|
const { t } = (0, import_react_i18next3.useTranslation)();
|
|
549
532
|
const { isMulti, id, isLabel, control, placeholder, fieldValue, name, options, label, labelSize, required, errors, inLine, isClearable, labelComponent, onInputChange, callback, ...rest } = props;
|
|
550
|
-
return /* @__PURE__ */ (0,
|
|
533
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
551
534
|
"div",
|
|
552
535
|
{
|
|
553
536
|
className: (0, import_classnames4.default)(
|
|
@@ -559,19 +542,19 @@ var CreatableSelectBox = (props) => {
|
|
|
559
542
|
}
|
|
560
543
|
),
|
|
561
544
|
children: [
|
|
562
|
-
isLabel === false ? "" : /* @__PURE__ */ (0,
|
|
545
|
+
isLabel === false ? "" : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_reactstrap4.Label, { className: "form-label", for: name, children: [
|
|
563
546
|
t(label),
|
|
564
547
|
" ",
|
|
565
|
-
required ? /* @__PURE__ */ (0,
|
|
548
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-danger", children: "*" }) : "",
|
|
566
549
|
" "
|
|
567
550
|
] }),
|
|
568
|
-
/* @__PURE__ */ (0,
|
|
569
|
-
/* @__PURE__ */ (0,
|
|
551
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_classnames4.default)("form-input-content", { "hidden-label": isLabel === false }), children: [
|
|
552
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
570
553
|
import_react_hook_form3.Controller,
|
|
571
554
|
{
|
|
572
555
|
name,
|
|
573
556
|
control,
|
|
574
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0,
|
|
557
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
575
558
|
import_creatable.default,
|
|
576
559
|
{
|
|
577
560
|
...rest,
|
|
@@ -599,7 +582,7 @@ var CreatableSelectBox = (props) => {
|
|
|
599
582
|
)
|
|
600
583
|
}
|
|
601
584
|
),
|
|
602
|
-
errors && /* @__PURE__ */ (0,
|
|
585
|
+
errors && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.FormFeedback, { children: errors?.message })
|
|
603
586
|
] })
|
|
604
587
|
]
|
|
605
588
|
}
|
|
@@ -611,9 +594,9 @@ var creactable_select_default = CreatableSelectBox;
|
|
|
611
594
|
var import_react_hook_form4 = require("react-hook-form");
|
|
612
595
|
var import_reactstrap5 = require("reactstrap");
|
|
613
596
|
var import_classnames5 = __toESM(require("classnames"));
|
|
614
|
-
var
|
|
597
|
+
var import_react7 = require("react");
|
|
615
598
|
var import_react_i18next4 = require("react-i18next");
|
|
616
|
-
var
|
|
599
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
617
600
|
var NumberInput = (props) => {
|
|
618
601
|
const { t } = (0, import_react_i18next4.useTranslation)();
|
|
619
602
|
const {
|
|
@@ -643,21 +626,21 @@ var NumberInput = (props) => {
|
|
|
643
626
|
...rest
|
|
644
627
|
} = props;
|
|
645
628
|
const renderLabel = () => {
|
|
646
|
-
return /* @__PURE__ */ (0,
|
|
629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react7.Fragment, { children: isLabel === false ? "" : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_reactstrap5.Label, { className: "form-label", for: name, children: [
|
|
647
630
|
t(label ? label : ""),
|
|
648
631
|
" ",
|
|
649
|
-
required ? /* @__PURE__ */ (0,
|
|
632
|
+
required ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-danger", children: "*" }) : "",
|
|
650
633
|
" "
|
|
651
634
|
] }) });
|
|
652
635
|
};
|
|
653
636
|
const renderInput = () => {
|
|
654
|
-
return /* @__PURE__ */ (0,
|
|
655
|
-
/* @__PURE__ */ (0,
|
|
637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react7.Fragment, { children: [
|
|
638
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
656
639
|
import_react_hook_form4.Controller,
|
|
657
640
|
{
|
|
658
641
|
name,
|
|
659
642
|
control,
|
|
660
|
-
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0,
|
|
643
|
+
render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
661
644
|
import_reactstrap5.Input,
|
|
662
645
|
{
|
|
663
646
|
id,
|
|
@@ -717,10 +700,10 @@ var NumberInput = (props) => {
|
|
|
717
700
|
)
|
|
718
701
|
}
|
|
719
702
|
),
|
|
720
|
-
errors && /* @__PURE__ */ (0,
|
|
703
|
+
errors && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_reactstrap5.FormFeedback, { children: errors?.message })
|
|
721
704
|
] });
|
|
722
705
|
};
|
|
723
|
-
return /* @__PURE__ */ (0,
|
|
706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
724
707
|
"div",
|
|
725
708
|
{
|
|
726
709
|
className: (0, import_classnames5.default)(
|
|
@@ -734,7 +717,7 @@ var NumberInput = (props) => {
|
|
|
734
717
|
),
|
|
735
718
|
children: [
|
|
736
719
|
renderLabel(),
|
|
737
|
-
/* @__PURE__ */ (0,
|
|
720
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_classnames5.default)("form-input-content", { "hidden-label": isLabel === false }), children: renderInput() })
|
|
738
721
|
]
|
|
739
722
|
}
|
|
740
723
|
) });
|
|
@@ -742,9 +725,9 @@ var NumberInput = (props) => {
|
|
|
742
725
|
var input_number_default = NumberInput;
|
|
743
726
|
|
|
744
727
|
// test-app/src/component/edit-form/index.tsx
|
|
745
|
-
var
|
|
728
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
746
729
|
var defaultWidth = 200;
|
|
747
|
-
var EditForm = (0,
|
|
730
|
+
var EditForm = (0, import_react8.forwardRef)((props, ref) => {
|
|
748
731
|
const {
|
|
749
732
|
id,
|
|
750
733
|
field,
|
|
@@ -769,11 +752,11 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
769
752
|
labelSize = "label-small"
|
|
770
753
|
} = props;
|
|
771
754
|
const { innerWidth } = window;
|
|
772
|
-
const inputRef = (0,
|
|
773
|
-
const editFormRef = (0,
|
|
774
|
-
const buttonRef = (0,
|
|
775
|
-
const [dropdownOpen, setDropdownOpen] = (0,
|
|
776
|
-
const [itemsField, setItemsField] = (0,
|
|
755
|
+
const inputRef = (0, import_react8.useRef)();
|
|
756
|
+
const editFormRef = (0, import_react8.useRef)();
|
|
757
|
+
const buttonRef = (0, import_react8.useRef)();
|
|
758
|
+
const [dropdownOpen, setDropdownOpen] = (0, import_react8.useState)(false);
|
|
759
|
+
const [itemsField, setItemsField] = (0, import_react8.useState)([]);
|
|
777
760
|
const { t } = (0, import_react_i18next5.useTranslation)();
|
|
778
761
|
useOnClickOutside(editFormRef, () => {
|
|
779
762
|
closeMenu();
|
|
@@ -795,7 +778,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
795
778
|
defaultValues,
|
|
796
779
|
resolver: (0, import_yup.yupResolver)(schema)
|
|
797
780
|
});
|
|
798
|
-
(0,
|
|
781
|
+
(0, import_react8.useEffect)(() => {
|
|
799
782
|
if (dropdownOpen) {
|
|
800
783
|
if (onFormOpen && itemsField.length === 0) {
|
|
801
784
|
onFormOpen(rowData, itemsField, setItemsField);
|
|
@@ -807,7 +790,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
807
790
|
}
|
|
808
791
|
}
|
|
809
792
|
}, [dropdownOpen]);
|
|
810
|
-
(0,
|
|
793
|
+
(0, import_react8.useEffect)(() => {
|
|
811
794
|
if (dropdownOpen && itemsField.length > 0) {
|
|
812
795
|
itemsField.forEach((ele) => {
|
|
813
796
|
setValue(ele.name, rowData[ele.name] ?? "");
|
|
@@ -912,9 +895,9 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
912
895
|
}
|
|
913
896
|
};
|
|
914
897
|
const renderForm = (rows) => {
|
|
915
|
-
return /* @__PURE__ */ (0,
|
|
898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Row, { className: "gy-25", children: rows.map((item, index) => {
|
|
916
899
|
if (item.type === "numeric") {
|
|
917
|
-
return /* @__PURE__ */ (0,
|
|
900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
918
901
|
input_number_default,
|
|
919
902
|
{
|
|
920
903
|
id: `form-element-${field}-${index}`,
|
|
@@ -934,7 +917,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
934
917
|
index
|
|
935
918
|
) }, index);
|
|
936
919
|
} else if (item.type === "text") {
|
|
937
|
-
return /* @__PURE__ */ (0,
|
|
920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
938
921
|
input_text_default,
|
|
939
922
|
{
|
|
940
923
|
id: `form-element-${field}-${index}`,
|
|
@@ -951,7 +934,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
951
934
|
index
|
|
952
935
|
) }, index);
|
|
953
936
|
} else if (item.type === "select") {
|
|
954
|
-
return /* @__PURE__ */ (0,
|
|
937
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
955
938
|
select_default,
|
|
956
939
|
{
|
|
957
940
|
id: `form-element-${field}-${index}`,
|
|
@@ -970,7 +953,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
970
953
|
index
|
|
971
954
|
) }, index);
|
|
972
955
|
} else if (item.type === "selectCreatable") {
|
|
973
|
-
return /* @__PURE__ */ (0,
|
|
956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
974
957
|
creactable_select_default,
|
|
975
958
|
{
|
|
976
959
|
id: `form-element-${field}-${index}`,
|
|
@@ -991,20 +974,20 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
991
974
|
}
|
|
992
975
|
}) });
|
|
993
976
|
};
|
|
994
|
-
return /* @__PURE__ */ (0,
|
|
977
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
995
978
|
"div",
|
|
996
979
|
{
|
|
997
980
|
className: "form-edit",
|
|
998
981
|
ref,
|
|
999
982
|
id,
|
|
1000
|
-
children: /* @__PURE__ */ (0,
|
|
983
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref: editFormRef, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1001
984
|
import_reactstrap6.Dropdown,
|
|
1002
985
|
{
|
|
1003
986
|
isOpen: dropdownOpen,
|
|
1004
987
|
toggle: () => {
|
|
1005
988
|
},
|
|
1006
989
|
children: [
|
|
1007
|
-
/* @__PURE__ */ (0,
|
|
990
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.DropdownToggle, { tag: "div", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1008
991
|
import_reactstrap6.Input,
|
|
1009
992
|
{
|
|
1010
993
|
style: { backgroundColor: "#FFF", textAlign: textAlign ?? "left" },
|
|
@@ -1019,7 +1002,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
1019
1002
|
readOnly: true
|
|
1020
1003
|
}
|
|
1021
1004
|
) }),
|
|
1022
|
-
/* @__PURE__ */ (0,
|
|
1005
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1023
1006
|
import_reactstrap6.DropdownMenu,
|
|
1024
1007
|
{
|
|
1025
1008
|
className: "formula-dropdown icon-dropdown p-0",
|
|
@@ -1030,8 +1013,8 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
1030
1013
|
borderRadius: 8,
|
|
1031
1014
|
zIndex: 1056
|
|
1032
1015
|
},
|
|
1033
|
-
children: /* @__PURE__ */ (0,
|
|
1034
|
-
/* @__PURE__ */ (0,
|
|
1016
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.DropdownItem, { className: "p-0", style: { borderRadius: "6px" }, tag: "div", header: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_reactstrap6.Form, { className: "todo-modal", onKeyDown: (e) => formKeyDown(e, handleSubmit(handleOnSubmit)), children: [
|
|
1017
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1035
1018
|
"div",
|
|
1036
1019
|
{
|
|
1037
1020
|
className: "p-1",
|
|
@@ -1042,9 +1025,9 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
1042
1025
|
children: itemsField ? renderForm(itemsField) : ""
|
|
1043
1026
|
}
|
|
1044
1027
|
),
|
|
1045
|
-
/* @__PURE__ */ (0,
|
|
1046
|
-
/* @__PURE__ */ (0,
|
|
1047
|
-
!onChangeField ? /* @__PURE__ */ (0,
|
|
1028
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "d-flex justify-content-between p-50", style: { boxShadow: "0 4px 24px 0 rgb(34 41 47 / 10%)" }, children: [
|
|
1029
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-primary py-25", style: { fontSize: 12 }, children: footerTemplate ? footerTemplate(rowData) : "" }),
|
|
1030
|
+
!onChangeField ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1048
1031
|
import_reactstrap6.Button,
|
|
1049
1032
|
{
|
|
1050
1033
|
ref: buttonRef,
|
|
@@ -1058,7 +1041,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
1058
1041
|
},
|
|
1059
1042
|
children: t("Save")
|
|
1060
1043
|
}
|
|
1061
|
-
) }) : /* @__PURE__ */ (0,
|
|
1044
|
+
) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, {})
|
|
1062
1045
|
] })
|
|
1063
1046
|
] }) })
|
|
1064
1047
|
}
|
|
@@ -1072,7 +1055,7 @@ var EditForm = (0, import_react9.forwardRef)((props, ref) => {
|
|
|
1072
1055
|
var edit_form_default = EditForm;
|
|
1073
1056
|
|
|
1074
1057
|
// test-app/src/component/sidebar-setting-column/index.tsx
|
|
1075
|
-
var
|
|
1058
|
+
var import_react10 = require("react");
|
|
1076
1059
|
var import_reactstrap7 = require("reactstrap");
|
|
1077
1060
|
var import_react_i18next7 = require("react-i18next");
|
|
1078
1061
|
|
|
@@ -1080,35 +1063,35 @@ var import_react_i18next7 = require("react-i18next");
|
|
|
1080
1063
|
var import_becoxy_icons2 = require("becoxy-icons");
|
|
1081
1064
|
var import_classnames7 = __toESM(require("classnames"));
|
|
1082
1065
|
var import_react_i18next6 = require("react-i18next");
|
|
1083
|
-
var
|
|
1066
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1084
1067
|
var ModalHeader = (props) => {
|
|
1085
1068
|
const { title, handleModal, typeModal = "Edit", component } = props;
|
|
1086
1069
|
const { t } = (0, import_react_i18next6.useTranslation)();
|
|
1087
1070
|
const handleModalIcon = () => {
|
|
1088
1071
|
if (typeModal === "Edit" || typeModal === "Approval") {
|
|
1089
|
-
return /* @__PURE__ */ (0,
|
|
1072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons2.Edit, { fontSize: 17, className: "me-1" });
|
|
1090
1073
|
} else if (typeModal === "View") {
|
|
1091
|
-
return /* @__PURE__ */ (0,
|
|
1074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons2.Info, { fontSize: 17, className: "me-1" });
|
|
1092
1075
|
} else if (typeModal === "Detail") {
|
|
1093
|
-
return /* @__PURE__ */ (0,
|
|
1076
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons2.Info, { fontSize: 17, className: "me-1" });
|
|
1094
1077
|
} else if (typeModal === "Order") {
|
|
1095
|
-
return /* @__PURE__ */ (0,
|
|
1078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "e-icons e-sorting-1 me-1", style: { fontSize: "14px" } });
|
|
1096
1079
|
} else if (typeModal === "Process") {
|
|
1097
|
-
return /* @__PURE__ */ (0,
|
|
1080
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "e-flat e-icons e-paste-match-destination me-1", style: { fontSize: "14px" } });
|
|
1098
1081
|
} else {
|
|
1099
|
-
return /* @__PURE__ */ (0,
|
|
1082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons2.Plus, { fontSize: 17, className: "me-1" });
|
|
1100
1083
|
}
|
|
1101
1084
|
};
|
|
1102
|
-
return /* @__PURE__ */ (0,
|
|
1103
|
-
/* @__PURE__ */ (0,
|
|
1104
|
-
/* @__PURE__ */ (0,
|
|
1085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "modal-header d-flex align-items-center justify-content-between mb-1", children: [
|
|
1086
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "d-flex align-items-center justify-content-start", children: [
|
|
1087
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h5", { className: "modal-title", children: [
|
|
1105
1088
|
handleModalIcon(),
|
|
1106
1089
|
" ",
|
|
1107
1090
|
t(title)
|
|
1108
1091
|
] }),
|
|
1109
|
-
component ? component() : /* @__PURE__ */ (0,
|
|
1092
|
+
component ? component() : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, {})
|
|
1110
1093
|
] }),
|
|
1111
|
-
/* @__PURE__ */ (0,
|
|
1094
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "todo-item-action d-flex align-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1112
1095
|
import_becoxy_icons2.X,
|
|
1113
1096
|
{
|
|
1114
1097
|
className: (0, import_classnames7.default)("fw-normal mt-25 cursor-pointer", { "d-none": !handleModal }),
|
|
@@ -1123,8 +1106,8 @@ var modal_header_default = ModalHeader;
|
|
|
1123
1106
|
// test-app/src/component/sidebar/index.tsx
|
|
1124
1107
|
var import_becoxy_icons3 = require("becoxy-icons");
|
|
1125
1108
|
var import_classnames8 = __toESM(require("classnames"));
|
|
1126
|
-
var
|
|
1127
|
-
var
|
|
1109
|
+
var import_react9 = require("react");
|
|
1110
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1128
1111
|
var Sidebar = (props) => {
|
|
1129
1112
|
const {
|
|
1130
1113
|
open,
|
|
@@ -1135,9 +1118,9 @@ var Sidebar = (props) => {
|
|
|
1135
1118
|
hiddenBackground,
|
|
1136
1119
|
hiddenFullScreenButton
|
|
1137
1120
|
} = props;
|
|
1138
|
-
const [isFullScreen, setIsFullScreen] = (0,
|
|
1139
|
-
const [flag, setFlag] = (0,
|
|
1140
|
-
(0,
|
|
1121
|
+
const [isFullScreen, setIsFullScreen] = (0, import_react9.useState)(false);
|
|
1122
|
+
const [flag, setFlag] = (0, import_react9.useState)(open);
|
|
1123
|
+
(0, import_react9.useEffect)(() => {
|
|
1141
1124
|
if (open !== flag) {
|
|
1142
1125
|
if (open) {
|
|
1143
1126
|
setFlag(open);
|
|
@@ -1154,7 +1137,7 @@ var Sidebar = (props) => {
|
|
|
1154
1137
|
toggleSidebar();
|
|
1155
1138
|
}, 400);
|
|
1156
1139
|
};
|
|
1157
|
-
return /* @__PURE__ */ (0,
|
|
1140
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1158
1141
|
"div",
|
|
1159
1142
|
{
|
|
1160
1143
|
tabIndex: 0,
|
|
@@ -1167,7 +1150,7 @@ var Sidebar = (props) => {
|
|
|
1167
1150
|
}
|
|
1168
1151
|
},
|
|
1169
1152
|
children: [
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1153
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1171
1154
|
"div",
|
|
1172
1155
|
{
|
|
1173
1156
|
className: (0, import_classnames8.default)("offcanvas-backdrop fade", {
|
|
@@ -1178,7 +1161,7 @@ var Sidebar = (props) => {
|
|
|
1178
1161
|
onClick: handClose
|
|
1179
1162
|
}
|
|
1180
1163
|
),
|
|
1181
|
-
/* @__PURE__ */ (0,
|
|
1164
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1182
1165
|
"div",
|
|
1183
1166
|
{
|
|
1184
1167
|
className: (0, import_classnames8.default)("customizer d-none d-md-block ", `customizer-${width ?? 600}`, {
|
|
@@ -1187,7 +1170,7 @@ var Sidebar = (props) => {
|
|
|
1187
1170
|
}),
|
|
1188
1171
|
style: { zIndex: 1057 },
|
|
1189
1172
|
children: [
|
|
1190
|
-
/* @__PURE__ */ (0,
|
|
1173
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1191
1174
|
"div",
|
|
1192
1175
|
{
|
|
1193
1176
|
style: {
|
|
@@ -1209,8 +1192,8 @@ var Sidebar = (props) => {
|
|
|
1209
1192
|
setIsFullScreen(!isFullScreen);
|
|
1210
1193
|
},
|
|
1211
1194
|
children: [
|
|
1212
|
-
/* @__PURE__ */ (0,
|
|
1213
|
-
/* @__PURE__ */ (0,
|
|
1195
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_becoxy_icons3.ChevronLeft, { className: `${isFullScreen ? "d-none" : ""}`, fontSize: 16 }),
|
|
1196
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_becoxy_icons3.ChevronRight, { className: `${!isFullScreen ? "d-none" : ""}`, fontSize: 15 })
|
|
1214
1197
|
]
|
|
1215
1198
|
}
|
|
1216
1199
|
),
|
|
@@ -1226,13 +1209,13 @@ var sidebar_default = Sidebar;
|
|
|
1226
1209
|
|
|
1227
1210
|
// test-app/src/component/sidebar-setting-column/index.tsx
|
|
1228
1211
|
var import_classnames9 = __toESM(require("classnames"));
|
|
1229
|
-
var
|
|
1212
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1230
1213
|
var SidebarSetColumn = (props) => {
|
|
1231
1214
|
const { column, setColumn, openSidebar, handleSidebar } = props;
|
|
1232
1215
|
const { t } = (0, import_react_i18next7.useTranslation)();
|
|
1233
|
-
const [dataSource, setDataSource] = (0,
|
|
1234
|
-
const [indexFocus, setIndexFocus] = (0,
|
|
1235
|
-
(0,
|
|
1216
|
+
const [dataSource, setDataSource] = (0, import_react10.useState)([]);
|
|
1217
|
+
const [indexFocus, setIndexFocus] = (0, import_react10.useState)();
|
|
1218
|
+
(0, import_react10.useEffect)(() => {
|
|
1236
1219
|
if (openSidebar) {
|
|
1237
1220
|
setDataSource(column.map((e) => ({ ...e })));
|
|
1238
1221
|
}
|
|
@@ -1249,8 +1232,8 @@ var SidebarSetColumn = (props) => {
|
|
|
1249
1232
|
const { innerWidth, innerHeight } = window;
|
|
1250
1233
|
return { innerWidth, innerHeight };
|
|
1251
1234
|
};
|
|
1252
|
-
const [windowSize, setWindowSize] = (0,
|
|
1253
|
-
(0,
|
|
1235
|
+
const [windowSize, setWindowSize] = (0, import_react10.useState)(getWindowSize());
|
|
1236
|
+
(0, import_react10.useEffect)(() => {
|
|
1254
1237
|
const handleWindowResize = () => {
|
|
1255
1238
|
setWindowSize(getWindowSize());
|
|
1256
1239
|
};
|
|
@@ -1260,13 +1243,13 @@ var SidebarSetColumn = (props) => {
|
|
|
1260
1243
|
};
|
|
1261
1244
|
}, []);
|
|
1262
1245
|
const renderFooterButtons = () => {
|
|
1263
|
-
return /* @__PURE__ */ (0,
|
|
1264
|
-
/* @__PURE__ */ (0,
|
|
1265
|
-
/* @__PURE__ */ (0,
|
|
1246
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react10.Fragment, { children: [
|
|
1247
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "primary", onClick: handleSubmit, className: "me-1", children: t("Confirm") }),
|
|
1248
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "secondary", onClick: handleCancel, outline: true, children: t("Close") })
|
|
1266
1249
|
] });
|
|
1267
1250
|
};
|
|
1268
1251
|
const visibleTemplate = (item, index) => {
|
|
1269
|
-
return /* @__PURE__ */ (0,
|
|
1252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1270
1253
|
import_reactstrap7.Input,
|
|
1271
1254
|
{
|
|
1272
1255
|
defaultChecked: item.visible ?? true,
|
|
@@ -1284,7 +1267,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1284
1267
|
);
|
|
1285
1268
|
};
|
|
1286
1269
|
const fixColumnTemplate = (item, index) => {
|
|
1287
|
-
return /* @__PURE__ */ (0,
|
|
1270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1288
1271
|
import_reactstrap7.Input,
|
|
1289
1272
|
{
|
|
1290
1273
|
defaultChecked: item.fixedType === "left" || item.fixedType === "right",
|
|
@@ -1313,7 +1296,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1313
1296
|
field: "headerText",
|
|
1314
1297
|
headerText: "Column name",
|
|
1315
1298
|
template: (e) => {
|
|
1316
|
-
return /* @__PURE__ */ (0,
|
|
1299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: t(e.headerText) });
|
|
1317
1300
|
},
|
|
1318
1301
|
visible: true,
|
|
1319
1302
|
width: 175,
|
|
@@ -1351,10 +1334,10 @@ var SidebarSetColumn = (props) => {
|
|
|
1351
1334
|
}
|
|
1352
1335
|
];
|
|
1353
1336
|
const renderHeaderCol = (col, indexCol) => {
|
|
1354
|
-
return /* @__PURE__ */ (0,
|
|
1355
|
-
|
|
1337
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1338
|
+
import_react10.Fragment,
|
|
1356
1339
|
{
|
|
1357
|
-
children: col.visible !== false && /* @__PURE__ */ (0,
|
|
1340
|
+
children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1358
1341
|
"th",
|
|
1359
1342
|
{
|
|
1360
1343
|
className: (0, import_classnames9.default)(
|
|
@@ -1367,7 +1350,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1367
1350
|
top: `${0 * 42}px`,
|
|
1368
1351
|
maxWidth: col.maxWidth
|
|
1369
1352
|
},
|
|
1370
|
-
children: /* @__PURE__ */ (0,
|
|
1353
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1371
1354
|
"div",
|
|
1372
1355
|
{
|
|
1373
1356
|
role: "textbox",
|
|
@@ -1386,20 +1369,20 @@ var SidebarSetColumn = (props) => {
|
|
|
1386
1369
|
`header-${indexCol}`
|
|
1387
1370
|
);
|
|
1388
1371
|
};
|
|
1389
|
-
return /* @__PURE__ */ (0,
|
|
1372
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
1390
1373
|
sidebar_default,
|
|
1391
1374
|
{
|
|
1392
1375
|
open: openSidebar,
|
|
1393
1376
|
toggleSidebar: handleCancel,
|
|
1394
1377
|
width: 700,
|
|
1395
1378
|
children: [
|
|
1396
|
-
/* @__PURE__ */ (0,
|
|
1397
|
-
/* @__PURE__ */ (0,
|
|
1398
|
-
/* @__PURE__ */ (0,
|
|
1379
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(modal_header_default, { typeModal: "Edit", handleModal: handleCancel, title: "Column setup" }),
|
|
1380
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ms-2 react-table-edit", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "r-grid", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "r-gridtable", style: { height: windowSize.innerHeight - 120 }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("table", { style: { width: "100%" }, children: [
|
|
1381
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("thead", { className: "r-gridheader", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tr", { className: "r-row", role: "row", children: columns.map((col, index) => {
|
|
1399
1382
|
return renderHeaderCol(col, index);
|
|
1400
1383
|
}) }) }),
|
|
1401
|
-
/* @__PURE__ */ (0,
|
|
1402
|
-
return /* @__PURE__ */ (0,
|
|
1384
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tbody", { className: "r-gridcontent", children: dataSource?.map((row, indexRow) => {
|
|
1385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1403
1386
|
"tr",
|
|
1404
1387
|
{
|
|
1405
1388
|
className: (0, import_classnames9.default)("r-row", { "last-row": indexRow === dataSource.length - 1 }, { "fisrt-row": indexRow === 0 }),
|
|
@@ -1408,7 +1391,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1408
1391
|
if (col.editType === "numeric" || col.editTypeCondition && col.editTypeCondition(row) === "numeric") {
|
|
1409
1392
|
value = formartNumberic(row[col.field], ",", ".", col.numericSettings?.fraction, true) ?? 0;
|
|
1410
1393
|
}
|
|
1411
|
-
return /* @__PURE__ */ (0,
|
|
1394
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react10.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1412
1395
|
"td",
|
|
1413
1396
|
{
|
|
1414
1397
|
className: (0, import_classnames9.default)(
|
|
@@ -1434,21 +1417,21 @@ var SidebarSetColumn = (props) => {
|
|
|
1434
1417
|
e.stopPropagation();
|
|
1435
1418
|
}
|
|
1436
1419
|
},
|
|
1437
|
-
children: /* @__PURE__ */ (0,
|
|
1420
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1438
1421
|
"div",
|
|
1439
1422
|
{
|
|
1440
1423
|
className: (0, import_classnames9.default)("r-rowcell-div"),
|
|
1441
1424
|
style: {
|
|
1442
1425
|
width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto"
|
|
1443
1426
|
},
|
|
1444
|
-
children: /* @__PURE__ */ (0,
|
|
1427
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1445
1428
|
"div",
|
|
1446
1429
|
{
|
|
1447
1430
|
className: (0, import_classnames9.default)("r-rowcell-content"),
|
|
1448
1431
|
style: {
|
|
1449
1432
|
margin: "7px 9px"
|
|
1450
1433
|
},
|
|
1451
|
-
children: /* @__PURE__ */ (0,
|
|
1434
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "r-cell-text", children: col.template ? col.template(row, indexRow) : value })
|
|
1452
1435
|
}
|
|
1453
1436
|
)
|
|
1454
1437
|
}
|
|
@@ -1462,7 +1445,7 @@ var SidebarSetColumn = (props) => {
|
|
|
1462
1445
|
);
|
|
1463
1446
|
}) })
|
|
1464
1447
|
] }) }) }) }),
|
|
1465
|
-
/* @__PURE__ */ (0,
|
|
1448
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1466
1449
|
"div",
|
|
1467
1450
|
{
|
|
1468
1451
|
className: "d-flex justify-content-end p-1 ",
|
|
@@ -1482,25 +1465,25 @@ var import_ej2_react_dropdowns = require("@syncfusion/ej2-react-dropdowns");
|
|
|
1482
1465
|
// test-app/src/component/paging/index.tsx
|
|
1483
1466
|
var import_becoxy_icons4 = require("becoxy-icons");
|
|
1484
1467
|
var import_classnames10 = __toESM(require("classnames"));
|
|
1485
|
-
var
|
|
1468
|
+
var import_react11 = require("react");
|
|
1486
1469
|
var import_react_i18next8 = require("react-i18next");
|
|
1487
1470
|
var import_react_select2 = __toESM(require("react-select"));
|
|
1488
|
-
var
|
|
1471
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1489
1472
|
var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
|
|
1490
1473
|
const { t } = (0, import_react_i18next8.useTranslation)();
|
|
1491
|
-
const [countPage, setCountPage] = (0,
|
|
1492
|
-
const [currentPageNumber, setCurrentPageNumber] = (0,
|
|
1493
|
-
(0,
|
|
1474
|
+
const [countPage, setCountPage] = (0, import_react11.useState)(0);
|
|
1475
|
+
const [currentPageNumber, setCurrentPageNumber] = (0, import_react11.useState)(1);
|
|
1476
|
+
(0, import_react11.useEffect)(() => {
|
|
1494
1477
|
setCountPage(Math.floor(totalItem / pageSize) + (Math.floor(totalItem / pageSize) === totalItem / pageSize ? 0 : 1));
|
|
1495
1478
|
}, [totalItem, pageSize]);
|
|
1496
|
-
(0,
|
|
1479
|
+
(0, import_react11.useEffect)(() => {
|
|
1497
1480
|
setCurrentPageNumber(Math.floor(currentPage / 5) + (Math.floor(currentPage / 5) === currentPage / 5 ? 0 : 1));
|
|
1498
1481
|
}, [currentPage]);
|
|
1499
1482
|
const renderPageNumber = (number) => {
|
|
1500
1483
|
const arr = [];
|
|
1501
1484
|
for (let index = (number - 1) * 5 + 1; index <= number * 5 && index <= Math.floor(totalItem / pageSize) + (Math.floor(totalItem / pageSize) === totalItem / pageSize ? 0 : 1); index++) {
|
|
1502
1485
|
arr.push(
|
|
1503
|
-
/* @__PURE__ */ (0,
|
|
1486
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1504
1487
|
"div",
|
|
1505
1488
|
{
|
|
1506
1489
|
className: (0, import_classnames10.default)("r-number", { "r-active": index === currentPage }),
|
|
@@ -1515,11 +1498,11 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
1515
1498
|
}
|
|
1516
1499
|
return arr;
|
|
1517
1500
|
};
|
|
1518
|
-
return /* @__PURE__ */ (0,
|
|
1519
|
-
/* @__PURE__ */ (0,
|
|
1520
|
-
/* @__PURE__ */ (0,
|
|
1521
|
-
/* @__PURE__ */ (0,
|
|
1522
|
-
/* @__PURE__ */ (0,
|
|
1501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react11.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "r-pager", children: [
|
|
1502
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "r-pagercontainer", children: [
|
|
1503
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { className: "r-button", type: "button", disabled: countPage <= 1 || currentPage === 1, onClick: () => onChangePage({ totalItem, pageSize, currentPage: 1, old: currentPage }), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_becoxy_icons4.ChevronsLeft, { fontSize: 16 }) }),
|
|
1504
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { className: "r-button", type: "button", disabled: countPage <= 1 || currentPage === 1, onClick: () => onChangePage({ totalItem, pageSize, currentPage: currentPage - 1, old: currentPage }), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_becoxy_icons4.ChevronLeft, { fontSize: 16 }) }),
|
|
1505
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1523
1506
|
"button",
|
|
1524
1507
|
{
|
|
1525
1508
|
className: (0, import_classnames10.default)("r-button", { "d-none": currentPageNumber === 1 }),
|
|
@@ -1532,7 +1515,7 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
1532
1515
|
}
|
|
1533
1516
|
),
|
|
1534
1517
|
renderPageNumber(currentPageNumber),
|
|
1535
|
-
/* @__PURE__ */ (0,
|
|
1518
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1536
1519
|
"button",
|
|
1537
1520
|
{
|
|
1538
1521
|
className: (0, import_classnames10.default)("r-button", { "d-none": currentPageNumber * 5 >= countPage }),
|
|
@@ -1544,9 +1527,9 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
1544
1527
|
children: "..."
|
|
1545
1528
|
}
|
|
1546
1529
|
),
|
|
1547
|
-
/* @__PURE__ */ (0,
|
|
1548
|
-
/* @__PURE__ */ (0,
|
|
1549
|
-
/* @__PURE__ */ (0,
|
|
1530
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { className: "r-button", type: "button", disabled: countPage <= 1 || countPage === currentPage, onClick: () => onChangePage({ totalItem, pageSize, currentPage: currentPage + 1, old: currentPage }), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_becoxy_icons4.ChevronRight, { fontSize: 16 }) }),
|
|
1531
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("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__ */ (0, import_jsx_runtime11.jsx)(import_becoxy_icons4.ChevronsRight, { fontSize: 16 }) }),
|
|
1532
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-pagesize", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1550
1533
|
import_react_select2.default,
|
|
1551
1534
|
{
|
|
1552
1535
|
value: { value: pageSize, label: pageSize },
|
|
@@ -1559,22 +1542,22 @@ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOpt
|
|
|
1559
1542
|
classNamePrefix: "select-pagesize"
|
|
1560
1543
|
}
|
|
1561
1544
|
) }),
|
|
1562
|
-
/* @__PURE__ */ (0,
|
|
1545
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("pagerDropDown") })
|
|
1563
1546
|
] }),
|
|
1564
|
-
/* @__PURE__ */ (0,
|
|
1547
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-parentmsgbar", children: t("totalItemsInfo", { page: currentPage, countPage, totalItem }) })
|
|
1565
1548
|
] }) });
|
|
1566
1549
|
};
|
|
1567
1550
|
|
|
1568
1551
|
// test-app/src/component/select-table/index.tsx
|
|
1569
|
-
var
|
|
1552
|
+
var import_react12 = require("react");
|
|
1570
1553
|
var import_reactstrap8 = require("reactstrap");
|
|
1571
1554
|
var import_react_i18next9 = require("react-i18next");
|
|
1572
1555
|
var import_classnames11 = __toESM(require("classnames"));
|
|
1573
1556
|
var import_moment = __toESM(require("moment"));
|
|
1574
1557
|
var import_becoxy_icons5 = require("becoxy-icons");
|
|
1575
|
-
var
|
|
1558
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1576
1559
|
var defaultMaxHeight = 300;
|
|
1577
|
-
var SelectTable = (0,
|
|
1560
|
+
var SelectTable = (0, import_react12.forwardRef)((props, ref) => {
|
|
1578
1561
|
const {
|
|
1579
1562
|
id,
|
|
1580
1563
|
menuWidth,
|
|
@@ -1601,17 +1584,17 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1601
1584
|
showFooter,
|
|
1602
1585
|
onPaste
|
|
1603
1586
|
} = props;
|
|
1604
|
-
const selectTableRef = (0,
|
|
1605
|
-
const selectMenuTableRef = (0,
|
|
1606
|
-
const inputRef = (0,
|
|
1607
|
-
const [dropdownOpen, setDropdownOpen] = (0,
|
|
1608
|
-
const [indexFocus, setIndexFocus] = (0,
|
|
1609
|
-
const [isFocus, setIsFocus] = (0,
|
|
1610
|
-
const [isLoading, setIsLoading] = (0,
|
|
1611
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
1612
|
-
const [optionsLoad, setOptionsLoad] = (0,
|
|
1587
|
+
const selectTableRef = (0, import_react12.useRef)();
|
|
1588
|
+
const selectMenuTableRef = (0, import_react12.useRef)();
|
|
1589
|
+
const inputRef = (0, import_react12.useRef)();
|
|
1590
|
+
const [dropdownOpen, setDropdownOpen] = (0, import_react12.useState)(false);
|
|
1591
|
+
const [indexFocus, setIndexFocus] = (0, import_react12.useState)(-1);
|
|
1592
|
+
const [isFocus, setIsFocus] = (0, import_react12.useState)(false);
|
|
1593
|
+
const [isLoading, setIsLoading] = (0, import_react12.useState)(false);
|
|
1594
|
+
const [searchTerm, setSearchTerm] = (0, import_react12.useState)("");
|
|
1595
|
+
const [optionsLoad, setOptionsLoad] = (0, import_react12.useState)();
|
|
1613
1596
|
const { t } = (0, import_react_i18next9.useTranslation)();
|
|
1614
|
-
const isSelectedAll = (0,
|
|
1597
|
+
const isSelectedAll = (0, import_react12.useMemo)(() => {
|
|
1615
1598
|
return isMulti === true && (optionsLoad ? optionsLoad : options).length > 0 && value?.length >= (optionsLoad ? optionsLoad : options).length;
|
|
1616
1599
|
}, [optionsLoad, options, value]);
|
|
1617
1600
|
const defaultColumns = [
|
|
@@ -1633,7 +1616,7 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1633
1616
|
const closeMenu = () => {
|
|
1634
1617
|
setDropdownOpen(false);
|
|
1635
1618
|
};
|
|
1636
|
-
(0,
|
|
1619
|
+
(0, import_react12.useEffect)(() => {
|
|
1637
1620
|
if (dropdownOpen) {
|
|
1638
1621
|
if (value) {
|
|
1639
1622
|
if (selectMenuTableRef) {
|
|
@@ -1652,17 +1635,12 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1652
1635
|
}
|
|
1653
1636
|
}
|
|
1654
1637
|
}, [dropdownOpen]);
|
|
1655
|
-
|
|
1656
|
-
(0, import_react13.useEffect)(() => {
|
|
1638
|
+
(0, import_react12.useEffect)(() => {
|
|
1657
1639
|
if (inputRef && !isDisabled) {
|
|
1658
1640
|
inputRef.current.addEventListener("blur", function() {
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
setSearchTerm("");
|
|
1663
|
-
setIsFocus(false);
|
|
1664
|
-
}
|
|
1665
|
-
}, 100);
|
|
1641
|
+
setDropdownOpen(false);
|
|
1642
|
+
setSearchTerm("");
|
|
1643
|
+
setIsFocus(false);
|
|
1666
1644
|
});
|
|
1667
1645
|
inputRef.current.addEventListener("focus", function() {
|
|
1668
1646
|
if (!isFocus) {
|
|
@@ -1671,7 +1649,7 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1671
1649
|
});
|
|
1672
1650
|
}
|
|
1673
1651
|
}, [inputRef]);
|
|
1674
|
-
(0,
|
|
1652
|
+
(0, import_react12.useEffect)(() => {
|
|
1675
1653
|
if (searchTerm && !dropdownOpen) {
|
|
1676
1654
|
setDropdownOpen(true);
|
|
1677
1655
|
setIndexFocus(0);
|
|
@@ -1787,10 +1765,10 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1787
1765
|
}, 100);
|
|
1788
1766
|
};
|
|
1789
1767
|
const renderHeaderCol = (col, indexCol) => {
|
|
1790
|
-
return /* @__PURE__ */ (0,
|
|
1791
|
-
|
|
1768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1769
|
+
import_react12.Fragment,
|
|
1792
1770
|
{
|
|
1793
|
-
children: col.visible !== false && /* @__PURE__ */ (0,
|
|
1771
|
+
children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1794
1772
|
"th",
|
|
1795
1773
|
{
|
|
1796
1774
|
className: (0, import_classnames11.default)(
|
|
@@ -1803,7 +1781,7 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1803
1781
|
top: `${0 * 35}px`,
|
|
1804
1782
|
maxWidth: col.maxWidth
|
|
1805
1783
|
},
|
|
1806
|
-
children: /* @__PURE__ */ (0,
|
|
1784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1807
1785
|
"div",
|
|
1808
1786
|
{
|
|
1809
1787
|
role: "textbox",
|
|
@@ -1838,7 +1816,7 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1838
1816
|
setIsLoading(false);
|
|
1839
1817
|
setOptionsLoad(rs);
|
|
1840
1818
|
};
|
|
1841
|
-
(0,
|
|
1819
|
+
(0, import_react12.useEffect)(() => {
|
|
1842
1820
|
if (!searchTerm) {
|
|
1843
1821
|
setOptionsLoad(void 0);
|
|
1844
1822
|
}
|
|
@@ -1849,14 +1827,14 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1849
1827
|
};
|
|
1850
1828
|
const RenderElement = (props2) => {
|
|
1851
1829
|
const { indexRow, row, isSelected, level = 0 } = props2;
|
|
1852
|
-
return /* @__PURE__ */ (0,
|
|
1830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1853
1831
|
"tr",
|
|
1854
1832
|
{
|
|
1855
1833
|
id: `row-select-table-${indexRow}`,
|
|
1856
1834
|
style: { paddingLeft: 10 * level },
|
|
1857
1835
|
className: (0, import_classnames11.default)("r-select-row", { "last-row": indexRow === (optionsLoad ? optionsLoad : options).length - 1 }, { "fisrt-row": indexRow === 0 }),
|
|
1858
1836
|
children: [
|
|
1859
|
-
isMulti && /* @__PURE__ */ (0,
|
|
1837
|
+
isMulti && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1860
1838
|
"td",
|
|
1861
1839
|
{
|
|
1862
1840
|
className: (0, import_classnames11.default)(`r-select-rowcell`, { "r-select-move": indexFocus === indexRow, "r-select-active": !isMulti && value && value[fieldValue ?? "value"] === row[fieldValue ?? "value"] }),
|
|
@@ -1880,7 +1858,7 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1880
1858
|
e.stopPropagation();
|
|
1881
1859
|
}
|
|
1882
1860
|
},
|
|
1883
|
-
children: /* @__PURE__ */ (0,
|
|
1861
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1884
1862
|
import_reactstrap8.Input,
|
|
1885
1863
|
{
|
|
1886
1864
|
checked: isSelected,
|
|
@@ -1902,8 +1880,8 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1902
1880
|
} else if (col.type === "datetime") {
|
|
1903
1881
|
valueDisplay = valueDisplay ? (0, import_moment.default)(valueDisplay).format("DD/MM/yyyy HH:mm") : "";
|
|
1904
1882
|
}
|
|
1905
|
-
return /* @__PURE__ */ (0,
|
|
1906
|
-
col.visible !== false && /* @__PURE__ */ (0,
|
|
1883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react12.Fragment, { children: [
|
|
1884
|
+
col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1907
1885
|
"td",
|
|
1908
1886
|
{
|
|
1909
1887
|
id: `select-${id}-${indexRow}-${indexCol}`,
|
|
@@ -1948,7 +1926,7 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1948
1926
|
},
|
|
1949
1927
|
`col-${indexRow}-${indexCol}`
|
|
1950
1928
|
),
|
|
1951
|
-
checkOverflow(indexRow, indexCol) && /* @__PURE__ */ (0,
|
|
1929
|
+
checkOverflow(indexRow, indexCol) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `select-${id}-${indexRow}-${indexCol}`, children: col.template ? col.template(row, indexRow) : valueDisplay })
|
|
1952
1930
|
] }, indexCol);
|
|
1953
1931
|
})
|
|
1954
1932
|
]
|
|
@@ -1959,15 +1937,15 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1959
1937
|
const RenderTable = (props2) => {
|
|
1960
1938
|
const {} = props2;
|
|
1961
1939
|
let countDisplay = 0;
|
|
1962
|
-
return /* @__PURE__ */ (0,
|
|
1963
|
-
/* @__PURE__ */ (0,
|
|
1964
|
-
/* @__PURE__ */ (0,
|
|
1965
|
-
isMulti && /* @__PURE__ */ (0,
|
|
1940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1941
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", { style: { width: "100%" }, children: [
|
|
1942
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { className: "r-select-row", role: "row", children: [
|
|
1943
|
+
isMulti && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { className: (0, import_classnames11.default)(`r-select-headercell`), style: { width: 40, top: `0px` }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1966
1944
|
"div",
|
|
1967
1945
|
{
|
|
1968
1946
|
style: { justifyContent: "center" },
|
|
1969
1947
|
className: (0, import_classnames11.default)("r-select-headercell-div"),
|
|
1970
|
-
children: /* @__PURE__ */ (0,
|
|
1948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1971
1949
|
import_reactstrap8.Input,
|
|
1972
1950
|
{
|
|
1973
1951
|
checked: isSelectedAll,
|
|
@@ -1993,73 +1971,71 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
1993
1971
|
return renderHeaderCol(col, index);
|
|
1994
1972
|
})
|
|
1995
1973
|
] }) }),
|
|
1996
|
-
(optionsLoad ? optionsLoad : options).length > 0 && !isLoading && /* @__PURE__ */ (0,
|
|
1974
|
+
(optionsLoad ? optionsLoad : options).length > 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tbody", { className: "r-select-gridcontent", children: (optionsLoad ? optionsLoad : options)?.map((row, indexRow) => {
|
|
1997
1975
|
if (!isMulti && loadOptions || checkSearch(searchTerm, row, columns ? columns : defaultColumns)) {
|
|
1998
1976
|
const isSelected = isMulti && value?.some((x) => x === row[fieldValue ?? "value"]);
|
|
1999
1977
|
countDisplay++;
|
|
2000
|
-
return /* @__PURE__ */ (0,
|
|
1978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RenderElement, { isSelected, indexRow, row }, `select-table-${indexRow}`);
|
|
2001
1979
|
}
|
|
2002
1980
|
}) }) })
|
|
2003
1981
|
] }),
|
|
2004
|
-
countDisplay === 0 && !isLoading && /* @__PURE__ */ (0,
|
|
2005
|
-
/* @__PURE__ */ (0,
|
|
2006
|
-
/* @__PURE__ */ (0,
|
|
2007
|
-
/* @__PURE__ */ (0,
|
|
2008
|
-
/* @__PURE__ */ (0,
|
|
2009
|
-
/* @__PURE__ */ (0,
|
|
1982
|
+
countDisplay === 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "r-no-data", children: [
|
|
1983
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [
|
|
1984
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }),
|
|
1985
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [
|
|
1986
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" }),
|
|
1987
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" })
|
|
2010
1988
|
] })
|
|
2011
1989
|
] }) }),
|
|
2012
1990
|
t("No data available.")
|
|
2013
1991
|
] }),
|
|
2014
|
-
isLoading && /* @__PURE__ */ (0,
|
|
2015
|
-
/* @__PURE__ */ (0,
|
|
1992
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "r-no-data", children: [
|
|
1993
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.Spinner, { className: "me-1", children: " " }),
|
|
2016
1994
|
t("Loading...")
|
|
2017
1995
|
] })
|
|
2018
1996
|
] });
|
|
2019
1997
|
};
|
|
2020
|
-
return /* @__PURE__ */ (0,
|
|
1998
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2021
1999
|
"div",
|
|
2022
2000
|
{
|
|
2023
2001
|
className: (0, import_classnames11.default)("react-select-table", { "is-invalid": invalid }),
|
|
2024
2002
|
ref,
|
|
2025
2003
|
id,
|
|
2026
|
-
children: /* @__PURE__ */ (0,
|
|
2004
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: selectTableRef, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2027
2005
|
import_reactstrap8.Dropdown,
|
|
2028
2006
|
{
|
|
2029
2007
|
isOpen: dropdownOpen,
|
|
2030
2008
|
toggle: () => {
|
|
2031
2009
|
},
|
|
2032
2010
|
children: [
|
|
2033
|
-
/* @__PURE__ */ (0,
|
|
2011
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2034
2012
|
import_reactstrap8.DropdownToggle,
|
|
2035
2013
|
{
|
|
2036
|
-
onClick: () => {
|
|
2014
|
+
onClick: (e) => {
|
|
2037
2015
|
if (!isDisabled) {
|
|
2038
2016
|
inputRef?.current.focus();
|
|
2039
|
-
if (dropdownOpen) {
|
|
2040
|
-
clearTimeout(timeOutBlur);
|
|
2041
|
-
}
|
|
2042
2017
|
handleOpenClose();
|
|
2043
2018
|
}
|
|
2019
|
+
e.preventDefault();
|
|
2044
2020
|
},
|
|
2045
2021
|
tag: "div",
|
|
2046
2022
|
className: (0, import_classnames11.default)("select-table-control", { "r-select-is-disabled": isDisabled }, { "r-select-is-open": dropdownOpen }, { "r-select-is-focus": isFocus }, { "r-select-is-invalid": invalid }),
|
|
2047
2023
|
children: [
|
|
2048
|
-
/* @__PURE__ */ (0,
|
|
2049
|
-
isMulti ? /* @__PURE__ */ (0,
|
|
2024
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "select-table-container", children: [
|
|
2025
|
+
isMulti ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_classnames11.default)("select-value is-mutil", { "d-none": searchTerm }), children: value?.map((ele, index) => {
|
|
2050
2026
|
const element = (optionsLoad ? optionsLoad : options).find((e) => e[fieldValue ?? "value"] === ele);
|
|
2051
2027
|
if (element) {
|
|
2052
|
-
return /* @__PURE__ */ (0,
|
|
2028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
|
|
2053
2029
|
index === 0 ? "" : ", ",
|
|
2054
2030
|
element[fieldLabel ?? "label"]
|
|
2055
2031
|
] }, index);
|
|
2056
2032
|
}
|
|
2057
|
-
}) }) }) : /* @__PURE__ */ (0,
|
|
2033
|
+
}) }) }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_classnames11.default)("select-value", { "d-none": searchTerm }), children: [
|
|
2058
2034
|
value ? formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? "label"] : "",
|
|
2059
2035
|
" "
|
|
2060
2036
|
] }) }),
|
|
2061
|
-
!((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && /* @__PURE__ */ (0,
|
|
2062
|
-
/* @__PURE__ */ (0,
|
|
2037
|
+
!((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_classnames11.default)("select-placeholder"), children: placeholder }),
|
|
2038
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "input-container", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2063
2039
|
"input",
|
|
2064
2040
|
{
|
|
2065
2041
|
style: { textAlign: textAlign ?? "left" },
|
|
@@ -2079,12 +2055,12 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
2079
2055
|
}
|
|
2080
2056
|
) })
|
|
2081
2057
|
] }),
|
|
2082
|
-
isLoading && /* @__PURE__ */ (0,
|
|
2083
|
-
/* @__PURE__ */ (0,
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2085
|
-
/* @__PURE__ */ (0,
|
|
2058
|
+
isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_classnames11.default)("select-table-indicator d-flex align-items-center"), children: [
|
|
2059
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }),
|
|
2060
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }),
|
|
2061
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" })
|
|
2086
2062
|
] }),
|
|
2087
|
-
isClearable && value && !isDisabled && /* @__PURE__ */ (0,
|
|
2063
|
+
isClearable && value && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2088
2064
|
"div",
|
|
2089
2065
|
{
|
|
2090
2066
|
className: (0, import_classnames11.default)("cursor-pointer"),
|
|
@@ -2092,14 +2068,14 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
2092
2068
|
onChange(isMulti ? [] : void 0);
|
|
2093
2069
|
e.stopPropagation();
|
|
2094
2070
|
},
|
|
2095
|
-
children: /* @__PURE__ */ (0,
|
|
2071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { height: "20", width: "20", color: "#c4c4c4", viewBox: "0 0 20 20", "aria-hidden": "true", focusable: "false", className: "css-tj5bde-Svg", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" }) })
|
|
2096
2072
|
}
|
|
2097
2073
|
),
|
|
2098
|
-
!isDisabled && /* @__PURE__ */ (0,
|
|
2074
|
+
!isDisabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "select-table-indicator", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("svg", { height: "20", width: "20", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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" }) }) })
|
|
2099
2075
|
]
|
|
2100
2076
|
}
|
|
2101
2077
|
),
|
|
2102
|
-
/* @__PURE__ */ (0,
|
|
2078
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2103
2079
|
import_reactstrap8.DropdownMenu,
|
|
2104
2080
|
{
|
|
2105
2081
|
container: component,
|
|
@@ -2109,20 +2085,19 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
2109
2085
|
position: "fixed",
|
|
2110
2086
|
zIndex: 9999
|
|
2111
2087
|
},
|
|
2112
|
-
children: /* @__PURE__ */ (0,
|
|
2088
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.DropdownItem, { className: (0, import_classnames11.default)("p-0 menu-select-table"), style: { borderRadius: "6px" }, tag: "div", header: true, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2113
2089
|
"div",
|
|
2114
2090
|
{
|
|
2115
2091
|
onMouseDown: (e) => {
|
|
2116
2092
|
if (!isDisabled) {
|
|
2117
2093
|
inputRef?.current.focus();
|
|
2118
|
-
clearTimeout(timeOutBlur);
|
|
2119
2094
|
e.preventDefault();
|
|
2120
2095
|
}
|
|
2121
2096
|
},
|
|
2122
|
-
children: /* @__PURE__ */ (0,
|
|
2123
|
-
/* @__PURE__ */ (0,
|
|
2124
|
-
/* @__PURE__ */ (0,
|
|
2125
|
-
/* @__PURE__ */ (0,
|
|
2097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "r-select-grid", children: [
|
|
2098
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "r-select-gridtable", ref: selectMenuTableRef, style: { minWidth: selectTableRef?.current?.clientWidth, maxHeight: maxHeight ?? defaultMaxHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RenderTable, {}) }),
|
|
2099
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_classnames11.default)("r-select-footer", { "d-none": !(showFooter === true || handleAdd) }), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_reactstrap8.Button, { outline: true, color: "primary", onClick: handleAdd, className: (0, import_classnames11.default)("r-btn-add d-flex align-items-center", { "d-none": !handleAdd }), children: [
|
|
2100
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_becoxy_icons5.Plus, { className: "me-50", fontSize: 16 }),
|
|
2126
2101
|
t("AddNew"),
|
|
2127
2102
|
" (F9)"
|
|
2128
2103
|
] }) })
|
|
@@ -2139,11 +2114,11 @@ var SelectTable = (0, import_react13.forwardRef)((props, ref) => {
|
|
|
2139
2114
|
});
|
|
2140
2115
|
|
|
2141
2116
|
// test-app/src/component/table/header.tsx
|
|
2142
|
-
var
|
|
2117
|
+
var import_react13 = require("react");
|
|
2143
2118
|
var import_classnames12 = __toESM(require("classnames"));
|
|
2144
2119
|
var import_reactstrap9 = require("reactstrap");
|
|
2145
2120
|
var import_react_i18next10 = require("react-i18next");
|
|
2146
|
-
var
|
|
2121
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2147
2122
|
var HeaderTableCol = (props) => {
|
|
2148
2123
|
const {
|
|
2149
2124
|
selectEnable,
|
|
@@ -2158,7 +2133,7 @@ var HeaderTableCol = (props) => {
|
|
|
2158
2133
|
isMulti
|
|
2159
2134
|
} = props;
|
|
2160
2135
|
const { t } = (0, import_react_i18next10.useTranslation)();
|
|
2161
|
-
return /* @__PURE__ */ (0,
|
|
2136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react13.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2162
2137
|
"th",
|
|
2163
2138
|
{
|
|
2164
2139
|
rowSpan: col.rowspan !== 1 ? col.rowspan : void 0,
|
|
@@ -2172,13 +2147,13 @@ var HeaderTableCol = (props) => {
|
|
|
2172
2147
|
minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.minWidth,
|
|
2173
2148
|
maxWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width
|
|
2174
2149
|
},
|
|
2175
|
-
children: /* @__PURE__ */ (0,
|
|
2150
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
2176
2151
|
"div",
|
|
2177
2152
|
{
|
|
2178
2153
|
style: { justifyContent: col.textAlign ?? "left" },
|
|
2179
2154
|
className: (0, import_classnames12.default)("r-headercell-div"),
|
|
2180
2155
|
children: [
|
|
2181
|
-
col.field === "checkbox" && /* @__PURE__ */ (0,
|
|
2156
|
+
col.field === "checkbox" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2182
2157
|
import_reactstrap9.Input,
|
|
2183
2158
|
{
|
|
2184
2159
|
checked: totalCount > 0 && selectedRows?.length >= totalCount,
|
|
@@ -2212,6 +2187,23 @@ var import_react15 = require("react");
|
|
|
2212
2187
|
var import_classnames13 = __toESM(require("classnames"));
|
|
2213
2188
|
var import_reactstrap10 = require("reactstrap");
|
|
2214
2189
|
var import_react_i18next11 = require("react-i18next");
|
|
2190
|
+
|
|
2191
|
+
// test-app/src/component/icon/index.tsx
|
|
2192
|
+
var Icon = __toESM(require("becoxy-icons"));
|
|
2193
|
+
var import_react14 = require("react");
|
|
2194
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2195
|
+
var IconCustom = (props) => {
|
|
2196
|
+
const { iconName, size } = props;
|
|
2197
|
+
if (iconName === "") {
|
|
2198
|
+
return null;
|
|
2199
|
+
} else {
|
|
2200
|
+
const TagIcon = iconName === "" ? "" : Icon[iconName];
|
|
2201
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react14.Fragment, { children: iconName === "" ? "" : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TagIcon, { fontSize: size }) });
|
|
2202
|
+
}
|
|
2203
|
+
};
|
|
2204
|
+
var icon_default = IconCustom;
|
|
2205
|
+
|
|
2206
|
+
// test-app/src/component/table/command.tsx
|
|
2215
2207
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2216
2208
|
var CommandElement = (props) => {
|
|
2217
2209
|
const { commandItems, rowData, indexRow, handleCommandClick, indexFocus, setIndexFocus } = props;
|
|
@@ -2220,7 +2212,7 @@ var CommandElement = (props) => {
|
|
|
2220
2212
|
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
|
|
2221
2213
|
import_reactstrap10.Button,
|
|
2222
2214
|
{
|
|
2223
|
-
id: `command-item-${indexRow}`,
|
|
2215
|
+
id: `command-item-${indexRow}-${index}`,
|
|
2224
2216
|
tabIndex: -1,
|
|
2225
2217
|
style: { padding: "5px", minWidth: 45, height: "100%" },
|
|
2226
2218
|
className: (0, import_classnames13.default)("command-item", {
|
|
@@ -2236,7 +2228,7 @@ var CommandElement = (props) => {
|
|
|
2236
2228
|
},
|
|
2237
2229
|
children: [
|
|
2238
2230
|
item.icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(icon_default, { iconName: item.icon, size: 16 }),
|
|
2239
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.UncontrolledTooltip, { className: "r-tooltip", target: `command-item-${index}`, place: "top", children: t(item.tooltip ?? "") })
|
|
2231
|
+
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.UncontrolledTooltip, { className: "r-tooltip", target: `command-item-${indexRow}-${index}`, place: "top", children: t(item.tooltip ?? "") })
|
|
2240
2232
|
]
|
|
2241
2233
|
},
|
|
2242
2234
|
`command-${index}`
|
|
@@ -2506,6 +2498,12 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
2506
2498
|
onKeyDown: (e) => {
|
|
2507
2499
|
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
2508
2500
|
}
|
|
2501
|
+
},
|
|
2502
|
+
onPaste: (e) => {
|
|
2503
|
+
if (toolbarSetting?.showBottomToolbar && !editDisable && !addDisable) {
|
|
2504
|
+
pasteDataFromExcel(indexRow, indexCol, e);
|
|
2505
|
+
e.preventDefault();
|
|
2506
|
+
}
|
|
2509
2507
|
}
|
|
2510
2508
|
}
|
|
2511
2509
|
);
|
|
@@ -2529,118 +2527,34 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
2529
2527
|
onKeyDown: (e) => {
|
|
2530
2528
|
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
2531
2529
|
}
|
|
2532
|
-
}
|
|
2533
|
-
}
|
|
2534
|
-
);
|
|
2535
|
-
case "asyncSelect":
|
|
2536
|
-
let optionAsyncSelects = [];
|
|
2537
|
-
if (col.selectSettings?.optionsField) {
|
|
2538
|
-
optionAsyncSelects = row[col.selectSettings?.optionsField] ? row[col.selectSettings?.optionsField] : [];
|
|
2539
|
-
} else {
|
|
2540
|
-
optionAsyncSelects = col.selectSettings?.options ? col.selectSettings?.validateOption ? col.selectSettings?.options.filter((item) => col.selectSettings?.validateOption(item, row)) : col.selectSettings?.options : [];
|
|
2541
|
-
}
|
|
2542
|
-
let valueAsyncSelect = !isNullOrUndefined(row[col.field]) && row[col.field] !== "" ? optionAsyncSelects?.find((val) => val[col.selectSettings?.fieldValue ?? "value"] === row[col.field]) : void 0;
|
|
2543
|
-
if (!valueAsyncSelect && col.selectSettings?.defaultValue) {
|
|
2544
|
-
valueAsyncSelect = col.selectSettings?.defaultValue(row);
|
|
2545
|
-
}
|
|
2546
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_classnames14.default)("d-flex select-group", { "is-invalid": col.validate && col.validate(row[col.field], row) }), children: [
|
|
2547
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2548
|
-
import_async.default,
|
|
2549
|
-
{
|
|
2550
|
-
menuPosition: "fixed",
|
|
2551
|
-
value: valueAsyncSelect,
|
|
2552
|
-
defaultOptions: optionAsyncSelects,
|
|
2553
|
-
onChange: (val) => {
|
|
2554
|
-
row[col.field] = val ? val[col.selectSettings?.fieldValue ?? "value"] : void 0;
|
|
2555
|
-
if (col.callback) {
|
|
2556
|
-
col.callback(val, indexRow);
|
|
2557
|
-
}
|
|
2558
|
-
handleDataChange(row, col, indexRow);
|
|
2559
|
-
},
|
|
2560
|
-
menuPortalTarget: document.body,
|
|
2561
|
-
isClearable: col.selectSettings?.isClearable ?? false,
|
|
2562
|
-
classNamePrefix: col.selectSettings?.widthPopup ? `select-${col.selectSettings?.widthPopup}` : "select",
|
|
2563
|
-
placeholder: t("Select"),
|
|
2564
|
-
id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
|
|
2565
|
-
loadOptions: col.selectSettings?.loadOptions,
|
|
2566
|
-
className: (0, import_classnames14.default)("react-select"),
|
|
2567
|
-
onKeyDown: (e) => {
|
|
2568
|
-
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
2569
|
-
}
|
|
2570
|
-
}
|
|
2571
|
-
}
|
|
2572
|
-
),
|
|
2573
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2574
|
-
"span",
|
|
2575
|
-
{
|
|
2576
|
-
onClick: () => {
|
|
2577
|
-
if (col.selectSettings?.handAddNew) {
|
|
2578
|
-
col.selectSettings?.handAddNew("right");
|
|
2579
|
-
}
|
|
2580
|
-
},
|
|
2581
|
-
className: (0, import_classnames14.default)("input-group-text", { "d-none": !col.selectSettings?.iconGroup }),
|
|
2582
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(icon_default, { iconName: col.selectSettings?.iconGroup ?? "", size: 16 })
|
|
2583
|
-
}
|
|
2584
|
-
)
|
|
2585
|
-
] });
|
|
2586
|
-
case "select":
|
|
2587
|
-
let valueSelect;
|
|
2588
|
-
let options = [];
|
|
2589
|
-
if (col.selectSettings?.optionsField) {
|
|
2590
|
-
options = row[col.selectSettings?.optionsField] ? row[col.selectSettings?.optionsField] : [];
|
|
2591
|
-
} else {
|
|
2592
|
-
options = col.selectSettings?.options ? col.selectSettings?.validateOption ? col.selectSettings?.options.filter((item) => col.selectSettings?.validateOption(item, row)) : col.selectSettings?.options : [];
|
|
2593
|
-
}
|
|
2594
|
-
if (col.selectSettings?.isMulti) {
|
|
2595
|
-
valueSelect = !isNullOrUndefined(row[col.field]) && row[col.field]?.length > 0 ? options?.filter((val) => row[col.field]?.includes(val[col.selectSettings?.fieldValue ?? "value"])) : [];
|
|
2596
|
-
} else {
|
|
2597
|
-
valueSelect = !isNullOrUndefined(row[col.field]) && row[col.field] !== "" ? options?.find((val) => val[col.selectSettings?.fieldValue ?? "value"] === row[col.field]) : "";
|
|
2598
|
-
}
|
|
2599
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2600
|
-
import_react_select3.default,
|
|
2601
|
-
{
|
|
2602
|
-
menuPosition: "fixed",
|
|
2603
|
-
id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
|
|
2604
|
-
value: valueSelect,
|
|
2605
|
-
options,
|
|
2606
|
-
onChange: (val) => {
|
|
2607
|
-
row[col.field] = col.selectSettings?.isMulti ? val?.map((item) => item[col.selectSettings?.fieldValue ?? "value"]) ?? [] : val ? val[col.selectSettings?.fieldValue ?? "value"] : void 0;
|
|
2608
|
-
if (col.callback) {
|
|
2609
|
-
col.callback(val, indexRow);
|
|
2610
|
-
}
|
|
2611
|
-
handleDataChange(row, col, indexRow);
|
|
2612
2530
|
},
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
placeholder: t("Select"),
|
|
2618
|
-
className: (0, import_classnames14.default)("react-select", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
|
|
2619
|
-
onKeyDown: (e) => {
|
|
2620
|
-
if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
|
|
2531
|
+
onPaste: (e) => {
|
|
2532
|
+
if (toolbarSetting?.showBottomToolbar && !editDisable && !addDisable) {
|
|
2533
|
+
pasteDataFromExcel(indexRow, indexCol, e);
|
|
2534
|
+
e.preventDefault();
|
|
2621
2535
|
}
|
|
2622
2536
|
}
|
|
2623
2537
|
}
|
|
2624
2538
|
);
|
|
2625
2539
|
case "selectTable":
|
|
2626
|
-
let
|
|
2627
|
-
let
|
|
2540
|
+
let valueSelect;
|
|
2541
|
+
let optionsSelect = [];
|
|
2628
2542
|
if (col.selectSettings?.optionsField) {
|
|
2629
|
-
|
|
2543
|
+
optionsSelect = row[col.selectSettings?.optionsField] ? row[col.selectSettings?.optionsField] : [];
|
|
2630
2544
|
} else {
|
|
2631
|
-
|
|
2545
|
+
optionsSelect = col.selectSettings?.options ? col.selectSettings?.validateOption ? col.selectSettings?.options.filter((item) => col.selectSettings?.validateOption(item, row)) : col.selectSettings?.options : [];
|
|
2632
2546
|
}
|
|
2633
2547
|
if (col.selectSettings?.isMulti) {
|
|
2634
|
-
|
|
2548
|
+
valueSelect = !isNullOrUndefined(row[col.field]) && row[col.field]?.length > 0 ? optionsSelect?.filter((val) => row[col.field]?.includes(val[col.selectSettings?.fieldValue ?? "value"])) : [];
|
|
2635
2549
|
} else {
|
|
2636
|
-
|
|
2550
|
+
valueSelect = !isNullOrUndefined(row[col.field]) && row[col.field] !== "" ? optionsSelect?.find((val) => val[col.selectSettings?.fieldValue ?? "value"] === row[col.field]) : "";
|
|
2637
2551
|
}
|
|
2638
2552
|
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2639
2553
|
SelectTable,
|
|
2640
2554
|
{
|
|
2641
2555
|
id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
|
|
2642
|
-
value:
|
|
2643
|
-
options:
|
|
2556
|
+
value: valueSelect,
|
|
2557
|
+
options: optionsSelect,
|
|
2644
2558
|
rowData: row,
|
|
2645
2559
|
onChange: (val) => {
|
|
2646
2560
|
row[col.field] = col.selectSettings?.isMulti ? val?.map((item) => item[col.selectSettings?.fieldValue ?? "value"]) ?? [] : val ? val[col.selectSettings?.fieldValue ?? "value"] : void 0;
|
|
@@ -3649,9 +3563,10 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
|
|
|
3649
3563
|
selectedRows,
|
|
3650
3564
|
setSelectedRows,
|
|
3651
3565
|
totalCount
|
|
3652
|
-
}
|
|
3566
|
+
},
|
|
3567
|
+
`header-${indexParent}-${index}`
|
|
3653
3568
|
);
|
|
3654
|
-
}) }, indexParent);
|
|
3569
|
+
}) }, `header-${-indexParent}`);
|
|
3655
3570
|
}) }),
|
|
3656
3571
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tbody", { className: "r-gridcontent", children: renderData() }),
|
|
3657
3572
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tfoot", { className: "r-gridfoot", children: haveSum == true ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tr", { className: "r-row", children: contentColumns.map((col, index) => {
|
|
@@ -3824,7 +3739,7 @@ var TabsMenuComponent = ({
|
|
|
3824
3739
|
};
|
|
3825
3740
|
|
|
3826
3741
|
// index.ts
|
|
3827
|
-
var
|
|
3742
|
+
var Table_edit_default = table_default;
|
|
3828
3743
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3829
3744
|
0 && (module.exports = {
|
|
3830
3745
|
SelectTable,
|