vueless 0.0.692 → 0.0.693
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/bin/constants.js +2 -2
- package/composables/useUI.ts +1 -1
- package/constants.js +1 -0
- package/directives/tooltip/vTooltip.ts +1 -1
- package/package.json +1 -1
- package/types.ts +2 -2
- package/ui.text-notify/UNotify.vue +1 -1
- package/ui.text-notify/utilNotify.ts +1 -1
- package/utils/node/dynamicProps.js +2 -2
- package/utils/node/dynamicStories.js +1 -1
- package/utils/node/loaderIcon.js +2 -2
- package/utils/node/tailwindSafelist.js +4 -4
- package/utils/ui.ts +1 -1
package/bin/constants.js
CHANGED
package/composables/useUI.ts
CHANGED
|
@@ -45,7 +45,7 @@ export default function useUI<T>(
|
|
|
45
45
|
? (parent?.type.__name as ComponentNames)
|
|
46
46
|
: (type.__name as ComponentNames);
|
|
47
47
|
|
|
48
|
-
const globalConfig = (vuelessConfig.
|
|
48
|
+
const globalConfig = (vuelessConfig.components?.[componentName] || {}) as ComponentConfigFull<T>;
|
|
49
49
|
|
|
50
50
|
const vuelessStrategy = Object.values(STRATEGY_TYPE).includes(vuelessConfig.strategy || "")
|
|
51
51
|
? (vuelessConfig.strategy as Strategies)
|
package/constants.js
CHANGED
|
@@ -24,7 +24,7 @@ if (isCSR) {
|
|
|
24
24
|
animation: "shift-away",
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
settings = merge(defaultSettings, vuelessConfig.
|
|
27
|
+
settings = merge(defaultSettings, vuelessConfig.directives?.tooltip || {}) as DefaultProps;
|
|
28
28
|
tippy.setDefaultProps(settings);
|
|
29
29
|
}
|
|
30
30
|
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -133,12 +133,12 @@ export interface Config extends ThemeConfig {
|
|
|
133
133
|
/**
|
|
134
134
|
* Component configs.
|
|
135
135
|
*/
|
|
136
|
-
|
|
136
|
+
components?: Partial<Components>;
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
139
|
* Directive configs.
|
|
140
140
|
*/
|
|
141
|
-
|
|
141
|
+
directives?: Partial<Directives>;
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
144
|
* Tailwind CSS theme config.
|
|
@@ -72,7 +72,7 @@ function getOffsetWidth(selector: string): number {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
function setPosition() {
|
|
75
|
-
const positionClasses = vuelessConfig.
|
|
75
|
+
const positionClasses = vuelessConfig.components?.UNotify?.positionClasses;
|
|
76
76
|
const pageClass = positionClasses?.page || config.value?.positionClasses?.page;
|
|
77
77
|
const asideClass = positionClasses?.aside || config.value?.positionClasses?.aside;
|
|
78
78
|
const pageWidth = getOffsetWidth(`${pageClass}`);
|
|
@@ -31,7 +31,7 @@ interface VuelessNotifyConfig {
|
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
const globalNotifyDuration = (vuelessConfig.
|
|
34
|
+
const globalNotifyDuration = (vuelessConfig.components?.UNotify as VuelessNotifyConfig)?.duration;
|
|
35
35
|
const notifyClearAllEvent: Event = new Event("notifyClearAll");
|
|
36
36
|
|
|
37
37
|
let lastMessageTime: Date | undefined = undefined;
|
|
@@ -19,7 +19,7 @@ export async function setCustomPropTypes(isVuelessEnv) {
|
|
|
19
19
|
const srcDir = isVuelessEnv ? VUELESS_LOCAL_DIR : VUELESS_DIR;
|
|
20
20
|
|
|
21
21
|
for await (const [componentName, componentDir] of Object.entries(COMPONENTS)) {
|
|
22
|
-
const componentGlobalConfig = vuelessConfig.
|
|
22
|
+
const componentGlobalConfig = vuelessConfig.components?.[componentName];
|
|
23
23
|
const customProps = componentGlobalConfig && componentGlobalConfig.props;
|
|
24
24
|
const isHiddenStories = componentGlobalConfig && componentGlobalConfig.storybook === false;
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ export async function setCustomPropTypes(isVuelessEnv) {
|
|
|
27
27
|
await cacheComponentTypes(path.join(srcDir, componentDir));
|
|
28
28
|
await modifyComponentTypes(
|
|
29
29
|
path.join(srcDir, componentDir),
|
|
30
|
-
vuelessConfig.
|
|
30
|
+
vuelessConfig.components?.[componentName]?.props,
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -47,7 +47,7 @@ export async function hideHiddenStories(isVuelessEnv) {
|
|
|
47
47
|
const srcDir = isVuelessEnv ? VUELESS_LOCAL_DIR : VUELESS_DIR;
|
|
48
48
|
|
|
49
49
|
for await (const [componentName, componentDir] of Object.entries(COMPONENTS)) {
|
|
50
|
-
const componentGlobalConfig = vuelessConfig.
|
|
50
|
+
const componentGlobalConfig = vuelessConfig.components?.[componentName];
|
|
51
51
|
const isHiddenStories = componentGlobalConfig && componentGlobalConfig.storybook === false;
|
|
52
52
|
|
|
53
53
|
if (isHiddenStories) {
|
package/utils/node/loaderIcon.js
CHANGED
|
@@ -146,7 +146,7 @@ async function copyCachedVuelessIcons(isVuelessEnv) {
|
|
|
146
146
|
*/
|
|
147
147
|
async function findAndCopyIcons(files) {
|
|
148
148
|
const defaults = await getDefaults();
|
|
149
|
-
const safelistIcons = vuelessConfig.
|
|
149
|
+
const safelistIcons = vuelessConfig.components?.[U_ICON]?.safelistIcons;
|
|
150
150
|
|
|
151
151
|
safelistIcons?.forEach((iconName) => {
|
|
152
152
|
copyIcon(iconName, defaults);
|
|
@@ -312,5 +312,5 @@ async function getDefaults() {
|
|
|
312
312
|
const defaultConfigPath = path.join(cwd(), defaultIconsDir, COMPONENTS[U_ICON], "config.ts");
|
|
313
313
|
const uIconDefaultConfig = await getComponentDefaultConfig(U_ICON, defaultConfigPath);
|
|
314
314
|
|
|
315
|
-
return merge({}, uIconDefaultConfig?.defaults, vuelessConfig.
|
|
315
|
+
return merge({}, uIconDefaultConfig?.defaults, vuelessConfig.components?.[U_ICON]?.defaults);
|
|
316
316
|
}
|
|
@@ -107,8 +107,8 @@ export async function createTailwindSafelist({ mode, env, debug, targetFiles = [
|
|
|
107
107
|
|
|
108
108
|
const globalSettings = cloneDeep(vuelessConfig);
|
|
109
109
|
|
|
110
|
-
delete globalSettings.
|
|
111
|
-
delete globalSettings.
|
|
110
|
+
delete globalSettings.components;
|
|
111
|
+
delete globalSettings.directives;
|
|
112
112
|
delete globalSettings.tailwindMerge;
|
|
113
113
|
|
|
114
114
|
process.env.VUELESS_GLOBAL_SETTINGS = globalSettings;
|
|
@@ -176,7 +176,7 @@ async function getMergedComponentConfig(componentName, vuelessConfigFiles) {
|
|
|
176
176
|
|
|
177
177
|
return getMergedConfig({
|
|
178
178
|
defaultConfig: await retrieveComponentDefaultConfig(componentName, vuelessConfigFiles),
|
|
179
|
-
globalConfig: vuelessConfig.
|
|
179
|
+
globalConfig: vuelessConfig.components?.[componentName] || {},
|
|
180
180
|
vuelessStrategy: isStrategyValid ? vuelessConfig.strategy : STRATEGY_TYPE.merge,
|
|
181
181
|
});
|
|
182
182
|
}
|
|
@@ -271,7 +271,7 @@ function isDefaultComponentConfig(filePath, componentName) {
|
|
|
271
271
|
|
|
272
272
|
function getSafelistColorsFromConfig(componentName) {
|
|
273
273
|
const globalSafelistColors = vuelessConfig.safelistColors || [];
|
|
274
|
-
const componentSafelistColors = vuelessConfig.
|
|
274
|
+
const componentSafelistColors = vuelessConfig.components?.[componentName]?.safelistColors || [];
|
|
275
275
|
|
|
276
276
|
return [...globalSafelistColors, ...componentSafelistColors];
|
|
277
277
|
}
|
package/utils/ui.ts
CHANGED
|
@@ -99,7 +99,7 @@ export const cva = ({ base = "", variants = {}, compoundVariants = [], defaultVa
|
|
|
99
99
|
*/
|
|
100
100
|
export function getDefaults<Props, Config>(defaultConfig: Config, name: ComponentNames) {
|
|
101
101
|
const componentDefaults = (defaultConfig as UnknownObject).defaults || {};
|
|
102
|
-
const globalDefaults = vuelessConfig.
|
|
102
|
+
const globalDefaults = vuelessConfig.components?.[name]?.defaults || {};
|
|
103
103
|
|
|
104
104
|
const defaults = merge({}, componentDefaults, globalDefaults) as Props & Defaults;
|
|
105
105
|
|