@fctc/widget-logic 2.5.5 → 2.5.7

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
@@ -89,11 +89,10 @@ interface UseMenuReturn {
89
89
  declare const useUser: () => any;
90
90
  type useUserType = ReturnType<typeof useUser>;
91
91
 
92
- declare const useViewV2: ({ action, context, aid, views, model, }: {
93
- action?: ActionResultType;
92
+ declare const useViewV2: ({ id, context, views, model, }: {
93
+ id?: any;
94
94
  context: any;
95
- aid?: any;
96
- views?: any;
95
+ views: any;
97
96
  model?: string;
98
97
  }) => {
99
98
  context: any;
package/dist/hooks.d.ts CHANGED
@@ -89,11 +89,10 @@ interface UseMenuReturn {
89
89
  declare const useUser: () => any;
90
90
  type useUserType = ReturnType<typeof useUser>;
91
91
 
92
- declare const useViewV2: ({ action, context, aid, views, model, }: {
93
- action?: ActionResultType;
92
+ declare const useViewV2: ({ id, context, views, model, }: {
93
+ id?: any;
94
94
  context: any;
95
- aid?: any;
96
- views?: any;
95
+ views: any;
97
96
  model?: string;
98
97
  }) => {
99
98
  context: any;
package/dist/hooks.js CHANGED
@@ -477,28 +477,21 @@ var useUser = () => {
477
477
  // src/hooks/core/use-view-v2.ts
478
478
  var import_react6 = require("react");
479
479
  var useViewV2 = ({
480
- action,
480
+ id,
481
481
  context,
482
- aid,
483
482
  views,
484
483
  model
485
484
  }) => {
486
485
  const { useGetView: useGetView2 } = (0, provider_exports.useService)();
487
486
  const viewParams = (0, import_react6.useMemo)(() => {
488
- if (!action) {
489
- return {
490
- model,
491
- views,
492
- context
493
- };
494
- }
487
+ if (!model || !views) return void 0;
495
488
  return {
496
489
  model,
497
490
  views,
498
491
  context,
499
- id: isNaN(Number(aid)) ? action?.id : aid
492
+ id
500
493
  };
501
- }, [action, context, aid, model, views]);
494
+ }, [model, views, context, id]);
502
495
  const view = useGetView2(
503
496
  viewParams || {},
504
497
  !!viewParams && !(0, utils_exports.isObjectEmpty)(viewParams)
@@ -599,9 +592,7 @@ var AppProvider = ({
599
592
  ]);
600
593
  }, [menuContext, action?.context, env?.context?.lang]);
601
594
  const view = useViewV2({
602
- action,
603
595
  context: viewContext,
604
- aid,
605
596
  views: [
606
597
  ...Array.isArray(action?.views) ? action?.views.map(
607
598
  (view2) => view2[1] === "list" ? [view2[0], "list"] : view2
package/dist/hooks.mjs CHANGED
@@ -458,28 +458,21 @@ var useUser = () => {
458
458
  // src/hooks/core/use-view-v2.ts
459
459
  import { useMemo as useMemo3 } from "react";
460
460
  var useViewV2 = ({
461
- action,
461
+ id,
462
462
  context,
463
- aid,
464
463
  views,
465
464
  model
466
465
  }) => {
467
466
  const { useGetView: useGetView2 } = (0, provider_exports.useService)();
468
467
  const viewParams = useMemo3(() => {
469
- if (!action) {
470
- return {
471
- model,
472
- views,
473
- context
474
- };
475
- }
468
+ if (!model || !views) return void 0;
476
469
  return {
477
470
  model,
478
471
  views,
479
472
  context,
480
- id: isNaN(Number(aid)) ? action?.id : aid
473
+ id
481
474
  };
482
- }, [action, context, aid, model, views]);
475
+ }, [model, views, context, id]);
483
476
  const view = useGetView2(
484
477
  viewParams || {},
485
478
  !!viewParams && !(0, utils_exports.isObjectEmpty)(viewParams)
@@ -580,9 +573,7 @@ var AppProvider = ({
580
573
  ]);
581
574
  }, [menuContext, action?.context, env?.context?.lang]);
582
575
  const view = useViewV2({
583
- action,
584
576
  context: viewContext,
585
- aid,
586
577
  views: [
587
578
  ...Array.isArray(action?.views) ? action?.views.map(
588
579
  (view2) => view2[1] === "list" ? [view2[0], "list"] : view2
package/dist/index.js CHANGED
@@ -4527,28 +4527,21 @@ var useUser = () => {
4527
4527
  // src/hooks/core/use-view-v2.ts
4528
4528
  var import_react6 = require("react");
4529
4529
  var useViewV2 = ({
4530
- action,
4530
+ id,
4531
4531
  context,
4532
- aid,
4533
4532
  views,
4534
4533
  model
4535
4534
  }) => {
4536
4535
  const { useGetView: useGetView2 } = (0, provider_exports.useService)();
4537
4536
  const viewParams = (0, import_react6.useMemo)(() => {
4538
- if (!action) {
4539
- return {
4540
- model,
4541
- views,
4542
- context
4543
- };
4544
- }
4537
+ if (!model || !views) return void 0;
4545
4538
  return {
4546
4539
  model,
4547
4540
  views,
4548
4541
  context,
4549
- id: isNaN(Number(aid)) ? action?.id : aid
4542
+ id
4550
4543
  };
4551
- }, [action, context, aid, model, views]);
4544
+ }, [model, views, context, id]);
4552
4545
  const view = useGetView2(
4553
4546
  viewParams || {},
4554
4547
  !!viewParams && !(0, utils_exports.isObjectEmpty)(viewParams)
@@ -4649,9 +4642,7 @@ var AppProvider = ({
4649
4642
  ]);
4650
4643
  }, [menuContext, action?.context, env?.context?.lang]);
4651
4644
  const view = useViewV2({
4652
- action,
4653
4645
  context: viewContext,
4654
- aid,
4655
4646
  views: [
4656
4647
  ...Array.isArray(action?.views) ? action?.views.map(
4657
4648
  (view2) => view2[1] === "list" ? [view2[0], "list"] : view2
package/dist/index.mjs CHANGED
@@ -4602,28 +4602,21 @@ var useUser = () => {
4602
4602
  // src/hooks/core/use-view-v2.ts
4603
4603
  import { useMemo as useMemo3 } from "react";
4604
4604
  var useViewV2 = ({
4605
- action,
4605
+ id,
4606
4606
  context,
4607
- aid,
4608
4607
  views,
4609
4608
  model
4610
4609
  }) => {
4611
4610
  const { useGetView: useGetView2 } = (0, provider_exports.useService)();
4612
4611
  const viewParams = useMemo3(() => {
4613
- if (!action) {
4614
- return {
4615
- model,
4616
- views,
4617
- context
4618
- };
4619
- }
4612
+ if (!model || !views) return void 0;
4620
4613
  return {
4621
4614
  model,
4622
4615
  views,
4623
4616
  context,
4624
- id: isNaN(Number(aid)) ? action?.id : aid
4617
+ id
4625
4618
  };
4626
- }, [action, context, aid, model, views]);
4619
+ }, [model, views, context, id]);
4627
4620
  const view = useGetView2(
4628
4621
  viewParams || {},
4629
4622
  !!viewParams && !(0, utils_exports.isObjectEmpty)(viewParams)
@@ -4724,9 +4717,7 @@ var AppProvider = ({
4724
4717
  ]);
4725
4718
  }, [menuContext, action?.context, env?.context?.lang]);
4726
4719
  const view = useViewV2({
4727
- action,
4728
4720
  context: viewContext,
4729
- aid,
4730
4721
  views: [
4731
4722
  ...Array.isArray(action?.views) ? action?.views.map(
4732
4723
  (view2) => view2[1] === "list" ? [view2[0], "list"] : view2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/widget-logic",
3
- "version": "2.5.5",
3
+ "version": "2.5.7",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",