@fctc/sme-widget-ui 1.1.1 → 1.1.3

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
@@ -34027,167 +34027,185 @@ var Many2ManyField = (props) => {
34027
34027
  clearSearch
34028
34028
  } = searchController;
34029
34029
  return (0, import_react_dom8.createPortal)(
34030
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
34031
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
34032
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("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: [
34033
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
34034
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
34035
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CloseIcon, {}) })
34036
- ] }),
34037
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
34038
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34039
- Search,
34040
- {
34041
- removeSearchItems,
34042
- selectedTags,
34043
- filterBy,
34044
- setFilterBy,
34045
- searchString,
34046
- onSearchString,
34047
- handleAddTagSearch,
34048
- searchBy,
34049
- groupBy,
34050
- showFiltersGroups: true,
34051
- setGroupBy,
34052
- setDomainList: setDomain,
34053
- setPage: (pages) => {
34054
- setPage?.(pages);
34055
- },
34056
- fieldsList: [
34057
- ...columns?.filter(
34058
- (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
34059
- )?.map((col) => ({ ...col.field })) ?? []
34060
- ],
34061
- setSelectedRowKeys,
34062
- viewData,
34063
- context,
34064
- selectedRowKeys,
34065
- aid,
34066
- domainSearch,
34067
- evalJSONContext,
34068
- clearSearch
34069
- }
34070
- ) }),
34071
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34072
- PaginationView,
34030
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
34031
+ "div",
34032
+ {
34033
+ style: {
34034
+ zIndex: 99999
34035
+ },
34036
+ className: "fixed bottom-0 left-0 right-0 top-0",
34037
+ children: [
34038
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
34039
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 overflow-auto px-6 flex justify-center items-center", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
34040
+ "div",
34073
34041
  {
34074
- className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
34075
- currentPage: page,
34076
- totalCount: totalRows ?? 0,
34077
- pageSize: 10,
34078
- onPageChange: (page2) => {
34079
- if (typeof setPage === "function") {
34080
- setPage(page2);
34081
- }
34042
+ style: {
34043
+ zIndex: 1
34082
34044
  },
34083
- displayPageNumberDots: false,
34084
- displayRowsNumberOption: false
34085
- }
34086
- )
34087
- ] }),
34088
- !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34089
- "div",
34090
- {
34091
- className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
34092
- children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34093
- "div",
34094
- {
34095
- className: `flex w-full items-center h-full overflow-auto `,
34096
- children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
34097
- "table",
34098
- {
34099
- className: `relative w-full bg-white custom-dropdown `,
34100
- children: [
34101
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34102
- TableHead,
34103
- {
34104
- columns,
34105
- onToggleColumnOptional,
34106
- isDisplayCheckbox,
34107
- checkedAll,
34108
- handleCheckBoxAll
34109
- }
34110
- ),
34111
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34112
- TableBody,
34113
- {
34114
- columns,
34115
- rows,
34116
- rootField,
34117
- isDisplayCheckbox,
34118
- model: relation,
34119
- renderField: ({
34120
- row,
34121
- col,
34122
- indexRow,
34123
- onChangeData,
34124
- rootField: rootField2
34125
- }) => {
34126
- if (typeof renderField === "function") {
34127
- return renderField({
34128
- row,
34129
- col,
34130
- indexRow,
34131
- onChangeData,
34132
- rootField: rootField2
34133
- });
34134
- }
34135
- },
34136
- onRemoveRow: null,
34137
- onAddRow,
34138
- onClickRow,
34139
- typeTable,
34140
- selectedRowKeysRef,
34141
- selectedRowKeys,
34142
- setSelectedRowKeys
34045
+ 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",
34046
+ children: [
34047
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex justify-between items-center border-b border-[rgba(0,0,0,0.1)] pb-2", children: [
34048
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
34049
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CloseIcon, {}) })
34050
+ ] }),
34051
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
34052
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34053
+ Search,
34054
+ {
34055
+ removeSearchItems,
34056
+ selectedTags,
34057
+ filterBy,
34058
+ setFilterBy,
34059
+ searchString,
34060
+ onSearchString,
34061
+ handleAddTagSearch,
34062
+ searchBy,
34063
+ groupBy,
34064
+ showFiltersGroups: true,
34065
+ setGroupBy,
34066
+ setDomainList: setDomain,
34067
+ setPage: (pages) => {
34068
+ setPage?.(pages);
34069
+ },
34070
+ fieldsList: [
34071
+ ...columns?.filter(
34072
+ (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
34073
+ )?.map((col) => ({ ...col.field })) ?? []
34074
+ ],
34075
+ setSelectedRowKeys,
34076
+ viewData,
34077
+ context,
34078
+ selectedRowKeys,
34079
+ aid,
34080
+ domainSearch,
34081
+ evalJSONContext,
34082
+ clearSearch
34083
+ }
34084
+ ) }),
34085
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34086
+ PaginationView,
34087
+ {
34088
+ className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
34089
+ currentPage: page,
34090
+ totalCount: totalRows ?? 0,
34091
+ pageSize: 10,
34092
+ onPageChange: (page2) => {
34093
+ if (typeof setPage === "function") {
34094
+ setPage(page2);
34143
34095
  }
34144
- )
34145
- ]
34096
+ },
34097
+ displayPageNumberDots: false,
34098
+ displayRowsNumberOption: false
34099
+ }
34100
+ )
34101
+ ] }),
34102
+ !isDataLoading && isDataFetched || isPlaceholderData ? /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative overflow-y-auto", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "relative h-full w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34103
+ "div",
34104
+ {
34105
+ className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
34106
+ children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "flex flex-col gap-[16px] w-full h-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: `relative w-full h-full`, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34107
+ "div",
34108
+ {
34109
+ className: `flex w-full items-center h-full overflow-auto `,
34110
+ children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
34111
+ "table",
34112
+ {
34113
+ className: `relative w-full bg-white custom-dropdown `,
34114
+ children: [
34115
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34116
+ TableHead,
34117
+ {
34118
+ columns,
34119
+ onToggleColumnOptional,
34120
+ isDisplayCheckbox,
34121
+ checkedAll,
34122
+ handleCheckBoxAll
34123
+ }
34124
+ ),
34125
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34126
+ TableBody,
34127
+ {
34128
+ columns,
34129
+ rows,
34130
+ rootField,
34131
+ isDisplayCheckbox,
34132
+ model: relation,
34133
+ renderField: ({
34134
+ row,
34135
+ col,
34136
+ indexRow,
34137
+ onChangeData,
34138
+ rootField: rootField2
34139
+ }) => {
34140
+ if (typeof renderField === "function") {
34141
+ return renderField({
34142
+ row,
34143
+ col,
34144
+ indexRow,
34145
+ onChangeData,
34146
+ rootField: rootField2
34147
+ });
34148
+ }
34149
+ },
34150
+ onRemoveRow: null,
34151
+ onAddRow,
34152
+ onClickRow,
34153
+ typeTable,
34154
+ selectedRowKeysRef,
34155
+ selectedRowKeys,
34156
+ setSelectedRowKeys
34157
+ }
34158
+ )
34159
+ ]
34160
+ }
34161
+ ) })
34162
+ }
34163
+ ) }) })
34146
34164
  }
