linear-react-components-ui 1.1.18-beta.17 → 1.1.18-beta.18

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.
Files changed (82) hide show
  1. package/.eslintcache +1 -1
  2. package/lib/assets/styles/calendar.scss +64 -30
  3. package/lib/assets/styles/datepicker.scss +26 -6
  4. package/lib/assets/styles/input.scss +2 -2
  5. package/lib/assets/styles/periodpicker.scss +60 -20
  6. package/lib/assets/styles/popover.scss +0 -3
  7. package/lib/assets/styles/sidenav.scss +1 -1
  8. package/lib/assets/styles/tabs.scss +32 -15
  9. package/lib/calendar/DangerCalendar.d.ts +1 -0
  10. package/lib/calendar/InfoCalendar.d.ts +1 -0
  11. package/lib/calendar/PrimaryCalendar.d.ts +1 -0
  12. package/lib/calendar/SuccessCalendar.d.ts +1 -0
  13. package/lib/calendar/WarningCalendar.d.ts +1 -0
  14. package/lib/calendar/base/Day.d.ts +1 -0
  15. package/lib/calendar/base/Day.js +6 -2
  16. package/lib/calendar/base/Month.d.ts +2 -1
  17. package/lib/calendar/base/Month.js +2 -0
  18. package/lib/calendar/base/Week.d.ts +1 -0
  19. package/lib/calendar/base/index.d.ts +1 -0
  20. package/lib/calendar/base/index.js +63 -13
  21. package/lib/calendar/index.d.ts +1 -0
  22. package/lib/calendar/types.d.ts +5 -0
  23. package/lib/checkbox/Label.d.ts +11 -0
  24. package/lib/checkbox/index.js +18 -45
  25. package/lib/checkbox/types.d.ts +0 -4
  26. package/lib/dialog/base/Content.js +5 -4
  27. package/lib/dialog/base/Header.js +0 -1
  28. package/lib/dialog/base/index.js +27 -3
  29. package/lib/drawer/Drawer.js +1 -1
  30. package/lib/form/types.d.ts +0 -14
  31. package/lib/inputs/base/InputTextBase.js +8 -34
  32. package/lib/inputs/base/types.d.ts +0 -3
  33. package/lib/inputs/color/types.d.ts +0 -5
  34. package/lib/inputs/date/Dialog.js +5 -4
  35. package/lib/inputs/date/Dropdown.js +15 -7
  36. package/lib/inputs/date/helpers.d.ts +1 -11
  37. package/lib/inputs/date/helpers.js +1 -11
  38. package/lib/inputs/date/index.js +138 -100
  39. package/lib/inputs/date/types.d.ts +7 -10
  40. package/lib/inputs/file/DragDropFile.js +1 -2
  41. package/lib/inputs/file/types.d.ts +0 -3
  42. package/lib/inputs/mask/helpers.d.ts +0 -4
  43. package/lib/inputs/mask/types.d.ts +0 -4
  44. package/lib/inputs/multiSelect/types.d.ts +0 -4
  45. package/lib/inputs/number/BaseNumber.d.ts +1 -1
  46. package/lib/inputs/number/Currency.d.ts +1 -1
  47. package/lib/inputs/number/Decimal.d.ts +1 -1
  48. package/lib/inputs/number/index.d.ts +1 -1
  49. package/lib/inputs/number/index.js +3 -7
  50. package/lib/inputs/number/types.d.ts +2 -14
  51. package/lib/inputs/period/Dialog.d.ts +1 -1
  52. package/lib/inputs/period/Dialog.js +5 -3
  53. package/lib/inputs/period/Dropdown.js +19 -8
  54. package/lib/inputs/period/PeriodList.js +3 -12
  55. package/lib/inputs/period/index.js +241 -112
  56. package/lib/inputs/period/types.d.ts +10 -11
  57. package/lib/inputs/select/ActionButtons.js +3 -2
  58. package/lib/inputs/select/multiple/index.js +10 -11
  59. package/lib/inputs/select/simple/index.js +10 -4
  60. package/lib/inputs/select/types.d.ts +4 -6
  61. package/lib/inputs/types.d.ts +1 -0
  62. package/lib/list/index.js +2 -2
  63. package/lib/popover/index.js +5 -3
  64. package/lib/popover/types.d.ts +1 -2
  65. package/lib/radio/index.d.ts +1 -1
  66. package/lib/radio/index.js +1 -32
  67. package/lib/radio/types.d.ts +0 -6
  68. package/lib/tabs/DropdownTabs.js +21 -7
  69. package/lib/tabs/context.d.ts +1 -1
  70. package/lib/tabs/context.js +3 -3
  71. package/lib/tabs/types.d.ts +2 -1
  72. package/lib/textContent/index.d.ts +4 -18
  73. package/lib/textContent/index.js +4 -14
  74. package/lib/toolbar/types.d.ts +2 -1
  75. package/package.json +1 -1
  76. package/lib/inputs/mask/imaskHOC.js +0 -203
  77. package/lib/menus/sidenav/popup_menu_help/index.js +0 -85
  78. package/lib/tabs/DropdownItems.js +0 -62
  79. package/lib/tabs/MenuItems.js +0 -70
  80. package/lib/treeview_old/Header.js +0 -29
  81. package/lib/treeview_old/Node.js +0 -68
  82. package/lib/treeview_old/index.js +0 -43
