@elcrm/telegram 0.0.124 → 0.0.126
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/index.d.ts +6 -184
- package/dist/index.es.js +1525 -1362
- package/dist/index.umd.js +20 -20
- package/dist/{TabBar → src/lib/TabBar}/TabBar.d.ts +1 -0
- package/dist/src/lib/index.d.ts +184 -0
- package/package.json +27 -3
- /package/dist/{AppBar → src/lib/AppBar}/AppBar.d.ts +0 -0
- /package/dist/{Badge → src/lib/Badge}/Badge.d.ts +0 -0
- /package/dist/{BottomSheet → src/lib/BottomSheet}/index.d.ts +0 -0
- /package/dist/{Header → src/lib/Header}/Header.d.ts +0 -0
- /package/dist/{Loading → src/lib/Loading}/index.d.ts +0 -0
- /package/dist/{Madal → src/lib/Madal}/Modal.d.ts +0 -0
- /package/dist/{Menu → src/lib/Menu}/index.d.ts +0 -0
- /package/dist/{Notice → src/lib/Notice}/Notice.d.ts +0 -0
- /package/dist/{SafeArea → src/lib/SafeArea}/index.d.ts +0 -0
- /package/dist/{Scroll → src/lib/Scroll}/Scroll.d.ts +0 -0
- /package/dist/{SidePanel → src/lib/SidePanel}/SidePanel.d.ts +0 -0
- /package/dist/{Sidebar → src/lib/Sidebar}/Sidebar.d.ts +0 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { Modal as _Modal } from './Madal/Modal';
|
|
2
|
+
import { default as _Sidebar } from './Sidebar/Sidebar';
|
|
3
|
+
import { default as _SidePanel } from './SidePanel/SidePanel';
|
|
4
|
+
import { default as _Scroll } from './Scroll/Scroll';
|
|
5
|
+
import { default as _AppBar } from './AppBar/AppBar';
|
|
6
|
+
type MainButton = {
|
|
7
|
+
text?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
textColor?: string;
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
callback?: () => void;
|
|
12
|
+
page: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const clsx: (...classes: (string | undefined | boolean | null)[]) => string;
|
|
15
|
+
declare namespace Telegram {
|
|
16
|
+
const WebApp: any;
|
|
17
|
+
const getUser: () => any;
|
|
18
|
+
const Location: (callback: (locationData: any) => void) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Объект для отображения уведомлений с поддержкой тем оформления и хаптик-отклика.
|
|
21
|
+
*
|
|
22
|
+
* @property {Function} Send - Основной метод для отправки уведомления.
|
|
23
|
+
* @param {string|object} type - Тип уведомления ('error', 'success', 'warning') или объект: {type, text, thema}.
|
|
24
|
+
* @param {string} [text] - Текст уведомления (используется если type - строка).
|
|
25
|
+
* @param {boolean} [thema] - Признак применения темы оформления (используется если type - строка).
|
|
26
|
+
*
|
|
27
|
+
* @property {Function} Error - Показывает уведомление об ошибке.
|
|
28
|
+
* @param {string} [text] - Текст уведомления.
|
|
29
|
+
*
|
|
30
|
+
* @property {Function} Success - Показывает уведомление об успехе.
|
|
31
|
+
* @param {string} [text] - Текст уведомления.
|
|
32
|
+
*
|
|
33
|
+
* @property {Function} Warning - Показывает предупреждение.
|
|
34
|
+
* @param {string} [text] - Текст уведомления.
|
|
35
|
+
*
|
|
36
|
+
* Пример использования:
|
|
37
|
+
* Telegram.Notice.Send('error', 'Что-то пошло не так');
|
|
38
|
+
* Telegram.Notice.Send({type: 'success', text: 'Операция выполнена', thema: true});
|
|
39
|
+
* Telegram.Notice.Error('Произошла ошибка');
|
|
40
|
+
* Telegram.Notice.Success('Операция выполнена успешно');
|
|
41
|
+
* Telegram.Notice.Warning('Внимание!');
|
|
42
|
+
*/
|
|
43
|
+
const Notice: {
|
|
44
|
+
Send: (type: any, text?: any, thema?: any) => void;
|
|
45
|
+
Error: (text?: any) => void;
|
|
46
|
+
Success: (text?: any) => void;
|
|
47
|
+
Warning: (text?: any) => void;
|
|
48
|
+
};
|
|
49
|
+
const Header: () => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
/**
|
|
51
|
+
* @param {TAction[]} [actions] - Массив действий для отображения в футере
|
|
52
|
+
* @param {React.ReactNode} [children] - Дополнительные дочерние элементы
|
|
53
|
+
* @param {string} [className] - Пользовательский CSS-класс
|
|
54
|
+
* @param {string} [page] - Текущая страница для определения активного действия
|
|
55
|
+
* @param {"row"|"column"} [direction="row"] - Направление расположения элементов футера
|
|
56
|
+
* @param {(page: string) => void} [onPageChange] - Функция для обработки смены страницы
|
|
57
|
+
* @param {boolean} [toHide=false] - Скрывать при открытой клавиатуре
|
|
58
|
+
*/
|
|
59
|
+
const TabBar: ({ actions, children, className, toHide, page, onPageChange, direction, }: import("./TabBar/TabBar").TFooter) => import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
/**
|
|
61
|
+
* @param {object} props - параметры компонента
|
|
62
|
+
* @param {React.ReactNode} props.children - Контент внутри шита
|
|
63
|
+
* @param {string} [props.title] - Заголовок окна (опционально)
|
|
64
|
+
* @param {boolean} [props.isOverlay=true] - Показывать ли затемняющую подложку (по умолчанию true)
|
|
65
|
+
*/
|
|
66
|
+
const BottomSheet: ({ children, title, isOverlay, footer, className, onOpen, }: {
|
|
67
|
+
children: React.ReactNode;
|
|
68
|
+
title?: string;
|
|
69
|
+
isOverlay?: boolean;
|
|
70
|
+
className?: string;
|
|
71
|
+
footer?: boolean;
|
|
72
|
+
onOpen?: (isOpen: boolean) => void;
|
|
73
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
74
|
+
const toggleBottomSheet: () => void;
|
|
75
|
+
const SafeArea: ({ className, children, isScroll }: import("./SafeArea").TSafeArea) => import("react/jsx-runtime").JSX.Element;
|
|
76
|
+
const Loading: ({ children, className }: import("./Loading").TLoading) => import("react/jsx-runtime").JSX.Element;
|
|
77
|
+
const Sidebar: typeof _Sidebar;
|
|
78
|
+
const SidePanel: typeof _SidePanel;
|
|
79
|
+
const AppBar: typeof _AppBar;
|
|
80
|
+
const SidePanelController: (name: string, action: boolean) => void;
|
|
81
|
+
const Scroll: typeof _Scroll;
|
|
82
|
+
const Modal: typeof _Modal;
|
|
83
|
+
const Menu: ({ items }: import("./Menu").TMenu) => import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
const MainButton: {
|
|
85
|
+
callback: never[];
|
|
86
|
+
set: (j: MainButton | boolean) => void;
|
|
87
|
+
};
|
|
88
|
+
const BackButtonPrev: () => void;
|
|
89
|
+
const BackButtonState: () => (boolean | {
|
|
90
|
+
page?: string;
|
|
91
|
+
callback?: () => void;
|
|
92
|
+
})[];
|
|
93
|
+
/**
|
|
94
|
+
* @param {object} params - параметры компонента
|
|
95
|
+
* @param {string} [params.page] - Текущая страница для определения активного действия
|
|
96
|
+
* @param {() => void} [params.callback] - Функция для обработки смены страницы
|
|
97
|
+
*/
|
|
98
|
+
const BackButton: (params: boolean | {
|
|
99
|
+
page?: string;
|
|
100
|
+
callback?: () => void;
|
|
101
|
+
}) => void;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @param {TAction[]} [actions] - Массив действий для отображения в футере
|
|
105
|
+
* @param {React.ReactNode} [children] - Дополнительные дочерние элементы
|
|
106
|
+
* @param {string} [className] - Пользовательский CSS-класс
|
|
107
|
+
* @param {string} [page] - Текущая страница для определения активного действия
|
|
108
|
+
* @param {"row"|"column"} [direction="row"] - Направление расположения элементов футера
|
|
109
|
+
* @param {(page: string) => void} [onPageChange] - Функция для обработки смены страницы
|
|
110
|
+
* @param {boolean} [toHide=false] - Скрывать при открытой клавиатуре
|
|
111
|
+
*/
|
|
112
|
+
export declare const TabBar: ({ actions, children, className, toHide, page, onPageChange, direction, }: import('./TabBar/TabBar').TFooter) => import("react/jsx-runtime").JSX.Element;
|
|
113
|
+
/**
|
|
114
|
+
* @param {object} props - параметры компонента
|
|
115
|
+
* @param {React.ReactNode} props.children - Контент внутри шита
|
|
116
|
+
* @param {string} [props.title] - Заголовок окна (опционально)
|
|
117
|
+
* @param {boolean} [props.isOverlay=true] - Показывать ли затемняющую подложку (по умолчанию true)
|
|
118
|
+
*/
|
|
119
|
+
export declare const BottomSheet: ({ children, title, isOverlay, footer, className, onOpen, }: {
|
|
120
|
+
children: React.ReactNode;
|
|
121
|
+
title?: string;
|
|
122
|
+
isOverlay?: boolean;
|
|
123
|
+
className?: string;
|
|
124
|
+
footer?: boolean;
|
|
125
|
+
onOpen?: (isOpen: boolean) => void;
|
|
126
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
127
|
+
/**
|
|
128
|
+
* @param {object} params - параметры компонента
|
|
129
|
+
* @param {string} [params.page] - Текущая страница для определения активного действия
|
|
130
|
+
* @param {() => void} [params.callback] - Функция для обработки смены страницы
|
|
131
|
+
*/
|
|
132
|
+
export declare const BackButton: (params: boolean | {
|
|
133
|
+
page?: string;
|
|
134
|
+
callback?: () => void;
|
|
135
|
+
}) => void;
|
|
136
|
+
export declare const BackButtonPrev: () => void;
|
|
137
|
+
export declare const BackButtonState: () => (boolean | {
|
|
138
|
+
page?: string;
|
|
139
|
+
callback?: () => void;
|
|
140
|
+
})[];
|
|
141
|
+
/**
|
|
142
|
+
* Объект для отображения уведомлений с поддержкой тем оформления и хаптик-отклика.
|
|
143
|
+
*
|
|
144
|
+
* @property {Function} Send - Основной метод для отправки уведомления.
|
|
145
|
+
* @param {string|object} type - Тип уведомления ('error', 'success', 'warning') или объект: {type, text, thema}.
|
|
146
|
+
* @param {string} [text] - Текст уведомления (используется если type - строка).
|
|
147
|
+
* @param {boolean} [thema] - Признак применения темы оформления (используется если type - строка).
|
|
148
|
+
*
|
|
149
|
+
* @property {Function} Error - Показывает уведомление об ошибке.
|
|
150
|
+
* @param {string} [text] - Текст уведомления.
|
|
151
|
+
*
|
|
152
|
+
* @property {Function} Success - Показывает уведомление об успехе.
|
|
153
|
+
* @param {string} [text] - Текст уведомления.
|
|
154
|
+
*
|
|
155
|
+
* @property {Function} Warning - Показывает предупреждение.
|
|
156
|
+
* @param {string} [text] - Текст уведомления.
|
|
157
|
+
*
|
|
158
|
+
* Пример использования:
|
|
159
|
+
* Notice.Send('error', 'Что-то пошло не так');
|
|
160
|
+
* Notice.Send({type: 'success', text: 'Операция выполнена', thema: true});
|
|
161
|
+
* Notice.Error('Произошла ошибка');
|
|
162
|
+
* Notice.Success('Операция выполнена успешно');
|
|
163
|
+
* Notice.Warning('Внимание!');
|
|
164
|
+
*/
|
|
165
|
+
export declare const Notice: {
|
|
166
|
+
Send: (type: any, text?: any, thema?: any) => void;
|
|
167
|
+
Error: (text?: any) => void;
|
|
168
|
+
Success: (text?: any) => void;
|
|
169
|
+
Warning: (text?: any) => void;
|
|
170
|
+
};
|
|
171
|
+
export declare const SafeArea: ({ className, children, isScroll }: import('./SafeArea').TSafeArea) => import("react/jsx-runtime").JSX.Element;
|
|
172
|
+
export declare const Loading: ({ children, className }: import('./Loading').TLoading) => import("react/jsx-runtime").JSX.Element;
|
|
173
|
+
export declare const Menu: ({ items }: import('./Menu').TMenu) => import("react/jsx-runtime").JSX.Element;
|
|
174
|
+
export declare const SidePanel: typeof _SidePanel;
|
|
175
|
+
export declare const Scroll: typeof _Scroll;
|
|
176
|
+
export declare const AppBar: typeof _AppBar;
|
|
177
|
+
export declare const Sidebar: typeof _Sidebar;
|
|
178
|
+
export declare const Location: (callback: (locationData: any) => void) => void;
|
|
179
|
+
export declare const SidePanelController: (name: string, action: boolean) => void;
|
|
180
|
+
export declare const Header: () => import("react/jsx-runtime").JSX.Element, toggleBottomSheet: () => void, Modal: typeof _Modal, MainButton: {
|
|
181
|
+
callback: never[];
|
|
182
|
+
set: (j: MainButton | boolean) => void;
|
|
183
|
+
}, WebApp: any, getUser: () => any;
|
|
184
|
+
export default Telegram;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elcrm/telegram",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.126",
|
|
4
4
|
"description": "plugin for elCRM to work with telegram",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "MaSkal <dev@elcrm.online>",
|
|
@@ -29,10 +29,34 @@
|
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"@types/react": ">=18.0.0",
|
|
32
|
-
"react": "
|
|
32
|
+
"react": "^18.2.0",
|
|
33
|
+
"react-dom": "^18.2.0"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@elcrm/router": "
|
|
36
|
+
"@elcrm/router": "^0.0.47",
|
|
36
37
|
"sass": "^1.93.3"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
41
|
+
"@testing-library/react": "^16.3.1",
|
|
42
|
+
"@testing-library/user-event": "^14.6.1",
|
|
43
|
+
"@types/node": "^22.13.10",
|
|
44
|
+
"@types/react": "^18.2.66",
|
|
45
|
+
"@types/react-dom": "^18.2.22",
|
|
46
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
47
|
+
"jsdom": "^27.4.0",
|
|
48
|
+
"react": "^18.2.0",
|
|
49
|
+
"react-dom": "^18.2.0",
|
|
50
|
+
"vitest": "^4.0.16",
|
|
51
|
+
"vite": "^5.4.2",
|
|
52
|
+
"vite-plugin-dts": "^4.0.3",
|
|
53
|
+
"vite-plugin-dynamic-import": "^1.6.0",
|
|
54
|
+
"vite-plugin-lib-inject-css": "^2.1.1"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"dev": "vite",
|
|
58
|
+
"test": "bun run test/dev.ts",
|
|
59
|
+
"test:dev": "bun run test/main.tsx",
|
|
60
|
+
"build": "vite build"
|
|
37
61
|
}
|
|
38
62
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|