34147
- ) })
34148
- }
34149
- ) }) })
34150
- }
34151
- ) }) }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(LayerLoading, {}),
34152
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
34153
- isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34154
- "button",
34155
- {
34156
- disabled: selectedRowKeys?.length === 0,
34157
- type: "button",
34158
- onClick: () => onChoose(selectedRowKeys),
34159
- className: "button-primary",
34160
- children: instance.t("choose")
34161
- }
34162
- ),
34163
- optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34164
- "button",
34165
- {
34166
- type: "button",
34167
- onClick: () => {
34168
- if (typeof onAddNew === "function") {
34169
- onAddNew();
34170
- onClose();
34171
- } else {
34172
- handleCreateNewOnPage();
34173
- }
34174
- },
34175
- className: "button-primary",
34176
- children: instance.t("new")
34177
- }
34178
- ),
34179
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34180
- "button",
34181
- {
34182
- type: "button",
34183
- onClick: onClose,
34184
- className: "button-secondary",
34185
- children: instance.t("cancel_button")
34165
+ ) }) }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(LayerLoading, {}),
34166
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
34167
+ isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34168
+ "button",
34169
+ {
34170
+ disabled: selectedRowKeys?.length === 0,
34171
+ type: "button",
34172
+ onClick: () => onChoose(selectedRowKeys),
34173
+ className: "button-primary",
34174
+ children: instance.t("choose")
34175
+ }
34176
+ ),
34177
+ optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34178
+ "button",
34179
+ {
34180
+ type: "button",
34181
+ onClick: () => {
34182
+ if (typeof onAddNew === "function") {
34183
+ onAddNew();
34184
+ onClose();
34185
+ } else {
34186
+ handleCreateNewOnPage();
34187
+ }
34188
+ },
34189
+ className: "button-primary",
34190
+ children: instance.t("new")
34191
+ }
34192
+ ),
34193
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34194
+ "button",
34195
+ {
34196
+ type: "button",
34197
+ onClick: onClose,
34198
+ className: "button-secondary",
34199
+ children: instance.t("cancel_button")
34200
+ }
34201
+ )
34202
+ ] })
34203
+ ]
34186
34204
  }
34187
- )
34188
- ] })
34189
- ] }) })
34190
- ] }),
34205
+ ) })
34206
+ ]
34207
+ }
34208
+ ),
34191
34209
  document.body
34192
34210
  );
34193
34211
  };