linear-react-components-ui 1.1.2-beta.8 → 1.1.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintcache +1 -0
- package/.gitlab-ci.yml +1 -0
- package/.vscode/settings.json +10 -1
- package/lib/@types/SizePixels.d.ts +1 -1
- package/lib/assets/styles/button.scss +11 -9
- package/lib/assets/styles/checkbox.scss +37 -38
- package/lib/assets/styles/colors.scss +2 -0
- package/lib/assets/styles/commons.scss +1 -0
- package/lib/assets/styles/error.scss +9 -0
- package/lib/assets/styles/fieldset.scss +3 -0
- package/lib/assets/styles/gridlayout.scss +0 -2
- package/lib/assets/styles/hint.scss +21 -0
- package/lib/assets/styles/input.scss +7 -7
- package/lib/assets/styles/table.scss +2 -1
- package/lib/buttons/DefaultButton.js +29 -12
- package/lib/buttons/types.d.ts +1 -0
- package/lib/checkbox/Label.js +13 -4
- package/lib/checkbox/index.js +15 -11
- package/lib/dialog/Custom.js +4 -2
- package/lib/dialog/base/index.js +3 -2
- package/lib/dialog/form/index.js +3 -3
- package/lib/drawer/Drawer.js +1 -1
- package/lib/fieldset/index.js +4 -2
- package/lib/fieldset/types.d.ts +2 -0
- package/lib/form/Field.d.ts +2 -0
- package/lib/form/FieldArray.d.ts +2 -0
- package/lib/form/FieldArray.js +12 -26
- package/lib/form/FieldNumber.d.ts +2 -0
- package/lib/form/FieldPeriod.d.ts +2 -0
- package/lib/form/helpers.d.ts +2 -0
- package/lib/form/index.d.ts +2 -0
- package/lib/form/index.js +6 -7
- package/lib/form/types.d.ts +5 -2
- package/lib/form/withFieldHOC.d.ts +2 -0
- package/lib/form/withFormSecurity.d.ts +2 -0
- package/lib/gridlayout/GridRow.js +10 -2
- package/lib/gridlayout/types.d.ts +1 -1
- package/lib/hint/helpers.d.ts +3 -0
- package/lib/hint/helpers.js +21 -0
- package/lib/hint/index.d.ts +2 -1
- package/lib/hint/index.js +9 -15
- package/lib/hint/types.d.ts +3 -0
- package/lib/icons/helper.d.ts +4 -0
- package/lib/icons/helper.js +4 -0
- package/lib/inputs/base/InputTextBase.d.ts +2 -0
- package/lib/inputs/base/InputTextBase.js +51 -7
- package/lib/inputs/base/Label.d.ts +14 -0
- package/lib/inputs/base/Label.js +35 -0
- package/lib/inputs/base/helpers.d.ts +3 -2
- package/lib/inputs/base/helpers.js +1 -8
- package/lib/inputs/base/types.d.ts +14 -2
- package/lib/inputs/date/Dialog.d.ts +2 -0
- package/lib/inputs/date/Dropdown.d.ts +2 -0
- package/lib/inputs/date/helpers.d.ts +2 -0
- package/lib/inputs/date/index.d.ts +2 -0
- package/lib/inputs/date/index.js +2 -0
- package/lib/inputs/date/types.d.ts +3 -0
- package/lib/inputs/errorMessage/index.d.ts +17 -0
- package/lib/inputs/errorMessage/index.js +26 -0
- package/lib/inputs/file/DefaultFile.d.ts +2 -0
- package/lib/inputs/file/DefaultFile.js +4 -2
- package/lib/inputs/file/DragDropFile.d.ts +2 -0
- package/lib/inputs/file/DragDropFile.js +4 -2
- package/lib/inputs/file/File.d.ts +2 -0
- package/lib/inputs/file/FileButtonSettings.d.ts +2 -0
- package/lib/inputs/file/helpers.d.ts +2 -0
- package/lib/inputs/file/index.d.ts +2 -0
- package/lib/inputs/file/types.d.ts +2 -0
- package/lib/inputs/inputHOC.d.ts +3 -1
- package/lib/inputs/mask/BaseMask.d.ts +3 -0
- package/lib/inputs/mask/Cnpj.d.ts +3 -0
- package/lib/inputs/mask/Cpf.d.ts +3 -0
- package/lib/inputs/mask/Cpf.js +0 -1
- package/lib/inputs/mask/Phone.d.ts +3 -0
- package/lib/inputs/mask/ZipCode.d.ts +3 -0
- package/lib/inputs/mask/helpers.d.ts +2 -1
- package/lib/inputs/mask/imaskHOC.d.ts +3 -1
- package/lib/inputs/mask/index.d.ts +3 -0
- package/lib/inputs/mask/types.d.ts +5 -1
- package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -0
- package/lib/inputs/multiSelect/Dropdown.d.ts +2 -0
- package/lib/inputs/multiSelect/helper.d.ts +2 -0
- package/lib/inputs/multiSelect/index.d.ts +2 -0
- package/lib/inputs/multiSelect/index.js +2 -2
- package/lib/inputs/multiSelect/types.d.ts +2 -0
- package/lib/inputs/number/BaseNumber.d.ts +3 -1
- package/lib/inputs/number/Currency.d.ts +3 -1
- package/lib/inputs/number/Decimal.d.ts +3 -1
- package/lib/inputs/number/index.d.ts +3 -1
- package/lib/inputs/number/types.d.ts +3 -1
- package/lib/inputs/period/Dialog.d.ts +2 -0
- package/lib/inputs/period/Dropdown.d.ts +2 -0
- package/lib/inputs/period/PeriodList.d.ts +2 -0
- package/lib/inputs/period/helper.d.ts +2 -0
- package/lib/inputs/period/index.d.ts +2 -0
- package/lib/inputs/period/index.js +4 -1
- package/lib/inputs/period/types.d.ts +2 -0
- package/lib/inputs/search/index.d.ts +3 -1
- package/lib/inputs/select/ActionButtons.d.ts +3 -1
- package/lib/inputs/select/Dropdown.d.ts +3 -1
- package/lib/inputs/select/helper.d.ts +3 -1
- package/lib/inputs/select/index.d.ts +2 -0
- package/lib/inputs/select/multiple/Selecteds.d.ts +2 -0
- package/lib/inputs/select/multiple/index.d.ts +2 -0
- package/lib/inputs/select/multiple/index.js +9 -3
- package/lib/inputs/select/simple/index.d.ts +2 -0
- package/lib/inputs/select/simple/index.js +9 -3
- package/lib/inputs/select/types.d.ts +4 -2
- package/lib/inputs/textarea/index.d.ts +2 -0
- package/lib/inputs/textarea/types.d.ts +2 -0
- package/lib/inputs/types.d.ts +10 -3
- package/lib/internals/types.d.ts +5 -2
- package/lib/internals/withTooltip.d.ts +3 -2
- package/lib/internals/withTooltip.js +25 -10
- package/lib/list/Item.js +19 -6
- package/lib/menus/sidenav/index.js +3 -3
- package/lib/menus/sidenav/popup_menu_search/index.js +1 -1
- package/lib/table/RowColumn.js +6 -8
- package/lib/toolbar/types.d.ts +1 -0
- package/lib/tooltip/index.js +2 -2
- package/lib/treeview/Node.js +2 -2
- package/lib/uitour/index.d.ts +2 -1
- package/lib/uitour/index.js +57 -4
- package/lib/uitour/types.d.ts +9 -1
- package/package.json +5 -5
- package/.tool-versions +0 -1
package/.gitlab-ci.yml
CHANGED
package/.vscode/settings.json
CHANGED
|
@@ -4,9 +4,18 @@
|
|
|
4
4
|
"coverage": true,
|
|
5
5
|
"node_modules": true,
|
|
6
6
|
"scripts": true,
|
|
7
|
-
// "yarn.lock": true,
|
|
8
7
|
".eslintrc.js": true,
|
|
9
8
|
".gitignore": true,
|
|
9
|
+
"package-lock.json": true,
|
|
10
|
+
// ".gitlab-ci.yml": true,
|
|
11
|
+
".nvmrc": true,
|
|
12
|
+
".npmignore": true,
|
|
13
|
+
".editorconfig": true,
|
|
14
|
+
".stylelintrc": true,
|
|
15
|
+
"jest.config.js": true,
|
|
16
|
+
"tsup.config.ts": true,
|
|
17
|
+
"LICENSE": true,
|
|
18
|
+
"babel.config.json": true,
|
|
10
19
|
},
|
|
11
20
|
"editor.codeActionsOnSave": {
|
|
12
21
|
"source.fixAll.eslint": "explicit"
|
|
@@ -38,13 +38,14 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
|
|
|
38
38
|
@extend %component-splash-click;
|
|
39
39
|
content: "";
|
|
40
40
|
position: absolute;
|
|
41
|
-
top: 50
|
|
42
|
-
left: 50
|
|
41
|
+
top: 50% !important;
|
|
42
|
+
left: 50% !important;
|
|
43
43
|
display: block;
|
|
44
|
-
width: 0;
|
|
45
44
|
padding-top: 0;
|
|
46
45
|
border-radius: 100%;
|
|
47
46
|
background-color: rgba(236, 240, 241, 0.3);
|
|
47
|
+
width: 0;
|
|
48
|
+
height: 0 !important;
|
|
48
49
|
}
|
|
49
50
|
> .icon-component {
|
|
50
51
|
width: 15px;
|
|
@@ -69,7 +70,7 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
|
|
|
69
70
|
&:active:before {
|
|
70
71
|
@extend %component-effect-click;
|
|
71
72
|
}
|
|
72
|
-
&:hover {
|
|
73
|
+
&:hover, &[data-uitour="hover"] {
|
|
73
74
|
background-color: $default-hover-color;
|
|
74
75
|
}
|
|
75
76
|
&:focus {
|
|
@@ -102,6 +103,7 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
|
|
|
102
103
|
@extend %component-disabled;
|
|
103
104
|
opacity: 0.7;
|
|
104
105
|
border: solid 1px $font-color-disabled;
|
|
106
|
+
pointer-events: auto;
|
|
105
107
|
}
|
|
106
108
|
&.-shadowsdisabled {
|
|
107
109
|
box-shadow: none!important;
|
|
@@ -162,7 +164,7 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
|
|
|
162
164
|
border: 1px solid $primary-border-color;
|
|
163
165
|
text-shadow: $shadow-text-button;
|
|
164
166
|
@extend %color-effects;
|
|
165
|
-
&:hover {
|
|
167
|
+
&:hover, &[data-uitour="hover"] {
|
|
166
168
|
background-color: $primary-hover-color;
|
|
167
169
|
}
|
|
168
170
|
&:focus {
|
|
@@ -201,7 +203,7 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
|
|
|
201
203
|
border: 1px solid $warning-color;
|
|
202
204
|
text-shadow: $shadow-text-button;
|
|
203
205
|
@extend %color-effects;
|
|
204
|
-
&:hover {
|
|
206
|
+
&:hover, &[data-uitour="hover"] {
|
|
205
207
|
background-color: $warning-hover-color;
|
|
206
208
|
}
|
|
207
209
|
&:focus {
|
|
@@ -220,7 +222,7 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
|
|
|
220
222
|
text-shadow: $shadow-text-button;
|
|
221
223
|
@extend %color-effects;
|
|
222
224
|
color: $font-color-second;
|
|
223
|
-
&:hover {
|
|
225
|
+
&:hover, &[data-uitour="hover"] {
|
|
224
226
|
background-color: $danger-hover-color;
|
|
225
227
|
}
|
|
226
228
|
&:focus {
|
|
@@ -239,7 +241,7 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
|
|
|
239
241
|
text-shadow: $shadow-text-button;
|
|
240
242
|
@extend %color-effects;
|
|
241
243
|
color: $font-color-second;
|
|
242
|
-
&:hover {
|
|
244
|
+
&:hover, &[data-uitour="hover"] {
|
|
243
245
|
background-color: $success-hover-color;
|
|
244
246
|
color: $font-color-second;
|
|
245
247
|
}
|
|
@@ -259,7 +261,7 @@ $shadow-button-inset-default: inset 0 0 0 1px $default-border-color, $shadow-but
|
|
|
259
261
|
text-shadow: $shadow-text-button;
|
|
260
262
|
@extend %color-effects;
|
|
261
263
|
color: $font-color-second;
|
|
262
|
-
&:hover {
|
|
264
|
+
&:hover, &[data-uitour="hover"] {
|
|
263
265
|
background-color: $info-hover-color;
|
|
264
266
|
color: $font-color-second;
|
|
265
267
|
}
|
|
@@ -4,81 +4,80 @@
|
|
|
4
4
|
|
|
5
5
|
.checkbox-component {
|
|
6
6
|
> .inputcontent {
|
|
7
|
+
display: flex;
|
|
7
8
|
> .input {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
pointer-events: none;
|
|
10
|
+
opacity: 0;
|
|
11
|
+
width: 0;
|
|
12
|
+
height: 0;
|
|
11
13
|
&:disabled + span {
|
|
12
14
|
@extend %component-disabled;
|
|
15
|
+
border: 1px solid $component-border-color;
|
|
16
|
+
}
|
|
17
|
+
&:checked:disabled + span {
|
|
18
|
+
border: 1px solid $component-border-color;
|
|
19
|
+
> svg {
|
|
20
|
+
@extend %component-menu-disabled
|
|
21
|
+
}
|
|
13
22
|
}
|
|
14
23
|
&:disabled + span + .description {
|
|
15
24
|
@extend %component-menu-disabled;
|
|
16
25
|
}
|
|
17
|
-
&:checked + span
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
justify-content: center;
|
|
22
|
-
position: static;
|
|
23
|
-
margin-top: -5px;
|
|
24
|
-
font-weight: 600;
|
|
25
|
-
height: 28px;
|
|
26
|
+
&:checked + span > svg {
|
|
27
|
+
display: block;
|
|
28
|
+
fill: $font-color-second;
|
|
29
|
+
margin: 0;
|
|
26
30
|
}
|
|
27
31
|
+ span {
|
|
28
|
-
display: inline-block;
|
|
29
32
|
position: relative;
|
|
30
|
-
|
|
33
|
+
min-width: 18px;
|
|
34
|
+
min-height: 18px;
|
|
31
35
|
width: 18px;
|
|
32
36
|
height: 18px;
|
|
33
|
-
margin: -1px 0px 0 0;
|
|
34
|
-
margin-right: 4px;
|
|
35
37
|
vertical-align: middle;
|
|
36
38
|
background: $font-color-second left top no-repeat;
|
|
37
39
|
border: 1px solid $component-border-color;
|
|
38
40
|
cursor: pointer;
|
|
41
|
+
display: flex;
|
|
42
|
+
margin-right: 6px;
|
|
43
|
+
align-items: center;
|
|
44
|
+
justify-content: center;
|
|
39
45
|
&:hover {
|
|
40
46
|
animation-duration: .5s;
|
|
41
47
|
animation-name: blink-effect;
|
|
42
48
|
animation-iteration-count: infinite;
|
|
43
49
|
animation-direction: alternate;
|
|
44
50
|
}
|
|
51
|
+
& > svg {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
45
54
|
}
|
|
46
55
|
&:checked + span {
|
|
47
|
-
background-color: $
|
|
56
|
+
background-color: $checked-effect;
|
|
57
|
+
border-color: $checked;
|
|
48
58
|
color: $font-color-second;
|
|
49
59
|
animation-duration: .2s;
|
|
50
60
|
animation-name: select-checkbox;
|
|
51
61
|
animation-iteration-count: 1;
|
|
52
62
|
animation-direction: Normal;
|
|
53
|
-
box-shadow: inset 0 0 0 1px $checked,
|
|
54
|
-
inset 0 0 0 0 #FFFFFF,
|
|
55
|
-
inset 0 0 0 16px $checked-effect;
|
|
56
63
|
}
|
|
57
64
|
&:focus + span {
|
|
58
65
|
border: 2px solid $component-selected-color;
|
|
59
66
|
}
|
|
60
|
-
&:disabled:checked + span:before {
|
|
61
|
-
@extend %component-menu-disabled;
|
|
62
|
-
border: 1px solid;
|
|
63
|
-
margin-top: -1px;
|
|
64
|
-
width: 18px;
|
|
65
|
-
height: 18px;
|
|
66
|
-
background-color: rgb(229, 229, 229);
|
|
67
|
-
margin-left: -1px;
|
|
68
|
-
}
|
|
69
67
|
}
|
|
70
68
|
> .description {
|
|
71
69
|
@extend %input-label;
|
|
72
|
-
margin-left: 2px;
|
|
73
70
|
cursor: pointer ;
|
|
71
|
+
flex: 1;
|
|
72
|
+
line-height: 18px;
|
|
73
|
+
|
|
74
|
+
> .hint {
|
|
75
|
+
@extend %hint-text;
|
|
76
|
+
margin-top: 0;
|
|
77
|
+
}
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
> .hint {
|
|
78
|
-
@extend %hint-text;
|
|
79
|
-
margin-top: 0;
|
|
80
|
-
padding-left: 22px;
|
|
81
|
-
}
|
|
82
81
|
|
|
83
82
|
> .errormessages {
|
|
84
83
|
width: 100%;
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
margin-top: 0px;
|
|
89
88
|
}
|
|
90
89
|
|
|
91
|
-
|
|
90
|
+
&[data-skeletonized="true"] {
|
|
92
91
|
> .inputcontent {
|
|
93
92
|
.input {
|
|
94
93
|
+ span {
|
|
@@ -101,8 +100,8 @@
|
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
|
-
> .inputcontent > .description,
|
|
105
|
-
> .hint > span {
|
|
103
|
+
> .inputcontent > .description > span,
|
|
104
|
+
> .inputcontent > .description > .hint > span {
|
|
106
105
|
@extend %skeleton-component;
|
|
107
106
|
}
|
|
108
107
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@import "commons.scss";
|
|
2
|
+
@import "colors.scss";
|
|
2
3
|
|
|
3
4
|
.hint-component {
|
|
4
5
|
@extend %hint-text;
|
|
@@ -6,4 +7,24 @@
|
|
|
6
7
|
&.-skeletonized > span {
|
|
7
8
|
@extend %skeleton-component;
|
|
8
9
|
}
|
|
10
|
+
|
|
11
|
+
&.-disabled > span {
|
|
12
|
+
opacity: 0.4;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&.-primary {
|
|
16
|
+
color: $primary-color;
|
|
17
|
+
}
|
|
18
|
+
&.-warning {
|
|
19
|
+
color: $warning-color;
|
|
20
|
+
}
|
|
21
|
+
&.-danger {
|
|
22
|
+
color: $danger-color;
|
|
23
|
+
}
|
|
24
|
+
&.-success {
|
|
25
|
+
color: $success-color;
|
|
26
|
+
}
|
|
27
|
+
&.-info {
|
|
28
|
+
color: $info-color;
|
|
29
|
+
}
|
|
9
30
|
}
|
|
@@ -5,8 +5,15 @@
|
|
|
5
5
|
.input-base-component > .labelcontainer {
|
|
6
6
|
margin: 0;
|
|
7
7
|
padding: 0;
|
|
8
|
+
line-height: 14px;
|
|
9
|
+
margin-bottom: 6px;
|
|
8
10
|
> .label {
|
|
9
11
|
@extend %input-label;
|
|
12
|
+
width: 100%;
|
|
13
|
+
display: block;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
text-overflow: ellipsis;
|
|
16
|
+
white-space: nowrap;
|
|
10
17
|
}
|
|
11
18
|
}
|
|
12
19
|
|
|
@@ -18,13 +25,6 @@
|
|
|
18
25
|
width: 100%;
|
|
19
26
|
height: 100%;
|
|
20
27
|
}
|
|
21
|
-
> .errormessages {
|
|
22
|
-
width: 100%;
|
|
23
|
-
color: red;
|
|
24
|
-
font-size: 13px!important;
|
|
25
|
-
line-height: 13px;
|
|
26
|
-
margin-top: 3px;
|
|
27
|
-
}
|
|
28
28
|
& .icon-component {
|
|
29
29
|
height: 100%;
|
|
30
30
|
display: grid;
|
|
@@ -7,11 +7,11 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
9
|
var _icons = _interopRequireDefault(require("../../lib/icons"));
|
|
10
|
-
var _withTooltip =
|
|
10
|
+
var _withTooltip = _interopRequireWildcard(require("../internals/withTooltip"));
|
|
11
11
|
var _spinner = _interopRequireDefault(require("../spinner"));
|
|
12
12
|
var _withDropdown = _interopRequireDefault(require("../dropdown/withDropdown"));
|
|
13
13
|
var _permissionValidations = require("../permissionValidations");
|
|
14
|
-
const _excluded = ["dropdown", "onClick", "disabled", "iconName", "icon", "targetRef", "tabIndex", "isLoading", "label", "showDropdown", "getDropdownPopup", "isDropdownOpened", "showIconDropdown", "content", "style", "toggleable", "activeIconColor", "iconStyle", "visible", "customClass", "className", "size", "iconAlign", "boxShadow", "transparent", "round", "permissionAttr", "skeletonize", "
|
|
14
|
+
const _excluded = ["dropdown", "onClick", "disabled", "iconName", "icon", "targetRef", "tabIndex", "isLoading", "label", "showDropdown", "getDropdownPopup", "isDropdownOpened", "showIconDropdown", "content", "style", "toggleable", "activeIconColor", "iconStyle", "visible", "customClass", "className", "size", "iconAlign", "boxShadow", "transparent", "round", "permissionAttr", "skeletonize", "errorMessage", "tooltipWidth", "isFloatMenu", "dropdownAlign", "customClassForDropdown", "buttonRef", "onDeniedText"];
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
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); }
|
|
17
17
|
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; }
|
|
@@ -53,13 +53,13 @@ const DefaultButton = _ref => {
|
|
|
53
53
|
round,
|
|
54
54
|
permissionAttr,
|
|
55
55
|
skeletonize,
|
|
56
|
-
tooltipPosition,
|
|
57
56
|
errorMessage,
|
|
58
57
|
tooltipWidth,
|
|
59
58
|
isFloatMenu,
|
|
60
59
|
dropdownAlign,
|
|
61
60
|
customClassForDropdown,
|
|
62
|
-
buttonRef
|
|
61
|
+
buttonRef,
|
|
62
|
+
onDeniedText = 'Permissão Negada! Consulte o Administrador do sistema.'
|
|
63
63
|
} = _ref,
|
|
64
64
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
65
65
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
@@ -67,18 +67,23 @@ const DefaultButton = _ref => {
|
|
|
67
67
|
const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
|
|
68
68
|
const refButton = (0, _react.useRef)(null);
|
|
69
69
|
const disabledIconColor = 'rgb(193, 193, 193)';
|
|
70
|
-
const
|
|
71
|
-
const
|
|
70
|
+
const disabledByPermission = onDenied.disabled;
|
|
71
|
+
const isDisabled = !!onDenied.disabled || disabled;
|
|
72
|
+
const {
|
|
73
|
+
handlerSetOnDeniedText
|
|
74
|
+
} = (0, _react.useContext)(_withTooltip.TooltipContext);
|
|
75
|
+
const getClass = () => "button-component ".concat(className, "\n ").concat(customClass, "\n ").concat(transparent && '-transparent', "\n ").concat(isDisabled && '-disabled', "\n ").concat(size && "-".concat(size), "\n ").concat(dropdown && !round && 'icon-right', "\n ").concat(dropdown && round && 'icon-center', "\n ").concat(iconAlign && !dropdown && "icon-".concat(iconAlign), "\n ").concat(boxShadow ? '' : '-shadowsdisabled', "\n ").concat(round && '-round');
|
|
72
76
|
const getIcon = () => {
|
|
73
77
|
let resultantStyle = iconStyle;
|
|
74
|
-
if (
|
|
78
|
+
if (isDisabled) {
|
|
75
79
|
resultantStyle = _objectSpread(_objectSpread({}, resultantStyle), {}, {
|
|
76
80
|
fill: disabledIconColor
|
|
77
81
|
});
|
|
78
82
|
}
|
|
79
83
|
if (dropdown && showIconDropdown) {
|
|
84
|
+
const openDropDownRule = isDropdownOpened ? 'mini_up' : 'mini_down';
|
|
80
85
|
return /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
81
|
-
name:
|
|
86
|
+
name: openDropDownRule,
|
|
82
87
|
size: 16,
|
|
83
88
|
customClass: "dropdown-icon",
|
|
84
89
|
pointerEvents: "none",
|
|
@@ -86,7 +91,7 @@ const DefaultButton = _ref => {
|
|
|
86
91
|
});
|
|
87
92
|
}
|
|
88
93
|
if (icon) {
|
|
89
|
-
if (
|
|
94
|
+
if (disabled) {
|
|
90
95
|
return /*#__PURE__*/_react.default.createElement(_icons.default, _extends({}, icon.props, {
|
|
91
96
|
color: disabledIconColor
|
|
92
97
|
}));
|
|
@@ -94,25 +99,37 @@ const DefaultButton = _ref => {
|
|
|
94
99
|
return icon;
|
|
95
100
|
} else if (iconName) {
|
|
96
101
|
return /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
97
|
-
name: iconName,
|
|
102
|
+
name: !disabledByPermission ? iconName : 'padlock',
|
|
98
103
|
size: 16,
|
|
99
104
|
color: toggleable && activeIconColor && activeButton && activeIconColor || '#676464',
|
|
100
105
|
pointerEvents: "none",
|
|
101
106
|
style: resultantStyle
|
|
102
107
|
});
|
|
103
108
|
}
|
|
109
|
+
if (!icon && disabledByPermission) {
|
|
110
|
+
return /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
111
|
+
name: "padlock",
|
|
112
|
+
size: 16,
|
|
113
|
+
pointerEvents: "none",
|
|
114
|
+
color: disabledIconColor,
|
|
115
|
+
style: resultantStyle
|
|
116
|
+
});
|
|
117
|
+
}
|
|
104
118
|
return null;
|
|
105
119
|
};
|
|
120
|
+
(0, _react.useEffect)(() => {
|
|
121
|
+
if (disabledByPermission) handlerSetOnDeniedText(onDeniedText);
|
|
122
|
+
}, [disabledByPermission]);
|
|
106
123
|
if (!visible || onDenied.unvisible) return null;
|
|
107
124
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("button", _extends({}, rest, {
|
|
108
125
|
style: style,
|
|
109
126
|
onClick: e => {
|
|
110
|
-
if (
|
|
127
|
+
if (isDisabled) return;
|
|
111
128
|
if (onClick) onClick(e);
|
|
112
129
|
if (dropdown && showDropdown) showDropdown();
|
|
113
130
|
if (onClick && toggleable) setActiveButton(!activeButton);
|
|
114
131
|
},
|
|
115
|
-
disabled:
|
|
132
|
+
disabled: isDisabled,
|
|
116
133
|
className: "".concat(getClass(), " ").concat(activeButton ? '-toggleable' : '', " ").concat(skeletonize ? '-skeletonized' : ''),
|
|
117
134
|
ref: r => {
|
|
118
135
|
if (buttonRef) {
|
package/lib/buttons/types.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
43
43
|
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
44
44
|
closeDropdownOnClickOutside?: boolean;
|
|
45
45
|
errorMessage?: string;
|
|
46
|
+
onDeniedText?: string;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
export type { IButtonProps };
|
package/lib/checkbox/Label.js
CHANGED
|
@@ -6,17 +6,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _withTooltip = _interopRequireDefault(require("../internals/withTooltip"));
|
|
9
|
+
var _hint = _interopRequireDefault(require("../hint"));
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
11
|
const Label = _ref => {
|
|
11
12
|
let {
|
|
12
13
|
label,
|
|
13
|
-
targetSpanRef
|
|
14
|
+
targetSpanRef,
|
|
15
|
+
disabled,
|
|
16
|
+
hint
|
|
14
17
|
} = _ref;
|
|
15
|
-
return /*#__PURE__*/_react.default.createElement("
|
|
16
|
-
className: "description"
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
|
+
className: "description"
|
|
20
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
17
21
|
ref: r => {
|
|
18
22
|
if (targetSpanRef) targetSpanRef(r);
|
|
19
23
|
}
|
|
20
|
-
}, label)
|
|
24
|
+
}, label), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
25
|
+
disabled: disabled,
|
|
26
|
+
visible: !!hint,
|
|
27
|
+
description: hint,
|
|
28
|
+
customClass: "hint"
|
|
29
|
+
}));
|
|
21
30
|
};
|
|
22
31
|
var _default = exports.default = (0, _withTooltip.default)(Label);
|
package/lib/checkbox/index.js
CHANGED
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _Label = _interopRequireDefault(require("./Label"));
|
|
9
|
-
var _hint = _interopRequireDefault(require("../hint"));
|
|
10
9
|
var _gridlayout = _interopRequireDefault(require("../gridlayout"));
|
|
11
|
-
var helpers = _interopRequireWildcard(require("../inputs/base/helpers"));
|
|
12
10
|
var _permissionValidations = require("../permissionValidations");
|
|
13
11
|
require("../assets/styles/checkbox.scss");
|
|
12
|
+
var _errorMessage = require("../inputs/errorMessage");
|
|
13
|
+
var _ = require("..");
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
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); }
|
|
16
16
|
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; }
|
|
@@ -70,7 +70,8 @@ const CheckBox = _ref => {
|
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
const renderInput = () => /*#__PURE__*/_react.default.createElement("div", _extends({}, getProps(), {
|
|
73
|
-
className: "checkbox-component
|
|
73
|
+
className: "checkbox-component",
|
|
74
|
+
"data-skeletonized": skeletonize
|
|
74
75
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
75
76
|
"data-testid": "checkbox-container",
|
|
76
77
|
className: "inputcontent",
|
|
@@ -80,6 +81,7 @@ const CheckBox = _ref => {
|
|
|
80
81
|
"aria-checked": "false",
|
|
81
82
|
onKeyPress: undefined
|
|
82
83
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
84
|
+
id: id || undefined,
|
|
83
85
|
ref: r => {
|
|
84
86
|
if (targetRef) targetRef(r);
|
|
85
87
|
inputRef.current = r;
|
|
@@ -92,18 +94,20 @@ const CheckBox = _ref => {
|
|
|
92
94
|
name: name,
|
|
93
95
|
required: required,
|
|
94
96
|
value: value,
|
|
95
|
-
id: id,
|
|
96
97
|
onChange: () => {}
|
|
97
|
-
}), /*#__PURE__*/_react.default.createElement("span", null
|
|
98
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_.Icon, {
|
|
99
|
+
size: 12,
|
|
100
|
+
name: "checkmark"
|
|
101
|
+
})), label && /*#__PURE__*/_react.default.createElement(_Label.default, {
|
|
98
102
|
label: label,
|
|
99
103
|
tooltip: tooltip,
|
|
100
104
|
tooltipWidth: tooltipWidth,
|
|
101
|
-
tooltipPosition: tooltipPosition
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
})
|
|
105
|
+
tooltipPosition: tooltipPosition,
|
|
106
|
+
disabled: disabled,
|
|
107
|
+
hint: hint
|
|
108
|
+
})), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
|
|
109
|
+
messages: errorMessages
|
|
110
|
+
}));
|
|
107
111
|
if (onDenied.unvisible) return null;
|
|
108
112
|
return gridLayout ? /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
|
|
109
113
|
customClass: "-withinput",
|
package/lib/dialog/Custom.js
CHANGED
|
@@ -5,11 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
-
var
|
|
8
|
+
var uuid = _interopRequireWildcard(require("uuid"));
|
|
9
9
|
var _base = _interopRequireDefault(require("./base"));
|
|
10
10
|
var _Footer = _interopRequireDefault(require("./base/Footer"));
|
|
11
11
|
var _icons = _interopRequireDefault(require("../icons"));
|
|
12
12
|
var _buttons = require("../buttons");
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
13
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
16
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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
|
const getIcon = (iconName, icon) => {
|
|
@@ -46,7 +48,7 @@ const Custom = props => {
|
|
|
46
48
|
}, props.text)), props.buttons && props.buttons.length > 0 && /*#__PURE__*/_react.default.createElement(_Footer.default, props, /*#__PURE__*/_react.default.createElement(_buttons.ButtonContainer, {
|
|
47
49
|
position: "right"
|
|
48
50
|
}, props.buttons.map(button => /*#__PURE__*/_react.default.cloneElement(button, {
|
|
49
|
-
key: "button-".concat(
|
|
51
|
+
key: "button-".concat(uuid.v1())
|
|
50
52
|
})))));
|
|
51
53
|
};
|
|
52
54
|
var _default = exports.default = Custom;
|
package/lib/dialog/base/index.js
CHANGED
|
@@ -42,8 +42,9 @@ const BaseDialog = props => {
|
|
|
42
42
|
onOpenChange(false);
|
|
43
43
|
} else {
|
|
44
44
|
if (handlerClose) handlerClose();
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
if (onOpenChange) {
|
|
46
|
+
onOpenChange(false);
|
|
47
|
+
}
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
const handleClickOutside = event => {
|
package/lib/dialog/form/index.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = exports.FormDialogContext = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var
|
|
8
|
+
var uuid = _interopRequireWildcard(require("uuid"));
|
|
9
9
|
var _base = _interopRequireDefault(require("../base"));
|
|
10
10
|
var _Header = _interopRequireDefault(require("../base/Header"));
|
|
11
11
|
var _index = require("../../buttons/index");
|
|
@@ -71,12 +71,12 @@ const ModalForm = props => {
|
|
|
71
71
|
}), props.buttons.map(button => {
|
|
72
72
|
if (context && context.securityBeforeUnload && button && button.type && button.type.name === 'CancelButton') {
|
|
73
73
|
return /*#__PURE__*/_react.default.cloneElement(button, {
|
|
74
|
-
key: "button-".concat(
|
|
74
|
+
key: "button-".concat(uuid.v1()),
|
|
75
75
|
onClick: props.handlerClose
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
78
|
return /*#__PURE__*/_react.default.cloneElement(button, {
|
|
79
|
-
key: "button-".concat(
|
|
79
|
+
key: "button-".concat(uuid.v1())
|
|
80
80
|
});
|
|
81
81
|
})))));
|
|
82
82
|
};
|
package/lib/drawer/Drawer.js
CHANGED
|
@@ -82,7 +82,7 @@ const BaseDrawer = _ref => {
|
|
|
82
82
|
body.appendChild(drawerOverlay);
|
|
83
83
|
};
|
|
84
84
|
const closeDrawerOnEsc = e => {
|
|
85
|
-
if (closeOnEsc && e.key === '
|
|
85
|
+
if (closeOnEsc && e.key === 'Escape') {
|
|
86
86
|
handlerClose === null || handlerClose === void 0 ? void 0 : handlerClose();
|
|
87
87
|
e.stopPropagation();
|
|
88
88
|
}
|