react-table-edit 0.8.9 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -53,10 +53,10 @@ __export(Table_edit_exports, {
53
53
  module.exports = __toCommonJS(Table_edit_exports);
54
54
 
55
55
  // test-app/src/component/table/index.tsx
56
- var import_react16 = require("react");
57
- var import_reactstrap11 = require("reactstrap");
58
- var import_classnames14 = __toESM(require("classnames"));
59
- var import_react_i18next12 = require("react-i18next");
56
+ var import_react15 = require("react");
57
+ var import_reactstrap10 = require("reactstrap");
58
+ var import_classnames13 = __toESM(require("classnames"));
59
+ var import_react_i18next11 = require("react-i18next");
60
60
  var import_becoxy_icons6 = require("becoxy-icons");
61
61
 
62
62
  // test-app/src/component/react-input/index.tsx
@@ -335,7 +335,7 @@ var import_moment2 = __toESM(require("moment"));
335
335
  // test-app/src/component/edit-form/index.tsx
336
336
  var import_react8 = require("react");
337
337
  var import_reactstrap6 = require("reactstrap");
338
- var import_react_hook_form5 = require("react-hook-form");
338
+ var import_react_hook_form4 = require("react-hook-form");
339
339
  var import_yup = require("@hookform/resolvers/yup");
340
340
  var import_react_i18next5 = require("react-i18next");
341
341
  var import_classnames6 = __toESM(require("classnames"));
@@ -431,175 +431,15 @@ var TextInput = (props) => {
431
431
  };
432
432
  var input_text_default = TextInput;
433
433
 
434
- // test-app/src/component/select/index.tsx
434
+ // test-app/src/component/input-number/index.tsx
435
435
  var import_react_hook_form2 = require("react-hook-form");
436
436
  var import_reactstrap3 = require("reactstrap");
437
- var import_react_select = __toESM(require("react-select"));
438
437
  var import_classnames3 = __toESM(require("classnames"));
439
438
  var import_react5 = require("react");
440
439
  var import_react_i18next2 = require("react-i18next");
441
440
  var import_jsx_runtime4 = require("react/jsx-runtime");
442
- var SelectBox = (props) => {
443
- const { t } = (0, import_react_i18next2.useTranslation)();
444
- 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;
445
- const handChange = ({ onChange, val }) => {
446
- onChange(!isNullOrUndefined(val) && isMulti ? val.map((item) => item.value) : !isNullOrUndefined(val) && !isMulti ? fieldValue ? val[fieldValue] : val?.value : void 0);
447
- if (callback) {
448
- callback(val);
449
- }
450
- };
451
- const renderSelect = () => {
452
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react5.Fragment, { children: [
453
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
454
- import_react_hook_form2.Controller,
455
- {
456
- name,
457
- control,
458
- render: ({ field: { value, onChange } }) => {
459
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
460
- import_react_select.default,
461
- {
462
- ...rest,
463
- id,
464
- value: isMulti && value?.length > 0 ? value.map((x) => options.find((val) => (fieldValue ? val[fieldValue] : val.value) === x)) : !isNullOrUndefined(value) && value !== "" ? options.find((val) => (fieldValue ? val[fieldValue] : val.value) === value) : "",
465
- onChange: (val) => {
466
- if ((fieldValue && val ? val[fieldValue] : val?.value) !== value) {
467
- if (confirmHandle) {
468
- confirmHandle(handChange, onChange, val);
469
- } else {
470
- onChange(!isNullOrUndefined(val) && isMulti ? val.map((item) => item.value) : !isNullOrUndefined(val) && !isMulti ? fieldValue ? val[fieldValue] : val?.value : void 0);
471
- if (callback) {
472
- callback(val);
473
- }
474
- }
475
- }
476
- },
477
- onInputChange,
478
- form: name,
479
- placeholder: placeholder ? placeholder : "",
480
- classNamePrefix: "select",
481
- className: `react-select ${errors && "is-invalid"}`,
482
- options,
483
- isMulti,
484
- isDisabled: disabled,
485
- isClearable,
486
- menuPosition: menuPosition ?? "fixed",
487
- formatOptionLabel: labelComponent ? labelComponent : void 0,
488
- ref
489
- }
490
- );
491
- }
492
- }
493
- ),
494
- errors && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_reactstrap3.FormFeedback, { children: errors?.message })
495
- ] });
496
- };
497
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
498
- "div",
499
- {
500
- className: (0, import_classnames3.default)(
501
- inLine === false ? "form-group " : "form-row-inline d-flex",
502
- "align",
503
- {
504
- [labelSize ? labelSize : ""]: labelSize,
505
- [classes ? classes : ""]: classes,
506
- "form-row-inline-error": errors
507
- }
508
- ),
509
- children: [
510
- isLabel === false ? "" : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_reactstrap3.Label, { className: "form-label", for: name, children: [
511
- t(label ? label : ""),
512
- " ",
513
- required ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-danger", children: "*" }) : "",
514
- " "
515
- ] }),
516
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_classnames3.default)("form-input-content", { "hidden-label": isLabel === false }), children: renderSelect() })
517
- ]
518
- }
519
- ) });
520
- };
521
- var select_default = SelectBox;
522
-
523
- // test-app/src/component/creactable-select/index.tsx
524
- var import_react_hook_form3 = require("react-hook-form");
525
- var import_reactstrap4 = require("reactstrap");
526
- var import_classnames4 = __toESM(require("classnames"));
527
- var import_react6 = require("react");
528
- var import_react_i18next3 = require("react-i18next");
529
- var import_creatable = __toESM(require("react-select/creatable"));
530
- var import_jsx_runtime5 = require("react/jsx-runtime");
531
- var CreatableSelectBox = (props) => {
532
- const { t } = (0, import_react_i18next3.useTranslation)();
533
- const { isMulti, id, isLabel, control, placeholder, fieldValue, name, options, label, labelSize, required, errors, inLine, isClearable, labelComponent, onInputChange, callback, ...rest } = props;
534
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
535
- "div",
536
- {
537
- className: (0, import_classnames4.default)(
538
- inLine === false ? "form-group " : "form-row-inline d-flex",
539
- "align",
540
- {
541
- [labelSize ? labelSize : ""]: labelSize,
542
- "form-row-inline-error": errors
543
- }
544
- ),
545
- children: [
546
- isLabel === false ? "" : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_reactstrap4.Label, { className: "form-label", for: name, children: [
547
- t(label),
548
- " ",
549
- required ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "text-danger", children: "*" }) : "",
550
- " "
551
- ] }),
552
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_classnames4.default)("form-input-content", { "hidden-label": isLabel === false }), children: [
553
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
554
- import_react_hook_form3.Controller,
555
- {
556
- name,
557
- control,
558
- render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
559
- import_creatable.default,
560
- {
561
- ...rest,
562
- id,
563
- value: isMulti && value?.length > 0 ? value.map((x) => options.find((val) => (fieldValue ? val[fieldValue] : val.value) === x)) : !isNullOrUndefined(value) && value !== "" ? options.find((val) => (fieldValue ? val[fieldValue] : val.value) === value) : "",
564
- onChange: (val) => {
565
- if (fieldValue && val.__isNew__) {
566
- val[fieldValue] = val.value;
567
- }
568
- onChange(!isNullOrUndefined(val) && isMulti ? val.map((item) => item.value) : !isNullOrUndefined(val) && !isMulti ? fieldValue ? val[fieldValue] : val?.value : void 0);
569
- if (callback) {
570
- callback(val);
571
- }
572
- },
573
- onInputChange,
574
- classNamePrefix: "select",
575
- className: `react-select ${errors && "is-invalid"}`,
576
- options,
577
- placeholder,
578
- isMulti,
579
- isClearable,
580
- menuPosition: "fixed",
581
- formatOptionLabel: labelComponent ? labelComponent : void 0
582
- }
583
- )
584
- }
585
- ),
586
- errors && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.FormFeedback, { children: errors?.message })
587
- ] })
588
- ]
589
- }
590
- ) });
591
- };
592
- var creactable_select_default = CreatableSelectBox;
593
-
594
- // test-app/src/component/input-number/index.tsx
595
- var import_react_hook_form4 = require("react-hook-form");
596
- var import_reactstrap5 = require("reactstrap");
597
- var import_classnames5 = __toESM(require("classnames"));
598
- var import_react7 = require("react");
599
- var import_react_i18next4 = require("react-i18next");
600
- var import_jsx_runtime6 = require("react/jsx-runtime");
601
441
  var NumberInput = (props) => {
602
- const { t } = (0, import_react_i18next4.useTranslation)();
442
+ const { t } = (0, import_react_i18next2.useTranslation)();
603
443
  const {
604
444
  control,
605
445
  id,
@@ -627,22 +467,22 @@ var NumberInput = (props) => {
627
467
  ...rest
628
468
  } = props;
629
469
  const renderLabel = () => {
630
- 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: [
470
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.Fragment, { children: isLabel === false ? "" : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_reactstrap3.Label, { className: "form-label", for: name, children: [
631
471
  t(label ? label : ""),
632
472
  " ",
633
- required ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-danger", children: "*" }) : "",
473
+ required ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "text-danger", children: "*" }) : "",
634
474
  " "
635
475
  ] }) });
636
476
  };
637
477
  const renderInput = () => {
638
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react7.Fragment, { children: [
639
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
640
- import_react_hook_form4.Controller,
478
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_react5.Fragment, { children: [
479
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
480
+ import_react_hook_form2.Controller,
641
481
  {
642
482
  name,
643
483
  control,
644
- render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
645
- import_reactstrap5.Input,
484
+ render: ({ field: { value, onChange } }) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
485
+ import_reactstrap3.Input,
646
486
  {
647
487
  id,
648
488
  value: formartNumberic(value, decimalSeparator, thousandSeparator, fractionCurrency),
@@ -701,13 +541,13 @@ var NumberInput = (props) => {
701
541
  )
702
542
  }
703
543
  ),
704
- errors && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_reactstrap5.FormFeedback, { children: errors?.message })
544
+ errors && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_reactstrap3.FormFeedback, { children: errors?.message })
705
545
  ] });
706
546
  };
707
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
547
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
708
548
  "div",
709
549
  {
710
- className: (0, import_classnames5.default)(
550
+ className: (0, import_classnames3.default)(
711
551
  " align",
712
552
  {
713
553
  [labelSize ? labelSize : ""]: labelSize,
@@ -718,358 +558,578 @@ var NumberInput = (props) => {
718
558
  ),
719
559
  children: [
720
560
  renderLabel(),
721
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: (0, import_classnames5.default)("form-input-content", { "hidden-label": isLabel === false }), children: renderInput() })
561
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: (0, import_classnames3.default)("form-input-content", { "hidden-label": isLabel === false }), children: renderInput() })
722
562
  ]
723
563
  }
724
564
  ) });
725
565
  };
726
566
  var input_number_default = NumberInput;
727
567
 
