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,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.381",
3
+ "version": "0.0.382",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -1,50 +1,28 @@
1
+ import { computed } from "vue";
1
2
  import useUI from "../composables/useUI.js";
2
- import { cva } from "../utils/utilUI.js";
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, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
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
- if (isCVA(value)) {
20
- value = cva(value)({
21
- ...props,
22
- });
23
- }
9
+ const keysAttrs = getKeysAttrs();
24
10
 
25
- return value;
26
- });
11
+ const { checkboxAttrs } = keysAttrs;
27
12
 
28
- attrs[`${key}Attrs`] = getAttrs(key, { classes });
29
-
30
- if (key === "checkbox") {
31
- const checkboxAttrs = attrs[`${key}Attrs`];
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
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.381",
4
+ "version": "0.0.382",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",