@unsource/ui 2.8.8 → 2.8.11

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.
Files changed (69) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +24 -9
  3. package/dist/runtime/assets/main.css +1 -1
  4. package/dist/runtime/components/UnAuth.d.vue.ts +2 -2
  5. package/dist/runtime/components/UnAuth.vue +2 -2
  6. package/dist/runtime/components/UnAuth.vue.d.ts +2 -2
  7. package/dist/runtime/components/UnCard.d.vue.ts +16 -14
  8. package/dist/runtime/components/UnCard.vue +26 -2
  9. package/dist/runtime/components/UnCard.vue.d.ts +16 -14
  10. package/dist/runtime/components/UnCheckboxItem.d.vue.ts +1 -5
  11. package/dist/runtime/components/UnCheckboxItem.vue +4 -5
  12. package/dist/runtime/components/UnCheckboxItem.vue.d.ts +1 -5
  13. package/dist/runtime/components/UnCollapsible.d.vue.ts +2 -2
  14. package/dist/runtime/components/UnCollapsible.vue.d.ts +2 -2
  15. package/dist/runtime/components/UnFormItem.vue +2 -2
  16. package/dist/runtime/components/UnFormList.d.vue.ts +1 -1
  17. package/dist/runtime/components/UnFormList.vue.d.ts +1 -1
  18. package/dist/runtime/components/UnIRDatePicker.d.vue.ts +1 -1
  19. package/dist/runtime/components/UnIRDatePicker.vue +1 -2
  20. package/dist/runtime/components/UnIRDatePicker.vue.d.ts +1 -1
  21. package/dist/runtime/components/UnInput.d.vue.ts +1 -1
  22. package/dist/runtime/components/UnInput.vue +1 -1
  23. package/dist/runtime/components/UnInput.vue.d.ts +1 -1
  24. package/dist/runtime/components/UnLabel.d.vue.ts +13 -13
  25. package/dist/runtime/components/UnLabel.vue +5 -5
  26. package/dist/runtime/components/UnLabel.vue.d.ts +13 -13
  27. package/dist/runtime/components/UnLocationInput.vue +1 -0
  28. package/dist/runtime/components/UnMap.vue +1 -1
  29. package/dist/runtime/components/UnMobileHeader.vue +0 -1
  30. package/dist/runtime/components/UnModal.vue +1 -1
  31. package/dist/runtime/components/UnMultiUploader.vue +0 -1
  32. package/dist/runtime/components/UnNavbar.vue +1 -1
  33. package/dist/runtime/components/UnNormalInput.d.vue.ts +1 -21
  34. package/dist/runtime/components/UnNormalInput.vue.d.ts +1 -21
  35. package/dist/runtime/components/UnNumberInput.vue +0 -1
  36. package/dist/runtime/components/UnNuxtIcon.d.vue.ts +0 -1
  37. package/dist/runtime/components/UnNuxtIcon.vue +1 -3
  38. package/dist/runtime/components/UnNuxtIcon.vue.d.ts +0 -1
  39. package/dist/runtime/components/UnProfile.d.vue.ts +2 -2
  40. package/dist/runtime/components/UnProfile.vue.d.ts +2 -2
  41. package/dist/runtime/components/UnRadioItem.d.vue.ts +1 -0
  42. package/dist/runtime/components/UnRadioItem.vue +8 -7
  43. package/dist/runtime/components/UnRadioItem.vue.d.ts +1 -0
  44. package/dist/runtime/components/UnSelect.d.vue.ts +0 -2
  45. package/dist/runtime/components/UnSelect.vue +2 -4
  46. package/dist/runtime/components/UnSelect.vue.d.ts +0 -2
  47. package/dist/runtime/components/UnSwiperControl.vue +0 -4
  48. package/dist/runtime/components/UnSwiperSlider.d.vue.ts +2 -2
  49. package/dist/runtime/components/UnSwiperSlider.vue.d.ts +2 -2
  50. package/dist/runtime/components/UnTransaction.vue +1 -0
  51. package/dist/runtime/components/UnUploadFile.d.vue.ts +60 -19
  52. package/dist/runtime/components/UnUploadFile.vue +5 -4
  53. package/dist/runtime/components/UnUploadFile.vue.d.ts +60 -19
  54. package/dist/runtime/components/UnWallet.vue +1 -0
  55. package/dist/runtime/composables/fetch.d.ts +38 -17
  56. package/dist/runtime/composables/fetch.js +20 -11
  57. package/dist/runtime/composables/global.d.ts +58 -15
  58. package/dist/runtime/composables/global.js +11 -30
  59. package/dist/runtime/composables/reuseable.d.ts +6 -19
  60. package/dist/runtime/composables/reuseable.js +7 -24
  61. package/dist/runtime/composables/services.d.ts +2 -2
  62. package/dist/runtime/composables/services.js +3 -2
  63. package/dist/runtime/plugins/floating.client.d.ts +3 -0
  64. package/dist/runtime/plugins/floating.client.js +6 -0
  65. package/dist/runtime/plugins/toast.client.d.ts +30 -30
  66. package/dist/runtime/types/models.d.ts +401 -110
  67. package/package.json +6 -5
  68. package/dist/runtime/uno.config.d.ts +0 -2
  69. package/dist/runtime/uno.config.js +0 -60
