@unsource/ui 1.0.2 → 1.2.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.
Files changed (109) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +3 -1
  3. package/dist/runtime/components/Un/Button.d.vue.ts +15 -0
  4. package/dist/runtime/components/Un/Button.vue +52 -0
  5. package/dist/runtime/components/Un/Button.vue.d.ts +15 -0
  6. package/dist/runtime/components/Un/Card.d.vue.ts +21 -0
  7. package/dist/runtime/components/Un/Card.vue +55 -0
  8. package/dist/runtime/components/Un/Card.vue.d.ts +21 -0
  9. package/dist/runtime/components/Un/Chart.d.vue.ts +18 -0
  10. package/dist/runtime/components/Un/Chart.vue +149 -0
  11. package/dist/runtime/components/Un/Chart.vue.d.ts +18 -0
  12. package/dist/runtime/components/Un/Checkbox.d.vue.ts +15 -0
  13. package/dist/runtime/components/Un/Checkbox.vue +40 -0
  14. package/dist/runtime/components/Un/Checkbox.vue.d.ts +15 -0
  15. package/dist/runtime/components/Un/CodeInput.d.vue.ts +6 -0
  16. package/dist/runtime/components/Un/CodeInput.vue +31 -0
  17. package/dist/runtime/components/Un/CodeInput.vue.d.ts +6 -0
  18. package/dist/runtime/components/Un/DiscountCode.d.vue.ts +15 -0
  19. package/dist/runtime/components/Un/DiscountCode.vue +29 -0
  20. package/dist/runtime/components/Un/DiscountCode.vue.d.ts +15 -0
  21. package/dist/runtime/components/Un/Dropdown.d.vue.ts +33 -0
  22. package/dist/runtime/components/Un/Dropdown.vue +82 -0
  23. package/dist/runtime/components/Un/Dropdown.vue.d.ts +33 -0
  24. package/dist/runtime/components/Un/DropdownModal.d.vue.ts +17 -0
  25. package/dist/runtime/components/Un/DropdownModal.vue +29 -0
  26. package/dist/runtime/components/Un/DropdownModal.vue.d.ts +17 -0
  27. package/dist/runtime/components/Un/EmptyData.d.vue.ts +6 -0
  28. package/dist/runtime/components/Un/EmptyData.vue +13 -0
  29. package/dist/runtime/components/Un/EmptyData.vue.d.ts +6 -0
  30. package/dist/runtime/components/Un/IRDatePicker.d.vue.ts +15 -0
  31. package/dist/runtime/components/Un/IRDatePicker.vue +85 -0
  32. package/dist/runtime/components/Un/IRDatePicker.vue.d.ts +15 -0
  33. package/dist/runtime/components/Un/Input.d.vue.ts +51 -0
  34. package/dist/runtime/components/Un/Input.vue +55 -0
  35. package/dist/runtime/components/Un/Input.vue.d.ts +51 -0
  36. package/dist/runtime/components/Un/Label.d.vue.ts +16 -0
  37. package/dist/runtime/components/Un/Label.vue +19 -0
  38. package/dist/runtime/components/Un/Label.vue.d.ts +16 -0
  39. package/dist/runtime/components/Un/Log.d.vue.ts +11 -0
  40. package/dist/runtime/components/Un/Log.vue +28 -0
  41. package/dist/runtime/components/Un/Log.vue.d.ts +11 -0
  42. package/dist/runtime/components/Un/Map.d.vue.ts +17 -0
  43. package/dist/runtime/components/Un/Map.vue +153 -0
  44. package/dist/runtime/components/Un/Map.vue.d.ts +17 -0
  45. package/dist/runtime/components/Un/MultiUploader.d.vue.ts +20 -0
  46. package/dist/runtime/components/Un/MultiUploader.vue +126 -0
  47. package/dist/runtime/components/Un/MultiUploader.vue.d.ts +20 -0
  48. package/dist/runtime/components/Un/NewPWA.d.vue.ts +3 -0
  49. package/dist/runtime/components/Un/NewPWA.vue +40 -0
  50. package/dist/runtime/components/Un/NewPWA.vue.d.ts +3 -0
  51. package/dist/runtime/components/Un/NumberInput.d.vue.ts +16 -0
  52. package/dist/runtime/components/Un/NumberInput.vue +36 -0
  53. package/dist/runtime/components/Un/NumberInput.vue.d.ts +16 -0
  54. package/dist/runtime/components/Un/NuxtIcon.d.vue.ts +9 -0
  55. package/dist/runtime/components/Un/NuxtIcon.vue +29 -0
  56. package/dist/runtime/components/Un/NuxtIcon.vue.d.ts +9 -0
  57. package/dist/runtime/components/Un/PWA.d.vue.ts +3 -0
  58. package/dist/runtime/components/Un/PWA.vue +17 -0
  59. package/dist/runtime/components/Un/PWA.vue.d.ts +3 -0
  60. package/dist/runtime/components/Un/QRCode.d.vue.ts +6 -0
  61. package/dist/runtime/components/Un/QRCode.vue +10 -0
  62. package/dist/runtime/components/Un/QRCode.vue.d.ts +6 -0
  63. package/dist/runtime/components/Un/Range.d.vue.ts +13 -0
  64. package/dist/runtime/components/Un/Range.vue +56 -0
  65. package/dist/runtime/components/Un/Range.vue.d.ts +13 -0
  66. package/dist/runtime/components/Un/Rate.d.vue.ts +10 -0
  67. package/dist/runtime/components/Un/Rate.vue +9 -0
  68. package/dist/runtime/components/Un/Rate.vue.d.ts +10 -0
  69. package/dist/runtime/components/Un/Search.d.vue.ts +21 -0
  70. package/dist/runtime/components/Un/Search.vue +28 -0
  71. package/dist/runtime/components/Un/Search.vue.d.ts +21 -0
  72. package/dist/runtime/components/Un/Searchbar.d.vue.ts +13 -0
  73. package/dist/runtime/components/Un/Searchbar.vue +35 -0
  74. package/dist/runtime/components/Un/Searchbar.vue.d.ts +13 -0
  75. package/dist/runtime/components/Un/Slider.d.vue.ts +9 -0
  76. package/dist/runtime/components/Un/Slider.vue +18 -0
  77. package/dist/runtime/components/Un/Slider.vue.d.ts +9 -0
  78. package/dist/runtime/components/Un/Tab.d.vue.ts +15 -0
  79. package/dist/runtime/components/Un/Tab.vue +47 -0
  80. package/dist/runtime/components/Un/Tab.vue.d.ts +15 -0
  81. package/dist/runtime/components/Un/TableCard.d.vue.ts +22 -0
  82. package/dist/runtime/components/Un/TableCard.vue +46 -0
  83. package/dist/runtime/components/Un/TableCard.vue.d.ts +22 -0
  84. package/dist/runtime/components/Un/TextIcon.d.vue.ts +3 -0
  85. package/dist/runtime/components/Un/TextIcon.vue +10 -0
  86. package/dist/runtime/components/Un/TextIcon.vue.d.ts +3 -0
  87. package/dist/runtime/components/Un/Timer.d.vue.ts +23 -0
  88. package/dist/runtime/components/Un/Timer.vue +29 -0
  89. package/dist/runtime/components/Un/Timer.vue.d.ts +23 -0
  90. package/dist/runtime/components/Un/Toggle/Button.d.vue.ts +11 -0
  91. package/dist/runtime/components/Un/Toggle/Button.vue +22 -0
  92. package/dist/runtime/components/Un/Toggle/Button.vue.d.ts +11 -0
  93. package/dist/runtime/components/Un/Toggle/index.d.vue.ts +11 -0
  94. package/dist/runtime/components/Un/Toggle/index.vue +22 -0
  95. package/dist/runtime/components/Un/Toggle/index.vue.d.ts +11 -0
  96. package/dist/runtime/components/Un/UploadFile.d.vue.ts +24 -0
  97. package/dist/runtime/components/Un/UploadFile.vue +83 -0
  98. package/dist/runtime/components/Un/UploadFile.vue.d.ts +24 -0
  99. package/dist/runtime/components/UnCard.d.vue.ts +32 -5
  100. package/dist/runtime/components/UnCard.vue +82 -28
  101. package/dist/runtime/components/UnCard.vue.d.ts +32 -5
  102. package/dist/runtime/components/UnNuxtIcon.vue +1 -1
  103. package/dist/runtime/components/UnSwiperControl.d.vue.ts +8 -0
  104. package/dist/runtime/components/UnSwiperControl.vue +15 -0
  105. package/dist/runtime/components/UnSwiperControl.vue.d.ts +8 -0
  106. package/dist/runtime/components/UnSwiperSlider.d.vue.ts +26 -0
  107. package/dist/runtime/components/UnSwiperSlider.vue +82 -0
  108. package/dist/runtime/components/UnSwiperSlider.vue.d.ts +26 -0
  109. package/package.json +6 -1
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <form
3
+ class="flex flex-col relative"
4
+ @dragenter="hovered=true"
5
+ @dragleave="hovered=false"
6
+ @submit.prevent="upload"
7
+ @dragover.prevent
8
+ @drop.stop.prevent="drop">
9
+ <label
10
+ class="flex justify-center items-stretch bg-transparent rounded-2xl relative overflow-hidden cursor-pointer h-full"
11
+ :class="{'p-2' : !value}">
12
+ <slot name="icon">
13
+ <div v-if="!value || loading"
14
+ class="flex flex-col justify-center items-center gap-3 p-2 border-(2 dashed) rounded-2xl grow"
15
+ :class="label ? 'border-(primary-500)' : 'border-transparent' ">
16
+ <TheNuxtIcon
17
+ v-if="!loading"
18
+ class="flex justify-center items-center text-primary-500 rounded-lg"
19
+ :class="label ? 'text-3xl' : 'text-8xl'"
20
+ :name="icon"/>
21
+ <TheNuxtIcon v-else name="loading" icon-type="svg"/>
22
+ <p class="text-(xs gray-400) font-extrabold text-center">
23
+ {{ label }}
24
+ </p>
25
+ </div>
26
+ <TheNuxtIcon
27
+ v-else
28
+ :name="value"
29
+ class="object-contain bg-gray-100 rounded-lg !w-full !h-full"/>
30
+ </slot>
31
+ <input
32
+ :disabled="!disabled" :accept="accept"
33
+ alt="uploadImage" hidden type="file"
34
+ @change="upload($event.target)"/>
35
+ </label>
36
+
37
+ </form>
38
+ </template>
39
+
40
+ <script setup>
41
+ const props = defineProps({
42
+ edit: {
43
+ type: Boolean,
44
+ default: true
45
+ },
46
+ disabled: {
47
+ type: Boolean,
48
+ default: true
49
+ },
50
+ icon: {
51
+ type: String,
52
+ default: "gallery-add"
53
+ },
54
+ label: {
55
+ type: String,
56
+ default: ""
57
+ },
58
+ accept: {
59
+ type: String,
60
+ default: ""
61
+ }
62
+ });
63
+ const hovered = ref(false);
64
+ const value = defineModel();
65
+ const drop = (e) => {
66
+ hovered.value = false;
67
+ upload(e.dataTransfer);
68
+ };
69
+ const upload = (evt) => {
70
+ compile(evt.files[0]);
71
+ };
72
+ const loading = ref(false);
73
+ const compile = async (file) => {
74
+ loading.value = true;
75
+ const fm = new FormData();
76
+ fm.append("file", file);
77
+ const { result } = await usePost("/upload", fm);
78
+ if (result) {
79
+ value.value = result;
80
+ }
81
+ loading.value = false;
82
+ };
83
+ </script>
@@ -0,0 +1,24 @@
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;
10
+ icon: string;
11
+ disabled: boolean;
12
+ accept: string;
13
+ 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;
24
+ };
@@ -1,14 +1,41 @@
1
1
  type __VLS_Props = {
2
2
  direction?: 'column' | 'row' | 'row-reverse' | 'column-reverse';
3
- customClass?: Record<'main' | 'body' | 'title' | 'tags' | 'tag' | 'description' | 'footer' | 'image' | 'avatar', string>;
3
+ customClass?: Record<'main' | 'desc' | 'body' | 'logo' | 'slider' | 'sliderWrapper' | 'sliderSlides' | 'title' | 'tags' | 'tag' | 'description' | 'footer' | 'image' | 'avatar', string>;
4
+ item: {
5
+ title?: string;
6
+ description?: string;
7
+ image?: string;
8
+ avatar?: string;
9
+ images?: string[];
10
+ tags?: {
11
+ value?: string;
12
+ icon?: string;
13
+ variant?: string;
14
+ }[];
15
+ };
16
+ to?: string;
17
+ };
18
+ declare var __VLS_33: {
19
+ item: any;
20
+ }, __VLS_40: {
21
+ item: any;
22
+ }, __VLS_42: {
23
+ item: any;
24
+ }, __VLS_44: {
25
+ item: any;
26
+ }, __VLS_46: {
27
+ item: any;
4
28
  };
