@fctc/widget-logic 2.0.4 → 2.0.8

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.mjs CHANGED
@@ -4086,7 +4086,6 @@ __export(index_exports, {
4086
4086
  useGetRowIds: () => useGetRowIds,
4087
4087
  useListData: () => useListData,
4088
4088
  useMenu: () => useMenu,
4089
- useMenuItem: () => useMenuItem,
4090
4089
  useProfile: () => useProfile,
4091
4090
  useSelectionState: () => useSelectionState,
4092
4091
  useStorageState: () => useStorageState,
@@ -4107,7 +4106,6 @@ __export(hooks_exports, {
4107
4106
  useDetail: () => useDetail,
4108
4107
  useListData: () => useListData,
4109
4108
  useMenu: () => useMenu,
4110
- useMenuItem: () => useMenuItem,
4111
4109
  useProfile: () => useProfile,
4112
4110
  useUser: () => useUser,
4113
4111
  useViewV2: () => useViewV2
@@ -4890,68 +4888,6 @@ var useAppProvider = () => {
4890
4888
  return context;
4891
4889
  };
4892
4890
 
4893
- // src/hooks/core/use-menu-item.tsx
4894
- import { getEnv as getEnv5 } from "@fctc/interface-logic/environment";
4895
- import { useGetActionDetail } from "@fctc/interface-logic/hooks";
4896
- import { useState as useState5 } from "react";
4897
-
4898
- // src/utils.ts
4899
- var utils_exports = {};
4900
- __export(utils_exports, {
4901
- API_APP_URL: () => API_APP_URL,
4902
- API_PRESCHOOL_URL: () => API_PRESCHOOL_URL,
4903
- STORAGES: () => STORAGES,
4904
- combineContexts: () => combineContexts,
4905
- convertFieldsToArray: () => convertFieldsToArray,
4906
- countSum: () => countSum,
4907
- getDateRange: () => getDateRange,
4908
- languages: () => languages,
4909
- mergeButtons: () => mergeButtons,
4910
- setStorageItemAsync: () => setStorageItemAsync,
4911
- useGetRowIds: () => useGetRowIds,
4912
- useSelectionState: () => useSelectionState,
4913
- useStorageState: () => useStorageState
4914
- });
4915
- __reExport(utils_exports, utils_star);
4916
- import * as utils_star from "@fctc/interface-logic/utils";
4917
-
4918
- // src/hooks/core/use-menu-item.tsx
4919
- var useMenuItem = (props) => {
4920
- const { menu, activeMenuId } = props;
4921
- const model = menu?.action?.res_model;
4922
- const aid = menu?.action?.id?.id;
4923
- const id = menu?.id;
4924
- const context = getEnv5().context;
4925
- const queryActionDetail = useGetActionDetail({
4926
- aid,
4927
- id,
4928
- model,
4929
- context,
4930
- enabled: true,
4931
- queryKey: [`action-${aid}`]
4932
- }).data;
4933
- const [path, setPath] = useState5("");
4934
- const handleClick = () => {
4935
- if (location?.pathname === "/list/menu" && activeMenuId === menu?.id) {
4936
- return;
4937
- }
4938
- const hasListView = queryActionDetail.views.some(
4939
- ([id2, type]) => type === "list"
4940
- );
4941
- const viewType = hasListView ? "list" : "form";
4942
- const isAccountPayment = menu?.action?.res_model === "account.payment" && menu?.action?.id?.id === 1551;
4943
- const isConvertCurrencyMenu = menu?.action?.res_model === "currency.convert" && menu?.action?.id?.id === 1562;
4944
- const path2 = (0, utils_exports.formatUrlPath)({
4945
- viewType,
4946
- actionPath: isConvertCurrencyMenu ? "menu" : isAccountPayment ? "menu" : menu?.action?.path || "menu",
4947
- aid: menu?.action?.id?.id,
4948
- model: queryActionDetail.res_model
4949
- });
4950
- setPath(path2);
4951
- };
4952
- return { handleClick, path, queryActionDetail };
4953
- };
4954
-
4955
4891
  // src/hooks/utils/use-click-outside.ts
4956
4892
  import { useEffect as useEffect7, useRef as useRef2 } from "react";
4957
4893
  var DEFAULT_EVENTS = ["mousedown", "touchstart"];
@@ -4984,9 +4920,9 @@ var useClickOutside = ({
4984
4920
  };
4985
4921
 
4986
4922
  // src/hooks/utils/use-debounce.ts
4987
- import { useEffect as useEffect8, useState as useState6 } from "react";
4923
+ import { useEffect as useEffect8, useState as useState5 } from "react";
4988
4924
  function useDebounce(value, delay) {
4989
- const [debouncedValue, setDebouncedValue] = useState6(value);
4925
+ const [debouncedValue, setDebouncedValue] = useState5(value);
4990
4926
  useEffect8(() => {
4991
4927
  const handler = setTimeout(() => {
4992
4928
  setDebouncedValue(value);
@@ -5244,18 +5180,18 @@ var ChevronBottomIcon = ({
5244
5180
  };
5245
5181
 
5246
5182
  // src/widget/basic/status-dropdown-field/controller.ts
5247
- import { useEffect as useEffect9, useRef as useRef3, useState as useState7 } from "react";
5248
- import { getEnv as getEnv6 } from "@fctc/interface-logic/environment";
5183
+ import { useEffect as useEffect9, useRef as useRef3, useState as useState6 } from "react";
5184
+ import { getEnv as getEnv5 } from "@fctc/interface-logic/environment";
5249
5185
  import { useSave } from "@fctc/interface-logic/hooks";
5250
5186
  var statusDropdownController = (props) => {
5251
5187
  const { selection, isForm, id, model, name, state, onRefetch } = props;
5252
- const env = getEnv6();
5188
+ const env = getEnv5();
5253
5189
  const colors = {
5254
5190
  normal: "bg-[#e9ecef]",
5255
5191
  done: "bg-primary",
5256
5192
  blocked: "bg-red-500"
5257
5193
  };
5258
- const [isOpen, setIsOpen] = useState7(false);
5194
+ const [isOpen, setIsOpen] = useState6(false);
5259
5195
  const buttonRef = useRef3(null);
5260
5196
  useEffect9(() => {
5261
5197
  const handleClickOutside = (event) => {
@@ -5298,7 +5234,27 @@ var statusDropdownController = (props) => {
5298
5234
  };
5299
5235
 
5300
5236
  // src/widget/basic/many2one-field/controller.ts
5301
- import { useCallback as useCallback2, useEffect as useEffect10, useMemo as useMemo9, useState as useState8 } from "react";
5237
+ import { useCallback as useCallback2, useEffect as useEffect10, useMemo as useMemo9, useState as useState7 } from "react";
5238
+
5239
+ // src/utils.ts
5240
+ var utils_exports = {};
5241
+ __export(utils_exports, {
5242
+ API_APP_URL: () => API_APP_URL,
5243
+ API_PRESCHOOL_URL: () => API_PRESCHOOL_URL,
5244
+ STORAGES: () => STORAGES,
5245
+ combineContexts: () => combineContexts,
5246
+ convertFieldsToArray: () => convertFieldsToArray,
5247
+ countSum: () => countSum,
5248
+ getDateRange: () => getDateRange,
5249
+ languages: () => languages,
5250
+ mergeButtons: () => mergeButtons,
5251
+ setStorageItemAsync: () => setStorageItemAsync,
5252
+ useGetRowIds: () => useGetRowIds,
5253
+ useSelectionState: () => useSelectionState,
5254
+ useStorageState: () => useStorageState
5255
+ });
5256
+ __reExport(utils_exports, utils_star2);
5257
+ import * as utils_star2 from "@fctc/interface-logic/utils";
5302
5258
 
5303
5259
  // src/provider.ts
5304
5260
  var provider_exports = {};
@@ -5320,13 +5276,13 @@ var many2oneFieldController = (props) => {
5320
5276
  options: fieldOptions,
5321
5277
  showDetail
5322
5278
  } = props;
5323
- const [options, setOptions] = useState8([]);
5324
- const [inputValue, setInputValue] = useState8("");
5279
+ const [options, setOptions] = useState7([]);
5280
+ const [inputValue, setInputValue] = useState7("");
5325
5281
  const [debouncedInputValue] = useDebounce(inputValue, 1e3);
5326
- const [isShowModalMany2Many, setIsShowModalMany2Many] = useState8(false);
5327
- const [tempSelectedOption, setTempSelectedOption] = useState8(null);
5328
- const [domainModal, setDomainModal] = useState8(null);
5329
- const [domainObject, setDomainObject] = useState8(null);
5282
+ const [isShowModalMany2Many, setIsShowModalMany2Many] = useState7(false);
5283
+ const [tempSelectedOption, setTempSelectedOption] = useState7(null);
5284
+ const [domainModal, setDomainModal] = useState7(null);
5285
+ const [domainObject, setDomainObject] = useState7(null);
5330
5286
  const actionData = sessionStorageUtils.getActionData();
5331
5287
  const { menuList } = (0, store_exports.useAppSelector)(store_exports.selectNavbar);
5332
5288
  const { context } = (0, store_exports.useAppSelector)(store_exports.selectEnv);
@@ -5337,7 +5293,7 @@ var many2oneFieldController = (props) => {
5337
5293
  ...fieldContext,
5338
5294
  ...context
5339
5295
  };
5340
- const { useGetSelection: useGetSelection3 } = (0, provider_exports.useService)();
5296
+ const { useGetSelection: useGetSelection2 } = (0, provider_exports.useService)();
5341
5297
  const data = {
5342
5298
  model: relation,
5343
5299
  domain: domainObject,
@@ -5353,7 +5309,7 @@ var many2oneFieldController = (props) => {
5353
5309
  data: dataOfSelection,
5354
5310
  refetch,
5355
5311
  isFetching
5356
- } = useGetSelection3({
5312
+ } = useGetSelection2({
5357
5313
  data,
5358
5314
  queryKey,
5359
5315
  enabled: false
@@ -5479,13 +5435,13 @@ var many2oneFieldController = (props) => {
5479
5435
  };
5480
5436
 
5481
5437
  // src/widget/basic/many2one-button-field/controller.ts
5482
- import { getEnv as getEnv7 } from "@fctc/interface-logic/environment";
5438
+ import { getEnv as getEnv6 } from "@fctc/interface-logic/environment";
5483
5439
  import { useGetSelection } from "@fctc/interface-logic/hooks";
5484
5440
  import { evalJSONDomain as evalJSONDomain3, evalJSONContext as evalJSONContext3 } from "@fctc/interface-logic/utils";
5485
5441
  var many2oneButtonController = (props) => {
5486
5442
  const { domain, methods, relation } = props;
5487
5443
  const actionDataString = sessionStorage.getItem("actionData");
5488
- const env = getEnv7();
5444
+ const env = getEnv6();
5489
5445
  const domainObject = evalJSONDomain3(domain, methods?.getValues() || {});
5490
5446
  const actionData = actionDataString && actionDataString !== "undefined" ? JSON.parse(actionDataString) : {};
5491
5447
  const { data: dataOfSelection } = useGetSelection({
@@ -5506,7 +5462,7 @@ var many2oneButtonController = (props) => {
5506
5462
  };
5507
5463
 
5508
5464
  // src/widget/basic/many2many-field/controller.ts
5509
- import { useEffect as useEffect11, useMemo as useMemo10, useState as useState9 } from "react";
5465
+ import { useEffect as useEffect11, useMemo as useMemo10, useState as useState8 } from "react";
5510
5466
  import {
5511
5467
  useAppDispatch as useAppDispatch5,
5512
5468
  setFirstDomain,
@@ -5537,9 +5493,9 @@ var many2manyFieldController = (props) => {
5537
5493
  const appDispatch = useAppDispatch5();
5538
5494
  const actionData = sessionStorageUtils.getActionData();
5539
5495
  const [debouncedPage] = useDebounce(page, 500);
5540
- const [order, setOrder] = useState9();
5541
- const [isLoadedData, setIsLoadedData] = useState9(false);
5542
- const [domainMany2Many, setDomainMany2Many] = useState9(domain);
5496
+ const [order, setOrder] = useState8();
5497
+ const [isLoadedData, setIsLoadedData] = useState8(false);
5498
+ const [domainMany2Many, setDomainMany2Many] = useState8(domain);
5543
5499
  const { env } = (0, provider_exports.useEnv)();
5544
5500
  const { useGetView: useGetView2, useGetListData: useGetListData3, useGetFormView } = (0, provider_exports.useService)();
5545
5501
  const viewParams = {
@@ -5696,8 +5652,6 @@ var many2manyFieldController = (props) => {
5696
5652
  // src/widget/basic/many2many-tags-field/controller.ts
5697
5653
  import { useMemo as useMemo11 } from "react";
5698
5654
  import { WIDGETAVATAR, WIDGETCOLOR } from "@fctc/interface-logic/constants";
5699
- import { getEnv as getEnv8 } from "@fctc/interface-logic/environment";
5700
- import { useGetSelection as useGetSelection2 } from "@fctc/interface-logic/hooks";
5701
5655
  import { evalJSONContext as evalJSONContext5, evalJSONDomain as evalJSONDomain4 } from "@fctc/interface-logic/utils";
5702
5656
  var many2manyTagsController = (props) => {
5703
5657
  const {
@@ -5709,7 +5663,8 @@ var many2manyTagsController = (props) => {
5709
5663
  placeholderNoOption
5710
5664
  } = props;
5711
5665
  const isUser = relation === "res.users" || relation === "res.partner";
5712
- const env = getEnv8();
5666
+ const { env } = (0, provider_exports.useEnv)();
5667
+ const { useGetSelection: useGetSelection2 } = (0, provider_exports.useService)();
5713
5668
  const addtionalFields = optionsFields ? evalJSONContext5(optionsFields) : null;
5714
5669
  const domainObject = useMemo11(
5715
5670
  () => evalJSONDomain4(domain, JSON.parse(JSON.stringify(formValues || {}))),
@@ -5748,16 +5703,15 @@ var many2manyTagsController = (props) => {
5748
5703
  options,
5749
5704
  customNoOptionsMessage,
5750
5705
  tranfer,
5751
- dataOfSelection,
5752
5706
  isUser
5753
5707
  };
5754
5708
  };
5755
5709
 
5756
5710
  // src/widget/basic/status-bar-field/controller.ts
5757
- import { useState as useState10 } from "react";
5711
+ import { useState as useState9 } from "react";
5758
5712
  import { evalJSONDomain as evalJSONDomain5 } from "@fctc/interface-logic/utils";
5759
5713
  var durationController = (props) => {
5760
- const { relation, domain, formValues, name, id, model, onRefetch } = props;
5714
+ const { relation, domain, formValues, name, id, model, onRefetch, enabled } = props;
5761
5715
  const specification = {
5762
5716
  id: 0,
5763
5717
  name: "",
@@ -5765,8 +5719,8 @@ var durationController = (props) => {
5765
5719
  };
5766
5720
  const { useGetListData: useGetListData3, useChangeStatus } = (0, provider_exports.useService)();
5767
5721
  const { env } = (0, provider_exports.useEnv)();
5768
- const [disabled, setDisabled] = useState10(false);
5769
- const [modelStatus, setModalStatus] = useState10(false);
5722
+ const [disabled, setDisabled] = useState9(false);
5723
+ const [modelStatus, setModalStatus] = useState9(false);
5770
5724
  const queryKey = [`data-status-duration`, specification];
5771
5725
  const listDataProps = {
5772
5726
  model: relation,
@@ -5781,7 +5735,11 @@ var durationController = (props) => {
5781
5735
  },
5782
5736
  sort: ""
5783
5737
  };
5784
- const { data: dataResponse } = useGetListData3(listDataProps, queryKey);
5738
+ const { data: dataResponse } = useGetListData3(
5739
+ listDataProps,
5740
+ queryKey,
5741
+ enabled
5742
+ );
5785
5743
  const { mutate: fetchChangeStatus } = useChangeStatus();
5786
5744
  const handleClick = async (stage_id) => {
5787
5745
  setDisabled(true);
@@ -5817,32 +5775,18 @@ var durationController = (props) => {
5817
5775
  };
5818
5776
 
5819
5777
  // src/widget/basic/priority-field/controller.ts
5820
- import { useSave as useSave2 } from "@fctc/interface-logic/hooks";
5821
5778
  import { evalJSONContext as evalJSONContext6 } from "@fctc/interface-logic/utils";
5822
5779
  var priorityFieldController = (props) => {
5823
- const {
5824
- value,
5825
- isForm,
5826
- name,
5827
- methods,
5828
- onChange,
5829
- model,
5830
- selection,
5831
- id,
5832
- actionData,
5833
- viewData,
5834
- context
5835
- } = props;
5780
+ const { name, model, id, actionData, context, onChange } = props;
5836
5781
  const _context = { ...evalJSONContext6(actionData?.context) };
5837
5782
  const contextObject = { ...context, ..._context };
5838
- const defaultPriority = parseInt(value) + 1;
5839
- const label = viewData?.models?.[model]?.[name ?? ""]?.string ?? name;
5783
+ const { useSave: useSave2 } = (0, provider_exports.useService)();
5840
5784
  const { mutateAsync: fetchSave } = useSave2();
5841
5785
  const savePriorities = async ({
5842
- value: value2,
5786
+ value,
5843
5787
  resetPriority
5844
5788
  }) => {
5845
- const priorityValue = value2 <= 0 ? 0 : value2 - 1;
5789
+ const priorityValue = value <= 0 ? 0 : value - 1;
5846
5790
  try {
5847
5791
  fetchSave({
5848
5792
  ids: id ? [id] : [],
@@ -5860,22 +5804,15 @@ var priorityFieldController = (props) => {
5860
5804
  }
5861
5805
  };
5862
5806
  return {
5863
- selection,
5864
- isForm,
5865
- methods,
5866
- defaultPriority,
5867
- savePriorities,
5868
- label,
5869
- id,
5870
- onChange
5807
+ savePriorities
5871
5808
  };
5872
5809
  };
5873
5810
 
5874
5811
  // src/widget/basic/download-file-field/controller.ts
5875
- import { useId, useState as useState11 } from "react";
5812
+ import { useId, useState as useState10 } from "react";
5876
5813
  var downloadFileController = () => {
5877
5814
  const inputId = useId();
5878
- const [file, setFile] = useState11(null);
5815
+ const [file, setFile] = useState10(null);
5879
5816
  const handleFileChange = (e) => {
5880
5817
  setFile(e.target.files[0]);
5881
5818
  };
@@ -6807,11 +6744,11 @@ var dateFieldController = (props) => {
6807
6744
  };
6808
6745
 
6809
6746
  // src/widget/basic/copy-link-button/controller.ts
6810
- import { useState as useState12 } from "react";
6747
+ import { useState as useState11 } from "react";
6811
6748
  import { copyTextToClipboard } from "@fctc/interface-logic/utils";
6812
6749
  var copyLinkButtonController = (props) => {
6813
6750
  const { value, defaultValue } = props;
6814
- const [isCopied, setIsCopied] = useState12(false);
6751
+ const [isCopied, setIsCopied] = useState11(false);
6815
6752
  const handleCopyToClipboard = async (value2) => {
6816
6753
  await copyTextToClipboard(value2);
6817
6754
  setIsCopied(true);
@@ -6830,11 +6767,11 @@ import { evalJSONContext as evalJSONContext7 } from "@fctc/interface-logic/utils
6830
6767
  var colorFieldController = (props) => {
6831
6768
  const { value, isForm, name, formValues, idForm, model, actionData } = props;
6832
6769
  const { env } = (0, provider_exports.useEnv)();
6833
- const { useSave: useSave3 } = (0, provider_exports.useService)();
6770
+ const { useSave: useSave2 } = (0, provider_exports.useService)();
6834
6771
  const _context = { ...evalJSONContext7(actionData?.context) || {} };
6835
6772
  const contextObject = { ...env.context, ..._context };
6836
6773
  const idDefault = isForm ? idForm : formValues?.id;
6837
- const { mutate: onSave } = useSave3();
6774
+ const { mutate: onSave } = useSave2();
6838
6775
  const savePickColor = async (colorObject) => {
6839
6776
  const { id } = colorObject;
6840
6777
  if (value === id) return;
@@ -6859,14 +6796,14 @@ var colorFieldController = (props) => {
6859
6796
  };
6860
6797
 
6861
6798
  // src/widget/basic/binary-field/controller.ts
6862
- import { useEffect as useEffect12, useId as useId2, useRef as useRef4, useState as useState13 } from "react";
6799
+ import { useEffect as useEffect12, useId as useId2, useRef as useRef4, useState as useState12 } from "react";
6863
6800
  import { isBase64Image } from "@fctc/interface-logic/utils";
6864
6801
  var binaryFieldController = (props) => {
6865
6802
  const { name, methods, readonly = false, value } = props;
6866
6803
  const inputId = useId2();
6867
- const [selectedImage, setSelectedImage] = useState13(null);
6868
- const [initialImage, setInitialImage] = useState13(value || null);
6869
- const [isInsideTable, setIsInsideTable] = useState13(false);
6804
+ const [selectedImage, setSelectedImage] = useState12(null);
6805
+ const [initialImage, setInitialImage] = useState12(value || null);
6806
+ const [isInsideTable, setIsInsideTable] = useState12(false);
6870
6807
  const { setValue } = methods;
6871
6808
  const binaryRef = useRef4(null);
6872
6809
  const convertUrlToBase64 = async (url) => {
@@ -6957,20 +6894,25 @@ var binaryFieldController = (props) => {
6957
6894
  };
6958
6895
 
6959
6896
  // src/widget/advance/table/table-body/controller.ts
6960
- import { useAppDispatch as useAppDispatch6, setSelectedRowKeys } from "@fctc/interface-logic/store";
6897
+ import {
6898
+ useAppDispatch as useAppDispatch6,
6899
+ setSelectedRowKeys,
6900
+ useAppSelector as useAppSelector4,
6901
+ selectList as selectList3
6902
+ } from "@fctc/interface-logic/store";
6961
6903
  import { useEffect as useEffect13, useMemo as useMemo12 } from "react";
6962
6904
  var tableBodyController = (props) => {
6963
6905
  const {
6964
6906
  checkedAll,
6965
6907
  checkboxRef,
6966
6908
  setIsAutoSelect,
6967
- selectedRowKeys,
6968
6909
  row,
6969
6910
  isAutoSelect,
6970
6911
  selectedRowKeysRef,
6971
6912
  onClickRow
6972
6913
  } = props;
6973
6914
  const appDispatch = useAppDispatch6();
6915
+ const { selectedRowKeys } = useAppSelector4(selectList3);
6974
6916
  const checked = useMemo12(() => {
6975
6917
  if (!row?.id) return false;
6976
6918
  if (selectedRowKeys?.includes(row.id)) {
@@ -6986,7 +6928,6 @@ var tableBodyController = (props) => {
6986
6928
  return;
6987
6929
  }
6988
6930
  const newSelectedRowKeys = selectedRowKeys?.includes(row.id) ? selectedRowKeys?.filter((key) => key !== row.id) : [...selectedRowKeys, row.id];
6989
- console.log("newSelectedRowKeys", newSelectedRowKeys);
6990
6931
  appDispatch(setSelectedRowKeys(newSelectedRowKeys));
6991
6932
  };
6992
6933
  const handleClickRow = (col, row2) => {
@@ -7026,14 +6967,14 @@ var tableBodyController = (props) => {
7026
6967
  // src/widget/advance/table/table-head/controller.ts
7027
6968
  import {
7028
6969
  useAppDispatch as useAppDispatch7,
7029
- useAppSelector as useAppSelector4,
6970
+ useAppSelector as useAppSelector5,
7030
6971
  selectSearch as selectSearch3,
7031
6972
  setSelectedRowKeys as setSelectedRowKeys2
7032
6973
  } from "@fctc/interface-logic/store";
7033
6974
  var tableHeadController = (props) => {
7034
6975
  const { typeTable, rows, selectedRowKeysRef } = props;
7035
6976
  const appDispatch = useAppDispatch7();
7036
- const { groupByDomain } = useAppSelector4(selectSearch3);
6977
+ const { groupByDomain } = useAppSelector5(selectSearch3);
7037
6978
  const handleCheckBoxAll = (event) => {
7038
6979
  if (event?.target?.checked && typeTable === "list") {
7039
6980
  const allRowKeys = Array.isArray(rows) ? rows.map((record) => record?.id) : [];
@@ -7066,16 +7007,16 @@ var tableHeadController = (props) => {
7066
7007
  };
7067
7008
 
7068
7009
  // src/widget/advance/table/table-view/controller.ts
7069
- import { useEffect as useEffect14, useMemo as useMemo13, useRef as useRef5, useState as useState14 } from "react";
7010
+ import { useEffect as useEffect14, useMemo as useMemo13, useRef as useRef5, useState as useState13 } from "react";
7070
7011
  import {
7071
- useAppSelector as useAppSelector5,
7012
+ useAppSelector as useAppSelector6,
7072
7013
  selectSearch as selectSearch4,
7073
- selectList as selectList3
7014
+ selectList as selectList4
7074
7015
  } from "@fctc/interface-logic/store";
7075
7016
  import { domainHelper } from "@fctc/interface-logic/utils";
7076
7017
  var tableController = ({ data }) => {
7077
- const [rows, setRows] = useState14(data.records || []);
7078
- const [columns, setColumns] = useState14([]);
7018
+ const [rows, setRows] = useState13(data.records || []);
7019
+ const [columns, setColumns] = useState13([]);
7079
7020
  const dataModelFields = data.fields?.map((field) => {
7080
7021
  return {
7081
7022
  ...data.dataModel?.[field?.name],
@@ -7149,15 +7090,15 @@ var tableController = ({ data }) => {
7149
7090
  };
7150
7091
 
7151
7092
  // src/widget/advance/table/table-group/controller.ts
7152
- import { useEffect as useEffect15, useMemo as useMemo14, useState as useState15 } from "react";
7093
+ import { useEffect as useEffect15, useMemo as useMemo14, useState as useState14 } from "react";
7153
7094
  import {
7154
7095
  useOdooDataTransform,
7155
7096
  useGetListData as useGetListData2
7156
7097
  } from "@fctc/interface-logic/hooks";
7157
7098
  import {
7158
- useAppSelector as useAppSelector6,
7099
+ useAppSelector as useAppSelector7,
7159
7100
  selectSearch as selectSearch5,
7160
- selectList as selectList4,
7101
+ selectList as selectList5,
7161
7102
  useAppDispatch as useAppDispatch8,
7162
7103
  setSelectedRowKeys as setSelectedRowKeys3
7163
7104
  } from "@fctc/interface-logic/store";
@@ -7188,14 +7129,14 @@ var tableGroupController = (props) => {
7188
7129
  setIsAutoSelect,
7189
7130
  selectedRowKeysRef
7190
7131
  } = props;
7191
- const [pageGroup, setPageGroup] = useState15(0);
7192
- const { groupByDomain, selectedTags } = useAppSelector6(selectSearch5);
7193
- const { selectedRowKeys } = useAppSelector6(selectList4);
7132
+ const [pageGroup, setPageGroup] = useState14(0);
7133
+ const { groupByDomain, selectedTags } = useAppSelector7(selectSearch5);
7134
+ const { selectedRowKeys } = useAppSelector7(selectList5);
7194
7135
  const appDispatch = useAppDispatch8();
7195
7136
  const { toDataJS } = useOdooDataTransform();
7196
7137
  const initVal = toDataJS(row, viewData, model);
7197
- const [isShowGroup, setIsShowGroup] = useState15(false);
7198
- const [colEmptyGroup, setColEmptyGroup] = useState15({
7138
+ const [isShowGroup, setIsShowGroup] = useState14(false);
7139
+ const [colEmptyGroup, setColEmptyGroup] = useState14({
7199
7140
  fromStart: 1,
7200
7141
  fromEnd: 1
7201
7142
  });
@@ -7335,7 +7276,7 @@ import {
7335
7276
  evalJSONDomain as evalJSONDomain6,
7336
7277
  validateAndParseDate
7337
7278
  } from "@fctc/interface-logic/utils";
7338
- import { useCallback as useCallback3, useEffect as useEffect16, useState as useState16 } from "react";
7279
+ import { useCallback as useCallback3, useEffect as useEffect16, useState as useState15 } from "react";
7339
7280
  var searchController = ({
7340
7281
  viewData,
7341
7282
  actionData,
@@ -7344,11 +7285,11 @@ var searchController = ({
7344
7285
  setSearchMap,
7345
7286
  searchMap
7346
7287
  }) => {
7347
- const [filterBy, setFilterBy] = useState16(null);
7348
- const [searchBy, setSearchBy] = useState16(null);
7349
- const [groupBy, setGroupBy] = useState16(null);
7350
- const [selectedTags, setSelectedTags] = useState16(null);
7351
- const [searchString, setSearchString] = useState16("");
7288
+ const [filterBy, setFilterBy] = useState15(null);
7289
+ const [searchBy, setSearchBy] = useState15(null);
7290
+ const [groupBy, setGroupBy] = useState15(null);
7291
+ const [selectedTags, setSelectedTags] = useState15(null);
7292
+ const [searchString, setSearchString] = useState15("");
7352
7293
  const domainAction = actionData?.domain ? Array.isArray(actionData?.domain) ? [...actionData?.domain] : evalJSONDomain6(actionData?.domain, contextSearch) : [];
7353
7294
  const aid = actionData?.id;
7354
7295
  const model = actionData?.res_model;
@@ -7675,7 +7616,6 @@ export {
7675
7616
  useGetRowIds,
7676
7617
  useListData,
7677
7618
  useMenu,
7678
- useMenuItem,
7679
7619
  useProfile,
7680
7620
  useSelectionState,
7681
7621
  useStorageState,
package/dist/types.d.mts CHANGED
@@ -28,6 +28,7 @@ interface IInputFieldProps {
28
28
  domain?: any;
29
29
  idForm?: boolean;
30
30
  widget?: string;
31
+ aid?: string | number;
31
32
  }
32
33
 
33
34
  export type { IInputFieldProps, ValuePropsType };
package/dist/types.d.ts CHANGED
@@ -28,6 +28,7 @@ interface IInputFieldProps {
28
28
  domain?: any;
29
29
  idForm?: boolean;
30
30
  widget?: string;
31
+ aid?: string | number;
31
32
  }
32
33
 
33
34
  export type { IInputFieldProps, ValuePropsType };
package/dist/widget.d.mts CHANGED
@@ -84,7 +84,6 @@ declare const many2manyFieldController: (props: IMany2ManyControllerProps) => {
84
84
 
85
85
  interface IMany2ManyTagFieldProps extends IInputFieldProps {
86
86
  options: any;
87
- widget: string;
88
87
  placeholderNoOption: string;
89
88
  }
90
89
 
@@ -92,12 +91,12 @@ declare const many2manyTagsController: (props: IMany2ManyTagFieldProps) => {
92
91
  options: any;
93
92
  customNoOptionsMessage: () => string;
94
93
  tranfer: (data: any) => any;
95
- dataOfSelection: any;
96
94
  isUser: boolean;
97
95
  };
98
96
 
99
97
  interface IDurationFieldProps extends IInputFieldProps {
100
98
  id: any;
99
+ enabled?: any;
101
100
  }
102
101
 
103
102
  declare const durationController: (props: IDurationFieldProps) => {
@@ -109,25 +108,16 @@ declare const durationController: (props: IDurationFieldProps) => {
109
108
  };
110
109
 
111
110
  interface IPriorityFieldProps extends IInputFieldProps {
112
- selection: any;
113
111
  id: any;
114
112
  actionData: any;
115
- viewData: any;
116
113
  context: any;
117
114
  }
118
115
 
119
116
  declare const priorityFieldController: (props: IPriorityFieldProps) => {
120
- selection: any;
121
- isForm: boolean | undefined;
122
- methods: any;
123
- defaultPriority: number;
124
117
  savePriorities: ({ value, resetPriority, }: {
125
118
  value: number;
126
119
  resetPriority?: () => void;
127
120
  }) => Promise<void>;
128
- label: any;
129
- id: any;
130
- onChange: ((name: string, value: any) => void) | undefined;
131
121
  };
132
122
 
133
123
  declare const downloadFileController: () => {
@@ -191,11 +181,10 @@ interface ITableBodyProps {
191
181
  checkedAll: any;
192
182
  checkboxRef: any;
193
183
  setIsAutoSelect: any;
194
- selectedRowKeys: any;
195
184
  row: any;
196
185
  isAutoSelect: any;
197
186
  selectedRowKeysRef: any;
198
- onClickRow: any;
187
+ onClickRow?: any;
199
188
  }
200
189
 
201
190
  declare const tableBodyController: (props: ITableBodyProps) => {
package/dist/widget.d.ts CHANGED
@@ -84,7 +84,6 @@ declare const many2manyFieldController: (props: IMany2ManyControllerProps) => {
84
84
 
85
85
  interface IMany2ManyTagFieldProps extends IInputFieldProps {
86
86
  options: any;
87
- widget: string;
88
87
  placeholderNoOption: string;
89
88
  }
90
89
 
@@ -92,12 +91,12 @@ declare const many2manyTagsController: (props: IMany2ManyTagFieldProps) => {
92
91
  options: any;
93
92
  customNoOptionsMessage: () => string;
94
93
  tranfer: (data: any) => any;
95
- dataOfSelection: any;
96
94
  isUser: boolean;
97
95
  };
98
96
 
99
97
  interface IDurationFieldProps extends IInputFieldProps {
100
98
  id: any;
99
+ enabled?: any;
101
100
  }
102
101
 
103
102
  declare const durationController: (props: IDurationFieldProps) => {
@@ -109,25 +108,16 @@ declare const durationController: (props: IDurationFieldProps) => {
109
108
  };
110
109
 
111
110
  interface IPriorityFieldProps extends IInputFieldProps {
112
- selection: any;
113
111
  id: any;
114
112
  actionData: any;
115
- viewData: any;
116
113
  context: any;
117
114
  }
118
115
 
119
116
  declare const priorityFieldController: (props: IPriorityFieldProps) => {
120
- selection: any;
121
- isForm: boolean | undefined;
122
- methods: any;
123
- defaultPriority: number;
124
117
  savePriorities: ({ value, resetPriority, }: {
125
118
  value: number;
126
119
  resetPriority?: () => void;
127
120
  }) => Promise<void>;
128
- label: any;
129
- id: any;
130
- onChange: ((name: string, value: any) => void) | undefined;
131
121
  };
132
122
 
133
123
  declare const downloadFileController: () => {
@@ -191,11 +181,10 @@ interface ITableBodyProps {
191
181
  checkedAll: any;
192
182
  checkboxRef: any;
193
183
  setIsAutoSelect: any;
194
- selectedRowKeys: any;
195
184
  row: any;
196
185
  isAutoSelect: any;
197
186
  selectedRowKeysRef: any;
198
- onClickRow: any;
187
+ onClickRow?: any;
199
188
  }
200
189
 
201
190
  declare const tableBodyController: (props: ITableBodyProps) => {