@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.
Files changed (211) hide show
  1. package/.chunks/{datepicker-D1JLNEmV.es.js → datepicker-BGhDjLcn.es.js} +2 -2
  2. package/.chunks/{datepicker-D1JLNEmV.es.js.map → datepicker-BGhDjLcn.es.js.map} +1 -1
  3. package/.chunks/{datepicker-5QMJRJn-.amd.js → datepicker-DM6aPyRB.amd.js} +2 -2
  4. package/.chunks/{datepicker-5QMJRJn-.amd.js.map → datepicker-DM6aPyRB.amd.js.map} +1 -1
  5. package/.chunks/{forms-S36M7cBH.es.js → forms-CRAV8PiZ.es.js} +328 -312
  6. package/.chunks/forms-CRAV8PiZ.es.js.map +1 -0
  7. package/.chunks/forms-Cksc7Rb7.amd.js +3 -0
  8. package/.chunks/forms-Cksc7Rb7.amd.js.map +1 -0
  9. 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
  10. 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
  11. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CpNwVBHY.amd.js +2 -0
  12. 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
  13. package/.chunks/{menu-v5knQbeF.es.js → menu-BWjYRHkQ.es.js} +8 -8
  14. package/.chunks/menu-BWjYRHkQ.es.js.map +1 -0
  15. package/.chunks/{menu-S1Hk7D3W.amd.js → menu-BX8GV8-v.amd.js} +2 -2
  16. package/.chunks/menu-BX8GV8-v.amd.js.map +1 -0
  17. package/.chunks/{popup-DncRq57t.amd.js → popup-3fVBIqu0.amd.js} +3 -3
  18. package/.chunks/{popup-DncRq57t.amd.js.map → popup-3fVBIqu0.amd.js.map} +1 -1
  19. package/.chunks/{popup-BK3xlBZm.es.js → popup-BWTP6yaC.es.js} +3 -3
  20. package/.chunks/{popup-BK3xlBZm.es.js.map → popup-BWTP6yaC.es.js.map} +1 -1
  21. package/.chunks/punycode.es6-C2yitnNb.amd.js +2 -0
  22. package/.chunks/punycode.es6-C2yitnNb.amd.js.map +1 -0
  23. package/.chunks/punycode.es6-CNI-zL6U.es.js +134 -0
  24. package/.chunks/punycode.es6-CNI-zL6U.es.js.map +1 -0
  25. package/assets/core.css +1 -1
  26. package/assets/dark.css +1 -1
  27. package/assets/forms.css +1 -1
  28. package/assets/formsExt.css +1 -1
  29. package/assets/light.css +1 -1
  30. package/core/core.amd.js +1 -1
  31. package/core/core.js +1 -1
  32. package/core/directives/focus.amd.js +2 -0
  33. package/core/directives/focus.amd.js.map +1 -0
  34. package/core/directives/focus.d.ts +3 -0
  35. package/core/directives/focus.js +5 -0
  36. package/core/directives/focus.js.map +1 -0
  37. package/core/directives/sticky.amd.js +2 -0
  38. package/core/directives/sticky.amd.js.map +1 -0
  39. package/core/directives/sticky.d.ts +3 -0
  40. package/core/directives/sticky.js +5 -0
  41. package/core/directives/sticky.js.map +1 -0
  42. package/core/directives/swimUp.amd.js +2 -0
  43. package/core/directives/swimUp.amd.js.map +1 -0
  44. package/core/directives/swimUp.d.ts +3 -0
  45. package/core/directives/swimUp.js +5 -0
  46. package/core/directives/swimUp.js.map +1 -0
  47. package/core/directives/tooltip.amd.js +2 -0
  48. package/core/directives/tooltip.amd.js.map +1 -0
  49. package/core/directives/tooltip.d.ts +3 -0
  50. package/core/directives/tooltip.js +5 -0
  51. package/core/directives/tooltip.js.map +1 -0
  52. package/core/plugin/plugin.amd.js +2 -0
  53. package/core/plugin/plugin.amd.js.map +1 -0
  54. package/core/plugin/plugin.d.ts +3 -0
  55. package/core/plugin/plugin.js +23 -0
  56. package/core/plugin/plugin.js.map +1 -0
  57. package/forms/forms.amd.js +1 -1
  58. package/forms/forms.js +14 -14
  59. package/formsExt/formsExt.amd.js +1 -1
  60. package/formsExt/formsExt.amd.js.map +1 -1
  61. package/formsExt/formsExt.js +122 -363
  62. package/formsExt/formsExt.js.map +1 -1
  63. package/package.json +32 -24
  64. package/popup/popup.amd.js +1 -1
  65. package/popup/popup.amd.js.map +1 -1
  66. package/popup/popup.js +47 -6
  67. package/popup/popup.js.map +1 -1
  68. package/popup/worker.amd.js +1 -1
  69. package/popup/worker.js +3 -3
  70. package/project/project.amd.js +1 -1
  71. package/project/project.amd.js.map +1 -1
  72. package/project/project.js +15 -15
  73. package/project/project.js.map +1 -1
  74. package/src/components/forms/avatar/avatar.stories.d.ts +15 -14
  75. package/src/components/forms/avatar/avatar.vue.d.ts +7 -6
  76. package/src/components/forms/button/button.stories.d.ts +59 -57
  77. package/src/components/forms/button/button.vue.d.ts +10 -8
  78. package/src/components/forms/checkbox/checkbox.stories.d.ts +34 -33
  79. package/src/components/forms/checkbox/checkbox.vue.d.ts +17 -16
  80. package/src/components/forms/controlLabel/controlLabel.stories.d.ts +14 -13
  81. package/src/components/forms/controlLabel/controlLabel.vue.d.ts +4 -3
  82. package/src/components/forms/forms.d.ts +33 -13
  83. package/src/components/forms/hint/hint.stories.d.ts +23 -22
  84. package/src/components/forms/hint/hint.vue.d.ts +4 -3
  85. package/src/components/forms/input/input.stories.d.ts +64 -62
  86. package/src/components/forms/input/input.vue.d.ts +10 -8
  87. package/src/components/forms/inputDate/inputDate.d.ts +1 -1
  88. package/src/components/forms/inputDate/inputDate.stories.d.ts +31 -29
  89. package/src/components/forms/inputDate/inputDate.vue.d.ts +6 -5
  90. package/src/components/forms/inputRange/inputRange.stories.d.ts +84 -81
  91. package/src/components/forms/inputRange/inputRange.vue.d.ts +2 -1
  92. package/src/components/forms/loadbar/loadbar.stories.d.ts +2 -1
  93. package/src/components/forms/loadbar/loadbar.vue.d.ts +2 -1
  94. package/src/components/forms/radio/radio.stories.d.ts +32 -31
  95. package/src/components/forms/radio/radio.vue.d.ts +5 -4
  96. package/src/components/forms/select/select.stories.d.ts +24 -22
  97. package/src/components/forms/select/select.vue.d.ts +25 -23
  98. package/src/components/forms/switcher/switcher.stories.d.ts +32 -31
  99. package/src/components/forms/switcher/switcher.vue.d.ts +5 -4
  100. package/src/components/forms/textarea/textarea.stories.d.ts +24 -23
  101. package/src/components/forms/textarea/textarea.vue.d.ts +6 -5
  102. package/src/components/formsExt/editArea/editArea.stories.d.ts +40 -39
  103. package/src/components/formsExt/editArea/editArea.vue.d.ts +6 -5
  104. package/src/components/formsExt/editInput/editInput.stories.d.ts +22 -19
  105. package/src/components/formsExt/editInput/editInput.vue.d.ts +5 -4
  106. package/src/components/formsExt/formsExt.d.ts +10 -5
  107. package/src/components/formsExt/menu/menu.stories.d.ts +15 -14
  108. package/src/components/formsExt/menu/menu.vue.d.ts +17 -16
  109. package/src/components/formsExt/radioGroup/radioGroup.stories.d.ts +16 -14
  110. package/src/components/formsExt/radioGroup/radioGroup.vue.d.ts +17 -14
  111. package/src/components/formsExt/selector2/api.d.ts +2 -2
  112. package/src/components/formsExt/selector2/selector2.stories.d.ts +67 -65
  113. package/src/components/popup/popup/listItem.vue.d.ts +5 -4
  114. package/src/components/popup/popup/opener.vue.d.ts +8 -7
  115. package/src/components/popup/popup/popup.stories.d.ts +198 -193
  116. package/src/components/popup/popup/popup.vue.d.ts +9 -8
  117. package/src/components/popup/popup/widgetInput.vue.d.ts +31 -28
  118. package/src/components/popup/popup.d.ts +10 -4
  119. package/src/components/popup/worker.d.ts +4 -1
  120. package/src/components/project/project.d.ts +4 -1
  121. package/src/components/project/selectorCompetitors/composables.d.ts +2 -1
  122. package/src/components/project/selectorCompetitors/selectorCompetitors.stories.d.ts +9 -8
  123. package/src/components/project/selectorCompetitors/selectorCompetitors.vue.d.ts +10 -9
  124. package/src/components/project/selectorCompetitors/stories/items.d.ts +2 -1
  125. package/src/components/tabs/tabs/content.vue.d.ts +4 -3
  126. package/src/components/tabs/tabs/tab.vue.d.ts +4 -3
  127. package/src/components/tabs/tabs/tabs.stories.d.ts +165 -162
  128. package/src/components/tabs/tabs/tabs.vue.d.ts +4 -3
  129. package/src/components/tabs/tabs.d.ts +8 -3
  130. package/src/components/tabsView/tabsView/menu.vue.d.ts +7 -6
  131. package/src/components/tabsView/tabsView/menuDelimeter.vue.d.ts +2 -1
  132. package/src/components/tabsView/tabsView/menuItem.vue.d.ts +6 -5
  133. package/src/components/tabsView/tabsView/menuTitle.vue.d.ts +4 -3
  134. package/src/components/tabsView/tabsView/store.d.ts +126 -69
  135. package/src/components/tabsView/tabsView/tabsView.d.ts +1 -1
  136. package/src/components/tabsView/tabsView/tabsView.stories.d.ts +95 -94
  137. package/src/components/tabsView/tabsView/tabsView.vue.d.ts +13 -12
  138. 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
  139. 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
  140. package/src/components/tabsView/tabsView.d.ts +8 -3
  141. package/src/core/core/core.d.ts +1 -0
  142. package/src/core/core/page.d.ts +4 -0
  143. package/src/core/core/state.d.ts +4 -0
  144. package/src/core/directives/focus.d.ts +9 -0
  145. package/src/core/directives/sticky.d.ts +11 -0
  146. package/src/core/directives/swimUp.d.ts +10 -0
  147. package/src/core/directives/tooltip.d.ts +11 -0
  148. package/src/core/plugin/plugin.d.ts +48 -0
  149. package/src/core/utils/device.d.ts +6 -0
  150. package/src/core/utils/image.d.ts +12 -0
  151. package/src/core/utils/number.d.ts +7 -0
  152. package/src/core/utils/store/plugin.d.ts +2 -1
  153. package/src/core/utils/string.d.ts +4 -0
  154. package/tabs/tabs.amd.js +1 -1
  155. package/tabs/tabs.amd.js.map +1 -1
  156. package/tabs/tabs.js +23 -23
  157. package/tabs/tabs.js.map +1 -1
  158. package/tabsView/tabsView.amd.js +1 -1
  159. package/tabsView/tabsView.amd.js.map +1 -1
  160. package/tabsView/tabsView.js +72 -73
  161. package/tabsView/tabsView.js.map +1 -1
  162. package/utils/date.amd.js +1 -1
  163. package/utils/date.js +7 -7
  164. package/utils/device.amd.js +1 -1
  165. package/utils/device.js +9 -8
  166. package/utils/image.amd.js +2 -0
  167. package/utils/image.amd.js.map +1 -0
  168. package/utils/image.d.ts +1 -0
  169. package/utils/image.js +13 -0
  170. package/utils/image.js.map +1 -0
  171. package/utils/number.amd.js +2 -0
  172. package/utils/number.amd.js.map +1 -0
  173. package/utils/number.d.ts +1 -0
  174. package/utils/number.js +9 -0
  175. package/utils/number.js.map +1 -0
  176. package/utils/scroll.amd.js +1 -1
  177. package/utils/scroll.js +1 -1
  178. package/utils/string.amd.js +1 -1
  179. package/utils/string.amd.js.map +1 -1
  180. package/utils/string.js +20 -13
  181. package/utils/string.js.map +1 -1
  182. package/utils/system.amd.js +1 -1
  183. package/utils/system.amd.js.map +1 -1
  184. package/utils/system.js +8 -8
  185. package/utils/system.js.map +1 -1
  186. package/utils/url.amd.js +2 -2
  187. package/utils/url.amd.js.map +1 -1
  188. package/utils/url.js +40 -168
  189. package/utils/url.js.map +1 -1
  190. package/utils/window.amd.js +1 -1
  191. package/utils/window.js +1 -1
  192. package/web-types.json +62 -0
  193. package/.chunks/forms-B2NcBl7S.amd.js +0 -3
  194. package/.chunks/forms-B2NcBl7S.amd.js.map +0 -1
  195. package/.chunks/forms-S36M7cBH.es.js.map +0 -1
  196. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-C7tg-67i.amd.js +0 -2
  197. package/.chunks/menu-S1Hk7D3W.amd.js.map +0 -1
  198. package/.chunks/menu-v5knQbeF.es.js.map +0 -1
  199. package/.chunks/widgetInput-Br5COpvG.es.js +0 -46
  200. package/.chunks/widgetInput-Br5COpvG.es.js.map +0 -1
  201. package/.chunks/widgetInput-CrrUoVPc.amd.js +0 -2
  202. package/.chunks/widgetInput-CrrUoVPc.amd.js.map +0 -1
  203. package/src/components/formsExt/selector2/itemMulti.vue.d.ts +0 -17
  204. package/src/components/formsExt/selector2/selector2.vue.d.ts +0 -130
  205. package/src/core/utils/common.d.ts +0 -21
  206. package/utils/common.amd.js +0 -2
  207. package/utils/common.amd.js.map +0 -1
  208. package/utils/common.d.ts +0 -1
  209. package/utils/common.js +0 -21
  210. package/utils/common.js.map +0 -1
  211. /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;
@@ -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
@@ -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
@@ -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