@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,153 @@
1
+ <template>
2
+ <ClientOnly>
3
+ <div class="relative h-full z-1">
4
+ <NeshanMap
5
+ ref="map"
6
+ :mapKey="NESHAN_WEB_KEY"
7
+ :service-key="NESHAN_API_KEY"
8
+ class="h-100"
9
+ :poi="true"
10
+ :traffic="true"
11
+ default-type="dreamy-gold"
12
+ :zoom="15"
13
+ :hide-search-container="true"
14
+ :hide-layers="true"
15
+ :cluster="true"
16
+ :center="center"
17
+ :reverse-on-click="false"
18
+ :popup-on-marker-hover="false"
19
+ />
20
+ <div
21
+ class="absolute left-1/50 top-1/40 flex flex-col rounded-2xl gap-1 items-center select-none
22
+ text-primary-500 children:(bg-primary w-8 h-8 p-1 flex justify-center items-center rounded-2xl cursor-pointer) z-[999999]">
23
+ <TheNuxtIcon @click="zoom(1)" name="solar:add-square-line-duotone"/>
24
+ <TheNuxtIcon @click="zoom(-1)" name="solar:minus-square-line-duotone"/>
25
+ <TheNuxtIcon v-if="isSupported && !readonly" @click="setCenterFromLoc" name="solar:gps-line-duotone"/>
26
+ <a v-if="readonly" :href="geo">
27
+ <TheNuxtIcon name="solar:share-line-duotone"/>
28
+ </a>
29
+ </div>
30
+ <TheNuxtIcon v-if="!readonly" :name="`${marker || 'my-icon:home-marker'}`" icon-type="img"
31
+ class="!absolute right-1/2 bottom-1/2 transform translate-x-1/2"/>
32
+ </div>
33
+ </ClientOnly>
34
+ </template>
35
+
36
+ <script setup>
37
+ import NeshanMap from "@neshan-maps-platform/vue3-openlayers";
38
+ import { Feature } from "ol";
39
+ import { Vector } from "ol/layer";
40
+ import { Vector as SourceVector } from "ol/source";
41
+ import { Style, Icon, Stroke, Fill } from "ol/style";
42
+ import { Geometry, Point, Circle as GeomCircle } from "ol/geom";
43
+ import { fromLonLat, transform } from "ol/proj";
44
+ import Big from "big.js";
45
+ const emit = defineEmits(["select-point"]);
46
+ const { points = [], readonly, marker } = defineProps({
47
+ points: { type: Array, required: false },
48
+ readonly: { type: Boolean, required: false },
49
+ marker: { type: String, required: false }
50
+ });
51
+ const mapCenter = defineModel("center");
52
+ const { isIos } = useDevice();
53
+ const geo = computed(() => isIos ? `maps://maps.google.com/?q=${points[0]?.coords[1]},${points[0]?.coords[0]}` : `geo:${points[0]?.coords[1]},${points[0]?.coords[0]}`);
54
+ const center = {
55
+ latitude: points[0]?.coords[1] || 30.5584422,
56
+ longitude: points[0]?.coords[0] || 49.1903995
57
+ };
58
+ const { coords, pause, isSupported, resume } = useGeolocation();
59
+ const setCenterFromLoc = () => {
60
+ resume();
61
+ };
62
+ const setCenter = (coords2) => {
63
+ coords2?.length && Map.value?.getView().setCenter(transform(coords2, "EPSG:4326", "EPSG:3857"));
64
+ };
65
+ watch(() => coords.value, () => {
66
+ pause();
67
+ !readonly && setCenter([coords.value.longitude, coords.value.latitude]);
68
+ });
69
+ const map = ref(null);
70
+ const filteredPoints = computed(() => points.filter(Boolean));
71
+ const getCenter = () => transform(Map.value?.getView().getCenter(), "EPSG:3857", "EPSG:4326");
72
+ const addVector = (e, isPoint = true) => {
73
+ const style = isPoint ? new Style({
74
+ image: new Icon({
75
+ src: e?.image,
76
+ anchor: e?.anchor || [0.5, 0],
77
+ // size: [50,50],
78
+ anchorOrigin: "bottom-left"
79
+ })
80
+ }) : new Style({
81
+ fill: new Fill({
82
+ color: "rgba(255, 100, 50, 0.3)"
83
+ }),
84
+ stroke: new Stroke({
85
+ width: 2,
86
+ color: "rgba(255, 100, 50, 0.8)"
87
+ })
88
+ });
89
+ return new Vector({
90
+ source: new SourceVector(),
91
+ style
92
+ });
93
+ };
94
+ const dataToFeature = (e, isPoint = true) => {
95
+ return isPoint ? new Feature(new Point(fromLonLat(e.coords))) : new Feature(new GeomCircle(fromLonLat(e.coords), 200));
96
+ };
97
+ let addedLayers = [];
98
+ const durationInLongLat = (points2) => {
99
+ const a2 = new Big(points2?.[1].coords[0]).minus(points2?.[0].coords[0]).pow(2);
100
+ const b2 = new Big(points2?.[1].coords[1]).minus(points2?.[0].coords[1]).pow(2);
101
+ return a2.plus(b2).sqrt();
102
+ };
103
+ const centerOfLatLong = (points2) => {
104
+ const x = new Big(points2?.[1].coords[0]).plus(points2?.[0].coords[0]).div(2).toNumber();
105
+ const y = new Big(points2?.[1].coords[1]).plus(points2?.[0].coords[1]).div(2).toNumber();
106
+ return [x, y];
107
+ };
108
+ const zoomOfPoints = (du) => new Big(Math.log(du)).times(1.3691).minus(8.895).abs().toNumber();
109
+ const setZoom = (number) => {
110
+ Map.value?.getView().setZoom(number);
111
+ };
112
+ const refreshPoints = async () => {
113
+ addedLayers.map((l) => {
114
+ const layers = map.value?.state?.map?.getLayers();
115
+ const ll = layers.getArray().findIndex((e) => e.ol_uid === l.ol_uid);
116
+ layers?.removeAt(ll);
117
+ });
118
+ addedLayers = [];
119
+ filteredPoints.value.forEach((e) => {
120
+ const layer = addVector(e, true);
121
+ layer?.getSource()?.addFeature(dataToFeature(e, true));
122
+ addedLayers.push(layer);
123
+ });
124
+ addedLayers.map((l) => map.value?.state?.map?.addLayer(l));
125
+ if ((points?.length || 0) > 1) {
126
+ const du = durationInLongLat(filteredPoints.value);
127
+ const zoom2 = zoomOfPoints(du.toNumber());
128
+ setZoom(zoom2);
129
+ setCenter([centerOfLatLong(filteredPoints.value)[0], Math.min(filteredPoints.value?.[0].coords[1], filteredPoints.value?.[1].coords[1])]);
130
+ } else {
131
+ setCenter(filteredPoints.value?.[0]?.coords);
132
+ }
133
+ };
134
+ const zoom = (number) => {
135
+ const view = map.value?.state.map.getView();
136
+ const zoom2 = view.getZoom();
137
+ view.setZoom(zoom2 + number);
138
+ };
139
+ const Map = computed(() => map.value?.state?.map);
140
+ watch(() => Map.value, () => {
141
+ refreshPoints();
142
+ const center2 = map.value?.state.map.getView().getCenter();
143
+ mapCenter.value = transform(center2, "EPSG:3857", "EPSG:4326");
144
+ });
145
+ watch(() => points, () => {
146
+ refreshPoints();
147
+ });
148
+ defineExpose({ Map, getCenter, setCenter });
149
+ </script>
150
+
151
+ <style>
152
+ @import "@neshan-maps-platform/vue3-openlayers/dist/style.css";
153
+ </style>
@@ -0,0 +1,17 @@
1
+ import type { Address, Point as PointType } from '~/types/app';
2
+ type __VLS_Props = {
3
+ points?: PointType[];
4
+ readonly?: boolean;
5
+ marker?: string;
6
+ };
7
+ type __VLS_ModelProps = {
8
+ 'center'?: any;
9
+ };
10
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
12
+ Map: any;
13
+ getCenter: () => any;
14
+ setCenter: (coords: Address) => void;
15
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ label?: string;
3
+ selected?: number;
4
+ max?: number;
5
+ uploaderClass?: string;
6
+ filesClass?: string;
7
+ selectable?: string;
8
+ watermark?: string | null;
9
+ accept?: string | null;
10
+ };
11
+ declare const __VLS_defaultModels: {
12
+ modelValue: () => never[];
13
+ };
14
+ type __VLS_ModelProps = {
15
+ modelValue?: typeof __VLS_defaultModels['modelValue'];
16
+ };
17
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
18
+ 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>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -0,0 +1,126 @@
1
+ <template>
2
+ <form
3
+ class="flex gap-4 items-stretch text-base text-primary-500 min-h-16"
4
+ @submit.prevent="upload"
5
+ @dragover.prevent
6
+ @dragenter="hovered = true"
7
+ @dragleave="hovered = false"
8
+ @drop.stop.prevent="drop"
9
+ >
10
+ <input
11
+ v-if="!max || files?.length < max"
12
+ id="image"
13
+ type="file"
14
+ alt="uploadImage"
15
+ hidden
16
+ :accept="accept"
17
+ multiple
18
+ @change="upload($event.target)"
19
+ />
20
+ <label
21
+ v-if="false"
22
+ for="image"
23
+ class="flex flex-row items-center justify-center gap-2 bg-box rounded-lg w-57 outline-1 outline-dashed outline-offset-6 my-2 mr-2 cursor-pointer border-border border-1"
24
+ :class="[
25
+ hovered ? 'outline-danger text-danger' : 'outline-primary text-primary-500',
26
+ uploaderClass
27
+ ]"
28
+ >
29
+ <i class="flex justify-center items-center svg:(w-8 h-8)">
30
+ <TheNuxtIcon name="solar:gallery-add-line-duotone"/>
31
+ </i>
32
+ <b>{{ label || $t("\u0622\u067E\u0644\u0648\u062F \u062A\u0635\u0648\u06CC\u0631") }}</b>
33
+ </label>
34
+ <transition-group
35
+ name="list"
36
+ tag="div"
37
+ class="flex flex-row flex-wrap gap-4 items-stretch"
38
+ :class="filesClass"
39
+ >
40
+ <label
41
+ key="label"
42
+ for="image"
43
+ class="flex flex-row items-center justify-center gap-2 bg-box rounded-lg w-57 outline-1 outline-dashed outline-offset-6 my-2 mr-2 cursor-pointer border-border border-1"
44
+ :class="[
45
+ hovered ? 'outline-danger text-danger' : 'outline-primary text-primary-500',
46
+ uploaderClass
47
+ ]">
48
+ <i class="flex justify-center items-center svg:(w-8 h-8)">
49
+ <TheNuxtIcon name="solar:gallery-add-line-duotone"/>
50
+ </i>
51
+ <b>{{ label || $t("\u0622\u067E\u0644\u0648\u062F \u062A\u0635\u0648\u06CC\u0631") }}</b>
52
+ </label>
53
+ <div
54
+ v-for="(image, index) in files"
55
+ :key="index"
56
+ class="bg-box rounded-lg aspect-square w-16 overflow-hidden relative border-(1 solid)"
57
+ :class="[
58
+ selected === index && selectable ? 'border-primary' : 'border-transparent'
59
+ ]"
60
+ >
61
+ <img
62
+ :src="image"
63
+ :alt="index"
64
+ class="w-full h-full object-cover"
65
+ />
66
+ <div v-if="selectable"
67
+ class="absolute inset-0 bg-white bg-opacity-50 svg:(w-6 h-6) opacity-30 transition duration-300 cursor-pointer hover:(opacity-100)"
68
+ @click.self="emit('select', index)">
69
+ </div>
70
+ <TheNuxtIcon name="solar:gallery-remove-line-duotone"
71
+ class="z-1 !absolute left-0 bottom-0 hover:(text-danger) cursor-pointer w-6 h-6"
72
+ @click="deleteImage(index)"
73
+ />
74
+ </div>
75
+ </transition-group>
76
+ </form>
77
+ </template>
78
+
79
+ <script setup>
80
+ const emit = defineEmits(["select", "update:modelValue"]);
81
+ const props = defineProps({
82
+ label: { type: String, required: false },
83
+ selected: { type: Number, required: false },
84
+ max: { type: Number, required: false },
85
+ uploaderClass: { type: String, required: false },
86
+ filesClass: { type: String, required: false },
87
+ selectable: { type: String, required: false },
88
+ watermark: { type: [String, null], required: false },
89
+ accept: { type: [String, null], required: false }
90
+ });
91
+ const hovered = ref(false);
92
+ const loadedpicture = ref("");
93
+ const files = defineModel({ default: () => [] });
94
+ const drop = (e) => {
95
+ hovered.value = false;
96
+ upload(e.dataTransfer);
97
+ };
98
+ const upload = (evt) => {
99
+ if (props.max && files.value?.length >= props.max) return;
100
+ for (let i = 0; i < evt?.files?.length; i++) {
101
+ compile(evt.files[i]);
102
+ }
103
+ };
104
+ const compile = async (file) => {
105
+ if (!file.type.includes("image")) return;
106
+ uploadToServer(file);
107
+ };
108
+ const loading = ref(false);
109
+ const uploadToServer = async (file) => {
110
+ loading.value = true;
111
+ const fm = new FormData();
112
+ fm.append("file", file);
113
+ const { result } = await usePost("/upload", fm);
114
+ if (result) {
115
+ files.value = [...files.value, result];
116
+ }
117
+ loading.value = false;
118
+ };
119
+ const deleteImage = (index) => {
120
+ files.value.splice(index, 1);
121
+ emit(
122
+ "select",
123
+ props.selected > 0 ? props.selected - 1 : props.selected
124
+ );
125
+ };
126
+ </script>
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ label?: string;
3
+ selected?: number;
4
+ max?: number;
5
+ uploaderClass?: string;
6
+ filesClass?: string;
7
+ selectable?: string;
8
+ watermark?: string | null;
9
+ accept?: string | null;
10
+ };
11
+ declare const __VLS_defaultModels: {
12
+ modelValue: () => never[];
13
+ };
14
+ type __VLS_ModelProps = {
15
+ modelValue?: typeof __VLS_defaultModels['modelValue'];
16
+ };
17
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
18
+ 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>;
19
+ declare const _default: typeof __VLS_export;
20
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,40 @@
1
+ <template>
2
+ <ClientOnly>
3
+ <div
4
+ v-if="$pwa?.offlineReady || $pwa?.needRefresh"
5
+ class="pwa-toast"
6
+ role="alert"
7
+ >
8
+ <div class="message">
9
+ <p v-if="$pwa.offlineReady">
10
+ اپلیکیشن آماده اجرا به صورت آفلاین می باشد
11
+ </p>
12
+ <p v-else>
13
+ جهت استفاده از امکانات اپلیکیشن بروزرسانی نمایید.
14
+ </p>
15
+ </div>
16
+ <div class="flex gap-2 items-stretch">
17
+ <TheButton :mini="true" variant="primary-fill" label="بروزرسانی" v-if="$pwa.needRefresh"
18
+ @click="$pwa.updateServiceWorker()"/>
19
+ <TheButton :mini="true" variant="secondary-fill" label="بستن" @click="$pwa.cancelPrompt()"/>
20
+ </div>
21
+ </div>
22
+ <div
23
+ v-if="$pwa?.showInstallPrompt && !$pwa?.offlineReady && !$pwa?.needRefresh"
24
+ class="pwa-toast"
25
+ role="alert"
26
+ >
27
+ <p class="message">
28
+ جهت استفاده راحت تر اپلیکیشن را نصب کنید!
29
+ </p>
30
+ <div class="flex gap-2 items-stretch">
31
+ <TheButton :mini="true" label="نصب" variant="primary-fill" @click="$pwa.install()"/>
32
+ <TheButton :mini="true" label="لغو" variant="primary-fill" @click="$pwa.cancelInstall()"/>
33
+ </div>
34
+ </div>
35
+ </ClientOnly>
36
+ </template>
37
+
38
+ <style>
39
+ .pwa-toast{@apply fixed right-[calc((100vw-30rem)/2+2rem)] bg-white bottom-20 p-4 border-(1 solid primary-500) rounded-xl z-999;@apply flex flex-col items-end gap-4}.message{@apply text-sm}
40
+ </style>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ max?: number;
3
+ min?: number;
4
+ step?: number;
5
+ };
6
+ type __VLS_ModelProps = {
7
+ modelValue?: string | number;
8
+ };
9
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:modelValue": (value: string | number | undefined) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
@@ -0,0 +1,36 @@
1
+ <template>
2
+ <div class="flex items-center gap-1 pt-1 px-1">
3
+ <TheNuxtIcon name="solar:add-circle-bold-duotone" class="text-3xl text-primary-500 "
4
+ @click.prevent.stop="increment(_min([step, remain]))"/>
5
+ <TheInput class="grow h-10" class-name="rounded-2xl bg-bg children:(text-center)" v-model="amount"
6
+ @update:model-value="handler"/>
7
+ <TheNuxtIcon name="solar:minus-circle-line-duotone" class="text-3xl text-primary-500"
8
+ @click.prevent.stop="increment(-1e3)"/>
9
+ </div>
10
+ </template>
11
+
12
+ <script setup>
13
+ const { max = 999999999, min = 0, step = 1e3 } = defineProps({
14
+ max: { type: Number, required: false },
15
+ min: { type: Number, required: false },
16
+ step: { type: Number, required: false }
17
+ });
18
+ const amount = defineModel({ type: [String, Number] });
19
+ const remain = computed(() => max - Number(s2n(amount.value)));
20
+ const increment = (e) => {
21
+ if (e < 0 && Number(s2n(amount.value)) <= Math.abs(e)) {
22
+ amount.value = "0";
23
+ } else {
24
+ amount.value = toLocal(Number(s2n(amount.value)) + e, 0);
25
+ }
26
+ };
27
+ const handler = (e) => {
28
+ if (Number(s2n(amount.value)) < min) {
29
+ amount.value = min;
30
+ } else if (Number(s2n(amount.value)) > max) {
31
+ amount.value = toLocal(max, 0);
32
+ } else {
33
+ amount.value = toLocal(e, 0);
34
+ }
35
+ };
36
+ </script>
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ max?: number;
3
+ min?: number;
4
+ step?: number;
5
+ };
6
+ type __VLS_ModelProps = {
7
+ modelValue?: string | number;
8
+ };
9
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
10
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
+ "update:modelValue": (value: string | number | undefined) => any;
12
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
+ "onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
@@ -0,0 +1,9 @@
1
+ type __VLS_Props = {
2
+ name?: string | null;
3
+ iconType?: string;
4
+ filled?: boolean;
5
+ alt?: string;
6
+ };
7
+ declare const __VLS_export: 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>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
@@ -0,0 +1,29 @@
1
+ <template>
2
+ <div
3
+ v-if="iconType === 'img' || name?.split('.')[1]"
4
+ class="relative overflow-hidden">
5
+ <div v-if="!loaded" class="absolute inset-0 bg-gray-200 animate-pulse z-0"/>
6
+ <img
7
+ :src="name?.includes('http') ? name : '/images/' + (name || 'noimage.jpg')"
8
+ :alt="alt || 'NoImg'"
9
+ loading="lazy"
10
+ @load="loaded = true"
11
+ class="block w-full h-full object-cover transition-opacity duration-300 z-10"
12
+ :class="loaded ? 'opacity-100' : 'opacity-0'"/>
13
+ </div>
14
+ <Icon
15
+ v-else-if="name"
16
+ class="text-2xl overflow-hidden"
17
+ :name="name"/>
18
+ </template>
19
+
20
+ <script setup>
21
+ const props = defineProps({
22
+ name: { type: [String, null], required: false },
23
+ iconType: { type: String, required: false },
24
+ filled: { type: Boolean, required: false },
25
+ alt: { type: String, required: false }
26
+ });
27
+ const iconType = props.iconType || "icon";
28
+ const loaded = ref(false);
29
+ </script>
@@ -0,0 +1,9 @@
1
+ type __VLS_Props = {
2
+ name?: string | null;
3
+ iconType?: string;
4
+ filled?: boolean;
5
+ alt?: string;
6
+ };
7
+ declare const __VLS_export: 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>;
8
+ declare const _default: typeof __VLS_export;
9
+ export default _default;
@@ -0,0 +1,3 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div v-show="$pwa.needRefresh" class="fixed flex flex-col gap-2 items-end bottom-4 right-4 max-w-vw border-(1 solid primary) rounded-lg bg-box-1 p-4 z-999999">
3
+ <div>
4
+ {{ $t('جهت دسترسی به آخرین نسخه اپلیکیشن روی بروزرسانی کلیک نمایید.') }}
5
+ </div>
6
+ <TheButton variant="primary-fill" :label="$t('بروزرسانی')" @click="$pwa.updateServiceWorker()"/>
7
+ </div>
8
+ </template>
9
+
10
+ <script setup>
11
+ const { $pwa } = useNuxtApp();
12
+ const toast = useNuxtApp();
13
+ onMounted(() => {
14
+ if ($pwa.offlineReady)
15
+ toast.success("App ready to work offline");
16
+ });
17
+ </script>
@@ -0,0 +1,3 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ value: string;
3
+ };
4
+ declare const __VLS_export: 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>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,10 @@
1
+ <template>
2
+ <qrcode-vue :value="value" level="H" render-as="svg"/>
3
+ </template>
4
+
5
+ <script setup>
6
+ import QrcodeVue from "qrcode.vue";
7
+ defineProps({
8
+ value: { type: String, required: true }
9
+ });
10
+ </script>
@@ -0,0 +1,6 @@
1
+ type __VLS_Props = {
2
+ value: string;
3
+ };
4
+ declare const __VLS_export: 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>;
5
+ declare const _default: typeof __VLS_export;
6
+ export default _default;
@@ -0,0 +1,13 @@
1
+ import type { Input } from "~/types/models";
2
+ type __VLS_Props = {
3
+ options?: Input["options"];
4
+ placeholder?: string;
5
+ };
6
+ type __VLS_ModelProps = {
7
+ 'from'?: any;
8
+ 'to'?: any;
9
+ };
10
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
11
+ 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>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <div
3
+ v-on-click-outside="close"
4
+ class="bg-box h-12 w-full rounded-lg flex flex-row gap-1 items-stretch text-black-1 relative select-none divide-x divide-x-reverse divide-border relative children:(flex-grow bg-transparent outline-none px-2 text-sm)">
5
+ <input
6
+ placeholder="از"
7
+ v-model="from"
8
+ @focus="focus(0)"/>
9
+ <input
10
+ v-model="to"
11
+ placeholder="تا"
12
+ @focus="focus(1)"/>
13
+ <div
14
+ v-if="show.some((e) => e === true)"
15
+ class="!bg-box absolute top-full right-1/2 max-h-200px w-1/2 z-2 border-none rounded-lg px-0 transform translate-y-2 transition-right duration-300 flex flex-col items-stretch"
16
+ :class="[show[1] ? 'right-1/2' : 'right-0']">
17
+ <div
18
+ class="divide-y divide-border divide-solid flex flex-col items-stretch overflow-y-auto scrollbar-width-thin">
19
+ <div
20
+ v-for="option in options"
21
+ :key="option.key"
22
+ class="divide-y divide-border px-2 py-2 cursor-pointer transition-all duration-300 hover:(text-black-2)"
23
+ @click="select(option.key)">
24
+ {{ option.title }}
25
+ </div>
26
+ </div>
27
+ </div>
28
+ </div>
29
+ </template>
30
+
31
+ <script setup>
32
+ import { vOnClickOutside } from "@vueuse/components";
33
+ const emit = defineEmits(["fromValueChange", "toValueChange"]);
34
+ defineProps({
35
+ options: { type: null, required: false },
36
+ placeholder: { type: String, required: false }
37
+ });
38
+ const from = defineModel("from");
39
+ const to = defineModel("to");
40
+ const show = ref([false, false]);
41
+ const focus = (e) => {
42
+ show.value.fill(false);
43
+ show.value[e] = true;
44
+ };
45
+ const close = () => {
46
+ show.value.fill(false);
47
+ };
48
+ const select = (e) => {
49
+ if (show.value[0]) {
50
+ from.value = e;
51
+ } else {
52
+ to.value = e;
53
+ }
54
+ close();
55
+ };
56
+ </script>
@@ -0,0 +1,13 @@
1
+ import type { Input } from "~/types/models";
2
+ type __VLS_Props = {
3
+ options?: Input["options"];
4
+ placeholder?: string;
5
+ };
6
+ type __VLS_ModelProps = {
7
+ 'from'?: any;
8
+ 'to'?: any;
9
+ };
10
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
11
+ 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>;
12
+ declare const _default: typeof __VLS_export;
13
+ export default _default;