wave-ui 3.16.2 → 3.16.3

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.16.2",
3
+ "version": "3.16.3",
4
4
  "description": "A UI framework for Vue.js 3 (and 2) with only the bright side. :sunny:",
5
5
  "author": "Antoni Andre <antoniandre.web@gmail.com>",
6
6
  "homepage": "https://antoniandre.github.io/wave-ui",
@@ -42,15 +42,6 @@
42
42
  "vue framework",
43
43
  "ui"
44
44
  ],
45
- "scripts": {
46
- "dev": "vite",
47
- "build": "vite build --base /wave-ui/",
48
- "build-types": "tsc -p ./tsconfig.json",
49
- "build-bundle": "BUNDLE=true vite build && npm run build-types && mv ./dist/style.css ./dist/wave-ui.css",
50
- "preview": "vite preview --base /wave-ui/",
51
- "lint": "vite lint",
52
- "publish-doc": "npm run build && npm run build-bundle && git add . && git commit -m 'Publish documentation on Github.' && git push && git push --tag"
53
- },
54
45
  "devDependencies": {
55
46
  "@eslint/js": "^9.10.0",
56
47
  "@faker-js/faker": "^8.4.1",
@@ -89,5 +80,14 @@
89
80
  },
90
81
  "peerDependencies": {
91
82
  "vue": "^3.2.0"
83
+ },
84
+ "scripts": {
85
+ "dev": "vite",
86
+ "build": "vite build --base /wave-ui/",
87
+ "build-types": "tsc -p ./tsconfig.json",
88
+ "build-bundle": "BUNDLE=true vite build && npm run build-types && mv ./dist/style.css ./dist/wave-ui.css",
89
+ "preview": "vite preview --base /wave-ui/",
90
+ "lint": "vite lint",
91
+ "publish-doc": "npm run build && npm run build-bundle && git add . && git commit -m 'Publish documentation on Github.' && git push && git push --tag"
92
92
  }
93
- }
93
+ }
@@ -10,7 +10,7 @@
10
10
  @focus="$emit('focus', getOriginalItem(item))"
11
11
  @keypress.enter="!item._disabled && toggleItem(item, $event)"
12
12
  :tabindex="!item._disabled && 0"
13
- :class="titleClass")
13
+ :class="titleClasses")
14
14
  //- Expand icon on left.
15
15
  w-button.w-accordion__expand-icon(
16
16
  v-if="expandIcon && !expandIconRight"
@@ -45,7 +45,7 @@
45
45
  :duration="duration")
46
46
  .w-accordion__item-content(
47
47
  v-if="item._expanded"
48
- :class="contentClass")
48
+ :class="contentClasses")
49
49
  slot(
50
50
  v-if="$slots[`item-content.${item.id || i + 1}`]"
51
51
  :name="`item-content.${item.id || i + 1}`"
@@ -62,6 +62,8 @@
62
62
  </template>
63
63
 
64
64
  <script>
65
+ import { objectifyClasses } from '../utils/index'
66
+
65
67
  export default {
66
68
  name: 'w-accordion',
67
69
 
@@ -73,9 +75,9 @@ export default {
73
75
  itemColorKey: { type: String, default: 'color' }, // Support a different color per item.
74
76
  itemTitleKey: { type: String, default: 'title' },
75
77
  itemContentKey: { type: String, default: 'content' },
76
- itemClass: { type: String },
77
- titleClass: { type: String },
78
- contentClass: { type: String },
78
+ itemClass: { type: [String, Array, Object] },
79
+ titleClass: { type: [String, Array, Object] },
80
+ contentClass: { type: [String, Array, Object] },
79
81
  expandIcon: { type: [String, Boolean], default: 'wi-triangle-down' },
80
82
  expandIconRight: { type: Boolean },
81
83
  expandIconRotate90: { type: Boolean },
@@ -106,6 +108,14 @@ export default {
106
108
  'w-accordion--icon-right': this.expandIcon && this.expandIconRight,
107
109
  'w-accordion--rotate-icon': this.expandIcon && !this.collapseIcon
108
110
  }
111
+ },
112
+
113
+ titleClasses () {
114
+ return objectifyClasses(this.titleClass)
115
+ },
116
+
117
+ contentClasses () {
118
+ return objectifyClasses(this.contentClass)
109
119
  }
110
120
  },
111
121
 
@@ -133,10 +143,10 @@ export default {
133
143
  },
134
144
  itemClasses (item) {
135
145
  return {
136
- [this.itemClass]: this.itemClass || null,
137
146
  'w-accordion__item--expanded': item._expanded,
138
147
  'w-accordion__item--disabled': item._disabled,
139
- [item[this.itemColorKey]]: item[this.itemColorKey]
148
+ [item[this.itemColorKey]]: item[this.itemColorKey],
149
+ ...objectifyClasses(this.itemClass)
140
150
  }
141
151
  },
142
152
  updateItems () {
@@ -35,7 +35,7 @@
35
35
  :key="tab._uid"
36
36
  :item="tab"
37
37
  v-show="tab._uid === activeTab._uid"
38
- :class="contentClass")
38
+ :class="contentClasses")
39
39
  slot(
40
40
  v-if="$slots[`item-content.${tab._index + 1}`]"
41
41
  :name="`item-content.${tab._index + 1}`"
@@ -71,6 +71,7 @@
71
71
  </template>
72
72
 
73
73
  <script>
74
+ import { objectifyClasses } from '../../utils/index'
74
75
  import TabContent from './tab-content.vue'
75
76
 
76
77
  let uid = 0
@@ -86,12 +87,12 @@ export default {
86
87
  itemIdKey: { type: String, default: 'id' },
87
88
  itemTitleKey: { type: String, default: 'title' },
88
89
  itemContentKey: { type: String, default: 'content' },
89
- titleClass: { type: String },
90
- activeClass: { type: String, default: 'primary' },
90
+ titleClass: { type: [String, Array, Object] },
91
+ activeClass: { type: [String, Array, Object], default: 'primary' },
91
92
  noSlider: { type: Boolean },
92
93
  pillSlider: { type: Boolean },
93
94
  sliderColor: { type: String, default: 'primary' },
94
- contentClass: { type: String },
95
+ contentClass: { type: [String, Array, Object] },
95
96
  transition: { type: [String, Boolean], default: '' },
96
97
  fillBar: { type: Boolean },
97
98
  center: { type: Boolean },
@@ -121,6 +122,10 @@ export default {
121
122
  }),
122
123
 
123
124
  computed: {
125
+ contentClasses () {
126
+ return objectifyClasses(this.contentClass)
127
+ },
128
+
124
129
  transitionName () {
125
130
  if (this.transition === false) return ''
126
131
  return this.transition || `w-tabs-slide-${this.direction}`
@@ -229,9 +234,10 @@ export default {
229
234
  return {
230
235
  [`${this.bgColor}--bg`]: this.bgColor,
231
236
  [this.color]: this.color && !item._disabled && !(this.activeClass && isActive),
232
- [`w-tabs__bar-item--active ${this.activeClass}`]: isActive,
237
+ 'w-tabs__bar-item--active': isActive,
233
238
  'w-tabs__bar-item--disabled': item._disabled,
234
- [this.titleClass]: this.titleClass
239
+ ...objectifyClasses(this.titleClass),
240
+ ...(isActive ? objectifyClasses(this.activeClass) : {})
235
241
  }
236
242
  },
237
243