@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/index.mjs CHANGED
@@ -33910,164 +33910,173 @@ var Many2ManyField = (props) => {
33910
33910
  return createPortal5(
33911
33911
  /* @__PURE__ */ jsxs71("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
33912
33912
  /* @__PURE__ */ jsx102("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
33913
- /* @__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: [
33914
- /* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
33915
- /* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
33916
- /* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
33917
- ] }),
33918
- /* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33919
- /* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
33920
- Search,
33921
- {
33922
- removeSearchItems,
33923
- selectedTags,
33924
- filterBy,
33925
- setFilterBy,
33926
- searchString,
33927
- onSearchString,
33928
- handleAddTagSearch,
33929
- searchBy,
33930
- groupBy,
33931
- showFiltersGroups: true,
33932
- setGroupBy,
33933
- setDomainList: setDomain,
33934
- setPage: (pages) => {
33935
- setPage?.(pages);
33936
- },
33937
- fieldsList: [
33938
- ...columns?.filter(
33939
- (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
33940
- )?.map((col) => ({ ...col.field })) ?? []
33941
- ],
33942
- setSelectedRowKeys,
33943
- viewData,
33944
- context,
33945
- selectedRowKeys,
33946
- aid,
33947
- domainSearch,
33948
- evalJSONContext,
33949
- clearSearch
33950
- }
33951
- ) }),
33952
- /* @__PURE__ */ jsx102(
33953
- PaginationView,
33954
- {
33955
- className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
33956
- currentPage: page,
33957
- totalCount: totalRows ?? 0,
33958
- pageSize: 10,
33959
- onPageChange: (page2) => {
33960
- if (typeof setPage === "function") {
33961
- setPage(page2);
33913
+ /* @__PURE__ */ jsx102("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ jsxs71(
33914
+ "div",
33915
+ {
33916
+ style: {
33917
+ zIndex: 1
33918
+ },
33919
+ 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",
33920
+ children: [
33921
+ /* @__PURE__ */ jsxs71("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
33922
+ /* @__PURE__ */ jsx102("div", { className: "text-[20px] font-semibold", children: title }),
33923
+ /* @__PURE__ */ jsx102("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ jsx102(CloseIcon, {}) })
33924
+ ] }),
33925
+ /* @__PURE__ */ jsxs71("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
33926
+ /* @__PURE__ */ jsx102("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ jsx102(
33927
+ Search,
33928
+ {
33929
+ removeSearchItems,
33930
+ selectedTags,
33931
+ filterBy,
33932
+ setFilterBy,
33933
+ searchString,
33934
+ onSearchString,
33935
+ handleAddTagSearch,
33936
+ searchBy,
33937
+ groupBy,
33938
+ showFiltersGroups: true,
33939
+ setGroupBy,
33940
+ setDomainList: setDomain,
33941
+ setPage: (pages) => {
33942
+ setPage?.(pages);
33943
+ },
33944
+ fieldsList: [
33945
+ ...columns?.filter(
33946
+ (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
33947
+ )?.map((col) => ({ ...col.field })) ?? []
33948
+ ],
33949
+ setSelectedRowKeys,
33950
+ viewData,
33951
+ context,
33952
+ selectedRowKeys,
33953
+ aid,
33954
+ domainSearch,
33955
+ evalJSONContext,
33956
+ clearSearch
33962
33957
  }
33963
- },
33964
- displayPageNumberDots: false,
33965
- displayRowsNumberOption: false
33966
- }
33967
- )
33968
- ] }),
33969
- !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ jsx102("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx102("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx102(
33970
- "div",
33971
- {
33972
- className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33973
- 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(
33958
+ ) }),
33959
+ /* @__PURE__ */ jsx102(
33960
+ PaginationView,
33961
+ {
33962
+ className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
33963
+ currentPage: page,
33964
+ totalCount: totalRows ?? 0,
33965
+ pageSize: 10,
33966
+ onPageChange: (page2) => {
33967
+ if (typeof setPage === "function") {
33968
+ setPage(page2);
33969
+ }
33970
+ },
33971
+ displayPageNumberDots: false,
33972
+ displayRowsNumberOption: false
33973
+ }
33974
+ )
33975
+ ] }),
33976
+ !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ jsx102("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ jsx102("div", { className: "relative h-full w-full", children: /* @__PURE__ */ jsx102(
33974
33977
  "div",
33975
33978
  {
33976
- className: `flex w-full items-center h-full overflow-auto `,
33977
- children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
33978
- "table",
33979
+ className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
33980
+ 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(
33981
+ "div",
33979
33982
  {
33980
- className: `relative w-full bg-white custom-dropdown `,
33981
- children: [
33982
- /* @__PURE__ */ jsx102(
33983
- TableHead,
33984
- {
33985
- columns,
33986
- onToggleColumnOptional,
33987
- isDisplayCheckbox,
33988
- checkedAll,
33989
- handleCheckBoxAll
33990
- }
33991
- ),
33992
- /* @__PURE__ */ jsx102(
33993
- TableBody,
33994
- {
33995
- columns,
33996
- rows,
33997
- rootField,
33998
- isDisplayCheckbox,
33999
- model: relation,
34000
- renderField: ({
34001
- row,
34002
- col,
34003
- indexRow,
34004
- onChangeData,
34005
- rootField: rootField2
34006
- }) => {
34007
- if (typeof renderField === "function") {
34008
- return renderField({
33983
+ className: `flex w-full items-center h-full overflow-auto `,
33984
+ children: /* @__PURE__ */ jsx102("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ jsxs71(
33985
+ "table",
33986
+ {
33987
+ className: `relative w-full bg-white custom-dropdown `,
33988
+ children: [
33989
+ /* @__PURE__ */ jsx102(
33990
+ TableHead,
33991
+ {
33992
+ columns,
33993
+ onToggleColumnOptional,
33994
+ isDisplayCheckbox,
33995
+ checkedAll,
33996
+ handleCheckBoxAll
33997
+ }
33998
+ ),
33999
+ /* @__PURE__ */ jsx102(
34000
+ TableBody,
34001
+ {
34002
+ columns,
34003
+ rows,
34004
+ rootField,
34005
+ isDisplayCheckbox,
34006
+ model: relation,
34007
+ renderField: ({
34009
34008
  row,
34010
34009
  col,
34011
34010
  indexRow,
34012
34011
  onChangeData,
34013
34012
  rootField: rootField2
34014
- });
34013
+ }) => {
34014
+ if (typeof renderField === "function") {
34015
+ return renderField({
34016
+ row,
34017
+ col,
34018
+ indexRow,
34019
+ onChangeData,
34020
+ rootField: rootField2
34021
+ });
34022
+ }
34023
+ },
34024
+ onRemoveRow: null,
34025
+ onAddRow,
34026
+ onClickRow,
34027
+ typeTable,
34028
+ selectedRowKeysRef,
34029
+ selectedRowKeys,
34030
+ setSelectedRowKeys
34015
34031
  }
34016
- },
34017
- onRemoveRow: null,
34018
- onAddRow,
34019
- onClickRow,
34020
- typeTable,
34021
- selectedRowKeysRef,
34022
- selectedRowKeys,
34023
- setSelectedRowKeys
34024
- }
34025
- )
34026
- ]
34032
+ )
34033
+ ]
34034
+ }
34035
+ ) })
34027
34036
  }
34028
- ) })
34037
+ ) }) })
34029
34038
  }
