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