@topvisor/ui 0.9.33 → 0.9.34-utils-components-2
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/.chunks/{datepicker-D1JLNEmV.es.js → datepicker-BGhDjLcn.es.js} +2 -2
- package/.chunks/{datepicker-D1JLNEmV.es.js.map → datepicker-BGhDjLcn.es.js.map} +1 -1
- package/.chunks/{datepicker-5QMJRJn-.amd.js → datepicker-DM6aPyRB.amd.js} +2 -2
- package/.chunks/{datepicker-5QMJRJn-.amd.js.map → datepicker-DM6aPyRB.amd.js.map} +1 -1
- package/.chunks/{forms-S36M7cBH.es.js → forms-CRAV8PiZ.es.js} +328 -312
- package/.chunks/forms-CRAV8PiZ.es.js.map +1 -0
- package/.chunks/forms-Cksc7Rb7.amd.js +3 -0
- package/.chunks/forms-Cksc7Rb7.amd.js.map +1 -0
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-BfCj7kQR.es.js → listItem.vue_vue_type_script_setup_true_lang-C2XaxeNZ.es.js} +9 -9
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-BfCj7kQR.es.js.map → listItem.vue_vue_type_script_setup_true_lang-C2XaxeNZ.es.js.map} +1 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CpNwVBHY.amd.js +2 -0
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-C7tg-67i.amd.js.map → listItem.vue_vue_type_script_setup_true_lang-CpNwVBHY.amd.js.map} +1 -1
- package/.chunks/{menu-v5knQbeF.es.js → menu-BWjYRHkQ.es.js} +8 -8
- package/.chunks/menu-BWjYRHkQ.es.js.map +1 -0
- package/.chunks/{menu-S1Hk7D3W.amd.js → menu-BX8GV8-v.amd.js} +2 -2
- package/.chunks/menu-BX8GV8-v.amd.js.map +1 -0
- package/.chunks/{popup-DncRq57t.amd.js → popup-3fVBIqu0.amd.js} +3 -3
- package/.chunks/{popup-DncRq57t.amd.js.map → popup-3fVBIqu0.amd.js.map} +1 -1
- package/.chunks/{popup-BK3xlBZm.es.js → popup-BWTP6yaC.es.js} +3 -3
- package/.chunks/{popup-BK3xlBZm.es.js.map → popup-BWTP6yaC.es.js.map} +1 -1
- package/.chunks/punycode.es6-C2yitnNb.amd.js +2 -0
- package/.chunks/punycode.es6-C2yitnNb.amd.js.map +1 -0
- package/.chunks/punycode.es6-CNI-zL6U.es.js +134 -0
- package/.chunks/punycode.es6-CNI-zL6U.es.js.map +1 -0
- package/assets/core.css +1 -1
- package/assets/dark.css +1 -1
- package/assets/forms.css +1 -1
- package/assets/formsExt.css +1 -1
- package/assets/light.css +1 -1
- package/core/core.amd.js +1 -1
- package/core/core.js +1 -1
- package/core/directives/focus.amd.js +2 -0
- package/core/directives/focus.amd.js.map +1 -0
- package/core/directives/focus.d.ts +3 -0
- package/core/directives/focus.js +5 -0
- package/core/directives/focus.js.map +1 -0
- package/core/directives/sticky.amd.js +2 -0
- package/core/directives/sticky.amd.js.map +1 -0
- package/core/directives/sticky.d.ts +3 -0
- package/core/directives/sticky.js +5 -0
- package/core/directives/sticky.js.map +1 -0
- package/core/directives/swimUp.amd.js +2 -0
- package/core/directives/swimUp.amd.js.map +1 -0
- package/core/directives/swimUp.d.ts +3 -0
- package/core/directives/swimUp.js +5 -0
- package/core/directives/swimUp.js.map +1 -0
- package/core/directives/tooltip.amd.js +2 -0
- package/core/directives/tooltip.amd.js.map +1 -0
- package/core/directives/tooltip.d.ts +3 -0
- package/core/directives/tooltip.js +5 -0
- package/core/directives/tooltip.js.map +1 -0
- package/core/plugin/plugin.amd.js +2 -0
- package/core/plugin/plugin.amd.js.map +1 -0
- package/core/plugin/plugin.d.ts +3 -0
- package/core/plugin/plugin.js +23 -0
- package/core/plugin/plugin.js.map +1 -0
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +14 -14
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +122 -363
- package/formsExt/formsExt.js.map +1 -1
- package/package.json +32 -24
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +47 -6
- package/popup/popup.js.map +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.js +3 -3
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +15 -15
- package/project/project.js.map +1 -1
- package/src/components/forms/avatar/avatar.stories.d.ts +15 -14
- package/src/components/forms/avatar/avatar.vue.d.ts +7 -6
- package/src/components/forms/button/button.stories.d.ts +59 -57
- package/src/components/forms/button/button.vue.d.ts +10 -8
- package/src/components/forms/checkbox/checkbox.stories.d.ts +34 -33
- package/src/components/forms/checkbox/checkbox.vue.d.ts +17 -16
- package/src/components/forms/controlLabel/controlLabel.stories.d.ts +14 -13
- package/src/components/forms/controlLabel/controlLabel.vue.d.ts +4 -3
- package/src/components/forms/forms.d.ts +33 -13
- package/src/components/forms/hint/hint.stories.d.ts +23 -22
- package/src/components/forms/hint/hint.vue.d.ts +4 -3
- package/src/components/forms/input/input.stories.d.ts +64 -62
- package/src/components/forms/input/input.vue.d.ts +10 -8
- package/src/components/forms/inputDate/inputDate.d.ts +1 -1
- package/src/components/forms/inputDate/inputDate.stories.d.ts +31 -29
- package/src/components/forms/inputDate/inputDate.vue.d.ts +6 -5
- package/src/components/forms/inputRange/inputRange.stories.d.ts +84 -81
- package/src/components/forms/inputRange/inputRange.vue.d.ts +2 -1
- package/src/components/forms/loadbar/loadbar.stories.d.ts +2 -1
- package/src/components/forms/loadbar/loadbar.vue.d.ts +2 -1
- package/src/components/forms/radio/radio.stories.d.ts +32 -31
- package/src/components/forms/radio/radio.vue.d.ts +5 -4
- package/src/components/forms/select/select.stories.d.ts +24 -22
- package/src/components/forms/select/select.vue.d.ts +25 -23
- package/src/components/forms/switcher/switcher.stories.d.ts +32 -31
- package/src/components/forms/switcher/switcher.vue.d.ts +5 -4
- package/src/components/forms/textarea/textarea.stories.d.ts +24 -23
- package/src/components/forms/textarea/textarea.vue.d.ts +6 -5
- package/src/components/formsExt/editArea/editArea.stories.d.ts +40 -39
- package/src/components/formsExt/editArea/editArea.vue.d.ts +6 -5
- package/src/components/formsExt/editInput/editInput.stories.d.ts +22 -19
- package/src/components/formsExt/editInput/editInput.vue.d.ts +5 -4
- package/src/components/formsExt/formsExt.d.ts +10 -5
- package/src/components/formsExt/menu/menu.stories.d.ts +15 -14
- package/src/components/formsExt/menu/menu.vue.d.ts +17 -16
- package/src/components/formsExt/radioGroup/radioGroup.stories.d.ts +16 -14
- package/src/components/formsExt/radioGroup/radioGroup.vue.d.ts +17 -14
- package/src/components/formsExt/selector2/api.d.ts +2 -2
- package/src/components/formsExt/selector2/selector2.stories.d.ts +67 -65
- package/src/components/popup/popup/listItem.vue.d.ts +5 -4
- package/src/components/popup/popup/opener.vue.d.ts +8 -7
- package/src/components/popup/popup/popup.stories.d.ts +198 -193
- package/src/components/popup/popup/popup.vue.d.ts +9 -8
- package/src/components/popup/popup/widgetInput.vue.d.ts +31 -28
- package/src/components/popup/popup.d.ts +10 -4
- package/src/components/popup/worker.d.ts +4 -1
- package/src/components/project/project.d.ts +4 -1
- package/src/components/project/selectorCompetitors/composables.d.ts +2 -1
- package/src/components/project/selectorCompetitors/selectorCompetitors.stories.d.ts +9 -8
- package/src/components/project/selectorCompetitors/selectorCompetitors.vue.d.ts +10 -9
- package/src/components/project/selectorCompetitors/stories/items.d.ts +2 -1
- package/src/components/tabs/tabs/content.vue.d.ts +4 -3
- package/src/components/tabs/tabs/tab.vue.d.ts +4 -3
- package/src/components/tabs/tabs/tabs.stories.d.ts +165 -162
- package/src/components/tabs/tabs/tabs.vue.d.ts +4 -3
- package/src/components/tabs/tabs.d.ts +8 -3
- package/src/components/tabsView/tabsView/menu.vue.d.ts +7 -6
- package/src/components/tabsView/tabsView/menuDelimeter.vue.d.ts +2 -1
- package/src/components/tabsView/tabsView/menuItem.vue.d.ts +6 -5
- package/src/components/tabsView/tabsView/menuTitle.vue.d.ts +4 -3
- package/src/components/tabsView/tabsView/store.d.ts +126 -69
- package/src/components/tabsView/tabsView/tabsView.d.ts +1 -1
- package/src/components/tabsView/tabsView/tabsView.stories.d.ts +95 -94
- package/src/components/tabsView/tabsView/tabsView.vue.d.ts +13 -12
- package/src/components/tabsView/tabsView//320/255/320/273/320/265/320/274/320/265/320/275/321/202/321/213/MenuItem.stories.d.ts +93 -92
- package/src/components/tabsView/tabsView//320/255/320/273/320/265/320/274/320/265/320/275/321/202/321/213/MenuTitle.stories.d.ts +45 -44
- package/src/components/tabsView/tabsView.d.ts +8 -3
- package/src/core/core/core.d.ts +1 -0
- package/src/core/core/page.d.ts +4 -0
- package/src/core/core/state.d.ts +4 -0
- package/src/core/directives/focus.d.ts +9 -0
- package/src/core/directives/sticky.d.ts +11 -0
- package/src/core/directives/swimUp.d.ts +10 -0
- package/src/core/directives/tooltip.d.ts +11 -0
- package/src/core/plugin/plugin.d.ts +48 -0
- package/src/core/utils/device.d.ts +6 -0
- package/src/core/utils/image.d.ts +12 -0
- package/src/core/utils/number.d.ts +7 -0
- package/src/core/utils/store/plugin.d.ts +2 -1
- package/src/core/utils/string.d.ts +4 -0
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.amd.js.map +1 -1
- package/tabs/tabs.js +23 -23
- package/tabs/tabs.js.map +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +72 -73
- package/tabsView/tabsView.js.map +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.js +7 -7
- package/utils/device.amd.js +1 -1
- package/utils/device.js +9 -8
- package/utils/image.amd.js +2 -0
- package/utils/image.amd.js.map +1 -0
- package/utils/image.d.ts +1 -0
- package/utils/image.js +13 -0
- package/utils/image.js.map +1 -0
- package/utils/number.amd.js +2 -0
- package/utils/number.amd.js.map +1 -0
- package/utils/number.d.ts +1 -0
- package/utils/number.js +9 -0
- package/utils/number.js.map +1 -0
- package/utils/scroll.amd.js +1 -1
- package/utils/scroll.js +1 -1
- package/utils/string.amd.js +1 -1
- package/utils/string.amd.js.map +1 -1
- package/utils/string.js +20 -13
- package/utils/string.js.map +1 -1
- package/utils/system.amd.js +1 -1
- package/utils/system.amd.js.map +1 -1
- package/utils/system.js +8 -8
- package/utils/system.js.map +1 -1
- package/utils/url.amd.js +2 -2
- package/utils/url.amd.js.map +1 -1
- package/utils/url.js +40 -168
- package/utils/url.js.map +1 -1
- package/utils/window.amd.js +1 -1
- package/utils/window.js +1 -1
- package/web-types.json +62 -0
- package/.chunks/forms-B2NcBl7S.amd.js +0 -3
- package/.chunks/forms-B2NcBl7S.amd.js.map +0 -1
- package/.chunks/forms-S36M7cBH.es.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-C7tg-67i.amd.js +0 -2
- package/.chunks/menu-S1Hk7D3W.amd.js.map +0 -1
- package/.chunks/menu-v5knQbeF.es.js.map +0 -1
- package/.chunks/widgetInput-Br5COpvG.es.js +0 -46
- package/.chunks/widgetInput-Br5COpvG.es.js.map +0 -1
- package/.chunks/widgetInput-CrrUoVPc.amd.js +0 -2
- package/.chunks/widgetInput-CrrUoVPc.amd.js.map +0 -1
- package/src/components/formsExt/selector2/itemMulti.vue.d.ts +0 -17
- package/src/components/formsExt/selector2/selector2.vue.d.ts +0 -130
- package/src/core/utils/common.d.ts +0 -21
- package/utils/common.amd.js +0 -2
- package/utils/common.amd.js.map +0 -1
- package/utils/common.d.ts +0 -1
- package/utils/common.js +0 -21
- package/utils/common.js.map +0 -1
- /package/assets/{widgetInput.css → popup.css} +0 -0
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { Item, Props, Slots } from './selector2';
|
|
2
|
-
|
|
3
|
-
declare function __VLS_template(): Readonly<Slots> & Slots;
|
|
4
|
-
declare const __VLS_component: import('vue').DefineComponent<{
|
|
5
|
-
modelValue: import('vue').PropType<Props["modelValue"]>;
|
|
6
|
-
size: {
|
|
7
|
-
type: import('vue').PropType<import('../../forms/helpers').Size>;
|
|
8
|
-
default: string;
|
|
9
|
-
};
|
|
10
|
-
disabled: {
|
|
11
|
-
type: import('vue').PropType<boolean>;
|
|
12
|
-
};
|
|
13
|
-
isError: {
|
|
14
|
-
type: import('vue').PropType<boolean>;
|
|
15
|
-
};
|
|
16
|
-
placeholder: {
|
|
17
|
-
type: import('vue').PropType<string>;
|
|
18
|
-
};
|
|
19
|
-
addChanger: {
|
|
20
|
-
type: import('vue').PropType<boolean>;
|
|
21
|
-
};
|
|
22
|
-
items: {
|
|
23
|
-
type: import('vue').PropType<Item[]>;
|
|
24
|
-
default: () => Array<Item>;
|
|
25
|
-
};
|
|
26
|
-
minLength: {
|
|
27
|
-
type: import('vue').PropType<number>;
|
|
28
|
-
default: number;
|
|
29
|
-
};
|
|
30
|
-
apiRequest: {
|
|
31
|
-
type: import('vue').PropType<{
|
|
32
|
-
[propName: string]: any;
|
|
33
|
-
params: {
|
|
34
|
-
limit?: number;
|
|
35
|
-
offset?: number;
|
|
36
|
-
search?: string;
|
|
37
|
-
};
|
|
38
|
-
call: Function;
|
|
39
|
-
cache: Map<string, {
|
|
40
|
-
result: Array<Item>;
|
|
41
|
-
nextOffset?: number;
|
|
42
|
-
}>;
|
|
43
|
-
}>;
|
|
44
|
-
};
|
|
45
|
-
useCache: {
|
|
46
|
-
type: import('vue').PropType<boolean>;
|
|
47
|
-
};
|
|
48
|
-
multiselect: {
|
|
49
|
-
type: import('vue').PropType<boolean>;
|
|
50
|
-
};
|
|
51
|
-
appendSearchToResult: {
|
|
52
|
-
type: import('vue').PropType<boolean>;
|
|
53
|
-
};
|
|
54
|
-
appendAllValue: {
|
|
55
|
-
type: import('vue').PropType<boolean>;
|
|
56
|
-
};
|
|
57
|
-
showSelectedInInput: {
|
|
58
|
-
type: import('vue').PropType<boolean>;
|
|
59
|
-
default: boolean;
|
|
60
|
-
};
|
|
61
|
-
}, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
62
|
-
modelValue: import('vue').PropType<Props["modelValue"]>;
|
|
63
|
-
size: {
|
|
64
|
-
type: import('vue').PropType<import('../../forms/helpers').Size>;
|
|
65
|
-
default: string;
|
|
66
|
-
};
|
|
67
|
-
disabled: {
|
|
68
|
-
type: import('vue').PropType<boolean>;
|
|
69
|
-
};
|
|
70
|
-
isError: {
|
|
71
|
-
type: import('vue').PropType<boolean>;
|
|
72
|
-
};
|
|
73
|
-
placeholder: {
|
|
74
|
-
type: import('vue').PropType<string>;
|
|
75
|
-
};
|
|
76
|
-
addChanger: {
|
|
77
|
-
type: import('vue').PropType<boolean>;
|
|
78
|
-
};
|
|
79
|
-
items: {
|
|
80
|
-
type: import('vue').PropType<Item[]>;
|
|
81
|
-
default: () => Array<Item>;
|
|
82
|
-
};
|
|
83
|
-
minLength: {
|
|
84
|
-
type: import('vue').PropType<number>;
|
|
85
|
-
default: number;
|
|
86
|
-
};
|
|
87
|
-
apiRequest: {
|
|
88
|
-
type: import('vue').PropType<{
|
|
89
|
-
[propName: string]: any;
|
|
90
|
-
params: {
|
|
91
|
-
limit?: number;
|
|
92
|
-
offset?: number;
|
|
93
|
-
search?: string;
|
|
94
|
-
};
|
|
95
|
-
call: Function;
|
|
96
|
-
cache: Map<string, {
|
|
97
|
-
result: Array<Item>;
|
|
98
|
-
nextOffset?: number;
|
|
99
|
-
}>;
|
|
100
|
-
}>;
|
|
101
|
-
};
|
|
102
|
-
useCache: {
|
|
103
|
-
type: import('vue').PropType<boolean>;
|
|
104
|
-
};
|
|
105
|
-
multiselect: {
|
|
106
|
-
type: import('vue').PropType<boolean>;
|
|
107
|
-
};
|
|
108
|
-
appendSearchToResult: {
|
|
109
|
-
type: import('vue').PropType<boolean>;
|
|
110
|
-
};
|
|
111
|
-
appendAllValue: {
|
|
112
|
-
type: import('vue').PropType<boolean>;
|
|
113
|
-
};
|
|
114
|
-
showSelectedInInput: {
|
|
115
|
-
type: import('vue').PropType<boolean>;
|
|
116
|
-
default: boolean;
|
|
117
|
-
};
|
|
118
|
-
}>>, {
|
|
119
|
-
size: import('../../forms/helpers').Size;
|
|
120
|
-
items: Item[];
|
|
121
|
-
minLength: number;
|
|
122
|
-
showSelectedInInput: boolean;
|
|
123
|
-
}, {}>;
|
|
124
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
125
|
-
export default _default;
|
|
126
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
127
|
-
new (): {
|
|
128
|
-
$slots: S;
|
|
129
|
-
};
|
|
130
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Получить случайную строку
|
|
3
|
-
*/
|
|
4
|
-
export declare const getRandomHash: (length?: number) => string;
|
|
5
|
-
/**
|
|
6
|
-
* Посчитать процент от числа (сколько процентов составляет part от full)
|
|
7
|
-
* @param part - первое число
|
|
8
|
-
* @param full - второе число
|
|
9
|
-
* @param precision - точность (колличество знаков после запятой)
|
|
10
|
-
*/
|
|
11
|
-
export declare const percentOfNumber: (part: "--" | number, full?: number, precision?: number) => "--" | number;
|
|
12
|
-
/**
|
|
13
|
-
* Проверить скрыта страница или нет
|
|
14
|
-
*/
|
|
15
|
-
export declare const isPageHidden: () => boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Скачать изображение, переданное в виде строки
|
|
18
|
-
* @param imageStr - адресс картинки
|
|
19
|
-
* @param imageName - имя файла при загрузке, по умолчанию download
|
|
20
|
-
*/
|
|
21
|
-
export declare const downloadImageFromString: (imageStr: string, imageName?: string) => void;
|
package/utils/common.amd.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
define(["require","exports"],function(l,d){"use strict";if(typeof a>"u")var a=window.Vue;const r=(t=20)=>{const o="AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890";let e="";for(let n=0;n<t;n++)e+=o[Math.floor(Math.random()*o.length)];return e},u=(t,o=100,e=0)=>{if(t==="--")return t;let n=o*1?t/o:0;return n*=100,!e&&n<1?n=Math.round(n*Math.pow(10,2))/Math.pow(10,2):n=Math.round(n*Math.pow(10,e))/Math.pow(10,e),n},i=()=>document.hidden,c=(t,o="download")=>{const e=document.createElement("a");e.download=o,e.href=t,e.click()};d.downloadImageFromString=c,d.getRandomHash=r,d.isPageHidden=i,d.percentOfNumber=u,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
-
//# sourceMappingURL=common.amd.js.map
|
package/utils/common.amd.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.amd.js","sources":["../../src/core/utils/common.ts"],"sourcesContent":["/**\r\n * Получить случайную строку\r\n */\r\nexport const getRandomHash = (length: number = 20): string => {\r\n\tconst l = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890';\r\n\r\n\tlet result = '';\r\n\tfor (let i = 0; i < length; i++) {\r\n\t\tresult += l[Math.floor(Math.random() * l.length)];\r\n\t}\r\n\r\n\treturn result;\r\n};\r\n\r\n/**\r\n * Посчитать процент от числа (сколько процентов составляет part от full)\r\n * @param part - первое число\r\n * @param full - второе число\r\n * @param precision - точность (колличество знаков после запятой)\r\n */\r\nexport const percentOfNumber = (part: '--' | number, full: number = 100, precision: number = 0): '--' | number => {\r\n\tif (part === '--') return part;\r\n\r\n\tlet percent = (full * 1) ? part / full : 0;\r\n\tpercent *= 100;\r\n\r\n\t// если десятичные знаки не выводятся и число при округлении может дать ноль, то округляем в большую сторону\r\n\tif (!precision && percent < 1) {\r\n\t\tpercent = Math.round(percent * (Math.pow(10, 2))) / (Math.pow(10, 2));\r\n\t} else {\r\n\t\tpercent = Math.round(percent * (Math.pow(10, precision))) / (Math.pow(10, precision));\r\n\t}\r\n\r\n\treturn percent;\r\n};\r\n\r\n/**\r\n * Проверить скрыта страница или нет\r\n */\r\nexport const isPageHidden = (): boolean => document.hidden;\r\n\r\n/**\r\n * Скачать изображение, переданное в виде строки\r\n * @param imageStr - адресс картинки\r\n * @param imageName - имя файла при загрузке, по умолчанию download\r\n */\r\nexport const downloadImageFromString = (imageStr: string, imageName: string = 'download'): void => {\r\n\tconst a = document.createElement('a');\r\n\ta.download = imageName;\r\n\ta.href = imageStr;\r\n\ta.click();\r\n};"],"names":["getRandomHash","length","l","result","i","percentOfNumber","part","full","precision","percent","isPageHidden","downloadImageFromString","imageStr","imageName","a"],"mappings":"yFAGa,MAAAA,EAAA,CAAAC,EAAA,KAAA,CACZ,MAAAC,EAAA,iEAEA,IAAAC,EAAA,GACA,QAAAC,EAAA,EAAAA,EAAAH,EAAAG,IACCD,GAAAD,EAAA,KAAA,MAAA,KAAA,OAAA,EAAAA,EAAA,MAAA,CAAA,YAYKG,EAAA,CAAAC,EAAAC,EAAA,IAAAC,EAAA,IAAA,CACN,GAAAF,IAAA,KAAA,OAAAA,EAEA,IAAAG,EAAAF,EAAA,EAAAD,EAAAC,EAAA,gBAIA,CAAAC,GAAAC,EAAA,iGAYYC,EAAA,IAAA,SAAA,OAONC,EAAA,CAAAC,EAAAC,EAAA,aAAA,qCAENC,EAAA,SAAAD,EACAC,EAAA,KAAAF,EACAE,EAAA,MAAA,CACD"}
|
package/utils/common.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '../src/core/utils/common'
|
package/utils/common.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const a = (o = 20) => {
|
|
2
|
-
const n = "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890";
|
|
3
|
-
let t = "";
|
|
4
|
-
for (let e = 0; e < o; e++)
|
|
5
|
-
t += n[Math.floor(Math.random() * n.length)];
|
|
6
|
-
return t;
|
|
7
|
-
}, d = (o, n = 100, t = 0) => {
|
|
8
|
-
if (o === "--") return o;
|
|
9
|
-
let e = n * 1 ? o / n : 0;
|
|
10
|
-
return e *= 100, !t && e < 1 ? e = Math.round(e * Math.pow(10, 2)) / Math.pow(10, 2) : e = Math.round(e * Math.pow(10, t)) / Math.pow(10, t), e;
|
|
11
|
-
}, r = () => document.hidden, h = (o, n = "download") => {
|
|
12
|
-
const t = document.createElement("a");
|
|
13
|
-
t.download = n, t.href = o, t.click();
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
h as downloadImageFromString,
|
|
17
|
-
a as getRandomHash,
|
|
18
|
-
r as isPageHidden,
|
|
19
|
-
d as percentOfNumber
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=common.js.map
|
package/utils/common.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sources":["../../src/core/utils/common.ts"],"sourcesContent":["/**\r\n * Получить случайную строку\r\n */\r\nexport const getRandomHash = (length: number = 20): string => {\r\n\tconst l = 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz1234567890';\r\n\r\n\tlet result = '';\r\n\tfor (let i = 0; i < length; i++) {\r\n\t\tresult += l[Math.floor(Math.random() * l.length)];\r\n\t}\r\n\r\n\treturn result;\r\n};\r\n\r\n/**\r\n * Посчитать процент от числа (сколько процентов составляет part от full)\r\n * @param part - первое число\r\n * @param full - второе число\r\n * @param precision - точность (колличество знаков после запятой)\r\n */\r\nexport const percentOfNumber = (part: '--' | number, full: number = 100, precision: number = 0): '--' | number => {\r\n\tif (part === '--') return part;\r\n\r\n\tlet percent = (full * 1) ? part / full : 0;\r\n\tpercent *= 100;\r\n\r\n\t// если десятичные знаки не выводятся и число при округлении может дать ноль, то округляем в большую сторону\r\n\tif (!precision && percent < 1) {\r\n\t\tpercent = Math.round(percent * (Math.pow(10, 2))) / (Math.pow(10, 2));\r\n\t} else {\r\n\t\tpercent = Math.round(percent * (Math.pow(10, precision))) / (Math.pow(10, precision));\r\n\t}\r\n\r\n\treturn percent;\r\n};\r\n\r\n/**\r\n * Проверить скрыта страница или нет\r\n */\r\nexport const isPageHidden = (): boolean => document.hidden;\r\n\r\n/**\r\n * Скачать изображение, переданное в виде строки\r\n * @param imageStr - адресс картинки\r\n * @param imageName - имя файла при загрузке, по умолчанию download\r\n */\r\nexport const downloadImageFromString = (imageStr: string, imageName: string = 'download'): void => {\r\n\tconst a = document.createElement('a');\r\n\ta.download = imageName;\r\n\ta.href = imageStr;\r\n\ta.click();\r\n};"],"names":["getRandomHash","length","l","result","i","percentOfNumber","part","full","precision","percent","isPageHidden","downloadImageFromString","imageStr","imageName","a"],"mappings":"AAGa,MAAAA,IAAgB,CAACC,IAAiB,OAAe;AAC7D,QAAMC,IAAI;AAEV,MAAIC,IAAS;AACb,WAASC,IAAI,GAAGA,IAAIH,GAAQG;AACjB,IAAAD,KAAAD,EAAE,KAAK,MAAM,KAAK,WAAWA,EAAE,MAAM,CAAC;AAG1C,SAAAC;AACR,GAQaE,IAAkB,CAACC,GAAqBC,IAAe,KAAKC,IAAoB,MAAqB;AAC7G,MAAAF,MAAS,KAAa,QAAAA;AAE1B,MAAIG,IAAWF,IAAO,IAAKD,IAAOC,IAAO;AAC9B,SAAAE,KAAA,KAGP,CAACD,KAAaC,IAAU,IAC3BA,IAAU,KAAK,MAAMA,IAAW,KAAK,IAAI,IAAI,CAAC,CAAE,IAAK,KAAK,IAAI,IAAI,CAAC,IAEnEA,IAAU,KAAK,MAAMA,IAAW,KAAK,IAAI,IAAID,CAAS,CAAE,IAAK,KAAK,IAAI,IAAIA,CAAS,GAG7EC;AACR,GAKaC,IAAe,MAAe,SAAS,QAOvCC,IAA0B,CAACC,GAAkBC,IAAoB,eAAqB;AAC5F,QAAAC,IAAI,SAAS,cAAc,GAAG;AACpC,EAAAA,EAAE,WAAWD,GACbC,EAAE,OAAOF,GACTE,EAAE,MAAM;AACT;"}
|
|
File without changes
|