vueless 0.0.478-beta.3 → 0.0.479
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/composables/useBreakpoint.js +1 -1
- package/composables/useUI.js +1 -204
- package/constants.js +1 -2
- package/directives/clickOutside/vClickOutside.js +2 -2
- package/directives/tooltip/storybook/stories.js +5 -5
- package/{index.ts → index.js} +7 -10
- package/package.json +18 -28
- package/preset.tailwind.js +7 -16
- package/ui.button/config.js +0 -12
- package/ui.button/storybook/stories.js +2 -2
- package/ui.button-link/ULink.vue +1 -1
- package/ui.button-link/config.js +0 -9
- package/ui.button-link/storybook/stories.js +1 -1
- package/ui.button-toggle/storybook/stories.js +1 -1
- package/ui.container-divider/storybook/stories.js +1 -1
- package/ui.container-modal/storybook/stories.js +1 -1
- package/ui.container-modal-confirm/storybook/stories.js +1 -1
- package/ui.container-row/storybook/stories.js +1 -1
- package/ui.data-list/UDataList.vue +4 -4
- package/ui.data-table/UTable.vue +1 -1
- package/ui.dropdown-badge/config.js +0 -1
- package/ui.dropdown-badge/storybook/stories.js +1 -1
- package/ui.dropdown-button/config.js +0 -1
- package/ui.dropdown-button/storybook/stories.js +2 -2
- package/ui.dropdown-link/storybook/stories.js +1 -1
- package/ui.dropdown-list/storybook/stories.js +1 -1
- package/ui.form-checkbox/config.js +0 -9
- package/ui.form-checkbox/storybook/stories.js +1 -1
- package/ui.form-checkbox-group/storybook/stories.js +1 -1
- package/ui.form-checkbox-multi-state/storybook/stories.js +1 -1
- package/ui.form-color-picker/config.js +0 -7
- package/ui.form-color-picker/storybook/stories.js +1 -1
- package/ui.form-date-picker/storybook/stories.js +2 -2
- package/ui.form-date-picker-range/storybook/stories.js +1 -1
- package/ui.form-input/UInput.vue +1 -1
- package/ui.form-input/storybook/stories.js +1 -1
- package/ui.form-input-file/storybook/stories.js +1 -1
- package/ui.form-input-money/storybook/stories.js +1 -1
- package/ui.form-input-money/useFormatCurrency.js +1 -1
- package/ui.form-input-number/UInputNumber.vue +3 -4
- package/ui.form-input-number/storybook/stories.js +1 -1
- package/ui.form-input-rating/storybook/stories.js +1 -1
- package/ui.form-input-search/storybook/stories.js +1 -1
- package/ui.form-label/config.js +2 -2
- package/ui.form-label/storybook/stories.js +1 -1
- package/ui.form-radio/config.js +0 -6
- package/ui.form-radio-group/storybook/stories.js +1 -1
- package/ui.form-select/storybook/stories.js +1 -1
- package/ui.form-switch/config.js +0 -6
- package/ui.form-switch/storybook/stories.js +1 -1
- package/ui.form-textarea/storybook/stories.js +1 -1
- package/ui.image-avatar/config.js +0 -5
- package/ui.image-avatar/storybook/stories.js +1 -1
- package/ui.image-icon/UIcon.vue +14 -5
- package/ui.image-icon/config.js +0 -5
- package/ui.image-icon/storybook/stories.js +1 -1
- package/ui.loader/config.js +0 -1
- package/ui.loader/storybook/stories.js +1 -1
- package/ui.loader-overlay/config.js +0 -1
- package/ui.loader-progress/config.js +0 -1
- package/ui.loader-progress/storybook/stories.js +1 -1
- package/ui.navigation-progress/config.js +0 -9
- package/ui.navigation-progress/storybook/stories.js +1 -1
- package/ui.navigation-tabs/storybook/stories.js +1 -1
- package/ui.other-dot/config.js +0 -1
- package/ui.other-dot/storybook/stories.js +1 -1
- package/ui.text-alert/config.js +0 -7
- package/ui.text-alert/storybook/stories.js +1 -1
- package/ui.text-badge/config.js +0 -8
- package/ui.text-badge/storybook/stories.js +2 -10
- package/ui.text-block/UText.vue +62 -18
- package/ui.text-block/storybook/Docs.mdx +3 -3
- package/ui.text-block/storybook/{stories.ts → stories.js} +8 -13
- package/ui.text-block/useAttrs.js +15 -0
- package/ui.text-empty/storybook/stories.js +1 -1
- package/ui.text-file/UFile.vue +15 -12
- package/ui.text-file/config.js +2 -12
- package/ui.text-files/config.js +1 -1
- package/ui.text-header/config.js +0 -1
- package/ui.text-header/storybook/stories.js +1 -1
- package/ui.text-money/config.js +0 -1
- package/ui.text-money/storybook/stories.js +1 -1
- package/ui.text-money/utilMoney.js +2 -2
- package/{utilsTs/utilTheme.ts → utils/utilTheme.js} +27 -31
- package/utils/utilUI.js +205 -1
- package/web-types.json +9580 -0
- package/composablesTs/useAutoPosition.ts +0 -115
- package/composablesTs/useBreakpoint.ts +0 -106
- package/composablesTs/useLocale.ts +0 -25
- package/composablesTs/useMutationObserver.ts +0 -50
- package/composablesTs/useUI.ts +0 -557
- package/constants.ts +0 -73
- package/types.ts +0 -223
- package/ui.text-block/types.ts +0 -33
- package/ui.text-block/useAttrs.ts +0 -20
- package/utilsTs/utilHelper.ts +0 -68
- package/utilsTs/utilPlatform.ts +0 -53
- package/utilsTs/utilStorybook.ts +0 -296
- package/utilsTs/utilTailwind.ts +0 -38
- package/utilsTs/utilUI.ts +0 -143
- /package/ui.text-block/{config.ts → config.js} +0 -0
- /package/ui.text-block/{constants.ts → constants.js} +0 -0
|
@@ -59,7 +59,7 @@ export default function useBreakpoint() {
|
|
|
59
59
|
onBeforeUnmount(() => {
|
|
60
60
|
if (isSSR) return;
|
|
61
61
|
|
|
62
|
-
window.removeEventListener("resize", resizeListener);
|
|
62
|
+
window.removeEventListener("resize", resizeListener, { passive: true });
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
watch(windowWidth, setBreakpoint, { immediate: true });
|
package/composables/useUI.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
computed,
|
|
12
12
|
} from "vue";
|
|
13
13
|
|
|
14
|
-
import { cx, cva, setColor, getColor, vuelessConfig } from "../utils/utilUI.js";
|
|
14
|
+
import { cx, cva, setColor, getColor, vuelessConfig, mergeConfigs } from "../utils/utilUI.js";
|
|
15
15
|
|
|
16
16
|
import { cloneDeep, isCSR } from "../utils/utilHelper.js";
|
|
17
17
|
import {
|
|
@@ -241,209 +241,6 @@ function getMergedConfig({ defaultConfig, globalConfig, propsConfig, vuelessStra
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
-
/**
|
|
245
|
-
* Recursively merge config objects with removing tailwind classes duplicates.
|
|
246
|
-
* @param {Object} defaultConfig
|
|
247
|
-
* @param {Object} globalConfig
|
|
248
|
-
* @param {Object} propsConfig
|
|
249
|
-
* @param {Object} config - final merged config.
|
|
250
|
-
* @param {boolean} isReplace - enables class replacement instead of merge.
|
|
251
|
-
* @param {boolean} isVarinants - if true, prevents adding a "base" key into nested objects.
|
|
252
|
-
*
|
|
253
|
-
* @returns {Object}
|
|
254
|
-
*/
|
|
255
|
-
function mergeConfigs({
|
|
256
|
-
defaultConfig,
|
|
257
|
-
globalConfig,
|
|
258
|
-
propsConfig,
|
|
259
|
-
config = {},
|
|
260
|
-
isReplace = false,
|
|
261
|
-
isVariants = false,
|
|
262
|
-
}) {
|
|
263
|
-
globalConfig = cloneDeep(globalConfig || {});
|
|
264
|
-
propsConfig = cloneDeep(propsConfig || {});
|
|
265
|
-
|
|
266
|
-
const isGlobalConfig = Object.keys(globalConfig).length;
|
|
267
|
-
const isPropsConfig = Object.keys(propsConfig).length;
|
|
268
|
-
|
|
269
|
-
// Add unique keys from defaultConfig to composedConfig
|
|
270
|
-
let composedConfig = cloneDeep(defaultConfig);
|
|
271
|
-
|
|
272
|
-
// Add unique keys from globalConfig to composedConfig
|
|
273
|
-
for (let key in globalConfig) {
|
|
274
|
-
if (!Object.keys(composedConfig).includes(key)) {
|
|
275
|
-
composedConfig[key] = globalConfig[key];
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// Add unique keys from propsConfig to composedConfig
|
|
280
|
-
for (let key in propsConfig) {
|
|
281
|
-
if (!Object.keys(composedConfig).includes(key)) {
|
|
282
|
-
composedConfig[key] = propsConfig[key];
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
const {
|
|
287
|
-
i18n,
|
|
288
|
-
defaults,
|
|
289
|
-
strategy,
|
|
290
|
-
safelist,
|
|
291
|
-
component,
|
|
292
|
-
safelistColors,
|
|
293
|
-
defaultVariants,
|
|
294
|
-
compoundVariants,
|
|
295
|
-
} = SYSTEM_CONFIG_KEY;
|
|
296
|
-
|
|
297
|
-
for (let key in composedConfig) {
|
|
298
|
-
if (isGlobalConfig || isPropsConfig) {
|
|
299
|
-
if (key === safelist || key === safelistColors) {
|
|
300
|
-
if (propsConfig[key]) {
|
|
301
|
-
// eslint-disable-next-line no-console
|
|
302
|
-
console.warn(`Passing '${key}' key in 'config' prop is not allowed.`);
|
|
303
|
-
}
|
|
304
|
-
} else if (key === component) {
|
|
305
|
-
config[key] = propsConfig[key] || defaultConfig[key];
|
|
306
|
-
|
|
307
|
-
if (globalConfig[key]) {
|
|
308
|
-
// eslint-disable-next-line no-console
|
|
309
|
-
console.warn(`Passing '${key}' key in 'config' prop or by global config is not allowed.`);
|
|
310
|
-
}
|
|
311
|
-
} else if (key === strategy) {
|
|
312
|
-
config[key] = propsConfig[key] || globalConfig[key] || defaultConfig[key];
|
|
313
|
-
} else if (key === defaults || key === defaultVariants) {
|
|
314
|
-
config[key] = { ...defaultConfig[key], ...globalConfig[key], ...propsConfig[key] };
|
|
315
|
-
} else if (key === compoundVariants) {
|
|
316
|
-
config[key] = mergeCompoundVariants({
|
|
317
|
-
defaultConfig: composedConfig,
|
|
318
|
-
globalConfig,
|
|
319
|
-
propsConfig,
|
|
320
|
-
isReplace,
|
|
321
|
-
key,
|
|
322
|
-
});
|
|
323
|
-
} else {
|
|
324
|
-
const isObjectComposedConfig = typeof composedConfig[key] === "object";
|
|
325
|
-
const isObjectGlobalConfig = typeof globalConfig[key] === "object";
|
|
326
|
-
const isObjectPropsConfig = typeof propsConfig[key] === "object";
|
|
327
|
-
|
|
328
|
-
const isObject = isObjectComposedConfig || isObjectGlobalConfig || isObjectPropsConfig;
|
|
329
|
-
const isEmpty = composedConfig[key] === null;
|
|
330
|
-
const isI18n = key === i18n;
|
|
331
|
-
|
|
332
|
-
if (key === "variants" && !isVariants) {
|
|
333
|
-
isVariants = true;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
config[key] =
|
|
337
|
-
isObject && !isEmpty && !isI18n
|
|
338
|
-
? mergeConfigs({
|
|
339
|
-
defaultConfig: stringToObject(composedConfig[key], { addBase: !isVariants }),
|
|
340
|
-
globalConfig: stringToObject(globalConfig[key], { addBase: !isVariants }),
|
|
341
|
-
propsConfig: stringToObject(propsConfig[key], { addBase: !isVariants }),
|
|
342
|
-
config: stringToObject(composedConfig[key], { addBase: !isVariants }),
|
|
343
|
-
isReplace,
|
|
344
|
-
isVariants,
|
|
345
|
-
})
|
|
346
|
-
: isReplace || isI18n
|
|
347
|
-
? propsConfig[key] || globalConfig[key] || defaultConfig[key]
|
|
348
|
-
: cx([defaultConfig[key], globalConfig[key], propsConfig[key]]);
|
|
349
|
-
}
|
|
350
|
-
} else {
|
|
351
|
-
config[key] = composedConfig[key];
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
return config;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
Turn simplified nested component config to regular config.
|
|
360
|
-
@param {Object | String} value
|
|
361
|
-
@param {Boolean} addBase
|
|
362
|
-
@returns {Object}
|
|
363
|
-
*/
|
|
364
|
-
function stringToObject(value, { addBase = false }) {
|
|
365
|
-
if (value === undefined) value = "";
|
|
366
|
-
|
|
367
|
-
return typeof value !== "object" ? addBase && { base: value } : value;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
/**
|
|
371
|
-
* Merge CVA compound variants arrays.
|
|
372
|
-
* @param {Object} defaultConfig
|
|
373
|
-
* @param {Object} globalConfig
|
|
374
|
-
* @param {Object} propsConfig
|
|
375
|
-
* @param {string} key
|
|
376
|
-
* @param {boolean} isReplace - enables class replacement instead of merge.
|
|
377
|
-
*
|
|
378
|
-
* @returns {Array}
|
|
379
|
-
*/
|
|
380
|
-
function mergeCompoundVariants({ defaultConfig, globalConfig, propsConfig, key, isReplace }) {
|
|
381
|
-
if (
|
|
382
|
-
(globalConfig[key] && !Array.isArray(globalConfig[key])) ||
|
|
383
|
-
(propsConfig[key] && !Array.isArray(propsConfig[key])) ||
|
|
384
|
-
(defaultConfig[key] && !Array.isArray(defaultConfig[key]))
|
|
385
|
-
) {
|
|
386
|
-
// eslint-disable-next-line no-console
|
|
387
|
-
console.error("CompoundVariants should be an array.");
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
let globalConfigUniqueItems = cloneDeep(globalConfig[key] || []);
|
|
391
|
-
let propsConfigUniqueItems = cloneDeep(propsConfig[key] || []);
|
|
392
|
-
|
|
393
|
-
const config = defaultConfig[key].map((defaultConfigItem) => {
|
|
394
|
-
/**
|
|
395
|
-
* Compare two objects by keys for match.
|
|
396
|
-
* @param {Object} configItem
|
|
397
|
-
* @returns {Boolean}
|
|
398
|
-
*/
|
|
399
|
-
function isSameItem(configItem) {
|
|
400
|
-
const hasConfigItemKeys = Object.keys(defaultConfigItem)
|
|
401
|
-
.map((key) => defaultConfigItem[key] === configItem[key] || key === "class")
|
|
402
|
-
.every((item) => !!item);
|
|
403
|
-
|
|
404
|
-
const hasDefaultConfigItemKeys = Object.keys(configItem)
|
|
405
|
-
.map((key) => defaultConfigItem[key] === configItem[key] || key === "class")
|
|
406
|
-
.every((item) => !!item);
|
|
407
|
-
|
|
408
|
-
return hasConfigItemKeys && hasDefaultConfigItemKeys;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Find the same compound variant item in custom config if exist.
|
|
413
|
-
* @param {Object} config
|
|
414
|
-
* @returns {Object|undefined}
|
|
415
|
-
*/
|
|
416
|
-
function findItem(config = []) {
|
|
417
|
-
const globalConfigUniqueItemIndex = globalConfigUniqueItems.findIndex(isSameItem);
|
|
418
|
-
const propsConfigUniqueItemIndex = propsConfigUniqueItems.findIndex(isSameItem);
|
|
419
|
-
|
|
420
|
-
if (~globalConfigUniqueItemIndex) {
|
|
421
|
-
globalConfigUniqueItems.splice(globalConfigUniqueItemIndex, 1);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
if (~propsConfigUniqueItemIndex) {
|
|
425
|
-
propsConfigUniqueItems.splice(propsConfigUniqueItemIndex, 1);
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
return config.find(isSameItem);
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
const globalConfigItem = findItem(globalConfig[key]);
|
|
432
|
-
const propsConfigItem = findItem(propsConfig[key]);
|
|
433
|
-
|
|
434
|
-
return globalConfigItem || propsConfigItem
|
|
435
|
-
? {
|
|
436
|
-
...defaultConfigItem,
|
|
437
|
-
class: isReplace
|
|
438
|
-
? propsConfigItem?.class || globalConfigItem?.class || defaultConfigItem.class
|
|
439
|
-
: cx([defaultConfigItem.class, globalConfigItem?.class, propsConfigItem?.class]),
|
|
440
|
-
}
|
|
441
|
-
: defaultConfigItem;
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
return [...config, ...globalConfigUniqueItems, ...propsConfigUniqueItems];
|
|
445
|
-
}
|
|
446
|
-
|
|
447
244
|
/**
|
|
448
245
|
* Merge component classes from "class" attribute into final config.
|
|
449
246
|
* @param {Object} config
|
package/constants.js
CHANGED
|
@@ -14,7 +14,7 @@ export const DEFAULT_GRAY_COLOR = COOL_COLOR;
|
|
|
14
14
|
export const DEFAULT_RING = 4; /* pixels */
|
|
15
15
|
export const DEFAULT_RING_OFFSET = 0; /* pixels */
|
|
16
16
|
export const DEFAULT_RING_OFFSET_COLOR_LIGHT = "#ffffff"; // white
|
|
17
|
-
export const DEFAULT_RING_OFFSET_COLOR_DARK = "#
|
|
17
|
+
export const DEFAULT_RING_OFFSET_COLOR_DARK = "#4b5563"; // gray-600
|
|
18
18
|
export const DEFAULT_ROUNDING = 8; /* pixels */
|
|
19
19
|
|
|
20
20
|
/* Vueless supported colors and shades */
|
|
@@ -61,7 +61,6 @@ export const SYSTEM_CONFIG_KEY = {
|
|
|
61
61
|
i18n: "i18n",
|
|
62
62
|
defaults: "defaults",
|
|
63
63
|
strategy: "strategy",
|
|
64
|
-
safelist: "safelist",
|
|
65
64
|
component: "component",
|
|
66
65
|
transition: "transition",
|
|
67
66
|
safelistColors: "safelistColors",
|
|
@@ -24,8 +24,8 @@ function clickOutside(target, handler, options) {
|
|
|
24
24
|
window.addEventListener("pointerdown", onClick, { passive: true });
|
|
25
25
|
|
|
26
26
|
function removeEvents() {
|
|
27
|
-
window.removeEventListener("click", onClick, capture);
|
|
28
|
-
window.removeEventListener("pointerdown", onClick);
|
|
27
|
+
window.removeEventListener("click", onClick, { capture, passive: true });
|
|
28
|
+
window.removeEventListener("pointerdown", onClick, { passive: true });
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
return removeEvents;
|
|
@@ -36,11 +36,11 @@ const EnumTemplate = (args) => ({
|
|
|
36
36
|
},
|
|
37
37
|
template: `
|
|
38
38
|
<URow>
|
|
39
|
-
<UIcon
|
|
40
|
-
v-for="option in args.options"
|
|
41
|
-
interactive
|
|
42
|
-
name="sentiment_satisfied"
|
|
43
|
-
v-tooltip="{ content: option, ...args.tooltip, [args.enum]: option }"
|
|
39
|
+
<UIcon
|
|
40
|
+
v-for="option in args.options"
|
|
41
|
+
interactive
|
|
42
|
+
name="sentiment_satisfied"
|
|
43
|
+
v-tooltip="{ content: option, ...args.tooltip, [args.enum]: option }"
|
|
44
44
|
>
|
|
45
45
|
</URow>
|
|
46
46
|
`,
|
package/{index.ts → index.js}
RENAMED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
/* eslint-disable prettier/prettier */
|
|
1
|
+
/* eslint-disable vue/max-len, prettier/prettier */
|
|
2
2
|
import { createLocale, LocaleSymbol } from "./composables/useLocale.js";
|
|
3
3
|
import { createLoaderOverlay, LoaderOverlaySymbol } from "./ui.loader-overlay/useLoaderOverlay.js";
|
|
4
4
|
import { createLoaderProgress, LoaderProgressSymbol } from "./ui.loader-progress/useLoaderProgress.js";
|
|
5
|
-
import { themeInit } from "./
|
|
5
|
+
import { themeInit } from "./utils/utilTheme.js";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export { setTitle } from "./utilsTs/utilHelper.ts";
|
|
11
|
-
export { setTheme } from "./utilsTs/utilTheme.ts";
|
|
7
|
+
export { setTitle } from "./utils/utilHelper.js";
|
|
8
|
+
export { setTheme } from "./utils/utilTheme.js";
|
|
12
9
|
export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n.js";
|
|
13
10
|
export { default as defaultEnLocale } from "./adatper.locale/locales/en.js";
|
|
14
11
|
export { useLocale } from "./composables/useLocale.js";
|
|
@@ -25,14 +22,14 @@ export {
|
|
|
25
22
|
setDelayedNotify,
|
|
26
23
|
getDelayedNotify,
|
|
27
24
|
} from "./ui.text-notify/utilNotify.js";
|
|
28
|
-
/* eslint-enable prettier/prettier */
|
|
25
|
+
/* eslint-enable vue/max-len, prettier/prettier */
|
|
29
26
|
|
|
30
|
-
export function createVueless(options
|
|
27
|
+
export function createVueless(options = {}) {
|
|
31
28
|
const i18n = createLocale(options.i18n);
|
|
32
29
|
const loaderOverlay = createLoaderOverlay();
|
|
33
30
|
const loaderProgress = createLoaderProgress();
|
|
34
31
|
|
|
35
|
-
const install = (app
|
|
32
|
+
const install = (app) => {
|
|
36
33
|
app.provide(LocaleSymbol, i18n);
|
|
37
34
|
app.provide(LoaderOverlaySymbol, loaderOverlay);
|
|
38
35
|
app.provide(LoaderProgressSymbol, loaderProgress);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.479",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"homepage": "https://vueless.com",
|
|
23
23
|
"author": "Johnny Grid",
|
|
24
|
-
"main": "index.
|
|
24
|
+
"main": "index.js",
|
|
25
25
|
"type": "module",
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
@@ -31,15 +31,13 @@
|
|
|
31
31
|
"dev": "npx @vueless/web-types && node prepare.icons && STORYBOOK_FULL=1 storybook dev -p 6006 --no-open",
|
|
32
32
|
"build": "npx @vueless/web-types && node prepare.icons && storybook build --docs",
|
|
33
33
|
"preview": "vite preview --host --outDir=storybook-static",
|
|
34
|
-
"
|
|
35
|
-
"release:prepare": "node prepare.icons && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE README.md dist/ && node prepare.package",
|
|
36
|
-
"release:beta": "release-it --ci --npm.publish --preRelease=beta --increment=prerelease",
|
|
34
|
+
"release:prepare": "npx @vueless/web-types && node prepare.icons && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE web-types.json README.md dist/ && node prepare.package",
|
|
37
35
|
"release:patch": "release-it patch --ci --npm.publish",
|
|
38
36
|
"release:minor": "release-it minor --ci --npm.publish --git.tag --github.release",
|
|
39
37
|
"release:major": "release-it major --ci --npm.publish --git.tag --github.release",
|
|
40
|
-
"lint": "eslint --no-fix src/ .storybook/",
|
|
41
|
-
"lint:fix": "eslint --fix src/ .storybook/",
|
|
42
|
-
"lint:ci": "eslint --no-fix --max-warnings=0"
|
|
38
|
+
"lint": "eslint --ext .vue,.js,.ts --no-fix --ignore-path .eslintignore src/ .storybook/",
|
|
39
|
+
"lint:fix": "eslint --ext .vue,.js,.ts --fix --ignore-path .eslintignore src/ .storybook/",
|
|
40
|
+
"lint:ci": "eslint --ext .vue,.js,.ts --no-fix --ignore-path .eslintignore --max-warnings=0"
|
|
43
41
|
},
|
|
44
42
|
"dependencies": {
|
|
45
43
|
"@tailwindcss/forms": "^0.5.7",
|
|
@@ -51,38 +49,30 @@
|
|
|
51
49
|
"vuedraggable": "^4.1.0"
|
|
52
50
|
},
|
|
53
51
|
"devDependencies": {
|
|
54
|
-
"@eslint/js": "^9.12.0",
|
|
55
52
|
"@material-symbols/svg-500": "^0.17.4",
|
|
56
53
|
"@release-it/bumper": "^6.0.1",
|
|
57
|
-
"@tsconfig/node20": "^20.1.4",
|
|
58
|
-
"@types/jsdom": "^21.1.7",
|
|
59
|
-
"@types/lodash-es": "^4.17.12",
|
|
60
|
-
"@types/node": "^22.7.7",
|
|
61
54
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
62
|
-
"@
|
|
63
|
-
"@
|
|
64
|
-
"@vue/eslint-config-typescript": "^14.1.1",
|
|
65
|
-
"@vue/tsconfig": "^0.5.1",
|
|
66
|
-
"@vueless/plugin-vite": "^0.0.74",
|
|
55
|
+
"@vue/eslint-config-prettier": "^9.0.0",
|
|
56
|
+
"@vueless/plugin-vite": "^0.0.76",
|
|
67
57
|
"@vueless/storybook": "^0.0.37",
|
|
68
58
|
"@vueless/web-types": "^0.0.17",
|
|
69
59
|
"autoprefixer": "^10.4.19",
|
|
70
60
|
"cssnano": "^6.1.2",
|
|
71
|
-
"eslint": "^
|
|
72
|
-
"eslint-plugin-
|
|
73
|
-
"eslint-plugin-
|
|
61
|
+
"eslint": "^8.55.0",
|
|
62
|
+
"eslint-plugin-node": "^11.1.0",
|
|
63
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
64
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
65
|
+
"eslint-plugin-tailwindcss": "^3.15.1",
|
|
74
66
|
"eslint-plugin-vue": "^9.25.0",
|
|
75
|
-
"globals": "^15.11.0",
|
|
76
|
-
"jsdom": "^25.0.1",
|
|
77
67
|
"postcss": "^8.4.38",
|
|
78
|
-
"prettier": "^3.
|
|
68
|
+
"prettier": "^3.2.5",
|
|
69
|
+
"prettier-eslint": "^16.3.0",
|
|
79
70
|
"release-it": "^17.2.1",
|
|
80
|
-
"
|
|
81
|
-
"vite": "^5.4.9",
|
|
71
|
+
"vite": "^5.2.13",
|
|
82
72
|
"vite-plugin-compression": "^0.5.1",
|
|
73
|
+
"vite-plugin-eslint": "^1.8.1",
|
|
83
74
|
"vue": "^3.5.4",
|
|
84
|
-
"vue-router": "^4.3.2"
|
|
85
|
-
"vue-tsc": "^2.1.6"
|
|
75
|
+
"vue-router": "^4.3.2"
|
|
86
76
|
},
|
|
87
77
|
"resolutions": {
|
|
88
78
|
"jackspeak": "2.3.6"
|
package/preset.tailwind.js
CHANGED
|
@@ -10,14 +10,9 @@ import {
|
|
|
10
10
|
DEFAULT_RING,
|
|
11
11
|
DEFAULT_RING_OFFSET,
|
|
12
12
|
DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
13
|
-
DEFAULT_BRAND_COLOR,
|
|
14
|
-
DEFAULT_GRAY_COLOR,
|
|
15
|
-
GRAYSCALE_COLOR,
|
|
16
13
|
} from "./constants.js";
|
|
17
14
|
|
|
18
15
|
const isStrategyOverride = process.env.VUELESS_STRATEGY === "override";
|
|
19
|
-
const brandColor = process.env.VUELESS_BRAND || DEFAULT_BRAND_COLOR;
|
|
20
|
-
const grayColor = process.env.VUELESS_GRAY || DEFAULT_GRAY_COLOR;
|
|
21
16
|
|
|
22
17
|
/**
|
|
23
18
|
* Vueless Tailwind CSS `content` config.
|
|
@@ -81,9 +76,6 @@ export const vuelessTailwindConfig = {
|
|
|
81
76
|
fontSize: {
|
|
82
77
|
"2xs": ["0.625rem", "0.875rem"] /* 10px / 14px */,
|
|
83
78
|
},
|
|
84
|
-
borderRadius: {
|
|
85
|
-
dynamic: "var(--vl-rounding)",
|
|
86
|
-
},
|
|
87
79
|
ringWidth: {
|
|
88
80
|
dynamic: "var(--vl-ring)",
|
|
89
81
|
},
|
|
@@ -91,7 +83,10 @@ export const vuelessTailwindConfig = {
|
|
|
91
83
|
dynamic: "var(--vl-ring-offset)",
|
|
92
84
|
},
|
|
93
85
|
ringOffsetColor: {
|
|
94
|
-
dynamic:
|
|
86
|
+
dynamic: "var(--vl-ring-offset-color)",
|
|
87
|
+
},
|
|
88
|
+
borderRadius: {
|
|
89
|
+
dynamic: "var(--vl-rounding)",
|
|
95
90
|
},
|
|
96
91
|
},
|
|
97
92
|
configViewer: {
|
|
@@ -101,8 +96,8 @@ export const vuelessTailwindConfig = {
|
|
|
101
96
|
"var(--vl-ring-offset)": DEFAULT_RING_OFFSET,
|
|
102
97
|
"var(--vl-ring-offset-color)": DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
103
98
|
"var(--vl-rounding)": DEFAULT_ROUNDING,
|
|
104
|
-
...getReplacementColors(GRAY_COLOR,
|
|
105
|
-
...getReplacementColors(BRAND_COLOR,
|
|
99
|
+
...getReplacementColors(GRAY_COLOR, GRAY_COLOR),
|
|
100
|
+
...getReplacementColors(BRAND_COLOR, GRAY_COLOR),
|
|
106
101
|
},
|
|
107
102
|
},
|
|
108
103
|
},
|
|
@@ -146,7 +141,7 @@ function twColorWithOpacity(variableName) {
|
|
|
146
141
|
* @returns { Object } - TailwindCSS color object palette.
|
|
147
142
|
*/
|
|
148
143
|
function getPalette(color) {
|
|
149
|
-
|
|
144
|
+
let palette = {
|
|
150
145
|
DEFAULT: twColorWithOpacity(`--vl-color-${color}-default`),
|
|
151
146
|
};
|
|
152
147
|
|
|
@@ -164,10 +159,6 @@ function getPalette(color) {
|
|
|
164
159
|
* @returns { Object } - `tailwind-config-viewer` color replacement object.
|
|
165
160
|
*/
|
|
166
161
|
function getReplacementColors(color, tailwindColor) {
|
|
167
|
-
if (tailwindColor === GRAYSCALE_COLOR || tailwindColor === COOL_COLOR) {
|
|
168
|
-
tailwindColor = GRAY_COLOR;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
162
|
const varsPalette = {
|
|
172
163
|
[twColorWithOpacity(`--vl-color-${color}-default`)]: colors[tailwindColor][600],
|
|
173
164
|
};
|
package/ui.button/config.js
CHANGED
|
@@ -161,16 +161,4 @@ export default /*tw*/ {
|
|
|
161
161
|
loading: false,
|
|
162
162
|
disabled: false,
|
|
163
163
|
},
|
|
164
|
-
safelist: (colors) => [
|
|
165
|
-
{ pattern: `border-(${colors})-600` },
|
|
166
|
-
{ pattern: `border-(${colors})-700`, variants: ["hover", "focus"] },
|
|
167
|
-
{ pattern: `border-(${colors})-800`, variants: ["active"] },
|
|
168
|
-
{ pattern: `bg-(${colors})-600` },
|
|
169
|
-
{ pattern: `bg-(${colors})-700`, variants: ["hover", "focus"] },
|
|
170
|
-
{ pattern: `bg-(${colors})-800`, variants: ["active"] },
|
|
171
|
-
{ pattern: `text-(${colors})-600` },
|
|
172
|
-
{ pattern: `text-(${colors})-700`, variants: ["hover", "focus"] },
|
|
173
|
-
{ pattern: `text-(${colors})-800`, variants: ["active"] },
|
|
174
|
-
{ pattern: `ring-(${colors})-700`, variants: ["focus", "focus-within"] },
|
|
175
|
-
],
|
|
176
164
|
};
|
|
@@ -34,7 +34,7 @@ const DefaultTemplate = (args) => ({
|
|
|
34
34
|
`,
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
37
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
38
38
|
components: { UButton, URow, UCol },
|
|
39
39
|
setup() {
|
|
40
40
|
return { args, options: argTypes[args.enum].options };
|
|
@@ -54,7 +54,7 @@ const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
|
54
54
|
`,
|
|
55
55
|
});
|
|
56
56
|
|
|
57
|
-
const ColorTemplate = (args, { argTypes }) => ({
|
|
57
|
+
const ColorTemplate = (args, { argTypes } = {}) => ({
|
|
58
58
|
components: { UButton, URow, UCol },
|
|
59
59
|
setup() {
|
|
60
60
|
return {
|
package/ui.button-link/ULink.vue
CHANGED
package/ui.button-link/config.js
CHANGED
|
@@ -80,13 +80,4 @@ export default /*tw*/ {
|
|
|
80
80
|
custom: false,
|
|
81
81
|
replace: false,
|
|
82
82
|
},
|
|
83
|
-
safelist: (colors) => [
|
|
84
|
-
{ pattern: `text-(${colors})-600` },
|
|
85
|
-
{ pattern: `text-(${colors})-700`, variants: ["hover", "focus"] },
|
|
86
|
-
{ pattern: `text-(${colors})-800`, variants: ["active"] },
|
|
87
|
-
{ pattern: `decoration-(${colors})-600` },
|
|
88
|
-
{ pattern: `decoration-(${colors})-700`, variants: ["hover", "focus"] },
|
|
89
|
-
{ pattern: `decoration-(${colors})-800`, variants: ["active"] },
|
|
90
|
-
{ pattern: `ring-(${colors})-700`, variants: ["focus-within"] },
|
|
91
|
-
],
|
|
92
83
|
};
|
|
@@ -62,7 +62,7 @@ const DefaultTemplate = (args) => ({
|
|
|
62
62
|
`,
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
-
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
65
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
66
66
|
components: { UModal, UButton, URow, UInput, UTextarea },
|
|
67
67
|
setup() {
|
|
68
68
|
function onClick(value) {
|
|
@@ -57,7 +57,7 @@ const DefaultTemplate = (args) => ({
|
|
|
57
57
|
`,
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
-
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
60
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
61
61
|
components: { UModalConfirm, UButton, URow },
|
|
62
62
|
setup() {
|
|
63
63
|
function onClick(value) {
|
|
@@ -36,7 +36,7 @@ const DefaultTemplate = (args) => ({
|
|
|
36
36
|
`,
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
39
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
40
40
|
components: { UCol, URow, UInput, UButton },
|
|
41
41
|
setup() {
|
|
42
42
|
const isGapEnum = argTypes[args.enum].name === "gap";
|
|
@@ -366,20 +366,20 @@ function onClickDelete(value, label) {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
function prepareSortData(list, parentId) {
|
|
369
|
-
|
|
369
|
+
let sortData = [];
|
|
370
370
|
|
|
371
371
|
list.forEach((item) => {
|
|
372
|
-
|
|
372
|
+
let hasItemChildren = item?.children?.length;
|
|
373
373
|
|
|
374
374
|
if (hasItemChildren) {
|
|
375
|
-
|
|
375
|
+
let childrenItem = prepareSortData(item.children, item[props.valueKey]);
|
|
376
376
|
|
|
377
377
|
childrenItem.forEach((item) => {
|
|
378
378
|
sortData.push(item);
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
-
|
|
382
|
+
let parentItem = { ...item, parentId: 0 || parentId };
|
|
383
383
|
|
|
384
384
|
sortData.push(parentItem);
|
|
385
385
|
});
|
package/ui.data-table/UTable.vue
CHANGED
|
@@ -703,7 +703,7 @@ function onChangeSelectedRows(selectedRows) {
|
|
|
703
703
|
if (selectedRows.length) {
|
|
704
704
|
canSelectAll.value = false;
|
|
705
705
|
|
|
706
|
-
isCheckedMoreOneTableItems.value
|
|
706
|
+
isCheckedMoreOneTableItems.value ? setFooterCellWidth() : "";
|
|
707
707
|
} else {
|
|
708
708
|
nextTick(setHeaderCellWidth);
|
|
709
709
|
}
|
|
@@ -42,7 +42,7 @@ const DefaultTemplate = (args) => ({
|
|
|
42
42
|
`,
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
45
|
+
const EnumVariantTemplate = (args, { argTypes } = {}) => ({
|
|
46
46
|
components: { UDropdownButton, URow },
|
|
47
47
|
setup() {
|
|
48
48
|
return {
|
|
@@ -63,7 +63,7 @@ const EnumVariantTemplate = (args, { argTypes }) => ({
|
|
|
63
63
|
`,
|
|
64
64
|
});
|
|
65
65
|
|
|
66
|
-
const VariantColorsTemplate = (args, { argTypes }) => ({
|
|
66
|
+
const VariantColorsTemplate = (args, { argTypes } = {}) => ({
|
|
67
67
|
components: { UDropdownButton, URow, UCol },
|
|
68
68
|
setup() {
|
|
69
69
|
return {
|