@fctc/widget-logic 2.5.0 → 2.5.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/hooks.d.mts +220 -3
- package/dist/hooks.d.ts +220 -3
- package/dist/hooks.js +0 -3
- package/dist/hooks.mjs +0 -3
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +68 -42
- package/dist/index.mjs +83 -53
- package/dist/widget.d.mts +1 -3
- package/dist/widget.d.ts +1 -3
- package/dist/widget.js +68 -191
- package/dist/widget.mjs +83 -202
- package/package.json +1 -1
- package/dist/use-view-v2-BWHqxo3S.d.mts +0 -222
- package/dist/use-view-v2-BWHqxo3S.d.ts +0 -222
package/dist/widget.mjs
CHANGED
|
@@ -4373,34 +4373,6 @@ import * as utils_star from "@fctc/interface-logic/utils";
|
|
|
4373
4373
|
|
|
4374
4374
|
// src/hooks/core/use-view-v2.ts
|
|
4375
4375
|
import { useMemo as useMemo3 } from "react";
|
|
4376
|
-
var useViewV2 = ({
|
|
4377
|
-
action,
|
|
4378
|
-
context,
|
|
4379
|
-
aid,
|
|
4380
|
-
views,
|
|
4381
|
-
model
|
|
4382
|
-
}) => {
|
|
4383
|
-
const { useGetView: useGetView2 } = (0, provider_exports.useService)();
|
|
4384
|
-
const viewParams = useMemo3(() => {
|
|
4385
|
-
if (!action) {
|
|
4386
|
-
return void 0;
|
|
4387
|
-
}
|
|
4388
|
-
return {
|
|
4389
|
-
model,
|
|
4390
|
-
views,
|
|
4391
|
-
context,
|
|
4392
|
-
id: isNaN(Number(aid)) ? action?.id : aid
|
|
4393
|
-
};
|
|
4394
|
-
}, [action, context, aid]);
|
|
4395
|
-
const view = useGetView2(
|
|
4396
|
-
viewParams || {},
|
|
4397
|
-
!!viewParams
|
|
4398
|
-
);
|
|
4399
|
-
return {
|
|
4400
|
-
...view,
|
|
4401
|
-
context
|
|
4402
|
-
};
|
|
4403
|
-
};
|
|
4404
4376
|
|
|
4405
4377
|
// src/hooks/core/use-company.ts
|
|
4406
4378
|
import { useQuery as useQuery3 } from "@tanstack/react-query";
|
|
@@ -4416,47 +4388,12 @@ var AppProviderInitialValue = {
|
|
|
4416
4388
|
view: {}
|
|
4417
4389
|
};
|
|
4418
4390
|
var ReactContext = createContext(AppProviderInitialValue);
|
|
4419
|
-
var useAppProvider = () => {
|
|
4420
|
-
const context = useContext(ReactContext);
|
|
4421
|
-
if (!context) {
|
|
4422
|
-
return AppProviderInitialValue;
|
|
4423
|
-
}
|
|
4424
|
-
return context;
|
|
4425
|
-
};
|
|
4426
4391
|
|
|
4427
4392
|
// src/hooks/core/use-config.ts
|
|
4428
4393
|
import { useEffect as useEffect6 } from "react";
|
|
4429
4394
|
|
|
4430
4395
|
// src/hooks/core/use-get-specification.ts
|
|
4431
4396
|
import { useMemo as useMemo6 } from "react";
|
|
4432
|
-
var useGetSpecification = ({
|
|
4433
|
-
model,
|
|
4434
|
-
viewData,
|
|
4435
|
-
fields
|
|
4436
|
-
}) => {
|
|
4437
|
-
const baseModel = useMemo6(
|
|
4438
|
-
() => ({
|
|
4439
|
-
name: String(model),
|
|
4440
|
-
view: viewData || {},
|
|
4441
|
-
fields
|
|
4442
|
-
}),
|
|
4443
|
-
[model, viewData]
|
|
4444
|
-
);
|
|
4445
|
-
const initModel = useModel();
|
|
4446
|
-
const modelInstance = useMemo6(() => {
|
|
4447
|
-
if (viewData) {
|
|
4448
|
-
return initModel.initModel(baseModel);
|
|
4449
|
-
}
|
|
4450
|
-
return null;
|
|
4451
|
-
}, [baseModel, viewData]);
|
|
4452
|
-
const specification = useMemo6(() => {
|
|
4453
|
-
if (modelInstance) {
|
|
4454
|
-
return modelInstance.getSpecification();
|
|
4455
|
-
}
|
|
4456
|
-
return null;
|
|
4457
|
-
}, [modelInstance]);
|
|
4458
|
-
return { specification };
|
|
4459
|
-
};
|
|
4460
4397
|
|
|
4461
4398
|
// src/hooks/core/use-list-data.ts
|
|
4462
4399
|
import { useMemo as useMemo7, useState as useState6 } from "react";
|
|
@@ -4550,95 +4487,6 @@ var useGetRowIds = (tableRef) => {
|
|
|
4550
4487
|
return { rowIds, refresh: updateVisibleRowIds };
|
|
4551
4488
|
};
|
|
4552
4489
|
|
|
4553
|
-
// src/hooks/core/use-list-data.ts
|
|
4554
|
-
var useListData = ({
|
|
4555
|
-
action,
|
|
4556
|
-
context,
|
|
4557
|
-
viewData,
|
|
4558
|
-
model
|
|
4559
|
-
}) => {
|
|
4560
|
-
const { useGetListData: useGetListData2 } = (0, provider_exports.useService)();
|
|
4561
|
-
const [page, setPage] = useState6(0);
|
|
4562
|
-
const [pageLimit, setPageLimit] = useState6(10);
|
|
4563
|
-
const [groupByList, setGroupByList] = useState6(null);
|
|
4564
|
-
const [domain, setDomain] = useState6(null);
|
|
4565
|
-
const [order, setOrder] = useState6("");
|
|
4566
|
-
const [mode, setMode] = useState6("month");
|
|
4567
|
-
const [type, setType] = useState6("list");
|
|
4568
|
-
const [currentDate, setCurrentDate] = useState6(/* @__PURE__ */ new Date());
|
|
4569
|
-
const [selectedRowKeys, setSelectedRowKeys2] = useState6([]);
|
|
4570
|
-
const [debouncedPage] = useDebounce(page, 500);
|
|
4571
|
-
const [debouncedDomain] = useDebounce(domain, 500);
|
|
4572
|
-
const { specification } = useGetSpecification({
|
|
4573
|
-
model,
|
|
4574
|
-
viewData,
|
|
4575
|
-
fields: viewData?.views?.list?.fields
|
|
4576
|
-
});
|
|
4577
|
-
const listDataProps = useMemo7(() => {
|
|
4578
|
-
if (!viewData || !action || !context) {
|
|
4579
|
-
return null;
|
|
4580
|
-
}
|
|
4581
|
-
const domainParse = type === "calendar" ? getDateRange(currentDate, mode) : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : evalJSONDomain(action?.domain, context) : [];
|
|
4582
|
-
const limit = type === "calendar" ? 2500 : pageLimit;
|
|
4583
|
-
const offset = debouncedPage * pageLimit;
|
|
4584
|
-
const fields = type === "calendar" ? convertFieldsToArray(viewData?.views?.calendar?.fields) || [] : typeof groupByList === "object" ? groupByList?.fields : void 0;
|
|
4585
|
-
const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
|
|
4586
|
-
const sort = order ? order : viewData?.views?.list?.default_order ? formatSortingString(viewData?.views?.list?.default_order) : "";
|
|
4587
|
-
return {
|
|
4588
|
-
model: action.res_model,
|
|
4589
|
-
specification,
|
|
4590
|
-
domain: domainParse,
|
|
4591
|
-
limit,
|
|
4592
|
-
offset,
|
|
4593
|
-
fields,
|
|
4594
|
-
groupby,
|
|
4595
|
-
context,
|
|
4596
|
-
sort,
|
|
4597
|
-
type
|
|
4598
|
-
};
|
|
4599
|
-
}, [
|
|
4600
|
-
action,
|
|
4601
|
-
context,
|
|
4602
|
-
currentDate,
|
|
4603
|
-
groupByList,
|
|
4604
|
-
mode,
|
|
4605
|
-
order,
|
|
4606
|
-
debouncedPage,
|
|
4607
|
-
pageLimit,
|
|
4608
|
-
type,
|
|
4609
|
-
debouncedDomain
|
|
4610
|
-
]);
|
|
4611
|
-
const list = useGetListData2(
|
|
4612
|
-
listDataProps,
|
|
4613
|
-
[listDataProps],
|
|
4614
|
-
!!listDataProps && !!specification && !isObjectEmpty3(specification)
|
|
4615
|
-
);
|
|
4616
|
-
return {
|
|
4617
|
-
...list,
|
|
4618
|
-
state: {
|
|
4619
|
-
specification,
|
|
4620
|
-
type,
|
|
4621
|
-
page,
|
|
4622
|
-
mode,
|
|
4623
|
-
order,
|
|
4624
|
-
domain: listDataProps?.domain,
|
|
4625
|
-
pageLimit,
|
|
4626
|
-
groupByList,
|
|
4627
|
-
currentDate,
|
|
4628
|
-
selectedRowKeys,
|
|
4629
|
-
setType,
|
|
4630
|
-
setMode,
|
|
4631
|
-
setPage,
|
|
4632
|
-
setOrder,
|
|
4633
|
-
setDomain,
|
|
4634
|
-
setPageLimit,
|
|
4635
|
-
setGroupByList,
|
|
4636
|
-
setCurrentDate,
|
|
4637
|
-
setSelectedRowKeys: setSelectedRowKeys2
|
|
4638
|
-
}
|
|
4639
|
-
};
|
|
4640
|
-
};
|
|
4641
|
-
|
|
4642
4490
|
// src/store.ts
|
|
4643
4491
|
var store_exports = {};
|
|
4644
4492
|
__reExport(store_exports, store_star);
|
|
@@ -4852,27 +4700,69 @@ var many2oneButtonController = (props) => {
|
|
|
4852
4700
|
};
|
|
4853
4701
|
|
|
4854
4702
|
// src/widget/basic/many2many-field/controller.ts
|
|
4855
|
-
import { useEffect as useEffect11, useState as useState8 } from "react";
|
|
4856
|
-
import {
|
|
4703
|
+
import { useEffect as useEffect11, useMemo as useMemo9, useState as useState8 } from "react";
|
|
4704
|
+
import {
|
|
4705
|
+
evalJSONContext as evalJSONContext4,
|
|
4706
|
+
evalJSONDomain as evalJSONDomain4,
|
|
4707
|
+
formatSortingString as formatSortingString2
|
|
4708
|
+
} from "@fctc/interface-logic/utils";
|
|
4857
4709
|
var many2manyFieldController = (props) => {
|
|
4858
|
-
const {
|
|
4710
|
+
const {
|
|
4711
|
+
relation,
|
|
4712
|
+
domain,
|
|
4713
|
+
context,
|
|
4714
|
+
options,
|
|
4715
|
+
tab,
|
|
4716
|
+
setSelectedRowKeys: setSelectedRowKeys2,
|
|
4717
|
+
groupByDomain,
|
|
4718
|
+
enabled: enabledCallAPI,
|
|
4719
|
+
actionData
|
|
4720
|
+
} = props;
|
|
4859
4721
|
const { env } = (0, provider_exports.useEnv)();
|
|
4860
|
-
const { useGetFormView: useGetFormView2 } = (0, provider_exports.useService)();
|
|
4722
|
+
const { useGetView: useGetView2, useGetListData: useGetListData2, useGetFormView: useGetFormView2 } = (0, provider_exports.useService)();
|
|
4723
|
+
const [order, setOrder] = useState8();
|
|
4861
4724
|
const [page, setPage] = useState8(0);
|
|
4862
4725
|
const [domainMany2Many, setDomainMany2Many] = useState8(null);
|
|
4863
|
-
const
|
|
4726
|
+
const [debouncedPage] = useDebounce(page, 500);
|
|
4864
4727
|
const contextObject = {
|
|
4865
4728
|
...env.context,
|
|
4866
4729
|
...context || {}
|
|
4867
4730
|
};
|
|
4868
|
-
const
|
|
4869
|
-
model:
|
|
4731
|
+
const viewParams = {
|
|
4732
|
+
model: relation,
|
|
4870
4733
|
views: [
|
|
4871
4734
|
[false, "list"],
|
|
4872
4735
|
[false, "search"]
|
|
4873
4736
|
],
|
|
4874
4737
|
context: contextObject
|
|
4875
|
-
}
|
|
4738
|
+
};
|
|
4739
|
+
const { data: viewResponse } = useGetView2(viewParams, enabledCallAPI);
|
|
4740
|
+
const baseModel = useMemo9(
|
|
4741
|
+
() => ({
|
|
4742
|
+
name: String(relation),
|
|
4743
|
+
view: viewResponse || {},
|
|
4744
|
+
actContext: contextObject,
|
|
4745
|
+
fields: [
|
|
4746
|
+
...Object.values(viewResponse?.views?.list?.fields ?? {}),
|
|
4747
|
+
...tab?.fields ? tab.fields : []
|
|
4748
|
+
]
|
|
4749
|
+
}),
|
|
4750
|
+
[relation, viewResponse]
|
|
4751
|
+
);
|
|
4752
|
+
const initModel = useModel();
|
|
4753
|
+
const modelInstance = useMemo9(() => {
|
|
4754
|
+
if (viewResponse) {
|
|
4755
|
+
return initModel.initModel(baseModel);
|
|
4756
|
+
}
|
|
4757
|
+
return null;
|
|
4758
|
+
}, [baseModel, viewResponse]);
|
|
4759
|
+
const specification = useMemo9(() => {
|
|
4760
|
+
if (modelInstance) {
|
|
4761
|
+
return modelInstance.getSpecification();
|
|
4762
|
+
}
|
|
4763
|
+
return null;
|
|
4764
|
+
}, [modelInstance]);
|
|
4765
|
+
const default_order = viewResponse && viewResponse?.views?.list?.default_order;
|
|
4876
4766
|
const optionsObject = tab?.options ? evalJSONContext4(tab?.options) : (options ? evalJSONContext4(options) : {}) || {};
|
|
4877
4767
|
const fetchData = async () => {
|
|
4878
4768
|
try {
|
|
@@ -4883,17 +4773,32 @@ var many2manyFieldController = (props) => {
|
|
|
4883
4773
|
console.log(err);
|
|
4884
4774
|
}
|
|
4885
4775
|
};
|
|
4776
|
+
const queryKey = [
|
|
4777
|
+
`view-${relation}`,
|
|
4778
|
+
specification,
|
|
4779
|
+
domainMany2Many,
|
|
4780
|
+
debouncedPage,
|
|
4781
|
+
groupByDomain,
|
|
4782
|
+
order
|
|
4783
|
+
];
|
|
4784
|
+
const data = {
|
|
4785
|
+
model: relation,
|
|
4786
|
+
specification,
|
|
4787
|
+
domain: domainMany2Many,
|
|
4788
|
+
offset: debouncedPage * 10,
|
|
4789
|
+
limit: 10,
|
|
4790
|
+
context: contextObject,
|
|
4791
|
+
fields: groupByDomain?.fields,
|
|
4792
|
+
groupby: [groupByDomain?.contexts[0]?.group_by],
|
|
4793
|
+
sort: order ? order : default_order ? formatSortingString2(default_order) : ""
|
|
4794
|
+
};
|
|
4795
|
+
const enabled = enabledCallAPI && !!specification && !!relation && !!domainMany2Many && !!viewResponse;
|
|
4886
4796
|
const {
|
|
4887
4797
|
data: dataResponse,
|
|
4798
|
+
isLoading,
|
|
4888
4799
|
isFetched,
|
|
4889
|
-
isPlaceholderData
|
|
4890
|
-
|
|
4891
|
-
} = useListData({
|
|
4892
|
-
action,
|
|
4893
|
-
context,
|
|
4894
|
-
model: String(relation),
|
|
4895
|
-
viewData: viewResponse
|
|
4896
|
-
});
|
|
4800
|
+
isPlaceholderData
|
|
4801
|
+
} = useGetListData2(data, queryKey, enabled);
|
|
4897
4802
|
useEffect11(() => {
|
|
4898
4803
|
if (viewResponse) {
|
|
4899
4804
|
fetchData();
|
|
@@ -4924,31 +4829,7 @@ var many2manyFieldController = (props) => {
|
|
|
4924
4829
|
)?.map((col) => ({ ...col.field })) ?? []
|
|
4925
4830
|
]
|
|
4926
4831
|
});
|
|
4927
|
-
const {
|
|
4928
|
-
refetch,
|
|
4929
|
-
data: dataFormViewResponse,
|
|
4930
|
-
isSuccess
|
|
4931
|
-
} = useGetFormView2({
|
|
4932
|
-
data: {
|
|
4933
|
-
id: null,
|
|
4934
|
-
model: relation ?? "",
|
|
4935
|
-
context: contextObject
|
|
4936
|
-
},
|
|
4937
|
-
queryKey: [`form-view-action-${relation}`],
|
|
4938
|
-
enabled: false
|
|
4939
|
-
});
|
|
4940
|
-
useEffect11(() => {
|
|
4941
|
-
if (isSuccess && dataFormViewResponse) {
|
|
4942
|
-
sessionStorage.setItem("actionData", JSON.stringify(dataFormViewResponse));
|
|
4943
|
-
window.location.href = `/form/menu?model=${relation}`;
|
|
4944
|
-
}
|
|
4945
|
-
}, [isSuccess]);
|
|
4946
4832
|
const handleCreateNewOnPage = async () => {
|
|
4947
|
-
try {
|
|
4948
|
-
refetch();
|
|
4949
|
-
} catch (error) {
|
|
4950
|
-
console.log(error);
|
|
4951
|
-
}
|
|
4952
4833
|
};
|
|
4953
4834
|
return {
|
|
4954
4835
|
handleCreateNewOnPage,
|
|
@@ -4971,7 +4852,7 @@ var many2manyFieldController = (props) => {
|
|
|
4971
4852
|
};
|
|
4972
4853
|
|
|
4973
4854
|
// src/widget/basic/many2many-tags-field/controller.ts
|
|
4974
|
-
import { useMemo as
|
|
4855
|
+
import { useMemo as useMemo10 } from "react";
|
|
4975
4856
|
import { WIDGETAVATAR, WIDGETCOLOR } from "@fctc/interface-logic/constants";
|
|
4976
4857
|
import { evalJSONContext as evalJSONContext5, evalJSONDomain as evalJSONDomain5 } from "@fctc/interface-logic/utils";
|
|
4977
4858
|
var many2manyTagsController = (props) => {
|
|
@@ -4989,7 +4870,7 @@ var many2manyTagsController = (props) => {
|
|
|
4989
4870
|
const { env } = (0, provider_exports.useEnv)();
|
|
4990
4871
|
const { useGetSelection: useGetSelection3 } = (0, provider_exports.useService)();
|
|
4991
4872
|
const addtionalFields = optionsFields ? evalJSONContext5(optionsFields) : null;
|
|
4992
|
-
const domainObject =
|
|
4873
|
+
const domainObject = useMemo10(
|
|
4993
4874
|
() => evalJSONDomain5(domain, JSON.parse(JSON.stringify(formValues || {}))),
|
|
4994
4875
|
[domain, formValues]
|
|
4995
4876
|
);
|
|
@@ -6221,7 +6102,7 @@ var binaryFieldController = (props) => {
|
|
|
6221
6102
|
};
|
|
6222
6103
|
|
|
6223
6104
|
// src/widget/advance/table/table-head/controller.ts
|
|
6224
|
-
import { useMemo as
|
|
6105
|
+
import { useMemo as useMemo11, useRef as useRef5 } from "react";
|
|
6225
6106
|
var tableHeadController = (props) => {
|
|
6226
6107
|
const {
|
|
6227
6108
|
typeTable,
|
|
@@ -6234,19 +6115,19 @@ var tableHeadController = (props) => {
|
|
|
6234
6115
|
const { rowIds: recordIds } = useGetRowIds(tableRef);
|
|
6235
6116
|
const selectedRowKeysRef = useRef5(recordIds);
|
|
6236
6117
|
const isGroupTable = typeTable === "group";
|
|
6237
|
-
const recordsCheckedGroup =
|
|
6118
|
+
const recordsCheckedGroup = useMemo11(() => {
|
|
6238
6119
|
if (!rows || !groupByList) return 0;
|
|
6239
6120
|
const groupBy = typeof groupByList === "object" ? groupByList?.contexts?.[0]?.group_by : void 0;
|
|
6240
6121
|
return countSum(rows, groupBy);
|
|
6241
6122
|
}, [rows, groupByList]);
|
|
6242
|
-
const isAllGroupChecked =
|
|
6123
|
+
const isAllGroupChecked = useMemo11(() => {
|
|
6243
6124
|
if (!isGroupTable || !selectedRowKeys?.length) return false;
|
|
6244
6125
|
const selectedLength = selectedRowKeys.filter((id) => id !== -1).length;
|
|
6245
6126
|
const allRecordsSelected = recordIds.length === selectedRowKeys.length ? recordIds.length === selectedLength : false;
|
|
6246
6127
|
const allGroupsSelected = recordsCheckedGroup === selectedRowKeys.length;
|
|
6247
6128
|
return allGroupsSelected || allRecordsSelected;
|
|
6248
6129
|
}, [isGroupTable, selectedRowKeys, recordIds, recordsCheckedGroup]);
|
|
6249
|
-
const isAllNormalChecked =
|
|
6130
|
+
const isAllNormalChecked = useMemo11(() => {
|
|
6250
6131
|
if (isGroupTable || !selectedRowKeys?.length || !rows?.length) return false;
|
|
6251
6132
|
return selectedRowKeys.length === rows.length && selectedRowKeys.every(
|
|
6252
6133
|
(id) => rows.some((record) => record.id === id)
|
|
@@ -6376,7 +6257,7 @@ var tableController = ({ data }) => {
|
|
|
6376
6257
|
};
|
|
6377
6258
|
|
|
6378
6259
|
// src/widget/advance/table/table-group/controller.ts
|
|
6379
|
-
import { useEffect as useEffect14, useMemo as
|
|
6260
|
+
import { useEffect as useEffect14, useMemo as useMemo12, useState as useState14 } from "react";
|
|
6380
6261
|
import {
|
|
6381
6262
|
useAppSelector as useAppSelector2,
|
|
6382
6263
|
selectList
|
|
@@ -6404,7 +6285,7 @@ var tableGroupController = (props) => {
|
|
|
6404
6285
|
fromEnd: 1
|
|
6405
6286
|
});
|
|
6406
6287
|
const domain = row?.__domain;
|
|
6407
|
-
const processedData =
|
|
6288
|
+
const processedData = useMemo12(() => {
|
|
6408
6289
|
const calculateColSpanEmpty = () => {
|
|
6409
6290
|
const startIndex = columns.findIndex(
|
|
6410
6291
|
(col) => col.field.type === "monetary" && typeof row[col.key] === "number" || col.field.aggregator === "sum"
|
|
@@ -6419,7 +6300,7 @@ var tableGroupController = (props) => {
|
|
|
6419
6300
|
};
|
|
6420
6301
|
return calculateColSpanEmpty();
|
|
6421
6302
|
}, [columns, row]);
|
|
6422
|
-
const shouldFetchData =
|
|
6303
|
+
const shouldFetchData = useMemo12(() => {
|
|
6423
6304
|
return !!isShowGroup;
|
|
6424
6305
|
}, [isShowGroup]);
|
|
6425
6306
|
const enabled = shouldFetchData && !!processedData;
|
|
@@ -6621,7 +6502,7 @@ var searchController = ({
|
|
|
6621
6502
|
const formatDomain = () => {
|
|
6622
6503
|
if (domainAction) {
|
|
6623
6504
|
const domain2 = [];
|
|
6624
|
-
if (domainAction
|
|
6505
|
+
if (Array.isArray(domainAction) && domainAction.length > 0) {
|
|
6625
6506
|
if (Object.keys(searchMap).some((key) => !key.includes(SearchType.GROUP))) {
|
|
6626
6507
|
domain2.push("&");
|
|
6627
6508
|
}
|
package/package.json
CHANGED
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import * as _tanstack_query_core from '@tanstack/query-core';
|
|
2
|
-
|
|
3
|
-
declare const useCallAction: () => readonly [ActionResult | undefined, ({ aid, }: {
|
|
4
|
-
aid: number;
|
|
5
|
-
actionType?: string;
|
|
6
|
-
}) => Promise<ActionResult | undefined>];
|
|
7
|
-
type useCallActionType = ReturnType<typeof useCallAction>;
|
|
8
|
-
type ActionResultType = useCallActionType[0];
|
|
9
|
-
interface ActionResult {
|
|
10
|
-
id?: number;
|
|
11
|
-
name?: string;
|
|
12
|
-
type?: 'ir.actions.act_window' | string;
|
|
13
|
-
xml_id?: string;
|
|
14
|
-
path?: false | string;
|
|
15
|
-
help?: string;
|
|
16
|
-
binding_model_id?: false | number;
|
|
17
|
-
binding_type?: 'action' | string;
|
|
18
|
-
binding_view_types?: string;
|
|
19
|
-
display_name?: string;
|
|
20
|
-
view_id?: false | number;
|
|
21
|
-
domain?: false | any[];
|
|
22
|
-
context?: string;
|
|
23
|
-
res_id?: number;
|
|
24
|
-
res_model?: string;
|
|
25
|
-
target?: 'current' | 'new' | string;
|
|
26
|
-
view_mode?: string;
|
|
27
|
-
mobile_view_mode?: string;
|
|
28
|
-
views?: [number, string][];
|
|
29
|
-
limit?: number;
|
|
30
|
-
groups_id?: number[];
|
|
31
|
-
search_view_id?: [number, string];
|
|
32
|
-
embedded_action_ids?: number[];
|
|
33
|
-
filter?: false | any;
|
|
34
|
-
url?: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare const useViewV2: ({ action, context, aid, views, model, }: {
|
|
38
|
-
action?: ActionResultType;
|
|
39
|
-
context: any;
|
|
40
|
-
aid?: any;
|
|
41
|
-
views?: any;
|
|
42
|
-
model?: string;
|
|
43
|
-
}) => {
|
|
44
|
-
context: any;
|
|
45
|
-
data: ViewResponse;
|
|
46
|
-
error: Error;
|
|
47
|
-
isError: true;
|
|
48
|
-
isPending: false;
|
|
49
|
-
isLoading: false;
|
|
50
|
-
isLoadingError: false;
|
|
51
|
-
isRefetchError: true;
|
|
52
|
-
isSuccess: false;
|
|
53
|
-
isPlaceholderData: false;
|
|
54
|
-
status: "error";
|
|
55
|
-
dataUpdatedAt: number;
|
|
56
|
-
errorUpdatedAt: number;
|
|
57
|
-
failureCount: number;
|
|
58
|
-
failureReason: Error | null;
|
|
59
|
-
errorUpdateCount: number;
|
|
60
|
-
isFetched: boolean;
|
|
61
|
-
isFetchedAfterMount: boolean;
|
|
62
|
-
isFetching: boolean;
|
|
63
|
-
isInitialLoading: boolean;
|
|
64
|
-
isPaused: boolean;
|
|
65
|
-
isRefetching: boolean;
|
|
66
|
-
isStale: boolean;
|
|
67
|
-
isEnabled: boolean;
|
|
68
|
-
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
69
|
-
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
70
|
-
promise: Promise<ViewResponse>;
|
|
71
|
-
} | {
|
|
72
|
-
context: any;
|
|
73
|
-
data: ViewResponse;
|
|
74
|
-
error: null;
|
|
75
|
-
isError: false;
|
|
76
|
-
isPending: false;
|
|
77
|
-
isLoading: false;
|
|
78
|
-
isLoadingError: false;
|
|
79
|
-
isRefetchError: false;
|
|
80
|
-
isSuccess: true;
|
|
81
|
-
isPlaceholderData: false;
|
|
82
|
-
status: "success";
|
|
83
|
-
dataUpdatedAt: number;
|
|
84
|
-
errorUpdatedAt: number;
|
|
85
|
-
failureCount: number;
|
|
86
|
-
failureReason: Error | null;
|
|
87
|
-
errorUpdateCount: number;
|
|
88
|
-
isFetched: boolean;
|
|
89
|
-
isFetchedAfterMount: boolean;
|
|
90
|
-
isFetching: boolean;
|
|
91
|
-
isInitialLoading: boolean;
|
|
92
|
-
isPaused: boolean;
|
|
93
|
-
isRefetching: boolean;
|
|
94
|
-
isStale: boolean;
|
|
95
|
-
isEnabled: boolean;
|
|
96
|
-
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
97
|
-
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
98
|
-
promise: Promise<ViewResponse>;
|
|
99
|
-
} | {
|
|
100
|
-
context: any;
|
|
101
|
-
data: undefined;
|
|
102
|
-
error: Error;
|
|
103
|
-
isError: true;
|
|
104
|
-
isPending: false;
|
|
105
|
-
isLoading: false;
|
|
106
|
-
isLoadingError: true;
|
|
107
|
-
isRefetchError: false;
|
|
108
|
-
isSuccess: false;
|
|
109
|
-
isPlaceholderData: false;
|
|
110
|
-
status: "error";
|
|
111
|
-
dataUpdatedAt: number;
|
|
112
|
-
errorUpdatedAt: number;
|
|
113
|
-
failureCount: number;
|
|
114
|
-
failureReason: Error | null;
|
|
115
|
-
errorUpdateCount: number;
|
|
116
|
-
isFetched: boolean;
|
|
117
|
-
isFetchedAfterMount: boolean;
|
|
118
|
-
isFetching: boolean;
|
|
119
|
-
isInitialLoading: boolean;
|
|
120
|
-
isPaused: boolean;
|
|
121
|
-
isRefetching: boolean;
|
|
122
|
-
isStale: boolean;
|
|
123
|
-
isEnabled: boolean;
|
|
124
|
-
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
125
|
-
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
126
|
-
promise: Promise<ViewResponse>;
|
|
127
|
-
} | {
|
|
128
|
-
context: any;
|
|
129
|
-
data: undefined;
|
|
130
|
-
error: null;
|
|
131
|
-
isError: false;
|
|
132
|
-
isPending: true;
|
|
133
|
-
isLoading: true;
|
|
134
|
-
isLoadingError: false;
|
|
135
|
-
isRefetchError: false;
|
|
136
|
-
isSuccess: false;
|
|
137
|
-
isPlaceholderData: false;
|
|
138
|
-
status: "pending";
|
|
139
|
-
dataUpdatedAt: number;
|
|
140
|
-
errorUpdatedAt: number;
|
|
141
|
-
failureCount: number;
|
|
142
|
-
failureReason: Error | null;
|
|
143
|
-
errorUpdateCount: number;
|
|
144
|
-
isFetched: boolean;
|
|
145
|
-
isFetchedAfterMount: boolean;
|
|
146
|
-
isFetching: boolean;
|
|
147
|
-
isInitialLoading: boolean;
|
|
148
|
-
isPaused: boolean;
|
|
149
|
-
isRefetching: boolean;
|
|
150
|
-
isStale: boolean;
|
|
151
|
-
isEnabled: boolean;
|
|
152
|
-
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
153
|
-
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
154
|
-
promise: Promise<ViewResponse>;
|
|
155
|
-
} | {
|
|
156
|
-
context: any;
|
|
157
|
-
data: undefined;
|
|
158
|
-
error: null;
|
|
159
|
-
isError: false;
|
|
160
|
-
isPending: true;
|
|
161
|
-
isLoadingError: false;
|
|
162
|
-
isRefetchError: false;
|
|
163
|
-
isSuccess: false;
|
|
164
|
-
isPlaceholderData: false;
|
|
165
|
-
status: "pending";
|
|
166
|
-
dataUpdatedAt: number;
|
|
167
|
-
errorUpdatedAt: number;
|
|
168
|
-
failureCount: number;
|
|
169
|
-
failureReason: Error | null;
|
|
170
|
-
errorUpdateCount: number;
|
|
171
|
-
isFetched: boolean;
|
|
172
|
-
isFetchedAfterMount: boolean;
|
|
173
|
-
isFetching: boolean;
|
|
174
|
-
isLoading: boolean;
|
|
175
|
-
isInitialLoading: boolean;
|
|
176
|
-
isPaused: boolean;
|
|
177
|
-
isRefetching: boolean;
|
|
178
|
-
isStale: boolean;
|
|
179
|
-
isEnabled: boolean;
|
|
180
|
-
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
181
|
-
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
182
|
-
promise: Promise<ViewResponse>;
|
|
183
|
-
} | {
|
|
184
|
-
context: any;
|
|
185
|
-
data: ViewResponse;
|
|
186
|
-
isError: false;
|
|
187
|
-
error: null;
|
|
188
|
-
isPending: false;
|
|
189
|
-
isLoading: false;
|
|
190
|
-
isLoadingError: false;
|
|
191
|
-
isRefetchError: false;
|
|
192
|
-
isSuccess: true;
|
|
193
|
-
isPlaceholderData: true;
|
|
194
|
-
status: "success";
|
|
195
|
-
dataUpdatedAt: number;
|
|
196
|
-
errorUpdatedAt: number;
|
|
197
|
-
failureCount: number;
|
|
198
|
-
failureReason: Error | null;
|
|
199
|
-
errorUpdateCount: number;
|
|
200
|
-
isFetched: boolean;
|
|
201
|
-
isFetchedAfterMount: boolean;
|
|
202
|
-
isFetching: boolean;
|
|
203
|
-
isInitialLoading: boolean;
|
|
204
|
-
isPaused: boolean;
|
|
205
|
-
isRefetching: boolean;
|
|
206
|
-
isStale: boolean;
|
|
207
|
-
isEnabled: boolean;
|
|
208
|
-
refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<ViewResponse, Error>>;
|
|
209
|
-
fetchStatus: _tanstack_query_core.FetchStatus;
|
|
210
|
-
promise: Promise<ViewResponse>;
|
|
211
|
-
};
|
|
212
|
-
type useViewV2Type = ReturnType<typeof useViewV2>;
|
|
213
|
-
type ViewResponse = {
|
|
214
|
-
models: {
|
|
215
|
-
[key: string]: any;
|
|
216
|
-
};
|
|
217
|
-
views: {
|
|
218
|
-
[key: string]: any;
|
|
219
|
-
};
|
|
220
|
-
};
|
|
221
|
-
|
|
222
|
-
export { type ActionResultType as A, type ViewResponse as V, type useCallActionType as a, useViewV2 as b, type useViewV2Type as c, useCallAction as u };
|