webcake-ui-kit 1.2.17 → 1.2.18

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.2.17",
3
+ "version": "1.2.18",
4
4
  "description": "UI Kit for Vue 2 && 3 - Pure Options API",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -18,7 +18,7 @@
18
18
  <span
19
19
  :ref="triggerRef"
20
20
  class="ui-dropdown__anchor"
21
- @click.stop="triggerHasClick && handleClick()"
21
+ @click.stop="triggerHasClick && handleClick($event)"
22
22
  @mouseenter.stop="triggerHasHover && handleMouseEnter()"
23
23
  @mouseleave.stop="triggerHasHover && handleMouseLeave()"
24
24
  >
@@ -136,8 +136,10 @@ export default {
136
136
  this.$emit('change', v)
137
137
  this.$emit('update:modelValue', v)
138
138
  },
139
- handleClick() {
139
+ handleClick(e) {
140
140
  if (this.disabled) return
141
+ // Don't close when clicking a focusable element inside the trigger (e.g. input, textarea)
142
+ if (this.isOpen && e && e.target && e.target.closest('input, textarea, select, [contenteditable]')) return
141
143
  this.onMenuChange(!this.isOpen)
142
144
  },
143
145
  handleMouseEnter() {
@@ -90,6 +90,7 @@
90
90
 
91
91
  .ui-input-number--disabled {
92
92
  opacity: 0.5;
93
+ background: var(--secondary-bg);
93
94
  }
94
95
 
95
96
  .ui-input-number--disabled:focus-within {
@@ -198,7 +198,12 @@ export default {
198
198
  this._kmSetFloatEl(float)
199
199
  this._pmAttach(this._triggerEl, float)
200
200
  this._coAttach()
201
- if (this.autoFocus) this._fmFocus(float)
201
+ if (this.autoFocus) {
202
+ // Don't steal focus when the trigger itself already holds it (e.g. an input inside the anchor)
203
+ const active = typeof document !== 'undefined' && document.activeElement
204
+ const triggerHasFocus = active && this._triggerEl && this._triggerEl.contains(active)
205
+ if (!triggerHasFocus) this._fmFocus(float)
206
+ }
202
207
  })
203
208
  },
204
209
  handleClose() {
@@ -10,6 +10,7 @@
10
10
  @close="onMenuClose"
11
11
  :overlay-class-name="overlayClassName"
12
12
  :overlay-style="overlayStyle"
13
+ :width="overlayWidth"
13
14
  >
14
15
  <template #trigger="{ toggle, isOpen: open, attrs, triggerRef }">
15
16
  <div
@@ -218,7 +219,8 @@ export default {
218
219
  },
219
220
  overlayClassName: { type: [String, Array, Object], default: null },
220
221
  overlayStyle: { type: [Object, Array], default: null },
221
- dropdownMatchSelectWidth: { type: Boolean, default: true }
222
+ dropdownMatchSelectWidth: { type: Boolean, default: true },
223
+ overlayWidth: { type: [String, Number], default: null }
222
224
  },
223
225
 
224
226
  emits: ['change', 'update:modelValue'],
@@ -158,8 +158,9 @@ export default {
158
158
 
159
159
  var style = {
160
160
  overflowY: 'auto',
161
+ overflowX: 'hidden',
161
162
  maxHeight: `calc(${this.toCssSize(this.scroll.y)} - ${deduct})`,
162
- minHeight: this.minHeight > 0 ? `calc(${this.toCssSize(this.minHeight)} - ${deduct})` : undefined
163
+ minHeight: this.minHeight ? `calc(${this.toCssSize(this.minHeight)} - ${deduct})` : undefined
163
164
  }
164
165
  if (this.hasScrollX) {
165
166
  style.overflowX = 'auto'
@@ -68,7 +68,7 @@ export default {
68
68
  return String(this.currentValue).length
69
69
  },
70
70
  showCounter() {
71
- return this.showCount
71
+ return this.showCount || this.maxLength !== undefined
72
72
  }
73
73
  },
74
74
  watch: {
@@ -184,22 +184,22 @@
184
184
  padding: var(--spacing-3xs);
185
185
  }
186
186
  .ui-toggle--icon-only.ui-toggle--xs {
187
- min-width: 28px;
187
+ width: 28px;
188
188
  height: 28px;
189
189
  padding: var(--spacing-6) var(--spacing-6) var(--spacing-6) var(--spacing-xs);
190
190
  }
191
191
  .ui-toggle--icon-only.ui-toggle--sm {
192
- min-width: 32px;
192
+ width: 32px;
193
193
  height: 32px;
194
194
  padding: var(--spacing-6);
195
195
  }
196
196
  .ui-toggle--icon-only.ui-toggle--md {
197
- min-width: 36px;
197
+ width: 36px;
198
198
  height: 36px;
199
199
  padding: var(--spacing-xs);
200
200
  }
201
201
  .ui-toggle--icon-only.ui-toggle--lg {
202
- min-width: 40px;
202
+ width: 40px;
203
203
  height: 40px;
204
204
  padding: var(--spacing-10);
205
205
  }
@@ -0,0 +1,32 @@
1
+ <template>
2
+ <BaseIcon v-bind="$attrs" v-on="listeners">
3
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none">
4
+ <path
5
+ d="M11.625 2.125C12.1082 2.125 12.5 2.51675 12.5 3C12.5 3.48325 12.1082 3.875 11.625 3.875H5C4.37868 3.875 3.875 4.37868 3.875 5V19C3.875 19.6213 4.37868 20.125 5 20.125H19C19.6213 20.125 20.125 19.6213 20.125 19V11.875C20.125 11.3918 20.5168 11 21 11C21.4832 11 21.875 11.3918 21.875 11.875V19C21.875 20.5878 20.5878 21.875 19 21.875H5C3.41218 21.875 2.125 20.5878 2.125 19V5C2.125 3.41218 3.41218 2.125 5 2.125H11.625Z"
6
+ fill="currentColor"
7
+ />
8
+ <path
9
+ fill-rule="evenodd"
10
+ clip-rule="evenodd"
11
+ d="M17.875 2.125C20.0151 2.125 21.75 3.8599 21.75 6C21.75 8.1401 20.0151 9.875 17.875 9.875C15.7349 9.875 14 8.1401 14 6C14 3.8599 15.7349 2.125 17.875 2.125ZM17.875 3.875C16.7014 3.875 15.75 4.8264 15.75 6C15.75 6.45107 15.8912 6.86887 16.1309 7.21289C16.1531 7.24478 16.1773 7.27508 16.2012 7.30566C16.3675 7.51859 16.573 7.6982 16.8076 7.83496C16.8234 7.84415 16.8385 7.85449 16.8545 7.86328C17.1575 8.02958 17.505 8.125 17.875 8.125C19.0486 8.125 20 7.1736 20 6C20 4.8264 19.0486 3.875 17.875 3.875Z"
12
+ fill="currentColor"
13
+ />
14
+ </svg>
15
+ </BaseIcon>
16
+ </template>
17
+
18
+ <script>
19
+ import BaseIcon from './BaseIcon.vue'
20
+
21
+ export default {
22
+ name: 'Popup',
23
+ components: { BaseIcon },
24
+ inheritAttrs: false,
25
+ emits: [],
26
+ computed: {
27
+ listeners() {
28
+ return this.$listeners || {}
29
+ }
30
+ }
31
+ }
32
+ </script>
@@ -1774,5 +1774,6 @@ export { default as WkiSkewWidth } from './SkewWidth.vue'
1774
1774
  export { default as WkiStrokeLine } from './StrokeLine.vue'
1775
1775
  export { default as WkiTopline } from './Topline.vue'
1776
1776
  export { default as WkiLettersSpacing } from './LettersSpacing.vue'
1777
+ export { default as WkiPopup } from './Popup.vue'
1777
1778
 
1778
1779
  // --- AUTO-GENERATED LUCIDE EXPORTS END ---