@@ -3,28 +3,58 @@
3
3
  @import "commons.scss";
4
4
 
5
5
  $padding-size: 10px;
6
+ $border-radius-size: 5px;
6
7
  .calendar-component {
7
- display: grid;
8
- grid-template-rows: 30px 30px 1fr;
9
- border: 1px solid $component-border-color;
10
- border-radius: 5px;
11
- font-size: 12px;
8
+ width: auto;
12
9
  height: 100%;
13
- width: 100%;
10
+ min-height: 20rem;
11
+ font-size: 12px;
12
+ display: flex;
13
+ flex-direction: column;
14
+ border-radius: $border-radius-size;
15
+ border: 1px solid $component-border-color;
14
16
  > .calendarheader,
15
17
  > .daynames {
16
- background-color: #f0f0f0;
18
+ width: auto;
19
+ height: 1.85rem;
17
20
  display: grid;
21
+ align-items: center;
22
+ background-color: #f0f0f0;
18
23
  grid-template-columns: 20px 1fr 30px;
19
- padding: $padding-size;
20
- padding-top: 4px;
21
24
  }
22
25
  > .calendarheader {
26
+ width: auto;
27
+ height: 32px;
28
+ padding-top: 4px;
29
+ display: flex;
30
+ align-items: center;
31
+ justify-content: space-between;
32
+ border-top-left-radius: $border-radius-size;
33
+ border-top-right-radius: $border-radius-size;
23
34
  > .navbutton {
35
+ width: 2rem;
36
+ height: 2rem;
37
+ padding: 0;
38
+ margin: 0px 2px;
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
24
42
  background-color: transparent;
25
43
  font-weight: bold;
26
- padding: 0;
27
44
  border: none;
45
+ svg {
46
+ margin: 0;
47
+ }
48
+ &:hover {
49
+ background-color: $component-border-color;
50
+ }
51
+ &:focus {
52
+ -webkit-box-shadow: none !important;
53
+ box-shadow: none !important;
54
+ border: 1px solid $default-border-color;
55
+ background-color: $component-border-color;
56
+ }
57
+ transition: none;
28
58
  }
29
59
  > .monthname {
30
60
  font-weight: bold;
@@ -35,16 +65,21 @@ $padding-size: 10px;
35
65
  }
36
66
  }
37
67
  > .daynames {
68
+ padding-top: 4px;
38
69
  border-bottom: 1px solid $component-border-color;
39
70
  grid-template-columns: repeat(7, 1fr);
40
71
  text-align: center;
41
- padding-top: 9px;
42
72
  }
43
73
  > .calendarmonth {
44
- background-color: $font-color-second;
74
+ width: 100%;
75
+ height: 100%;
76
+ flex: 1;
45
77
  display: grid;
46
78
  grid-template-rows: repeat(6, 1fr);
47
- padding: $padding-size;
79
+ padding: 2px;
80
+ background-color: $font-color-second;
81
+ border-bottom-left-radius: $border-radius-size;
82
+ border-bottom-right-radius: $border-radius-size;
48
83
  }
49
84
  > .calendarmonth > .monthweek {
50
85
  text-align: center;
@@ -52,16 +87,31 @@ $padding-size: 10px;
52
87
  grid-template-columns: repeat(7, 1fr)
53
88
  }
54
89
  .calendarmonth > .monthweek > .monthday {
55
- padding: 12px 0;
90
+ height: auto;
91
+ width: auto;
56
92
  text-align: center;
57
93
  border-right: 0;
58
94
  border-bottom: 0;
59
95
  transition: all 0.2s ease-in-out;
60
96
  > .daybutton {
97
+ height: 100%;
98
+ width: 100%;
99
+ padding: 0;
100
+ font-size: 13px;
101
+ border: none;
102
+ background-color: transparent;
103
+ &.-nowday {
104
+ font-weight: bold
105
+ }
106
+ &.-outmonth {
107
+ color: #777;
108
+ }
61
109
  &:focus {
62
110
  -webkit-box-shadow: none !important;
63
111
  box-shadow: none !important;
112
+ border: 2px solid $default-border-color;
64
113
  }
114
+ transition: none;
65
115
  }
66
116
  &:hover {
67
117
  background-color: $component-border-color;
@@ -74,19 +124,6 @@ $padding-size: 10px;
74
124
  &.-selectedday > .daybutton {
75
125
  color: $font-color-second;
76
126
  }
77
- > .daybutton {
78
- background-color: transparent;
79
- height: 100%;
80
- padding: 0;
81
- width: 100%;
82
- font-size: 13px;
83
- &.-nowday {
84
- font-weight: bold
85
- }
86
- &.-outmonth {
87
- color: #777;
88
- }
89
- }
90
127
  }
91
128
  }
92
129
 
@@ -167,6 +204,3 @@ $padding-size: 10px;
167
204
  }
