@fctc/widget-logic 2.7.2 → 2.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -29
- package/dist/index.mjs +19 -39
- package/dist/widget.d.mts +0 -1
- package/dist/widget.d.ts +0 -1
- package/dist/widget.js +37 -29
- package/dist/widget.mjs +47 -39
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5324,7 +5324,6 @@ var many2oneFieldController = (props) => {
|
|
|
5324
5324
|
}
|
|
5325
5325
|
};
|
|
5326
5326
|
const queryKey = [`data_${relation}`, domainObject];
|
|
5327
|
-
console.log("data", data);
|
|
5328
5327
|
const {
|
|
5329
5328
|
data: dataOfSelection,
|
|
5330
5329
|
refetch,
|
|
@@ -5497,8 +5496,7 @@ var many2manyFieldController = (props) => {
|
|
|
5497
5496
|
tab,
|
|
5498
5497
|
setSelectedRowKeys: setSelectedRowKeys2,
|
|
5499
5498
|
groupByDomain,
|
|
5500
|
-
enabled: enabledCallAPI
|
|
5501
|
-
actionData
|
|
5499
|
+
enabled: enabledCallAPI
|
|
5502
5500
|
} = props;
|
|
5503
5501
|
const { env } = (0, provider_exports.useEnv)();
|
|
5504
5502
|
const { useGetView: useGetView2, useGetListData: useGetListData2, useGetFormView: useGetFormView2 } = (0, provider_exports.useService)();
|
|
@@ -5522,31 +5520,14 @@ var many2manyFieldController = (props) => {
|
|
|
5522
5520
|
viewParams,
|
|
5523
5521
|
enabled: enabledCallAPI
|
|
5524
5522
|
});
|
|
5525
|
-
const
|
|
5526
|
-
()
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
fields: [
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
]
|
|
5534
|
-
}),
|
|
5535
|
-
[relation, viewResponse]
|
|
5536
|
-
);
|
|
5537
|
-
const initModel = (0, import_hooks2.useModel)();
|
|
5538
|
-
const modelInstance = (0, import_react17.useMemo)(() => {
|
|
5539
|
-
if (viewResponse) {
|
|
5540
|
-
return initModel.initModel(baseModel);
|
|
5541
|
-
}
|
|
5542
|
-
return null;
|
|
5543
|
-
}, [baseModel, viewResponse]);
|
|
5544
|
-
const specification = (0, import_react17.useMemo)(() => {
|
|
5545
|
-
if (modelInstance) {
|
|
5546
|
-
return modelInstance.getSpecification();
|
|
5547
|
-
}
|
|
5548
|
-
return null;
|
|
5549
|
-
}, [modelInstance]);
|
|
5523
|
+
const { specification } = useGetSpecification({
|
|
5524
|
+
model: String(relation),
|
|
5525
|
+
viewData: viewResponse || {},
|
|
5526
|
+
fields: [
|
|
5527
|
+
...Object.values(viewResponse?.views?.list?.fields ?? {}),
|
|
5528
|
+
...tab?.fields ? tab.fields : []
|
|
5529
|
+
]
|
|
5530
|
+
});
|
|
5550
5531
|
const default_order = viewResponse && viewResponse?.views?.list?.default_order;
|
|
5551
5532
|
const optionsObject = tab?.options ? (0, import_utils9.evalJSONContext)(tab?.options) : (options ? (0, import_utils9.evalJSONContext)(options) : {}) || {};
|
|
5552
5533
|
const fetchData = async () => {
|
|
@@ -5672,7 +5653,6 @@ var many2manyTagsController = (props) => {
|
|
|
5672
5653
|
enabled: true,
|
|
5673
5654
|
context: env.context
|
|
5674
5655
|
};
|
|
5675
|
-
console.log("data", data);
|
|
5676
5656
|
const { data: dataOfSelection } = useGetSelection3({
|
|
5677
5657
|
data,
|
|
5678
5658
|
queryKey: [`data_${relation}`, domainObject],
|
package/dist/index.mjs
CHANGED
|
@@ -5405,7 +5405,6 @@ var many2oneFieldController = (props) => {
|
|
|
5405
5405
|
}
|
|
5406
5406
|
};
|
|
5407
5407
|
const queryKey = [`data_${relation}`, domainObject];
|
|
5408
|
-
console.log("data", data);
|
|
5409
5408
|
const {
|
|
5410
5409
|
data: dataOfSelection,
|
|
5411
5410
|
refetch,
|
|
@@ -5567,7 +5566,7 @@ var many2oneButtonController = (props) => {
|
|
|
5567
5566
|
};
|
|
5568
5567
|
|
|
5569
5568
|
// src/widget/basic/many2many-field/controller.ts
|
|
5570
|
-
import { useEffect as useEffect11,
|
|
5569
|
+
import { useEffect as useEffect11, useState as useState8 } from "react";
|
|
5571
5570
|
import {
|
|
5572
5571
|
evalJSONContext as evalJSONContext4,
|
|
5573
5572
|
evalJSONDomain as evalJSONDomain4,
|
|
@@ -5582,8 +5581,7 @@ var many2manyFieldController = (props) => {
|
|
|
5582
5581
|
tab,
|
|
5583
5582
|
setSelectedRowKeys: setSelectedRowKeys2,
|
|
5584
5583
|
groupByDomain,
|
|
5585
|
-
enabled: enabledCallAPI
|
|
5586
|
-
actionData
|
|
5584
|
+
enabled: enabledCallAPI
|
|
5587
5585
|
} = props;
|
|
5588
5586
|
const { env } = (0, provider_exports.useEnv)();
|
|
5589
5587
|
const { useGetView: useGetView2, useGetListData: useGetListData2, useGetFormView: useGetFormView2 } = (0, provider_exports.useService)();
|
|
@@ -5607,31 +5605,14 @@ var many2manyFieldController = (props) => {
|
|
|
5607
5605
|
viewParams,
|
|
5608
5606
|
enabled: enabledCallAPI
|
|
5609
5607
|
});
|
|
5610
|
-
const
|
|
5611
|
-
()
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
fields: [
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
]
|
|
5619
|
-
}),
|
|
5620
|
-
[relation, viewResponse]
|
|
5621
|
-
);
|
|
5622
|
-
const initModel = useModel();
|
|
5623
|
-
const modelInstance = useMemo9(() => {
|
|
5624
|
-
if (viewResponse) {
|
|
5625
|
-
return initModel.initModel(baseModel);
|
|
5626
|
-
}
|
|
5627
|
-
return null;
|
|
5628
|
-
}, [baseModel, viewResponse]);
|
|
5629
|
-
const specification = useMemo9(() => {
|
|
5630
|
-
if (modelInstance) {
|
|
5631
|
-
return modelInstance.getSpecification();
|
|
5632
|
-
}
|
|
5633
|
-
return null;
|
|
5634
|
-
}, [modelInstance]);
|
|
5608
|
+
const { specification } = useGetSpecification({
|
|
5609
|
+
model: String(relation),
|
|
5610
|
+
viewData: viewResponse || {},
|
|
5611
|
+
fields: [
|
|
5612
|
+
...Object.values(viewResponse?.views?.list?.fields ?? {}),
|
|
5613
|
+
...tab?.fields ? tab.fields : []
|
|
5614
|
+
]
|
|
5615
|
+
});
|
|
5635
5616
|
const default_order = viewResponse && viewResponse?.views?.list?.default_order;
|
|
5636
5617
|
const optionsObject = tab?.options ? evalJSONContext4(tab?.options) : (options ? evalJSONContext4(options) : {}) || {};
|
|
5637
5618
|
const fetchData = async () => {
|
|
@@ -5722,7 +5703,7 @@ var many2manyFieldController = (props) => {
|
|
|
5722
5703
|
};
|
|
5723
5704
|
|
|
5724
5705
|
// src/widget/basic/many2many-tags-field/controller.ts
|
|
5725
|
-
import { useMemo as
|
|
5706
|
+
import { useMemo as useMemo9 } from "react";
|
|
5726
5707
|
import { WIDGETAVATAR, WIDGETCOLOR } from "@fctc/interface-logic/constants";
|
|
5727
5708
|
import { evalJSONContext as evalJSONContext5, evalJSONDomain as evalJSONDomain5 } from "@fctc/interface-logic/utils";
|
|
5728
5709
|
var many2manyTagsController = (props) => {
|
|
@@ -5740,7 +5721,7 @@ var many2manyTagsController = (props) => {
|
|
|
5740
5721
|
const { env } = (0, provider_exports.useEnv)();
|
|
5741
5722
|
const { useGetSelection: useGetSelection3 } = (0, provider_exports.useService)();
|
|
5742
5723
|
const addtionalFields = optionsFields ? evalJSONContext5(optionsFields) : null;
|
|
5743
|
-
const domainObject =
|
|
5724
|
+
const domainObject = useMemo9(
|
|
5744
5725
|
() => evalJSONDomain5(domain, JSON.parse(JSON.stringify(formValues || {}))),
|
|
5745
5726
|
[domain, formValues]
|
|
5746
5727
|
);
|
|
@@ -5757,7 +5738,6 @@ var many2manyTagsController = (props) => {
|
|
|
5757
5738
|
enabled: true,
|
|
5758
5739
|
context: env.context
|
|
5759
5740
|
};
|
|
5760
|
-
console.log("data", data);
|
|
5761
5741
|
const { data: dataOfSelection } = useGetSelection3({
|
|
5762
5742
|
data,
|
|
5763
5743
|
queryKey: [`data_${relation}`, domainObject],
|
|
@@ -6972,7 +6952,7 @@ var binaryFieldController = (props) => {
|
|
|
6972
6952
|
};
|
|
6973
6953
|
|
|
6974
6954
|
// src/widget/advance/table/table-head/controller.ts
|
|
6975
|
-
import { useMemo as
|
|
6955
|
+
import { useMemo as useMemo10, useRef as useRef5 } from "react";
|
|
6976
6956
|
var tableHeadController = (props) => {
|
|
6977
6957
|
const {
|
|
6978
6958
|
typeTable,
|
|
@@ -6985,19 +6965,19 @@ var tableHeadController = (props) => {
|
|
|
6985
6965
|
const { rowIds: recordIds } = useGetRowIds(tableRef);
|
|
6986
6966
|
const selectedRowKeysRef = useRef5(recordIds);
|
|
6987
6967
|
const isGroupTable = typeTable === "group";
|
|
6988
|
-
const recordsCheckedGroup =
|
|
6968
|
+
const recordsCheckedGroup = useMemo10(() => {
|
|
6989
6969
|
if (!rows || !groupByList) return 0;
|
|
6990
6970
|
const groupBy = typeof groupByList === "object" ? groupByList?.contexts?.[0]?.group_by : void 0;
|
|
6991
6971
|
return countSum(rows, groupBy);
|
|
6992
6972
|
}, [rows, groupByList]);
|
|
6993
|
-
const isAllGroupChecked =
|
|
6973
|
+
const isAllGroupChecked = useMemo10(() => {
|
|
6994
6974
|
if (!isGroupTable || !selectedRowKeys?.length) return false;
|
|
6995
6975
|
const selectedLength = selectedRowKeys.filter((id) => id !== -1).length;
|
|
6996
6976
|
const allRecordsSelected = recordIds.length === selectedRowKeys.length ? recordIds.length === selectedLength : false;
|
|
6997
6977
|
const allGroupsSelected = recordsCheckedGroup === selectedRowKeys.length;
|
|
6998
6978
|
return allGroupsSelected || allRecordsSelected;
|
|
6999
6979
|
}, [isGroupTable, selectedRowKeys, recordIds, recordsCheckedGroup]);
|
|
7000
|
-
const isAllNormalChecked =
|
|
6980
|
+
const isAllNormalChecked = useMemo10(() => {
|
|
7001
6981
|
if (isGroupTable || !selectedRowKeys?.length || !rows?.length) return false;
|
|
7002
6982
|
return selectedRowKeys.length === rows.length && selectedRowKeys.every(
|
|
7003
6983
|
(id) => rows.some((record) => record.id === id)
|
|
@@ -7127,7 +7107,7 @@ var tableController = ({ data }) => {
|
|
|
7127
7107
|
};
|
|
7128
7108
|
|
|
7129
7109
|
// src/widget/advance/table/table-group/controller.ts
|
|
7130
|
-
import { useEffect as useEffect14, useMemo as
|
|
7110
|
+
import { useEffect as useEffect14, useMemo as useMemo11, useState as useState14 } from "react";
|
|
7131
7111
|
import {
|
|
7132
7112
|
useAppSelector as useAppSelector2,
|
|
7133
7113
|
selectList
|
|
@@ -7155,7 +7135,7 @@ var tableGroupController = (props) => {
|
|
|
7155
7135
|
fromEnd: 1
|
|
7156
7136
|
});
|
|
7157
7137
|
const domain = row?.__domain;
|
|
7158
|
-
const processedData =
|
|
7138
|
+
const processedData = useMemo11(() => {
|
|
7159
7139
|
const calculateColSpanEmpty = () => {
|
|
7160
7140
|
const startIndex = columns.findIndex(
|
|
7161
7141
|
(col) => col.field.type === "monetary" && typeof row[col.key] === "number" || col.field.aggregator === "sum"
|
|
@@ -7170,7 +7150,7 @@ var tableGroupController = (props) => {
|
|
|
7170
7150
|
};
|
|
7171
7151
|
return calculateColSpanEmpty();
|
|
7172
7152
|
}, [columns, row]);
|
|
7173
|
-
const shouldFetchData =
|
|
7153
|
+
const shouldFetchData = useMemo11(() => {
|
|
7174
7154
|
return !!isShowGroup;
|
|
7175
7155
|
}, [isShowGroup]);
|
|
7176
7156
|
const enabled = shouldFetchData && !!processedData;
|
package/dist/widget.d.mts
CHANGED
package/dist/widget.d.ts
CHANGED
package/dist/widget.js
CHANGED
|
@@ -4341,6 +4341,34 @@ var import_react10 = require("react");
|
|
|
4341
4341
|
|
|
4342
4342
|
// src/hooks/core/use-get-specification.ts
|
|
4343
4343
|
var import_react11 = require("react");
|
|
4344
|
+
var useGetSpecification = ({
|
|
4345
|
+
model,
|
|
4346
|
+
viewData,
|
|
4347
|
+
fields
|
|
4348
|
+
}) => {
|
|
4349
|
+
const baseModel = (0, import_react11.useMemo)(
|
|
4350
|
+
() => ({
|
|
4351
|
+
name: String(model),
|
|
4352
|
+
view: viewData || {},
|
|
4353
|
+
fields
|
|
4354
|
+
}),
|
|
4355
|
+
[model, viewData]
|
|
4356
|
+
);
|
|
4357
|
+
const initModel = (0, import_hooks3.useModel)();
|
|
4358
|
+
const modelInstance = (0, import_react11.useMemo)(() => {
|
|
4359
|
+
if (viewData) {
|
|
4360
|
+
return initModel.initModel(baseModel);
|
|
4361
|
+
}
|
|
4362
|
+
return null;
|
|
4363
|
+
}, [baseModel, viewData]);
|
|
4364
|
+
const specification = (0, import_react11.useMemo)(() => {
|
|
4365
|
+
if (modelInstance) {
|
|
4366
|
+
return modelInstance.getSpecification();
|
|
4367
|
+
}
|
|
4368
|
+
return null;
|
|
4369
|
+
}, [modelInstance]);
|
|
4370
|
+
return { specification };
|
|
4371
|
+
};
|
|
4344
4372
|
|
|
4345
4373
|
// src/hooks/core/use-list-data.ts
|
|
4346
4374
|
var import_react15 = require("react");
|
|
@@ -4480,7 +4508,6 @@ var many2oneFieldController = (props) => {
|
|
|
4480
4508
|
}
|
|
4481
4509
|
};
|
|
4482
4510
|
const queryKey = [`data_${relation}`, domainObject];
|
|
4483
|
-
console.log("data", data);
|
|
4484
4511
|
const {
|
|
4485
4512
|
data: dataOfSelection,
|
|
4486
4513
|
refetch,
|
|
@@ -4653,8 +4680,7 @@ var many2manyFieldController = (props) => {
|
|
|
4653
4680
|
tab,
|
|
4654
4681
|
setSelectedRowKeys: setSelectedRowKeys2,
|
|
4655
4682
|
groupByDomain,
|
|
4656
|
-
enabled: enabledCallAPI
|
|
4657
|
-
actionData
|
|
4683
|
+
enabled: enabledCallAPI
|
|
4658
4684
|
} = props;
|
|
4659
4685
|
const { env } = (0, provider_exports.useEnv)();
|
|
4660
4686
|
const { useGetView: useGetView2, useGetListData: useGetListData2, useGetFormView: useGetFormView2 } = (0, provider_exports.useService)();
|
|
@@ -4678,31 +4704,14 @@ var many2manyFieldController = (props) => {
|
|
|
4678
4704
|
viewParams,
|
|
4679
4705
|
enabled: enabledCallAPI
|
|
4680
4706
|
});
|
|
4681
|
-
const
|
|
4682
|
-
()
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4686
|
-
fields: [
|
|
4687
|
-
|
|
4688
|
-
|
|
4689
|
-
]
|
|
4690
|
-
}),
|
|
4691
|
-
[relation, viewResponse]
|
|
4692
|
-
);
|
|
4693
|
-
const initModel = (0, import_hooks3.useModel)();
|
|
4694
|
-
const modelInstance = (0, import_react17.useMemo)(() => {
|
|
4695
|
-
if (viewResponse) {
|
|
4696
|
-
return initModel.initModel(baseModel);
|
|
4697
|
-
}
|
|
4698
|
-
return null;
|
|
4699
|
-
}, [baseModel, viewResponse]);
|
|
4700
|
-
const specification = (0, import_react17.useMemo)(() => {
|
|
4701
|
-
if (modelInstance) {
|
|
4702
|
-
return modelInstance.getSpecification();
|
|
4703
|
-
}
|
|
4704
|
-
return null;
|
|
4705
|
-
}, [modelInstance]);
|
|
4707
|
+
const { specification } = useGetSpecification({
|
|
4708
|
+
model: String(relation),
|
|
4709
|
+
viewData: viewResponse || {},
|
|
4710
|
+
fields: [
|
|
4711
|
+
...Object.values(viewResponse?.views?.list?.fields ?? {}),
|
|
4712
|
+
...tab?.fields ? tab.fields : []
|
|
4713
|
+
]
|
|
4714
|
+
});
|
|
4706
4715
|
const default_order = viewResponse && viewResponse?.views?.list?.default_order;
|
|
4707
4716
|
const optionsObject = tab?.options ? (0, import_utils9.evalJSONContext)(tab?.options) : (options ? (0, import_utils9.evalJSONContext)(options) : {}) || {};
|
|
4708
4717
|
const fetchData = async () => {
|
|
@@ -4828,7 +4837,6 @@ var many2manyTagsController = (props) => {
|
|
|
4828
4837
|
enabled: true,
|
|
4829
4838
|
context: env.context
|
|
4830
4839
|
};
|
|
4831
|
-
console.log("data", data);
|
|
4832
4840
|
const { data: dataOfSelection } = useGetSelection3({
|
|
4833
4841
|
data,
|
|
4834
4842
|
queryKey: [`data_${relation}`, domainObject],
|
package/dist/widget.mjs
CHANGED
|
@@ -4394,6 +4394,34 @@ import { useEffect as useEffect6 } from "react";
|
|
|
4394
4394
|
|
|
4395
4395
|
// src/hooks/core/use-get-specification.ts
|
|
4396
4396
|
import { useMemo as useMemo6 } from "react";
|
|
4397
|
+
var useGetSpecification = ({
|
|
4398
|
+
model,
|
|
4399
|
+
viewData,
|
|
4400
|
+
fields
|
|
4401
|
+
}) => {
|
|
4402
|
+
const baseModel = useMemo6(
|
|
4403
|
+
() => ({
|
|
4404
|
+
name: String(model),
|
|
4405
|
+
view: viewData || {},
|
|
4406
|
+
fields
|
|
4407
|
+
}),
|
|
4408
|
+
[model, viewData]
|
|
4409
|
+
);
|
|
4410
|
+
const initModel = useModel();
|
|
4411
|
+
const modelInstance = useMemo6(() => {
|
|
4412
|
+
if (viewData) {
|
|
4413
|
+
return initModel.initModel(baseModel);
|
|
4414
|
+
}
|
|
4415
|
+
return null;
|
|
4416
|
+
}, [baseModel, viewData]);
|
|
4417
|
+
const specification = useMemo6(() => {
|
|
4418
|
+
if (modelInstance) {
|
|
4419
|
+
return modelInstance.getSpecification();
|
|
4420
|
+
}
|
|
4421
|
+
return null;
|
|
4422
|
+
}, [modelInstance]);
|
|
4423
|
+
return { specification };
|
|
4424
|
+
};
|
|
4397
4425
|
|
|
4398
4426
|
// src/hooks/core/use-list-data.ts
|
|
4399
4427
|
import { useMemo as useMemo7, useState as useState6 } from "react";
|
|
@@ -4538,7 +4566,6 @@ var many2oneFieldController = (props) => {
|
|
|
4538
4566
|
}
|
|
4539
4567
|
};
|
|
4540
4568
|
const queryKey = [`data_${relation}`, domainObject];
|
|
4541
|
-
console.log("data", data);
|
|
4542
4569
|
const {
|
|
4543
4570
|
data: dataOfSelection,
|
|
4544
4571
|
refetch,
|
|
@@ -4700,7 +4727,7 @@ var many2oneButtonController = (props) => {
|
|
|
4700
4727
|
};
|
|
4701
4728
|
|
|
4702
4729
|
// src/widget/basic/many2many-field/controller.ts
|
|
4703
|
-
import { useEffect as useEffect11,
|
|
4730
|
+
import { useEffect as useEffect11, useState as useState8 } from "react";
|
|
4704
4731
|
import {
|
|
4705
4732
|
evalJSONContext as evalJSONContext4,
|
|
4706
4733
|
evalJSONDomain as evalJSONDomain4,
|
|
@@ -4715,8 +4742,7 @@ var many2manyFieldController = (props) => {
|
|
|
4715
4742
|
tab,
|
|
4716
4743
|
setSelectedRowKeys: setSelectedRowKeys2,
|
|
4717
4744
|
groupByDomain,
|
|
4718
|
-
enabled: enabledCallAPI
|
|
4719
|
-
actionData
|
|
4745
|
+
enabled: enabledCallAPI
|
|
4720
4746
|
} = props;
|
|
4721
4747
|
const { env } = (0, provider_exports.useEnv)();
|
|
4722
4748
|
const { useGetView: useGetView2, useGetListData: useGetListData2, useGetFormView: useGetFormView2 } = (0, provider_exports.useService)();
|
|
@@ -4740,31 +4766,14 @@ var many2manyFieldController = (props) => {
|
|
|
4740
4766
|
viewParams,
|
|
4741
4767
|
enabled: enabledCallAPI
|
|
4742
4768
|
});
|
|
4743
|
-
const
|
|
4744
|
-
()
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
fields: [
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
]
|
|
4752
|
-
}),
|
|
4753
|
-
[relation, viewResponse]
|
|
4754
|
-
);
|
|
4755
|
-
const initModel = useModel();
|
|
4756
|
-
const modelInstance = useMemo9(() => {
|
|
4757
|
-
if (viewResponse) {
|
|
4758
|
-
return initModel.initModel(baseModel);
|
|
4759
|
-
}
|
|
4760
|
-
return null;
|
|
4761
|
-
}, [baseModel, viewResponse]);
|
|
4762
|
-
const specification = useMemo9(() => {
|
|
4763
|
-
if (modelInstance) {
|
|
4764
|
-
return modelInstance.getSpecification();
|
|
4765
|
-
}
|
|
4766
|
-
return null;
|
|
4767
|
-
}, [modelInstance]);
|
|
4769
|
+
const { specification } = useGetSpecification({
|
|
4770
|
+
model: String(relation),
|
|
4771
|
+
viewData: viewResponse || {},
|
|
4772
|
+
fields: [
|
|
4773
|
+
...Object.values(viewResponse?.views?.list?.fields ?? {}),
|
|
4774
|
+
...tab?.fields ? tab.fields : []
|
|
4775
|
+
]
|
|
4776
|
+
});
|
|
4768
4777
|
const default_order = viewResponse && viewResponse?.views?.list?.default_order;
|
|
4769
4778
|
const optionsObject = tab?.options ? evalJSONContext4(tab?.options) : (options ? evalJSONContext4(options) : {}) || {};
|
|
4770
4779
|
const fetchData = async () => {
|
|
@@ -4855,7 +4864,7 @@ var many2manyFieldController = (props) => {
|
|
|
4855
4864
|
};
|
|
4856
4865
|
|
|
4857
4866
|
// src/widget/basic/many2many-tags-field/controller.ts
|
|
4858
|
-
import { useMemo as
|
|
4867
|
+
import { useMemo as useMemo9 } from "react";
|
|
4859
4868
|
import { WIDGETAVATAR, WIDGETCOLOR } from "@fctc/interface-logic/constants";
|
|
4860
4869
|
import { evalJSONContext as evalJSONContext5, evalJSONDomain as evalJSONDomain5 } from "@fctc/interface-logic/utils";
|
|
4861
4870
|
var many2manyTagsController = (props) => {
|
|
@@ -4873,7 +4882,7 @@ var many2manyTagsController = (props) => {
|
|
|
4873
4882
|
const { env } = (0, provider_exports.useEnv)();
|
|
4874
4883
|
const { useGetSelection: useGetSelection3 } = (0, provider_exports.useService)();
|
|
4875
4884
|
const addtionalFields = optionsFields ? evalJSONContext5(optionsFields) : null;
|
|
4876
|
-
const domainObject =
|
|
4885
|
+
const domainObject = useMemo9(
|
|
4877
4886
|
() => evalJSONDomain5(domain, JSON.parse(JSON.stringify(formValues || {}))),
|
|
4878
4887
|
[domain, formValues]
|
|
4879
4888
|
);
|
|
@@ -4890,7 +4899,6 @@ var many2manyTagsController = (props) => {
|
|
|
4890
4899
|
enabled: true,
|
|
4891
4900
|
context: env.context
|
|
4892
4901
|
};
|
|
4893
|
-
console.log("data", data);
|
|
4894
4902
|
const { data: dataOfSelection } = useGetSelection3({
|
|
4895
4903
|
data,
|
|
4896
4904
|
queryKey: [`data_${relation}`, domainObject],
|
|
@@ -6105,7 +6113,7 @@ var binaryFieldController = (props) => {
|
|
|
6105
6113
|
};
|
|
6106
6114
|
|
|
6107
6115
|
// src/widget/advance/table/table-head/controller.ts
|
|
6108
|
-
import { useMemo as
|
|
6116
|
+
import { useMemo as useMemo10, useRef as useRef5 } from "react";
|
|
6109
6117
|
var tableHeadController = (props) => {
|
|
6110
6118
|
const {
|
|
6111
6119
|
typeTable,
|
|
@@ -6118,19 +6126,19 @@ var tableHeadController = (props) => {
|
|
|
6118
6126
|
const { rowIds: recordIds } = useGetRowIds(tableRef);
|
|
6119
6127
|
const selectedRowKeysRef = useRef5(recordIds);
|
|
6120
6128
|
const isGroupTable = typeTable === "group";
|
|
6121
|
-
const recordsCheckedGroup =
|
|
6129
|
+
const recordsCheckedGroup = useMemo10(() => {
|
|
6122
6130
|
if (!rows || !groupByList) return 0;
|
|
6123
6131
|
const groupBy = typeof groupByList === "object" ? groupByList?.contexts?.[0]?.group_by : void 0;
|
|
6124
6132
|
return countSum(rows, groupBy);
|
|
6125
6133
|
}, [rows, groupByList]);
|
|
6126
|
-
const isAllGroupChecked =
|
|
6134
|
+
const isAllGroupChecked = useMemo10(() => {
|
|
6127
6135
|
if (!isGroupTable || !selectedRowKeys?.length) return false;
|
|
6128
6136
|
const selectedLength = selectedRowKeys.filter((id) => id !== -1).length;
|
|
6129
6137
|
const allRecordsSelected = recordIds.length === selectedRowKeys.length ? recordIds.length === selectedLength : false;
|
|
6130
6138
|
const allGroupsSelected = recordsCheckedGroup === selectedRowKeys.length;
|
|
6131
6139
|
return allGroupsSelected || allRecordsSelected;
|
|
6132
6140
|
}, [isGroupTable, selectedRowKeys, recordIds, recordsCheckedGroup]);
|
|
6133
|
-
const isAllNormalChecked =
|
|
6141
|
+
const isAllNormalChecked = useMemo10(() => {
|
|
6134
6142
|
if (isGroupTable || !selectedRowKeys?.length || !rows?.length) return false;
|
|
6135
6143
|
return selectedRowKeys.length === rows.length && selectedRowKeys.every(
|
|
6136
6144
|
(id) => rows.some((record) => record.id === id)
|
|
@@ -6260,7 +6268,7 @@ var tableController = ({ data }) => {
|
|
|
6260
6268
|
};
|
|
6261
6269
|
|
|
6262
6270
|
// src/widget/advance/table/table-group/controller.ts
|
|
6263
|
-
import { useEffect as useEffect14, useMemo as
|
|
6271
|
+
import { useEffect as useEffect14, useMemo as useMemo11, useState as useState14 } from "react";
|
|
6264
6272
|
import {
|
|
6265
6273
|
useAppSelector as useAppSelector2,
|
|
6266
6274
|
selectList
|
|
@@ -6288,7 +6296,7 @@ var tableGroupController = (props) => {
|
|
|
6288
6296
|
fromEnd: 1
|
|
6289
6297
|
});
|
|
6290
6298
|
const domain = row?.__domain;
|
|
6291
|
-
const processedData =
|
|
6299
|
+
const processedData = useMemo11(() => {
|
|
6292
6300
|
const calculateColSpanEmpty = () => {
|
|
6293
6301
|
const startIndex = columns.findIndex(
|
|
6294
6302
|
(col) => col.field.type === "monetary" && typeof row[col.key] === "number" || col.field.aggregator === "sum"
|
|
@@ -6303,7 +6311,7 @@ var tableGroupController = (props) => {
|
|
|
6303
6311
|
};
|
|
6304
6312
|
return calculateColSpanEmpty();
|
|
6305
6313
|
}, [columns, row]);
|
|
6306
|
-
const shouldFetchData =
|
|
6314
|
+
const shouldFetchData = useMemo11(() => {
|
|
6307
6315
|
return !!isShowGroup;
|
|
6308
6316
|
}, [isShowGroup]);
|
|
6309
6317
|
const enabled = shouldFetchData && !!processedData;
|