prlg-ui 1.8.119 → 1.8.121

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 (71) hide show
  1. package/package.json +1 -1
  2. package/dist/FileIcon-BE4ItwkK.cjs +0 -1
  3. package/dist/FileIcon-maHE2Nhr.js +0 -101
  4. package/dist/Image-BHDBSn7B.cjs +0 -1
  5. package/dist/Image-CAGIshx9.js +0 -259
  6. package/dist/QuestionIcon-DptFSXX2.cjs +0 -1
  7. package/dist/QuestionIcon-tK1kUB_h.js +0 -340
  8. package/dist/SendIcon-CH6S0QWh.cjs +0 -1
  9. package/dist/SendIcon-Cqdt2QWN.js +0 -88
  10. package/dist/blocks/index.cjs.js +0 -1
  11. package/dist/blocks/index.es.js +0 -186
  12. package/dist/blocks.d.ts +0 -35
  13. package/dist/eventBus.util-K9Yq6hZm.cjs +0 -1
  14. package/dist/eventBus.util-msbJpg6N.js +0 -75
  15. package/dist/fonts/Roboto/Roboto-Black.woff +0 -0
  16. package/dist/fonts/Roboto/Roboto-Black.woff2 +0 -0
  17. package/dist/fonts/Roboto/Roboto-Bold.woff +0 -0
  18. package/dist/fonts/Roboto/Roboto-Bold.woff2 +0 -0
  19. package/dist/fonts/Roboto/Roboto-ExtraBold.woff +0 -0
  20. package/dist/fonts/Roboto/Roboto-ExtraBold.woff2 +0 -0
  21. package/dist/fonts/Roboto/Roboto-ExtraLight.woff +0 -0
  22. package/dist/fonts/Roboto/Roboto-ExtraLight.woff2 +0 -0
  23. package/dist/fonts/Roboto/Roboto-Light.woff +0 -0
  24. package/dist/fonts/Roboto/Roboto-Light.woff2 +0 -0
  25. package/dist/fonts/Roboto/Roboto-Medium.woff +0 -0
  26. package/dist/fonts/Roboto/Roboto-Medium.woff2 +0 -0
  27. package/dist/fonts/Roboto/Roboto-Regular.woff +0 -0
  28. package/dist/fonts/Roboto/Roboto-Regular.woff2 +0 -0
  29. package/dist/fonts/Roboto/Roboto-SemiBold.woff +0 -0
  30. package/dist/fonts/Roboto/Roboto-SemiBold.woff2 +0 -0
  31. package/dist/fonts/Roboto/Roboto-Thin.woff +0 -0
  32. package/dist/fonts/Roboto/Roboto-Thin.woff2 +0 -0
  33. package/dist/icons/index.cjs.js +0 -1
  34. package/dist/icons/index.es.js +0 -1487
  35. package/dist/icons.d.ts +0 -220
  36. package/dist/index.d.ts +0 -2095
  37. package/dist/parseFileSize.util-Bg1rLRLQ.cjs +0 -1
  38. package/dist/parseFileSize.util-CxVk4CvB.js +0 -785
  39. package/dist/prlg-ui.cjs.js +0 -1
  40. package/dist/prlg-ui.css +0 -1
  41. package/dist/prlg-ui.es.js +0 -6220
  42. package/dist/scss/animations.scss +0 -30
  43. package/dist/scss/colors.scss +0 -135
  44. package/dist/scss/fonts.scss +0 -3
  45. package/dist/scss/main.scss +0 -36
  46. package/dist/scss/mixins.scss +0 -177
  47. package/dist/scss/reset.scss +0 -51
  48. package/dist/scss/root-vars.scss +0 -12
  49. package/dist/types/index.cjs.js +0 -1
  50. package/dist/types/index.es.js +0 -1
  51. package/dist/types.d.ts +0 -14
  52. package/dist/uploadFile.util-DCFkx3w3.cjs +0 -1
  53. package/dist/uploadFile.util-DhavPrlY.js +0 -37
  54. package/dist/utils/date.util.ts +0 -30
  55. package/dist/utils/dayjs.util.ts +0 -32
  56. package/dist/utils/eventBus.util.ts +0 -43
  57. package/dist/utils/index.cjs.js +0 -1
  58. package/dist/utils/index.es.js +0 -1891
  59. package/dist/utils/index.ts +0 -3
  60. package/dist/utils/isClient.util.ts +0 -3
  61. package/dist/utils/mask.util.test.ts +0 -170
  62. package/dist/utils/mask.util.ts +0 -217
  63. package/dist/utils/onClickOutside.util.ts +0 -78
  64. package/dist/utils/parseDate.util.ts +0 -41
  65. package/dist/utils/parseFileSize.util.ts +0 -38
  66. package/dist/utils/price.util.ts +0 -28
  67. package/dist/utils/typeFile.util.ts +0 -32
  68. package/dist/utils/uploadFile.util.ts +0 -94
  69. package/dist/utils/useBodyScroll.util.ts +0 -41
  70. package/dist/utils.d.ts +0 -141
  71. package/dist/vite.svg +0 -1