5
- declare var __VLS_22: {}, __VLS_24: {}, __VLS_26: {};
6
29
  type __VLS_Slots = {} & {
7
- header?: (props: typeof __VLS_22) => any;
30
+ bodyStart?: (props: typeof __VLS_33) => any;
31
+ } & {
32
+ bodyEnd?: (props: typeof __VLS_40) => any;
33
+ } & {
34
+ header?: (props: typeof __VLS_42) => any;
8
35
  } & {
9
- footerStart?: (props: typeof __VLS_24) => any;
36
+ footerStart?: (props: typeof __VLS_44) => any;
10
37
  } & {
11
- footerEnd?: (props: typeof __VLS_26) => any;
38
+ footerEnd?: (props: typeof __VLS_46) => any;
12
39
  };
13
40
  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>;
14
41
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -2,38 +2,89 @@
2
2
  <NuxtLink
3
3
  class="flex items-stretch bg-white rounded-2xl overflow-hidden"
4
4
  :class="headerClass[direction]"
5
- to="#"
5
+ no-prefetch
6
+ :to="to"
6
7
  >
7
8
  <UnNuxtIcon
9
+ v-if="item.image"
8
10
  class="grow-1 basis-1"
9
- :class="customClass.image"
10
- name="https://picsum.photos/400/200"
11
+ :class="[customClass.image, { 'min-h-50': direction.includes('column') }]"
12
+ :name="item.image"
11
13
  icon-type="img"
