vueless 0.0.381 → 0.0.382
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,50 +1,28 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
1
2
|
import useUI from "../composables/useUI.js";
|
|
2
|
-
|
|
3
|
+
|
|
3
4
|
import defaultConfig from "./config.js";
|
|
4
|
-
import { computed } from "vue";
|
|
5
5
|
|
|
6
6
|
export default function useAttrs(props, { selected }) {
|
|
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];
|
|
7
|
+
const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
|
|
18
8
|
|
|
19
|
-
|
|
20
|
-
value = cva(value)({
|
|
21
|
-
...props,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
9
|
+
const keysAttrs = getKeysAttrs();
|
|
24
10
|
|
|
25
|
-
|
|
26
|
-
});
|
|
11
|
+
const { checkboxAttrs } = keysAttrs;
|
|
27
12
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
attrs[`${key}Attrs`] = computed(() => {
|
|
34
|
-
if (selected.value.icon) {
|
|
35
|
-
checkboxAttrs.value.config = checkboxAttrs.value.config || {};
|
|
36
|
-
checkboxAttrs.value.config.defaults = checkboxAttrs.value.config.defaults || {};
|
|
37
|
-
checkboxAttrs.value.config.defaults.checkedIcon = selected.value.icon;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return checkboxAttrs.value;
|
|
41
|
-
});
|
|
13
|
+
keysAttrs.checkboxAttrs = computed(() => {
|
|
14
|
+
if (selected.value.icon) {
|
|
15
|
+
checkboxAttrs.value.config = checkboxAttrs.value.config || {};
|
|
16
|
+
checkboxAttrs.value.config.defaults = checkboxAttrs.value.config.defaults || {};
|
|
17
|
+
checkboxAttrs.value.config.defaults.checkedIcon = selected.value.icon;
|
|
42
18
|
}
|
|
43
|
-
|
|
19
|
+
|
|
20
|
+
return checkboxAttrs.value;
|
|
21
|
+
});
|
|
44
22
|
|
|
45
23
|
return {
|
|
46
|
-
...attrs,
|
|
47
24
|
config,
|
|
25
|
+
...keysAttrs,
|
|
48
26
|
hasSlotContent,
|
|
49
27
|
};
|
|
50
28
|
}
|