728
- // test-app/src/component/edit-form/index.tsx
729
- var import_jsx_runtime7 = require("react/jsx-runtime");
730
- var defaultWidth = 200;
731
- var EditForm = (0, import_react8.forwardRef)((props, ref) => {
568
+ // test-app/src/component/edit-form/select-table/index.tsx
569
+ var import_react_hook_form3 = require("react-hook-form");
570
+ var import_reactstrap5 = require("reactstrap");
571
+ var import_classnames5 = __toESM(require("classnames"));
572
+ var import_react7 = require("react");
573
+
574
+ // test-app/src/component/select-table/index.tsx
575
+ var import_react6 = require("react");
576
+ var import_reactstrap4 = require("reactstrap");
577
+ var import_react_i18next3 = require("react-i18next");
578
+ var import_classnames4 = __toESM(require("classnames"));
579
+ var import_moment = __toESM(require("moment"));
580
+ var import_becoxy_icons2 = require("becoxy-icons");
581
+ var import_jsx_runtime5 = require("react/jsx-runtime");
582
+ var defaultMaxHeight = 250;
583
+ var SelectTable = (0, import_react6.forwardRef)((props, ref) => {
732
584
  const {
733
585
  id,
734
- field,
735
- displayValue,
736
- menuHeight,
737
586
  menuWidth,
738
- rowData,
587
+ width,
739
588
  invalid,
740
- onChange,
741
- onChangeField,
742
589
  onKeyDown,
743
- defaultValues,
744
590
  placeholder,
745
591
  textAlign,
746
- schema,
747
- onFormOpen,
748
- onFormSubmit,
749
- footerTemplate,
750
- minWidth,
751
- onPaste,
752
- openOnFocus,
592
+ options,
593
+ columns,
594
+ decimalSeparator,
595
+ thousandSeparator,
596
+ onChange,
597
+ value,
598
+ fieldValue,
599
+ fieldLabel,
600
+ loadOptions,
601
+ maxHeight,
602
+ handleAdd,
753
603
  isClearable,
754
- labelSize = "label-small"
604
+ component,
605
+ formatOptionLabel,
606
+ isMulti,
607
+ noHeader,
608
+ isDisabled,
609
+ showFooter,
610
+ onPaste
755
611
  } = props;
756
- const { innerWidth } = window;
757
- const inputRef = (0, import_react8.useRef)();
758
- const editFormRef = (0, import_react8.useRef)();
759
- const buttonRef = (0, import_react8.useRef)();
760
- const [dropdownOpen, setDropdownOpen] = (0, import_react8.useState)(false);
761
- const [itemsField, setItemsField] = (0, import_react8.useState)([]);
762
- const { t } = (0, import_react_i18next5.useTranslation)();
763
- useOnClickOutside(editFormRef, () => {
764
- closeMenu();
765
- });
612
+ const selectTableRef = (0, import_react6.useRef)();
613
+ const selectMenuTableRef = (0, import_react6.useRef)();
614
+ const inputRef = (0, import_react6.useRef)();
615
+ const [dropdownOpen, setDropdownOpen] = (0, import_react6.useState)(false);
616
+ const [indexFocus, setIndexFocus] = (0, import_react6.useState)(-1);
617
+ const [isFocus, setIsFocus] = (0, import_react6.useState)(false);
618
+ const [isLoading, setIsLoading] = (0, import_react6.useState)(false);
619
+ const [searchTerm, setSearchTerm] = (0, import_react6.useState)("");
620
+ const [optionsLoad, setOptionsLoad] = (0, import_react6.useState)();
621
+ const { t } = (0, import_react_i18next3.useTranslation)();
622
+ const isSelectedAll = (0, import_react6.useMemo)(() => {
623
+ return isMulti === true && (optionsLoad ? optionsLoad : options).length > 0 && value?.length >= (optionsLoad ? optionsLoad : options).length;
624
+ }, [optionsLoad, options, value]);
625
+ const defaultColumns = noHeader ? [
626
+ {
627
+ headerText: "Name",
628
+ field: fieldLabel ?? "label",
629
+ width: menuWidth
630
+ }
631
+ ] : [
632
+ {
633
+ field: "key",
634
+ headerText: "Code",
635
+ width: 100,
636
+ maxWidth: 120,
637
+ minWidth: 80
638
+ },
639
+ {
640
+ headerText: "Name",
641
+ field: "label",
642
+ width: 150,
643
+ maxWidth: 200,
644
+ minWidth: 250
645
+ }
646
+ ];
766
647
  const closeMenu = () => {
767
- setTimeout(() => {
768
- setDropdownOpen(false);
769
- }, onChangeField ? 10 : 0);
648
+ setDropdownOpen(false);
770
649
  };
771
- const {
772
- control,
773
- handleSubmit,
774
- getValues,
775
- reset,
776
- setValue,
777
- formState: { errors }
778
- } = (0, import_react_hook_form5.useForm)({
779
- mode: "onChange",
780
- defaultValues,
781
- resolver: (0, import_yup.yupResolver)(schema)
782
- });
783
- (0, import_react8.useEffect)(() => {
784
- if (dropdownOpen) {
785
- if (onFormOpen && itemsField.length === 0) {
786
- onFormOpen(rowData, itemsField, setItemsField);
787
- }
788
- if (openOnFocus) {
789
- setTimeout(() => {
790
- focusElement(`form-element-${field}-0`, true);
791
- }, 100);
650
+ (0, import_react6.useEffect)(() => {
651
+ if (dropdownOpen && value && !isMulti && selectMenuTableRef) {
652
+ const index = (optionsLoad ? optionsLoad : options)?.findIndex((e) => e[fieldValue ?? "value"] === value[fieldValue ?? "value"]);
653
+ if (index >= 0) {
654
+ selectMenuTableRef.current.scrollTo({ top: (index - 1) * 30 });
792
655
  }
793
656
  }
794
657
  }, [dropdownOpen]);
795
- (0, import_react8.useEffect)(() => {
796
- if (dropdownOpen && itemsField.length > 0) {
797
- itemsField.forEach((ele) => {
798
- setValue(ele.name, rowData[ele.name] ?? "");
658
+ (0, import_react6.useEffect)(() => {
659
+ if (inputRef && !isDisabled) {
660
+ inputRef.current.addEventListener("blur", function() {
661
+ setDropdownOpen(false);
662
+ setSearchTerm("");
663
+ setIsFocus(false);
664
+ });
665
+ inputRef.current.addEventListener("focus", function() {
666
+ if (!isFocus) {
667
+ setIsFocus(true);
668
+ }
799
669
  });
800
670
  }
801
- }, [dropdownOpen, itemsField]);
802
- const handleOnClick = () => {
671
+ }, [inputRef]);
672
+ (0, import_react6.useEffect)(() => {
673
+ if (searchTerm && !dropdownOpen) {
674
+ setDropdownOpen(true);
675
+ setIndexFocus(0);
676
+ }
677
+ }, [searchTerm]);
678
+ const handleOpenClose = () => {
679
+ setSearchTerm("");
803
680
  if (dropdownOpen) {
804
681
  closeMenu();
805
682
  } else {
806
- setDropdownOpen(true);
807
- }
808
- };
809
- const handleOnSubmit = (val) => {
810
- closeMenu();
811
- onChange(val);
812
- if (onFormSubmit) {
813
- onFormSubmit(rowData, setValue, getValues, reset);
683
+ if (!isDisabled) {
684
+ setDropdownOpen(true);
685
+ }
814
686
  }
815
- inputRef.current.focus();
816
687
  };
817
- const focusElement = (id2, focus) => {
818
- const element = document.getElementById(id2);
819
- if (element) {
820
- if (element.className.includes("react-select")) {
821
- element.getElementsByTagName("input")[0]?.focus();
822
- } else {
823
- element.focus();
824
- if (focus) {
825
- element.setSelectionRange(0, element.innerText.length - 1);
826
- }
688
+ const listKeyUse = ["Escape", "Space", "Enter", "Tab", "NumpadEnter", "ArrowDown", "ArrowUp", "F9"];
689
+ const handleOnKeyDown = (e) => {
690
+ let key = "";
691
+ if (onKeyDown && (!dropdownOpen || !listKeyUse.includes(e.code))) {
692
+ key = onKeyDown(e);
693
+ if (key === "ArrowRight" || key === "ArrowLeft") {
694
+ closeMenu();
827
695
  }
828
696
  }
829
- };
830
- const handleOnKeyDown = (e) => {
831
697
  let flag = false;
832
- if (dropdownOpen) {
833
- if (e.code === "Escape") {
834
- closeMenu();
835
- flag = true;
836
- } else if (e.code === "Enter") {
837
- closeMenu();
698
+ if (!key) {
699
+ if (e.code === "F9") {
700
+ handleAdd();
838
701
  flag = true;
702
+ } else if (e.code === "Escape" || e.code === "Space") {
703
+ if (dropdownOpen) {
704
+ if ((optionsLoad ? optionsLoad : options)[indexFocus]) {
705
+ onChange((optionsLoad ? optionsLoad : options)[indexFocus]);
706
+ }
707
+ }
708
+ if (!searchTerm) {
709
+ handleOpenClose();
710
+ flag = true;
711
+ }
712
+ } else if (e.code === "Enter" || e.code === "Tab" || e.code === "NumpadEnter") {
713
+ if (dropdownOpen) {
714
+ onChange((optionsLoad ? optionsLoad : options)[indexFocus]);
715
+ handleOpenClose();
716
+ flag = true;
717
+ }
839
718
  } else if (e.code === "ArrowDown") {
840
- focusElement(`form-element-${field}-0`);
841
- flag = true;
842
- }
843
- } else {
844
- if (e.code === "ArrowDown") {
845
- setDropdownOpen(true);
846
- focusElement(`form-element-${field}-0`);
847
- flag = true;
848
- } else if (e.code === "Space") {
849
- setDropdownOpen(true);
850
- flag = true;
719
+ if (dropdownOpen) {
720
+ let newIndex = 0;
721
+ if (indexFocus >= 0) {
722
+ newIndex = indexFocus + 1;
723
+ } else if (value) {
724
+ newIndex = (optionsLoad ? optionsLoad : options)?.findIndex((e2) => e2[fieldValue ?? "value"] === value[fieldValue ?? "value"]) + 1;
725
+ }
726
+ if (newIndex < (optionsLoad ? optionsLoad : options).length) {
727
+ setIndexFocus(newIndex);
728
+ checkIfElementIsOutOfScroll(0, newIndex);
729
+ } else {
730
+ setIndexFocus(0);
731
+ checkIfElementIsOutOfScroll(1, 0);
732
+ }
733
+ flag = true;
734
+ } else {
735
+ handleOpenClose();
736
+ flag = true;
737
+ }
738
+ } else if (e.code === "ArrowUp") {
739
+ if (dropdownOpen) {
740
+ let newIndex = 0;
741
+ if (indexFocus >= 0) {
742
+ newIndex = indexFocus - 1;
743
+ } else if (value) {
744
+ newIndex = (optionsLoad ? optionsLoad : options)?.findIndex((e2) => e2[fieldValue ?? "value"] === value[fieldValue ?? "value"]) - 1;
745
+ }
746
+ if (newIndex >= 0) {
747
+ setIndexFocus(newIndex);
748
+ checkIfElementIsOutOfScroll(2, newIndex);
749
+ } else {
750
+ setIndexFocus((optionsLoad ? optionsLoad : options).length - 1);
751
+ checkIfElementIsOutOfScroll(3, (optionsLoad ? optionsLoad : options).length - 1);
752
+ }
753
+ flag = true;
754
+ }
851
755
  }
852
756
  }
853
- if (onKeyDown && !flag) {
854
- const key = onKeyDown(e);
855
- if (key === "ArrowRight" || key === "ArrowLeft") {
856
- closeMenu();
857
- }
858
- } else {
757
+ if (flag) {
859
758
  e.stopPropagation();
860
759
  e.preventDefault();
861
760
  }
862
761
  };
863
- const formKeyDown = (e, handSubmit) => {
864
- if (e.code === "Enter") {
865
- handSubmit();
866
- e.preventDefault();
867
- e.stopPropagation();
868
- } else {
869
- if (onKeyDown) {
870
- const key = onKeyDown(e);
871
- if (key === "ArrowRight" || key === "ArrowLeft") {
872
- closeMenu();
762
+ const checkIfElementIsOutOfScroll = (flag, index) => {
763
+ if (selectMenuTableRef) {
764
+ const elementFocus = document.getElementById(`row-select-table-${index}`);
765
+ if (elementFocus) {
766
+ const rect = elementFocus.getBoundingClientRect();
767
+ const parentRect = selectMenuTableRef.current?.getBoundingClientRect();
768
+ if (flag === 1) {
769
+ scrollToElement(selectMenuTableRef.current, 0);
770
+ } else if (flag === 3) {
771
+ scrollToElement(selectMenuTableRef.current, selectMenuTableRef.current.scrollHeight);
772
+ } else if (flag === 0 && rect.bottom + 30 > parentRect.bottom) {
773
+ scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - selectMenuTableRef.current.offsetTop - parentRect.height + rect.height + 50);
774
+ } else if (flag === 2 && rect.top < parentRect.top + 50) {
775
+ scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - 65);
873
776
  }
874
777
  }
875
778
  }
876
779
  };
877
- const formItemKeyDown = (e, index) => {
878
- if (e.code === "ArrowDown" && index < itemsField.length - 1) {
879
- focusElement(`form-element-${field}-${index + 1}`);
880
- e.preventDefault();
881
- e.stopPropagation();
882
- } else if (e.code === "ArrowUp" && index > 0) {
883
- focusElement(`form-element-${field}-${index - 1}`);
884
- e.preventDefault();
885
- e.stopPropagation();
886
- } else if (e.code === "Tab" && onChangeField && index === itemsField.length - 1) {
887
- closeMenu();
888
- }
780
+ let timeOutElement;
781
+ const scrollToElement = (elemment, top) => {
782
+ clearTimeout(timeOutElement);
783
+ timeOutElement = setTimeout(() => {
784
+ elemment.scrollTo({
785
+ top,
786
+ behavior: "smooth"
787
+ });
788
+ }, 100);
889
789
  };
890
- const elementChange = (field2) => {
891
- if (onChangeField) {
892
- onChangeField(rowData, field2, setValue, getValues);
893
- const rs = getValues();
894
- if (rs) {
895
- onChange(rs);
790
+ const renderHeaderCol = (col, indexCol) => {
791
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
792
+ import_react6.Fragment,
793
+ {
794
+ children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
795
+ "th",
796
+ {
797
+ className: (0, import_classnames4.default)(
798
+ `r-select-headercell fix-${col.fixedType}`,
799
+ { "cell-fixed": col.fixedType }
800
+ ),
801
+ style: {
802
+ width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width,
803
+ minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.minWidth,
804
+ top: `${0 * 35}px`,
805
+ maxWidth: col.maxWidth
806
+ },
807
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
808
+ "div",
809
+ {
810
+ role: "textbox",
811
+ title: t(col.headerText ?? ""),
812
+ style: {
813
+ height: `${1 * 35}px`,
814
+ justifyContent: col.textAlign ?? "left"
815
+ },
816
+ className: "r-select-headercell-div",
817
+ children: t(col.headerText ?? "")
818
+ }
819
+ )
820
+ }
821
+ )
822
+ },
823
+ `header-select-${indexCol}`
824
+ );
825
+ };
826
+ const checkSearch = (keyword, data, columnsSearch) => {
827
+ if (!keyword || columnsSearch.length === 0) {
828
+ return true;
829
+ }
830
+ for (let index = 0; index < columnsSearch.length; index++) {
831
+ const key = columnsSearch[index].field.trim();
832
+ if (data[key] && data[key].toString().trim().toLowerCase().includes(keyword.trim().toLowerCase())) {
833
+ return true;
896
834
  }
897
835
  }
836
+ return false;
898
837
  };
899
- const renderForm = (rows) => {
900
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Row, { className: "gy-25", children: rows.map((item, index) => {
901
- if (item.type === "numeric") {
902
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
903
- input_number_default,
904
- {
905
- id: `form-element-${field}-${index}`,
906
- control,
907
- name: item.name,
908
- label: item.label ? item.label : "",
909
- labelSize: `text-left ${labelSize}`,
910
- errors: errors[item.name],
911
- disabled: item.disabled,
912
- min: item.min,
913
- max: item.max,
914
- fractionCurrency: item.fraction,
915
- callback: () => {
916
- elementChange(item.name);
917
- }
918
- },
919
- index
920
- ) }, index);
921
- } else if (item.type === "text") {
922
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
923
- input_text_default,
924
- {
925
- id: `form-element-${field}-${index}`,
926
- control,
927
- name: item.name,
928
- label: item.label ? item.label : "",
929
- labelSize: `text-left ${labelSize}`,
930
- errors: errors[item.name],
931
- disabled: item.disabled,
932
- callback: () => {
933
- elementChange(item.name);
934
- }
935
- },
936
- index
937
- ) }, index);
938
- } else if (item.type === "select") {
939
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
940
- select_default,
941
- {
942
- id: `form-element-${field}-${index}`,
943
- options: item.options ?? [],
944
- control,
945
- name: item.name,
946
- label: item.label ? item.label : "",
947
- labelSize: `text-left ${labelSize}`,
948
- menuPortalTarget: document.body,
949
- errors: errors[item.name],
950
- disabled: item.disabled,
951
- callback: () => {
952
- elementChange(item.name);
953
- }
954
- },
955
- index
956
- ) }, index);
957
- } else if (item.type === "selectCreatable") {
958
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
959
- creactable_select_default,
960
- {
961
- id: `form-element-${field}-${index}`,
962
- options: item.options ?? [],
963
- control,
964
- name: item.name,
965
- placeholder: t("Select"),
966
- menuPortalTarget: document.body,
967
- label: item.label ? item.label : "",
968
- labelSize: ` ${labelSize}`,
969
- errors: errors[item.name],
970
- callback: () => {
971
- elementChange(item.name);
972
- }
973
- },
974
- index
975
- ) }, index);
976
- }
977
- }) });
838
+ const callbackLoadOption = (rs) => {
839
+ setIsLoading(false);
840
+ setOptionsLoad(rs);
978
841
  };
979
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
842
+ (0, import_react6.useEffect)(() => {
843
+ if (!searchTerm) {
844
+ setOptionsLoad(void 0);
845
+ }
846
+ }, [searchTerm]);
847
+ const checkOverflow = (indexRow, indexCol) => {
848
+ const element = document.getElementById(`select-${id}-${indexRow}-${indexCol}`);
849
+ return element && element.scrollWidth > element.clientWidth;
850
+ };
851
+ const RenderElement = (props2) => {
852
+ const { indexRow, row, isSelected, level = 0 } = props2;
853
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
854
+ "tr",
855
+ {
856
+ id: `row-select-table-${indexRow}`,
857
+ style: { paddingLeft: 10 * level },
858
+ className: (0, import_classnames4.default)("r-select-row", { "last-row": indexRow === (optionsLoad ? optionsLoad : options).length - 1 }, { "fisrt-row": indexRow === 0 }),
859
+ children: [
860
+ isMulti && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
861
+ "td",
862
+ {
863
+ className: (0, import_classnames4.default)(`r-select-rowcell`, { "r-select-move": indexFocus === indexRow, "r-select-active": !isMulti && value && value[fieldValue ?? "value"] === row[fieldValue ?? "value"] }),
864
+ style: { width: 40, textAlign: "center", padding: 0, paddingBottom: 6 },
865
+ onClick: (e) => {
866
+ if (isMulti) {
867
+ const index = value?.findIndex((x) => x === row[fieldValue ?? "value"]);
868
+ if (index > -1) {
869
+ value?.splice(index, 1);
870
+ const valueArr = (optionsLoad ? optionsLoad : options).filter((ele) => value?.some((x) => x === ele[fieldValue ?? "value"]));
871
+ onChange(valueArr);
872
+ } else {
873
+ if (value) {
874
+ value?.push(row[fieldValue ?? "value"]);
875
+ const valueArr = (optionsLoad ? optionsLoad : options).filter((ele) => value?.some((x) => x === ele[fieldValue ?? "value"]));
876
+ onChange(valueArr);
877
+ } else {
878
+ onChange([row[fieldValue ?? "value"]]);
879
+ }
880
+ }
881
+ e.stopPropagation();
882
+ }
883
+ },
884
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
885
+ import_reactstrap4.Input,
886
+ {
887
+ checked: isSelected,
888
+ type: "checkbox",
889
+ className: "cursor-pointer",
890
+ onChange: () => {
891
+ },
892
+ style: { textAlign: "center", marginTop: 6 }
893
+ }
894
+ )
895
+ }
896
+ ),
897
+ (columns ? columns : defaultColumns).map((col, indexCol) => {
898
+ let valueDisplay = row[col.field];
899
+ if (col.type === "numeric" || col.typeCondition && col.typeCondition(row) === "numeric") {
900
+ valueDisplay = formartNumberic(row[col.field], decimalSeparator ?? ".", thousandSeparator ?? ",", col.fraction ?? 0, true) ?? 0;
901
+ } else if (col.type === "date") {
902
+ valueDisplay = valueDisplay ? (0, import_moment.default)(valueDisplay).format("DD/MM/yyyy") : "";
903
+ } else if (col.type === "datetime") {
904
+ valueDisplay = valueDisplay ? (0, import_moment.default)(valueDisplay).format("DD/MM/yyyy HH:mm") : "";
905
+ }
906
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_react6.Fragment, { children: [
907
+ col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
908
+ "td",
909
+ {
910
+ id: `select-${id}-${indexRow}-${indexCol}`,
911
+ className: (0, import_classnames4.default)(`r-select-rowcell`, { "r-select-move": indexFocus === indexRow, "r-select-active": !isMulti && value && value[fieldValue ?? "value"] === row[fieldValue ?? "value"] }),
912
+ style: {
913
+ minWidth: col.minWidth,
914
+ width: col.width,
915
+ maxWidth: col.maxWidth,
916
+ textAlign: col.textAlign ? col.textAlign : "left"
917
+ },
918
+ onClick: (e) => {
919
+ if (isMulti) {
920
+ const index = value?.findIndex((x) => x === row[fieldValue ?? "value"]);
921
+ if (index > -1) {
922
+ value?.splice(index, 1);
923
+ const valueArr = (optionsLoad ? optionsLoad : options).filter((ele) => value?.some((x) => x === ele[fieldValue ?? "value"]));
924
+ onChange(valueArr);
925
+ } else {
926
+ if (value) {
927
+ value?.push(row[fieldValue ?? "value"]);
928
+ const valueArr = (optionsLoad ? optionsLoad : options).filter((ele) => value?.some((x) => x === ele[fieldValue ?? "value"]));
929
+ onChange(valueArr);
930
+ } else {
931
+ onChange([row[fieldValue ?? "value"]]);
932
+ }
933
+ }
934
+ } else {
935
+ onChange(row);
936
+ setSearchTerm("");
937
+ closeMenu();
938
+ }
939
+ e.preventDefault();
940
+ e.stopPropagation();
941
+ },
942
+ onMouseMove: (e) => {
943
+ if (indexRow !== indexFocus) {
944
+ setIndexFocus(indexRow);
945
+ }
946
+ e.stopPropagation();
947
+ },
948
+ children: col.template ? col.template(row, indexRow) : valueDisplay
949
+ },
950
+ `col-${indexRow}-${indexCol}`
951
+ ),
952
+ checkOverflow(indexRow, indexCol) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `select-${id}-${indexRow}-${indexCol}`, children: col.template ? col.template(row, indexRow) : valueDisplay })
953
+ ] }, indexCol);
954
+ })
955
+ ]
956
+ },
957
+ `row-${indexRow}`
958
+ );
959
+ };
960
+ const RenderTable = (props2) => {
961
+ const {} = props2;
962
+ let countDisplay = 0;
963
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
964
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("table", { style: { width: "100%" }, children: [
965
+ !noHeader && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("thead", { className: "r-select-gridheader", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tr", { className: "r-select-row", role: "row", children: [
966
+ isMulti && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: (0, import_classnames4.default)(`r-select-headercell`), style: { width: 40, top: `0px` }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
967
+ "div",
968
+ {
969
+ style: { justifyContent: "center" },
970
+ className: (0, import_classnames4.default)("r-select-headercell-div"),
971
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
972
+ import_reactstrap4.Input,
973
+ {
974
+ checked: isSelectedAll,
975
+ type: "checkbox",
976
+ onClick: (e) => {
977
+ if (isMulti) {
978
+ if (isSelectedAll) {
979
+ onChange([]);
980
+ } else {
981
+ onChange([...optionsLoad ? optionsLoad : options]);
982
+ }
983
+ e.stopPropagation();
984
+ }
985
+ },
986
+ readOnly: true,
987
+ className: (0, import_classnames4.default)("cursor-pointer", { "d-none": !isMulti }),
988
+ style: { textAlign: "center", marginTop: 6 }
989
+ }
990
+ )
991
+ }
992
+ ) }),
993
+ !noHeader && (columns ? columns : defaultColumns).map((col, index) => {
994
+ return renderHeaderCol(col, index);
995
+ })
996
+ ] }) }),
997
+ (optionsLoad ? optionsLoad : options).length > 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("tbody", { className: "r-select-gridcontent", children: (optionsLoad ? optionsLoad : options)?.map((row, indexRow) => {
998
+ if (!isMulti && loadOptions || checkSearch(searchTerm, row, columns ? columns : defaultColumns)) {
999
+ const isSelected = isMulti && value?.some((x) => x === row[fieldValue ?? "value"]);
1000
+ countDisplay++;
1001
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderElement, { isSelected, indexRow, row }, `select-table-${indexRow}`);
1002
+ }
1003
+ }) }) })
1004
+ ] }),
1005
+ countDisplay === 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "r-no-data", children: [
1006
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { width: "64", height: "41", viewBox: "0 0 64 41", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("g", { transform: "translate(0 1)", fill: "none", fillRule: "evenodd", children: [
1007
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }),
1008
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [
1009
+ /* @__PURE__ */ (0, import_jsx_runtime5.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" }),
1010
+ /* @__PURE__ */ (0, import_jsx_runtime5.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" })
1011
+ ] })
1012
+ ] }) }),
1013
+ t("No data available.")
1014
+ ] }),
1015
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "r-no-data", children: [
1016
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.Spinner, { className: "me-1", children: " " }),
1017
+ t("Loading...")
1018
+ ] })
1019
+ ] });
1020
+ };
1021
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
980
1022
  "div",
981
1023
  {
982
- className: "form-edit",
1024
+ className: (0, import_classnames4.default)("react-select-table", { "is-invalid": invalid }),
983
1025
  ref,
984
1026
  id,
985
- children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref: editFormRef, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
986
- import_reactstrap6.Dropdown,
1027
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref: selectTableRef, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1028
+ import_reactstrap4.Dropdown,
987
1029
  {
988
1030
  isOpen: dropdownOpen,
989
1031
  toggle: () => {
990
1032
  },
1033
+ onMouseDown: (e) => e.preventDefault(),
991
1034
  children: [
992
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.DropdownToggle, { tag: "div", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
993
- import_reactstrap6.Input,
994
- {
995
- style: { backgroundColor: "#FFF", textAlign: textAlign ?? "left" },
996
- placeholder,
997
- innerRef: inputRef,
998
- className: (0, import_classnames6.default)("input-display input-numeric", { "is-invalid": invalid }),
999
- value: displayValue,
1000
- onClick: handleOnClick,
1001
- onKeyDown: (e) => handleOnKeyDown(e),
1002
- onPaste: (e) => onPaste && onPaste(e),
1003
- readOnly: true
1004
- }
1005
- ) }),
1006
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1007
- import_reactstrap6.DropdownMenu,
1035
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1036
+ import_reactstrap4.DropdownToggle,
1008
1037
  {
1009
- className: "formula-dropdown icon-dropdown p-0",
1010
- style: {
1011
- minWidth: minWidth ? minWidth : defaultWidth,
1012
- width: menuWidth ? menuWidth : "min-content",
1013
- maxWidth: innerWidth > 1280 ? 1280 : innerWidth,
1014
- borderRadius: 8,
1015
- zIndex: 1056
1038
+ onClick: (e) => {
1039
+ if (!isDisabled) {
1040
+ inputRef?.current.focus();
1041
+ handleOpenClose();
1042
+ }
1043
+ e.preventDefault();
1016
1044
  },
1017
- 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: [
1018
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1045
+ tag: "div",
1046
+ style: { width: width ? width : "100%" },
1047
+ className: (0, import_classnames4.default)("select-table-control", { "r-select-is-disabled": isDisabled }, { "r-select-is-open": dropdownOpen }, { "r-select-is-focus": isFocus }, { "r-select-is-invalid": invalid }),
1048
+ children: [
1049
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "select-table-container", children: [
1050
+ isMulti ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_classnames4.default)("select-value is-mutil", { "d-none": searchTerm }), children: value?.map((ele, index) => {
1051
+ const element = (optionsLoad ? optionsLoad : options).find((e) => e[fieldValue ?? "value"] === ele);
1052
+ if (element) {
1053
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { children: [
1054
+ index === 0 ? "" : ", ",
1055
+ element[fieldLabel ?? "label"]
1056
+ ] }, index);
1057
+ }
1058
+ }) }) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_classnames4.default)("select-value", { "d-none": searchTerm }), children: [
1059
+ value ? formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? "label"] : "",
1060
+ " "
1061
+ ] }) }),
1062
+ !((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_classnames4.default)("select-placeholder"), children: placeholder }),
1063
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "input-container", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1064
+ "input",
1065
+ {
1066
+ style: { textAlign: textAlign ?? "left" },
1067
+ ref: inputRef,
1068
+ className: (0, import_classnames4.default)("select-input"),
1069
+ readOnly: isDisabled,
1070
+ value: searchTerm,
1071
+ onPaste: (e) => onPaste && !dropdownOpen && onPaste(e),
1072
+ onChange: (val) => {
1073
+ if (!isMulti && loadOptions && val.target.value) {
1074
+ setIsLoading(true);
1075
+ loadOptions(val.target.value, callbackLoadOption);
1076
+ }
1077
+ setSearchTerm(val.target.value);
1078
+ },
1079
+ onKeyDown: (e) => handleOnKeyDown(e)
1080
+ }
1081
+ ) })
1082
+ ] }),
1083
+ isLoading && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: (0, import_classnames4.default)("select-table-indicator d-flex align-items-center"), children: [
1084
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }),
1085
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }),
1086
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" })
1087
+ ] }),
1088
+ isClearable && value && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1019
1089
  "div",
1020
1090
  {
1021
- className: "p-1",
1022
- style: {
1023
- maxHeight: menuHeight ? menuHeight : 300,
1024
- overflow: "auto"
1091
+ className: (0, import_classnames4.default)("cursor-pointer"),
1092
+ onClick: (e) => {
1093
+ onChange(isMulti ? [] : void 0);
1094
+ e.stopPropagation();
1025
1095
  },
1026
- children: itemsField ? renderForm(itemsField) : ""
1096
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.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_runtime5.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" }) })
1027
1097
  }
1028
1098
  ),
1029
- /* @__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: [
1030
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-primary py-25", style: { fontSize: 12 }, children: footerTemplate ? footerTemplate(rowData) : "" }),
1031
- !onChangeField ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "d-flex justify-content-end", children: [
1032
- isClearable && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1033
- import_reactstrap6.Button,
1034
- {
1035
- ref: buttonRef,
1036
- className: "btn me-50 py-25 px-50",
1037
- outline: true,
1038
- onClick: () => {
1039
- itemsField.forEach((e) => {
1040
- if (e.type === "numeric") {
1041
- setValue(e.name, 0);
1042
- } else {
1043
- setValue(e.name, "");
1044
- }
1045
- });
1046
- },
1047
- onKeyDown: (e) => {
1048
- if (e.code === "Tab") {
1049
- closeMenu();
1050
- }
1051
- },
1052
- children: t("Clear")
1053
- }
1054
- ),
1055
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1056
- import_reactstrap6.Button,
1057
- {
1058
- ref: buttonRef,
1059
- color: "primary",
1060
- className: "btn btn-primary py-25 px-50",
1061
- onClick: handleSubmit(handleOnSubmit),
1062
- onKeyDown: (e) => {
1063
- if (e.code === "Tab") {
1064
- closeMenu();
1065
- }
1066
- },
1067
- children: t("Save")
1068
- }
1069
- )
1070
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, {})
1071
- ] })
1072
- ] }) })
1099
+ !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "select-table-indicator", onMouseDown: (e) => e.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("svg", { height: "20", width: "20", viewBox: "0 0 20 20", children: /* @__PURE__ */ (0, import_jsx_runtime5.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" }) }) })
1100
+ ]
1101
+ }
1102
+ ),
1103
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1104
+ import_reactstrap4.DropdownMenu,
1105
+ {
1106
+ container: component,
1107
+ className: "formula-dropdown icon-dropdown p-0",
1108
+ style: {
1109
+ width: menuWidth ? menuWidth : "min-content",
1110
+ position: "fixed",
1111
+ borderRadius: 3,
1112
+ zIndex: 9999
1113
+ },
1114
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_reactstrap4.DropdownItem, { className: (0, import_classnames4.default)("p-0 menu-select-table"), style: { borderRadius: "6px" }, tag: "div", header: true, children: dropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1115
+ "div",
1116
+ {
1117
+ onMouseDown: (e) => {
1118
+ if (!isDisabled) {
1119
+ inputRef?.current.focus();
1120
+ e.preventDefault();
1121
+ }
1122
+ },
1123
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "r-select-grid", children: [
1124
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "r-select-gridtable", ref: selectMenuTableRef, style: { minWidth: selectTableRef?.current?.clientWidth, maxHeight: maxHeight ?? defaultMaxHeight }, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RenderTable, {}) }),
1125
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: (0, import_classnames4.default)("r-select-footer", { "d-none": !(showFooter === true || handleAdd) }), children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_reactstrap4.Button, { outline: true, color: "primary", onClick: handleAdd, className: (0, import_classnames4.default)("r-btn-add d-flex align-items-center", { "d-none": !handleAdd }), children: [
1126
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_becoxy_icons2.Plus, { className: "me-50", fontSize: 16 }),
1127
+ t("AddNew"),
1128
+ " (F9)"
1129
+ ] }) })
1130
+ ] })
1131
+ }
1132
+ ) })
1073
1133
  }
