wave-ui 1.45.2 → 1.45.7

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.45.2",
3
+ "version": "1.45.7",
4
4
  "description": "An emerging UI framework for Vue.js & Vue 3 with only the bright side. :sunny:",
5
5
  "author": "Antoni Andre <antoniandre.web@gmail.com>",
6
6
  "main": "./dist/wave-ui.umd.js",
@@ -19,7 +19,8 @@
19
19
  :tabindex="-1"
20
20
  text
21
21
  @keypress.stop
22
- @click.stop="!item._disabled && toggleItem(item, $event)")
22
+ @click.stop="!item._disabled && toggleItem(item, $event)"
23
+ :class="{ 'w-accordion__expand-icon--expanded': item._expanded }")
23
24
  //- Title.
24
25
  slot(
25
26
  v-if="$scopedSlots[`item-title.${item.id || i + 1}`]"
@@ -34,7 +35,8 @@
34
35
  :icon="(item._expanded && collapseIcon) || expandIcon"
35
36
  text
36
37
  @keypress.stop
37
- @click.stop="!item._disabled && toggleItem(item, $event)")
38
+ @click.stop="!item._disabled && toggleItem(item, $event)"
39
+ :class="{ 'w-accordion__expand-icon--expanded': item._expanded }")
38
40
  //- Content.
39
41
  w-transition-expand(y)
40
42
  .w-accordion__item-content(v-if="item._expanded" :class="contentClass")
