wave-ui 1.40.0 → 1.42.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-ui",
3
- "version": "1.40.0",
3
+ "version": "1.42.1",
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",
@@ -43,36 +43,37 @@
43
43
  "*.vue"
44
44
  ],
45
45
  "devDependencies": {
46
- "@babel/core": "^7.14.8",
47
- "@babel/eslint-parser": "^7.14.7",
48
- "@babel/plugin-proposal-class-properties": "^7.14.5",
46
+ "@babel/core": "^7.16.0",
47
+ "@babel/eslint-parser": "^7.16.0",
48
+ "@babel/plugin-proposal-class-properties": "^7.16.0",
49
49
  "@mdi/font": "^5.9.55",
50
- "@vitejs/plugin-vue": "^1.2.5",
51
- "autoprefixer": "^10.3.1",
52
- "axios": "^0.21.1",
53
- "core-js": "^3.15.2",
54
- "eslint": "^7.31.0",
50
+ "@vitejs/plugin-vue": "^1.9.4",
51
+ "autoprefixer": "^10.4.0",
52
+ "axios": "^0.21.4",
53
+ "core-js": "^3.19.0",
54
+ "eslint": "^7.32.0",
55
55
  "eslint-config-standard": "^16.0.3",
56
- "eslint-plugin-import": "^2.23.4",
56
+ "eslint-plugin-import": "^2.25.2",
57
57
  "eslint-plugin-node": "^11.1.0",
58
- "eslint-plugin-promise": "^5.1.0",
59
- "eslint-plugin-vue": "^7.14.0",
58
+ "eslint-plugin-promise": "^5.1.1",
59
+ "eslint-plugin-vue": "^7.20.0",
60
60
  "font-awesome": "^4.7.0",
61
61
  "ghspa": "^1.0.0",
62
- "gsap": "^3.7.1",
62
+ "gsap": "^3.8.0",
63
63
  "ionicons": "^4.6.3",
64
64
  "material-design-icons": "^3.0.1",
65
65
  "rollup-plugin-delete": "^2.0.0",
66
- "sass": "^1.35.2",
67
- "simple-syntax-highlighter": "^1.4.8",
66
+ "sass": "^1.43.4",
67
+ "simple-syntax-highlighter": "^1.5.0",
68
68
  "splitpanes": "^2.3.8",
69
- "vite": "^2.4.3",
69
+ "vite": "^2.6.13",
70
70
  "vite-plugin-pug": "^0.3.0",
71
- "vite-plugin-vue2": "^1.7.3",
71
+ "vite-plugin-vue2": "^1.9.0",
72
72
  "vue": "^2.6.14",
73
- "vue-router": "^3.5.2",
73
+ "vue-router": "^3.5.3",
74
74
  "vue-svg-loader": "^0.16.0",
75
75
  "vue-template-compiler": "^2.6.14",
76
- "vueperslides": "^2.15.2"
76
+ "vueperslides": "^2.15.2",
77
+ "vuex": "^3.6.2"
77
78
  }
78
79
  }
@@ -1,5 +1,5 @@
1
1
  <template lang="pug">
2
- .w-badge-wrap
2
+ .w-badge-wrap(v-on="$listeners")
3
3
  slot
4
4
  transition(:name="`${transition}`")
