@win2win/shared-ui 0.0.10 → 0.0.12
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/components/DynamicForm/CardsSelectControl.vue.d.ts +23 -0
- package/dist/components/DynamicForm/CardsSelectControl.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/ControlLabel.vue.d.ts +16 -0
- package/dist/components/DynamicForm/ControlLabel.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/Controls/DynamicArrayControl.vue.d.ts +23 -0
- package/dist/components/DynamicForm/Controls/DynamicArrayControl.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/Controls/ObjectControl.vue.d.ts +23 -0
- package/dist/components/DynamicForm/Controls/ObjectControl.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/Controls/SimpleCheckbox.vue.d.ts +23 -0
- package/dist/components/DynamicForm/Controls/SimpleCheckbox.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/Controls/SimpleInput.vue.d.ts +24 -0
- package/dist/components/DynamicForm/Controls/SimpleInput.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/Controls/SimpleSelect.vue.d.ts +23 -0
- package/dist/components/DynamicForm/Controls/SimpleSelect.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/Controls/SimpleSwitch.vue.d.ts +23 -0
- package/dist/components/DynamicForm/Controls/SimpleSwitch.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/DynamicForm.vue.d.ts +29 -0
- package/dist/components/DynamicForm/DynamicForm.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/FormMapper.d.ts +8 -0
- package/dist/components/DynamicForm/FormMapper.d.ts.map +1 -0
- package/dist/components/DynamicForm/FormStepsIndicator.vue.d.ts +19 -0
- package/dist/components/DynamicForm/FormStepsIndicator.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/InputControl.vue.d.ts +38 -0
- package/dist/components/DynamicForm/InputControl.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/MapLocation.vue.d.ts +3 -0
- package/dist/components/DynamicForm/MapLocation.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/MultipleFormGroups.vue.d.ts +16 -0
- package/dist/components/DynamicForm/MultipleFormGroups.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/NavigationButtons.vue.d.ts +26 -0
- package/dist/components/DynamicForm/NavigationButtons.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/SelectControl.vue.d.ts +23 -0
- package/dist/components/DynamicForm/SelectControl.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/SelectCurrencyControl.vue.d.ts +23 -0
- package/dist/components/DynamicForm/SelectCurrencyControl.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/SelectZoneControl.vue.d.ts +23 -0
- package/dist/components/DynamicForm/SelectZoneControl.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/SingleFormGroup.vue.d.ts +16 -0
- package/dist/components/DynamicForm/SingleFormGroup.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/StepHeader.vue.d.ts +19 -0
- package/dist/components/DynamicForm/StepHeader.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/StepsNavigationButtons.vue.d.ts +7 -0
- package/dist/components/DynamicForm/StepsNavigationButtons.vue.d.ts.map +1 -0
- package/dist/components/DynamicForm/consts.d.ts +3 -0
- package/dist/components/DynamicForm/consts.d.ts.map +1 -0
- package/dist/components/DynamicForm/control-validators.d.ts +12 -0
- package/dist/components/DynamicForm/control-validators.d.ts.map +1 -0
- package/dist/components/DynamicForm/helpers.d.ts +5 -0
- package/dist/components/DynamicForm/helpers.d.ts.map +1 -0
- package/dist/components/DynamicForm/models.d.ts +197 -0
- package/dist/components/DynamicForm/models.d.ts.map +1 -0
- package/dist/components/DynamicForm/useFormGroups.d.ts +106 -0
- package/dist/components/DynamicForm/useFormGroups.d.ts.map +1 -0
- package/dist/components/DynamicForm/useFormStore.d.ts +433 -0
- package/dist/components/DynamicForm/useFormStore.d.ts.map +1 -0
- package/dist/components/Inputs/WinInput.vue.d.ts +108 -0
- package/dist/components/Inputs/WinInput.vue.d.ts.map +1 -0
- package/dist/components/Inputs/WinSelect.vue.d.ts +234 -0
- package/dist/components/Inputs/WinSelect.vue.d.ts.map +1 -0
- package/dist/components/TestUi.vue.d.ts +0 -1
- package/dist/components/TestUi.vue.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/mock-forms.d.ts +3 -0
- package/dist/mock-forms.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/w2w-shared-ui.js +10247 -9
- package/dist/w2w-shared-ui.umd.cjs +35 -1
- package/package.json +9 -4
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { ControlType, GamaPropControlCode } from '@win2win/shared';
|
|
2
|
+
import { ControlValidator } from './control-validators';
|
|
3
|
+
export interface FormStep {
|
|
4
|
+
controls: FormControl[];
|
|
5
|
+
title: string;
|
|
6
|
+
order: number;
|
|
7
|
+
name: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
id: number;
|
|
10
|
+
}
|
|
11
|
+
export interface FormStepModel extends FormStep {
|
|
12
|
+
valid: boolean;
|
|
13
|
+
controls: FormControlModel[];
|
|
14
|
+
}
|
|
15
|
+
export interface FormGroup {
|
|
16
|
+
title: string;
|
|
17
|
+
controls: FormControl[];
|
|
18
|
+
order: number;
|
|
19
|
+
}
|
|
20
|
+
export interface FormGroupModel extends FormGroup {
|
|
21
|
+
visible: boolean;
|
|
22
|
+
valid: boolean;
|
|
23
|
+
controls: FormControlModel[];
|
|
24
|
+
id: string;
|
|
25
|
+
}
|
|
26
|
+
export interface FormControlModel extends FormControl {
|
|
27
|
+
valid: boolean;
|
|
28
|
+
value: any;
|
|
29
|
+
visible?: boolean;
|
|
30
|
+
parentKey?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface FormControl {
|
|
33
|
+
code: string;
|
|
34
|
+
controlType: ControlType;
|
|
35
|
+
label?: string;
|
|
36
|
+
type?: 'text' | 'number' | 'tel' | 'textarea';
|
|
37
|
+
name: string;
|
|
38
|
+
defaultValue?: string | number;
|
|
39
|
+
validators?: ControlValidator[];
|
|
40
|
+
options?: SelectOption[];
|
|
41
|
+
conditions?: ControlCondition[];
|
|
42
|
+
multiple?: boolean;
|
|
43
|
+
id: number;
|
|
44
|
+
suffix?: string;
|
|
45
|
+
prefix?: string;
|
|
46
|
+
row: number;
|
|
47
|
+
col: number;
|
|
48
|
+
structure: FormControl[];
|
|
49
|
+
group: number;
|
|
50
|
+
title: string;
|
|
51
|
+
customParams?: {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
};
|
|
54
|
+
itemsLength?: {
|
|
55
|
+
default: number;
|
|
56
|
+
controlId: number | null;
|
|
57
|
+
value: number;
|
|
58
|
+
} | null;
|
|
59
|
+
}
|
|
60
|
+
export interface ControlCondition {
|
|
61
|
+
logic: 'AND' | 'OR';
|
|
62
|
+
children: ControlCondition[];
|
|
63
|
+
operator: ConditionOperator;
|
|
64
|
+
id: number;
|
|
65
|
+
value: string;
|
|
66
|
+
}
|
|
67
|
+
export declare const OPERATORS: readonly ["==", "!=", ">", "<", ">=", "<=", "contains", "not_contains", "in", "not_in"];
|
|
68
|
+
export type ConditionOperator = (typeof OPERATORS)[number];
|
|
69
|
+
export interface SelectOption {
|
|
70
|
+
value: string | number | boolean;
|
|
71
|
+
label: string | (() => string);
|
|
72
|
+
exclusive: boolean;
|
|
73
|
+
image?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface ProductOption {
|
|
76
|
+
GAMA: number;
|
|
77
|
+
SUBGAMA: number;
|
|
78
|
+
NOMBRE: string;
|
|
79
|
+
}
|
|
80
|
+
interface ProductFieldProps {
|
|
81
|
+
code: string;
|
|
82
|
+
label: string;
|
|
83
|
+
type: 'text' | 'number' | 'select' | 'location' | 'climate' | 'boolean' | 'state';
|
|
84
|
+
isMain?: boolean;
|
|
85
|
+
suffix?: string;
|
|
86
|
+
multiple?: boolean;
|
|
87
|
+
options?: {
|
|
88
|
+
label: string;
|
|
89
|
+
value: string | number;
|
|
90
|
+
}[];
|
|
91
|
+
group?: number;
|
|
92
|
+
class?: string;
|
|
93
|
+
}
|
|
94
|
+
export interface ProductFieldPropsWithValue extends ProductFieldProps {
|
|
95
|
+
value: any;
|
|
96
|
+
}
|
|
97
|
+
export interface Contact {
|
|
98
|
+
RAZON_SOCIAL: string;
|
|
99
|
+
NOMBRE: string;
|
|
100
|
+
NIF: string;
|
|
101
|
+
EMAIL: string;
|
|
102
|
+
PAGINA_WEB: string;
|
|
103
|
+
PERSONA_CONTACTO: string;
|
|
104
|
+
TIPO_DOC: string;
|
|
105
|
+
NUMERO_DOC: string;
|
|
106
|
+
ID_LANDING: number;
|
|
107
|
+
}
|
|
108
|
+
export declare const getDefaultControlValue: (control: FormControl) => {} | null;
|
|
109
|
+
export interface Mapper<R, T, S> {
|
|
110
|
+
fromRaw(data: R): T | null;
|
|
111
|
+
toRaw(data: T): S | null;
|
|
112
|
+
}
|
|
113
|
+
export interface HeaderLink {
|
|
114
|
+
text: string;
|
|
115
|
+
link: string;
|
|
116
|
+
section?: string;
|
|
117
|
+
external?: boolean;
|
|
118
|
+
}
|
|
119
|
+
export interface LandingParams {
|
|
120
|
+
logo?: string;
|
|
121
|
+
titulo_formulario: string;
|
|
122
|
+
requestButton?: {
|
|
123
|
+
text: string;
|
|
124
|
+
link: string;
|
|
125
|
+
color: string;
|
|
126
|
+
};
|
|
127
|
+
footerText?: string;
|
|
128
|
+
headerLinks?: HeaderLink[];
|
|
129
|
+
description?: string;
|
|
130
|
+
contact?: {
|
|
131
|
+
email: string;
|
|
132
|
+
phone: string;
|
|
133
|
+
address: string;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
export interface StylesRaw {
|
|
137
|
+
CONTENIDO: object;
|
|
138
|
+
NOMBRE: string;
|
|
139
|
+
DESCRIPCION: string;
|
|
140
|
+
FECHA_UPD: string;
|
|
141
|
+
ESTADO: number;
|
|
142
|
+
ID_LANDING: number;
|
|
143
|
+
ID_LANDING_STYLE: number;
|
|
144
|
+
}
|
|
145
|
+
export interface FormRaw {
|
|
146
|
+
ID_CUESTIONARIO: number;
|
|
147
|
+
ID_LANDING: number;
|
|
148
|
+
ID_BASE: null;
|
|
149
|
+
NOMBRE: string;
|
|
150
|
+
ORDEN: number;
|
|
151
|
+
DESCRIPCION: string;
|
|
152
|
+
ESTADO: number;
|
|
153
|
+
FECHA_CREADO: string;
|
|
154
|
+
FECHA_UPD: string;
|
|
155
|
+
PREGUNTAS: FormQuestion[];
|
|
156
|
+
CLAVE: string;
|
|
157
|
+
}
|
|
158
|
+
export interface FormQuestion {
|
|
159
|
+
ID_CUESTIONARIO_PREGUNTA: number;
|
|
160
|
+
ID_CUESTIONARIO: number;
|
|
161
|
+
NOMBRE: string;
|
|
162
|
+
CLAVE: string;
|
|
163
|
+
RESPUESTAS?: {
|
|
164
|
+
label: string;
|
|
165
|
+
value: string;
|
|
166
|
+
image?: string | null;
|
|
167
|
+
exclusive: boolean;
|
|
168
|
+
}[] | null;
|
|
169
|
+
VALIDACIONES?: {
|
|
170
|
+
validator: string;
|
|
171
|
+
param?: string;
|
|
172
|
+
}[];
|
|
173
|
+
ICON?: string | null;
|
|
174
|
+
CLASS?: string | null;
|
|
175
|
+
TIPO: GamaPropControlCode;
|
|
176
|
+
ESTADO: number;
|
|
177
|
+
GRUPO: number;
|
|
178
|
+
TITULO_GRUPO: string | null;
|
|
179
|
+
FILA?: number;
|
|
180
|
+
COLUMNA?: number;
|
|
181
|
+
MULTIPLE?: boolean | number;
|
|
182
|
+
PREFIJO: string | null;
|
|
183
|
+
SUFIJO: string | null;
|
|
184
|
+
STRUCTURE?: object | null;
|
|
185
|
+
CONDITIONS?: any[] | null;
|
|
186
|
+
LENGTH?: {
|
|
187
|
+
default: number;
|
|
188
|
+
controlId: number | null;
|
|
189
|
+
} | null;
|
|
190
|
+
PARAMS?: object | null;
|
|
191
|
+
}
|
|
192
|
+
export interface FormAnswer {
|
|
193
|
+
ID_CUESTIONARIO_PREGUNTA: number;
|
|
194
|
+
RESPUESTA: any;
|
|
195
|
+
}
|
|
196
|
+
export {};
|
|
197
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicForm/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,aAAc,SAAQ,QAAQ;IAC7C,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAe,SAAQ,SAAS;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,EAAE,EAAE,MAAM,CAAC;CACZ;AACD,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACnD,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE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AAG,IAAI,CAAC;KAC1B,GAAG,IAAI,CAAC;IACT,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,wBAAwB,EAAE,MAAM,CAAC;IACjC,SAAS,EAAE,GAAG,CAAC;CAChB"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { FormControlModel } from './models';
|
|
2
|
+
interface GroupOptions {
|
|
3
|
+
maxControlsPerGroup?: number;
|
|
4
|
+
notifyValidations?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function useFormGroups(formStepIndex: number, options?: GroupOptions): {
|
|
7
|
+
model: import("vue").Ref<{
|
|
8
|
+
visible: boolean;
|
|
9
|
+
valid: boolean;
|
|
10
|
+
controls: {
|
|
11
|
+
valid: boolean;
|
|
12
|
+
value: any;
|
|
13
|
+
visible?: boolean | undefined;
|
|
14
|
+
parentKey?: string | undefined;
|
|
15
|
+
code: string;
|
|
16
|
+
controlType: import("@win2win/shared").ControlType;
|
|
17
|
+
label?: string | undefined;
|
|
18
|
+
type?: "number" | "text" | "tel" | "textarea" | undefined;
|
|
19
|
+
name: string;
|
|
20
|
+
defaultValue?: string | number | undefined;
|
|
21
|
+
validators?: {
|
|
22
|
+
validator: string;
|
|
23
|
+
param?: string | number | undefined;
|
|
24
|
+
}[] | undefined;
|
|
25
|
+
options?: {
|
|
26
|
+
value: string | number | boolean;
|
|
27
|
+
label: string | (() => string);
|
|
28
|
+
exclusive: boolean;
|
|
29
|
+
image?: string | undefined;
|
|
30
|
+
}[] | undefined;
|
|
31
|
+
conditions?: {
|
|
32
|
+
logic: "AND" | "OR";
|
|
33
|
+
children: any[];
|
|
34
|
+
operator: ">" | "<" | ">=" | "<=" | "==" | "!=" | "contains" | "not_contains" | "in" | "not_in";
|
|
35
|
+
id: number;
|
|
36
|
+
value: string;
|
|
37
|
+
}[] | undefined;
|
|
38
|
+
multiple?: boolean | undefined;
|
|
39
|
+
id: number;
|
|
40
|
+
suffix?: string | undefined;
|
|
41
|
+
prefix?: string | undefined;
|
|
42
|
+
row: number;
|
|
43
|
+
col: number;
|
|
44
|
+
structure: {
|
|
45
|
+
code: string;
|
|
46
|
+
controlType: import("@win2win/shared").ControlType;
|
|
47
|
+
label?: string | undefined;
|
|
48
|
+
type?: "number" | "text" | "tel" | "textarea" | undefined;
|
|
49
|
+
name: string;
|
|
50
|
+
defaultValue?: string | number | undefined;
|
|
51
|
+
validators?: {
|
|
52
|
+
validator: string;
|
|
53
|
+
param?: string | number | undefined;
|
|
54
|
+
}[] | undefined;
|
|
55
|
+
options?: {
|
|
56
|
+
value: string | number | boolean;
|
|
57
|
+
label: string | (() => string);
|
|
58
|
+
exclusive: boolean;
|
|
59
|
+
image?: string | undefined;
|
|
60
|
+
}[] | undefined;
|
|
61
|
+
conditions?: {
|
|
62
|
+
logic: "AND" | "OR";
|
|
63
|
+
children: any[];
|
|
64
|
+
operator: ">" | "<" | ">=" | "<=" | "==" | "!=" | "contains" | "not_contains" | "in" | "not_in";
|
|
65
|
+
id: number;
|
|
66
|
+
value: string;
|
|
67
|
+
}[] | undefined;
|
|
68
|
+
multiple?: boolean | undefined;
|
|
69
|
+
id: number;
|
|
70
|
+
suffix?: string | undefined;
|
|
71
|
+
prefix?: string | undefined;
|
|
72
|
+
row: number;
|
|
73
|
+
col: number;
|
|
74
|
+
structure: any[];
|
|
75
|
+
group: number;
|
|
76
|
+
title: string;
|
|
77
|
+
customParams?: {
|
|
78
|
+
[key: string]: any;
|
|
79
|
+
} | undefined;
|
|
80
|
+
itemsLength?: {
|
|
81
|
+
default: number;
|
|
82
|
+
controlId: number | null;
|
|
83
|
+
value: number;
|
|
84
|
+
} | null | undefined;
|
|
85
|
+
}[];
|
|
86
|
+
group: number;
|
|
87
|
+
title: string;
|
|
88
|
+
customParams?: {
|
|
89
|
+
[key: string]: any;
|
|
90
|
+
} | undefined;
|
|
91
|
+
itemsLength?: {
|
|
92
|
+
default: number;
|
|
93
|
+
controlId: number | null;
|
|
94
|
+
value: number;
|
|
95
|
+
} | null | undefined;
|
|
96
|
+
}[];
|
|
97
|
+
id: string;
|
|
98
|
+
title: string;
|
|
99
|
+
order: number;
|
|
100
|
+
}[]>;
|
|
101
|
+
errorMessages: import("vue").Ref<string[]>;
|
|
102
|
+
rebuildModel: () => void;
|
|
103
|
+
onControlValueUpdate: (control: FormControlModel, groupId?: string) => void;
|
|
104
|
+
};
|
|
105
|
+
export {};
|
|
106
|
+
//# sourceMappingURL=useFormGroups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useFormGroups.d.ts","sourceRoot":"","sources":["../../../src/components/DynamicForm/useFormGroups.ts"],"names":[],"mappings":"AAKA,OAAO,EAAqB,gBAAgB,EAAiC,MAAM,UAAU,CAAC;AAG9F,UAAU,YAAY;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAG7B;AAOD,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCAc9D,gBAAgB,YACf,MAAM;EAqInB"}
|