@fctc/sme-widget-ui 1.1.0 → 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
@@ -12692,8 +12692,14 @@ var TableHead = (props) => {
12692
12692
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
12693
12693
  "tr",
12694
12694
  {
12695
- style: { userSelect: "none", WebkitUserSelect: "none" },
12696
- className: "border-b-[1.5px] border-[rgba(66,66,66,0.12)] sticky top-0 bg-white z-[1]",
12695
+ style: {
12696
+ userSelect: "none",
12697
+ WebkitUserSelect: "none",
12698
+ zIndex: 1,
12699
+ position: "sticky",
12700
+ top: 0
12701
+ },
12702
+ className: "border-b border-[rgba(66,66,66,0.12)] bg-white",
12697
12703
  children: [
12698
12704
  isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12699
12705
  "th",
@@ -12714,7 +12720,7 @@ var TableHead = (props) => {
12714
12720
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12715
12721
  "th",
12716
12722
  {
12717
- className: `column whitespace-nowrap text-left p-3 text-sm font-medium capitalize text-[#121212]`,
12723
+ className: `column whitespace-nowrap text-left p-3 text-sm font-semibold capitalize text-[#060606]`,
12718
12724
  children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "cursor-pointer flex justify-between items-center gap-[4px] w-full min-w-max group", children: col.title })
12719
12725
  },
12720
12726
  "table-head-" + index4
@@ -15230,7 +15236,7 @@ var Search = ({
15230
15236
  "input",
15231
15237
  {
15232
15238
  value: searchString,
15233
- className: "min-h-[25px] w-fit flex-1 border-none bg-transparent outline-none min-w-[50px] text-sm",
15239
+ className: "min-h-[44px] w-fit flex-1 border-none bg-transparent outline-none min-w-[50px] text-sm",
15234
15240
  placeholder: instance.t("search..."),
15235
15241
  onChange: (e3) => {
15236
15242
  onSearchString(e3.target.value);
@@ -18174,7 +18180,7 @@ var CharField = (props) => {
18174
18180
  disabled: readonly,
18175
18181
  placeholder,
18176
18182
  required: !invisible && required,
18177
- className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-white border border-[rgba(66,66,66,0.12)] rounded-lg p-3 text-sm font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content
18183
+ className: `w-full min-h-[44px] ring-0 focus:ring-0 focus:!outline-none focus:border-[1px] focus:border-primary outline-0 bg-white border !border-[rgba(66,66,66,0.12)] rounded-lg py-2 px-3 text-sm font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content
18178
18184
  ${readonly ? "!cursor-not-allowed border-transparent text-[#5c5a5a]" : "!cursor-pointer text-[#AEAEAE]"}
18179
18185
  `
18180
18186
  }
@@ -34023,164 +34029,173 @@ var Many2ManyField = (props) => {
34023
34029
  return (0, import_react_dom8.createPortal)(
34024
34030
  /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
34025
34031
  /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "absolute inset-0 bg-[rgba(27,27,27,0.48)]" }),
34026
- /* @__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: [
34027
- /* @__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: [
34028
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "text-[20px] font-semibold", children: title }),
34029
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("button", { className: "cursor-pointer", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(CloseIcon, {}) })
34030
- ] }),
34031
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "grid grid-cols-3 gap-2 items-center py-2", children: [
34032
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "col-span-3 sm:col-span-2 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34033
- Search,
34034
- {
34035
- removeSearchItems,
34036
- selectedTags,
34037
- filterBy,
34038
- setFilterBy,
34039
- searchString,
34040
- onSearchString,
34041
- handleAddTagSearch,
34042
- searchBy,
34043
- groupBy,
34044
- showFiltersGroups: true,
34045
- setGroupBy,
34046
- setDomainList: setDomain,
34047
- setPage: (pages) => {
34048
- setPage?.(pages);
34049
- },
34050
- fieldsList: [
34051
- ...columns?.filter(
34052
- (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
34053
- )?.map((col) => ({ ...col.field })) ?? []
34054
- ],
34055
- setSelectedRowKeys,
34056
- viewData,
34057
- context,
34058
- selectedRowKeys,
34059
- aid,
34060
- domainSearch,
34061
- evalJSONContext,
34062
- clearSearch
34063
- }
34064
- ) }),
34065
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34066
- PaginationView,
34067
- {
34068
- className: "pagination-bar col-span-3 sm:col-span-1 justify-end flex-1",
34069
- currentPage: page,
34070
- totalCount: totalRows ?? 0,
34071
- pageSize: 10,
34072
- onPageChange: (page2) => {
34073
- if (typeof setPage === "function") {
34074
- 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
34075
34076
  }
34076
- },
34077
- displayPageNumberDots: false,
34078
- displayRowsNumberOption: false
34079
- }
34080
- )
34081
- ] }),
34082
- !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)(
34083
- "div",
34084
- {
34085
- className: `border-[1px] h-full border-solid border-[#dbe0e6] rounded-[10px] relative w-full overflow-hidden`,
34086
- 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)(
34087
34096
  "div",
34088
34097
  {
34089
- className: `flex w-full items-center h-full overflow-auto `,
34090
- children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { className: "w-full h-full max-w-full", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
34091
- "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",
34092
34101
  {
34093
- className: `relative w-full bg-white custom-dropdown `,
34094
- children: [
34095
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34096
- TableHead,
34097
- {
34098
- columns,
34099
- onToggleColumnOptional,
34100
- isDisplayCheckbox,
34101
- checkedAll,
34102
- handleCheckBoxAll
34103
- }
34104
- ),
34105
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34106
- TableBody,
34107
- {
34108
- columns,
34109
- rows,
34110
- rootField,
34111
- isDisplayCheckbox,
34112
- model: relation,
34113
- renderField: ({
34114
- row,
34115
- col,
34116
- indexRow,
34117
- onChangeData,
34118
- rootField: rootField2
34119
- }) => {
34120
- if (typeof renderField === "function") {
34121
- 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: ({
34122
34127
  row,
34123
34128
  col,
34124
34129
  indexRow,
34125
34130
  onChangeData,
34126
34131
  rootField: rootField2
34127
- });
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
34128
34150
  }
34129
- },
34130
- onRemoveRow: null,
34131
- onAddRow,
34132
- onClickRow,
34133
- typeTable,
34134
- selectedRowKeysRef,
34135
- selectedRowKeys,
34136
- setSelectedRowKeys
34137
- }
34138
- )
34139
- ]
34151
+ )
34152
+ ]
34153
+ }
34154
+ ) })
34140
34155
  }
34141
- ) })
34156
+ ) }) })
34142
34157
  }
34143
- ) }) })
34144
- }
34145
- ) }) }) : /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(LayerLoading, {}),
34146
- /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)("div", { className: "flex items-center gap-2 mt-auto", children: [
34147
- isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34148
- "button",
34149
- {
34150
- disabled: selectedRowKeys?.length === 0,
34151
- type: "button",
34152
- onClick: () => onChoose(selectedRowKeys),
34153
- className: "button-primary",
34154
- children: instance.t("choose")
34155
- }
34156
- ),
34157
- optionsObject && "no_create" in optionsObject && optionsObject?.no_create === false && /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34158
- "button",
34159
- {
34160
- type: "button",
34161
- onClick: () => {
34162
- if (typeof onAddNew === "function") {
34163
- onAddNew();
34164
- onClose();
34165
- } else {
34166
- 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")
34167
34168
  }
34168
- },
34169
- className: "button-primary",
34170
- children: instance.t("new")
34171
- }
34172
- ),
34173
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
34174
- "button",
34175
- {
34176
- type: "button",
34177
- onClick: onClose,
34178
- className: "button-secondary",
34179
- children: instance.t("cancel_button")
34180
- }
34181
- )
34182
- ] })
34183
- ] }) })
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
+ ) })
34184
34199
  ] }),
34185
34200
  document.body
34186
34201
  );
@@ -34305,7 +34320,7 @@ var Many2OneField = (props) => {
34305
34320
  menuShouldScrollIntoView: false,
34306
34321
  options: options2,
34307
34322
  classNames: {
34308
- control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 bg-white !shadow-none !rounded-[10px] p-2 pl-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isForm && (isFocused ? "!border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
34323
+ control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 bg-white !shadow-none !rounded-[10px] py-2 px-3 text-sm text-[#1A1A1B] font-normal cursor-pointer gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content ${isForm && (isFocused ? "!border-[1px] !border-primary !ring-0 outline-none" : "border !border-[rgba(66,66,66,0.12)]")} ${readonly && "!cursor-not-allowed"} ${isEditTable && "md:!min-w-[300px] max-w-[300px] !rounded-none !border !border-transparent !border-b !border-[#f7f7f7] hover:border-b-primary !bg-transparent min-h-auto"}`,
34309
34324
  valueContainer: () => "!m-0 !p-0",
34310
34325
  singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
34311
34326
  input: () => "!m-0 !p-0",