blue-react 7.8.3 → 7.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,21 @@
1
- $width: 2.188rem;
2
- $height: 1.25rem;
3
- $padding: 0.188rem;
4
-
5
- $switch-active-color: $success;
6
-
7
- .switch {
8
- @include switch();
9
-
10
- &.lg {
11
- @include switch(100px, 30px);
12
- }
13
- }
14
-
15
- /* Rounded sliders */
16
- .slider.round {
17
- border-radius: $height;
18
- }
19
- .slider.round:before {
20
- border-radius: 50%;
21
- }
1
+ $width: 2.188rem;
2
+ $height: 1.25rem;
3
+ $padding: 0.188rem;
4
+
5
+ $switch-active-color: $success;
6
+
7
+ .switch {
8
+ @include switch();
9
+
10
+ &.lg {
11
+ @include switch(100px, 30px);
12
+ }
13
+ }
14
+
15
+ /* Rounded sliders */
16
+ .slider.round {
17
+ border-radius: $height;
18
+ }
19
+ .slider.round:before {
20
+ border-radius: 50%;
21
+ }
@@ -1,14 +1,14 @@
1
1
  @mixin actions-break($width) {
2
2
  @media screen and (max-width: $width) {
3
3
  top: 0;
4
- border-radius: $blue-actions-indicator-height / 2;
4
+ border-radius: $blue-actions-indicator-height * 0.5;
5
5
  box-shadow: $box-shadow;
6
6
  background-color: $header-bg;
7
7
 
8
8
  .blue-actions-controls {
9
9
  & > * {
10
- margin-top: $spacer / 2;
11
- margin-bottom: $spacer / 2;
10
+ margin-top: $spacer * 0.5;
11
+ margin-bottom: $spacer * 0.5;
12
12
  }
13
13
  }
14
14
 
@@ -31,13 +31,13 @@
31
31
  .blue-actions-controls {
32
32
  background: transparent;
33
33
  display: flex;
34
- margin-left: -$spacer / 2;
35
- margin-right: -$spacer / 2;
34
+ margin-left: -$spacer * 0.5;
35
+ margin-right: -$spacer * 0.5;
36
36
  padding-right: $spacer;
37
37
 
38
38
  & > * {
39
- margin-left: $spacer / 2;
40
- margin-right: $spacer / 2;
39
+ margin-left: $spacer * 0.5;
40
+ margin-right: $spacer * 0.5;
41
41
  }
42
42
  }
43
43
 
@@ -1,10 +1,10 @@
1
- @mixin customProperty($name, $value) {
2
- // fallback for older browser who do not support custom properties / css variables
3
- #{$name}: #{$value};
4
-
5
- // create a css variable (this might override the variable on any of the ancestor elements)
6
- --#{$name}: #{$value};
7
-
8
- // use the css variable on the property
9
- #{$name}: var(--#{$name}, #{$value});
10
- }
1
+ @mixin customProperty($name, $value) {
2
+ // fallback for older browser who do not support custom properties / css variables
3
+ #{$name}: #{$value};
4
+
5
+ // create a css variable (this might override the variable on any of the ancestor elements)
6
+ --#{$name}: #{$value};
7
+
8
+ // use the css variable on the property
9
+ #{$name}: var(--#{$name}, #{$value});
10
+ }
@@ -1,33 +1,33 @@
1
- @mixin custom-scrollbar($thumb-color, $bg-color, $track-border-radius: 0) {
2
- ::-webkit-scrollbar-thumb {
3
- background-color: rgba($thumb-color, 0.4);
4
- box-shadow: inset 1px 1px 0 rgba($thumb-color, 0.1),
5
- inset 0 -1px 0 rgba($thumb-color, 0.07);
6
- }
7
- ::-webkit-scrollbar-thumb:hover {
8
- background-color: rgba($thumb-color, 0.5);
9
- }
10
- ::-webkit-scrollbar-thumb:active {
11
- background-color: rgba($thumb-color, 0.6);
12
- }
13
-
14
- ::-webkit-scrollbar-track {
15
- background-color: $bg-color;
16
- border-radius: $track-border-radius;
17
- }
18
- }
19
-
20
- @mixin slide-transition() {
21
- $slide-transition: width 0.5s;
22
- transition: $slide-transition;
23
- }
24
-
25
- @mixin header-bg() {
26
- background-color: rgba($header-bg, $shimmering);
27
- background-image: linear-gradient(
28
- 0deg,
29
- rgba($header-bg, 0.8),
30
- rgba($header-bg, 0.7)
31
- );
32
- backdrop-filter: blur(3px) saturate(125%);
33
- }
1
+ @mixin custom-scrollbar($thumb-color, $bg-color, $track-border-radius: 0) {
2
+ ::-webkit-scrollbar-thumb {
3
+ background-color: rgba($thumb-color, 0.4);
4
+ box-shadow: inset 1px 1px 0 rgba($thumb-color, 0.1),
5
+ inset 0 -1px 0 rgba($thumb-color, 0.07);
6
+ }
7
+ ::-webkit-scrollbar-thumb:hover {
8
+ background-color: rgba($thumb-color, 0.5);
9
+ }
10
+ ::-webkit-scrollbar-thumb:active {
11
+ background-color: rgba($thumb-color, 0.6);
12
+ }
13
+
14
+ ::-webkit-scrollbar-track {
15
+ background-color: $bg-color;
16
+ border-radius: $track-border-radius;
17
+ }
18
+ }
19
+
20
+ @mixin slide-transition() {
21
+ $slide-transition: width 0.5s;
22
+ transition: $slide-transition;
23
+ }
24
+
25
+ @mixin header-bg() {
26
+ background-color: rgba($header-bg, $shimmering);
27
+ background-image: linear-gradient(
28
+ 0deg,
29
+ rgba($header-bg, 0.8),
30
+ rgba($header-bg, 0.7)
31
+ );
32
+ backdrop-filter: blur(3px) saturate(125%);
33
+ }
@@ -1,9 +1,9 @@
1
- @mixin scroll-shadow($bg, $light-base: white) {
2
- background: linear-gradient($bg 30%, rgba($light-base, 0)),
3
- linear-gradient(rgba($light-base, 0) 10px, $bg 70%) bottom,
4
- radial-gradient(at top, rgba(0, 0, 0, 0.2), transparent 70%),
5
- radial-gradient(at bottom, rgba(0, 0, 0, 0.2), transparent 70%) bottom;
6
- background-repeat: no-repeat;
7
- background-size: 100% 20px, 100% 20px, 100% 10px, 100% 10px;
8
- background-attachment: local, local, scroll, scroll;
9
- }
1
+ @mixin scroll-shadow($bg, $light-base: white) {
2
+ background: linear-gradient($bg 30%, rgba($light-base, 0)),
3
+ linear-gradient(rgba($light-base, 0) 10px, $bg 70%) bottom,
4
+ radial-gradient(at top, rgba(0, 0, 0, 0.2), transparent 70%),
5
+ radial-gradient(at bottom, rgba(0, 0, 0, 0.2), transparent 70%) bottom;
6
+ background-repeat: no-repeat;
7
+ background-size: 100% 20px, 100% 20px, 100% 10px, 100% 10px;
8
+ background-attachment: local, local, scroll, scroll;
9
+ }
@@ -1,85 +1,85 @@
1
- @mixin switch(
2
- $width: 35px,
3
- $height: 20px,
4
- $padding: 3px,
5
- $color: $body-color,
6
- $color-active: $success
7
- ) {
8
- $slider-size: $height - ($padding * 2);
9
-
10
- & {
11
- position: relative;
12
- display: inline-block;
13
- width: $width;
14
- height: $height;
15
-
16
- input {
17
- display: none;
18
- }
19
-
20
- &.disabled {
21
- opacity: 0.8;
22
- }
23
-
24
- &:not(.disabled) {
25
- .slider {
26
- cursor: pointer;
27
- }
28
- }
29
-
30
- .slider {
31
- position: absolute;
32
- top: 0;
33
- left: 0;
34
- right: 0;
35
- bottom: 0;
36
- background-color: $input-group-addon-bg;
37
- transition: 0.4s;
38
- box-shadow: inset 0 0 0 1px rgba($color, 0.5);
39
-
40
- &::before {
41
- content: "";
42
- position: absolute;
43
- height: $slider-size;
44
- width: $slider-size;
45
- left: $padding;
46
- bottom: $padding;
47
- background-color: $color;
48
- transition: 0.4s;
49
- }
50
-
51
- &::after {
52
- content: attr(data-label);
53
- position: absolute;
54
- top: 50%;
55
- left: 50%;
56
- transform: translate(-50%, -50%);
57
- margin-left: ($slider-size / 2);
58
- transition: margin-left 0.4s;
59
- color: $color;
60
- }
61
- }
62
-
63
- input:checked {
64
- & + .slider {
65
- background-color: $color-active;
66
- box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.3);
67
-
68
- &::before {
69
- transform: translateX(
70
- $width - $slider-size - ($padding * 2)
71
- );
72
- background-color: white;
73
- }
74
-
75
- &::after {
76
- color: white;
77
- margin-left: ($slider-size / 2) * -1;
78
- }
79
- }
80
- }
81
- input:focus + .slider {
82
- box-shadow: 0 0 1px $color-active;
83
- }
84
- }
85
- }
1
+ @mixin switch(
2
+ $width: 35px,
3
+ $height: 20px,
4
+ $padding: 3px,
5
+ $color: $body-color,
6
+ $color-active: $success
7
+ ) {
8
+ $slider-size: $height - ($padding * 2);
9
+
10
+ & {
11
+ position: relative;
12
+ display: inline-block;
13
+ width: $width;
14
+ height: $height;
15
+
16
+ input {
17
+ display: none;
18
+ }
19
+
20
+ &.disabled {
21
+ opacity: 0.8;
22
+ }
23
+
24
+ &:not(.disabled) {
25
+ .slider {
26
+ cursor: pointer;
27
+ }
28
+ }
29
+
30
+ .slider {
31
+ position: absolute;
32
+ top: 0;
33
+ left: 0;
34
+ right: 0;
35
+ bottom: 0;
36
+ background-color: $input-group-addon-bg;
37
+ transition: 0.4s;
38
+ box-shadow: inset 0 0 0 1px rgba($color, 0.5);
39
+
40
+ &::before {
41
+ content: "";
42
+ position: absolute;
43
+ height: $slider-size;
44
+ width: $slider-size;
45
+ left: $padding;
46
+ bottom: $padding;
47
+ background-color: $color;
48
+ transition: 0.4s;
49
+ }
50
+
51
+ &::after {
52
+ content: attr(data-label);
53
+ position: absolute;
54
+ top: 50%;
55
+ left: 50%;
56
+ transform: translate(-50%, -50%);
57
+ margin-left: ($slider-size * 0.5);
58
+ transition: margin-left 0.4s;
59
+ color: $color;
60
+ }
61
+ }
62
+
63
+ input:checked {
64
+ & + .slider {
65
+ background-color: $color-active;
66
+ box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.3);
67
+
68
+ &::before {
69
+ transform: translateX(
70
+ $width - $slider-size - ($padding * 2)
71
+ );
72
+ background-color: white;
73
+ }
74
+
75
+ &::after {
76
+ color: white;
77
+ margin-left: ($slider-size * 0.5) * -1;
78
+ }
79
+ }
80
+ }
81
+ input:focus + .slider {
82
+ box-shadow: 0 0 1px $color-active;
83
+ }
84
+ }
85
+ }
@@ -70,16 +70,23 @@ export interface GridState {
70
70
  }
