pixelon 0.3.25 → 0.3.26
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/atoms/chat/AudioWaves/AudioWaves(1).d.ts +21 -0
- package/dist/components/atoms/chat/AudioWaves/index(1).d.ts +2 -0
- package/dist/components/atoms/chat/DateDivider/DateDivider(1).d.ts +7 -0
- package/dist/components/atoms/chat/Loader/Loader(1).d.ts +10 -0
- package/dist/components/atoms/chat/Loader/index(1).d.ts +2 -0
- package/dist/components/atoms/chat/Select/index(1).d.ts +2 -0
- package/dist/components/atoms/lumi/Button/Button(1).d.ts +17 -0
- package/dist/components/atoms/lumi/Checkbox/Checkbox(1).d.ts +5 -0
- package/dist/components/atoms/lumi/Checkbox/index(1).d.ts +2 -0
- package/dist/components/atoms/lumi/Checkbox/index(2).d.ts +2 -0
- package/dist/components/atoms/lumi/Checkbox/types(1).d.ts +93 -0
- package/dist/components/atoms/lumi/CurrencyDisplay/index(1).d.ts +2 -0
- package/dist/components/atoms/lumi/DateDisplay/index(1).d.ts +2 -0
- package/dist/components/atoms/lumi/DateDisplay/index(2).d.ts +2 -0
- package/dist/components/atoms/lumi/DateInput/DateInput(1).d.ts +27 -0
- package/dist/components/atoms/lumi/DateInput/WebDatePicker(1).d.ts +19 -0
- package/dist/components/atoms/lumi/DateInput/WebDatePicker(2).d.ts +19 -0
- package/dist/components/atoms/lumi/Icon/Icon(1).d.ts +52 -0
- package/dist/components/atoms/lumi/Input/index(1).d.ts +3 -0
- package/dist/components/atoms/lumi/Popover/index(1).d.ts +2 -0
- package/dist/components/atoms/lumi/Popover/types(1).d.ts +62 -0
- package/dist/components/atoms/lumi/TextArea/index(1).d.ts +2 -0
- package/dist/components/atoms/lumi/TextArea/types(1).d.ts +35 -0
- package/dist/components/atoms/lumi/TimeInput/TimeInput(1).d.ts +27 -0
- package/dist/components/atoms/lumi/TimeInput/TimeInput(2).d.ts +27 -0
- package/dist/components/molecules/chat/Drawer/Drawer.d.ts +2 -0
- package/dist/components/molecules/chat/FullscreenViewer/hooks/useSwipeGestures(1).d.ts +12 -0
- package/dist/components/molecules/chat/StructuredContent/StructuredContent(1).d.ts +10 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/CarouselDisplay.d.ts +4 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/components/CarouselCard/CarouselCard.d.ts +15 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/components/CarouselConfirm/CarouselConfirm.d.ts +10 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/components/CarouselSearch/CarouselSearch.d.ts +8 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/components/CarouselTrack/CarouselTrack.d.ts +11 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/store/actions.d.ts +26 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/store/carouselStore.d.ts +8 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/store/index.d.ts +6 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/store/storeKeys.d.ts +10 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/store/types.d.ts +11 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/types.d.ts +43 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/useCarouselSearch.d.ts +15 -0
- package/dist/components/molecules/chat/StructuredContent/components/CarouselDisplay/useStoreState.d.ts +3 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/DynamicField(1).d.ts +13 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/DynamicField.d.ts +13 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/ReactiveForm.d.ts +4 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/ReactiveFormView.d.ts +10 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/buildYupSchema(1).d.ts +4 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/buildYupSchema.d.ts +4 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/resolveVariables.d.ts +20 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/types(1).d.ts +91 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/types.d.ts +100 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/useReactiveEndpoints(1).d.ts +17 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/useReactiveEndpoints(2).d.ts +23 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/useReactiveEndpoints.d.ts +23 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/useReactiveForm(1).d.ts +38 -0
- package/dist/components/molecules/chat/StructuredContent/components/ReactiveForm/useReactiveForm.d.ts +38 -0
- package/dist/components/molecules/chat/StructuredContent/components/index.d.ts +2 -0
- package/dist/components/molecules/chat/StructuredContent/helpers/contentParser(1).d.ts +7 -0
- package/dist/components/molecules/chat/StructuredContent/helpers/fetchViaEventBus.d.ts +2 -0
- package/dist/components/molecules/chat/StructuredContent/index(1).d.ts +2 -0
- package/dist/components/molecules/lumi/Breadcrumb/Breadcrumb(1).d.ts +10 -0
- package/dist/components/molecules/lumi/Breadcrumb/Breadcrumb(2).d.ts +10 -0
- package/dist/components/molecules/lumi/Breadcrumb/types(1).d.ts +105 -0
- package/dist/components/molecules/lumi/Checkbox/Checkbox(1).d.ts +11 -0
- package/dist/components/molecules/lumi/Checkbox/index(1).d.ts +4 -0
- package/dist/components/molecules/lumi/Checkbox/use-cases/index(1).d.ts +1 -0
- package/dist/components/molecules/lumi/Checkbox/validation-helpers(1).d.ts +151 -0
- package/dist/components/molecules/lumi/DateInput/FormDateInput(1).d.ts +12 -0
- package/dist/components/molecules/lumi/DateInput/index(1).d.ts +2 -0
- package/dist/components/molecules/lumi/DateInput/use-cases/FormDateInputClearWithResetUseCase(1).d.ts +21 -0
- package/dist/components/molecules/lumi/DateInput/use-cases/FormDateInputErrorVisibilityUseCase(1).d.ts +21 -0
- package/dist/components/molecules/lumi/Drawer/Drawer(1).d.ts +39 -0
- package/dist/components/molecules/lumi/Drawer/index(1).d.ts +2 -0
- package/dist/components/molecules/lumi/DropdownMenu/DropdownMenu(1).d.ts +22 -0
- package/dist/components/molecules/lumi/DropdownMenu/index(1).d.ts +2 -0
- package/dist/components/molecules/lumi/DropdownMenu/types(1).d.ts +29 -0
- package/dist/components/molecules/lumi/Filter/FilterRow(1).d.ts +13 -0
- package/dist/components/molecules/lumi/Filter/helpers/conditionHelpers(1).d.ts +14 -0
- package/dist/components/molecules/lumi/Filter/index(1).d.ts +5 -0
- package/dist/components/molecules/lumi/Filter/types(1).d.ts +115 -0
- package/dist/components/molecules/lumi/Input/Input(1).d.ts +12 -0
- package/dist/components/molecules/lumi/Menu/Menu(1).d.ts +18 -0
- package/dist/components/molecules/lumi/Menu/MenuContext(1).d.ts +41 -0
- package/dist/components/molecules/lumi/Menu/MenuItem(1).d.ts +6 -0
- package/dist/components/molecules/lumi/Menu/MenuItem(2).d.ts +6 -0
- package/dist/components/molecules/lumi/Menu/MenuItemGroup(1).d.ts +6 -0
- package/dist/components/molecules/lumi/Menu/SubMenu(1).d.ts +6 -0
- package/dist/components/molecules/lumi/Menu/iconHelper(1).d.ts +15 -0
- package/dist/components/molecules/lumi/Menu/index(1).d.ts +8 -0
- package/dist/components/molecules/lumi/Menu/index(2).d.ts +8 -0
- package/dist/components/molecules/lumi/Menu/types(1).d.ts +119 -0
- package/dist/components/molecules/lumi/Pagination/Pagination(1).d.ts +4 -0
- package/dist/components/molecules/lumi/Pagination/index(1).d.ts +2 -0
- package/dist/components/molecules/lumi/Select/Select(1).d.ts +14 -0
- package/dist/components/molecules/lumi/Select/Select(2).d.ts +14 -0
- package/dist/components/molecules/lumi/Select/Select(3).d.ts +14 -0
- package/dist/components/molecules/lumi/Select/index(1).d.ts +2 -0
- package/dist/components/molecules/lumi/Select/index(2).d.ts +2 -0
- package/dist/components/molecules/lumi/Select/use-cases/FormSelectClearWithResetUseCase(1).d.ts +21 -0
- package/dist/components/molecules/lumi/Select/use-cases/FormSelectClearWithResetUseCase(2).d.ts +21 -0
- package/dist/components/molecules/lumi/Select/use-cases/index(1).d.ts +2 -0
- package/dist/components/molecules/lumi/Select/use-cases/index(2).d.ts +2 -0
- package/dist/components/molecules/lumi/Table/Table(1).d.ts +6 -0
- package/dist/components/molecules/lumi/Table/Table(2).d.ts +6 -0
- package/dist/components/molecules/lumi/Table/index(1).d.ts +2 -0
- package/dist/components/molecules/lumi/Table/types(1).d.ts +177 -0
- package/dist/components/molecules/lumi/Table/types(2).d.ts +177 -0
- package/dist/components/molecules/lumi/Tabs/Tabs(1).d.ts +4 -0
- package/dist/components/molecules/lumi/Tabs/Tabs(2).d.ts +4 -0
- package/dist/components/molecules/lumi/Tabs/index(1).d.ts +2 -0
- package/dist/components/molecules/lumi/Tabs/index(2).d.ts +2 -0
- package/dist/components/molecules/lumi/TimeInput/FormTimeInput(1).d.ts +12 -0
- package/dist/components/molecules/lumi/TimeInput/use-cases/FormTimeInputClearWithResetUseCase(1).d.ts +21 -0
- package/dist/components/molecules/lumi/TimeInput/use-cases/FormTimeInputErrorVisibilityUseCase(1).d.ts +21 -0
- package/dist/components/molecules/lumi/TimeInput/use-cases/index(1).d.ts +4 -0
- package/dist/components/organisms/chat/Chat/Chat(1).d.ts +12 -0
- package/dist/components/organisms/chat/Chat/hooks/useChatHandlers(1).d.ts +15 -0
- package/dist/components/organisms/chat/Chat/hooks/useChatStore.d.ts +3 -0
- package/dist/components/organisms/chat/Chat/hooks/useKeyboardLock(1).d.ts +15 -0
- package/dist/components/organisms/chat/Chat/index(1).d.ts +3 -0
- package/dist/components/organisms/chat/Chat/store/actions.d.ts +3 -0
- package/dist/components/organisms/chat/Chat/store/index(1).d.ts +4 -0
- package/dist/components/organisms/chat/Chat/store/types.d.ts +3 -0
- package/dist/components/organisms/chat/Chat/use-cases/GroupMessagesByDateUseCase(1).d.ts +20 -0
- package/dist/components/organisms/chat/index(1).d.ts +3 -0
- package/dist/components/organisms/chat/index(2).d.ts +3 -0
- package/dist/components/organisms/lumi/ActionBar/ActionBar(1).d.ts +18 -0
- package/dist/components/organisms/lumi/ActionBar/types(1).d.ts +57 -0
- package/dist/components/organisms/lumi/BaseNavbar/types(1).d.ts +34 -0
- package/dist/components/organisms/lumi/BaseWorkspace/BaseWorkspace(1).d.ts +28 -0
- package/dist/components/organisms/lumi/BaseWorkspace/index(1).d.ts +2 -0
- package/dist/components/organisms/lumi/Calendar/components/CalendarEvent(1).d.ts +18 -0
- package/dist/components/organisms/lumi/Calendar/components/CalendarEvent(2).d.ts +18 -0
- package/dist/components/organisms/lumi/Calendar/components/CalendarEvent(3).d.ts +18 -0
- package/dist/components/organisms/lumi/Calendar/components/CalendarHeader(1).d.ts +14 -0
- package/dist/components/organisms/lumi/Calendar/components/TimeGutter(1).d.ts +10 -0
- package/dist/components/organisms/lumi/Calendar/components/TimeGutter(2).d.ts +10 -0
- package/dist/components/organisms/lumi/Calendar/hooks/index(1).d.ts +4 -0
- package/dist/components/organisms/lumi/Calendar/hooks/useCalendarHeight(1).d.ts +58 -0
- package/dist/components/organisms/lumi/Calendar/hooks/useCalendarHeight(2).d.ts +58 -0
- package/dist/components/organisms/lumi/Calendar/hooks/useEventLayout(1).d.ts +21 -0
- package/dist/components/organisms/lumi/Calendar/hooks/useEventLayout(2).d.ts +21 -0
- package/dist/components/organisms/lumi/Calendar/hooks/useTimeSlots(1).d.ts +14 -0
- package/dist/components/organisms/lumi/Calendar/hooks/useTimeSlots(2).d.ts +14 -0
- package/dist/components/organisms/lumi/Calendar/hooks/useTimeSlots(3).d.ts +14 -0
- package/dist/components/organisms/lumi/Calendar/i18n/index(1).d.ts +1 -0
- package/dist/components/organisms/lumi/Calendar/i18n/index(2).d.ts +1 -0
- package/dist/components/organisms/lumi/Calendar/i18n/translations(1).d.ts +34 -0
- package/dist/components/organisms/lumi/Calendar/index(1).d.ts +2 -0
- package/dist/components/organisms/lumi/Calendar/utils/dateUtils(1).d.ts +140 -0
- package/dist/components/organisms/lumi/Calendar/utils/dateUtils(2).d.ts +140 -0
- package/dist/components/organisms/lumi/Calendar/utils/index(1).d.ts +2 -0
- package/dist/components/organisms/lumi/Calendar/utils/multiDayUtils(1).d.ts +73 -0
- package/dist/components/organisms/lumi/Calendar/views/DayView(1).d.ts +17 -0
- package/dist/components/organisms/lumi/Calendar/views/DayView(2).d.ts +17 -0
- package/dist/components/organisms/lumi/Calendar/views/MonthView(1).d.ts +17 -0
- package/dist/components/organisms/lumi/Calendar/views/MonthView(2).d.ts +17 -0
- package/dist/components/organisms/lumi/Calendar/views/WeekView(1).d.ts +19 -0
- package/dist/components/organisms/lumi/Calendar/views/WeekView(2).d.ts +19 -0
- package/dist/components/organisms/lumi/Calendar/views/YearView(1).d.ts +13 -0
- package/dist/components/organisms/lumi/Calendar/views/index(1).d.ts +4 -0
- package/dist/components/organisms/lumi/Calendar/views/index(2).d.ts +4 -0
- package/dist/components/organisms/lumi/DashboardNavbar/index(1).d.ts +7 -0
- package/dist/components/organisms/lumi/DashboardNavbar/types(1).d.ts +52 -0
- package/dist/components/organisms/lumi/DashboardWorkspace/DashboardWorkspace(1).d.ts +23 -0
- package/dist/components/organisms/lumi/DashboardWorkspace/DashboardWorkspace(2).d.ts +23 -0
- package/dist/components/organisms/lumi/DashboardWorkspace/index(1).d.ts +7 -0
- package/dist/components/organisms/lumi/DashboardWorkspace/index(2).d.ts +7 -0
- package/dist/components/organisms/lumi/DashboardWorkspace/types(1).d.ts +60 -0
- package/dist/components/organisms/lumi/DashboardWorkspace/types(2).d.ts +60 -0
- package/dist/components/organisms/lumi/DynamicForm/DynamicForm(1).d.ts +21 -0
- package/dist/components/organisms/lumi/DynamicForm/helpers/fieldMapper(1).d.ts +17 -0
- package/dist/components/organisms/lumi/DynamicForm/helpers/fieldMapper(2).d.ts +17 -0
- package/dist/components/organisms/lumi/DynamicForm/helpers/fieldRenderer(1).d.ts +6 -0
- package/dist/components/organisms/lumi/DynamicForm/helpers/fieldRenderer(2).d.ts +6 -0
- package/dist/components/organisms/lumi/DynamicForm/index(1).d.ts +2 -0
- package/dist/components/organisms/lumi/DynamicForm/index(2).d.ts +2 -0
- package/dist/components/organisms/lumi/DynamicForm/types(1).d.ts +96 -0
- package/dist/components/organisms/lumi/DynamicForm/types(2).d.ts +96 -0
- package/dist/components/organisms/lumi/FormDrawer/FormDrawer(1).d.ts +5 -0
- package/dist/components/organisms/lumi/FormDrawer/index(1).d.ts +3 -0
- package/dist/components/organisms/lumi/FormDrawer/types(1).d.ts +61 -0
- package/dist/components/organisms/lumi/FormDrawer/types(2).d.ts +61 -0
- package/dist/components/organisms/lumi/Stepper/StepIndicator(1).d.ts +4 -0
- package/dist/components/organisms/lumi/Stepper/Stepper(1).d.ts +5 -0
- package/dist/components/organisms/lumi/Stepper/index(1).d.ts +3 -0
- package/dist/components/organisms/lumi/Stepper/types(1).d.ts +96 -0
- package/dist/components/organisms/lumi/Stepper/types(2).d.ts +96 -0
- package/dist/components/organisms/lumi/index(1).d.ts +10 -0
- package/dist/components/organisms/lumi/index(2).d.ts +10 -0
- package/dist/components/templates/chat/ChatWidget/ChatWidget(1).d.ts +10 -0
- package/dist/components/templates/chat/ChatWidget/hooks/index(1).d.ts +1 -0
- package/dist/components/templates/chat/ChatWidget/index(1).d.ts +2 -0
- package/dist/components/templates/chat/ChatWidget/index(2).d.ts +2 -0
- package/dist/components/templates/chat/ChatWidget/types(1).d.ts +90 -0
- package/dist/components/templates/lumi/Base/hooks/index(1).d.ts +2 -0
- package/dist/components/templates/lumi/Base/hooks/useAppHeight(1).d.ts +21 -0
- package/dist/components/templates/lumi/Base/index(1).d.ts +2 -0
- package/dist/components/templates/lumi/Base/types(1).d.ts +54 -0
- package/dist/components/templates/lumi/Crud/Crud(1).d.ts +6 -0
- package/dist/components/templates/lumi/Crud/Crud(2).d.ts +6 -0
- package/dist/components/templates/lumi/Crud/helpers/fieldMapper(1).d.ts +13 -0
- package/dist/components/templates/lumi/Crud/hooks/useCrudActions(1).d.ts +11 -0
- package/dist/components/templates/lumi/Crud/index(1).d.ts +2 -0
- package/dist/components/templates/lumi/Crud/store/actions(1).d.ts +45 -0
- package/dist/components/templates/lumi/Crud/store/crudStore(1).d.ts +8 -0
- package/dist/components/templates/lumi/Crud/store/index(1).d.ts +5 -0
- package/dist/components/templates/lumi/Crud/store/types(1).d.ts +71 -0
- package/dist/components/templates/lumi/Dashboard/Dashboard(1).d.ts +25 -0
- package/dist/components/templates/lumi/Dashboard/hooks/index(1).d.ts +12 -0
- package/dist/components/templates/lumi/Dashboard/hooks/index(2).d.ts +12 -0
- package/dist/components/templates/lumi/Dashboard/hooks/useDashboardStore(1).d.ts +34 -0
- package/dist/components/templates/lumi/Dashboard/hooks/useScrollToTop(1).d.ts +47 -0
- package/dist/components/templates/lumi/Dashboard/index(1).d.ts +10 -0
- package/dist/components/templates/lumi/Dashboard/store/storeKeys(1).d.ts +13 -0
- package/dist/components/templates/lumi/Dashboard/store/types(1).d.ts +73 -0
- package/dist/components/templates/lumi/Dashboard/store/types(2).d.ts +73 -0
- package/dist/components/templates/lumi/Dashboard/types(1).d.ts +114 -0
- package/dist/components/templates/lumi/Dashboard/types(2).d.ts +114 -0
- package/dist/components/templates/lumi/index(1).d.ts +3 -0
- package/dist/core/chat/ChatConfigContext(1).d.ts +36 -0
- package/dist/core/chat/chatMessage.d.ts +1 -1
- package/dist/core/eventBus/chatEventBus.d.ts +67 -0
- package/dist/index(1).esm.js +19378 -0
- package/dist/index(1).js +19487 -0
- package/dist/index.esm.js +2218 -348
- package/dist/index.js +2218 -348
- package/dist/styles(1).css +1 -0
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/src/styles/index.scss +7 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props del organismo DashboardWorkspace
|
|
4
|
+
*/
|
|
5
|
+
export interface DashboardWorkspaceProps {
|
|
6
|
+
/**
|
|
7
|
+
* Contenido del workspace
|
|
8
|
+
*/
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Si habilita el botón "volver arriba"
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
enableScrollToTop?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Altura del navbar en píxeles (para calcular altura disponible)
|
|
17
|
+
* @default 64
|
|
18
|
+
*/
|
|
19
|
+
navbarHeight?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Threshold de scroll para mostrar el botón (en píxeles)
|
|
22
|
+
* @default 200
|
|
23
|
+
*/
|
|
24
|
+
scrollThreshold?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Comportamiento del scroll al ir arriba
|
|
27
|
+
* @default 'smooth'
|
|
28
|
+
*/
|
|
29
|
+
scrollBehavior?: ScrollBehavior;
|
|
30
|
+
/**
|
|
31
|
+
* Callback cuando cambia la posición del scroll
|
|
32
|
+
*/
|
|
33
|
+
onScroll?: (scrollTop: number) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Callback cuando se hace clic en el botón "volver arriba"
|
|
36
|
+
*/
|
|
37
|
+
onScrollToTop?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Color de fondo del workspace
|
|
40
|
+
* @default '#fafafa'
|
|
41
|
+
*/
|
|
42
|
+
backgroundColor?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Padding del contenido
|
|
45
|
+
* @default { mobile: '16px', tablet: '20px', desktop: '24px' }
|
|
46
|
+
*/
|
|
47
|
+
padding?: string | {
|
|
48
|
+
mobile?: string;
|
|
49
|
+
tablet?: string;
|
|
50
|
+
desktop?: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Clase CSS adicional
|
|
54
|
+
*/
|
|
55
|
+
className?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Test ID para testing
|
|
58
|
+
*/
|
|
59
|
+
'data-testid'?: string;
|
|
60
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props del organismo DashboardWorkspace
|
|
4
|
+
*/
|
|
5
|
+
export interface DashboardWorkspaceProps {
|
|
6
|
+
/**
|
|
7
|
+
* Contenido del workspace
|
|
8
|
+
*/
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Si habilita el botón "volver arriba"
|
|
12
|
+
* @default true
|
|
13
|
+
*/
|
|
14
|
+
enableScrollToTop?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Altura del navbar en píxeles (para calcular altura disponible)
|
|
17
|
+
* @default 64
|
|
18
|
+
*/
|
|
19
|
+
navbarHeight?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Threshold de scroll para mostrar el botón (en píxeles)
|
|
22
|
+
* @default 200
|
|
23
|
+
*/
|
|
24
|
+
scrollThreshold?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Comportamiento del scroll al ir arriba
|
|
27
|
+
* @default 'smooth'
|
|
28
|
+
*/
|
|
29
|
+
scrollBehavior?: ScrollBehavior;
|
|
30
|
+
/**
|
|
31
|
+
* Callback cuando cambia la posición del scroll
|
|
32
|
+
*/
|
|
33
|
+
onScroll?: (scrollTop: number) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Callback cuando se hace clic en el botón "volver arriba"
|
|
36
|
+
*/
|
|
37
|
+
onScrollToTop?: () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Color de fondo del workspace
|
|
40
|
+
* @default '#fafafa'
|
|
41
|
+
*/
|
|
42
|
+
backgroundColor?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Padding del contenido
|
|
45
|
+
* @default { mobile: '16px', tablet: '20px', desktop: '24px' }
|
|
46
|
+
*/
|
|
47
|
+
padding?: string | {
|
|
48
|
+
mobile?: string;
|
|
49
|
+
tablet?: string;
|
|
50
|
+
desktop?: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Clase CSS adicional
|
|
54
|
+
*/
|
|
55
|
+
className?: string;
|
|
56
|
+
/**
|
|
57
|
+
* Test ID para testing
|
|
58
|
+
*/
|
|
59
|
+
'data-testid'?: string;
|
|
60
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DynamicFormProps } from "./types";
|
|
3
|
+
import "./DynamicForm.scss";
|
|
4
|
+
/**
|
|
5
|
+
* DynamicForm - Organismo de Lumi
|
|
6
|
+
*
|
|
7
|
+
* Formulario dinámico que renderiza campos basados en una configuración.
|
|
8
|
+
* Integrado con React Hook Form para manejo de estado y Yup para validación.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <DynamicForm
|
|
13
|
+
* fields={serviceFields}
|
|
14
|
+
* validationSchema={serviceSchema}
|
|
15
|
+
* onSubmit={handleSubmit}
|
|
16
|
+
* onChange={(data) => console.log('Cambio en tiempo real:', data)}
|
|
17
|
+
* columns={2}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare const DynamicForm: React.FC<DynamicFormProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FormFieldConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Transforma los valores de entrada según transformOnReceive
|
|
4
|
+
*/
|
|
5
|
+
export declare const transformIncomingValues: (values: Record<string, unknown>, fields: FormFieldConfig[]) => Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Transforma los valores de salida según transformOnSubmit
|
|
8
|
+
*/
|
|
9
|
+
export declare const transformOutgoingValues: (values: Record<string, unknown>, fields: FormFieldConfig[]) => Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Filtra y ordena los campos según showIf y order
|
|
12
|
+
*/
|
|
13
|
+
export declare const filterAndSortFields: (fields: FormFieldConfig[], formValues: Record<string, unknown>) => FormFieldConfig[];
|
|
14
|
+
/**
|
|
15
|
+
* Obtiene los valores por defecto de los campos
|
|
16
|
+
*/
|
|
17
|
+
export declare const getDefaultValuesFromFields: (fields: FormFieldConfig[]) => Record<string, unknown>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FormFieldConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Transforma los valores de entrada según transformOnReceive
|
|
4
|
+
*/
|
|
5
|
+
export declare const transformIncomingValues: (values: Record<string, unknown>, fields: FormFieldConfig[]) => Record<string, unknown>;
|
|
6
|
+
/**
|
|
7
|
+
* Transforma los valores de salida según transformOnSubmit
|
|
8
|
+
*/
|
|
9
|
+
export declare const transformOutgoingValues: (values: Record<string, unknown>, fields: FormFieldConfig[]) => Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Filtra y ordena los campos según showIf y order
|
|
12
|
+
*/
|
|
13
|
+
export declare const filterAndSortFields: (fields: FormFieldConfig[], formValues: Record<string, unknown>) => FormFieldConfig[];
|
|
14
|
+
/**
|
|
15
|
+
* Obtiene los valores por defecto de los campos
|
|
16
|
+
*/
|
|
17
|
+
export declare const getDefaultValuesFromFields: (fields: FormFieldConfig[]) => Record<string, unknown>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FieldRendererProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Renderiza la molécula correspondiente según el tipo de campo
|
|
5
|
+
*/
|
|
6
|
+
export declare const renderField: ({ field, control, mode, disabled, }: FieldRendererProps) => React.ReactElement;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { FieldRendererProps } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Renderiza la molécula correspondiente según el tipo de campo
|
|
5
|
+
*/
|
|
6
|
+
export declare const renderField: ({ field, control, mode, disabled, }: FieldRendererProps) => React.ReactElement;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { UseFormReturn, Control, FieldValues } from 'react-hook-form';
|
|
2
|
+
/**
|
|
3
|
+
* Tipos de moléculas soportadas por DynamicForm
|
|
4
|
+
*/
|
|
5
|
+
export type MoleculeType = 'INPUT' | 'INPUT_NUMBER' | 'INPUT_EMAIL' | 'INPUT_PASSWORD' | 'INPUT_PHONE' | 'INPUT_CURRENCY' | 'TEXTAREA' | 'SELECT' | 'SELECT_MULTI' | 'DATE_INPUT' | 'TIME_INPUT' | 'DATETIME_INPUT' | 'CHECKBOX' | 'SWITCH' | 'RADIO_GROUP' | 'CUSTOM';
|
|
6
|
+
/**
|
|
7
|
+
* Opción para Select, Select Multi, Radio Group
|
|
8
|
+
*/
|
|
9
|
+
export interface SelectOption {
|
|
10
|
+
value: string | number;
|
|
11
|
+
label: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Configuración de un campo del formulario
|
|
16
|
+
*/
|
|
17
|
+
export interface FormFieldConfig {
|
|
18
|
+
/** Key del campo (debe coincidir con la key en defaultValues) */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Label del campo */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Tipo de molécula a renderizar (OBLIGATORIO) */
|
|
23
|
+
moleculeType: MoleculeType;
|
|
24
|
+
/** Si el campo es requerido */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** Si el campo es de solo lectura */
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
/** Placeholder del campo */
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
/** Descripción o help text del campo */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** Valor por defecto */
|
|
33
|
+
defaultValue?: unknown;
|
|
34
|
+
/** Ancho del campo en el grid (1-12) */
|
|
35
|
+
gridSpan?: number;
|
|
36
|
+
/** Props específicas de la molécula */
|
|
37
|
+
uiProps?: Record<string, unknown>;
|
|
38
|
+
/** Función de transformación al enviar */
|
|
39
|
+
transformOnSubmit?: (value: unknown) => unknown;
|
|
40
|
+
/** Función de transformación al recibir */
|
|
41
|
+
transformOnReceive?: (value: unknown) => unknown;
|
|
42
|
+
/** Condición para mostrar el campo (dependencia de otros campos) */
|
|
43
|
+
showIf?: (formValues: Record<string, unknown>) => boolean;
|
|
44
|
+
/** Opciones para SELECT, SELECT_MULTI */
|
|
45
|
+
options?: SelectOption[];
|
|
46
|
+
/** Orden de renderizado */
|
|
47
|
+
order?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Props del componente DynamicForm
|
|
51
|
+
*/
|
|
52
|
+
export interface DynamicFormProps {
|
|
53
|
+
/** Configuración de campos del formulario */
|
|
54
|
+
fields: FormFieldConfig[];
|
|
55
|
+
/** Valores iniciales del formulario */
|
|
56
|
+
defaultValues?: Record<string, unknown>;
|
|
57
|
+
/** Callback al enviar el formulario (después de validación) */
|
|
58
|
+
onSubmit: (data: Record<string, unknown>) => void | Promise<void>;
|
|
59
|
+
/** Callback al cancelar */
|
|
60
|
+
onCancel?: () => void;
|
|
61
|
+
/** Callback que se ejecuta cuando cambia cualquier valor del formulario (en tiempo real) */
|
|
62
|
+
onChange?: (data: Record<string, unknown>) => void;
|
|
63
|
+
/** Esquema de validación Yup (OBLIGATORIO) */
|
|
64
|
+
validationSchema: unknown;
|
|
65
|
+
/** Modo del formulario */
|
|
66
|
+
mode?: 'create' | 'edit' | 'view';
|
|
67
|
+
/** Mostrar botones de submit y cancel */
|
|
68
|
+
showActions?: boolean;
|
|
69
|
+
/** Texto del botón submit */
|
|
70
|
+
submitText?: string;
|
|
71
|
+
/** Texto del botón cancel */
|
|
72
|
+
cancelText?: string;
|
|
73
|
+
/** Estado de loading al enviar */
|
|
74
|
+
loading?: boolean;
|
|
75
|
+
/** Deshabilitar todo el formulario */
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
/** Layout de columnas (1, 2, 3, etc.) */
|
|
78
|
+
columns?: 1 | 2 | 3 | 4;
|
|
79
|
+
/** Espaciado entre campos */
|
|
80
|
+
spacing?: 'small' | 'medium' | 'large';
|
|
81
|
+
/** Instancia de react-hook-form (opcional, para control externo) */
|
|
82
|
+
formInstance?: UseFormReturn;
|
|
83
|
+
/** Clase CSS adicional */
|
|
84
|
+
className?: string;
|
|
85
|
+
/** Test ID */
|
|
86
|
+
'data-testid'?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Props internas para el FieldRenderer
|
|
90
|
+
*/
|
|
91
|
+
export interface FieldRendererProps {
|
|
92
|
+
field: FormFieldConfig;
|
|
93
|
+
control: Control<FieldValues>;
|
|
94
|
+
mode: 'create' | 'edit' | 'view';
|
|
95
|
+
disabled: boolean;
|
|
96
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { UseFormReturn, Control, FieldValues } from 'react-hook-form';
|
|
2
|
+
/**
|
|
3
|
+
* Tipos de moléculas soportadas por DynamicForm
|
|
4
|
+
*/
|
|
5
|
+
export type MoleculeType = 'INPUT' | 'INPUT_NUMBER' | 'INPUT_EMAIL' | 'INPUT_PASSWORD' | 'INPUT_PHONE' | 'INPUT_CURRENCY' | 'TEXTAREA' | 'SELECT' | 'SELECT_MULTI' | 'DATE_INPUT' | 'TIME_INPUT' | 'DATETIME_INPUT' | 'CHECKBOX' | 'SWITCH' | 'RADIO_GROUP' | 'CUSTOM';
|
|
6
|
+
/**
|
|
7
|
+
* Opción para Select, Select Multi, Radio Group
|
|
8
|
+
*/
|
|
9
|
+
export interface SelectOption {
|
|
10
|
+
value: string | number;
|
|
11
|
+
label: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Configuración de un campo del formulario
|
|
16
|
+
*/
|
|
17
|
+
export interface FormFieldConfig {
|
|
18
|
+
/** Key del campo (debe coincidir con la key en defaultValues) */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Label del campo */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Tipo de molécula a renderizar (OBLIGATORIO) */
|
|
23
|
+
moleculeType: MoleculeType;
|
|
24
|
+
/** Si el campo es requerido */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** Si el campo es de solo lectura */
|
|
27
|
+
readOnly?: boolean;
|
|
28
|
+
/** Placeholder del campo */
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
/** Descripción o help text del campo */
|
|
31
|
+
description?: string;
|
|
32
|
+
/** Valor por defecto */
|
|
33
|
+
defaultValue?: unknown;
|
|
34
|
+
/** Ancho del campo en el grid (1-12) */
|
|
35
|
+
gridSpan?: number;
|
|
36
|
+
/** Props específicas de la molécula */
|
|
37
|
+
uiProps?: Record<string, unknown>;
|
|
38
|
+
/** Función de transformación al enviar */
|
|
39
|
+
transformOnSubmit?: (value: unknown) => unknown;
|
|
40
|
+
/** Función de transformación al recibir */
|
|
41
|
+
transformOnReceive?: (value: unknown) => unknown;
|
|
42
|
+
/** Condición para mostrar el campo (dependencia de otros campos) */
|
|
43
|
+
showIf?: (formValues: Record<string, unknown>) => boolean;
|
|
44
|
+
/** Opciones para SELECT, SELECT_MULTI */
|
|
45
|
+
options?: SelectOption[];
|
|
46
|
+
/** Orden de renderizado */
|
|
47
|
+
order?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Props del componente DynamicForm
|
|
51
|
+
*/
|
|
52
|
+
export interface DynamicFormProps {
|
|
53
|
+
/** Configuración de campos del formulario */
|
|
54
|
+
fields: FormFieldConfig[];
|
|
55
|
+
/** Valores iniciales del formulario */
|
|
56
|
+
defaultValues?: Record<string, unknown>;
|
|
57
|
+
/** Callback al enviar el formulario (después de validación) */
|
|
58
|
+
onSubmit: (data: Record<string, unknown>) => void | Promise<void>;
|
|
59
|
+
/** Callback al cancelar */
|
|
60
|
+
onCancel?: () => void;
|
|
61
|
+
/** Callback que se ejecuta cuando cambia cualquier valor del formulario (en tiempo real) */
|
|
62
|
+
onChange?: (data: Record<string, unknown>) => void;
|
|
63
|
+
/** Esquema de validación Yup (OBLIGATORIO) */
|
|
64
|
+
validationSchema: unknown;
|
|
65
|
+
/** Modo del formulario */
|
|
66
|
+
mode?: 'create' | 'edit' | 'view';
|
|
67
|
+
/** Mostrar botones de submit y cancel */
|
|
68
|
+
showActions?: boolean;
|
|
69
|
+
/** Texto del botón submit */
|
|
70
|
+
submitText?: string;
|
|
71
|
+
/** Texto del botón cancel */
|
|
72
|
+
cancelText?: string;
|
|
73
|
+
/** Estado de loading al enviar */
|
|
74
|
+
loading?: boolean;
|
|
75
|
+
/** Deshabilitar todo el formulario */
|
|
76
|
+
disabled?: boolean;
|
|
77
|
+
/** Layout de columnas (1, 2, 3, etc.) */
|
|
78
|
+
columns?: 1 | 2 | 3 | 4;
|
|
79
|
+
/** Espaciado entre campos */
|
|
80
|
+
spacing?: 'small' | 'medium' | 'large';
|
|
81
|
+
/** Instancia de react-hook-form (opcional, para control externo) */
|
|
82
|
+
formInstance?: UseFormReturn;
|
|
83
|
+
/** Clase CSS adicional */
|
|
84
|
+
className?: string;
|
|
85
|
+
/** Test ID */
|
|
86
|
+
'data-testid'?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Props internas para el FieldRenderer
|
|
90
|
+
*/
|
|
91
|
+
export interface FieldRendererProps {
|
|
92
|
+
field: FormFieldConfig;
|
|
93
|
+
control: Control<FieldValues>;
|
|
94
|
+
mode: 'create' | 'edit' | 'view';
|
|
95
|
+
disabled: boolean;
|
|
96
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { FormFieldConfig } from "../DynamicForm/types";
|
|
3
|
+
/**
|
|
4
|
+
* Modo del FormDrawer
|
|
5
|
+
*/
|
|
6
|
+
export type FormDrawerMode = "create" | "edit" | "view";
|
|
7
|
+
/**
|
|
8
|
+
* Props del componente FormDrawer
|
|
9
|
+
*/
|
|
10
|
+
export interface FormDrawerProps {
|
|
11
|
+
/** Si el drawer está abierto */
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
/** Callback al cerrar el drawer */
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
/** Modo del formulario */
|
|
16
|
+
mode: FormDrawerMode;
|
|
17
|
+
/** Configuración de campos del formulario */
|
|
18
|
+
fields: FormFieldConfig[];
|
|
19
|
+
/** Valores iniciales del formulario */
|
|
20
|
+
defaultValues?: Record<string, unknown>;
|
|
21
|
+
/** Callback al enviar el formulario */
|
|
22
|
+
onSubmit: (data: Record<string, unknown>) => void | Promise<void>;
|
|
23
|
+
/** Callback que se ejecuta cuando cambia cualquier valor del formulario (en tiempo real) */
|
|
24
|
+
onChange?: (data: Record<string, unknown>) => void;
|
|
25
|
+
/** Esquema de validación Yup */
|
|
26
|
+
validationSchema: unknown;
|
|
27
|
+
/** Título del drawer */
|
|
28
|
+
title?: string;
|
|
29
|
+
/** Subtítulo o descripción */
|
|
30
|
+
subtitle?: string;
|
|
31
|
+
/** Estado de loading al enviar */
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
/** Ancho del drawer */
|
|
34
|
+
width?: number | string;
|
|
35
|
+
/** Texto del botón submit */
|
|
36
|
+
submitText?: string;
|
|
37
|
+
/** Texto del botón cancel */
|
|
38
|
+
cancelText?: string;
|
|
39
|
+
/** Layout de columnas del formulario */
|
|
40
|
+
columns?: 1 | 2 | 3 | 4;
|
|
41
|
+
/** Espaciado entre campos */
|
|
42
|
+
spacing?: "small" | "medium" | "large";
|
|
43
|
+
/** Tamaño de los campos del formulario */
|
|
44
|
+
fieldSize?: "small" | "medium" | "large";
|
|
45
|
+
/** Contenido adicional en el footer (además de los botones) */
|
|
46
|
+
footerExtra?: ReactNode;
|
|
47
|
+
/** Cerrar drawer al hacer clic en overlay (default: true) */
|
|
48
|
+
closeOnOverlayClick?: boolean;
|
|
49
|
+
/** Cerrar drawer al presionar Escape (default: true) */
|
|
50
|
+
closeOnEscape?: boolean;
|
|
51
|
+
/** Callback cuando se intenta cerrar (puede prevenir el cierre) */
|
|
52
|
+
onBeforeClose?: () => boolean | Promise<boolean>;
|
|
53
|
+
/** Clase CSS adicional */
|
|
54
|
+
className?: string;
|
|
55
|
+
/** Test ID */
|
|
56
|
+
"data-testid"?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Títulos por defecto según el modo
|
|
60
|
+
*/
|
|
61
|
+
export declare const DEFAULT_TITLES: Record<FormDrawerMode, string>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { FormFieldConfig } from "../DynamicForm/types";
|
|
3
|
+
/**
|
|
4
|
+
* Modo del FormDrawer
|
|
5
|
+
*/
|
|
6
|
+
export type FormDrawerMode = "create" | "edit" | "view";
|
|
7
|
+
/**
|
|
8
|
+
* Props del componente FormDrawer
|
|
9
|
+
*/
|
|
10
|
+
export interface FormDrawerProps {
|
|
11
|
+
/** Si el drawer está abierto */
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
/** Callback al cerrar el drawer */
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
/** Modo del formulario */
|
|
16
|
+
mode: FormDrawerMode;
|
|
17
|
+
/** Configuración de campos del formulario */
|
|
18
|
+
fields: FormFieldConfig[];
|
|
19
|
+
/** Valores iniciales del formulario */
|
|
20
|
+
defaultValues?: Record<string, unknown>;
|
|
21
|
+
/** Callback al enviar el formulario */
|
|
22
|
+
onSubmit: (data: Record<string, unknown>) => void | Promise<void>;
|
|
23
|
+
/** Callback que se ejecuta cuando cambia cualquier valor del formulario (en tiempo real) */
|
|
24
|
+
onChange?: (data: Record<string, unknown>) => void;
|
|
25
|
+
/** Esquema de validación Yup */
|
|
26
|
+
validationSchema: unknown;
|
|
27
|
+
/** Título del drawer */
|
|
28
|
+
title?: string;
|
|
29
|
+
/** Subtítulo o descripción */
|
|
30
|
+
subtitle?: string;
|
|
31
|
+
/** Estado de loading al enviar */
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
/** Ancho del drawer */
|
|
34
|
+
width?: number | string;
|
|
35
|
+
/** Texto del botón submit */
|
|
36
|
+
submitText?: string;
|
|
37
|
+
/** Texto del botón cancel */
|
|
38
|
+
cancelText?: string;
|
|
39
|
+
/** Layout de columnas del formulario */
|
|
40
|
+
columns?: 1 | 2 | 3 | 4;
|
|
41
|
+
/** Espaciado entre campos */
|
|
42
|
+
spacing?: "small" | "medium" | "large";
|
|
43
|
+
/** Tamaño de los campos del formulario */
|
|
44
|
+
fieldSize?: "small" | "medium" | "large";
|
|
45
|
+
/** Contenido adicional en el footer (además de los botones) */
|
|
46
|
+
footerExtra?: ReactNode;
|
|
47
|
+
/** Cerrar drawer al hacer clic en overlay (default: true) */
|
|
48
|
+
closeOnOverlayClick?: boolean;
|
|
49
|
+
/** Cerrar drawer al presionar Escape (default: true) */
|
|
50
|
+
closeOnEscape?: boolean;
|
|
51
|
+
/** Callback cuando se intenta cerrar (puede prevenir el cierre) */
|
|
52
|
+
onBeforeClose?: () => boolean | Promise<boolean>;
|
|
53
|
+
/** Clase CSS adicional */
|
|
54
|
+
className?: string;
|
|
55
|
+
/** Test ID */
|
|
56
|
+
"data-testid"?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Títulos por defecto según el modo
|
|
60
|
+
*/
|
|
61
|
+
export declare const DEFAULT_TITLES: Record<FormDrawerMode, string>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type StepStatus = 'pending' | 'active' | 'completed' | 'error';
|
|
3
|
+
export interface StepConfig {
|
|
4
|
+
/** Identificador único del paso */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Título del paso (opcional, se muestra en tooltip) */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Descripción del paso (opcional) */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Icono personalizado para el paso (opcional) */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** Si el paso está deshabilitado */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Función de validación antes de avanzar al siguiente paso */
|
|
15
|
+
validate?: () => boolean | Promise<boolean>;
|
|
16
|
+
/** Callback cuando el paso se completa */
|
|
17
|
+
onComplete?: () => void;
|
|
18
|
+
}
|
|
19
|
+
export interface StepperProps {
|
|
20
|
+
/** Configuración de los pasos */
|
|
21
|
+
steps: StepConfig[];
|
|
22
|
+
/** Índice del paso actual (controlado) */
|
|
23
|
+
currentStep?: number;
|
|
24
|
+
/** Paso inicial (no controlado) */
|
|
25
|
+
defaultStep?: number;
|
|
26
|
+
/** Callback cuando cambia el paso */
|
|
27
|
+
onStepChange?: (stepIndex: number, stepId: string) => void;
|
|
28
|
+
/** Callback cuando se completan todos los pasos */
|
|
29
|
+
onComplete?: () => void;
|
|
30
|
+
/** Callback cuando se cancela el flujo */
|
|
31
|
+
onCancel?: () => void;
|
|
32
|
+
/** Contenido de cada paso (children como función o array) */
|
|
33
|
+
children: ReactNode | ((step: StepConfig, index: number) => ReactNode);
|
|
34
|
+
/** Orientación del stepper */
|
|
35
|
+
orientation?: 'horizontal' | 'vertical';
|
|
36
|
+
/** Tamaño de los indicadores */
|
|
37
|
+
size?: 'small' | 'medium' | 'large';
|
|
38
|
+
/** Variante de los indicadores */
|
|
39
|
+
variant?: 'circle' | 'dot' | 'number';
|
|
40
|
+
/** Si se permite navegación libre entre pasos completados */
|
|
41
|
+
allowNavigation?: boolean;
|
|
42
|
+
/** Si se muestra la línea conectora entre pasos */
|
|
43
|
+
showConnector?: boolean;
|
|
44
|
+
/** Texto del botón anterior */
|
|
45
|
+
prevButtonText?: string;
|
|
46
|
+
/** Texto del botón siguiente */
|
|
47
|
+
nextButtonText?: string;
|
|
48
|
+
/** Texto del botón finalizar */
|
|
49
|
+
finishButtonText?: string;
|
|
50
|
+
/** Texto del botón cancelar */
|
|
51
|
+
cancelButtonText?: string;
|
|
52
|
+
/** Si se muestra el botón cancelar */
|
|
53
|
+
showCancelButton?: boolean;
|
|
54
|
+
/** Si se ocultan los botones de navegación */
|
|
55
|
+
hideNavigation?: boolean;
|
|
56
|
+
/** Renderizado personalizado del header */
|
|
57
|
+
renderHeader?: (props: StepperHeaderRenderProps) => ReactNode;
|
|
58
|
+
/** Renderizado personalizado del footer */
|
|
59
|
+
renderFooter?: (props: StepperFooterRenderProps) => ReactNode;
|
|
60
|
+
/** Clase CSS adicional */
|
|
61
|
+
className?: string;
|
|
62
|
+
/** Si está cargando (deshabilita navegación) */
|
|
63
|
+
loading?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface StepperHeaderRenderProps {
|
|
66
|
+
steps: StepConfig[];
|
|
67
|
+
currentStep: number;
|
|
68
|
+
goToStep: (index: number) => void;
|
|
69
|
+
getStepStatus: (index: number) => StepStatus;
|
|
70
|
+
}
|
|
71
|
+
export interface StepperFooterRenderProps {
|
|
72
|
+
currentStep: number;
|
|
73
|
+
totalSteps: number;
|
|
74
|
+
isFirstStep: boolean;
|
|
75
|
+
isLastStep: boolean;
|
|
76
|
+
canGoNext: boolean;
|
|
77
|
+
canGoPrev: boolean;
|
|
78
|
+
goNext: () => void;
|
|
79
|
+
goPrev: () => void;
|
|
80
|
+
goToStep: (index: number) => void;
|
|
81
|
+
finish: () => void;
|
|
82
|
+
cancel: () => void;
|
|
83
|
+
loading: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface StepIndicatorProps {
|
|
86
|
+
step: StepConfig;
|
|
87
|
+
index: number;
|
|
88
|
+
status: StepStatus;
|
|
89
|
+
size: 'small' | 'medium' | 'large';
|
|
90
|
+
variant: 'circle' | 'dot' | 'number';
|
|
91
|
+
onClick?: () => void;
|
|
92
|
+
isClickable: boolean;
|
|
93
|
+
showConnector: boolean;
|
|
94
|
+
isLast: boolean;
|
|
95
|
+
orientation: 'horizontal' | 'vertical';
|
|
96
|
+
}
|