@esportsplus/ui 0.35.6 → 0.35.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.
@@ -1,10 +1,7 @@
1
1
  import response, { Response } from '@esportsplus/action';
2
2
  import { Attributes } from '@esportsplus/template';
3
3
  type A = {
4
- action: (<T extends Record<string, unknown>>(data: {
5
- input: T;
6
- response: typeof response;
7
- }) => (Promise<Errors> | Errors));
4
+ action: (input: Record<string, any>, r: typeof response) => (Promise<Errors> | Errors);
8
5
  state?: {
9
6
  processing: boolean;
10
7
  };
@@ -45,10 +45,7 @@ export default template.factory((attributes, content) => {
45
45
  if (state) {
46
46
  state.processing = true;
47
47
  }
48
- let { errors } = await action({
49
- input: parse(new FormData(this).entries()),
50
- response
51
- });
48
+ let { errors } = await action(parse(new FormData(this).entries()), response);
52
49
  for (let i = 0, n = errors.length; i < n; i++) {
53
50
  let { message, path } = errors[i], reactive = input.get(this[path]);
54
51
  if (!reactive) {
@@ -2,14 +2,11 @@ declare const _default: {
2
2
  action: {
3
3
  (): ReturnType<(this: {
4
4
  attributes?: ({
5
- action: (<T extends Record<string, unknown>>(data: {
6
- input: T;
7
- response: typeof import("@esportsplus/action").default;
8
- }) => (Promise<{
5
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
9
6
  errors: import("@esportsplus/action").Response<unknown>["errors"];
10
7
  }> | {
11
8
  errors: import("@esportsplus/action").Response<unknown>["errors"];
12
- }));
9
+ });
13
10
  state?: {
14
11
  processing: boolean;
15
12
  };
@@ -129,14 +126,11 @@ declare const _default: {
129
126
  } & Record<PropertyKey, unknown>) | undefined;
130
127
  content?: import("@esportsplus/template").Renderable<any>;
131
128
  }, attributes: Readonly<{
132
- action: (<T extends Record<string, unknown>>(data: {
133
- input: T;
134
- response: typeof import("@esportsplus/action").default;
135
- }) => (Promise<{
129
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
136
130
  errors: import("@esportsplus/action").Response<unknown>["errors"];
137
131
  }> | {
138
132
  errors: import("@esportsplus/action").Response<unknown>["errors"];
139
- }));
133
+ });
140
134
  state?: {
141
135
  processing: boolean;
142
136
  };
@@ -255,14 +249,11 @@ declare const _default: {
255
249
  onwheel?: ((this: import("@esportsplus/template").Element, event: WheelEvent) => void) | undefined;
256
250
  } & Record<PropertyKey, unknown>>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
257
251
  <T extends {
258
- action: (<T_1 extends Record<string, unknown>>(data: {
259
- input: T_1;
260
- response: typeof import("@esportsplus/action").default;
261
- }) => (Promise<{
252
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
262
253
  errors: import("@esportsplus/action").Response<unknown>["errors"];
263
254
  }> | {
264
255
  errors: import("@esportsplus/action").Response<unknown>["errors"];
265
- }));
256
+ });
266
257
  state?: {
267
258
  processing: boolean;
268
259
  };
@@ -381,14 +372,11 @@ declare const _default: {
381
372
  onwheel?: ((this: import("@esportsplus/template").Element, event: WheelEvent) => void) | undefined;
382
373
  } & Record<PropertyKey, unknown>>(attributes: T): ReturnType<(this: {
383
374
  attributes?: ({
384
- action: (<T_1 extends Record<string, unknown>>(data: {
385
- input: T_1;
386
- response: typeof import("@esportsplus/action").default;
387
- }) => (Promise<{
375
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
388
376
  errors: import("@esportsplus/action").Response<unknown>["errors"];
389
377
  }> | {
390
378
  errors: import("@esportsplus/action").Response<unknown>["errors"];
391
- }));
379
+ });
392
380
  state?: {
393
381
  processing: boolean;
394
382
  };
@@ -508,14 +496,11 @@ declare const _default: {
508
496
  } & Record<PropertyKey, unknown>) | undefined;
509
497
  content?: import("@esportsplus/template").Renderable<any>;
510
498
  }, attributes: Readonly<{
511
- action: (<T_1 extends Record<string, unknown>>(data: {
512
- input: T_1;
513
- response: typeof import("@esportsplus/action").default;
514
- }) => (Promise<{
499
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
515
500
  errors: import("@esportsplus/action").Response<unknown>["errors"];
516
501
  }> | {
517
502
  errors: import("@esportsplus/action").Response<unknown>["errors"];
518
- }));
503
+ });
519
504
  state?: {
520
505
  processing: boolean;
521
506
  };
@@ -635,14 +620,11 @@ declare const _default: {
635
620
  } & Record<PropertyKey, unknown>>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
636
621
  <T extends import("@esportsplus/template").Renderable<any>>(content: T): ReturnType<(this: {
637
622
  attributes?: ({
638
- action: (<T_1 extends Record<string, unknown>>(data: {
639
- input: T_1;
640
- response: typeof import("@esportsplus/action").default;
641
- }) => (Promise<{
623
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
642
624
  errors: import("@esportsplus/action").Response<unknown>["errors"];
643
625
  }> | {
644
626
  errors: import("@esportsplus/action").Response<unknown>["errors"];
645
- }));
627
+ });
646
628
  state?: {
647
629
  processing: boolean;
648
630
  };
@@ -762,14 +744,11 @@ declare const _default: {
762
744
  } & Record<PropertyKey, unknown>) | undefined;
763
745
  content?: import("@esportsplus/template").Renderable<any>;
764
746
  }, attributes: Readonly<{
765
- action: (<T_1 extends Record<string, unknown>>(data: {
766
- input: T_1;
767
- response: typeof import("@esportsplus/action").default;
768
- }) => (Promise<{
747
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
769
748
  errors: import("@esportsplus/action").Response<unknown>["errors"];
770
749
  }> | {
771
750
  errors: import("@esportsplus/action").Response<unknown>["errors"];
772
- }));
751
+ });
773
752
  state?: {
774
753
  processing: boolean;
775
754
  };
@@ -888,14 +867,11 @@ declare const _default: {
888
867
  onwheel?: ((this: import("@esportsplus/template").Element, event: WheelEvent) => void) | undefined;
889
868
  } & Record<PropertyKey, unknown>>, content: import("@esportsplus/template").Renderable<any>) => import("@esportsplus/template").Renderable<any>>;
890
869
  (attributes: {
891
- action: (<T extends Record<string, unknown>>(data: {
892
- input: T;
893
- response: typeof import("@esportsplus/action").default;
894
- }) => (Promise<{
870
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
895
871
  errors: import("@esportsplus/action").Response<unknown>["errors"];
896
872
  }> | {
897
873
  errors: import("@esportsplus/action").Response<unknown>["errors"];
898
- }));
874
+ });
899
875
  state?: {
900
876
  processing: boolean;
901
877
  };
@@ -1014,14 +990,11 @@ declare const _default: {
1014
990
  onwheel?: ((this: import("@esportsplus/template").Element, event: WheelEvent) => void) | undefined;
1015
991
  } & Record<PropertyKey, unknown>, content: import("@esportsplus/template").Renderable<any>): ReturnType<(this: {
1016
992
  attributes?: ({
1017
- action: (<T extends Record<string, unknown>>(data: {
1018
- input: T;
1019
- response: typeof import("@esportsplus/action").default;
1020
- }) => (Promise<{
993
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
1021
994
  errors: import("@esportsplus/action").Response<unknown>["errors"];
1022
995
  }> | {
1023
996
  errors: import("@esportsplus/action").Response<unknown>["errors"];
1024
- }));
997
+ });
1025
998
  state?: {
1026
999
  processing: boolean;
1027
1000
  };
@@ -1141,14 +1114,11 @@ declare const _default: {
1141
1114
  } & Record<PropertyKey, unknown>) | undefined;
1142
1115
  content?: import("@esportsplus/template").Renderable<any>;
1143
1116
  }, attributes: Readonly<{
1144
- action: (<T extends Record<string, unknown>>(data: {
1145
- input: T;
1146
- response: typeof import("@esportsplus/action").default;
1147
- }) => (Promise<{
1117
+ action: (input: Record<string, any>, r: typeof import("@esportsplus/action").default) => (Promise<{
1148
1118
  errors: import("@esportsplus/action").Response<unknown>["errors"];
1149
1119
  }> | {
1150
1120
  errors: import("@esportsplus/action").Response<unknown>["errors"];
1151
- }));
1121
+ });
1152
1122
  state?: {
1153
1123
  processing: boolean;
1154
1124
  };
package/package.json CHANGED
@@ -42,7 +42,7 @@
42
42
  "private": false,
43
43
  "sideEffects": false,
44
44
  "type": "module",
45
- "version": "0.35.6",
45
+ "version": "0.35.7",
46
46
  "scripts": {
47
47
  "build": "run-s build:vite build:ts",
48
48
  "build:ts": "tsc && tsc-alias",
@@ -6,12 +6,7 @@ import input from './input';
6
6
 
7
7
 
8
8
  type A = {
9
- action: (<
10
- T extends Record<string, unknown>>(data: {
11
- input: T;
12
- response: typeof response;
13
- }) => (Promise<Errors> | Errors)
14
- ),
9
+ action: (input: Record<string, any>, r: typeof response) => (Promise<Errors> | Errors),
15
10
  state?: { processing: boolean }
16
11
  } & Attributes;
17
12
 
@@ -80,10 +75,10 @@ export default template.factory<A>(
80
75
  state.processing = true;
81
76
  }
82
77
 
83
- let { errors } = await action({
84
- input: parse( new FormData( this as any as HTMLFormElement ).entries() ),
78
+ let { errors } = await action(
79
+ parse( new FormData( this as any as HTMLFormElement ).entries() ),
85
80
  response
86
- });
81
+ );
87
82
 
88
83
  for (let i = 0, n = errors.length; i < n; i++) {
89
84
  let { message, path } = errors[i],