vueless 0.0.728 → 0.0.729

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.
@@ -54,7 +54,6 @@ export default function useUI<T>(
54
54
 
55
55
  const firstClassKey = Object.keys(defaultConfig || {})[0];
56
56
  const config = ref({}) as Ref<ComponentConfigFull<T>>;
57
- const attrs = useAttrs();
58
57
 
59
58
  watchEffect(() => {
60
59
  const propsConfig = props.config as ComponentConfigFull<T>;
@@ -91,7 +90,7 @@ export default function useUI<T>(
91
90
  }
92
91
 
93
92
  if (key === (topLevelClassKey || firstClassKey)) {
94
- classes = cx([DEFAULT_BASE_CLASSES, vuelessConfig.baseClasses, classes, attrs.class]);
93
+ classes = cx([DEFAULT_BASE_CLASSES, vuelessConfig.baseClasses, classes]);
95
94
  }
96
95
 
97
96
  classes = classes.replaceAll(EXTENDS_PATTERN_REG_EXP, "");
@@ -150,18 +149,21 @@ export default function useUI<T>(
150
149
 
151
150
  const commonAttrs: KeyAttrs = {
152
151
  ...(isTopLevelKey ? attrs : {}),
152
+ "data-vl-child": attrs["data-vl-child"] ? null : true,
153
153
  "vl-component": isDev ? attrs["vl-component"] || componentName || null : null,
154
154
  "vl-key": isDev ? attrs["vl-key"] || configKey || null : null,
155
155
  "vl-child-component": isDev && attrs["vl-component"] ? nestedComponent : null,
156
156
  "vl-child-key": isDev && attrs["vl-component"] ? configKey : null,
157
157
  };
158
158
 
159
+ const topLevelClasses = (!attrs["data-vl-child"] && commonAttrs.class) || "";
160
+
159
161
  /* Delete value key to prevent v-model overwrite. */
160
162
  delete commonAttrs.value;
161
163
 
162
164
  vuelessAttrs.value = {
163
165
  ...commonAttrs,
164
- class: cx([...extendsClasses, toValue(classes)]),
166
+ class: cx([...extendsClasses, toValue(classes), topLevelClasses]),
165
167
  config: getMergedConfig({
166
168
  defaultConfig: extendsKeyConfig,
167
169
  globalConfig: keyConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.728",
3
+ "version": "0.0.729",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
package/types.ts CHANGED
@@ -310,11 +310,12 @@ export type KeyAttrsWithConfig<T> = {
310
310
  } & KeyAttrs;
311
311
 
312
312
  export interface KeyAttrs extends VueAttrs {
313
+ "data-vl-child"?: boolean | null;
313
314
  "vl-component"?: string | null;
314
315
  "vl-key"?: string | null;
315
316
  "vl-child-component"?: string | null;
316
317
  "vl-child-key"?: string | null;
317
- [key: string]: string | undefined | null;
318
+ [key: string]: string | boolean | undefined | null;
318
319
  }
319
320
 
320
321
  export interface VueAttrs {