71
71
  /**
72
72
  * The main component. As soon this component is mounted, it is globally available under `window.blueGridRef`.
73
- * Also you can append your own event listeners with `blueGridRef.addEventListener(eventName, (prevProps, prevState) => { })`.
73
+ * You can also append your own event listeners.
74
74
  *
75
- * Allowed event listeners:
75
+ * Allowed events:
76
76
  *
77
77
  * * **componentDidUpdate** - Component was updated.
78
- * Example: `blueGridRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })`
78
+ * Example: `window.blueGridRef.addEventListener("componentDidUpdate", (prevProps, prevState) => { })`
79
79
  * * **pageDidShowAgain** - Page appeared again with the same old state. In the callback function you can reinitialize things.
80
- * Example: `blueGridRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
80
+ * Example: `window.blueGridRef.addEventListener("pageDidShowAgain", "home", (prevProps, prevState) => { })`
81
81
  * * **pageDidHide** - This page disappeared and another page appears instead.
82
- * Example: `blueGridRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
82
+ * Example: `window.blueGridRef.addEventListener("pageDidHide", "home", (prevProps, prevState) => { })`
83
+ *
84
+ * Method to add event listeners:
85
+ * * `window.blueGridRef.`**addEventListener**`(eventName: string, param2: any, param3: any, listenerId?: string)`
86
+ *
87
+ * Methods to remove event listeners:
88
+ * * `window.blueGridRef.`**removeEventListener**`(eventName: string, listenerId: string)`
89
+ * * `window.blueGridRef.`**removeDuplicatedEventListeners**`()` - Will automatically be called when running `addEventListener`
83
90
  */
84
91
  export default class Grid extends Component<GridProps, GridState> {
85
92
  defaultMatch: string[];
@@ -105,6 +112,8 @@ export default class Grid extends Component<GridProps, GridState> {
105
112
  toggleSidebar(event: any): void;
106
113
  hideSidebar(e: any): void;
107
114
  initMatch(): void;
108
- addEventListener(param1: any, param2: any, param3: any): void;
115
+ addEventListener(param1: any, param2: any, param3: any, listenerId?: string): void;
116
+ removeEventListener(type: string, listenerId: string): void;
117
+ removeDuplicatedEventListeners(): void;
109
118
  render(): JSX.Element;
110
119
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blue-react",
3
- "version": "7.8.3",
3
+ "version": "7.10.1",
4
4
  "description": "Blue React Components",
5
5
  "license": "LGPL-3.0-or-later",
6
6
  "main": "index.js",