@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.js CHANGED
@@ -34029,164 +34029,173 @@ var Many2ManyField = (props) => {
34029
34029
  return (0, import_react_dom8.createPortal)(
34030
34030
  /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
34031
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,
34073
- {
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);
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
34081
34076
  }
34082
- },
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)(
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);
34088
+ }
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)(
34093
34096
  "div",
34094
34097
  {
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
+ 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)(
34100
+ "div",
34098
34101
  {
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({
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
+ {
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: ({
34128
34127
  row,
34129
34128
  col,
34130
34129
  indexRow,
34131
34130
  onChangeData,
34132
34131
  rootField: rootField2
34133
- });
34132
+ }) => {
34133
+ if (typeof renderField === "function") {
34134
+ return renderField({
34135
+ row,
34136
+ col,
34137
+ indexRow,
34138
+ onChangeData,
34139
+ rootField: rootField2
34140
+ });
34141
+ }
34142
+ },
34143
+ onRemoveRow: null,
34144
+ onAddRow,
34145
+ onClickRow,
34146
+ typeTable,
34147
+ selectedRowKeysRef,
34148
+ selectedRowKeys,
34149
+ setSelectedRowKeys
34134
34150
  }
34135
- },
34136
- onRemoveRow: null,
34137
- onAddRow,
34138
- onClickRow,
34139
- typeTable,
34140
- selectedRowKeysRef,
34141
- selectedRowKeys,
34142
- setSelectedRowKeys
34143
- }
34144
- )
34145
- ]
34151
+ )
34152
+ ]
34153
+ }
34154
+ ) })
34146
34155
  }
34147
- ) })
34156
+ ) }) })
34148
34157
  }
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();
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")
34173
34168
  }
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")
34186
- }
34187
- )
34188
- ] })
34189
- ] }) })
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();
34180
+ }
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
+ ) })
34190
34199
  ] }),
34191
34200
  document.body
34192
34201
  );