@managespace/sdk 0.0.60 → 0.0.61

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.
@@ -5,17 +5,24 @@ export type ControlValidation = {
5
5
  };
6
6
  export type ControlOption = {
7
7
  name: string;
8
- value: string;
8
+ data: Record<string, unknown>;
9
9
  };
10
- export type PageControl = {
10
+ export type BasePageControl = {
11
11
  label: string;
12
- type: 'number' | 'text' | 'date' | 'checkbox' | 'radio' | 'textarea' | 'asset' | 'customer' | 'contact' | 'user' | 'insurance';
13
12
  responseField: string;
14
13
  required: boolean;
15
14
  placeholder?: string;
16
- options: PageControl['type'] extends 'radio' | 'checkbox' ? ControlOption[] : never;
17
15
  validation?: ControlValidation;
18
16
  };
17
+ export type SelectionPageControl = BasePageControl & {
18
+ type: 'radio' | 'checkbox';
19
+ options: ControlOption[];
20
+ };
21
+ export type OtherPageControl = BasePageControl & {
22
+ type: 'number' | 'text' | 'date' | 'textarea' | 'asset' | 'customer' | 'contact' | 'user' | 'insurance';
23
+ options?: never;
24
+ };
25
+ export type PageControl = SelectionPageControl | OtherPageControl;
19
26
  export type SectionLayout = {
20
27
  columns?: number;
21
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../src/extensibility/types/control.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EACE,QAAQ,GACR,MAAM,GACN,MAAM,GACN,UAAU,GACV,OAAO,GACP,UAAU,GACV,OAAO,GACP,UAAU,GACV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": {
5
5
  "dev": "tsc -w --preserveWatchOutput",
6
6
  "build": "tsc",
@@ -8,33 +8,40 @@ export type ControlValidation = {
8
8
 
9
9
  export type ControlOption = {
10
10
  name: string;
11
- value: string;
11
+ data: Record<string, unknown>;
12
12
  };
13
13
 
14
- export type PageControl = {
14
+ export type BasePageControl = {
15
15
  label: string;
16
+ responseField: string;
17
+ required: boolean;
18
+ placeholder?: string;
19
+ validation?: ControlValidation;
20
+ };
21
+
22
+ // Type for radio and checkbox controls
23
+ export type SelectionPageControl = BasePageControl & {
24
+ type: 'radio' | 'checkbox';
25
+ options: ControlOption[];
26
+ };
27
+
28
+ // Type for other controls
29
+ export type OtherPageControl = BasePageControl & {
16
30
  type:
17
31
  | 'number'
18
32
  | 'text'
19
33
  | 'date'
20
- | 'checkbox'
21
- | 'radio'
22
34
  | 'textarea'
23
35
  | 'asset'
24
36
  | 'customer'
25
37
  | 'contact'
26
38
  | 'user'
27
39
  | 'insurance';
28
- responseField: string;
29
- required: boolean;
30
- placeholder?: string;
31
- // options?: string;
32
- options: PageControl['type'] extends 'radio' | 'checkbox'
33
- ? ControlOption[]
34
- : never;
35
- validation?: ControlValidation;
40
+ options?: never;
36
41
  };
37
42
 
43
+ export type PageControl = SelectionPageControl | OtherPageControl;
44
+
38
45
  export type SectionLayout = {
39
46
  columns?: number;
40
47
  };