@unsource/ui 2.9.46 → 2.9.48

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.
@@ -1,3 +1,3 @@
1
- {
2
- "eslint.experimental.useFlatConfig": true
3
- }
1
+ {
2
+ "eslint.experimental.useFlatConfig": true
3
+ }
package/README.md CHANGED
@@ -1,84 +1,84 @@
1
- <!--
2
- Get your module up and running quickly.
3
-
4
- Find and replace all on all files (CMD+SHIFT+F):
5
- - Name: My Module
6
- - Package name: my-module
7
- - Description: My new Nuxt module
8
- -->
9
-
10
- # My Module
11
-
12
- [![npm version][npm-version-src]][npm-version-href]
13
- [![npm downloads][npm-downloads-src]][npm-downloads-href]
14
- [![License][license-src]][license-href]
15
- [![Nuxt][nuxt-src]][nuxt-href]
16
-
17
- My new Nuxt module for doing amazing things.
18
-
19
- - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
- <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
21
- <!-- - [📖 &nbsp;Documentation](https://example.com) -->
22
-
23
- ## Features
24
-
25
- <!-- Highlight some of the features your module provide here -->
26
- - ⛰ &nbsp;Foo
27
- - 🚠 &nbsp;Bar
28
- - 🌲 &nbsp;Baz
29
-
30
- ## Quick Setup
31
-
32
- Install the module to your Nuxt application with one command:
33
-
34
- ```bash
35
- npx nuxi module add my-module
36
- ```
37
-
38
- That's it! You can now use My Module in your Nuxt app ✨
39
-
40
-
41
- ## Contribution
42
-
43
- <details>
44
- <summary>Local development</summary>
45
-
46
- ```bash
47
- # Install dependencies
48
- npm install
49
-
50
- # Generate type stubs
51
- npm run dev:prepare
52
-
53
- # Develop with the playground
54
- npm run dev
55
-
56
- # Build the playground
57
- npm run dev:build
58
-
59
- # Run ESLint
60
- npm run lint
61
-
62
- # Run Vitest
63
- npm run test
64
- npm run test:watch
65
-
66
- # Release new version
67
- npm run release
68
- ```
69
-
70
- </details>
71
-
72
-
73
- <!-- Badges -->
74
- [npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
75
- [npm-version-href]: https://npmjs.com/package/my-module
76
-
77
- [npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
78
- [npm-downloads-href]: https://npm.chart.dev/my-module
79
-
80
- [license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
81
- [license-href]: https://npmjs.com/package/my-module
82
-
83
- [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
84
- [nuxt-href]: https://nuxt.com
1
+ <!--
2
+ Get your module up and running quickly.
3
+
4
+ Find and replace all on all files (CMD+SHIFT+F):
5
+ - Name: My Module
6
+ - Package name: my-module
7
+ - Description: My new Nuxt module
8
+ -->
9
+
10
+ # My Module
11
+
12
+ [![npm version][npm-version-src]][npm-version-href]
13
+ [![npm downloads][npm-downloads-src]][npm-downloads-href]
14
+ [![License][license-src]][license-href]
15
+ [![Nuxt][nuxt-src]][nuxt-href]
16
+
17
+ My new Nuxt module for doing amazing things.
18
+
19
+ - [✨ &nbsp;Release Notes](/CHANGELOG.md)
20
+ <!-- - [🏀 Online playground](https://stackblitz.com/github/your-org/my-module?file=playground%2Fapp.vue) -->
21
+ <!-- - [📖 &nbsp;Documentation](https://example.com) -->
22
+
23
+ ## Features
24
+
25
+ <!-- Highlight some of the features your module provide here -->
26
+ - ⛰ &nbsp;Foo
27
+ - 🚠 &nbsp;Bar
28
+ - 🌲 &nbsp;Baz
29
+
30
+ ## Quick Setup
31
+
32
+ Install the module to your Nuxt application with one command:
33
+
34
+ ```bash
35
+ npx nuxi module add my-module
36
+ ```
37
+
38
+ That's it! You can now use My Module in your Nuxt app ✨
39
+
40
+
41
+ ## Contribution
42
+
43
+ <details>
44
+ <summary>Local development</summary>
45
+
46
+ ```bash
47
+ # Install dependencies
48
+ npm install
49
+
50
+ # Generate type stubs
51
+ npm run dev:prepare
52
+
53
+ # Develop with the playground
54
+ npm run dev
55
+
56
+ # Build the playground
57
+ npm run dev:build
58
+
59
+ # Run ESLint
60
+ npm run lint
61
+
62
+ # Run Vitest
63
+ npm run test
64
+ npm run test:watch
65
+
66
+ # Release new version
67
+ npm run release
68
+ ```
69
+
70
+ </details>
71
+
72
+
73
+ <!-- Badges -->
74
+ [npm-version-src]: https://img.shields.io/npm/v/my-module/latest.svg?style=flat&colorA=020420&colorB=00DC82
75
+ [npm-version-href]: https://npmjs.com/package/my-module
76
+
77
+ [npm-downloads-src]: https://img.shields.io/npm/dm/my-module.svg?style=flat&colorA=020420&colorB=00DC82
78
+ [npm-downloads-href]: https://npm.chart.dev/my-module
79
+
80
+ [license-src]: https://img.shields.io/npm/l/my-module.svg?style=flat&colorA=020420&colorB=00DC82
81
+ [license-href]: https://npmjs.com/package/my-module
82
+
83
+ [nuxt-src]: https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js
84
+ [nuxt-href]: https://nuxt.com
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unsource-ui",
3
3
  "configKey": "unsourceUi",
4
- "version": "2.9.46",
4
+ "version": "2.9.48",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -8,6 +8,16 @@ type __VLS_Props = {
8
8
  customClass?: CheckboxCustomClass;
9
9
  disabled?: boolean;
10
10
  };
11
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare var __VLS_9: any, __VLS_10: any;
12
+ type __VLS_Slots = {} & {
13
+ [K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
17
  declare const _default: typeof __VLS_export;
13
18
  export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -20,11 +20,22 @@
20
20
  :class="customClass.card"
21
21
  :custom-class="customClass.item"
22
22
  :item
23
- />
23
+ >
24
+ <template
25
+ v-for="(_, name) in slots"
26
+ #[name]="slotProps"
27
+ >
28
+ <slot
29
+ :name="name"
30
+ v-bind="slotProps"
31
+ />
32
+ </template>
33
+ </UnCard>
24
34
  </div>
25
35
  </template>
26
36
 
27
37
  <script setup>
38
+ import { useSlots } from "#imports";
28
39
  const emit = defineEmits(["input"]);
29
40
  const { customClass = {} } = defineProps({
30
41
  item: { type: Object, required: true },
@@ -35,4 +46,5 @@ const { customClass = {} } = defineProps({
35
46
  const toggle = () => {
36
47
  emit("input");
37
48
  };
49
+ const slots = useSlots();
38
50
  </script>
@@ -8,6 +8,16 @@ type __VLS_Props = {
8
8
  customClass?: CheckboxCustomClass;
9
9
  disabled?: boolean;
10
10
  };
11
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
+ declare var __VLS_9: any, __VLS_10: any;
12
+ type __VLS_Slots = {} & {
13
+ [K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
14
+ };
15
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
12
17
  declare const _default: typeof __VLS_export;
13
18
  export default _default;
19
+ type __VLS_WithSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -1,28 +1,28 @@
1
1
  <template>
2
- <div
3
- class="flex flex-col p-3 bg-white rounded-2xl gap-4"
4
- >
5
- <div
6
- :class="customClass?.header"
7
- class="cursor-pointer flex items-center justify-between"
8
- @click="show = !show"
9
- >
10
- <UnCard
11
- :item="{ avatar: icon, title, tags, description }"
12
- :class="customClass.card"
13
- :custom-class="customClass.cardInside"
14
- />
15
- <UnNuxtIcon
16
- :class="customClass?.collapsibleIcon"
17
- :name="collapsibleIcon || 'solar:alt-arrow-down-bold-duotone'"
18
- class="transition-all duration-300"
19
- :style="{ rotate: show && !noRotate ? '180deg' : '0deg' }"
20
- />
21
- </div>
22
- <template v-if="show">
23
- <slot />
24
- </template>
25
- </div>
2
+ <div
3
+ class="flex flex-col p-3 bg-white rounded-2xl gap-4"
4
+ >
5
+ <div
6
+ :class="customClass?.header"
7
+ class="cursor-pointer flex items-center justify-between"
8
+ @click="show = !show"
9
+ >
10
+ <UnCard
11
+ :item="{ avatar: icon, title, tags, description }"
12
+ :class="customClass.card"
13
+ :custom-class="customClass.cardInside"
14
+ />
15
+ <UnNuxtIcon
16
+ :class="customClass?.collapsibleIcon"
17
+ :name="collapsibleIcon || 'solar:alt-arrow-down-bold-duotone'"
18
+ class="transition-all duration-300"
19
+ :style="{ rotate: show && !noRotate ? '180deg' : '0deg' }"
20
+ />
21
+ </div>
22
+ <template v-if="show">
23
+ <slot />
24
+ </template>
25
+ </div>
26
26
  </template>
27
27
 
28
28
  <script setup>
@@ -1,30 +1,30 @@
1
1
  <template>
2
- <div
3
- class="flex flex-col p-3 bg-white rounded-2xl gap-4"
4
- >
5
- <div
6
- v-if="title || $slots.default"
7
- :class="customClass?.header"
8
- class="flex items-center justify-between"
9
- >
10
- <h3
11
- v-if="title"
12
- :class="customClass?.title"
13
- class="text-(lg gray-600) font-semibold"
14
- >
15
- {{ title }}
16
- </h3>
17
- <slot />
18
- </div>
19
- <UnCard
20
- v-for="(item, index) in items"
21
- :key="index"
22
- :class="customClass.items"
23
- :custom-class="customClass.item"
24
- :item="item"
25
- :to="to?.(item)"
26
- />
27
- </div>
2
+ <div
3
+ class="flex flex-col p-3 bg-white rounded-2xl gap-4"
4
+ >
5
+ <div
6
+ v-if="title || $slots.default"
7
+ :class="customClass?.header"
8
+ class="flex items-center justify-between"
9
+ >
10
+ <h3
11
+ v-if="title"
12
+ :class="customClass?.title"
13
+ class="text-(lg gray-600) font-semibold"
14
+ >
15
+ {{ title }}
16
+ </h3>
17
+ <slot />
18
+ </div>
19
+ <UnCard
20
+ v-for="(item, index) in items"
21
+ :key="index"
22
+ :class="customClass.items"
23
+ :custom-class="customClass.item"
24
+ :item="item"
25
+ :to="to?.(item)"
26
+ />
27
+ </div>
28
28
  </template>
29
29
 
30
30
  <script setup>
@@ -1,52 +1,52 @@
1
1
  <template>
2
- <div class="grow flex flex-col gap-3">
3
- <div class="flex flex-col items-stretch gap-3 grow-1 p-4">
4
- <UnCard
5
- v-for="(item, index) in items.filter((e) => !e.disable)"
6
- :key="index"
2
+ <div class="grow flex flex-col gap-3">
3
+ <div class="flex flex-col items-stretch gap-3 grow-1 p-4">
4
+ <UnCard
5
+ v-for="(item, index) in items.filter((e) => !e.disable)"
6
+ :key="index"
7
7
  :custom-class="_mergeWith(customClass.item, {
8
8
  logo: '!w-8 !h-8 !border-none !rounded-0',
9
9
  body: '!items-center'
10
- }, merge)"
11
- :class="customClass.items"
12
- :to="item.to"
13
- :item="item"
14
- @click="item.handler?.()"
15
- >
16
- <template #header>
17
- <UnNuxtIcon
18
- :class="customClass.appendIcon"
19
- :name="item.appendIcon || 'solar:alt-arrow-left-line-duotone'"
20
- class="text-sm"
21
- />
22
- </template>
23
- </UnCard>
24
- </div>
25
- <div class="grow" />
26
- <div class="flex flex-col gap-2 text-sm text-center self-stretch">
27
- <slot>
28
- <NuxtLink
29
- v-if="developer"
30
- :to="developerLink || '#'"
31
- target="_blank"
32
- class="flex justify-center gap-1 self-center"
33
- >طراحی و توسعه توسط <span class="text-blue-6 font-bold">{{ developer }}</span>
34
- <UnNuxtIcon
35
- v-if="developerIcon"
36
- :name="developerIcon"
37
- class="!text-xl"
38
- />
39
- </NuxtLink>
40
- <p v-if="owner">
41
- کلیه حقوق مادی و معنوی این نرم‌افزار متعلق به شرکت <span class="text-primary-500 font-bold">{{ owner }}</span>
42
- می‌باشد.
43
- </p>
44
- <p v-if="version">
45
- V{{ version }}
46
- </p>
47
- </slot>
48
- </div>
49
- </div>
10
+ }, merge)"
11
+ :class="customClass.items"
12
+ :to="item.to"
13
+ :item="item"
14
+ @click="item.handler?.()"
15
+ >
16
+ <template #header>
17
+ <UnNuxtIcon
18
+ :class="customClass.appendIcon"
19
+ :name="item.appendIcon || 'solar:alt-arrow-left-line-duotone'"
20
+ class="text-sm"
21
+ />
22
+ </template>
23
+ </UnCard>
24
+ </div>
25
+ <div class="grow" />
26
+ <div class="flex flex-col gap-2 text-sm text-center self-stretch">
27
+ <slot>
28
+ <NuxtLink
29
+ v-if="developer"
30
+ :to="developerLink || '#'"
31
+ target="_blank"
32
+ class="flex justify-center gap-1 self-center"
33
+ >طراحی و توسعه توسط <span class="text-blue-6 font-bold">{{ developer }}</span>
34
+ <UnNuxtIcon
35
+ v-if="developerIcon"
36
+ :name="developerIcon"
37
+ class="!text-xl"
38
+ />
39
+ </NuxtLink>
40
+ <p v-if="owner">
41
+ کلیه حقوق مادی و معنوی این نرم‌افزار متعلق به شرکت <span class="text-primary-500 font-bold">{{ owner }}</span>
42
+ می‌باشد.
43
+ </p>
44
+ <p v-if="version">
45
+ V{{ version }}
46
+ </p>
47
+ </slot>
48
+ </div>
49
+ </div>
50
50
  </template>
51
51
 
52
52
  <script setup>
@@ -14,6 +14,16 @@ type __VLS_Props = {
14
14
  disabled?: boolean;
15
15
  infoIcon?: string;
16
16
  };
17
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare var __VLS_9: any, __VLS_10: any;
18
+ type __VLS_Slots = {} & {
19
+ [K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
20
+ };
21
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
23
  declare const _default: typeof __VLS_export;
19
24
  export default _default;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -1,31 +1,42 @@
1
1
  <template>
2
- <div
3
- class="relative select-none group px-4 py-3 flex flex-row items-center gap-3 transition duration-300 hover:bg-primary-500/10 border-0 min-w-fit"
4
- :class="{ 'opacity-50 grayscale': disabled, 'disable': disabled, 'selected': selected }"
5
- @click.prevent.stop="toggle"
6
- >
7
- <div
8
- name="radio"
9
- :class="customClass.radio"
10
- class="group-[.disable]:border-secondary border-(1 solid primary) rounded-1/2 w-4 h-4 flex justify-center items-center"
11
- >
12
- <div
13
- name="radioInside"
14
- class="bg-primary-500 rounded-1/2 h-10px w-10px transition-opacity duration-200"
15
- :class="[customClass.radioInside, selected ? 'opacity-full' : 'opacity-0']"
16
- />
17
- </div>
18
- <UnCard
19
- :item="item"
20
- class="!bg-transparent grow-1"
21
- :class="customClass.card"
22
- :custom-class="customClass.item"
23
- :info-icon="infoIcon"
24
- />
25
- </div>
2
+ <div
3
+ class="relative select-none group px-4 py-3 flex flex-row items-center gap-3 transition duration-300 hover:bg-primary-500/10 border-0 min-w-fit"
4
+ :class="{ 'opacity-50 grayscale': disabled, 'disable': disabled, 'selected': selected }"
5
+ @click.prevent.stop="toggle"
6
+ >
7
+ <div
8
+ name="radio"
9
+ :class="customClass.radio"
10
+ class="group-[.disable]:border-secondary border-(1 solid primary) rounded-1/2 w-4 h-4 flex justify-center items-center"
11
+ >
12
+ <div
13
+ name="radioInside"
14
+ class="bg-primary-500 rounded-1/2 h-10px w-10px transition-opacity duration-200"
15
+ :class="[customClass.radioInside, selected ? 'opacity-full' : 'opacity-0']"
16
+ />
17
+ </div>
18
+ <UnCard
19
+ :item="item"
20
+ class="!bg-transparent grow-1"
21
+ :class="customClass.card"
22
+ :custom-class="customClass.item"
23
+ :info-icon="infoIcon"
24
+ >
25
+ <template
26
+ v-for="(_, name) in slots"
27
+ #[name]="slotProps"
28
+ >
29
+ <slot
30
+ :name="name"
31
+ v-bind="slotProps"
32
+ />
33
+ </template>
34
+ </UnCard>
35
+ </div>
26
36
  </template>
27
37
 
28
38
  <script setup>
39
+ import { useSlots } from "#imports";
29
40
  const emit = defineEmits(["input"]);
30
41
  const { customClass = {}, disabled } = defineProps({
31
42
  value: { type: null, required: true },
@@ -39,4 +50,5 @@ const toggle = () => {
39
50
  if (disabled) return;
40
51
  emit("input");
41
52
  };
53
+ const slots = useSlots();
42
54
  </script>
@@ -14,6 +14,16 @@ type __VLS_Props = {
14
14
  disabled?: boolean;
15
15
  infoIcon?: string;
16
16
  };
17
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
17
+ declare var __VLS_9: any, __VLS_10: any;
18
+ type __VLS_Slots = {} & {
19
+ [K in NonNullable<typeof __VLS_9>]?: (props: typeof __VLS_10) => any;
20
+ };
21
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
22
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
23
  declare const _default: typeof __VLS_export;
19
24
  export default _default;
25
+ type __VLS_WithSlots<T, S> = T & {
26
+ new (): {
27
+ $slots: S;
28
+ };
29
+ };
@@ -23,10 +23,22 @@ type __VLS_ModelProps = {
23
23
  modelValue?: any;
24
24
  };
25
25
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
26
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ declare var __VLS_35: any, __VLS_36: any, __VLS_56: any, __VLS_57: any;
27
+ type __VLS_Slots = {} & {
28
+ [K in NonNullable<typeof __VLS_35>]?: (props: typeof __VLS_36) => any;
29
+ } & {
30
+ [K in NonNullable<typeof __VLS_56>]?: (props: typeof __VLS_57) => any;
31
+ };
32
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
33
  "update:modelValue": (value: any) => any;
28
34
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
29
35
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
30
36
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
38
  declare const _default: typeof __VLS_export;
32
39
  export default _default;
40
+ type __VLS_WithSlots<T, S> = T & {
41
+ new (): {
42
+ $slots: S;
43
+ };
44
+ };
@@ -38,9 +38,9 @@
38
38
  >
39
39
  <div
40
40
  v-show="show && !readonly || inline"
41
+ ref="list"
41
42
  v-on-click-outside="close"
42
43
  name="wrapper"
43
- ref="list"
44
44
  :style="!isMobile && !inline && dropdownStyles"
45
45
  class="z-1000 md:mt-3 rounded-2xl w-auto <md:w-full min-w-fit text-base flex flex-col items-stretch overflow-y-auto scrollbar-thin"
46
46
  :class="[
@@ -79,7 +79,17 @@
79
79
  :selected="value?.includes?.(Value(option))"
80
80
  :disabled="option.disable"
81
81
  @click="handleSelect(option)"
82
- />
82
+ >
83
+ <template
84
+ v-for="(_, name) in slots"
85
+ #[name]="slotProps"
86
+ >
87
+ <slot
88
+ :name="name"
89
+ v-bind="slotProps"
90
+ />
91
+ </template>
92
+ </UnCheckboxItem>
83
93
  <UnButton
84
94
  v-if="!inline"
85
95
  variant="primary-fill"
@@ -101,7 +111,17 @@
101
111
  :disabled="option.disable"
102
112
  class="!min-w-60"
103
113
  @click="handleSelect(option)"
104
- />
114
+ >
115
+ <template
116
+ v-for="(_, name) in slots"
117
+ #[name]="slotProps"
118
+ >
119
+ <slot
120
+ :name="name"
121
+ v-bind="slotProps"
122
+ />
123
+ </template>
124
+ </UnRadioItem>
105
125
  </template>
106
126
  </div>
107
127
  </div>
@@ -130,6 +150,7 @@ const id = useId();
130
150
  const value = defineModel({ type: null });
131
151
  const show = ref(false);
132
152
  const search = ref("");
153
+ const slots = useSlots();
133
154
  const Searchable = computed(() => searchable && items?.length > 8);
134
155
  const searchedOptions = computed(() => {
135
156
  if (!search.value) return items;
@@ -23,10 +23,22 @@ type __VLS_ModelProps = {
23
23
  modelValue?: any;
24
24
  };
25
25
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
26
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
26
+ declare var __VLS_35: any, __VLS_36: any, __VLS_56: any, __VLS_57: any;
27
+ type __VLS_Slots = {} & {
28
+ [K in NonNullable<typeof __VLS_35>]?: (props: typeof __VLS_36) => any;
29
+ } & {
30
+ [K in NonNullable<typeof __VLS_56>]?: (props: typeof __VLS_57) => any;
31
+ };
32
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
33
  "update:modelValue": (value: any) => any;
28
34
  }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
29
35
  "onUpdate:modelValue"?: ((value: any) => any) | undefined;
30
36
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
37
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
38
  declare const _default: typeof __VLS_export;
32
39
  export default _default;
40
+ type __VLS_WithSlots<T, S> = T & {
41
+ new (): {
42
+ $slots: S;
43
+ };
44
+ };
@@ -1,79 +1,79 @@
1
1
  <template>
2
- <tr
3
- class="children:p-3 <md:children:p-1 text-center border-b-(2 solid border) hover:bg-primary-500/10"
4
- :class="[trClass?.(item, items), { '!bg-primary-500/20': selected?.[idKey] === item[idKey] }]"
2
+ <tr
3
+ class="children:p-3 <md:children:p-1 text-center border-b-(2 solid border) hover:bg-primary-500/10"
4
+ :class="[trClass?.(item, items), { '!bg-primary-500/20': selected?.[idKey] === item[idKey] }]"
5
5
  @click="$emit('click:row', item);
6
- selected = item"
7
- @dbclick="$emit('dbclick:row', item)"
8
- >
9
- <td
10
- v-if="parentKey"
11
- class="!max-w-1 !w-1"
12
- :style="{ paddingInlineStart: level * 10 + 5 + 'px' }"
13
- >
14
- <UnNuxtIcon
15
- v-if="subItems?.length"
16
- class="cursor-pointer w-5 h-5"
17
- :name="open ? 'solar:folder-open-broken' : 'solar:add-folder-broken'"
18
- @click="open = !open"
19
- />
20
- </td>
21
- <td
22
- v-for="col in cols.filter((e) => !e.disabled)"
23
- :key="col.name + '-td'"
24
- class="text-gray-400 text-sm text-center first:rounded-l-lg last:rounded-r-lg"
25
- :style="{ paddingInlineStart: parentKey ? level * 10 + 5 + 'px' : 'unset' }"
26
- :class="[col.classHandler?.(item, col, items, cols), col.class, { '<md:hidden': col.isDesktop, 'hidden <md:table-cell': col.isMobile }, tdClass]"
27
- :dir="col.dir"
28
- >
29
- <slot
30
- :name="col.name"
31
- :col="col"
32
- :item="item"
33
- :items="_at(item, col.key)"
34
- :index="col.name + '-slot'"
35
- >
36
- <div class="flex flex-col gap-0.5">
37
- <p :class="textClass">
38
- {{ col.handler ? col.handler(_at(item, col.key), item, col, items, cols) : _at(item, col.key).join(" ") }}
39
- </p>
40
- <small
41
- v-if="col.subKey?.length"
42
- class="font-500 text-gray-600 text-xs"
43
- >{{ _at(item, col.subKey).join(" ") }}</small>
44
- </div>
45
- </slot>
46
- </td>
47
- <td
48
- v-if="parentKey"
49
- class="!max-w-1 !w-1 !p-1"
50
- >
51
- <UnNuxtIcon
52
- class="cursor-pointer w-5 h-5"
53
- name="solar:add-circle-broken"
54
- @click="$emit('add:row', item)"
55
- />
56
- </td>
57
- </tr>
58
- <template v-if="parentKey && subItems?.length && open">
59
- <UnTableRow
60
- v-for="(i, index) in subItems"
61
- :key="index"
62
- v-model="selected"
63
- :item="i"
64
- :items
65
- :cols
66
- :parent-key
67
- :level="level + 1"
68
- :id-key
69
- :text-class
70
- :td-class
71
- :tr-class
72
- @click:row="$emit('click:row', i)"
73
- @dbclick:row="$emit('dbclick:row', i)"
74
- @add:row="$emit('add:row', i)"
75
- />
76
- </template>
6
+ selected = item"
7
+ @dbclick="$emit('dbclick:row', item)"
8
+ >
9
+ <td
10
+ v-if="parentKey"
11
+ class="!max-w-1 !w-1"
12
+ :style="{ paddingInlineStart: level * 10 + 5 + 'px' }"
13
+ >
14
+ <UnNuxtIcon
15
+ v-if="subItems?.length"
16
+ class="cursor-pointer w-5 h-5"
17
+ :name="open ? 'solar:folder-open-broken' : 'solar:add-folder-broken'"
18
+ @click="open = !open"
19
+ />
20
+ </td>
21
+ <td
22
+ v-for="col in cols.filter((e) => !e.disabled)"
23
+ :key="col.name + '-td'"
24
+ class="text-gray-400 text-sm text-center first:rounded-l-lg last:rounded-r-lg"
25
+ :style="{ paddingInlineStart: parentKey ? level * 10 + 5 + 'px' : 'unset' }"
26
+ :class="[col.classHandler?.(item, col, items, cols), col.class, { '<md:hidden': col.isDesktop, 'hidden <md:table-cell': col.isMobile }, tdClass]"
27
+ :dir="col.dir"
28
+ >
29
+ <slot
30
+ :name="col.name"
31
+ :col="col"
32
+ :item="item"
33
+ :items="_at(item, col.key)"
34
+ :index="col.name + '-slot'"
35
+ >
36
+ <div class="flex flex-col gap-0.5">
37
+ <p :class="textClass">
38
+ {{ col.handler ? col.handler(_at(item, col.key), item, col, items, cols) : _at(item, col.key).join(" ") }}
39
+ </p>
40
+ <small
41
+ v-if="col.subKey?.length"
42
+ class="font-500 text-gray-600 text-xs"
43
+ >{{ _at(item, col.subKey).join(" ") }}</small>
44
+ </div>
45
+ </slot>
46
+ </td>
47
+ <td
48
+ v-if="parentKey"
49
+ class="!max-w-1 !w-1 !p-1"
50
+ >
51
+ <UnNuxtIcon
52
+ class="cursor-pointer w-5 h-5"
53
+ name="solar:add-circle-broken"
54
+ @click="$emit('add:row', item)"
55
+ />
56
+ </td>
57
+ </tr>
58
+ <template v-if="parentKey && subItems?.length && open">
59
+ <UnTableRow
60
+ v-for="(i, index) in subItems"
61
+ :key="index"
62
+ v-model="selected"
63
+ :item="i"
64
+ :items
65
+ :cols
66
+ :parent-key
67
+ :level="level + 1"
68
+ :id-key
69
+ :text-class
70
+ :td-class
71
+ :tr-class
72
+ @click:row="$emit('click:row', i)"
73
+ @dbclick:row="$emit('dbclick:row', i)"
74
+ @add:row="$emit('add:row', i)"
75
+ />
76
+ </template>
77
77
  </template>
78
78
 
79
79
  <script setup>
@@ -1,29 +1,29 @@
1
1
  <template>
2
- <div class="border-t-(1 solid border) flex flex-wrap children:grow-1 sticky bottom-0 mt-auto z-2 bg-white rounded-t-xl -mx-4 <md:-mx-3 px-4 py-3 gap-3">
3
- <UnCard
4
- :item="selectedWallet"
5
- class="basis-full"
6
- />
7
- <UnButton
8
- v-if="selectedWallet?.coin?.withdrawable && !noWithdraw"
9
- variant="primary-fill"
10
- class="basis-full"
11
- label="برداشت"
12
- @click="$emit('withdraw')"
13
- />
14
- <UnButton
15
- v-if="selectedWallet?.coin?.transferable && !noTransfer"
16
- variant="primary-fill"
17
- label="انتقال"
18
- @click="$emit('transfer')"
19
- />
20
- <UnButton
21
- v-if="selectedWallet?.coin?.depositable && !noDeposit"
22
- variant="primary-fill"
23
- label="افزایش اعتبار"
24
- @click="$emit('deposit')"
25
- />
26
- </div>
2
+ <div class="border-t-(1 solid border) flex flex-wrap children:grow-1 sticky bottom-0 mt-auto z-2 bg-white rounded-t-xl -mx-4 <md:-mx-3 px-4 py-3 gap-3">
3
+ <UnCard
4
+ :item="selectedWallet"
5
+ class="basis-full"
6
+ />
7
+ <UnButton
8
+ v-if="selectedWallet?.coin?.withdrawable && !noWithdraw"
9
+ variant="primary-fill"
10
+ class="basis-full"
11
+ label="برداشت"
12
+ @click="$emit('withdraw')"
13
+ />
14
+ <UnButton
15
+ v-if="selectedWallet?.coin?.transferable && !noTransfer"
16
+ variant="primary-fill"
17
+ label="انتقال"
18
+ @click="$emit('transfer')"
19
+ />
20
+ <UnButton
21
+ v-if="selectedWallet?.coin?.depositable && !noDeposit"
22
+ variant="primary-fill"
23
+ label="افزایش اعتبار"
24
+ @click="$emit('deposit')"
25
+ />
26
+ </div>
27
27
  </template>
28
28
 
29
29
  <script setup>
@@ -145,7 +145,9 @@ export const minutesToTime = (m = 0) => {
145
145
  };
146
146
  export const useSocketIo = () => {
147
147
  const moduleConfig = useModuleConfig();
148
- const socket = io(window.BASE_URL || moduleConfig?.BASE_URL, {
148
+ let api = window.BASE_URL || moduleConfig?.BASE_URL;
149
+ api = api?.endsWith("/api") ? api.replace("/api", "") : api;
150
+ const socket = io(api, {
149
151
  extraHeaders: {
150
152
  authorization: useToken().value || ""
151
153
  // 'app-code': APP_CODE
@@ -1,3 +1,3 @@
1
- {
2
- "extends": "../../../.nuxt/tsconfig.server.json",
3
- }
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json",
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "2.9.46",
3
+ "version": "2.9.48",
4
4
  "private": false,
5
5
  "description": "nuxt ui kit for unsource env",
6
6
  "repository": "https://github.com/alisa2142/unsource-ui",