12
14
  />
15
+ <UnSwiperSlider
16
+ v-else-if="item.images"
17
+ :items="item.images || []"
18
+ :slides="1"
19
+ :navigation="true"
20
+ :pagination="true"
21
+ :initial-slide="0"
22
+ :slide-class="`!px-0 ${customClass.sliderSlides}`"
23
+ :wrapper-class="`!px-0 ${customClass.sliderWrapper}`"
24
+ :class="[customClass.slider, direction.includes('column') ? 'h-50' : 'w-50', 'aspect-square']"
25
+ :autoplay="{
26
+ delay: 1e3,
27
+ disableOnInteraction: false
28
+ }"
29
+ >
30
+ <template #default="{ item }">
31
+ <div class="h-full self-stretch max-w-screen">
32
+ <UnNuxtIcon
33
+ :name="item"
34
+ icon-type="img"
35
+ class="object-cover !w-full !h-full"
36
+ />
37
+ </div>
38
+ </template>
39
+ </UnSwiperSlider>
13
40
  <div
14
41
  :class="customClass.main"
15
42
  class="flex flex-col items-stretch grow-2.5 basis-2.5"
16
43
  >
17
44
  <div
18
45
  :class="customClass.body"
19
- class="flex gap-2 items-stretch p-3"
46
+ class="flex gap-2 items-stretch p-3 grow"
20
47
  >