168
205
  }
169
206
 
170
- .numberdaycalendar {
171
- border: none!important;
172
- }
@@ -1,16 +1,36 @@
1
1
  @import "commons.scss";
2
2
  @import "effects.scss";
3
3
 
4
+ .datepicker-container {
5
+ position: relative;
6
+ transition: none;
7
+ }
8
+
4
9
  .datepicker-component {
5
10
  @extend %component-box-shadow;
6
- height: auto;
7
- position: absolute;
8
- z-index: 999999999999999;
11
+ z-index: 999999999999;
12
+ margin-top: 4px;
13
+ position: fixed;
9
14
  animation: 0.5s ease-in 0s 1 slideDown;
15
+ transition: none;
10
16
  }
11
17
 
12
18
  .calendar-button {
13
19
  width: 26px;
14
- padding: 4px;
15
- border: none;
16
- }
20
+ border-radius: 0;
21
+ border: 0 !important;
22
+ display: flex;
23
+ align-items: center;
24
+ box-shadow: none !important;
25
+ justify-content: center;
26
+ padding: 0 !important;
27
+
28
+ svg {
29
+ margin: 0 !important;
30
+ }
31
+
32
+ >.icon-component {
33
+ width: 16px !important;
34
+ height: 16px !important;
35
+ }
36
+ }
@@ -2,7 +2,7 @@
2
2
  @import "fonts.scss";
3
3
  @import "colors.scss";
4
4
  @import "effects";
