vueless 0.0.268 → 0.0.269

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.268",
3
+ "version": "0.0.269",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless Component Framework.",
6
6
  "homepage": "https://vueless.com",
@@ -6,22 +6,25 @@ import { computed } from "vue";
6
6
  import defaultConfig from "../configs/default.config";
7
7
 
8
8
  export default function useAttrs(props) {
9
- const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
9
+ const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
10
+ defaultConfig,
11
+ () => props.config,
12
+ );
10
13
  const attrs = {};
11
14
 
12
15
  for (const key in defaultConfig) {
13
16
  if (isSystemKey(key)) continue;
14
17
 
15
18
  const classes = computed(() => {
16
- const value = config.value[key];
19
+ let value = config.value[key];
17
20
 
18
- if (value.variants || value.compoundVariants) {
19
- return cva(value)({
21
+ if (isCVA(value)) {
22
+ value = cva(value)({
20
23
  ...props,
21
24
  });
22
25
  }
23
26
 
24
- return "";
27
+ return value;
25
28
  });
26
29
 
27
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -68,5 +71,6 @@ export default function useAttrs(props) {
68
71
  return {
69
72
  ...attrs,
70
73
  config,
74
+ hasSlotContent,
71
75
  };
72
76
  }
@@ -5,7 +5,7 @@ import { cva } from "../../service.ui";
5
5
  import defaultConfig from "../configs/default.config";
6
6
 
7
7
  export default function useAttrs(props, { checkboxColor, checkboxSize }) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,22 +15,19 @@ export default function useAttrs(props, { checkboxColor, checkboxSize }) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
17
  const classes = computed(() => {
18
- const value = config.value[key];
19
-
20
- if (value.variants || value.compoundVariants) {
21
- return setColor(
22
- cva(value)({
23
- ...props,
24
- size: checkboxSize.value,
25
- label: Boolean(props.label),
26
- error: Boolean(props.error),
27
- color: getColor(checkboxColor.value),
28
- }),
29
- checkboxColor.value,
30
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ size: checkboxSize.value,
24
+ label: Boolean(props.label),
25
+ error: Boolean(props.error),
26
+ color: getColor(checkboxColor.value),
27
+ });
31
28
  }
32
29
 
33
- return "";
30
+ return setColor(value, checkboxColor.value);
34
31
  });
35
32
 
36
33
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -39,5 +36,6 @@ export default function useAttrs(props, { checkboxColor, checkboxSize }) {
39
36
  return {
40
37
  ...attrs,
41
38
  config,
39
+ hasSlotContent,
42
40
  };
43
41
  }
@@ -4,22 +4,25 @@ import { cva } from "../../service.ui";
4
4
  import defaultConfig from "../configs/default.config";
5
5
 
6
6
  export default function useAttrs(props) {
7
- const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
7
+ const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
8
+ defaultConfig,
9
+ () => props.config,
10
+ );
8
11
  const attrs = {};
9
12
 
10
13
  for (const key in defaultConfig) {
11
14
  if (isSystemKey(key)) continue;
12
15
 
13
16
  const classes = computed(() => {
14
- const value = config.value[key];
17
+ let value = config.value[key];
15
18
 
16
- if (value.variants || value.compoundVariants) {
17
- return cva(value)({
19
+ if (isCVA(value)) {
20
+ value = cva(value)({
18
21
  ...props,
19
22
  });
20
23
  }
21
24
 
22
- return "";
25
+ return value;
23
26
  });
24
27
 
25
28
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -28,5 +31,6 @@ export default function useAttrs(props) {
28
31
  return {
29
32
  ...attrs,
30
33
  config,
34
+ hasSlotContent,
31
35
  };
32
36
  }
@@ -4,22 +4,25 @@ import defaultConfig from "../configs/default.config";
4
4
  import { computed } from "vue";
5
5
 
6
6
  export default function useAttrs(props, { selected }) {
7
- const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
7
+ const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
8
+ defaultConfig,
9
+ () => props.config,
10
+ );
8
11
  const attrs = {};
9
12
 
10
13
  for (const key in defaultConfig) {
11
14
  if (isSystemKey(key)) continue;
12
15
 
13
16
  const classes = computed(() => {
14
- const value = config.value[key];
17
+ let value = config.value[key];
15
18
 
16
- if (value.variants || value.compoundVariants) {
17
- return cva(value)({
19
+ if (isCVA(value)) {
20
+ value = cva(value)({
18
21
  ...props,
19
22
  });
20
23
  }
21
24
 
22
- return "";
25
+ return value;
23
26
  });
24
27
 
25
28
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -42,5 +45,6 @@ export default function useAttrs(props, { selected }) {
42
45
  return {
43
46
  ...attrs,
44
47
  config,
48
+ hasSlotContent,
45
49
  };
46
50
  }
@@ -5,7 +5,7 @@ import { cva } from "../../service.ui";
5
5
  import defaultConfig from "../configs/default.config";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, setColor, getColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, setColor, getColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,19 +15,16 @@ export default function useAttrs(props) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
17
  const classes = computed(() => {
18
- const value = config.value[key];
19
-
20
- if (value.variants || value.compoundVariants) {
21
- return setColor(
22
- cva(value)({
23
- ...props,
24
- color: getColor(props.color),
25
- }),
26
- props.color,
27
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ color: getColor(props.color),
24
+ });
28
25
  }
29
26
 
30
- return "";
27
+ return setColor(value, props.color);
31
28
  });
32
29
 
33
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -36,5 +33,6 @@ export default function useAttrs(props) {
36
33
  return {
37
34
  ...attrs,
38
35
  config,
36
+ hasSlotContent,
39
37
  };
40
38
  }
@@ -6,24 +6,27 @@ import defaultConfig from "../configs/default.config";
6
6
  import { POSITION } from "../../composable.autoPosition";
7
7
 
8
8
  export default function useAttrs(props, { isShownCalendar, isTop, isRight }) {
9
- const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
9
+ const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
10
+ defaultConfig,
11
+ () => props.config,
12
+ );
10
13
  const attrs = {};
11
14
 
12
15
  for (const key in defaultConfig) {
13
16
  if (isSystemKey(key)) continue;
14
17
 
15
18
  const classes = computed(() => {
16
- const value = config.value[key];
19
+ let value = config.value[key];
17
20
 
18
- if (value.variants || value.compoundVariants) {
19
- return cva(value)({
21
+ if (isCVA(value)) {
22
+ value = cva(value)({
20
23
  ...props,
21
24
  openDirectionY: isTop.value ? POSITION.top : POSITION.bottom,
22
25
  openDirectionX: isRight.value ? POSITION.right : POSITION.left,
23
26
  });
24
27
  }
25
28
 
26
- return "";
29
+ return value;
27
30
  });
28
31
 
29
32
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -82,5 +85,6 @@ export default function useAttrs(props, { isShownCalendar, isTop, isRight }) {
82
85
  return {
83
86
  ...attrs,
84
87
  config,
88
+ hasSlotContent,
85
89
  };
86
90
  }
@@ -7,22 +7,25 @@ import defaultConfig from "../configs/default.config";
7
7
  import { POSITION } from "../../composable.autoPosition";
8
8
 
9
9
  export default function useAttrs(props, { isShownMenu, isTop, isRight }) {
10
- const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
10
+ const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
11
+ defaultConfig,
12
+ () => props.config,
13
+ );
11
14
  const attrs = {};
12
15
 
13
16
  for (const key in defaultConfig) {
14
17
  if (isSystemKey(key)) continue;
15
18
 
16
19
  const classes = computed(() => {
17
- const value = config.value[key];
20
+ let value = config.value[key];
18
21
 
19
- if (value.variants || value.compoundVariants) {
20
- return cva(value)({
22
+ if (isCVA(value)) {
23
+ value = cva(value)({
21
24
  ...props,
22
25
  });
23
26
  }
24
27
 
25
- return "";
28
+ return value;
26
29
  });
27
30
 
28
31
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -123,5 +126,6 @@ export default function useAttrs(props, { isShownMenu, isTop, isRight }) {
123
126
  return {
124
127
  ...attrs,
125
128
  config,
129
+ hasSlotContent,
126
130
  };
127
131
  }
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props) {
8
- const { config, getAttrs, hasSlotContent, isSystemKey } = useUI(
8
+ const { config, getAttrs, hasSlotContent, isSystemKey, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,16 +15,16 @@ export default function useAttrs(props) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
17
  const classes = computed(() => {
18
- const value = config.value[key];
18
+ let value = config.value[key];
19
19
 
20
- if (value.variants || value.compoundVariants) {
21
- return cva(value)({
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
22
  ...props,
23
23
  error: Boolean(props.error),
24
24
  });
25
25
  }
26
26
 
27
- return "";
27
+ return value;
28
28
  });
29
29
 
30
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -5,7 +5,7 @@ import { cva } from "../../service.ui";
5
5
  import defaultConfig from "../configs/default.config";
6
6
 
7
7
  export default function useAttrs(props, { radioColor, radioSize }) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,22 +15,19 @@ export default function useAttrs(props, { radioColor, radioSize }) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
17
  const classes = computed(() => {
18
- const value = config.value[key];
19
-
20
- if (value.variants || value.compoundVariants) {
21
- return setColor(
22
- cva(value)({
23
- ...props,
24
- size: radioSize.value,
25
- label: Boolean(props.label),
26
- error: Boolean(props.error),
27
- color: getColor(radioColor.value),
28
- }),
29
- radioColor.value,
30
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ size: radioSize.value,
24
+ label: Boolean(props.label),
25
+ error: Boolean(props.error),
26
+ color: getColor(radioColor.value),
27
+ });
31
28
  }
32
29
 
33
- return "";
30
+ return setColor(value, radioColor.value);
34
31
  });
35
32
 
36
33
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -39,5 +36,6 @@ export default function useAttrs(props, { radioColor, radioSize }) {
39
36
  return {
40
37
  ...attrs,
41
38
  config,
39
+ hasSlotContent,
42
40
  };
43
41
  }
@@ -6,22 +6,25 @@ import useUI from "../../composable.ui";
6
6
  import defaultConfig from "../configs/default.config";
7
7
 
8
8
  export default function useAttrs(props) {
9
- const { config, getAttrs, isSystemKey } = useUI(defaultConfig, () => props.config);
9
+ const { config, getAttrs, isSystemKey, hasSlotContent, isCVA } = useUI(
10
+ defaultConfig,
11
+ () => props.config,
12
+ );
10
13
  const attrs = {};
11
14
 
12
15
  for (const key in defaultConfig) {
13
16
  if (isSystemKey(key)) continue;
14
17
 
15
18
  const classes = computed(() => {
16
- const value = config.value[key];
19
+ let value = config.value[key];
17
20
 
18
- if (value.variants || value.compoundVariants) {
19
- return cva(value)({
21
+ if (isCVA(value)) {
22
+ value = cva(value)({
20
23
  ...props,
21
24
  });
22
25
  }
23
26
 
24
- return "";
27
+ return value;
25
28
  });
26
29
 
27
30
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -30,5 +33,6 @@ export default function useAttrs(props) {
30
33
  return {
31
34
  ...attrs,
32
35
  config,
36
+ hasSlotContent,
33
37
  };
34
38
  }
@@ -5,7 +5,7 @@ import defaultConfig from "../configs/default.config";
5
5
  import { computed } from "vue";
6
6
 
7
7
  export default function useAttrs(props, { checked }) {
8
- const { config, getAttrs, getColor, setColor, isSystemKey } = useUI(
8
+ const { config, getAttrs, getColor, setColor, isSystemKey, hasSlotContent, isCVA } = useUI(
9
9
  defaultConfig,
10
10
  () => props.config,
11
11
  );
@@ -15,20 +15,17 @@ export default function useAttrs(props, { checked }) {
15
15
  if (isSystemKey(key)) continue;
16
16
 
17
17
  const classes = computed(() => {
18
- const value = config.value[key];
19
-
20
- if (value.variants || value.compoundVariants) {
21
- return setColor(
22
- cva(value)({
23
- ...props,
24
- color: getColor(props.color),
25
- checked: Boolean(checked.value),
26
- }),
27
- props.color,
28
- );
18
+ let value = config.value[key];
19
+
20
+ if (isCVA(value)) {
21
+ value = cva(value)({
22
+ ...props,
23
+ color: getColor(props.color),
24
+ checked: Boolean(checked.value),
25
+ });
29
26
  }
30
27
 
31
- return "";
28
+ return setColor(value, props.color);
32
29
  });
33
30
 
34
31
  attrs[`${key}Attrs`] = getAttrs(key, { classes });
@@ -37,5 +34,6 @@ export default function useAttrs(props, { checked }) {
37
34
  return {
38
35
  ...attrs,
39
36
  config,
37
+ hasSlotContent,
40
38
  };
41
39
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.268",
4
+ "version": "0.0.269",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",