wave-ui 3.5.1 → 3.5.2

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": "3.5.1",
3
+ "version": "3.5.2",
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
  "homepage": "https://antoniandre.github.io/wave-ui",
@@ -61,6 +61,7 @@ component(
61
61
  @change="onFileChange"
62
62
  :multiple="multiple || null"
63
63
  v-bind="attrs"
64
+ :disabled="isDisabled || null"
64
65
  :data-progress="overallFilesProgress /* Needed to emit the overallProgress. */")
65
66
  transition-group.w-input__input.w-input__input--file(
66
67
  tag="label"
@@ -67,7 +67,7 @@ export default {
67
67
  .w-toolbar {
68
68
  position: relative;
69
69
  display: flex;
70
- flex: 1 1 auto;
70
+ flex: 0 1 auto; // No grow, so it doesn't stretch vertically in flex column.
71
71
  align-items: center;
72
72
  padding: (2 * $base-increment) (3 * $base-increment);
73
73
  background-color: $toolbar-bg-color;
@@ -94,7 +94,6 @@ export default {
94
94
  &--vertical {
95
95
  padding: (2 * $base-increment);
96
96
  flex-direction: column;
97
- flex-grow: 0;
98
97
  flex-shrink: 0;
99
98
  }
100
99
 
@@ -1,8 +1,9 @@
1
1
  import { reactive, inject } from 'vue'
2
2
  import { mergeConfig } from './utils/config'
3
- import { injectNotifManagerInDOM, NotificationManager } from './utils/notification-manager'
3
+ import { consoleWarn } from './utils/console'
4
4
  import { colorPalette, generateColorShades, flattenColors } from './utils/colors'
5
5
  import { injectColorsCSSInDOM, injectCSSInDOM } from './utils/dynamic-css'
6
+ import { injectNotifManagerInDOM, NotificationManager } from './utils/notification-manager'
6
7
  import './scss/index.scss'
7
8
 
8
9
  let mounted = false
@@ -19,13 +20,36 @@ const detectOSDarkMode = $waveui => {
19
20
 
20
21
  /**
21
22
  * Inject presets into a Vue component props defaults before its registration into the app.
23
+ * If a preset is not found in the given component props, try to find it in its mixins, if any.
22
24
  *
25
+ * @todo remove mixins-related code when stopping support for Vue 2.
23
26
  * @param {Object} component the Vue component to inject presets into.
24
27
  * @param {Object} presets the presets to inject. E.g. `{ bgColor: 'green' }`.
25
28
  */
26
29
  const injectPresets = (component, presets) => {
27
30
  for (const preset in presets) {
28
- component.props[preset].default = presets[preset]
31
+ // If we don't have the prop output a warning and continue.
32
+ if (!component.props?.[preset]) {
33
+ let foundProp = false
34
+ // Check to see if the prop exists on a mixin when it doesn't exist on the component.
35
+ // @todo: remove this check when there is no more Vue 2 and mixins: mixins are now deprecated.
36
+ if (Array.isArray(component.mixins) && component.mixins.length) {
37
+ // Loop through the array of mixin, and if we find the prop in one, update its default value.
38
+ for (const mixin of component.mixins) {
39
+ if (mixin?.props?.[preset]) {
40
+ mixin.props[preset].default = presets[preset]
41
+ foundProp = true
42
+ break
43
+ }
44
+ }
45
+
46
+ // If the given prop (= preset) is still not found in the mixins props raise warning.
47
+ if (!foundProp) consoleWarn(`Attempting to set a preset on a prop that doesn't exist: \`${component.name}.${preset}\`.`)
48
+ continue // Continue to the next preset.
49
+ }
50
+ }
51
+
52
+ else component.props[preset].default = presets[preset]
29
53
  }
30
54
  }
31
55
 
@@ -1,4 +1,3 @@
1
- @import './variables';
2
1
  @import './base';
3
2
  @import './typography';
4
3
  @import './layout';