@fctc/widget-logic 2.5.4 → 2.5.6

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,24 +477,20 @@ 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 void 0;
490
- }
491
487
  return {
492
488
  model,
493
489
  views,
494
490
  context,
495
- id: isNaN(Number(aid)) ? action?.id : aid
491
+ id
496
492
  };
497
- }, [action, context, aid]);
493
+ }, [model]);
498
494
  const view = useGetView2(
499
495
  viewParams || {},
500
496
  !!viewParams
@@ -595,9 +591,7 @@ var AppProvider = ({
595
591
  ]);
596
592
  }, [menuContext, action?.context, env?.context?.lang]);
597
593
  const view = useViewV2({
598
- action,
599
594
  context: viewContext,
600
- aid,
601
595
  views: [
602
596
  ...Array.isArray(action?.views) ? action?.views.map(
603
597
  (view2) => view2[1] === "list" ? [view2[0], "list"] : view2
package/dist/hooks.mjs CHANGED
@@ -458,24 +458,20 @@ 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 void 0;
471
- }
472
468
  return {
473
469
  model,
474
470
  views,
475
471
  context,
476
- id: isNaN(Number(aid)) ? action?.id : aid
472
+ id
477
473
  };
478
- }, [action, context, aid]);
474
+ }, [model]);
479
475
  const view = useGetView2(
480
476
  viewParams || {},
481
477
  !!viewParams
@@ -576,9 +572,7 @@ var AppProvider = ({
576
572
  ]);
577
573
  }, [menuContext, action?.context, env?.context?.lang]);
578
574
  const view = useViewV2({
579
- action,
580
575
  context: viewContext,
581
- aid,
582
576
  views: [
583
577
  ...Array.isArray(action?.views) ? action?.views.map(
584
578
  (view2) => view2[1] === "list" ? [view2[0], "list"] : view2
package/dist/index.js CHANGED
@@ -4527,24 +4527,20 @@ 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 void 0;
4540
- }
4541
4537
  return {
4542
4538
  model,
4543
4539
  views,
4544
4540
  context,
4545
- id: isNaN(Number(aid)) ? action?.id : aid
4541
+ id
4546
4542
  };
4547
- }, [action, context, aid]);
4543
+ }, [model]);
4548
4544
  const view = useGetView2(
4549
4545
  viewParams || {},
4550
4546
  !!viewParams
@@ -4645,9 +4641,7 @@ var AppProvider = ({
4645
4641
  ]);
4646
4642
  }, [menuContext, action?.context, env?.context?.lang]);
4647
4643
  const view = useViewV2({
4648
- action,
4649
4644
  context: viewContext,
4650
- aid,
4651
4645
  views: [
4652
4646
  ...Array.isArray(action?.views) ? action?.views.map(
4653
4647
  (view2) => view2[1] === "list" ? [view2[0], "list"] : view2
package/dist/index.mjs CHANGED
@@ -4602,24 +4602,20 @@ 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 void 0;
4615
- }
4616
4612
  return {
4617
4613
  model,
4618
4614
  views,
4619
4615
  context,
4620
- id: isNaN(Number(aid)) ? action?.id : aid
4616
+ id
4621
4617
  };
4622
- }, [action, context, aid]);
4618
+ }, [model]);
4623
4619
  const view = useGetView2(
4624
4620
  viewParams || {},
4625
4621
  !!viewParams
@@ -4720,9 +4716,7 @@ var AppProvider = ({
4720
4716
  ]);
4721
4717
  }, [menuContext, action?.context, env?.context?.lang]);
4722
4718
  const view = useViewV2({
4723
- action,
4724
4719
  context: viewContext,
4725
- aid,
4726
4720
  views: [
4727
4721
  ...Array.isArray(action?.views) ? action?.views.map(
4728
4722
  (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.4",
3
+ "version": "2.5.6",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",