@unsource/ui 2.0.23 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -52,6 +52,21 @@ const module = defineNuxtModule({
|
|
|
52
52
|
},
|
|
53
53
|
// Default configuration options of the Nuxt module
|
|
54
54
|
defaults: {},
|
|
55
|
+
hooks: {
|
|
56
|
+
"vite:extend": ({ config }) => {
|
|
57
|
+
config.optimizeDeps.includes = [
|
|
58
|
+
"@unsource/ui",
|
|
59
|
+
"@iconify/utils",
|
|
60
|
+
"vue3-persian-datetime-picker",
|
|
61
|
+
"earcut",
|
|
62
|
+
"xml-utils/*",
|
|
63
|
+
"numeral",
|
|
64
|
+
"persian-number",
|
|
65
|
+
"ajv",
|
|
66
|
+
"handlebars"
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
},
|
|
55
70
|
async setup(_options, _nuxt) {
|
|
56
71
|
const resolver2 = createResolver(import.meta.url);
|
|
57
72
|
addComponentsDir({
|
|
@@ -17,37 +17,9 @@ import {
|
|
|
17
17
|
useAsyncData,
|
|
18
18
|
useNuxtApp,
|
|
19
19
|
watch,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_toPairs,
|
|
23
|
-
_get
|
|
20
|
+
setOptions,
|
|
21
|
+
ajv
|
|
24
22
|
} from "#imports";
|
|
25
|
-
import Handlebars from "handlebars";
|
|
26
|
-
import Ajv from "ajv";
|
|
27
|
-
const ajv = new Ajv();
|
|
28
|
-
const setOptions = async (f, ctx2 = {}) => {
|
|
29
|
-
if (f.input?.extendedInputKey) {
|
|
30
|
-
return {
|
|
31
|
-
...f,
|
|
32
|
-
input: {
|
|
33
|
-
...f.input,
|
|
34
|
-
options: f.input?.extendInput?.options ?? []
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
} else if (f.input?.externalOptions) {
|
|
38
|
-
const template = Handlebars.compile(f.input?.externalOptions);
|
|
39
|
-
const { result } = await useGet(template(ctx2));
|
|
40
|
-
return {
|
|
41
|
-
...f,
|
|
42
|
-
input: {
|
|
43
|
-
...f.input,
|
|
44
|
-
options: (result ?? []).map((e) => _fromPairs(_toPairs(f.input?.externalOptionsKeys).map((p) => [p[0], _get(e, p[1])])))
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
} else {
|
|
48
|
-
return f;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
23
|
const { name, ctx } = defineProps({
|
|
52
24
|
name: { type: String, required: true },
|
|
53
25
|
ctx: { type: Object, required: false }
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
<script setup>
|
|
28
28
|
import { s2n, p2e, computed } from "#imports";
|
|
29
|
-
import
|
|
29
|
+
import numeral from "numeral";
|
|
30
30
|
const { Type, Input } = defineProps({
|
|
31
31
|
disabled: { type: Boolean, required: false },
|
|
32
32
|
Input: { type: Object, required: false },
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { CoinGateway, DiscountCode, Form, Transaction, Wallet } from '../types/models.js';
|
|
2
2
|
import type { Address, MetaData, SocketJoinObject } from '../types/app.js';
|
|
3
3
|
import type { RemovableRef } from '@vueuse/core';
|
|
4
|
+
import Moment from 'jalali-moment';
|
|
5
|
+
export declare const moment: typeof Moment;
|
|
6
|
+
export declare const ajv: any;
|
|
4
7
|
export declare const NESHAN_API_KEY = "service.23c2db7869bd44b986353729776b338c";
|
|
5
8
|
export declare const NESHAN_WEB_KEY = "web.698da9dc73764b18a38a4c5cc4f92320";
|
|
6
9
|
export declare const logger: (...args: any) => void;
|
|
@@ -16,23 +19,23 @@ export declare const copyData: (string: string) => Promise<void>;
|
|
|
16
19
|
export declare const mapper: (data: Record<string, any>, map: Record<string, any>, keys?: string[]) => Record<string, any>;
|
|
17
20
|
export declare const deg2rad: (deg: number) => number;
|
|
18
21
|
export declare const getDistanceFromLatLonInKm: (lat1: number, lon1: number, lat2: number, lon2: number) => number;
|
|
19
|
-
export declare const isoToNormal: (time: string) =>
|
|
20
|
-
export declare const isoToMonth: (time: string) =>
|
|
21
|
-
export declare const isoToDateTime: (time: string) =>
|
|
22
|
-
export declare const isoToHumanDateTime: (time: string) =>
|
|
23
|
-
export declare const isoToTime: (time: string) =>
|
|
24
|
-
export declare const isoToDate: (time: string) =>
|
|
25
|
-
export declare const isoToStandard: (time: string) =>
|
|
22
|
+
export declare const isoToNormal: (time: string) => string;
|
|
23
|
+
export declare const isoToMonth: (time: string) => string;
|
|
24
|
+
export declare const isoToDateTime: (time: string) => string;
|
|
25
|
+
export declare const isoToHumanDateTime: (time: string) => string;
|
|
26
|
+
export declare const isoToTime: (time: string) => string;
|
|
27
|
+
export declare const isoToDate: (time: string) => string;
|
|
28
|
+
export declare const isoToStandard: (time: string) => string;
|
|
26
29
|
export declare const dataToRange: (data: any[] | undefined) => [string, string];
|
|
27
30
|
export declare const subIsoDate: (du: string) => string;
|
|
28
|
-
export declare const isExpire: (time: any) =>
|
|
31
|
+
export declare const isExpire: (time: any) => boolean;
|
|
29
32
|
export declare const remainToExpire: (timestamp: any, time: string) => string[];
|
|
30
33
|
export declare const timeToDurationShort: (timeString?: string) => string;
|
|
31
34
|
export declare const timeToMinutes: (timeString?: string) => number;
|
|
32
35
|
export declare const minutesToTime: (m?: number) => string;
|
|
33
36
|
export declare const useSocketIo: () => import("socket.io-client").Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap>;
|
|
34
37
|
export declare const watchSocket: (socket: any, joinObject: SocketJoinObject, dataHandler: any, loading?: import("vue").Ref<boolean, boolean>, initHandler?: () => Promise<void>) => void;
|
|
35
|
-
export declare const lastAct: (time: string) =>
|
|
38
|
+
export declare const lastAct: (time: string) => string;
|
|
36
39
|
export declare const setMeta: (data: MetaData) => void;
|
|
37
40
|
export declare const encrypt: (text: any, passphrase: any) => any;
|
|
38
41
|
export declare const decrypt: (ciphertext: any, passphrase: any) => any;
|
|
@@ -18,6 +18,11 @@ import {
|
|
|
18
18
|
import { io } from "socket.io-client";
|
|
19
19
|
import { digitsFaToEn, digitsArToEn } from "@persian-tools/persian-tools";
|
|
20
20
|
import { useToken, useUserId } from "./reuseable.js";
|
|
21
|
+
import Moment from "jalali-moment";
|
|
22
|
+
import Handlebars from "handlebars";
|
|
23
|
+
import Ajv from "ajv";
|
|
24
|
+
export const moment = Moment;
|
|
25
|
+
export const ajv = Ajv();
|
|
21
26
|
export const NESHAN_API_KEY = "service.23c2db7869bd44b986353729776b338c";
|
|
22
27
|
export const NESHAN_WEB_KEY = "web.698da9dc73764b18a38a4c5cc4f92320";
|
|
23
28
|
export const logger = (...args) => console.log("logger=>>>", ...args);
|