@widergy/energy-ui 3.159.0 → 3.160.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/CHANGELOG.md +19 -6
- package/dist/components/UTButton/README.md +17 -8
- package/dist/components/UTButton/index.js +26 -6
- package/dist/components/UTButton/stories/UTButton.stories.js +4 -1
- package/dist/components/UTButton/stories/UTButtonAdornments.stories.js +16 -11
- package/dist/components/UTButton/stories/storiesConstants.js +32 -10
- package/dist/components/UTButton/utils.js +52 -7
- package/dist/components/UTPanel/versions/V1/components/AdditionalContentModule/index.js +7 -2
- package/dist/components/UTPanel/versions/V1/components/AdditionalContentModule/styles.module.scss +2 -1
- package/dist/components/UTTable/UTTable.stories.js +34 -1
- package/dist/components/UTTable/components/TableHeader/versions/V1/ActionsMobile.js +85 -0
- package/dist/components/UTTable/components/TableHeader/versions/V1/index.js +14 -23
- package/dist/components/UTTable/components/TableHeader/versions/V1/utils.js +6 -3
- package/dist/components/UTTable/index.js +3 -0
- package/dist/esm/components/UTButton/README.md +17 -8
- package/dist/esm/components/UTButton/index.js +28 -8
- package/dist/esm/components/UTButton/stories/UTButton.stories.js +4 -1
- package/dist/esm/components/UTButton/stories/UTButtonAdornments.stories.js +15 -10
- package/dist/esm/components/UTButton/stories/storiesConstants.js +33 -11
- package/dist/esm/components/UTButton/utils.js +53 -8
- package/dist/esm/components/UTPanel/versions/V1/components/AdditionalContentModule/index.js +7 -2
- package/dist/esm/components/UTPanel/versions/V1/components/AdditionalContentModule/styles.module.scss +2 -1
- package/dist/esm/components/UTTable/UTTable.stories.js +33 -0
- package/dist/esm/components/UTTable/components/TableHeader/versions/V1/ActionsMobile.js +78 -0
- package/dist/esm/components/UTTable/components/TableHeader/versions/V1/index.js +15 -24
- package/dist/esm/components/UTTable/components/TableHeader/versions/V1/utils.js +6 -3
- package/dist/esm/components/UTTable/index.js +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
## [3.160.1](https://github.com/widergy/energy-ui/compare/v3.160.0...v3.160.1) (2026-06-04)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* scroll additional content ([#810](https://github.com/widergy/energy-ui/issues/810)) ([aa1d542](https://github.com/widergy/energy-ui/commit/aa1d542e3e01550330a91ea36acd292e2ff47d21))
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
# [3.160.0](https://github.com/widergy/energy-ui/compare/v3.159.0...v3.160.0) (2026-06-02)
|
|
9
9
|
|
|
10
|
+
### Novedades y Mejoras
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
* Los botones de acción ahora admiten un segundo ícono en el extremo derecho, lo que permite mayor flexibilidad visual sin afectar el comportamiento existente. [#805](https://github.com/widergy/Energy-UI/pull/805) [AXCH-1489](https://widergy.atlassian.net/browse/AXCH-1489)
|
|
13
|
+
|
|
14
|
+
# [3.159.0](https://github.com/widergy/energy-ui/compare/v3.158.1...v3.159.0) (2026-06-01)
|
|
15
|
+
|
|
16
|
+
### Novedades y Mejoras
|
|
17
|
+
|
|
18
|
+
* Se optimizó el tamaño de la aplicación: ahora solo se cargan los recursos necesarios según lo que cada pantalla utiliza, lo que mejora los tiempos de carga y el rendimiento general. [#801](https://github.com/widergy/Energy-UI/pull/801) [AXAG-276](https://widergy.atlassian.net/browse/AXAG-276)
|
|
19
|
+
* Los íconos de banderas se cargan de forma inteligente bajo demanda, evitando descargas innecesarias y reduciendo el consumo de datos. [#801](https://github.com/widergy/Energy-UI/pull/801) [AXAG-276](https://widergy.atlassian.net/browse/AXAG-276)
|
|
20
|
+
* Mejoras internas de la plataforma. [#801](https://github.com/widergy/Energy-UI/pull/801) [AXAG-276](https://widergy.atlassian.net/browse/AXAG-276)
|
|
21
|
+
|
|
22
|
+
## [3.158.1](https://github.com/widergy/energy-ui/compare/v3.158.0...v3.158.1) (2026-06-01)
|
|
23
|
+
|
|
24
|
+
### Correcciones
|
|
12
25
|
|
|
13
|
-
*
|
|
26
|
+
* Mejoras internas de la plataforma. [#802](https://github.com/widergy/Energy-UI/pull/802) [`650c988`](https://github.com/widergy/Energy-UI/commit/650c988) [OUG-999](https://widergy.atlassian.net/browse/OUG-999)
|
|
14
27
|
|
|
15
28
|
# [3.158.0](https://github.com/widergy/energy-ui/compare/v3.157.1...v3.158.0) (2026-05-19)
|
|
16
29
|
|
|
@@ -17,12 +17,16 @@ All these variants are defined in the component theme.
|
|
|
17
17
|
|
|
18
18
|
### Color Themes
|
|
19
19
|
|
|
20
|
-
The color themes are defined by the component consumer and will vary accordingly.They define a set of variables (colors and opacities) that then combined with the variant will change how the
|
|
21
|
-
The components supports an infinite amount of color themes but
|
|
20
|
+
The color themes are defined by the component consumer and will vary accordingly. They define a set of variables (colors and opacities) that then combined with the variant will change how the button looks.
|
|
21
|
+
The components supports an infinite amount of color themes but requires the consumer to pass at least a `primary` one that works as a default.
|
|
22
22
|
|
|
23
|
-
###
|
|
23
|
+
### Icons
|
|
24
24
|
|
|
25
|
-
The button can include
|
|
25
|
+
The button can include up to two icons (left and right), each of which can be either a Tabler Icons name or a custom SVG React component.
|
|
26
|
+
|
|
27
|
+
- **`LeftIcon`:** rendered at the start of the button content.
|
|
28
|
+
- **`RightIcon`:** rendered at the end of the button content.
|
|
29
|
+
- Additional props for each icon can be passed via `leftIconProps` and `rightIconProps`.
|
|
26
30
|
|
|
27
31
|
### Props
|
|
28
32
|
|
|
@@ -34,9 +38,14 @@ The button can include an icon, which can be either from the Tabler Icons librar
|
|
|
34
38
|
| onClick | func | | Callback fired when the user clicks the component. |
|
|
35
39
|
| loading | bool | false | If `true` a spinner is shown over the component. |
|
|
36
40
|
| disabled | bool | false | If `true` the button is unclickable. |
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
+
| LeftIcon | node \| string | | Icon rendered at the start of the button. |
|
|
42
|
+
| leftIconProps | object | | Additional props to apply to the left icon. |
|
|
43
|
+
| RightIcon | node \| string | | Icon rendered at the end of the button. |
|
|
44
|
+
| rightIconProps | object | | Additional props to apply to the right icon. |
|
|
45
|
+
| hideTextOnResponsive | bool | false | If `true` and an icon is present, the button text is hidden on mobile. |
|
|
46
|
+
| count | number | | Number to display in a badge inside the button. |
|
|
47
|
+
| type | string | | HTML type attribute. |
|
|
41
48
|
| classNames | object | | Overrides the default button theme. |
|
|
42
49
|
| children | node | | The component contents. |
|
|
50
|
+
| Icon | node \| string | | **Deprecated.** Use `LeftIcon` or `RightIcon` instead. |
|
|
51
|
+
| iconPlacement | 'left' \| 'right' | 'left' | **Deprecated.** Use `LeftIcon` or `RightIcon` instead. |
|
|
@@ -32,8 +32,12 @@ const UTButton = _ref => {
|
|
|
32
32
|
hideTextOnResponsive,
|
|
33
33
|
Icon,
|
|
34
34
|
iconPlacement,
|
|
35
|
+
LeftIcon,
|
|
36
|
+
leftIconProps,
|
|
35
37
|
loading,
|
|
36
38
|
onClick,
|
|
39
|
+
RightIcon,
|
|
40
|
+
rightIconProps,
|
|
37
41
|
size,
|
|
38
42
|
type,
|
|
39
43
|
variant
|
|
@@ -47,27 +51,33 @@ const UTButton = _ref => {
|
|
|
47
51
|
...materialButtonClasses
|
|
48
52
|
} = classes;
|
|
49
53
|
const {
|
|
50
|
-
|
|
51
|
-
|
|
54
|
+
LeftIconComponent,
|
|
55
|
+
leftIconProps: leftIconBaseProps,
|
|
56
|
+
RightIconComponent,
|
|
57
|
+
rightIconProps: rightIconBaseProps
|
|
52
58
|
} = (0, _react.useMemo)(() => (0, _utils.getIconProps)({
|
|
53
59
|
className: icon,
|
|
54
60
|
colorTheme,
|
|
55
61
|
hasContent: !!children,
|
|
56
62
|
hideTextOnResponsive,
|
|
57
63
|
Icon,
|
|
64
|
+
iconPlacement,
|
|
65
|
+
LeftIcon,
|
|
66
|
+
RightIcon,
|
|
58
67
|
size,
|
|
59
68
|
variant
|
|
60
|
-
}), [colorTheme, children, hideTextOnResponsive, icon, Icon, size, variant]);
|
|
61
|
-
const
|
|
69
|
+
}), [colorTheme, children, hideTextOnResponsive, icon, Icon, iconPlacement, LeftIcon, RightIcon, size, variant]);
|
|
70
|
+
const LeftIconToShow = LeftIconComponent && /*#__PURE__*/_react.default.createElement(LeftIconComponent, _extends({}, leftIconBaseProps, leftIconProps));
|
|
71
|
+
const RightIconToShow = RightIconComponent && /*#__PURE__*/_react.default.createElement(RightIconComponent, _extends({}, rightIconBaseProps, rightIconProps));
|
|
62
72
|
const counterColorTheme = (0, _utils.getCounterColorTheme)(colorTheme, variant);
|
|
63
73
|
const labelProps = (0, _utils.getLabelProps)(colorTheme, variant, size);
|
|
64
74
|
const RenderedChildren = /*#__PURE__*/_react.default.createElement("div", {
|
|
65
75
|
className: "".concat(childrenContainer, " ").concat(_stylesModule.default["".concat(size, "ChildrenContainer")])
|
|
66
76
|
}, count && /*#__PURE__*/_react.default.createElement(_UTBadge.default, {
|
|
67
77
|
colorTheme: counterColorTheme
|
|
68
|
-
}, count),
|
|
78
|
+
}, count), LeftIconToShow, children !== null && children !== undefined && children !== false && /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({}, labelProps, {
|
|
69
79
|
className: "".concat(_stylesModule.default.textContainer, " ").concat(textClassName)
|
|
70
|
-
}), children),
|
|
80
|
+
}), children), RightIconToShow);
|
|
71
81
|
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
72
82
|
classes: materialButtonClasses,
|
|
73
83
|
className: "\n ".concat(_stylesModule.default["padding".concat((0, _componentUtils.capitalize)(size))], "\n ").concat(hideTextOnResponsive && _stylesModule.default.hideTextOnResponsive, "\n ").concat(!hideTextOnResponsive && !children && _stylesModule.default.noChildren, "\n "),
|
|
@@ -89,10 +99,20 @@ UTButton.propTypes = {
|
|
|
89
99
|
dataTestId: _propTypes.string,
|
|
90
100
|
disabled: _propTypes.bool,
|
|
91
101
|
hideTextOnResponsive: _propTypes.bool,
|
|
102
|
+
/**
|
|
103
|
+
* @deprecated Use LeftIcon or RightIcon instead.
|
|
104
|
+
*/
|
|
92
105
|
Icon: _propTypes.elementType,
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated Use LeftIcon or RightIcon instead.
|
|
108
|
+
*/
|
|
93
109
|
iconPlacement: _propTypes.string,
|
|
110
|
+
LeftIcon: _propTypes.elementType,
|
|
111
|
+
leftIconProps: _propTypes.object,
|
|
94
112
|
loading: _propTypes.bool,
|
|
95
113
|
onClick: _propTypes.func,
|
|
114
|
+
RightIcon: _propTypes.elementType,
|
|
115
|
+
rightIconProps: _propTypes.object,
|
|
96
116
|
size: _propTypes.string,
|
|
97
117
|
type: _propTypes.string,
|
|
98
118
|
variant: _propTypes.string
|
|
@@ -14,8 +14,11 @@ var _default = exports.default = {
|
|
|
14
14
|
children: undefined,
|
|
15
15
|
classNames: undefined,
|
|
16
16
|
count: undefined,
|
|
17
|
-
|
|
17
|
+
LeftIcon: undefined,
|
|
18
|
+
leftIconProps: undefined,
|
|
18
19
|
onClick: undefined,
|
|
20
|
+
RightIcon: undefined,
|
|
21
|
+
rightIconProps: undefined,
|
|
19
22
|
..._storiesConstants.COMMON_ARGS
|
|
20
23
|
},
|
|
21
24
|
argTypes: {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.
|
|
6
|
+
exports.default = exports.RightIconOnly = exports.LeftIconOnly = exports.IconOnly = exports.CountOnly = exports.CountAndIcon = exports.BothIcons = void 0;
|
|
7
7
|
var _ = _interopRequireDefault(require(".."));
|
|
8
8
|
var _storiesConstants = require("./storiesConstants");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -20,29 +20,34 @@ var _default = exports.default = {
|
|
|
20
20
|
..._storiesConstants.COMMON_PARAMETERS
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
|
-
const
|
|
23
|
+
const LeftIconOnly = exports.LeftIconOnly = {
|
|
24
24
|
args: {
|
|
25
|
-
children: 'Icon
|
|
26
|
-
|
|
27
|
-
iconPlacement: 'left'
|
|
25
|
+
children: 'Left Icon',
|
|
26
|
+
LeftIcon: 'IconArrowLeft'
|
|
28
27
|
}
|
|
29
28
|
};
|
|
30
|
-
const
|
|
29
|
+
const RightIconOnly = exports.RightIconOnly = {
|
|
31
30
|
args: {
|
|
32
|
-
children: 'Icon
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
children: 'Right Icon',
|
|
32
|
+
RightIcon: 'IconArrowRight'
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
const BothIcons = exports.BothIcons = {
|
|
36
|
+
args: {
|
|
37
|
+
children: 'Descargas',
|
|
38
|
+
LeftIcon: 'IconDownload',
|
|
39
|
+
RightIcon: 'IconChevronDown'
|
|
35
40
|
}
|
|
36
41
|
};
|
|
37
42
|
const IconOnly = exports.IconOnly = {
|
|
38
43
|
args: {
|
|
39
|
-
|
|
44
|
+
LeftIcon: 'IconSearch'
|
|
40
45
|
}
|
|
41
46
|
};
|
|
42
47
|
const CountAndIcon = exports.CountAndIcon = {
|
|
43
48
|
args: {
|
|
44
49
|
count: 7,
|
|
45
|
-
|
|
50
|
+
LeftIcon: 'IconBell'
|
|
46
51
|
}
|
|
47
52
|
};
|
|
48
53
|
const CountOnly = exports.CountOnly = {
|
|
@@ -95,7 +95,7 @@ const COMMON_ARG_TYPES = exports.COMMON_ARG_TYPES = {
|
|
|
95
95
|
},
|
|
96
96
|
hideTextOnResponsive: {
|
|
97
97
|
control: 'boolean',
|
|
98
|
-
description: 'Si es `true` y
|
|
98
|
+
description: 'Si es `true` y hay ícono, el contenido del botón no se muestra en dispositivos móviles.',
|
|
99
99
|
table: {
|
|
100
100
|
defaultValue: {
|
|
101
101
|
summary: _constants.DEFAULT_PROPS.hideTextOnResponsive
|
|
@@ -105,9 +105,9 @@ const COMMON_ARG_TYPES = exports.COMMON_ARG_TYPES = {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
-
|
|
108
|
+
LeftIcon: {
|
|
109
109
|
control: 'text',
|
|
110
|
-
description: '
|
|
110
|
+
description: 'Ícono a mostrar al inicio del botón. Puede ser un nombre de icono de Tabler o un componente personalizado.',
|
|
111
111
|
table: {
|
|
112
112
|
defaultValue: {
|
|
113
113
|
summary: 'undefined'
|
|
@@ -117,16 +117,15 @@ const COMMON_ARG_TYPES = exports.COMMON_ARG_TYPES = {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
},
|
|
120
|
-
|
|
121
|
-
control:
|
|
122
|
-
description: '
|
|
123
|
-
options: Object.values(_constants.ICON_PLACEMENTS),
|
|
120
|
+
leftIconProps: {
|
|
121
|
+
control: false,
|
|
122
|
+
description: 'Props adicionales a aplicar al ícono izquierdo.',
|
|
124
123
|
table: {
|
|
125
124
|
defaultValue: {
|
|
126
|
-
summary:
|
|
125
|
+
summary: 'undefined'
|
|
127
126
|
},
|
|
128
127
|
type: {
|
|
129
|
-
summary:
|
|
128
|
+
summary: 'object'
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
131
|
},
|
|
@@ -154,6 +153,30 @@ const COMMON_ARG_TYPES = exports.COMMON_ARG_TYPES = {
|
|
|
154
153
|
}
|
|
155
154
|
}
|
|
156
155
|
},
|
|
156
|
+
RightIcon: {
|
|
157
|
+
control: 'text',
|
|
158
|
+
description: 'Ícono a mostrar al final del botón. Puede ser un nombre de icono de Tabler o un componente personalizado.',
|
|
159
|
+
table: {
|
|
160
|
+
defaultValue: {
|
|
161
|
+
summary: 'undefined'
|
|
162
|
+
},
|
|
163
|
+
type: {
|
|
164
|
+
summary: (0, _utils.joinArgTypes)(['string', 'ReactComponent'])
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
rightIconProps: {
|
|
169
|
+
control: false,
|
|
170
|
+
description: 'Props adicionales a aplicar al ícono derecho.',
|
|
171
|
+
table: {
|
|
172
|
+
defaultValue: {
|
|
173
|
+
summary: 'undefined'
|
|
174
|
+
},
|
|
175
|
+
type: {
|
|
176
|
+
summary: 'object'
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
},
|
|
157
180
|
size: {
|
|
158
181
|
control: 'inline-radio',
|
|
159
182
|
description: 'Tamaño del botón.',
|
|
@@ -200,7 +223,6 @@ const COMMON_ARGS = exports.COMMON_ARGS = {
|
|
|
200
223
|
dataTestId: 'customButtonId',
|
|
201
224
|
disabled: _constants.DEFAULT_PROPS.disabled,
|
|
202
225
|
hideTextOnResponsive: _constants.DEFAULT_PROPS.hideTextOnResponsive,
|
|
203
|
-
iconPlacement: _constants.DEFAULT_PROPS.iconPlacement,
|
|
204
226
|
loading: _constants.DEFAULT_PROPS.loading,
|
|
205
227
|
size: _constants.DEFAULT_PROPS.size,
|
|
206
228
|
type: 'button',
|
|
@@ -11,24 +11,69 @@ var _constants = require("./constants");
|
|
|
11
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
const getButtonElementColorTheme = (buttonColorTheme, buttonVariant) => buttonVariant === _constants.VARIANTS_NAMES.filled ? buttonColorTheme === _constants.COLORS_MAPPER.negative ? _Palette.COLOR_THEMES.neutral : _Palette.COLOR_THEMES.negative : _constants.COLORS_MAPPER[buttonColorTheme];
|
|
14
|
-
const
|
|
14
|
+
const buildSingleIconProps = _ref => {
|
|
15
15
|
let {
|
|
16
16
|
className,
|
|
17
|
-
colorTheme
|
|
17
|
+
colorTheme,
|
|
18
18
|
hasContent,
|
|
19
19
|
hideTextOnResponsive,
|
|
20
20
|
Icon,
|
|
21
21
|
size,
|
|
22
|
-
variant
|
|
22
|
+
variant
|
|
23
23
|
} = _ref;
|
|
24
|
-
|
|
24
|
+
if (!Icon) return null;
|
|
25
|
+
return {
|
|
25
26
|
IconComponent: (0, _componentUtils.isUTIcon)(Icon) ? _UTIcon.default : Icon,
|
|
26
|
-
className: "\n
|
|
27
|
+
className: "\n ".concat(_stylesModule.default.baseIcon, "\n ").concat(className, "\n ").concat(hasContent ? _stylesModule.default.icon : _stylesModule.default["iconOnly".concat((0, _componentUtils.capitalize)(size))], "\n ").concat(hideTextOnResponsive ? _stylesModule.default["adaptableIcon".concat((0, _componentUtils.capitalize)(size))] : '', "\n "),
|
|
27
28
|
...((0, _componentUtils.isUTIcon)(Icon) ? {
|
|
28
|
-
colorTheme: getButtonElementColorTheme(
|
|
29
|
+
colorTheme: getButtonElementColorTheme(colorTheme, variant),
|
|
29
30
|
name: Icon
|
|
30
31
|
} : {})
|
|
31
|
-
}
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const getIconProps = _ref2 => {
|
|
35
|
+
let {
|
|
36
|
+
className,
|
|
37
|
+
colorTheme,
|
|
38
|
+
hasContent,
|
|
39
|
+
hideTextOnResponsive,
|
|
40
|
+
Icon,
|
|
41
|
+
iconPlacement,
|
|
42
|
+
LeftIcon,
|
|
43
|
+
RightIcon,
|
|
44
|
+
size,
|
|
45
|
+
variant
|
|
46
|
+
} = _ref2;
|
|
47
|
+
const resolvedLeftIcon = LeftIcon || (iconPlacement !== _constants.ICON_PLACEMENTS.right ? Icon : undefined);
|
|
48
|
+
const resolvedRightIcon = RightIcon || (iconPlacement === _constants.ICON_PLACEMENTS.right ? Icon : undefined);
|
|
49
|
+
const commonParams = {
|
|
50
|
+
className,
|
|
51
|
+
colorTheme,
|
|
52
|
+
hasContent,
|
|
53
|
+
hideTextOnResponsive,
|
|
54
|
+
size,
|
|
55
|
+
variant
|
|
56
|
+
};
|
|
57
|
+
const {
|
|
58
|
+
IconComponent: LeftIconComponent,
|
|
59
|
+
...leftIconProps
|
|
60
|
+
} = buildSingleIconProps({
|
|
61
|
+
...commonParams,
|
|
62
|
+
Icon: resolvedLeftIcon
|
|
63
|
+
}) || {};
|
|
64
|
+
const {
|
|
65
|
+
IconComponent: RightIconComponent,
|
|
66
|
+
...rightIconProps
|
|
67
|
+
} = buildSingleIconProps({
|
|
68
|
+
...commonParams,
|
|
69
|
+
Icon: resolvedRightIcon
|
|
70
|
+
}) || {};
|
|
71
|
+
return {
|
|
72
|
+
LeftIconComponent: LeftIconComponent || null,
|
|
73
|
+
leftIconProps,
|
|
74
|
+
RightIconComponent: RightIconComponent || null,
|
|
75
|
+
rightIconProps
|
|
76
|
+
};
|
|
32
77
|
};
|
|
33
78
|
exports.getIconProps = getIconProps;
|
|
34
79
|
const getLabelProps = (buttonColorTheme, buttonVariant, buttonSize) => ({
|
|
@@ -34,10 +34,15 @@ const AdditionalContentModule = _ref => {
|
|
|
34
34
|
const defaultTooltipContainer = tooltipContainer || (() => document.body);
|
|
35
35
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
36
|
className: _stylesModule.default.additionalContentWrapper
|
|
37
|
-
}, activeContent && /*#__PURE__*/_react.default.createElement(
|
|
37
|
+
}, activeContent && /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, {
|
|
38
|
+
options: {
|
|
39
|
+
suppressScrollX: true
|
|
40
|
+
},
|
|
41
|
+
className: _stylesModule.default.sidebarScroll
|
|
42
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
38
43
|
className: _stylesModule.default.bodyComponent,
|
|
39
44
|
"data-testid": panel.additionalContent.body
|
|
40
|
-
}, ActiveBodyComponent && /*#__PURE__*/_react.default.createElement(ActiveBodyComponent, null)), /*#__PURE__*/_react.default.createElement("div", {
|
|
45
|
+
}, ActiveBodyComponent && /*#__PURE__*/_react.default.createElement(ActiveBodyComponent, null))), /*#__PURE__*/_react.default.createElement("div", {
|
|
41
46
|
className: "".concat(_stylesModule.default.sidebar, " ").concat(!activeContent ? _stylesModule.default.sidebarCollapsed : ''),
|
|
42
47
|
"data-testid": panel.additionalContent.sidebar
|
|
43
48
|
}, /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, {
|
package/dist/components/UTPanel/versions/V1/components/AdditionalContentModule/styles.module.scss
CHANGED
|
@@ -23,9 +23,10 @@ $sidebar-width: 56px;
|
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-direction: column;
|
|
25
25
|
flex-shrink: 0;
|
|
26
|
+
height: 100%;
|
|
26
27
|
min-width: $body-component-width;
|
|
27
28
|
opacity: 1;
|
|
28
|
-
overflow:
|
|
29
|
+
overflow-y: auto;
|
|
29
30
|
padding: 24px 24px 16px 24px;
|
|
30
31
|
width: $body-component-width;
|
|
31
32
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = exports.WithRefresh = exports.WithPagination = exports.WithCustomRenderers = exports.WithActions = exports.TableHeaderV1WithSelection = exports.TableHeaderV1WithRefresh = exports.TableHeaderV1WithAutomaticRefresh = exports.TableHeaderV1WithActions = exports.TableHeaderV1Loading = exports.TableHeaderV1Basic = exports.TableHeaderV0WithReload = exports.TableHeaderV0Basic = exports.StickyHeader = exports.Selectable = exports.Playground = exports.NoPagination = exports.Loading = exports.FitColumnsWidth = exports.ExternalIntegration = exports.ExclusiveSelection = exports.EmptyState = exports.CustomSpacing = exports.CustomNoResults = exports.CompleteExample = exports.ClickableRows = exports.Basic = void 0;
|
|
6
|
+
exports.default = exports.WithRefresh = exports.WithPagination = exports.WithCustomRenderers = exports.WithActions = exports.TableHeaderV1WithSelection = exports.TableHeaderV1WithRefresh = exports.TableHeaderV1WithPrimaryActions = exports.TableHeaderV1WithAutomaticRefresh = exports.TableHeaderV1WithActions = exports.TableHeaderV1Loading = exports.TableHeaderV1Basic = exports.TableHeaderV0WithReload = exports.TableHeaderV0Basic = exports.StickyHeader = exports.Selectable = exports.Playground = exports.NoPagination = exports.Loading = exports.FitColumnsWidth = exports.ExternalIntegration = exports.ExclusiveSelection = exports.EmptyState = exports.CustomSpacing = exports.CustomNoResults = exports.CompleteExample = exports.ClickableRows = exports.Basic = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _utils = require("stories/utils");
|
|
9
9
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
@@ -933,6 +933,39 @@ const TableHeaderV1WithActions = exports.TableHeaderV1WithActions = {
|
|
|
933
933
|
},
|
|
934
934
|
name: 'Header V1 - Con Acciones'
|
|
935
935
|
};
|
|
936
|
+
const TableHeaderV1WithPrimaryActions = exports.TableHeaderV1WithPrimaryActions = {
|
|
937
|
+
args: {
|
|
938
|
+
data: mockData.slice(0, 10),
|
|
939
|
+
columns: basicColumns,
|
|
940
|
+
headerVersion: 'V1',
|
|
941
|
+
withActionHeader: true,
|
|
942
|
+
tableTitle: 'Tabla con Acciones Primarias V1',
|
|
943
|
+
description: 'Header V1 con isPrimary: las acciones primarias siempre son visibles (solo ícono en mobile), las secundarias colapsan en el dots menu.',
|
|
944
|
+
actionsConfig: [{
|
|
945
|
+
isPrimary: true,
|
|
946
|
+
LeftIcon: 'IconPlus',
|
|
947
|
+
onClick: () => alert('Nuevo trámite'),
|
|
948
|
+
variant: 'filled',
|
|
949
|
+
colorTheme: 'primary',
|
|
950
|
+
size: 'small',
|
|
951
|
+
children: 'Nuevo trámite'
|
|
952
|
+
}, {
|
|
953
|
+
LeftIcon: 'IconDownload',
|
|
954
|
+
RightIcon: 'IconChevronDown',
|
|
955
|
+
onClick: () => alert('Descargas'),
|
|
956
|
+
variant: 'outlined',
|
|
957
|
+
size: 'small',
|
|
958
|
+
children: 'Descargas'
|
|
959
|
+
}, {
|
|
960
|
+
Icon: 'IconFilter',
|
|
961
|
+
onClick: () => alert('Filtrar'),
|
|
962
|
+
variant: 'outlined',
|
|
963
|
+
size: 'small',
|
|
964
|
+
children: 'Filtros'
|
|
965
|
+
}]
|
|
966
|
+
},
|
|
967
|
+
name: 'Header V1 - Con Acciones Primarias'
|
|
968
|
+
};
|
|
936
969
|
const TableHeaderV1WithSelection = exports.TableHeaderV1WithSelection = {
|
|
937
970
|
args: {
|
|
938
971
|
data: mockData.slice(0, 10),
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
8
|
+
var _partition = _interopRequireDefault(require("lodash/partition"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _propTypes = require("prop-types");
|
|
11
|
+
var _UTButton = _interopRequireDefault(require("../../../../../UTButton"));
|
|
12
|
+
var _UTMenu = _interopRequireDefault(require("../../../../../UTMenu"));
|
|
13
|
+
var _UTTooltip = _interopRequireDefault(require("../../../../../UTTooltip"));
|
|
14
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
|
+
var _utils = require("./utils");
|
|
16
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
18
|
+
const ActionsMobile = _ref => {
|
|
19
|
+
var _classes$wrapperHeade;
|
|
20
|
+
let {
|
|
21
|
+
actions,
|
|
22
|
+
anchor,
|
|
23
|
+
classes,
|
|
24
|
+
closeMenu,
|
|
25
|
+
menuButtonRef,
|
|
26
|
+
openMenu,
|
|
27
|
+
tableHeaderDataTestId
|
|
28
|
+
} = _ref;
|
|
29
|
+
const [primaryActions, secondaryActions] = (0, _partition.default)(actions, _ref2 => {
|
|
30
|
+
let {
|
|
31
|
+
isPrimary
|
|
32
|
+
} = _ref2;
|
|
33
|
+
return isPrimary;
|
|
34
|
+
});
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !(0, _isEmpty.default)(secondaryActions) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
+
ref: menuButtonRef
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
38
|
+
dataTestId: tableHeaderDataTestId ? "".concat(tableHeaderDataTestId, ".dotMenuButton") : '',
|
|
39
|
+
Icon: "IconDots",
|
|
40
|
+
onClick: openMenu,
|
|
41
|
+
variant: "text"
|
|
42
|
+
})), /*#__PURE__*/_react.default.createElement(_UTMenu.default, {
|
|
43
|
+
anchor: anchor,
|
|
44
|
+
classNames: {
|
|
45
|
+
menuItemContainer: "".concat(_stylesModule.default.wrapperHeaderMenuItem, " ").concat((_classes$wrapperHeade = classes.wrapperHeaderMenuItem) !== null && _classes$wrapperHeade !== void 0 ? _classes$wrapperHeade : '')
|
|
46
|
+
},
|
|
47
|
+
dataTestId: tableHeaderDataTestId ? "".concat(tableHeaderDataTestId, ".dotMenu") : '',
|
|
48
|
+
iconBefore: true,
|
|
49
|
+
items: (0, _utils.getMenuItems)(secondaryActions, closeMenu),
|
|
50
|
+
onClose: closeMenu,
|
|
51
|
+
onOpen: openMenu,
|
|
52
|
+
popperProps: {
|
|
53
|
+
disablePortal: true
|
|
54
|
+
}
|
|
55
|
+
})), primaryActions.map(actionConfig => actionConfig.tooltip ? /*#__PURE__*/_react.default.createElement(_UTTooltip.default, _extends({
|
|
56
|
+
key: actionConfig.dataTestId || String(actionConfig.children),
|
|
57
|
+
className: actionConfig.tooltipClassName,
|
|
58
|
+
content: actionConfig.tooltip,
|
|
59
|
+
tippyProps: {
|
|
60
|
+
arrow: false,
|
|
61
|
+
placement: 'top'
|
|
62
|
+
}
|
|
63
|
+
}, actionConfig.tooltipProps), /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
64
|
+
hideTextOnResponsive: true
|
|
65
|
+
}, actionConfig)))) : /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
66
|
+
key: actionConfig.dataTestId || String(actionConfig.children),
|
|
67
|
+
dataTestId: actionConfig.dataTestId,
|
|
68
|
+
hideTextOnResponsive: true
|
|
69
|
+
}, actionConfig))));
|
|
70
|
+
};
|
|
71
|
+
ActionsMobile.propTypes = {
|
|
72
|
+
actions: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
73
|
+
children: _propTypes.string,
|
|
74
|
+
dataTestId: _propTypes.string,
|
|
75
|
+
isPrimary: _propTypes.bool,
|
|
76
|
+
tooltip: _propTypes.string
|
|
77
|
+
})),
|
|
78
|
+
anchor: _propTypes.object,
|
|
79
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
80
|
+
closeMenu: _propTypes.func,
|
|
81
|
+
menuButtonRef: _propTypes.object,
|
|
82
|
+
openMenu: _propTypes.func,
|
|
83
|
+
tableHeaderDataTestId: _propTypes.string
|
|
84
|
+
};
|
|
85
|
+
var _default = exports.default = ActionsMobile;
|
|
@@ -9,17 +9,17 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _propTypes = require("prop-types");
|
|
10
10
|
var _UTButton = _interopRequireDefault(require("../../../../../UTButton"));
|
|
11
11
|
var _UTLabel = _interopRequireDefault(require("../../../../../UTLabel"));
|
|
12
|
-
var _UTMenu = _interopRequireDefault(require("../../../../../UTMenu"));
|
|
13
12
|
var _UTTooltip = _interopRequireDefault(require("../../../../../UTTooltip"));
|
|
14
13
|
var _useScrollBasedMenu = _interopRequireDefault(require("../../../../../../utils/hooks/use-scroll-based-menu"));
|
|
15
14
|
var _types = require("../../../../types");
|
|
15
|
+
var _ActionsMobile = _interopRequireDefault(require("./ActionsMobile"));
|
|
16
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
17
|
var _utils = require("./utils");
|
|
18
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
20
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
21
21
|
const TableHeader = _ref => {
|
|
22
|
-
var _classes$wrapperHeade, _classes$textElements, _classes$titleAndDesc, _classes$selectedLabe, _classes$refreshAndAc
|
|
22
|
+
var _classes$wrapperHeade, _classes$textElements, _classes$titleAndDesc, _classes$selectedLabe, _classes$refreshAndAc;
|
|
23
23
|
let {
|
|
24
24
|
actions,
|
|
25
25
|
automaticRefreshDelay,
|
|
@@ -90,7 +90,7 @@ const TableHeader = _ref => {
|
|
|
90
90
|
weight: "medium"
|
|
91
91
|
}, selectedLabel)), /*#__PURE__*/_react.default.createElement("article", {
|
|
92
92
|
className: "".concat(_stylesModule.default.refreshAndActions, " ").concat((_classes$refreshAndAc = classes.refreshAndActions) !== null && _classes$refreshAndAc !== void 0 ? _classes$refreshAndAc : '')
|
|
93
|
-
}, withRefresh && /*#__PURE__*/_react.default.createElement(_react.Fragment, null, !isMobile && (loading ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
93
|
+
}, withRefresh && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, !isMobile && (loading ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
94
94
|
colorTheme: "gray",
|
|
95
95
|
dataTestId: tableHeaderDataTestId ? "".concat(tableHeaderDataTestId, ".ongoingRefreshLabel") : '',
|
|
96
96
|
variant: "small",
|
|
@@ -123,27 +123,15 @@ const TableHeader = _ref => {
|
|
|
123
123
|
onClick: handleRefresh,
|
|
124
124
|
size: "small",
|
|
125
125
|
variant: "text"
|
|
126
|
-
})))), Array.isArray(actions) && !(0, _isEmpty.default)(actions) && !isDesktop ? /*#__PURE__*/_react.default.createElement(
|
|
127
|
-
|
|
128
|
-
}, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
129
|
-
dataTestId: tableHeaderDataTestId ? "".concat(tableHeaderDataTestId, ".dotMenuButton") : '',
|
|
130
|
-
Icon: "IconDots",
|
|
131
|
-
onClick: openMenu,
|
|
132
|
-
variant: "text"
|
|
133
|
-
})), /*#__PURE__*/_react.default.createElement(_UTMenu.default, {
|
|
126
|
+
})))), Array.isArray(actions) && !(0, _isEmpty.default)(actions) && !isDesktop ? /*#__PURE__*/_react.default.createElement(_ActionsMobile.default, {
|
|
127
|
+
actions: actions,
|
|
134
128
|
anchor: anchor,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
onClose: closeMenu,
|
|
142
|
-
onOpen: openMenu,
|
|
143
|
-
popperProps: {
|
|
144
|
-
disablePortal: true
|
|
145
|
-
}
|
|
146
|
-
})) : Array.isArray(actions) && actions.map((actionConfig, index) => actionConfig.tooltip ? /*#__PURE__*/_react.default.createElement(_UTTooltip.default, _extends({
|
|
129
|
+
classes: classes,
|
|
130
|
+
closeMenu: closeMenu,
|
|
131
|
+
menuButtonRef: menuButtonRef,
|
|
132
|
+
openMenu: openMenu,
|
|
133
|
+
tableHeaderDataTestId: tableHeaderDataTestId
|
|
134
|
+
}) : Array.isArray(actions) && actions.map((actionConfig, index) => actionConfig.tooltip ? /*#__PURE__*/_react.default.createElement(_UTTooltip.default, _extends({
|
|
147
135
|
className: actionConfig.tooltipClassName,
|
|
148
136
|
content: actionConfig.tooltip,
|
|
149
137
|
dataTestId: tableHeaderDataTestId ? "".concat(tableHeaderDataTestId, ".").concat(index) : '',
|
|
@@ -166,8 +154,11 @@ TableHeader.propTypes = {
|
|
|
166
154
|
hideTextOnResponsive: _propTypes.bool,
|
|
167
155
|
Icon: (0, _propTypes.oneOfType)([_propTypes.elementType, _propTypes.string]),
|
|
168
156
|
iconPlacement: _propTypes.string,
|
|
157
|
+
isPrimary: _propTypes.bool,
|
|
158
|
+
LeftIcon: (0, _propTypes.oneOfType)([_propTypes.elementType, _propTypes.string]),
|
|
169
159
|
loading: _propTypes.bool,
|
|
170
160
|
onClick: _propTypes.func,
|
|
161
|
+
RightIcon: (0, _propTypes.oneOfType)([_propTypes.elementType, _propTypes.string]),
|
|
171
162
|
size: _propTypes.string,
|
|
172
163
|
type: _propTypes.string,
|
|
173
164
|
variant: _propTypes.string
|