5
- .input-base-component > .labelcontainer > .text-content {
5
+ .input-base-component > .labelcontainer {
6
6
  margin: 0;
7
7
  padding: 0;
8
8
  line-height: 14px;
@@ -115,7 +115,7 @@
115
115
  }
116
116
 
117
117
  .input-base-component.-skeletonized {
118
- > .labelcontainer > .text-content > .label,
118
+ > .labelcontainer > .label,
119
119
  > .hint {
120
120
  @extend %skeleton-component;
121
121
  color: transparent;
@@ -1,12 +1,18 @@
1
1
  @import "commons.scss";
2
2
  @import "effects.scss";
3
+ @import "colors.scss";
4
+
5
+ .datepicker-period-container {
6
+ position: relative;
7
+ transition: none;
8
+ }
3
9
 
4
10
  .periodpicker-component {
5
11
  height: auto;
6
12
  position: relative;
7
13
  display: flex;
8
14
  border-radius: 2px;
9
- border: 1px solid #dae1e8;
15
+ border: 1px solid $component-border-color;
10
16
 
11
17
  .inputwrapper {
12
18
  border: none;
@@ -18,31 +24,79 @@
18
24
  }
19
25
 
20
26
  .calendar-button {
21
- flex: 0 0 20px;
22
- padding: 4px;
23
- border: none;
27
+ width: 26px;
28
+ border-radius: 0;
29
+ border: 0 !important;
30
+ display: flex;
31
+ align-items: center;
32
+ box-shadow: none !important;
33
+ justify-content: center;
34
+ padding: 0 !important;
35
+
36
+ svg {
37
+ margin: 0 !important;
38
+ }
39
+
40
+ >.icon-component {
41
+ width: 16px !important;
42
+ height: 16px !important;
43
+ }
24
44
  }
25
45
 
26
46
  .input-base-component {
27
47
  flex: 1;
28
48
  }
49
+ }
29
50
 
51
+ .datepicker-component {
52
+ @extend %component-box-shadow;
53
+ border-radius: 5px;
54
+ margin-top: 4px !important;
55
+ position: fixed;
56
+ animation: 0.5s ease-in 0s 1 slideDown;
57
+ transition: none;
58
+ }
59
+
60
+ .dropdown-period {
61
+ width: 100%;
62
+ border-radius: 3px;
63
+ background-color: $component-bg-default;
64
+ border: 1px solid $component-border-color;
65
+ display: grid;
66
+ grid-template-rows: auto;
67
+ height: auto;
68
+ overflow-y: auto;
69
+ overflow-x: hidden;
30
70
  }
31
71
 
32
72
  .dropdown-period>.item {
73
+ all: unset;
33
74
  margin: 0;
34
75
  padding: 6px 10px;
35
76
  display: flex;
36
77
  cursor: pointer;
37
78
  justify-content: stretch;
38
- border-bottom: solid 1px #e1e1e1;
79
+
80
+ &:not(:last-child) {
81
+ border-bottom: solid 1px $separator-background;
82
+ }
83
+
84
+ &:first-child {
85
+ border-top-left-radius: 3px;
86
+ border-top-right-radius: 3px;
87
+ }
88
+
89
+ &:last-child {
90
+ border-bottom-left-radius: 3px;
91
+ border-bottom-right-radius: 3px;
92
+ }
39
93
 
40
94
  &:hover {
41
95
  background-color: $default-hover-color;
42
96
  }
43
97
 
44
98
  &.-selected {
45
- background-color: $default-hover-color;
99
+ background-color: $component-bg-selected-color;
46
100
  }
47
101
 
48
102
  &.-disabled {
@@ -53,17 +107,3 @@
53
107
  }
54
108
  }
55
109
  }
56
-
57
- .dropdown-period {
58
- width: 100%;
59
- /* animation: 0.5s ease-in 0s 1 slideDown; */
60
- background-color: #FFF;
61
- border: #dae1e8;
62
- display: grid;
63
- grid-template-rows: auto;
64
- height: auto;
65
- overflow-y: auto;
66
- overflow-x: hidden;
67
- /* margin-top: 2px; */
68
- z-index: 99999999999;
69
- }
@@ -38,7 +38,4 @@
38
38
  color: rgb(59, 59, 59);
39
39
  }
40
40
  }
41
- &.-hint {
42
- width: 100% !important;
43
- }
44
41
  }
@@ -95,7 +95,7 @@ que utilizam. Em caso de mudança, ficar atento para os refatores.
95
95
  overflow-y: auto;
96
96
 
97
97
  &::-webkit-scrollbar {
98
- width: 5px;
98
+ width: 2px;
99
99
  }
100
100
 