@@ -1,94 +0,0 @@
1
- import { parseFileSize } from '@/utils/parseFileSize.util'
2
-
3
- type FileType = 'image' | 'pdf' | 'excel' | 'word' | 'all';
4
-
5
- interface OpenFileDialogOptions {
6
- accept?: FileType | FileType[];
7
- maxFileSize?: string; // например, "5mb"
8
- maxFiles?: number;
9
- multiple?: boolean;
10
- }
11
-
12
- /**
13
- * Преобразует типы файлов в accept-строку для input[type="file"]
14
- */
15
- function getAcceptString(accept?: FileType | FileType[]): string | undefined {
16
- if (!accept) return undefined;
17
- const types = Array.isArray(accept) ? accept : [accept];
18
- const map: Record<FileType, string[]> = {
19
- image: ['image/*'],
20
- pdf: ['application/pdf'],
21
- excel: [
22
- 'application/vnd.ms-excel',
23
- 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
24
- ],
25
- word: [
26
- 'application/msword',
27
- 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
28
- ],
29
- all: ['*/*']
30
- };
31
- return types.flatMap(type => map[type] || []).join(',');
32
- }
33
-
34
- /**
35
- * Открывает окно выбора файла для загрузки с ограничениями.
36
- * @param options - настройки выбора файлов
37
- * @returns {Promise<File[]>} - промис с выбранными файлами
38
- *
39
- * Пример использования:
40
- *
41
- * openFileDialog({
42
- * accept: ['image', 'pdf'],
43
- * maxFileSize: '5mb',
44
- * maxFiles: 3
45
- * }).then((files) => {
46
- * // files — массив выбранных файлов, соответствующих ограничениям
47
- * console.log(files);
48
- * });
49
- */
50
- export function openFileDialog(options: OpenFileDialogOptions = {}): Promise<File[]> {
51
- return new Promise((resolve) => {
52
- const input = document.createElement('input');
53
- input.type = 'file';
54
- input.style.display = 'none';
55
-
56
- if (options.multiple && options.maxFiles && options.maxFiles > 1) {
57
- input.multiple = true;
58
- }
59
-
60
- const acceptString = getAcceptString(options.accept);
61
- if (acceptString) {
62
- input.accept = acceptString;
63
- }
64
-
65
- input.addEventListener('change', (event: Event) => {
66
- const target = event.target as HTMLInputElement;
67
- let files: File[] = [];
68
-
69
- if (target.files && target.files.length > 0) {
70
- files = Array.from(target.files);
71
-
72
- // Ограничение по количеству файлов
73
- if (options.maxFiles && files.length > options.maxFiles) {
74
- files = files.slice(0, options.maxFiles);
75
- }
76
-
77
- // Ограничение по размеру файла
78
- if (options.maxFileSize) {
79
- const maxSize = parseFileSize(options.maxFileSize);
80
- files = files.filter(file => file.size <= maxSize);
81
- }
82
- }
83
-
84
- resolve(files);
85
- document.body.removeChild(input);
86
- });
87
-
88
- document.body.appendChild(input);
89
- input.click();
90
- });
91
- }
92
-
93
-
94
-
@@ -1,41 +0,0 @@
1
- let restoreScroll: (() => void) | null = null;
2
- let lockCount = 0;
3
-
4
- function preventScrollMobileSafari() {
5
- const scrollY = window.scrollY;
6
- document.body.style.position = "fixed";
7
- document.body.style.top = `-${scrollY}px`;
8
-
9
- return () => {
10
- document.body.style.position = "";
11
- document.body.style.top = "";
12
- window.scrollTo(0, scrollY);
13
- };
14
- }
15
-
16
- // Utility function to block scroll
17
- const preventScroll = () => {
18
- lockCount++;
19
- if (lockCount === 1 && !restoreScroll) {
20
- restoreScroll = preventScrollMobileSafari();
21
- }
22
- };
23
-
24
- // Utility function to restore scroll
25
- const allowScroll = () => {
26
- if (lockCount > 0) {
27
- lockCount--;
28
- }
29
-
30
- if (lockCount === 0 && restoreScroll) {
31
- restoreScroll();
32
- restoreScroll = null;
33
- }
34
- };
35
-
36
- export const useBodyScroll = () => {
37
- return {
38
- unlockScroll: allowScroll,
39
- lockScroll: preventScroll,
40
- };
41
- };
package/dist/utils.d.ts DELETED
@@ -1,141 +0,0 @@
1
- import { ComponentOptionsMixin } from 'vue';
2
- import { ComponentProvideOptions } from 'vue';
3
- import { ComponentPublicInstance } from 'vue';
4
- import { default as dayjs } from 'dayjs';
5
- import { DefineComponent } from 'vue';
6
- import { MaybeRef } from 'vue';
7
- import { MaybeRefOrGetter } from 'vue';
8
- import { PublicProps } from 'vue';
9
-
10
- declare const __VLS_component: DefineComponent<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<Props> & Readonly<{}>, {
11
- target: string;
12
- show: boolean;
13
- overlayType: OverlayType;
14
- teleport: boolean;
15
- }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
16
-
17
- declare function __VLS_template(): {
18
- attrs: Partial<{}>;
19
- slots: {
20
- default?(_: {}): any;
21
- };
22
- refs: {};
23
- rootEl: any;
24
- };
25
-
26
- declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
27
-
28
- declare type __VLS_WithTemplateSlots<T, S> = T & {
29
- new (): {
30
- $slots: S;
31
- };
32
- };
33
-
34
- export { dayjs }
35
-
36
- export declare function EventBus<Events extends Record<string, any>>(): TypedEventBus<Events>;
37
-
38
- declare type FileType = 'image' | 'pdf' | 'excel' | 'word' | 'all';
39
-
40
- /**
41
- * Форматирует дату в человекочитаемый вид: 20 июня 2025
42
- */
43
- export declare function formatDateReadable(date: string | Date): string;
44
-
45
- /**
46
- * Форматирует дату для отображения времени: 20 июня, 14:30
47
- */
48
- export declare function formatDateWithTime(date: string | Date): string;
49
-
50
- /**
51
- * Преобразует число в форматированную строку с валютой (по умолчанию: ₽)
52
- */
53
- export declare function formatPrice(value: number, currency?: string): string;
54
-
55
- /**
56
- * Возвращает разницу между датами в днях
57
- */
58
- export declare function getDaysBetween(start: string | Date, end: string | Date): number;
59
-
60
- export declare type Handler<T> = (event: T) => void;
61
-
62
- /**
63
- * Проверяет, истекла ли дата
64
- */
65
- export declare function isExpired(date: string | Date): boolean;
66
-
67
- export declare type MaybeElement = HTMLElement | SVGElement | VueInstance | undefined | null;
68
-
69
- export declare type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
70
-
71
- export declare type MaybeElementTarget = MaybeElementRef<MaybeElement> | string;
72
-
73
- export declare function onClickOutside(target: MaybeElementTarget, handler: (event: MouseEvent | TouchEvent) => void, options?: OnClickOutsideOptions): () => void;
74
-
75
- export declare interface OnClickOutsideOptions {
76
- ignore?: MaybeRefOrGetter<(MaybeElementRef<MaybeElement> | string)[]>;
77
- }
78
-
79
- /**
80
- * Открывает окно выбора файла для загрузки с ограничениями.
81
- * @param options - настройки выбора файлов
82
- * @returns {Promise<File[]>} - промис с выбранными файлами
83
- *
84
- * Пример использования:
85
- *
86
- * openFileDialog({
87
- * accept: ['image', 'pdf'],
88
- * maxFileSize: '5mb',
89
- * maxFiles: 3
90
- * }).then((files) => {
91
- * // files — массив выбранных файлов, соответствующих ограничениям
92
- * console.log(files);
93
- * });
94
- */
95
- export declare function openFileDialog(options?: OpenFileDialogOptions): Promise<File[]>;
96
-
97
- declare interface OpenFileDialogOptions {
98
- accept?: FileType | FileType[];
99
- maxFileSize?: string;
100
- maxFiles?: number;
101
- multiple?: boolean;
102
- }
103
-
104
- declare type OverlayType = 'modal' | 'drawer' | 'popover' | 'tooltip' | 'confirm';
105
-
106
- /**
107
- * Делает безопасное преобразование строки в число (цены из инпута)
108
- */
109
- export declare function parsePrice(input: string): number;
110
-
111
- export declare const Portal: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
112
-
113
- declare interface Props {
114
- overlayType?: OverlayType;
115
- teleport?: boolean;
116
- target?: string;
117
- zIndex?: number;
118
- show?: boolean;
119
- parentId?: string;
120
- }
121
-
122
- /**
123
- * Возвращает сумму всех значений (например, для корзины)
124
- */
125
- export declare function sumPrices(items: number[]): number;
126
-
127
- export declare interface TypedEventBus<Events extends Record<string, any>> {
128
- on<K extends keyof Events>(type: K, handler: Handler<Events[K]>): void;
129
- off<K extends keyof Events>(type: K, handler: Handler<Events[K]>): void;
130
- emit<K extends keyof Events>(type: K, evt?: Events[K]): void;
131
- clear(): void;
132
- }
133
-
134
- export declare const useBodyScroll: () => {
135
- unlockScroll: () => void;
136
- lockScroll: () => void;
137
- };
138
-
139
- export declare type VueInstance = ComponentPublicInstance;
140
-
141
- export { }
package/dist/vite.svg DELETED
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>