@m4l/layouts 9.1.8 → 9.1.10-beta.1
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/.storybook/constants.d.ts +21 -0
- package/.storybook/decorators/WithContexts/WithContexts.d.ts +5 -0
- package/.storybook/decorators/WithContexts/constants.d.ts +10 -0
- package/.storybook/decorators/WithContexts/index.d.ts +1 -0
- package/.storybook/decorators/WithContexts/styles.d.ts +1 -0
- package/.storybook/decorators/WithContexts/subcomponents/AppWithTheme.d.ts +6 -0
- package/.storybook/decorators/WithContexts/types.d.ts +7 -0
- package/.storybook/decorators/index.d.ts +1 -0
- package/.storybook/main.d.ts +3 -0
- package/.storybook/storybook.vite.d.ts +2 -0
- package/.storybook/utils/getGlobalsFromSearchParams.d.ts +7 -0
- package/.storybook/utils/getStylesColorsByMode.d.ts +744 -0
- package/components/MFHostApp/MFHostApp.d.ts +6 -0
- package/components/MFHostApp/MFHostApp.js +59 -0
- package/components/MFHostApp/index.d.ts +2 -10
- package/components/MFHostApp/index.js +1 -60
- package/components/MFHostApp/types.d.ts +4 -1
- package/components/MFNoAuthApp/index.d.ts +0 -4
- package/components/MFNoAuthApp/index.js +3 -4
- package/components/MFNoAuthApp/types.d.ts +4 -1
- package/components/MFWindowsTitle/MFWindowsTitle.d.ts +0 -4
- package/components/ModuleDetailTabs/ModuleDetailTabs.d.ts +5 -0
- package/components/ModuleDetailTabs/ModuleDetailTabs.js +42 -0
- package/components/ModuleDetailTabs/index.d.ts +2 -0
- package/components/ModuleDetailTabs/index.js +1 -0
- package/components/ModuleDetailTabs/types.d.ts +88 -0
- package/components/ModuleDetailTabs/useModuleDatailTabs.d.ts +308 -0
- package/components/ModuleDetailTabs/useModuleDatailTabs.js +86 -0
- package/components/index.d.ts +3 -2
- package/contexts/AuthContext/index.d.ts +0 -4
- package/hooks/index.d.ts +1 -0
- package/hooks/useAuth/index.d.ts +0 -4
- package/hooks/useDynamicAccordions/index.d.ts +2 -0
- package/hooks/useDynamicAccordions/index.js +1 -0
- package/hooks/useDynamicAccordions/types.d.ts +42 -0
- package/hooks/useDynamicAccordions/useBaseAccordions.d.ts +5 -0
- package/hooks/useDynamicAccordions/useBaseAccordions.js +38 -0
- package/hooks/useDynamicAccordions/useDynamicAccordions.d.ts +6 -0
- package/hooks/useDynamicAccordions/useDynamicAccordions.js +18 -0
- package/hooks/useMasterDetail/index.d.ts +1 -1
- package/hooks/useModule/index.d.ts +0 -4
- package/index.d.ts +1 -0
- package/index.js +14 -9
- package/layouts/MasterDetailLayout/MasterDetailLayout.d.ts +0 -4
- package/layouts/MasterDetailLayout/MasterDetailLayout.js +6 -6
- package/layouts/MasterDetailLayout/classes/index.d.ts +0 -4
- package/layouts/MasterDetailLayout/components/ButtonDetail/index.d.ts +0 -4
- package/layouts/MasterDetailLayout/contexts/MasterDetailContext/index.d.ts +0 -4
- package/layouts/MasterDetailLayout/dicctionary.js +2 -11
- package/layouts/MasterDetailLayout/index.d.ts +2 -0
- package/layouts/MasterDetailLayout/index.js +1 -0
- package/layouts/ModuleLayout/ModuleLayout.js +6 -3
- package/layouts/ModuleLayout/constants.d.ts +1 -0
- package/layouts/ModuleLayout/constants.js +4 -0
- package/layouts/ModuleLayout/contexts/ModuleContext/index.d.ts +0 -4
- package/layouts/ModuleLayout/contexts/ModuleContext/index.js +0 -5
- package/layouts/ModuleLayout/slots/ModuleLayoutEnum.d.ts +3 -0
- package/layouts/ModuleLayout/slots/ModuleLayoutEnum.js +7 -0
- package/layouts/ModuleLayout/slots/ModuleLayoutSlots.d.ts +1 -0
- package/layouts/ModuleLayout/slots/ModuleLayoutSlots.js +11 -0
- package/layouts/ModuleLayout/styles.d.ts +2 -0
- package/layouts/ModuleLayout/styles.js +16 -0
- package/layouts/ModuleLayout/subcomponents/BaseModuleLayout/index.d.ts +2 -0
- package/layouts/ModuleLayout/subcomponents/BaseModuleLayout/index.js +20 -0
- package/layouts/ModuleLayout/subcomponents/{InnerModule → BaseModuleLayout}/types.d.ts +1 -0
- package/layouts/ModuleLayout/types.d.ts +8 -1
- package/layouts/NoAuthModuleLayout/constants.d.ts +1 -0
- package/layouts/NoAuthModuleLayout/constants.js +4 -0
- package/layouts/NoAuthModuleLayout/index.d.ts +4 -5
- package/layouts/NoAuthModuleLayout/index.js +4 -5
- package/layouts/NoAuthModuleLayout/slots/NoAuthModuleLayoutEnum.d.ts +25 -0
- package/layouts/NoAuthModuleLayout/slots/NoAuthModuleLayoutEnum.js +33 -0
- package/layouts/NoAuthModuleLayout/slots/NoAuthModuleLayoutSlots.d.ts +19 -0
- package/layouts/NoAuthModuleLayout/slots/NoAuthModuleLayoutSlots.js +100 -0
- package/layouts/NoAuthModuleLayout/styles.d.ts +2 -0
- package/layouts/NoAuthModuleLayout/styles.js +314 -0
- package/layouts/NoAuthModuleLayout/subcomponents/BaseNoAuthModuleLayout/index.d.ts +4 -0
- package/layouts/NoAuthModuleLayout/subcomponents/BaseNoAuthModuleLayout/index.js +16 -0
- package/layouts/NoAuthModuleLayout/subcomponents/BaseNoAuthModuleLayout/subcomponents/DesktopContent/index.d.ts +4 -0
- package/layouts/NoAuthModuleLayout/subcomponents/BaseNoAuthModuleLayout/subcomponents/DesktopContent/index.js +47 -0
- package/layouts/NoAuthModuleLayout/subcomponents/BaseNoAuthModuleLayout/subcomponents/MobileContent/index.d.ts +4 -0
- package/layouts/NoAuthModuleLayout/subcomponents/BaseNoAuthModuleLayout/subcomponents/MobileContent/index.js +43 -0
- package/layouts/NoAuthModuleLayout/tests/NoAuthModuleLayout.test.d.ts +1 -0
- package/layouts/NoAuthModuleLayout/types.d.ts +45 -0
- package/layouts/index.d.ts +1 -2
- package/package.json +4 -3
- package/storybook/layouts/ModuleLayout/ModuleLayout.stories.d.ts +6 -0
- package/storybook/layouts/ModuleLayout/moks/mokData.d.ts +14 -0
- package/storybook/layouts/ModuleLayout/subcomponents/ClientsHeaderActions.d.ts +4 -0
- package/storybook/layouts/ModuleLayout/subcomponents/RenderModuleLayout.d.ts +6 -0
- package/storybook/layouts/ModuleLayout/subcomponents/UsersHeaderActions.d.ts +4 -0
- package/storybook/layouts/ModuleLayout/subcomponents/WithExtendedContainer.d.ts +5 -0
- package/storybook/layouts/NoAuthModuleLayout/NoAuthModuleLayout.stories.d.ts +9 -0
- package/test/HostThemeProviderMock.d.ts +10 -0
- package/test/TestAppWrapper.d.ts +29 -0
- package/test/TestFormAutoValidation.d.ts +4 -0
- package/test/constants.d.ts +69 -0
- package/test/constants_no_mock.d.ts +1 -0
- package/test/getNameDataTestId.d.ts +15 -0
- package/test/index.d.ts +4 -0
- package/test/mocks.d.ts +24 -0
- package/test/types.d.ts +4 -0
- package/test/utils.d.ts +23 -10
- package/utils/createAppMF.d.ts +13 -0
- package/utils/createAppMF.js +58 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/vite-env.d.ts +19 -0
- package/layouts/ModuleLayout/classes/constants.d.ts +0 -1
- package/layouts/ModuleLayout/classes/constants.js +0 -4
- package/layouts/ModuleLayout/classes/index.d.ts +0 -14
- package/layouts/ModuleLayout/classes/index.js +0 -25
- package/layouts/ModuleLayout/classes/types.d.ts +0 -7
- package/layouts/ModuleLayout/subcomponents/InnerModule/index.d.ts +0 -2
- package/layouts/ModuleLayout/subcomponents/InnerModule/index.js +0 -20
- package/layouts/ModuleLayout/subcomponents/InnerModule/styles.d.ts +0 -1
- package/layouts/ModuleLayout/subcomponents/InnerModule/styles.js +0 -7
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/index.d.ts +0 -8
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/index.js +0 -16
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/styles.d.ts +0 -1
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/styles.js +0 -15
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/DesktopContent/index.d.ts +0 -8
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/DesktopContent/index.js +0 -47
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/DesktopContent/styles.d.ts +0 -9
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/DesktopContent/styles.js +0 -115
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/MobileContent/index.d.ts +0 -8
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/MobileContent/index.js +0 -43
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/MobileContent/styles.d.ts +0 -8
- package/layouts/NoAuthModuleLayout/subcomponents/InnerModule/subcomponents/MobileContent/styles.js +0 -96
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { ModuleDetailTabContent, ModuleDetailTabsProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Componente para mostrar un listado de tabs y contenido en un MasterDetail, basado en las props
|
|
4
|
+
*/
|
|
5
|
+
export declare function useModuleDetailTabs<T extends Record<string, any> = Record<string, any>, K extends Record<string, any> = Record<string, any>>(props: ModuleDetailTabsProps<T, K>): {
|
|
6
|
+
conditionNoMasterSelection: boolean;
|
|
7
|
+
currentTab: string;
|
|
8
|
+
detailData: any;
|
|
9
|
+
endPointData: any;
|
|
10
|
+
hasPrivilegeDetail: boolean;
|
|
11
|
+
finalTabs: {
|
|
12
|
+
unmountable: boolean;
|
|
13
|
+
icon: import("react/jsx-runtime").JSX.Element | undefined;
|
|
14
|
+
label: string | undefined;
|
|
15
|
+
value: string;
|
|
16
|
+
tabContent: import('react').FunctionComponent<any>;
|
|
17
|
+
componentProps?: Omit<any, keyof ModuleDetailTabContent<T_1, K_1>> | undefined;
|
|
18
|
+
dictionaryId?: string;
|
|
19
|
+
size?: Extract<import('@m4l/styles').Sizes, "small" | "medium"> | undefined;
|
|
20
|
+
children?: null | undefined;
|
|
21
|
+
ref?: ((instance: HTMLDivElement | null) => void | import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import('react').DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import('react').RefObject<HTMLDivElement> | null | undefined;
|
|
22
|
+
title?: string | undefined;
|
|
23
|
+
component?: React.ElementType | undefined;
|
|
24
|
+
id?: string | undefined;
|
|
25
|
+
disabled?: boolean | undefined;
|
|
26
|
+
action?: React.Ref<import('@mui/material').ButtonBaseActions> | undefined;
|
|
27
|
+
hidden?: boolean | undefined;
|
|
28
|
+
color?: Extract<import('@m4l/styles').ComponentPalletColor, "default"> | undefined;
|
|
29
|
+
content?: string | undefined;
|
|
30
|
+
style?: React.CSSProperties | undefined;
|
|
31
|
+
translate?: "yes" | "no" | undefined;
|
|
32
|
+
urlIcon?: string | undefined;
|
|
33
|
+
lang?: string | undefined;
|
|
34
|
+
slot?: string | undefined;
|
|
35
|
+
dir?: string | undefined;
|
|
36
|
+
className?: string | undefined;
|
|
37
|
+
classes?: (Partial<import('@mui/material').TabClasses> & Partial<import('@mui/material').ClassNameMap<never>>) | undefined;
|
|
38
|
+
sx?: import('@mui/system').SxProps<import('@mui/material').Theme> | undefined;
|
|
39
|
+
key?: import('react').Key | null | undefined;
|
|
40
|
+
defaultChecked?: boolean | undefined;
|
|
41
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
42
|
+
suppressContentEditableWarning?: boolean | undefined;
|
|
43
|
+
suppressHydrationWarning?: boolean | undefined;
|
|
44
|
+
accessKey?: string | undefined;
|
|
45
|
+
autoFocus?: boolean | undefined;
|
|
46
|
+
contentEditable?: (boolean | "false" | "true") | "inherit" | "plaintext-only" | undefined;
|
|
47
|
+
contextMenu?: string | undefined;
|
|
48
|
+
draggable?: (boolean | "false" | "true") | undefined;
|
|
49
|
+
nonce?: string | undefined;
|
|
50
|
+
spellCheck?: (boolean | "false" | "true") | undefined;
|
|
51
|
+
tabIndex?: NonNullable<React.HTMLAttributes<any>["tabIndex"]> | undefined;
|
|
52
|
+
radioGroup?: string | undefined;
|
|
53
|
+
role?: import('react').AriaRole | undefined;
|
|
54
|
+
about?: string | undefined;
|
|
55
|
+
datatype?: string | undefined;
|
|
56
|
+
inlist?: any;
|
|
57
|
+
prefix?: string | undefined;
|
|
58
|
+
property?: string | undefined;
|
|
59
|
+
rel?: string | undefined;
|
|
60
|
+
resource?: string | undefined;
|
|
61
|
+
rev?: string | undefined;
|
|
62
|
+
typeof?: string | undefined;
|
|
63
|
+
vocab?: string | undefined;
|
|
64
|
+
autoCapitalize?: string | undefined;
|
|
65
|
+
autoCorrect?: string | undefined;
|
|
66
|
+
autoSave?: string | undefined;
|
|
67
|
+
itemProp?: string | undefined;
|
|
68
|
+
itemScope?: boolean | undefined;
|
|
69
|
+
itemType?: string | undefined;
|
|
70
|
+
itemID?: string | undefined;
|
|
71
|
+
itemRef?: string | undefined;
|
|
72
|
+
results?: number | undefined;
|
|
73
|
+
security?: string | undefined;
|
|
74
|
+
unselectable?: "on" | "off" | undefined;
|
|
75
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
76
|
+
is?: string | undefined;
|
|
77
|
+
"aria-activedescendant"?: string | undefined;
|
|
78
|
+
"aria-atomic"?: (boolean | "false" | "true") | undefined;
|
|
79
|
+
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
|
|
80
|
+
"aria-braillelabel"?: string | undefined;
|
|
81
|
+
"aria-brailleroledescription"?: string | undefined;
|
|
82
|
+
"aria-busy"?: (boolean | "false" | "true") | undefined;
|
|
83
|
+
"aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
84
|
+
"aria-colcount"?: number | undefined;
|
|
85
|
+
"aria-colindex"?: number | undefined;
|
|
86
|
+
"aria-colindextext"?: string | undefined;
|
|
87
|
+
"aria-colspan"?: number | undefined;
|
|
88
|
+
"aria-controls"?: string | undefined;
|
|
89
|
+
"aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
|
|
90
|
+
"aria-describedby"?: string | undefined;
|
|
91
|
+
"aria-description"?: string | undefined;
|
|
92
|
+
"aria-details"?: string | undefined;
|
|
93
|
+
"aria-disabled"?: (boolean | "false" | "true") | undefined;
|
|
94
|
+
"aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
|
|
95
|
+
"aria-errormessage"?: string | undefined;
|
|
96
|
+
"aria-expanded"?: (boolean | "false" | "true") | undefined;
|
|
97
|
+
"aria-flowto"?: string | undefined;
|
|
98
|
+
"aria-grabbed"?: (boolean | "false" | "true") | undefined;
|
|
99
|
+
"aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
|
|
100
|
+
"aria-hidden"?: (boolean | "false" | "true") | undefined;
|
|
101
|
+
"aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
|
|
102
|
+
"aria-keyshortcuts"?: string | undefined;
|
|
103
|
+
"aria-label"?: string | undefined;
|
|
104
|
+
"aria-labelledby"?: string | undefined;
|
|
105
|
+
"aria-level"?: number | undefined;
|
|
106
|
+
"aria-live"?: "off" | "assertive" | "polite" | undefined;
|
|
107
|
+
"aria-modal"?: (boolean | "false" | "true") | undefined;
|
|
108
|
+
"aria-multiline"?: (boolean | "false" | "true") | undefined;
|
|
109
|
+
"aria-multiselectable"?: (boolean | "false" | "true") | undefined;
|
|
110
|
+
"aria-orientation"?: "horizontal" | "vertical" | undefined;
|
|
111
|
+
"aria-owns"?: string | undefined;
|
|
112
|
+
"aria-placeholder"?: string | undefined;
|
|
113
|
+
"aria-posinset"?: number | undefined;
|
|
114
|
+
"aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
|
|
115
|
+
"aria-readonly"?: (boolean | "false" | "true") | undefined;
|
|
116
|
+
"aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
|
|
117
|
+
"aria-required"?: (boolean | "false" | "true") | undefined;
|
|
118
|
+
"aria-roledescription"?: string | undefined;
|
|
119
|
+
"aria-rowcount"?: number | undefined;
|
|
120
|
+
"aria-rowindex"?: number | undefined;
|
|
121
|
+
"aria-rowindextext"?: string | undefined;
|
|
122
|
+
"aria-rowspan"?: number | undefined;
|
|
123
|
+
"aria-selected"?: (boolean | "false" | "true") | undefined;
|
|
124
|
+
"aria-setsize"?: number | undefined;
|
|
125
|
+
"aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
|
|
126
|
+
"aria-valuemax"?: number | undefined;
|
|
127
|
+
"aria-valuemin"?: number | undefined;
|
|
128
|
+
"aria-valuenow"?: number | undefined;
|
|
129
|
+
"aria-valuetext"?: string | undefined;
|
|
130
|
+
dangerouslySetInnerHTML?: {
|
|
131
|
+
__html: string | TrustedHTML;
|
|
132
|
+
} | undefined;
|
|
133
|
+
onCopy?: import('react').ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
134
|
+
onCopyCapture?: import('react').ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
135
|
+
onCut?: import('react').ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
136
|
+
onCutCapture?: import('react').ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
137
|
+
onPaste?: import('react').ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
138
|
+
onPasteCapture?: import('react').ClipboardEventHandler<HTMLDivElement> | undefined;
|
|
139
|
+
onCompositionEnd?: import('react').CompositionEventHandler<HTMLDivElement> | undefined;
|
|
140
|
+
onCompositionEndCapture?: import('react').CompositionEventHandler<HTMLDivElement> | undefined;
|
|
141
|
+
onCompositionStart?: import('react').CompositionEventHandler<HTMLDivElement> | undefined;
|
|
142
|
+
onCompositionStartCapture?: import('react').CompositionEventHandler<HTMLDivElement> | undefined;
|
|
143
|
+
onCompositionUpdate?: import('react').CompositionEventHandler<HTMLDivElement> | undefined;
|
|
144
|
+
onCompositionUpdateCapture?: import('react').CompositionEventHandler<HTMLDivElement> | undefined;
|
|
145
|
+
onFocus?: import('react').FocusEventHandler<HTMLDivElement> | undefined;
|
|
146
|
+
onFocusCapture?: import('react').FocusEventHandler<HTMLDivElement> | undefined;
|
|
147
|
+
onBlur?: import('react').FocusEventHandler<HTMLDivElement> | undefined;
|
|
148
|
+
onBlurCapture?: import('react').FocusEventHandler<HTMLDivElement> | undefined;
|
|
149
|
+
onChange?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
150
|
+
onChangeCapture?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
151
|
+
onBeforeInput?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
152
|
+
onBeforeInputCapture?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
153
|
+
onInput?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
154
|
+
onInputCapture?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
155
|
+
onReset?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
156
|
+
onResetCapture?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
157
|
+
onSubmit?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
158
|
+
onSubmitCapture?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
159
|
+
onInvalid?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
160
|
+
onInvalidCapture?: import('react').FormEventHandler<HTMLDivElement> | undefined;
|
|
161
|
+
onLoad?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
162
|
+
onLoadCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
163
|
+
onError?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
164
|
+
onErrorCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
165
|
+
onKeyDown?: import('react').KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
166
|
+
onKeyDownCapture?: import('react').KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
167
|
+
onKeyPress?: import('react').KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
168
|
+
onKeyPressCapture?: import('react').KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
169
|
+
onKeyUp?: import('react').KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
170
|
+
onKeyUpCapture?: import('react').KeyboardEventHandler<HTMLDivElement> | undefined;
|
|
171
|
+
onAbort?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
172
|
+
onAbortCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
173
|
+
onCanPlay?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
174
|
+
onCanPlayCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
175
|
+
onCanPlayThrough?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
176
|
+
onCanPlayThroughCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
177
|
+
onDurationChange?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
178
|
+
onDurationChangeCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
179
|
+
onEmptied?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
180
|
+
onEmptiedCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
181
|
+
onEncrypted?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
182
|
+
onEncryptedCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
183
|
+
onEnded?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
184
|
+
onEndedCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
185
|
+
onLoadedData?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
186
|
+
onLoadedDataCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
187
|
+
onLoadedMetadata?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
188
|
+
onLoadedMetadataCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
189
|
+
onLoadStart?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
190
|
+
onLoadStartCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
191
|
+
onPause?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
192
|
+
onPauseCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
193
|
+
onPlay?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
194
|
+
onPlayCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
195
|
+
onPlaying?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
196
|
+
onPlayingCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
197
|
+
onProgress?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
198
|
+
onProgressCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
199
|
+
onRateChange?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
200
|
+
onRateChangeCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
201
|
+
onResize?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
202
|
+
onResizeCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
203
|
+
onSeeked?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
204
|
+
onSeekedCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
205
|
+
onSeeking?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
206
|
+
onSeekingCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
207
|
+
onStalled?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
208
|
+
onStalledCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
209
|
+
onSuspend?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
210
|
+
onSuspendCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
211
|
+
onTimeUpdate?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
212
|
+
onTimeUpdateCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
213
|
+
onVolumeChange?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
214
|
+
onVolumeChangeCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
215
|
+
onWaiting?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
216
|
+
onWaitingCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
217
|
+
onAuxClick?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
218
|
+
onAuxClickCapture?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
219
|
+
onClick?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
220
|
+
onClickCapture?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
221
|
+
onContextMenu?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
222
|
+
onContextMenuCapture?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
223
|
+
onDoubleClick?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
224
|
+
onDoubleClickCapture?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
225
|
+
onDrag?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
226
|
+
onDragCapture?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
227
|
+
onDragEnd?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
228
|
+
onDragEndCapture?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
229
|
+
onDragEnter?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
230
|
+
onDragEnterCapture?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
231
|
+
onDragExit?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
232
|
+
onDragExitCapture?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
233
|
+
onDragLeave?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
234
|
+
onDragLeaveCapture?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
235
|
+
onDragOver?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
236
|
+
onDragOverCapture?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
237
|
+
onDragStart?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
238
|
+
onDragStartCapture?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
239
|
+
onDrop?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
240
|
+
onDropCapture?: import('react').DragEventHandler<HTMLDivElement> | undefined;
|
|
241
|
+
onMouseDown?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
242
|
+
onMouseDownCapture?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
243
|
+
onMouseEnter?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
244
|
+
onMouseLeave?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
245
|
+
onMouseMove?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
246
|
+
onMouseMoveCapture?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
247
|
+
onMouseOut?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
248
|
+
onMouseOutCapture?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
249
|
+
onMouseOver?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
250
|
+
onMouseOverCapture?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
251
|
+
onMouseUp?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
252
|
+
onMouseUpCapture?: import('react').MouseEventHandler<HTMLDivElement> | undefined;
|
|
253
|
+
onSelect?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
254
|
+
onSelectCapture?: import('react').ReactEventHandler<HTMLDivElement> | undefined;
|
|
255
|
+
onTouchCancel?: import('react').TouchEventHandler<HTMLDivElement> | undefined;
|
|
256
|
+
onTouchCancelCapture?: import('react').TouchEventHandler<HTMLDivElement> | undefined;
|
|
257
|
+
onTouchEnd?: import('react').TouchEventHandler<HTMLDivElement> | undefined;
|
|
258
|
+
onTouchEndCapture?: import('react').TouchEventHandler<HTMLDivElement> | undefined;
|
|
259
|
+
onTouchMove?: import('react').TouchEventHandler<HTMLDivElement> | undefined;
|
|
260
|
+
onTouchMoveCapture?: import('react').TouchEventHandler<HTMLDivElement> | undefined;
|
|
261
|
+
onTouchStart?: import('react').TouchEventHandler<HTMLDivElement> | undefined;
|
|
262
|
+
onTouchStartCapture?: import('react').TouchEventHandler<HTMLDivElement> | undefined;
|
|
263
|
+
onPointerDown?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
264
|
+
onPointerDownCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
265
|
+
onPointerMove?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
266
|
+
onPointerMoveCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
267
|
+
onPointerUp?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
268
|
+
onPointerUpCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
269
|
+
onPointerCancel?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
270
|
+
onPointerCancelCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
271
|
+
onPointerEnter?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
272
|
+
onPointerLeave?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
273
|
+
onPointerOver?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
274
|
+
onPointerOverCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
275
|
+
onPointerOut?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
276
|
+
onPointerOutCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
277
|
+
onGotPointerCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
278
|
+
onGotPointerCaptureCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
279
|
+
onLostPointerCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
280
|
+
onLostPointerCaptureCapture?: import('react').PointerEventHandler<HTMLDivElement> | undefined;
|
|
281
|
+
onScroll?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
282
|
+
onScrollCapture?: import('react').UIEventHandler<HTMLDivElement> | undefined;
|
|
283
|
+
onWheel?: import('react').WheelEventHandler<HTMLDivElement> | undefined;
|
|
284
|
+
onWheelCapture?: import('react').WheelEventHandler<HTMLDivElement> | undefined;
|
|
285
|
+
onAnimationStart?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
286
|
+
onAnimationStartCapture?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
287
|
+
onAnimationEnd?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
288
|
+
onAnimationEndCapture?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
289
|
+
onAnimationIteration?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
290
|
+
onAnimationIterationCapture?: import('react').AnimationEventHandler<HTMLDivElement> | undefined;
|
|
291
|
+
onTransitionEnd?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
292
|
+
onTransitionEndCapture?: import('react').TransitionEventHandler<HTMLDivElement> | undefined;
|
|
293
|
+
centerRipple?: boolean | undefined;
|
|
294
|
+
disableRipple?: boolean | undefined;
|
|
295
|
+
disableTouchRipple?: boolean | undefined;
|
|
296
|
+
focusRipple?: boolean | undefined;
|
|
297
|
+
focusVisibleClassName?: string | undefined;
|
|
298
|
+
LinkComponent?: React.ElementType | undefined;
|
|
299
|
+
onFocusVisible?: React.FocusEventHandler<any> | undefined;
|
|
300
|
+
TouchRippleProps?: Partial<import('@mui/material/ButtonBase/TouchRipple').TouchRippleProps> | undefined;
|
|
301
|
+
touchRippleRef?: React.Ref<import('@mui/material/ButtonBase/TouchRipple').TouchRippleActions> | undefined;
|
|
302
|
+
disableFocusRipple?: boolean | undefined;
|
|
303
|
+
dataTestId?: string | undefined;
|
|
304
|
+
iconPosition?: ("top" | "bottom" | "start" | "end") | undefined;
|
|
305
|
+
wrapped?: boolean | undefined;
|
|
306
|
+
}[];
|
|
307
|
+
handleChangeTab: (newValue: string) => void;
|
|
308
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, useEffect } from "react";
|
|
3
|
+
import { u as useMasterDetail } from "../../hooks/useMasterDetail/index.js";
|
|
4
|
+
import { useModuleDictionary, useNetwork } from "@m4l/core";
|
|
5
|
+
import { useWindowToolsMF, ObjectLogs, Icon } from "@m4l/components";
|
|
6
|
+
function useModuleDetailTabs(props) {
|
|
7
|
+
const { tabs, defaultTab, urlAssetsPrefix, objectLogsProps, getEndPoint } = props;
|
|
8
|
+
const [currentTab, setCurrentTab] = useState(defaultTab);
|
|
9
|
+
const [detailData, setDetailData] = useState(void 0);
|
|
10
|
+
const [endPointData, setEndPointData] = useState(void 0);
|
|
11
|
+
const [hasPrivilegeDetail, setHasPrivilegeDetail] = useState(true);
|
|
12
|
+
const { masterSelection } = useMasterDetail();
|
|
13
|
+
const { getLabel } = useModuleDictionary();
|
|
14
|
+
const { startProgress, stopProgress } = useWindowToolsMF();
|
|
15
|
+
const { networkOperation } = useNetwork();
|
|
16
|
+
const handleChangeTab = (newValue) => {
|
|
17
|
+
setCurrentTab(newValue);
|
|
18
|
+
};
|
|
19
|
+
const finalTabs = useMemo(() => {
|
|
20
|
+
if (masterSelection === void 0 || masterSelection.length === 0) {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const arrTabs = [...tabs];
|
|
24
|
+
if (objectLogsProps) {
|
|
25
|
+
arrTabs.push({
|
|
26
|
+
...objectLogsProps,
|
|
27
|
+
value: "objectLogs",
|
|
28
|
+
tabContent: ObjectLogs,
|
|
29
|
+
unmountable: false,
|
|
30
|
+
componentProps: {
|
|
31
|
+
resourceId: objectLogsProps.resourceId.toString(),
|
|
32
|
+
objectId: objectLogsProps.getObjectId(masterSelection[0])
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return arrTabs.map((tab) => ({
|
|
37
|
+
...tab,
|
|
38
|
+
unmountable: tab.unmountable === void 0 ? true : tab.unmountable,
|
|
39
|
+
icon: typeof tab.icon === "string" ? /* @__PURE__ */ jsx(Icon, { src: `${urlAssetsPrefix}/${tab.icon}` }) : tab.icon,
|
|
40
|
+
label: tab.dictionaryId ? getLabel(tab.dictionaryId) : void 0
|
|
41
|
+
}));
|
|
42
|
+
}, [masterSelection, tabs, objectLogsProps, urlAssetsPrefix, getLabel]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (masterSelection === void 0 || masterSelection.length === 0) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
setDetailData(masterSelection[0]);
|
|
48
|
+
}, [masterSelection]);
|
|
49
|
+
const conditionNoMasterSelection = masterSelection === void 0 || masterSelection.length === 0;
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!getEndPoint) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (masterSelection === void 0 || masterSelection.length === 0) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
networkOperation({
|
|
58
|
+
options: {
|
|
59
|
+
startProgress,
|
|
60
|
+
stopProgress
|
|
61
|
+
},
|
|
62
|
+
...getEndPoint(masterSelection[masterSelection.length - 1])
|
|
63
|
+
}).then((response) => {
|
|
64
|
+
{
|
|
65
|
+
setHasPrivilegeDetail(true);
|
|
66
|
+
setEndPointData(response);
|
|
67
|
+
}
|
|
68
|
+
}).catch((error) => {
|
|
69
|
+
if (error.status === 403) {
|
|
70
|
+
setHasPrivilegeDetail(false);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}, [masterSelection, startProgress, stopProgress, networkOperation, getEndPoint]);
|
|
74
|
+
return {
|
|
75
|
+
conditionNoMasterSelection,
|
|
76
|
+
currentTab,
|
|
77
|
+
detailData,
|
|
78
|
+
endPointData,
|
|
79
|
+
hasPrivilegeDetail,
|
|
80
|
+
finalTabs,
|
|
81
|
+
handleChangeTab
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export {
|
|
85
|
+
useModuleDetailTabs as u
|
|
86
|
+
};
|
package/components/index.d.ts
CHANGED
|
@@ -2,10 +2,6 @@ import { AuthProviderProps, SessionContextType } from './types';
|
|
|
2
2
|
declare const AuthContext: import('react').Context<SessionContextType | null>;
|
|
3
3
|
/**
|
|
4
4
|
* Proveedor de autenticación
|
|
5
|
-
* @author Juan Escobar - automatic
|
|
6
|
-
* @createdAt 2024-10-09 19:56:26 - automatic
|
|
7
|
-
* @updatedAt 2024-10-09 20:00:30 - automatic
|
|
8
|
-
* @updatedUser Juan Escobar - automatic
|
|
9
5
|
*/
|
|
10
6
|
declare function AuthProvider(props: AuthProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
7
|
export { AuthContext, AuthProvider };
|
package/hooks/index.d.ts
CHANGED
package/hooks/useAuth/index.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hook para obtener el contexto de autenticación
|
|
3
|
-
* @author Juan Escobar - automatic
|
|
4
|
-
* @createdAt 2024-10-09 19:56:26 - automatic
|
|
5
|
-
* @updatedAt 2024-10-09 20:00:30 - automatic
|
|
6
|
-
* @updatedUser Juan Escobar - automatic
|
|
7
3
|
*/
|
|
8
4
|
export declare const useAuth: () => import('../../contexts/AuthContext/types').SessionContextType;
|
|
9
5
|
export default useAuth;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AccordionProps } from '@m4l/components';
|
|
2
|
+
import { ModuleDetailTabContent } from '../../components/ModuleDetailTabs';
|
|
3
|
+
export type DynamicAccordionValue<T extends any = any, K extends any = any> = (data: T, endPointData?: K) => string | React.ReactNode;
|
|
4
|
+
export interface ConfigDynamicAccordion<T extends any = any, K extends any = any> {
|
|
5
|
+
/**
|
|
6
|
+
* "icon": Icono de la propiedad
|
|
7
|
+
*/
|
|
8
|
+
icon?: string;
|
|
9
|
+
/**
|
|
10
|
+
* "dictionaryId": Id de la propiedad en el diccionario para mostrar en el label
|
|
11
|
+
*/
|
|
12
|
+
dictionaryId: string;
|
|
13
|
+
/**
|
|
14
|
+
* "accordionProps" Propiedades del accordion
|
|
15
|
+
*/
|
|
16
|
+
accordionProps?: AccordionProps['accordionProps'];
|
|
17
|
+
/**
|
|
18
|
+
* "properties": Propiedades que se ven en el accordion
|
|
19
|
+
*/
|
|
20
|
+
properties: {
|
|
21
|
+
/**
|
|
22
|
+
* "icon": Icono de la propiedad
|
|
23
|
+
*/
|
|
24
|
+
icon?: string | React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* "dictionaryId": Id de la propiedad en el diccionario para mostrar en el label
|
|
27
|
+
*/
|
|
28
|
+
dictionaryId: string;
|
|
29
|
+
/**
|
|
30
|
+
* "getValue": Función que se encarga de obtener el valor de la propiedad
|
|
31
|
+
*/
|
|
32
|
+
getValue: DynamicAccordionValue<T, K>;
|
|
33
|
+
/**
|
|
34
|
+
* "privilegeToView": Si se requiere un privilegio para ver el valor
|
|
35
|
+
*/
|
|
36
|
+
privilegeToView?: string;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
export interface useDynamicAccordionsProps<T extends any = any, K extends any = any> {
|
|
40
|
+
configDynamicAccordions: ConfigDynamicAccordion<T, K>[];
|
|
41
|
+
}
|
|
42
|
+
export type useBaseDynamicAccordionsProps<T extends any = any, K extends any = any> = useDynamicAccordionsProps<T, K> & ModuleDetailTabContent;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Accordion, PropertyValue } from "@m4l/components";
|
|
4
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
5
|
+
function useBaseAccordions(props) {
|
|
6
|
+
const { data, endPointData, configDynamicAccordions: accordions } = props;
|
|
7
|
+
const { getLabel } = useModuleDictionary();
|
|
8
|
+
const AccordionsComponents = useMemo(() => {
|
|
9
|
+
return accordions.map((accordion) => {
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
Accordion,
|
|
12
|
+
{
|
|
13
|
+
icon: accordion.icon,
|
|
14
|
+
label: getLabel(accordion.dictionaryId),
|
|
15
|
+
accordionProps: {
|
|
16
|
+
...accordion.accordionProps
|
|
17
|
+
},
|
|
18
|
+
children: accordion.properties.map((property) => {
|
|
19
|
+
const value = property.getValue(data, endPointData);
|
|
20
|
+
return value ? /* @__PURE__ */ jsx(
|
|
21
|
+
PropertyValue,
|
|
22
|
+
{
|
|
23
|
+
property: getLabel(property.dictionaryId),
|
|
24
|
+
value
|
|
25
|
+
},
|
|
26
|
+
property.dictionaryId
|
|
27
|
+
) : null;
|
|
28
|
+
})
|
|
29
|
+
},
|
|
30
|
+
accordion.dictionaryId
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
}, [accordions, data, endPointData, getLabel]);
|
|
34
|
+
return AccordionsComponents;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
useBaseAccordions as u
|
|
38
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ModuleDetailTabContent } from '../../components/ModuleDetailTabs';
|
|
2
|
+
import { useDynamicAccordionsProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Componente que muestra los datos generales de un inventario
|
|
5
|
+
*/
|
|
6
|
+
export declare function useDynamicAccordions(props: useDynamicAccordionsProps): (propsGeneral: ModuleDetailTabContent) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ScrollBar, Stack } from "@m4l/components";
|
|
3
|
+
import { u as useBaseAccordions } from "./useBaseAccordions.js";
|
|
4
|
+
function useDynamicAccordions(props) {
|
|
5
|
+
const { configDynamicAccordions } = props;
|
|
6
|
+
return function General(propsGeneral) {
|
|
7
|
+
const { data, endPointData } = propsGeneral;
|
|
8
|
+
const accordionsComponents = useBaseAccordions({
|
|
9
|
+
data,
|
|
10
|
+
endPointData,
|
|
11
|
+
configDynamicAccordions
|
|
12
|
+
});
|
|
13
|
+
return /* @__PURE__ */ jsx(ScrollBar, { children: /* @__PURE__ */ jsx(Stack, { direction: "column", gap: "4px", style: { height: "auto" }, children: accordionsComponents }) });
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
useDynamicAccordions as u
|
|
18
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useMasterDetail: () => import('
|
|
1
|
+
export declare const useMasterDetail: () => import('../..').MasterDetailContextProps;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hook para obtener el contexto de un módulo
|
|
3
|
-
* @author Juan Escobar - automatic
|
|
4
|
-
* @createdAt 2024-10-09 19:56:26 - automatic
|
|
5
|
-
* @updatedAt 2024-10-09 20:00:30 - automatic
|
|
6
|
-
* @updatedUser Juan Escobar - automatic
|
|
7
3
|
*/
|
|
8
4
|
export declare const useModule: () => import('../../layouts/ModuleLayout/contexts/ModuleContext/types').ModuleLayoutContextProps;
|
|
9
5
|
export default useModule;
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
import { M } from "./components/MFNoAuthApp/index.js";
|
|
2
|
-
import { M as M2 } from "./components/MFHostApp/
|
|
2
|
+
import { M as M2 } from "./components/MFHostApp/MFHostApp.js";
|
|
3
|
+
import { M as M3 } from "./components/ModuleDetailTabs/ModuleDetailTabs.js";
|
|
3
4
|
import { A, a } from "./contexts/AuthContext/index.js";
|
|
4
|
-
import { M as
|
|
5
|
-
import { M as M4 } from "./layouts/MasterDetailLayout/MasterDetailLayout.js";
|
|
5
|
+
import { M as M4 } from "./layouts/ModuleLayout/ModuleLayout.js";
|
|
6
6
|
import { N } from "./layouts/NoAuthModuleLayout/index.js";
|
|
7
7
|
import { d, g } from "./layouts/ModuleLayout/dicctionary.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { M as M5 } from "./layouts/MasterDetailLayout/MasterDetailLayout.js";
|
|
9
|
+
import { g as g2 } from "./layouts/MasterDetailLayout/dicctionary.js";
|
|
10
|
+
import { d as d2, g as g3 } from "./layouts/NoAuthModuleLayout/dicctionary.js";
|
|
10
11
|
import { u } from "./hooks/useMasterDetail/index.js";
|
|
11
12
|
import { u as u2 } from "./hooks/useAuth/index.js";
|
|
12
13
|
import { u as u3 } from "./hooks/useModule/index.js";
|
|
14
|
+
import { u as u4 } from "./hooks/useDynamicAccordions/useDynamicAccordions.js";
|
|
15
|
+
import { c } from "./utils/createAppMF.js";
|
|
13
16
|
export {
|
|
14
17
|
A as AuthContext,
|
|
15
18
|
a as AuthProvider,
|
|
16
19
|
M2 as MFHostApp,
|
|
17
20
|
M as MFNoAuthApp,
|
|
18
|
-
|
|
19
|
-
M3 as
|
|
21
|
+
M5 as MasterDetailLayout,
|
|
22
|
+
M3 as ModuleDetailTabs,
|
|
23
|
+
M4 as ModuleLayout,
|
|
20
24
|
N as NoAuthModuleLayout,
|
|
21
|
-
|
|
25
|
+
c as createAppMF,
|
|
22
26
|
d as defaultModuleLayoutDictionary,
|
|
23
|
-
|
|
27
|
+
d2 as defaultNoAuthModuleLayoutDictionary,
|
|
24
28
|
g2 as getMasterDetailLayoutComponentsDictionary,
|
|
25
29
|
g as getModuleLayoutComponentsDictionary,
|
|
26
30
|
g3 as getNoAuthModuleLayoutComponentsDictionary,
|
|
27
31
|
u2 as useAuth,
|
|
32
|
+
u4 as useDynamicAccordions,
|
|
28
33
|
u as useMasterDetail,
|
|
29
34
|
u3 as useModule
|
|
30
35
|
};
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { MasterDetailLayoutProps } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Layout de maestro detalle
|
|
4
|
-
* @author Juan Escobar - automatic
|
|
5
|
-
* @createdAt 2024-10-09 19:56:26 - automatic
|
|
6
|
-
* @updatedAt 2024-12-05 10:48:46 - automatic
|
|
7
|
-
* @updatedUser Bruce Escobar - automatic
|
|
8
4
|
*/
|
|
9
5
|
export declare function MasterDetailLayout(props: MasterDetailLayoutProps): import("react/jsx-runtime").JSX.Element;
|