webcake-ui-kit 1.3.8 → 1.3.10

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": "webcake-ui-kit",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
4
4
  "description": "UI Kit for Vue 2 && 3 - Pure Options API",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -69,14 +69,11 @@ function open(config) {
69
69
  const vm = ensureContainer()
70
70
  if (!vm) return function () {}
71
71
 
72
- // Per-call placement/offset override (applied before add so the container
73
- // is positioned correctly when the message enters).
74
- if (config.placement != null || config.offset != null) {
75
- vm.configure({
76
- placement: config.placement,
77
- offset: config.offset
78
- })
79
- }
72
+ // Always resolve placement/offset — per-call value wins, falls back to globalConfig.
73
+ vm.configure({
74
+ placement: config.placement != null ? config.placement : globalConfig.placement,
75
+ offset: config.offset != null ? config.offset : globalConfig.offset
76
+ })
80
77
 
81
78
  const type = config.type || 'info'
82
79
  const duration = config.duration !== undefined ? config.duration : type === 'loading' ? 0 : globalConfig.duration
@@ -97,6 +97,7 @@
97
97
  :key="opt.value"
98
98
  :value="opt.value"
99
99
  :label="opt.label"
100
+ :mark-label="opt.markLabel"
100
101
  :disabled="opt.disabled"
101
102
  :children="opt.children"
102
103
  :placement="opt.placement"
@@ -265,9 +266,10 @@ export default {
265
266
  var base = this.mode === 'tags' ? this.options.concat(this.tagOptions) : this.options
266
267
  return base.map(function (opt) {
267
268
  return typeof opt === 'string'
268
- ? { label: opt, value: opt, disabled: false, children: [], placement: 'right-start' }
269
+ ? { label: opt, value: opt, markLabel: opt, disabled: false, children: [], placement: 'right-start' }
269
270
  : {
270
271
  label: opt.label || opt.value,
272
+ markLabel: opt.markLabel || opt.label || opt.value,
271
273
  value: opt.value,
272
274
  disabled: !!opt.disabled,
273
275
  children: opt.children || [],
@@ -290,7 +292,6 @@ export default {
290
292
  selectedLabel() {
291
293
  if (this.isMultiMode) return ''
292
294
  if (!this.effectiveValue) return ''
293
- if (this.labelCache[this.effectiveValue]) return this.labelCache[this.effectiveValue]
294
295
  const findOpt = (opts, val) => {
295
296
  for (let i = 0; i < opts.length; i++) {
296
297
  if (opts[i].value === val) return opts[i]
@@ -302,7 +303,8 @@ export default {
302
303
  return null
303
304
  }
304
305
  const opt = findOpt(this.normalizedOptions, this.effectiveValue)
305
- if (opt) return opt.label
306
+ if (opt) return opt.markLabel || opt.label
307
+ if (this.labelCache[this.effectiveValue]) return this.labelCache[this.effectiveValue]
306
308
  return this._findLabelInSlot(this.effectiveValue) || this.effectiveValue
307
309
  },
308
310
  selectedItems() {
@@ -41,6 +41,7 @@
41
41
  :key="opt.value"
42
42
  :value="opt.value"
43
43
  :label="opt.label"
44
+ :mark-label="opt.markLabel"
44
45
  :disabled="opt.disabled"
45
46
  :children="opt.children"
46
47
  :placement="opt.placement"
@@ -78,6 +79,10 @@ export default {
78
79
  type: String,
79
80
  default: ''
80
81
  },
82
+ markLabel: {
83
+ type: String,
84
+ default: ''
85
+ },
81
86
  disabled: {
82
87
  type: Boolean,
83
88
  default: false
@@ -198,6 +203,10 @@ export default {
198
203
  },
199
204
  _registerLabel() {
200
205
  if (!this.select) return
206
+ if (this.markLabel) {
207
+ this.select.registerOption(this.value, this.markLabel)
208
+ return
209
+ }
201
210
  var labelEl = this.$el && this.$el.querySelector('.ui-select-option--label')
202
211
  var slotText = labelEl ? labelEl.textContent.trim() : ''
203
212
  var labelText = slotText || this.label || String(this.value)