21
48
  <UnNuxtIcon
49
+ v-if="item.avatar"
22
50
  :class="customClass.avatar"
23
- :name="`https://s3.parand.app/files/parand/images/shop-logo.png`"
51
+ :name="item.avatar"
24
52
  icon-type="img"
25
53
  class="!object-cover shrink-0 w-14 h-14 aspect-square rounded-full border-(2 solid primary-500)"
26
54
  />
27
55
  <div class="flex justify-start flex-col gap-1 grow-1">
28
- <h3
29
- :class="customClass.title"
30
- class="text-(lg gray-600) font-medium"
31
- >{{ item.title }}</h3>
32
- <small
56
+ <div class="flex gap-2 items-center">
57
+ <UnNuxtIcon
58
+ v-if="item.logo"
59
+ :class="customClass.logo"
60
+ :name="item.logo"
61
+ icon-type="img"
62
+ class="!object-cover shrink-0 w-14 h-14 aspect-square rounded-full border-(2 solid primary-500)"
63
+ />
64
+ <div class="flex flex-col">
65
+ <h3
66
+ v-if="item.title"
67
+ :class="customClass.title"
68
+ class="text-(lg gray-600) font-medium"
69
+ >{{ item.title }}</h3>
70
+ <p
71
+ v-if="item.desc"
72
+ :class="customClass.desc"
73
+ class="text-(base gray-500)"
74
+ >{{ item.desc }}</p>
75
+ </div>
76
+ </div>
77
+ <slot
78
+ name="bodyStart"
79
+ :item="item"
80
+ />
81
+ <p
82
+ v-if="item.description"
33
83
  :class="customClass.description"
