webcake-ui-kit 1.1.20 → 1.1.22
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
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
height: 28px;
|
|
138
138
|
padding: var(--spacing-2xs) var(--spacing-6);
|
|
139
139
|
gap: var(--spacing-2xs);
|
|
140
|
-
border-radius: var(--
|
|
140
|
+
border-radius: var(--radius);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
.ui-select--xs .ui-select__left {
|
|
@@ -204,7 +204,6 @@
|
|
|
204
204
|
margin: 0;
|
|
205
205
|
min-width: 60px;
|
|
206
206
|
flex: 1;
|
|
207
|
-
font-size: 12px;
|
|
208
207
|
}
|
|
209
208
|
|
|
210
209
|
.ui-select__search::placeholder {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<span class="ui-select-option--label">
|
|
17
17
|
<slot>{{ label || value }}</slot>
|
|
18
18
|
</span>
|
|
19
|
-
<WkiCheck v-if="isSelected" :size="16" color="var(--muted-fg)" />
|
|
19
|
+
<WkiCheck v-if="isSelected && isMultiMode" :size="16" color="var(--muted-fg)" />
|
|
20
20
|
</div>
|
|
21
21
|
</template>
|
|
22
22
|
|
|
@@ -103,6 +103,9 @@ export default {
|
|
|
103
103
|
},
|
|
104
104
|
isDisabled() {
|
|
105
105
|
return this.disabled || !!(this.select && this.select.disabled)
|
|
106
|
+
},
|
|
107
|
+
isMultiMode() {
|
|
108
|
+
return !!(this.select && this.select.isMultiMode)
|
|
106
109
|
}
|
|
107
110
|
},
|
|
108
111
|
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
@click="onHeaderClick(col)"
|
|
36
36
|
@keydown.enter.prevent="onHeaderClick(col)"
|
|
37
37
|
@keydown.space.prevent="onHeaderClick(col)"
|
|
38
|
-
v-bind="
|
|
38
|
+
v-bind="customHeaderAttrs(col, i)"
|
|
39
|
+
v-on="customHeaderListeners(col, i)"
|
|
39
40
|
>
|
|
40
41
|
<span class="ui-table__th-inner">
|
|
41
42
|
<slot name="headerCell" :column="col">{{ col.title }}</slot>
|
|
@@ -80,7 +81,8 @@
|
|
|
80
81
|
isSelected(record, rowIndex(i)) && 'ui-table__row--selected'
|
|
81
82
|
]"
|
|
82
83
|
:style="{ height: toCssSize(rowHeight) }"
|
|
83
|
-
v-bind="
|
|
84
|
+
v-bind="customRowAttrs(record, rowIndex(i))"
|
|
85
|
+
v-on="customRowListeners(record, rowIndex(i))"
|
|
84
86
|
@click="hasSelection ? onRowClick(record, rowIndex(i), $event) : undefined"
|
|
85
87
|
>
|
|
86
88
|
<td
|
|
@@ -277,6 +279,38 @@ export default {
|
|
|
277
279
|
this.teardown()
|
|
278
280
|
},
|
|
279
281
|
methods: {
|
|
282
|
+
// Split a customRow/customHeader result into plain attributes and event listeners.
|
|
283
|
+
// The public API mirrors ant-design-vue's `onClick`/`onDblclick`/... convention, which
|
|
284
|
+
// Vue 3 auto-resolves to listeners when spread via v-bind — but Vue 2 would bind them as
|
|
285
|
+
// raw DOM attributes. So we strip the `onXxx` keys into a v-on map (event name lower-cased)
|
|
286
|
+
// and leave the rest for v-bind, which works identically on both runtimes.
|
|
287
|
+
splitBindings(raw) {
|
|
288
|
+
const attrs = {}
|
|
289
|
+
const on = {}
|
|
290
|
+
if (raw) {
|
|
291
|
+
Object.keys(raw).forEach(key => {
|
|
292
|
+
const match = /^on([A-Z].*)$/.exec(key)
|
|
293
|
+
if (match) {
|
|
294
|
+
on[match[1].charAt(0).toLowerCase() + match[1].slice(1)] = raw[key]
|
|
295
|
+
} else {
|
|
296
|
+
attrs[key] = raw[key]
|
|
297
|
+
}
|
|
298
|
+
})
|
|
299
|
+
}
|
|
300
|
+
return { attrs, on }
|
|
301
|
+
},
|
|
302
|
+
customRowAttrs(record, index) {
|
|
303
|
+
return this.customRow ? this.splitBindings(this.customRow(record, index)).attrs : {}
|
|
304
|
+
},
|
|
305
|
+
customRowListeners(record, index) {
|
|
306
|
+
return this.customRow ? this.splitBindings(this.customRow(record, index)).on : {}
|
|
307
|
+
},
|
|
308
|
+
customHeaderAttrs(col, index) {
|
|
309
|
+
return this.customHeader ? this.splitBindings(this.customHeader(col, index)).attrs : {}
|
|
310
|
+
},
|
|
311
|
+
customHeaderListeners(col, index) {
|
|
312
|
+
return this.customHeader ? this.splitBindings(this.customHeader(col, index)).on : {}
|
|
313
|
+
},
|
|
280
314
|
teardown() {
|
|
281
315
|
window.removeEventListener('resize', this.onResize)
|
|
282
316
|
if (this.rafId != null) {
|