@councilbox/councilbox-ui 2.0.59 → 2.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.
- package/SafeHtml.js +3 -0
- package/dist/HOCs/overlayA11yStack.js +1 -1
- package/dist/HOCs/useDynamicStyles.js +39 -4
- package/dist/build-index.js +14 -0
- package/dist/components/Accordion/Accordion.css +7 -1
- package/dist/components/Accordion/Accordion.js +2 -2
- package/dist/components/Button/Button.js +79 -87
- package/dist/components/Button/button.css +171 -16
- package/dist/components/DatePicker/Calendar.js +3 -5
- package/dist/components/DatePicker/DatePicker.css +1 -1
- package/dist/components/DateRangePicker/RangeCalendar.js +2 -4
- package/dist/components/IconButton/IconButton.js +1 -1
- package/dist/components/Modal/Modal.js +13 -3
- package/dist/components/RichTextInput/RichTextInput.js +28 -7
- package/dist/components/SafeHtml/SafeHtml.js +82 -0
- package/dist/components/SelectInput/SelectInput.js +1 -0
- package/dist/components/Stepper/Stepper.css +6 -1
- package/dist/components/Tabs/Tabs.js +1 -0
- package/dist/components/TextInput/TextInput.css +164 -1
- package/dist/components/TextInput/TextInput.js +171 -167
- package/dist/components/ThemeProvider/Colors.js +1 -1
- package/dist/components/ThemeProvider/ThemeProvider.js +1 -7
- package/dist/components/Toast/toastStore.js +1 -0
- package/dist/styles/colorConsts.css +1 -1
- package/dist/styles/stylesheet.js +2 -50
- package/dist/testing/TestAutocomplete.js +1 -105
- package/dist/utils/sanitizeHtml.js +199 -0
- package/package.json +17 -31
- package/dist/__snapshots__/storybook.test.js.snap +0 -104
- package/dist/components/1.Introduction.stories.mdx +0 -579
- package/dist/components/2.Changelog.stories.mdx +0 -1392
- package/dist/components/3.Guide.stories.mdx +0 -589
- package/dist/components/Accordion/Accordion.stories.js +0 -95
- package/dist/components/Accordion/DesignAccordion.stories.js +0 -27
- package/dist/components/Alert/Alert.stories.js +0 -101
- package/dist/components/Avatar/Avatar.stories.js +0 -159
- package/dist/components/Avatar/DesignAvatar.stories.js +0 -64
- package/dist/components/Avatar/DesignAvatarText.stories.js +0 -123
- package/dist/components/AvatarGroup/AvatarGroup.stories.js +0 -72
- package/dist/components/AvatarGroup/DesignAvatarGroup.stories.js +0 -118
- package/dist/components/Block/Block.stories.js +0 -66
- package/dist/components/Block/DesignBlock.stories.js +0 -35
- package/dist/components/Button/Button.stories.js +0 -98
- package/dist/components/ButtonBasic/ButtonBasic.stories.js +0 -161
- package/dist/components/Checkbox/Checkbox.stories.js +0 -110
- package/dist/components/DatePicker/DatePicker.stories.js +0 -180
- package/dist/components/DateRangePicker/DateRangePicker.stories.js +0 -147
- package/dist/components/DateTimePicker/DateTimePicker.stories.js +0 -144
- package/dist/components/DragDrop/DragDrop.stories.js +0 -155
- package/dist/components/DrawerPanel/DrawerPanel.stories.js +0 -277
- package/dist/components/DropDown/DesignDropDown.stories.js +0 -216
- package/dist/components/DropDown/DropDown.stories.js +0 -240
- package/dist/components/EnhancedTable/DesignEnhancedTable.stories.js +0 -128
- package/dist/components/EnhancedTable/EnhancedTable.stories.js +0 -259
- package/dist/components/FabButton/DesignFabButton.stories.js +0 -40
- package/dist/components/FabButton/FabButton.stories.js +0 -147
- package/dist/components/Grid/DesignGrid.stories.js +0 -45
- package/dist/components/Grid/Grid.stories.js +0 -211
- package/dist/components/Header/DesignHeader.stories.js +0 -65
- package/dist/components/Header/Header.stories.js +0 -674
- package/dist/components/IconButton/DesignIconButton.stories.js +0 -113
- package/dist/components/IconButton/IconButton.stories.js +0 -205
- package/dist/components/IconButtonSquare/DesignIconButtonSquare.stories.js +0 -21
- package/dist/components/IconButtonSquare/IconButtonSquare.stories.js +0 -209
- package/dist/components/InputAutocomplete/InputAutocomplete.stories.js +0 -433
- package/dist/components/InputPassword/InputPassword.stories.js +0 -185
- package/dist/components/InputText/InputText.stories.js +0 -261
- package/dist/components/InputTextArea/DesignInputTextArea.stories.js +0 -116
- package/dist/components/InputTextArea/InputTextArea.stories.js +0 -146
- package/dist/components/LoadingSection/LoadingSection.stories.js +0 -84
- package/dist/components/MenuItem/DesignMenuItem.stories.js +0 -54
- package/dist/components/MenuItem/MenuItem.stories.js +0 -138
- package/dist/components/MenuLateralLeft/MenuLateralLeft.stories.js +0 -243
- package/dist/components/MenuLateralRight/MenuLateralRight.stories.js +0 -228
- package/dist/components/Modal/DesignModal.stories.js +0 -39
- package/dist/components/Modal/Modal.stories.js +0 -229
- package/dist/components/PaginationFooter/DesignPaginationFooter.stories.js +0 -22
- package/dist/components/PaginationFooter/PaginationFooter.stories.js +0 -191
- package/dist/components/RadioButton/Radio.stories.js +0 -157
- package/dist/components/RichTextInput/DesignRichTextInput.stories.js +0 -119
- package/dist/components/RichTextInput/RichTextInput.stories.js +0 -38
- package/dist/components/Ripple/Ripple.stories.js +0 -107
- package/dist/components/Scrollbar/Scrollbar.stories.js +0 -42
- package/dist/components/ScrollbarOld/ScrollbarOld.stories.js +0 -140
- package/dist/components/SelectInput/SelectInput.stories.js +0 -212
- package/dist/components/Slider/Slider.stories.js +0 -128
- package/dist/components/Spacing/Spacing.stories.js +0 -37
- package/dist/components/Stars/Stars.stories.js +0 -138
- package/dist/components/Stepper/DesignStepper.stories.js +0 -130
- package/dist/components/Stepper/Stepper.stories.js +0 -131
- package/dist/components/Table/DesignTable.stories.js +0 -614
- package/dist/components/Table/Table.stories.js +0 -215
- package/dist/components/Tabs/Tabs.stories.js +0 -163
- package/dist/components/Tag/DesignTags.stories.js +0 -81
- package/dist/components/Tag/Tag.stories.js +0 -148
- package/dist/components/TextInput/TextInput.stories.js +0 -148
- package/dist/components/TimePicker/TimePicker.stories.js +0 -132
- package/dist/components/Timeline/DesignTimeline.stories.js +0 -19
- package/dist/components/Timeline/Timeline.stories.js +0 -128
- package/dist/components/Toast/DesignToast.stories.js +0 -174
- package/dist/components/Toast/Toast.stories.js +0 -39
- package/dist/components/Toggle/Toggle.stories.js +0 -118
- package/dist/components/Tooltip/DesignTooltip.stories.js +0 -45
- package/dist/components/Tooltip/Tooltip.stories.js +0 -135
- package/dist/components/Typography/Typography.stories.js +0 -114
- package/dist/reportWebVitals.js +0 -28
- package/dist/storybook.test.js +0 -5
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = exports.Success = exports.Helper = exports.ErrorTemplate = exports.Disabled = exports.DesignSelectInputTemplate = exports.Default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _SelectInput = _interopRequireDefault(require("./SelectInput"));
|
|
9
|
-
var _DesignSelectInput = _interopRequireDefault(require("./DesignSelectInput"));
|
|
10
|
-
var _MenuItem = _interopRequireDefault(require("../MenuItem/MenuItem"));
|
|
11
|
-
var _excluded = ["value", "onChange"];
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
13
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
14
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
15
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
17
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
|
|
18
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
19
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
20
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
21
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
22
|
-
var _default = {
|
|
23
|
-
title: 'Components/SelectInput',
|
|
24
|
-
component: _SelectInput["default"],
|
|
25
|
-
argTypes: {
|
|
26
|
-
label: {
|
|
27
|
-
control: 'text'
|
|
28
|
-
},
|
|
29
|
-
value: {
|
|
30
|
-
control: 'text',
|
|
31
|
-
description: 'Valor seleccionado (array en modo múltiple).'
|
|
32
|
-
},
|
|
33
|
-
variant: {
|
|
34
|
-
options: ['outlined', 'filled', 'standard'],
|
|
35
|
-
control: {
|
|
36
|
-
type: 'radio'
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
multiple: {
|
|
40
|
-
control: 'boolean'
|
|
41
|
-
},
|
|
42
|
-
disabled: {
|
|
43
|
-
control: 'boolean'
|
|
44
|
-
},
|
|
45
|
-
fullWidth: {
|
|
46
|
-
control: 'boolean'
|
|
47
|
-
},
|
|
48
|
-
width: {
|
|
49
|
-
control: 'text'
|
|
50
|
-
},
|
|
51
|
-
error: {
|
|
52
|
-
control: 'text'
|
|
53
|
-
},
|
|
54
|
-
success: {
|
|
55
|
-
control: 'boolean'
|
|
56
|
-
},
|
|
57
|
-
helper: {
|
|
58
|
-
control: 'text'
|
|
59
|
-
},
|
|
60
|
-
helperText: {
|
|
61
|
-
control: 'text'
|
|
62
|
-
},
|
|
63
|
-
'aria-label': {
|
|
64
|
-
control: 'text'
|
|
65
|
-
},
|
|
66
|
-
renderValue: {
|
|
67
|
-
control: false,
|
|
68
|
-
description: 'Función (valor) => texto mostrado.'
|
|
69
|
-
},
|
|
70
|
-
children: {
|
|
71
|
-
control: false,
|
|
72
|
-
description: 'Opciones (MenuItem con value).'
|
|
73
|
-
},
|
|
74
|
-
onChange: {
|
|
75
|
-
action: 'onChange'
|
|
76
|
-
},
|
|
77
|
-
id: {
|
|
78
|
-
control: 'text'
|
|
79
|
-
},
|
|
80
|
-
className: {
|
|
81
|
-
control: 'text'
|
|
82
|
-
},
|
|
83
|
-
style: {
|
|
84
|
-
control: 'object'
|
|
85
|
-
},
|
|
86
|
-
sx: {
|
|
87
|
-
control: 'object'
|
|
88
|
-
},
|
|
89
|
-
prefixClass: {
|
|
90
|
-
table: {
|
|
91
|
-
disable: true
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
parameters: {
|
|
96
|
-
docs: {
|
|
97
|
-
description: {
|
|
98
|
-
component: "\n## SelectInput\n\nCampo desplegable para elegir una opci\xF3n (o varias) de una lista cerrada. Tiene el aspecto de un `InputText` y muestra las opciones en una lista bajo el campo.\n\n## Funcionamiento\n\n- `children`: las opciones, normalmente `MenuItem` con `value` y texto:\n\n```jsx\n<SelectInput label=\"Tipo de reuni\xF3n\" value={type} onChange={event => setType(event.target.value)}>\n\t<MenuItem value=\"ordinary\">Ordinaria</MenuItem>\n\t<MenuItem value=\"extraordinary\">Extraordinaria</MenuItem>\n</SelectInput>\n```\n\n- `value` y `onChange`: `onChange` recibe un objeto tipo evento con el valor en `event.target.value`, como un `select` nativo.\n- `multiple`: permite elegir varias opciones. `value` es un array y la lista no se cierra al elegir.\n- `renderValue(valor)`: personaliza el texto que se muestra en el campo.\n- `label`, `disabled`, `fullWidth`, `width`, `error`, `helper` y `helperText`, como en `InputText`.\n- La lista se posiciona bajo el campo y se recoloca para no salirse de la pantalla.\n\n## Accesibilidad\n\n### Campo\n\n- El campo tiene `role=\"combobox\"`, `aria-haspopup=\"listbox\"` y `aria-expanded`, y apunta a la lista con `aria-controls` mientras est\xE1 abierta.\n- Es de solo lectura: no se escribe en \xE9l, solo se elige.\n- Integra `useA11yGuard`: en modo estricto exige `label` o `aria-label`.\n\n### Lista de opciones\n\n- La lista tiene `role=\"listbox\"` (con `aria-multiselectable` en modo m\xFAltiple).\n- Cada opci\xF3n tiene `role=\"option\"` y `aria-selected` seg\xFAn est\xE9 elegida.\n\n### Teclado\n\n- **Enter** o **Espacio** en el campo: abre la lista.\n- **Flecha abajo** / **Flecha arriba**: abren la lista y mueven el foco entre las opciones.\n- **Enter** o **Espacio** sobre una opci\xF3n: la eligen.\n- **Escape** o **Tab** en el campo: cierran la lista.\n\n## Recomendaciones de uso\n\n- Usar siempre `label` visible.\n- Para listas largas o en las que interesa buscar, usar `InputAutocomplete`.\n- En modo m\xFAltiple, mostrar las opciones elegidas de forma clara con `renderValue`.\n\n## Consideraciones\n\n- El foco se mueve f\xEDsicamente a las opciones (no se usa `aria-activedescendant`), y la lista est\xE1 en un portal al final de `<body>`.\n- Con el foco en una opci\xF3n, **Escape** no cierra la lista: solo funciona con el foco en el campo.\n- No hay b\xFAsqueda por teclado escribiendo la primera letra de una opci\xF3n.\n- Las teclas que se pulsan en el campo no se propagan a los componentes padre (`stopPropagation`)."
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
storybookCodePanel: {
|
|
102
|
-
disabled: false,
|
|
103
|
-
files: [{
|
|
104
|
-
fileName: 'SelectInput.js',
|
|
105
|
-
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
106
|
-
code: require('!!raw-loader!./SelectInput.jsx')
|
|
107
|
-
}, {
|
|
108
|
-
fileName: 'SelectInput.css',
|
|
109
|
-
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
110
|
-
code: require('!!raw-loader!./SelectInput.css')
|
|
111
|
-
}]
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
exports["default"] = _default;
|
|
116
|
-
var OPTIONS = [{
|
|
117
|
-
value: 'ordinary',
|
|
118
|
-
text: 'Ordinaria'
|
|
119
|
-
}, {
|
|
120
|
-
value: 'extraordinary',
|
|
121
|
-
text: 'Extraordinaria'
|
|
122
|
-
}, {
|
|
123
|
-
value: 'universal',
|
|
124
|
-
text: 'Universal'
|
|
125
|
-
}, {
|
|
126
|
-
value: 'board',
|
|
127
|
-
text: 'Consejo de administración'
|
|
128
|
-
}];
|
|
129
|
-
var Template = function Template(_ref) {
|
|
130
|
-
var valueArg = _ref.value,
|
|
131
|
-
_onChange = _ref.onChange,
|
|
132
|
-
args = _objectWithoutProperties(_ref, _excluded);
|
|
133
|
-
var initialValue = args.multiple ? [] : '';
|
|
134
|
-
var _React$useState = _react["default"].useState(valueArg !== null && valueArg !== void 0 ? valueArg : initialValue),
|
|
135
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
136
|
-
value = _React$useState2[0],
|
|
137
|
-
setValue = _React$useState2[1];
|
|
138
|
-
_react["default"].useEffect(function () {
|
|
139
|
-
if (args.multiple) {
|
|
140
|
-
setValue(Array.isArray(valueArg) ? valueArg : []);
|
|
141
|
-
} else {
|
|
142
|
-
setValue(valueArg !== null && valueArg !== void 0 ? valueArg : '');
|
|
143
|
-
}
|
|
144
|
-
}, [valueArg, args.multiple]);
|
|
145
|
-
return /*#__PURE__*/_react["default"].createElement(_SelectInput["default"], _extends({}, args, {
|
|
146
|
-
key: args.multiple ? 'multiple' : 'single',
|
|
147
|
-
value: value,
|
|
148
|
-
onChange: function onChange(event) {
|
|
149
|
-
setValue(event.target.value);
|
|
150
|
-
_onChange === null || _onChange === void 0 ? void 0 : _onChange(event);
|
|
151
|
-
}
|
|
152
|
-
}), OPTIONS.map(function (option) {
|
|
153
|
-
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
154
|
-
key: option.value,
|
|
155
|
-
value: option.value
|
|
156
|
-
}, option.text);
|
|
157
|
-
}));
|
|
158
|
-
};
|
|
159
|
-
Template.displayName = "Template";
|
|
160
|
-
var Default = Template.bind({});
|
|
161
|
-
exports.Default = Default;
|
|
162
|
-
Default.args = {
|
|
163
|
-
label: 'Tipo de reunión',
|
|
164
|
-
value: '',
|
|
165
|
-
variant: 'outlined',
|
|
166
|
-
multiple: false,
|
|
167
|
-
disabled: false,
|
|
168
|
-
fullWidth: false,
|
|
169
|
-
error: '',
|
|
170
|
-
success: false,
|
|
171
|
-
helper: ''
|
|
172
|
-
};
|
|
173
|
-
var Helper = Template.bind({});
|
|
174
|
-
exports.Helper = Helper;
|
|
175
|
-
Helper.args = {
|
|
176
|
-
value: 'ordinary',
|
|
177
|
-
helper: 'Helper',
|
|
178
|
-
label: 'Example'
|
|
179
|
-
};
|
|
180
|
-
var Success = Template.bind({});
|
|
181
|
-
exports.Success = Success;
|
|
182
|
-
Success.args = {
|
|
183
|
-
value: 'ordinary',
|
|
184
|
-
success: true,
|
|
185
|
-
label: 'Example'
|
|
186
|
-
};
|
|
187
|
-
var Disabled = Template.bind({});
|
|
188
|
-
exports.Disabled = Disabled;
|
|
189
|
-
Disabled.args = {
|
|
190
|
-
value: 'ordinary',
|
|
191
|
-
disabled: true,
|
|
192
|
-
label: 'Example'
|
|
193
|
-
};
|
|
194
|
-
var ErrorTemplate = Template.bind({});
|
|
195
|
-
exports.ErrorTemplate = ErrorTemplate;
|
|
196
|
-
ErrorTemplate.args = {
|
|
197
|
-
value: 'ordinary',
|
|
198
|
-
error: 'Error',
|
|
199
|
-
label: 'Example'
|
|
200
|
-
};
|
|
201
|
-
var TemplateSelectInput = function TemplateSelectInput(args) {
|
|
202
|
-
return /*#__PURE__*/_react["default"].createElement(_DesignSelectInput["default"], args);
|
|
203
|
-
};
|
|
204
|
-
TemplateSelectInput.displayName = "TemplateSelectInput";
|
|
205
|
-
var DesignSelectInputTemplate = TemplateSelectInput.bind({});
|
|
206
|
-
exports.DesignSelectInputTemplate = DesignSelectInputTemplate;
|
|
207
|
-
DesignSelectInputTemplate.args = {};
|
|
208
|
-
DesignSelectInputTemplate.parameters = {
|
|
209
|
-
controls: {
|
|
210
|
-
disable: true
|
|
211
|
-
}
|
|
212
|
-
};
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = exports.Playground = exports.DesignSliderTemplate = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Slider = _interopRequireDefault(require("./Slider"));
|
|
9
|
-
var _DesignSlider = _interopRequireDefault(require("./DesignSlider"));
|
|
10
|
-
var _excluded = ["values"];
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
13
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
14
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
15
|
-
var _default = {
|
|
16
|
-
title: 'Components/Slider',
|
|
17
|
-
component: _Slider["default"],
|
|
18
|
-
argTypes: {
|
|
19
|
-
label: {
|
|
20
|
-
control: 'text'
|
|
21
|
-
},
|
|
22
|
-
min: {
|
|
23
|
-
control: 'number'
|
|
24
|
-
},
|
|
25
|
-
max: {
|
|
26
|
-
control: 'number'
|
|
27
|
-
},
|
|
28
|
-
value: {
|
|
29
|
-
control: 'number',
|
|
30
|
-
description: 'Valor (en modo values, uno de la lista).'
|
|
31
|
-
},
|
|
32
|
-
values: {
|
|
33
|
-
control: 'object',
|
|
34
|
-
description: 'Lista de valores concretos (vacía para modo continuo).'
|
|
35
|
-
},
|
|
36
|
-
textValue: {
|
|
37
|
-
control: 'text',
|
|
38
|
-
description: 'Unidad que se muestra junto al valor.'
|
|
39
|
-
},
|
|
40
|
-
noDisplayValue: {
|
|
41
|
-
control: 'boolean'
|
|
42
|
-
},
|
|
43
|
-
'aria-label': {
|
|
44
|
-
control: 'text'
|
|
45
|
-
},
|
|
46
|
-
'aria-labelledby': {
|
|
47
|
-
control: 'text'
|
|
48
|
-
},
|
|
49
|
-
onChange: {
|
|
50
|
-
action: 'onChange'
|
|
51
|
-
},
|
|
52
|
-
id: {
|
|
53
|
-
control: 'text'
|
|
54
|
-
},
|
|
55
|
-
className: {
|
|
56
|
-
control: 'text'
|
|
57
|
-
},
|
|
58
|
-
style: {
|
|
59
|
-
control: 'object'
|
|
60
|
-
},
|
|
61
|
-
sx: {
|
|
62
|
-
control: 'object'
|
|
63
|
-
},
|
|
64
|
-
prefixClass: {
|
|
65
|
-
table: {
|
|
66
|
-
disable: true
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
parameters: {
|
|
71
|
-
docs: {
|
|
72
|
-
description: {
|
|
73
|
-
component: "\n## Slider\n\nControl deslizante para elegir un valor num\xE9rico dentro de un rango, o uno de una lista de valores concretos. Usa el `input type=\"range\"` nativo.\n\n## Funcionamiento\n\n### Modo continuo\n\n- `min` y `max`: l\xEDmites del rango.\n- `value`: valor inicial o controlado.\n- `onChange(valor)`: recibe el n\xFAmero seleccionado.\n\n### Modo de valores concretos\n\n- `values`: lista de valores posibles (por ejemplo, `[5, 10, 15, 30]`). El control se mueve de uno en uno y `onChange` recibe el valor de la lista, no la posici\xF3n.\n\n### Presentaci\xF3n\n\n- Sobre el control se muestra el valor actual, que sigue a la posici\xF3n del selector.\n- `textValue`: unidad que se a\xF1ade al valor mostrado (por ejemplo, \"min\").\n- `noDisplayValue`: oculta el valor sobre el control.\n- `label`: etiqueta visible.\n\n## Accesibilidad\n\n### Etiqueta y nombre accesible\n\n- Con `label`, se renderiza un `label` vinculado al `input` (`htmlFor` y `aria-labelledby`).\n- Sin `label`, se usa `aria-labelledby` (si se pasa), `aria-label`, `textValue` o, en \xFAltimo caso, \"Control deslizante\".\n- Integra `useA11yGuard`: en modo estricto exige `label` o `aria-label`.\n\n### Valor\n\n- Al ser un `input type=\"range\"` nativo, el lector anuncia el valor actual, el m\xEDnimo y el m\xE1ximo.\n- En el modo de valores concretos se a\xF1ade `aria-valuetext` con el valor real y su unidad (por ejemplo, \"15 min\"), en lugar de la posici\xF3n interna (0, 1, 2...).\n- El valor visible sobre el control es decorativo (`aria-hidden=\"true\"`) para no leerse dos veces.\n\n### Teclado\n\n- Mantiene el teclado nativo: **flechas** para avanzar o retroceder, **Inicio** y **Fin** para ir a los extremos, y **AvP\xE1g** / **ReP\xE1g** para saltos mayores.\n\n## Recomendaciones de uso\n\n- Usar siempre `label` visible, salvo que el contexto ya lo identifique claramente (en ese caso, `aria-label`).\n- Para valores con unidad, indicarla en `textValue`.\n- Si el valor exacto importa, ofrecer tambi\xE9n un campo de texto para escribirlo, ya que con el rat\xF3n es dif\xEDcil acertar valores concretos en rangos grandes.\n\n## Consideraciones\n\n- En modo continuo no se a\xF1ade `aria-valuetext`, as\xED que la unidad de `textValue` no se anuncia junto al valor.\n- Si no se pasa `value`, el control empieza en `min` (o en el primer valor de `values`)."
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
storybookCodePanel: {
|
|
77
|
-
disabled: false,
|
|
78
|
-
files: [{
|
|
79
|
-
fileName: 'Slider.js',
|
|
80
|
-
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
81
|
-
code: require('!!raw-loader!./Slider.jsx')
|
|
82
|
-
}, {
|
|
83
|
-
fileName: 'Slider.css',
|
|
84
|
-
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
85
|
-
code: require('!!raw-loader!./Slider.css')
|
|
86
|
-
}]
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
exports["default"] = _default;
|
|
91
|
-
var PlaygroundTemplate = function PlaygroundTemplate(_ref) {
|
|
92
|
-
var values = _ref.values,
|
|
93
|
-
args = _objectWithoutProperties(_ref, _excluded);
|
|
94
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
95
|
-
style: {
|
|
96
|
-
maxWidth: '24rem',
|
|
97
|
-
paddingTop: '2rem'
|
|
98
|
-
}
|
|
99
|
-
}, /*#__PURE__*/_react["default"].createElement(_Slider["default"], _extends({
|
|
100
|
-
key: JSON.stringify(values)
|
|
101
|
-
}, args, {
|
|
102
|
-
values: Array.isArray(values) && values.length > 0 ? values : null
|
|
103
|
-
})));
|
|
104
|
-
};
|
|
105
|
-
PlaygroundTemplate.displayName = "PlaygroundTemplate";
|
|
106
|
-
var Playground = PlaygroundTemplate.bind({});
|
|
107
|
-
exports.Playground = Playground;
|
|
108
|
-
Playground.args = {
|
|
109
|
-
label: 'Duración de la intervención',
|
|
110
|
-
min: 0,
|
|
111
|
-
max: 60,
|
|
112
|
-
value: 15,
|
|
113
|
-
values: [],
|
|
114
|
-
textValue: 'min',
|
|
115
|
-
noDisplayValue: false
|
|
116
|
-
};
|
|
117
|
-
var TemplateSlider = function TemplateSlider(args) {
|
|
118
|
-
return /*#__PURE__*/_react["default"].createElement(_DesignSlider["default"], args);
|
|
119
|
-
};
|
|
120
|
-
TemplateSlider.displayName = "TemplateSlider";
|
|
121
|
-
var DesignSliderTemplate = TemplateSlider.bind({});
|
|
122
|
-
exports.DesignSliderTemplate = DesignSliderTemplate;
|
|
123
|
-
DesignSliderTemplate.args = {};
|
|
124
|
-
DesignSliderTemplate.parameters = {
|
|
125
|
-
controls: {
|
|
126
|
-
disable: true
|
|
127
|
-
}
|
|
128
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = exports.Default = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Spacing = _interopRequireDefault(require("./Spacing"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
-
var _default = {
|
|
11
|
-
title: 'Components/Spacing',
|
|
12
|
-
component: _Spacing["default"],
|
|
13
|
-
argTypes: {},
|
|
14
|
-
parameters: {
|
|
15
|
-
storybookCodePanel: {
|
|
16
|
-
disabled: false,
|
|
17
|
-
files: [{
|
|
18
|
-
fileName: 'Spacing.js',
|
|
19
|
-
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
20
|
-
code: require('!!raw-loader!./Spacing.jsx')
|
|
21
|
-
}]
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
exports["default"] = _default;
|
|
26
|
-
var Template = function Template(args) {
|
|
27
|
-
return /*#__PURE__*/_react["default"].createElement(_Spacing["default"], args);
|
|
28
|
-
};
|
|
29
|
-
Template.displayName = "Template";
|
|
30
|
-
var Default = Template.bind({});
|
|
31
|
-
exports.Default = Default;
|
|
32
|
-
Default.args = {};
|
|
33
|
-
Default.parameters = {
|
|
34
|
-
controls: {
|
|
35
|
-
disable: true
|
|
36
|
-
}
|
|
37
|
-
};
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = exports.Playground = exports.DesignStarsTemplate = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Stars = _interopRequireDefault(require("./Stars"));
|
|
9
|
-
var _DesignStars = _interopRequireDefault(require("./DesignStars"));
|
|
10
|
-
var _excluded = ["value", "onClick"];
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
12
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) { ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } } return n; }, _extends.apply(null, arguments); }
|
|
13
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
14
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
15
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
16
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
|
|
17
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
18
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
19
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) { o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } } return i; }
|
|
20
|
-
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) { if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } } return t; }
|
|
21
|
-
var _default = {
|
|
22
|
-
title: 'Components/Stars',
|
|
23
|
-
component: _Stars["default"],
|
|
24
|
-
argTypes: {
|
|
25
|
-
name: {
|
|
26
|
-
control: 'text',
|
|
27
|
-
description: 'Identifica el grupo; forma parte del nombre accesible.'
|
|
28
|
-
},
|
|
29
|
-
value: {
|
|
30
|
-
control: {
|
|
31
|
-
type: 'range',
|
|
32
|
-
min: 0,
|
|
33
|
-
max: 10,
|
|
34
|
-
step: 1
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
lengthStars: {
|
|
38
|
-
control: {
|
|
39
|
-
type: 'range',
|
|
40
|
-
min: 1,
|
|
41
|
-
max: 10,
|
|
42
|
-
step: 1
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
variant: {
|
|
46
|
-
control: 'radio',
|
|
47
|
-
options: ['', 'secondary']
|
|
48
|
-
},
|
|
49
|
-
lowStars: {
|
|
50
|
-
control: 'boolean'
|
|
51
|
-
},
|
|
52
|
-
disabled: {
|
|
53
|
-
control: 'boolean'
|
|
54
|
-
},
|
|
55
|
-
error: {
|
|
56
|
-
control: 'text',
|
|
57
|
-
description: 'Mensaje de error (vacío para quitarlo).'
|
|
58
|
-
},
|
|
59
|
-
onClick: {
|
|
60
|
-
action: 'onClick',
|
|
61
|
-
description: 'Recibe el valor como texto.'
|
|
62
|
-
},
|
|
63
|
-
style: {
|
|
64
|
-
control: 'object'
|
|
65
|
-
},
|
|
66
|
-
sx: {
|
|
67
|
-
control: 'object'
|
|
68
|
-
},
|
|
69
|
-
lengthtStars: {
|
|
70
|
-
table: {
|
|
71
|
-
disable: true
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
parameters: {
|
|
76
|
-
docs: {
|
|
77
|
-
description: {
|
|
78
|
-
component: "\n## Stars\n\nControl de valoraci\xF3n por estrellas. Internamente es un grupo de botones de opci\xF3n (`input type=\"radio\"`) con un dise\xF1o de estrellas.\n\n## Funcionamiento\n\n- `value`: valoraci\xF3n actual (n\xFAmero de estrellas marcadas).\n- `onClick(valor)`: se llama al elegir una estrella. Recibe el valor como texto (`'1'`, `'2'`...).\n- `lengthStars`: n\xFAmero de estrellas (5 por defecto).\n- `name`: identifica el grupo. Es obligatorio y debe ser \xFAnico en la p\xE1gina.\n- `disabled`: deshabilita la valoraci\xF3n.\n- `error`: muestra un mensaje de error bajo las estrellas.\n- `variant=\"secondary\"` y `lowStars` cambian el estilo de las estrellas.\n- Al pasar el rat\xF3n o al enfocar una estrella, se previsualiza la valoraci\xF3n.\n\n## Accesibilidad\n\n### Estructura\n\n- Las estrellas se agrupan en un `fieldset` con una `legend` oculta (\"Rating for {name}\").\n- Cada estrella es un `input type=\"radio\"` real con un `label` oculto que indica su valor (\"1 star\", \"2 stars\"...).\n- El car\xE1cter de estrella es decorativo (`aria-hidden=\"true\"`).\n\n### Teclado\n\n- Al ser un grupo de radios nativos, **Tab** entra en el grupo y las **flechas** cambian la valoraci\xF3n.\n- Al recorrer las estrellas con el teclado tambi\xE9n se previsualiza el valor.\n\n### Error\n\n- Con `error`, el grupo lleva `aria-invalid=\"true\"` y `aria-describedby` apuntando al mensaje, que se anuncia con `role=\"alert\"`.\n\n### Control mediante `useA11yGuard`\n\n- En modo estricto exige `name`, ya que forma parte del nombre accesible del grupo.\n\n## Recomendaciones de uso\n\n- Usar un `name` descriptivo (por ejemplo, \"calidad del servicio\"), ya que se lee en la leyenda del grupo.\n- Mostrar cerca de las estrellas qu\xE9 significa la escala (por ejemplo, \"1 = muy malo, 5 = excelente\").\n\n## Consideraciones\n\n- La leyenda (\"Rating for\") y los textos de cada estrella (\"star\" / \"stars\") est\xE1n fijos en ingl\xE9s.\n- `onClick` recibe el valor como texto, no como n\xFAmero: convertirlo con `Number()` si hace falta.\n- `error` est\xE1 tipado como booleano, pero su contenido se muestra como mensaje; pasar el texto del error."
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
storybookCodePanel: {
|
|
82
|
-
disabled: false,
|
|
83
|
-
files: [{
|
|
84
|
-
fileName: 'Stars.js',
|
|
85
|
-
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
86
|
-
code: require('!!raw-loader!./Stars.jsx')
|
|
87
|
-
}, {
|
|
88
|
-
fileName: 'Stars.css',
|
|
89
|
-
// eslint-disable-next-line import/no-webpack-loader-syntax, global-require, import/extensions, import/no-unresolved
|
|
90
|
-
code: require('!!raw-loader!./Stars.css')
|
|
91
|
-
}]
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
exports["default"] = _default;
|
|
96
|
-
var PlaygroundTemplate = function PlaygroundTemplate(_ref) {
|
|
97
|
-
var valueArg = _ref.value,
|
|
98
|
-
_onClick = _ref.onClick,
|
|
99
|
-
args = _objectWithoutProperties(_ref, _excluded);
|
|
100
|
-
var _React$useState = _react["default"].useState(valueArg),
|
|
101
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
102
|
-
value = _React$useState2[0],
|
|
103
|
-
setValue = _React$useState2[1];
|
|
104
|
-
_react["default"].useEffect(function () {
|
|
105
|
-
return setValue(valueArg);
|
|
106
|
-
}, [valueArg]);
|
|
107
|
-
return /*#__PURE__*/_react["default"].createElement(_Stars["default"], _extends({}, args, {
|
|
108
|
-
value: value,
|
|
109
|
-
onClick: function onClick(newValue) {
|
|
110
|
-
setValue(Number(newValue));
|
|
111
|
-
_onClick === null || _onClick === void 0 ? void 0 : _onClick(newValue);
|
|
112
|
-
}
|
|
113
|
-
}));
|
|
114
|
-
};
|
|
115
|
-
PlaygroundTemplate.displayName = "PlaygroundTemplate";
|
|
116
|
-
var Playground = PlaygroundTemplate.bind({});
|
|
117
|
-
exports.Playground = Playground;
|
|
118
|
-
Playground.args = {
|
|
119
|
-
name: 'calidad del servicio',
|
|
120
|
-
value: 3,
|
|
121
|
-
lengthStars: 5,
|
|
122
|
-
variant: '',
|
|
123
|
-
lowStars: false,
|
|
124
|
-
disabled: false,
|
|
125
|
-
error: ''
|
|
126
|
-
};
|
|
127
|
-
var Template = function Template(args) {
|
|
128
|
-
return /*#__PURE__*/_react["default"].createElement(_DesignStars["default"], args);
|
|
129
|
-
};
|
|
130
|
-
Template.displayName = "Template";
|
|
131
|
-
var DesignStarsTemplate = Template.bind({});
|
|
132
|
-
exports.DesignStarsTemplate = DesignStarsTemplate;
|
|
133
|
-
DesignStarsTemplate.args = {};
|
|
134
|
-
DesignStarsTemplate.parameters = {
|
|
135
|
-
controls: {
|
|
136
|
-
disable: true
|
|
137
|
-
}
|
|
138
|
-
};
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var _Stepper = _interopRequireDefault(require("./Stepper"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
-
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
11
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
-
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
13
|
-
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) { n[e] = r[e]; } return n; }
|
|
14
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
15
|
-
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
16
|
-
var DesignStepper = function DesignStepper() {
|
|
17
|
-
var _React$useState = _react["default"].useState(null),
|
|
18
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
19
|
-
state = _React$useState2[0],
|
|
20
|
-
setState = _React$useState2[1];
|
|
21
|
-
var steps = [{
|
|
22
|
-
text: 'Detalles',
|
|
23
|
-
name: 'Detalles',
|
|
24
|
-
icon: 'ri-file-list-2-line'
|
|
25
|
-
}, {
|
|
26
|
-
text: 'Participantes',
|
|
27
|
-
name: 'Participantes',
|
|
28
|
-
icon: 'ri-user-3-line'
|
|
29
|
-
}, {
|
|
30
|
-
text: 'Consentimientos',
|
|
31
|
-
name: 'Consentimientos',
|
|
32
|
-
icon: 'ri-clipboard-line'
|
|
33
|
-
}, {
|
|
34
|
-
text: 'Documentacion',
|
|
35
|
-
name: 'Documentacion',
|
|
36
|
-
icon: 'ri-folder-3-line'
|
|
37
|
-
}, {
|
|
38
|
-
text: 'Configuracion',
|
|
39
|
-
name: 'Configuracion',
|
|
40
|
-
icon: 'ri-settings-4-line'
|
|
41
|
-
}, {
|
|
42
|
-
text: 'Revisar',
|
|
43
|
-
name: 'Revisar',
|
|
44
|
-
icon: 'ri-file-text-line'
|
|
45
|
-
}];
|
|
46
|
-
var stepNames = steps.map(function (s) {
|
|
47
|
-
return s.name;
|
|
48
|
-
});
|
|
49
|
-
var currentIndex = stepNames.indexOf(state);
|
|
50
|
-
var previous = stepNames[currentIndex - 1];
|
|
51
|
-
var next = stepNames[currentIndex + 1];
|
|
52
|
-
var handleStepClick = function handleStepClick(stepName) {
|
|
53
|
-
if (stepName === next) {
|
|
54
|
-
setState(next);
|
|
55
|
-
} else if (stepName === previous) {
|
|
56
|
-
setState(previous);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
return /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
60
|
-
style: {
|
|
61
|
-
marginBottom: '1rem'
|
|
62
|
-
}
|
|
63
|
-
}, /*#__PURE__*/_react["default"].createElement(_Stepper["default"], {
|
|
64
|
-
onClick: setState,
|
|
65
|
-
items: [{
|
|
66
|
-
text: 'Detalles',
|
|
67
|
-
name: 'Detalles',
|
|
68
|
-
icon: 'ri-file-list-2-line'
|
|
69
|
-
}, {
|
|
70
|
-
text: 'Participantes',
|
|
71
|
-
name: 'Participantes',
|
|
72
|
-
icon: 'ri-user-3-line'
|
|
73
|
-
}, {
|
|
74
|
-
text: 'Consentimientos',
|
|
75
|
-
name: 'Consentimientos',
|
|
76
|
-
icon: 'ri-clipboard-line'
|
|
77
|
-
}, {
|
|
78
|
-
text: 'Documentacion',
|
|
79
|
-
name: 'Documentacion',
|
|
80
|
-
icon: 'ri-folder-3-line'
|
|
81
|
-
}, {
|
|
82
|
-
text: 'Configuracion',
|
|
83
|
-
name: 'Configuracion',
|
|
84
|
-
icon: 'ri-settings-4-line'
|
|
85
|
-
}, {
|
|
86
|
-
text: 'Revisar',
|
|
87
|
-
name: 'Revisar',
|
|
88
|
-
icon: 'ri-file-text-line'
|
|
89
|
-
}],
|
|
90
|
-
active: state
|
|
91
|
-
})), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Stepper["default"], {
|
|
92
|
-
onClick: setState,
|
|
93
|
-
freeNavigation: false,
|
|
94
|
-
items: [{
|
|
95
|
-
text: 'Detalles',
|
|
96
|
-
name: 'Detalles',
|
|
97
|
-
icon: 'ri-file-list-2-line'
|
|
98
|
-
}, {
|
|
99
|
-
text: 'Participantes',
|
|
100
|
-
name: 'Participantes',
|
|
101
|
-
icon: 'ri-user-3-line'
|
|
102
|
-
}, {
|
|
103
|
-
text: 'Consentimientos',
|
|
104
|
-
name: 'Consentimientos',
|
|
105
|
-
icon: 'ri-clipboard-line'
|
|
106
|
-
}, {
|
|
107
|
-
text: 'Documentacion',
|
|
108
|
-
name: 'Documentacion',
|
|
109
|
-
icon: 'ri-folder-3-line'
|
|
110
|
-
}, {
|
|
111
|
-
text: 'Configuracion',
|
|
112
|
-
name: 'Configuracion',
|
|
113
|
-
icon: 'ri-settings-4-line'
|
|
114
|
-
}, {
|
|
115
|
-
text: 'Revisar',
|
|
116
|
-
name: 'Revisar',
|
|
117
|
-
icon: 'ri-file-text-line'
|
|
118
|
-
}],
|
|
119
|
-
active: state
|
|
120
|
-
})), /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(_Stepper["default"], {
|
|
121
|
-
onClick: handleStepClick,
|
|
122
|
-
freeNavigation: false,
|
|
123
|
-
allowedSteps: [previous, next].filter(Boolean),
|
|
124
|
-
items: steps,
|
|
125
|
-
active: state
|
|
126
|
-
})));
|
|
127
|
-
};
|
|
128
|
-
DesignStepper.displayName = "DesignStepper";
|
|
129
|
-
var _default = DesignStepper;
|
|
130
|
-
exports["default"] = _default;
|