1074
1134
  )
1075
1135
  ]
@@ -1078,1082 +1138,962 @@ var EditForm = (0, import_react8.forwardRef)((props, ref) => {
1078
1138
  }
1079
1139
  );
1080
1140
  });
1081
- var edit_form_default = EditForm;
1082
-
1083
- // test-app/src/component/sidebar-setting-column/index.tsx
1084
- var import_react10 = require("react");
1085
- var import_reactstrap7 = require("reactstrap");
1086
- var import_react_i18next7 = require("react-i18next");
1087
1141
 
1088
- // test-app/src/component/modal-header/index.tsx
1089
- var import_becoxy_icons2 = require("becoxy-icons");
1090
- var import_classnames7 = __toESM(require("classnames"));
1091
- var import_react_i18next6 = require("react-i18next");
1092
- var import_jsx_runtime8 = require("react/jsx-runtime");
1093
- var ModalHeader = (props) => {
1094
- const { title, handleModal, typeModal = "Edit", component } = props;
1095
- const { t } = (0, import_react_i18next6.useTranslation)();
1096
- const handleModalIcon = () => {
1097
- if (typeModal === "Edit" || typeModal === "Approval") {
1098
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons2.Edit, { fontSize: 17, className: "me-1" });
1099
- } else if (typeModal === "View") {
1100
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons2.Info, { fontSize: 17, className: "me-1" });
1101
- } else if (typeModal === "Detail") {
1102
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons2.Info, { fontSize: 17, className: "me-1" });
1103
- } else if (typeModal === "Order") {
1104
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "e-icons e-sorting-1 me-1", style: { fontSize: "14px" } });
1105
- } else if (typeModal === "Process") {
1106
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "e-flat e-icons e-paste-match-destination me-1", style: { fontSize: "14px" } });
1107
- } else {
1108
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons2.Plus, { fontSize: 17, className: "me-1" });
1142
+ // test-app/src/component/edit-form/select-table/index.tsx
1143
+ var import_react_i18next4 = require("react-i18next");
1144
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1145
+ var SelectTableBox = (props) => {
1146
+ const {
1147
+ isMulti,
1148
+ isLabel,
1149
+ confirmHandle,
1150
+ id,
1151
+ fieldValue,
1152
+ fieldLabel,
1153
+ labelComponent,
1154
+ defaultOptions,
1155
+ loadOptions,
1156
+ control,
1157
+ placeholder,
1158
+ disabled,
1159
+ name,
1160
+ label,
1161
+ labelSize,
1162
+ required,
1163
+ errors,
1164
+ inLine,
1165
+ callback,
1166
+ desciptionLabel,
1167
+ classLabel,
1168
+ isClearable,
1169
+ defaultValue,
1170
+ handleAddNew,
1171
+ columns,
1172
+ ...rest
1173
+ } = props;
1174
+ const handChange = ({ onChange, val }) => {
1175
+ onChange(!isNullOrUndefined(val) && isMulti ? val.map((item) => item.value) : !isNullOrUndefined(val) && !isMulti ? fieldValue ? val[fieldValue] : val?.value : void 0);
1176
+ if (callback) {
1177
+ callback(val);
1109
1178
  }
1110
1179
  };
1111
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "modal-header d-flex align-items-center justify-content-between mb-1", children: [
1112
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "d-flex align-items-center justify-content-start", children: [
1113
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h5", { className: "modal-title", children: [
1114
- handleModalIcon(),
1180
+ const renderLabel = (props2) => {
1181
+ const { t } = (0, import_react_i18next4.useTranslation)();
1182
+ const { isLabel: isLabel2, desciptionLabel: desciptionLabel2, id: id2, classLabel: classLabel2, name: name2, label: label2, required: required2 } = props2;
1183
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react7.Fragment, { children: [
1184
+ isLabel2 === false ? "" : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_reactstrap5.Label, { id: `label-${id2}`, className: classLabel2, for: name2, children: [
1185
+ t(label2 ? label2 : ""),
1115
1186
  " ",
1116
- t(title)
1187
+ required2 ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-danger", children: "*" }) : ""
1117
1188
  ] }),
1118
- component ? component() : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, {})
1119
- ] }),
1120
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "todo-item-action d-flex align-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1121
- import_becoxy_icons2.X,
1122
- {
1123
- className: (0, import_classnames7.default)("fw-normal mt-25 cursor-pointer", { "d-none": !handleModal }),
1124
- fontSize: 20,
1125
- onClick: handleModal
1126
- }
1127
- ) })
1128
- ] });
1129
- };
1130
- var modal_header_default = ModalHeader;
1131
-
1132
- // test-app/src/component/sidebar/index.tsx
1133
- var import_becoxy_icons3 = require("becoxy-icons");
1134
- var import_classnames8 = __toESM(require("classnames"));
1135
- var import_react9 = require("react");
1136
- var import_jsx_runtime9 = require("react/jsx-runtime");
1137
- var Sidebar = (props) => {
1138
- const {
1139
- open,
1140
- children,
1141
- toggleSidebar,
1142
- width,
1143
- keyboard,
1144
- hiddenBackground,
1145
- hiddenFullScreenButton
1146
- } = props;
1147
- const [isFullScreen, setIsFullScreen] = (0, import_react9.useState)(false);
1148
- const [flag, setFlag] = (0, import_react9.useState)(open);
1149
- (0, import_react9.useEffect)(() => {
1150
- if (open !== flag) {
1151
- if (open) {
1152
- setFlag(open);
1153
- } else {
1154
- setTimeout(() => {
1155
- setFlag(open);
1156
- }, 50);
1157
- }
1158
- }
1159
- }, [open]);
1160
- const handClose = () => {
1161
- setFlag(false);
1162
- setTimeout(() => {
1163
- toggleSidebar();
1164
- }, 400);
1189
+ (!isNullOrUndefined(desciptionLabel2) && desciptionLabel2 !== "") ?? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_reactstrap5.UncontrolledTooltip, { target: `label-${id2}`, children: t(desciptionLabel2 ?? "") }) })
1190
+ ] });
1165
1191
  };
1166
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1192
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
1167
1193
  "div",
1168
1194
  {
1169
- tabIndex: 0,
1170
- className: (0, import_classnames8.default)({ "d-none": !open }),
1171
- onKeyDown: (e) => {
1172
- if (!keyboard && e.code === "Escape" && flag) {
1173
- handClose();
1174
- e.stopPropagation();
1175
- e.preventDefault();
1195
+ className: (0, import_classnames5.default)(
1196
+ inLine === false ? "form-group " : "form-row-inline d-flex",
1197
+ "align",
1198
+ {
1199
+ [labelSize ? labelSize : ""]: labelSize,
1200
+ "form-row-inline-error": errors
1176
1201
  }
1177
- },
1202
+ ),
1178
1203
  children: [
1179
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1180
- "div",
1181
- {
1182
- className: (0, import_classnames8.default)("offcanvas-backdrop fade", {
1183
- "d-none": !flag || hiddenBackground,
1184
- show: flag
1185
- }),
1186
- style: { zIndex: 1056 },
1187
- onClick: handClose
1188
- }
1189
- ),
1190
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1191
- "div",
1192
- {
1193
- className: (0, import_classnames8.default)("customizer d-none d-md-block ", `customizer-${width ?? 600}`, {
1194
- open: flag,
1195
- fullscreen: isFullScreen
1196
- }),
1197
- style: { zIndex: 1057 },
1198
- children: [
1199
- /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1200
- "div",
1201
- {
1202
- style: {
1203
- position: "fixed",
1204
- top: "50%",
1205
- transform: "translate(-50%, -50%)",
1206
- background: "#FFF",
1207
- filter: "drop-shadow(0.9px 0.9px 1.5px)",
1208
- height: 50,
1209
- display: "flex",
1210
- alignItems: "center",
1211
- borderRadius: "0px 5px 5px 0px",
1212
- cursor: "pointer",
1213
- zIndex: 9,
1214
- marginLeft: 7
1215
- },
1216
- className: (0, import_classnames8.default)({ "d-none": hiddenFullScreenButton }),
1217
- onClick: () => {
1218
- setIsFullScreen(!isFullScreen);
1219
- },
1220
- children: [
1221
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_becoxy_icons3.ChevronLeft, { className: `${isFullScreen ? "d-none" : ""}`, fontSize: 16 }),
1222
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_becoxy_icons3.ChevronRight, { className: `${!isFullScreen ? "d-none" : ""}`, fontSize: 15 })
1223
- ]
1224
- }
1225
- ),
1226
- children
1227
- ]
1228
- }
1229
- )
1204
+ renderLabel({ isLabel, desciptionLabel, classLabel, name, label, required, id: id ?? "" }),
1205
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: (0, import_classnames5.default)("form-input-content", { "hidden-label": isLabel === false }), children: [
1206
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1207
+ import_react_hook_form3.Controller,
1208
+ {
1209
+ name,
1210
+ control,
1211
+ render: ({ field: { value, onChange } }) => {
1212
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
1213
+ SelectTable,
1214
+ {
1215
+ ...rest,
1216
+ id,
1217
+ value: (isMulti ? value?.length > 0 : value) ? !isMulti ? defaultOptions.find((val) => val[fieldValue ?? "value"] === value) ?? (defaultValue ?? "") : value : isMulti ? [] : void 0,
1218
+ onChange: (val) => {
1219
+ if (isMulti || (fieldValue && val ? val[fieldValue] : val?.value) !== value) {
1220
+ if (confirmHandle) {
1221
+ confirmHandle(handChange, onChange, val);
1222
+ } else {
1223
+ if (isMulti) {
1224
+ onChange(!isNullOrUndefined(val) ? val.map((item) => item[fieldValue ?? "value"]) : []);
1225
+ } else {
1226
+ onChange(!isNullOrUndefined(val) ? val[fieldValue ?? "value"] : void 0);
1227
+ }
1228
+ if (callback) {
1229
+ callback(val);
1230
+ }
1231
+ }
1232
+ }
1233
+ },
1234
+ handleAdd: handleAddNew,
1235
+ isClearable,
1236
+ isMulti,
1237
+ placeholder,
1238
+ invalid: errors,
1239
+ loadOptions,
1240
+ options: defaultOptions,
1241
+ isDisabled: disabled,
1242
+ columns,
1243
+ fieldValue,
1244
+ fieldLabel,
1245
+ formatOptionLabel: labelComponent ? labelComponent : void 0
1246
+ }
1247
+ );
1248
+ }
1249
+ }
1250
+ ),
1251
+ errors && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_reactstrap5.FormFeedback, { children: errors?.message })
1252
+ ] })
1230
1253
  ]
1231
1254
  }
1232
- );
1255
+ ) });
1233
1256
  };
1234
- var sidebar_default = Sidebar;
1257
+ var select_table_default = SelectTableBox;
1235
1258
 
1236
- // test-app/src/component/sidebar-setting-column/index.tsx
1237
- var import_classnames9 = __toESM(require("classnames"));
1238
- var import_jsx_runtime10 = require("react/jsx-runtime");
1239
- var SidebarSetColumn = (props) => {
1240
- const { column, setColumn, openSidebar, handleSidebar } = props;
1241
- const { t } = (0, import_react_i18next7.useTranslation)();
1242
- const [dataSource, setDataSource] = (0, import_react10.useState)([]);
1243
- const [indexFocus, setIndexFocus] = (0, import_react10.useState)();
1244
- (0, import_react10.useEffect)(() => {
1245
- if (openSidebar) {
1246
- setDataSource(column.map((e) => ({ ...e })));
1247
- }
1248
- }, [openSidebar]);
1249
- const handleCancel = () => {
1250
- handleSidebar();
1251
- setDataSource([]);
1252
- };
1253
- const handleSubmit = () => {
1254
- setColumn([...dataSource]);
1255
- handleCancel();
1256
- };
1257
- const getWindowSize = () => {
1258
- const { innerWidth, innerHeight } = window;
1259
- return { innerWidth, innerHeight };
1259
+ // test-app/src/component/edit-form/index.tsx
1260
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1261
+ var defaultWidth = 200;
1262
+ var EditForm = (0, import_react8.forwardRef)((props, ref) => {
1263
+ const {
1264
+ id,
1265
+ field,
1266
+ displayValue,
1267
+ menuHeight,
1268
+ menuWidth,
1269
+ rowData,
1270
+ invalid,
1271
+ onChange,
1272
+ onChangeField,
1273
+ onKeyDown,
1274
+ defaultValues,
1275
+ placeholder,
1276
+ textAlign,
1277
+ schema,
1278
+ onFormOpen,
1279
+ onFormSubmit,
1280
+ footerTemplate,
1281
+ minWidth,
1282
+ onPaste,
1283
+ openOnFocus,
1284
+ isClearable,
1285
+ labelSize = "label-small"
1286
+ } = props;
1287
+ const { innerWidth } = window;
1288
+ const inputRef = (0, import_react8.useRef)();
1289
+ const editFormRef = (0, import_react8.useRef)();
1290
+ const buttonRef = (0, import_react8.useRef)();
1291
+ const [dropdownOpen, setDropdownOpen] = (0, import_react8.useState)(false);
1292
+ const [itemsField, setItemsField] = (0, import_react8.useState)([]);
1293
+ const { t } = (0, import_react_i18next5.useTranslation)();
1294
+ useOnClickOutside(editFormRef, () => {
1295
+ closeMenu();
1296
+ });
1297
+ const closeMenu = () => {
1298
+ setTimeout(() => {
1299
+ setDropdownOpen(false);
1300
+ }, onChangeField ? 10 : 0);
1260
1301
  };
1261
- const [windowSize, setWindowSize] = (0, import_react10.useState)(getWindowSize());
1262
- (0, import_react10.useEffect)(() => {
1263
- const handleWindowResize = () => {
1264
- setWindowSize(getWindowSize());
1265
- };
1266
- window.addEventListener("resize", handleWindowResize);
1267
- return () => {
1268
- window.removeEventListener("resize", handleWindowResize);
1269
- };
1270
- }, []);
1271
- const renderFooterButtons = () => {
1272
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react10.Fragment, { children: [
1273
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "primary", onClick: handleSubmit, className: "me-1", children: t("Confirm") }),
1274
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "secondary", onClick: handleCancel, outline: true, children: t("Close") })
1275
- ] });
1302
+ const {
1303
+ control,
1304
+ handleSubmit,
1305
+ getValues,
1306
+ reset,
1307
+ setValue,
1308
+ formState: { errors }
1309
+ } = (0, import_react_hook_form4.useForm)({
1310
+ mode: "onChange",
1311
+ defaultValues,
1312
+ resolver: (0, import_yup.yupResolver)(schema)
1313
+ });
1314
+ (0, import_react8.useEffect)(() => {
1315
+ if (dropdownOpen) {
1316
+ if (onFormOpen && itemsField.length === 0) {
1317
+ onFormOpen(rowData, itemsField, setItemsField);
1318
+ }
1319
+ if (openOnFocus) {
1320
+ setTimeout(() => {
1321
+ focusElement(`form-element-${field}-0`, true);
1322
+ }, 100);
1323
+ }
1324
+ }
1325
+ }, [dropdownOpen]);
1326
+ (0, import_react8.useEffect)(() => {
1327
+ if (dropdownOpen && itemsField.length > 0) {
1328
+ itemsField.forEach((ele) => {
1329
+ setValue(ele.name, rowData[ele.name] ?? "");
1330
+ });
1331
+ }
1332
+ }, [dropdownOpen, itemsField]);
1333
+ const handleOnClick = () => {
1334
+ if (dropdownOpen) {
1335
+ closeMenu();
1336
+ } else {
1337
+ setDropdownOpen(true);
1338
+ }
1276
1339
  };
1277
- const visibleTemplate = (item, index) => {
1278
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1279
- import_reactstrap7.Input,
1280
- {
1281
- defaultChecked: item.visible ?? true,
1282
- disabled: item.invisibleDisable,
1283
- type: "checkbox",
1284
- style: { height: 18 },
1285
- className: " cursor-pointer",
1286
- onChange: (e) => {
1287
- if (dataSource) {
1288
- dataSource[index].visible = e.target.checked;
1289
- setDataSource(dataSource);
1290
- }
1340
+ const handleOnSubmit = (val) => {
1341
+ closeMenu();
1342
+ onChange(val);
1343
+ if (onFormSubmit) {
1344
+ onFormSubmit(rowData, setValue, getValues, reset);
1345
+ }
1346
+ inputRef.current.focus();
1347
+ };
1348
+ const focusElement = (id2, focus) => {
1349
+ const element = document.getElementById(id2);
1350
+ if (element) {
1351
+ if (element.className.includes("react-select")) {
1352
+ element.getElementsByTagName("input")[0]?.focus();
1353
+ } else {
1354
+ element.focus();
1355
+ if (focus) {
1356
+ element.setSelectionRange(0, element.innerText.length - 1);
1291
1357
  }
1292
1358
  }
1293
- );
1359
+ }
1294
1360
  };
1295
- const fixColumnTemplate = (item, index) => {
1296
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1297
- import_reactstrap7.Input,
1298
- {
1299
- defaultChecked: item.fixedType === "left" || item.fixedType === "right",
1300
- type: "checkbox",
1301
- style: { height: 18 },
1302
- className: " cursor-pointer",
1303
- onChange: (e) => {
1304
- if (dataSource) {
1305
- if (e.target.checked) {
1306
- if (index * 2 <= dataSource.length) {
1307
- dataSource[index].fixedType = "left";
1308
- } else {
1309
- dataSource[index].fixedType = "right";
1310
- }
1311
- } else {
1312
- dataSource[index].fixedType = void 0;
1313
- }
1314
- setDataSource(dataSource);
1315
- }
1361
+ const handleOnKeyDown = (e) => {
1362
+ let flag = false;
1363
+ if (dropdownOpen) {
1364
+ if (e.code === "Escape") {
1365
+ closeMenu();
1366
+ flag = true;
1367
+ } else if (e.code === "Enter") {
1368
+ closeMenu();
1369
+ flag = true;
1370
+ } else if (e.code === "ArrowDown") {
1371
+ focusElement(`form-element-${field}-0`);
1372
+ flag = true;
1373
+ }
1374
+ } else {
1375
+ if (e.code === "ArrowDown") {
1376
+ setDropdownOpen(true);
1377
+ focusElement(`form-element-${field}-0`);
1378
+ flag = true;
1379
+ } else if (e.code === "Space") {
1380
+ setDropdownOpen(true);
1381
+ flag = true;
1382
+ }
1383
+ }
1384
+ if (onKeyDown && !flag) {
1385
+ const key = onKeyDown(e);
1386
+ if (key === "ArrowRight" || key === "ArrowLeft") {
1387
+ closeMenu();
1388
+ }
1389
+ } else {
1390
+ e.stopPropagation();
1391
+ e.preventDefault();
1392
+ }
1393
+ };
1394
+ const formKeyDown = (e, handSubmit) => {
1395
+ if (e.code === "Enter") {
1396
+ handSubmit();
1397
+ e.preventDefault();
1398
+ e.stopPropagation();
1399
+ } else {
1400
+ if (onKeyDown) {
1401
+ const key = onKeyDown(e);
1402
+ if (key === "ArrowRight" || key === "ArrowLeft") {
1403
+ closeMenu();
1316
1404
  }
1317
1405
  }
1318
- );
1406
+ }
1319
1407
  };
1320
- const columns = [
1321
- {
1322
- field: "headerText",
1323
- headerText: "Column name",
1324
- template: (e) => {
1325
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: t(e.headerText) });
1326
- },
1327
- visible: true,
1328
- width: 175,
1329
- maxWidth: 200,
1330
- minWidth: 150
1331
- },
1332
- {
1333
- field: "",
1334
- template: visibleTemplate,
1335
- headerText: "Display",
1336
- textAlign: "center",
1337
- visible: true,
1338
- width: 100,
1339
- maxWidth: 120,
1340
- minWidth: 80
1341
- },
1342
- {
1343
- field: "",
1344
- template: fixColumnTemplate,
1345
- headerText: "Fix the column",
1346
- textAlign: "center",
1347
- visible: true,
1348
- width: 100,
1349
- maxWidth: 120,
1350
- minWidth: 80
1351
- },
1352
- {
1353
- field: "width",
1354
- headerText: "Column width",
1355
- textAlign: "right",
1356
- visible: true,
1357
- width: 100,
1358
- maxWidth: 120,
1359
- minWidth: 80
1408
+ const formItemKeyDown = (e, index) => {
1409
+ if (e.code === "ArrowDown" && index < itemsField.length - 1) {
1410
+ focusElement(`form-element-${field}-${index + 1}`);
1411
+ e.preventDefault();
1412
+ e.stopPropagation();
1413
+ } else if (e.code === "ArrowUp" && index > 0) {
1414
+ focusElement(`form-element-${field}-${index - 1}`);
1415
+ e.preventDefault();
1416
+ e.stopPropagation();
1417
+ } else if (e.code === "Tab" && onChangeField && index === itemsField.length - 1) {
1418
+ closeMenu();
1360
1419
  }
1361
- ];
1362
- const renderHeaderCol = (col, indexCol) => {
1363
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1364
- import_react10.Fragment,
1365
- {
1366
- children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1367
- "th",
1420
+ };
1421
+ const elementChange = (field2) => {
1422
+ if (onChangeField) {
1423
+ onChangeField(rowData, field2, setValue, getValues);
1424
+ const rs = getValues();
1425
+ if (rs) {
1426
+ onChange(rs);
1427
+ }
1428
+ }
1429
+ };
1430
+ const renderForm = (rows) => {
1431
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Row, { className: "gy-25", children: rows.map((item, index) => {
1432
+ if (item.type === "numeric") {
1433
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1434
+ input_number_default,
1368
1435
  {
1369
- className: (0, import_classnames9.default)(
1370
- `r-headercell fix-${col.fixedType}`,
1371
- { "cell-fixed": col.fixedType }
1372
- ),
1373
- style: {
1374
- width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width,
1375
- minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.minWidth,
1376
- top: `${0 * 42}px`,
1377
- maxWidth: col.maxWidth
1378
- },
1379
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1380
- "div",
1381
- {
1382
- role: "textbox",
1383
- title: t(col.headerText ?? ""),
1384
- style: {
1385
- height: `${1 * 42}px`,
1386
- justifyContent: col.textAlign ?? "left"
1387
- },
1388
- className: "r-headercell-div",
1389
- children: t(col.headerText ?? "")
1390
- }
1391
- )
1392
- }
1393
- )
1394
- },
1395
- `header-${indexCol}`
1396
- );
1436
+ id: `form-element-${field}-${index}`,
1437
+ control,
1438
+ name: item.name,
1439
+ label: item.label ? item.label : "",
1440
+ labelSize: `text-left ${labelSize}`,
1441
+ errors: errors[item.name],
1442
+ disabled: item.disabled,
1443
+ min: item.min,
1444
+ max: item.max,
1445
+ fractionCurrency: item.fraction,
1446
+ callback: () => {
1447
+ elementChange(item.name);
1448
+ }
1449
+ },
1450
+ index
1451
+ ) }, index);
1452
+ } else if (item.type === "text") {
1453
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1454
+ input_text_default,
1455
+ {
1456
+ id: `form-element-${field}-${index}`,
1457
+ control,
1458
+ name: item.name,
1459
+ label: item.label ? item.label : "",
1460
+ labelSize: `text-left ${labelSize}`,
1461
+ errors: errors[item.name],
1462
+ disabled: item.disabled,
1463
+ callback: () => {
1464
+ elementChange(item.name);
1465
+ }
1466
+ },
1467
+ index
1468
+ ) }, index);
1469
+ } else if (item.type === "select") {
1470
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.Col, { xl: 12, onKeyDown: (e) => formItemKeyDown(e, index), children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1471
+ select_table_default,
1472
+ {
1473
+ id: `form-element-${field}-${index}`,
1474
+ defaultOptions: item.options ?? [],
1475
+ control,
1476
+ name: item.name,
1477
+ label: item.label ? item.label : "",
1478
+ labelSize: `text-left ${labelSize}`,
1479
+ errors: errors[item.name],
1480
+ disabled: item.disabled,
1481
+ callback: () => {
1482
+ elementChange(item.name);
1483
+ }
1484
+ },
1485
+ index
1486
+ ) }, index);
1487
+ }
1488
+ }) });
1397
1489
  };
