underpost 2.7.1 → 2.7.3
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/.dockerignore +13 -13
- package/.env.development +7 -7
- package/.env.production +7 -7
- package/.env.test +7 -7
- package/.github/workflows/publish.yml +26 -0
- package/.github/workflows/test.yml +80 -0
- package/.nycrc +9 -9
- package/.prettierignore +12 -12
- package/.prettierrc +9 -9
- package/.vscode/extensions.json +72 -72
- package/.vscode/settings.json +100 -99
- package/Dockerfile +89 -89
- package/LICENSE +21 -21
- package/README.md +96 -96
- package/bin/db.js +172 -119
- package/bin/deploy.js +607 -661
- package/bin/file.js +93 -92
- package/bin/index.js +76 -53
- package/bin/ssl.js +55 -64
- package/bin/util.js +182 -182
- package/bin/vs.js +35 -35
- package/conf.js +251 -249
- package/docker-compose.yml +67 -67
- package/jsconfig.json +7 -7
- package/jsdoc.json +32 -32
- package/nodemon.json +6 -6
- package/package.json +137 -132
- package/prometheus.yml +36 -36
- package/setup.sh +24 -24
- package/src/api/core/core.controller.js +69 -69
- package/src/api/core/core.model.js +11 -11
- package/src/api/core/core.router.js +23 -23
- package/src/api/core/core.service.js +29 -29
- package/src/api/crypto/crypto.controller.js +51 -51
- package/src/api/crypto/crypto.model.js +23 -23
- package/src/api/crypto/crypto.router.js +20 -20
- package/src/api/crypto/crypto.service.js +64 -64
- package/src/api/default/default.controller.js +69 -69
- package/src/api/default/default.model.js +20 -20
- package/src/api/default/default.router.js +23 -23
- package/src/api/default/default.service.js +31 -31
- package/src/api/file/file.controller.js +53 -51
- package/src/api/file/file.model.js +19 -19
- package/src/api/file/file.router.js +21 -20
- package/src/api/file/file.service.js +76 -70
- package/src/api/instance/instance.controller.js +69 -69
- package/src/api/instance/instance.model.js +36 -36
- package/src/api/instance/instance.router.js +33 -33
- package/src/api/instance/instance.service.js +48 -48
- package/src/api/test/test.controller.js +59 -59
- package/src/api/test/test.model.js +14 -14
- package/src/api/test/test.router.js +21 -21
- package/src/api/test/test.service.js +35 -35
- package/src/api/user/user.build.js +16 -0
- package/src/api/user/user.controller.js +70 -70
- package/src/api/user/user.model.js +65 -65
- package/src/api/user/user.router.js +345 -345
- package/src/api/user/user.service.js +479 -479
- package/src/api.js +23 -23
- package/src/client/Default.index.js +40 -40
- package/src/client/components/core/Account.js +290 -290
- package/src/client/components/core/AgGrid.js +160 -160
- package/src/client/components/core/Auth.js +19 -19
- package/src/client/components/core/Badge.js +32 -32
- package/src/client/components/core/{BlockChain.js → Blockchain.js} +41 -41
- package/src/client/components/core/Blog.js +9 -9
- package/src/client/components/core/BtnIcon.js +101 -94
- package/src/client/components/core/CalendarCore.js +458 -319
- package/src/client/components/core/Chat.js +64 -64
- package/src/client/components/core/ColorPalette.js +5267 -5267
- package/src/client/components/core/CommonJs.js +735 -732
- package/src/client/components/core/Content.js +193 -49
- package/src/client/components/core/Css.js +1064 -1027
- package/src/client/components/core/CssCore.js +817 -796
- package/src/client/components/core/D3Chart.js +44 -44
- package/src/client/components/core/Docs.js +229 -229
- package/src/client/components/core/DropDown.js +164 -164
- package/src/client/components/core/EventsUI.js +46 -54
- package/src/client/components/core/FileExplorer.js +699 -624
- package/src/client/components/core/FullScreen.js +45 -45
- package/src/client/components/core/Input.js +346 -259
- package/src/client/components/core/JoyStick.js +77 -77
- package/src/client/components/core/Keyboard.js +73 -73
- package/src/client/components/core/LoadingAnimation.js +179 -157
- package/src/client/components/core/LogIn.js +187 -181
- package/src/client/components/core/LogOut.js +58 -52
- package/src/client/components/core/Logger.js +26 -26
- package/src/client/components/core/Modal.js +1612 -1596
- package/src/client/components/core/NotificationManager.js +84 -84
- package/src/client/components/core/Panel.js +613 -413
- package/src/client/components/core/PanelForm.js +468 -0
- package/src/client/components/core/Polyhedron.js +162 -162
- package/src/client/components/core/Recover.js +204 -204
- package/src/client/components/core/Responsive.js +53 -53
- package/src/client/components/core/RichText.js +51 -27
- package/src/client/components/core/Router.js +76 -77
- package/src/client/components/core/Scroll.js +34 -0
- package/src/client/components/core/SignUp.js +125 -125
- package/src/client/components/core/SocketIo.js +72 -72
- package/src/client/components/core/Stream.js +113 -113
- package/src/client/components/core/ToggleSwitch.js +87 -87
- package/src/client/components/core/ToolTip.js +26 -26
- package/src/client/components/core/Translate.js +437 -408
- package/src/client/components/core/Validator.js +100 -100
- package/src/client/components/core/VanillaJs.js +460 -457
- package/src/client/components/core/Wallet.js +106 -106
- package/src/client/components/core/Webhook.js +25 -25
- package/src/client/components/core/Worker.js +272 -272
- package/src/client/components/default/CommonDefault.js +29 -29
- package/src/client/components/default/CssDefault.js +13 -13
- package/src/client/components/default/ElementsDefault.js +38 -38
- package/src/client/components/default/LogInDefault.js +41 -41
- package/src/client/components/default/LogOutDefault.js +28 -28
- package/src/client/components/default/MenuDefault.js +389 -389
- package/src/client/components/default/RoutesDefault.js +48 -48
- package/src/client/components/default/SettingsDefault.js +16 -16
- package/src/client/components/default/SignUpDefault.js +9 -9
- package/src/client/components/default/SocketIoDefault.js +54 -54
- package/src/client/components/default/TranslateDefault.js +7 -7
- package/src/client/public/default/assets/mailer/api-user-check.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-invalid-token.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-recover.png +0 -0
- package/src/client/public/default/browserconfig.xml +11 -11
- package/src/client/public/default/manifest.webmanifest +68 -68
- package/src/client/public/default/plantuml/client-conf.svg +1 -0
- package/src/client/public/default/plantuml/client-schema.svg +1 -0
- package/src/client/public/default/plantuml/cron-conf.svg +1 -0
- package/src/client/public/default/plantuml/cron-schema.svg +1 -0
- package/src/client/public/default/plantuml/server-conf.svg +1 -0
- package/src/client/public/default/plantuml/server-schema.svg +1 -0
- package/src/client/public/default/plantuml/ssr-conf.svg +1 -0
- package/src/client/public/default/plantuml/ssr-schema.svg +1 -0
- package/src/client/public/default/sitemap +147 -147
- package/src/client/public/default/yandex-browser-manifest.json +8 -8
- package/src/client/public/doc/sitemap +147 -147
- package/src/client/public/test/sitemap +147 -147
- package/src/client/services/core/core.service.js +170 -152
- package/src/client/services/crypto/crypto.service.js +70 -70
- package/src/client/services/default/default.management.js +345 -345
- package/src/client/services/default/default.service.js +89 -89
- package/src/client/services/file/file.service.js +70 -70
- package/src/client/services/instance/instance.management.js +74 -74
- package/src/client/services/instance/instance.service.js +89 -89
- package/src/client/services/test/test.service.js +70 -70
- package/src/client/services/user/user.management.js +50 -50
- package/src/client/services/user/user.service.js +89 -89
- package/src/client/ssr/Render.js +16 -16
- package/src/client/ssr/body-components/CacheControl.js +114 -113
- package/src/client/ssr/body-components/DefaultSplashScreen.js +79 -79
- package/src/client/ssr/email-components/DefaultRecoverEmail.js +21 -21
- package/src/client/ssr/email-components/DefaultVerifyEmail.js +17 -17
- package/src/client/ssr/head-components/Css.js +241 -241
- package/src/client/ssr/head-components/DefaultScripts.js +3 -3
- package/src/client/ssr/head-components/Microdata.js +11 -11
- package/src/client/ssr/head-components/Production.js +1 -1
- package/src/client/ssr/head-components/PwaDefault.js +59 -59
- package/src/client/ssr/head-components/Seo.js +14 -14
- package/src/client/sw/default.sw.js +201 -201
- package/src/client/sw/template.sw.js +84 -84
- package/src/client.build.js +22 -22
- package/src/client.dev.js +21 -21
- package/src/cron.js +25 -25
- package/src/db/DataBaseProvider.js +34 -34
- package/src/db/mariadb/MariaDB.js +33 -33
- package/src/db/mongo/MongooseDB.js +137 -46
- package/src/dns.js +22 -22
- package/src/index.js +42 -29
- package/src/mailer/EmailRender.js +69 -69
- package/src/mailer/MailerProvider.js +96 -96
- package/src/proxy.js +22 -22
- package/src/runtime/lampp/Lampp.js +115 -44
- package/src/runtime/nginx/Nginx.js +3 -3
- package/src/runtime/xampp/Xampp.js +49 -49
- package/src/server/auth.js +235 -204
- package/src/server/backup.js +101 -94
- package/src/server/client-build-live.js +72 -72
- package/src/server/client-build.js +699 -699
- package/src/server/client-dev-server.js +60 -58
- package/src/server/client-formatted.js +48 -48
- package/src/server/client-icons.js +149 -150
- package/src/server/conf.js +860 -611
- package/src/server/dns.js +98 -98
- package/src/server/downloader.js +42 -42
- package/src/server/logger.js +190 -180
- package/src/server/network.js +122 -122
- package/src/server/peer.js +33 -33
- package/src/server/process.js +66 -66
- package/src/server/prompt-optimizer.js +28 -28
- package/src/server/proxy.js +118 -118
- package/src/server/runtime.js +444 -393
- package/src/server/ssl.js +120 -107
- package/src/server.js +25 -25
- package/src/ws/IoInterface.js +45 -45
- package/src/ws/IoServer.js +39 -39
- package/src/ws/core/channels/core.ws.chat.js +23 -23
- package/src/ws/core/channels/core.ws.mailer.js +35 -35
- package/src/ws/core/channels/core.ws.stream.js +31 -31
- package/src/ws/core/core.ws.connection.js +28 -28
- package/src/ws/core/core.ws.emit.js +14 -14
- package/src/ws/core/core.ws.server.js +24 -24
- package/src/ws/core/management/core.ws.chat.js +8 -8
- package/src/ws/core/management/core.ws.mailer.js +16 -16
- package/src/ws/core/management/core.ws.stream.js +8 -8
- package/src/ws/default/channels/default.ws.main.js +16 -16
- package/src/ws/default/default.ws.connection.js +22 -22
- package/src/ws/default/default.ws.emit.js +14 -14
- package/src/ws/default/default.ws.server.js +20 -20
- package/src/ws/default/management/default.ws.main.js +8 -8
- package/startup.js +11 -11
- package/supervisord-openssh-server.conf +4 -4
- package/test/api.test.js +60 -60
- package/bin/dns.js +0 -1
- package/bin/install.js +0 -357
- package/bin/shortcut.js +0 -44
|
@@ -1,1596 +1,1612 @@
|
|
|
1
|
-
import { cap, getId, newInstance } from './CommonJs.js';
|
|
2
|
-
import { Draggable } from '@neodrag/vanilla';
|
|
3
|
-
import {
|
|
4
|
-
append,
|
|
5
|
-
s,
|
|
6
|
-
prepend,
|
|
7
|
-
setPath,
|
|
8
|
-
getProxyPath,
|
|
9
|
-
htmls,
|
|
10
|
-
sa,
|
|
11
|
-
getAllChildNodes,
|
|
12
|
-
getCurrentTrace,
|
|
13
|
-
isActiveElement,
|
|
14
|
-
} from './VanillaJs.js';
|
|
15
|
-
import { BtnIcon } from './BtnIcon.js';
|
|
16
|
-
import { Responsive } from './Responsive.js';
|
|
17
|
-
import { loggerFactory } from './Logger.js';
|
|
18
|
-
import {
|
|
19
|
-
Css,
|
|
20
|
-
ThemeEvents,
|
|
21
|
-
Themes,
|
|
22
|
-
ThemesScope,
|
|
23
|
-
darkTheme,
|
|
24
|
-
renderStyleTag,
|
|
25
|
-
renderStatus,
|
|
26
|
-
renderCssAttr,
|
|
27
|
-
} from './Css.js';
|
|
28
|
-
import { setDocTitle } from './Router.js';
|
|
29
|
-
import { NotificationManager } from './NotificationManager.js';
|
|
30
|
-
import { EventsUI } from './EventsUI.js';
|
|
31
|
-
import { Translate } from './Translate.js';
|
|
32
|
-
import { Input } from './Input.js';
|
|
33
|
-
import { Validator } from './Validator.js';
|
|
34
|
-
import { DropDown } from './DropDown.js';
|
|
35
|
-
import { Keyboard } from './Keyboard.js';
|
|
36
|
-
import { Badge } from './Badge.js';
|
|
37
|
-
import { Worker } from './Worker.js';
|
|
38
|
-
|
|
39
|
-
const logger = loggerFactory(import.meta);
|
|
40
|
-
|
|
41
|
-
const Modal = {
|
|
42
|
-
Data: {},
|
|
43
|
-
Render: async function (
|
|
44
|
-
options = {
|
|
45
|
-
id: '',
|
|
46
|
-
barConfig: {},
|
|
47
|
-
title: '',
|
|
48
|
-
html: '',
|
|
49
|
-
handleType: 'bar',
|
|
50
|
-
mode: '' /* slide-menu */,
|
|
51
|
-
RouterInstance: {},
|
|
52
|
-
disableTools: [],
|
|
53
|
-
},
|
|
54
|
-
) {
|
|
55
|
-
if (options.heightBottomBar === undefined) options.heightBottomBar = 50;
|
|
56
|
-
if (options.heightTopBar === undefined) options.heightTopBar = 50;
|
|
57
|
-
let originHeightBottomBar = options.heightBottomBar ? newInstance(options.heightBottomBar) : 0;
|
|
58
|
-
let originHeightTopBar = options.heightTopBar ? newInstance(options.heightTopBar) : 0;
|
|
59
|
-
let width = 300;
|
|
60
|
-
let height = 400;
|
|
61
|
-
let top = 0;
|
|
62
|
-
let left = 0;
|
|
63
|
-
const topBottomBarEnable = options && options.barMode && options.barMode === 'top-bottom-bar';
|
|
64
|
-
if (!topBottomBarEnable) {
|
|
65
|
-
options.heightTopBar = options.heightTopBar + options.heightBottomBar;
|
|
66
|
-
options.heightBottomBar = 0;
|
|
67
|
-
}
|
|
68
|
-
const setCenterRestore = () => {
|
|
69
|
-
const ResponsiveData = Responsive.getResponsiveData();
|
|
70
|
-
top = `${ResponsiveData.height / 2 - height / 2}px`;
|
|
71
|
-
left = `${ResponsiveData.width / 2 - width / 2}px`;
|
|
72
|
-
};
|
|
73
|
-
setCenterRestore();
|
|
74
|
-
let transition = `opacity 0.3s, box-shadow 0.3s, bottom 0.3s`;
|
|
75
|
-
const originSlideMenuWidth = 320;
|
|
76
|
-
const collapseSlideMenuWidth = 50;
|
|
77
|
-
let slideMenuWidth = originSlideMenuWidth;
|
|
78
|
-
const minWidth = width;
|
|
79
|
-
const heightDefaultTopBar = 0;
|
|
80
|
-
const heightDefaultBottomBar = 0;
|
|
81
|
-
const idModal = options && 'id' in options ? options.id : getId(this.Data, 'modal-');
|
|
82
|
-
this.Data[idModal] = {
|
|
83
|
-
options,
|
|
84
|
-
onCloseListener: {},
|
|
85
|
-
onMenuListener: {},
|
|
86
|
-
onDragEndListener: {},
|
|
87
|
-
onObserverListener: {},
|
|
88
|
-
onClickListener: {},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
options.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
options.barConfig.buttons.
|
|
105
|
-
options.
|
|
106
|
-
options.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (this.Data[idModal].
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
(options.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
case 'slide-menu
|
|
137
|
-
case 'slide-menu-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
(options.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
// overflow: '
|
|
150
|
-
'
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
options.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
// barConfig.buttons.
|
|
164
|
-
// barConfig.buttons.
|
|
165
|
-
// barConfig.buttons.
|
|
166
|
-
// barConfig.buttons.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
(options.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
s(`.btn-
|
|
190
|
-
s(
|
|
191
|
-
s(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
s(`.btn-bar-center-icon-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
s(`.btn-
|
|
204
|
-
s(
|
|
205
|
-
s(
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
s(`.btn-bar-center-icon-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
s(`.input-info-${inputSearchBoxId}`).
|
|
309
|
-
{
|
|
310
|
-
|
|
311
|
-
const
|
|
312
|
-
const
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
let
|
|
321
|
-
let
|
|
322
|
-
let
|
|
323
|
-
let
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
s(`.search-box-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
s(`.search-box-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
if (!s(
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex]
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex]
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
.
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
e.src
|
|
449
|
-
e.
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
if (
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
s(selector).childNodes[s(selector).childNodes.length - 1]
|
|
492
|
-
s(selector).childNodes[s(selector).childNodes.length - 1].data
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
s(selector).childNodes[s(selector).childNodes.length - 2]
|
|
499
|
-
s(selector).childNodes[s(selector).childNodes.length - 2].outerText
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
barConfig
|
|
524
|
-
barConfig.buttons.
|
|
525
|
-
barConfig.buttons.
|
|
526
|
-
barConfig.buttons.
|
|
527
|
-
barConfig.buttons.
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
s(`.title-modal-${id}`).
|
|
563
|
-
s(`.
|
|
564
|
-
s(`.btn-bar-modal-container-render-${id}`).classList.add('
|
|
565
|
-
s(`.btn-bar-modal-container-render-${id}`).
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
// s(`.btn-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
s(`.btn-close-${idModal}`).
|
|
683
|
-
s(`.
|
|
684
|
-
s(`.
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
s(`.btn-menu-${idModal}`).
|
|
688
|
-
s(`.
|
|
689
|
-
s(`.
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
// s(`.title-modal-${idModal}`).
|
|
694
|
-
// s(`.
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
//
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
barConfig
|
|
704
|
-
barConfig.buttons.
|
|
705
|
-
barConfig.buttons.
|
|
706
|
-
barConfig.buttons.
|
|
707
|
-
barConfig.buttons.
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
'
|
|
719
|
-
width:
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
const
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
(options.
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
['
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
s(`.top-bar-search-box`).
|
|
767
|
-
s(`.top-bar-search-box`).
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
barConfig
|
|
776
|
-
barConfig.buttons.
|
|
777
|
-
barConfig.buttons.
|
|
778
|
-
barConfig.buttons.
|
|
779
|
-
barConfig.buttons.
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
<
|
|
814
|
-
<span class="btn-bar-center-icon-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
'
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
//
|
|
877
|
-
s(
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
EventsUI.onClick(`.action-btn-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
if (s(
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
barConfig
|
|
943
|
-
barConfig.buttons.
|
|
944
|
-
barConfig.buttons.
|
|
945
|
-
barConfig.buttons.
|
|
946
|
-
barConfig.buttons.
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
'
|
|
959
|
-
'
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
s(`.${id}`)
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
(options.
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
s(`.${idModal}`).style.
|
|
993
|
-
s(`.${idModal}`).style.
|
|
994
|
-
s(`.${idModal}`).style.
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
.
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
countDrop
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
if (
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
options.titleClass = ' title-view-modal ';
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
}
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
}
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
<div class="
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
<div class="
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
case 'slide-menu
|
|
1168
|
-
case 'slide-menu-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
.
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
s(`.btn-icon-menu-mode-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
s(`.btn-icon-menu-mode-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
sa(`.
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
sa(`.
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
this.actionBtnCenter();
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
...
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
this.Data[idModal].
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
setTimeout(() => (s(`.${idModal}`).style.
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
s(
|
|
1300
|
-
s(`.btn-
|
|
1301
|
-
s(`.btn-
|
|
1302
|
-
s(
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
s(
|
|
1309
|
-
s(`.btn-
|
|
1310
|
-
s(`.btn-
|
|
1311
|
-
s(
|
|
1312
|
-
s(`.${idModal}`).style.
|
|
1313
|
-
s(`.${idModal}`).style.
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
s(`.${idModal}`).style.
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
s(
|
|
1324
|
-
s(`.btn-
|
|
1325
|
-
s(`.btn-
|
|
1326
|
-
s(
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
s(`.${idModal}`).style.
|
|
1337
|
-
s(`.${idModal}`).style.
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
(options.
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
s(`.${idModal}`).style.
|
|
1356
|
-
s(`.${idModal}`).style.
|
|
1357
|
-
s(`.${idModal}`).style.
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
if (options.
|
|
1374
|
-
|
|
1375
|
-
this.Data[idModal].
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
this.Data[idModal].observer.
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
const
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
},
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
<div class="
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1596
|
-
|
|
1
|
+
import { cap, getId, newInstance } from './CommonJs.js';
|
|
2
|
+
import { Draggable } from '@neodrag/vanilla';
|
|
3
|
+
import {
|
|
4
|
+
append,
|
|
5
|
+
s,
|
|
6
|
+
prepend,
|
|
7
|
+
setPath,
|
|
8
|
+
getProxyPath,
|
|
9
|
+
htmls,
|
|
10
|
+
sa,
|
|
11
|
+
getAllChildNodes,
|
|
12
|
+
getCurrentTrace,
|
|
13
|
+
isActiveElement,
|
|
14
|
+
} from './VanillaJs.js';
|
|
15
|
+
import { BtnIcon } from './BtnIcon.js';
|
|
16
|
+
import { Responsive } from './Responsive.js';
|
|
17
|
+
import { loggerFactory } from './Logger.js';
|
|
18
|
+
import {
|
|
19
|
+
Css,
|
|
20
|
+
ThemeEvents,
|
|
21
|
+
Themes,
|
|
22
|
+
ThemesScope,
|
|
23
|
+
darkTheme,
|
|
24
|
+
renderStyleTag,
|
|
25
|
+
renderStatus,
|
|
26
|
+
renderCssAttr,
|
|
27
|
+
} from './Css.js';
|
|
28
|
+
import { setDocTitle } from './Router.js';
|
|
29
|
+
import { NotificationManager } from './NotificationManager.js';
|
|
30
|
+
import { EventsUI } from './EventsUI.js';
|
|
31
|
+
import { Translate } from './Translate.js';
|
|
32
|
+
import { Input } from './Input.js';
|
|
33
|
+
import { Validator } from './Validator.js';
|
|
34
|
+
import { DropDown } from './DropDown.js';
|
|
35
|
+
import { Keyboard } from './Keyboard.js';
|
|
36
|
+
import { Badge } from './Badge.js';
|
|
37
|
+
import { Worker } from './Worker.js';
|
|
38
|
+
|
|
39
|
+
const logger = loggerFactory(import.meta);
|
|
40
|
+
|
|
41
|
+
const Modal = {
|
|
42
|
+
Data: {},
|
|
43
|
+
Render: async function (
|
|
44
|
+
options = {
|
|
45
|
+
id: '',
|
|
46
|
+
barConfig: {},
|
|
47
|
+
title: '',
|
|
48
|
+
html: '',
|
|
49
|
+
handleType: 'bar',
|
|
50
|
+
mode: '' /* slide-menu */,
|
|
51
|
+
RouterInstance: {},
|
|
52
|
+
disableTools: [],
|
|
53
|
+
},
|
|
54
|
+
) {
|
|
55
|
+
if (options.heightBottomBar === undefined) options.heightBottomBar = 50;
|
|
56
|
+
if (options.heightTopBar === undefined) options.heightTopBar = 50;
|
|
57
|
+
let originHeightBottomBar = options.heightBottomBar ? newInstance(options.heightBottomBar) : 0;
|
|
58
|
+
let originHeightTopBar = options.heightTopBar ? newInstance(options.heightTopBar) : 0;
|
|
59
|
+
let width = 300;
|
|
60
|
+
let height = 400;
|
|
61
|
+
let top = 0;
|
|
62
|
+
let left = 0;
|
|
63
|
+
const topBottomBarEnable = options && options.barMode && options.barMode === 'top-bottom-bar';
|
|
64
|
+
if (!topBottomBarEnable) {
|
|
65
|
+
options.heightTopBar = options.heightTopBar + options.heightBottomBar;
|
|
66
|
+
options.heightBottomBar = 0;
|
|
67
|
+
}
|
|
68
|
+
const setCenterRestore = () => {
|
|
69
|
+
const ResponsiveData = Responsive.getResponsiveData();
|
|
70
|
+
top = `${ResponsiveData.height / 2 - height / 2}px`;
|
|
71
|
+
left = `${ResponsiveData.width / 2 - width / 2}px`;
|
|
72
|
+
};
|
|
73
|
+
setCenterRestore();
|
|
74
|
+
let transition = `opacity 0.3s, box-shadow 0.3s, bottom 0.3s`;
|
|
75
|
+
const originSlideMenuWidth = 320;
|
|
76
|
+
const collapseSlideMenuWidth = 50;
|
|
77
|
+
let slideMenuWidth = originSlideMenuWidth;
|
|
78
|
+
const minWidth = width;
|
|
79
|
+
const heightDefaultTopBar = 0;
|
|
80
|
+
const heightDefaultBottomBar = 0;
|
|
81
|
+
const idModal = options && 'id' in options ? options.id : getId(this.Data, 'modal-');
|
|
82
|
+
this.Data[idModal] = {
|
|
83
|
+
options,
|
|
84
|
+
onCloseListener: {},
|
|
85
|
+
onMenuListener: {},
|
|
86
|
+
onDragEndListener: {},
|
|
87
|
+
onObserverListener: {},
|
|
88
|
+
onClickListener: {},
|
|
89
|
+
query: options.query ? `${window.location.search}` : undefined,
|
|
90
|
+
};
|
|
91
|
+
if (options && 'mode' in options) {
|
|
92
|
+
this.Data[idModal][options.mode] = {};
|
|
93
|
+
switch (options.mode) {
|
|
94
|
+
case 'view':
|
|
95
|
+
if (options && options.slideMenu) s(`.btn-close-${options.slideMenu}`).click();
|
|
96
|
+
options.zIndexSync = true;
|
|
97
|
+
|
|
98
|
+
options.style = {
|
|
99
|
+
...options.style,
|
|
100
|
+
'min-width': `${minWidth}px`,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
if (this.mobileModal()) {
|
|
104
|
+
options.barConfig.buttons.restore.disabled = true;
|
|
105
|
+
options.barConfig.buttons.minimize.disabled = true;
|
|
106
|
+
options.dragDisabled = true;
|
|
107
|
+
options.style.resize = 'none';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
Responsive.Event[`view-${idModal}`] = () => {
|
|
111
|
+
if (!this.Data[idModal]) return delete Responsive.Event[`view-${idModal}`];
|
|
112
|
+
if (this.Data[idModal].slideMenu)
|
|
113
|
+
s(`.${idModal}`).style.height = `${
|
|
114
|
+
window.innerHeight -
|
|
115
|
+
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
|
|
116
|
+
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
117
|
+
}px`;
|
|
118
|
+
};
|
|
119
|
+
Responsive.Event[`view-${idModal}`]();
|
|
120
|
+
|
|
121
|
+
// Router
|
|
122
|
+
if (options.route)
|
|
123
|
+
(() => {
|
|
124
|
+
let path = window.location.pathname;
|
|
125
|
+
if (path !== '/' && path[path.length - 1] === '/') path = path.slice(0, -1);
|
|
126
|
+
const proxyPath = getProxyPath();
|
|
127
|
+
const newPath = `${proxyPath}${options.route}`;
|
|
128
|
+
if (path !== newPath) {
|
|
129
|
+
// console.warn('SET MODAL URI', newPath);
|
|
130
|
+
setPath(`${newPath}`); // ${location.search}
|
|
131
|
+
setDocTitle({ ...options.RouterInstance, route: options.route });
|
|
132
|
+
}
|
|
133
|
+
})();
|
|
134
|
+
|
|
135
|
+
break;
|
|
136
|
+
case 'slide-menu':
|
|
137
|
+
case 'slide-menu-right':
|
|
138
|
+
case 'slide-menu-left':
|
|
139
|
+
(async () => {
|
|
140
|
+
const { barConfig } = options;
|
|
141
|
+
options.style = {
|
|
142
|
+
position: 'absolute',
|
|
143
|
+
height: `${
|
|
144
|
+
window.innerHeight -
|
|
145
|
+
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
|
|
146
|
+
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
147
|
+
}px`,
|
|
148
|
+
width: `${slideMenuWidth}px`,
|
|
149
|
+
// 'overflow-x': 'hidden',
|
|
150
|
+
// overflow: 'visible', // required for tooltip
|
|
151
|
+
'z-index': 6,
|
|
152
|
+
resize: 'none',
|
|
153
|
+
top: `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`,
|
|
154
|
+
};
|
|
155
|
+
options.mode === 'slide-menu-right' ? (options.style.right = '0px') : (options.style.left = '0px');
|
|
156
|
+
const contentIconClass = 'abs center';
|
|
157
|
+
|
|
158
|
+
options.dragDisabled = true;
|
|
159
|
+
options.titleClass = 'hide';
|
|
160
|
+
top = '0px';
|
|
161
|
+
left = 'auto';
|
|
162
|
+
width = 'auto';
|
|
163
|
+
// barConfig.buttons.maximize.disabled = true;
|
|
164
|
+
// barConfig.buttons.minimize.disabled = true;
|
|
165
|
+
// barConfig.buttons.restore.disabled = true;
|
|
166
|
+
// barConfig.buttons.menu.disabled = true;
|
|
167
|
+
// barConfig.buttons.close.disabled = true;
|
|
168
|
+
options.btnBarModalClass = 'hide';
|
|
169
|
+
Responsive.Event[`slide-menu-${idModal}`] = () => {
|
|
170
|
+
for (const _idModal of Object.keys(this.Data)) {
|
|
171
|
+
if (this.Data[_idModal].slideMenu && this.Data[_idModal].slideMenu.id === idModal)
|
|
172
|
+
this.Data[_idModal].slideMenu.callBack();
|
|
173
|
+
}
|
|
174
|
+
s(`.${idModal}`).style.height = `${
|
|
175
|
+
window.innerHeight -
|
|
176
|
+
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
|
|
177
|
+
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
178
|
+
}px`;
|
|
179
|
+
if (s(`.main-body-top`)) {
|
|
180
|
+
if (Modal.mobileModal()) {
|
|
181
|
+
if (s(`.btn-menu-${idModal}`).classList.contains('hide') && collapseSlideMenuWidth !== slideMenuWidth)
|
|
182
|
+
s(`.main-body-top`).classList.remove('hide');
|
|
183
|
+
if (s(`.btn-close-${idModal}`).classList.contains('hide')) s(`.main-body-top`).classList.add('hide');
|
|
184
|
+
} else if (!s(`.main-body-top`).classList.contains('hide')) s(`.main-body-top`).classList.add('hide');
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
barConfig.buttons.menu.onClick = () => {
|
|
188
|
+
this.Data[idModal][options.mode].width = slideMenuWidth;
|
|
189
|
+
s(`.btn-menu-${idModal}`).classList.add('hide');
|
|
190
|
+
s(`.btn-close-${idModal}`).classList.remove('hide');
|
|
191
|
+
s(`.${idModal}`).style.width = `${this.Data[idModal][options.mode].width}px`;
|
|
192
|
+
s(`.html-${idModal}`).style.display = 'block';
|
|
193
|
+
// s(`.title-modal-${idModal}`).style.display = 'block';
|
|
194
|
+
if (s(`.main-body-top`)) {
|
|
195
|
+
s(`.btn-bar-center-icon-close`).classList.remove('hide');
|
|
196
|
+
s(`.btn-bar-center-icon-menu`).classList.add('hide');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
Responsive.Event[`slide-menu-${idModal}`]();
|
|
200
|
+
};
|
|
201
|
+
barConfig.buttons.close.onClick = () => {
|
|
202
|
+
this.Data[idModal][options.mode].width = 0;
|
|
203
|
+
s(`.btn-close-${idModal}`).classList.add('hide');
|
|
204
|
+
s(`.btn-menu-${idModal}`).classList.remove('hide');
|
|
205
|
+
s(`.${idModal}`).style.width = `${this.Data[idModal][options.mode].width}px`;
|
|
206
|
+
s(`.html-${idModal}`).style.display = 'none';
|
|
207
|
+
if (s(`.main-body-top`)) {
|
|
208
|
+
s(`.btn-bar-center-icon-menu`).classList.remove('hide');
|
|
209
|
+
s(`.btn-bar-center-icon-close`).classList.add('hide');
|
|
210
|
+
}
|
|
211
|
+
// s(`.title-modal-${idModal}`).style.display = 'none';
|
|
212
|
+
Responsive.Event[`slide-menu-${idModal}`]();
|
|
213
|
+
};
|
|
214
|
+
transition += `, width 0.3s`;
|
|
215
|
+
|
|
216
|
+
const inputSearchBoxId = `top-bar-search-box`;
|
|
217
|
+
append(
|
|
218
|
+
'body',
|
|
219
|
+
html` <div class="fix modal slide-menu-top-bar">
|
|
220
|
+
<div
|
|
221
|
+
class="fl top-bar ${options.barClass ? options.barClass : ''}"
|
|
222
|
+
style="height: ${originHeightTopBar}px;"
|
|
223
|
+
>
|
|
224
|
+
${await BtnIcon.Render({
|
|
225
|
+
style: `height: 100%`,
|
|
226
|
+
class: 'in fll main-btn-menu action-bar-box action-btn-close hide',
|
|
227
|
+
label: html` <div class="${contentIconClass} action-btn-close-render">
|
|
228
|
+
<i class="fa-solid fa-xmark"></i>
|
|
229
|
+
</div>`,
|
|
230
|
+
})}
|
|
231
|
+
${await BtnIcon.Render({
|
|
232
|
+
style: `height: 100%`,
|
|
233
|
+
class: `in fll main-btn-menu action-bar-box action-btn-app-icon ${
|
|
234
|
+
options?.disableTools?.includes('app-icon') ? 'hide' : ''
|
|
235
|
+
}`,
|
|
236
|
+
label: html` <div class="${contentIconClass} action-btn-app-icon-render"></div>`,
|
|
237
|
+
})}
|
|
238
|
+
<form
|
|
239
|
+
class="in fll top-bar-search-box-container hover ${options?.disableTools?.includes('text-box')
|
|
240
|
+
? 'hide'
|
|
241
|
+
: ''}"
|
|
242
|
+
>
|
|
243
|
+
${await Input.Render({
|
|
244
|
+
id: inputSearchBoxId,
|
|
245
|
+
placeholder: Modal.mobileModal() ? Translate.Render('search', '.top-bar-search-box') : undefined, // html`<i class="fa-solid fa-magnifying-glass"></i> ${Translate.Render('search')}`,
|
|
246
|
+
placeholderIcon: html`<div
|
|
247
|
+
class="in fll"
|
|
248
|
+
style="width: ${originHeightTopBar}px; height: ${originHeightTopBar}px;"
|
|
249
|
+
>
|
|
250
|
+
<div class="abs center"><i class="fa-solid fa-magnifying-glass"></i></div>
|
|
251
|
+
${!Modal.mobileModal()
|
|
252
|
+
? html` <div
|
|
253
|
+
class="inl wfm key-shortcut-container-info"
|
|
254
|
+
style="${renderCssAttr({ style: { top: '10px', left: '60px' } })}"
|
|
255
|
+
>
|
|
256
|
+
${await Badge.Render({
|
|
257
|
+
id: 'shortcut-key-info-search',
|
|
258
|
+
text: 'Shift',
|
|
259
|
+
classList: 'inl',
|
|
260
|
+
style: { 'z-index': 1 },
|
|
261
|
+
})}
|
|
262
|
+
${await Badge.Render({
|
|
263
|
+
id: 'shortcut-key-info-search',
|
|
264
|
+
text: '+',
|
|
265
|
+
classList: 'inl',
|
|
266
|
+
style: { 'z-index': 1, background: 'none', color: '#5f5f5f' },
|
|
267
|
+
})}
|
|
268
|
+
${await Badge.Render({
|
|
269
|
+
id: 'shortcut-key-info-search',
|
|
270
|
+
text: 'k',
|
|
271
|
+
classList: 'inl',
|
|
272
|
+
style: { 'z-index': 1 },
|
|
273
|
+
})}
|
|
274
|
+
</div>`
|
|
275
|
+
: ''}
|
|
276
|
+
</div>`,
|
|
277
|
+
inputClass: 'in fll',
|
|
278
|
+
// containerClass: '',
|
|
279
|
+
})}
|
|
280
|
+
</form>
|
|
281
|
+
<div
|
|
282
|
+
class="abs top-box-profile-container ${options?.disableTools?.includes('profile') ? 'hide' : ''}"
|
|
283
|
+
>
|
|
284
|
+
${await BtnIcon.Render({
|
|
285
|
+
style: `height: 100%`,
|
|
286
|
+
class: 'in fll session-in-log-in main-btn-menu action-bar-box action-btn-profile-log-in',
|
|
287
|
+
label: html` <div class="${contentIconClass} action-btn-profile-log-in-render"></div>`,
|
|
288
|
+
})}
|
|
289
|
+
${await BtnIcon.Render({
|
|
290
|
+
style: `height: 100%`,
|
|
291
|
+
class: 'in fll session-in-log-out main-btn-menu action-bar-box action-btn-profile-log-out',
|
|
292
|
+
label: html` <div class="${contentIconClass} action-btn-profile-log-out-render">
|
|
293
|
+
<i class="fas fa-user-plus"></i>
|
|
294
|
+
</div>`,
|
|
295
|
+
})}
|
|
296
|
+
</div>
|
|
297
|
+
</div>
|
|
298
|
+
</div>`,
|
|
299
|
+
);
|
|
300
|
+
EventsUI.onClick(`.action-btn-profile-log-in`, () => {
|
|
301
|
+
s(`.main-btn-account`).click();
|
|
302
|
+
});
|
|
303
|
+
EventsUI.onClick(`.action-btn-profile-log-out`, () => {
|
|
304
|
+
s(`.main-btn-sign-up`).click();
|
|
305
|
+
});
|
|
306
|
+
s(`.input-info-${inputSearchBoxId}`).style.textAlign = 'left';
|
|
307
|
+
htmls(`.input-info-${inputSearchBoxId}`, '');
|
|
308
|
+
const inputInfoNode = s(`.input-info-${inputSearchBoxId}`).cloneNode(true);
|
|
309
|
+
s(`.input-info-${inputSearchBoxId}`).remove();
|
|
310
|
+
{
|
|
311
|
+
const id = 'search-box-history';
|
|
312
|
+
const searchBoxHistoryId = id;
|
|
313
|
+
const formDataInfoNode = [
|
|
314
|
+
{
|
|
315
|
+
model: 'search-box',
|
|
316
|
+
id: inputSearchBoxId,
|
|
317
|
+
rules: [] /*{ type: 'isEmpty' }, { type: 'isEmail' }*/,
|
|
318
|
+
},
|
|
319
|
+
];
|
|
320
|
+
let hoverHistBox = false;
|
|
321
|
+
let hoverInputBox = false;
|
|
322
|
+
let currentKeyBoardSearchBoxIndex = 0;
|
|
323
|
+
let results = [];
|
|
324
|
+
let historySearchBox = [];
|
|
325
|
+
|
|
326
|
+
const checkHistoryBoxTitleStatus = () => {
|
|
327
|
+
if (s(`.search-box-result-title`) && s(`.search-box-result-title`).classList) {
|
|
328
|
+
if (!s(`.${inputSearchBoxId}`).value.trim()) {
|
|
329
|
+
s(`.search-box-result-title`).classList.add('hide');
|
|
330
|
+
s(`.search-box-recent-title`).classList.remove('hide');
|
|
331
|
+
} else {
|
|
332
|
+
s(`.search-box-recent-title`).classList.add('hide');
|
|
333
|
+
s(`.search-box-result-title`).classList.remove('hide');
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
const checkShortcutContainerInfoEnabled = () => {
|
|
339
|
+
if (Modal.mobileModal() || !s(`.key-shortcut-container-info`)) return;
|
|
340
|
+
if (!s(`.${inputSearchBoxId}`).value) {
|
|
341
|
+
s(`.key-shortcut-container-info`).classList.remove('hide');
|
|
342
|
+
} else s(`.key-shortcut-container-info`).classList.add('hide');
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
const renderSearchResult = async (results) => {
|
|
346
|
+
htmls(`.html-${searchBoxHistoryId}`, '');
|
|
347
|
+
if (results.length === 0) {
|
|
348
|
+
append(
|
|
349
|
+
`.html-${searchBoxHistoryId}`,
|
|
350
|
+
await BtnIcon.Render({
|
|
351
|
+
label: html`<i class="fas fa-exclamation-circle"></i> ${Translate.Render('no-result-found')}`,
|
|
352
|
+
class: `wfa`,
|
|
353
|
+
style: renderCssAttr({
|
|
354
|
+
style: {
|
|
355
|
+
padding: '3px',
|
|
356
|
+
margin: '2px',
|
|
357
|
+
'text-align': 'center',
|
|
358
|
+
border: 'none',
|
|
359
|
+
cursor: 'default',
|
|
360
|
+
background: 'none !important',
|
|
361
|
+
},
|
|
362
|
+
}),
|
|
363
|
+
}),
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
let indexResult = -1;
|
|
367
|
+
for (const result of results) {
|
|
368
|
+
indexResult++;
|
|
369
|
+
const indexRender = indexResult;
|
|
370
|
+
append(
|
|
371
|
+
`.html-${searchBoxHistoryId}`,
|
|
372
|
+
await BtnIcon.Render({
|
|
373
|
+
label: `${
|
|
374
|
+
result.fontAwesomeIcon
|
|
375
|
+
? html`<i class="${result.fontAwesomeIcon.classList.toString()}"></i> `
|
|
376
|
+
: result.imgElement
|
|
377
|
+
? html`<img
|
|
378
|
+
class="inl"
|
|
379
|
+
src="${result.imgElement.src}"
|
|
380
|
+
style="${renderCssAttr({ style: { width: '25px', height: '25px' } })}"
|
|
381
|
+
/>`
|
|
382
|
+
: ''
|
|
383
|
+
} ${Translate.Render(result.routerId)}`,
|
|
384
|
+
class: `wfa search-result-btn-${result.routerId} ${
|
|
385
|
+
indexResult === currentKeyBoardSearchBoxIndex ? 'main-btn-menu-active' : ''
|
|
386
|
+
} search-result-btn-${indexResult}`,
|
|
387
|
+
style: renderCssAttr({
|
|
388
|
+
style: { padding: '3px', margin: '2px', 'text-align': 'left' },
|
|
389
|
+
}),
|
|
390
|
+
}),
|
|
391
|
+
);
|
|
392
|
+
s(`.search-result-btn-${result.routerId}`).onclick = () => {
|
|
393
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.remove(
|
|
394
|
+
`main-btn-menu-active`,
|
|
395
|
+
);
|
|
396
|
+
currentKeyBoardSearchBoxIndex = indexRender;
|
|
397
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.add(
|
|
398
|
+
`main-btn-menu-active`,
|
|
399
|
+
);
|
|
400
|
+
setSearchValue(`.search-result-btn-${result.routerId}`);
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
const getResultSearchBox = (validatorData) => {
|
|
406
|
+
const { model, id } = validatorData;
|
|
407
|
+
switch (model) {
|
|
408
|
+
case 'search-box':
|
|
409
|
+
{
|
|
410
|
+
if (
|
|
411
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex] &&
|
|
412
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList
|
|
413
|
+
)
|
|
414
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.remove(
|
|
415
|
+
`main-btn-menu-active`,
|
|
416
|
+
);
|
|
417
|
+
currentKeyBoardSearchBoxIndex = 0;
|
|
418
|
+
if (
|
|
419
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex] &&
|
|
420
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList
|
|
421
|
+
)
|
|
422
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.add(
|
|
423
|
+
`main-btn-menu-active`,
|
|
424
|
+
);
|
|
425
|
+
results = [];
|
|
426
|
+
const routerInstance = Worker.RouterInstance.Routes();
|
|
427
|
+
for (const _routerId of Object.keys(routerInstance)) {
|
|
428
|
+
const routerId = _routerId.slice(1);
|
|
429
|
+
if (routerId) {
|
|
430
|
+
if (
|
|
431
|
+
s(`.main-btn-${routerId}`) &&
|
|
432
|
+
(routerId.toLocaleLowerCase().match(s(`.${id}`).value.toLocaleLowerCase()) ||
|
|
433
|
+
(Translate.Data[routerId] &&
|
|
434
|
+
Object.keys(Translate.Data[routerId]).filter((keyLang) =>
|
|
435
|
+
Translate.Data[routerId][keyLang]
|
|
436
|
+
.toLocaleLowerCase()
|
|
437
|
+
.match(s(`.${id}`).value.toLocaleLowerCase()),
|
|
438
|
+
).length > 0))
|
|
439
|
+
) {
|
|
440
|
+
const fontAwesomeIcon = getAllChildNodes(s(`.main-btn-${routerId}`)).find((e) => {
|
|
441
|
+
return (
|
|
442
|
+
e.classList &&
|
|
443
|
+
Array.from(e.classList).find((e) => e.match('fa-') && !e.match('fa-grip-vertical'))
|
|
444
|
+
);
|
|
445
|
+
});
|
|
446
|
+
const imgElement = getAllChildNodes(s(`.main-btn-${routerId}`)).find((e) => {
|
|
447
|
+
return (
|
|
448
|
+
typeof e.src === 'string' &&
|
|
449
|
+
e.src.match(routerId) &&
|
|
450
|
+
e.classList &&
|
|
451
|
+
Array.from(e.classList).find((e) => e.match('img-btn-square-menu'))
|
|
452
|
+
);
|
|
453
|
+
});
|
|
454
|
+
if (imgElement || fontAwesomeIcon) {
|
|
455
|
+
results.push({
|
|
456
|
+
routerId,
|
|
457
|
+
fontAwesomeIcon: fontAwesomeIcon,
|
|
458
|
+
imgElement,
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
break;
|
|
466
|
+
|
|
467
|
+
default:
|
|
468
|
+
break;
|
|
469
|
+
}
|
|
470
|
+
if (s(`.${inputSearchBoxId}`).value.trim()) renderSearchResult(results);
|
|
471
|
+
else renderSearchResult(historySearchBox);
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
const searchBoxCallBack = async (validatorData) => {
|
|
475
|
+
const isSearchBoxActiveElement = isActiveElement(inputSearchBoxId);
|
|
476
|
+
checkHistoryBoxTitleStatus();
|
|
477
|
+
checkShortcutContainerInfoEnabled();
|
|
478
|
+
if (!isSearchBoxActiveElement && !hoverHistBox && !hoverInputBox) {
|
|
479
|
+
Modal.removeModal(searchBoxHistoryId);
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
setTimeout(() => getResultSearchBox(validatorData));
|
|
483
|
+
};
|
|
484
|
+
|
|
485
|
+
const getDefaultSearchBoxSelector = () => `.search-result-btn-${currentKeyBoardSearchBoxIndex}`;
|
|
486
|
+
|
|
487
|
+
const updateSearchBoxValue = (selector) => {
|
|
488
|
+
if (!selector) selector = getDefaultSearchBoxSelector();
|
|
489
|
+
if (s(selector).childNodes) {
|
|
490
|
+
if (
|
|
491
|
+
s(selector).childNodes[s(selector).childNodes.length - 1] &&
|
|
492
|
+
s(selector).childNodes[s(selector).childNodes.length - 1].data &&
|
|
493
|
+
s(selector).childNodes[s(selector).childNodes.length - 1].data.trim()
|
|
494
|
+
) {
|
|
495
|
+
s(`.${inputSearchBoxId}`).value =
|
|
496
|
+
s(selector).childNodes[s(selector).childNodes.length - 1].data.trim();
|
|
497
|
+
} else if (
|
|
498
|
+
s(selector).childNodes[s(selector).childNodes.length - 2] &&
|
|
499
|
+
s(selector).childNodes[s(selector).childNodes.length - 2].outerText &&
|
|
500
|
+
s(selector).childNodes[s(selector).childNodes.length - 2].outerText.trim()
|
|
501
|
+
) {
|
|
502
|
+
s(`.${inputSearchBoxId}`).value =
|
|
503
|
+
s(selector).childNodes[s(selector).childNodes.length - 2].outerText.trim();
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
checkHistoryBoxTitleStatus();
|
|
507
|
+
checkShortcutContainerInfoEnabled();
|
|
508
|
+
};
|
|
509
|
+
|
|
510
|
+
const setSearchValue = (selector) => {
|
|
511
|
+
if (!selector) selector = getDefaultSearchBoxSelector();
|
|
512
|
+
historySearchBox = historySearchBox.filter(
|
|
513
|
+
(h) => h.routerId !== results[currentKeyBoardSearchBoxIndex].routerId,
|
|
514
|
+
);
|
|
515
|
+
historySearchBox.unshift(results[currentKeyBoardSearchBoxIndex]);
|
|
516
|
+
updateSearchBoxValue(selector);
|
|
517
|
+
s(`.main-btn-${results[currentKeyBoardSearchBoxIndex].routerId}`).click();
|
|
518
|
+
Modal.removeModal(searchBoxHistoryId);
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
const searchBoxHistoryOpen = async () => {
|
|
522
|
+
if (!s(`.${id}`)) {
|
|
523
|
+
const { barConfig } = await Themes[Css.currentTheme]();
|
|
524
|
+
barConfig.buttons.maximize.disabled = true;
|
|
525
|
+
barConfig.buttons.minimize.disabled = true;
|
|
526
|
+
barConfig.buttons.restore.disabled = true;
|
|
527
|
+
barConfig.buttons.menu.disabled = true;
|
|
528
|
+
barConfig.buttons.close.disabled = false;
|
|
529
|
+
await Modal.Render({
|
|
530
|
+
id,
|
|
531
|
+
barConfig,
|
|
532
|
+
title: html`<div class="search-box-recent-title">
|
|
533
|
+
${renderViewTitle({
|
|
534
|
+
icon: html`<i class="fas fa-history mini-title"></i>`,
|
|
535
|
+
text: Translate.Render('recent'),
|
|
536
|
+
})}
|
|
537
|
+
</div>
|
|
538
|
+
<div class="search-box-result-title hide">
|
|
539
|
+
${renderViewTitle({
|
|
540
|
+
icon: html`<i class="far fa-list-alt mini-title"></i>`,
|
|
541
|
+
text: Translate.Render('results'),
|
|
542
|
+
})}
|
|
543
|
+
</div>`,
|
|
544
|
+
html: () => html``,
|
|
545
|
+
titleClass: 'mini-title',
|
|
546
|
+
style: {
|
|
547
|
+
resize: 'none',
|
|
548
|
+
'max-width': '450px',
|
|
549
|
+
height:
|
|
550
|
+
this.mobileModal() && window.innerWidth < 445
|
|
551
|
+
? `${window.innerHeight - originHeightTopBar}px !important`
|
|
552
|
+
: '300px !important',
|
|
553
|
+
'z-index': 7,
|
|
554
|
+
},
|
|
555
|
+
dragDisabled: true,
|
|
556
|
+
maximize: true,
|
|
557
|
+
heightBottomBar: 0,
|
|
558
|
+
heightTopBar: originHeightTopBar,
|
|
559
|
+
barMode: options.barMode,
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
const titleNode = s(`.title-modal-${id}`).cloneNode(true);
|
|
563
|
+
s(`.title-modal-${id}`).remove();
|
|
564
|
+
s(`.btn-bar-modal-container-render-${id}`).classList.add('in');
|
|
565
|
+
s(`.btn-bar-modal-container-render-${id}`).classList.add('fll');
|
|
566
|
+
s(`.btn-bar-modal-container-render-${id}`).appendChild(titleNode);
|
|
567
|
+
|
|
568
|
+
prepend(`.btn-bar-modal-container-${id}`, html`<div class="hide">${inputInfoNode.outerHTML}</div>`);
|
|
569
|
+
|
|
570
|
+
s(`.top-bar-search-box-container`).onmouseover = () => {
|
|
571
|
+
hoverInputBox = true;
|
|
572
|
+
};
|
|
573
|
+
s(`.top-bar-search-box-container`).onmouseout = () => {
|
|
574
|
+
hoverInputBox = false;
|
|
575
|
+
};
|
|
576
|
+
s(`.${id}`).onmouseover = () => {
|
|
577
|
+
hoverHistBox = true;
|
|
578
|
+
};
|
|
579
|
+
s(`.${id}`).onmouseout = () => {
|
|
580
|
+
hoverHistBox = false;
|
|
581
|
+
s(`.${inputSearchBoxId}`).focus();
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
s('.top-bar-search-box').oninput = () => {
|
|
587
|
+
searchBoxHistoryOpen();
|
|
588
|
+
searchBoxCallBack(formDataInfoNode[0]);
|
|
589
|
+
};
|
|
590
|
+
s('.top-bar-search-box').onfocus = () => {
|
|
591
|
+
searchBoxHistoryOpen();
|
|
592
|
+
searchBoxCallBack(formDataInfoNode[0]);
|
|
593
|
+
};
|
|
594
|
+
s('.top-bar-search-box').onblur = () => {
|
|
595
|
+
if (!hoverHistBox && !hoverInputBox && !isActiveElement(inputSearchBoxId)) {
|
|
596
|
+
Modal.removeModal(searchBoxHistoryId);
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
EventsUI.onClick(`.top-bar-search-box-container`, () => {
|
|
600
|
+
searchBoxHistoryOpen();
|
|
601
|
+
searchBoxCallBack(formDataInfoNode[0]);
|
|
602
|
+
});
|
|
603
|
+
|
|
604
|
+
const timePressDelay = 100;
|
|
605
|
+
Keyboard.instanceMultiPressKey({
|
|
606
|
+
id: 'input-search-shortcut-ArrowUp',
|
|
607
|
+
keys: ['ArrowUp'],
|
|
608
|
+
eventCallBack: () => {
|
|
609
|
+
if (s(`.${id}`)) {
|
|
610
|
+
if (
|
|
611
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex] &&
|
|
612
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex - 1]
|
|
613
|
+
) {
|
|
614
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.remove(
|
|
615
|
+
`main-btn-menu-active`,
|
|
616
|
+
);
|
|
617
|
+
currentKeyBoardSearchBoxIndex--;
|
|
618
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.add(
|
|
619
|
+
`main-btn-menu-active`,
|
|
620
|
+
);
|
|
621
|
+
} else {
|
|
622
|
+
if (s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex])
|
|
623
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.remove(
|
|
624
|
+
`main-btn-menu-active`,
|
|
625
|
+
);
|
|
626
|
+
currentKeyBoardSearchBoxIndex = s(`.html-${searchBoxHistoryId}`).childNodes.length - 1;
|
|
627
|
+
if (s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex])
|
|
628
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.add(
|
|
629
|
+
`main-btn-menu-active`,
|
|
630
|
+
);
|
|
631
|
+
}
|
|
632
|
+
updateSearchBoxValue();
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
timePressDelay,
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
Keyboard.instanceMultiPressKey({
|
|
639
|
+
id: 'input-search-shortcut-ArrowDown',
|
|
640
|
+
keys: ['ArrowDown'],
|
|
641
|
+
eventCallBack: () => {
|
|
642
|
+
if (s(`.${id}`)) {
|
|
643
|
+
if (
|
|
644
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex] &&
|
|
645
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex + 1]
|
|
646
|
+
) {
|
|
647
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.remove(
|
|
648
|
+
`main-btn-menu-active`,
|
|
649
|
+
);
|
|
650
|
+
currentKeyBoardSearchBoxIndex++;
|
|
651
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.add(
|
|
652
|
+
`main-btn-menu-active`,
|
|
653
|
+
);
|
|
654
|
+
} else {
|
|
655
|
+
if (s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex])
|
|
656
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.remove(
|
|
657
|
+
`main-btn-menu-active`,
|
|
658
|
+
);
|
|
659
|
+
currentKeyBoardSearchBoxIndex = 0;
|
|
660
|
+
if (s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex])
|
|
661
|
+
s(`.html-${searchBoxHistoryId}`).childNodes[currentKeyBoardSearchBoxIndex].classList.add(
|
|
662
|
+
`main-btn-menu-active`,
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
updateSearchBoxValue();
|
|
666
|
+
}
|
|
667
|
+
},
|
|
668
|
+
timePressDelay,
|
|
669
|
+
});
|
|
670
|
+
|
|
671
|
+
s(`.top-bar-search-box-container`).onsubmit = (e) => {
|
|
672
|
+
e.preventDefault();
|
|
673
|
+
setSearchValue();
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
setTimeout(async () => {
|
|
677
|
+
// clone and change position
|
|
678
|
+
|
|
679
|
+
// s(`.btn-close-${idModal}`);
|
|
680
|
+
// s(`.btn-menu-${idModal}`);
|
|
681
|
+
if (originHeightBottomBar === 0) {
|
|
682
|
+
const btnCloseNode = s(`.btn-close-${idModal}`).cloneNode(true);
|
|
683
|
+
s(`.btn-close-${idModal}`).remove();
|
|
684
|
+
s(`.top-bar`).appendChild(btnCloseNode);
|
|
685
|
+
s(`.btn-close-${idModal}`).onclick = btnCloseEvent;
|
|
686
|
+
|
|
687
|
+
const btnMenuNode = s(`.btn-menu-${idModal}`).cloneNode(true);
|
|
688
|
+
s(`.btn-menu-${idModal}`).remove();
|
|
689
|
+
s(`.top-bar`).appendChild(btnMenuNode);
|
|
690
|
+
s(`.btn-menu-${idModal}`).onclick = btnMenuEvent;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
// const titleNode = s(`.title-modal-${idModal}`).cloneNode(true);
|
|
694
|
+
// s(`.title-modal-${idModal}`).remove();
|
|
695
|
+
// s(`.top-bar`).appendChild(titleNode);
|
|
696
|
+
|
|
697
|
+
s(`.slide-menu-top-bar`).style.zIndex = 7;
|
|
698
|
+
|
|
699
|
+
// s('body').removeChild(`.${idModal}`);
|
|
700
|
+
// while (s(`.top-modal`).firstChild) s(`.top-modal`).removeChild(s(`.top-modal`).firstChild);
|
|
701
|
+
|
|
702
|
+
{
|
|
703
|
+
const { barConfig } = await Themes[Css.currentTheme]();
|
|
704
|
+
barConfig.buttons.maximize.disabled = true;
|
|
705
|
+
barConfig.buttons.minimize.disabled = true;
|
|
706
|
+
barConfig.buttons.restore.disabled = true;
|
|
707
|
+
barConfig.buttons.menu.disabled = true;
|
|
708
|
+
barConfig.buttons.close.disabled = true;
|
|
709
|
+
const id = 'main-body';
|
|
710
|
+
await Modal.Render({
|
|
711
|
+
id,
|
|
712
|
+
barConfig,
|
|
713
|
+
html: options.htmlMainBody ? options.htmlMainBody : () => html``,
|
|
714
|
+
titleClass: 'hide',
|
|
715
|
+
style: {
|
|
716
|
+
// overflow: 'hidden',
|
|
717
|
+
background: 'none',
|
|
718
|
+
resize: 'none',
|
|
719
|
+
'min-width': `${minWidth}px`,
|
|
720
|
+
width: '100%',
|
|
721
|
+
// border: '3px solid red',
|
|
722
|
+
},
|
|
723
|
+
dragDisabled: true,
|
|
724
|
+
maximize: true,
|
|
725
|
+
slideMenu: 'modal-menu',
|
|
726
|
+
heightTopBar: originHeightTopBar,
|
|
727
|
+
heightBottomBar: originHeightBottomBar,
|
|
728
|
+
barMode: options.barMode,
|
|
729
|
+
});
|
|
730
|
+
const maxWidthInputSearchBox = 450;
|
|
731
|
+
const paddingInputSearchBox = 5;
|
|
732
|
+
const paddingRightSearchBox = 50;
|
|
733
|
+
Responsive.Event[`view-${id}`] = () => {
|
|
734
|
+
if (!this.Data[id] || !s(`.${id}`)) return delete Responsive.Event[`view-${id}`];
|
|
735
|
+
const widthInputSearchBox =
|
|
736
|
+
window.innerWidth > maxWidthInputSearchBox ? maxWidthInputSearchBox : window.innerWidth;
|
|
737
|
+
s(`.top-bar-search-box-container`).style.width = `${
|
|
738
|
+
widthInputSearchBox - originHeightTopBar - paddingRightSearchBox - 1
|
|
739
|
+
}px`;
|
|
740
|
+
s(`.top-bar-search-box`).style.width = `${
|
|
741
|
+
widthInputSearchBox -
|
|
742
|
+
originHeightTopBar * 2 -
|
|
743
|
+
paddingRightSearchBox -
|
|
744
|
+
paddingInputSearchBox * 2 /*padding input*/ -
|
|
745
|
+
10 /* right-margin */
|
|
746
|
+
}px`;
|
|
747
|
+
s(`.top-bar-search-box`).style.top = `${
|
|
748
|
+
(originHeightTopBar - s(`.top-bar-search-box`).clientHeight) / 2
|
|
749
|
+
}px`;
|
|
750
|
+
if (this.Data[id].slideMenu)
|
|
751
|
+
s(`.${id}`).style.height = `${
|
|
752
|
+
window.innerHeight -
|
|
753
|
+
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
|
|
754
|
+
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
755
|
+
}px`;
|
|
756
|
+
};
|
|
757
|
+
Responsive.Event[`view-${id}`]();
|
|
758
|
+
Keyboard.instanceMultiPressKey({
|
|
759
|
+
id: 'input-search-shortcut-k',
|
|
760
|
+
keys: [
|
|
761
|
+
['Shift', 'k'],
|
|
762
|
+
['Alt', 'k'],
|
|
763
|
+
],
|
|
764
|
+
eventCallBack: () => {
|
|
765
|
+
if (s(`.top-bar-search-box`)) {
|
|
766
|
+
s(`.top-bar-search-box`).blur();
|
|
767
|
+
s(`.top-bar-search-box`).focus();
|
|
768
|
+
s(`.top-bar-search-box`).select();
|
|
769
|
+
}
|
|
770
|
+
},
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
{
|
|
775
|
+
const { barConfig } = await Themes[Css.currentTheme]();
|
|
776
|
+
barConfig.buttons.maximize.disabled = true;
|
|
777
|
+
barConfig.buttons.minimize.disabled = true;
|
|
778
|
+
barConfig.buttons.restore.disabled = true;
|
|
779
|
+
barConfig.buttons.menu.disabled = true;
|
|
780
|
+
barConfig.buttons.close.disabled = true;
|
|
781
|
+
const id = 'bottom-bar';
|
|
782
|
+
if (options && options.homeModals && !options.homeModals.includes(id)) options.homeModals.push(id);
|
|
783
|
+
else options.homeModals = [id];
|
|
784
|
+
const html = async () => html`
|
|
785
|
+
<style>
|
|
786
|
+
.top-bar-search-box-container {
|
|
787
|
+
height: 100%;
|
|
788
|
+
overflow: hidden;
|
|
789
|
+
}
|
|
790
|
+
.bottom-bar {
|
|
791
|
+
overflow: hidden;
|
|
792
|
+
}
|
|
793
|
+
.action-bar-box {
|
|
794
|
+
margin: 0px;
|
|
795
|
+
border: none;
|
|
796
|
+
width: 50px;
|
|
797
|
+
min-height: 50px;
|
|
798
|
+
}
|
|
799
|
+
</style>
|
|
800
|
+
<div
|
|
801
|
+
class="fl ${options.barClass ? options.barClass : ''}"
|
|
802
|
+
style="height: ${originHeightBottomBar}px;"
|
|
803
|
+
>
|
|
804
|
+
${await BtnIcon.Render({
|
|
805
|
+
style: `height: 100%`,
|
|
806
|
+
class: `in fl${
|
|
807
|
+
options.mode === 'slide-menu-right' ? 'r' : 'l'
|
|
808
|
+
} main-btn-menu action-bar-box action-btn-center ${
|
|
809
|
+
options?.disableTools?.includes('center') ? 'hide' : ''
|
|
810
|
+
}`,
|
|
811
|
+
label: html`
|
|
812
|
+
<div class="${contentIconClass}">
|
|
813
|
+
<i class="far fa-square btn-bar-center-icon-square hide"></i>
|
|
814
|
+
<span class="btn-bar-center-icon-close hide">${barConfig.buttons.close.label}</span>
|
|
815
|
+
<span class="btn-bar-center-icon-menu">${barConfig.buttons.menu.label}</span>
|
|
816
|
+
</div>
|
|
817
|
+
`,
|
|
818
|
+
})}
|
|
819
|
+
${await BtnIcon.Render({
|
|
820
|
+
style: `height: 100%`,
|
|
821
|
+
class: `in flr main-btn-menu action-bar-box action-btn-lang ${
|
|
822
|
+
options?.disableTools?.includes('lang') ? 'hide' : ''
|
|
823
|
+
}`,
|
|
824
|
+
label: html` <div class="${contentIconClass} action-btn-lang-render"></div>`,
|
|
825
|
+
})}
|
|
826
|
+
${await BtnIcon.Render({
|
|
827
|
+
style: `height: 100%`,
|
|
828
|
+
class: `in flr main-btn-menu action-bar-box action-btn-theme ${
|
|
829
|
+
options?.disableTools?.includes('theme') ? 'hide' : ''
|
|
830
|
+
}`,
|
|
831
|
+
label: html` <div class="${contentIconClass} action-btn-theme-render"></div>`,
|
|
832
|
+
})}
|
|
833
|
+
${await BtnIcon.Render({
|
|
834
|
+
style: `height: 100%`,
|
|
835
|
+
class: `in flr main-btn-menu action-bar-box action-btn-home ${
|
|
836
|
+
options?.disableTools?.includes('navigator') ? 'hide' : ''
|
|
837
|
+
}`,
|
|
838
|
+
label: html` <div class="${contentIconClass}"><i class="fas fa-home"></i></div>`,
|
|
839
|
+
})}
|
|
840
|
+
${await BtnIcon.Render({
|
|
841
|
+
style: `height: 100%`,
|
|
842
|
+
class: `in flr main-btn-menu action-bar-box action-btn-right ${
|
|
843
|
+
options?.disableTools?.includes('navigator') ? 'hide' : ''
|
|
844
|
+
}`,
|
|
845
|
+
label: html` <div class="${contentIconClass}"><i class="fas fa-chevron-right"></i></div>`,
|
|
846
|
+
})}
|
|
847
|
+
${await BtnIcon.Render({
|
|
848
|
+
style: `height: 100%`,
|
|
849
|
+
class: `in flr main-btn-menu action-bar-box action-btn-left ${
|
|
850
|
+
options?.disableTools?.includes('navigator') ? 'hide' : ''
|
|
851
|
+
}`,
|
|
852
|
+
label: html`<div class="${contentIconClass}"><i class="fas fa-chevron-left"></i></div>`,
|
|
853
|
+
})}
|
|
854
|
+
</div>
|
|
855
|
+
`;
|
|
856
|
+
if (options.heightBottomBar === 0 && options.heightTopBar > 0) {
|
|
857
|
+
append(`.slide-menu-top-bar`, html` <div class="in ${id}">${await html()}</div>`);
|
|
858
|
+
} else {
|
|
859
|
+
await Modal.Render({
|
|
860
|
+
id,
|
|
861
|
+
barConfig,
|
|
862
|
+
html,
|
|
863
|
+
titleClass: 'hide',
|
|
864
|
+
style: {
|
|
865
|
+
resize: 'none',
|
|
866
|
+
height: `${options.heightBottomBar}px`,
|
|
867
|
+
'min-width': `${minWidth}px`,
|
|
868
|
+
'z-index': 7,
|
|
869
|
+
},
|
|
870
|
+
dragDisabled: true,
|
|
871
|
+
maximize: true,
|
|
872
|
+
barMode: options.barMode,
|
|
873
|
+
});
|
|
874
|
+
Responsive.Event[`view-${id}`] = () => {
|
|
875
|
+
if (!this.Data[id] || !s(`.${id}`)) return delete Responsive.Event[`view-${id}`];
|
|
876
|
+
// <div class="in fll right-offset-menu-bottom-bar" style="height: 100%"></div>
|
|
877
|
+
// s(`.right-offset-menu-bottom-bar`).style.width = `${window.innerWidth - slideMenuWidth}px`;
|
|
878
|
+
s(`.${id}`).style.top = `${
|
|
879
|
+
window.innerHeight - (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
880
|
+
}px`;
|
|
881
|
+
};
|
|
882
|
+
Responsive.Event[`view-${id}`]();
|
|
883
|
+
}
|
|
884
|
+
EventsUI.onClick(`.action-btn-left`, (e) => {
|
|
885
|
+
e.preventDefault();
|
|
886
|
+
window.history.back();
|
|
887
|
+
});
|
|
888
|
+
EventsUI.onClick(`.action-btn-center`, (e) => {
|
|
889
|
+
e.preventDefault();
|
|
890
|
+
this.actionBtnCenter();
|
|
891
|
+
});
|
|
892
|
+
EventsUI.onClick(`.action-btn-right`, (e) => {
|
|
893
|
+
e.preventDefault();
|
|
894
|
+
window.history.forward();
|
|
895
|
+
});
|
|
896
|
+
EventsUI.onClick(`.action-btn-home`, () => s(`.main-btn-home`).click());
|
|
897
|
+
EventsUI.onClick(`.action-btn-app-icon`, () => s(`.action-btn-home`).click());
|
|
898
|
+
Keyboard.instanceMultiPressKey({
|
|
899
|
+
id: 'input-shortcut-global-escape',
|
|
900
|
+
keys: ['Escape'],
|
|
901
|
+
eventCallBack: () => {
|
|
902
|
+
// if (s(`.main-btn-home`)) s(`.main-btn-home`).click();
|
|
903
|
+
|
|
904
|
+
if (s(`.btn-close-${this.currentTopModalId}`)) s(`.btn-close-${this.currentTopModalId}`).click();
|
|
905
|
+
},
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
{
|
|
910
|
+
ThemeEvents['action-btn-theme'] = () => {
|
|
911
|
+
htmls(
|
|
912
|
+
`.action-btn-theme-render`,
|
|
913
|
+
html` ${darkTheme ? html` <i class="fas fa-moon"></i>` : html`<i class="far fa-sun"></i>`}`,
|
|
914
|
+
);
|
|
915
|
+
};
|
|
916
|
+
ThemeEvents['action-btn-theme']();
|
|
917
|
+
|
|
918
|
+
EventsUI.onClick(`.action-btn-theme`, async () => {
|
|
919
|
+
const themePair = ThemesScope.find((t) => t.theme === Css.currentTheme).themePair;
|
|
920
|
+
const theme = themePair ? themePair : ThemesScope.find((t) => t.dark === !darkTheme).theme;
|
|
921
|
+
if (s(`.dropdown-option-${theme}`))
|
|
922
|
+
DropDown.Tokens['settings-theme'].onClickEvents[`dropdown-option-${theme}`]();
|
|
923
|
+
else await Themes[theme]();
|
|
924
|
+
});
|
|
925
|
+
if (!(ThemesScope.find((t) => t.dark) && ThemesScope.find((t) => !t.dark))) {
|
|
926
|
+
s(`.action-btn-theme`).classList.add('hide');
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
{
|
|
931
|
+
htmls(`.action-btn-lang-render`, html` ${s('html').lang}`);
|
|
932
|
+
EventsUI.onClick(`.action-btn-lang`, () => {
|
|
933
|
+
let lang = 'en';
|
|
934
|
+
if (s('html').lang === 'en') lang = 'es';
|
|
935
|
+
if (s(`.dropdown-option-${lang}`))
|
|
936
|
+
DropDown.Tokens['settings-lang'].onClickEvents[`dropdown-option-${lang}`]();
|
|
937
|
+
else Translate.renderLang(lang);
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
{
|
|
942
|
+
const { barConfig } = await Themes[Css.currentTheme]();
|
|
943
|
+
barConfig.buttons.maximize.disabled = true;
|
|
944
|
+
barConfig.buttons.minimize.disabled = true;
|
|
945
|
+
barConfig.buttons.restore.disabled = true;
|
|
946
|
+
barConfig.buttons.menu.disabled = true;
|
|
947
|
+
barConfig.buttons.close.disabled = true;
|
|
948
|
+
const id = 'main-body-top';
|
|
949
|
+
await Modal.Render({
|
|
950
|
+
id,
|
|
951
|
+
barConfig,
|
|
952
|
+
html: () => html``,
|
|
953
|
+
titleClass: 'hide',
|
|
954
|
+
class: 'hide',
|
|
955
|
+
style: {
|
|
956
|
+
// overflow: 'hidden',
|
|
957
|
+
background: 'none',
|
|
958
|
+
resize: 'none',
|
|
959
|
+
'min-width': `${minWidth}px`,
|
|
960
|
+
'z-index': 5,
|
|
961
|
+
background: `rgba(61, 61, 61, 0.5)`,
|
|
962
|
+
// border: '3px solid red',
|
|
963
|
+
},
|
|
964
|
+
dragDisabled: true,
|
|
965
|
+
maximize: true,
|
|
966
|
+
heightTopBar: originHeightTopBar,
|
|
967
|
+
heightBottomBar: originHeightBottomBar,
|
|
968
|
+
barMode: options.barMode,
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
Responsive.Event[`view-${id}`] = () => {
|
|
972
|
+
if (!this.Data[id] || !s(`.${id}`)) return delete Responsive.Event[`view-${id}`];
|
|
973
|
+
s(`.${id}`).style.height = `${
|
|
974
|
+
window.innerHeight -
|
|
975
|
+
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
|
|
976
|
+
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
977
|
+
}px`;
|
|
978
|
+
};
|
|
979
|
+
Responsive.Event[`view-${id}`]();
|
|
980
|
+
|
|
981
|
+
s(`.main-body-top`).onclick = () => s(`.btn-close-modal-menu`).click();
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
await NotificationManager.RenderBoard(options);
|
|
985
|
+
});
|
|
986
|
+
})();
|
|
987
|
+
break;
|
|
988
|
+
|
|
989
|
+
case 'dropNotification':
|
|
990
|
+
(() => {
|
|
991
|
+
setTimeout(() => {
|
|
992
|
+
s(`.${idModal}`).style.top = 'auto';
|
|
993
|
+
s(`.${idModal}`).style.left = 'auto';
|
|
994
|
+
s(`.${idModal}`).style.height = 'auto';
|
|
995
|
+
s(`.${idModal}`).style.position = 'absolute';
|
|
996
|
+
let countDrop = 0;
|
|
997
|
+
Object.keys(this.Data)
|
|
998
|
+
.reverse()
|
|
999
|
+
.map((_idModal) => {
|
|
1000
|
+
if (this.Data[_idModal][options.mode]) {
|
|
1001
|
+
s(`.${_idModal}`).style.bottom = `${countDrop * s(`.${_idModal}`).clientHeight * 1.05}px`;
|
|
1002
|
+
countDrop++;
|
|
1003
|
+
}
|
|
1004
|
+
});
|
|
1005
|
+
});
|
|
1006
|
+
})();
|
|
1007
|
+
break;
|
|
1008
|
+
|
|
1009
|
+
default:
|
|
1010
|
+
break;
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
if (options.zIndexSync) this.zIndexSync({ idModal });
|
|
1014
|
+
if (s(`.${idModal}`)) {
|
|
1015
|
+
s(`.btn-maximize-${idModal}`).click();
|
|
1016
|
+
return;
|
|
1017
|
+
}
|
|
1018
|
+
if (options.slideMenu) {
|
|
1019
|
+
if (options.titleClass) options.titleClass = ' title-view-modal ' + options.titleClass;
|
|
1020
|
+
options.titleClass = ' title-view-modal ';
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
const render = html` <style class="style-${idModal}">
|
|
1024
|
+
.${idModal} {
|
|
1025
|
+
width: ${width}px;
|
|
1026
|
+
height: ${height}px;
|
|
1027
|
+
top: ${top};
|
|
1028
|
+
left: ${left};
|
|
1029
|
+
overflow: auto; /* resizable required */
|
|
1030
|
+
resize: auto; /* resizable required */
|
|
1031
|
+
transition: ${transition};
|
|
1032
|
+
opacity: 0;
|
|
1033
|
+
z-index: 1;
|
|
1034
|
+
}
|
|
1035
|
+
.bar-default-modal-${idModal} {
|
|
1036
|
+
top: 0px;
|
|
1037
|
+
left: 0px;
|
|
1038
|
+
z-index: 3;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
.modal-html-${idModal} {
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
.btn-modal-default-${idModal} {
|
|
1045
|
+
}
|
|
1046
|
+
.modal-handle-${idModal} {
|
|
1047
|
+
width: 90%;
|
|
1048
|
+
height: 90%;
|
|
1049
|
+
top: 5%;
|
|
1050
|
+
left: 5%;
|
|
1051
|
+
}
|
|
1052
|
+
</style>
|
|
1053
|
+
${renderStyleTag(`style-${idModal}`, `.${idModal}`, options)}
|
|
1054
|
+
<div class="fix ${options && options.class ? options.class : ''} modal box-shadow ${idModal}">
|
|
1055
|
+
<div class="abs modal-handle-${idModal}"></div>
|
|
1056
|
+
<div class="in modal-html-${idModal}">
|
|
1057
|
+
<div class="stq bar-default-modal bar-default-modal-${idModal}">
|
|
1058
|
+
<div
|
|
1059
|
+
class="fl btn-bar-modal-container btn-bar-modal-container-${idModal} ${options?.btnBarModalClass
|
|
1060
|
+
? options.btnBarModalClass
|
|
1061
|
+
: ''}"
|
|
1062
|
+
>
|
|
1063
|
+
<div class="btn-bar-modal-container-render-${idModal}"></div>
|
|
1064
|
+
<div class="in flr bar-default-modal" style="z-index: 1">
|
|
1065
|
+
${await BtnIcon.Render({
|
|
1066
|
+
class: `btn-minimize-${idModal} btn-modal-default btn-modal-default-${idModal} ${
|
|
1067
|
+
options?.btnContainerClass ? options.btnContainerClass : ''
|
|
1068
|
+
} ${options?.barConfig?.buttons?.minimize?.disabled ? 'hide' : ''}`,
|
|
1069
|
+
label: html`<div class="${options?.btnIconContainerClass ? options.btnIconContainerClass : ''}">
|
|
1070
|
+
${options?.barConfig?.buttons?.minimize?.label ? options.barConfig.buttons.minimize.label : html`_`}
|
|
1071
|
+
</div>`,
|
|
1072
|
+
})}
|
|
1073
|
+
${await BtnIcon.Render({
|
|
1074
|
+
class: `btn-restore-${idModal} btn-modal-default btn-modal-default-${idModal} ${
|
|
1075
|
+
options?.btnContainerClass ? options.btnContainerClass : ''
|
|
1076
|
+
} ${options?.barConfig?.buttons?.restore?.disabled ? 'hide' : ''}`,
|
|
1077
|
+
label: html`<div class="${options?.btnIconContainerClass ? options.btnIconContainerClass : ''}">
|
|
1078
|
+
${options?.barConfig?.buttons?.restore?.label ? options.barConfig.buttons.restore.label : html`□`}
|
|
1079
|
+
</div>`,
|
|
1080
|
+
style: 'display: none',
|
|
1081
|
+
})}
|
|
1082
|
+
${await BtnIcon.Render({
|
|
1083
|
+
class: `btn-maximize-${idModal} btn-modal-default btn-modal-default-${idModal} ${
|
|
1084
|
+
options?.btnContainerClass ? options.btnContainerClass : ''
|
|
1085
|
+
} ${options?.barConfig?.buttons?.maximize?.disabled ? 'hide' : ''}`,
|
|
1086
|
+
label: html`<div class="${options?.btnIconContainerClass ? options.btnIconContainerClass : ''}">
|
|
1087
|
+
${options?.barConfig?.buttons?.maximize?.label ? options.barConfig.buttons.maximize.label : html`▢`}
|
|
1088
|
+
</div>`,
|
|
1089
|
+
})}
|
|
1090
|
+
${await BtnIcon.Render({
|
|
1091
|
+
class: `btn-close-${idModal} btn-modal-default btn-modal-default-${idModal} ${
|
|
1092
|
+
options?.btnContainerClass ? options.btnContainerClass : ''
|
|
1093
|
+
} ${options?.barConfig?.buttons?.close?.disabled ? 'hide' : ''}`,
|
|
1094
|
+
label: html`<div class="${options?.btnIconContainerClass ? options.btnIconContainerClass : ''}">
|
|
1095
|
+
${options?.barConfig?.buttons?.close?.label ? options.barConfig.buttons.close.label : html`X`}
|
|
1096
|
+
</div>`,
|
|
1097
|
+
})}
|
|
1098
|
+
${await BtnIcon.Render({
|
|
1099
|
+
class: `btn-menu-${idModal} btn-modal-default btn-modal-default-${idModal} ${
|
|
1100
|
+
options?.btnContainerClass ? options.btnContainerClass : ''
|
|
1101
|
+
} ${options?.barConfig?.buttons?.menu?.disabled ? 'hide' : ''}`,
|
|
1102
|
+
label: html`<div class="${options?.btnIconContainerClass ? options.btnIconContainerClass : ''}">
|
|
1103
|
+
${options?.barConfig?.buttons?.menu?.label ? options.barConfig.buttons.menu.label : html`≡`}
|
|
1104
|
+
</div>`,
|
|
1105
|
+
})}
|
|
1106
|
+
</div>
|
|
1107
|
+
</div>
|
|
1108
|
+
${options && options.status
|
|
1109
|
+
? html` <div class="abs modal-icon-container">${renderStatus(options.status)}</div> `
|
|
1110
|
+
: ''}
|
|
1111
|
+
<div
|
|
1112
|
+
class="inl title-modal-${idModal} ${options && options.titleClass ? options.titleClass : 'title-modal'}"
|
|
1113
|
+
>
|
|
1114
|
+
${options && options.titleRender ? options.titleRender() : options.title ? options.title : ''}
|
|
1115
|
+
</div>
|
|
1116
|
+
</div>
|
|
1117
|
+
|
|
1118
|
+
<div class="in html-${idModal}">
|
|
1119
|
+
${options.mode && options.mode.match('slide-menu')
|
|
1120
|
+
? html`<div class="in" style="${renderCssAttr({ style: { height: '50px' } })}">
|
|
1121
|
+
${await BtnIcon.Render({
|
|
1122
|
+
style: renderCssAttr({ style: { height: '100%', color: '#5f5f5f' } }),
|
|
1123
|
+
class: `in flr main-btn-menu action-bar-box btn-icon-menu-mode`,
|
|
1124
|
+
label: html` <div class="abs center">
|
|
1125
|
+
<i
|
|
1126
|
+
class="fas fa-caret-right btn-icon-menu-mode-right ${options.mode && options.mode.match('right')
|
|
1127
|
+
? ''
|
|
1128
|
+
: 'hide'}"
|
|
1129
|
+
></i
|
|
1130
|
+
><i
|
|
1131
|
+
class="fas fa-caret-left btn-icon-menu-mode-left ${options.mode && options.mode.match('right')
|
|
1132
|
+
? 'hide'
|
|
1133
|
+
: ''}"
|
|
1134
|
+
></i>
|
|
1135
|
+
</div>`,
|
|
1136
|
+
})}
|
|
1137
|
+
</div>`
|
|
1138
|
+
: ''}
|
|
1139
|
+
${options && options.html ? (typeof options.html === 'function' ? await options.html() : options.html) : ''}
|
|
1140
|
+
</div>
|
|
1141
|
+
</div>
|
|
1142
|
+
</div>`;
|
|
1143
|
+
const selector = options && options.selector ? options.selector : 'body';
|
|
1144
|
+
if (options) {
|
|
1145
|
+
switch (options.renderType) {
|
|
1146
|
+
case 'prepend':
|
|
1147
|
+
prepend(selector, render);
|
|
1148
|
+
break;
|
|
1149
|
+
default:
|
|
1150
|
+
append(selector, render);
|
|
1151
|
+
break;
|
|
1152
|
+
}
|
|
1153
|
+
} else append(selector, render);
|
|
1154
|
+
let handle = [s(`.bar-default-modal-${idModal}`), s(`.modal-handle-${idModal}`), s(`.modal-html-${idModal}`)];
|
|
1155
|
+
if (options && 'handleType' in options) {
|
|
1156
|
+
switch (options.handleType) {
|
|
1157
|
+
case 'bar':
|
|
1158
|
+
handle = [s(`.bar-default-modal-${idModal}`)];
|
|
1159
|
+
|
|
1160
|
+
break;
|
|
1161
|
+
|
|
1162
|
+
default:
|
|
1163
|
+
break;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
switch (options.mode) {
|
|
1167
|
+
case 'slide-menu':
|
|
1168
|
+
case 'slide-menu-right':
|
|
1169
|
+
case 'slide-menu-left':
|
|
1170
|
+
s(`.main-btn-home`).onclick = () => {
|
|
1171
|
+
for (const keyModal of Object.keys(this.Data)) {
|
|
1172
|
+
if (
|
|
1173
|
+
![idModal, 'main-body-top', 'main-body']
|
|
1174
|
+
.concat(options?.homeModals ? options.homeModals : [])
|
|
1175
|
+
.includes(keyModal)
|
|
1176
|
+
)
|
|
1177
|
+
s(`.btn-close-${keyModal}`).click();
|
|
1178
|
+
}
|
|
1179
|
+
s(`.btn-close-modal-menu`).click();
|
|
1180
|
+
};
|
|
1181
|
+
EventsUI.onClick(`.btn-icon-menu-mode`, () => {
|
|
1182
|
+
if (s(`.btn-icon-menu-mode-right`).classList.contains('hide')) {
|
|
1183
|
+
s(`.btn-icon-menu-mode-right`).classList.remove('hide');
|
|
1184
|
+
s(`.btn-icon-menu-mode-left`).classList.add('hide');
|
|
1185
|
+
} else {
|
|
1186
|
+
s(`.btn-icon-menu-mode-left`).classList.remove('hide');
|
|
1187
|
+
s(`.btn-icon-menu-mode-right`).classList.add('hide');
|
|
1188
|
+
}
|
|
1189
|
+
if (slideMenuWidth === originSlideMenuWidth) {
|
|
1190
|
+
slideMenuWidth = collapseSlideMenuWidth;
|
|
1191
|
+
if (!s(`.btn-bar-center-icon-close`).classList.contains('hide')) {
|
|
1192
|
+
sa(`.handle-btn-container`).forEach((el) => el.classList.add('hide'));
|
|
1193
|
+
sa(`.menu-label-text`).forEach((el) => el.classList.add('hide'));
|
|
1194
|
+
if (!Modal.mobileModal()) {
|
|
1195
|
+
sa(`.tooltip-menu`).forEach((el) => el.classList.remove('hide'));
|
|
1196
|
+
s(`.${idModal}`).style.overflow = 'visible';
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
if (options.onCollapseMenu) options.onCollapseMenu();
|
|
1200
|
+
} else {
|
|
1201
|
+
slideMenuWidth = originSlideMenuWidth;
|
|
1202
|
+
sa(`.handle-btn-container`).forEach((el) => el.classList.remove('hide'));
|
|
1203
|
+
sa(`.menu-label-text`).forEach((el) => el.classList.remove('hide'));
|
|
1204
|
+
if (!Modal.mobileModal()) {
|
|
1205
|
+
sa(`.tooltip-menu`).forEach((el) => el.classList.add('hide'));
|
|
1206
|
+
s(`.${idModal}`).style.overflow = null;
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
if (options.onExtendMenu) options.onExtendMenu();
|
|
1210
|
+
}
|
|
1211
|
+
// btn-bar-center-icon-menu
|
|
1212
|
+
this.actionBtnCenter();
|
|
1213
|
+
this.actionBtnCenter();
|
|
1214
|
+
});
|
|
1215
|
+
|
|
1216
|
+
break;
|
|
1217
|
+
|
|
1218
|
+
default:
|
|
1219
|
+
break;
|
|
1220
|
+
}
|
|
1221
|
+
let dragOptions = {
|
|
1222
|
+
// disabled: true,
|
|
1223
|
+
handle,
|
|
1224
|
+
onDragStart: (data) => {
|
|
1225
|
+
if (!s(`.${idModal}`)) return;
|
|
1226
|
+
// logger.info('Dragging started', data);
|
|
1227
|
+
s(`.${idModal}`).style.transition = null;
|
|
1228
|
+
},
|
|
1229
|
+
onDrag: (data) => {
|
|
1230
|
+
if (!s(`.${idModal}`)) return;
|
|
1231
|
+
// logger.info('Dragging', data);
|
|
1232
|
+
},
|
|
1233
|
+
onDragEnd: (data) => {
|
|
1234
|
+
if (!s(`.${idModal}`)) return;
|
|
1235
|
+
// logger.info('Dragging stopped', data);
|
|
1236
|
+
s(`.${idModal}`).style.transition = transition;
|
|
1237
|
+
Object.keys(this.Data[idModal].onDragEndListener).map((keyListener) =>
|
|
1238
|
+
this.Data[idModal].onDragEndListener[keyListener](),
|
|
1239
|
+
);
|
|
1240
|
+
},
|
|
1241
|
+
};
|
|
1242
|
+
let dragInstance;
|
|
1243
|
+
// new Draggable(s(`.${idModal}`), { disabled: true });
|
|
1244
|
+
const setDragInstance = () => (options?.dragDisabled ? null : new Draggable(s(`.${idModal}`), dragOptions));
|
|
1245
|
+
this.Data[idModal].setDragInstance = (updateDragOptions) => {
|
|
1246
|
+
dragOptions = {
|
|
1247
|
+
...dragOptions,
|
|
1248
|
+
...updateDragOptions,
|
|
1249
|
+
};
|
|
1250
|
+
dragInstance = setDragInstance();
|
|
1251
|
+
this.Data[idModal].dragInstance = dragInstance;
|
|
1252
|
+
this.Data[idModal].dragOptions = dragOptions;
|
|
1253
|
+
};
|
|
1254
|
+
s(`.${idModal}`).style.transition = '0.15s';
|
|
1255
|
+
setTimeout(() => (s(`.${idModal}`).style.opacity = '1'));
|
|
1256
|
+
setTimeout(() => (s(`.${idModal}`).style.transition = transition), 150);
|
|
1257
|
+
|
|
1258
|
+
const btnCloseEvent = () => {
|
|
1259
|
+
Object.keys(this.Data[idModal].onCloseListener).map((keyListener) =>
|
|
1260
|
+
this.Data[idModal].onCloseListener[keyListener](),
|
|
1261
|
+
);
|
|
1262
|
+
if (options && 'barConfig' in options && options.barConfig.buttons.close.onClick)
|
|
1263
|
+
return options.barConfig.buttons.close.onClick();
|
|
1264
|
+
s(`.${idModal}`).style.opacity = '0';
|
|
1265
|
+
if (this.Data[idModal].observer) {
|
|
1266
|
+
this.Data[idModal].observer.disconnect();
|
|
1267
|
+
// this.Data[idModal].observer.unobserve();
|
|
1268
|
+
}
|
|
1269
|
+
setTimeout(() => {
|
|
1270
|
+
if (!s(`.${idModal}`)) return;
|
|
1271
|
+
this.removeModal(idModal);
|
|
1272
|
+
// Router
|
|
1273
|
+
if (options.route)
|
|
1274
|
+
(() => {
|
|
1275
|
+
let path = window.location.pathname;
|
|
1276
|
+
if (path[path.length - 1] !== '/') path = `${path}/`;
|
|
1277
|
+
let newPath = `${getProxyPath()}`;
|
|
1278
|
+
if (path !== newPath) {
|
|
1279
|
+
for (const subIdModal of Object.keys(this.Data).reverse()) {
|
|
1280
|
+
if (this.Data[subIdModal].options.route) {
|
|
1281
|
+
newPath = `${newPath}${this.Data[subIdModal].options.route}`;
|
|
1282
|
+
// console.warn('SET MODAL URI', newPath);
|
|
1283
|
+
setPath(newPath);
|
|
1284
|
+
this.setTopModalCallback(subIdModal);
|
|
1285
|
+
return setDocTitle({ ...options.RouterInstance, route: this.Data[subIdModal].options.route });
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
// console.warn('SET MODAL URI', newPath);
|
|
1289
|
+
setPath(`${newPath}${Modal.homeCid ? `?cid=${Modal.homeCid}` : ''}`);
|
|
1290
|
+
return setDocTitle({ ...options.RouterInstance, route: '' });
|
|
1291
|
+
}
|
|
1292
|
+
})();
|
|
1293
|
+
}, 300);
|
|
1294
|
+
};
|
|
1295
|
+
s(`.btn-close-${idModal}`).onclick = btnCloseEvent;
|
|
1296
|
+
|
|
1297
|
+
s(`.btn-minimize-${idModal}`).onclick = () => {
|
|
1298
|
+
if (options.slideMenu) delete this.Data[idModal].slideMenu;
|
|
1299
|
+
s(`.${idModal}`).style.transition = '0.3s';
|
|
1300
|
+
s(`.btn-minimize-${idModal}`).style.display = 'none';
|
|
1301
|
+
s(`.btn-maximize-${idModal}`).style.display = null;
|
|
1302
|
+
s(`.btn-restore-${idModal}`).style.display = null;
|
|
1303
|
+
s(`.${idModal}`).style.height = `${s(`.bar-default-modal-${idModal}`).clientHeight}px`;
|
|
1304
|
+
setTimeout(() => (s(`.${idModal}`).style.transition = transition), 300);
|
|
1305
|
+
};
|
|
1306
|
+
s(`.btn-restore-${idModal}`).onclick = () => {
|
|
1307
|
+
if (options.slideMenu) delete this.Data[idModal].slideMenu;
|
|
1308
|
+
s(`.${idModal}`).style.transition = '0.3s';
|
|
1309
|
+
s(`.btn-restore-${idModal}`).style.display = 'none';
|
|
1310
|
+
s(`.btn-minimize-${idModal}`).style.display = null;
|
|
1311
|
+
s(`.btn-maximize-${idModal}`).style.display = null;
|
|
1312
|
+
s(`.${idModal}`).style.transform = null;
|
|
1313
|
+
s(`.${idModal}`).style.height = null;
|
|
1314
|
+
s(`.${idModal}`).style.width = null;
|
|
1315
|
+
setCenterRestore();
|
|
1316
|
+
s(`.${idModal}`).style.top = top;
|
|
1317
|
+
s(`.${idModal}`).style.left = left;
|
|
1318
|
+
dragInstance = setDragInstance();
|
|
1319
|
+
setTimeout(() => (s(`.${idModal}`).style.transition = transition), 300);
|
|
1320
|
+
};
|
|
1321
|
+
s(`.btn-maximize-${idModal}`).onclick = () => {
|
|
1322
|
+
s(`.${idModal}`).style.transition = '0.3s';
|
|
1323
|
+
setTimeout(() => (s(`.${idModal}`).style.transition = transition), 300);
|
|
1324
|
+
s(`.btn-maximize-${idModal}`).style.display = 'none';
|
|
1325
|
+
s(`.btn-restore-${idModal}`).style.display = null;
|
|
1326
|
+
s(`.btn-minimize-${idModal}`).style.display = null;
|
|
1327
|
+
s(`.${idModal}`).style.transform = null;
|
|
1328
|
+
|
|
1329
|
+
if (options.slideMenu) {
|
|
1330
|
+
const idSlide = this.Data[options.slideMenu]['slide-menu']
|
|
1331
|
+
? 'slide-menu'
|
|
1332
|
+
: this.Data[options.slideMenu]['slide-menu-right']
|
|
1333
|
+
? 'slide-menu-right'
|
|
1334
|
+
: 'slide-menu-left';
|
|
1335
|
+
const callBack = () => {
|
|
1336
|
+
s(`.${idModal}`).style.transition = '0.3s';
|
|
1337
|
+
s(`.${idModal}`).style.width = `${window.innerWidth - this.Data[options.slideMenu][idSlide].width}px`;
|
|
1338
|
+
s(`.${idModal}`).style.left =
|
|
1339
|
+
idSlide === 'slide-menu-right' ? `0px` : `${this.Data[options.slideMenu][idSlide].width}px`;
|
|
1340
|
+
setTimeout(() => (s(`.${idModal}`) ? (s(`.${idModal}`).style.transition = transition) : null), 300);
|
|
1341
|
+
};
|
|
1342
|
+
|
|
1343
|
+
callBack();
|
|
1344
|
+
this.Data[idModal].slideMenu = {
|
|
1345
|
+
callBack,
|
|
1346
|
+
id: options.slideMenu,
|
|
1347
|
+
};
|
|
1348
|
+
s(`.${idModal}`).style.height = `${
|
|
1349
|
+
window.innerHeight -
|
|
1350
|
+
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
|
|
1351
|
+
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
1352
|
+
}px`;
|
|
1353
|
+
s(`.${idModal}`).style.top = `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
|
|
1354
|
+
} else {
|
|
1355
|
+
s(`.${idModal}`).style.width = '100%';
|
|
1356
|
+
s(`.${idModal}`).style.height = '100%';
|
|
1357
|
+
s(`.${idModal}`).style.top = `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
|
|
1358
|
+
s(`.${idModal}`).style.left = `0px`;
|
|
1359
|
+
}
|
|
1360
|
+
dragInstance = setDragInstance();
|
|
1361
|
+
};
|
|
1362
|
+
|
|
1363
|
+
const btnMenuEvent = () => {
|
|
1364
|
+
Object.keys(this.Data[idModal].onMenuListener).map((keyListener) =>
|
|
1365
|
+
this.Data[idModal].onMenuListener[keyListener](),
|
|
1366
|
+
);
|
|
1367
|
+
if (options && 'barConfig' in options && options.barConfig.buttons.menu.onClick)
|
|
1368
|
+
return options.barConfig.buttons.menu.onClick();
|
|
1369
|
+
};
|
|
1370
|
+
s(`.btn-menu-${idModal}`).onclick = btnMenuEvent;
|
|
1371
|
+
|
|
1372
|
+
dragInstance = setDragInstance();
|
|
1373
|
+
if (options && options.maximize) s(`.btn-maximize-${idModal}`).click();
|
|
1374
|
+
if (options.observer) {
|
|
1375
|
+
this.Data[idModal].onObserverListener = {};
|
|
1376
|
+
this.Data[idModal].observerCallBack = () => {
|
|
1377
|
+
// logger.info('ResizeObserver', `.${idModal}`, s(`.${idModal}`).offsetWidth, s(`.${idModal}`).offsetHeight);
|
|
1378
|
+
if (this.Data[idModal] && this.Data[idModal].onObserverListener)
|
|
1379
|
+
Object.keys(this.Data[idModal].onObserverListener).map((eventKey) =>
|
|
1380
|
+
this.Data[idModal].onObserverListener[eventKey]({
|
|
1381
|
+
width: s(`.${idModal}`).offsetWidth,
|
|
1382
|
+
height: s(`.${idModal}`).offsetHeight,
|
|
1383
|
+
}),
|
|
1384
|
+
);
|
|
1385
|
+
else console.warn('observer not found', idModal);
|
|
1386
|
+
};
|
|
1387
|
+
this.Data[idModal].observer = new ResizeObserver(this.Data[idModal].observerCallBack);
|
|
1388
|
+
this.Data[idModal].observer.observe(s(`.${idModal}`));
|
|
1389
|
+
setTimeout(this.Data[idModal].observerCallBack);
|
|
1390
|
+
}
|
|
1391
|
+
// cancel: [cancel1, cancel2]
|
|
1392
|
+
s(`.${idModal}`).onclick = () => {
|
|
1393
|
+
this.Data[idModal]?.onClickListener
|
|
1394
|
+
? Object.keys(this.Data[idModal].onClickListener).map((keyListener) =>
|
|
1395
|
+
this.Data[idModal].onClickListener[keyListener](),
|
|
1396
|
+
)
|
|
1397
|
+
: null;
|
|
1398
|
+
};
|
|
1399
|
+
return {
|
|
1400
|
+
id: idModal,
|
|
1401
|
+
...this.Data[idModal],
|
|
1402
|
+
};
|
|
1403
|
+
},
|
|
1404
|
+
currentTopModalId: '',
|
|
1405
|
+
zIndexSync: function ({ idModal }) {
|
|
1406
|
+
setTimeout(() => {
|
|
1407
|
+
const cleanTopModal = () => {
|
|
1408
|
+
Object.keys(this.Data).map((_idModal) => {
|
|
1409
|
+
if (this.Data[_idModal].options.zIndexSync && s(`.${_idModal}`)) s(`.${_idModal}`).style.zIndex = '3';
|
|
1410
|
+
});
|
|
1411
|
+
};
|
|
1412
|
+
const setTopModal = () => {
|
|
1413
|
+
if (s(`.${idModal}`)) {
|
|
1414
|
+
this.setTopModalCallback(idModal);
|
|
1415
|
+
} else setTimeout(setTopModal, 100);
|
|
1416
|
+
};
|
|
1417
|
+
cleanTopModal();
|
|
1418
|
+
setTopModal();
|
|
1419
|
+
this.Data[idModal].onClickListener[`${idModal}-z-index`] = () => {
|
|
1420
|
+
if (s(`.${idModal}`) && s(`.${idModal}`).style.zIndex === '3') {
|
|
1421
|
+
if (this.Data[idModal].options.route) setPath(`${getProxyPath()}${this.Data[idModal].options.route}`);
|
|
1422
|
+
cleanTopModal();
|
|
1423
|
+
setTopModal();
|
|
1424
|
+
}
|
|
1425
|
+
};
|
|
1426
|
+
});
|
|
1427
|
+
},
|
|
1428
|
+
setTopModalCallback: function (idModal) {
|
|
1429
|
+
s(`.${idModal}`).style.zIndex = '4';
|
|
1430
|
+
this.currentTopModalId = `${idModal}`;
|
|
1431
|
+
if (
|
|
1432
|
+
this.Data[idModal].query &&
|
|
1433
|
+
`${location.pathname}${window.location.search}` !== `${location.pathname}${this.Data[idModal].query}`
|
|
1434
|
+
)
|
|
1435
|
+
setPath(`${location.pathname}${this.Data[idModal].query}`);
|
|
1436
|
+
},
|
|
1437
|
+
mobileModal: () => window.innerWidth < 600 || window.innerHeight < 600,
|
|
1438
|
+
writeHTML: ({ idModal, html }) => htmls(`.html-${idModal}`, html),
|
|
1439
|
+
viewModalOpen: function () {
|
|
1440
|
+
return Object.keys(this.Data).find((idModal) => s(`.${idModal}`) && this.Data[idModal].options.mode === 'view');
|
|
1441
|
+
},
|
|
1442
|
+
removeModal: function (idModal) {
|
|
1443
|
+
if (!s(`.${idModal}`)) return;
|
|
1444
|
+
s(`.${idModal}`).remove();
|
|
1445
|
+
sa(`.style-${idModal}`).forEach((element) => {
|
|
1446
|
+
element.remove();
|
|
1447
|
+
});
|
|
1448
|
+
delete this.Data[idModal];
|
|
1449
|
+
},
|
|
1450
|
+
RenderConfirm: async function (options) {
|
|
1451
|
+
const { id } = options;
|
|
1452
|
+
append(
|
|
1453
|
+
'body',
|
|
1454
|
+
html`
|
|
1455
|
+
<div
|
|
1456
|
+
class="fix background-confirm-modal-${id}"
|
|
1457
|
+
style="${renderCssAttr({
|
|
1458
|
+
style: {
|
|
1459
|
+
'z-index': '10',
|
|
1460
|
+
background: 'rgba(0,0,0,0.5)',
|
|
1461
|
+
width: '100%',
|
|
1462
|
+
height: '100%',
|
|
1463
|
+
top: '0px',
|
|
1464
|
+
left: '0px',
|
|
1465
|
+
transition: '0.3s',
|
|
1466
|
+
opacity: '1',
|
|
1467
|
+
},
|
|
1468
|
+
})}"
|
|
1469
|
+
></div>
|
|
1470
|
+
`,
|
|
1471
|
+
);
|
|
1472
|
+
const removeBackgroundConfirmModal = () => {
|
|
1473
|
+
s(`.background-confirm-modal-${id}`).style.opacity = '0';
|
|
1474
|
+
setTimeout(() => {
|
|
1475
|
+
s(`.background-confirm-modal-${id}`).remove();
|
|
1476
|
+
});
|
|
1477
|
+
};
|
|
1478
|
+
|
|
1479
|
+
return new Promise(async (resolve, reject) => {
|
|
1480
|
+
const { barConfig } = await Themes[Css.currentTheme]();
|
|
1481
|
+
barConfig.buttons.maximize.disabled = true;
|
|
1482
|
+
barConfig.buttons.minimize.disabled = true;
|
|
1483
|
+
barConfig.buttons.restore.disabled = true;
|
|
1484
|
+
barConfig.buttons.menu.disabled = true;
|
|
1485
|
+
barConfig.buttons.close.disabled = false;
|
|
1486
|
+
const htmlRender = html`
|
|
1487
|
+
<br />
|
|
1488
|
+
<div class="in section-mp" style="font-size: 40px; text-align: center">
|
|
1489
|
+
<i class="fas fa-question-circle"></i>
|
|
1490
|
+
</div>
|
|
1491
|
+
${await options.html()}
|
|
1492
|
+
<div class="in section-mp">
|
|
1493
|
+
${await BtnIcon.Render({
|
|
1494
|
+
class: `in section-mp form-button btn-confirm-${id}`,
|
|
1495
|
+
label: Translate.Render('confirm'),
|
|
1496
|
+
type: 'submit',
|
|
1497
|
+
style: `margin: auto`,
|
|
1498
|
+
})}
|
|
1499
|
+
</div>
|
|
1500
|
+
<div class="in section-mp">
|
|
1501
|
+
${await BtnIcon.Render({
|
|
1502
|
+
class: `in section-mp form-button btn-cancel-${id}`,
|
|
1503
|
+
label: Translate.Render('cancel'),
|
|
1504
|
+
type: 'submit',
|
|
1505
|
+
style: `margin: auto`,
|
|
1506
|
+
})}
|
|
1507
|
+
</div>
|
|
1508
|
+
`;
|
|
1509
|
+
await Modal.Render({
|
|
1510
|
+
id,
|
|
1511
|
+
barConfig,
|
|
1512
|
+
titleClass: 'hide',
|
|
1513
|
+
style: {
|
|
1514
|
+
width: '300px',
|
|
1515
|
+
height: '350px',
|
|
1516
|
+
overflow: 'hidden',
|
|
1517
|
+
'z-index': '11',
|
|
1518
|
+
resize: 'none',
|
|
1519
|
+
},
|
|
1520
|
+
dragDisabled: true,
|
|
1521
|
+
...options,
|
|
1522
|
+
html: htmlRender,
|
|
1523
|
+
});
|
|
1524
|
+
|
|
1525
|
+
const end = () => {
|
|
1526
|
+
removeBackgroundConfirmModal();
|
|
1527
|
+
Modal.removeModal(id);
|
|
1528
|
+
};
|
|
1529
|
+
barConfig.buttons.close.onClick = () => {
|
|
1530
|
+
end();
|
|
1531
|
+
resolve({ status: 'cancelled' });
|
|
1532
|
+
};
|
|
1533
|
+
s(`.background-confirm-modal-${id}`).onclick = () => {
|
|
1534
|
+
end();
|
|
1535
|
+
resolve({ status: 'cancelled' });
|
|
1536
|
+
};
|
|
1537
|
+
s(`.btn-cancel-${id}`).onclick = () => {
|
|
1538
|
+
end();
|
|
1539
|
+
resolve({ status: 'cancelled' });
|
|
1540
|
+
};
|
|
1541
|
+
s(`.btn-confirm-${id}`).onclick = () => {
|
|
1542
|
+
end();
|
|
1543
|
+
resolve({ status: 'confirm' });
|
|
1544
|
+
};
|
|
1545
|
+
});
|
|
1546
|
+
},
|
|
1547
|
+
headerTitleHeight: 40,
|
|
1548
|
+
actionBtnCenter: function () {
|
|
1549
|
+
// if (!s(`.btn-close-modal-menu`).classList.contains('hide')) return s(`.main-btn-home`).click();
|
|
1550
|
+
if (!s(`.btn-close-modal-menu`).classList.contains('hide')) return s(`.btn-close-modal-menu`).click();
|
|
1551
|
+
if (!s(`.btn-menu-modal-menu`).classList.contains('hide')) return s(`.btn-menu-modal-menu`).click();
|
|
1552
|
+
},
|
|
1553
|
+
cleanUI: function () {
|
|
1554
|
+
s(`.top-bar`).classList.add('hide');
|
|
1555
|
+
s(`.bottom-bar`).classList.add('hide');
|
|
1556
|
+
s(`.modal-menu`).classList.add('hide');
|
|
1557
|
+
},
|
|
1558
|
+
restoreUI: function () {
|
|
1559
|
+
s(`.top-bar`).classList.remove('hide');
|
|
1560
|
+
s(`.bottom-bar`).classList.remove('hide');
|
|
1561
|
+
s(`.modal-menu`).classList.remove('hide');
|
|
1562
|
+
},
|
|
1563
|
+
};
|
|
1564
|
+
|
|
1565
|
+
const renderMenuLabel = ({ img, text, icon }) => {
|
|
1566
|
+
if (!img) return html`<span class="menu-btn-icon">${icon}</span> ${text}`;
|
|
1567
|
+
return html`<img class="abs center img-btn-square-menu" src="${getProxyPath()}assets/ui-icons/${img}" />
|
|
1568
|
+
<div class="abs center main-btn-menu-text">${text}</div>`;
|
|
1569
|
+
};
|
|
1570
|
+
|
|
1571
|
+
const renderViewTitle = (options = { icon: '', img: '', text: '', assetFolder: '', 'ui-icons': '', dim, top }) => {
|
|
1572
|
+
if (options.dim === undefined) options.dim = 60;
|
|
1573
|
+
const { img, text, icon, dim, top } = options;
|
|
1574
|
+
if (!img && !options['ui-icon']) return html`<span class="view-title-icon">${icon}</span> ${text}`;
|
|
1575
|
+
return html`<img
|
|
1576
|
+
class="abs img-btn-square-view-title"
|
|
1577
|
+
style="${renderCssAttr({
|
|
1578
|
+
style: { width: `${dim}px`, height: `${dim}px`, top: top !== undefined ? `${top}px` : `-${dim / 2}px` },
|
|
1579
|
+
})}"
|
|
1580
|
+
src="${options['ui-icon']
|
|
1581
|
+
? `${getProxyPath()}assets/${options.assetFolder ? options.assetFolder : 'ui-icons'}/${options['ui-icon']}`
|
|
1582
|
+
: img}"
|
|
1583
|
+
/>
|
|
1584
|
+
<div class="in text-btn-square-view-title" style="${renderCssAttr({ style: { 'padding-left': `${dim}px` } })}">
|
|
1585
|
+
${text}
|
|
1586
|
+
</div>`;
|
|
1587
|
+
};
|
|
1588
|
+
|
|
1589
|
+
const buildBadgeToolTipMenuOption = (id, sideKey = 'left') => {
|
|
1590
|
+
const option = {
|
|
1591
|
+
id: `tooltip-content-main-btn-${id}`,
|
|
1592
|
+
text: `${Translate.Render(`${id}`)}`,
|
|
1593
|
+
classList: 'tooltip-menu hide',
|
|
1594
|
+
style: { top: `0px` },
|
|
1595
|
+
};
|
|
1596
|
+
switch (sideKey) {
|
|
1597
|
+
case 'left':
|
|
1598
|
+
option.style.left = '40px';
|
|
1599
|
+
|
|
1600
|
+
break;
|
|
1601
|
+
|
|
1602
|
+
case 'right':
|
|
1603
|
+
option.style.right = '80px';
|
|
1604
|
+
break;
|
|
1605
|
+
|
|
1606
|
+
default:
|
|
1607
|
+
break;
|
|
1608
|
+
}
|
|
1609
|
+
return option;
|
|
1610
|
+
};
|
|
1611
|
+
|
|
1612
|
+
export { Modal, renderMenuLabel, renderViewTitle, buildBadgeToolTipMenuOption };
|