@@ -76,6 +78,7 @@ export default {
76
78
  computed: {
77
79
  accordionItems () {
78
80
  const items = typeof this.items === 'number' ? Array(this.items).fill({}) : this.items || []
81
+ // eslint-disable-next-line new-cap
79
82
  return items.map((item, _index) => new Vue.observable({
80
83
  ...item,
81
84
  _index,
@@ -148,8 +151,8 @@ export default {
148
151
  margin-right: $base-increment;
149
152
 
150
153
  .w-accordion--rotate-icon & {@include default-transition;}
151
- .w-accordion--rotate-icon .w-accordion__item--expanded & {transform: rotate(-180deg);}
152
- .w-accordion--rotate-icon.w-accordion--icon-right .w-accordion__item--expanded & {transform: rotate(180deg);}
154
+ &--expanded {transform: rotate(-180deg);}
155
+ .w-accordion--icon-right &--expanded {transform: rotate(180deg);}
153
156
 
154
157
  .w-icon:before {font-size: 1.1em;}
155
158
  }
@@ -40,7 +40,7 @@ export default {
40
40
  classes () {
41
41
  return {
42
42
  'd-block': this.block,
43
- 'row': this.row,
43
+ row: this.row,
44
44
  'align-center': this.alignCenter,
45
45
  'align-end': this.alignEnd,
46
46
  'justify-center': this.justifyCenter,
@@ -26,6 +26,7 @@ export default {
26
26
  justifyEnd: { type: Boolean },
27
27
  justifySpaceBetween: { type: Boolean },
28
28
  justifySpaceAround: { type: Boolean },
29
+ justifySpaceEvenly: { type: Boolean },
29
30
  basisZero: { type: Boolean },
30
31
  gap: { type: Number, default: 0 }
31
32
  },
@@ -48,6 +49,7 @@ export default {
48
49
  'justify-end': this.justifyEnd,
49
50
  'justify-space-between': this.justifySpaceBetween,
50
51
  'justify-space-around': this.justifySpaceAround,
52
+ 'justify-space-evenly': this.justifySpaceEvenly,
51
53
  'basis-zero': this.basisZero,
52
54
  [`w-flex--gap${this.gap}`]: this.gap
53
55
  }
@@ -170,6 +170,7 @@ export default {
170
170
  hasValue () {
171
171
  return (
172
172
  this.inputValue ||
173
+ this.inputValue === 0 ||
173
174
  ['date', 'time'].includes(this.type) ||
174
175
  (this.type === 'number' && this.inputNumberError) ||
175
176
  (this.type === 'file' && this.inputFiles.length)
@@ -272,7 +273,6 @@ export default {
272
273
  reader.addEventListener('progress', event => {
273
274
  if (event.loaded && event.total) {
274
275
  this.$set(file, 'progress', event.loaded * 100 / event.total)
275
- console.log(`Progress: ${Math.round(file.progress)}`)
276
276
  }
277
277
  })
278
278
 
@@ -197,7 +197,7 @@ export default {
197
197
  }
198
198
  },
199
199
 
200
- // The floatting menu styles.
200
+ // The floating menu styles.
201
201
  styles () {
202
202
  return {
203
203
  zIndex: this.zIndex || this.zIndex === 0 || (this.overlay && !this.zIndex && 200) || null,
@@ -106,6 +106,7 @@ export default {
106
106
  tabsItems () {
107
107
  const items = typeof this.items === 'number' ? Array(this.items).fill({}) : this.items
108
108
 
109
+ // eslint-disable-next-line new-cap
109
110
  return items.map((item, _index) => new Vue.observable({
110
111
  ...item,
111
112
  _index,
@@ -116,7 +116,7 @@ export default {
116
116
  return listeners
117
117
  },
118
118
  hasValue () {
119
- return this.inputValue
119
+ return this.inputValue || this.inputValue === 0
120
120
  },
121
121
  hasLabel () {
122
122
  return this.label || this.$slots.default
@@ -1,13 +1,9 @@
1
1
  <template lang="pug">
2
- .w-tooltip-wrap(ref="wrapper" :class="{ 'w-tooltip-wrap--attached': !detachTo }")
2
+ .w-tooltip-wrap(:class="{ 'w-tooltip-wrap--attached': !detachTo }")
3
3
  slot(name="activator" :on="eventHandlers")
4
4
  transition(:name="transitionName" appear)
5
5
  .w-tooltip(ref="tooltip" v-show="showTooltip" :class="classes" :style="styles")
6
- //- When there is a bg color, another div wrapper is needed for the triangle
7
- //- to inherit the current color.
8
- div(v-if="bgColor" :class="color")
9
- slot
10
- slot(v-else)
6
+ slot
11
7
  </template>
12
8
 
13
9
  <script>
@@ -95,7 +91,7 @@ export default {
95
91
 
96
92
  // DOM element that will receive the tooltip.
97
93
  tooltipParentEl () {
98
- return this.detachTo ? this.detachToTarget : this.$refs.wrapper
94
+ return this.detachTo ? this.detachToTarget : this.$el
99
95
  },
100
96
 
101
97
  position () {
@@ -140,8 +136,8 @@ export default {
140
136
 
141
137
  classes () {
142
138
  return {
143
- [this.color]: !this.bgColor,
144
- [`${this.bgColor} ${this.bgColor}--bg`]: this.bgColor,
139
+ [this.color]: this.color,
140
+ [`${this.bgColor}--bg`]: this.bgColor,
145
141
  ...this.tooltipClasses,
146
142
  [`w-tooltip--${this.position}`]: true,
147
143
  'w-tooltip--tile': this.tile,
@@ -154,11 +150,13 @@ export default {
154
150
  }
155
151
  },
156
152
 
153
+ // The tooltip styles.
157
154
  styles () {
158
155
  return {
159
156
  zIndex: this.zIndex || this.zIndex === 0 || null,
160
- top: `${~~this.tooltipCoordinates.top}px`,
161
- left: `${~~this.tooltipCoordinates.left}px`
157
+ top: (this.tooltipCoordinates.top && `${~~this.tooltipCoordinates.top}px`) || null,
158
+ left: (this.tooltipCoordinates.left && `${~~this.tooltipCoordinates.left}px`) || null,
159
+ '--w-tooltip-bg-color': this.$waveui.colors[this.bgColor || 'white']
162
160
  }
163
161
  },
164
162
 
@@ -267,7 +265,7 @@ export default {
267
265
  },
268
266
 
269
267
  insertTooltip () {
270
- const wrapper = this.$refs.wrapper
268
+ const wrapper = this.$el
271
269
  this.tooltipEl = this.$refs.tooltip.$el || this.$refs.tooltip
272
270
 
273
271
  // Unwrap the activator element.
@@ -285,7 +283,7 @@ export default {
285
283
  },
286
284
 
287
285
  mounted () {
288
- this.activatorEl = this.$refs.wrapper.firstElementChild
286
+ this.activatorEl = this.$el.firstElementChild
289
287
  if (this.detachTo) this.insertTooltip()
290
288
 
291
289
  if (this.value) this.toggle({ type: 'click', target: this.activatorEl })
@@ -361,93 +359,95 @@ export default {
361
359
 
362
360
  &--custom-transition {transform: none;}
363
361
 
364
- &:after {
365
- content: '';
366
- position: absolute;
367
- width: 0;
368
- height: 0;
369
- border: 6px solid transparent;
370
- }
371
- &--top:after {
372
- top: 100%;
373
- left: 50%;
374
- border-top-color: $tooltip-bg-color;
375
- transform: translateX(-50%);
376
- margin-top: 1px;
377
- }
378
- &--bottom:after {
379
- bottom: 100%;
380
- left: 50%;
381
- border-bottom-color: $tooltip-bg-color;
382
- transform: translateX(-50%);
383
- margin-bottom: 1px;
384
- }
385
- &--left:after {
386
- left: 100%;
387
- top: 50%;
388
- border-left-color: $tooltip-bg-color;
389
- transform: translateY(-50%);
390
- margin-left: 1px;
391
- }
392
- &--right:after {
393
- right: 100%;
394
- top: 50%;
395
- border-right-color: $tooltip-bg-color;
396
- transform: translateY(-50%);
397
- margin-right: 1px;
398
- }
362
+ // &:after {
363
+ // content: '';
364
+ // position: absolute;
365
+ // width: 0;
366
+ // height: 0;
367
+ // border: 6px solid transparent;
368
+ // }
369
+ // &--top:after {
370
+ // top: 100%;
371
+ // left: 50%;
372
+ // border-top-color: $tooltip-bg-color;
373
+ // transform: translateX(-50%);
374
+ // margin-top: 1px;
375
+ // }
376
+ // &--bottom:after {
377
+ // bottom: 100%;
378
+ // left: 50%;
379
+ // border-bottom-color: $tooltip-bg-color;
380
+ // transform: translateX(-50%);
381
+ // margin-bottom: 1px;
382
+ // }
383
+ // &--left:after {
384
+ // left: 100%;
385
+ // top: 50%;
386
+ // border-left-color: $tooltip-bg-color;
387
+ // transform: translateY(-50%);
388
+ // margin-left: 1px;
389
+ // }
390
+ // &--right:after {
391
+ // right: 100%;
392
+ // top: 50%;
393
+ // border-right-color: $tooltip-bg-color;
394
+ // transform: translateY(-50%);
395
+ // margin-right: 1px;
396
+ // }
399
397
 
400
398
  // Tooltip without border.
401
399
  // --------------------------------------------------------
402
- &--no-border.w-tooltip--top:after {margin-top: -1px;border-top-color: inherit;}
403
- &--no-border.w-tooltip--bottom:after {margin-bottom: -1px;border-bottom-color: inherit;}
404
- &--no-border.w-tooltip--left:after {margin-left: -1px;border-left-color: inherit;}
405
- &--no-border.w-tooltip--right:after {margin-right: -1px;border-right-color: inherit;}
400
+ &--no-border {
401
+ @include triangle(var(--w-tooltip-bg-color), '.w-tooltip', 7px, 0);
402
+ }
403
+ &:not(&--no-border) {
404
+ @include triangle(var(--w-tooltip-bg-color), '.w-tooltip', 7px);
405
+ }
406
406
 
407
407
  // Tooltip with border.
408
408
  // --------------------------------------------------------
409
- &:not(&--no-border).w-tooltip--top:after {margin-top: -1px;}
410
- &:not(&--no-border).w-tooltip--bottom:after {margin-bottom: -1px;}
411
- &:not(&--no-border).w-tooltip--left:after {margin-left: -1px;}
412
- &:not(&--no-border).w-tooltip--right:after {margin-right: -1px;}
413
-
414
- &:not(&--no-border) {
415
- &:before {
416
- content: '';
417
- position: absolute;
418
- width: 0;
419
- height: 0;
420
- border: 7px solid transparent;
421
- }
422
- &.w-tooltip--top:before {
423
- top: 100%;
424
- left: 50%;
425
- border-top-color: inherit;
426
- transform: translateX(-50%);
427
- margin-top: 0;
428
- }
429
- &.w-tooltip--bottom:before {
430
- bottom: 100%;
431
- left: 50%;
432
- border-bottom-color: inherit;
433
- transform: translateX(-50%);
434
- margin-bottom: 0;
435
- }
436
- &.w-tooltip--left:before {
437
- left: 100%;
438
- top: 50%;
439
- border-left-color: inherit;
440
- transform: translateY(-50%);
441
- margin-left: 0;
442
- }
443
- &.w-tooltip--right:before {
444
- right: 100%;
445
- top: 50%;
446
- border-right-color: inherit;
447
- transform: translateY(-50%);
448
- margin-right: 0;
449
- }
450
- }
409
+ // &:not(&--no-border).w-tooltip--top:after {margin-top: -1px;}
410
+ // &:not(&--no-border).w-tooltip--bottom:after {margin-bottom: -1px;}
411
+ // &:not(&--no-border).w-tooltip--left:after {margin-left: -1px;}
412
+ // &:not(&--no-border).w-tooltip--right:after {margin-right: -1px;}
413
+
414
+ // &:not(&--no-border) {
415
+ // &:before {
416
+ // content: '';
417
+ // position: absolute;
418
+ // width: 0;
419
+ // height: 0;
420
+ // border: 7px solid transparent;
421
+ // }
422
+ // &.w-tooltip--top:before {
423
+ // top: 100%;
424
+ // left: 50%;
425
+ // border-top-color: inherit;
426
+ // transform: translateX(-50%);
427
+ // margin-top: 0;
428
+ // }
429
+ // &.w-tooltip--bottom:before {
430
+ // bottom: 100%;
431
+ // left: 50%;
432
+ // border-bottom-color: inherit;
433
+ // transform: translateX(-50%);
434
+ // margin-bottom: 0;
435
+ // }
436
+ // &.w-tooltip--left:before {
437
+ // left: 100%;
438
+ // top: 50%;
439
+ // border-left-color: inherit;
440
+ // transform: translateY(-50%);
441
+ // margin-left: 0;
442
+ // }
443
+ // &.w-tooltip--right:before {
444
+ // right: 100%;
445
+ // top: 50%;
446
+ // border-right-color: inherit;
447
+ // transform: translateY(-50%);
448
+ // margin-right: 0;
449
+ // }
450
+ // }
451
451
  // --------------------------------------------------------
452
452
  }
453
453
 
@@ -6,6 +6,6 @@
6
6
  */
7
7
  export const objectifyClasses = (classes = {}) => {
8
8
  if (typeof classes === 'string') classes = { [classes]: true }
9
- else if (typeof classes === 'array') classes = { [classes.join(' ')]: true }
9
+ else if (Array.isArray(classes)) classes = { [classes.join(' ')]: true }
10
10
  return classes
11
11
  }