101
101
  &::-webkit-scrollbar-track {
@@ -54,7 +54,6 @@ $dropdown-width: 38px;
54
54
  width: auto;
55
55
  min-width: 100px;
56
56
  display: flex;
57
- justify-content: space-between;
58
57
  align-items: center;
59
58
  &.selected {
60
59
  border: 1px solid $component-border-color;
@@ -113,11 +112,17 @@ $dropdown-width: 38px;
113
112
  visibility: hidden;
114
113
  pointer-events: none;
115
114
  opacity: 0;
115
+ display: flex;
116
+ align-items: center;
117
+ justify-content: center;
116
118
  &.show {
117
119
  visibility: visible;
118
120
  pointer-events: all;
119
121
  opacity: 1;
120
122
  }
123
+ &.has-selected {
124
+ border: 1px solid $component-selected-color !important;
125
+ }
121
126
  > svg {
122
127
  margin: 0;
123
128
  float: none;
@@ -247,20 +252,32 @@ $dropdown-width: 38px;
247
252
  /*
248
253
  Dropdown hide tabs
249
254
  */
250
- .dropdown-hide-tabs .menuitem {
251
- cursor: pointer;
252
- line-height: 20px;
253
- margin-right: 1px;
254
- display: flex;
255
- align-items: center;
256
- justify-content: space-between;
257
- min-height: 50px;
258
-
259
- >.closepanel {
260
- @extend %tab-closepanel;
255
+ .dropdown-hide-tabs {
256
+ .item-container > .item {
257
+ width: auto;
258
+ padding-left: 10px;
261
259
  }
262
-
263
- &:hover>.closepanel {
264
- visibility: visible;
260
+ .menuitem {
261
+ cursor: pointer;
262
+ line-height: 20px;
263
+ margin-right: 1px;
264
+ display: flex;
265
+ align-items: center;
266
+ min-height: 50px;
267
+ gap: 8px;
268
+ > svg {
269
+ margin: 0;
270
+ }
271
+ > .menubutton {
272
+ padding: 0;
273
+ }
274
+ >.closepanel {
275
+ @extend %tab-closepanel;
276
+ margin-left: auto;
277
+ margin-right: 0;
278
+ }
279
+ &:hover>.closepanel {
280
+ visibility: visible;
281
+ }
265
282
  }
266
283
  }
@@ -1,4 +1,5 @@
1
1
  import { ICalendarProps } from './types.js';
2
+ import 'react';
2
3
  import 'moment';
3
4
  import '../@types/ColorStyles.js';
4
5
 
@@ -1,4 +1,5 @@
1
1
  import { ICalendarProps } from './types.js';
2
+ import 'react';
2
3
  import 'moment';
3
4
  import '../@types/ColorStyles.js';
4
5
 
@@ -1,4 +1,5 @@
1
1
  import { ICalendarProps } from './types.js';
2
+ import 'react';
2
3
  import 'moment';
3
4
  import '../@types/ColorStyles.js';
4
5
 
@@ -1,4 +1,5 @@
1
1
  import { ICalendarProps } from './types.js';
2
+ import 'react';
2
3
  import 'moment';
3
4
  import '../@types/ColorStyles.js';
4
5
 
@@ -1,4 +1,5 @@
1
1
  import { ICalendarProps } from './types.js';
2
+ import 'react';
2
3
  import 'moment';
3
4
  import '../@types/ColorStyles.js';
4
5
 
@@ -1,4 +1,5 @@
1
1
  import { IDayProps } from '../types.js';
2
+ import 'react';
2
3
  import 'moment';
3
4
  import '../../@types/ColorStyles.js';
4
5
 
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
+ var _uuid = require("uuid");
8
9
  var _helpers = require("./helpers");
9
10
  var _buttons = _interopRequireDefault(require("../../buttons"));
10
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -21,12 +22,15 @@ const Day = _ref => {
21
22
  return /*#__PURE__*/_react.default.createElement("div", {
22
23
  className: (0, _helpers.getDayContainerCssClass)(currentDate, day)
23
24
  }, /*#__PURE__*/_react.default.createElement(_buttons.default, {
25
+ id: (0, _uuid.v1)(),
26
+ type: "button",
27
+ tabIndex: (0, _helpers.dateIsEquals)(currentDate, day) ? 0 : -1,
24
28
  boxShadow: false,
29
+ label: day.format('D'),
25
30
  onClick: () => {
26
31
  if (handleDateChange) handleDateChange(day);
27
32
  },
28
- customClass: " ".concat((0, _helpers.getDayCssClass)(currentDate, day), " numberdaycalendar"),
29
- label: day.format('D')
33
+ customClass: " ".concat((0, _helpers.getDayCssClass)(currentDate, day), " numberdaycalendar")
30
34
  }));
31
35
  };
32
36
  var _default = exports.default = Day;
@@ -1,7 +1,8 @@
1
1
  import { IMonthProps } from '../types.js';
2
+ import 'react';
2
3
  import 'moment';
3
4
  import '../../@types/ColorStyles.js';
4
5
 
5
- declare const Month: ({ currentDate }: IMonthProps) => JSX.Element;
6
+ declare const Month: ({ monthRef, currentDate }: IMonthProps) => JSX.Element;
6
7
 
7
8
  export { Month as default };
@@ -10,6 +10,7 @@ var _helpers = require("./helpers");
10
10
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
11
  const Month = _ref => {
12
12
  let {
13
+ monthRef,
13
14
  currentDate
14
15
  } = _ref;
15
16
  const renderWeeks = () => {
@@ -31,6 +32,7 @@ const Month = _ref => {
31
32
  return weeks;
32
33
  };
33
34
  return /*#__PURE__*/_react.default.createElement("div", {
35
+ ref: monthRef,
34
36
  className: "calendarmonth"
35
37
  }, renderWeeks());
36
38
  };
@@ -1,4 +1,5 @@
1
1
  import { IWeekProps } from '../types.js';
2
+ import 'react';
2
3
  import 'moment';
3
4
  import '../../@types/ColorStyles.js';
4
5
 
@@ -1,4 +1,5 @@
1
1
  import { ICalendarProps } from '../types.js';
2
+ import 'react';
2
3
  import 'moment';
3
4
  import '../../@types/ColorStyles.js';
4
5
 
@@ -5,14 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
+ var _uuid = require("uuid");
8
9
  var _moment = _interopRequireDefault(require("moment"));
9
10
  var _Month = _interopRequireDefault(require("./Month"));
10
11
  var _buttons = _interopRequireDefault(require("../../buttons"));
12
+ var _gridlayout = _interopRequireDefault(require("../../gridlayout"));
11
13
  var _helpers = require("./helpers");
12
14
  require("../../assets/styles/calendar.scss");
13
15
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
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); }
15
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; }
18
+ const arrowKeys = ['ArrowUp', 'ArrowRight', 'ArrowDown', 'ArrowLeft'];
16
19
  const Calendar = props => {
17
20
  const {
18
21
  currentDate = (0, _moment.default)(),
@@ -20,12 +23,14 @@ const Calendar = props => {
20
23
  drawGridLines = false,
21
24
  colorStyle,
22
25
  unpadding = false,
23
- customClass
26
+ customClass,
27
+ gridLayout,
28
+ currentDateButton,
29
+ calendarContainer
24
30
  } = props;
31
+ const currentMonth = (0, _react.useRef)(null);
32
+ const currentCalendarRef = (0, _react.useRef)(null);
25
33
  const [dataAtual, setDataAtual] = (0, _react.useState)((0, _helpers.validDate)(currentDate));
26
- (0, _react.useEffect)(() => {
27
- setDataAtual((0, _helpers.validDate)(currentDate));
28
- }, []);
29
34
  const onDateChangeFunction = date => {
30
35
  if (onDateChange) onDateChange(date);
31
36
  setDataAtual(date);
@@ -38,12 +43,48 @@ const Calendar = props => {
38
43
  const currentDateClone = dataAtual.clone();
39
44
  setDataAtual(currentDateClone.add(1, 'month'));
40
45
  };
46
+ const navigateWithArrows = event => {
47
+ var _currentMonth$current;
48
+ const sourceTarget = event.target;
49
+ const daysOfMonth = (_currentMonth$current = currentMonth.current) === null || _currentMonth$current === void 0 ? void 0 : _currentMonth$current.getElementsByClassName('daybutton');
50
+ let indexCurrentDay = 0;
51
+ if (daysOfMonth.length) {
52
+ Array.from(daysOfMonth).find((dayButton, index) => {
53
+ if (dayButton && dayButton.id === sourceTarget.id) indexCurrentDay = index;
54
+ });
55
+ }
56
+ const element = {
57
+ ArrowUp: daysOfMonth[indexCurrentDay - 7],
58
+ ArrowRight: daysOfMonth[indexCurrentDay + 1],
59
+ ArrowDown: daysOfMonth[indexCurrentDay + 7],
60
+ ArrowLeft: daysOfMonth[indexCurrentDay - 1]
61
+ }[event.code];
62
+ if (element) element.focus();
63
+ };
41
64
  const contextValues = {
42
65
  handleDateChange: onDateChangeFunction
43
66
  };
44
- return /*#__PURE__*/_react.default.createElement(_helpers.CalendarContext.Provider, {
45
- value: contextValues
46
- }, /*#__PURE__*/_react.default.createElement("div", {
67
+ (0, _react.useEffect)(() => {
68
+ calendarContainer === null || calendarContainer === void 0 ? void 0 : calendarContainer(currentCalendarRef === null || currentCalendarRef === void 0 ? void 0 : currentCalendarRef.current);
69
+ setDataAtual((0, _helpers.validDate)(currentDate));
70
+ document.addEventListener('keydown', event => {
71
+ if (event && event.code && arrowKeys.includes(event.code) && currentCalendarRef.current && currentCalendarRef.current.contains(document.activeElement) && currentMonth.current && currentMonth.current.contains(document.activeElement)) {
72
+ navigateWithArrows(event);
73
+ event.stopPropagation();
74
+ event.preventDefault();
75
+ }
76
+ });
77
+ return () => {
78
+ document.removeEventListener('keydown', () => {});
79
+ };
80
+ }, []);
81
+ (0, _react.useEffect)(() => {
82
+ var _currentMonth$current2;
83
+ const daysOfMonth = (_currentMonth$current2 = currentMonth.current) === null || _currentMonth$current2 === void 0 ? void 0 : _currentMonth$current2.getElementsByClassName('-selectedday')[0];
84
+ currentDateButton === null || currentDateButton === void 0 ? void 0 : currentDateButton(daysOfMonth.firstChild);
85
+ }, [currentDate]);
86
+ const component = /*#__PURE__*/_react.default.createElement("div", {
87
+ ref: currentCalendarRef,
47
88
  className: (0, _helpers.getCalendarCssClass)({
48
89
  unpadding,
49
90
  drawGridLines,
@@ -53,27 +94,36 @@ const Calendar = props => {
53
94
  }, /*#__PURE__*/_react.default.createElement("div", {
54
95
  className: "calendarheader"
55
96
  }, /*#__PURE__*/_react.default.createElement(_buttons.default, {
56
- iconName: "arrow_left",
97
+ id: (0, _uuid.v1)(),
57
98
  boxShadow: false,
99
+ iconName: "arrow_left",
100
+ customClass: "navbutton nav-arrow-left",
58
101
  onClick: () => {
59
102
  previousMonth();
60
- },
61
- customClass: "navbutton"
103
+ }
62
104
  }), /*#__PURE__*/_react.default.createElement("span", {
63
105
  className: "monthname"
64
106
  }, dataAtual.format('MMMM YYYY')), /*#__PURE__*/_react.default.createElement(_buttons.default, {
107
+ id: (0, _uuid.v1)(),
65
108
  boxShadow: false,
66
109
  iconName: "arrow_right",
110
+ customClass: "navbutton nav-arrow-right",
67
111
  onClick: () => {
68
112
  nextMonth();
69
- },
70
- customClass: "navbutton"
113
+ }
71
114
  })), /*#__PURE__*/_react.default.createElement("div", {
72
115
  className: "daynames"
73
116
  }, (0, _helpers.dayNames)().map(name => /*#__PURE__*/_react.default.createElement("div", {
74
117
  key: "day-".concat(name)
75
118
  }, name))), /*#__PURE__*/_react.default.createElement(_Month.default, {
119
+ monthRef: currentMonth,
76
120
  currentDate: dataAtual
77
- })));
121
+ }));
122
+ return /*#__PURE__*/_react.default.createElement(_helpers.CalendarContext.Provider, {
123
+ value: contextValues
124
+ }, !gridLayout ? component : /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
125
+ customClass: "-withinput",
126
+ cols: gridLayout
127
+ }, component));
78
128
  };
79
129
  var _default = exports.default = Calendar;
@@ -5,6 +5,7 @@ export { default as DangerCalendar } from './DangerCalendar.js';
5
5
  export { default as WarningCalendar } from './WarningCalendar.js';
6
6
  export { default as InfoCalendar } from './InfoCalendar.js';
7
7
  import './types.js';
8
+ import 'react';
8
9
  import 'moment';
9
10
  import '../@types/ColorStyles.js';
10
11