@unsource/ui 2.3.1 → 2.4.0

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unsource-ui",
3
3
  "configKey": "unsourceUi",
4
- "version": "2.3.1",
4
+ "version": "2.4.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -0,0 +1,43 @@
1
+ type __VLS_Props = {
2
+ cols?: {
3
+ title: string;
4
+ name: string;
5
+ disabled?: boolean;
6
+ key?: string | string[];
7
+ subKey?: string | string[];
8
+ class?: string;
9
+ dir?: string;
10
+ isDesktop?: boolean;
11
+ isMobile?: boolean;
12
+ }[];
13
+ items?: Record<string, unknown>[];
14
+ thClass?: string;
15
+ tdClass?: string;
16
+ textClass?: string;
17
+ boxMode?: boolean;
18
+ };
19
+ declare var __VLS_2: any, __VLS_3: {
20
+ col: any;
21
+ item: any;
22
+ items: any;
23
+ index: any;
24
+ }, __VLS_6: any, __VLS_7: {
25
+ col: any;
26
+ item: any;
27
+ items: any;
28
+ index: any;
29
+ };
30
+ type __VLS_Slots = {} & {
31
+ [K in NonNullable<typeof __VLS_2>]?: (props: typeof __VLS_3) => any;
32
+ } & {
33
+ [K in NonNullable<typeof __VLS_6>]?: (props: typeof __VLS_7) => any;
34
+ };
35
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
37
+ declare const _default: typeof __VLS_export;
38
+ export default _default;
39
+ type __VLS_WithSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -0,0 +1,115 @@
1
+ <template>
2
+ <div class="flex flex-col justify-start min-h-50 <md:(max-w-screen overflow-x-auto)">
3
+ <div
4
+ v-if="boxMode"
5
+ class="flex flex-col gap-2 h-full"
6
+ >
7
+ <div
8
+ v-for="(item, index) in items"
9
+ :key="index"
10
+ class="flex flex-col gap-1 pb-2 border-b-(1 solid gray-400)"
11
+ @click="$emit('click:row', item)"
12
+ >
13
+ <div
14
+ v-for="col in cols.filter((e) => !e.disabled)"
15
+ :key="col.name"
16
+ class="flex items-center gap-2"
17
+ >
18
+ <div class="text-xs text-gray-600 font-medium text-left">
19
+ {{ col.title }}
20
+ </div>
21
+ <div class="border-t-(dashed gray-600 1) grow" />
22
+ <div class="text-gray-400 text-sm text-right">
23
+ <slot
24
+ :name="col.name"
25
+ :col="col"
26
+ :item="item"
27
+ :items="_at(item, col.key)"
28
+ :index="index"
29
+ >
30
+ <div class="flex flex-col gap-0.5">
31
+ <p :class="textClass">
32
+ {{ _at(item, col.key).join(" ") }}
33
+ </p>
34
+ <small
35
+ v-if="col.subKey?.length"
36
+ class="font-500 text-gray-600 text-xs"
37
+ >{{ _at(item, col.subKey).join(" ") }}</small>
38
+ </div>
39
+ </slot>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <table
45
+ v-else
46
+ class="border-spacing-x-0 border-spacing-y-1"
47
+ >
48
+ <thead>
49
+ <tr class="border-b-2 children:(text-center p-4) rounded-lg <md:children:p-1 ">
50
+ <th
51
+ v-for="col in cols.filter((e) => !e.disabled)"
52
+ :key="col.name + '-th'"
53
+ :class="[{ '<md:hidden': col.isDesktop, 'hidden <md:table-cell': col.isMobile }, `w-${cols.length}`, thClass, 'sticky top-0']"
54
+ class="text-xs text-gray-600 font-medium text-center first:rounded-l-lg last:rounded-r-lg"
55
+ >
56
+ {{ col.title }}
57
+ </th>
58
+ </tr>
59
+ </thead>
60
+ <tbody>
61
+ <tr
62
+ v-for="(item, index) in items"
63
+ :key="index"
64
+ class="children:p-3 <md:children:p-1 text-center children:(border-b border-gray-100)"
65
+ @click="$emit('click:row', item)"
66
+ >
67
+ <td
68
+ v-for="col in cols.filter((e) => !e.disabled)"
69
+ :key="col.name + '-td'"
70
+ class="text-gray-400 text-sm text-center first:rounded-l-lg last:rounded-r-lg"
71
+ :class="[col.class, { '<md:hidden': col.isDesktop, 'hidden <md:table-cell': col.isMobile }, tdClass]"
72
+ :dir="col.dir"
73
+ >
74
+ <slot
75
+ :name="col.name"
76
+ :col="col"
77
+ :item="item"
78
+ :items="_at(item, col.key)"
79
+ :index="index"
80
+ >
81
+ <div class="flex flex-col gap-0.5">
82
+ <p :class="textClass">
83
+ {{ _at(item, col.key).join(" ") }}
84
+ </p>
85
+ <small
86
+ v-if="col.subKey?.length"
87
+ class="font-500 text-gray-600 text-xs"
88
+ >{{ _at(item, col.subKey).join(" ") }}</small>
89
+ </div>
90
+ </slot>
91
+ </td>
92
+ </tr>
93
+ </tbody>
94
+ </table>
95
+ <div
96
+ v-if="!items?.length"
97
+ class="flex grow justify-center items-center font-bold text-sm text-text"
98
+ >
99
+ {{ $t("Empty") }}
100
+ </div>
101
+ </div>
102
+ </template>
103
+
104
+ <script setup>
105
+ import { _at, useDevice } from "#imports";
106
+ const { cols = [], items = [], thClass = "bg-gray-100 border-gray-100", tdClass = "bg-gray-250", textClass = "text-gray-800 font-700 text-xs" } = defineProps({
107
+ cols: { type: Array, required: false },
108
+ items: { type: Array, required: false },
109
+ thClass: { type: String, required: false },
110
+ tdClass: { type: String, required: false },
111
+ textClass: { type: String, required: false },
112
+ boxMode: { type: Boolean, required: false }
113
+ });
114
+ const { isDesktop, isMobile } = useDevice();
115
+ </script>
@@ -0,0 +1,43 @@
1
+ type __VLS_Props = {
2
+ cols?: {
3
+ title: string;
4
+ name: string;
5
+ disabled?: boolean;
6
+ key?: string | string[];
7
+ subKey?: string | string[];
8
+ class?: string;
9
+ dir?: string;
10
+ isDesktop?: boolean;
11
+ isMobile?: boolean;
12
+ }[];
13
+ items?: Record<string, unknown>[];
14
+ thClass?: string;
15
+ tdClass?: string;
16
+ textClass?: string;
17
+ boxMode?: boolean;
18
+ };
19
+ declare var __VLS_2: any, __VLS_3: {
20
+ col: any;
21
+ item: any;
22
+ items: any;
23
+ index: any;
24
+ }, __VLS_6: any, __VLS_7: {
25
+ col: any;
26
+ item: any;
27
+ items: any;
28
+ index: any;
29
+ };
30
+ type __VLS_Slots = {} & {
31
+ [K in NonNullable<typeof __VLS_2>]?: (props: typeof __VLS_3) => any;
32
+ } & {
33
+ [K in NonNullable<typeof __VLS_6>]?: (props: typeof __VLS_7) => any;
34
+ };
35
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
36
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
37
+ declare const _default: typeof __VLS_export;
38
+ export default _default;
39
+ type __VLS_WithSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -1,4 +1,4 @@
1
- import type { Form, InputOption, Section, Profile, Transaction, Slider, User, Banner, WithdrawRequest, Coin } from '../types/models.js';
1
+ import type { Form, InputOption, Section, Profile, Transaction, Slider, User, Banner, Coin } from '../types/models.js';
2
2
  export declare const getForms: (name: string) => Promise<Form[] | undefined>;
