@burh/nuxt-core 1.0.382 → 1.0.384

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,228 +1,228 @@
1
- <template>
2
- <div>
3
- <div
4
- v-if="isDropdownOpen"
5
- id="backgroundFade"
6
- ></div>
7
- <div
8
- v-click-outside="dropDownOutsideClick"
9
- class="filter__container"
10
- :class="{'filter__container__dropdown--open': isDropdownOpen}"
11
- ref="filterContainer"
12
- >
13
- <button
14
- class="filter__item"
15
- :class="{'filter__item--active': isDropdownOpen || isActive}"
16
- @click="handleFilterClick()"
17
- >
18
- <div
19
- v-if="status != ''"
20
- class="status"
21
- :class="`status--${status}`"
22
- ></div>
23
- <p>{{ text }}</p>
24
- </button>
25
-
26
- <div
27
- v-show="isDropdownOpen"
28
- class="filter__dropdown"
29
- ref="dropdownContainer"
30
- >
31
- <div class="filter__dropdown__content">
32
- <slot name="dropdown-content" />
33
- </div>
34
- </div>
35
- </div>
36
- </div>
37
- </template>
38
-
39
- <script>
40
- export default {
41
- name: 'filter-with-dropdown',
42
- props: {
43
- text: {
44
- type: String,
45
- default: ''
46
- },
47
- isActive: {
48
- type: Boolean,
49
- default: false
50
- },
51
- shouldOpenDropdown: {
52
- type: Boolean,
53
- default: false
54
- },
55
- status: {
56
- type: String,
57
- default: ''
58
- }
59
- },
60
- data() {
61
- return {
62
- isDropdownOpen: false
63
- };
64
- },
65
- watch: {
66
- isDropdownOpen(value) {
67
- if (value === true) {
68
- if (this.shouldOpenDropdown) {
69
- const filterContainer = this.$refs.filterContainer;
70
- const dropdownContainer = this.$refs.dropdownContainer;
71
-
72
- dropdownContainer.classList.remove('dropdown-left');
73
- dropdownContainer.classList.remove('dropdown-right');
74
-
75
- if (((filterContainer.offsetLeft - (350 / 2)) - 20) < 0) {
76
- dropdownContainer.classList.add('dropdown-left');
77
- }
78
-
79
- if (((window.innerWidth - filterContainer.offsetLeft - filterContainer.offsetWidth) - (350 / 2) - 20) < 0) {
80
- dropdownContainer.classList.add('dropdown-right');
81
- }
82
- }
83
- }
84
- },
85
- },
86
- methods: {
87
- handleFilterClick() {
88
- if (this.shouldOpenDropdown === true) {
89
- this.toggleDropdown();
90
- } else {
91
- this.$emit('filter-click');
92
- }
93
- },
94
- toggleDropdown() {
95
- this.isDropdownOpen = !this.isDropdownOpen;
96
- },
97
- dropDownOutsideClick() {
98
- if (this.isDropdownOpen) {
99
- this.isDropdownOpen = false;
100
- }
101
- }
102
- }
103
- };
104
- </script>
105
-
106
- <style lang="scss" scoped>
107
- @keyframes fadeIn {
108
- from { opacity: 0; }
109
- to { opacity: 1; }
110
- }
111
-
112
- @keyframes dropdownAnimation {
113
- from {
114
- margin-top: -5px;
115
- opacity: 0;
116
- }
117
- to {
118
- margin-top: 10px;
119
- opacity: 1;
120
- }
121
- }
122
-
123
- #backgroundFade {
124
- position: fixed;
125
- left: 0;
126
- top: 0;
127
- width: 100vw;
128
- height: 100vh;
129
- background: rgba(255, 255, 255, 0.6);
130
- z-index: 200;
131
- animation: 0.5s fadeIn;
132
- }
133
-
134
- .filter__container__dropdown--open {
135
- z-index: 210!important;
136
- }
137
-
138
- .filter__container {
139
- position: relative;
140
- z-index: 100;
141
- margin-bottom: 10px;
142
- .filter__dropdown {
143
- position: absolute;
144
- width: 350px;
145
- left: calc(50% + (10px / 2));
146
- transform: translateX(-50%);
147
- margin-top: 10px;
148
- box-shadow: 0 0 20px rgba(0,0,0,0.08);
149
- border-radius: 4px;
150
- background: #fff;
151
- animation: 0.5s dropdownAnimation cubic-bezier(0.65, 0.05, 0.36, 1);
152
- border: 1px solid #e9ecef;
153
- &.dropdown-left {
154
- transform: none;
155
- left: 0;
156
- }
157
- &.dropdown-right {
158
- transform: none;
159
- left: initial;
160
- right: 10px;
161
- }
162
- &__content {
163
- padding: 20px;
164
- }
165
- }
166
-
167
- .filter__item {
168
- cursor: pointer;
169
- user-select: none;
170
- padding: 5px 20px;
171
- border-radius: 100px;
172
- margin-right: 10px;
173
- border: 1px solid #E9ECEF;
174
- transition: background 0.5s;
175
- display: flex;
176
- align-items: center;
177
- background: transparent;
178
- &:focus {
179
- outline: none;
180
- background: rgba(31, 140, 235, 0.2);
181
- border-color: transparent;
182
- p {
183
- color: #5865F2;
184
- }
185
- }
186
- &:not(.filter__item--active):hover {
187
- background: rgba(174, 182, 190, 0.2);
188
- p {
189
- color: #1D364B;
190
- }
191
- }
192
- p {
193
- margin: 0;
194
- font-weight: 400;
195
- color: #AEB6BE;
196
- transition: color 0.5s;
197
- white-space: nowrap;
198
- }
199
- &--active {
200
- background: rgba(31, 140, 235, 0.2);
201
- border-color: transparent;
202
- p {
203
- color: #5865F2;
204
- }
205
- }
206
- .status {
207
- width: 10px;
208
- height: 10px;
209
- background: #AEB6BE;
210
- display: block;
211
- border-radius: 100px;
212
- margin-right: 10px;
213
- &--open {
214
- background: #3AC089;
215
- }
216
- &--awaiting {
217
- background: #FFCF02;
218
- }
219
- &--paused {
220
- background: #FF539D;
221
- }
222
- &--ended {
223
- background: #0C95FC;
224
- }
225
- }
226
- }
227
- }
228
- </style>
1
+ <template>
2
+ <div>
3
+ <div
4
+ v-if="isDropdownOpen"
5
+ id="backgroundFade"
6
+ ></div>
7
+ <div
8
+ v-click-outside="dropDownOutsideClick"
9
+ class="filter__container"
10
+ :class="{'filter__container__dropdown--open': isDropdownOpen}"
11
+ ref="filterContainer"
12
+ >
13
+ <button
14
+ class="filter__item"
15
+ :class="{'filter__item--active': isDropdownOpen || isActive}"
16
+ @click="handleFilterClick()"
17
+ >
18
+ <div
19
+ v-if="status != ''"
20
+ class="status"
21
+ :class="`status--${status}`"
22
+ ></div>
23
+ <p>{{ text }}</p>
24
+ </button>
25
+
26
+ <div
27
+ v-show="isDropdownOpen"
28
+ class="filter__dropdown"
29
+ ref="dropdownContainer"
30
+ >
31
+ <div class="filter__dropdown__content">
32
+ <slot name="dropdown-content" />
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </template>
38
+
39
+ <script>
40
+ export default {
41
+ name: 'filter-with-dropdown',
42
+ props: {
43
+ text: {
44
+ type: String,
45
+ default: ''
46
+ },
47
+ isActive: {
48
+ type: Boolean,
49
+ default: false
50
+ },
51
+ shouldOpenDropdown: {
52
+ type: Boolean,
53
+ default: false
54
+ },
55
+ status: {
56
+ type: String,
57
+ default: ''
58
+ }
59
+ },
60
+ data() {
61
+ return {
62
+ isDropdownOpen: false
63
+ };
64
+ },
65
+ watch: {
66
+ isDropdownOpen(value) {
67
+ if (value === true) {
68
+ if (this.shouldOpenDropdown) {
69
+ const filterContainer = this.$refs.filterContainer;
70
+ const dropdownContainer = this.$refs.dropdownContainer;
71
+
72
+ dropdownContainer.classList.remove('dropdown-left');
73
+ dropdownContainer.classList.remove('dropdown-right');
74
+
75
+ if (((filterContainer.offsetLeft - (350 / 2)) - 20) < 0) {
76
+ dropdownContainer.classList.add('dropdown-left');
77
+ }
78
+
79
+ if (((window.innerWidth - filterContainer.offsetLeft - filterContainer.offsetWidth) - (350 / 2) - 20) < 0) {
80
+ dropdownContainer.classList.add('dropdown-right');
81
+ }
82
+ }
83
+ }
84
+ },
85
+ },
86
+ methods: {
87
+ handleFilterClick() {
88
+ if (this.shouldOpenDropdown === true) {
89
+ this.toggleDropdown();
90
+ } else {
91
+ this.$emit('filter-click');
92
+ }
93
+ },
94
+ toggleDropdown() {
95
+ this.isDropdownOpen = !this.isDropdownOpen;
96
+ },
97
+ dropDownOutsideClick() {
98
+ if (this.isDropdownOpen) {
99
+ this.isDropdownOpen = false;
100
+ }
101
+ }
102
+ }
103
+ };
104
+ </script>
105
+
106
+ <style lang="scss" scoped>
107
+ @keyframes fadeIn {
108
+ from { opacity: 0; }
109
+ to { opacity: 1; }
110
+ }
111
+
112
+ @keyframes dropdownAnimation {
113
+ from {
114
+ margin-top: -5px;
115
+ opacity: 0;
116
+ }
117
+ to {
118
+ margin-top: 10px;
119
+ opacity: 1;
120
+ }
121
+ }
122
+
123
+ #backgroundFade {
124
+ position: fixed;
125
+ left: 0;
126
+ top: 0;
127
+ width: 100vw;
128
+ height: 100vh;
129
+ background: rgba(255, 255, 255, 0.6);
130
+ z-index: 200;
131
+ animation: 0.5s fadeIn;
132
+ }
133
+
134
+ .filter__container__dropdown--open {
135
+ z-index: 210!important;
136
+ }
137
+
138
+ .filter__container {
139
+ position: relative;
140
+ z-index: 100;
141
+ margin-bottom: 10px;
142
+ .filter__dropdown {
143
+ position: absolute;
144
+ width: 350px;
145
+ left: calc(50% + (10px / 2));
146
+ transform: translateX(-50%);
147
+ margin-top: 10px;
148
+ box-shadow: 0 0 20px rgba(0,0,0,0.08);
149
+ border-radius: 4px;
150
+ background: #fff;
151
+ animation: 0.5s dropdownAnimation cubic-bezier(0.65, 0.05, 0.36, 1);
152
+ border: 1px solid #e9ecef;
153
+ &.dropdown-left {
154
+ transform: none;
155
+ left: 0;
156
+ }
157
+ &.dropdown-right {
158
+ transform: none;
159
+ left: initial;
160
+ right: 10px;
161
+ }
162
+ &__content {
163
+ padding: 20px;
164
+ }
165
+ }
166
+
167
+ .filter__item {
168
+ cursor: pointer;
169
+ user-select: none;
170
+ padding: 5px 20px;
171
+ border-radius: 100px;
172
+ margin-right: 10px;
173
+ border: 1px solid #E9ECEF;
174
+ transition: background 0.5s;
175
+ display: flex;
176
+ align-items: center;
177
+ background: transparent;
178
+ &:focus {
179
+ outline: none;
180
+ background: rgba(31, 140, 235, 0.2);
181
+ border-color: transparent;
182
+ p {
183
+ color: #5865F2;
184
+ }
185
+ }
186
+ &:not(.filter__item--active):hover {
187
+ background: rgba(174, 182, 190, 0.2);
188
+ p {
189
+ color: #1D364B;
190
+ }
191
+ }
192
+ p {
193
+ margin: 0;
194
+ font-weight: 400;
195
+ color: #AEB6BE;
196
+ transition: color 0.5s;
197
+ white-space: nowrap;
198
+ }
199
+ &--active {
200
+ background: rgba(31, 140, 235, 0.2);
201
+ border-color: transparent;
202
+ p {
203
+ color: #5865F2;
204
+ }
205
+ }
206
+ .status {
207
+ width: 10px;
208
+ height: 10px;
209
+ background: #AEB6BE;
210
+ display: block;
211
+ border-radius: 100px;
212
+ margin-right: 10px;
213
+ &--open {
214
+ background: #3AC089;
215
+ }
216
+ &--awaiting {
217
+ background: #FFCF02;
218
+ }
219
+ &--paused {
220
+ background: #FF539D;
221
+ }
222
+ &--ended {
223
+ background: #0C95FC;
224
+ }
225
+ }
226
+ }
227
+ }
228
+ </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burh/nuxt-core",
3
- "version": "1.0.382",
3
+ "version": "1.0.384",
4
4
  "description": "Design System and Components.",
5
5
  "author": "Burh",
6
6
  "scripts": {