34
84
  class="text-(base gray-500)"
35
- >{{ item.description }}</small>
85
+ >{{ item.description }}</p>
36
86
  <div
87
+ v-if="item.tags?.length"
37
88
  :class="customClass.tags"
38
89
  class="flex items-center justify-start gap-2"
39
90
  >
@@ -48,25 +99,40 @@
48
99
  class="!px-1"
49
100
  />
50
101
  </div>
102
+ <slot
103
+ name="bodyEnd"
104
+ :item="item"
105
+ />
51
106
  </div>
52
- <slot name="header" />
107
+ <slot
108
+ name="header"
109
+ :item="item"
110
+ />
53
111
  </div>
54
112
  <div
55
113
  v-if="$slots.footerStart || $slots.footerEnd"
56
114
  :class="customClass.footer"
57
115
  class="flex justify-between items-stretch border-t-(2 dashed border) p-3"
58
116
  >
59
- <slot name="footerStart" />
60
- <slot name="footerEnd" />
117
+ <slot
118
+ name="footerStart"
119
+ :item="item"
120
+ />
121
+ <slot
122
+ name="footerEnd"
123
+ :item="item"
124
+ />
61
125
  </div>
62
126
  </div>
63
127
  </NuxtLink>
64
128
  </template>
65
129
 
66
130
  <script setup>
