siesa-ui-kit 1.0.113 → 1.0.116
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/ButtonGroup/ButtonGroup.d.ts +53 -0
- package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
- package/dist/components/ButtonGroup/ButtonGroup.types.d.ts +82 -0
- package/dist/components/ButtonGroup/ButtonGroup.types.d.ts.map +1 -0
- package/dist/components/ButtonGroup/index.d.ts +3 -0
- package/dist/components/ButtonGroup/index.d.ts.map +1 -0
- package/dist/components/MasterDocument/ActionBar.d.ts +12 -0
- package/dist/components/MasterDocument/ActionBar.d.ts.map +1 -0
- package/dist/components/MasterDocument/ApprovalBanner.d.ts +3 -0
- package/dist/components/MasterDocument/ApprovalBanner.d.ts.map +1 -0
- package/dist/components/MasterDocument/ConflictModal.d.ts +24 -0
- package/dist/components/MasterDocument/ConflictModal.d.ts.map +1 -0
- package/dist/components/MasterDocument/ContentLayout.d.ts +9 -0
- package/dist/components/MasterDocument/ContentLayout.d.ts.map +1 -0
- package/dist/components/MasterDocument/ContextStrip.d.ts +9 -0
- package/dist/components/MasterDocument/ContextStrip.d.ts.map +1 -0
- package/dist/components/MasterDocument/DocumentCreationWizard.d.ts +25 -0
- package/dist/components/MasterDocument/DocumentCreationWizard.d.ts.map +1 -0
- package/dist/components/MasterDocument/DocumentList.d.ts +30 -0
- package/dist/components/MasterDocument/DocumentList.d.ts.map +1 -0
- package/dist/components/MasterDocument/FactBox.d.ts +30 -0
- package/dist/components/MasterDocument/FactBox.d.ts.map +1 -0
- package/dist/components/MasterDocument/FactBoxCfde.d.ts +22 -0
- package/dist/components/MasterDocument/FactBoxCfde.d.ts.map +1 -0
- package/dist/components/MasterDocument/FactBoxFinancial.d.ts +23 -0
- package/dist/components/MasterDocument/FactBoxFinancial.d.ts.map +1 -0
- package/dist/components/MasterDocument/FactBoxPaymentTerms.d.ts +30 -0
- package/dist/components/MasterDocument/FactBoxPaymentTerms.d.ts.map +1 -0
- package/dist/components/MasterDocument/FactBoxTotals.d.ts +23 -0
- package/dist/components/MasterDocument/FactBoxTotals.d.ts.map +1 -0
- package/dist/components/MasterDocument/FieldRenderer.d.ts +23 -0
- package/dist/components/MasterDocument/FieldRenderer.d.ts.map +1 -0
- package/dist/components/MasterDocument/GlobalDiscountControl.d.ts +25 -0
- package/dist/components/MasterDocument/GlobalDiscountControl.d.ts.map +1 -0
- package/dist/components/MasterDocument/HeaderRenderer.d.ts +27 -0
- package/dist/components/MasterDocument/HeaderRenderer.d.ts.map +1 -0
- package/dist/components/MasterDocument/LineContextMenu.d.ts +10 -0
- package/dist/components/MasterDocument/LineContextMenu.d.ts.map +1 -0
- package/dist/components/MasterDocument/LineFormModal.d.ts +26 -0
- package/dist/components/MasterDocument/LineFormModal.d.ts.map +1 -0
- package/dist/components/MasterDocument/LinesSection.d.ts +26 -0
- package/dist/components/MasterDocument/LinesSection.d.ts.map +1 -0
- package/dist/components/MasterDocument/MasterDocument.d.ts +19 -24
- package/dist/components/MasterDocument/MasterDocument.d.ts.map +1 -1
- package/dist/components/MasterDocument/MasterDocument.types.d.ts +483 -304
- package/dist/components/MasterDocument/MasterDocument.types.d.ts.map +1 -1
- package/dist/components/MasterDocument/Skeletons.d.ts +21 -0
- package/dist/components/MasterDocument/Skeletons.d.ts.map +1 -0
- package/dist/components/MasterDocument/StateBadge.d.ts +17 -0
- package/dist/components/MasterDocument/StateBadge.d.ts.map +1 -0
- package/dist/components/MasterDocument/adapter/ApiService.types.d.ts +43 -0
- package/dist/components/MasterDocument/adapter/ApiService.types.d.ts.map +1 -0
- package/dist/components/MasterDocument/adapter/MasterDocumentAdapter.types.d.ts +90 -0
- package/dist/components/MasterDocument/adapter/MasterDocumentAdapter.types.d.ts.map +1 -0
- package/dist/components/MasterDocument/adapter/createDefaultAdapter.d.ts +26 -0
- package/dist/components/MasterDocument/adapter/createDefaultAdapter.d.ts.map +1 -0
- package/dist/components/MasterDocument/icons.d.ts +3 -3
- package/dist/components/MasterDocument/icons.d.ts.map +1 -1
- package/dist/components/MasterDocument/index.d.ts +30 -6
- package/dist/components/MasterDocument/index.d.ts.map +1 -1
- package/dist/components/MasterDocument/provider/MasterDocumentProvider.d.ts +36 -0
- package/dist/components/MasterDocument/provider/MasterDocumentProvider.d.ts.map +1 -0
- package/dist/components/MasterDocument/provider/iconRegistry.d.ts +4 -0
- package/dist/components/MasterDocument/provider/iconRegistry.d.ts.map +1 -0
- package/dist/components/MasterDocument/smart/SmartMasterDocument.d.ts +27 -0
- package/dist/components/MasterDocument/smart/SmartMasterDocument.d.ts.map +1 -0
- package/dist/components/MasterDocument/smart/factBoxBuilder.d.ts +5 -0
- package/dist/components/MasterDocument/smart/factBoxBuilder.d.ts.map +1 -0
- package/dist/components/MasterDocument/smart/useConflictDetection.d.ts +6 -0
- package/dist/components/MasterDocument/smart/useConflictDetection.d.ts.map +1 -0
- package/dist/components/MasterDocument/smart/useFactBoxData.d.ts +9 -0
- package/dist/components/MasterDocument/smart/useFactBoxData.d.ts.map +1 -0
- package/dist/components/MasterDocument/smart/useMasterDocumentReducer.d.ts +65 -0
- package/dist/components/MasterDocument/smart/useMasterDocumentReducer.d.ts.map +1 -0
- package/dist/components/MasterDocument/template/MasterDocumentTemplate.types.d.ts +278 -0
- package/dist/components/MasterDocument/template/MasterDocumentTemplate.types.d.ts.map +1 -0
- package/dist/components/MasterDocument/template/expressionEvaluator.d.ts +5 -0
- package/dist/components/MasterDocument/template/expressionEvaluator.d.ts.map +1 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/siesa-ui-kit.cjs +168 -165
- package/dist/siesa-ui-kit.cjs.map +1 -1
- package/dist/siesa-ui-kit.mjs +24631 -21017
- package/dist/siesa-ui-kit.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +10 -9
- package/dist/components/MasterDocument/MasterDocumentDetail.d.ts +0 -12
- package/dist/components/MasterDocument/MasterDocumentDetail.d.ts.map +0 -1
- package/dist/components/MasterDocument/MasterDocumentFormModal.d.ts +0 -31
- package/dist/components/MasterDocument/MasterDocumentFormModal.d.ts.map +0 -1
- package/dist/components/MasterDocument/MasterDocumentHeaderSections.d.ts +0 -13
- package/dist/components/MasterDocument/MasterDocumentHeaderSections.d.ts.map +0 -1
- package/dist/components/MasterDocument/MasterDocumentToolbar.d.ts +0 -13
- package/dist/components/MasterDocument/MasterDocumentToolbar.d.ts.map +0 -1
- package/dist/components/MasterDocument/MasterDocumentTotals.d.ts +0 -11
- package/dist/components/MasterDocument/MasterDocumentTotals.d.ts.map +0 -1
|
@@ -1,339 +1,518 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
* - 'display': Solo lectura (presentación)
|
|
15
|
-
*/
|
|
16
|
-
export type MasterDocumentFieldType = 'text' | 'number' | 'currency' | 'percentage' | 'date' | 'select' | 'autocomplete' | 'checkbox' | 'textarea' | 'display';
|
|
17
|
-
/**
|
|
18
|
-
* Contexto donde se usa el campo dentro del documento
|
|
19
|
-
*/
|
|
20
|
-
export type MasterDocumentFieldContext = 'header' | 'line' | 'line-detail';
|
|
21
|
-
/**
|
|
22
|
-
* Grupo del documento para clasificación
|
|
23
|
-
*/
|
|
24
|
-
export type MasterDocumentGroup = 'PURCHASES' | 'SALES' | 'INVENTORY';
|
|
25
|
-
/**
|
|
26
|
-
* Layout de ítems permitidos en el detalle
|
|
27
|
-
*/
|
|
28
|
-
export type MasterDocumentItemLayout = 'PRODUCTS_ONLY' | 'SERVICES_ONLY' | 'MIXED';
|
|
29
|
-
/**
|
|
30
|
-
* Variantes de estilo para botones de acción
|
|
31
|
-
*/
|
|
32
|
-
export type MasterDocumentActionVariant = 'primary' | 'secondary' | 'danger' | 'ghost';
|
|
33
|
-
/**
|
|
34
|
-
* Formato de columna en la grilla de detalle
|
|
35
|
-
*/
|
|
36
|
-
export type MasterDocumentColumnFormat = 'currency' | 'number' | 'text';
|
|
37
|
-
/**
|
|
38
|
-
* Función de agregación para columnas
|
|
39
|
-
*/
|
|
40
|
-
export type MasterDocumentColumnAggregate = 'sum' | 'count';
|
|
41
|
-
/**
|
|
42
|
-
* Alineación de columna
|
|
43
|
-
*/
|
|
44
|
-
export type MasterDocumentColumnAlign = 'left' | 'center' | 'right';
|
|
45
|
-
/**
|
|
46
|
-
* Opción para campos de tipo 'select'
|
|
47
|
-
*/
|
|
48
|
-
export interface MasterDocumentSelectOption {
|
|
2
|
+
export type ControlType = 'text' | 'number' | 'currency' | 'percentage' | 'date' | 'select' | 'searcher' | 'autocomplete' | 'readonly' | 'textarea' | 'toggle' | 'checkbox' | 'display';
|
|
3
|
+
export type FieldContext = 'header' | 'line' | 'line-detail';
|
|
4
|
+
export type DocumentGroup = 'PURCHASES' | 'SALES' | 'INVENTORY';
|
|
5
|
+
export type ItemLayout = 'PRODUCTS_ONLY' | 'SERVICES_ONLY' | 'MIXED';
|
|
6
|
+
export type ActionVariant = 'primary' | 'secondary' | 'danger' | 'ghost';
|
|
7
|
+
export type ColumnFormat = 'currency' | 'number' | 'percentage' | 'text' | 'date';
|
|
8
|
+
export type ColumnAlign = 'left' | 'center' | 'right';
|
|
9
|
+
export type ColumnAggregate = 'sum' | 'count';
|
|
10
|
+
export type HeaderMode = 'accordion' | 'tabs';
|
|
11
|
+
export type Breakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
12
|
+
export type ValidationSeverity = 'error' | 'warning';
|
|
13
|
+
export interface SelectOption {
|
|
49
14
|
label: string;
|
|
50
15
|
value: string | number;
|
|
51
16
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
17
|
+
export interface ValidationRule {
|
|
18
|
+
type: 'required' | 'min' | 'max' | 'minLength' | 'maxLength' | 'pattern' | 'custom';
|
|
19
|
+
value?: unknown;
|
|
20
|
+
message: string;
|
|
21
|
+
severity: ValidationSeverity;
|
|
22
|
+
}
|
|
23
|
+
export interface FieldDescriptor {
|
|
24
|
+
key: string;
|
|
25
|
+
section: string;
|
|
26
|
+
span: 1 | 2 | 3 | 4;
|
|
27
|
+
order: number;
|
|
28
|
+
control: ControlType;
|
|
60
29
|
label: string;
|
|
61
|
-
|
|
62
|
-
type: MasterDocumentFieldType;
|
|
63
|
-
/** Si es obligatorio */
|
|
30
|
+
placeholder?: string;
|
|
64
31
|
required?: boolean;
|
|
65
|
-
|
|
66
|
-
readonly?: boolean;
|
|
67
|
-
/** Si está oculto */
|
|
68
|
-
hidden?: boolean;
|
|
69
|
-
/** Valor por defecto */
|
|
70
|
-
defaultValue?: string | number | boolean;
|
|
71
|
-
/** Opciones para tipo 'select' */
|
|
72
|
-
options?: MasterDocumentSelectOption[];
|
|
73
|
-
/** Configuración para tipo 'autocomplete' */
|
|
32
|
+
options?: SelectOption[];
|
|
74
33
|
lookup?: Record<string, unknown>;
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
export interface
|
|
83
|
-
document_number: string;
|
|
84
|
-
document_date: string;
|
|
85
|
-
state_id: string;
|
|
86
|
-
company_id: string;
|
|
87
|
-
operation_center_id: string;
|
|
88
|
-
partner_name_snapshot: string;
|
|
89
|
-
currency_code_snapshot: string;
|
|
90
|
-
grand_total: number;
|
|
91
|
-
[key: string]: string | number | boolean | null | undefined;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Línea de detalle del documento (Tabla T2).
|
|
95
|
-
* Cada línea representa un ítem/producto/servicio.
|
|
96
|
-
*/
|
|
97
|
-
export interface MasterDocumentLine {
|
|
98
|
-
line_number: number;
|
|
99
|
-
item_code_snapshot: string;
|
|
100
|
-
item_name_snapshot: string;
|
|
101
|
-
quantity_base: number;
|
|
102
|
-
unit_price: number;
|
|
103
|
-
net_total: number;
|
|
104
|
-
[key: string]: string | number | boolean | null | undefined;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Campo dentro de una sección de cabecera
|
|
108
|
-
*/
|
|
109
|
-
export interface HeaderSectionField {
|
|
110
|
-
/** Clave del campo (referencia a MasterDocumentField.id) */
|
|
34
|
+
defaultValue?: unknown;
|
|
35
|
+
editableOn: string[];
|
|
36
|
+
visibleOn: string[];
|
|
37
|
+
validations: ValidationRule[];
|
|
38
|
+
context: FieldContext;
|
|
39
|
+
hideOnBreakpoints?: Breakpoint[];
|
|
40
|
+
}
|
|
41
|
+
export interface SectionConfig {
|
|
111
42
|
key: string;
|
|
112
|
-
/** Etiqueta visible */
|
|
113
|
-
label: string;
|
|
114
|
-
/** Columnas que ocupa (1-4) */
|
|
115
|
-
colSpan?: number;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* Sección de la cabecera del documento
|
|
119
|
-
*/
|
|
120
|
-
export interface HeaderSection {
|
|
121
|
-
/** ID único de la sección */
|
|
122
|
-
id: string;
|
|
123
|
-
/** Título de la sección */
|
|
124
43
|
label: string;
|
|
125
|
-
|
|
44
|
+
subtitle?: string;
|
|
45
|
+
defaultOpen: boolean;
|
|
46
|
+
accent?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface HeaderLayoutConfig {
|
|
49
|
+
mode: HeaderMode;
|
|
126
50
|
columns: 1 | 2 | 3 | 4;
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Layout de la cabecera: organiza campos en secciones y rejillas
|
|
132
|
-
*/
|
|
133
|
-
export interface HeaderLayoutDefinition {
|
|
134
|
-
sections: HeaderSection[];
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Columna de la grilla de detalle
|
|
138
|
-
*/
|
|
139
|
-
export interface DetailColumn {
|
|
140
|
-
/** Clave del campo (referencia a MasterDocumentLine key) */
|
|
51
|
+
sections: SectionConfig[];
|
|
52
|
+
}
|
|
53
|
+
export interface LineColumnConfig {
|
|
141
54
|
key: string;
|
|
142
|
-
/** Texto del encabezado */
|
|
143
55
|
header: string;
|
|
144
|
-
/** Ancho de la columna (CSS) */
|
|
145
56
|
width?: string;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
export interface
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
57
|
+
align?: ColumnAlign;
|
|
58
|
+
format?: ColumnFormat;
|
|
59
|
+
aggregate?: ColumnAggregate;
|
|
60
|
+
hideOn?: Breakpoint[];
|
|
61
|
+
showInCard?: boolean;
|
|
62
|
+
}
|
|
63
|
+
export interface DetailLayoutConfig {
|
|
64
|
+
mode: HeaderMode;
|
|
65
|
+
columns: LineColumnConfig[];
|
|
66
|
+
}
|
|
67
|
+
export interface LayoutConfig {
|
|
68
|
+
header: HeaderLayoutConfig;
|
|
69
|
+
detail: DetailLayoutConfig;
|
|
70
|
+
itemLayout: ItemLayout;
|
|
71
|
+
}
|
|
72
|
+
export interface StateBadgeConfig {
|
|
73
|
+
label: string;
|
|
74
|
+
bg: string;
|
|
75
|
+
color: string;
|
|
76
|
+
}
|
|
77
|
+
export interface TransitionConfig {
|
|
78
|
+
to: string;
|
|
79
|
+
label: string;
|
|
80
|
+
icon?: ReactNode;
|
|
81
|
+
style: ActionVariant;
|
|
82
|
+
hasGuard?: boolean;
|
|
83
|
+
shortcut?: string;
|
|
84
|
+
disabled?: boolean;
|
|
85
|
+
loading?: boolean;
|
|
86
|
+
}
|
|
87
|
+
export interface ActionConfig {
|
|
88
|
+
key: string;
|
|
89
|
+
label: string;
|
|
90
|
+
icon?: ReactNode;
|
|
91
|
+
variant?: ActionVariant;
|
|
92
|
+
onClick: () => void;
|
|
93
|
+
disabled?: boolean;
|
|
94
|
+
visibleOn?: string[];
|
|
95
|
+
position?: 'actionBar' | 'moreMenu';
|
|
96
|
+
}
|
|
97
|
+
export interface FactBoxSectionConfig {
|
|
98
|
+
key: string;
|
|
99
|
+
label: string;
|
|
100
|
+
defaultOpen: boolean;
|
|
101
|
+
badge?: ReactNode;
|
|
102
|
+
children: ReactNode;
|
|
103
|
+
}
|
|
104
|
+
export interface TotalItem {
|
|
105
|
+
key: string;
|
|
106
|
+
label: string;
|
|
107
|
+
value: string | number;
|
|
108
|
+
highlight?: boolean;
|
|
109
|
+
color?: string;
|
|
110
|
+
}
|
|
111
|
+
export type CfdeStatus = 'PENDING' | 'SENT' | 'ACCEPTED' | 'REJECTED' | 'ERROR';
|
|
112
|
+
export interface CfdeData {
|
|
113
|
+
status: CfdeStatus;
|
|
114
|
+
number?: string;
|
|
115
|
+
cufe?: string;
|
|
116
|
+
issueDate?: string;
|
|
117
|
+
qrUrl?: string;
|
|
118
|
+
printCount?: number;
|
|
119
|
+
isTransmitted?: boolean;
|
|
120
|
+
}
|
|
121
|
+
export type PeriodMode = 'days' | 'months' | 'custom';
|
|
122
|
+
export interface PaymentTermsData {
|
|
123
|
+
code: string;
|
|
165
124
|
name: string;
|
|
166
|
-
|
|
125
|
+
installmentCount: number;
|
|
126
|
+
periodMode: PeriodMode;
|
|
127
|
+
dueDays: number;
|
|
128
|
+
earlyPaymentEnabled?: boolean;
|
|
129
|
+
earlyPaymentDays?: number;
|
|
130
|
+
earlyPaymentDiscountPct?: number;
|
|
131
|
+
advancePaymentPct?: number;
|
|
132
|
+
advancePaymentAmount?: number;
|
|
133
|
+
}
|
|
134
|
+
export interface FinancialData {
|
|
135
|
+
receivableAmount?: number;
|
|
136
|
+
payableAmount?: number;
|
|
137
|
+
advanceAmount?: number;
|
|
138
|
+
cashAmount?: number;
|
|
139
|
+
receivableAmountLocal?: number;
|
|
140
|
+
payableAmountLocal?: number;
|
|
141
|
+
currencyCode?: string;
|
|
142
|
+
}
|
|
143
|
+
export type DiscountMode = 'percentage' | 'amount';
|
|
144
|
+
export interface GlobalDiscountData {
|
|
145
|
+
mode: DiscountMode;
|
|
146
|
+
percentage?: number;
|
|
147
|
+
amount?: number;
|
|
148
|
+
}
|
|
149
|
+
export interface DocumentHeaderData {
|
|
150
|
+
[key: string]: unknown;
|
|
151
|
+
}
|
|
152
|
+
export interface DocumentLineData {
|
|
153
|
+
id: string;
|
|
154
|
+
line_number: number;
|
|
155
|
+
[key: string]: unknown;
|
|
156
|
+
}
|
|
157
|
+
export interface ComputedRule {
|
|
158
|
+
targetField: string;
|
|
159
|
+
watch: string[];
|
|
160
|
+
compute: (formData: Record<string, unknown>) => unknown;
|
|
161
|
+
}
|
|
162
|
+
export interface FieldError {
|
|
163
|
+
message: string;
|
|
164
|
+
severity: ValidationSeverity;
|
|
165
|
+
}
|
|
166
|
+
export type FieldErrorMap = Record<string, FieldError>;
|
|
167
|
+
export interface EmptyStateConfig {
|
|
168
|
+
icon?: ReactNode;
|
|
169
|
+
title: string;
|
|
170
|
+
description?: string;
|
|
171
|
+
action?: {
|
|
172
|
+
label: string;
|
|
173
|
+
onClick: () => void;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
export interface ContextStripItem {
|
|
167
177
|
label: string;
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
label
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
178
|
+
value: string;
|
|
179
|
+
mono?: boolean;
|
|
180
|
+
accent?: boolean;
|
|
181
|
+
}
|
|
182
|
+
export interface DocumentListColumn {
|
|
183
|
+
key: string;
|
|
184
|
+
header: string;
|
|
185
|
+
align?: ColumnAlign;
|
|
186
|
+
render?: (row: Record<string, unknown>) => ReactNode;
|
|
187
|
+
mono?: boolean;
|
|
188
|
+
width?: string;
|
|
189
|
+
}
|
|
190
|
+
export interface FilterPill {
|
|
191
|
+
key: string;
|
|
192
|
+
label: string;
|
|
193
|
+
count?: number;
|
|
194
|
+
active?: boolean;
|
|
195
|
+
bg?: string;
|
|
196
|
+
color?: string;
|
|
197
|
+
}
|
|
198
|
+
export interface SearchField {
|
|
199
|
+
key: string;
|
|
200
|
+
label: string;
|
|
201
|
+
type: 'text' | 'date' | 'select';
|
|
202
|
+
options?: SelectOption[];
|
|
203
|
+
placeholder?: string;
|
|
204
|
+
}
|
|
205
|
+
export interface WizardOption {
|
|
206
|
+
id: string;
|
|
207
|
+
label: string;
|
|
208
|
+
description?: string;
|
|
209
|
+
icon?: ReactNode;
|
|
210
|
+
color?: string;
|
|
211
|
+
}
|
|
212
|
+
export interface ApprovalStep {
|
|
213
|
+
label: string;
|
|
214
|
+
status: 'completed' | 'current' | 'pending';
|
|
215
|
+
}
|
|
216
|
+
export interface ActionBarProps {
|
|
217
|
+
breadcrumbLabel: string;
|
|
218
|
+
onBreadcrumbClick: () => void;
|
|
219
|
+
documentId?: string;
|
|
220
|
+
stateBadge?: StateBadgeConfig;
|
|
221
|
+
docTypeBadge?: string;
|
|
222
|
+
transitions: TransitionConfig[];
|
|
223
|
+
onTransition: (to: string) => void;
|
|
224
|
+
actions: ActionConfig[];
|
|
225
|
+
onToggleFactBox?: () => void;
|
|
226
|
+
factBoxOpen?: boolean;
|
|
227
|
+
className?: string;
|
|
228
|
+
}
|
|
229
|
+
export interface ContextStripProps {
|
|
230
|
+
items: ContextStripItem[];
|
|
231
|
+
currencyPanel?: ReactNode;
|
|
232
|
+
className?: string;
|
|
233
|
+
}
|
|
234
|
+
export interface HeaderRendererProps {
|
|
235
|
+
mode: HeaderMode;
|
|
236
|
+
columns: 1 | 2 | 3 | 4;
|
|
237
|
+
sections: SectionConfig[];
|
|
238
|
+
fieldsBySection: Record<string, FieldDescriptor[]>;
|
|
239
|
+
values: DocumentHeaderData;
|
|
240
|
+
errors?: FieldErrorMap;
|
|
241
|
+
onFieldChange: (key: string, value: unknown) => void;
|
|
242
|
+
docState: string;
|
|
243
|
+
mode_form: 'create' | 'edit' | 'view';
|
|
244
|
+
className?: string;
|
|
245
|
+
/** Mapa de configs LookupField por key de campo searcher. */
|
|
246
|
+
lookupConfigs?: Record<string, LookupFieldConfig>;
|
|
247
|
+
/** Fetcher del adapter para campos searcher. */
|
|
248
|
+
fetcher?: unknown;
|
|
249
|
+
/** Callback cuando un LookupField selecciona un registro (para bindFields). */
|
|
250
|
+
onRecordSelect?: (fieldKey: string, record: Record<string, unknown> | null) => void;
|
|
251
|
+
}
|
|
252
|
+
export interface LinesSectionProps {
|
|
253
|
+
title: string;
|
|
254
|
+
lines: DocumentLineData[];
|
|
255
|
+
columns: LineColumnConfig[];
|
|
256
|
+
lineFields: FieldDescriptor[];
|
|
257
|
+
alerts?: Array<{
|
|
258
|
+
label: string;
|
|
259
|
+
bg: string;
|
|
260
|
+
color: string;
|
|
261
|
+
}>;
|
|
262
|
+
canAddLine: boolean;
|
|
263
|
+
onAddLine: () => void;
|
|
264
|
+
onEditLine: (lineId: string) => void;
|
|
265
|
+
onDeleteLine: (lineId: string) => void;
|
|
266
|
+
onDuplicateLine?: (lineId: string) => void;
|
|
267
|
+
activeLineId?: string | null;
|
|
268
|
+
currentBreakpoint?: Breakpoint;
|
|
269
|
+
className?: string;
|
|
270
|
+
}
|
|
271
|
+
export interface FactBoxProps {
|
|
272
|
+
sections: FactBoxSectionConfig[];
|
|
273
|
+
open?: boolean;
|
|
274
|
+
onClose?: () => void;
|
|
275
|
+
className?: string;
|
|
276
|
+
}
|
|
277
|
+
export interface FactBoxTotalsProps {
|
|
278
|
+
grandTotal: {
|
|
279
|
+
label: string;
|
|
280
|
+
value: string;
|
|
196
281
|
subtitle?: string;
|
|
197
|
-
icon?: ReactNode;
|
|
198
|
-
group: MasterDocumentGroup;
|
|
199
|
-
};
|
|
200
|
-
/** 2. Selector de compañía y centro de operación (siempre presente) */
|
|
201
|
-
context: {
|
|
202
|
-
company: {
|
|
203
|
-
label: string;
|
|
204
|
-
visible: true;
|
|
205
|
-
required: true;
|
|
206
|
-
};
|
|
207
|
-
operationCenter: {
|
|
208
|
-
label: string;
|
|
209
|
-
visible: true;
|
|
210
|
-
required: true;
|
|
211
|
-
};
|
|
212
|
-
};
|
|
213
|
-
/** 3. Configuración de totales y cálculos */
|
|
214
|
-
totals: MasterDocumentTotal[];
|
|
215
|
-
/** 5. Layouts */
|
|
216
|
-
layout: {
|
|
217
|
-
headerLayout: HeaderLayoutDefinition;
|
|
218
|
-
detailLayout: DetailLayoutDefinition;
|
|
219
|
-
itemLayout: MasterDocumentItemLayout;
|
|
220
|
-
};
|
|
221
|
-
/** 6. Acciones y botones */
|
|
222
|
-
actions: {
|
|
223
|
-
/** Cambian estado (Aprobar, Cancelar, Guardar) */
|
|
224
|
-
workflow: MasterDocumentAction[];
|
|
225
|
-
/** No cambian estado (Imprimir, Duplicar) */
|
|
226
|
-
features: MasterDocumentAction[];
|
|
227
|
-
};
|
|
228
|
-
/** 7. Capacidades LEGO (flags de funcionalidad) */
|
|
229
|
-
capabilities: {
|
|
230
|
-
consecutive?: boolean;
|
|
231
|
-
taxCalculation?: boolean;
|
|
232
|
-
discounts?: boolean;
|
|
233
|
-
printFormats?: boolean;
|
|
234
|
-
electronicInvoice?: boolean;
|
|
235
|
-
[key: string]: boolean | undefined;
|
|
236
282
|
};
|
|
283
|
+
kpis: Array<{
|
|
284
|
+
label: string;
|
|
285
|
+
value: string;
|
|
286
|
+
color?: string;
|
|
287
|
+
}>;
|
|
288
|
+
breakdown: Array<{
|
|
289
|
+
label: string;
|
|
290
|
+
value: string;
|
|
291
|
+
color?: string;
|
|
292
|
+
isSummary?: boolean;
|
|
293
|
+
}>;
|
|
294
|
+
className?: string;
|
|
237
295
|
}
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
296
|
+
export interface DocumentListProps {
|
|
297
|
+
title: string;
|
|
298
|
+
subtitle?: string;
|
|
299
|
+
companyName: string;
|
|
300
|
+
onCompanyChange?: () => void;
|
|
301
|
+
onExport?: () => void;
|
|
302
|
+
onCreateNew: () => void;
|
|
303
|
+
createNewLabel?: string;
|
|
304
|
+
pills: FilterPill[];
|
|
305
|
+
onPillClick: (key: string) => void;
|
|
306
|
+
searchFields: SearchField[];
|
|
307
|
+
searchValues: Record<string, unknown>;
|
|
308
|
+
onSearchChange: (key: string, value: unknown) => void;
|
|
309
|
+
onSearch: () => void;
|
|
310
|
+
onClearSearch: () => void;
|
|
311
|
+
searchOpen?: boolean;
|
|
312
|
+
onToggleSearch?: () => void;
|
|
313
|
+
columns: DocumentListColumn[];
|
|
314
|
+
rows: Record<string, unknown>[];
|
|
315
|
+
totalCount: number;
|
|
316
|
+
onRowClick: (row: Record<string, unknown>) => void;
|
|
317
|
+
emptyState?: EmptyStateConfig;
|
|
318
|
+
page: number;
|
|
319
|
+
pageSize: number;
|
|
320
|
+
onPageChange: (page: number) => void;
|
|
321
|
+
loading?: boolean;
|
|
322
|
+
error?: string;
|
|
323
|
+
onRetry?: () => void;
|
|
258
324
|
className?: string;
|
|
259
325
|
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
326
|
+
export interface DocumentCreationWizardProps {
|
|
327
|
+
open: boolean;
|
|
328
|
+
onClose: () => void;
|
|
329
|
+
companies: WizardOption[];
|
|
330
|
+
selectedCompany?: string;
|
|
331
|
+
onSelectCompany: (id: string) => void;
|
|
332
|
+
operationCenters: WizardOption[];
|
|
333
|
+
selectedCO?: string;
|
|
334
|
+
onSelectCO: (id: string) => void;
|
|
335
|
+
documentTypes: WizardOption[];
|
|
336
|
+
selectedType?: string;
|
|
337
|
+
onSelectType: (id: string) => void;
|
|
338
|
+
onConfirm: () => void;
|
|
339
|
+
loadingStep?: 1 | 2 | 3;
|
|
340
|
+
errorStep?: {
|
|
341
|
+
step: 1 | 2 | 3;
|
|
342
|
+
message: string;
|
|
343
|
+
onRetry: () => void;
|
|
344
|
+
};
|
|
268
345
|
className?: string;
|
|
269
346
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
context: MasterDocumentDefinition['context'];
|
|
347
|
+
export interface ApprovalBannerProps {
|
|
348
|
+
steps: ApprovalStep[];
|
|
349
|
+
message: string;
|
|
350
|
+
onApprove: () => void;
|
|
351
|
+
approveLabel?: string;
|
|
352
|
+
onReject: () => void;
|
|
353
|
+
rejectLabel?: string;
|
|
278
354
|
className?: string;
|
|
279
355
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
356
|
+
export interface LookupFieldConfig {
|
|
357
|
+
entity: string;
|
|
358
|
+
displayFields: string[];
|
|
359
|
+
searchFields?: string[];
|
|
360
|
+
displayTemplate?: string;
|
|
361
|
+
valueField?: string;
|
|
362
|
+
pageSize?: number;
|
|
363
|
+
filters?: Record<string, unknown> | unknown[][];
|
|
364
|
+
}
|
|
365
|
+
export interface FieldRendererProps {
|
|
366
|
+
fieldDef: FieldDescriptor;
|
|
367
|
+
value: unknown;
|
|
368
|
+
onChange: (value: unknown) => void;
|
|
369
|
+
editable: boolean;
|
|
370
|
+
error?: FieldError;
|
|
371
|
+
readOnly?: boolean;
|
|
288
372
|
className?: string;
|
|
373
|
+
/** Config de LookupField para campos control: 'searcher'. */
|
|
374
|
+
lookupConfig?: LookupFieldConfig;
|
|
375
|
+
/** Fetcher del adapter para LookupField. */
|
|
376
|
+
fetcher?: unknown;
|
|
377
|
+
/** Callback cuando LookupField selecciona un registro (para bindFields). */
|
|
378
|
+
onRecordSelect?: (record: Record<string, unknown> | null) => void;
|
|
289
379
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
* Cuando cambian los campos `watch`, se ejecuta `compute` y se asigna el resultado a `targetField`.
|
|
293
|
-
*/
|
|
294
|
-
export interface MasterDocumentComputedRule {
|
|
295
|
-
/** Campo destino donde se escribe el resultado */
|
|
296
|
-
targetField: string;
|
|
297
|
-
/** Campos que disparan el recálculo */
|
|
298
|
-
watch: string[];
|
|
299
|
-
/** Función de cálculo. Recibe los valores actuales del formulario. */
|
|
300
|
-
compute: (formData: Record<string, string | number | boolean>) => string | number | boolean;
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Props del modal dinámico para formularios del documento.
|
|
304
|
-
* Renderiza cualquier conjunto de MasterDocumentField[] como formulario.
|
|
305
|
-
*/
|
|
306
|
-
export interface MasterDocumentFormModalProps {
|
|
307
|
-
/** Si el modal está abierto */
|
|
308
|
-
isOpen: boolean;
|
|
309
|
-
/** Callback al cerrar */
|
|
380
|
+
export interface LineFormModalProps {
|
|
381
|
+
open: boolean;
|
|
310
382
|
onClose: () => void;
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
383
|
+
onConfirm: (data: Record<string, unknown>) => void;
|
|
384
|
+
fields: FieldDescriptor[];
|
|
385
|
+
initialData?: Record<string, unknown>;
|
|
386
|
+
computedRules?: ComputedRule[];
|
|
387
|
+
errors?: FieldErrorMap;
|
|
316
388
|
title: string;
|
|
317
|
-
|
|
318
|
-
submitLabel?: string;
|
|
319
|
-
/** Texto del botón de cancelar */
|
|
389
|
+
confirmLabel?: string;
|
|
320
390
|
cancelLabel?: string;
|
|
321
|
-
/** Datos iniciales para modo edición */
|
|
322
|
-
initialData?: Record<string, string | number | boolean>;
|
|
323
|
-
/** Reglas de cálculo automático entre campos */
|
|
324
|
-
computedRules?: MasterDocumentComputedRule[];
|
|
325
|
-
/** Número de columnas del grid (1 o 2) */
|
|
326
391
|
columns?: 1 | 2;
|
|
327
|
-
/** Clase CSS adicional para el contenedor del modal */
|
|
328
392
|
className?: string;
|
|
329
393
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
export interface
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
394
|
+
export interface SkeletonDocumentProps {
|
|
395
|
+
className?: string;
|
|
396
|
+
}
|
|
397
|
+
export interface SkeletonListProps {
|
|
398
|
+
rows?: number;
|
|
399
|
+
className?: string;
|
|
400
|
+
}
|
|
401
|
+
export interface ConflictModalProps {
|
|
402
|
+
open: boolean;
|
|
403
|
+
modifiedBy?: string;
|
|
404
|
+
modifiedAgo?: string;
|
|
405
|
+
onReload: () => void;
|
|
406
|
+
onKeepEditing: () => void;
|
|
407
|
+
className?: string;
|
|
408
|
+
}
|
|
409
|
+
export interface StateBadgeProps {
|
|
410
|
+
label: string;
|
|
411
|
+
bg: string;
|
|
412
|
+
color: string;
|
|
413
|
+
className?: string;
|
|
414
|
+
}
|
|
415
|
+
export interface ContentLayoutProps {
|
|
416
|
+
children: ReactNode;
|
|
417
|
+
factBox?: ReactNode;
|
|
418
|
+
factBoxOpen?: boolean;
|
|
419
|
+
onFactBoxClose?: () => void;
|
|
420
|
+
className?: string;
|
|
421
|
+
}
|
|
422
|
+
export interface LineContextMenuProps {
|
|
423
|
+
open: boolean;
|
|
424
|
+
position: {
|
|
425
|
+
x: number;
|
|
426
|
+
y: number;
|
|
427
|
+
};
|
|
428
|
+
onClose: () => void;
|
|
429
|
+
items: Array<{
|
|
430
|
+
label: string;
|
|
431
|
+
icon?: ReactNode;
|
|
432
|
+
onClick: () => void;
|
|
433
|
+
danger?: boolean;
|
|
434
|
+
separator?: boolean;
|
|
435
|
+
}>;
|
|
436
|
+
className?: string;
|
|
437
|
+
}
|
|
438
|
+
export interface FactBoxCfdeProps {
|
|
439
|
+
data: CfdeData;
|
|
440
|
+
onRetransmit?: () => void;
|
|
441
|
+
onDownloadPdf?: () => void;
|
|
442
|
+
className?: string;
|
|
443
|
+
}
|
|
444
|
+
export interface FactBoxPaymentTermsProps {
|
|
445
|
+
data: PaymentTermsData;
|
|
446
|
+
className?: string;
|
|
447
|
+
}
|
|
448
|
+
export interface FactBoxFinancialProps {
|
|
449
|
+
data: FinancialData;
|
|
450
|
+
formatCurrency: (value: number) => string;
|
|
451
|
+
className?: string;
|
|
452
|
+
}
|
|
453
|
+
export interface GlobalDiscountControlProps {
|
|
454
|
+
data: GlobalDiscountData;
|
|
455
|
+
onChange: (data: GlobalDiscountData) => void;
|
|
456
|
+
subtotal: number;
|
|
457
|
+
formatCurrency: (value: number) => string;
|
|
458
|
+
editable?: boolean;
|
|
459
|
+
className?: string;
|
|
460
|
+
}
|
|
461
|
+
export interface MasterDocumentProps {
|
|
462
|
+
documentId?: string;
|
|
463
|
+
docTypeBadge?: string;
|
|
464
|
+
breadcrumbLabel: string;
|
|
465
|
+
onBreadcrumbClick: () => void;
|
|
466
|
+
docState: string;
|
|
467
|
+
stateBadge?: StateBadgeConfig;
|
|
468
|
+
transitions: TransitionConfig[];
|
|
469
|
+
onTransition: (to: string) => void;
|
|
470
|
+
mode: 'create' | 'edit' | 'view';
|
|
471
|
+
actions: ActionConfig[];
|
|
472
|
+
contextItems: ContextStripItem[];
|
|
473
|
+
currencyPanel?: ReactNode;
|
|
474
|
+
headerLayout: HeaderLayoutConfig;
|
|
475
|
+
headerFields: FieldDescriptor[];
|
|
476
|
+
headerValues: DocumentHeaderData;
|
|
477
|
+
headerErrors?: FieldErrorMap;
|
|
478
|
+
onHeaderFieldChange: (key: string, value: unknown) => void;
|
|
479
|
+
lookupConfigs?: Record<string, LookupFieldConfig>;
|
|
480
|
+
fetcher?: unknown;
|
|
481
|
+
onRecordSelect?: (fieldKey: string, record: Record<string, unknown> | null) => void;
|
|
482
|
+
linesTitle?: string;
|
|
483
|
+
lines: DocumentLineData[];
|
|
484
|
+
lineColumns: LineColumnConfig[];
|
|
485
|
+
lineFields: FieldDescriptor[];
|
|
486
|
+
lineComputedRules?: ComputedRule[];
|
|
487
|
+
lineAlerts?: Array<{
|
|
488
|
+
label: string;
|
|
489
|
+
bg: string;
|
|
490
|
+
color: string;
|
|
491
|
+
}>;
|
|
492
|
+
canAddLine?: boolean;
|
|
493
|
+
onAddLine: () => void;
|
|
494
|
+
onEditLine: (lineId: string) => void;
|
|
495
|
+
onDeleteLine: (lineId: string) => void;
|
|
496
|
+
onDuplicateLine?: (lineId: string) => void;
|
|
497
|
+
onLineSave?: (lineId: string | null, data: Record<string, unknown>) => void;
|
|
498
|
+
factBoxSections?: FactBoxSectionConfig[];
|
|
499
|
+
approval?: {
|
|
500
|
+
steps: ApprovalStep[];
|
|
501
|
+
message: string;
|
|
502
|
+
onApprove: () => void;
|
|
503
|
+
onReject: () => void;
|
|
504
|
+
approveLabel?: string;
|
|
505
|
+
rejectLabel?: string;
|
|
506
|
+
};
|
|
507
|
+
conflict?: {
|
|
508
|
+
modifiedBy?: string;
|
|
509
|
+
modifiedAgo?: string;
|
|
510
|
+
onReload: () => void;
|
|
511
|
+
onKeepEditing: () => void;
|
|
512
|
+
};
|
|
513
|
+
loading?: boolean;
|
|
514
|
+
error?: string;
|
|
515
|
+
onRetry?: () => void;
|
|
337
516
|
className?: string;
|
|
338
517
|
}
|
|
339
518
|
//# sourceMappingURL=MasterDocument.types.d.ts.map
|