dgrcorrientes-modulos 1.0.0
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/.nvmrc +1 -0
- package/.prettierrc.cjs +8 -0
- package/.storybook/main.cjs +11 -0
- package/.storybook/manager-head.html +2 -0
- package/.storybook/manager.cjs +6 -0
- package/.storybook/preview-head.html +3 -0
- package/.storybook/preview.cjs +11 -0
- package/.storybook/themes.cjs +14 -0
- package/README.md +21 -0
- package/StoryBook.txt +19 -0
- package/dist-config.cjs +57 -0
- package/index.html +13 -0
- package/package.json +60 -0
- package/public/elevation.ico +0 -0
- package/public/elevationImage.png +0 -0
- package/public/vite.svg +1 -0
- package/src/App.scss +36 -0
- package/src/App.tsx +34 -0
- package/src/assets/react.svg +1 -0
- package/src/index.js +70 -0
- package/src/index.scss +63 -0
- package/src/index.ts +108 -0
- package/src/main.tsx +11 -0
- package/src/sass/base/_base.scss +50 -0
- package/src/sass/base/_controls.scss +90 -0
- package/src/sass/base/_datepicker.scss +114 -0
- package/src/sass/base/_typo.scss +71 -0
- package/src/sass/base/fonts/SFUIText-Bold.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-BoldItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Heavy.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-HeavyItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Light.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-LightItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Medium.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-MediumItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Regular.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-RegularItalic.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-Semibold.ttf +0 -0
- package/src/sass/base/fonts/SFUIText-SemiboldItalic.ttf +0 -0
- package/src/sass/bulma/bulma-changes.scss +19 -0
- package/src/sass/bulma/extensions/extensions.sass +1 -0
- package/src/sass/bulma/extensions/steps/bulma-steps.sass +3 -0
- package/src/sass/bulma/extensions/steps/index.sass +421 -0
- package/src/sass/bulma/variables/_variables-bulma.sass +16 -0
- package/src/sass/bulma/variables/components/card.sass +20 -0
- package/src/sass/bulma/variables/components/navbar.sass +50 -0
- package/src/sass/bulma/variables/components/tabs.sass +28 -0
- package/src/sass/bulma/variables/elements/button.sass +46 -0
- package/src/sass/bulma/variables/elements/notification.sass +8 -0
- package/src/sass/bulma/variables/elements/title.sass +20 -0
- package/src/sass/bulma/variables/grid/column.sass +2 -0
- package/src/sass/main.sass +16 -0
- package/src/sass/utilities/_bulma-variables.sass +20 -0
- package/src/sass/utilities/_derived-variables.scss +68 -0
- package/src/sass/utilities/_helpers.scss +70 -0
- package/src/sass/utilities/_variables.scss +147 -0
- package/src/stories/Changelog.stories.tsx +73 -0
- package/src/stories/Components/AssistanceDiary/AssistanceDiary.scss +19 -0
- package/src/stories/Components/AssistanceDiary/AssistanceDiary.stories.tsx +25 -0
- package/src/stories/Components/AssistanceDiary/AssistanceDiary.tsx +57 -0
- package/src/stories/Components/AverageAttended/AverageAttended.scss +39 -0
- package/src/stories/Components/AverageAttended/AverageAttended.stories.tsx +71 -0
- package/src/stories/Components/AverageAttended/AverageAttended.tsx +311 -0
- package/src/stories/Components/Breadcrumb/Breadcrumb.stories.tsx +45 -0
- package/src/stories/Components/Breadcrumb/Breadcrumb.tsx +68 -0
- package/src/stories/Components/Breadcrumb/breadcrumb.scss +82 -0
- package/src/stories/Components/CTA/CTA.scss +76 -0
- package/src/stories/Components/CTA/CTA.stories.tsx +46 -0
- package/src/stories/Components/CTA/CTA.tsx +70 -0
- package/src/stories/Components/Cards/Card CTA/CardCta.stories.tsx +34 -0
- package/src/stories/Components/Cards/Card CTA/CardCta.tsx +81 -0
- package/src/stories/Components/Cards/Card CTA/cardCta.scss +71 -0
- package/src/stories/Components/Cards/Card Expiration/cardExpiration.scss +105 -0
- package/src/stories/Components/Cards/Card Expiration/cardExpiration.stories.tsx +40 -0
- package/src/stories/Components/Cards/Card Expiration/cardExpiration.tsx +95 -0
- package/src/stories/Components/Cards/Card Vertical/CardVertical.stories.tsx +43 -0
- package/src/stories/Components/Cards/Card Vertical/CardVertical.tsx +106 -0
- package/src/stories/Components/Cards/Card Vertical/cardVertical.scss +130 -0
- package/src/stories/Components/Cards/CardActivity/cardActivity.scss +31 -0
- package/src/stories/Components/Cards/CardActivity/cardActivity.stories.tsx +20 -0
- package/src/stories/Components/Cards/CardActivity/cardActivity.tsx +48 -0
- package/src/stories/Components/Cards/CardHorizontal/CardHorizontal.stories.tsx +96 -0
- package/src/stories/Components/Cards/CardHorizontal/CardHorizontal.tsx +94 -0
- package/src/stories/Components/Cards/CardHorizontal/cardHorizontal.scss +65 -0
- package/src/stories/Components/Cards/CardUser/CardUser.stories.tsx +135 -0
- package/src/stories/Components/Cards/CardUser/CardUser.tsx +122 -0
- package/src/stories/Components/Cards/CardUser/cardUser.scss +115 -0
- package/src/stories/Components/Cart/Cart.scss +279 -0
- package/src/stories/Components/Cart/Cart.stories.tsx +350 -0
- package/src/stories/Components/Cart/Cart.tsx +277 -0
- package/src/stories/Components/Collapse/Collapse.scss +339 -0
- package/src/stories/Components/Collapse/Collapse.stories.tsx +766 -0
- package/src/stories/Components/Collapse/Collapse.tsx +451 -0
- package/src/stories/Components/CollapseEdit/CollapseEdit.scss +128 -0
- package/src/stories/Components/CollapseEdit/CollapseEdit.stories.tsx +29 -0
- package/src/stories/Components/CollapseEdit/CollapseEdit.tsx +185 -0
- package/src/stories/Components/CompleteDiary/CompleteDiary.scss +165 -0
- package/src/stories/Components/CompleteDiary/CompleteDiary.stories.tsx +219 -0
- package/src/stories/Components/CompleteDiary/CompleteDiary.tsx +394 -0
- package/src/stories/Components/Dropdown/Dropdown.scss +60 -0
- package/src/stories/Components/Dropdown/Dropdown.stories.tsx +19 -0
- package/src/stories/Components/Dropdown/Dropdown.tsx +99 -0
- package/src/stories/Components/EmptyState/EmptyState.stories.tsx +46 -0
- package/src/stories/Components/EmptyState/EmptyState.tsx +44 -0
- package/src/stories/Components/EmptyState/emptyState.scss +75 -0
- package/src/stories/Components/ErrorPage/ErrorPage.scss +65 -0
- package/src/stories/Components/ErrorPage/ErrorPage.stories.tsx +164 -0
- package/src/stories/Components/ErrorPage/ErrorPage.tsx +107 -0
- package/src/stories/Components/IncomingCall/IncomingCall.scss +27 -0
- package/src/stories/Components/IncomingCall/IncomingCall.stories.tsx +43 -0
- package/src/stories/Components/IncomingCall/IncomingCall.tsx +76 -0
- package/src/stories/Components/ModalConfirm/ModalConfirm.scss +30 -0
- package/src/stories/Components/ModalConfirm/ModalConfirm.stories.tsx +21 -0
- package/src/stories/Components/ModalConfirm/ModalConfirm.tsx +118 -0
- package/src/stories/Components/Pagination/Pagination.scss +42 -0
- package/src/stories/Components/Pagination/Pagination.stories.tsx +25 -0
- package/src/stories/Components/Pagination/Pagination.tsx +143 -0
- package/src/stories/Components/PerformanceAssessment/PerformanceAssessment.scss +26 -0
- package/src/stories/Components/PerformanceAssessment/PerformanceAssessment.stories.tsx +27 -0
- package/src/stories/Components/PerformanceAssessment/PerformanceAssessment.tsx +108 -0
- package/src/stories/Components/ShiftDiary/ShiftDiary.scss +45 -0
- package/src/stories/Components/ShiftDiary/ShiftDiary.stories.tsx +32 -0
- package/src/stories/Components/ShiftDiary/ShiftDiary.tsx +92 -0
- package/src/stories/Components/Stepper/Stepper.stories.tsx +26 -0
- package/src/stories/Components/Stepper/Stepper.tsx +102 -0
- package/src/stories/Components/Stepper/stepper.scss +59 -0
- package/src/stories/Components/Tabs/Tabs.stories.tsx +76 -0
- package/src/stories/Components/Tabs/Tabs.tsx +111 -0
- package/src/stories/Components/Tabs/tabs.scss +118 -0
- package/src/stories/Components/Tooltip/Tooltip.scss +235 -0
- package/src/stories/Components/Tooltip/Tooltip.stories.tsx +125 -0
- package/src/stories/Components/Tooltip/Tooltip.tsx +222 -0
- package/src/stories/Elements/Alert/Alert.stories.tsx +65 -0
- package/src/stories/Elements/Alert/Alert.tsx +49 -0
- package/src/stories/Elements/Alert/alert.scss +189 -0
- package/src/stories/Elements/Badge/Badge.stories.tsx +15 -0
- package/src/stories/Elements/Badge/Badge.tsx +21 -0
- package/src/stories/Elements/Badge/badge.scss +24 -0
- package/src/stories/Elements/Button/Button.stories.tsx +54 -0
- package/src/stories/Elements/Button/Button.tsx +118 -0
- package/src/stories/Elements/Button/button.scss +102 -0
- package/src/stories/Elements/Icon/Icon.stories.tsx +33 -0
- package/src/stories/Elements/Icon/Icon.tsx +57 -0
- package/src/stories/Elements/Icon/icon.scss +15 -0
- package/src/stories/Elements/Icon/icono.svg +1 -0
- package/src/stories/Elements/ProgressBar/ProgressBar.scss +26 -0
- package/src/stories/Elements/ProgressBar/ProgressBar.stories.tsx +19 -0
- package/src/stories/Elements/ProgressBar/ProgressBar.tsx +35 -0
- package/src/stories/Form/Autocomplete/Autocomplete.stories.tsx +55 -0
- package/src/stories/Form/Autocomplete/Autocomplete.tsx +160 -0
- package/src/stories/Form/Autocomplete/autocomplete.scss +311 -0
- package/src/stories/Form/Autocomplete-Prueba/Autocomplete.stories.tsx +50 -0
- package/src/stories/Form/Autocomplete-Prueba/AutocompletePrueba.tsx +83 -0
- package/src/stories/Form/Checkbox/Checkbox.stories.tsx +26 -0
- package/src/stories/Form/Checkbox/Checkbox.tsx +89 -0
- package/src/stories/Form/Checkbox/checkbox.scss +41 -0
- package/src/stories/Form/DatePicker/DatePickerExample.stories.tsx +27 -0
- package/src/stories/Form/DatePicker/DatePickerExample.tsx +65 -0
- package/src/stories/Form/DatePickerComponent/DatePickerComponent.scss +116 -0
- package/src/stories/Form/DatePickerComponent/DatePickerComponent.stories.tsx +37 -0
- package/src/stories/Form/DatePickerComponent/DatePickerComponent.tsx +97 -0
- package/src/stories/Form/Filters/Filters.stories.tsx +84 -0
- package/src/stories/Form/Filters/Filters.tsx +230 -0
- package/src/stories/Form/Filters/filters.scss +261 -0
- package/src/stories/Form/Input/Input.stories.tsx +25 -0
- package/src/stories/Form/Input/Input.tsx +86 -0
- package/src/stories/Form/Input/InputVar.sass +26 -0
- package/src/stories/Form/Input/input.scss +19 -0
- package/src/stories/Form/InputFormControl/Input-form-control.stories.tsx +26 -0
- package/src/stories/Form/InputFormControl/Input-form-control.tsx +48 -0
- package/src/stories/Form/InputFormControl/input-form-control.scss +34 -0
- package/src/stories/Form/Radio/Radio.stories.tsx +19 -0
- package/src/stories/Form/Radio/Radio.tsx +84 -0
- package/src/stories/Form/Radio/radio.scss +19 -0
- package/src/stories/Form/Search/Search.scss +50 -0
- package/src/stories/Form/Search/Search.stories.tsx +26 -0
- package/src/stories/Form/Search/Search.tsx +84 -0
- package/src/stories/Form/Select/Select.stories.tsx +55 -0
- package/src/stories/Form/Select/Select.tsx +121 -0
- package/src/stories/Form/Select/select.scss +303 -0
- package/src/stories/Form/Switch/Switch.stories.tsx +17 -0
- package/src/stories/Form/Switch/Switch.tsx +36 -0
- package/src/stories/Form/Switch/switch.scss +123 -0
- package/src/stories/Form/Textarea/Textarea.stories.tsx +19 -0
- package/src/stories/Form/Textarea/Textarea.tsx +52 -0
- package/src/stories/Form/Textarea/textarea.scss +25 -0
- package/src/stories/Form/UploadFileItem/UploadFileItem.scss +49 -0
- package/src/stories/Form/UploadFileItem/UploadFileItem.stories.tsx +18 -0
- package/src/stories/Form/UploadFileItem/UploadFileItem.tsx +89 -0
- package/src/stories/Form/UploadFiles/UploadFiles.scss +17 -0
- package/src/stories/Form/UploadFiles/UploadFiles.stories.tsx +32 -0
- package/src/stories/Form/UploadFiles/UploadFiles.tsx +177 -0
- package/src/stories/Layout/Footer/Footer.scss +129 -0
- package/src/stories/Layout/Footer/Footer.stories.tsx +101 -0
- package/src/stories/Layout/Footer/Footer.tsx +81 -0
- package/src/stories/Layout/Header/Header.scss +190 -0
- package/src/stories/Layout/Header/Header.stories.tsx +223 -0
- package/src/stories/Layout/Header/Header.tsx +278 -0
- package/src/stories/Layout/HeaderTable/HeaderTable.scss +21 -0
- package/src/stories/Layout/HeaderTable/HeaderTable.stories.tsx +112 -0
- package/src/stories/Layout/HeaderTable/HeaderTable.tsx +72 -0
- package/src/stories/Layout/Sidebar/Sidebar.scss +50 -0
- package/src/stories/Layout/Sidebar/Sidebar.stories.tsx +744 -0
- package/src/stories/Layout/Sidebar/Sidebar.tsx +129 -0
- package/src/stories/Layout/SidebarEmpty/SidebarEmpty.scss +64 -0
- package/src/stories/Layout/SidebarEmpty/SidebarEmpty.stories.tsx +26 -0
- package/src/stories/Layout/SidebarEmpty/SidebarEmpty.tsx +100 -0
- package/src/stories/Layout/Subtitle/Subtitle.scss +88 -0
- package/src/stories/Layout/Subtitle/Subtitle.stories.tsx +46 -0
- package/src/stories/Layout/Subtitle/Subtitle.tsx +108 -0
- package/src/stories/Layout/Title/Title.scss +79 -0
- package/src/stories/Layout/Title/Title.stories.tsx +86 -0
- package/src/stories/Layout/Title/Title.tsx +96 -0
- package/src/stories/Welcome.stories.tsx +111 -0
- package/src/stories/assets/404 Page Not Found _Two Color (1).png +0 -0
- package/src/stories/assets/404 Page Not Found _Two Color.png +0 -0
- package/src/stories/assets/Empty Inbox _Two Color.png +0 -0
- package/src/stories/assets/Loading _Two Color.png +0 -0
- package/src/stories/assets/Notifications_Two Color 1.png +0 -0
- package/src/stories/assets/Online protection_Two Color.png +0 -0
- package/src/stories/assets/Under Constructions _Two Color.png +0 -0
- package/src/stories/assets/bulma.png +0 -0
- package/src/stories/assets/burger.svg +5 -0
- package/src/stories/assets/code-brackets.svg +1 -0
- package/src/stories/assets/colors.svg +1 -0
- package/src/stories/assets/comments.svg +1 -0
- package/src/stories/assets/decor-bg.png +0 -0
- package/src/stories/assets/direction.svg +1 -0
- package/src/stories/assets/e-isologo.svg +4 -0
- package/src/stories/assets/e-isotype.svg +4 -0
- package/src/stories/assets/e-logo_negative.svg +14 -0
- package/src/stories/assets/e-logotype.svg +14 -0
- package/src/stories/assets/flow.svg +1 -0
- package/src/stories/assets/logo_gobierno_corrientes.svg +9 -0
- package/src/stories/assets/logo_rentas_corrientes.svg +10 -0
- package/src/stories/assets/logo_rentas_corrientes_compacto.svg +10 -0
- package/src/stories/assets/plugin.svg +1 -0
- package/src/stories/assets/repo.svg +1 -0
- package/src/stories/assets/stackalt.svg +1 -0
- package/src/stories/assets/storybook.svg +13 -0
- package/src/stories/assets/thumbnail-black.jpg +0 -0
- package/src/stories/assets/thumbnail-black[2].jpg +0 -0
- package/src/stories/assets/thumbnail.jpg +0 -0
- package/src/stories/assets/thumbnail[2].jpg +0 -0
- package/src/stories/changelog.ts +389 -0
- package/src/utils/functions.ts +57 -0
- package/src/vite-env.d.ts +2 -0
- package/static/e-isologo-192.jpg +0 -0
- package/static/e-isologo.svg +4 -0
- package/static/e-logotype.svg +14 -0
- package/static/favicon.ico +0 -0
- package/tsconfig.json +22 -0
- package/tsconfig.node.json +9 -0
- package/vite.config.ts +22 -0
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import React, {useEffect, useRef, useState} from 'react';
|
|
2
|
+
import './Collapse.scss';
|
|
3
|
+
import {Badge, BadgeProps} from '../../Elements/Badge/Badge';
|
|
4
|
+
import {Button, IButton} from '../../Elements/Button/Button';
|
|
5
|
+
import {Checkbox, ICheckbox} from '../../Form/Checkbox/Checkbox';
|
|
6
|
+
import {Icon, IIcon} from '../../Elements/Icon/Icon';
|
|
7
|
+
import {Tooltip, ITooltip} from '../Tooltip/Tooltip';
|
|
8
|
+
import {Radio, IRadio} from '../../Form/Radio/Radio';
|
|
9
|
+
import {ISelect, Select} from '../../Form/Select/Select';
|
|
10
|
+
import {generateRandomKey} from '../../../utils/functions';
|
|
11
|
+
import {CollapseEdit, ICollapseEdit, IDataPrice} from '../CollapseEdit/CollapseEdit';
|
|
12
|
+
import {Input} from '../../Form/Input/Input';
|
|
13
|
+
|
|
14
|
+
type ICollapseOrEmptyObject = ICollapse | {};
|
|
15
|
+
|
|
16
|
+
export interface ICollapse extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
17
|
+
type: 'father' | 'child' | 'nephew';
|
|
18
|
+
paddingLeft?: 'short' | 'long';
|
|
19
|
+
isFather?: boolean;
|
|
20
|
+
className?: string;
|
|
21
|
+
show?: boolean;
|
|
22
|
+
initialState?: boolean;
|
|
23
|
+
childCollapse?: ICollapse[];
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
colored?: boolean;
|
|
26
|
+
borderBottom?: boolean;
|
|
27
|
+
borderTop?: boolean;
|
|
28
|
+
collapseEdit?: ICollapseEdit;
|
|
29
|
+
showAmountinEdit?: boolean;
|
|
30
|
+
|
|
31
|
+
// LEFT
|
|
32
|
+
title?: string;
|
|
33
|
+
stateTitle?: {color?: string; label?: string};
|
|
34
|
+
titleWeight?: 'regular' | 'semibold';
|
|
35
|
+
titleIcon?: IIcon;
|
|
36
|
+
description?: string;
|
|
37
|
+
badge?: BadgeProps;
|
|
38
|
+
details?: string;
|
|
39
|
+
dateDays?: string;
|
|
40
|
+
dateTime?: string;
|
|
41
|
+
|
|
42
|
+
// RIGHT
|
|
43
|
+
price?: number;
|
|
44
|
+
priceColor?: string;
|
|
45
|
+
priceTop?: {description?: string; value?: number};
|
|
46
|
+
priceBottom?: {description?: string; value?: number};
|
|
47
|
+
priceLeft?: {checkbox?: ICheckbox; label?: string};
|
|
48
|
+
buttonMenu?: {button: IButton; select?: ISelect; menuDropComponent?: React.ReactNode; onEllipse?: () => void};
|
|
49
|
+
buttonLink?: IButton;
|
|
50
|
+
buttonDetail?: {button: IButton; tooltip?: ITooltip; tooltipPos?: 'top' | 'bottom'};
|
|
51
|
+
|
|
52
|
+
dropRightButton?: IButton;
|
|
53
|
+
buttonEdit?: IButton;
|
|
54
|
+
checkbox?: ICheckbox;
|
|
55
|
+
callBackCheckbox?: (object: ICollapseOrEmptyObject) => void;
|
|
56
|
+
radio?: IRadio;
|
|
57
|
+
|
|
58
|
+
onSaveData?: (Data: IDataPrice) => void;
|
|
59
|
+
onCalculateClick?: (value: number) => void;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export const Collapse = ({
|
|
63
|
+
type,
|
|
64
|
+
paddingLeft,
|
|
65
|
+
isFather,
|
|
66
|
+
className,
|
|
67
|
+
show,
|
|
68
|
+
initialState,
|
|
69
|
+
childCollapse,
|
|
70
|
+
disabled,
|
|
71
|
+
colored,
|
|
72
|
+
borderBottom,
|
|
73
|
+
borderTop,
|
|
74
|
+
title,
|
|
75
|
+
stateTitle,
|
|
76
|
+
titleWeight,
|
|
77
|
+
titleIcon,
|
|
78
|
+
description,
|
|
79
|
+
badge,
|
|
80
|
+
details,
|
|
81
|
+
dateDays,
|
|
82
|
+
dateTime,
|
|
83
|
+
price,
|
|
84
|
+
priceColor,
|
|
85
|
+
priceTop,
|
|
86
|
+
priceBottom,
|
|
87
|
+
priceLeft,
|
|
88
|
+
buttonMenu,
|
|
89
|
+
buttonLink,
|
|
90
|
+
buttonDetail,
|
|
91
|
+
dropRightButton,
|
|
92
|
+
buttonEdit,
|
|
93
|
+
checkbox,
|
|
94
|
+
collapseEdit,
|
|
95
|
+
callBackCheckbox,
|
|
96
|
+
radio,
|
|
97
|
+
onSaveData,
|
|
98
|
+
showAmountinEdit,
|
|
99
|
+
...props
|
|
100
|
+
}: ICollapse) => {
|
|
101
|
+
const [isExpanded, setIsExpanded] = useState(initialState);
|
|
102
|
+
const [detailExpanded, setDetailExpanded] = useState(false);
|
|
103
|
+
const [menuExpanded, setMenuExpanded] = useState(false);
|
|
104
|
+
const [edit, setEdit] = useState(false);
|
|
105
|
+
const [disable, setDisable] = useState(disabled);
|
|
106
|
+
const [cantidad, setCantidad] = useState(price);
|
|
107
|
+
const [isChecked, setIsChecked] = useState(false);
|
|
108
|
+
|
|
109
|
+
const handleClickExpand = () => {
|
|
110
|
+
setIsExpanded(!isExpanded);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const handleClickEdit = () => {
|
|
114
|
+
setEdit(!edit);
|
|
115
|
+
setDisable(!disable);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const handleCantidadChange = (cantidad: number) => {
|
|
119
|
+
setCantidad(cantidad);
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const menuDropRef = useRef<HTMLDivElement>(null);
|
|
123
|
+
useEffect(() => {
|
|
124
|
+
function handleClickOutside(event: MouseEvent) {
|
|
125
|
+
if (menuDropRef.current && !menuDropRef.current.contains(event.target as Node)) {
|
|
126
|
+
setMenuExpanded(false);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
document.addEventListener('click', handleClickOutside);
|
|
131
|
+
|
|
132
|
+
return () => {
|
|
133
|
+
document.removeEventListener('click', handleClickOutside);
|
|
134
|
+
};
|
|
135
|
+
}, [menuDropRef]);
|
|
136
|
+
|
|
137
|
+
const detailsDropRef = useRef<HTMLDivElement>(null);
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
function handleClickOutside(event: MouseEvent) {
|
|
140
|
+
if (detailsDropRef.current && !detailsDropRef.current.contains(event.target as Node)) {
|
|
141
|
+
setDetailExpanded(false);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
document.addEventListener('click', handleClickOutside);
|
|
146
|
+
|
|
147
|
+
return () => {
|
|
148
|
+
document.removeEventListener('click', handleClickOutside);
|
|
149
|
+
};
|
|
150
|
+
}, [detailsDropRef]);
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div className={`elv-component elv-collapse ${className ? className : ''}`} {...props}>
|
|
154
|
+
{!edit && !disable ? (
|
|
155
|
+
<div
|
|
156
|
+
className={[
|
|
157
|
+
'e-collapse',
|
|
158
|
+
`${show ? ' e-collapse--show' : ' e-collapse--hide'}`,
|
|
159
|
+
`${colored ? ' e-collapse--colored-gray' : ''}`,
|
|
160
|
+
`${borderTop ? ' e-collapse--borderTop' : ''}`,
|
|
161
|
+
`${className ? ' ' + className : ''}`,
|
|
162
|
+
].join('')}
|
|
163
|
+
>
|
|
164
|
+
<div
|
|
165
|
+
className={`e-collapse__container ${'e-collapse__container--' + type} ${
|
|
166
|
+
paddingLeft && paddingLeft === 'short'
|
|
167
|
+
? 'e-collapse__container--' + type + '--short'
|
|
168
|
+
: 'e-collapse__container--' + type + '--long'
|
|
169
|
+
} ${disabled ? 'e-collapse__container--disabled' : ''} ${borderBottom ? 'e-collapse__container--borderBottom' : ''} ${
|
|
170
|
+
title && !description && !details ? 'e-collapse__container--' + type + '--onlyTitle ' : ''
|
|
171
|
+
}is-flex is-justify-content-space-between`}
|
|
172
|
+
>
|
|
173
|
+
<div
|
|
174
|
+
className="left-container is-flex"
|
|
175
|
+
style={{cursor: isFather && !disabled ? 'pointer' : 'auto'}}
|
|
176
|
+
onClick={() => {
|
|
177
|
+
if (isFather && !disabled) {
|
|
178
|
+
handleClickExpand();
|
|
179
|
+
}
|
|
180
|
+
}}
|
|
181
|
+
>
|
|
182
|
+
{isFather && (
|
|
183
|
+
<div className={`left-container__dropIcon`} style={stateTitle && {paddingTop: '28px'}}>
|
|
184
|
+
<Icon icon={'fa-solid fa-chevron-right'} className={`icon-drop ${isExpanded && 'rotate'}`}></Icon>
|
|
185
|
+
</div>
|
|
186
|
+
)}
|
|
187
|
+
<div className="left-container__texts is-flex is-flex-direction-column is-justify-content-center">
|
|
188
|
+
{stateTitle && (
|
|
189
|
+
<div className="state-title is-flex" style={{color: stateTitle?.color}}>
|
|
190
|
+
<Icon icon="fa-solid fa-circle"></Icon> <p className="state-title__text">{stateTitle?.label}</p>
|
|
191
|
+
</div>
|
|
192
|
+
)}
|
|
193
|
+
<div className="title-container is-flex is-align-items-center">
|
|
194
|
+
{titleIcon && <Icon {...titleIcon}></Icon>}
|
|
195
|
+
{badge && <Badge {...badge}></Badge>}
|
|
196
|
+
{title && (
|
|
197
|
+
<p
|
|
198
|
+
className={`title-container__title title-container__title${
|
|
199
|
+
titleWeight && titleWeight == 'regular' ? '--regular' : '--semibold'
|
|
200
|
+
}`}
|
|
201
|
+
>
|
|
202
|
+
{title}
|
|
203
|
+
</p>
|
|
204
|
+
)}
|
|
205
|
+
</div>
|
|
206
|
+
{description && <p className="description">{description}</p>}
|
|
207
|
+
|
|
208
|
+
{details && <p className="details">{details}</p>}
|
|
209
|
+
{(dateDays || dateTime) && (
|
|
210
|
+
<div className="date is-flex">
|
|
211
|
+
{dateDays && (
|
|
212
|
+
<span className="date__days is-flex is-align-items-center">
|
|
213
|
+
<Icon icon="fa-solid fa-calendar-days"></Icon>
|
|
214
|
+
<p>{dateDays}</p>
|
|
215
|
+
</span>
|
|
216
|
+
)}
|
|
217
|
+
{dateTime && (
|
|
218
|
+
<span className="date__time is-flex is-align-items-center">
|
|
219
|
+
<Icon icon="fa-solid fa-clock"></Icon>
|
|
220
|
+
<p>{dateTime}</p>
|
|
221
|
+
</span>
|
|
222
|
+
)}
|
|
223
|
+
</div>
|
|
224
|
+
)}
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
<div className="right-container is-flex is-align-items-center">
|
|
228
|
+
{buttonDetail && (
|
|
229
|
+
<span className="right-container__buttonDetail" ref={detailsDropRef}>
|
|
230
|
+
<Button
|
|
231
|
+
{...buttonDetail.button}
|
|
232
|
+
onClick={() => {
|
|
233
|
+
setDetailExpanded(!detailExpanded);
|
|
234
|
+
buttonDetail.button.onClick && buttonDetail.button.onClick();
|
|
235
|
+
}}
|
|
236
|
+
/>
|
|
237
|
+
{buttonDetail.tooltip ? (
|
|
238
|
+
<div
|
|
239
|
+
className={`detail-tooltip ${buttonDetail.tooltipPos === 'top' ? 'detail-tooltip--top' : 'detail-tooltip--bottom'}`}
|
|
240
|
+
>
|
|
241
|
+
<Tooltip {...buttonDetail.tooltip} active={detailExpanded} />
|
|
242
|
+
</div>
|
|
243
|
+
) : (
|
|
244
|
+
<></>
|
|
245
|
+
)}
|
|
246
|
+
</span>
|
|
247
|
+
)}
|
|
248
|
+
<div className="right-container__price is-flex">
|
|
249
|
+
{priceLeft && priceLeft.checkbox && (
|
|
250
|
+
<div className="is-flex is-align-items-center">
|
|
251
|
+
<Checkbox {...priceLeft.checkbox}></Checkbox>
|
|
252
|
+
</div>
|
|
253
|
+
)}
|
|
254
|
+
<div className="col-price is-flex is-flex-direction-column is-align-items-end">
|
|
255
|
+
{priceTop && (
|
|
256
|
+
<span className="col-price__top is-flex is-align-items-center">
|
|
257
|
+
<p className="desc">{priceTop.description}</p>
|
|
258
|
+
<p className="value">$ {priceTop.value}</p>
|
|
259
|
+
</span>
|
|
260
|
+
)}
|
|
261
|
+
{price && (
|
|
262
|
+
<p className="col-price__price" style={priceColor && priceColor != '' ? {color: priceColor} : {color: 'none'}}>
|
|
263
|
+
${price}
|
|
264
|
+
</p>
|
|
265
|
+
)}
|
|
266
|
+
{priceBottom && (
|
|
267
|
+
<span className="col-price__bottom is-flex is-align-items-center">
|
|
268
|
+
<p className="desc">{priceBottom.description}</p>
|
|
269
|
+
<p className="value">$ {priceBottom.value}</p>
|
|
270
|
+
</span>
|
|
271
|
+
)}
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
{buttonMenu && (
|
|
275
|
+
<div className="right-container__buttonMenu is-flex is-align-items-center is-relative" ref={menuDropRef}>
|
|
276
|
+
<span className="menu-button ">
|
|
277
|
+
<Button
|
|
278
|
+
{...buttonMenu.button}
|
|
279
|
+
onClick={() => {
|
|
280
|
+
setMenuExpanded(!menuExpanded), buttonMenu.onEllipse && buttonMenu.onEllipse();
|
|
281
|
+
}}
|
|
282
|
+
/>
|
|
283
|
+
</span>
|
|
284
|
+
{menuExpanded && buttonMenu.menuDropComponent && (
|
|
285
|
+
<div className="menu-drop-component is-absolute">{buttonMenu.menuDropComponent}</div>
|
|
286
|
+
)}
|
|
287
|
+
|
|
288
|
+
{buttonMenu.select && (
|
|
289
|
+
<div className={`menu-select`} style={menuExpanded ? {display: 'block'} : {display: 'none'}}>
|
|
290
|
+
<Select {...buttonMenu.select} />
|
|
291
|
+
</div>
|
|
292
|
+
)}
|
|
293
|
+
</div>
|
|
294
|
+
)}
|
|
295
|
+
{dropRightButton && (
|
|
296
|
+
<div className="right-container__dropLeftButton is-flex">
|
|
297
|
+
<Button {...dropRightButton} />
|
|
298
|
+
</div>
|
|
299
|
+
)}
|
|
300
|
+
{buttonLink && (
|
|
301
|
+
<div className="right-container__buttonLink is-flex is-align-items-center">
|
|
302
|
+
<Button {...buttonLink} />
|
|
303
|
+
</div>
|
|
304
|
+
)}
|
|
305
|
+
{buttonEdit || checkbox || radio ? (
|
|
306
|
+
<div className="right-container__editCheckbox is-flex">
|
|
307
|
+
{buttonEdit && (
|
|
308
|
+
<div className="buttonEdit is-flex is-align-items-center">
|
|
309
|
+
<Button
|
|
310
|
+
{...buttonEdit}
|
|
311
|
+
onClick={() => {
|
|
312
|
+
handleClickEdit();
|
|
313
|
+
}}
|
|
314
|
+
/>
|
|
315
|
+
</div>
|
|
316
|
+
)}
|
|
317
|
+
{checkbox && (
|
|
318
|
+
<div className="_checkbox is-flex is-align-items-center">
|
|
319
|
+
<Checkbox
|
|
320
|
+
// defaultChecked={isChecked}
|
|
321
|
+
{...checkbox}
|
|
322
|
+
onCheck={state => {
|
|
323
|
+
setIsChecked(state);
|
|
324
|
+
if (callBackCheckbox) {
|
|
325
|
+
if (state) {
|
|
326
|
+
callBackCheckbox({
|
|
327
|
+
type,
|
|
328
|
+
paddingLeft,
|
|
329
|
+
isFather,
|
|
330
|
+
show,
|
|
331
|
+
initialState,
|
|
332
|
+
childCollapse,
|
|
333
|
+
disabled,
|
|
334
|
+
colored,
|
|
335
|
+
borderBottom,
|
|
336
|
+
borderTop,
|
|
337
|
+
title,
|
|
338
|
+
stateTitle,
|
|
339
|
+
titleWeight,
|
|
340
|
+
titleIcon,
|
|
341
|
+
description,
|
|
342
|
+
badge,
|
|
343
|
+
details,
|
|
344
|
+
dateDays,
|
|
345
|
+
dateTime,
|
|
346
|
+
price,
|
|
347
|
+
priceColor,
|
|
348
|
+
priceTop,
|
|
349
|
+
priceBottom,
|
|
350
|
+
priceLeft,
|
|
351
|
+
buttonMenu,
|
|
352
|
+
buttonLink,
|
|
353
|
+
buttonDetail,
|
|
354
|
+
dropRightButton,
|
|
355
|
+
buttonEdit,
|
|
356
|
+
});
|
|
357
|
+
} else {
|
|
358
|
+
callBackCheckbox({});
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}}
|
|
362
|
+
/>
|
|
363
|
+
</div>
|
|
364
|
+
)}
|
|
365
|
+
{radio && (
|
|
366
|
+
<div className="_radio is-flex is-align-items-center">
|
|
367
|
+
<Radio
|
|
368
|
+
{...radio}
|
|
369
|
+
onCheck={() => {
|
|
370
|
+
if (callBackCheckbox) {
|
|
371
|
+
callBackCheckbox({
|
|
372
|
+
type,
|
|
373
|
+
paddingLeft,
|
|
374
|
+
isFather,
|
|
375
|
+
show,
|
|
376
|
+
initialState,
|
|
377
|
+
childCollapse,
|
|
378
|
+
disabled,
|
|
379
|
+
colored,
|
|
380
|
+
borderBottom,
|
|
381
|
+
borderTop,
|
|
382
|
+
title,
|
|
383
|
+
stateTitle,
|
|
384
|
+
titleWeight,
|
|
385
|
+
titleIcon,
|
|
386
|
+
description,
|
|
387
|
+
badge,
|
|
388
|
+
details,
|
|
389
|
+
dateDays,
|
|
390
|
+
dateTime,
|
|
391
|
+
price,
|
|
392
|
+
priceColor,
|
|
393
|
+
priceTop,
|
|
394
|
+
priceBottom,
|
|
395
|
+
priceLeft,
|
|
396
|
+
buttonMenu,
|
|
397
|
+
buttonLink,
|
|
398
|
+
buttonDetail,
|
|
399
|
+
dropRightButton,
|
|
400
|
+
buttonEdit,
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
{
|
|
404
|
+
radio.onCheck && radio.onCheck();
|
|
405
|
+
}
|
|
406
|
+
}}
|
|
407
|
+
></Radio>
|
|
408
|
+
</div>
|
|
409
|
+
)}
|
|
410
|
+
</div>
|
|
411
|
+
) : (
|
|
412
|
+
<></>
|
|
413
|
+
)}
|
|
414
|
+
</div>
|
|
415
|
+
</div>
|
|
416
|
+
|
|
417
|
+
{childCollapse && childCollapse.map(item => <Collapse key={generateRandomKey()} {...item} show={isExpanded} />)}
|
|
418
|
+
</div>
|
|
419
|
+
) : (
|
|
420
|
+
<div className="">
|
|
421
|
+
<CollapseEdit
|
|
422
|
+
labelDescription="1001 - Tambos"
|
|
423
|
+
priceTopEdit={{labelImpost: 'Impuesto', labelNumberI: priceTop?.value}}
|
|
424
|
+
priceBottomEdit={{labelAliquot: 'Alícuota', labelNumberA: priceBottom?.value}}
|
|
425
|
+
className="collapseEdit"
|
|
426
|
+
checkbox={{label: 'Exento', disabled: false, size: 'sm', value: '', name: '', onCheck(checked) {}}}
|
|
427
|
+
inputAmount={{type: 'number', color: 'none', placeholder: 'Monto imponible', size: 'normal', onChange(value) {}}}
|
|
428
|
+
input={{type: 'number', color: 'none', placeholder: 'Cantidad', size: 'normal', onChange(value) {}}}
|
|
429
|
+
buttonRecalculate={{fill: 'unstyled', label: 'Recalcular', icon: 'fa-solid fa-rotate-right', trailingIcon: false, onClick() {}}}
|
|
430
|
+
buttonCancel={{
|
|
431
|
+
fill: 'unstyled',
|
|
432
|
+
color: 'secondary',
|
|
433
|
+
size: 'normal',
|
|
434
|
+
label: 'Cancelar',
|
|
435
|
+
onClick() {
|
|
436
|
+
setEdit(false);
|
|
437
|
+
setDisable(false);
|
|
438
|
+
},
|
|
439
|
+
}}
|
|
440
|
+
onSaveData={data => {
|
|
441
|
+
onSaveData && onSaveData({aliquot: data.aliquot, calculatedtax: data.calculatedtax});
|
|
442
|
+
setEdit(false);
|
|
443
|
+
setDisable(false);
|
|
444
|
+
}}
|
|
445
|
+
showAmountinEdit={showAmountinEdit}
|
|
446
|
+
/>
|
|
447
|
+
</div>
|
|
448
|
+
)}
|
|
449
|
+
</div>
|
|
450
|
+
);
|
|
451
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
@import '/src/sass/utilities/variables';
|
|
2
|
+
|
|
3
|
+
.elv-collapsedit {
|
|
4
|
+
.collapsedit {
|
|
5
|
+
border: 1px solid $truegray-300;
|
|
6
|
+
border-radius: 0px;
|
|
7
|
+
|
|
8
|
+
&__breakpoint4 {
|
|
9
|
+
@media screen and (max-width: 768px) {
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
padding: 16px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&__breakpoint3 {
|
|
16
|
+
@media screen and (max-width: 853px) {
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: flex-start !important;
|
|
19
|
+
gap: 10px;
|
|
20
|
+
}
|
|
21
|
+
@media screen and (max-width: 768px) {
|
|
22
|
+
align-items: center !important;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&__breakpoint2 {
|
|
27
|
+
@media screen and (max-width: 1060px) {
|
|
28
|
+
flex-direction: column;
|
|
29
|
+
align-items: center !important;
|
|
30
|
+
gap: 10px !important;
|
|
31
|
+
}
|
|
32
|
+
@media screen and (max-width: 768px) {
|
|
33
|
+
width: 100% !important;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&__breakpoint1 {
|
|
38
|
+
@media screen and (max-width: 1275px) {
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
align-items: center !important;
|
|
41
|
+
gap: 5px !important;
|
|
42
|
+
}
|
|
43
|
+
@media screen and (max-width: 768px) {
|
|
44
|
+
width: 100% !important;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
&__desc-cont {
|
|
48
|
+
@media screen and (max-width: 1110px) {
|
|
49
|
+
margin-right: 0px !important;
|
|
50
|
+
align-items: center !important;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__desc {
|
|
55
|
+
min-width: 130px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&__check {
|
|
59
|
+
min-width: 77px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__input {
|
|
63
|
+
@media screen and (max-width: 768px) {
|
|
64
|
+
width: 100% !important;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
&__inputAmount {
|
|
69
|
+
@media screen and (max-width: 1060px) {
|
|
70
|
+
margin-right: 0 !important;
|
|
71
|
+
}
|
|
72
|
+
@media screen and (max-width: 768px) {
|
|
73
|
+
width: 100% !important;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&__bottom {
|
|
78
|
+
min-width: 50px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&__top {
|
|
82
|
+
min-width: 50px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
input {
|
|
86
|
+
padding: 8px 12px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
button {
|
|
90
|
+
padding: 8px 16px;
|
|
91
|
+
}
|
|
92
|
+
&__buttonCont {
|
|
93
|
+
@media screen and (max-width: 768px) {
|
|
94
|
+
gap: 5px !important;
|
|
95
|
+
align-items: center;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
width: 100%;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
&__buttonRec {
|
|
102
|
+
color: $primary-600;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&__button {
|
|
106
|
+
border-left: 1px solid $truegray-300;
|
|
107
|
+
@media screen and (max-width: 768px) {
|
|
108
|
+
width: 100%;
|
|
109
|
+
border-left: none;
|
|
110
|
+
gap: 5px !important;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
.button-cancel {
|
|
115
|
+
width: 100px;
|
|
116
|
+
@media screen and (max-width: 768px) {
|
|
117
|
+
width: 100% !important;
|
|
118
|
+
margin-left: 0px !important;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
.button-save {
|
|
122
|
+
width: 100px;
|
|
123
|
+
@media screen and (max-width: 768px) {
|
|
124
|
+
width: 100% !important;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {ComponentStory, ComponentMeta} from '@storybook/react';
|
|
2
|
+
import {CollapseEdit} from './CollapseEdit';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Components/Collapsedit',
|
|
6
|
+
component: CollapseEdit,
|
|
7
|
+
args: {
|
|
8
|
+
labelDescription: '1001 - Tambos',
|
|
9
|
+
checkbox: {label: 'Exento', disabled: false, size: 'sm'},
|
|
10
|
+
input: {type: 'number', color: 'none', placeholder: 'Cantidad', onChange(value) {}},
|
|
11
|
+
inputAmount: {type: 'number', color: 'none', placeholder: 'Monto imponible'},
|
|
12
|
+
priceBottomEdit: {labelAliquot: 'Alícuota', labelNumberA: 2.9},
|
|
13
|
+
priceTopEdit: {labelImpost: 'Impuesto.', labelNumberI: 990},
|
|
14
|
+
buttonRecalculate: {fill: 'unstyled', label: 'Recalcular', icon: 'fa-solid fa-rotate-right', trailingIcon: false, onClick() {}},
|
|
15
|
+
buttonCancel: {
|
|
16
|
+
fill: 'unstyled',
|
|
17
|
+
color: 'secondary',
|
|
18
|
+
size: 'normal',
|
|
19
|
+
label: 'Cancelar',
|
|
20
|
+
onClick: () => console.log('buttonCancel Clicked'),
|
|
21
|
+
},
|
|
22
|
+
showAmountinEdit: true,
|
|
23
|
+
},
|
|
24
|
+
} as ComponentMeta<typeof CollapseEdit>;
|
|
25
|
+
|
|
26
|
+
const Template: ComponentStory<typeof CollapseEdit> = args => <CollapseEdit {...args} />;
|
|
27
|
+
|
|
28
|
+
export const Standard = Template.bind({});
|
|
29
|
+
Standard.args = {};
|