linear-react-components-ui 1.1.20-beta.35 → 1.1.20-beta.36
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/lib/alerts/BaseAlert.js +1 -1
- package/lib/alerts/Message.js +1 -1
- package/lib/assets/styles/wizard.scss +88 -2
- package/lib/avatar/index.js +9 -8
- package/lib/badge/index.js +4 -4
- package/lib/buttons/DangerButton.js +1 -1
- package/lib/buttons/DefaultButton.js +22 -3
- package/lib/buttons/InfoButton.js +1 -1
- package/lib/buttons/PrimaryButton.js +1 -1
- package/lib/buttons/SuccessButton.js +1 -1
- package/lib/buttons/WarningButton.js +1 -1
- package/lib/buttons/button_container/index.js +1 -1
- package/lib/buttons/split_button/index.js +1 -1
- package/lib/calendar/base/Day.js +1 -1
- package/lib/calendar/base/Month.js +1 -1
- package/lib/calendar/base/helpers.js +2 -2
- package/lib/calendar/base/index.js +1 -1
- package/lib/checkbox/index.js +1 -1
- package/lib/dialog/Custom.js +1 -1
- package/lib/dialog/Question.js +2 -4
- package/lib/dialog/base/Content.js +1 -1
- package/lib/dialog/base/Header.js +2 -2
- package/lib/dialog/base/index.js +8 -5
- package/lib/dialog/form/index.js +2 -2
- package/lib/dialog/types.d.ts +2 -0
- package/lib/dialog/wizard/index.d.ts +1 -1
- package/lib/dialog/wizard/index.js +5 -3
- package/lib/dialog/wizard/progressbar.d.ts +2 -1
- package/lib/dialog/wizard/progressbar.js +5 -3
- package/lib/dialog/wizard/step.js +1 -1
- package/lib/drawer/Drawer.js +3 -3
- package/lib/drawer/Header.js +1 -1
- package/lib/dropdown/Popup.js +6 -6
- package/lib/dropdown/helper.js +1 -1
- package/lib/dropdown/withDropdown.js +2 -2
- package/lib/fieldset/index.js +7 -7
- package/lib/form/Field.js +3 -14
- package/lib/form/FieldArray.js +1 -1
- package/lib/form/FieldNumber.js +7 -10
- package/lib/form/FieldPeriod.js +2 -2
- package/lib/form/index.js +20 -15
- package/lib/gridlayout/GridCol.js +5 -5
- package/lib/gridlayout/GridRow.js +4 -1
- package/lib/hint/index.js +7 -1
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +4 -0
- package/lib/icons/index.js +24 -27
- package/lib/inputs/base/InputTextBase.js +6 -8
- package/lib/inputs/base/Label.js +1 -1
- package/lib/inputs/base/helpers.js +7 -3
- package/lib/inputs/date/helpers.js +4 -1
- package/lib/inputs/date/index.js +9 -15
- package/lib/inputs/errorMessage/index.js +1 -1
- package/lib/inputs/file/DefaultFile.js +5 -6
- package/lib/inputs/file/DragDropFile.js +15 -17
- package/lib/inputs/file/File.js +3 -4
- package/lib/inputs/mask/BaseMask.js +4 -1
- package/lib/inputs/mask/helpers.d.ts +1 -1
- package/lib/inputs/multiSelect/Dropdown.js +9 -10
- package/lib/inputs/multiSelect/helper.js +1 -2
- package/lib/inputs/multiSelect/index.js +7 -9
- package/lib/inputs/number/index.js +1 -2
- package/lib/inputs/period/PeriodList.js +1 -1
- package/lib/inputs/period/helper.js +3 -1
- package/lib/inputs/period/index.js +9 -14
- package/lib/inputs/search/index.js +1 -1
- package/lib/inputs/select/Dropdown.js +1 -1
- package/lib/inputs/select/helper.js +10 -13
- package/lib/inputs/select/multiple/Selecteds.js +1 -1
- package/lib/inputs/select/multiple/index.js +9 -14
- package/lib/inputs/select/simple/index.js +10 -17
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/internals/withTooltip.js +9 -9
- package/lib/labelMessages/index.js +4 -3
- package/lib/labels/DefaultLabel.js +4 -1
- package/lib/labels/label_container/index.js +1 -1
- package/lib/list/Header.js +1 -1
- package/lib/list/Item.js +21 -11
- package/lib/list/index.js +2 -1
- package/lib/list/types.d.ts +2 -1
- package/lib/menus/float/MenuItem.js +2 -2
- package/lib/menus/float/SubMenuContainer.js +1 -1
- package/lib/menus/float/index.js +1 -1
- package/lib/menus/sidenav/ExpandMenu.js +1 -1
- package/lib/menus/sidenav/NavMenuGroup.js +1 -1
- package/lib/menus/sidenav/NavMenuItem.js +27 -25
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.js +1 -1
- package/lib/menus/sidenav/index.js +39 -31
- package/lib/menus/sidenav/types.d.ts +1 -0
- package/lib/panel/Content.js +5 -7
- package/lib/panel/Default.js +2 -2
- package/lib/panel/Header.js +3 -3
- package/lib/permissionValidations.js +1 -1
- package/lib/popover/index.js +1 -1
- package/lib/progress/Bar.js +6 -6
- package/lib/radio/index.js +2 -2
- package/lib/shortcuts/index.js +1 -1
- package/lib/skeleton/SkeletonContainer.js +2 -1
- package/lib/skeleton/index.js +4 -1
- package/lib/spinner/index.js +2 -2
- package/lib/split/Split.js +1 -1
- package/lib/split/SplitSide.js +3 -3
- package/lib/table/Body.js +3 -3
- package/lib/table/Header.js +8 -11
- package/lib/table/HeaderColumn.js +1 -1
- package/lib/table/Row.js +3 -3
- package/lib/table/RowColumn.js +1 -1
- package/lib/table/index.js +6 -1
- package/lib/tabs/DropdownTabs.js +1 -1
- package/lib/tabs/Menu.js +1 -1
- package/lib/tabs/MenuTabs.js +2 -2
- package/lib/tabs/Panel.js +5 -7
- package/lib/tabs/context.js +3 -6
- package/lib/textContent/index.js +4 -2
- package/lib/toolbar/ButtonBar.js +1 -1
- package/lib/toolbar/index.js +1 -1
- package/lib/tooltip/index.js +7 -7
- package/lib/treetable/Body.js +1 -1
- package/lib/treetable/Header.js +2 -2
- package/lib/treetable/Row.js +8 -8
- package/lib/treeview/Header.js +1 -1
- package/lib/treeview/Node.js +5 -5
- package/lib/treeview/index.js +4 -4
- package/lib/uitour/index.js +6 -8
- package/package.json +1 -1
- package/lib/checkbox/Label.js +0 -31
- package/lib/inputs/mask/imaskHOC.js +0 -203
- package/lib/menus/sidenav/popup_menu_help/index.js +0 -85
- package/lib/tabs/DropdownItems.js +0 -62
- package/lib/tabs/MenuItems.js +0 -70
- package/lib/treeview_old/Header.js +0 -29
- package/lib/treeview_old/Node.js +0 -68
- package/lib/treeview_old/index.js +0 -43
package/lib/alerts/BaseAlert.js
CHANGED
|
@@ -26,7 +26,7 @@ const BaseAlert = _ref => {
|
|
|
26
26
|
alert.appendChild(messageContainerEl);
|
|
27
27
|
}
|
|
28
28
|
return () => {
|
|
29
|
-
alert
|
|
29
|
+
alert?.removeChild(messageContainerEl);
|
|
30
30
|
};
|
|
31
31
|
}, []);
|
|
32
32
|
return /*#__PURE__*/_reactDom.default.createPortal(children, messageContainerEl);
|
package/lib/alerts/Message.js
CHANGED
|
@@ -4,8 +4,13 @@
|
|
|
4
4
|
.wizard-wrapper {
|
|
5
5
|
.wizard-content {
|
|
6
6
|
display: flex !important;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
&:has(.wizard-progressbar[data-position="top"]) {
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
}
|
|
10
|
+
&:has(.wizard-progressbar[data-position="left"]) {
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
}
|
|
13
|
+
.wizard-progressbar[data-position="top"] {
|
|
9
14
|
width: 100%;
|
|
10
15
|
display: grid;
|
|
11
16
|
grid-auto-columns: 1fr;
|
|
@@ -120,6 +125,87 @@
|
|
|
120
125
|
}
|
|
121
126
|
}
|
|
122
127
|
}
|
|
128
|
+
.wizard-progressbar[data-position="left"] {
|
|
129
|
+
width: 166px;
|
|
130
|
+
display: flex;
|
|
131
|
+
flex-direction: column;
|
|
132
|
+
gap: 30px;
|
|
133
|
+
border-right: 1px solid #ccc;
|
|
134
|
+
padding-right: 16px;
|
|
135
|
+
margin-right: 10px;
|
|
136
|
+
> .title {
|
|
137
|
+
font-size: 16px;
|
|
138
|
+
font-weight: 600;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
gap: 10px;
|
|
142
|
+
position: relative;
|
|
143
|
+
text-align: center;
|
|
144
|
+
|
|
145
|
+
& + .title {
|
|
146
|
+
&:before {
|
|
147
|
+
content: "";
|
|
148
|
+
position: absolute;
|
|
149
|
+
top: -34px;
|
|
150
|
+
left: 17px;
|
|
151
|
+
width: 3px;
|
|
152
|
+
height: 100%;
|
|
153
|
+
background-color: #dadada;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&[data-completed="true"] {
|
|
158
|
+
& + .title:before {
|
|
159
|
+
background-color: $success-color !important;
|
|
160
|
+
}
|
|
161
|
+
> .step {
|
|
162
|
+
> .number {
|
|
163
|
+
background-color: $success-color;
|
|
164
|
+
border-color: $success-color;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
&[data-disabled="true"] {
|
|
169
|
+
.step {
|
|
170
|
+
.number {
|
|
171
|
+
background-color: #dadada;
|
|
172
|
+
border-color: #dadada;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
.step-title {
|
|
176
|
+
color: #dadada;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
> .step {
|
|
180
|
+
display: flex;
|
|
181
|
+
flex-direction: column;
|
|
182
|
+
align-items: center;
|
|
183
|
+
justify-content: center;
|
|
184
|
+
width: 36px;
|
|
185
|
+
> .number {
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
font-size: 20px;
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
width: 36px;
|
|
192
|
+
height: 36px;
|
|
193
|
+
border-radius: 100%;
|
|
194
|
+
color: #fff;
|
|
195
|
+
background-color: $color-light-dark;
|
|
196
|
+
z-index: 1;
|
|
197
|
+
transition: all 0.2s ease-in-out;
|
|
198
|
+
border: 2px solid $color-light-dark;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
> .step-title {
|
|
202
|
+
max-width: 150px;
|
|
203
|
+
overflow: hidden;
|
|
204
|
+
font-weight: 500;
|
|
205
|
+
color: $font-color-soft;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
123
209
|
}
|
|
124
210
|
}
|
|
125
211
|
}
|
package/lib/avatar/index.js
CHANGED
|
@@ -23,7 +23,8 @@ const getClass = _ref => {
|
|
|
23
23
|
disabled,
|
|
24
24
|
size = 'default'
|
|
25
25
|
} = _ref;
|
|
26
|
-
return
|
|
26
|
+
return `avatar-component ${className}${disabled && '-disabled'}
|
|
27
|
+
${square && '-square'} ${size && `-${size}`}`;
|
|
27
28
|
};
|
|
28
29
|
const getIcon = (iconName, icon) => {
|
|
29
30
|
if (icon) {
|
|
@@ -70,18 +71,18 @@ const Avatar = props => {
|
|
|
70
71
|
if (targetRef) targetRef(r);
|
|
71
72
|
dropdownRef.current = r;
|
|
72
73
|
},
|
|
73
|
-
className:
|
|
74
|
+
className: `${getClass(props)} ${customClass}`,
|
|
74
75
|
style: _objectSpread({
|
|
75
|
-
width:
|
|
76
|
-
height:
|
|
77
|
-
backgroundColor:
|
|
78
|
-
cursor:
|
|
76
|
+
width: `${width}`,
|
|
77
|
+
height: `${height}`,
|
|
78
|
+
backgroundColor: `${color}`,
|
|
79
|
+
cursor: `${dropdown ? 'pointer' : 'normal'}`
|
|
79
80
|
}, style)
|
|
80
81
|
}, (iconName || icon) && !src && getIcon(iconName, icon), src && /*#__PURE__*/_react.default.createElement("img", {
|
|
81
82
|
className: "imgavatar",
|
|
82
83
|
style: {
|
|
83
|
-
width:
|
|
84
|
-
height:
|
|
84
|
+
width: `${width}`,
|
|
85
|
+
height: `${height}`
|
|
85
86
|
},
|
|
86
87
|
src: src,
|
|
87
88
|
alt: srcAlt
|
package/lib/badge/index.js
CHANGED
|
@@ -18,12 +18,12 @@ const Badge = props => {
|
|
|
18
18
|
right = '-11px'
|
|
19
19
|
} = props;
|
|
20
20
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
21
|
-
className:
|
|
21
|
+
className: `badge-component ${customClass}`
|
|
22
22
|
}, children, /*#__PURE__*/_react.default.createElement("span", {
|
|
23
|
-
className:
|
|
23
|
+
className: `badge -${color} ${customClassForBadge}`,
|
|
24
24
|
style: {
|
|
25
|
-
top:
|
|
26
|
-
right:
|
|
25
|
+
top: `${top}`,
|
|
26
|
+
right: `${right}`
|
|
27
27
|
}
|
|
28
28
|
}, content));
|
|
29
29
|
};
|
|
@@ -17,7 +17,7 @@ const DangerButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: `-danger ${customClass}`
|
|
21
21
|
}, rest));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = DangerButton;
|
|
@@ -72,7 +72,16 @@ const DefaultButton = _ref => {
|
|
|
72
72
|
const {
|
|
73
73
|
handlerSetOnDeniedText
|
|
74
74
|
} = (0, _react.useContext)(_withTooltip.TooltipContext);
|
|
75
|
-
const getClass = () =>
|
|
75
|
+
const getClass = () => `button-component ${className}
|
|
76
|
+
${customClass}
|
|
77
|
+
${transparent && '-transparent'}
|
|
78
|
+
${isDisabled && '-disabled'}
|
|
79
|
+
${size && `-${size}`}
|
|
80
|
+
${dropdown && !round && 'icon-right'}
|
|
81
|
+
${dropdown && round && 'icon-center'}
|
|
82
|
+
${iconAlign && !dropdown && `icon-${iconAlign}`}
|
|
83
|
+
${boxShadow ? '' : '-shadowsdisabled'}
|
|
84
|
+
${round && '-round'}`;
|
|
76
85
|
const returnPadlockIcon = resultantStyle => /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
77
86
|
name: "padlock",
|
|
78
87
|
size: 16,
|
|
@@ -126,6 +135,16 @@ const DefaultButton = _ref => {
|
|
|
126
135
|
if (!visible || onDenied.unvisible) return null;
|
|
127
136
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("button", _extends({}, rest, {
|
|
128
137
|
style: style,
|
|
138
|
+
onKeyDown: e => {
|
|
139
|
+
if (e && (e.key === 'Enter' || e.key === ' ')) {
|
|
140
|
+
e.preventDefault();
|
|
141
|
+
e.stopPropagation();
|
|
142
|
+
if (isDisabled) return;
|
|
143
|
+
if (onClick) refButton?.current?.click();
|
|
144
|
+
if (dropdown && showDropdown) showDropdown();
|
|
145
|
+
if (onClick && toggleable) setActiveButton(!activeButton);
|
|
146
|
+
}
|
|
147
|
+
},
|
|
129
148
|
onClick: e => {
|
|
130
149
|
// É Necessário que tenha o preventDefault pois foi retirado o disabled do botão, assim evitando que o evento padrão seja disparado.
|
|
131
150
|
e.preventDefault();
|
|
@@ -134,7 +153,7 @@ const DefaultButton = _ref => {
|
|
|
134
153
|
if (dropdown && showDropdown) showDropdown();
|
|
135
154
|
if (onClick && toggleable) setActiveButton(!activeButton);
|
|
136
155
|
},
|
|
137
|
-
className:
|
|
156
|
+
className: `${getClass()} ${activeButton ? '-toggleable' : ''} ${skeletonize ? '-skeletonized' : ''}`,
|
|
138
157
|
ref: r => {
|
|
139
158
|
if (buttonRef) {
|
|
140
159
|
if (!_lodash.default.isFunction(buttonRef)) {
|
|
@@ -146,7 +165,7 @@ const DefaultButton = _ref => {
|
|
|
146
165
|
if (targetRef) targetRef(r);
|
|
147
166
|
refButton.current = r;
|
|
148
167
|
},
|
|
149
|
-
tabIndex: tabIndex
|
|
168
|
+
tabIndex: isDisabled ? -1 : tabIndex
|
|
150
169
|
}), content, getIcon(), label || '', isLoading && /*#__PURE__*/_react.default.createElement("div", {
|
|
151
170
|
className: "spinnercontainer"
|
|
152
171
|
}, /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
@@ -17,7 +17,7 @@ const InfoButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: `-info ${customClass}`
|
|
21
21
|
}, rest));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = InfoButton;
|
|
@@ -17,7 +17,7 @@ const PrimaryButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: `-primary ${customClass}`
|
|
21
21
|
}, rest));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = PrimaryButton;
|
|
@@ -17,7 +17,7 @@ const SuccessButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({}, rest, {
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: `-success ${customClass}`
|
|
21
21
|
}));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = SuccessButton;
|
|
@@ -17,7 +17,7 @@ const WarningButton = _ref => {
|
|
|
17
17
|
} = _ref,
|
|
18
18
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement(_Button.default, _extends({}, rest, {
|
|
20
|
-
customClass:
|
|
20
|
+
customClass: `-warning ${customClass}`
|
|
21
21
|
}));
|
|
22
22
|
};
|
|
23
23
|
var _default = exports.default = WarningButton;
|
|
@@ -23,7 +23,7 @@ const ButtonContainer = _ref => {
|
|
|
23
23
|
} = _ref;
|
|
24
24
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
25
|
"data-testid": "button-container",
|
|
26
|
-
className:
|
|
26
|
+
className: `btn-container ${customClass}`,
|
|
27
27
|
style: getStyles(style, position)
|
|
28
28
|
}, children);
|
|
29
29
|
};
|
|
@@ -37,7 +37,7 @@ const SplitButton = props => {
|
|
|
37
37
|
}
|
|
38
38
|
})), /*#__PURE__*/_react.default.createElement(_DefaultButton.default, _extends({}, splitProps, {
|
|
39
39
|
iconName: "down",
|
|
40
|
-
customClass:
|
|
40
|
+
customClass: `${customClass} -transparenttext`,
|
|
41
41
|
iconStyle: {
|
|
42
42
|
marginRight: -7,
|
|
43
43
|
marginLeft: 0
|
package/lib/calendar/base/Day.js
CHANGED
|
@@ -25,7 +25,7 @@ const Day = _ref => {
|
|
|
25
25
|
onClick: () => {
|
|
26
26
|
if (handleDateChange) handleDateChange(day);
|
|
27
27
|
},
|
|
28
|
-
customClass:
|
|
28
|
+
customClass: ` ${(0, _helpers.getDayCssClass)(currentDate, day)} numberdaycalendar`,
|
|
29
29
|
label: day.format('D')
|
|
30
30
|
}));
|
|
31
31
|
};
|
|
@@ -21,7 +21,7 @@ const Month = _ref => {
|
|
|
21
21
|
const week = /*#__PURE__*/_react.default.createElement(_Week.default, {
|
|
22
22
|
currentDate: currentDate,
|
|
23
23
|
weekStartDate: startOfWeek,
|
|
24
|
-
key:
|
|
24
|
+
key: `week-${startOfWeek.format('YYYYMMDD')}`
|
|
25
25
|
});
|
|
26
26
|
weeks = [...weeks, week];
|
|
27
27
|
weekIndex += 1;
|
|
@@ -89,8 +89,8 @@ function getCalendarCssClass(_ref) {
|
|
|
89
89
|
customClass,
|
|
90
90
|
colorStyle
|
|
91
91
|
} = _ref;
|
|
92
|
-
let cssClass =
|
|
93
|
-
cssClass +=
|
|
92
|
+
let cssClass = `calendar-component ${customClass}`;
|
|
93
|
+
cssClass += ` -${colorStyle}`;
|
|
94
94
|
cssClass += unpadding ? ' -unpadding' : '';
|
|
95
95
|
cssClass += drawGridLines ? ' -draw-grid-lines' : '';
|
|
96
96
|
return cssClass;
|
|
@@ -71,7 +71,7 @@ const Calendar = props => {
|
|
|
71
71
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
72
72
|
className: "daynames"
|
|
73
73
|
}, (0, _helpers.dayNames)().map(name => /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
-
key:
|
|
74
|
+
key: `day-${name}`
|
|
75
75
|
}, name))), /*#__PURE__*/_react.default.createElement(_Month.default, {
|
|
76
76
|
currentDate: dataAtual
|
|
77
77
|
})));
|
package/lib/checkbox/index.js
CHANGED
|
@@ -69,7 +69,7 @@ const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
|
69
69
|
onClick: () => {
|
|
70
70
|
if (!shouldDisable() && !skeletonize) {
|
|
71
71
|
setIsChecked(!isChecked);
|
|
72
|
-
onChange
|
|
72
|
+
onChange?.({
|
|
73
73
|
target
|
|
74
74
|
});
|
|
75
75
|
}
|
package/lib/dialog/Custom.js
CHANGED
|
@@ -50,7 +50,7 @@ const Custom = props => {
|
|
|
50
50
|
}, props.text)), props.buttons && props.buttons.length > 0 && /*#__PURE__*/_react.default.createElement(_Footer.default, props, /*#__PURE__*/_react.default.createElement(_buttons.ButtonContainer, {
|
|
51
51
|
position: "right"
|
|
52
52
|
}, props.buttons.map(button => /*#__PURE__*/_react.default.cloneElement(button, {
|
|
53
|
-
key:
|
|
53
|
+
key: `button-${uuid.v1()}`
|
|
54
54
|
})))));
|
|
55
55
|
};
|
|
56
56
|
var _default = exports.default = Custom;
|
package/lib/dialog/Question.js
CHANGED
|
@@ -37,14 +37,12 @@ const Question = props => {
|
|
|
37
37
|
(0, _react.useLayoutEffect)(() => {
|
|
38
38
|
const lastElementActive = document.activeElement;
|
|
39
39
|
return () => {
|
|
40
|
-
|
|
41
|
-
lastElementActive === null || lastElementActive === void 0 ? void 0 : (_lastElementActive$fo = lastElementActive.focus) === null || _lastElementActive$fo === void 0 ? void 0 : _lastElementActive$fo.call(lastElementActive);
|
|
40
|
+
lastElementActive?.focus?.();
|
|
42
41
|
};
|
|
43
42
|
}, [visible]);
|
|
44
43
|
(0, _react.useEffect)(() => {
|
|
45
|
-
var _buttonUnconfirm$focu;
|
|
46
44
|
const buttonUnconfirm = document.getElementById(idUnconfirm);
|
|
47
|
-
buttonUnconfirm
|
|
45
|
+
buttonUnconfirm?.focus?.();
|
|
48
46
|
}, [visible, document.activeElement]);
|
|
49
47
|
if (!visible) return null;
|
|
50
48
|
return /*#__PURE__*/_react.default.createElement(_Custom.default, _extends({}, props, {
|
|
@@ -15,7 +15,7 @@ const Content = _ref => {
|
|
|
15
15
|
} = _ref;
|
|
16
16
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
17
|
id: "modal-dialog-content",
|
|
18
|
-
className:
|
|
18
|
+
className: `dialog-content ${className}`,
|
|
19
19
|
style: styleForContent
|
|
20
20
|
}, children);
|
|
21
21
|
};
|
|
@@ -46,10 +46,10 @@ const Header = _ref => {
|
|
|
46
46
|
tabIndex: -1,
|
|
47
47
|
onFocus: () => {},
|
|
48
48
|
onBlur: () => {},
|
|
49
|
-
ref: formDialogContext
|
|
49
|
+
ref: formDialogContext?.headerRef,
|
|
50
50
|
className: "dialog-header"
|
|
51
51
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
52
|
-
className:
|
|
52
|
+
className: `${icon !== null || titleIcon !== null ? 'left' : ''}`
|
|
53
53
|
}, getIcon(titleIcon, icon)), /*#__PURE__*/_react.default.createElement("div", {
|
|
54
54
|
className: "right"
|
|
55
55
|
}, /*#__PURE__*/_react.default.createElement("h5", {
|
package/lib/dialog/base/index.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = exports.DialogContext = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
|
+
var uuid = _interopRequireWildcard(require("uuid"));
|
|
9
10
|
var _style = _interopRequireDefault(require("./style"));
|
|
10
11
|
require("../../assets/styles/dialog.scss");
|
|
11
12
|
var _form = require("../form");
|
|
@@ -17,7 +18,9 @@ const {
|
|
|
17
18
|
body
|
|
18
19
|
} = document;
|
|
19
20
|
const BaseDialog = props => {
|
|
21
|
+
const baseDialogId = uuid.v4();
|
|
20
22
|
const {
|
|
23
|
+
id = baseDialogId,
|
|
21
24
|
overlay = true,
|
|
22
25
|
closeOnEsc,
|
|
23
26
|
closeOnOutsideClick,
|
|
@@ -55,7 +58,7 @@ const BaseDialog = props => {
|
|
|
55
58
|
}
|
|
56
59
|
};
|
|
57
60
|
const handleCloseOnEsc = event => {
|
|
58
|
-
if (
|
|
61
|
+
if (event?.key === 'Escape') {
|
|
59
62
|
event.stopPropagation();
|
|
60
63
|
handleClose();
|
|
61
64
|
}
|
|
@@ -74,7 +77,7 @@ const BaseDialog = props => {
|
|
|
74
77
|
let y = positionY <= 0 ? 0 : positionY;
|
|
75
78
|
if (x + width >= window.innerWidth) x = window.innerWidth - width;
|
|
76
79
|
if (y + height >= window.innerHeight) y = window.innerHeight - height;
|
|
77
|
-
wrapperEl.current.style.transform =
|
|
80
|
+
wrapperEl.current.style.transform = `translate(${x}px, ${y}px)`;
|
|
78
81
|
wrapperEl.current.style.transition = 'none';
|
|
79
82
|
wrapperEl.current.style.left = '0';
|
|
80
83
|
wrapperEl.current.style.top = '0';
|
|
@@ -94,15 +97,15 @@ const BaseDialog = props => {
|
|
|
94
97
|
}
|
|
95
98
|
};
|
|
96
99
|
const onMouseDown = event => {
|
|
97
|
-
var _headerRef$current;
|
|
98
100
|
const element = event.target;
|
|
99
|
-
const isHeader = headerRef
|
|
101
|
+
const isHeader = headerRef?.current?.contains(element);
|
|
100
102
|
if (wrapperEl.current && isHeader) setIsDragging(true);
|
|
101
103
|
};
|
|
102
104
|
const onMouseUp = () => {
|
|
103
105
|
if (wrapperEl.current) setIsDragging(false);
|
|
104
106
|
};
|
|
105
107
|
const createdModal = /*#__PURE__*/_react.default.createElement("div", {
|
|
108
|
+
id: id,
|
|
106
109
|
className: "modalcontainer",
|
|
107
110
|
onMouseDown: handleClickOutside,
|
|
108
111
|
style: {
|
|
@@ -112,7 +115,7 @@ const BaseDialog = props => {
|
|
|
112
115
|
className: "modal-overlay",
|
|
113
116
|
"data-testid": "modal-overlay"
|
|
114
117
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
115
|
-
className:
|
|
118
|
+
className: `dialog ${className}`,
|
|
116
119
|
"data-testid": "dialog-component"
|
|
117
120
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
118
121
|
className: wrapperClassName,
|
package/lib/dialog/form/index.js
CHANGED
|
@@ -59,8 +59,8 @@ const ModalForm = props => {
|
|
|
59
59
|
width: width,
|
|
60
60
|
height: height
|
|
61
61
|
}, props, {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
className: className,
|
|
63
|
+
wrapperClassName: `dialog-form-wrapper ${wrapperClassName}`
|
|
64
64
|
}), props.title && /*#__PURE__*/_react.default.createElement("div", {
|
|
65
65
|
className: "header-form"
|
|
66
66
|
}, /*#__PURE__*/_react.default.createElement(_Header.default, {
|
package/lib/dialog/types.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ interface IBaseProps {
|
|
|
32
32
|
open?: boolean;
|
|
33
33
|
onOpenChange?: (open: boolean) => void;
|
|
34
34
|
handlerClose?: () => void;
|
|
35
|
+
id?: string;
|
|
35
36
|
}
|
|
36
37
|
interface IFormProps extends Omit<IBaseProps, 'textAlign' | 'zIndex'> {
|
|
37
38
|
buttons?: JSX.Element[];
|
|
@@ -80,6 +81,7 @@ interface WizardComponentProps extends Omit<IFormProps, 'content'> {
|
|
|
80
81
|
title?: string;
|
|
81
82
|
handlerClose?: () => void;
|
|
82
83
|
controls: WizardControls;
|
|
84
|
+
position?: 'top' | 'left';
|
|
83
85
|
}
|
|
84
86
|
interface WizardStepComponentProps {
|
|
85
87
|
children: React.ReactNode;
|
|
@@ -8,6 +8,6 @@ import '../../icons/helper.js';
|
|
|
8
8
|
|
|
9
9
|
declare const WizardContext: React__default.Context<WizardControls | null>;
|
|
10
10
|
declare const useWizardContext: () => WizardControls | null;
|
|
11
|
-
declare function Wizard({ children, controls, showProgressbar, ...dialogProps }: Readonly<WizardComponentProps>): JSX.Element;
|
|
11
|
+
declare function Wizard({ children, controls, showProgressbar, position, ...dialogProps }: Readonly<WizardComponentProps>): JSX.Element;
|
|
12
12
|
|
|
13
13
|
export { Wizard as Container, WizardContext, Wizard as default, useWizardContext };
|
|
@@ -25,7 +25,7 @@ var _progressbar = require("./progressbar");
|
|
|
25
25
|
require("../../assets/styles/wizard.scss");
|
|
26
26
|
var _step = require("./step");
|
|
27
27
|
var _useWizard = require("./useWizard");
|
|
28
|
-
const _excluded = ["children", "controls", "showProgressbar"];
|
|
28
|
+
const _excluded = ["children", "controls", "showProgressbar", "position"];
|
|
29
29
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
30
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
31
31
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -39,7 +39,8 @@ function Wizard(_ref) {
|
|
|
39
39
|
let {
|
|
40
40
|
children,
|
|
41
41
|
controls,
|
|
42
|
-
showProgressbar = true
|
|
42
|
+
showProgressbar = true,
|
|
43
|
+
position = 'top'
|
|
43
44
|
} = _ref,
|
|
44
45
|
dialogProps = _objectWithoutProperties(_ref, _excluded);
|
|
45
46
|
const {
|
|
@@ -66,7 +67,8 @@ function Wizard(_ref) {
|
|
|
66
67
|
wrapperClassName: "wizard-wrapper",
|
|
67
68
|
contentClassName: "wizard-content"
|
|
68
69
|
}, dialogProps), showProgressbar && /*#__PURE__*/_react.default.createElement(_progressbar.Progressbar, {
|
|
69
|
-
stepsTitle: stepsTitle
|
|
70
|
+
stepsTitle: stepsTitle,
|
|
71
|
+
position: position
|
|
70
72
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
71
73
|
className: "wizard-body"
|
|
72
74
|
}, currentStepElement)));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties } from 'react';
|
|
2
2
|
|
|
3
|
-
declare function Progressbar({ customClass, customStyle, stepsTitle }: Readonly<{
|
|
3
|
+
declare function Progressbar({ customClass, customStyle, stepsTitle, position, }: Readonly<{
|
|
4
4
|
customClass?: string;
|
|
5
5
|
stepsTitle: {
|
|
6
6
|
title: string;
|
|
@@ -8,6 +8,7 @@ declare function Progressbar({ customClass, customStyle, stepsTitle }: Readonly<
|
|
|
8
8
|
completed: boolean;
|
|
9
9
|
}[];
|
|
10
10
|
customStyle?: CSSProperties;
|
|
11
|
+
position?: 'top' | 'left';
|
|
11
12
|
}>): JSX.Element;
|
|
12
13
|
|
|
13
14
|
export { Progressbar };
|
|
@@ -11,7 +11,8 @@ function Progressbar(_ref) {
|
|
|
11
11
|
let {
|
|
12
12
|
customClass,
|
|
13
13
|
customStyle,
|
|
14
|
-
stepsTitle
|
|
14
|
+
stepsTitle,
|
|
15
|
+
position = 'top'
|
|
15
16
|
} = _ref;
|
|
16
17
|
const context = (0, _.useWizardContext)();
|
|
17
18
|
if (!context) throw new Error('WizardProgressbar must be used within a Wizard component');
|
|
@@ -19,8 +20,9 @@ function Progressbar(_ref) {
|
|
|
19
20
|
currentStep
|
|
20
21
|
} = context;
|
|
21
22
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
22
|
-
className:
|
|
23
|
-
style: customStyle
|
|
23
|
+
className: `wizard-progressbar ${customClass}`,
|
|
24
|
+
style: customStyle,
|
|
25
|
+
"data-position": position
|
|
24
26
|
}, stepsTitle.map(step => /*#__PURE__*/_react.default.createElement("div", {
|
|
25
27
|
key: step.number,
|
|
26
28
|
className: "title",
|
|
@@ -16,7 +16,7 @@ function WizardStep(_ref) {
|
|
|
16
16
|
const context = (0, _.useWizardContext)();
|
|
17
17
|
if (!context) throw new Error('WizardStep must be used within a Wizard component');
|
|
18
18
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
|
-
className:
|
|
19
|
+
className: `wizard-step-component ${customClass}`,
|
|
20
20
|
style: customStyle
|
|
21
21
|
}, children);
|
|
22
22
|
}
|
package/lib/drawer/Drawer.js
CHANGED
|
@@ -83,7 +83,7 @@ const BaseDrawer = _ref => {
|
|
|
83
83
|
};
|
|
84
84
|
const closeDrawerOnEsc = e => {
|
|
85
85
|
if (closeOnEsc && e.key === 'Escape') {
|
|
86
|
-
handlerClose
|
|
86
|
+
handlerClose?.();
|
|
87
87
|
e.stopPropagation();
|
|
88
88
|
}
|
|
89
89
|
};
|
|
@@ -124,12 +124,12 @@ const BaseDrawer = _ref => {
|
|
|
124
124
|
value: contextValues
|
|
125
125
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
126
126
|
"data-testid": "drawercontainer-component",
|
|
127
|
-
className:
|
|
127
|
+
className: `${position} ${customClass}`,
|
|
128
128
|
style: style
|
|
129
129
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
130
130
|
style: overlayStyle,
|
|
131
131
|
"data-testid": "drawercontent",
|
|
132
|
-
className:
|
|
132
|
+
className: `drawercontent ${skeletonize ? '-skeletonized' : ''} ${customClassForContent}`
|
|
133
133
|
}, title && /*#__PURE__*/_react.default.createElement(_.DrawerHeader, _extends({}, headerProps, {
|
|
134
134
|
customClass: customClassForDrawer
|
|
135
135
|
})), content ? /*#__PURE__*/_react.default.createElement(_.DrawerContent, null, content) : children, getSpinner())));
|
package/lib/drawer/Header.js
CHANGED
|
@@ -61,7 +61,7 @@ const Header = _ref => {
|
|
|
61
61
|
};
|
|
62
62
|
const checkHandlerClose = () => handlerClose ? handlerClose() : undefined;
|
|
63
63
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
|
-
className:
|
|
64
|
+
className: `drawerheader ${customClass}`,
|
|
65
65
|
"data-testid": "drawerheader"
|
|
66
66
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
67
67
|
className: "left"
|