vueless 0.0.376 → 0.0.377
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 +1 -1
- package/ui.data-list/UDataList.vue +10 -5
- package/ui.data-list/useAttrs.js +4 -37
- package/ui.image-avatar/useAttrs.js +3 -26
- package/ui.image-icon/useAttrs.js +3 -26
- package/web-types.json +4 -1
package/package.json
CHANGED
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
/>
|
|
40
40
|
</slot>
|
|
41
41
|
|
|
42
|
-
<div v-bind="
|
|
42
|
+
<div v-bind="isActive(element) ? labelAttrs : labelCrossedAttrs">
|
|
43
43
|
<!--
|
|
44
44
|
@slot Use it to modify label.
|
|
45
45
|
@binding {object} item
|
|
46
46
|
-->
|
|
47
|
-
<slot name="label" :item="element">
|
|
47
|
+
<slot name="label" :item="element" :active="isActive(element)">
|
|
48
48
|
{{ element[labelKey] }}
|
|
49
49
|
</slot>
|
|
50
50
|
</div>
|
|
@@ -113,9 +113,9 @@
|
|
|
113
113
|
@click-edit="onClickEdit"
|
|
114
114
|
@drag-sort="onDragEnd"
|
|
115
115
|
>
|
|
116
|
-
<template #label="{ item }">
|
|
117
|
-
<slot name="label" :item="item">
|
|
118
|
-
<div v-bind="labelAttrs" v-text="item[labelKey]" />
|
|
116
|
+
<template #label="{ item, active }">
|
|
117
|
+
<slot name="label" :item="item" :active="active">
|
|
118
|
+
<div v-bind="active ? labelCrossedAttrs : labelAttrs" v-text="item[labelKey]" />
|
|
119
119
|
</slot>
|
|
120
120
|
</template>
|
|
121
121
|
|
|
@@ -290,6 +290,7 @@ const {
|
|
|
290
290
|
itemWrapperAttrs,
|
|
291
291
|
itemAttrs,
|
|
292
292
|
labelAttrs,
|
|
293
|
+
labelCrossedAttrs,
|
|
293
294
|
customActionsAttrs,
|
|
294
295
|
deleteIconAttrs,
|
|
295
296
|
editIconAttrs,
|
|
@@ -311,6 +312,10 @@ const iconSize = computed(() => {
|
|
|
311
312
|
return sizes[props.size];
|
|
312
313
|
});
|
|
313
314
|
|
|
315
|
+
function isActive(element) {
|
|
316
|
+
return element.isActive === undefined || element.isActive;
|
|
317
|
+
}
|
|
318
|
+
|
|
314
319
|
function onDragMove(event) {
|
|
315
320
|
const isDisabledNestingItem = event.draggedContext.element.isDisabledNesting;
|
|
316
321
|
const isNestingAction = !event.relatedContext.element?.isDisabledNesting;
|
package/ui.data-list/useAttrs.js
CHANGED
|
@@ -1,48 +1,15 @@
|
|
|
1
1
|
import useUI from "../composables/useUI.js";
|
|
2
|
+
|
|
2
3
|
import defaultConfig from "./config.js";
|
|
3
|
-
import { computed } from "vue";
|
|
4
|
-
import { cva, cx } from "../utils/utilUI.js";
|
|
5
4
|
|
|
6
5
|
export default function useAttrs(props) {
|
|
7
|
-
const { config,
|
|
8
|
-
defaultConfig,
|
|
9
|
-
() => props.config,
|
|
10
|
-
);
|
|
11
|
-
const attrs = {};
|
|
12
|
-
|
|
13
|
-
for (const key in defaultConfig) {
|
|
14
|
-
if (isSystemKey(key)) continue;
|
|
15
|
-
|
|
16
|
-
const classes = computed(() => {
|
|
17
|
-
let value = config.value[key];
|
|
18
|
-
|
|
19
|
-
if (isCVA(value)) {
|
|
20
|
-
value = cva(value)({
|
|
21
|
-
...props,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return value;
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
29
|
-
|
|
30
|
-
if (key === "label") {
|
|
31
|
-
const labelAttrs = attrs[`${key}Attrs`];
|
|
6
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
32
7
|
|
|
33
|
-
|
|
34
|
-
...labelAttrs,
|
|
35
|
-
class: cx([
|
|
36
|
-
labelAttrs.value.class,
|
|
37
|
-
isActive !== undefined && !isActive ? config.value.labelCrossed : "",
|
|
38
|
-
]),
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
8
|
+
const keysAttrs = getKeysAttrs();
|
|
42
9
|
|
|
43
10
|
return {
|
|
44
|
-
...attrs,
|
|
45
11
|
config,
|
|
12
|
+
...keysAttrs,
|
|
46
13
|
hasSlotContent,
|
|
47
14
|
};
|
|
48
15
|
}
|
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
import useUI from "../composables/useUI.js";
|
|
2
|
-
import { cva } from "../utils/utilUI.js";
|
|
3
2
|
|
|
4
3
|
import defaultConfig from "./config.js";
|
|
5
|
-
import { computed } from "vue";
|
|
6
4
|
|
|
7
5
|
export default function useAttrs(props) {
|
|
8
|
-
const { config,
|
|
9
|
-
defaultConfig,
|
|
10
|
-
() => props.config,
|
|
11
|
-
);
|
|
12
|
-
const attrs = {};
|
|
6
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
if (isSystemKey(key)) continue;
|
|
16
|
-
|
|
17
|
-
const classes = computed(() => {
|
|
18
|
-
let value = config.value[key];
|
|
19
|
-
|
|
20
|
-
if (isCVA(value)) {
|
|
21
|
-
value = cva(value)({
|
|
22
|
-
...props,
|
|
23
|
-
color: getColor(props.color),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return setColor(value, props.color);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
31
|
-
}
|
|
8
|
+
const keysAttrs = getKeysAttrs();
|
|
32
9
|
|
|
33
10
|
return {
|
|
34
|
-
...attrs,
|
|
35
11
|
config,
|
|
12
|
+
...keysAttrs,
|
|
36
13
|
hasSlotContent,
|
|
37
14
|
};
|
|
38
15
|
}
|
|
@@ -1,38 +1,15 @@
|
|
|
1
1
|
import useUI from "../composables/useUI.js";
|
|
2
|
-
import { cva } from "../utils/utilUI.js";
|
|
3
2
|
|
|
4
3
|
import defaultConfig from "./config.js";
|
|
5
|
-
import { computed } from "vue";
|
|
6
4
|
|
|
7
5
|
export default function useAttrs(props) {
|
|
8
|
-
const { config,
|
|
9
|
-
defaultConfig,
|
|
10
|
-
() => props.config,
|
|
11
|
-
);
|
|
12
|
-
const attrs = {};
|
|
6
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
if (isSystemKey(key)) continue;
|
|
16
|
-
|
|
17
|
-
const classes = computed(() => {
|
|
18
|
-
let value = config.value[key];
|
|
19
|
-
|
|
20
|
-
if (isCVA(value)) {
|
|
21
|
-
value = cva(value)({
|
|
22
|
-
...props,
|
|
23
|
-
color: getColor(props.color),
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
return setColor(value, props.color);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
attrs[`${key}Attrs`] = getAttrs(key, { classes });
|
|
31
|
-
}
|
|
8
|
+
const keysAttrs = getKeysAttrs();
|
|
32
9
|
|
|
33
10
|
return {
|
|
34
|
-
...attrs,
|
|
35
11
|
config,
|
|
12
|
+
...keysAttrs,
|
|
36
13
|
hasSlotContent,
|
|
37
14
|
};
|
|
38
15
|
}
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"framework": "vue",
|
|
3
3
|
"name": "vueless",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.377",
|
|
5
5
|
"contributions": {
|
|
6
6
|
"html": {
|
|
7
7
|
"description-markup": "markdown",
|
|
@@ -2252,6 +2252,9 @@
|
|
|
2252
2252
|
"bindings": [
|
|
2253
2253
|
{
|
|
2254
2254
|
"name": "item"
|
|
2255
|
+
},
|
|
2256
|
+
{
|
|
2257
|
+
"name": "active"
|
|
2255
2258
|
}
|
|
2256
2259
|
]
|
|
2257
2260
|
},
|