@fctc/widget-logic 4.2.0 → 4.2.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 CHANGED
@@ -781,7 +781,7 @@ declare const useGetSpecification: ({ model, viewData, fields, }: {
781
781
  specification: Record<string, any> | null;
782
782
  };
783
783
 
784
- declare const useListData: ({ action, context, viewData, model, service, xNode, mode, }: {
784
+ declare const useListData: ({ action, context, viewData, model, service, xNode, mode, limit, }: {
785
785
  action: ActionResultType;
786
786
  context: any;
787
787
  viewData?: ViewResponse;
@@ -789,6 +789,7 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
789
789
  service?: string;
790
790
  xNode?: string;
791
791
  mode?: string;
792
+ limit?: number;
792
793
  }) => {
793
794
  state: {
794
795
  specification: Record<string, any> | null;
package/dist/hooks.d.ts CHANGED
@@ -781,7 +781,7 @@ declare const useGetSpecification: ({ model, viewData, fields, }: {
781
781
  specification: Record<string, any> | null;
782
782
  };
783
783
 
784
- declare const useListData: ({ action, context, viewData, model, service, xNode, mode, }: {
784
+ declare const useListData: ({ action, context, viewData, model, service, xNode, mode, limit, }: {
785
785
  action: ActionResultType;
786
786
  context: any;
787
787
  viewData?: ViewResponse;
@@ -789,6 +789,7 @@ declare const useListData: ({ action, context, viewData, model, service, xNode,
789
789
  service?: string;
790
790
  xNode?: string;
791
791
  mode?: string;
792
+ limit?: number;
792
793
  }) => {
793
794
  state: {
794
795
  specification: Record<string, any> | null;
package/dist/hooks.js CHANGED
@@ -902,11 +902,12 @@ var useListData = ({
902
902
  model,
903
903
  service,
904
904
  xNode,
905
- mode
905
+ mode,
906
+ limit = 10
906
907
  }) => {
907
908
  const { useGetListData: useGetListData2 } = (0, provider_exports.useService)();
908
909
  const [page, setPage] = (0, import_react14.useState)(0);
909
- const [pageLimit, setPageLimit] = (0, import_react14.useState)(10);
910
+ const [pageLimit, setPageLimit] = (0, import_react14.useState)(limit);
910
911
  const [groupByList, setGroupByList] = (0, import_react14.useState)(null);
911
912
  const [domain, setDomain] = (0, import_react14.useState)(null);
912
913
  const [order, setOrder] = (0, import_react14.useState)("");
@@ -923,7 +924,7 @@ var useListData = ({
923
924
  return null;
924
925
  }
925
926
  const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : (0, import_utils5.evalJSONDomain)(action?.domain, context) : [];
926
- const limit = pageLimit;
927
+ const limit2 = pageLimit;
927
928
  const offset = debouncedPage * pageLimit;
928
929
  const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
929
930
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
@@ -934,7 +935,7 @@ var useListData = ({
934
935
  model: action?.res_model,
935
936
  specification,
936
937
  domain: domainParse,
937
- limit,
938
+ limit: limit2,
938
939
  offset,
939
940
  fields,
940
941
  groupby,
package/dist/hooks.mjs CHANGED
@@ -887,11 +887,12 @@ var useListData = ({
887
887
  model,
888
888
  service,
889
889
  xNode,
890
- mode
890
+ mode,
891
+ limit = 10
891
892
  }) => {
892
893
  const { useGetListData: useGetListData2 } = (0, provider_exports.useService)();
893
894
  const [page, setPage] = useState5(0);
894
- const [pageLimit, setPageLimit] = useState5(10);
895
+ const [pageLimit, setPageLimit] = useState5(limit);
895
896
  const [groupByList, setGroupByList] = useState5(null);
896
897
  const [domain, setDomain] = useState5(null);
897
898
  const [order, setOrder] = useState5("");
@@ -908,7 +909,7 @@ var useListData = ({
908
909
  return null;
909
910
  }
910
911
  const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : evalJSONDomain(action?.domain, context) : [];
911
- const limit = pageLimit;
912
+ const limit2 = pageLimit;
912
913
  const offset = debouncedPage * pageLimit;
913
914
  const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
914
915
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
@@ -919,7 +920,7 @@ var useListData = ({
919
920
  model: action?.res_model,
920
921
  specification,
921
922
  domain: domainParse,
922
- limit,
923
+ limit: limit2,
923
924
  offset,
924
925
  fields,
925
926
  groupby,
package/dist/index.js CHANGED
@@ -4952,11 +4952,12 @@ var useListData = ({
4952
4952
  model,
4953
4953
  service,
4954
4954
  xNode,
4955
- mode
4955
+ mode,
4956
+ limit = 10
4956
4957
  }) => {
4957
4958
  const { useGetListData: useGetListData2 } = (0, provider_exports.useService)();
4958
4959
  const [page, setPage] = (0, import_react14.useState)(0);
4959
- const [pageLimit, setPageLimit] = (0, import_react14.useState)(10);
4960
+ const [pageLimit, setPageLimit] = (0, import_react14.useState)(limit);
4960
4961
  const [groupByList, setGroupByList] = (0, import_react14.useState)(null);
4961
4962
  const [domain, setDomain] = (0, import_react14.useState)(null);
4962
4963
  const [order, setOrder] = (0, import_react14.useState)("");
@@ -4973,7 +4974,7 @@ var useListData = ({
4973
4974
  return null;
4974
4975
  }
4975
4976
  const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : (0, import_utils5.evalJSONDomain)(action?.domain, context) : [];
4976
- const limit = pageLimit;
4977
+ const limit2 = pageLimit;
4977
4978
  const offset = debouncedPage * pageLimit;
4978
4979
  const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
4979
4980
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
@@ -4984,7 +4985,7 @@ var useListData = ({
4984
4985
  model: action?.res_model,
4985
4986
  specification,
4986
4987
  domain: domainParse,
4987
- limit,
4988
+ limit: limit2,
4988
4989
  offset,
4989
4990
  fields,
4990
4991
  groupby,
@@ -6232,7 +6233,6 @@ var binaryFieldController = (props) => {
6232
6233
  const [selectedFile, setSelectedFile] = (0, import_react22.useState)(null);
6233
6234
  const [selectedPreview, setSelectedPreview] = (0, import_react22.useState)(null);
6234
6235
  const [initialFile, setInitialFile] = (0, import_react22.useState)(value || null);
6235
- const { setValue } = methods;
6236
6236
  const binaryRef = (0, import_react22.useRef)(null);
6237
6237
  const convertUrlToBase64 = async (url) => {
6238
6238
  try {
@@ -6283,11 +6283,11 @@ var binaryFieldController = (props) => {
6283
6283
  setSelectedPreview(fileUrl);
6284
6284
  const base64 = await convertUrlToBase64(fileUrl);
6285
6285
  const base64Data = extractBase64Data(base64);
6286
- setValue(name, base64Data, { shouldDirty: true });
6286
+ methods?.setValue(name, base64Data, { shouldDirty: true });
6287
6287
  onChange(base64Data);
6288
6288
  handleOnchange && handleOnchange(name ?? "", base64Data);
6289
6289
  if (filename) {
6290
- setValue(
6290
+ methods?.setValue(
6291
6291
  rootField ? `${rootField?.name}.${index}.${filename}` : filename,
6292
6292
  file?.name,
6293
6293
  { shouldDirty: true }
package/dist/index.mjs CHANGED
@@ -5046,11 +5046,12 @@ var useListData = ({
5046
5046
  model,
5047
5047
  service,
5048
5048
  xNode,
5049
- mode
5049
+ mode,
5050
+ limit = 10
5050
5051
  }) => {
5051
5052
  const { useGetListData: useGetListData2 } = (0, provider_exports.useService)();
5052
5053
  const [page, setPage] = useState5(0);
5053
- const [pageLimit, setPageLimit] = useState5(10);
5054
+ const [pageLimit, setPageLimit] = useState5(limit);
5054
5055
  const [groupByList, setGroupByList] = useState5(null);
5055
5056
  const [domain, setDomain] = useState5(null);
5056
5057
  const [order, setOrder] = useState5("");
@@ -5067,7 +5068,7 @@ var useListData = ({
5067
5068
  return null;
5068
5069
  }
5069
5070
  const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : evalJSONDomain(action?.domain, context) : [];
5070
- const limit = pageLimit;
5071
+ const limit2 = pageLimit;
5071
5072
  const offset = debouncedPage * pageLimit;
5072
5073
  const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
5073
5074
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
@@ -5078,7 +5079,7 @@ var useListData = ({
5078
5079
  model: action?.res_model,
5079
5080
  specification,
5080
5081
  domain: domainParse,
5081
- limit,
5082
+ limit: limit2,
5082
5083
  offset,
5083
5084
  fields,
5084
5085
  groupby,
@@ -6327,7 +6328,6 @@ var binaryFieldController = (props) => {
6327
6328
  const [selectedFile, setSelectedFile] = useState12(null);
6328
6329
  const [selectedPreview, setSelectedPreview] = useState12(null);
6329
6330
  const [initialFile, setInitialFile] = useState12(value || null);
6330
- const { setValue } = methods;
6331
6331
  const binaryRef = useRef4(null);
6332
6332
  const convertUrlToBase64 = async (url) => {
6333
6333
  try {
@@ -6378,11 +6378,11 @@ var binaryFieldController = (props) => {
6378
6378
  setSelectedPreview(fileUrl);
6379
6379
  const base64 = await convertUrlToBase64(fileUrl);
6380
6380
  const base64Data = extractBase64Data(base64);
6381
- setValue(name, base64Data, { shouldDirty: true });
6381
+ methods?.setValue(name, base64Data, { shouldDirty: true });
6382
6382
  onChange(base64Data);
6383
6383
  handleOnchange && handleOnchange(name ?? "", base64Data);
6384
6384
  if (filename) {
6385
- setValue(
6385
+ methods?.setValue(
6386
6386
  rootField ? `${rootField?.name}.${index}.${filename}` : filename,
6387
6387
  file?.name,
6388
6388
  { shouldDirty: true }
package/dist/widget.js CHANGED
@@ -4470,11 +4470,12 @@ var useListData = ({
4470
4470
  model,
4471
4471
  service,
4472
4472
  xNode,
4473
- mode
4473
+ mode,
4474
+ limit = 10
4474
4475
  }) => {
4475
4476
  const { useGetListData: useGetListData2 } = (0, provider_exports.useService)();
4476
4477
  const [page, setPage] = (0, import_react15.useState)(0);
4477
- const [pageLimit, setPageLimit] = (0, import_react15.useState)(10);
4478
+ const [pageLimit, setPageLimit] = (0, import_react15.useState)(limit);
4478
4479
  const [groupByList, setGroupByList] = (0, import_react15.useState)(null);
4479
4480
  const [domain, setDomain] = (0, import_react15.useState)(null);
4480
4481
  const [order, setOrder] = (0, import_react15.useState)("");
@@ -4491,7 +4492,7 @@ var useListData = ({
4491
4492
  return null;
4492
4493
  }
4493
4494
  const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : (0, import_utils5.evalJSONDomain)(action?.domain, context) : [];
4494
- const limit = pageLimit;
4495
+ const limit2 = pageLimit;
4495
4496
  const offset = debouncedPage * pageLimit;
4496
4497
  const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
4497
4498
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
@@ -4502,7 +4503,7 @@ var useListData = ({
4502
4503
  model: action?.res_model,
4503
4504
  specification,
4504
4505
  domain: domainParse,
4505
- limit,
4506
+ limit: limit2,
4506
4507
  offset,
4507
4508
  fields,
4508
4509
  groupby,
@@ -5458,7 +5459,6 @@ var binaryFieldController = (props) => {
5458
5459
  const [selectedFile, setSelectedFile] = (0, import_react22.useState)(null);
5459
5460
  const [selectedPreview, setSelectedPreview] = (0, import_react22.useState)(null);
5460
5461
  const [initialFile, setInitialFile] = (0, import_react22.useState)(value || null);
5461
- const { setValue } = methods;
5462
5462
  const binaryRef = (0, import_react22.useRef)(null);
5463
5463
  const convertUrlToBase64 = async (url) => {
5464
5464
  try {
@@ -5509,11 +5509,11 @@ var binaryFieldController = (props) => {
5509
5509
  setSelectedPreview(fileUrl);
5510
5510
  const base64 = await convertUrlToBase64(fileUrl);
5511
5511
  const base64Data = extractBase64Data(base64);
5512
- setValue(name, base64Data, { shouldDirty: true });
5512
+ methods?.setValue(name, base64Data, { shouldDirty: true });
5513
5513
  onChange(base64Data);
5514
5514
  handleOnchange && handleOnchange(name ?? "", base64Data);
5515
5515
  if (filename) {
5516
- setValue(
5516
+ methods?.setValue(
5517
5517
  rootField ? `${rootField?.name}.${index}.${filename}` : filename,
5518
5518
  file?.name,
5519
5519
  { shouldDirty: true }
package/dist/widget.mjs CHANGED
@@ -4542,11 +4542,12 @@ var useListData = ({
4542
4542
  model,
4543
4543
  service,
4544
4544
  xNode,
4545
- mode
4545
+ mode,
4546
+ limit = 10
4546
4547
  }) => {
4547
4548
  const { useGetListData: useGetListData2 } = (0, provider_exports.useService)();
4548
4549
  const [page, setPage] = useState6(0);
4549
- const [pageLimit, setPageLimit] = useState6(10);
4550
+ const [pageLimit, setPageLimit] = useState6(limit);
4550
4551
  const [groupByList, setGroupByList] = useState6(null);
4551
4552
  const [domain, setDomain] = useState6(null);
4552
4553
  const [order, setOrder] = useState6("");
@@ -4563,7 +4564,7 @@ var useListData = ({
4563
4564
  return null;
4564
4565
  }
4565
4566
  const domainParse = domain ? [...domain] : action?.domain ? Array.isArray(action?.domain) ? [...action?.domain] : evalJSONDomain(action?.domain, context) : [];
4566
- const limit = pageLimit;
4567
+ const limit2 = pageLimit;
4567
4568
  const offset = debouncedPage * pageLimit;
4568
4569
  const fields = typeof groupByList === "object" ? groupByList?.fields : void 0;
4569
4570
  const groupby = typeof groupByList === "object" ? [groupByList?.contexts?.[0]?.group_by] : [];
@@ -4574,7 +4575,7 @@ var useListData = ({
4574
4575
  model: action?.res_model,
4575
4576
  specification,
4576
4577
  domain: domainParse,
4577
- limit,
4578
+ limit: limit2,
4578
4579
  offset,
4579
4580
  fields,
4580
4581
  groupby,
@@ -5530,7 +5531,6 @@ var binaryFieldController = (props) => {
5530
5531
  const [selectedFile, setSelectedFile] = useState12(null);
5531
5532
  const [selectedPreview, setSelectedPreview] = useState12(null);
5532
5533
  const [initialFile, setInitialFile] = useState12(value || null);
5533
- const { setValue } = methods;
5534
5534
  const binaryRef = useRef4(null);
5535
5535
  const convertUrlToBase64 = async (url) => {
5536
5536
  try {
@@ -5581,11 +5581,11 @@ var binaryFieldController = (props) => {
5581
5581
  setSelectedPreview(fileUrl);
5582
5582
  const base64 = await convertUrlToBase64(fileUrl);
5583
5583
  const base64Data = extractBase64Data(base64);
5584
- setValue(name, base64Data, { shouldDirty: true });
5584
+ methods?.setValue(name, base64Data, { shouldDirty: true });
5585
5585
  onChange(base64Data);
5586
5586
  handleOnchange && handleOnchange(name ?? "", base64Data);
5587
5587
  if (filename) {
5588
- setValue(
5588
+ methods?.setValue(
5589
5589
  rootField ? `${rootField?.name}.${index}.${filename}` : filename,
5590
5590
  file?.name,
5591
5591
  { shouldDirty: true }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/widget-logic",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",