@fctc/sme-widget-ui 1.0.7 → 1.0.9

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.
@@ -39,6 +39,7 @@ interface TableBodyProps {
39
39
  typeCo?: any;
40
40
  setSelectedRowKeys?: any;
41
41
  selectedRowKeys?: any;
42
+ isEditTable?: boolean;
42
43
  }
43
44
  declare const TableBody: (props: TableBodyProps) => JSX.Element;
44
45
 
package/dist/widgets.d.ts CHANGED
@@ -39,6 +39,7 @@ interface TableBodyProps {
39
39
  typeCo?: any;
40
40
  setSelectedRowKeys?: any;
41
41
  selectedRowKeys?: any;
42
+ isEditTable?: boolean;
42
43
  }
43
44
  declare const TableBody: (props: TableBodyProps) => JSX.Element;
44
45
 
package/dist/widgets.js CHANGED
@@ -6771,7 +6771,7 @@ var import_jsx_runtime26 = require("react/jsx-runtime");
6771
6771
  // src/icons/search-icon.tsx
6772
6772
  var import_jsx_runtime27 = require("react/jsx-runtime");
6773
6773
  var SearchIcon = () => {
6774
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
6774
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6775
6775
  "svg",
6776
6776
  {
6777
6777
  xmlns: "http://www.w3.org/2000/svg",
@@ -6779,22 +6779,13 @@ var SearchIcon = () => {
6779
6779
  height: "20",
6780
6780
  viewBox: "0 0 20 20",
6781
6781
  fill: "none",
6782
- children: [
6783
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6784
- "path",
6785
- {
6786
- d: "M9.58334 18.1248C4.875 18.1248 1.04167 14.2915 1.04167 9.58317C1.04167 4.87484 4.875 1.0415 9.58334 1.0415C14.2917 1.0415 18.125 4.87484 18.125 9.58317C18.125 14.2915 14.2917 18.1248 9.58334 18.1248ZM9.58334 2.2915C5.55834 2.2915 2.29167 5.5665 2.29167 9.58317C2.29167 13.5998 5.55834 16.8748 9.58334 16.8748C13.6083 16.8748 16.875 13.5998 16.875 9.58317C16.875 5.5665 13.6083 2.2915 9.58334 2.2915Z",
6787
- fill: "#525252"
6788
- }
6789
- ),
6790
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6791
- "path",
6792
- {
6793
- d: "M18.3333 18.9585C18.175 18.9585 18.0167 18.9002 17.8917 18.7752L16.225 17.1085C15.9833 16.8669 15.9833 16.4669 16.225 16.2252C16.4667 15.9835 16.8667 15.9835 17.1083 16.2252L18.775 17.8919C19.0167 18.1335 19.0167 18.5335 18.775 18.7752C18.65 18.9002 18.4917 18.9585 18.3333 18.9585Z",
6794
- fill: "#525252"
6795
- }
6796
- )
6797
- ]
6782
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
6783
+ "path",
6784
+ {
6785
+ d: "M14.5232 13.4627L17.7355 16.6742L16.6742 17.7355L13.4627 14.5232C12.2678 15.4812 10.7815 16.0022 9.25 16C5.524 16 2.5 12.976 2.5 9.25C2.5 5.524 5.524 2.5 9.25 2.5C12.976 2.5 16 5.524 16 9.25C16.0022 10.7815 15.4812 12.2678 14.5232 13.4627ZM13.0187 12.9062C13.9706 11.9274 14.5021 10.6153 14.5 9.25C14.5 6.349 12.1502 4 9.25 4C6.349 4 4 6.349 4 9.25C4 12.1502 6.349 14.5 9.25 14.5C10.6153 14.5021 11.9274 13.9706 12.9062 13.0187L13.0187 12.9062Z",
6786
+ fill: "#AEAEAE"
6787
+ }
6788
+ )
6798
6789
  }
6799
6790
  );
6800
6791
  };
@@ -12018,7 +12009,8 @@ var TableBodyRow = (props) => {
12018
12009
  checked,
12019
12010
  isForm,
12020
12011
  typeCo,
12021
- selectedRowKeys
12012
+ selectedRowKeys,
12013
+ isEditTable
12022
12014
  } = props;
12023
12015
  const [isAutoSelect, setIsAutoSelect] = (0, import_react11.useState)(false);
12024
12016
  const rootStyle = getComputedStyle(document.documentElement);
@@ -12063,16 +12055,16 @@ var TableBodyRow = (props) => {
12063
12055
  checkedAll,
12064
12056
  setIsAutoSelect,
12065
12057
  isAutoSelect,
12066
- s: true,
12067
12058
  selectedRowKeysRef,
12068
- setSelectedRowKeys
12059
+ setSelectedRowKeys,
12060
+ isEditTable
12069
12061
  },
12070
12062
  `record-${index4}`
12071
12063
  );
12072
12064
  }) : !isForm && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("td", { className: "w-full", colSpan: columns?.length + 2, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
12073
12065
  "div",
12074
12066
  {
12075
- className: `flex flex-col items-center justify-center gap-3 ${typeCo === "form" ? "my-6" : "my-20"}`,
12067
+ className: `flex flex-col items-center justify-center gap-3 ${typeCo === "form" ? "my-6" : "my-2"}`,
12076
12068
  children: [
12077
12069
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(EmptyData, { className: colorPrimary }),
12078
12070
  /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "text-xl font-extrabold", children: i18n_default.t("empty_data") })
@@ -12081,7 +12073,7 @@ var TableBodyRow = (props) => {
12081
12073
  ) }) });