@@ -26,26 +26,6 @@ type __VLS_ModelProps = {
26
26
  modelValue?: any;
27
27
  };
28
28
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
29
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {
30
- password: boolean;
31
- appendIcon: string;
32
- label: string;
33
- disabled: boolean;
34
- inputType: string;
35
- placeholder: string;
36
- date: boolean;
37
- focusable: boolean;
38
- className: string;
39
- valueClassName: string;
40
- focusClassName: string;
41
- labelClass: string;
42
- prependIcon: string;
43
- appendIconType: string;
44
- appendIconClass: string;
45
- appendText: string;
46
- inputMode: string;
47
- iconColor: string;
48
- bgStyle: string;
49
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
30
  declare const _default: typeof __VLS_export;
51
31
  export default _default;
@@ -26,26 +26,6 @@ type __VLS_ModelProps = {
26
26
  modelValue?: any;
27
27
  };
28
28
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
29
- declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {
30
- password: boolean;
31
- appendIcon: string;
32
- label: string;
33
- disabled: boolean;
34
- inputType: string;
35
- placeholder: string;
36
- date: boolean;
37
- focusable: boolean;
38
- className: string;
39
- valueClassName: string;
40
- focusClassName: string;
41
- labelClass: string;
42
- prependIcon: string;
43
- appendIconType: string;
44
- appendIconClass: string;
45
- appendText: string;
46
- inputMode: string;
47
- iconColor: string;
48
- bgStyle: string;
49
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
50
30
  declare const _default: typeof __VLS_export;
51
31
  export default _default;
@@ -36,7 +36,6 @@ const { max = 999999999, min = 0, step = 1e3 } = defineProps({
36
36
  const amount = defineModel({ type: [String, Number] });
37
37
  const remain = computed(() => max - Number(s2n(amount.value)));
38
38
  const increment = (e) => {
39
- console.log(e);
40
39
  if (e < 0 && Number(s2n(amount.value)) <= Math.abs(e)) {
41
40
  amount.value = "0";
42
41
  } else {
@@ -1,6 +1,5 @@
1
1
  type __VLS_Props = {
2
2
  name?: string | null;
3
- iconType?: string;
4
3
  filled?: boolean;
5
4
  alt?: string;
6
5
  };
@@ -25,12 +25,10 @@
25
25
 
26
26
  <script setup>
27
27
  import { ref } from "#imports";
28
- const props = defineProps({
28
+ defineProps({
29
29
  name: { type: [String, null], required: false },
30
- iconType: { type: String, required: false },
31
30
  filled: { type: Boolean, required: false },
32
31
  alt: { type: String, required: false }
33
32
  });
34
- const iconType = props.iconType || "icon";
35
33
  const loaded = ref(true);
36
34
  </script>
@@ -1,6 +1,5 @@
1
1
  type __VLS_Props = {
2
2
  name?: string | null;
3
- iconType?: string;
4
3
  filled?: boolean;
5
4
  alt?: string;
6
5
  };
@@ -26,9 +26,9 @@ type __VLS_Props = {
26
26
  owner?: string;
27
27
  customClass?: ProfileCustomClass;
28
28
  };
29
- declare var __VLS_15: {};
29
+ declare var __VLS_16: {};
30
30
  type __VLS_Slots = {} & {
31
- default?: (props: typeof __VLS_15) => any;
31
+ default?: (props: typeof __VLS_16) => any;
32
32
  };
33
33
  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>;
34
34
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -26,9 +26,9 @@ type __VLS_Props = {
26
26
  owner?: string;
27
27
  customClass?: ProfileCustomClass;
28
28
  };
29
- declare var __VLS_15: {};
29
+ declare var __VLS_16: {};
30
30
  type __VLS_Slots = {} & {
31
- default?: (props: typeof __VLS_15) => any;
31
+ default?: (props: typeof __VLS_16) => any;
32
32
  };
33
33
  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>;
34
34
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -12,6 +12,7 @@ type __VLS_Props = {
12
12
  selected?: boolean;
13
13
  customClass?: RadioCustomClass;
14
14
  disabled?: boolean;
15
+ infoIcon?: string;
15
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
18
  declare const _default: typeof __VLS_export;
@@ -1,38 +1,39 @@
1
1
  <template>
2
2
  <div
3
- class="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"
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
4
  :class="{ 'opacity-50 grayscale': disabled, 'disable': disabled, 'selected': selected }"
5
5
  @click.prevent.stop="toggle"
6
6
  >
7
7
  <div
8
8
  name="radio"
9
- :class="[customClass.radio, customClass[selected ? 'selected' : 'notSelected']?.radio]"
9
+ :class="customClass.radio"
10
10
  class="group-[.disable]:border-secondary border-(1 solid primary) rounded-1/2 w-4 h-4 flex justify-center items-center"
11
11
  >
12
12
  <div
13
13
  name="radioInside"
14
14
  class="bg-primary-500 rounded-1/2 h-10px w-10px transition-opacity duration-200"
15
- :class="[customClass.radioInside, customClass[selected ? 'selected' : 'notSelected']?.radioInside, selected ? 'opacity-full' : 'opacity-0']"
15
+ :class="[customClass.radioInside, selected ? 'opacity-full' : 'opacity-0']"
16
16
  />
17
17
  </div>
18
18
  <UnCard
19
19
  :item="item"
20
20
  class="!bg-transparent grow-1"
21
- :class="[customClass.card, customClass[selected ? 'selected' : 'notSelected']?.card]"
22
- :custom-class="_mergeWith(customClass.item, customClass[selected ? 'selected' : 'notSelected']?.item, merge)"
21
+ :class="customClass.card"
22
+ :custom-class="customClass.item"
23
+ :info-icon="infoIcon"
23
24
  />
24
25
  </div>
25
26
  </template>
26
27
 
27
28
  <script setup>
28
- import { _mergeWith, merge } from "#imports";
29
29
  const emit = defineEmits(["input"]);
30
30
  const { customClass = {}, disabled } = defineProps({
31
31
  value: { type: null, required: true },
32
32
  item: { type: Object, required: true },
33
33
  selected: { type: Boolean, required: false },
34
34
  customClass: { type: Object, required: false },
35
- disabled: { type: Boolean, required: false }
35
+ disabled: { type: Boolean, required: false },
36
+ infoIcon: { type: String, required: false }
36
37
  });
37
38
  const toggle = () => {
38
39
  if (disabled) return;
@@ -12,6 +12,7 @@ type __VLS_Props = {
12
12
  selected?: boolean;
13
13
  customClass?: RadioCustomClass;
14
14
  disabled?: boolean;
15
+ infoIcon?: string;
15
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
18
  declare const _default: typeof __VLS_export;
@@ -16,8 +16,6 @@ type __VLS_Props = {
16
16
  customClass?: Partial<Record<'header' | 'icon' | 'label' | 'arrowIcon' | 'wrapper' | 'innerWrapper' | 'search' | 'list' | 'radio' | 'checkbox' | 'checkboxButton', unknown>> & {
17
17
  radioItem?: RadioCustomClass;
18
18
  checkboxItem?: CheckboxCustomClass;
19
- selected: Partial<Record<'radio' | 'checkbox', string>>;
20
- notSelected: Partial<Record<'radio' | 'checkbox', string>>;
21
19
  };
22
20
  };
23
21
  type __VLS_ModelProps = {
@@ -73,7 +73,7 @@
73
73
  :key="Value(option)"
74
74
  :value="Value(option)"
75
75
  :item="Label(option)"
76
- :class="[customClass.checkbox, customClass[value?.includes?.(Value(option)) ? 'selected' : 'notSelected']?.checkbox]"
76
+ :class="customClass.checkbox"
77
77
  :custom-class="customClass.checkboxItem"
78
78
  :selected="value?.includes?.(Value(option))"
79
79
  :disabled="option.disable"
@@ -94,7 +94,7 @@
94
94
  :key="Value(option)"
95
95
  :value="Value(option)"
96
96
  :item="Label(option)"
97
- :class="[customClass.radio, customClass[isEqual(Value(option), value) ? 'selected' : 'notSelected']?.radio]"
97
+ :class="customClass.radio"
98
98
  :custom-class="customClass.radioItem"
99
99
  :selected="isEqual(Value(option), value)"
100
100
  :disabled="option.disable"
@@ -138,12 +138,10 @@ const close = (e = {}) => {
138
138
  const name = e?.target?.id;
139
139
  const pname = e?.target?.parentElement?.id;
140
140
  const ppname = e?.target?.parentElement?.parentElement?.id;
141
- console.log(e);
142
141
  if ([name, pname, ppname].includes(id)) return;
143
142
  show.value = false;
144
143
  };
145
144
  const toggle = () => {
146
- console.log("aaa");
147
145
  show.value = !show.value;
148
146
  };
149
147
  const dropdownStyles = ref({});
@@ -16,8 +16,6 @@ type __VLS_Props = {
16
16
  customClass?: Partial<Record<'header' | 'icon' | 'label' | 'arrowIcon' | 'wrapper' | 'innerWrapper' | 'search' | 'list' | 'radio' | 'checkbox' | 'checkboxButton', unknown>> & {
17
17
  radioItem?: RadioCustomClass;
18
18
  checkboxItem?: CheckboxCustomClass;
19
- selected: Partial<Record<'radio' | 'checkbox', string>>;
20
- notSelected: Partial<Record<'radio' | 'checkbox', string>>;
21
19
  };
22
20
  };
23
21
  type __VLS_ModelProps = {
@@ -1,7 +1,3 @@
1
- <template>
2
-
3
- </template>
4
-
5
1
  <script setup>
6
2
  const props = defineProps({
7
3
  name: { type: String, required: false }
@@ -9,11 +9,11 @@ type __VLS_Props = {
9
9
  pagination?: boolean;
10
10
  initialSlide?: number;
11
11
  };
12
- declare var __VLS_11: {
12
+ declare var __VLS_13: {
13
13
  item: any;
14
14
  };
15
15
  type __VLS_Slots = {} & {
16
- default?: (props: typeof __VLS_11) => any;
16
+ default?: (props: typeof __VLS_13) => any;
17
17
  };
18
18
  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>;
19
19
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -9,11 +9,11 @@ type __VLS_Props = {
9
9
  pagination?: boolean;
10
10
  initialSlide?: number;
11
11
  };
12
- declare var __VLS_11: {
12
+ declare var __VLS_13: {
13
13
  item: any;
14
14
  };
15
15
  type __VLS_Slots = {} & {
16
- default?: (props: typeof __VLS_11) => any;
16
+ default?: (props: typeof __VLS_13) => any;
17
17
  };
18
18
  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>;
19
19
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -77,6 +77,7 @@ const Title = computed(() => {
77
77
  if (transaction.type === "TRANSFER" && transaction.toWallet?.userId !== userId.value) {
78
78
  return `\u0627\u0631\u0633\u0627\u0644 \u0634\u0627\u0631\u0698 ${transaction.wallet?.coin?.name} \u0628\u0647 ${transaction.toWallet?.user?.profile?.firstName || ""} ${transaction.toWallet?.user?.profile?.lastName || ""}`;
79
79
  }
80
+ return "";
80
81
  });
81
82
  const statusVariant = computed(() => ["REJECTED", "FAILED"].includes(transaction.status) ? "text-danger" : transaction.type === "DEPOSIT" || transaction.type === "TRANSFER" && transaction.toWallet?.userId === userId.value ? "text-success" : "text-danger");
82
83
  const statusIcon = computed(() => ["REJECTED", "FAILED"].includes(transaction.status) ? "solar:danger-circle-bold-duotone" : transaction.type === "DEPOSIT" || transaction.type === "TRANSFER" && transaction.toWallet?.userId === userId.value ? "solar:import-bold-duotone" : "solar:export-bold-duotone");
@@ -1,24 +1,65 @@
1
- declare const _default: typeof __VLS_export;
2
- export default _default;
3
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
4
- type __VLS_WithSlots<T, S> = T & (new () => {
5
- $slots: S;
6
- });
7
- declare const __VLS_base: import("vue").DefineComponent<{}, {
8
- $props: Partial<typeof props>;
9
- label: string;
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ icon?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ edit: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ disabled: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
14
+ icon: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ label: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ accept: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ "update:modelValue": (value: any) => any;
28
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
29
+ edit: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ disabled: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ icon: {
38
+ type: StringConstructor;
39
+ default: string;
40
+ };
41
+ label: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
45
+ accept: {
46
+ type: StringConstructor;
47
+ default: string;
48
+ };
49
+ }>> & Readonly<{
50
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
51
+ }>, {
10
52
  icon: string;
53
+ label: string;
11
54
  disabled: boolean;
12
55
  accept: string;
13
56
  edit: boolean;
14
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
15
- type __VLS_Slots = {
16
- icon?: ((props: {}) => any) | undefined;
17
- };
18
- declare const props: {
19
- readonly label: string;
20
- readonly icon: string;
21
- readonly disabled: boolean;
22
- readonly accept: string;
23
- readonly edit: boolean;
57
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
58
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
59
+ declare const _default: typeof __VLS_export;
60
+ export default _default;
61
+ type __VLS_WithSlots<T, S> = T & {
62
+ new (): {
63
+ $slots: S;
64
+ };
24
65
  };
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <form
3
3
  class="flex flex-col relative"
4
- @dragenter="hovered=true"
5
- @dragleave="hovered=false"
4
+ @dragenter="hovered = true"
5
+ @dragleave="hovered = false"
6
6
  @submit.prevent="upload"
7
7
  @dragover.prevent
8
8
  @drop.stop.prevent="drop"
@@ -15,7 +15,7 @@
15
15
  <div
16
16
  v-if="!value || loading"
17
17
  class="flex flex-col justify-center items-center gap-3 p-2 border-(2 dashed) rounded-2xl grow"
18
- :class="label ? 'border-(primary-500)' : 'border-transparent' "
18
+ :class="label ? 'border-(primary-500)' : 'border-transparent'"
19
19
  >
20
20
  <UnNuxtIcon
21
21
  v-if="!loading"
@@ -51,7 +51,8 @@
51
51
  </template>
52
52
 
53
53
  <script setup>
54
- const props = defineProps({
54
+ import { ref, usePost } from "#imports";
55
+ defineProps({
55
56
  edit: {
56
57
  type: Boolean,
57
58
  default: true
@@ -1,24 +1,65 @@
1
- declare const _default: typeof __VLS_export;
2
- export default _default;
3
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
4
- type __VLS_WithSlots<T, S> = T & (new () => {
5
- $slots: S;
6
- });
7
- declare const __VLS_base: import("vue").DefineComponent<{}, {
8
- $props: Partial<typeof props>;
9
- label: string;
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ icon?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
6
+ edit: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ disabled: {
11
+ type: BooleanConstructor;
12
+ default: boolean;
13
+ };
14
+ icon: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ label: {
19
+ type: StringConstructor;
20
+ default: string;
21
+ };
22
+ accept: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
27
+ "update:modelValue": (value: any) => any;
28
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
29
+ edit: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ disabled: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ icon: {
38
+ type: StringConstructor;
39
+ default: string;
40
+ };
41
+ label: {
42
+ type: StringConstructor;
43
+ default: string;
44
+ };
45
+ accept: {
46
+ type: StringConstructor;
47
+ default: string;
48
+ };
49
+ }>> & Readonly<{
50
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
51
+ }>, {
10
52
  icon: string;
53
+ label: string;
11
54
  disabled: boolean;
12
55
  accept: string;
13
56
  edit: boolean;
14
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
15
- type __VLS_Slots = {
16
- icon?: ((props: {}) => any) | undefined;
17
- };
18
- declare const props: {
19
- readonly label: string;
20
- readonly icon: string;
21
- readonly disabled: boolean;
22
- readonly accept: string;
23
- readonly edit: boolean;
57
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
58
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
59
+ declare const _default: typeof __VLS_export;
60
+ export default _default;
61
+ type __VLS_WithSlots<T, S> = T & {
62
+ new (): {
63
+ $slots: S;
64
+ };
24
65
  };
@@ -124,6 +124,7 @@ const mappedWallet = computed(() => wallets.value.map((e) => ({
124
124
  icon: e.coin?.icon,
125
125
  title: e.coin?.name,
126
126
  unit: e.coin?.unit,
127
+ info: e.coin?.info,
127
128
  description: ["\u0645\u0627\u0646\u062F\u0647:", _ceil(e.balance || 0, e.coin?.precision || 0)?.toLocaleString("en"), e.coin?.isFiat ? "\u062A\u0648\u0645\u0627\u0646" : e.coin?.unit].join(" "),
128
129
  type: "wallet"
129
130
  })));
@@ -1,30 +1,51 @@
1
1
  import type { NitroFetchOptions, NitroFetchRequest } from 'nitropack';
2
- export declare const fetch: <T>({ body, config, controller, URL, method }: {
3
- body?: undefined;
4
- config?: {} | undefined;
5
- controller?: undefined;
6
- URL?: string | undefined;
7
- method?: string | undefined;
2
+ declare global {
3
+ interface Window {
4
+ BASE_URL?: string;
5
+ APP_CODE?: string;
6
+ NESHAN_API_KEY?: string;
7
+ NESHAN_WEB_KEY?: string;
8
+ urlPrefix?: string;
9
+ }
10
+ }
11
+ type Config = NitroFetchOptions<NitroFetchRequest, 'get' | 'post' | 'put' | 'delete'> & {
12
+ headers?: Record<string, unknown>;
13
+ };
14
+ export declare const fetch: <T>({ body, config, controller, URL, method, }: {
15
+ body?: Record<string, unknown>;
16
+ config?: Config;
17
+ controller?: AbortController;
18
+ URL?: string;
19
+ method?: "GET" | "POST" | "PUT" | "DELETE";
8
20
  }) => Promise<{
9
- error: never;
21
+ result: undefined;
22
+ error: Record<string, Record<string, unknown>>;
10
23
  } | {
11
- result: import("nitropack").TypedInternalResponse<NitroFetchRequest, T, NitroFetchOptions<NitroFetchRequest, "get" | "head" | "patch" | "post" | "put" | "delete" | "connect" | "options" | "trace"> extends NitroFetchOptions<R, import("nitropack").AvailableRouterMethod<R>> ? "get" : Lowercase<Exclude<import("nitropack").AvailableRouterMethod<R>, undefined>> | Lowercase<Exclude<Uppercase<import("nitropack").AvailableRouterMethod<R>>, undefined>> extends "get" | "head" | "patch" | "post" | "put" | "delete" | "connect" | "options" | "trace" ? Lowercase<Exclude<import("nitropack").AvailableRouterMethod<R>, undefined>> | Lowercase<Exclude<Uppercase<import("nitropack").AvailableRouterMethod<R>>, undefined>> : "get">;
24
+ result: T;
25
+ error: undefined;
12
26
  }>;
13
- export declare const useGet: <T>(URL: string, config?: NitroFetchOptions<NitroFetchRequest, "get"> | {
14
- headers?: Record<string, never>;
27
+ export declare const useGet: <T>(URL: string, config?: NitroFetchOptions<NitroFetchRequest, "get"> & {
28
+ headers?: Record<string, unknown>;
15
29
  }, controller?: AbortController | undefined) => Promise<{
16
30
  result?: T;
17
- error?: never;
31
+ error?: unknown;
18
32
  }>;
19
- export declare const useDelete: <T>(URL: string, config?: NitroFetchOptions<NitroFetchRequest, "delete">, controller?: AbortController | undefined) => Promise<{
33
+ export declare const useDelete: <T>(URL: string, config?: NitroFetchOptions<NitroFetchRequest, "delete"> & {
34
+ headers?: Record<string, unknown>;
35
+ }, controller?: AbortController | undefined) => Promise<{
20
36
  result?: T;
21
- error?: never;
37
+ error?: unknown;
22
38
  }>;
23
- export declare const usePost: <T, R = T>(URL: string, data: R, config?: NitroFetchOptions<NitroFetchRequest, "post">, controller?: AbortController | undefined) => Promise<{
39
+ export declare const usePost: <T, R = T>(URL: string, data: R, config?: NitroFetchOptions<NitroFetchRequest, "post"> & {
40
+ headers?: Record<string, unknown>;
41
+ }, controller?: AbortController | undefined) => Promise<{
24
42
  result?: T;
25
- error?: never;
43
+ error?: unknown;
26
44
  }>;
27
- export declare const usePut: <T, R = T>(URL: string, data: Partial<R>, config?: NitroFetchOptions<NitroFetchRequest, "put">, controller?: AbortController | undefined) => Promise<{
45
+ export declare const usePut: <T, R = T>(URL: string, data: Partial<R>, config?: NitroFetchOptions<NitroFetchRequest, "put"> & {
46
+ headers?: Record<string, unknown>;
47
+ }, controller?: AbortController | undefined) => Promise<{
28
48
  result?: T;
29
- error?: never;
49
+ error?: unknown;
30
50
  }>;
51
+ export {};
@@ -1,7 +1,5 @@
1
1
  import { useModuleConfig, useToken } from "./reuseable.js";
2
- import { _get, _set, useNuxtApp, _takeRight } from "#imports";
3
- const domain = location.hostname.split(".");
4
- const tld = _takeRight(domain, 2).join(".");
2
+ import { _get, _set, useNuxtApp, isArray } from "#imports";
5
3
  const setHeaders = (config) => {
6
4
  const token = useToken();
7
5
  _set(config, ["headers", "Authorization"], _get(config, ["headers", "Authorization"], token.value || ""));
@@ -9,18 +7,29 @@ const setHeaders = (config) => {
9
7
  return config;
10
8
  };
11
9
  const errorHandler = (error, config) => {
12
- const msg = error?.data?.errors?.map((e) => e.field + ":" + e.message).join(" , ");
13
- if (!config?.headers?.["no-error"]) {
14
- const { $toast } = useNuxtApp();
15
- $toast?.error(msg || JSON.stringify(error?.data));
10
+ if ("data" in error) {
11
+ let msg = "";
12
+ if ("errors" in error.data && isArray(error.data.errors)) {
13
+ msg = error?.data?.errors?.map?.((e) => e.field + ":" + e.message).join(" , ");
14
+ }
15
+ if (!config?.headers?.["no-error"]) {
16
+ const { $toast } = useNuxtApp();
17
+ $toast?.error(msg || JSON.stringify(error?.data));
18
+ }
16
19
  }
17
- return { error };
20
+ return { result: void 0, error };
18
21
  };
19
- export const fetch = async ({ body = void 0, config = {}, controller = void 0, URL = "", method = "GET" }) => {
22
+ export const fetch = async ({
23
+ body = void 0,
24
+ config = {},
25
+ controller = void 0,
26
+ URL = "",
27
+ method = "GET"
28
+ }) => {
20
29
  const moduleConfig = useModuleConfig();
21
30
  controller = new AbortController();
22
31
  const signal = controller.signal;
23
- config = setHeaders(config);
32
+ config = setHeaders(config || {});
24
33
  try {
25
34
  const result = await $fetch(URL, {
26
35
  baseURL: window.BASE_URL || moduleConfig?.BASE_URL,
@@ -29,7 +38,7 @@ export const fetch = async ({ body = void 0, config = {}, controller = void 0, U
29
38
  body,
30
39
  ...config
31
40
  });
32
- return { result };
41
+ return { result, error: void 0 };
33
42
  } catch (error) {
34
43
  return errorHandler(error, config);
35
44
  }