vueless 0.0.551 → 0.0.553

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/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import type { App } from "vue";
2
2
  import type { CreateVuelessOptions } from "./types.ts";
3
- export { setTitle } from "./utils/helper.ts";
4
3
  export { setTheme } from "./utils/theme.ts";
4
+ export { cx, cva, compose } from "./utils/ui.ts";
5
+ export { isSSR, isCSR, getRandomId, setTitle, createDebounce } from "./utils/helper.ts";
6
+ export { isMac, isPWA, isIOS, isAndroid, isMobileApp, isWindows } from "./utils/platform.ts";
5
7
  export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n.js";
6
8
  export { default as defaultEnLocale } from "./adatper.locale/locales/en.js";
7
9
  export { useLocale } from "./composables/useLocale.ts";
package/index.ts CHANGED
@@ -7,8 +7,10 @@ import { themeInit } from "./utils/theme.ts";
7
7
  import type { App } from 'vue'
8
8
  import type { CreateVuelessOptions } from './types.ts'
9
9
 
10
- export { setTitle } from "./utils/helper.ts";
11
10
  export { setTheme } from "./utils/theme.ts";
11
+ export { cx, cva, compose } from "./utils/ui.ts";
12
+ export { isSSR, isCSR, getRandomId, setTitle, createDebounce } from "./utils/helper.ts";
13
+ export { isMac, isPWA, isIOS, isAndroid, isMobileApp, isWindows } from "./utils/platform.ts";
12
14
  export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n.js";
13
15
  export { default as defaultEnLocale } from "./adatper.locale/locales/en.js";
14
16
  export { useLocale } from "./composables/useLocale.ts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vueless",
3
- "version": "0.0.551",
3
+ "version": "0.0.553",
4
4
  "license": "MIT",
5
5
  "description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  import type { Meta, StoryFn } from "@storybook/vue3";
2
2
  import { getArgTypes, getSlotNames, getSlotsFragment } from "../../utils/storybook.ts";
3
- import { getRandomId } from "../../utils/ui.ts";
3
+ import { getRandomId } from "../../utils/helper.ts";
4
4
 
5
5
  import UTable from "../UTable.vue";
6
6
  import UButton from "../../ui.button/UButton.vue";
@@ -1,4 +1,4 @@
1
- import { getRandomId } from "../utils/ui.ts";
1
+ import { getRandomId } from "../utils/helper.ts";
2
2
 
3
3
  import type { Column, ColumnObject, Row, RowData, RowId } from "./types.ts";
4
4
 
@@ -123,6 +123,7 @@ export default /*tw*/ {
123
123
  dateTimeFormat: undefined,
124
124
  maxDate: undefined,
125
125
  minDate: undefined,
126
+ /* icons */
126
127
  rightIcon: "calendar_month-fill",
127
128
  },
128
129
  };
@@ -9,14 +9,14 @@ import type { UseAttrs } from "../types.ts";
9
9
  import type { UDatePickerProps, Config } from "./types.ts";
10
10
  import type { Config as UCalendarConfig } from "../ui.form-calendar/types.ts";
11
11
 
12
- interface DatePickerState {
12
+ interface ComponentState {
13
13
  isTop: Ref<boolean>;
14
14
  isRight: Ref<boolean>;
15
15
  }
16
16
 
17
17
  export default function useAttrs(
18
18
  props: UDatePickerProps<unknown>,
19
- { isTop, isRight }: DatePickerState,
19
+ { isTop, isRight }: ComponentState,
20
20
  ): UseAttrs<Config> {
21
21
  const { config, getKeysAttrs, hasSlotContent } = useUI(defaultConfig, () => props.config);
22
22
 
@@ -202,8 +202,8 @@ export default /*tw*/ {
202
202
  dateFormat: undefined,
203
203
  maxDate: undefined,
204
204
  minDate: undefined,
205
- rightIcon: "calendar_month-fill",
206
205
  /* icons */
206
+ rightIcon: "calendar_month-fill",
207
207
  nextIcon: "keyboard_arrow_right",
208
208
  prevIcon: "keyboard_arrow_left",
209
209
  ownRangeIcon: "apps",
@@ -73,7 +73,7 @@ watchEffect(() => {
73
73
  emit("update:modelValue", props.value);
74
74
  });
75
75
 
76
- function onChange(event: CustomEvent) {
76
+ function onChange(event: Event) {
77
77
  const target = event.target as HTMLInputElement;
78
78
 
79
79
  if (setRadioGroupSelectedItem) {
@@ -1,4 +1,5 @@
1
- import { getRandomId, vuelessConfig } from "../utils/ui.ts";
1
+ import { vuelessConfig } from "../utils/ui.ts";
2
+ import { getRandomId } from "../utils/helper.ts";
2
3
  import { DELAY_BETWEEN_CLONES, DURATION, LOCAL_STORAGE_ID, NOTIFY_TYPE } from "./constants.ts";
3
4
 
4
5
  interface NotifyConfig {
package/utils/helper.ts CHANGED
@@ -57,6 +57,22 @@ export function setTitle({ title = "", separator = " / ", suffix = "" }) {
57
57
  }
58
58
  }
59
59
 
60
+ /**
61
+ * Generates simple unique identifier.
62
+ */
63
+ export function getRandomId(length = 15) {
64
+ const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
65
+ const charactersLength = characters.length;
66
+
67
+ let id = "";
68
+
69
+ while (id.length < length) {
70
+ id += characters.charAt(Math.floor(Math.random() * charactersLength));
71
+ }
72
+
73
+ return id;
74
+ }
75
+
60
76
  /**
61
77
  * Check is code rendering on the server side.
62
78
  */
package/utils/ui.ts CHANGED
@@ -127,19 +127,3 @@ export function getColor(color: string) {
127
127
  export function setColor(classes: string, color: string) {
128
128
  return classes?.replace(/{color}/g, color);
129
129
  }
130
-
131
- /**
132
- * Generates simple unique identifier.
133
- */
134
- export function getRandomId(length = 15) {
135
- const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
136
- const charactersLength = characters.length;
137
-
138
- let id = "";
139
-
140
- while (id.length < length) {
141
- id += characters.charAt(Math.floor(Math.random() * charactersLength));
142
- }
143
-
144
- return id;
145
- }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "framework": "vue",
3
3
  "name": "vueless",
4
- "version": "0.0.551",
4
+ "version": "0.0.553",
5
5
  "contributions": {
6
6
  "html": {
7
7
  "description-markup": "markdown",