@arquimedes.co/eureka-forms 3.0.44-test → 3.0.45-mui9
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/@Types/FormStep.d.ts +4 -2
- package/dist/@Types/GenericFormSteps.d.ts +1 -1
- package/dist/App/AppHooks.js +13 -13
- package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +7 -5
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +5 -3
- package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +7 -5
- package/dist/FormSteps/@StoryDecorators/FormStepDecorator.d.ts +9 -0
- package/dist/FormSteps/@StoryDecorators/FormStepDecorator.js +86 -0
- package/dist/FormSteps/AYFStepMapper.js +2 -2
- package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +3 -3
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +7 -5
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +1 -1
- package/dist/FormSteps/StepFunctions.js +1 -1
- package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +1 -0
- package/dist/Shared/ErkCheckbox/ErkCheckBox.js +2 -2
- package/dist/Shared/ErkDatePicker/ErkDatePicker.js +41 -35
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.d.ts +4 -1
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +38 -25
- package/dist/Shared/ErkMenuItem.d.ts +1 -1
- package/dist/Shared/ErkSelect/ErkSelect.d.ts +2 -2
- package/dist/Shared/ErkTextField/ErkTextField.d.ts +17 -2
- package/dist/Shared/ErkTextField/ErkTextField.js +3 -3
- package/dist/Shared/ErkTimePicker/ErkTimePicker.js +1 -1
- package/dist/Shared/Rating/Ratings/ScaleRating.js +1 -1
- package/dist/States/GlobalSlice.d.ts +8 -26
- package/dist/States/GlobalSlice.js +3 -2
- package/dist/States/SiteSlice.d.ts +8 -33
- package/dist/States/SiteSlice.js +11 -9
- package/dist/States/WidthStatsSlice.d.ts +5 -1
- package/dist/Utils/DraftFunctions.js +1 -1
- package/dist/index.css +7 -0
- package/dist/main.d.ts +1 -1
- package/dist/main.js +1 -1
- package/package.json +34 -33
- package/dist/Shared/ErkButton/ErkButton.stories.d.ts +0 -16
- package/dist/Shared/ErkButton/ErkButton.stories.js +0 -28
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +0 -13
- package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +0 -34
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +0 -23
- package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +0 -98
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.stories.d.ts +0 -36
- package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.stories.js +0 -274
- package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +0 -21
- package/dist/Shared/ErkSelect/ErkSelect.stories.js +0 -87
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.d.ts +0 -26
- package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +0 -159
- package/dist/Shared/ErkTextField/ErkTextField.stories.d.ts +0 -24
- package/dist/Shared/ErkTextField/ErkTextField.stories.js +0 -99
- package/dist/Shared/Navbar/Navbar.stories.d.ts +0 -13
- package/dist/Shared/Navbar/Navbar.stories.js +0 -13
- package/dist/Shared/Rating/Rating.stories.d.ts +0 -15
- package/dist/Shared/Rating/Rating.stories.js +0 -47
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import ErkDateRangePicker from './ErkDateRangePicker';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof ErkDateRangePicker;
|
|
5
|
-
tags: string[];
|
|
6
|
-
args: {
|
|
7
|
-
readOnly: false;
|
|
8
|
-
};
|
|
9
|
-
parameters: {
|
|
10
|
-
dateRange: Date[];
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
export declare const Empty: Story;
|
|
16
|
-
export declare const Default: Story;
|
|
17
|
-
export declare const Interactive: Story;
|
|
18
|
-
export declare const ValueAndLabel: Story;
|
|
19
|
-
export declare const Full: Story;
|
|
20
|
-
export declare const Error: Story;
|
|
21
|
-
export declare const Menu: Story;
|
|
22
|
-
export declare const WithSelectedRange: Story;
|
|
23
|
-
export declare const Disabled: Story;
|
|
24
|
-
export declare const ReadOnly: Story;
|
|
25
|
-
export declare const WithError: Story;
|
|
26
|
-
export declare const Required: Story;
|
|
27
|
-
export declare const SmallSize: Story;
|
|
28
|
-
export declare const MediumSize: Story;
|
|
29
|
-
export declare const CurrentMonth: Story;
|
|
30
|
-
export declare const LastWeek: Story;
|
|
31
|
-
export declare const NextMonth: Story;
|
|
32
|
-
export declare const WithMinMaxDates: Story;
|
|
33
|
-
export declare const YearRange: Story;
|
|
34
|
-
export declare const QuarterRange: Story;
|
|
35
|
-
export declare const EventDuration: Story;
|
|
36
|
-
export declare const MultipleStates: Story;
|
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import ErkDateRangePicker from './ErkDateRangePicker';
|
|
3
|
-
import { useArgs } from 'storybook/internal/preview-api';
|
|
4
|
-
import { useState } from 'react';
|
|
5
|
-
const meta = {
|
|
6
|
-
component: ErkDateRangePicker,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
args: {
|
|
9
|
-
readOnly: false,
|
|
10
|
-
},
|
|
11
|
-
parameters: {
|
|
12
|
-
dateRange: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
export default meta;
|
|
16
|
-
export const Empty = {
|
|
17
|
-
args: {
|
|
18
|
-
label: 'Seleccionar Rango',
|
|
19
|
-
value: [null, null],
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
export const Default = {
|
|
23
|
-
args: {
|
|
24
|
-
label: 'Rango de Fechas',
|
|
25
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
26
|
-
},
|
|
27
|
-
render: function Component(args) {
|
|
28
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
29
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export const Interactive = {
|
|
33
|
-
args: {
|
|
34
|
-
label: 'Rango Interactivo',
|
|
35
|
-
value: [null, null],
|
|
36
|
-
helperText: 'Seleccione un rango de fechas',
|
|
37
|
-
},
|
|
38
|
-
render: function Component(args) {
|
|
39
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
40
|
-
const handleChange = (newValue) => {
|
|
41
|
-
setValue(newValue);
|
|
42
|
-
args.onChange?.(newValue);
|
|
43
|
-
};
|
|
44
|
-
return (_jsxs("div", { children: [_jsx(ErkDateRangePicker, { ...args, value: value, onChange: handleChange }), _jsxs("div", { style: { marginTop: '20px', fontSize: '14px' }, children: [_jsx("strong", { children: "Valor seleccionado:" }), _jsxs("div", { children: ["Inicio: ", value[0]?.toLocaleDateString('es-ES') ?? 'No seleccionado'] }), _jsxs("div", { children: ["Fin: ", value[1]?.toLocaleDateString('es-ES') ?? 'No seleccionado'] })] })] }));
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
export const ValueAndLabel = {
|
|
48
|
-
args: {
|
|
49
|
-
label: 'Rango de Fechas',
|
|
50
|
-
value: [null, null],
|
|
51
|
-
},
|
|
52
|
-
render: function Component(args) {
|
|
53
|
-
const [, setArgs] = useArgs();
|
|
54
|
-
const onValueChange = (value) => {
|
|
55
|
-
args.onChange?.(value);
|
|
56
|
-
setArgs({ value });
|
|
57
|
-
};
|
|
58
|
-
return _jsx(ErkDateRangePicker, { ...args, onChange: onValueChange });
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
export const Full = {
|
|
62
|
-
args: {
|
|
63
|
-
label: 'Rango de Fechas',
|
|
64
|
-
value: [null, null],
|
|
65
|
-
helperText: 'Seleccione un rango de fechas',
|
|
66
|
-
},
|
|
67
|
-
render: function Component(args) {
|
|
68
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
69
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
export const Error = {
|
|
73
|
-
args: {
|
|
74
|
-
label: 'Rango de Fechas',
|
|
75
|
-
value: [null, null],
|
|
76
|
-
helperText: 'Error: Rango de fechas inválido',
|
|
77
|
-
error: true,
|
|
78
|
-
},
|
|
79
|
-
render: function Component(args) {
|
|
80
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
81
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
82
|
-
},
|
|
83
|
-
};
|
|
84
|
-
export const Menu = {
|
|
85
|
-
args: {
|
|
86
|
-
label: 'Rango de Fechas',
|
|
87
|
-
value: [null, null],
|
|
88
|
-
},
|
|
89
|
-
render: function Component(args) {
|
|
90
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
91
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
92
|
-
},
|
|
93
|
-
play: async ({ canvas, userEvent }) => {
|
|
94
|
-
const selector = canvas.getByTestId('date-picker');
|
|
95
|
-
await userEvent.click(selector);
|
|
96
|
-
},
|
|
97
|
-
};
|
|
98
|
-
export const WithSelectedRange = {
|
|
99
|
-
args: {
|
|
100
|
-
label: 'Vacaciones',
|
|
101
|
-
value: [new Date('2024-12-20'), new Date('2025-01-05')],
|
|
102
|
-
helperText: 'Período de vacaciones',
|
|
103
|
-
},
|
|
104
|
-
render: function Component(args) {
|
|
105
|
-
const [, setArgs] = useArgs();
|
|
106
|
-
const onValueChange = (value) => {
|
|
107
|
-
args.onChange?.(value);
|
|
108
|
-
setArgs({ value });
|
|
109
|
-
};
|
|
110
|
-
return _jsx(ErkDateRangePicker, { ...args, onChange: onValueChange });
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
export const Disabled = {
|
|
114
|
-
args: {
|
|
115
|
-
label: 'Rango de Fechas',
|
|
116
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
117
|
-
disabled: true,
|
|
118
|
-
helperText: 'Campo deshabilitado',
|
|
119
|
-
},
|
|
120
|
-
render: function Component(args) {
|
|
121
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
122
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
123
|
-
},
|
|
124
|
-
};
|
|
125
|
-
export const ReadOnly = {
|
|
126
|
-
args: {
|
|
127
|
-
label: 'Rango de Fechas',
|
|
128
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
129
|
-
readOnly: true,
|
|
130
|
-
helperText: 'Campo de solo lectura',
|
|
131
|
-
},
|
|
132
|
-
render: function Component(args) {
|
|
133
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
134
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
export const WithError = {
|
|
138
|
-
args: {
|
|
139
|
-
label: 'Rango de Fechas',
|
|
140
|
-
value: [new Date('2021-07-21'), new Date('2021-07-01')],
|
|
141
|
-
helperText: 'La fecha de inicio debe ser anterior a la fecha de fin',
|
|
142
|
-
error: true,
|
|
143
|
-
},
|
|
144
|
-
render: function Component(args) {
|
|
145
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
146
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
export const Required = {
|
|
150
|
-
args: {
|
|
151
|
-
label: 'Rango de Fechas',
|
|
152
|
-
value: [null, null],
|
|
153
|
-
helperText: 'Este campo es obligatorio',
|
|
154
|
-
required: true,
|
|
155
|
-
},
|
|
156
|
-
render: function Component(args) {
|
|
157
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
158
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
159
|
-
},
|
|
160
|
-
};
|
|
161
|
-
export const SmallSize = {
|
|
162
|
-
args: {
|
|
163
|
-
label: 'Rango Pequeño',
|
|
164
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
165
|
-
size: 'small',
|
|
166
|
-
helperText: 'Tamaño pequeño',
|
|
167
|
-
},
|
|
168
|
-
render: function Component(args) {
|
|
169
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
170
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
171
|
-
},
|
|
172
|
-
};
|
|
173
|
-
export const MediumSize = {
|
|
174
|
-
args: {
|
|
175
|
-
label: 'Rango Mediano',
|
|
176
|
-
value: [new Date('2021-07-01'), new Date('2021-07-21')],
|
|
177
|
-
size: 'medium',
|
|
178
|
-
helperText: 'Tamaño mediano',
|
|
179
|
-
},
|
|
180
|
-
render: function Component(args) {
|
|
181
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
182
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
183
|
-
},
|
|
184
|
-
};
|
|
185
|
-
export const CurrentMonth = {
|
|
186
|
-
args: {
|
|
187
|
-
label: 'Mes Actual',
|
|
188
|
-
value: [new Date(2025, 10, 1), new Date(2025, 10, 30)],
|
|
189
|
-
helperText: 'Noviembre 2025',
|
|
190
|
-
},
|
|
191
|
-
render: function Component(args) {
|
|
192
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
193
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
export const LastWeek = {
|
|
197
|
-
args: {
|
|
198
|
-
label: 'Última Semana',
|
|
199
|
-
value: [new Date(new Date().setDate(new Date().getDate() - 7)), new Date()],
|
|
200
|
-
helperText: 'Últimos 7 días',
|
|
201
|
-
},
|
|
202
|
-
render: function Component(args) {
|
|
203
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
204
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
export const NextMonth = {
|
|
208
|
-
args: {
|
|
209
|
-
label: 'Próximo Mes',
|
|
210
|
-
value: [
|
|
211
|
-
new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1),
|
|
212
|
-
new Date(new Date().getFullYear(), new Date().getMonth() + 2, 0),
|
|
213
|
-
],
|
|
214
|
-
helperText: 'Planificación del próximo mes',
|
|
215
|
-
},
|
|
216
|
-
render: function Component(args) {
|
|
217
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
218
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
219
|
-
},
|
|
220
|
-
};
|
|
221
|
-
export const WithMinMaxDates = {
|
|
222
|
-
args: {
|
|
223
|
-
label: 'Reserva de Hotel',
|
|
224
|
-
value: [null, null],
|
|
225
|
-
helperText: 'Seleccione fechas entre hoy y 3 meses',
|
|
226
|
-
minDate: new Date(),
|
|
227
|
-
maxDate: new Date(new Date().setMonth(new Date().getMonth() + 3)),
|
|
228
|
-
},
|
|
229
|
-
render: function Component(args) {
|
|
230
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
231
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
232
|
-
},
|
|
233
|
-
};
|
|
234
|
-
export const YearRange = {
|
|
235
|
-
args: {
|
|
236
|
-
label: 'Período Fiscal',
|
|
237
|
-
value: [new Date('2025-01-01'), new Date('2025-12-31')],
|
|
238
|
-
helperText: 'Año fiscal 2025',
|
|
239
|
-
},
|
|
240
|
-
render: function Component(args) {
|
|
241
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
242
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
243
|
-
},
|
|
244
|
-
};
|
|
245
|
-
export const QuarterRange = {
|
|
246
|
-
args: {
|
|
247
|
-
label: 'Trimestre Q1 2025',
|
|
248
|
-
value: [new Date('2025-01-01'), new Date('2025-03-31')],
|
|
249
|
-
helperText: 'Primer trimestre del año',
|
|
250
|
-
},
|
|
251
|
-
render: function Component(args) {
|
|
252
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
253
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
254
|
-
},
|
|
255
|
-
};
|
|
256
|
-
export const EventDuration = {
|
|
257
|
-
args: {
|
|
258
|
-
label: 'Duración del Evento',
|
|
259
|
-
value: [new Date('2025-06-15'), new Date('2025-06-18')],
|
|
260
|
-
helperText: 'Conferencia anual (4 días)',
|
|
261
|
-
},
|
|
262
|
-
render: function Component(args) {
|
|
263
|
-
const [value, setValue] = useState(args.value ?? [null, null]);
|
|
264
|
-
return _jsx(ErkDateRangePicker, { ...args, value: value, onChange: setValue });
|
|
265
|
-
},
|
|
266
|
-
};
|
|
267
|
-
export const MultipleStates = {
|
|
268
|
-
render: function Component() {
|
|
269
|
-
const [range1, setRange1] = useState([null, null]);
|
|
270
|
-
const [range2, setRange2] = useState([new Date('2025-01-01'), new Date('2025-01-31')]);
|
|
271
|
-
const [range3, setRange3] = useState([null, null]);
|
|
272
|
-
return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '20px' }, children: [_jsx(ErkDateRangePicker, { label: "Fecha de Inicio del Proyecto", value: range1, onChange: setRange1, helperText: "Seleccione el per\u00EDodo del proyecto" }), _jsx(ErkDateRangePicker, { label: "Per\u00EDodo de Pruebas", value: range2, onChange: setRange2, helperText: "Enero 2025" }), _jsx(ErkDateRangePicker, { label: "Fecha de Entrega", value: range3, onChange: setRange3, error: range3[0] === null, helperText: range3[0] === null ? 'Este campo es obligatorio' : 'Fecha confirmada', required: true })] }));
|
|
273
|
-
},
|
|
274
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import ErkSelect from './ErkSelect';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof ErkSelect;
|
|
5
|
-
tags: string[];
|
|
6
|
-
args: {
|
|
7
|
-
readOnly: false;
|
|
8
|
-
MenuProps: {
|
|
9
|
-
disablePortal: false;
|
|
10
|
-
};
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default meta;
|
|
14
|
-
type Story = StoryObj<typeof meta>;
|
|
15
|
-
export declare const Default: Story;
|
|
16
|
-
export declare const Empty: Story;
|
|
17
|
-
export declare const ValueAndLabel: Story;
|
|
18
|
-
export declare const Full: Story;
|
|
19
|
-
export declare const Error: Story;
|
|
20
|
-
export declare const ErrorColor: Story;
|
|
21
|
-
export declare const DifferentColors: Story;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import ErkSelect from './ErkSelect';
|
|
3
|
-
import { MenuItem } from '@mui/material';
|
|
4
|
-
import { useArgs } from 'storybook/internal/preview-api';
|
|
5
|
-
const meta = {
|
|
6
|
-
component: ErkSelect,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
args: {
|
|
9
|
-
readOnly: false,
|
|
10
|
-
MenuProps: {
|
|
11
|
-
disablePortal: false,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
export default meta;
|
|
16
|
-
export const Default = {
|
|
17
|
-
args: {
|
|
18
|
-
label: 'Label',
|
|
19
|
-
},
|
|
20
|
-
render: function Component(args) {
|
|
21
|
-
const [, setArgs] = useArgs();
|
|
22
|
-
const onValueChange = (value) => {
|
|
23
|
-
args.onChange?.(value);
|
|
24
|
-
setArgs({ value });
|
|
25
|
-
};
|
|
26
|
-
return (_jsxs(ErkSelect, { ...args, onChange: onValueChange, children: [_jsx(MenuItem, { value: 'option1', children: "Option 1" }), _jsx(MenuItem, { value: 'option2', children: "Option 2" }), _jsx(MenuItem, { value: 'option3', children: "Option 3" })] }));
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
export const Empty = {
|
|
30
|
-
args: {},
|
|
31
|
-
render: function Component(args) {
|
|
32
|
-
return _jsx(ErkSelect, { ...args });
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
export const ValueAndLabel = {
|
|
36
|
-
args: {
|
|
37
|
-
label: 'Label',
|
|
38
|
-
value: 'option',
|
|
39
|
-
},
|
|
40
|
-
render: function Component({ inputRef, ...args }) {
|
|
41
|
-
const [, setArgs] = useArgs();
|
|
42
|
-
const onValueChange = (value) => {
|
|
43
|
-
args.onChange?.(value);
|
|
44
|
-
setArgs({ value });
|
|
45
|
-
};
|
|
46
|
-
return (_jsx(ErkSelect, { ...args, onChange: onValueChange, inputRef: inputRef, children: _jsx(MenuItem, { value: 'option', style: { whiteSpace: 'normal' }, children: "Option" }) }));
|
|
47
|
-
},
|
|
48
|
-
};
|
|
49
|
-
export const Full = {
|
|
50
|
-
args: {
|
|
51
|
-
label: 'Label',
|
|
52
|
-
helperText: 'Helper text',
|
|
53
|
-
},
|
|
54
|
-
render: function Component(args) {
|
|
55
|
-
return (_jsxs(ErkSelect, { ...args, children: [_jsx(MenuItem, { value: 'option1', children: "Option 1" }), _jsx(MenuItem, { value: 'option2', children: "Option 2" }), _jsx(MenuItem, { value: 'option3', children: "Option 3" })] }));
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
export const Error = {
|
|
59
|
-
args: {
|
|
60
|
-
label: 'Label',
|
|
61
|
-
helperText: 'Helper text',
|
|
62
|
-
error: true,
|
|
63
|
-
},
|
|
64
|
-
render: function Component(args) {
|
|
65
|
-
return (_jsxs(ErkSelect, { ...args, children: [_jsx(MenuItem, { value: 'option1', children: "Option 1" }), _jsx(MenuItem, { value: 'option2', children: "Option 2" }), _jsx(MenuItem, { value: 'option3', children: "Option 3" })] }));
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
export const ErrorColor = {
|
|
69
|
-
args: {
|
|
70
|
-
label: 'Label',
|
|
71
|
-
helperText: 'Helper text',
|
|
72
|
-
error: true,
|
|
73
|
-
},
|
|
74
|
-
render: function Component(args) {
|
|
75
|
-
return (_jsxs(ErkSelect, { ...args, children: [_jsx(MenuItem, { value: 'option1', children: "Option 1" }), _jsx(MenuItem, { value: 'option2', children: "Option 2" }), _jsx(MenuItem, { value: 'option3', children: "Option 3" })] }));
|
|
76
|
-
},
|
|
77
|
-
};
|
|
78
|
-
export const DifferentColors = {
|
|
79
|
-
args: {
|
|
80
|
-
label: 'Label',
|
|
81
|
-
value: 'option',
|
|
82
|
-
helperText: 'Helper text',
|
|
83
|
-
},
|
|
84
|
-
render: function Component({ inputRef, ...args }) {
|
|
85
|
-
return (_jsx(ErkSelect, { ...args, inputRef: inputRef, children: _jsx(MenuItem, { value: 'option', style: { whiteSpace: 'normal' }, children: "Option" }) }));
|
|
86
|
-
},
|
|
87
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import ErkSmartSelect from './ErkSmartSelect';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof ErkSmartSelect;
|
|
5
|
-
tags: string[];
|
|
6
|
-
args: {
|
|
7
|
-
searchable: false;
|
|
8
|
-
readOnly: false;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof meta>;
|
|
13
|
-
export declare const Empty: Story;
|
|
14
|
-
export declare const Default: Story;
|
|
15
|
-
export declare const Focused: Story;
|
|
16
|
-
export declare const FocusedSearchable: Story;
|
|
17
|
-
export declare const SearchableWithOptions: Story;
|
|
18
|
-
export declare const SearchableWithSearchAndOptions: Story;
|
|
19
|
-
export declare const Loading: Story;
|
|
20
|
-
export declare const LoadingOpened: Story;
|
|
21
|
-
export declare const SearchableLoadingOpened: Story;
|
|
22
|
-
export declare const WithValueandLabel: Story;
|
|
23
|
-
export declare const Full: Story;
|
|
24
|
-
export declare const Error: Story;
|
|
25
|
-
export declare const ErrorColor: Story;
|
|
26
|
-
export declare const DifferentColors: Story;
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import ErkSmartSelect from './ErkSmartSelect';
|
|
3
|
-
import { useArgs } from 'storybook/internal/preview-api';
|
|
4
|
-
const meta = {
|
|
5
|
-
component: ErkSmartSelect,
|
|
6
|
-
tags: ['autodocs'],
|
|
7
|
-
args: {
|
|
8
|
-
searchable: false,
|
|
9
|
-
readOnly: false,
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
export default meta;
|
|
13
|
-
export const Empty = {
|
|
14
|
-
args: {
|
|
15
|
-
label: 'Label',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
export const Default = {
|
|
19
|
-
args: {
|
|
20
|
-
label: 'Label',
|
|
21
|
-
options: [
|
|
22
|
-
{
|
|
23
|
-
label: 'Option',
|
|
24
|
-
value: 'option',
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
play: async ({ canvas, userEvent }) => {
|
|
29
|
-
const selector = canvas.getByTestId('smart-select');
|
|
30
|
-
await userEvent.click(selector);
|
|
31
|
-
const option = canvas.getByTestId('smart-select-option');
|
|
32
|
-
await userEvent.click(option);
|
|
33
|
-
},
|
|
34
|
-
render: function Component(args) {
|
|
35
|
-
const [, setArgs] = useArgs();
|
|
36
|
-
const onValueChange = (value) => {
|
|
37
|
-
args.onChange?.(value);
|
|
38
|
-
setArgs({ value });
|
|
39
|
-
};
|
|
40
|
-
return _jsx(ErkSmartSelect, { ...args, onChange: onValueChange });
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
export const Focused = {
|
|
44
|
-
args: {
|
|
45
|
-
label: 'Label',
|
|
46
|
-
},
|
|
47
|
-
play: async ({ canvas, userEvent }) => {
|
|
48
|
-
const selector = canvas.getByTestId('smart-select');
|
|
49
|
-
await userEvent.click(selector);
|
|
50
|
-
const option = canvas.getByTestId('smart-select-empty');
|
|
51
|
-
await userEvent.click(option);
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
export const FocusedSearchable = {
|
|
55
|
-
args: {
|
|
56
|
-
label: 'Label',
|
|
57
|
-
searchable: true,
|
|
58
|
-
},
|
|
59
|
-
play: async ({ canvas, userEvent }) => {
|
|
60
|
-
const selector = canvas.getByTestId('smart-select');
|
|
61
|
-
await userEvent.click(selector);
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
export const SearchableWithOptions = {
|
|
65
|
-
args: {
|
|
66
|
-
label: 'Label',
|
|
67
|
-
searchable: true,
|
|
68
|
-
options: [
|
|
69
|
-
{
|
|
70
|
-
label: 'Option',
|
|
71
|
-
value: 'option',
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
},
|
|
75
|
-
play: async ({ canvas, userEvent }) => {
|
|
76
|
-
const selector = canvas.getByTestId('smart-select');
|
|
77
|
-
await userEvent.click(selector);
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
export const SearchableWithSearchAndOptions = {
|
|
81
|
-
args: {
|
|
82
|
-
label: 'Label',
|
|
83
|
-
searchable: true,
|
|
84
|
-
value: 'Opt',
|
|
85
|
-
options: [
|
|
86
|
-
{
|
|
87
|
-
label: 'Option',
|
|
88
|
-
value: 'option',
|
|
89
|
-
},
|
|
90
|
-
],
|
|
91
|
-
},
|
|
92
|
-
play: async ({ canvas, userEvent }) => {
|
|
93
|
-
const selector = canvas.getByTestId('smart-select');
|
|
94
|
-
await userEvent.click(selector);
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
export const Loading = {
|
|
98
|
-
args: {
|
|
99
|
-
label: 'Label',
|
|
100
|
-
loading: true,
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
export const LoadingOpened = {
|
|
104
|
-
args: {
|
|
105
|
-
label: 'Label',
|
|
106
|
-
loading: true,
|
|
107
|
-
},
|
|
108
|
-
play: async ({ canvas, userEvent }) => {
|
|
109
|
-
const selector = canvas.getByTestId('smart-select');
|
|
110
|
-
await userEvent.click(selector);
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
export const SearchableLoadingOpened = {
|
|
114
|
-
args: {
|
|
115
|
-
label: 'Label',
|
|
116
|
-
searchable: true,
|
|
117
|
-
loading: true,
|
|
118
|
-
},
|
|
119
|
-
play: async ({ canvas, userEvent }) => {
|
|
120
|
-
const selector = canvas.getByTestId('smart-select');
|
|
121
|
-
await userEvent.click(selector);
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
export const WithValueandLabel = {
|
|
125
|
-
args: {
|
|
126
|
-
label: 'Label',
|
|
127
|
-
value: 'Textinput Value',
|
|
128
|
-
},
|
|
129
|
-
};
|
|
130
|
-
export const Full = {
|
|
131
|
-
args: {
|
|
132
|
-
label: 'Label',
|
|
133
|
-
value: 'Value',
|
|
134
|
-
helperText: 'Helper text',
|
|
135
|
-
},
|
|
136
|
-
};
|
|
137
|
-
export const Error = {
|
|
138
|
-
args: {
|
|
139
|
-
label: 'Label',
|
|
140
|
-
value: 'Value',
|
|
141
|
-
helperText: 'Helper text',
|
|
142
|
-
error: true,
|
|
143
|
-
},
|
|
144
|
-
};
|
|
145
|
-
export const ErrorColor = {
|
|
146
|
-
args: {
|
|
147
|
-
label: 'Label',
|
|
148
|
-
value: 'Value',
|
|
149
|
-
helperText: 'Helper text',
|
|
150
|
-
error: true,
|
|
151
|
-
},
|
|
152
|
-
};
|
|
153
|
-
export const DifferentColors = {
|
|
154
|
-
args: {
|
|
155
|
-
label: 'Label',
|
|
156
|
-
value: 'Value',
|
|
157
|
-
helperText: 'Helper text',
|
|
158
|
-
},
|
|
159
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import ErkTextField from './ErkTextField';
|
|
3
|
-
declare const meta: {
|
|
4
|
-
component: typeof ErkTextField;
|
|
5
|
-
tags: string[];
|
|
6
|
-
args: {
|
|
7
|
-
disabled: false;
|
|
8
|
-
multiline: false;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof meta>;
|
|
13
|
-
export declare const Empty: Story;
|
|
14
|
-
export declare const EmptyLabel: Story;
|
|
15
|
-
export declare const Default: Story;
|
|
16
|
-
export declare const Focused: Story;
|
|
17
|
-
export declare const FocusedNoLabel: Story;
|
|
18
|
-
export declare const WithValue: Story;
|
|
19
|
-
export declare const Multiline: Story;
|
|
20
|
-
export declare const WithHelperText: Story;
|
|
21
|
-
export declare const WithValueandLabel: Story;
|
|
22
|
-
export declare const WithMaxLength: Story;
|
|
23
|
-
export declare const Full: Story;
|
|
24
|
-
export declare const Error: Story;
|