1398
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1399
- sidebar_default,
1490
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1491
+ "div",
1400
1492
  {
1401
- open: openSidebar,
1402
- toggleSidebar: handleCancel,
1403
- width: 700,
1404
- children: [
1405
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(modal_header_default, { typeModal: "Edit", handleModal: handleCancel, title: "Column setup" }),
1406
- /* @__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: [
1407
- /* @__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) => {
1408
- return renderHeaderCol(col, index);
1409
- }) }) }),
1410
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tbody", { className: "r-gridcontent", children: dataSource?.map((row, indexRow) => {
1411
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1412
- "tr",
1493
+ className: "form-edit",
1494
+ ref,
1495
+ id,
1496
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref: editFormRef, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
1497
+ import_reactstrap6.Dropdown,
1498
+ {
1499
+ isOpen: dropdownOpen,
1500
+ toggle: () => {
1501
+ },
1502
+ children: [
1503
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_reactstrap6.DropdownToggle, { tag: "div", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1504
+ import_reactstrap6.Input,
1413
1505
  {
1414
- className: (0, import_classnames9.default)("r-row", { "last-row": indexRow === dataSource.length - 1 }, { "fisrt-row": indexRow === 0 }),
1415
- children: columns.map((col, indexCol) => {
1416
- let value = row[col.field];
1417
- if (col.editType === "numeric" || col.editTypeCondition && col.editTypeCondition(row) === "numeric") {
1418
- value = formartNumberic(row[col.field], ",", ".", col.numericSettings?.fraction, true) ?? 0;
1419
- }
1420
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react10.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1421
- "td",
1506
+ style: { backgroundColor: "#FFF", textAlign: textAlign ?? "left" },
1507
+ placeholder,
1508
+ innerRef: inputRef,
1509
+ className: (0, import_classnames6.default)("input-display input-numeric", { "is-invalid": invalid }),
1510
+ value: displayValue,
1511
+ onClick: handleOnClick,
1512
+ onKeyDown: (e) => handleOnKeyDown(e),
1513
+ onPaste: (e) => onPaste && onPaste(e),
1514
+ readOnly: true
1515
+ }
1516
+ ) }),
1517
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1518
+ import_reactstrap6.DropdownMenu,
1519
+ {
1520
+ className: "formula-dropdown icon-dropdown p-0",
1521
+ style: {
1522
+ minWidth: minWidth ? minWidth : defaultWidth,
1523
+ width: menuWidth ? menuWidth : "min-content",
1524
+ maxWidth: innerWidth > 1280 ? 1280 : innerWidth,
1525
+ borderRadius: 8,
1526
+ zIndex: 1056
1527
+ },
1528
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_reactstrap6.DropdownItem, { className: "p-0", style: { borderRadius: "6px" }, tag: "div", header: true, children: [
1529
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1530
+ "div",
1422
1531
  {
1423
- className: (0, import_classnames9.default)(
1424
- `r-rowcell fix-${col.fixedType}`,
1425
- { "cell-fixed": col.fixedType },
1426
- { "r-active": indexFocus === indexRow }
1427
- ),
1532
+ onKeyDown: (e) => formKeyDown(e, handleSubmit(handleOnSubmit)),
1533
+ className: "p-1",
1428
1534
  style: {
1429
- padding: 0,
1430
- textAlign: col.textAlign ? col.textAlign : "left"
1431
- },
1432
- onFocus: (e) => {
1433
- if (indexRow !== indexFocus) {
1434
- setIndexFocus(indexRow);
1435
- }
1436
- e.stopPropagation();
1437
- },
1438
- onClick: (e) => {
1439
- if (e.target.nodeName === "DIV" || e.target.nodeName === "TD") {
1440
- if (indexRow !== indexFocus) {
1441
- setIndexFocus(indexRow);
1442
- }
1443
- e.stopPropagation();
1444
- }
1535
+ maxHeight: menuHeight ? menuHeight : 300,
1536
+ overflow: "auto"
1445
1537
  },
1446
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1447
- "div",
1538
+ children: itemsField ? renderForm(itemsField) : ""
1539
+ }
1540
+ ),
1541
+ /* @__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: [
1542
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "text-primary py-25", style: { fontSize: 12 }, children: footerTemplate ? footerTemplate(rowData) : "" }),
1543
+ !onChangeField ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "d-flex justify-content-end", children: [
1544
+ isClearable && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1545
+ import_reactstrap6.Button,
1448
1546
  {
1449
- className: (0, import_classnames9.default)("r-rowcell-div"),
1450
- style: {
1451
- width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto"
1547
+ ref: buttonRef,
1548
+ className: "btn me-50 py-25 px-50",
1549
+ outline: true,
1550
+ onClick: () => {
1551
+ itemsField.forEach((e) => {
1552
+ if (e.type === "numeric") {
1553
+ setValue(e.name, 0);
1554
+ } else {
1555
+ setValue(e.name, "");
1556
+ }
1557
+ });
1452
1558
  },
1453
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1454
- "div",
1455
- {
1456
- className: (0, import_classnames9.default)("r-rowcell-content"),
1457
- style: {
1458
- margin: "7px 9px"
1459
- },
1460
- children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "r-cell-text", children: col.template ? col.template(row, indexRow) : value })
1559
+ onKeyDown: (e) => {
1560
+ if (e.code === "Tab") {
1561
+ closeMenu();
1461
1562
  }
1462
- )
1563
+ },
1564
+ children: t("Clear")
1463
1565
  }
1464
- )
1465
- },
1466
- `col-${indexRow}-${indexCol}`
1467
- ) }, indexCol);
1468
- })
1469
- },
1470
- `row-${indexRow}`
1471
- );
1472
- }) })
1473
- ] }) }) }) }),
1474
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1475
- "div",
1476
- {
1477
- className: "d-flex justify-content-end p-1 ",
1478
- style: { boxShadow: "0 4px 24px 0 rgb(34 41 47 / 10%)" },
1479
- children: renderFooterButtons()
1480
- }
1481
- )
1482
- ]
1566
+ ),
1567
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1568
+ import_reactstrap6.Button,
1569
+ {
1570
+ ref: buttonRef,
1571
+ color: "primary",
1572
+ className: "btn btn-primary py-25 px-50",
1573
+ onClick: handleSubmit(handleOnSubmit),
1574
+ onKeyDown: (e) => {
1575
+ if (e.code === "Tab") {
1576
+ closeMenu();
1577
+ }
1578
+ },
1579
+ children: t("Save")
1580
+ }
1581
+ )
1582
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, {})
1583
+ ] })
1584
+ ] })
1585
+ }
1586
+ )
1587
+ ]
1588
+ }
1589
+ ) })
1483
1590
  }
1484
1591
  );
1485
- };
1486
- var sidebar_setting_column_default = SidebarSetColumn;
1592
+ });
1593
+ var edit_form_default = EditForm;
1487
1594
 
1488
- // test-app/src/component/table/index.tsx
1489
- var import_ej2_react_dropdowns = require("@syncfusion/ej2-react-dropdowns");
1595
+ // test-app/src/component/sidebar-setting-column/index.tsx
1596
+ var import_react10 = require("react");
1597
+ var import_reactstrap7 = require("reactstrap");
1598
+ var import_react_i18next7 = require("react-i18next");
1490
1599
 
1491
- // test-app/src/component/paging/index.tsx
1492
- var import_becoxy_icons4 = require("becoxy-icons");
1493
- var import_classnames10 = __toESM(require("classnames"));
1494
- var import_react11 = require("react");
1495
- var import_react_i18next8 = require("react-i18next");
1496
- var import_react_select2 = __toESM(require("react-select"));
1497
- var import_jsx_runtime11 = require("react/jsx-runtime");
1498
- var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
1499
- const { t } = (0, import_react_i18next8.useTranslation)();
1500
- const [countPage, setCountPage] = (0, import_react11.useState)(0);
1501
- const [currentPageNumber, setCurrentPageNumber] = (0, import_react11.useState)(1);
1502
- (0, import_react11.useEffect)(() => {
1503
- setCountPage(Math.floor(totalItem / pageSize) + (Math.floor(totalItem / pageSize) === totalItem / pageSize ? 0 : 1));
1504
- }, [totalItem, pageSize]);
1505
- (0, import_react11.useEffect)(() => {
1506
- setCurrentPageNumber(Math.floor(currentPage / 5) + (Math.floor(currentPage / 5) === currentPage / 5 ? 0 : 1));
1507
- }, [currentPage]);
1508
- const renderPageNumber = (number) => {
1509
- const arr = [];
1510
- for (let index = (number - 1) * 5 + 1; index <= number * 5 && index <= Math.floor(totalItem / pageSize) + (Math.floor(totalItem / pageSize) === totalItem / pageSize ? 0 : 1); index++) {
1511
- arr.push(
1512
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1513
- "div",
1514
- {
1515
- className: (0, import_classnames10.default)("r-number", { "r-active": index === currentPage }),
1516
- onClick: () => {
1517
- onChangePage({ totalItem, pageSize, currentPage: index, old: currentPage });
1518
- },
1519
- children: index
1520
- },
1521
- `page-${index}`
1522
- )
1523
- );
1600
+ // test-app/src/component/modal-header/index.tsx
1601
+ var import_becoxy_icons3 = require("becoxy-icons");
1602
+ var import_classnames7 = __toESM(require("classnames"));
1603
+ var import_react_i18next6 = require("react-i18next");
1604
+ var import_jsx_runtime8 = require("react/jsx-runtime");
1605
+ var ModalHeader = (props) => {
1606
+ const { title, handleModal, typeModal = "Edit", component } = props;
1607
+ const { t } = (0, import_react_i18next6.useTranslation)();
1608
+ const handleModalIcon = () => {
1609
+ if (typeModal === "Edit" || typeModal === "Approval") {
1610
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons3.Edit, { fontSize: 17, className: "me-1" });
1611
+ } else if (typeModal === "View") {
1612
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons3.Info, { fontSize: 17, className: "me-1" });
1613
+ } else if (typeModal === "Detail") {
1614
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons3.Info, { fontSize: 17, className: "me-1" });
1615
+ } else if (typeModal === "Order") {
1616
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "e-icons e-sorting-1 me-1", style: { fontSize: "14px" } });
1617
+ } else if (typeModal === "Process") {
1618
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "e-flat e-icons e-paste-match-destination me-1", style: { fontSize: "14px" } });
1619
+ } else {
1620
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_becoxy_icons3.Plus, { fontSize: 17, className: "me-1" });
1524
1621
  }
1525
- return arr;
1526
1622
  };
1527
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react11.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "r-pager", children: [
1528
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "r-pagercontainer", children: [
1529
- /* @__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 }) }),
1530
- /* @__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 }) }),
1531
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1532
- "button",
1533
- {
1534
- className: (0, import_classnames10.default)("r-button", { "d-none": currentPageNumber === 1 }),
1535
- type: "button",
1536
- onClick: () => {
1537
- setCurrentPageNumber(currentPageNumber - 1);
1538
- onChangePage({ totalItem, pageSize, currentPage: (currentPageNumber - 2) * 5 + 1, old: currentPage });
1539
- },
1540
- children: "..."
1541
- }
1542
- ),
1543
- renderPageNumber(currentPageNumber),
1544
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1545
- "button",
1546
- {
1547
- className: (0, import_classnames10.default)("r-button", { "d-none": currentPageNumber * 5 >= countPage }),
1548
- type: "button",
1549
- onClick: () => {
1550
- setCurrentPageNumber(currentPageNumber + 1);
1551
- onChangePage({ totalItem, pageSize, currentPage: currentPageNumber * 5 + 1, old: currentPage });
1552
- },
1553
- children: "..."
1554
- }
1555
- ),
1556
- /* @__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 }) }),
1557
- /* @__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 }) }),
1558
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-pagesize", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1559
- import_react_select2.default,
1560
- {
1561
- value: { value: pageSize, label: pageSize },
1562
- options: pageOptions.map((item) => ({ value: item, label: item })),
1563
- onChange: (val) => {
1564
- onChangePageSize({ totalItem, pageSize: val?.value });
1565
- },
1566
- menuPosition: "fixed",
1567
- placeholder: t("Select"),
1568
- classNamePrefix: "select-pagesize"
1569
- }
1570
- ) }),
1571
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("pagerDropDown") })
1623
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "modal-header d-flex align-items-center justify-content-between mb-1", children: [
1624
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "d-flex align-items-center justify-content-start", children: [
1625
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h5", { className: "modal-title", children: [
1626
+ handleModalIcon(),
1627
+ " ",
1628
+ t(title)
1629
+ ] }),
1630
+ component ? component() : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, {})
1572
1631
  ] }),
1573
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-parentmsgbar", children: t("totalItemsInfo", { page: currentPage, countPage, totalItem }) })
1574
- ] }) });
1632
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "todo-item-action d-flex align-items-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1633
+ import_becoxy_icons3.X,
1634
+ {
1635
+ className: (0, import_classnames7.default)("fw-normal mt-25 cursor-pointer", { "d-none": !handleModal }),
1636
+ fontSize: 20,
1637
+ onClick: handleModal
1638
+ }
1639
+ ) })
1640
+ ] });
1575
1641
  };
1642
+ var modal_header_default = ModalHeader;
1576
1643
 
1577
- // test-app/src/component/select-table/index.tsx
1578
- var import_react12 = require("react");
1579
- var import_reactstrap8 = require("reactstrap");
1580
- var import_react_i18next9 = require("react-i18next");
1581
- var import_classnames11 = __toESM(require("classnames"));
1582
- var import_moment = __toESM(require("moment"));
1583
- var import_becoxy_icons5 = require("becoxy-icons");
1584
- var import_jsx_runtime12 = require("react/jsx-runtime");
1585
- var defaultMaxHeight = 250;
1586
- var SelectTable = (0, import_react12.forwardRef)((props, ref) => {
1644
+ // test-app/src/component/sidebar/index.tsx
1645
+ var import_becoxy_icons4 = require("becoxy-icons");
1646
+ var import_classnames8 = __toESM(require("classnames"));
1647
+ var import_react9 = require("react");
1648
+ var import_jsx_runtime9 = require("react/jsx-runtime");
1649
+ var Sidebar = (props) => {
1587
1650
  const {
1588
- id,
1589
- menuWidth,
1590
- invalid,
1591
- onKeyDown,
1592
- placeholder,
1593
- textAlign,
1594
- options,
1595
- columns,
1596
- decimalSeparator,
1597
- thousandSeparator,
1598
- onChange,
1599
- value,
1600
- fieldValue,
1601
- fieldLabel,
1602
- loadOptions,
1603
- maxHeight,
1604
- handleAdd,
1605
- isClearable,
1606
- component,
1607
- formatOptionLabel,
1608
- isMulti,
1609
- noHeader,
1610
- isDisabled,
1611
- showFooter,
1612
- onPaste
1651
+ open,
1652
+ children,
1653
+ toggleSidebar,
1654
+ width,
1655
+ keyboard,
1656
+ hiddenBackground,
1657
+ hiddenFullScreenButton
1613
1658
  } = props;
1614
- const selectTableRef = (0, import_react12.useRef)();
1615
- const selectMenuTableRef = (0, import_react12.useRef)();
1616
- const inputRef = (0, import_react12.useRef)();
1617
- const [dropdownOpen, setDropdownOpen] = (0, import_react12.useState)(false);
1618
- const [indexFocus, setIndexFocus] = (0, import_react12.useState)(-1);
1619
- const [isFocus, setIsFocus] = (0, import_react12.useState)(false);
1620
- const [isLoading, setIsLoading] = (0, import_react12.useState)(false);
1621
- const [searchTerm, setSearchTerm] = (0, import_react12.useState)("");
1622
- const [optionsLoad, setOptionsLoad] = (0, import_react12.useState)();
1623
- const { t } = (0, import_react_i18next9.useTranslation)();
1624
- const isSelectedAll = (0, import_react12.useMemo)(() => {
1625
- return isMulti === true && (optionsLoad ? optionsLoad : options).length > 0 && value?.length >= (optionsLoad ? optionsLoad : options).length;
1626
- }, [optionsLoad, options, value]);
1627
- const defaultColumns = noHeader ? [
1628
- {
1629
- headerText: "Name",
1630
- field: fieldLabel ?? "label",
1631
- width: menuWidth
1632
- }
1633
- ] : [
1634
- {
1635
- field: "key",
1636
- headerText: "Code",
1637
- width: 100,
1638
- maxWidth: 120,
1639
- minWidth: 80
1640
- },
1641
- {
1642
- headerText: "Name",
1643
- field: "label",
1644
- width: 150,
1645
- maxWidth: 200,
1646
- minWidth: 250
1647
- }
1648
- ];
1649
- const closeMenu = () => {
1650
- setDropdownOpen(false);
1651
- };
1652
- (0, import_react12.useEffect)(() => {
1653
- if (dropdownOpen && value && !isMulti && selectMenuTableRef) {
1654
- setTimeout(() => {
1655
- const elementFocus = document.getElementById(`row-select-table-${(optionsLoad ? optionsLoad : options)?.findIndex((e) => e[fieldValue ?? "value"] === value[fieldValue ?? "value"])}`);
1656
- if (elementFocus) {
1657
- const parentRect = selectMenuTableRef.current.getBoundingClientRect();
1658
- const childRect = elementFocus.getBoundingClientRect();
1659
- const offset = childRect.top - parentRect.top + selectMenuTableRef.current.scrollTop - parentRect.height / 2 + childRect.height / 2;
1660
- selectMenuTableRef.current.scrollTo({ top: offset, behavior: "smooth" });
1661
- }
1662
- }, 100);
1663
- }
1664
- }, [dropdownOpen]);
1665
- (0, import_react12.useEffect)(() => {
1666
- if (inputRef && !isDisabled) {
1667
- inputRef.current.addEventListener("blur", function() {
1668
- setDropdownOpen(false);
1669
- setSearchTerm("");
1670
- setIsFocus(false);
1671
- });
1672
- inputRef.current.addEventListener("focus", function() {
1673
- if (!isFocus) {
1674
- setIsFocus(true);
1675
- }
1676
- });
1677
- }
1678
- }, [inputRef]);
1679
- (0, import_react12.useEffect)(() => {
1680
- if (searchTerm && !dropdownOpen) {
1681
- setDropdownOpen(true);
1682
- setIndexFocus(0);
1683
- }
1684
- }, [searchTerm]);
1685
- const handleOpenClose = () => {
1686
- setSearchTerm("");
1687
- if (dropdownOpen) {
1688
- closeMenu();
1689
- } else {
1690
- if (!isDisabled) {
1691
- setDropdownOpen(true);
1692
- }
1693
- }
1694
- };
1695
- const listKeyUse = ["Escape", "Space", "Enter", "Tab", "NumpadEnter", "ArrowDown", "ArrowUp", "F9"];
1696
- const handleOnKeyDown = (e) => {
1697
- let key = "";
1698
- if (onKeyDown && (!dropdownOpen || !listKeyUse.includes(e.code))) {
1699
- key = onKeyDown(e);
1700
- if (key === "ArrowRight" || key === "ArrowLeft") {
1701
- closeMenu();
1659
+ const [isFullScreen, setIsFullScreen] = (0, import_react9.useState)(false);
1660
+ const [flag, setFlag] = (0, import_react9.useState)(open);
1661
+ (0, import_react9.useEffect)(() => {
1662
+ if (open !== flag) {
1663
+ if (open) {
1664
+ setFlag(open);
1665
+ } else {
1666
+ setTimeout(() => {
1667
+ setFlag(open);
1668
+ }, 50);
1702
1669
  }
1703
1670
  }
1704
- let flag = false;
1705
- if (!key) {
1706
- if (e.code === "F9") {
1707
- handleAdd();
1708
- flag = true;
1709
- } else if (e.code === "Escape" || e.code === "Space") {
1710
- if (dropdownOpen) {
1711
- if ((optionsLoad ? optionsLoad : options)[indexFocus]) {
1712
- onChange((optionsLoad ? optionsLoad : options)[indexFocus]);
1713
- }
1714
- }
1715
- if (!searchTerm) {
1716
- handleOpenClose();
1717
- flag = true;
1718
- }
1719
- } else if (e.code === "Enter" || e.code === "Tab" || e.code === "NumpadEnter") {
1720
- if (dropdownOpen) {
1721
- onChange((optionsLoad ? optionsLoad : options)[indexFocus]);
1722
- handleOpenClose();
1723
- flag = true;
1671
+ }, [open]);
1672
+ const handClose = () => {
1673
+ setFlag(false);
1674
+ setTimeout(() => {
1675
+ toggleSidebar();
1676
+ }, 400);
1677
+ };
1678
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1679
+ "div",
1680
+ {
1681
+ tabIndex: 0,
1682
+ className: (0, import_classnames8.default)({ "d-none": !open }),
1683
+ onKeyDown: (e) => {
1684
+ if (!keyboard && e.code === "Escape" && flag) {
1685
+ handClose();
1686
+ e.stopPropagation();
1687
+ e.preventDefault();
1724
1688
  }
1725
- } else if (e.code === "ArrowDown") {
1726
- if (dropdownOpen) {
1727
- let newIndex = 0;
1728
- if (indexFocus >= 0) {
1729
- newIndex = indexFocus + 1;
1730
- } else if (value) {
1731
- newIndex = (optionsLoad ? optionsLoad : options)?.findIndex((e2) => e2[fieldValue ?? "value"] === value[fieldValue ?? "value"]) + 1;
1732
- }
1733
- if (newIndex < (optionsLoad ? optionsLoad : options).length) {
1734
- setIndexFocus(newIndex);
1735
- checkIfElementIsOutOfScroll(0, newIndex);
1736
- } else {
1737
- setIndexFocus(0);
1738
- checkIfElementIsOutOfScroll(1, 0);
1689
+ },
1690
+ children: [
1691
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1692
+ "div",
1693
+ {
1694
+ className: (0, import_classnames8.default)("offcanvas-backdrop fade", {
1695
+ "d-none": !flag || hiddenBackground,
1696
+ show: flag
1697
+ }),
1698
+ style: { zIndex: 1056 },
1699
+ onClick: handClose
1739
1700
  }
1740
- flag = true;
1741
- } else {
1742
- handleOpenClose();
1743
- flag = true;
1744
- }
1745
- } else if (e.code === "ArrowUp") {
1746
- if (dropdownOpen) {
1747
- let newIndex = 0;
1748
- if (indexFocus >= 0) {
1749
- newIndex = indexFocus - 1;
1750
- } else if (value) {
1751
- newIndex = (optionsLoad ? optionsLoad : options)?.findIndex((e2) => e2[fieldValue ?? "value"] === value[fieldValue ?? "value"]) - 1;
1701
+ ),
1702
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1703
+ "div",
1704
+ {
1705
+ className: (0, import_classnames8.default)("customizer d-none d-md-block ", `customizer-${width ?? 600}`, {
1706
+ open: flag,
1707
+ fullscreen: isFullScreen
1708
+ }),
1709
+ style: { zIndex: 1057 },
1710
+ children: [
1711
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
1712
+ "div",
1713
+ {
1714
+ style: {
1715
+ position: "fixed",
1716
+ top: "50%",
1717
+ transform: "translate(-50%, -50%)",
1718
+ background: "#FFF",
1719
+ filter: "drop-shadow(0.9px 0.9px 1.5px)",
1720
+ height: 50,
1721
+ display: "flex",
1722
+ alignItems: "center",
1723
+ borderRadius: "0px 5px 5px 0px",
1724
+ cursor: "pointer",
1725
+ zIndex: 9,
1726
+ marginLeft: 7
1727
+ },
1728
+ className: (0, import_classnames8.default)({ "d-none": hiddenFullScreenButton }),
1729
+ onClick: () => {
1730
+ setIsFullScreen(!isFullScreen);
1731
+ },
1732
+ children: [
1733
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_becoxy_icons4.ChevronLeft, { className: `${isFullScreen ? "d-none" : ""}`, fontSize: 16 }),
1734
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_becoxy_icons4.ChevronRight, { className: `${!isFullScreen ? "d-none" : ""}`, fontSize: 15 })
1735
+ ]
1736
+ }
1737
+ ),
1738
+ children
1739
+ ]
1752
1740
  }
1753
- if (newIndex >= 0) {
1754
- setIndexFocus(newIndex);
1755
- checkIfElementIsOutOfScroll(2, newIndex);
1756
- } else {
1757
- setIndexFocus((optionsLoad ? optionsLoad : options).length - 1);
1758
- checkIfElementIsOutOfScroll(3, (optionsLoad ? optionsLoad : options).length - 1);
1741
+ )
1742
+ ]
1743
+ }
1744
+ );
1745
+ };
1746
+ var sidebar_default = Sidebar;
1747
+
1748
+ // test-app/src/component/sidebar-setting-column/index.tsx
1749
+ var import_classnames9 = __toESM(require("classnames"));
1750
+ var import_jsx_runtime10 = require("react/jsx-runtime");
1751
+ var SidebarSetColumn = (props) => {
1752
+ const { column, setColumn, openSidebar, handleSidebar } = props;
1753
+ const { t } = (0, import_react_i18next7.useTranslation)();
1754
+ const [dataSource, setDataSource] = (0, import_react10.useState)([]);
1755
+ const [indexFocus, setIndexFocus] = (0, import_react10.useState)();
1756
+ (0, import_react10.useEffect)(() => {
1757
+ if (openSidebar) {
1758
+ setDataSource(column.map((e) => ({ ...e })));
1759
+ }
1760
+ }, [openSidebar]);
1761
+ const handleCancel = () => {
1762
+ handleSidebar();
1763
+ setDataSource([]);
1764
+ };
1765
+ const handleSubmit = () => {
1766
+ setColumn([...dataSource]);
1767
+ handleCancel();
1768
+ };
1769
+ const getWindowSize = () => {
1770
+ const { innerWidth, innerHeight } = window;
1771
+ return { innerWidth, innerHeight };
1772
+ };
1773
+ const [windowSize, setWindowSize] = (0, import_react10.useState)(getWindowSize());
1774
+ (0, import_react10.useEffect)(() => {
1775
+ const handleWindowResize = () => {
1776
+ setWindowSize(getWindowSize());
1777
+ };
1778
+ window.addEventListener("resize", handleWindowResize);
1779
+ return () => {
1780
+ window.removeEventListener("resize", handleWindowResize);
1781
+ };
1782
+ }, []);
1783
+ const renderFooterButtons = () => {
1784
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_react10.Fragment, { children: [
1785
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "primary", onClick: handleSubmit, className: "me-1", children: t("Confirm") }),
1786
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_reactstrap7.Button, { color: "secondary", onClick: handleCancel, outline: true, children: t("Close") })
1787
+ ] });
1788
+ };
1789
+ const visibleTemplate = (item, index) => {
1790
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1791
+ import_reactstrap7.Input,
1792
+ {
1793
+ defaultChecked: item.visible ?? true,
1794
+ disabled: item.invisibleDisable,
1795
+ type: "checkbox",
1796
+ style: { height: 18 },
1797
+ className: " cursor-pointer",
1798
+ onChange: (e) => {
1799
+ if (dataSource) {
1800
+ dataSource[index].visible = e.target.checked;
1801
+ setDataSource(dataSource);
1759
1802
  }
1760
- flag = true;
1761
1803
  }
1762
1804
  }
1763
- }
1764
- if (flag) {
1765
- e.stopPropagation();
1766
- e.preventDefault();
1767
- }
1805
+ );
1768
1806
  };
1769
- const checkIfElementIsOutOfScroll = (flag, index) => {
1770
- if (selectMenuTableRef) {
1771
- const elementFocus = document.getElementById(`row-select-table-${index}`);
1772
- console.log(elementFocus);
1773
- if (elementFocus) {
1774
- const rect = elementFocus.getBoundingClientRect();
1775
- const parentRect = selectMenuTableRef.current?.getBoundingClientRect();
1776
- if (flag === 1) {
1777
- scrollToElement(selectMenuTableRef.current, 0);
1778
- } else if (flag === 3) {
1779
- scrollToElement(selectMenuTableRef.current, selectMenuTableRef.current.scrollHeight);
1780
- } else if (flag === 0 && rect.bottom + 30 > parentRect.bottom) {
1781
- scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - selectMenuTableRef.current.offsetTop - parentRect.height + rect.height + 50);
1782
- } else if (flag === 2 && rect.top < parentRect.top + 50) {
1783
- scrollToElement(selectMenuTableRef.current, elementFocus.offsetTop - 65);
1807
+ const fixColumnTemplate = (item, index) => {
1808
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1809
+ import_reactstrap7.Input,
1810
+ {
1811
+ defaultChecked: item.fixedType === "left" || item.fixedType === "right",
1812
+ type: "checkbox",
1813
+ style: { height: 18 },
1814
+ className: " cursor-pointer",
1815
+ onChange: (e) => {
1816
+ if (dataSource) {
1817
+ if (e.target.checked) {
1818
+ if (index * 2 <= dataSource.length) {
1819
+ dataSource[index].fixedType = "left";
1820
+ } else {
1821
+ dataSource[index].fixedType = "right";
1822
+ }
1823
+ } else {
1824
+ dataSource[index].fixedType = void 0;
1825
+ }
1826
+ setDataSource(dataSource);
1827
+ }
1784
1828
  }
1785
1829
  }
1830
+ );
1831
+ };
1832
+ const columns = [
1833
+ {
1834
+ field: "headerText",
1835
+ headerText: "Column name",
1836
+ template: (e) => {
1837
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: t(e.headerText) });
1838
+ },
1839
+ visible: true,
1840
+ width: 175,
1841
+ maxWidth: 200,
1842
+ minWidth: 150
1843
+ },
1844
+ {
1845
+ field: "",
1846
+ template: visibleTemplate,
1847
+ headerText: "Display",
1848
+ textAlign: "center",
1849
+ visible: true,
1850
+ width: 100,
1851
+ maxWidth: 120,
1852
+ minWidth: 80
1853
+ },
1854
+ {
1855
+ field: "",
1856
+ template: fixColumnTemplate,
1857
+ headerText: "Fix the column",
1858
+ textAlign: "center",
1859
+ visible: true,
1860
+ width: 100,
1861
+ maxWidth: 120,
1862
+ minWidth: 80
1863
+ },
1864
+ {
1865
+ field: "width",
1866
+ headerText: "Column width",
1867
+ textAlign: "right",
1868
+ visible: true,
1869
+ width: 100,
1870
+ maxWidth: 120,
1871
+ minWidth: 80
1786
1872
  }
1787
- };
1788
- let timeOutElement;
1789
- const scrollToElement = (elemment, top) => {
1790
- clearTimeout(timeOutElement);
1791
- timeOutElement = setTimeout(() => {
1792
- elemment.scrollTo({
1793
- top,
1794
- behavior: "smooth"
1795
- });
1796
- }, 100);
1797
- };
1873
+ ];
1798
1874
  const renderHeaderCol = (col, indexCol) => {
1799
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1800
- import_react12.Fragment,
1875
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1876
+ import_react10.Fragment,
1801
1877
  {
1802
- children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1878
+ children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1803
1879
  "th",
1804
1880
  {
1805
- className: (0, import_classnames11.default)(
1806
- `r-select-headercell fix-${col.fixedType}`,
1881
+ className: (0, import_classnames9.default)(
1882
+ `r-headercell fix-${col.fixedType}`,
1807
1883
  { "cell-fixed": col.fixedType }
1808
1884
  ),
1809
1885
  style: {
1810
1886
  width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.width,
1811
1887
  minWidth: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : col.minWidth,
1812
- top: `${0 * 35}px`,
1888
+ top: `${0 * 42}px`,
1813
1889
  maxWidth: col.maxWidth
1814
1890
  },
1815
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1891
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1816
1892
  "div",
1817
1893
  {
1818
1894
  role: "textbox",
1819
1895
  title: t(col.headerText ?? ""),
1820
1896
  style: {
1821
- height: `${1 * 35}px`,
1897
+ height: `${1 * 42}px`,
1822
1898
  justifyContent: col.textAlign ?? "left"
1823
1899
  },
1824
- className: "r-select-headercell-div",
1900
+ className: "r-headercell-div",
1825
1901
  children: t(col.headerText ?? "")
1826
1902
  }
1827
1903
  )
1828
1904
  }
1829
1905
  )
1830
1906
  },
1831
- `header-select-${indexCol}`
1832
- );
1833
- };
1834
- const checkSearch = (keyword, data, columnsSearch) => {
1835
- if (!keyword || columnsSearch.length === 0) {
1836
- return true;
1837
- }
1838
- for (let index = 0; index < columnsSearch.length; index++) {
1839
- const key = columnsSearch[index].field.trim();
1840
- if (data[key] && data[key].toString().trim().toLowerCase().includes(keyword.trim().toLowerCase())) {
1841
- return true;
1842
- }
1843
- }
1844
- return false;
1845
- };
1846
- const callbackLoadOption = (rs) => {
1847
- setIsLoading(false);
1848
- setOptionsLoad(rs);
1849
- };
1850
- (0, import_react12.useEffect)(() => {
1851
- if (!searchTerm) {
1852
- setOptionsLoad(void 0);
1853
- }
1854
- }, [searchTerm]);
1855
- const checkOverflow = (indexRow, indexCol) => {
1856
- const element = document.getElementById(`select-${id}-${indexRow}-${indexCol}`);
1857
- return element && element.scrollWidth > element.clientWidth;
1858
- };
1859
- const RenderElement = (props2) => {
1860
- const { indexRow, row, isSelected, level = 0 } = props2;
1861
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
1862
- "tr",
1863
- {
1864
- id: `row-select-table-${indexRow}`,
1865
- style: { paddingLeft: 10 * level },
1866
- className: (0, import_classnames11.default)("r-select-row", { "last-row": indexRow === (optionsLoad ? optionsLoad : options).length - 1 }, { "fisrt-row": indexRow === 0 }),
1867
- children: [
1868
- isMulti && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1869
- "td",
1870
- {
1871
- className: (0, import_classnames11.default)(`r-select-rowcell`, { "r-select-move": indexFocus === indexRow, "r-select-active": !isMulti && value && value[fieldValue ?? "value"] === row[fieldValue ?? "value"] }),
1872
- style: { width: 40, textAlign: "center", padding: 0, paddingBottom: 6 },
1873
- onClick: (e) => {
1874
- if (isMulti) {
1875
- const index = value?.findIndex((x) => x === row[fieldValue ?? "value"]);
1876
- if (index > -1) {
1877
- value?.splice(index, 1);
1878
- const valueArr = (optionsLoad ? optionsLoad : options).filter((ele) => value?.some((x) => x === ele[fieldValue ?? "value"]));
1879
- onChange(valueArr);
1880
- } else {
1881
- if (value) {
1882
- value?.push(row[fieldValue ?? "value"]);
1883
- const valueArr = (optionsLoad ? optionsLoad : options).filter((ele) => value?.some((x) => x === ele[fieldValue ?? "value"]));
1884
- onChange(valueArr);
1885
- } else {
1886
- onChange([row[fieldValue ?? "value"]]);
1887
- }
1888
- }
1889
- e.stopPropagation();
1890
- }
1891
- },
1892
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1893
- import_reactstrap8.Input,
1894
- {
1895
- checked: isSelected,
1896
- type: "checkbox",
1897
- className: "cursor-pointer",
1898
- onChange: () => {
1899
- },
1900
- style: { textAlign: "center", marginTop: 6 }
1901
- }
1902
- )
1903
- }
1904
- ),
1905
- (columns ? columns : defaultColumns).map((col, indexCol) => {
1906
- let valueDisplay = row[col.field];
1907
- if (col.type === "numeric" || col.typeCondition && col.typeCondition(row) === "numeric") {
1908
- valueDisplay = formartNumberic(row[col.field], decimalSeparator ?? ".", thousandSeparator ?? ",", col.fraction ?? 0, true) ?? 0;
1909
- } else if (col.type === "date") {
1910
- valueDisplay = valueDisplay ? (0, import_moment.default)(valueDisplay).format("DD/MM/yyyy") : "";
1911
- } else if (col.type === "datetime") {
1912
- valueDisplay = valueDisplay ? (0, import_moment.default)(valueDisplay).format("DD/MM/yyyy HH:mm") : "";
1913
- }
1914
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react12.Fragment, { children: [
1915
- col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1916
- "td",
1917
- {
1918
- id: `select-${id}-${indexRow}-${indexCol}`,
1919
- className: (0, import_classnames11.default)(`r-select-rowcell`, { "r-select-move": indexFocus === indexRow, "r-select-active": !isMulti && value && value[fieldValue ?? "value"] === row[fieldValue ?? "value"] }),
1920
- style: {
1921
- minWidth: col.minWidth,
1922
- width: col.width,
1923
- maxWidth: col.maxWidth,
1924
- textAlign: col.textAlign ? col.textAlign : "left"
1925
- },
1926
- onClick: (e) => {
1927
- if (isMulti) {
1928
- const index = value?.findIndex((x) => x === row[fieldValue ?? "value"]);
1929
- if (index > -1) {
1930
- value?.splice(index, 1);
1931
- const valueArr = (optionsLoad ? optionsLoad : options).filter((ele) => value?.some((x) => x === ele[fieldValue ?? "value"]));
1932
- onChange(valueArr);
1933
- } else {
1934
- if (value) {
1935
- value?.push(row[fieldValue ?? "value"]);
1936
- const valueArr = (optionsLoad ? optionsLoad : options).filter((ele) => value?.some((x) => x === ele[fieldValue ?? "value"]));
1937
- onChange(valueArr);
1938
- } else {
1939
- onChange([row[fieldValue ?? "value"]]);
1940
- }
1941
- }
1942
- } else {
1943
- onChange(row);
1944
- setSearchTerm("");
1945
- closeMenu();
1946
- }
1947
- e.preventDefault();
1948
- e.stopPropagation();
1949
- },
1950
- onMouseMove: (e) => {
1951
- if (indexRow !== indexFocus) {
1952
- setIndexFocus(indexRow);
1953
- }
1954
- e.stopPropagation();
1955
- },
1956
- children: col.template ? col.template(row, indexRow) : valueDisplay
1957
- },
1958
- `col-${indexRow}-${indexCol}`
1959
- ),
1960
- 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 })
1961
- ] }, indexCol);
1962
- })
1963
- ]
1964
- },
1965
- `row-${indexRow}`
1907
+ `header-${indexCol}`
1966
1908
  );
1967
1909
  };
1968
- const RenderTable = (props2) => {
1969
- const {} = props2;
1970
- let countDisplay = 0;
1971
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
1972
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", { style: { width: "100%" }, children: [
1973
- !noHeader && /* @__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: [
1974
- 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)(
1975
- "div",
1976
- {
1977
- style: { justifyContent: "center" },
1978
- className: (0, import_classnames11.default)("r-select-headercell-div"),
1979
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
1980
- import_reactstrap8.Input,
1981
- {
1982
- checked: isSelectedAll,
1983
- type: "checkbox",
1984
- onClick: (e) => {
1985
- if (isMulti) {
1986
- if (isSelectedAll) {
1987
- onChange([]);
1988
- } else {
1989
- onChange([...optionsLoad ? optionsLoad : options]);
1990
- }
1991
- e.stopPropagation();
1992
- }
1993
- },
1994
- readOnly: true,
1995
- className: (0, import_classnames11.default)("cursor-pointer", { "d-none": !isMulti }),
1996
- style: { textAlign: "center", marginTop: 6 }
1997
- }
1998
- )
1999
- }
2000
- ) }),
2001
- !noHeader && (columns ? columns : defaultColumns).map((col, index) => {
2002
- return renderHeaderCol(col, index);
2003
- })
2004
- ] }) }),
2005
- (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) => {
2006
- if (!isMulti && loadOptions || checkSearch(searchTerm, row, columns ? columns : defaultColumns)) {
2007
- const isSelected = isMulti && value?.some((x) => x === row[fieldValue ?? "value"]);
2008
- countDisplay++;
2009
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RenderElement, { isSelected, indexRow, row }, `select-table-${indexRow}`);
2010
- }
2011
- }) }) })
2012
- ] }),
2013
- countDisplay === 0 && !isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "r-no-data", children: [
2014
- /* @__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: [
2015
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ellipse", { fill: "#f5f5f5", cx: "32", cy: "33", rx: "32", ry: "7" }),
2016
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("g", { fillRule: "nonzero", stroke: "#d9d9d9", children: [
2017
- /* @__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" }),
2018
- /* @__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" })
2019
- ] })
2020
- ] }) }),
2021
- t("No data available.")
2022
- ] }),
2023
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "r-no-data", children: [
2024
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.Spinner, { className: "me-1", children: " " }),
2025
- t("Loading...")
2026
- ] })
2027
- ] });
2028
- };
2029
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2030
- "div",
2031
- {
2032
- className: (0, import_classnames11.default)("react-select-table", { "is-invalid": invalid }),
2033
- ref,
2034
- id,
2035
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: selectTableRef, children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2036
- import_reactstrap8.Dropdown,
2037
- {
2038
- isOpen: dropdownOpen,
2039
- toggle: () => {
2040
- },
2041
- onMouseDown: (e) => e.preventDefault(),
2042
- children: [
2043
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2044
- import_reactstrap8.DropdownToggle,
2045
- {
2046
- onClick: (e) => {
2047
- if (!isDisabled) {
2048
- inputRef?.current.focus();
2049
- handleOpenClose();
2050
- }
2051
- e.preventDefault();
2052
- },
2053
- tag: "div",
2054
- 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 }),
2055
- children: [
2056
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "select-table-container", children: [
2057
- 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) => {
2058
- const element = (optionsLoad ? optionsLoad : options).find((e) => e[fieldValue ?? "value"] === ele);
2059
- if (element) {
2060
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { children: [
2061
- index === 0 ? "" : ", ",
2062
- element[fieldLabel ?? "label"]
2063
- ] }, index);
2064
- }
2065
- }) }) }) : /* @__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: [
2066
- value ? formatOptionLabel ? formatOptionLabel(value) : value[fieldLabel ?? "label"] : "",
2067
- " "
2068
- ] }) }),
2069
- !((isMulti ? value?.length > 0 : value) || isDisabled || searchTerm) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: (0, import_classnames11.default)("select-placeholder"), children: placeholder }),
2070
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "input-container", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2071
- "input",
2072
- {
2073
- style: { textAlign: textAlign ?? "left" },
2074
- ref: inputRef,
2075
- className: (0, import_classnames11.default)("select-input"),
2076
- readOnly: isDisabled,
2077
- value: searchTerm,
2078
- onPaste: (e) => onPaste && !dropdownOpen && onPaste(e),
2079
- onChange: (val) => {
2080
- if (!isMulti && loadOptions && val.target.value) {
2081
- setIsLoading(true);
2082
- loadOptions(val.target.value, callbackLoadOption);
2083
- }
2084
- setSearchTerm(val.target.value);
2085
- },
2086
- onKeyDown: (e) => handleOnKeyDown(e)
2087
- }
2088
- ) })
2089
- ] }),
2090
- isLoading && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: (0, import_classnames11.default)("select-table-indicator d-flex align-items-center"), children: [
2091
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }),
2092
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" }),
2093
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_reactstrap8.Spinner, { style: { width: 4, height: 4, marginRight: 3 }, type: "grow" })
2094
- ] }),
2095
- isClearable && value && !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2096
- "div",
1910
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1911
+ sidebar_default,
1912
+ {
1913
+ open: openSidebar,
1914
+ toggleSidebar: handleCancel,
1915
+ width: 700,
1916
+ children: [
1917
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(modal_header_default, { typeModal: "Edit", handleModal: handleCancel, title: "Column setup" }),
1918
+ /* @__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: [
1919
+ /* @__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) => {
1920
+ return renderHeaderCol(col, index);
1921
+ }) }) }),
1922
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("tbody", { className: "r-gridcontent", children: dataSource?.map((row, indexRow) => {
1923
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1924
+ "tr",
1925
+ {
1926
+ className: (0, import_classnames9.default)("r-row", { "last-row": indexRow === dataSource.length - 1 }, { "fisrt-row": indexRow === 0 }),
1927
+ children: columns.map((col, indexCol) => {
1928
+ let value = row[col.field];
1929
+ if (col.editType === "numeric" || col.editTypeCondition && col.editTypeCondition(row) === "numeric") {
1930
+ value = formartNumberic(row[col.field], ",", ".", col.numericSettings?.fraction, true) ?? 0;
1931
+ }
1932
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_react10.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1933
+ "td",
2097
1934
  {
2098
- className: (0, import_classnames11.default)("cursor-pointer"),
2099
- onClick: (e) => {
2100
- onChange(isMulti ? [] : void 0);
1935
+ className: (0, import_classnames9.default)(
1936
+ `r-rowcell fix-${col.fixedType}`,
1937
+ { "cell-fixed": col.fixedType },
1938
+ { "r-active": indexFocus === indexRow }
1939
+ ),
1940
+ style: {
1941
+ padding: 0,
1942
+ textAlign: col.textAlign ? col.textAlign : "left"
1943
+ },
1944
+ onFocus: (e) => {
1945
+ if (indexRow !== indexFocus) {
1946
+ setIndexFocus(indexRow);
1947
+ }
2101
1948
  e.stopPropagation();
2102
1949
  },
2103
- 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" }) })
2104
- }
2105
- ),
2106
- !isDisabled && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "select-table-indicator", onMouseDown: (e) => e.preventDefault(), 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" }) }) })
2107
- ]
2108
- }
2109
- ),
2110
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2111
- import_reactstrap8.DropdownMenu,
2112
- {
2113
- container: component,
2114
- className: "formula-dropdown icon-dropdown p-0",
2115
- style: {
2116
- width: menuWidth ? menuWidth : "min-content",
2117
- position: "fixed",
2118
- borderRadius: 3,
2119
- zIndex: 9999
2120
- },
2121
- 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: dropdownOpen && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2122
- "div",
2123
- {
2124
- onMouseDown: (e) => {
2125
- if (!isDisabled) {
2126
- inputRef?.current.focus();
2127
- e.preventDefault();
2128
- }
1950
+ onClick: (e) => {
1951
+ if (e.target.nodeName === "DIV" || e.target.nodeName === "TD") {
1952
+ if (indexRow !== indexFocus) {
1953
+ setIndexFocus(indexRow);
1954
+ }
1955
+ e.stopPropagation();
1956
+ }
1957
+ },
1958
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1959
+ "div",
1960
+ {
1961
+ className: (0, import_classnames9.default)("r-rowcell-div"),
1962
+ style: {
1963
+ width: col.fixedType ? Number(col.maxWidth ? col.maxWidth : col.width ? col.width : col.minWidth ?? "auto") : "auto"
1964
+ },
1965
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1966
+ "div",
1967
+ {
1968
+ className: (0, import_classnames9.default)("r-rowcell-content"),
1969
+ style: {
1970
+ margin: "7px 9px"
1971
+ },
1972
+ children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "r-cell-text", children: col.template ? col.template(row, indexRow) : value })
1973
+ }
1974
+ )
1975
+ }
1976
+ )
2129
1977
  },
2130
- children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "r-select-grid", children: [
2131
- /* @__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, {}) }),
2132
- /* @__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: [
2133
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_becoxy_icons5.Plus, { className: "me-50", fontSize: 16 }),
2134
- t("AddNew"),
2135
- " (F9)"
2136
- ] }) })
2137
- ] })
2138
- }
2139
- ) })
2140
- }
2141
- )
2142
- ]
2143
- }
2144
- ) })
1978
+ `col-${indexRow}-${indexCol}`
1979
+ ) }, indexCol);
1980
+ })
1981
+ },
1982
+ `row-${indexRow}`
1983
+ );
1984
+ }) })
1985
+ ] }) }) }) }),
1986
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1987
+ "div",
1988
+ {
1989
+ className: "d-flex justify-content-end p-1 ",
1990
+ style: { boxShadow: "0 4px 24px 0 rgb(34 41 47 / 10%)" },
1991
+ children: renderFooterButtons()
1992
+ }
1993
+ )
1994
+ ]
2145
1995
  }
2146
1996
  );
2147
- });
1997
+ };
1998
+ var sidebar_setting_column_default = SidebarSetColumn;
1999
+
2000
+ // test-app/src/component/table/index.tsx
2001
+ var import_ej2_react_dropdowns = require("@syncfusion/ej2-react-dropdowns");
2002
+
2003
+ // test-app/src/component/table/paging/index.tsx
2004
+ var import_becoxy_icons5 = require("becoxy-icons");
2005
+ var import_classnames10 = __toESM(require("classnames"));
2006
+ var import_react11 = require("react");
2007
+ var import_react_i18next8 = require("react-i18next");
2008
+ var import_jsx_runtime11 = require("react/jsx-runtime");
2009
+ var PagingComponent = ({ totalItem, pageSize, currentPage, onChangePage, pageOptions, onChangePageSize }) => {
2010
+ const { t } = (0, import_react_i18next8.useTranslation)();
2011
+ const [countPage, setCountPage] = (0, import_react11.useState)(0);
2012
+ const [currentPageNumber, setCurrentPageNumber] = (0, import_react11.useState)(1);
2013
+ (0, import_react11.useEffect)(() => {
2014
+ setCountPage(Math.floor(totalItem / pageSize) + (Math.floor(totalItem / pageSize) === totalItem / pageSize ? 0 : 1));
2015
+ }, [totalItem, pageSize]);
2016
+ (0, import_react11.useEffect)(() => {
2017
+ setCurrentPageNumber(Math.floor(currentPage / 5) + (Math.floor(currentPage / 5) === currentPage / 5 ? 0 : 1));
2018
+ }, [currentPage]);
2019
+ const renderPageNumber = (number) => {
2020
+ const arr = [];
2021
+ for (let index = (number - 1) * 5 + 1; index <= number * 5 && index <= Math.floor(totalItem / pageSize) + (Math.floor(totalItem / pageSize) === totalItem / pageSize ? 0 : 1); index++) {
2022
+ arr.push(
2023
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2024
+ "div",
2025
+ {
2026
+ className: (0, import_classnames10.default)("r-number", { "r-active": index === currentPage }),
2027
+ onClick: () => {
2028
+ onChangePage({ totalItem, pageSize, currentPage: index, old: currentPage });
2029
+ },
2030
+ children: index
2031
+ },
2032
+ `page-${index}`
2033
+ )
2034
+ );
2035
+ }
2036
+ return arr;
2037
+ };
2038
+ return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react11.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "r-pager", children: [
2039
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "r-pagercontainer", children: [
2040
+ /* @__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_icons5.ChevronsLeft, { fontSize: 16 }) }),
2041
+ /* @__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_icons5.ChevronLeft, { fontSize: 16 }) }),
2042
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2043
+ "button",
2044
+ {
2045
+ className: (0, import_classnames10.default)("r-button", { "d-none": currentPageNumber === 1 }),
2046
+ type: "button",
2047
+ onClick: () => {
2048
+ setCurrentPageNumber(currentPageNumber - 1);
2049
+ onChangePage({ totalItem, pageSize, currentPage: (currentPageNumber - 2) * 5 + 1, old: currentPage });
2050
+ },
2051
+ children: "..."
2052
+ }
2053
+ ),
2054
+ renderPageNumber(currentPageNumber),
2055
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2056
+ "button",
2057
+ {
2058
+ className: (0, import_classnames10.default)("r-button", { "d-none": currentPageNumber * 5 >= countPage }),
2059
+ type: "button",
2060
+ onClick: () => {
2061
+ setCurrentPageNumber(currentPageNumber + 1);
2062
+ onChangePage({ totalItem, pageSize, currentPage: currentPageNumber * 5 + 1, old: currentPage });
2063
+ },
2064
+ children: "..."
2065
+ }
2066
+ ),
2067
+ /* @__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_icons5.ChevronRight, { fontSize: 16 }) }),
2068
+ /* @__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_icons5.ChevronsRight, { fontSize: 16 }) }),
2069
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-pagesize", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
2070
+ SelectTable,
2071
+ {
2072
+ value: { value: pageSize, label: pageSize },
2073
+ noHeader: true,
2074
+ options: pageOptions.map((item) => ({ value: item, label: item })),
2075
+ onChange: (val) => {
2076
+ onChangePageSize({ totalItem, pageSize: val?.value });
2077
+ },
2078
+ menuWidth: 90,
2079
+ width: 90,
2080
+ placeholder: t("Select")
2081
+ }
2082
+ ) }),
2083
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { style: { display: "inline", marginLeft: 10, fontSize: 13 }, children: t("pagerDropDown") })
2084
+ ] }),
2085
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "r-parentmsgbar", children: t("totalItemsInfo", { page: currentPage, countPage, totalItem }) })
2086
+ ] }) });
2087
+ };
2148
2088
 
2149
2089
  // test-app/src/component/table/header.tsx
2150
- var import_react13 = require("react");
2151
- var import_classnames12 = __toESM(require("classnames"));
2152
- var import_reactstrap9 = require("reactstrap");
2153
- var import_react_i18next10 = require("react-i18next");
2090
+ var import_react12 = require("react");
2091
+ var import_classnames11 = __toESM(require("classnames"));
2092
+ var import_reactstrap8 = require("reactstrap");
2093
+ var import_react_i18next9 = require("react-i18next");
2154
2094
  var import_react_resizable = require("react-resizable");
2155
2095
  var import_styles = require("react-resizable/css/styles.css");
2156
- var import_jsx_runtime13 = require("react/jsx-runtime");
2096
+ var import_jsx_runtime12 = require("react/jsx-runtime");
2157
2097
  var HeaderTableCol = (props) => {
2158
2098
  const {
2159
2099
  selectEnable,
@@ -2169,7 +2109,7 @@ var HeaderTableCol = (props) => {
2169
2109
  setColumn,
2170
2110
  isMulti
2171
2111
  } = props;
2172
- const { t } = (0, import_react_i18next10.useTranslation)();
2112
+ const { t } = (0, import_react_i18next9.useTranslation)();
2173
2113
  const handleResize = (e, { size }) => {
2174
2114
  if (size.width > 50) {
2175
2115
  const newColumns = [...column];
@@ -2177,7 +2117,7 @@ var HeaderTableCol = (props) => {
2177
2117
  setColumn(newColumns);
2178
2118
  }
2179
2119
  };
2180
- return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react13.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2120
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react12.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2181
2121
  import_react_resizable.Resizable,
2182
2122
  {
2183
2123
  className: "r-resize",
@@ -2185,12 +2125,12 @@ var HeaderTableCol = (props) => {
2185
2125
  height: 0,
2186
2126
  onResize: handleResize,
2187
2127
  draggableOpts: { enableUserSelectHack: false },
2188
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2128
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2189
2129
  "th",
2190
2130
  {
2191
2131
  rowSpan: col.rowspan !== 1 ? col.rowspan : void 0,
2192
2132
  colSpan: col.columns?.length ?? 1,
2193
- className: (0, import_classnames12.default)(`r-headercell fix-${col.fixedType}`, { "cell-fixed": col.fixedType }),
2133
+ className: (0, import_classnames11.default)(`r-headercell fix-${col.fixedType}`, { "cell-fixed": col.fixedType }),
2194
2134
  style: {
2195
2135
  top: `${indexParent * 42}px`,
2196
2136
  left: col.fixedType === "left" ? objWidthFix[col.index ?? 0] : void 0,
@@ -2199,18 +2139,18 @@ var HeaderTableCol = (props) => {
2199
2139
  minWidth: col.width ? typeof col.width === "number" ? col.width : col.width?.includes("px") || col.width?.includes("%") ? col.width : `${col.width}px` : "auto",
2200
2140
  maxWidth: col.width ? typeof col.width === "number" ? col.width : col.width?.includes("px") || col.width?.includes("%") ? col.width : `${col.width}px` : "auto"
2201
2141
  },
2202
- children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
2142
+ children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
2203
2143
  "div",
2204
2144
  {
2205
2145
  style: { justifyContent: col.textAlign ?? "left" },
2206
- className: (0, import_classnames12.default)("r-headercell-div"),
2146
+ className: (0, import_classnames11.default)("r-headercell-div"),
2207
2147
  children: [
2208
- col.field === "checkbox" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
2209
- import_reactstrap9.Input,
2148
+ col.field === "checkbox" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
2149
+ import_reactstrap8.Input,
2210
2150
  {
2211
2151
  checked: totalCount > 0 && selectedRows?.length >= totalCount,
2212
2152
  type: "checkbox",
2213
- className: (0, import_classnames12.default)("cursor-pointer", { "d-none": !isMulti }),
2153
+ className: (0, import_classnames11.default)("cursor-pointer", { "d-none": !isMulti }),
2214
2154
  style: { textAlign: col.textAlign ?? "left", marginTop: 6 },
2215
2155
  onChange: (e) => {
2216
2156
  if (selectEnable) {
@@ -2237,39 +2177,39 @@ var HeaderTableCol = (props) => {
2237
2177
  var header_default = HeaderTableCol;
2238
2178
 
2239
2179
  // test-app/src/component/table/command.tsx
2240
- var import_react15 = require("react");
2241
- var import_classnames13 = __toESM(require("classnames"));
2242
- var import_reactstrap10 = require("reactstrap");
2243
- var import_react_i18next11 = require("react-i18next");
2180
+ var import_react14 = require("react");
2181
+ var import_classnames12 = __toESM(require("classnames"));
2182
+ var import_reactstrap9 = require("reactstrap");
2183
+ var import_react_i18next10 = require("react-i18next");
2244
2184
 
2245
2185
  // test-app/src/component/icon/index.tsx
2246
2186
  var Icon = __toESM(require("becoxy-icons"));
2247
- var import_react14 = require("react");
2248
- var import_jsx_runtime14 = require("react/jsx-runtime");
2187
+ var import_react13 = require("react");
2188
+ var import_jsx_runtime13 = require("react/jsx-runtime");
2249
2189
  var IconCustom = (props) => {
2250
2190
  const { iconName, size } = props;
2251
2191
  if (iconName === "") {
2252
2192
  return null;
2253
2193
  } else {
2254
2194
  const TagIcon = iconName === "" ? "" : Icon[iconName];
2255
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react14.Fragment, { children: iconName === "" ? "" : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TagIcon, { fontSize: size }) });
2195
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_react13.Fragment, { children: iconName === "" ? "" : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(TagIcon, { fontSize: size }) });
2256
2196
  }
2257
2197
  };
2258
2198
  var icon_default = IconCustom;
2259
2199
 
2260
2200
  // test-app/src/component/table/command.tsx
2261
- var import_jsx_runtime15 = require("react/jsx-runtime");
2201
+ var import_jsx_runtime14 = require("react/jsx-runtime");
2262
2202
  var CommandElement = (props) => {
2263
2203
  const { commandItems, rowData, indexRow, handleCommandClick, indexFocus, setIndexFocus } = props;
2264
- const { t } = (0, import_react_i18next11.useTranslation)();
2265
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "d-flex align-items-center", style: { columnGap: 10 }, children: commandItems.map((item, index) => {
2266
- return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
2267
- import_reactstrap10.Button,
2204
+ const { t } = (0, import_react_i18next10.useTranslation)();
2205
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react14.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "d-flex align-items-center", style: { columnGap: 10 }, children: commandItems.map((item, index) => {
2206
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
2207
+ import_reactstrap9.Button,
2268
2208
  {
2269
2209
  id: `command-item-${indexRow}-${index}`,
2270
2210
  tabIndex: -1,
2271
2211
  style: { padding: "5px", minWidth: 45, height: "100%" },
2272
- className: (0, import_classnames13.default)("command-item", {
2212
+ className: (0, import_classnames12.default)("command-item", {
2273
2213
  "btn-icon": item.tooltip === ""
2274
2214
  }),
2275
2215
  color: item.color ? item.color : "#000",
@@ -2281,8 +2221,8 @@ var CommandElement = (props) => {
2281
2221
  e.preventDefault();
2282
2222
  },
2283
2223
  children: [
2284
- item.icon && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(icon_default, { iconName: item.icon, size: 16 }),
2285
- /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.UncontrolledTooltip, { className: "r-tooltip", target: `command-item-${indexRow}-${index}`, place: "top", children: t(item.tooltip ?? "") })
2224
+ item.icon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(icon_default, { iconName: item.icon, size: 16 }),
2225
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_reactstrap9.UncontrolledTooltip, { className: "r-tooltip", target: `command-item-${indexRow}-${index}`, place: "top", children: t(item.tooltip ?? "") })
2286
2226
  ]
2287
2227
  },
2288
2228
  `command-${index}`
@@ -2292,9 +2232,9 @@ var CommandElement = (props) => {
2292
2232
  var command_default = CommandElement;
2293
2233
 
2294
2234
  // test-app/src/component/table/index.tsx
2295
- var import_jsx_runtime16 = require("react/jsx-runtime");
2296
- var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2297
- const { t } = (0, import_react_i18next12.useTranslation)();
2235
+ var import_jsx_runtime15 = require("react/jsx-runtime");
2236
+ var TableEdit = (0, import_react15.forwardRef)((props, ref) => {
2237
+ const { t } = (0, import_react_i18next11.useTranslation)();
2298
2238
  const {
2299
2239
  idTable,
2300
2240
  dataSource,
@@ -2322,36 +2262,36 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2322
2262
  handleSelect,
2323
2263
  isMulti
2324
2264
  } = props;
2325
- (0, import_react16.useImperativeHandle)(ref, () => {
2265
+ (0, import_react15.useImperativeHandle)(ref, () => {
2326
2266
  return {
2327
2267
  refeshFocusRow: handleRefeshRow
2328
2268
  };
2329
2269
  });
2330
- const [refreshRow, setRefreshRow] = (0, import_react16.useState)(false);
2331
- const [indexFocus, setIndexFocus] = (0, import_react16.useState)();
2332
- const [selectedRows, setSelectedRows] = (0, import_react16.useState)([]);
2333
- const [headerColumns, setHeaderColumns] = (0, import_react16.useState)([[]]);
2334
- const [contentColumns, setContentColumns] = (0, import_react16.useState)([]);
2335
- const [levelCol, setLevelCol] = (0, import_react16.useState)(0);
2336
- const [columnFistEdit, setColumnFistEdit] = (0, import_react16.useState)(0);
2337
- const [columnLastEdit, setColumnlastEdit] = (0, import_react16.useState)(0);
2338
- const [objWidthFix, setObjWidthFix] = (0, import_react16.useState)({});
2339
- const [openPopupTree, setOpenPopupTree] = (0, import_react16.useState)(false);
2340
- const [openPopupSetupColumn, setOpenPopupSetupColumn] = (0, import_react16.useState)(false);
2341
- const [searchTerm, setSearchTerm] = (0, import_react16.useState)("");
2342
- const tableElement = (0, import_react16.useRef)(null);
2343
- const gridRef = (0, import_react16.useRef)();
2270
+ const [refreshRow, setRefreshRow] = (0, import_react15.useState)(false);
2271
+ const [indexFocus, setIndexFocus] = (0, import_react15.useState)();
2272
+ const [selectedRows, setSelectedRows] = (0, import_react15.useState)([]);
2273
+ const [headerColumns, setHeaderColumns] = (0, import_react15.useState)([[]]);
2274
+ const [contentColumns, setContentColumns] = (0, import_react15.useState)([]);
2275
+ const [levelCol, setLevelCol] = (0, import_react15.useState)(0);
2276
+ const [columnFistEdit, setColumnFistEdit] = (0, import_react15.useState)(0);
2277
+ const [columnLastEdit, setColumnlastEdit] = (0, import_react15.useState)(0);
2278
+ const [objWidthFix, setObjWidthFix] = (0, import_react15.useState)({});
2279
+ const [openPopupTree, setOpenPopupTree] = (0, import_react15.useState)(false);
2280
+ const [openPopupSetupColumn, setOpenPopupSetupColumn] = (0, import_react15.useState)(false);
2281
+ const [searchTerm, setSearchTerm] = (0, import_react15.useState)("");
2282
+ const tableElement = (0, import_react15.useRef)(null);
2283
+ const gridRef = (0, import_react15.useRef)();
2344
2284
  let totalCount = dataSource.length;
2345
2285
  const pagingClient = pagingSetting?.allowPaging && (pagingSetting?.pagingClient || !(editDisable || addDisable));
2346
2286
  const searchClient = searchSetting?.searchEnable && (searchSetting?.searchClient || !(editDisable || addDisable));
2347
2287
  const fieldKey = columns.find((item) => item.isPrimarykey === true)?.field ?? "id";
2348
2288
  const fieldUniKey = columns.filter((item) => item.isUnikey === true)?.map((item) => item.field);
2349
- (0, import_react16.useEffect)(() => {
2289
+ (0, import_react15.useEffect)(() => {
2350
2290
  if (pagingClient && pagingSetting.setCurrentPage && Math.ceil(totalCount / (pagingSetting?.pageSize ?? 1)) < (pagingSetting.currentPage ?? 1)) {
2351
2291
  pagingSetting.setCurrentPage(1);
2352
2292
  }
2353
2293
  }, [dataSource]);
2354
- (0, import_react16.useEffect)(() => {
2294
+ (0, import_react15.useEffect)(() => {
2355
2295
  let indexFirst = -1;
2356
2296
  let indexlast = -1;
2357
2297
  let letfWidthFix = 0;
@@ -2385,7 +2325,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2385
2325
  setColumnFistEdit(indexFirst + 1);
2386
2326
  setColumnlastEdit(indexlast + 1);
2387
2327
  }, [contentColumns]);
2388
- (0, import_react16.useEffect)(() => {
2328
+ (0, import_react15.useEffect)(() => {
2389
2329
  const arrHeaderColumns = [];
2390
2330
  const arrContentColumns = [];
2391
2331
  let headerLevelRow = 0;
@@ -2402,7 +2342,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2402
2342
  setHeaderColumns(arrHeaderColumns);
2403
2343
  setContentColumns(arrContentColumns);
2404
2344
  }, [columns]);
2405
- (0, import_react16.useEffect)(() => {
2345
+ (0, import_react15.useEffect)(() => {
2406
2346
  const arrHeaderColumns = [];
2407
2347
  const arrContentColumns = [];
2408
2348
  let headerLevelRow = 0;
@@ -2430,6 +2370,9 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2430
2370
  ele.index = arrContentColumns.length;
2431
2371
  if (maxLevelRow === 1) {
2432
2372
  ele.visible = item.invisibleDisable ? item.visible : contentColumns[arrContentColumns.length]?.visible ?? item.visible;
2373
+ ele.width = contentColumns[arrContentColumns.length]?.width ?? item.width;
2374
+ ele.maxWidth = contentColumns[arrContentColumns.length]?.maxWidth ?? item.maxWidth;
2375
+ ele.minWidth = contentColumns[arrContentColumns.length]?.minWidth ?? item.minWidth;
2433
2376
  }
2434
2377
  arrHeaderColumns[level].push(ele);
2435
2378
  arrContentColumns.push(ele);
@@ -2516,7 +2459,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2516
2459
  }
2517
2460
  };
2518
2461
  const searchTemplate = () => {
2519
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react16.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "me-50 r-search", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2462
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "me-50 r-search", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2520
2463
  react_input_default,
2521
2464
  {
2522
2465
  style: { width: "230px" },
@@ -2537,8 +2480,8 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2537
2480
  const renderEdit = (row, col, indexRow, indexCol) => {
2538
2481
  switch (col?.editTypeCondition ? col?.editTypeCondition(row) : col.editType) {
2539
2482
  case "date":
2540
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2541
- import_reactstrap11.Input,
2483
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2484
+ import_reactstrap10.Input,
2542
2485
  {
2543
2486
  id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
2544
2487
  style: { textAlign: col.textAlign, height: 29 },
@@ -2550,7 +2493,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2550
2493
  }
2551
2494
  handleDataChange(row, col, indexRow);
2552
2495
  },
2553
- className: (0, import_classnames14.default)("border-0 rounded-0", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2496
+ className: (0, import_classnames13.default)("border-0 rounded-0 r-date-input", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2554
2497
  type: "date",
2555
2498
  max: "9999-12-31",
2556
2499
  onKeyDown: (e) => {
@@ -2566,8 +2509,8 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2566
2509
  }
2567
2510
  );
2568
2511
  case "datetime":
2569
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2570
- import_reactstrap11.Input,
2512
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2513
+ import_reactstrap10.Input,
2571
2514
  {
2572
2515
  id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
2573
2516
  style: { textAlign: col.textAlign, height: 29 },
@@ -2579,7 +2522,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2579
2522
  }
2580
2523
  handleDataChange(row, col, indexRow);
2581
2524
  },
2582
- className: (0, import_classnames14.default)("border-0 rounded-0", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2525
+ className: (0, import_classnames13.default)("border-0 rounded-0 r-date-input", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2583
2526
  type: "datetime-local",
2584
2527
  max: "9999-12-31T23:59",
2585
2528
  onKeyDown: (e) => {
@@ -2607,7 +2550,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2607
2550
  } else {
2608
2551
  valueSelect = !isNullOrUndefined(row[col.field]) && row[col.field] !== "" ? optionsSelect?.find((val) => val[col.selectSettings?.fieldValue ?? "value"] === row[col.field]) : "";
2609
2552
  }
2610
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2553
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2611
2554
  SelectTable,
2612
2555
  {
2613
2556
  id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
@@ -2664,14 +2607,14 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2664
2607
  }
2665
2608
  }
2666
2609
  };
2667
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2610
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2668
2611
  "div",
2669
2612
  {
2670
2613
  onKeyDown: (e) => {
2671
2614
  if (checkKeyDown(e, row, col, indexRow + 1, indexCol + 1)) {
2672
2615
  }
2673
2616
  },
2674
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2617
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2675
2618
  import_ej2_react_dropdowns.DropDownTreeComponent,
2676
2619
  {
2677
2620
  id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
@@ -2682,7 +2625,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2682
2625
  parentValue: "parentId",
2683
2626
  child: "children"
2684
2627
  },
2685
- className: (0, import_classnames14.default)("select-tree", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2628
+ className: (0, import_classnames13.default)("select-tree", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2686
2629
  allowFiltering: false,
2687
2630
  value: valueSelectTree,
2688
2631
  popupHeight: 250,
@@ -2710,8 +2653,8 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2710
2653
  }
2711
2654
  );
2712
2655
  case "checkbox":
2713
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2714
- import_reactstrap11.Input,
2656
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2657
+ import_reactstrap10.Input,
2715
2658
  {
2716
2659
  checked: row[col.field],
2717
2660
  id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
@@ -2733,13 +2676,13 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2733
2676
  );
2734
2677
  case "numeric":
2735
2678
  let valueCurrency = row[col.field];
2736
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2737
- import_reactstrap11.Input,
2679
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2680
+ import_reactstrap10.Input,
2738
2681
  {
2739
2682
  id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
2740
2683
  style: { textAlign: col.textAlign, height: 29 },
2741
2684
  defaultValue: formartNumberic(valueCurrency, decimalSeparator, thousandSeparator, col.numericSettings?.fraction),
2742
- className: (0, import_classnames14.default)("border-0 rounded-0 input-numeric", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2685
+ className: (0, import_classnames13.default)("border-0 rounded-0 input-numeric", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2743
2686
  onChange: (val) => {
2744
2687
  let newVal = "";
2745
2688
  const flag = val.target?.value.startsWith("-");
@@ -2823,8 +2766,8 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2823
2766
  }
2824
2767
  );
2825
2768
  case "color":
2826
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { padding: "4px 8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2827
- import_reactstrap11.Input,
2769
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { padding: "4px 8px" }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2770
+ import_reactstrap10.Input,
2828
2771
  {
2829
2772
  type: "color",
2830
2773
  value: row[col.field],
@@ -2846,7 +2789,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2846
2789
  `col-${indexRow}-${indexCol}`
2847
2790
  ) });
2848
2791
  case "form":
2849
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2792
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2850
2793
  edit_form_default,
2851
2794
  {
2852
2795
  id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
@@ -2874,13 +2817,13 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
2874
2817
  }
2875
2818
  );
2876
2819
  default:
2877
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
2878
- import_reactstrap11.Input,
2820
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
2821
+ import_reactstrap10.Input,
2879
2822
  {
2880
2823
  id: `${idTable}-col${indexCol + 1}-row${indexRow + 1}`,
2881
2824
  style: { textAlign: col.textAlign, height: 29 },
2882
2825
  defaultValue: isNullOrUndefined(row[col.field]) ? "" : row[col.field],
2883
- className: (0, import_classnames14.default)("border-0 rounded-0 input-element", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2826
+ className: (0, import_classnames13.default)("border-0 rounded-0 input-element", { "is-invalid": col.validate && col.validate(row[col.field], row) }),
2884
2827
  onBlur: (val) => {
2885
2828
  if (row[col.field] != val.target?.value) {
2886
2829
  row[col.field] = val.target?.value;
@@ -3050,7 +2993,6 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3050
2993
  }
3051
2994
  };
3052
2995
  const onChangePageSize = (args) => {
3053
- console.log(args.pageSize);
3054
2996
  if (pagingSetting?.allowPaging) {
3055
2997
  if (pagingSetting?.pageSize !== args.pageSize) {
3056
2998
  if (pagingSetting?.setPageSize) {
@@ -3263,7 +3205,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3263
3205
  }
3264
3206
  }
3265
3207
  };
3266
- (0, import_react16.useEffect)(() => {
3208
+ (0, import_react15.useEffect)(() => {
3267
3209
  setIndexFocus(-1);
3268
3210
  if (setSelectedItem) {
3269
3211
  if (isMulti) {
@@ -3290,7 +3232,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3290
3232
  }
3291
3233
  }
3292
3234
  }, [selectedRows]);
3293
- (0, import_react16.useEffect)(() => {
3235
+ (0, import_react15.useEffect)(() => {
3294
3236
  if (!isMulti) {
3295
3237
  if (dataSource && selectedItem && selectedItem[fieldKey]) {
3296
3238
  if (selectedRows?.length === 0 || selectedItem[fieldKey] !== selectedRows[0][fieldKey]) {
@@ -3307,10 +3249,10 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3307
3249
  }, [selectedItem]);
3308
3250
  const renderContentCol = (col, row, indexRow, indexCol, isSelected) => {
3309
3251
  if (col.field === "command") {
3310
- return col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3252
+ return col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3311
3253
  "td",
3312
3254
  {
3313
- className: (0, import_classnames14.default)(
3255
+ className: (0, import_classnames13.default)(
3314
3256
  `r-rowcell p-0 fix-${col.fixedType}`,
3315
3257
  { "cell-fixed": col.fixedType },
3316
3258
  { "r-active": isSelected && editDisable || indexFocus === indexRow }
@@ -3320,15 +3262,15 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3320
3262
  right: col.fixedType === "right" ? objWidthFix[indexCol] : void 0,
3321
3263
  textAlign: col.textAlign ? col.textAlign : "left"
3322
3264
  },
3323
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-rowcell-div ", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(command_default, { commandItems: col.commandItems ?? [], handleCommandClick, indexRow, rowData: row, setIndexFocus, indexFocus }) })
3265
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-rowcell-div ", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(command_default, { commandItems: col.commandItems ?? [], handleCommandClick, indexRow, rowData: row, setIndexFocus, indexFocus }) })
3324
3266
  },
3325
3267
  `col-${indexRow}-${indexCol}`
3326
3268
  );
3327
3269
  } else if (col.field === "#") {
3328
- return col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3270
+ return col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3329
3271
  "td",
3330
3272
  {
3331
- className: (0, import_classnames14.default)(`r-rowcell p-0 cursor-pointer fix-${col.fixedType}`, { "cell-fixed": col.fixedType }, { "r-active": isSelected && editDisable || indexFocus === indexRow }),
3273
+ className: (0, import_classnames13.default)(`r-rowcell p-0 cursor-pointer fix-${col.fixedType}`, { "cell-fixed": col.fixedType }, { "r-active": isSelected && editDisable || indexFocus === indexRow }),
3332
3274
  tabIndex: Number(`${indexRow}${indexCol}`),
3333
3275
  style: {
3334
3276
  left: col.fixedType === "left" ? objWidthFix[indexCol] : void 0,
@@ -3372,15 +3314,15 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3372
3314
  e.stopPropagation();
3373
3315
  }
3374
3316
  },
3375
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-rowcell-div pt-50", children: indexRow + 1 })
3317
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-rowcell-div pt-50", children: indexRow + 1 })
3376
3318
  },
3377
3319
  `col-${indexRow}-${indexCol}`
3378
3320
  );
3379
3321
  } else if (col.field === "checkbox") {
3380
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3322
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3381
3323
  "td",
3382
3324
  {
3383
- className: (0, import_classnames14.default)(
3325
+ className: (0, import_classnames13.default)(
3384
3326
  `r-rowcell p-0 fix-${col.fixedType}`,
3385
3327
  { "cell-fixed": col.fixedType },
3386
3328
  { "r-active": isSelected && editDisable || indexFocus === indexRow }
@@ -3390,7 +3332,7 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3390
3332
  right: col.fixedType === "right" ? objWidthFix[indexCol] : void 0,
3391
3333
  textAlign: col.textAlign ? col.textAlign : "center"
3392
3334
  },
3393
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3335
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3394
3336
  "div",
3395
3337
  {
3396
3338
  className: "r-rowcell-div cursor-pointer",
@@ -3414,8 +3356,8 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3414
3356
  e.stopPropagation();
3415
3357
  }
3416
3358
  },
3417
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3418
- import_reactstrap11.Input,
3359
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3360
+ import_reactstrap10.Input,
3419
3361
  {
3420
3362
  checked: isSelected,
3421
3363
  type: "checkbox",
@@ -3441,10 +3383,10 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3441
3383
  }
3442
3384
  const typeDis = !editDisable && (indexFocus === indexRow || col.editType === "checkbox") && (!col.disabledCondition || !col.disabledCondition(row)) ? col.editEnable ? 1 : col.template ? 2 : 3 : col.template ? 2 : 3;
3443
3385
  const errorMessage = typeDis === 1 || col.field === "" || !col.validate ? "" : col.validate(row[col.field], row);
3444
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react16.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3386
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3445
3387
  "td",
3446
3388
  {
3447
- className: (0, import_classnames14.default)(
3389
+ className: (0, import_classnames13.default)(
3448
3390
  `r-rowcell fix-${col.fixedType}`,
3449
3391
  { "cell-fixed": col.fixedType },
3450
3392
  { "r-active": isSelected && editDisable || indexFocus === indexRow }
@@ -3486,25 +3428,25 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3486
3428
  e.stopPropagation();
3487
3429
  }
3488
3430
  },
3489
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3431
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3490
3432
  "div",
3491
3433
  {
3492
- className: (0, import_classnames14.default)("r-rowcell-div"),
3493
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
3434
+ className: (0, import_classnames13.default)("r-rowcell-div"),
3435
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(
3494
3436
  "div",
3495
3437
  {
3496
3438
  id: indexFocus === indexRow && typeDis !== 1 ? `${idTable}-col${indexCol + 1}-row${indexRow + 1}` : "",
3497
- className: (0, import_classnames14.default)("r-rowcell-content", { "r-is-invalid": errorMessage }),
3439
+ className: (0, import_classnames13.default)("r-rowcell-content", { "r-is-invalid": errorMessage }),
3498
3440
  style: {
3499
3441
  margin: typeDis === 1 ? 2 : !errorMessage ? "7px 9px" : 2,
3500
3442
  color: col.editType === "numeric" && Number(row[col.field]) < 0 ? "red" : ""
3501
3443
  },
3502
3444
  children: [
3503
- typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { id: `content-${idTable}-row${indexRow}col-${indexCol}`, className: "r-cell-text", children: typeDis === 2 ? col.template(row, indexRow) : value }),
3504
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { id: `error-${indexRow}-${indexCol}`, className: (0, import_classnames14.default)("cursor-pointer text-primary icon-table", { "d-none": !errorMessage }), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_becoxy_icons6.AlertCircle, { fontSize: 15.5 }) }),
3505
- !(typeDis === 1 && !refreshRow) && checkOverflow(indexRow, indexCol) && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `content-${idTable}-row${indexRow}col-${indexCol}`, children: typeDis === 2 ? col.template(row, indexRow) : value }),
3506
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3507
- import_reactstrap11.UncontrolledTooltip,
3445
+ typeDis === 1 && !refreshRow ? renderEdit(row, col, indexRow, indexCol) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id: `content-${idTable}-row${indexRow}col-${indexCol}`, className: "r-cell-text", children: typeDis === 2 ? col.template(row, indexRow) : value }),
3446
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { id: `error-${indexRow}-${indexCol}`, className: (0, import_classnames13.default)("cursor-pointer text-primary icon-table", { "d-none": !errorMessage }), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_becoxy_icons6.AlertCircle, { fontSize: 15.5 }) }),
3447
+ !(typeDis === 1 && !refreshRow) && checkOverflow(indexRow, indexCol) && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.UncontrolledTooltip, { className: "r-tooltip", autohide: false, target: `content-${idTable}-row${indexRow}col-${indexCol}`, children: typeDis === 2 ? col.template(row, indexRow) : value }),
3448
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3449
+ import_reactstrap10.UncontrolledTooltip,
3508
3450
  {
3509
3451
  target: `error-${indexRow}-${indexCol}`,
3510
3452
  className: "r-tooltip tooltip-error",
@@ -3526,10 +3468,10 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3526
3468
  return element && element.scrollWidth > element.clientWidth;
3527
3469
  };
3528
3470
  const renderFooterCol = (col, indexCol) => {
3529
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react16.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3471
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react15.Fragment, { children: col.visible !== false && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3530
3472
  "td",
3531
3473
  {
3532
- className: (0, import_classnames14.default)(
3474
+ className: (0, import_classnames13.default)(
3533
3475
  `p-0 px-50 r-footer fix-${col.fixedType}`,
3534
3476
  { "cell-fixed": col.fixedType }
3535
3477
  ),
@@ -3538,56 +3480,56 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3538
3480
  right: col.fixedType === "right" ? objWidthFix[indexCol] : void 0,
3539
3481
  textAlign: col.textAlign ? col.textAlign : "left"
3540
3482
  },
3541
- children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-footer-div", children: col.haveSum === true && col.editType === "numeric" ? formartNumberic(dataSource.reduce(function(accumulator, currentValue) {
3483
+ children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-footer-div", children: col.haveSum === true && col.editType === "numeric" ? formartNumberic(dataSource.reduce(function(accumulator, currentValue) {
3542
3484
  return Number(accumulator ?? 0) + Number(currentValue[col.field] ?? 0);
3543
3485
  }, 0), decimalSeparator, thousandSeparator, col.numericSettings?.fraction, true) : "" })
3544
3486
  }
3545
3487
  ) }, `summarycell-${indexCol}`);
3546
3488
  };
3547
3489
  const renderToolbarTop = () => {
3548
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { id: "table_custom_top_toolbar", className: "r-toolbar r-toolbar-top", "aria-orientation": "horizontal", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "r-toolbar-items", children: [
3549
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-left", children: toolbarTopOption?.map((item, index) => {
3550
- return item.align === "left" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-top-left-${index}`) : "";
3490
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id: "table_custom_top_toolbar", className: "r-toolbar r-toolbar-top", "aria-orientation": "horizontal", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "r-toolbar-items", children: [
3491
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-left", children: toolbarTopOption?.map((item, index) => {
3492
+ return item.align === "left" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-top-left-${index}`) : "";
3551
3493
  }) }),
3552
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-center", children: toolbarTopOption?.map((item, index) => {
3553
- return item.align === "center" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-top-center-${index}`) : "";
3494
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-center", children: toolbarTopOption?.map((item, index) => {
3495
+ return item.align === "center" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-top-center-${index}`) : "";
3554
3496
  }) }),
3555
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-right", children: toolbarTopOption?.map((item, index) => {
3556
- return item.align === "right" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-top-right-${index}`) : "";
3497
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-right", children: toolbarTopOption?.map((item, index) => {
3498
+ return item.align === "right" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-top-right-${index}`) : "";
3557
3499
  }) })
3558
3500
  ] }) });
3559
3501
  };
3560
3502
  const renderToolbarBottom = () => {
3561
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "r-toolbar-items", children: [
3562
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "r-toolbar-left", children: [
3563
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: handleAdd, className: "d-flex", children: t("Add item") }) }),
3564
- (indexFocus ?? -1) > -1 ? /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
3565
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.duplicateDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: () => {
3503
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id: "table_custom_bottom_toolbar", className: "r-toolbar r-toolbar-bottom", role: "toolbar", "aria-disabled": "false", "aria-haspopup": "false", "aria-orientation": "horizontal", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "r-toolbar-items", children: [
3504
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "r-toolbar-left", children: [
3505
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_classnames13.default)("r-toolbar-item", { "d-none": editDisable || addDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.Button, { color: "success", outline: true, onClick: handleAdd, className: "d-flex", children: t("Add item") }) }),
3506
+ (indexFocus ?? -1) > -1 ? /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
3507
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_classnames13.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.duplicateDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.Button, { color: "success", outline: true, onClick: () => {
3566
3508
  handleDuplicate(dataSource[indexFocus ?? -1], indexFocus ?? -1);
3567
3509
  }, className: "d-flex", children: t("Duplicate") }) }),
3568
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertBeforeDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t("Insert item before") }) }),
3569
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertAfterDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t("Insert item after") }) })
3570
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: " " }),
3571
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item", { "d-none": editDisable || buttonSetting?.deleteAllDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.Button, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t("Delete all item") }) }),
3510
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_classnames13.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertBeforeDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.Button, { color: "success", outline: true, onClick: handleInsertBefore, className: "d-flex", children: t("Insert item before") }) }),
3511
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_classnames13.default)("r-toolbar-item", { "d-none": editDisable || addDisable || buttonSetting?.insertAfterDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.Button, { color: "success", outline: true, onClick: handleInsertAfter, className: "d-flex", children: t("Insert item after") }) })
3512
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: " " }),
3513
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_classnames13.default)("r-toolbar-item", { "d-none": editDisable || buttonSetting?.deleteAllDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.Button, { color: "primary", outline: true, onClick: handleDeleteAll, className: "d-flex", children: t("Delete all item") }) }),
3572
3514
  toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
3573
- return item.align === "left" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`) : "";
3515
+ return item.align === "left" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-left-${index}`) : "";
3574
3516
  })
3575
3517
  ] }),
3576
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
3577
- return item.align === "center" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`) : "";
3518
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-center", children: toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
3519
+ return item.align === "center" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-center-${index}`) : "";
3578
3520
  }) }),
3579
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "r-toolbar-right", children: [
3521
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "r-toolbar-right", children: [
3580
3522
  toolbarSetting?.toolbarBottomOptions?.map((item, index) => {
3581
- return item.align === "right" ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`) : "";
3523
+ return item.align === "right" ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: "r-toolbar-item", "aria-disabled": "false", children: item.template() }, `toolbar-bottom-right-${index}`) : "";
3582
3524
  }),
3583
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item me-25", { "d-none": headerColumns.length > 1 }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_becoxy_icons6.Settings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }),
3584
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: (0, import_classnames14.default)("r-toolbar-item me-25", { "d-none": editDisable || addDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_reactstrap11.UncontrolledDropdown, { className: "dropdown-user nav-item", children: [
3585
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.DropdownToggle, { href: "/", tag: "a", color: "info", onClick: (e) => e.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_becoxy_icons6.Info, { className: "cursor-pointer" }) }),
3586
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.DropdownMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "d-flex flex-column p-50 py-25", children: [
3587
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\xE0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\xE0ng v\xE0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\xE2n b\u1EA3n" }),
3588
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 13 }, children: "Ch\u1ECDn \xF4 v\xE0 Ctrl + V \u0111\u1EC3 d\xE1n th\xF4ng tin t\u1EEB excel" }),
3589
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\xE0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\xE0ng v\xE0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\xE9p h\xE0ng" }),
3590
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\xE0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\xE0ng v\xE0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\xE1n h\xE0ng" })
3525
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_classnames13.default)("r-toolbar-item me-25", { "d-none": headerColumns.length > 1 }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_becoxy_icons6.Settings, { className: "text-primary cursor-pointer", onClick: () => setOpenPopupSetupColumn(true) }) }),
3526
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { className: (0, import_classnames13.default)("r-toolbar-item me-25", { "d-none": editDisable || addDisable }), "aria-disabled": "false", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_reactstrap10.UncontrolledDropdown, { className: "dropdown-user nav-item", children: [
3527
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.DropdownToggle, { href: "/", tag: "a", color: "info", onClick: (e) => e.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_becoxy_icons6.Info, { className: "cursor-pointer" }) }),
3528
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_reactstrap10.DropdownMenu, { children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "d-flex flex-column p-50 py-25", children: [
3529
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\xE0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\xE0ng v\xE0 nh\u1EA5n Ctrl + D \u0111\u1EC3 nh\xE2n b\u1EA3n" }),
3530
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 13 }, children: "Ch\u1ECDn \xF4 v\xE0 Ctrl + V \u0111\u1EC3 d\xE1n th\xF4ng tin t\u1EEB excel" }),
3531
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\xE0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\xE0ng v\xE0 nh\u1EA5n Ctrl + C \u0111\u1EC3 sao ch\xE9p h\xE0ng" }),
3532
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { style: { fontSize: 13 }, children: "Nh\u1EA5n v\xE0o c\u1ED9t STT \u0111\u1EC3 ch\u1ECDn h\xE0ng v\xE0 nh\u1EA5n Ctrl + V \u0111\u1EC3 d\xE1n h\xE0ng" })
3591
3533
  ] }) })
3592
3534
  ] }) })
3593
3535
  ] })
@@ -3616,10 +3558,10 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3616
3558
  const flagDisplay = !pagingClient || totalCount > (pagingSetting.pageSize ?? 0) * ((pagingSetting.currentPage ?? 0) - 1) && totalCount <= (pagingSetting.pageSize ?? 0) * (pagingSetting.currentPage ?? 0);
3617
3559
  if (flagDisplay) {
3618
3560
  countDisplay++;
3619
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3561
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3620
3562
  "tr",
3621
3563
  {
3622
- className: (0, import_classnames14.default)("r-row", { "fisrt-row": countDisplay === 0 }),
3564
+ className: (0, import_classnames13.default)("r-row", { "fisrt-row": countDisplay === 0 }),
3623
3565
  children: contentColumns.map((col, indexCol) => {
3624
3566
  return renderContentCol(col, row, indexRow, indexCol, isSelected);
3625
3567
  })
@@ -3630,19 +3572,19 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3630
3572
  }
3631
3573
  });
3632
3574
  };
3633
- (0, import_react16.useEffect)(() => {
3575
+ (0, import_react15.useEffect)(() => {
3634
3576
  if (pagingClient && pagingSetting?.setCurrentPage && (searchSetting?.searchTerm !== void 0 ? searchSetting?.searchTerm : searchTerm)) {
3635
3577
  pagingSetting?.setCurrentPage(1);
3636
3578
  }
3637
3579
  }, [searchTerm, searchSetting?.searchTerm]);
3638
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react16.Fragment, { children: [
3639
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "react-table-edit", children: [
3640
- /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "r-grid", ref: gridRef, children: [
3641
- toolbarSetting?.showTopToolbar ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: renderToolbarTop() }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, {}),
3642
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { ref: tableElement, className: "r-gridtable", style: { height: `${height ? `${height}px` : "auto"}`, minHeight: `${minHeight ? `${minHeight}px` : ""}`, maxHeight: `${maxHeight ? `${maxHeight}px` : "400px"}` }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("table", { style: { width: "100%" }, children: [
3643
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("thead", { className: "r-gridheader", children: headerColumns.map((element, indexParent) => {
3644
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
3645
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3580
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_react15.Fragment, { children: [
3581
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "react-table-edit", children: [
3582
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "r-grid", ref: gridRef, children: [
3583
+ toolbarSetting?.showTopToolbar ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: renderToolbarTop() }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {}),
3584
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { ref: tableElement, className: "r-gridtable", style: { height: `${height ? `${height}px` : "auto"}`, minHeight: `${minHeight ? `${minHeight}px` : ""}`, maxHeight: `${maxHeight ? `${maxHeight}px` : "400px"}` }, children: /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("table", { style: { width: "100%" }, children: [
3585
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("thead", { className: "r-gridheader", children: headerColumns.map((element, indexParent) => {
3586
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: "r-row", role: "row", children: element?.map((col, index) => {
3587
+ return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3646
3588
  header_default,
3647
3589
  {
3648
3590
  col,
@@ -3662,14 +3604,14 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3662
3604
  );
3663
3605
  }) }, `header-${-indexParent}`);
3664
3606
  }) }),
3665
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("tbody", { className: "r-gridcontent", children: renderData() }),
3666
- /* @__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) => {
3607
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tbody", { className: "r-gridcontent", children: renderData() }),
3608
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tfoot", { className: "r-gridfoot", children: haveSum == true ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("tr", { className: "r-row", children: contentColumns.map((col, index) => {
3667
3609
  return renderFooterCol(col, index);
3668
- }) }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, {}) })
3610
+ }) }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {}) })
3669
3611
  ] }) }),
3670
- toolbarSetting?.showBottomToolbar ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, { children: renderToolbarBottom() }) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, {})
3612
+ toolbarSetting?.showBottomToolbar ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, { children: renderToolbarBottom() }) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {})
3671
3613
  ] }),
3672
- pagingSetting?.allowPaging ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3614
+ pagingSetting?.allowPaging ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3673
3615
  PagingComponent,
3674
3616
  {
3675
3617
  onChangePage,
@@ -3679,9 +3621,9 @@ var TableEdit = (0, import_react16.forwardRef)((props, ref) => {
3679
3621
  totalItem: pagingClient ? totalCount : pagingSetting?.totalItem ?? 0,
3680
3622
  onChangePageSize
3681
3623
  }
3682
- ) : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_jsx_runtime16.Fragment, {})
3624
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {})
3683
3625
  ] }),
3684
- /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3626
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
3685
3627
  sidebar_setting_column_default,
3686
3628
  {
3687
3629
  handleSidebar: () => {
@@ -3698,11 +3640,11 @@ var table_default = TableEdit;
3698
3640
 
3699
3641
  // test-app/src/component/tab-menu/index.tsx
3700
3642
  var import_becoxy_icons7 = require("becoxy-icons");
3701
- var import_classnames15 = __toESM(require("classnames"));
3702
- var import_react17 = require("react");
3643
+ var import_classnames14 = __toESM(require("classnames"));
3644
+ var import_react16 = require("react");
3703
3645
  var import_react_router_dom = require("react-router-dom");
3704
- var import_reactstrap12 = require("reactstrap");
3705
- var import_jsx_runtime17 = require("react/jsx-runtime");
3646
+ var import_reactstrap11 = require("reactstrap");
3647
+ var import_jsx_runtime16 = require("react/jsx-runtime");
3706
3648
  var TabsMenuComponent = ({
3707
3649
  buttonWidth,
3708
3650
  tabParent,
@@ -3714,14 +3656,14 @@ var TabsMenuComponent = ({
3714
3656
  renderModal
3715
3657
  }) => {
3716
3658
  const navigate = (0, import_react_router_dom.useNavigate)();
3717
- const [dataMenu, setDataMenu] = (0, import_react17.useState)([]);
3718
- const [openMenu, setOpenMenu] = (0, import_react17.useState)(false);
3719
- const [url, setUrl] = (0, import_react17.useState)("");
3720
- const [contentWidth, setContentWidth] = (0, import_react17.useState)(0);
3721
- const [componentWidth, setComponentWidth] = (0, import_react17.useState)(0);
3722
- const [scrollPosition, setScrollPosition] = (0, import_react17.useState)(0);
3723
- const [dataItem, setDataItem] = (0, import_react17.useState)([]);
3724
- const [openModal, setOpenModal] = (0, import_react17.useState)({});
3659
+ const [dataMenu, setDataMenu] = (0, import_react16.useState)([]);
3660
+ const [openMenu, setOpenMenu] = (0, import_react16.useState)(false);
3661
+ const [url, setUrl] = (0, import_react16.useState)("");
3662
+ const [contentWidth, setContentWidth] = (0, import_react16.useState)(0);
3663
+ const [componentWidth, setComponentWidth] = (0, import_react16.useState)(0);
3664
+ const [scrollPosition, setScrollPosition] = (0, import_react16.useState)(0);
3665
+ const [dataItem, setDataItem] = (0, import_react16.useState)([]);
3666
+ const [openModal, setOpenModal] = (0, import_react16.useState)({});
3725
3667
  const handleWindowResize = () => {
3726
3668
  const tabEle = document.getElementById(`tab-component-${resourceCode}`);
3727
3669
  const tabContent = document.getElementById(`content-component-${resourceCode}`);
@@ -3730,7 +3672,7 @@ var TabsMenuComponent = ({
3730
3672
  setContentWidth(tabContent?.offsetWidth ?? 0);
3731
3673
  }
3732
3674
  };
3733
- (0, import_react17.useEffect)(() => {
3675
+ (0, import_react16.useEffect)(() => {
3734
3676
  setUrl(window.location.pathname);
3735
3677
  window.addEventListener("resize", handleWindowResize);
3736
3678
  setTimeout(() => {
@@ -3746,7 +3688,7 @@ var TabsMenuComponent = ({
3746
3688
  window.removeEventListener("resize", handleWindowResize);
3747
3689
  };
3748
3690
  }, []);
3749
- (0, import_react17.useEffect)(() => {
3691
+ (0, import_react16.useEffect)(() => {
3750
3692
  const item = resources?.find((x) => x.code === (resourceCodeParent ? resourceCodeParent : resourceCode));
3751
3693
  if (item) {
3752
3694
  if (resourceCodeParent) {
@@ -3777,23 +3719,23 @@ var TabsMenuComponent = ({
3777
3719
  const handleModal = (name) => {
3778
3720
  setOpenModal((old) => ({ ...old, [name]: !(openModal[name] ?? false) }));
3779
3721
  };
3780
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_react17.Fragment, { children: [
3722
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_react16.Fragment, { children: [
3781
3723
  renderModal ? renderModal({ handleModal, windowSize, openModal, setDataItem, dataItem }) : "",
3782
- /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: (0, import_classnames15.default)("tab-custom", { "tab-parent": tabParent }, { "tab-child": tabChild }), style: { width: `calc(100% - ${buttonWidth ?? 100}px` }, children: [
3783
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3724
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: (0, import_classnames14.default)("tab-custom", { "tab-parent": tabParent }, { "tab-child": tabChild }), style: { width: `calc(100% - ${buttonWidth ?? 100}px` }, children: [
3725
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3784
3726
  "div",
3785
3727
  {
3786
3728
  onClick: () => handleScroll(-200),
3787
- className: (0, import_classnames15.default)("btn-scroll", { "d-none": componentWidth >= contentWidth - 20 }),
3788
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_becoxy_icons7.ChevronLeft, {})
3729
+ className: (0, import_classnames14.default)("btn-scroll", { "d-none": componentWidth >= contentWidth - 20 }),
3730
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_becoxy_icons7.ChevronLeft, {})
3789
3731
  }
3790
3732
  ),
3791
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { id: `tab-component-${resourceCode}`, className: "tab-component", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { id: `content-component-${resourceCode}`, children: dataMenu.map((item) => {
3733
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { id: `tab-component-${resourceCode}`, className: "tab-component", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { id: `content-component-${resourceCode}`, children: dataMenu.map((item) => {
3792
3734
  if (item?.resAttributes?.IS_MENU === "1") {
3793
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_reactstrap12.UncontrolledDropdown, { className: "tab-custom-item", isOpen: openMenu, toggle: toggleMenu, direction: "down", style: { backgroundColor: openMenu ? "#e0e0e0" : "" }, children: [
3794
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_reactstrap12.DropdownToggle, { color: "#00000", style: { border: "none", boxShadow: "none", margin: 0, padding: 0 }, className: "background-none", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: item.name }) }),
3795
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_reactstrap12.DropdownMenu, { container: document.body, end: true, style: { width: 300 }, children: item?.children?.map((x) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3796
- import_reactstrap12.DropdownItem,
3735
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_reactstrap11.UncontrolledDropdown, { className: "tab-custom-item", isOpen: openMenu, toggle: toggleMenu, direction: "down", style: { backgroundColor: openMenu ? "#e0e0e0" : "" }, children: [
3736
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.DropdownToggle, { color: "#00000", style: { border: "none", boxShadow: "none", margin: 0, padding: 0 }, className: "background-none", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { children: item.name }) }),
3737
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_reactstrap11.DropdownMenu, { container: document.body, end: true, style: { width: 300 }, children: item?.children?.map((x) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3738
+ import_reactstrap11.DropdownItem,
3797
3739
  {
3798
3740
  style: { borderRadius: "5px", margin: "0 0.5rem", width: "95%" },
3799
3741
  onClick: () => {
@@ -3809,23 +3751,23 @@ var TabsMenuComponent = ({
3809
3751
  )) })
3810
3752
  ] }, item.code);
3811
3753
  } else {
3812
- return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3754
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3813
3755
  import_react_router_dom.Link,
3814
3756
  {
3815
3757
  to: item.url,
3816
- className: (0, import_classnames15.default)("tab-custom-item", { active: item.url === url || tabParent && url?.split("/").length > 3 && item.url.startsWith(url.substring(0, url.lastIndexOf("/"))) }),
3758
+ className: (0, import_classnames14.default)("tab-custom-item", { active: item.url === url || tabParent && url?.split("/").length > 3 && item.url.startsWith(url.substring(0, url.lastIndexOf("/"))) }),
3817
3759
  children: item.name
3818
3760
  },
3819
3761
  item.code
3820
3762
  );
3821
3763
  }
3822
3764
  }) }) }),
3823
- /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
3765
+ /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
3824
3766
  "div",
3825
3767
  {
3826
3768
  onClick: () => handleScroll(200),
3827
- className: (0, import_classnames15.default)("btn-scroll", { "d-none": componentWidth >= contentWidth - 20 }),
3828
- children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_becoxy_icons7.ChevronRight, {})
3769
+ className: (0, import_classnames14.default)("btn-scroll", { "d-none": componentWidth >= contentWidth - 20 }),
3770
+ children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_becoxy_icons7.ChevronRight, {})
3829
3771
  }
3830
3772
  )
3831
3773
  ] })
@@ -3834,9 +3776,9 @@ var TabsMenuComponent = ({
3834
3776
 
3835
3777
  // test-app/src/component/input-style/index.tsx
3836
3778
  var import_becoxy_icons8 = require("becoxy-icons");
3837
- var import_reactstrap13 = require("reactstrap");
3838
- var import_classnames16 = __toESM(require("classnames"));
3839
- var import_react18 = require("react");
3779
+ var import_reactstrap12 = require("reactstrap");
3780
+ var import_classnames15 = __toESM(require("classnames"));
3781
+ var import_react17 = require("react");
3840
3782
 
3841
3783
  // test-app/src/component/input-style/fonts.ts
3842
3784
  var OptionFont = [
@@ -4695,7 +4637,7 @@ var OptionFont = [
4695
4637
  ];
4696
4638
 
4697
4639
  // test-app/src/component/input-style/index.tsx
4698
- var import_jsx_runtime18 = require("react/jsx-runtime");
4640
+ var import_jsx_runtime17 = require("react/jsx-runtime");
4699
4641
  var InputStyleComponent = (props) => {
4700
4642
  const {
4701
4643
  value,
@@ -4709,8 +4651,8 @@ var InputStyleComponent = (props) => {
4709
4651
  disabledItalic,
4710
4652
  disabledUnderline
4711
4653
  } = props;
4712
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react18.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "d-flex align-items-center", children: [
4713
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4654
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_react17.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "d-flex align-items-center", children: [
4655
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4714
4656
  SelectTable,
4715
4657
  {
4716
4658
  options: OptionFont,
@@ -4726,12 +4668,12 @@ var InputStyleComponent = (props) => {
4726
4668
  field: "label",
4727
4669
  headerText: "",
4728
4670
  template: (row) => {
4729
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { style: { fontFamily: row.label }, children: row.label });
4671
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { fontFamily: row.label }, children: row.label });
4730
4672
  }
4731
4673
  }
4732
4674
  ],
4733
4675
  formatOptionLabel: (props2) => {
4734
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { style: {
4676
+ return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { style: {
4735
4677
  paddingLeft: 3,
4736
4678
  borderRadius: 2,
4737
4679
  fontFamily: value.fontFamily,
@@ -4744,7 +4686,7 @@ var InputStyleComponent = (props) => {
4744
4686
  }
4745
4687
  }
4746
4688
  ),
4747
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: (0, import_classnames16.default)("ms-25", { "d-none": disabledFontSize }), style: { width: 60 }, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4689
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: (0, import_classnames15.default)("ms-25", { "d-none": disabledFontSize }), style: { width: 60 }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4748
4690
  SelectTable,
4749
4691
  {
4750
4692
  options: Array.from({ length: 100 }, (_, i) => ({ value: i + 1, label: i + 1 })),
@@ -4756,45 +4698,45 @@ var InputStyleComponent = (props) => {
4756
4698
  }
4757
4699
  }
4758
4700
  ) }),
4759
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4701
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4760
4702
  "div",
4761
4703
  {
4762
- className: (0, import_classnames16.default)("btn-input-style", { "active-custom": value.bold }, { "d-none": disabledBold }),
4704
+ className: (0, import_classnames15.default)("btn-input-style", { "active-custom": value.bold }, { "d-none": disabledBold }),
4763
4705
  onClick: () => {
4764
4706
  if (!disabled) {
4765
4707
  onChange({ ...value, bold: !value.bold });
4766
4708
  }
4767
4709
  },
4768
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_becoxy_icons8.Bold, { fontSize: 18 })
4710
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_becoxy_icons8.Bold, { fontSize: 18 })
4769
4711
  }
4770
4712
  ),
4771
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4713
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4772
4714
  "div",
4773
4715
  {
4774
- className: (0, import_classnames16.default)("btn-input-style", { "active-custom": value.italic }, { "d-none": disabledItalic }),
4716
+ className: (0, import_classnames15.default)("btn-input-style", { "active-custom": value.italic }, { "d-none": disabledItalic }),
4775
4717
  onClick: () => {
4776
4718
  if (!disabled) {
4777
4719
  onChange({ ...value, italic: !value.italic });
4778
4720
  }
4779
4721
  },
4780
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_becoxy_icons8.Italic, { fontSize: 18 })
4722
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_becoxy_icons8.Italic, { fontSize: 18 })
4781
4723
  }
4782
4724
  ),
4783
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4725
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4784
4726
  "div",
4785
4727
  {
4786
- className: (0, import_classnames16.default)("btn-input-style", { "active-custom": value.underline }, { "d-none": disabledUnderline }),
4728
+ className: (0, import_classnames15.default)("btn-input-style", { "active-custom": value.underline }, { "d-none": disabledUnderline }),
4787
4729
  onClick: () => {
4788
4730
  if (!disabled) {
4789
4731
  onChange({ ...value, underline: !value.underline });
4790
4732
  }
4791
4733
  },
4792
- children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_becoxy_icons8.Underline, { fontSize: 18 })
4734
+ children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_becoxy_icons8.Underline, { fontSize: 18 })
4793
4735
  }
4794
4736
  ),
4795
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_reactstrap13.Button, { tag: "label", color: "none", className: (0, import_classnames16.default)("btn-input-style", { "d-none": disabledColor }), children: [
4796
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_becoxy_icons8.Type, { stroke: value.color ?? "#000000", fontSize: 18 }),
4797
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4737
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_reactstrap12.Button, { tag: "label", color: "none", className: (0, import_classnames15.default)("btn-input-style", { "d-none": disabledColor }), children: [
4738
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_becoxy_icons8.Type, { stroke: value.color ?? "#000000", fontSize: 18 }),
4739
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4798
4740
  "input",
4799
4741
  {
4800
4742
  type: "color",
@@ -4808,10 +4750,10 @@ var InputStyleComponent = (props) => {
4808
4750
  }
4809
4751
  )
4810
4752
  ] }),
4811
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_reactstrap13.Button, { tag: "label", color: "none", className: (0, import_classnames16.default)("btn-input-style", { "d-none": disabledBackgroundColor }), children: [
4812
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_becoxy_icons8.Droplet, { fill: value.backgroundColor ?? "#ffffff", fontSize: 18 }),
4813
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
4814
- import_reactstrap13.Input,
4753
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_reactstrap12.Button, { tag: "label", color: "none", className: (0, import_classnames15.default)("btn-input-style", { "d-none": disabledBackgroundColor }), children: [
4754
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_becoxy_icons8.Droplet, { fill: value.backgroundColor ?? "#ffffff", fontSize: 18 }),
4755
+ /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
4756
+ import_reactstrap12.Input,
4815
4757
  {
4816
4758
  id: "backgroundColor",
4817
4759
  type: "color",