5
5
  .w-badge(
@@ -104,6 +104,7 @@ export default {
104
104
  border-radius: 99em;
105
105
  // Always get an even number for better text vertical align.
106
106
  height: round(1.1 * divide($base-font-size, 2)) * 2;
107
+ line-height: round(1.1 * divide($base-font-size, 2)) * 2;
107
108
  min-width: round(1.1 * divide($base-font-size, 2)) * 2;
108
109
  z-index: 1;
109
110
  padding: 0 $base-increment;
@@ -121,29 +122,38 @@ export default {
121
122
  $height: round(divide($base-font-size, 2)) * 2;
122
123
  font-size: round(0.67 * divide($base-font-size, 2)) * 2;
123
124
  height: $height;
125
+ line-height: $height;
124
126
  min-width: $height;
125
127
 
126
128
  &--round {width: $height;padding: 0 round(divide($height, 2));}
127
129
  }
128
130
  &.size--sm {
131
+ $height: round(1.1 * divide($base-font-size, 2)) * 2;
129
132
  font-size: round(0.75 * divide($base-font-size, 2)) * 2;
130
- height: round(1.1 * divide($base-font-size, 2)) * 2;
131
- min-width: round(1.1 * divide($base-font-size, 2)) * 2;
133
+ height: $height;
134
+ line-height: $height;
135
+ min-width: $height;
132
136
  }
133
137
  &.size--md {
138
+ $height: round(1.3 * divide($base-font-size, 2)) * 2;
134
139
  font-size: round(0.9 * divide($base-font-size, 2)) * 2;
135
- height: round(1.3 * divide($base-font-size, 2)) * 2;
136
- min-width: round(1.3 * divide($base-font-size, 2)) * 2;
140
+ height: $height;
141
+ line-height: $height;
142
+ min-width: $height;
137
143
  }
138
144
  &.size--lg {
145
+ $height: round(1.5 * divide($base-font-size, 2)) * 2;
139
146
  font-size: round(1.05 * divide($base-font-size, 2)) * 2;
140
- height: round(1.5 * divide($base-font-size, 2)) * 2;
141
- min-width: round(1.5 * divide($base-font-size, 2)) * 2;
147
+ height: $height;
148
+ line-height: $height;
149
+ min-width: $height;
142
150
  }
143
151
  &.size--xl {
152
+ $height: round(1.8 * divide($base-font-size, 2)) * 2;
144
153
  font-size: round(1.2 * divide($base-font-size, 2)) * 2;
145
- height: round(1.8 * divide($base-font-size, 2)) * 2;
146
- min-width: round(1.8 * divide($base-font-size, 2)) * 2;
154
+ height: $height;
155
+ line-height: $height;
156
+ min-width: $height;
147
157
  }
148
158
 
149
159
  // Position.
@@ -119,8 +119,8 @@ export default {
119
119
  &.size--lg {font-size: round(1.7 * $base-font-size);}
120
120
  &.size--xl {font-size: 2 * $base-font-size;}
121
121
 
122
- // In w-button and w-alert.
123
- // .w-button &, .w-alert & {font-size: round(1.4 * $base-font-size);}
122
+ // Icon's vertical alignment in button.
123
+ .w-button &, .w-button &:before {line-height: inherit;}
124
124
  // Always an even number to vertical align well in button.
125
125
  .w-button.size--xs & {font-size: round(0.95 * divide($base-font-size, 2)) * 2;}
126
126
  .w-alert.size--xs & {font-size: $base-font-size;}
@@ -36,6 +36,8 @@
36
36
  ref="overlay"
37
37
  :value="showMenu"
38
38
  :persistent="persistent"
39
+ :class="overlayClass || null"
40
+ v-bind="overlayProps"
39
41
  :z-index="(zIndex || 200) - 1"
40
42
  @input="showMenu = false")
41
43
  </template>
@@ -86,6 +88,8 @@ export default {
86
88
  zIndex: { type: [Number, String, Boolean] },
87
89
  minWidth: { type: [Number, String] }, // can be like: `40`, `5em`, `activator`.
88
90
  overlay: { type: Boolean },
91
+ overlayClass: { type: String },
92
+ overlayProps: { type: Object }, // Allow passing down an object of props to the w-overlay component.
89
93
  persistent: { type: Boolean },
90
94
  noPosition: { type: Boolean }
91
95
  },
@@ -27,6 +27,7 @@ component(
27
27
  label.w-switch__label.w-form-el-shakable(v-else-if="label" :for="`w-switch--${_uid}`" v-html="label")
28
28
  .w-switch__input(
29
29
  @click="$refs.input.focus();$refs.input.click()"
30
+ v-on="$listeners"
30
31
  :class="inputClasses")
31
32
  template(v-if="hasLabel && !labelOnLeft")
32
33
  label.w-switch__label.w-form-el-shakable(v-if="$slots.default" :for="`w-switch--${_uid}`")
@@ -15,7 +15,7 @@
15
15
  th.w-table__header(
16
16
  v-for="(header, i) in headers"
17
17
  :key="i"
18
- @click="header.sortable !== false && sortTable(header)"
18
+ @click="!colResizing.dragging && header.sortable !== false && sortTable(header)"
19
19
  :class="headerClasses(header)")
20
20
  w-icon.w-table__header-sort(
21
21
  v-if="header.sortable !== false && header.align === 'right'"
@@ -122,6 +122,9 @@
122
122
 
123
123
  import { consoleError } from '../utils/console'
124
124
 
125
+ // When column resizing is on, this is the minimum cell width that we can resize to.
126
+ const minColumnWidth = 15
127
+
125
128
  export default {
126
129
  name: 'w-table',
127
130
  props: {
@@ -404,15 +407,17 @@ export default {
404
407
  columnEl.style.width = colWidth + deltaX + 'px'
405
408
  nextColumnEl.style.width = nextColWidth - deltaX + 'px'
406
409
 
407
- // 2. Check if we went too far (the width applyed is different than the browser-computed one).
408
- const minWidthReached = deltaX < 0 && columnEl.offsetWidth > newColWidth
410
+ // 2. Check if we went too far (the width applied is different than the browser-computed one).
411
+ const minWidthReached = (deltaX < 0 && columnEl.offsetWidth > newColWidth) ||
412
+ columnEl.offsetWidth <= minColumnWidth
409
413
  const maxWidthReached = deltaX > 0 && nextColumnEl.offsetWidth > newNextColWidth
410
414
 
411
415
  // 3. If we went too far, correct the value of both cells widths.
412
416
  // Make sure we don't shrink enough to push other left cells.
413
417
  if (minWidthReached) {
414
- columnEl.style.width = columnEl.offsetWidth + 'px'
415
- nextColumnEl.style.width = maxWidth - columnEl.offsetWidth + 'px'
418
+ const newWidth = Math.max(columnEl.offsetWidth, minColumnWidth)
419
+ columnEl.style.width = newWidth + 'px'
420
+ nextColumnEl.style.width = maxWidth - newWidth + 'px'
416
421
  }
417
422
  // Make sure we don't grow enough to push other right cells.
418
423
  else if (maxWidthReached) {
@@ -421,19 +426,24 @@ export default {
421
426
  }
422
427
  },
423
428
 
424
- onResizerMouseUp (e) {
429
+ onResizerMouseUp () {
425
430
  // Remove listeners.
426
431
  document.removeEventListener('mousemove', this.onResizerMouseMove)
427
432
  document.removeEventListener('mouseup', this.onResizerMouseUp)
428
433
 
429
434
  // Reset all the variables (better for debugging).
430
- this.colResizing.dragging = false
431
- this.colResizing.columnIndex = null
432
- this.colResizing.startCursorX = null
433
- this.colResizing.columnEl = null
434
- this.colResizing.nextColumnEl = null
435
- this.colResizing.colWidth = null
436
- this.colResizing.nextColWidth = null
435
+ // setTimeout 0 to make sure the sorting is not applied when releasing the mouse on a header
436
+ // cell after resizing.
437
+ // (releasing the mouse on table header triggers a click event captured by the sorting feature)
438
+ setTimeout(() => {
439
+ this.colResizing.dragging = false
440
+ this.colResizing.columnIndex = null
441
+ this.colResizing.startCursorX = null
442
+ this.colResizing.columnEl = null
443
+ this.colResizing.nextColumnEl = null
444
+ this.colResizing.colWidth = null
445
+ this.colResizing.nextColWidth = null
446
+ }, 0)
437
447
  }
438
448
  },
439
449
 
@@ -490,6 +500,10 @@ $tr-border-top: 1px;
490
500
  border-collapse: collapse;
491
501
  border: none;
492
502
 
503
+ &--resizable-cols {
504
+ table-layout: fixed; // Allow resizing beyond the cell minimum text width.
505
+ }
506
+
493
507
  &--resizing {
494
508
  &, * {cursor: col-resize;}
495
509
 
@@ -498,8 +512,11 @@ $tr-border-top: 1px;
498
512
 
499
513
  // Table headers.
500
514
  // ------------------------------------------------------
501
- &__header {
502
- padding: $base-increment;
515
+ &__header {padding: $base-increment;}
516
+ &__header--resizable {
517
+ overflow: hidden;
518
+ white-space: nowrap;
519
+ text-overflow: ellipsis;
503
520
  }
504
521
 
505
522
  &--fixed-header th {
@@ -596,7 +613,15 @@ $tr-border-top: 1px;
596
613
  &__header:first-child, &__cell:first-child {padding-left: 2 * $base-increment;}
597
614
  &__header:last-child, &__cell:last-child {padding-right: 2 * $base-increment;}
598
615
 
599
- &--resizable-cols &__cell {position: relative;}
616
+ &--resizable-cols &__cell {
617
+ position: relative;
618
+
619
+ &, & * {
620
+ overflow: hidden;
621
+ // white-space: nowrap; // If you only want the content cell on a single line.
622
+ text-overflow: ellipsis;
623
+ }
624
+ }
600
625
 
601
626
  .no-data &__cell {
602
627
  background-color: rgba(255, 255, 255, 0.2);
@@ -61,6 +61,12 @@
61
61
  @for $i from 1 through 6 {
62
62
  .bd#{$i} {border: $i + px solid $border-color;}
63
63
  }
64
+ .bdx1 {border-left: 1px solid $border-color;border-right: 1px solid $border-color;}
65
+ .bdy1 {border-top: 1px solid $border-color;border-bottom: 1px solid $border-color;}
66
+ .bdl1 {border-left: 1px solid $border-color;}
67
+ .bdr1 {border-right: 1px solid $border-color;}
68
+ .bdt1 {border-top: 1px solid $border-color;}
69
+ .bdb1 {border-bottom: 1px solid $border-color;}
64
70
  .bd0 {border: none;}
65
71
 
66
72
  @for $i from 1 through 6 {
@@ -142,11 +142,11 @@ $fast-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1);
142
142
 
143
143
  // Twist.
144
144
  // --------------------------------------------------------
145
- .twist-enter-active {animation: w-twist $transition-duration;}
146
- .twist-leave-active {animation: w-twist $transition-duration reverse;}
145
+ .twist-enter-active {animation: w-twist ($transition-duration + 0.25s);}
146
+ .twist-leave-active {animation: w-twist ($transition-duration + 0.25s) reverse;}
147
147
  @keyframes w-twist {
148
- 0% {transform: scale(0) rotate(-30deg);}
149
- 60% {transform: scale(1.03) rotate(5deg);}
148
+ 0% {transform: scale(0) rotate(-70deg);}
149
+ 60% {transform: scale(1.03) rotate(6deg);}
150
150
  100% {transform: scale(1) rotate(0deg);}
151
151
  }
152
152
  // --------------------------------------------------------
@@ -17,7 +17,7 @@ $layout-padding: $base-increment * 4 !default; // Applied on the .content-wrap t
17
17
  $border-radius: 3px !default;
18
18
  $border-color: rgba(0, 0, 0, 0.15);
19
19
  $border: 1px solid $border-color !default;
20
- $transition-duration: 0.2s !default;
20
+ $transition-duration: 0.25s !default;
21
21
  $fast-transition-duration: 0.15s !default;
22
22
  $box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2),
23
23
  0 2px 2px 0 rgba(0, 0, 0, 0.15),