linear-react-components-ui 0.4.76-beta.29 → 0.4.76-beta.31
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/README.md +7 -5
- package/lib/assets/styles/effects.scss +20 -0
- package/lib/assets/styles/panel.scss +4 -1
- package/lib/assets/styles/table.scss +16 -0
- package/lib/assets/styles/tabs.scss +49 -44
- package/lib/assets/styles/treeview.scss +0 -5
- package/lib/assets/styles/uitour.scss +112 -0
- package/lib/form/form.spec.js +8 -0
- package/lib/form/index.js +40 -21
- package/lib/icons/helper.js +8 -0
- package/lib/inputs/base/InputTextBase.js +23 -3
- package/lib/inputs/date/helper.js +16 -0
- package/lib/inputs/mask/Phone.js +10 -1
- package/lib/inputs/mask/input_mask.spec.js +21 -4
- package/lib/inputs/select/Dropdown.js +5 -2
- package/lib/inputs/select/multiple/index.js +1 -1
- package/lib/internals/withTooltip.js +2 -2
- package/lib/skeleton/SkeletonContainer.js +1 -1
- package/lib/table/Body.js +53 -11
- package/lib/table/Header.js +12 -1
- package/lib/table/HeaderColumn.js +4 -2
- package/lib/table/Row.js +14 -7
- package/lib/table/RowColumn.js +4 -3
- package/lib/table/helpers.js +11 -1
- package/lib/table/index.js +34 -8
- package/lib/tabs/Menu.js +1 -11
- package/lib/tabs/index.js +1 -1
- package/lib/treeview/Node.js +15 -7
- package/lib/treeview/index.js +33 -19
- package/lib/treeview/treeview.spec.js +9 -0
- package/lib/uitour/helpers.js +15 -0
- package/lib/uitour/index.js +271 -0
- package/lib/uitour/uitour.spec.js +176 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,14 +71,16 @@ ficando da seguinte maneira:
|
|
|
71
71
|
|
|
72
72
|
### Publicar versão de demonstração no Heroku
|
|
73
73
|
|
|
74
|
+
Pré-requesistos
|
|
75
|
+
- Ter um conta no heroku
|
|
76
|
+
- Ser um colaborador do projeto no Heroku
|
|
77
|
+
- Ter o heroku cli instalado: https://devcenter.heroku.com/articles/heroku-cli#install-the-heroku-cli
|
|
74
78
|
|
|
75
|
-
No diretorio da aplicação clonar
|
|
76
|
-
`heroku git:clone -a linear-react-comp-demo`
|
|
77
|
-
|
|
78
|
-
Renomear a pastar `linear-react-comp-demo` para `demo`
|
|
79
|
-
|
|
80
79
|
Fazer login no Heroku
|
|
81
80
|
`heroku login`
|
|
81
|
+
|
|
82
|
+
No diretorio da aplicação clonar
|
|
83
|
+
`heroku git:clone -a linear-react-comp-demo demo`
|
|
82
84
|
|
|
83
85
|
Executar o comando
|
|
84
86
|
`npm run deploy:heroku`
|
|
@@ -731,3 +731,23 @@
|
|
|
731
731
|
left: 100%;
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
+
|
|
735
|
+
@keyframes slideRightToLeftWithFade {
|
|
736
|
+
from {
|
|
737
|
+
opacity: 0;
|
|
738
|
+
transform: translateX(2%);
|
|
739
|
+
} to {
|
|
740
|
+
opacity: 1;
|
|
741
|
+
transform: translateX(0);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
@keyframes slideLeftToRightWithFade {
|
|
746
|
+
from {
|
|
747
|
+
opacity: 0;
|
|
748
|
+
transform: translateX(-2%);
|
|
749
|
+
} to {
|
|
750
|
+
opacity: 1;
|
|
751
|
+
transform: translateX(0);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
height: 100%;
|
|
7
7
|
margin-bottom: 20px;
|
|
8
8
|
border: solid 1px $component-border-color;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
9
11
|
&.panel-shadow {
|
|
10
12
|
box-shadow: 0 2px 5px 0 rgba(0,0,0,.16), 0 2px 10px 0 rgba(0,0,0,.12);
|
|
11
13
|
}
|
|
@@ -47,7 +49,8 @@
|
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
> .panel-content {
|
|
50
|
-
|
|
52
|
+
flex: 1;
|
|
53
|
+
overflow: auto;
|
|
51
54
|
padding: 15px;
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -19,6 +19,19 @@
|
|
|
19
19
|
> .bodycontainer {
|
|
20
20
|
overflow-y: auto;
|
|
21
21
|
}
|
|
22
|
+
> .bodycontainer > .innertable > .tbody,
|
|
23
|
+
> .tbody {
|
|
24
|
+
position: relative;
|
|
25
|
+
&.skeleton-transparency::before {
|
|
26
|
+
content: '';
|
|
27
|
+
position: absolute;
|
|
28
|
+
width: 100%;
|
|
29
|
+
height: 100%;
|
|
30
|
+
background: rgb(255,255,255);
|
|
31
|
+
background: linear-gradient( 180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 30%,
|
|
32
|
+
rgba(255,255,255,0.6) 70%,rgba(255,255,255,0.8) 100%);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
22
35
|
> .headercontainer > .innertable > .theader > .trow,
|
|
23
36
|
> .bodycontainer > .innertable > .tbody > .trow,
|
|
24
37
|
> .theader > .trow,
|
|
@@ -33,6 +46,9 @@
|
|
|
33
46
|
vertical-align: middle;
|
|
34
47
|
border-bottom: 1px solid $component-border-color-soft;
|
|
35
48
|
line-height: 18px;
|
|
49
|
+
> .rowskeleton {
|
|
50
|
+
margin: 10px 0;
|
|
51
|
+
}
|
|
36
52
|
> .hidden,
|
|
37
53
|
> .rowhover {
|
|
38
54
|
display: none;
|
|
@@ -48,7 +48,6 @@
|
|
|
48
48
|
margin-right: 1px;
|
|
49
49
|
padding: 0;
|
|
50
50
|
width: auto;
|
|
51
|
-
min-width: 100px;
|
|
52
51
|
display: flex;
|
|
53
52
|
justify-content: space-between;
|
|
54
53
|
align-items: center;
|
|
@@ -122,24 +121,26 @@
|
|
|
122
121
|
.tabs-component.menu-left {
|
|
123
122
|
grid-template-columns: auto 1fr;
|
|
124
123
|
grid-template-rows: none;
|
|
125
|
-
> .
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
124
|
+
> .menucontainer {
|
|
125
|
+
> .menu {
|
|
126
|
+
box-shadow: -1px 0px 0px 0px $component-border-color inset;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
justify-content: center;
|
|
129
|
+
}
|
|
130
|
+
> .menu > .menuitem {
|
|
131
|
+
border-radius: 5px 0px 0px 5px;
|
|
132
|
+
-moz-border-radius: 5px 0px 0px 5px;
|
|
133
|
+
-webkit-border-radius: 5px 0px 0px 5px;
|
|
134
|
+
&.selected {
|
|
135
|
+
border: 1px solid $component-border-color;
|
|
136
|
+
border-right: 1px solid $font-color-second;
|
|
137
|
+
border-left: 2px solid $component-selected-color;
|
|
138
|
+
width: 100%;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
> .menu > .menuitem > .closepanel {
|
|
142
|
+
float: left;
|
|
139
143
|
}
|
|
140
|
-
}
|
|
141
|
-
> .menu > .menuitem > .closepanel {
|
|
142
|
-
float: left;
|
|
143
144
|
}
|
|
144
145
|
> .panel {
|
|
145
146
|
border-top: 1px solid $component-border-color;
|
|
@@ -152,18 +153,20 @@
|
|
|
152
153
|
*/
|
|
153
154
|
.tabs-component.menu-bottom {
|
|
154
155
|
grid-template-rows: 1fr auto;
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
156
|
+
.menucontainer {
|
|
157
|
+
> .menu {
|
|
158
|
+
box-shadow: 0 1px 1px 0px $component-border-color inset;
|
|
159
|
+
}
|
|
160
|
+
> .menu > .menuitem {
|
|
161
|
+
border-radius: 0px 0px 5px 5px;
|
|
162
|
+
-moz-border-radius: 0px 0px 5px 5px;
|
|
163
|
+
-webkit-border-radius: 0px 0px 5px 5px;
|
|
164
|
+
&.selected {
|
|
165
|
+
border: 1px solid $component-border-color;
|
|
166
|
+
border-top: 1px solid $font-color-second;
|
|
167
|
+
border-bottom: 2px solid $component-selected-color;
|
|
168
|
+
height: 100%;
|
|
169
|
+
}
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
172
|
> .panel {
|
|
@@ -178,20 +181,22 @@
|
|
|
178
181
|
.tabs-component.menu-right {
|
|
179
182
|
grid-template-columns: 1fr auto;
|
|
180
183
|
grid-template-rows: none;
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
184
|
+
.menucontainer{
|
|
185
|
+
> .menu {
|
|
186
|
+
box-shadow: 2px 0 0px -1px $component-border-color inset;
|
|
187
|
+
flex-direction: column;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
}
|
|
190
|
+
> .menu > .menuitem {
|
|
191
|
+
border-radius: 0px 5px 5px 0px;
|
|
192
|
+
-moz-border-radius: 0px 5px 5px 0px;
|
|
193
|
+
-webkit-border-radius: 0px 5px 5px 0px;
|
|
194
|
+
&.selected {
|
|
195
|
+
border: 1px solid $component-border-color;
|
|
196
|
+
border-left: 1px solid $font-color-second;
|
|
197
|
+
border-right: 2px solid $component-selected-color;
|
|
198
|
+
width: 100%;
|
|
199
|
+
}
|
|
195
200
|
}
|
|
196
201
|
}
|
|
197
202
|
> .panel {
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
@import "commons.scss";
|
|
2
|
+
@import "colors.scss";
|
|
3
|
+
@import "effects.scss";
|
|
4
|
+
|
|
5
|
+
$step-arrow-size: 22px;
|
|
6
|
+
$step-arrow-shadow-size: 26px;
|
|
7
|
+
%step-arrow {
|
|
8
|
+
content: '';
|
|
9
|
+
position: absolute;
|
|
10
|
+
border-bottom: $step-arrow-size solid transparent;
|
|
11
|
+
border-right: $step-arrow-size solid #fff;
|
|
12
|
+
border-top: $step-arrow-size solid transparent;
|
|
13
|
+
}
|
|
14
|
+
%step-arrow-shadow {
|
|
15
|
+
content: '';
|
|
16
|
+
position: absolute;
|
|
17
|
+
border-bottom: $step-arrow-shadow-size solid transparent;
|
|
18
|
+
border-right: $step-arrow-shadow-size solid rgba(0, 0, 0, 0.6);
|
|
19
|
+
border-top: $step-arrow-shadow-size solid transparent;
|
|
20
|
+
}
|
|
21
|
+
.uitour-component {
|
|
22
|
+
position: absolute;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100vh;
|
|
25
|
+
left: 0;
|
|
26
|
+
top: 0;
|
|
27
|
+
z-index: 99999999999999999999;
|
|
28
|
+
> .step {
|
|
29
|
+
background-color: #fff;
|
|
30
|
+
position: relative;
|
|
31
|
+
max-width: 450px;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
border: 3px solid rgba(0, 0, 0, 0.6);
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
padding: 5px 0;
|
|
37
|
+
&.-left {
|
|
38
|
+
animation: slideRightToLeftWithFade 0.5s;
|
|
39
|
+
&:before {
|
|
40
|
+
@extend %step-arrow-shadow;
|
|
41
|
+
top: 6px;
|
|
42
|
+
left: -$step-arrow-shadow-size;
|
|
43
|
+
}
|
|
44
|
+
&:after {
|
|
45
|
+
@extend %step-arrow;
|
|
46
|
+
top: 10px;
|
|
47
|
+
left: -$step-arrow-size;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
&.-right {
|
|
51
|
+
animation: slideLeftToRightWithFade 0.5s;
|
|
52
|
+
&:before {
|
|
53
|
+
@extend %step-arrow-shadow;
|
|
54
|
+
top: 6px;
|
|
55
|
+
right: -$step-arrow-shadow-size;
|
|
56
|
+
transform: rotate(180deg);
|
|
57
|
+
}
|
|
58
|
+
&:after {
|
|
59
|
+
@extend %step-arrow;
|
|
60
|
+
top: 10px;
|
|
61
|
+
right: -$step-arrow-size;
|
|
62
|
+
transform: rotate(180deg);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
> .closebutton {
|
|
66
|
+
align-self: flex-end;
|
|
67
|
+
padding: 0 5px 5px;
|
|
68
|
+
line-height: 0;
|
|
69
|
+
}
|
|
70
|
+
> .content {
|
|
71
|
+
width: 100%;
|
|
72
|
+
padding: 0px 20px;
|
|
73
|
+
margin-bottom: 0;
|
|
74
|
+
display: flex;
|
|
75
|
+
> .number {
|
|
76
|
+
display: flex;
|
|
77
|
+
width: 40px;
|
|
78
|
+
height: 40px;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
border-radius: 50%;
|
|
82
|
+
background-color: $success-color;
|
|
83
|
+
color: #fff;
|
|
84
|
+
margin-right: 10px;
|
|
85
|
+
font-weight: bold;
|
|
86
|
+
font-size: 20px;
|
|
87
|
+
line-height: 0;
|
|
88
|
+
}
|
|
89
|
+
> .about {
|
|
90
|
+
flex: 1;
|
|
91
|
+
margin-bottom: 10px;
|
|
92
|
+
> h3 {
|
|
93
|
+
font-size: 16px;
|
|
94
|
+
font-weight: bold;
|
|
95
|
+
}
|
|
96
|
+
> .description {
|
|
97
|
+
font-size: 14px;
|
|
98
|
+
line-height: 18px;
|
|
99
|
+
strong {
|
|
100
|
+
font-weight: bold;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
> .footer {
|
|
106
|
+
display: flex;
|
|
107
|
+
justify-content: flex-end;
|
|
108
|
+
gap: 10px;
|
|
109
|
+
padding: 5px 10px 10px;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
package/lib/form/form.spec.js
CHANGED
|
@@ -189,6 +189,14 @@ describe('Form', function () {
|
|
|
189
189
|
}));
|
|
190
190
|
expect(mockHandlerReset).toHaveBeenCalled();
|
|
191
191
|
});
|
|
192
|
+
it('should apply disabled', function () {
|
|
193
|
+
var mockHandlerReset = jest.fn();
|
|
194
|
+
(0, _react2.render)(mockForm({
|
|
195
|
+
disabled: true,
|
|
196
|
+
handlerReset: mockHandlerReset
|
|
197
|
+
}));
|
|
198
|
+
expect(mockHandlerReset).not.toHaveBeenCalled();
|
|
199
|
+
});
|
|
192
200
|
});
|
|
193
201
|
describe('Field', function () {
|
|
194
202
|
describe('Default & Number', function () {
|
package/lib/form/index.js
CHANGED
|
@@ -91,7 +91,8 @@ var Form = function Form(_ref) {
|
|
|
91
91
|
onValidateForm = _ref.onValidateForm,
|
|
92
92
|
externalFieldErrors = _ref.externalFieldErrors,
|
|
93
93
|
onSubmit = _ref.onSubmit,
|
|
94
|
-
skeletonize = _ref.skeletonize
|
|
94
|
+
skeletonize = _ref.skeletonize,
|
|
95
|
+
disabled = _ref.disabled;
|
|
95
96
|
|
|
96
97
|
var _useState = (0, _react.useState)(dataSource),
|
|
97
98
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -231,10 +232,29 @@ var Form = function Form(_ref) {
|
|
|
231
232
|
};
|
|
232
233
|
};
|
|
233
234
|
|
|
235
|
+
var formProps = function formProps() {
|
|
236
|
+
var propsForm = null;
|
|
237
|
+
|
|
238
|
+
if (!disabled) {
|
|
239
|
+
propsForm = {
|
|
240
|
+
onSubmit: function onSubmit(e) {
|
|
241
|
+
return e.preventDefault();
|
|
242
|
+
},
|
|
243
|
+
onKeyPress: function onKeyPress(e) {
|
|
244
|
+
return submitOnEnter(e);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
return propsForm;
|
|
250
|
+
};
|
|
251
|
+
|
|
234
252
|
(0, _react.useEffect)(function () {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
253
|
+
if (!disabled) {
|
|
254
|
+
handlerSubmit(onFormSubmit);
|
|
255
|
+
if (handlerReset) handlerReset(onReset);
|
|
256
|
+
if (handlerValidates) handlerValidates(checkIsValid);
|
|
257
|
+
}
|
|
238
258
|
}, [data]);
|
|
239
259
|
(0, _react.useEffect)(function () {
|
|
240
260
|
if (securityBeforeUnload) {
|
|
@@ -247,27 +267,24 @@ var Form = function Form(_ref) {
|
|
|
247
267
|
};
|
|
248
268
|
}, [securityBeforeUnload, onBeforeUnload]);
|
|
249
269
|
(0, _react.useEffect)(function () {
|
|
250
|
-
if (
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
270
|
+
if (!disabled) {
|
|
271
|
+
if (submitOnPressEnterKey !== submitFormOnEnter || dataSource !== originalData) {
|
|
272
|
+
setData(dataSource);
|
|
273
|
+
setOriginalData(function (prevState) {
|
|
274
|
+
return prevState || dataSource;
|
|
275
|
+
});
|
|
276
|
+
setSubmitFormOnEnter(submitOnPressEnterKey);
|
|
277
|
+
}
|
|
256
278
|
}
|
|
257
279
|
}, [submitOnPressEnterKey, dataSource]);
|
|
258
280
|
return /*#__PURE__*/_react["default"].createElement(_react.Fragment, null, /*#__PURE__*/_react["default"].createElement(_helpers.FormContext.Provider, {
|
|
259
281
|
value: getContextValue()
|
|
260
|
-
}, /*#__PURE__*/_react["default"].createElement("form", {
|
|
261
|
-
style: style
|
|
262
|
-
|
|
263
|
-
return e.preventDefault();
|
|
264
|
-
},
|
|
265
|
-
onKeyPress: function onKeyPress(e) {
|
|
266
|
-
return submitOnEnter(e);
|
|
267
|
-
},
|
|
282
|
+
}, /*#__PURE__*/_react["default"].createElement("form", _extends({
|
|
283
|
+
style: style
|
|
284
|
+
}, formProps(), {
|
|
268
285
|
role: "presentation",
|
|
269
286
|
className: "form-component ".concat(customClass)
|
|
270
|
-
}, children)), /*#__PURE__*/_react["default"].createElement(_dialog.DialogQuestion, {
|
|
287
|
+
}), children)), /*#__PURE__*/_react["default"].createElement(_dialog.DialogQuestion, {
|
|
271
288
|
zIndex: "99999999",
|
|
272
289
|
title: securityTitle || 'Dados Alterados',
|
|
273
290
|
text: securityText || 'Você possui dados alterados, confirma o fechamento?',
|
|
@@ -293,7 +310,8 @@ Form.propTypes = {
|
|
|
293
310
|
securityTitle: _propTypes["default"].string,
|
|
294
311
|
securityText: _propTypes["default"].string,
|
|
295
312
|
externalFieldErrors: _propTypes["default"].object,
|
|
296
|
-
skeletonize: _propTypes["default"].bool
|
|
313
|
+
skeletonize: _propTypes["default"].bool,
|
|
314
|
+
disabled: _propTypes["default"].bool
|
|
297
315
|
};
|
|
298
316
|
Form.defaultProps = {
|
|
299
317
|
onValidateForm: undefined,
|
|
@@ -307,7 +325,8 @@ Form.defaultProps = {
|
|
|
307
325
|
securityTitle: null,
|
|
308
326
|
securityText: null,
|
|
309
327
|
externalFieldErrors: {},
|
|
310
|
-
skeletonize: false
|
|
328
|
+
skeletonize: false,
|
|
329
|
+
disabled: false
|
|
311
330
|
};
|
|
312
331
|
var _default = Form;
|
|
313
332
|
exports["default"] = _default;
|
package/lib/icons/helper.js
CHANGED
|
@@ -554,6 +554,14 @@ function getIcons() {
|
|
|
554
554
|
flipVertical4: {
|
|
555
555
|
viewbox: '0 0 16 16',
|
|
556
556
|
paths: ['M0.854 5.146c-0.143-0.143-0.358-0.186-0.545-0.108s-0.309 0.26-0.309 0.462v10c0 0.202 0.122 0.385 0.309 0.462 0.062 0.026 0.127 0.038 0.191 0.038 0.13 0 0.258-0.051 0.354-0.146l5-5c0.195-0.195 0.195-0.512 0-0.707l-5-5z', 'M7.5 7c-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v1c0 0.276-0.224 0.5-0.5 0.5z', 'M7.5 10c-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v1c0 0.276-0.224 0.5-0.5 0.5z', 'M7.5 13c-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v1c0 0.276-0.224 0.5-0.5 0.5z', 'M7.5 16c-0.276 0-0.5-0.224-0.5-0.5v-1c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v1c0 0.276-0.224 0.5-0.5 0.5z', 'M14.691 5.038c-0.062-0.026-0.127-0.038-0.191-0.038-0.13 0-0.258 0.051-0.354 0.146l-5 5c-0.195 0.195-0.195 0.512 0 0.707l5 5c0.143 0.143 0.358 0.186 0.545 0.108s0.309-0.26 0.309-0.462v-10c0-0.202-0.122-0.385-0.309-0.462zM13.875 13.991l-3.491-3.491 3.491-3.491v6.982z', 'M11.5 3c-0.943-1.257-2.419-2-4-2-1.672 0-3.226 0.831-4.158 2.222-0.154 0.229-0.092 0.54 0.137 0.694s0.54 0.092 0.694-0.137c0.745-1.113 1.989-1.778 3.327-1.778 1.313 0 2.534 0.64 3.284 1.716l-1.284 1.284h3.5v-3.5l-1.5 1.5z']
|
|
557
|
+
},
|
|
558
|
+
tools: {
|
|
559
|
+
viewbox: '0 0 20 16',
|
|
560
|
+
paths: ['M7.696 11.009l2.295 2.295-1.823 2.341c-0.334 0.437-0.926 0.476-1.315 0.087l-1.586-1.586c-0.389-0.389-0.35-0.98 0.087-1.315l2.341-1.823zM19.899 4.101l-2.399 2.399-3-3 2.399-2.399c-0.289-0.066-0.59-0.101-0.899-0.101-2.209 0-4 1.791-4 4 0 0.797 0.233 1.539 0.635 2.163l-2.233 1.739-3.402-3.402 4.5-4.5h-5l-2.22 2.22-0.22-0.22h-1.061v1.061l0.22 0.22-3.22 3.22 2.5 2.5 3-3 9 9 1.5-1.5-3.902-3.902 1.739-2.233c0.624 0.402 1.366 0.635 2.163 0.635 2.209 0 4-1.791 4-4 0-0.309-0.035-0.61-0.101-0.899z']
|
|
561
|
+
},
|
|
562
|
+
checkmarkCircle: {
|
|
563
|
+
viewbox: '0 0 16 16',
|
|
564
|
+
paths: ['M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM6.5 12.031l-2.813-3.344 1.031-1.031 1.781 1.75 5.156-4.5 0.719 0.719-5.875 6.406z']
|
|
557
565
|
}
|
|
558
566
|
};
|
|
559
567
|
return icons;
|
|
@@ -79,7 +79,12 @@ var InputTextBase = function InputTextBase(props) {
|
|
|
79
79
|
onDeniedActions = props.onDeniedActions,
|
|
80
80
|
handlerSetOnDenied = props.handlerSetOnDenied,
|
|
81
81
|
targetRef = props.targetRef,
|
|
82
|
-
skeletonize = props.skeletonize
|
|
82
|
+
skeletonize = props.skeletonize,
|
|
83
|
+
style = props.style,
|
|
84
|
+
styleForInputContent = props.styleForInputContent,
|
|
85
|
+
styleForWrapper = props.styleForWrapper,
|
|
86
|
+
styleForLabel = props.styleForLabel,
|
|
87
|
+
styleForSideButtons = props.styleForSideButtons;
|
|
83
88
|
var options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
84
89
|
|
|
85
90
|
var _useState = (0, _react.useState)(onDeniedActions || (0, _permissionValidations.actionsOnPermissionDenied)(permissionAttr, options)),
|
|
@@ -153,23 +158,28 @@ var InputTextBase = function InputTextBase(props) {
|
|
|
153
158
|
|
|
154
159
|
if (!visible || unvisible) return null;
|
|
155
160
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
161
|
+
style: style,
|
|
156
162
|
className: "input-base-component ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClass),
|
|
157
163
|
ref: inputBaseRef
|
|
158
164
|
}, label && /*#__PURE__*/_react["default"].createElement("div", {
|
|
159
165
|
className: "labelcontainer"
|
|
160
166
|
}, /*#__PURE__*/_react["default"].createElement("span", {
|
|
167
|
+
style: styleForLabel,
|
|
161
168
|
className: "label ".concat(customClassForLabel, " ").concat(labelUppercase && ' -uppercase')
|
|
162
169
|
}, label, required && /*#__PURE__*/_react["default"].createElement("span", {
|
|
163
170
|
className: "-requiredlabel"
|
|
164
171
|
}, "*"))), /*#__PURE__*/_react["default"].createElement("div", {
|
|
165
172
|
"data-testid": "testInputWrapper",
|
|
173
|
+
style: styleForWrapper,
|
|
166
174
|
className: helpers.getInputWrapperClass(_extends({}, props, {
|
|
167
175
|
disabled: shouldDisable() || hideContent
|
|
168
176
|
}))
|
|
169
177
|
}, leftElements && /*#__PURE__*/_react["default"].createElement("div", {
|
|
178
|
+
style: styleForSideButtons,
|
|
170
179
|
className: "sidebuttons ".concat(customClassForSideButtons)
|
|
171
180
|
}, leftElements), /*#__PURE__*/_react["default"].createElement("div", {
|
|
172
181
|
"data-testid": "testInputContent",
|
|
182
|
+
style: styleForInputContent,
|
|
173
183
|
className: "inputcontent ".concat(customClassForInputContent)
|
|
174
184
|
}, type === 'textarea' ? /*#__PURE__*/_react["default"].createElement("textarea", _extends({
|
|
175
185
|
rows: props.rows,
|
|
@@ -223,7 +233,12 @@ InputTextBase.propTypes = {
|
|
|
223
233
|
handlerSetOnDenied: _propTypes["default"].func,
|
|
224
234
|
targetRef: _propTypes["default"].func,
|
|
225
235
|
gridLayout: _propTypes["default"].string,
|
|
226
|
-
skeletonize: _propTypes["default"].bool
|
|
236
|
+
skeletonize: _propTypes["default"].bool,
|
|
237
|
+
style: _propTypes["default"].object,
|
|
238
|
+
styleForInputContent: _propTypes["default"].object,
|
|
239
|
+
styleForWrapper: _propTypes["default"].object,
|
|
240
|
+
styleForLabel: _propTypes["default"].object,
|
|
241
|
+
styleForSideButtons: _propTypes["default"].object
|
|
227
242
|
};
|
|
228
243
|
InputTextBase.defaultProps = {
|
|
229
244
|
value: undefined,
|
|
@@ -266,7 +281,12 @@ InputTextBase.defaultProps = {
|
|
|
266
281
|
handlerSetOnDenied: undefined,
|
|
267
282
|
targetRef: undefined,
|
|
268
283
|
gridLayout: undefined,
|
|
269
|
-
skeletonize: false
|
|
284
|
+
skeletonize: false,
|
|
285
|
+
style: {},
|
|
286
|
+
styleForInputContent: {},
|
|
287
|
+
styleForWrapper: {},
|
|
288
|
+
styleForLabel: {},
|
|
289
|
+
styleForSideButtons: {}
|
|
270
290
|
};
|
|
271
291
|
|
|
272
292
|
var _default = (0, _inputHOC["default"])((0, _withTooltip["default"])(InputTextBase));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports["default"] = void 0;
|
|
7
|
+
|
|
8
|
+
var getCalendarDropdownStyle = function getCalendarDropdownStyle(_ref) {
|
|
9
|
+
var topPosition = _ref.topPosition,
|
|
10
|
+
leftPosition = _ref.leftPosition,
|
|
11
|
+
width = _ref.width;
|
|
12
|
+
return "top: ".concat(topPosition, "px;\n left: ").concat(leftPosition, "px;\n width:").concat(width, "px");
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var _default = getCalendarDropdownStyle;
|
|
16
|
+
exports["default"] = _default;
|
package/lib/inputs/mask/Phone.js
CHANGED
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
+
|
|
10
12
|
var _BaseMask = _interopRequireDefault(require("./BaseMask"));
|
|
11
13
|
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
@@ -14,10 +16,17 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d
|
|
|
14
16
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
17
|
|
|
16
18
|
var PhoneField = function PhoneField(props) {
|
|
19
|
+
var cellNumber = props.cellNumber;
|
|
17
20
|
return /*#__PURE__*/_react["default"].createElement(_BaseMask["default"], _extends({}, props, {
|
|
18
|
-
mask:
|
|
21
|
+
mask: cellNumber ? '(00) 00000-0000' : '(00) 0000-0000'
|
|
19
22
|
}));
|
|
20
23
|
};
|
|
21
24
|
|
|
25
|
+
PhoneField.propTypes = {
|
|
26
|
+
cellNumber: _propTypes["default"].bool
|
|
27
|
+
};
|
|
28
|
+
PhoneField.defaultProps = {
|
|
29
|
+
cellNumber: false
|
|
30
|
+
};
|
|
22
31
|
var _default = PhoneField;
|
|
23
32
|
exports["default"] = _default;
|
|
@@ -562,18 +562,35 @@ describe('Input Masked', function () {
|
|
|
562
562
|
|
|
563
563
|
expect(input).toHaveValue('(11) 1111-1111');
|
|
564
564
|
});
|
|
565
|
+
it('should apply cellNumber', function () {
|
|
566
|
+
var _render38 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_.PhoneField, {
|
|
567
|
+
cellNumber: true
|
|
568
|
+
})),
|
|
569
|
+
container = _render38.container;
|
|
570
|
+
|
|
571
|
+
var input = container.querySelector('.input-base-component .inputwrapper .inputcontent input.textinput');
|
|
572
|
+
expect(input).toHaveValue('(__) _____-____');
|
|
573
|
+
|
|
574
|
+
_react2.fireEvent.change(input, {
|
|
575
|
+
target: {
|
|
576
|
+
value: '11111111111'
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
expect(input).toHaveValue('(11) 11111-1111');
|
|
581
|
+
});
|
|
565
582
|
});
|
|
566
583
|
describe('Zip Code', function () {
|
|
567
584
|
it('should render correctly', function () {
|
|
568
|
-
var
|
|
569
|
-
container =
|
|
585
|
+
var _render39 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_.ZipCodeField, null)),
|
|
586
|
+
container = _render39.container;
|
|
570
587
|
|
|
571
588
|
expect(container.firstChild).toBeTruthy();
|
|
572
589
|
expect(container.firstChild).toHaveClass('input-base-component');
|
|
573
590
|
});
|
|
574
591
|
it('should apply zipcode mask', function () {
|
|
575
|
-
var
|
|
576
|
-
container =
|
|
592
|
+
var _render40 = (0, _react2.render)( /*#__PURE__*/_react["default"].createElement(_.ZipCodeField, null)),
|
|
593
|
+
container = _render40.container;
|
|
577
594
|
|
|
578
595
|
var input = container.querySelector('.input-base-component .inputwrapper .inputcontent input.textinput');
|
|
579
596
|
expect(input).toHaveValue('_____-___');
|
|
@@ -85,7 +85,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
85
85
|
imgSrcKey = _ref.imgSrcKey,
|
|
86
86
|
gridWrapperStyle = _ref.gridWrapperStyle,
|
|
87
87
|
selectFieldRef = _ref.selectFieldRef,
|
|
88
|
-
dropdownMaxHeight = _ref.dropdownMaxHeight
|
|
88
|
+
dropdownMaxHeight = _ref.dropdownMaxHeight,
|
|
89
|
+
inputValue = _ref.inputValue;
|
|
89
90
|
|
|
90
91
|
var _useState = (0, _react.useState)(returnDropdownDynamicStyles(selectFieldRef, dropdownMaxHeight)),
|
|
91
92
|
_useState2 = _slicedToArray(_useState, 1),
|
|
@@ -102,6 +103,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
102
103
|
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
103
104
|
className: "filterinput",
|
|
104
105
|
type: "text",
|
|
106
|
+
value: inputValue,
|
|
105
107
|
onFocus: function onFocus() {
|
|
106
108
|
handleOnFocus();
|
|
107
109
|
},
|
|
@@ -174,7 +176,8 @@ Dropdown.propTypes = {
|
|
|
174
176
|
striped: _propTypes["default"].bool,
|
|
175
177
|
gridWrapperStyle: _propTypes["default"].object,
|
|
176
178
|
selectFieldRef: _propTypes["default"].object,
|
|
177
|
-
dropdownMaxHeight: _propTypes["default"].number
|
|
179
|
+
dropdownMaxHeight: _propTypes["default"].number,
|
|
180
|
+
inputValue: _propTypes["default"].string.isRequired
|
|
178
181
|
};
|
|
179
182
|
Dropdown.defaultProps = {
|
|
180
183
|
selected: null,
|
|
@@ -397,7 +397,7 @@ Object.defineProperty(MultipleSelect, "getDerivedStateFromProps", {
|
|
|
397
397
|
var dataCombo = remoteSearch ? dataSource : (0, _helper.getFilteredMultipleDataCombo)(_extends({}, props, state));
|
|
398
398
|
return {
|
|
399
399
|
dataCombo: dataCombo,
|
|
400
|
-
selected:
|
|
400
|
+
selected: dataCombo.length > 0 ? dataCombo[0] : null
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
403
|
|