wave-ui 1.53.2 → 1.55.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-ui",
3
- "version": "1.53.2",
3
+ "version": "1.55.0",
4
4
  "description": "An emerging UI framework for Vue.js (2 & 3) with only the bright side. :sunny:",
5
5
  "author": "Antoni Andre <antoniandre.web@gmail.com>",
6
6
  "main": "./dist/wave-ui.umd.js",
@@ -10,6 +10,7 @@
10
10
  "exports": {
11
11
  "./dist/wave-ui.css": "./dist/wave-ui.css",
12
12
  "./dist/wave-ui.cjs.js": "./dist/wave-ui.cjs.js",
13
+ "./src/wave-ui": "./src/wave-ui/index.js",
13
14
  ".": {
14
15
  "import": "./dist/wave-ui.es.js",
15
16
  "require": "./dist/wave-ui.umd.js"
@@ -189,6 +189,7 @@ export default {
189
189
  user-select: none;
190
190
  cursor: pointer;
191
191
  border-top: $border;
192
+ -webkit-tap-highlight-color: transparent;
192
193
 
193
194
  .w-accordion__item--disabled & {
194
195
  cursor: not-allowed;
@@ -166,6 +166,7 @@ $spinner-size: 40;
166
166
  // Background-color must not transition to not affect the hover & focus states
167
167
  // in :before & :after.
168
168
  transition: $transition-duration, background-color 0s, padding 0s;
169
+ -webkit-tap-highlight-color: transparent;
169
170
 
170
171
  // In w-flex wrapper, allow overriding the default `align-self: center`.
171
172
  .w-flex.align-start > & {align-self: flex-start;}
@@ -133,11 +133,9 @@ $inactive-color: #666;
133
133
  // Contain the hidden radio button, so browser doesn't pan to it when outside of the screen.
134
134
  position: relative;
135
135
  cursor: pointer;
136
+ -webkit-tap-highlight-color: transparent;
136
137
 
137
- &--disabled {
138
- cursor: not-allowed;
139
- -webkit-tap-highlight-color: transparent;
140
- }
138
+ &--disabled {cursor: not-allowed;}
141
139
 
142
140
  // The hidden real checkbox.
143
141
  input[type="checkbox"] {
@@ -234,7 +232,8 @@ $inactive-color: #666;
234
232
  animation: w-checkbox-ripple 0.55s 0.15s ease;
235
233
  }
236
234
 
237
- :focus ~ &__input:before {
235
+ :focus ~ &__input:before,
236
+ :active ~ &__input:before {
238
237
  transform: scale(1.8);
239
238
  opacity: 0.2;
240
239
  }
@@ -134,6 +134,7 @@ export default {
134
134
  icon: { type: String, default: '' },
135
135
  itemLabelKey: { type: String, default: 'label' }, // Name of the label field.
136
136
  itemValueKey: { type: String, default: 'value' }, // Name of the value field.
137
+ itemClassKey: { type: String, default: 'class' }, // Name of the class field.
137
138
  itemColorKey: { type: String, default: 'color' }, // Support a different color per item.
138
139
  itemRouteKey: { type: String, default: 'route' }, // Name of the route field for `nav` lists.
139
140
  itemClass: { type: String },
@@ -230,7 +231,7 @@ export default {
230
231
  'w-list__item-label--selectable': this.isSelectable,
231
232
  [item.color]: !!item.color,
232
233
  [this.SelectionColor]: item._selected && !item.color && this.SelectionColor,
233
- [this.itemClass]: !!this.itemClass
234
+ [item[this.itemClassKey] || this.itemClass]: item[this.itemClassKey] || this.itemClass
234
235
  }
235
236
  },
236
237
 
@@ -483,6 +484,7 @@ export default {
483
484
  padding-top: 1px;
484
485
  padding-bottom: 1px;
485
486
  display: flex;
487
+ -webkit-tap-highlight-color: transparent;
486
488
 
487
489
  .w-list--navigation &,
488
490
  .w-list--checklist & {
@@ -218,12 +218,12 @@ $circle-size: 40;
218
218
  background-image: linear-gradient(
219
219
  -45deg,
220
220
  rgba(255, 255, 255, 0.2) 25%,
221
- transparent 25%,
222
- transparent 50%,
221
+ rgba(255, 255, 255, 0) 25%,
222
+ rgba(255, 255, 255, 0) 50%,
223
223
  rgba(255, 255, 255, 0.2) 50%,
224
224
  rgba(255, 255, 255, 0.2) 75%,
225
- transparent 75%,
226
- transparent
225
+ rgba(255, 255, 255, 0) 75%,
226
+ rgba(255, 255, 255, 0)
227
227
  );
228
228
  background-size: 50px 50px;
229
229
  animation: w-progress-stripes 2s infinite linear;
@@ -134,6 +134,7 @@ $inactive-color: #666;
134
134
  // Contain the hidden radio button, so browser doesn't pan to it when outside of the screen.
135
135
  position: relative;
136
136
  cursor: pointer;
137
+ -webkit-tap-highlight-color: transparent;
137
138
 
138
139
  &--disabled {
139
140
  cursor: not-allowed;
@@ -211,7 +212,8 @@ $inactive-color: #666;
211
212
  animation: w-radio-ripple 0.55s 0.15s ease;
212
213
  }
213
214
 
214
- :focus + &__input:before {
215
+ :focus ~ &__input:before,
216
+ :active ~ &__input:before {
215
217
  transform: scale(1.8);
216
218
  opacity: 0.2;
217
219
  }
@@ -173,6 +173,7 @@ export default {
173
173
  border: none;
174
174
  background: none;
175
175
  cursor: pointer;
176
+ -webkit-tap-highlight-color: transparent;
176
177
  @include default-transition($fast-transition-duration);
177
178
 
178
179
  // Disabled & readonly.
@@ -246,13 +247,16 @@ export default {
246
247
  animation: w-rating-ripple 0.55s ease;
247
248
  }
248
249
 
249
- &__button:focus:after {
250
+ &__button:focus:after,
251
+ &__button:active:after {
250
252
  transform: scale(1.8);
251
253
  opacity: 0.2;
252
254
  }
253
255
  &__button--on:focus:after {
254
256
  transform: scale(1.8);
255
257
  }
258
+ .w-rating--disabled &__button:after,
259
+ .w-rating--readonly &__button:after {opacity: 0;}
256
260
 
257
261
  // After ripple reset to default state, then remove the class via js and the
258
262
  // `:focus + &__button:after` will re-transition to normal focused outline.
@@ -10,6 +10,8 @@
10
10
  v-for="(header, i) in headers"
11
11
  :key="i"
12
12
  :width="header.width || null")
13
+
14
+ //- Table header.
13
15
  thead(v-if="!noHeaders")
14
16
  tr
15
17
  th.w-table__header(
@@ -35,6 +37,8 @@
35
37
  v-if="i < headers.length - 1 && resizableColumns"
36
38
  :class="{ 'w-table__col-resizer--hover': colResizing.hover === i, 'w-table__col-resizer--active': colResizing.columnIndex === i }"
37
39
  @click.stop="/* Prevent click on header, which triggers sorting & DOM refresh. */")
40
+
41
+ //- Table body.
38
42
  tbody
39
43
  //- Progress bar.
40
44
  tr.w-table__progress-bar(v-if="loading")
@@ -114,6 +118,17 @@
114
118
  span.w-table__col-resizer(
115
119
  v-if="i < headers.length - 1 && resizableColumns"
116
120
  :class="{ 'w-table__col-resizer--hover': colResizing.hover === i, 'w-table__col-resizer--active': colResizing.columnIndex === j }")
121
+ //- Extra row.
122
+ .w-table__extra-row(v-if="$slots['extra-row']")
123
+ slot(name="extra-row")
124
+
125
+ //- Table footer.
126
+ tfoot.w-table__footer(v-if="$slots.footer || $slots['footer-row']")
127
+ slot(v-if="$slots['footer-row']" name="footer-row")
128
+ tr.w-table__row(v-else)
129
+ td.w-table__cell(:colspan="headers.length")
130
+ slot(name="footer")
131
+ //- .pagination
117
132
  </template>
118
133
 
119
134
  <script>
@@ -133,6 +148,7 @@ export default {
133
148
  headers: { type: Array, required: true },
134
149
  noHeaders: { type: Boolean },
135
150
  fixedHeaders: { type: Boolean },
151
+ fixedFooter: { type: Boolean },
136
152
  loading: { type: Boolean },
137
153
  // Allow single sort: `+id`, or multiple in an array like: ['+id', '-firstName'].
138
154
  sort: { type: [String, Array] },
@@ -175,7 +191,15 @@ export default {
175
191
  resizableColumns: { type: Boolean }
176
192
  },
177
193
 
178
- emits: ['row-select', 'row-expand', 'row-click', 'update:sort', 'update:selected-rows', 'update:expanded-rows', 'column-resize'],
194
+ emits: [
195
+ 'row-select',
196
+ 'row-expand',
197
+ 'row-click',
198
+ 'update:sort',
199
+ 'update:selected-rows',
200
+ 'update:expanded-rows',
201
+ 'column-resize'
202
+ ],
179
203
 
180
204
  data: () => ({
181
205
  activeSorting: [],
@@ -243,7 +267,8 @@ export default {
243
267
  'w-table--mobile': this.isMobile || null,
244
268
  'w-table--resizable-cols': this.resizableColumns || null,
245
269
  'w-table--resizing': this.colResizing.dragging,
246
- 'w-table--fixed-header': this.fixedHeaders
270
+ 'w-table--fixed-header': this.fixedHeaders,
271
+ 'w-table--fixed-footer': this.fixedFooter
247
272
  }
248
273
  },
249
274
 
@@ -523,7 +548,7 @@ $tr-border-top: 1px;
523
548
  text-overflow: ellipsis;
524
549
  }
525
550
 
526
- &--fixed-header th {
551
+ &--fixed-header thead {
527
552
  position: sticky;
528
553
  top: 0;
529
554
  background-color: #fff;
@@ -631,6 +656,28 @@ $tr-border-top: 1px;
631
656
  background-color: rgba(255, 255, 255, 0.2);
632
657
  padding: (2 * $base-increment) $base-increment;
633
658
  }
659
+
660
+ // Table footer.
661
+ // ------------------------------------------------------
662
+ &__footer &__cell {
663
+ padding-top: $base-increment;
664
+ padding-bottom: $base-increment;
665
+ }
666
+
667
+ &--fixed-footer tfoot {
668
+ position: sticky;
669
+ bottom: 0;
670
+ background-color: #fff;
671
+
672
+ &:after {
673
+ content: '';
674
+ position: absolute;
675
+ bottom: 0;
676
+ left: 0;
677
+ right: 0;
678
+ border-bottom: $border;
679
+ }
680
+ }
634
681
  }
635
682
 
636
683
  // Mobile layout.
@@ -192,6 +192,15 @@ export default {
192
192
  if (typeof index === 'string') index = ~~index
193
193
  else if (isNaN(index) || index < 0) index = 0
194
194
  this.activeTabIndex = index
195
+
196
+ // Scroll the new active tab item title into view if needed.
197
+ this.$nextTick(() => {
198
+ const ref = this.$refs['tabs-bar']
199
+ this.activeTabEl = ref && ref.querySelector(`.w-tabs__bar-item:nth-child(${index + 1})`)
200
+ if (this.activeTabEl) {
201
+ this.activeTabEl.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' })
202
+ }
203
+ })
195
204
  },
196
205
 
197
206
  // Return the original item (so there is no `_index`, etc.).
@@ -281,6 +290,7 @@ export default {
281
290
  transition: $transition-duration ease-in-out, flex-grow 0s, flex 0s; // `flex` for Safari.
282
291
  user-select: none;
283
292
  cursor: pointer;
293
+ -webkit-tap-highlight-color: transparent;
284
294
 
285
295
  .w-tabs--fill-bar & {flex-grow: 1;flex-basis: 0;}
286
296
  .w-tabs--card & {
@@ -135,6 +135,7 @@ export default {
135
135
  &--clickable {
136
136
  cursor: pointer;
137
137
  user-select: none;
138
+ -webkit-tap-highlight-color: transparent;
138
139
 
139
140
  .w-tag__closable {
140
141
  margin-left: 3px;
@@ -16,7 +16,7 @@
16
16
 
17
17
  .grow {flex-grow: 1;flex-basis: auto;}
18
18
  .no-grow {flex-grow: 0;}
19
- .shrink {flex-shrink: 1;margin-left: auto;margin-right: auto;}
19
+ .shrink {flex-shrink: 1;}
20
20
  .no-shrink {flex-shrink: 0;}
21
21
  .fill-width {width: 100%;}
22
22
  .fill-height {height: 100%;}