@unsource/ui 2.8.5 → 2.8.7
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 +1 -1
- package/dist/module.mjs +2 -0
- package/dist/runtime/components/UnMap.d.vue.ts +1 -1
- package/dist/runtime/components/UnMap.vue +4 -2
- package/dist/runtime/components/UnMap.vue.d.ts +1 -1
- package/dist/runtime/composables/fetch.js +3 -2
- package/dist/runtime/composables/global.js +19 -18
- package/dist/runtime/composables/reuseable.d.ts +1 -0
- package/dist/runtime/composables/reuseable.js +4 -0
- package/package.json +3 -2
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createResolver, defineNuxtModule, addComponentsDir, addImportsDir, addPlugin } from '@nuxt/kit';
|
|
2
|
+
import defu from 'defu';
|
|
2
3
|
|
|
3
4
|
const resolver = createResolver(import.meta.url);
|
|
4
5
|
const module = defineNuxtModule({
|
|
@@ -86,6 +87,7 @@ const module = defineNuxtModule({
|
|
|
86
87
|
});
|
|
87
88
|
addImportsDir(resolver2.resolve("runtime/composables"));
|
|
88
89
|
addPlugin(resolver2.resolve("runtime/plugins/toast.client"));
|
|
90
|
+
_nuxt.options.runtimeConfig.public.unsourceUi = defu(_nuxt.options.runtimeConfig.public.unsourceUi, _options);
|
|
89
91
|
}
|
|
90
92
|
});
|
|
91
93
|
|
|
@@ -61,8 +61,10 @@ import { Point, Circle as GeomCircle } from "ol/geom";
|
|
|
61
61
|
import { fromLonLat, transform } from "ol/proj";
|
|
62
62
|
import Big from "big.js";
|
|
63
63
|
import { computed, ref, useDevice, useGeolocation, watch } from "#imports";
|
|
64
|
-
|
|
65
|
-
const
|
|
64
|
+
import { useModuleConfig } from "../composables/reuseable";
|
|
65
|
+
const moduleConfig = useModuleConfig();
|
|
66
|
+
const NESHAN_API_KEY = window.NESHAN_API_KEY || moduleConfig?.NESHAN_API_KEY;
|
|
67
|
+
const NESHAN_WEB_KEY = window.NESHAN_WEB_KEY || moduleConfig?.NESHAN_WEB_KEY;
|
|
66
68
|
const emit = defineEmits(["select-point"]);
|
|
67
69
|
const { points = [], readonly, marker } = defineProps({
|
|
68
70
|
points: { type: Array, required: false },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useToken } from "./reuseable.js";
|
|
1
|
+
import { useModuleConfig, useToken } from "./reuseable.js";
|
|
2
2
|
import { _get, _set, useNuxtApp, _takeRight } from "#imports";
|
|
3
3
|
const domain = location.hostname.split(".");
|
|
4
4
|
const tld = _takeRight(domain, 2).join(".");
|
|
@@ -17,12 +17,13 @@ const errorHandler = (error, config) => {
|
|
|
17
17
|
return { error };
|
|
18
18
|
};
|
|
19
19
|
export const fetch = async ({ body = void 0, config = {}, controller = void 0, URL = "", method = "GET" }) => {
|
|
20
|
+
const moduleConfig = useModuleConfig();
|
|
20
21
|
controller = new AbortController();
|
|
21
22
|
const signal = controller.signal;
|
|
22
23
|
config = setHeaders(config);
|
|
23
24
|
try {
|
|
24
25
|
const result = await $fetch(URL, {
|
|
25
|
-
baseURL: window.BASE_URL,
|
|
26
|
+
baseURL: window.BASE_URL || moduleConfig?.BASE_URL,
|
|
26
27
|
method,
|
|
27
28
|
signal,
|
|
28
29
|
body,
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
} from "#imports";
|
|
20
20
|
import { io } from "socket.io-client";
|
|
21
21
|
import { digitsFaToEn, digitsArToEn } from "@persian-tools/persian-tools";
|
|
22
|
-
import { useToken, useUserId } from "./reuseable.js";
|
|
22
|
+
import { useModuleConfig, useToken, useUserId } from "./reuseable.js";
|
|
23
23
|
import Moment from "jalali-moment";
|
|
24
24
|
import Handlebars from "handlebars";
|
|
25
25
|
import Ajv from "ajv";
|
|
@@ -156,7 +156,8 @@ export const minutesToTime = (m = 0) => {
|
|
|
156
156
|
return `${hour.padStart(2, 0)}:${minute.padStart(2, 0)}`;
|
|
157
157
|
};
|
|
158
158
|
export const useSocketIo = () => {
|
|
159
|
-
const
|
|
159
|
+
const moduleConfig = useModuleConfig();
|
|
160
|
+
const socket = io(window.BASE_URL || moduleConfig?.BASE_URL, {
|
|
160
161
|
extraHeaders: {
|
|
161
162
|
authorization: useToken().value || ""
|
|
162
163
|
// 'app-code': APP_CODE
|
|
@@ -387,20 +388,20 @@ export const merge = (v, s) => {
|
|
|
387
388
|
}
|
|
388
389
|
};
|
|
389
390
|
export const variants = {
|
|
390
|
-
"success": "bg-success/10 text-success",
|
|
391
|
-
"success-fill": "bg-success text-white",
|
|
392
|
-
"success-flat": "bg-white text-success",
|
|
393
|
-
"danger": "bg-danger/10 text-danger",
|
|
394
|
-
"danger-fill": "bg-danger text-white",
|
|
395
|
-
"danger-flat": "bg-white bg-danger",
|
|
396
|
-
"warning": "bg-warning/10 text-warning",
|
|
397
|
-
"warning-fill": "bg-warning text-white",
|
|
398
|
-
"warning-flat": "bg-white text-warning",
|
|
399
|
-
"primary": "bg-primary-500/10 text-primary-500",
|
|
400
|
-
"primary-fill": "bg-primary-500 text-white",
|
|
401
|
-
"primary-border": "
|
|
402
|
-
"primary-flat": "bg-white text-primary-500",
|
|
403
|
-
"secondary": "bg-gray-600/10 text-secondary-500",
|
|
404
|
-
"secondary-fill": "bg-secondary-500 text-white",
|
|
405
|
-
"secondary-flat": "bg-white text-secondary-500"
|
|
391
|
+
"success": "border-transparent bg-success/10 text-success",
|
|
392
|
+
"success-fill": "border-success bg-success text-white",
|
|
393
|
+
"success-flat": "border-transparent bg-white text-success",
|
|
394
|
+
"danger": "border-transparent bg-danger/10 text-danger",
|
|
395
|
+
"danger-fill": "border-danger bg-danger text-white",
|
|
396
|
+
"danger-flat": "border-transparent bg-white bg-danger",
|
|
397
|
+
"warning": "border-transparent bg-warning/10 text-warning",
|
|
398
|
+
"warning-fill": "border-warning bg-warning text-white",
|
|
399
|
+
"warning-flat": "border-transparent bg-white text-warning",
|
|
400
|
+
"primary": "border-transparent bg-primary-500/10 text-primary-500",
|
|
401
|
+
"primary-fill": "border-primary-500 bg-primary-500 text-white",
|
|
402
|
+
"primary-border": "border-primary-500 bg-primary-500/10 text-primary-500",
|
|
403
|
+
"primary-flat": "border-transparent bg-white text-primary-500",
|
|
404
|
+
"secondary": "border-transparent bg-gray-600/10 text-secondary-500",
|
|
405
|
+
"secondary-fill": "border-secondary-500 bg-secondary-500 text-white",
|
|
406
|
+
"secondary-flat": "border-transparent bg-white text-secondary-500"
|
|
406
407
|
};
|
|
@@ -48,6 +48,7 @@ export declare const BookingPrice: (booking: Booking) => number;
|
|
|
48
48
|
export declare const authenticate: () => Promise<void>;
|
|
49
49
|
export declare const authenticateProvider: () => Promise<void>;
|
|
50
50
|
export declare const useConfig: () => import("@nuxt/schema").PublicRuntimeConfig;
|
|
51
|
+
export declare const useModuleConfig: () => unknown;
|
|
51
52
|
export declare const isProviderSide: (config: {
|
|
52
53
|
userType: string;
|
|
53
54
|
}) => boolean;
|
|
@@ -67,6 +67,10 @@ export const useConfig = () => {
|
|
|
67
67
|
const { public: config } = useRuntimeConfig();
|
|
68
68
|
return config;
|
|
69
69
|
};
|
|
70
|
+
export const useModuleConfig = () => {
|
|
71
|
+
const config = useConfig();
|
|
72
|
+
return config.unsourceUi;
|
|
73
|
+
};
|
|
70
74
|
export const isProviderSide = (config) => {
|
|
71
75
|
return config?.userType === "PROVIDER";
|
|
72
76
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unsource/ui",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "nuxt ui kit for unsource env",
|
|
6
6
|
"repository": "https://github.com/alisa2142/unsource-ui",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"vue-json-pretty": "^2.6.0",
|
|
62
62
|
"vue3-otp-input": "^0.5.40",
|
|
63
63
|
"vue3-persian-datetime-picker": "^1.2.2",
|
|
64
|
-
"vue3-toastify": "^0.2.8"
|
|
64
|
+
"vue3-toastify": "^0.2.8",
|
|
65
|
+
"defu": "^6.1.4"
|
|
65
66
|
},
|
|
66
67
|
"peerDependencies": {
|
|
67
68
|
"ajv": "^8.17.1",
|