67
- const { direction = "row-reverse", customClass = {} } = defineProps({
131
+ const { direction = "column", customClass = {}, to = "#" } = defineProps({
68
132
  direction: { type: String, required: false },
69
- customClass: { type: Object, required: false }
133
+ customClass: { type: Object, required: false },
134
+ item: { type: Object, required: true },
135
+ to: { type: String, required: false }
70
136
  });
71
137
  const headerClass = {
72
138
  "column": "flex-col",
@@ -74,16 +140,4 @@ const headerClass = {
74
140
  "row-reverse": "flex-row-reverse",
75
141
  "column-reverse": "flex-col-reverse"
76
142
  };
77
- const item = {
78
- title: "\u062A\u0633\u062A",
79
- description: "\u0644\u0648\u0631\u0645 \u0627\u06CC\u067E\u0633\u0648\u0645 \u0645\u062A\u0646 \u0633\u0627\u062E\u062A\u06AF\u06CC \u0628\u0627 \u062A\u0648\u0644\u06CC\u062F \u0633\u0627\u062F\u06AF\u06CC \u0646\u0627\u0645\u0641\u0647\u0648\u0645 \u0627\u0632 \u0635\u0646\u0639\u062A \u0686\u0627\u067E \u0648 \u0628\u0627 \u0627\u0633\u062A\u0641\u0627\u062F\u0647 \u0627\u0632 \u0637\u0631\u0627\u062D\u0627\u0646 \u06AF\u0631\u0627\u0641\u06CC\u06A9 \u0627\u0633\u062A ",
80
- tags: [
81
- {
82
- value: "\u062A\u0633\u062A"
83
- },
84
- {
85
- value: "\u062A\u0633\u062A"
86
- }
87
- ]
88
- };
89
143
  </script>
@@ -1,14 +1,41 @@
1
1
  type __VLS_Props = {
2
2
  direction?: 'column' | 'row' | 'row-reverse' | 'column-reverse';
3
- customClass?: Record<'main' | 'body' | 'title' | 'tags' | 'tag' | 'description' | 'footer' | 'image' | 'avatar', string>;
3
+ customClass?: Record<'main' | 'desc' | 'body' | 'logo' | 'slider' | 'sliderWrapper' | 'sliderSlides' | 'title' | 'tags' | 'tag' | 'description' | 'footer' | 'image' | 'avatar', string>;
4
+ item: {
5
+ title?: string;
6
+ description?: string;
7
+ image?: string;
8
+ avatar?: string;
9
+ images?: string[];
10
+ tags?: {
11
+ value?: string;
12
+ icon?: string;
13
+ variant?: string;
14
+ }[];
15
+ };
16
+ to?: string;
17
+ };
18
+ declare var __VLS_33: {
19
+ item: any;
20
+ }, __VLS_40: {
21
+ item: any;
22
+ }, __VLS_42: {
23
+ item: any;
24
+ }, __VLS_44: {
25
+ item: any;
26
+ }, __VLS_46: {
27
+ item: any;
4
28
  };
5
- declare var __VLS_22: {}, __VLS_24: {}, __VLS_26: {};
6
29
  type __VLS_Slots = {} & {
7
- header?: (props: typeof __VLS_22) => any;
30
+ bodyStart?: (props: typeof __VLS_33) => any;
31
+ } & {
32
+ bodyEnd?: (props: typeof __VLS_40) => any;
33
+ } & {
34
+ header?: (props: typeof __VLS_42) => any;
8
35
  } & {
9
- footerStart?: (props: typeof __VLS_24) => any;
36
+ footerStart?: (props: typeof __VLS_44) => any;
10
37
  } & {
11
- footerEnd?: (props: typeof __VLS_26) => any;
38
+ footerEnd?: (props: typeof __VLS_46) => any;
12
39
  };
13
40
  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>;
14
41
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -32,5 +32,5 @@ const props = defineProps({
32
32
  alt: { type: String, required: false }
33
33
  });
34
34
  const iconType = props.iconType || "icon";
35
- const loaded = ref(false);
35
+ const loaded = ref(true);
36
36
  </script>
@@ -0,0 +1,8 @@
1
+ type __VLS_Props = {
2
+ name?: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
5
+ swiper: any;
6
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,15 @@
1
+ <template>
2
+
3
+ </template>
4
+
5
+ <script setup>
6
+ const props = defineProps({
7
+ name: { type: String, required: false }
8
+ });
9
+ const swiper = useState(props.name || "stepperSwiper");
10
+ swiper.value = useSwiper();
11
+ defineExpose({ swiper });
12
+ onUnmounted(() => {
13
+ swiper.value = void 0;
14
+ });
15
+ </script>
@@ -0,0 +1,8 @@
1
+ type __VLS_Props = {
2
+ name?: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
5
+ swiper: any;
6
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,26 @@
1
+ import 'swiper/css/pagination';
2
+ type __VLS_Props = {
3
+ slideClass?: string;
4
+ wrapperClass?: string;
5
+ items: any[];
6
+ name?: string;
7
+ slides: number | 'auto';
8
+ navigation?: boolean;
9
+ pagination?: boolean;
10
+ initialSlide?: number;
11
+ };
12
+ declare var __VLS_11: {
13
+ item: any;
14
+ };
15
+ type __VLS_Slots = {} & {
16
+ default?: (props: typeof __VLS_11) => any;
17
+ };
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
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
22
+ type __VLS_WithSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
@@ -0,0 +1,82 @@
1
+ <template>
2
+ <div
3
+ class="flex flex-col relative"
4
+ dir="ltr"
5
+ >
6
+ <Swiper
7
+ class="!w-full !h-full grow children:(flex) px-3"
8
+ :class="wrapperClass"
9
+ :slides-per-view="slides"
10
+ :space-between="0"
11
+ :loop="false"
12
+ :pagination="pagination"
13
+ :keyboard="true"
14
+ :modules="modules"
15
+ :initial-slide="initialSlide || 0"
16
+ :simulate-touch="true"
17
+ :autoplay="{
18
+ delay: 5e3,
19
+ disableOnInteraction: false,
20
+ pauseOnMouseEnter: true
21
+ }"
22
+ >
23
+ <!-- <TheSwiperControl :name="name"/> -->
24
+ <SwiperSlide
25
+ v-for="(item, index) in items"
26
+ :key="index"
27
+ class="!flex flex-col !self-stretch !items-center transition-all"
28
+ :class="slideClass"
29
+ >
30
+ <slot :item="item" />
31
+ </SwiperSlide>
32
+ </Swiper>
33
+ </div>
34
+ </template>
35
+
36
+ <script setup>
37
+ import "swiper/css/pagination";
38
+ import { Autoplay } from "swiper/modules";
39
+ import { SwiperNavigation, SwiperPagination } from "#imports";
40
+ defineProps({
41
+ slideClass: { type: String, required: false },
42
+ wrapperClass: { type: String, required: false },
43
+ items: { type: Array, required: true },
44
+ name: { type: String, required: false },
45
+ slides: { type: [Number, String], required: true },
46
+ navigation: { type: Boolean, required: false },
47
+ pagination: { type: Boolean, required: false },
48
+ initialSlide: { type: Number, required: false }
49
+ });
50
+ const modules = [SwiperPagination, SwiperNavigation, Autoplay];
51
+ </script>
52
+
53
+ <style>
54
+ .swiper {
55
+ @apply static;
56
+ }
57
+
58
+ .swiper-pagination {
59
+ @apply absolute bottom-5 !left-auto right-1/2 transform translate-x-1/2 z-10 flex justify-center items-center bg-white/10 !w-fit px-2 py-1.5 rounded-full backdrop-blur-md;
60
+ }
61
+ .swiper-pagination .swiper-pagination-bullet {
62
+ @apply bg-gray-400 w-4 h-1.5 rounded-full !important;
63
+ }
64
+ .swiper-pagination .swiper-pagination-bullet.swiper-pagination-bullet-active {
65
+ @apply bg-white !important;
66
+ }
67
+
68
+ .swiper-button-next, .swiper-button-prev {
69
+ @apply w-12 w-12 h-12 bg-secondary-900 rounded-1/2;
70
+ }
71
+ .swiper-button-next::after, .swiper-button-prev::after {
72
+ @apply text-white transform text-lg;
73
+ }
74
+
75
+ .swiper-button-prev::after {
76
+ @apply translate-x-1/4;
77
+ }
78
+
79
+ .swiper-button-next::after {
80
+ @apply -translate-x-1/4;
81
+ }
82
+ </style>
@@ -0,0 +1,26 @@
1
+ import 'swiper/css/pagination';
2
+ type __VLS_Props = {
3
+ slideClass?: string;
4
+ wrapperClass?: string;
5
+ items: any[];
6
+ name?: string;
7
+ slides: number | 'auto';
8
+ navigation?: boolean;
9
+ pagination?: boolean;
10
+ initialSlide?: number;
11
+ };
12
+ declare var __VLS_11: {
13
+ item: any;
14
+ };
15
+ type __VLS_Slots = {} & {
16
+ default?: (props: typeof __VLS_11) => any;
17
+ };
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
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
22
+ type __VLS_WithSlots<T, S> = T & {
23
+ new (): {
24
+ $slots: S;
25
+ };
26
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unsource/ui",
3
- "version": "1.0.2",
3
+ "version": "1.2.0",
4
4
  "private": false,
5
5
  "description": "My new Nuxt module",
6
6
  "repository": "your-org/my-module",
@@ -35,7 +35,10 @@
35
35
  "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
36
36
  },
37
37
  "dependencies": {
38
+ "@neshan-maps-platform/vue3-openlayers": "^2.0.1",
38
39
  "@nuxt/kit": "^4.1.3",
40
+ "nuxt-swiper": "^1.2.2",
41
+ "swiper": "^11.2.10",
39
42
  "unocss-preset-scrollbar": "^3.2.0"
40
43
  },
41
44
  "devDependencies": {
@@ -51,6 +54,8 @@
51
54
  "changelogen": "^0.6.2",
52
55
  "eslint": "^9.37.0",
53
56
  "nuxt": "^3.19.3",
57
+ "sass": "^1.93.2",
58
+ "sass-embedded": "^1.93.2",
54
59
  "typescript": "~5.9.3",
55
60
  "unocss": "^66.5.3",
56
61
  "vitest": "^3.2.4",