@fctc/sme-widget-ui 1.0.1 → 1.0.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/widgets.mjs CHANGED
@@ -12023,11 +12023,11 @@ var TableBody = (props) => {
12023
12023
  };
12024
12024
 
12025
12025
  // src/widgets/advanced/table/table-filter.tsx
12026
- import { useEffect as useEffect4, useRef as useRef5, useState as useState3 } from "react";
12026
+ import { useEffect as useEffect4, useRef as useRef4, useState as useState3 } from "react";
12027
12027
  import { createPortal } from "react-dom";
12028
12028
 
12029
12029
  // src/hooks/use-click-outside.ts
12030
- import { useEffect as useEffect3, useRef as useRef4 } from "react";
12030
+ import { useEffect as useEffect3, useRef as useRef3 } from "react";
12031
12031
  var DEFAULT_EVENTS = ["mousedown", "touchstart"];
12032
12032
  var useClickOutside = ({
12033
12033
  handler,
@@ -12036,7 +12036,7 @@ var useClickOutside = ({
12036
12036
  // Default to empty array to avoid undefined errors
12037
12037
  refs
12038
12038
  }) => {
12039
- const ref = useRef4(null);
12039
+ const ref = useRef3(null);
12040
12040
  useEffect3(() => {
12041
12041
  const listener = (event) => {
12042
12042
  const { target } = event;
@@ -12063,7 +12063,7 @@ import { jsx as jsx43, jsxs as jsxs27 } from "react/jsx-runtime";
12063
12063
  var TableFilter = ({ columns, onToggleColumnOptional }) => {
12064
12064
  const [openTableFilter, setOpenTableFilter] = useState3();
12065
12065
  const [filterPosition, setFilterPosition] = useState3(null);
12066
- const filterPopupRef = useRef5(null);
12066
+ const filterPopupRef = useRef4(null);
12067
12067
  const filterRef = useClickOutside({
12068
12068
  handler: () => {
12069
12069
  if (openTableFilter) {
@@ -12095,7 +12095,10 @@ var TableFilter = ({ columns, onToggleColumnOptional }) => {
12095
12095
  "div",
12096
12096
  {
12097
12097
  ref: filterRef,
12098
- className: "w-fit absolute top-[8px] right-[10px] ms-auto z-[32] bg-[#eff1f2] pl-2 ",
12098
+ style: {
12099
+ transform: "translateY(-50%)"
12100
+ },
12101
+ className: "w-fit absolute top-[50%] translate-y-[-50%] right-[10px] ms-auto z-[32] bg-[#eff1f2]",
12099
12102
  children: [
12100
12103
  /* @__PURE__ */ jsx43(
12101
12104
  "button",
@@ -12301,7 +12304,11 @@ var TableHead = (props) => {
12301
12304
  columns && Array.isArray(columns) && columns?.some((column2) => column2?.optional) && /* @__PURE__ */ jsx45(
12302
12305
  "th",
12303
12306
  {
12304
- className: `column whitespace-nowrap text-left p-3 text-sm font-medium capitalize text-[#121212]`,
12307
+ style: {
12308
+ minWidth: "40px",
12309
+ right: 0
12310
+ },
12311
+ className: `column whitespace-nowrap text-left p-3 text-sm font-medium capitalize text-[#121212] min-w-[40px] sticky right-[0px] bg-[#eff1f2]`,
12305
12312
  children: /* @__PURE__ */ jsx45(
12306
12313
  TableFilter,
12307
12314
  {
@@ -14458,10 +14465,8 @@ var PopupFilter = ({
14458
14465
  return;
14459
14466
  }
14460
14467
  typeof handleAddTagSearch === "function" && handleAddTagSearch({
14461
- title: /* @__PURE__ */ jsx54(FilterIcon, {}),
14462
14468
  name: item?.name,
14463
14469
  value: item?.string ?? item?.help,
14464
- icon: /* @__PURE__ */ jsx54(FilterIcon, {}),
14465
14470
  domain: item?.domain,
14466
14471
  groupIndex: item?.group_index,
14467
14472
  type: SearchType.FILTER
@@ -14500,10 +14505,8 @@ var PopupFilter = ({
14500
14505
  return;
14501
14506
  }
14502
14507
  typeof handleAddTagSearch === "function" && handleAddTagSearch({
14503
- title: /* @__PURE__ */ jsx54(GroupByIcon, {}),
14504
14508
  name: item?.name,
14505
14509
  value: item?.string,
14506
- icon: /* @__PURE__ */ jsx54(GroupByIcon, {}),
14507
14510
  type: SearchType.GROUP,
14508
14511
  context: JSON.parse(item?.context.replace(/'/g, '"')),
14509
14512
  active: !isExist,
@@ -14546,7 +14549,7 @@ var TagSearch = ({
14546
14549
  {
14547
14550
  className: "flex min-h-full overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
14548
14551
  children: [
14549
- /* @__PURE__ */ jsx55("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: tag?.title }),
14552
+ /* @__PURE__ */ jsx55("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: tag?.type === SearchType.SEARCH ? tag?.title : /* @__PURE__ */ jsx55(FilterIcon, {}) }),
14550
14553
  /* @__PURE__ */ jsx55("div", { className: "pl-2 align-middle text-[#495057] text-[14px]", children: tag.values.map((value, idx) => {
14551
14554
  return /* @__PURE__ */ jsxs37(Fragment7, { children: [
14552
14555
  /* @__PURE__ */ jsx55("span", { children: value }),
@@ -14592,7 +14595,7 @@ var TagSearch = ({
14592
14595
  {
14593
14596
  className: "flex gap-2 overflow-hidden rounded bg-[#E9ECEF] hover:shadow-xl",
14594
14597
  children: [
14595
- /* @__PURE__ */ jsx55("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: tag?.title }),
14598
+ /* @__PURE__ */ jsx55("div", { className: "bg-primary flex items-center justify-center px-2 text-sm font-semibold leading-[1.5] text-white", children: /* @__PURE__ */ jsx55(GroupByIcon, {}) }),
14596
14599
  value?.strings?.map((string, idx) => /* @__PURE__ */ jsxs37(Fragment8, { children: [
14597
14600
  /* @__PURE__ */ jsx55("span", { children: string }),
14598
14601
  idx < value?.strings.length - 1 && /* @__PURE__ */ jsxs37("span", { className: "text-sm italic text-[#495057] text-opacity-50", children: [
@@ -14705,7 +14708,8 @@ var Search = ({
14705
14708
  aid,
14706
14709
  selectedRowKeys,
14707
14710
  domainSearch,
14708
- evalJSONContext
14711
+ evalJSONContext,
14712
+ clearSearch
14709
14713
  }) => {
14710
14714
  const [showPopupFilter, setShowPopupFilter] = useState5(false);
14711
14715
  const popupFilterRef = useClickOutside({
@@ -14725,6 +14729,13 @@ var Search = ({
14725
14729
  }
14726
14730
  }
14727
14731
  }, [selectedTags, isReadyFormatDomain]);
14732
+ useEffect6(() => {
14733
+ return () => {
14734
+ clearSearch();
14735
+ setDidInit(false);
14736
+ setIsReadyFormatDomain(false);
14737
+ };
14738
+ }, [viewData]);
14728
14739
  useEffect6(() => {
14729
14740
  if (didInit || selectedTags?.length > 0) return;
14730
14741
  const searchDefaults = Object.entries(context || {}).filter(
@@ -16913,11 +16924,11 @@ var LoadingSmall = () => {
16913
16924
  };
16914
16925
 
16915
16926
  // src/widgets/common/video-player.tsx
16916
- import { useRef as useRef6, useState as useState9 } from "react";
16927
+ import { useRef as useRef5, useState as useState9 } from "react";
16917
16928
  import { jsx as jsx64, jsxs as jsxs44 } from "react/jsx-runtime";
16918
16929
  var VideoPlayer = ({ src }) => {
16919
16930
  const [isPlaying, setIsPlaying] = useState9(false);
16920
- const videoRef = useRef6(null);
16931
+ const videoRef = useRef5(null);
16921
16932
  const handlePlayPause = () => {
16922
16933
  if (videoRef.current) {
16923
16934
  if (isPlaying) {
@@ -17296,13 +17307,14 @@ var ButtonSelectFiles = ({
17296
17307
  const MAX_TOTAL_SIZE = 50 * 1024 * 1024;
17297
17308
  const { mutate: onUploadImage, isPending } = useUploadImage();
17298
17309
  const { mutate: onUploadFile } = useUploadFile();
17299
- const handleUploadImage = async ({ data }) => {
17310
+ const handleUploadImage = async ({ formData }) => {
17311
+ console.log("data", formData);
17300
17312
  if (widget !== "many2many_binary") {
17301
17313
  onUploadImage(
17302
- { data },
17314
+ { formData },
17303
17315
  {
17304
- onSuccess: (data2) => {
17305
- const formatData = data2?.data?.["ir.attachment"]?.[0];
17316
+ onSuccess: (data) => {
17317
+ const formatData = data?.data?.["ir.attachment"]?.[0];
17306
17318
  const files = [...selectedFiles, formatData];
17307
17319
  setSelectedFiles(files);
17308
17320
  y2.success(instance.t("upload_success"));
@@ -17314,10 +17326,10 @@ var ButtonSelectFiles = ({
17314
17326
  );
17315
17327
  } else {
17316
17328
  onUploadFile(
17317
- { data },
17329
+ { formData },
17318
17330
  {
17319
- onSuccess: (data2) => {
17320
- const formatData = data2?.data?.["ir.attachment"]?.[0];
17331
+ onSuccess: (data) => {
17332
+ const formatData = data?.data?.["ir.attachment"]?.[0];
17321
17333
  const files = [...selectedFiles, formatData];
17322
17334
  setSelectedFiles(files);
17323
17335
  y2.success(i18n_default.t("upload_success"));
@@ -17360,10 +17372,10 @@ var ButtonSelectFiles = ({
17360
17372
  setUploadError(false);
17361
17373
  const formData = new FormData();
17362
17374
  formData.append("ufile", file);
17363
- formData.append("thread_model", model);
17375
+ formData.append("thread_model", String(model));
17364
17376
  formData.append("thread_id", Number(id));
17365
17377
  formData.append("is_pending", true);
17366
- await handleUploadImage({ data: formData });
17378
+ await handleUploadImage({ formData });
17367
17379
  }
17368
17380
  };
17369
17381
  return /* @__PURE__ */ jsxs46(Fragment13, { children: [
@@ -17809,7 +17821,7 @@ var CheckboxField = (props) => {
17809
17821
  };
17810
17822
 
17811
17823
  // src/widgets/basic/color-field/color-wrapper.tsx
17812
- import { useEffect as useEffect10, useRef as useRef7, useState as useState10 } from "react";
17824
+ import { useEffect as useEffect10, useRef as useRef6, useState as useState10 } from "react";
17813
17825
  import { Fragment as Fragment17, jsx as jsx73, jsxs as jsxs51 } from "react/jsx-runtime";
17814
17826
  var ColorWrapper = (props) => {
17815
17827
  const {
@@ -17819,7 +17831,7 @@ var ColorWrapper = (props) => {
17819
17831
  } = props;
17820
17832
  const [selectedColor, setSelectedColor] = useState10(colors2[defaultColor]);
17821
17833
  const [showFullColors, setIsShowFullColor] = useState10(false);
17822
- const pickColorsRef = useRef7(null);
17834
+ const pickColorsRef = useRef6(null);
17823
17835
  useEffect10(() => {
17824
17836
  setSelectedColor(colors2[defaultColor]);
17825
17837
  }, [defaultColor]);
@@ -18020,7 +18032,7 @@ var CopyLinkButtonField = (props) => {
18020
18032
  import { forwardRef as forwardRef6, useEffect as useEffect15 } from "react";
18021
18033
 
18022
18034
  // node_modules/react-datepicker/dist/index.es.js
18023
- import React9, { useRef as useRef11, useCallback as useCallback5, useEffect as useEffect13, cloneElement as cloneElement3, Component, createRef, createElement as createElement5 } from "react";
18035
+ import React9, { useRef as useRef10, useCallback as useCallback5, useEffect as useEffect13, cloneElement as cloneElement3, Component, createRef, createElement as createElement5 } from "react";
18024
18036
 
18025
18037
  // node_modules/date-fns/constants.js
18026
18038
  var daysInYear = 365.2425;
@@ -22590,8 +22602,8 @@ var CalendarContainer = function(_a2) {
22590
22602
  return React9.createElement("div", { className, role: "dialog", "aria-label": ariaLabel, "aria-modal": "true" }, children);
22591
22603
  };
22592
22604
  var useDetectClickOutside = function(onClickOutside, ignoreClass) {
22593
- var ref = useRef11(null);
22594
- var onClickOutsideRef = useRef11(onClickOutside);
22605
+ var ref = useRef10(null);
22606
+ var onClickOutsideRef = useRef10(onClickOutside);
22595
22607
  onClickOutsideRef.current = onClickOutside;
22596
22608
  var handleClickOutside = useCallback5(function(event) {
22597
22609
  var _a2;
@@ -25845,7 +25857,7 @@ function withFloating(Component3) {
25845
25857
  var WithFloating = function(props) {
25846
25858
  var _a2;
25847
25859
  var hidePopper = typeof props.hidePopper === "boolean" ? props.hidePopper : true;
25848
- var arrowRef = useRef11(null);
25860
+ var arrowRef = useRef10(null);
25849
25861
  var floatingProps = useFloating2(_assign({ open: !hidePopper, whileElementsMounted: autoUpdate, placement: props.popperPlacement, middleware: __spreadArray([
25850
25862
  flip3({ padding: 15 }),
25851
25863
  offset3(10),
@@ -27024,7 +27036,7 @@ function _toConsumableArray(r4) {
27024
27036
 
27025
27037
  // node_modules/react-select/dist/Select-ef7c0426.esm.js
27026
27038
  import * as React13 from "react";
27027
- import { useMemo as useMemo7, Fragment as Fragment21, useRef as useRef14, useCallback as useCallback8, useEffect as useEffect14, Component as Component2 } from "react";
27039
+ import { useMemo as useMemo7, Fragment as Fragment21, useRef as useRef13, useCallback as useCallback8, useEffect as useEffect14, Component as Component2 } from "react";
27028
27040
 
27029
27041
  // node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js
27030
27042
  import * as React11 from "react";
@@ -28356,7 +28368,7 @@ function _taggedTemplateLiteral(e3, t3) {
28356
28368
  }
28357
28369
 
28358
28370
  // node_modules/react-select/dist/index-641ee5b8.esm.js
28359
- import { useContext as useContext8, useRef as useRef13, useState as useState14, useMemo as useMemo6, useCallback as useCallback7, createContext as createContext4 } from "react";
28371
+ import { useContext as useContext8, useRef as useRef12, useState as useState14, useMemo as useMemo6, useCallback as useCallback7, createContext as createContext4 } from "react";
28360
28372
  import { createPortal as createPortal4 } from "react-dom";
28361
28373
 
28362
28374
  // node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js
@@ -28702,7 +28714,7 @@ var PortalPlacementContext = /* @__PURE__ */ createContext4(null);
28702
28714
  var MenuPlacer = function MenuPlacer2(props) {
28703
28715
  var children = props.children, minMenuHeight = props.minMenuHeight, maxMenuHeight = props.maxMenuHeight, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition, menuShouldScrollIntoView = props.menuShouldScrollIntoView, theme = props.theme;
28704
28716
  var _ref3 = useContext8(PortalPlacementContext) || {}, setPortalPlacement = _ref3.setPortalPlacement;
28705
- var ref = useRef13(null);
28717
+ var ref = useRef12(null);
28706
28718
  var _useState = useState14(maxMenuHeight), _useState2 = _slicedToArray(_useState, 2), maxHeight = _useState2[0], setMaxHeight = _useState2[1];
28707
28719
  var _useState3 = useState14(null), _useState4 = _slicedToArray(_useState3, 2), placement = _useState4[0], setPlacement = _useState4[1];
28708
28720
  var controlHeight2 = theme.spacing.controlHeight;
@@ -28806,8 +28818,8 @@ var menuPortalCSS = function menuPortalCSS2(_ref8) {
28806
28818
  };
28807
28819
  var MenuPortal = function MenuPortal2(props) {
28808
28820
  var appendTo = props.appendTo, children = props.children, controlElement = props.controlElement, innerProps = props.innerProps, menuPlacement = props.menuPlacement, menuPosition = props.menuPosition;
28809
- var menuPortalRef = useRef13(null);
28810
- var cleanupRef = useRef13(null);
28821
+ var menuPortalRef = useRef12(null);
28822
+ var cleanupRef = useRef12(null);
28811
28823
  var _useState5 = useState14(coercePlacement(menuPlacement)), _useState6 = _slicedToArray(_useState5, 2), placement = _useState6[0], setPortalPlacement = _useState6[1];
28812
28824
  var portalPlacementContext = useMemo6(function() {
28813
28825
  return {
@@ -29945,10 +29957,10 @@ var cancelScroll = function cancelScroll2(event) {
29945
29957
  };
29946
29958
  function useScrollCapture(_ref3) {
29947
29959
  var isEnabled = _ref3.isEnabled, onBottomArrive = _ref3.onBottomArrive, onBottomLeave = _ref3.onBottomLeave, onTopArrive = _ref3.onTopArrive, onTopLeave = _ref3.onTopLeave;
29948
- var isBottom = useRef14(false);
29949
- var isTop = useRef14(false);
29950
- var touchStart = useRef14(0);
29951
- var scrollTarget = useRef14(null);
29960
+ var isBottom = useRef13(false);
29961
+ var isTop = useRef13(false);
29962
+ var touchStart = useRef13(0);
29963
+ var scrollTarget = useRef13(null);
29952
29964
  var handleEventDelta = useCallback8(function(event, delta) {
29953
29965
  if (scrollTarget.current === null) return;
29954
29966
  var _scrollTarget$current = scrollTarget.current, scrollTop = _scrollTarget$current.scrollTop, scrollHeight = _scrollTarget$current.scrollHeight, clientHeight = _scrollTarget$current.clientHeight;
@@ -30055,8 +30067,8 @@ var listenerOptions = {
30055
30067
  };
30056
30068
  function useScrollLock(_ref3) {
30057
30069
  var isEnabled = _ref3.isEnabled, _ref$accountForScroll = _ref3.accountForScrollbars, accountForScrollbars = _ref$accountForScroll === void 0 ? true : _ref$accountForScroll;
30058
- var originalStyles = useRef14({});
30059
- var scrollTarget = useRef14(null);
30070
+ var originalStyles = useRef13({});
30071
+ var scrollTarget = useRef13(null);
30060
30072
  var addScrollLock = useCallback8(function(touchScrollTarget) {
30061
30073
  if (!canUseDOM) return;
30062
30074
  var target = document.body;
@@ -32180,11 +32192,11 @@ var FeeField = (props) => {
32180
32192
  };
32181
32193
 
32182
32194
  // src/widgets/basic/file-upload-field/file-upload.tsx
32183
- import { useEffect as useEffect16, useRef as useRef15, useState as useState16 } from "react";
32195
+ import { useEffect as useEffect16, useRef as useRef14, useState as useState16 } from "react";
32184
32196
  import { jsx as jsx84, jsxs as jsxs59 } from "react/jsx-runtime";
32185
32197
  var FileUploadField = (props) => {
32186
32198
  const { name: name2, methods, isForm, model, required, idForm, widget, useUploadImage, useUploadFile, useGetImage, isBase64File } = props;
32187
- const fileInputRef = useRef15(null);
32199
+ const fileInputRef = useRef14(null);
32188
32200
  const [selectedFiles, setSelectedFiles] = useState16([]);
32189
32201
  const [uploadError, setUploadError] = useState16();
32190
32202
  return /* @__PURE__ */ jsx84(
@@ -32245,7 +32257,7 @@ var FileUploadField = (props) => {
32245
32257
  };
32246
32258
 
32247
32259
  // src/widgets/basic/float-field/float.tsx
32248
- import { useEffect as useEffect17, useRef as useRef16, useState as useState17 } from "react";
32260
+ import { useEffect as useEffect17, useRef as useRef15, useState as useState17 } from "react";
32249
32261
  import { Fragment as Fragment24, jsx as jsx85, jsxs as jsxs60 } from "react/jsx-runtime";
32250
32262
  var FloatField = (props) => {
32251
32263
  const {
@@ -32286,9 +32298,9 @@ var FloatField = (props) => {
32286
32298
  setInputValue("");
32287
32299
  }
32288
32300
  }, [value, name2, clearErrors]);
32289
- const isDirtyRef = useRef16(false);
32290
- const inputRef = useRef16(null);
32291
- const lastCommittedValueRef = useRef16(null);
32301
+ const isDirtyRef = useRef15(false);
32302
+ const inputRef = useRef15(null);
32303
+ const lastCommittedValueRef = useRef15(null);
32292
32304
  const handleInputChange = (e3) => {
32293
32305
  const newValue = e3.target.value;
32294
32306
  const valueWithoutCommas = newValue.replace(/,/g, "");
@@ -32518,7 +32530,7 @@ var FloatTimeField = (props) => {
32518
32530
  };
32519
32531
 
32520
32532
  // src/widgets/basic/html-field/html.tsx
32521
- import { useEffect as useEffect18, useRef as useRef17 } from "react";
32533
+ import { useEffect as useEffect18, useRef as useRef16 } from "react";
32522
32534
  import { jsx as jsx87 } from "react/jsx-runtime";
32523
32535
  var HtmlField = (props) => {
32524
32536
  const {
@@ -32530,7 +32542,7 @@ var HtmlField = (props) => {
32530
32542
  onChange: onChange2,
32531
32543
  value
32532
32544
  } = props;
32533
- const divRef = useRef17(null);
32545
+ const divRef = useRef16(null);
32534
32546
  if (!isForm) {
32535
32547
  return /* @__PURE__ */ jsx87("div", { dangerouslySetInnerHTML: { __html: value || defaultValue || "" } });
32536
32548
  }
@@ -32597,9 +32609,6 @@ import { useEffect as useEffect19 } from "react";
32597
32609
  import { Fragment as Fragment26, jsx as jsx89, jsxs as jsxs62 } from "react/jsx-runtime";
32598
32610
  var InfomationField = (props) => {
32599
32611
  const { value, isForm = false, showName = true, stringToColor } = props;
32600
- if (isForm) {
32601
- return /* @__PURE__ */ jsx89("div", { children: "abc" });
32602
- }
32603
32612
  if (!value || Array.isArray(value) && value.length === 0) {
32604
32613
  return /* @__PURE__ */ jsx89(Fragment26, {});
32605
32614
  }
@@ -32630,7 +32639,7 @@ var InfomationField = (props) => {
32630
32639
 
32631
32640
  // src/widgets/basic/many2many-tags-field/many2many-tags.tsx
32632
32641
  import { jsx as jsx90, jsxs as jsxs63 } from "react/jsx-runtime";
32633
- var CustomMultiValue = (props) => {
32642
+ var CustomMultiValue = ({ stringToColor, ...props }) => {
32634
32643
  const { selectProps, data, menuList } = props;
32635
32644
  const { relation } = selectProps;
32636
32645
  const actionId = menuList?.flatMap(
@@ -32647,7 +32656,8 @@ var CustomMultiValue = (props) => {
32647
32656
  relation,
32648
32657
  isForm: false,
32649
32658
  aid: actionId?.id,
32650
- avatarSrc: data?.image_256
32659
+ avatarSrc: data?.image_256,
32660
+ stringToColor
32651
32661
  }
32652
32662
  ),
32653
32663
  /* @__PURE__ */ jsx90("span", { className: "capitalize", children: data?.label ?? data?.display_name }),
@@ -32692,7 +32702,14 @@ var Many2ManyTagField = (props) => {
32692
32702
  value: item.id,
32693
32703
  label: item.name ?? item.display_name
32694
32704
  })) : [];
32695
- return /* @__PURE__ */ jsx90(InfomationField, { value: optionValue || null, isForm, stringToColor });
32705
+ return /* @__PURE__ */ jsx90(
32706
+ InfomationField,
32707
+ {
32708
+ value: optionValue || null,
32709
+ isForm,
32710
+ stringToColor
32711
+ }
32712
+ );
32696
32713
  }
32697
32714
  return /* @__PURE__ */ jsx90(
32698
32715
  Controller,
@@ -32777,7 +32794,13 @@ var Many2ManyTagField = (props) => {
32777
32794
  })
32778
32795
  },
32779
32796
  components: isUser ? {
32780
- MultiValue: CustomMultiValue,
32797
+ MultiValue: (multiValueProps) => /* @__PURE__ */ jsx90(
32798
+ CustomMultiValue,
32799
+ {
32800
+ ...multiValueProps,
32801
+ stringToColor
32802
+ }
32803
+ ),
32781
32804
  IndicatorSeparator: () => null
32782
32805
  } : {
32783
32806
  IndicatorSeparator: () => null
@@ -33301,7 +33324,7 @@ var ToggleButtonField = (props) => {
33301
33324
  };
33302
33325
 
33303
33326
  // src/widgets/basic/integer-field/integer.tsx
33304
- import { useEffect as useEffect23, useRef as useRef18, useState as useState20 } from "react";
33327
+ import { useEffect as useEffect23, useRef as useRef17, useState as useState20 } from "react";
33305
33328
  import { Fragment as Fragment29, jsx as jsx100, jsxs as jsxs70 } from "react/jsx-runtime";
33306
33329
  var IntegerField = (props) => {
33307
33330
  const {
@@ -33336,9 +33359,9 @@ var IntegerField = (props) => {
33336
33359
  fieldState: { error: error2 }
33337
33360
  }) => {
33338
33361
  const { setError, clearErrors } = methods;
33339
- const isDirtyRef = useRef18(false);
33340
- const inputRef = useRef18(null);
33341
- const lastCommittedValueRef = useRef18(null);
33362
+ const isDirtyRef = useRef17(false);
33363
+ const inputRef = useRef17(null);
33364
+ const lastCommittedValueRef = useRef17(null);
33342
33365
  const [inputValue, setInputValue] = useState20(
33343
33366
  value2 !== void 0 && value2 !== null ? String(value2) : ""
33344
33367
  );
@@ -33508,14 +33531,12 @@ var Many2ManyField = (props) => {
33508
33531
  page,
33509
33532
  rows,
33510
33533
  columns,
33511
- typeTable,
33512
33534
  renderField,
33513
33535
  isDataLoading,
33514
33536
  relation,
33515
33537
  onToggleColumnOptional,
33516
33538
  isDataFetched,
33517
33539
  isPlaceholderData,
33518
- isCheckBox,
33519
33540
  optionsObject,
33520
33541
  onChoose,
33521
33542
  onAddNew,
@@ -33529,7 +33550,13 @@ var Many2ManyField = (props) => {
33529
33550
  evalJSONContext,
33530
33551
  searchController,
33531
33552
  viewData,
33532
- setDomain
33553
+ setDomain,
33554
+ isDisplayCheckbox,
33555
+ checkedAll,
33556
+ handleCheckBoxAll,
33557
+ selectedRowKeysRef,
33558
+ typeTable,
33559
+ setSelectedRowKeys
33533
33560
  } = props;
33534
33561
  const {
33535
33562
  context,
@@ -33543,7 +33570,8 @@ var Many2ManyField = (props) => {
33543
33570
  searchString,
33544
33571
  selectedTags,
33545
33572
  setFilterBy,
33546
- setGroupBy
33573
+ setGroupBy,
33574
+ clearSearch
33547
33575
  } = searchController;
33548
33576
  return createPortal5(
33549
33577
  /* @__PURE__ */ jsxs72("div", { className: "fixed bottom-0 left-0 right-0 top-0 z-[9999]", children: [
@@ -33568,8 +33596,6 @@ var Many2ManyField = (props) => {
33568
33596
  groupBy,
33569
33597
  showFiltersGroups: true,
33570
33598
  setGroupBy,
33571
- setSelectedRowKeys: (keys) => {
33572
- },
33573
33599
  setDomainList: setDomain,
33574
33600
  setPage: (pages) => {
33575
33601
  setPage?.(pages);
@@ -33579,12 +33605,14 @@ var Many2ManyField = (props) => {
33579
33605
  (col) => col?.field?.type_co === "field" && col?.optional !== "hide"
33580
33606
  )?.map((col) => ({ ...col.field })) ?? []
33581
33607
  ],
33608
+ setSelectedRowKeys,
33582
33609
  viewData,
33583
33610
  context,
33584
33611
  selectedRowKeys,
33585
33612
  aid,
33586
33613
  domainSearch,
33587
- evalJSONContext
33614
+ evalJSONContext,
33615
+ clearSearch
33588
33616
  }
33589
33617
  ) }),
33590
33618
  /* @__PURE__ */ jsx102(
@@ -33622,7 +33650,9 @@ var Many2ManyField = (props) => {
33622
33650
  {
33623
33651
  columns,
33624
33652
  onToggleColumnOptional,
33625
- isDisplayCheckbox: false
33653
+ isDisplayCheckbox,
33654
+ checkedAll,
33655
+ handleCheckBoxAll
33626
33656
  }
33627
33657
  ),
33628
33658
  /* @__PURE__ */ jsx102(
@@ -33631,7 +33661,7 @@ var Many2ManyField = (props) => {
33631
33661
  columns,
33632
33662
  rows,
33633
33663
  rootField,
33634
- isDisplayCheckbox: false,
33664
+ isDisplayCheckbox,
33635
33665
  model: relation,
33636
33666
  renderField: ({
33637
33667
  row,
@@ -33652,7 +33682,11 @@ var Many2ManyField = (props) => {
33652
33682
  },
33653
33683
  onRemoveRow: null,
33654
33684
  onAddRow,
33655
- onClickRow
33685
+ onClickRow,
33686
+ typeTable,
33687
+ selectedRowKeysRef,
33688
+ selectedRowKeys,
33689
+ setSelectedRowKeys
33656
33690
  }
33657
33691
  )
33658
33692
  ]
@@ -33663,7 +33697,7 @@ var Many2ManyField = (props) => {
33663
33697
  }
33664
33698
  ) }) }) : /* @__PURE__ */ jsx102(LayerLoading, {}),
33665
33699
  /* @__PURE__ */ jsxs72("div", { className: "flex items-center gap-2 mt-auto", children: [
33666
- isCheckBox && /* @__PURE__ */ jsx102(
33700
+ isDisplayCheckbox && /* @__PURE__ */ jsx102(
33667
33701
  "button",
33668
33702
  {
33669
33703
  disabled: selectedRowKeys?.length === 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/sme-widget-ui",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "main": "dist/index.cjs",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",