3
3
  export declare const getUserInfo: () => Promise<User | null>;
4
4
  export declare const getCoin: (id?: string | null) => Promise<Coin | undefined>;
@@ -10,8 +10,8 @@ export declare const getOptions: (key: string) => Promise<InputOption[]>;
10
10
  export declare const getTransactions: (walletIds: string[], justWallet?: boolean) => Promise<Transaction[] | undefined>;
11
11
  export declare const saveUser: (user: User) => Promise<Profile | undefined>;
12
12
  export declare const saveProfile: (profile: Profile) => Promise<Profile | undefined>;
13
- export declare const saveWithdraw: (withdraw: WithdrawRequest) => Promise<any>;
14
- export declare const cancelRequest: (request: WithdrawRequest) => Promise<any>;
13
+ export declare const saveWithdraw: (withdraw: any) => Promise<unknown>;
14
+ export declare const cancelRequest: (request: any) => Promise<{} | null>;
15
15
  export declare const verifyPayment: (txId?: string) => Promise<{
16
16
  trx: Transaction;
17
17
  status: boolean;
@@ -3,6 +3,7 @@ import {
3
3
  useUser,
4
4
  useUserId
5
5
  } from "./reuseable.js";
6
+ import { _set, useNuxtApp, useRoute } from "#imports";
6
7
  export const getForms = async (name) => {
7
8
  const { result } = await useGet("/Form", {
8
9
  params: {
@@ -175,7 +176,6 @@ export const verifyPayment = async (txId = "") => {
175
176
  };
176
177
  export const submitInviteCode = async (code) => {
177
178
  if (!code) return;
178
- const inviteCode = useCookie("inviteCode");
179
179
  const { $toast } = useNuxtApp();
180
180
  const { result: supervisor } = await useGet(`/user/inviteCode/${code}`);
181
181
  if (supervisor?.id) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "2.3.1",
3
+ "version": "2.4.0",
4
4
  "private": false,
5
5
  "description": "nuxt ui kit for unsource env",
6
6
  "repository": "https://github.com/alisa2142/unsource-ui",