34030
- ) }) })
34031
- }
34032
- ) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
34033
- /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
34034
- isDisplayCheckbox && /* @__PURE__ */ jsx102(
34035
- "button",
34036
- {
34037
- disabled: selectedRowKeys?.length === 0,
34038
- type: "button",
34039
- onClick: () => onChoose(selectedRowKeys),
34040
- className: "button-primary",
34041
- children: instance.t("choose")
34042
- }
34043
- ),
34044
- optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
34045
- "button",
34046
- {
34047
- type: "button",
34048
- onClick: () => {
34049
- if (typeof onAddNew === "function") {
34050
- onAddNew();
34051
- onClose();
34052
- } else {
34053
- handleCreateNewOnPage();
34039
+ ) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
34040
+ /* @__PURE__ */ jsxs71("div", { className: "flex items-center gap-2 mt-auto", children: [
34041
+ isDisplayCheckbox && /* @__PURE__ */ jsx102(
34042
+ "button",
34043
+ {
34044
+ disabled: selectedRowKeys?.length === 0,
34045
+ type: "button",
34046
+ onClick: () => onChoose(selectedRowKeys),
34047
+ className: "button-primary",
34048
+ children: instance.t("choose")
34054
34049
  }
34055
- },
34056
- className: "button-primary",
34057
- children: instance.t("new")
34058
- }
34059
- ),
34060
- /* @__PURE__ */ jsx102(
34061
- "button",
34062
- {
34063
- type: "button",
34064
- onClick: onClose,
34065
- className: "button-secondary",
34066
- children: instance.t("cancel_button")
34067
- }
34068
- )
34069
- ] })
34070
- ] }) })
34050
+ ),
34051
+ optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ jsx102(
34052
+ "button",
34053
+ {
34054
+ type: "button",
34055
+ onClick: () => {
34056
+ if (typeof onAddNew === "function") {
34057
+ onAddNew();
34058
+ onClose();
34059
+ } else {
34060
+ handleCreateNewOnPage();
34061
+ }
34062
+ },
34063
+ className: "button-primary",
34064
+ children: instance.t("new")
34065
+ }
34066
+ ),
34067
+ /* @__PURE__ */ jsx102(
34068
+ "button",
34069
+ {
34070
+ type: "button",
34071
+ onClick: onClose,
34072
+ className: "button-secondary",
34073
+ children: instance.t("cancel_button")
34074
+ }
34075
+ )
34076
+ ] })
34077
+ ]
34078
+ }
34079
+ ) })
34071
34080
  ] }),
34072
34081
  document.body
34073
34082
  );