@fctc/sme-widget-ui 1.1.1 → 1.1.2

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/widgets.mjs CHANGED
@@ -33612,164 +33612,173 @@ var Many2ManyField = (props) => {
33612
33612
  return createPortal5(
33613
33613
  /* @__PURE__ */ jsxs71("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
33614
33614
  /* @__PURE__ */ jsx102("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
33615
- /* @__PURE__ */ jsx102("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxs71("div", { className: "relative z-[1] p-4 flex flex-col gap-2 max-w-full lg:max-w-[1000px] lg:min-w-[1000px] transform rounded-3xl bg-[#FFF] min-h-[90%] max-h-[90%] h-fit", children: [
33616
- /* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
33617
- /* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
33618
- /* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
33619
- ] }),
33620
- /* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33621
- /* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
33622
- Search,
33623
- {
33624
- removeSearchItems,
33625
- selectedTags,
33626
- filterBy,
33627
- setFilterBy,
33628
- searchString,
33629
- onSearchString,
33630
- handleAddTagSearch,
33631
- searchBy,
33632
- groupBy,
33633
- showFiltersGroups: true,
33634
- setGroupBy,
33635
- setDomainList: setDomain,
33636
- setPage: (pages) => {
33637
- setPage?.(pages);
33638
- },
33639
- fieldsList: [
33640
- ...columns?.filter(
33641
- (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
33642
- )?.map((col) => ({ ...col.field })) ?? []
33643
- ],
33644
- setSelectedRowKeys,
33645
- viewData,
33646
- context,
33647
- selectedRowKeys,
33648
- aid,
33649
- domainSearch,
33650
- evalJSONContext,
33651
- clearSearch
33652
- }
33653
- ) }),
33654
- /* @__PURE__ */ jsx102(
33655
- PaginationView,
33656
- {
33657
- className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
33658
- currentPage: page,
33659
- totalCount: totalRows ?? 0,
33660
- pageSize: 10,
33661
- onPageChange: (page2) => {
33662
- if (typeof setPage === "function") {
33663
- setPage(page2);
33615
+ /* @__PURE__ */ jsx102("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxs71(
33616
+ "div",
33617
+ {
33618
+ style: {
33619
+ zIndex: 1
33620
+ },
33621
+ className: "relative p-4 flex flex-col gap-2 max-w-full lg:max-w-[1000px] lg:min-w-[1000px] transform rounded-3xl bg-[#FFF] min-h-[90%] max-h-[90%] h-fit",
33622
+ children: [
33623
+ /* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
33624
+ /* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
33625
+ /* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
33626
+ ] }),
33627
+ /* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33628
+ /* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
33629
+ Search,
33630
+ {
33631
+ removeSearchItems,
33632
+ selectedTags,
33633
+ filterBy,
33634
+ setFilterBy,
33635
+ searchString,
33636
+ onSearchString,
33637
+ handleAddTagSearch,
33638
+ searchBy,
33639
+ groupBy,
33640
+ showFiltersGroups: true,
33641
+ setGroupBy,
33642
+ setDomainList: setDomain,
33643
+ setPage: (pages) => {
33644
+ setPage?.(pages);
33645
+ },
33646
+ fieldsList: [
33647
+ ...columns?.filter(
33648
+ (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
33649
+ )?.map((col) => ({ ...col.field })) ?? []
33650
+ ],
33651
+ setSelectedRowKeys,
33652
+ viewData,
33653
+ context,
33654
+ selectedRowKeys,
33655
+ aid,
33656
+ domainSearch,
33657
+ evalJSONContext,
33658
+ clearSearch
33664
33659
  }
33665
- },
33666
- displayPageNumberDots: false,
33667
- displayRowsNumberOption: false
33668
- }
33669
- )
33670
- ] }),
33671
- !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ jsx102("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx102("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx102(
33672
- "div",
33673
- {
33674
- className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33675
- children: /* @__PURE__ */ jsx102("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ jsx102("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ jsx102(
33660
+ ) }),
33661
+ /* @__PURE__ */ jsx102(
33662
+ PaginationView,
33663
+ {
33664
+ className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
33665
+ currentPage: page,
33666
+ totalCount: totalRows ?? 0,
33667
+ pageSize: 10,
33668
+ onPageChange: (page2) => {
33669
+ if (typeof setPage === "function") {
33670
+ setPage(page2);
33671
+ }
33672
+ },
33673
+ displayPageNumberDots: false,
33674
+ displayRowsNumberOption: false
33675
+ }
33676
+ )
33677
+ ] }),
33678
+ !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ jsx102("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx102("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx102(
33676
33679
  "div",
33677
33680
  {
33678
- className: `flex w-full items-center h-full overflow-auto `,
33679
- children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
33680
- "table",
33681
+ className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33682
+ children: /* @__PURE__ */ jsx102("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ jsx102("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ jsx102(
33683
+ "div",
33681
33684
  {
33682
- className: `relative w-full bg-white custom-dropdown `,
33683
- children: [
33684
- /* @__PURE__ */ jsx102(
33685
- TableHead,
33686
- {
33687
- columns,
33688
- onToggleColumnOptional,
33689
- isDisplayCheckbox,
33690
- checkedAll,
33691
- handleCheckBoxAll
33692
- }
33693
- ),
33694
- /* @__PURE__ */ jsx102(
33695
- TableBody,
33696
- {
33697
- columns,
33698
- rows,
33699
- rootField,
33700
- isDisplayCheckbox,
33701
- model: relation,
33702
- renderField: ({
33703
- row,
33704
- col,
33705
- indexRow,
33706
- onChangeData,
33707
- rootField: rootField2
33708
- }) => {
33709
- if (typeof renderField === "function") {
33710
- return renderField({
33685
+ className: `flex w-full items-center h-full overflow-auto `,
33686
+ children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
33687
+ "table",
33688
+ {
33689
+ className: `relative w-full bg-white custom-dropdown `,
33690
+ children: [
33691
+ /* @__PURE__ */ jsx102(
33692
+ TableHead,
33693
+ {
33694
+ columns,
33695
+ onToggleColumnOptional,
33696
+ isDisplayCheckbox,
33697
+ checkedAll,
33698
+ handleCheckBoxAll
33699
+ }
33700
+ ),
33701
+ /* @__PURE__ */ jsx102(
33702
+ TableBody,
33703
+ {
33704
+ columns,
33705
+ rows,
33706
+ rootField,
33707
+ isDisplayCheckbox,
33708
+ model: relation,
33709
+ renderField: ({
33711
33710
  row,
33712
33711
  col,
33713
33712
  indexRow,
33714
33713
  onChangeData,
33715
33714
  rootField: rootField2
33716
- });
33715
+ }) => {
33716
+ if (typeof renderField === "function") {
33717
+ return renderField({
33718
+ row,
33719
+ col,
33720
+ indexRow,
33721
+ onChangeData,
33722
+ rootField: rootField2
33723
+ });
33724
+ }
33725
+ },
33726
+ onRemoveRow: null,
33727
+ onAddRow,
33728
+ onClickRow,
33729
+ typeTable,
33730
+ selectedRowKeysRef,
33731
+ selectedRowKeys,
33732
+ setSelectedRowKeys
33717
33733
  }
33718
- },
33719
- onRemoveRow: null,
33720
- onAddRow,
33721
- onClickRow,
33722
- typeTable,
33723
- selectedRowKeysRef,
33724
- selectedRowKeys,
33725
- setSelectedRowKeys
33726
- }
33727
- )
33728
- ]
33734
+ )
33735
+ ]
33736
+ }
33737
+ ) })
33729
33738
  }
33730
- ) })
33739
+ ) }) })
33731
33740
  }
33732
- ) }) })
33733
- }
33734
- ) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
33735
- /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
33736
- isDisplayCheckbox && /* @__PURE__ */ jsx102(
33737
- "button",
33738
- {
33739
- disabled: selectedRowKeys?.length === 0,
33740
- type: "button",
33741
- onClick: () => onChoose(selectedRowKeys),
33742
- className: "button-primary",
33743
- children: instance.t("choose")
33744
- }
33745
- ),
33746
- optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
33747
- "button",
33748
- {
33749
- type: "button",
33750
- onClick: () => {
33751
- if (typeof onAddNew === "function") {
33752
- onAddNew();
33753
- onClose();
33754
- } else {
33755
- handleCreateNewOnPage();
33741
+ ) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
33742
+ /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
33743
+ isDisplayCheckbox && /* @__PURE__ */ jsx102(
33744
+ "button",
33745
+ {
33746
+ disabled: selectedRowKeys?.length === 0,
33747
+ type: "button",
33748
+ onClick: () => onChoose(selectedRowKeys),
33749
+ className: "button-primary",
33750
+ children: instance.t("choose")
33756
33751
  }
33757
- },
33758
- className: "button-primary",
33759
- children: instance.t("new")
33760
- }
33761
- ),
33762
- /* @__PURE__ */ jsx102(
33763
- "button",
33764
- {
33765
- type: "button",
33766
- onClick: onClose,
33767
- className: "button-secondary",
33768
- children: instance.t("cancel_button")
33769
- }
33770
- )
33771
- ] })
33772
- ] }) })
33752
+ ),
33753
+ optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
33754
+ "button",
33755
+ {
33756
+ type: "button",
33757
+ onClick: () => {
33758
+ if (typeof onAddNew === "function") {
33759
+ onAddNew();
33760
+ onClose();
33761
+ } else {
33762
+ handleCreateNewOnPage();
33763
+ }
33764
+ },
33765
+ className: "button-primary",
33766
+ children: instance.t("new")
33767
+ }
33768
+ ),
33769
+ /* @__PURE__ */ jsx102(
33770
+ "button",
33771
+ {
33772
+ type: "button",
33773
+ onClick: onClose,
33774
+ className: "button-secondary",
33775
+ children: instance.t("cancel_button")
33776
+ }
33777
+ )
33778
+ ] })
33779
+ ]
33780
+ }
33781
+ ) })
33773
33782
  ] }),
33774
33783
  document.body
33775
33784
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/sme-widget-ui",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",