vueless 0.0.588 → 0.0.590

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/constants.js CHANGED
@@ -72,8 +72,8 @@ export const SYSTEM_CONFIG_KEY = {
72
72
  ...CVA_CONFIG_KEY,
73
73
  };
74
74
 
75
- /* Vueless system non-props defaults */
76
- export const SYSTEM_NON_PROPS_DEFAULTS = ["library", "style", "weight"];
75
+ /* UIcon non-props defaults */
76
+ export const ICON_NON_PROPS_DEFAULTS = ["library", "path", "style", "weight"];
77
77
 
78
78
  /* Component to folder mapping. */
79
79
  export const COMPONENTS = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.588",
3
+ "version": "0.0.590",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -559,6 +559,8 @@ function onClickSubmit() {
559
559
  emit("submit");
560
560
  }
561
561
 
562
+ let timeInputCount = 0;
563
+
562
564
  function onClickTimeInput(event: MouseEvent) {
563
565
  const input = event.target as HTMLInputElement;
564
566
 
@@ -568,6 +570,8 @@ function onClickTimeInput(event: MouseEvent) {
568
570
  function onFocusTimeInput(event: FocusEvent) {
569
571
  const input = event.target as HTMLInputElement;
570
572
 
573
+ timeInputCount = 0;
574
+
571
575
  selectTimeInput(input);
572
576
  }
573
577
 
@@ -578,6 +582,8 @@ function selectTimeInput(input: HTMLInputElement) {
578
582
  }
579
583
 
580
584
  function onTimeInput(event: InputEvent, type: InputType) {
585
+ timeInputCount += 1;
586
+
581
587
  const input = event.target as HTMLInputElement;
582
588
  const value = input.value;
583
589
  const numericValue = Number(value);
@@ -666,6 +672,22 @@ function onTimeInput(event: InputEvent, type: InputType) {
666
672
  }
667
673
 
668
674
  input.value = String(numericValue).padStart(2, "0");
675
+
676
+ if (timeInputCount >= 2) {
677
+ if (isHours && minutesRef.value) {
678
+ minutesRef.value.focus();
679
+ }
680
+
681
+ if (isMinutes && secondsRef.value) {
682
+ secondsRef.value.focus();
683
+ }
684
+
685
+ if (isSeconds && okButton.value) {
686
+ okButton.value.buttonRef?.focus();
687
+ }
688
+
689
+ timeInputCount = 0;
690
+ }
669
691
  }
670
692
 
671
693
  defineExpose({
@@ -49,6 +49,7 @@ const dynamicComponent = computed(() => {
49
49
  const userLibrary = config.value.defaults.library as IconLibraries;
50
50
 
51
51
  const library = props.internal && isInternalIcon ? VUELESS_LIBRARY : userLibrary;
52
+ const customLibraryPath = config.value.defaults.path;
52
53
  const weight = config.value.defaults.weight;
53
54
  const style = config.value.defaults.style;
54
55
  const isFill = props.name?.endsWith(FILL_SUFFIX);
@@ -109,6 +110,13 @@ const dynamicComponent = computed(() => {
109
110
  ? import(/* @vite-ignore */ `node_modules/${library}/24/${fillType}/${name}.svg?component`)
110
111
  : import(/* @vite-ignore */ `/node_modules/${library}/24/${fillType}/${name}.svg?component`);
111
112
  },
113
+ "custom-icons": async () => {
114
+ return import.meta.env.PROD
115
+ ? await getIcon([library, name])
116
+ : isSSR
117
+ ? import(/* @vite-ignore */ `${customLibraryPath}/${name}.svg?component`)
118
+ : import(/* @vite-ignore */ `/${customLibraryPath}/${name}.svg?component`);
119
+ },
112
120
  };
113
121
  /* eslint-enable prettier/prettier */
114
122
 
@@ -38,6 +38,7 @@ export default /*tw*/ {
38
38
  interactive: false,
39
39
  /* icon library */
40
40
  library: "@material-symbols",
41
+ path: "", // set for `custom-icons` library only.
41
42
  style: "outlined",
42
43
  weight: 500,
43
44
  },
@@ -7,7 +7,12 @@ import type { Props as TippyProps } from "tippy.js";
7
7
 
8
8
  export type Config = typeof defaultConfig;
9
9
 
10
- export type IconLibraries = "vueless" | "@material-symbols" | "bootstrap-icons" | "heroicons";
10
+ export type IconLibraries =
11
+ | "vueless"
12
+ | "@material-symbols"
13
+ | "bootstrap-icons"
14
+ | "heroicons"
15
+ | "custom-icons";
11
16
 
12
17
  export interface Props {
13
18
  /**
@@ -261,6 +261,7 @@ function copyIcon(name, defaults) {
261
261
  * @returns {source: string, destination: string}
262
262
  */
263
263
  function getIconLibraryPaths(name, defaults) {
264
+ const customLibraryPath = defaults.path;
264
265
  const library = defaults.library;
265
266
  const weight = defaults.weight;
266
267
  const style = defaults.style;
@@ -283,7 +284,11 @@ function getIconLibraryPaths(name, defaults) {
283
284
  "heroicons": {
284
285
  source: `${cwd}/node_modules/${library}/24/${name.endsWith("-fill") ? "solid" : "outline"}/${name}.svg`,
285
286
  destination: `${cacheIconsPath}/${library}/24/${style}/${name.endsWith("-fill") ? "solid" : "outline"}/${name}.svg`
286
- }
287
+ },
288
+ "custom-icons": {
289
+ source: `${cwd}/${customLibraryPath}/${name}.svg`,
290
+ destination: `${cacheIconsPath}/${library}/${name}.svg`
291
+ },
287
292
  };
288
293
  /* eslint-enable prettier/prettier, vue/max-len */
289
294
 
package/utils/ui.ts CHANGED
@@ -3,12 +3,13 @@ import { defineConfig } from "cva";
3
3
  import { extendTailwindMerge } from "tailwind-merge";
4
4
  import { cloneDeep, isCSR, isSSR } from "./helper.ts";
5
5
  import { createGetMergedConfig } from "./node/mergeConfigs.js";
6
+ import { UIcon } from "../ui.image-icon/constants.ts";
6
7
  import {
7
8
  BRAND_COLOR,
8
9
  GRAYSCALE_COLOR,
9
10
  DEFAULT_BRAND_COLOR,
11
+ ICON_NON_PROPS_DEFAULTS,
10
12
  TAILWIND_MERGE_EXTENSION,
11
- SYSTEM_NON_PROPS_DEFAULTS,
12
13
  NESTED_COMPONENT_PATTERN_REG_EXP,
13
14
  } from "../constants.js";
14
15
 
@@ -110,8 +111,9 @@ export function getDefaults<Props, Config>(defaultConfig: Config, name: Componen
110
111
  /* Remove non a props defaults. */
111
112
  for (const key in defaults) {
112
113
  const isNonPropIcon = /Icon/.test(key) && !/(leftIcon|rightIcon)/.test(key);
114
+ const isNonPropIconDefaults = ICON_NON_PROPS_DEFAULTS.includes(key) && name === UIcon;
113
115
 
114
- if (SYSTEM_NON_PROPS_DEFAULTS.includes(key) || isNonPropIcon) {
116
+ if (isNonPropIcon || isNonPropIconDefaults) {
115
117
  delete defaults[key];
116
118
  }
117
119
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.588",
4
+ "version": "0.0.590",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",