12082
12074
  };
12083
12075
  var TableBody = (props) => {
12084
- return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tbody", { className: "overflow-hidden", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBodyRow, { ...props }) });
12076
+ return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("tbody", { className: "overflow-hidden z-0", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TableBodyRow, { ...props }) });
12085
12077
  };
12086
12078
 
12087
12079
  // src/widgets/advanced/table/table-filter.tsx
@@ -12331,11 +12323,11 @@ var TableHead = (props) => {
12331
12323
  onRemoveRow,
12332
12324
  onToggleColumnOptional
12333
12325
  } = props;
12334
- return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { className: "relative z-[0]", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
12326
+ return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("thead", { className: "relative z-10", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
12335
12327
  "tr",
12336
12328
  {
12337
12329
  style: { userSelect: "none", WebkitUserSelect: "none" },
12338
- className: "border-b-[1.5px] border-[#DEE7DD] sticky top-0 bg-[#eff1f2] z-[1]",
12330
+ className: "border-b-[1.5px] border-[rgba(66,66,66,0.12)] sticky top-0 bg-white z-[1]",
12339
12331
  children: [
12340
12332
  isDisplayCheckbox && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
12341
12333
  "th",
@@ -33221,7 +33213,7 @@ var SelectDropdownField = (props) => {
33221
33213
  value: val[0],
33222
33214
  label: val[1]
33223
33215
  })) : [];
33224
- if (!isForm) {
33216
+ if (!isForm && !isEditTable) {
33225
33217
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("span", { children: options2?.find((item) => item?.value === value)?.label });
33226
33218
  } else {
33227
33219
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
@@ -33263,20 +33255,43 @@ var SelectDropdownField = (props) => {
33263
33255
  StateManagedSelect$1,
33264
33256
  {
33265
33257
  ...commonProps,
33266
- classNames: isEditTable ? {
33267
- control: () => `w-full flex ring-0 cursor-pointer outline-0 !shadow-none p-2 pl-3 text-sm text-[#1A1A1B] font-normal gap-2 opacity-100 leading-5 resize-none overflow-hidden field-sizing-content border border-transparent border-b border-[#f7f7f7] hover:border-b-primary ${readonly ? "!cursor-not-allowed" : ""}`,
33268
- valueContainer: () => "!m-0 !p-0",
33269
- singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
33270
- input: () => "!m-0 !p-0",
33271
- dropdownIndicator: () => "invisible group-hover:visible !m-0 !p-0",
33272
- clearIndicator: () => "invisible group-hover:visible !m-0 !p-0"
33273
- } : {
33274
- control: ({ isFocused }) => `w-full flex min-h-[44px] ring-0 cursor-pointer outline-0 !bg-white !shadow-none !rounded-[8px] 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 ${isFocused ? "!border-[1px] border-primary !ring-0 outline-none" : "border border-[rgba(66,66,66,0.12)]"} `,
33275
- valueContainer: () => "!m-0 !p-0",
33276
- singleValue: () => `!m-0 ${readonly ? "!text-[#5c5a5a]" : ""}`,
33277
- input: () => "!m-0 !p-0",
33278
- dropdownIndicator: () => "!m-0 !p-0"
33258
+ styles: {
33259
+ control: (base, state) => ({
33260
+ ...base,
33261
+ display: "flex",
33262
+ minHeight: "44px",
33263
+ cursor: readonly ? "not-allowed" : "pointer",
33264
+ backgroundColor: "#f7f7f7",
33265
+ borderRadius: isEditTable ? "0px" : "10px",
33266
+ padding: "4px 0px",
33267
+ border: isForm ? state.isFocused ? "1px solid var(--primary)" : "1px solid transparent" : "none",
33268
+ boxShadow: "none",
33269
+ "&:hover": {
33270
+ borderColor: "var(--primary)"
33271
+ },
33272
+ ...isEditTable && {
33273
+ minWidth: "300px",
33274
+ maxWidth: "300px",
33275
+ borderBottom: "1px solid transparent",
33276
+ background: "transparent"
33277
+ }
33278
+ }),
33279
+ clearIndicator: (base) => ({
33280
+ ...base,
33281
+ padding: "0"
33282
+ }),
33283
+ menuPortal: (base) => ({
33284
+ ...base,
33285
+ zIndex: 9999
33286
+ }),
33287
+ menu: (base) => ({
33288
+ ...base,
33289
+ zIndex: 9999,
33290
+ width: isEditTable ? "300px" : "100%",
33291
+ minWidth: isEditTable ? "300px" : "100%"
33292
+ })
33279
33293
  },
33294
+ menuPortalTarget: typeof window !== "undefined" ? document.body : null,
33280
33295
  components: {
33281
33296
  IndicatorSeparator: () => null,
33282
33297
  DropdownIndicator: (props2) => readonly || !isEditTable ? null : /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(components.DropdownIndicator, { ...props2 })
@@ -33840,15 +33855,10 @@ var Many2OneField = (props) => {
33840
33855
  string,
33841
33856
  //return
33842
33857
  menuList,
33843
- handleChooseRecord,
33844
- handleClose,
33845
- selectedRowKeys,
33846
33858
  allowShowDetail,
33847
33859
  index: index4,
33848
33860
  contextObject,
33849
33861
  renderDetail,
33850
- isShowModalMany2Many,
33851
- initValue,
33852
33862
  tempSelectedOption,
33853
33863
  options: options2,
33854
33864
  fetchMoreOptions,