@underpostnet/underpost 2.7.83 → 2.7.92
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/.github/workflows/ghpkg.yml +41 -1
- package/.github/workflows/pwa-microservices-template.page.yml +54 -0
- package/.vscode/settings.json +7 -0
- package/CHANGELOG.md +64 -16
- package/bin/cron.js +47 -0
- package/bin/db.js +60 -7
- package/bin/deploy.js +358 -26
- package/bin/file.js +18 -1
- package/bin/hwt.js +59 -0
- package/bin/index.js +1 -1
- package/bin/util.js +31 -1
- package/conf.js +46 -8
- package/docker-compose.yml +1 -1
- package/package.json +4 -4
- package/src/api/core/core.router.js +9 -9
- package/src/api/core/core.service.js +12 -4
- package/src/api/default/default.service.js +4 -4
- package/src/api/file/file.service.js +3 -3
- package/src/api/user/user.service.js +10 -8
- package/src/client/components/core/404.js +20 -0
- package/src/client/components/core/500.js +20 -0
- package/src/client/{ssr/common → components/core}/Alert.js +13 -11
- package/src/client/components/core/CommonJs.js +3 -0
- package/src/client/components/core/CssCore.js +30 -3
- package/src/client/components/core/Docs.js +110 -10
- package/src/client/components/core/LoadingAnimation.js +4 -2
- package/src/client/components/core/Modal.js +223 -22
- package/src/client/components/core/Panel.js +1 -1
- package/src/client/components/core/PanelForm.js +2 -1
- package/src/client/components/core/Responsive.js +34 -5
- package/src/client/components/core/RichText.js +4 -2
- package/src/client/components/core/Translate.js +21 -5
- package/src/client/components/core/VanillaJs.js +2 -1
- package/src/client/components/core/WebComponent.js +44 -0
- package/src/client/components/core/Worker.js +15 -18
- package/src/client/components/default/MenuDefault.js +68 -0
- package/src/client/components/default/RoutesDefault.js +2 -0
- package/src/client/public/default/plantuml/client-conf.svg +1 -1
- package/src/client/public/default/plantuml/client-schema.svg +1 -1
- package/src/client/public/default/plantuml/cron-conf.svg +1 -1
- package/src/client/public/default/plantuml/cron-schema.svg +1 -1
- package/src/client/public/default/plantuml/server-conf.svg +1 -1
- package/src/client/public/default/plantuml/server-schema.svg +1 -1
- package/src/client/public/default/plantuml/ssr-conf.svg +1 -1
- package/src/client/public/default/plantuml/ssr-schema.svg +1 -1
- package/src/client/public/default/site.webmanifest +69 -0
- package/src/client/ssr/Render.js +1 -6
- package/src/client/ssr/{components/body → body}/CacheControl.js +1 -1
- package/src/client/ssr/head/Production.js +1 -0
- package/src/client/ssr/head/Pwa.js +146 -0
- package/src/client/ssr/head/Seo.js +14 -0
- package/src/client/ssr/mailer/DefaultRecoverEmail.js +21 -0
- package/src/client/ssr/mailer/DefaultVerifyEmail.js +17 -0
- package/src/client/ssr/offline/NoNetworkConnection.js +65 -0
- package/src/client/ssr/pages/Test.js +196 -0
- package/src/client/ssr/pages/maintenance.js +14 -0
- package/src/client/ssr/pages/offline.js +21 -0
- package/src/client/sw/default.sw.js +44 -165
- package/src/db/DataBaseProvider.js +12 -1
- package/src/db/mongo/MongooseDB.js +0 -1
- package/src/mailer/EmailRender.js +2 -4
- package/src/mailer/MailerProvider.js +4 -1
- package/src/runtime/lampp/Lampp.js +9 -9
- package/src/server/backup.js +82 -70
- package/src/server/client-build.js +133 -155
- package/src/server/client-formatted.js +2 -4
- package/src/server/conf.js +114 -23
- package/src/server/crypto.js +91 -0
- package/src/server/dns.js +48 -16
- package/src/server/network.js +94 -7
- package/src/server/proxy.js +26 -28
- package/src/server/runtime.js +42 -12
- package/src/server/ssl.js +2 -2
- package/src/client/ssr/common/SsrCore.js +0 -91
- package/src/client/ssr/common/Translate.js +0 -26
- package/src/client/ssr/common/Worker.js +0 -28
- package/src/client/ssr/components/head/PwaDefault.js +0 -60
- package/src/client/ssr/offline/default.index.js +0 -31
- package/src/cron.js +0 -30
- package/src/server/cron.js +0 -35
- /package/src/client/ssr/{components/body → body}/DefaultSplashScreen.js +0 -0
- /package/src/client/ssr/{components/email → email}/DefaultRecoverEmail.js +0 -0
- /package/src/client/ssr/{components/email → email}/DefaultVerifyEmail.js +0 -0
- /package/src/client/ssr/{components/head → head}/Css.js +0 -0
- /package/src/client/ssr/{components/head → head}/DefaultScripts.js +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { Badge } from './Badge.js';
|
|
1
2
|
import { BtnIcon } from './BtnIcon.js';
|
|
2
3
|
import { rgbToHex } from './CommonJs.js';
|
|
3
4
|
import { Css, darkTheme, dynamicCol, renderCssAttr, ThemeEvents, Themes } from './Css.js';
|
|
4
5
|
import { DropDown } from './DropDown.js';
|
|
5
|
-
import { Modal, renderMenuLabel, renderViewTitle } from './Modal.js';
|
|
6
|
+
import { buildBadgeToolTipMenuOption, Modal, renderMenuLabel, renderViewTitle } from './Modal.js';
|
|
6
7
|
import { listenQueryPathInstance, setQueryPath } from './Router.js';
|
|
7
8
|
import { Translate } from './Translate.js';
|
|
8
9
|
import { getProxyPath, getQueryParams, htmls, s } from './VanillaJs.js';
|
|
10
|
+
import Sortable from 'sortablejs';
|
|
9
11
|
|
|
10
12
|
// https://mintlify.com/docs/quickstart
|
|
11
13
|
|
|
@@ -55,7 +57,21 @@ const Docs = {
|
|
|
55
57
|
icon: html`<i class="fab fa-github"></i>`,
|
|
56
58
|
text: `Last Release`,
|
|
57
59
|
url: function () {
|
|
58
|
-
return `https://github.com/underpostnet/
|
|
60
|
+
return `https://github.com/underpostnet/pwa-microservices-template-ghpkg/`;
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
type: 'demo',
|
|
65
|
+
icon: html`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 32 32">
|
|
66
|
+
<path fill="currentColor" d="M20 2v12l10-6z" />
|
|
67
|
+
<path
|
|
68
|
+
fill="currentColor"
|
|
69
|
+
d="M28 14v8H4V6h10V4H4a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h8v4H8v2h16v-2h-4v-4h8a2 2 0 0 0 2-2v-8zM18 28h-4v-4h4z"
|
|
70
|
+
/>
|
|
71
|
+
</svg>`,
|
|
72
|
+
text: html`Demo`,
|
|
73
|
+
url: function () {
|
|
74
|
+
return `https://underpostnet.github.io/pwa-microservices-template-ghpkg/`;
|
|
59
75
|
},
|
|
60
76
|
},
|
|
61
77
|
{
|
|
@@ -63,7 +79,7 @@ const Docs = {
|
|
|
63
79
|
icon: html`<i class="fa-brands fa-osi"></i>`,
|
|
64
80
|
text: 'Source Docs',
|
|
65
81
|
url: function () {
|
|
66
|
-
return `${getProxyPath()}docs/engine/2.7.
|
|
82
|
+
return `${getProxyPath()}docs/engine/2.7.92`;
|
|
67
83
|
},
|
|
68
84
|
},
|
|
69
85
|
{
|
|
@@ -109,6 +125,9 @@ const Docs = {
|
|
|
109
125
|
type: umlId,
|
|
110
126
|
icon: html`<i class="fas fa-sitemap"></i>`,
|
|
111
127
|
text: Translate.Render(`${umlType} config uml`),
|
|
128
|
+
url: function () {
|
|
129
|
+
return `/docs/?cid=${umlId}`;
|
|
130
|
+
},
|
|
112
131
|
renderHtml: function () {
|
|
113
132
|
return html` <div class="in section-mp">
|
|
114
133
|
<div class="in sub-title-modal"><i class="fas fa-project-diagram"></i> Schema</div>
|
|
@@ -130,19 +149,36 @@ const Docs = {
|
|
|
130
149
|
};
|
|
131
150
|
}),
|
|
132
151
|
),
|
|
152
|
+
Tokens: {},
|
|
133
153
|
Init: async function (options) {
|
|
134
154
|
const { idModal } = options;
|
|
155
|
+
this.Tokens[idModal] = options;
|
|
135
156
|
setTimeout(() => {
|
|
157
|
+
const cleanActive = () => {
|
|
158
|
+
s(`.btn-docs-src`).classList.remove('main-btn-menu-active');
|
|
159
|
+
s(`.btn-docs-api`).classList.remove('main-btn-menu-active');
|
|
160
|
+
s(`.btn-docs-coverage`).classList.remove('main-btn-menu-active');
|
|
161
|
+
for (const umlType of umlTypes) {
|
|
162
|
+
const umlId = `uml-${umlType}`;
|
|
163
|
+
s(`.btn-docs-${umlId}`).classList.remove('main-btn-menu-active');
|
|
164
|
+
}
|
|
165
|
+
};
|
|
136
166
|
s(`.btn-docs-src`).onclick = async () => {
|
|
137
167
|
setQueryPath({ path: 'docs', queryPath: 'src' });
|
|
168
|
+
cleanActive();
|
|
169
|
+
s(`.btn-docs-src`).classList.add('main-btn-menu-active');
|
|
138
170
|
await this.RenderModal('src', options.modalOptions);
|
|
139
171
|
};
|
|
140
172
|
s(`.btn-docs-api`).onclick = async () => {
|
|
141
173
|
setQueryPath({ path: 'docs', queryPath: 'api' });
|
|
174
|
+
cleanActive();
|
|
175
|
+
s(`.btn-docs-api`).classList.add('main-btn-menu-active');
|
|
142
176
|
await this.RenderModal('api', options.modalOptions);
|
|
143
177
|
};
|
|
144
178
|
s(`.btn-docs-coverage`).onclick = async () => {
|
|
145
179
|
setQueryPath({ path: 'docs', queryPath: 'coverage' });
|
|
180
|
+
cleanActive();
|
|
181
|
+
s(`.btn-docs-coverage`).classList.add('main-btn-menu-active');
|
|
146
182
|
await this.RenderModal('coverage', options.modalOptions);
|
|
147
183
|
};
|
|
148
184
|
|
|
@@ -154,10 +190,16 @@ const Docs = {
|
|
|
154
190
|
const docData = this.Data.find((d) => d.type === 'repo');
|
|
155
191
|
location.href = docData.url();
|
|
156
192
|
};
|
|
193
|
+
s(`.btn-docs-demo`).onclick = () => {
|
|
194
|
+
const docData = this.Data.find((d) => d.type === 'demo');
|
|
195
|
+
location.href = docData.url();
|
|
196
|
+
};
|
|
157
197
|
|
|
158
198
|
for (const umlType of umlTypes) {
|
|
159
199
|
const umlId = `uml-${umlType}`;
|
|
160
200
|
s(`.btn-docs-${umlId}`).onclick = async () => {
|
|
201
|
+
cleanActive();
|
|
202
|
+
s(`.btn-docs-${umlId}`).classList.add('main-btn-menu-active');
|
|
161
203
|
setQueryPath({ path: 'docs', queryPath: umlId });
|
|
162
204
|
await this.RenderModal(umlId, { ...options.modalOptions, handleType: 'bar' });
|
|
163
205
|
};
|
|
@@ -181,7 +223,6 @@ const Docs = {
|
|
|
181
223
|
switch (docData.type) {
|
|
182
224
|
case 'repo':
|
|
183
225
|
case 'coverage-link':
|
|
184
|
-
tabHref = docData.url();
|
|
185
226
|
style = renderCssAttr({ style: { height: '45px' } });
|
|
186
227
|
labelStyle = renderCssAttr({ style: { top: '8px', left: '9px' } });
|
|
187
228
|
break;
|
|
@@ -189,16 +230,75 @@ const Docs = {
|
|
|
189
230
|
default:
|
|
190
231
|
break;
|
|
191
232
|
}
|
|
192
|
-
|
|
233
|
+
tabHref = docData.url();
|
|
234
|
+
docMenuRender += html`
|
|
193
235
|
${await BtnIcon.Render({
|
|
194
|
-
class: `
|
|
195
|
-
label: html
|
|
236
|
+
class: `in wfa main-btn-menu btn-docs-${docData.type}`,
|
|
237
|
+
label: html`<span class="menu-btn-icon">${docData.icon}</span
|
|
238
|
+
><span class="menu-label-text"> ${docData.text} </span>`,
|
|
196
239
|
tabHref,
|
|
197
|
-
|
|
198
|
-
|
|
240
|
+
handleContainerClass: 'handle-btn-container',
|
|
241
|
+
tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption(docData.text, 'right')),
|
|
242
|
+
attrs: `data-id="${docData.type}"`,
|
|
243
|
+
handleContainerClass: 'handle-btn-container',
|
|
199
244
|
})}
|
|
200
|
-
|
|
245
|
+
`;
|
|
201
246
|
}
|
|
247
|
+
|
|
248
|
+
htmls('.menu-btn-container-children', html` <div class="fl menu-btn-container-docs">${docMenuRender}</div>`);
|
|
249
|
+
if (s(`.menu-btn-container-main`)) s(`.menu-btn-container-main`).classList.add('hide');
|
|
250
|
+
htmls(`.nav-path-display-${'modal-menu'}`, location.pathname);
|
|
251
|
+
|
|
252
|
+
this.Tokens[idModal] = new Sortable(s(`.menu-btn-container-docs`), {
|
|
253
|
+
animation: 150,
|
|
254
|
+
group: `docs-sortable`,
|
|
255
|
+
forceFallback: true,
|
|
256
|
+
fallbackOnBody: true,
|
|
257
|
+
handle: '.handle-btn-container',
|
|
258
|
+
store: {
|
|
259
|
+
/**
|
|
260
|
+
* Get the order of elements. Called once during initialization.
|
|
261
|
+
* @param {Sortable} sortable
|
|
262
|
+
* @returns {Array}
|
|
263
|
+
*/
|
|
264
|
+
get: function (sortable) {
|
|
265
|
+
const order = localStorage.getItem(sortable.options.group.name);
|
|
266
|
+
return order ? order.split('|') : [];
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Save the order of elements. Called onEnd (when the item is dropped).
|
|
271
|
+
* @param {Sortable} sortable
|
|
272
|
+
*/
|
|
273
|
+
set: function (sortable) {
|
|
274
|
+
const order = sortable.toArray();
|
|
275
|
+
localStorage.setItem(sortable.options.group.name, order.join('|'));
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
// chosenClass: 'css-class',
|
|
279
|
+
// ghostClass: 'css-class',
|
|
280
|
+
// Element dragging ended
|
|
281
|
+
onEnd: function (/**Event*/ evt) {
|
|
282
|
+
// console.log('Sortable onEnd', evt);
|
|
283
|
+
// console.log('evt.oldIndex', evt.oldIndex);
|
|
284
|
+
// console.log('evt.newIndex', evt.newIndex);
|
|
285
|
+
const slotId = Array.from(evt.item.classList).pop();
|
|
286
|
+
// console.log('slotId', slotId);
|
|
287
|
+
if (evt.oldIndex === evt.newIndex) s(`.${slotId}`).click();
|
|
288
|
+
|
|
289
|
+
// var itemEl = evt.item; // dragged HTMLElement
|
|
290
|
+
// evt.to; // target list
|
|
291
|
+
// evt.from; // previous list
|
|
292
|
+
// evt.oldIndex; // element's old index within old parent
|
|
293
|
+
// evt.newIndex; // element's new index within new parent
|
|
294
|
+
// evt.oldDraggableIndex; // element's old index within old parent, only counting draggable elements
|
|
295
|
+
// evt.newDraggableIndex; // element's new index within new parent, only counting draggable elements
|
|
296
|
+
// evt.clone; // the clone element
|
|
297
|
+
// evt.pullMode; // when item is in another sortable: `"clone"` if cloning, `true` if moving
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
return '';
|
|
202
302
|
return html` <div class="in section-mp">${docMenuRender}</div>`;
|
|
203
303
|
return html` <div class="in section-mp">
|
|
204
304
|
${await DropDown.Render({
|
|
@@ -3,7 +3,7 @@ import { BtnIcon } from './BtnIcon.js';
|
|
|
3
3
|
import { s4 } from './CommonJs.js';
|
|
4
4
|
import { darkTheme, renderCssAttr } from './Css.js';
|
|
5
5
|
import { loggerFactory } from './Logger.js';
|
|
6
|
-
import { append, getAllChildNodes, getProxyPath, htmls, s } from './VanillaJs.js';
|
|
6
|
+
import { append, getAllChildNodes, getProxyPath, htmls, s, sa } from './VanillaJs.js';
|
|
7
7
|
|
|
8
8
|
const logger = loggerFactory(import.meta);
|
|
9
9
|
|
|
@@ -129,6 +129,7 @@ const LoadingAnimation = {
|
|
|
129
129
|
},
|
|
130
130
|
barLevel: {
|
|
131
131
|
append: () => {
|
|
132
|
+
if (Array.from(sa('.ssr-loading-bar-block')).length >= 5) return;
|
|
132
133
|
s(`.ssr-blink-bar`).classList.remove('ssr-blink-bar');
|
|
133
134
|
append('.ssr-loading-bar', html`<div class="ssr-loading-bar-block ssr-blink-bar"></div>`);
|
|
134
135
|
},
|
|
@@ -136,7 +137,7 @@ const LoadingAnimation = {
|
|
|
136
137
|
htmls('.ssr-loading-bar', html`<div class="ssr-loading-bar-block ssr-blink-bar"></div>`);
|
|
137
138
|
},
|
|
138
139
|
},
|
|
139
|
-
removeSplashScreen: function (backgroundContainer) {
|
|
140
|
+
removeSplashScreen: function (backgroundContainer, callBack) {
|
|
140
141
|
if (s(`.clean-cache-container`)) s(`.clean-cache-container`).style.display = 'none';
|
|
141
142
|
if (!backgroundContainer) backgroundContainer = '.ssr-background';
|
|
142
143
|
if (s(backgroundContainer))
|
|
@@ -144,6 +145,7 @@ const LoadingAnimation = {
|
|
|
144
145
|
s(backgroundContainer).style.opacity = 0;
|
|
145
146
|
setTimeout(async () => {
|
|
146
147
|
s(backgroundContainer).style.display = 'none';
|
|
148
|
+
if (callBack) callBack();
|
|
147
149
|
}, 300);
|
|
148
150
|
});
|
|
149
151
|
},
|
|
@@ -86,6 +86,7 @@ const Modal = {
|
|
|
86
86
|
onDragEndListener: {},
|
|
87
87
|
onObserverListener: {},
|
|
88
88
|
onClickListener: {},
|
|
89
|
+
onExpandUiListener: {},
|
|
89
90
|
query: options.query ? `${window.location.search}` : undefined,
|
|
90
91
|
};
|
|
91
92
|
if (options && 'mode' in options) {
|
|
@@ -191,11 +192,20 @@ const Modal = {
|
|
|
191
192
|
s(`.${idModal}`).style.width = `${this.Data[idModal][options.mode].width}px`;
|
|
192
193
|
s(`.html-${idModal}`).style.display = 'block';
|
|
193
194
|
// s(`.title-modal-${idModal}`).style.display = 'block';
|
|
194
|
-
|
|
195
|
-
s(`.btn-
|
|
196
|
-
s(`.
|
|
197
|
-
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
s(`.main-body-btn-ui-menu-menu`).classList.add('hide');
|
|
197
|
+
s(`.main-body-btn-ui-menu-close`).classList.remove('hide');
|
|
198
|
+
if (s(`.btn-bar-center-icon-menu`)) {
|
|
199
|
+
s(`.btn-bar-center-icon-close`).classList.remove('hide');
|
|
200
|
+
s(`.btn-bar-center-icon-menu`).classList.add('hide');
|
|
201
|
+
}
|
|
202
|
+
});
|
|
198
203
|
|
|
204
|
+
setTimeout(() => {
|
|
205
|
+
s(`.main-body-btn-container`).style[
|
|
206
|
+
true || (options.mode && options.mode.match('right')) ? 'right' : 'left'
|
|
207
|
+
] = options.mode && options.mode.match('right') ? `${slideMenuWidth}px` : '0px';
|
|
208
|
+
});
|
|
199
209
|
Responsive.Event[`slide-menu-${idModal}`]();
|
|
200
210
|
};
|
|
201
211
|
barConfig.buttons.close.onClick = () => {
|
|
@@ -204,15 +214,106 @@ const Modal = {
|
|
|
204
214
|
s(`.btn-menu-${idModal}`).classList.remove('hide');
|
|
205
215
|
s(`.${idModal}`).style.width = `${this.Data[idModal][options.mode].width}px`;
|
|
206
216
|
s(`.html-${idModal}`).style.display = 'none';
|
|
207
|
-
|
|
208
|
-
s(`.
|
|
209
|
-
s(`.btn-
|
|
210
|
-
|
|
217
|
+
setTimeout(() => {
|
|
218
|
+
s(`.main-body-btn-ui-menu-close`).classList.add('hide');
|
|
219
|
+
s(`.main-body-btn-ui-menu-menu`).classList.remove('hide');
|
|
220
|
+
if (s(`.btn-bar-center-icon-menu`)) {
|
|
221
|
+
s(`.btn-bar-center-icon-menu`).classList.remove('hide');
|
|
222
|
+
s(`.btn-bar-center-icon-close`).classList.add('hide');
|
|
223
|
+
}
|
|
224
|
+
});
|
|
211
225
|
// s(`.title-modal-${idModal}`).style.display = 'none';
|
|
226
|
+
setTimeout(() => {
|
|
227
|
+
s(`.main-body-btn-container`).style[
|
|
228
|
+
true || (options.mode && options.mode.match('right')) ? 'right' : 'left'
|
|
229
|
+
] = `${0}px`;
|
|
230
|
+
});
|
|
212
231
|
Responsive.Event[`slide-menu-${idModal}`]();
|
|
213
232
|
};
|
|
214
233
|
transition += `, width 0.3s`;
|
|
215
234
|
|
|
235
|
+
setTimeout(() => {
|
|
236
|
+
append(
|
|
237
|
+
'body',
|
|
238
|
+
html`
|
|
239
|
+
<div
|
|
240
|
+
class="abs main-body-btn-container"
|
|
241
|
+
style="top: ${options.heightTopBar + 50}px; z-index: 9; ${true ||
|
|
242
|
+
(options.mode && options.mode.match('right'))
|
|
243
|
+
? 'right'
|
|
244
|
+
: 'left'}: 50px; width: 50px; height: 100px; transition: .3s"
|
|
245
|
+
>
|
|
246
|
+
<div
|
|
247
|
+
class="abs main-body-btn main-body-btn-menu"
|
|
248
|
+
style="top: 50px; ${true || (options.mode && options.mode.match('right'))
|
|
249
|
+
? 'right'
|
|
250
|
+
: 'left'}: 0px"
|
|
251
|
+
>
|
|
252
|
+
<div class="abs center">
|
|
253
|
+
<i class="fa-solid fa-xmark hide main-body-btn-ui-menu-close"></i>
|
|
254
|
+
<i class="fa-solid fa-bars main-body-btn-ui-menu-menu"></i>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
<div
|
|
258
|
+
class="abs main-body-btn main-body-btn-ui"
|
|
259
|
+
style="top: 0px; ${true || (options.mode && options.mode.match('right')) ? 'right' : 'left'}: 0px"
|
|
260
|
+
>
|
|
261
|
+
<div class="abs center">
|
|
262
|
+
<i class="fas fa-caret-down main-body-btn-ui-open hide"></i>
|
|
263
|
+
<i class="fas fa-caret-up main-body-btn-ui-close"></i>
|
|
264
|
+
</div>
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
`,
|
|
268
|
+
);
|
|
269
|
+
|
|
270
|
+
s(`.main-body-btn-menu`).onclick = () => {
|
|
271
|
+
Modal.actionBtnCenter();
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
let _heightTopBar, _heightBottomBar, _topMenu;
|
|
275
|
+
s(`.main-body-btn-ui`).onclick = () => {
|
|
276
|
+
if (s(`.main-body-btn-ui-open`).classList.contains('hide')) {
|
|
277
|
+
s(`.main-body-btn-ui-open`).classList.remove('hide');
|
|
278
|
+
s(`.main-body-btn-ui-close`).classList.add('hide');
|
|
279
|
+
_heightTopBar = newInstance(options.heightTopBar);
|
|
280
|
+
_heightBottomBar = newInstance(options.heightBottomBar);
|
|
281
|
+
_topMenu = newInstance(s(`.modal-menu`).style.top);
|
|
282
|
+
options.heightTopBar = 0;
|
|
283
|
+
options.heightBottomBar = 0;
|
|
284
|
+
s(`.slide-menu-top-bar`).classList.add('hide');
|
|
285
|
+
s(`.bottom-bar`).classList.add('hide');
|
|
286
|
+
s(`.modal-menu`).style.top = '0px';
|
|
287
|
+
s(`.main-body-btn-container`).style.top = '50px';
|
|
288
|
+
s(`.main-body`).style.top = '0px';
|
|
289
|
+
} else {
|
|
290
|
+
s(`.main-body-btn-ui-close`).classList.remove('hide');
|
|
291
|
+
s(`.main-body-btn-ui-open`).classList.add('hide');
|
|
292
|
+
options.heightTopBar = _heightTopBar;
|
|
293
|
+
options.heightBottomBar = _heightBottomBar;
|
|
294
|
+
s(`.modal-menu`).style.top = _topMenu;
|
|
295
|
+
s(`.main-body-btn-container`).style.top = `${options.heightTopBar + 50}px`;
|
|
296
|
+
s(`.slide-menu-top-bar`).classList.remove('hide');
|
|
297
|
+
s(`.bottom-bar`).classList.remove('hide');
|
|
298
|
+
s(`.main-body`).style.top = `${options.heightTopBar}px`;
|
|
299
|
+
}
|
|
300
|
+
Responsive.Event[`slide-menu-modal-menu`]();
|
|
301
|
+
Object.keys(this.Data).map((_idModal) => {
|
|
302
|
+
if (this.Data[_idModal].slideMenu) {
|
|
303
|
+
if (s(`.btn-maximize-${_idModal}`)) s(`.btn-maximize-${_idModal}`).click();
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
Responsive.Event[`view-${'main-body'}`]();
|
|
307
|
+
if (Responsive.Event[`view-${'bottom-bar'}`]) Responsive.Event[`view-${'bottom-bar'}`]();
|
|
308
|
+
if (Responsive.Event[`view-${'main-body-top'}`]) Responsive.Event[`view-${'main-body-top'}`]();
|
|
309
|
+
for (const keyEvent of Object.keys(this.Data[idModal].onExpandUiListener)) {
|
|
310
|
+
this.Data[idModal].onExpandUiListener[keyEvent](
|
|
311
|
+
!s(`.main-body-btn-ui-open`).classList.contains('hide'),
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
});
|
|
316
|
+
|
|
216
317
|
const inputSearchBoxId = `top-bar-search-box`;
|
|
217
318
|
append(
|
|
218
319
|
'body',
|
|
@@ -726,6 +827,7 @@ const Modal = {
|
|
|
726
827
|
heightTopBar: originHeightTopBar,
|
|
727
828
|
heightBottomBar: originHeightBottomBar,
|
|
728
829
|
barMode: options.barMode,
|
|
830
|
+
observer: true,
|
|
729
831
|
});
|
|
730
832
|
const maxWidthInputSearchBox = 450;
|
|
731
833
|
const paddingInputSearchBox = 5;
|
|
@@ -970,11 +1072,24 @@ const Modal = {
|
|
|
970
1072
|
|
|
971
1073
|
Responsive.Event[`view-${id}`] = () => {
|
|
972
1074
|
if (!this.Data[id] || !s(`.${id}`)) return delete Responsive.Event[`view-${id}`];
|
|
973
|
-
s(`.${id}`).style.height =
|
|
974
|
-
|
|
975
|
-
(
|
|
976
|
-
|
|
977
|
-
|
|
1075
|
+
s(`.${id}`).style.height =
|
|
1076
|
+
s(`.main-body-btn-ui-close`).classList.contains('hide') &&
|
|
1077
|
+
s(`.btn-restore-${id}`).style.display !== 'none'
|
|
1078
|
+
? `${window.innerHeight}px`
|
|
1079
|
+
: `${
|
|
1080
|
+
window.innerHeight -
|
|
1081
|
+
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
|
|
1082
|
+
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
1083
|
+
}px`;
|
|
1084
|
+
|
|
1085
|
+
if (
|
|
1086
|
+
s(`.main-body-btn-ui-close`).classList.contains('hide') &&
|
|
1087
|
+
s(`.btn-restore-${id}`).style.display !== 'none'
|
|
1088
|
+
) {
|
|
1089
|
+
s(`.${id}`).style.top = '0px';
|
|
1090
|
+
} else {
|
|
1091
|
+
s(`.${id}`).style.top = `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
|
|
1092
|
+
}
|
|
978
1093
|
};
|
|
979
1094
|
Responsive.Event[`view-${id}`]();
|
|
980
1095
|
|
|
@@ -1049,6 +1164,28 @@ const Modal = {
|
|
|
1049
1164
|
top: 5%;
|
|
1050
1165
|
left: 5%;
|
|
1051
1166
|
}
|
|
1167
|
+
.sub-menu-title-container-${idModal},
|
|
1168
|
+
.nav-path-container-${idModal} {
|
|
1169
|
+
top: 0px;
|
|
1170
|
+
left: 0px;
|
|
1171
|
+
width: 200px;
|
|
1172
|
+
height: 50px;
|
|
1173
|
+
overflow: hidden;
|
|
1174
|
+
font-size: 20px;
|
|
1175
|
+
cursor: default;
|
|
1176
|
+
}
|
|
1177
|
+
.nav-path-display-${idModal} {
|
|
1178
|
+
font-size: 11px;
|
|
1179
|
+
width: 100%;
|
|
1180
|
+
top: 35px;
|
|
1181
|
+
left: 37px;
|
|
1182
|
+
}
|
|
1183
|
+
.nav-title-display-${idModal} {
|
|
1184
|
+
font-size: 19px;
|
|
1185
|
+
width: 100%;
|
|
1186
|
+
top: 13px;
|
|
1187
|
+
left: 13px;
|
|
1188
|
+
}
|
|
1052
1189
|
</style>
|
|
1053
1190
|
${renderStyleTag(`style-${idModal}`, `.${idModal}`, options)}
|
|
1054
1191
|
<div class="fix ${options && options.class ? options.class : ''} modal box-shadow ${idModal}">
|
|
@@ -1117,7 +1254,10 @@ const Modal = {
|
|
|
1117
1254
|
|
|
1118
1255
|
<div class="in html-${idModal}">
|
|
1119
1256
|
${options.mode && options.mode.match('slide-menu')
|
|
1120
|
-
? html`<div
|
|
1257
|
+
? html`<div
|
|
1258
|
+
class="stq modal"
|
|
1259
|
+
style="${renderCssAttr({ style: { height: '50px', 'z-index': 1, top: '0px' } })}"
|
|
1260
|
+
>
|
|
1121
1261
|
${await BtnIcon.Render({
|
|
1122
1262
|
style: renderCssAttr({ style: { height: '100%', color: '#5f5f5f' } }),
|
|
1123
1263
|
class: `in flr main-btn-menu action-bar-box btn-icon-menu-mode`,
|
|
@@ -1134,6 +1274,19 @@ const Modal = {
|
|
|
1134
1274
|
></i>
|
|
1135
1275
|
</div>`,
|
|
1136
1276
|
})}
|
|
1277
|
+
${await BtnIcon.Render({
|
|
1278
|
+
style: renderCssAttr({ style: { height: '100%', color: '#5f5f5f' } }),
|
|
1279
|
+
class: `in flr main-btn-menu action-bar-box btn-icon-menu-back hide`,
|
|
1280
|
+
label: html`<div class="abs center"><i class="fas fa-undo-alt"></i></div>`,
|
|
1281
|
+
})}
|
|
1282
|
+
<div class="abs sub-menu-title-container-${idModal} ac">
|
|
1283
|
+
<div class="abs nav-title-display-${idModal}">
|
|
1284
|
+
<!-- <i class="fas fa-home"></i> ${Translate.Render('home')} -->
|
|
1285
|
+
</div>
|
|
1286
|
+
</div>
|
|
1287
|
+
<div class="abs nav-path-container-${idModal} ahc bold">
|
|
1288
|
+
<div class="abs nav-path-display-${idModal}"><!-- ${location.pathname} --></div>
|
|
1289
|
+
</div>
|
|
1137
1290
|
</div>`
|
|
1138
1291
|
: ''}
|
|
1139
1292
|
${options && options.html ? (typeof options.html === 'function' ? await options.html() : options.html) : ''}
|
|
@@ -1167,6 +1320,15 @@ const Modal = {
|
|
|
1167
1320
|
case 'slide-menu':
|
|
1168
1321
|
case 'slide-menu-right':
|
|
1169
1322
|
case 'slide-menu-left':
|
|
1323
|
+
const backMenuButtonEvent = async () => {
|
|
1324
|
+
if (location.pathname !== getProxyPath()) setPath(getProxyPath());
|
|
1325
|
+
if (s(`.menu-btn-container-children`)) htmls(`.menu-btn-container-children`, '');
|
|
1326
|
+
// htmls(`.nav-title-display-${'modal-menu'}`, html`<i class="fas fa-home"></i> ${Translate.Render('home')}`);
|
|
1327
|
+
htmls(`.nav-title-display-${'modal-menu'}`, html``);
|
|
1328
|
+
htmls(`.nav-path-display-${idModal}`, '');
|
|
1329
|
+
s(`.btn-icon-menu-back`).classList.add('hide');
|
|
1330
|
+
if (s(`.menu-btn-container-main`)) s(`.menu-btn-container-main`).classList.remove('hide');
|
|
1331
|
+
};
|
|
1170
1332
|
s(`.main-btn-home`).onclick = () => {
|
|
1171
1333
|
for (const keyModal of Object.keys(this.Data)) {
|
|
1172
1334
|
if (
|
|
@@ -1175,9 +1337,11 @@ const Modal = {
|
|
|
1175
1337
|
.includes(keyModal)
|
|
1176
1338
|
)
|
|
1177
1339
|
s(`.btn-close-${keyModal}`).click();
|
|
1340
|
+
backMenuButtonEvent();
|
|
1178
1341
|
}
|
|
1179
1342
|
s(`.btn-close-modal-menu`).click();
|
|
1180
1343
|
};
|
|
1344
|
+
EventsUI.onClick(`.btn-icon-menu-back`, backMenuButtonEvent);
|
|
1181
1345
|
EventsUI.onClick(`.btn-icon-menu-mode`, () => {
|
|
1182
1346
|
if (s(`.btn-icon-menu-mode-right`).classList.contains('hide')) {
|
|
1183
1347
|
s(`.btn-icon-menu-mode-right`).classList.remove('hide');
|
|
@@ -1188,6 +1352,12 @@ const Modal = {
|
|
|
1188
1352
|
}
|
|
1189
1353
|
if (slideMenuWidth === originSlideMenuWidth) {
|
|
1190
1354
|
slideMenuWidth = collapseSlideMenuWidth;
|
|
1355
|
+
setTimeout(() => {
|
|
1356
|
+
s(`.main-body-btn-container`).style[
|
|
1357
|
+
true || (options.mode && options.mode.match('right')) ? 'right' : 'left'
|
|
1358
|
+
] = options.mode && options.mode.match('right') ? `${slideMenuWidth}px` : '0px';
|
|
1359
|
+
}, 1);
|
|
1360
|
+
|
|
1191
1361
|
if (!s(`.btn-bar-center-icon-close`).classList.contains('hide')) {
|
|
1192
1362
|
sa(`.handle-btn-container`).forEach((el) => el.classList.add('hide'));
|
|
1193
1363
|
sa(`.menu-label-text`).forEach((el) => el.classList.add('hide'));
|
|
@@ -1195,18 +1365,32 @@ const Modal = {
|
|
|
1195
1365
|
sa(`.tooltip-menu`).forEach((el) => el.classList.remove('hide'));
|
|
1196
1366
|
s(`.${idModal}`).style.overflow = 'visible';
|
|
1197
1367
|
}
|
|
1368
|
+
if (s(`.menu-btn-container-main`) && s(`.menu-btn-container-main`).classList.contains('hide'))
|
|
1369
|
+
s(`.btn-icon-menu-back`).classList.add('hide');
|
|
1198
1370
|
}
|
|
1199
1371
|
if (options.onCollapseMenu) options.onCollapseMenu();
|
|
1372
|
+
s(`.sub-menu-title-container-${'modal-menu'}`).classList.add('hide');
|
|
1373
|
+
s(`.nav-path-container-${'modal-menu'}`).classList.add('hide');
|
|
1200
1374
|
} else {
|
|
1201
1375
|
slideMenuWidth = originSlideMenuWidth;
|
|
1376
|
+
setTimeout(() => {
|
|
1377
|
+
s(`.main-body-btn-container`).style[
|
|
1378
|
+
true || (options.mode && options.mode.match('right')) ? 'right' : 'left'
|
|
1379
|
+
] = options.mode && options.mode.match('right') ? `${slideMenuWidth}px` : '0px';
|
|
1380
|
+
}, 1);
|
|
1381
|
+
|
|
1202
1382
|
sa(`.handle-btn-container`).forEach((el) => el.classList.remove('hide'));
|
|
1203
1383
|
sa(`.menu-label-text`).forEach((el) => el.classList.remove('hide'));
|
|
1204
1384
|
if (!Modal.mobileModal()) {
|
|
1205
1385
|
sa(`.tooltip-menu`).forEach((el) => el.classList.add('hide'));
|
|
1206
1386
|
s(`.${idModal}`).style.overflow = null;
|
|
1207
1387
|
}
|
|
1388
|
+
if (s(`.menu-btn-container-main`) && s(`.menu-btn-container-main`).classList.contains('hide'))
|
|
1389
|
+
s(`.btn-icon-menu-back`).classList.remove('hide');
|
|
1208
1390
|
|
|
1209
1391
|
if (options.onExtendMenu) options.onExtendMenu();
|
|
1392
|
+
s(`.sub-menu-title-container-${'modal-menu'}`).classList.remove('hide');
|
|
1393
|
+
s(`.nav-path-container-${'modal-menu'}`).classList.remove('hide');
|
|
1210
1394
|
}
|
|
1211
1395
|
// btn-bar-center-icon-menu
|
|
1212
1396
|
this.actionBtnCenter();
|
|
@@ -1345,13 +1529,26 @@ const Modal = {
|
|
|
1345
1529
|
callBack,
|
|
1346
1530
|
id: options.slideMenu,
|
|
1347
1531
|
};
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1532
|
+
Responsive.Event['h-ui-hide-' + idModal] = () => {
|
|
1533
|
+
setTimeout(() => {
|
|
1534
|
+
if (!s(`.${idModal}`) || !s(`.main-body-btn-ui-close`)) return;
|
|
1535
|
+
if (s(`.btn-restore-${idModal}`).style.display !== 'none') {
|
|
1536
|
+
s(`.${idModal}`).style.height = s(`.main-body-btn-ui-close`).classList.contains('hide')
|
|
1537
|
+
? `${window.innerHeight}px`
|
|
1538
|
+
: `${
|
|
1539
|
+
window.innerHeight -
|
|
1540
|
+
(options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
|
|
1541
|
+
(options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
|
|
1542
|
+
}px`;
|
|
1543
|
+
s(`.${idModal}`).style.top = s(`.main-body-btn-ui-close`).classList.contains('hide')
|
|
1544
|
+
? `0px`
|
|
1545
|
+
: `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
|
|
1546
|
+
}
|
|
1547
|
+
});
|
|
1548
|
+
};
|
|
1549
|
+
Responsive.Event['h-ui-hide-' + idModal]();
|
|
1354
1550
|
} else {
|
|
1551
|
+
delete Responsive.Event['h-ui-hide-' + idModal];
|
|
1355
1552
|
s(`.${idModal}`).style.width = '100%';
|
|
1356
1553
|
s(`.${idModal}`).style.height = '100%';
|
|
1357
1554
|
s(`.${idModal}`).style.top = `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
|
|
@@ -1547,8 +1744,12 @@ const Modal = {
|
|
|
1547
1744
|
headerTitleHeight: 40,
|
|
1548
1745
|
actionBtnCenter: function () {
|
|
1549
1746
|
// 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'))
|
|
1551
|
-
|
|
1747
|
+
if (!s(`.btn-close-modal-menu`).classList.contains('hide')) {
|
|
1748
|
+
return s(`.btn-close-modal-menu`).click();
|
|
1749
|
+
}
|
|
1750
|
+
if (!s(`.btn-menu-modal-menu`).classList.contains('hide')) {
|
|
1751
|
+
return s(`.btn-menu-modal-menu`).click();
|
|
1752
|
+
}
|
|
1552
1753
|
},
|
|
1553
1754
|
cleanUI: function () {
|
|
1554
1755
|
s(`.top-bar`).classList.add('hide');
|
|
@@ -454,7 +454,8 @@ const PanelForm = {
|
|
|
454
454
|
},
|
|
455
455
|
});
|
|
456
456
|
|
|
457
|
-
if (options.route === 'home') setTimeout(this.Data[idPanel].updatePanel);
|
|
457
|
+
// if (options.route === 'home') setTimeout(this.Data[idPanel].updatePanel);
|
|
458
|
+
if (!Auth.getToken()) setTimeout(this.Data[idPanel].updatePanel);
|
|
458
459
|
|
|
459
460
|
if (options.parentIdModal) {
|
|
460
461
|
htmls(`.html-${options.parentIdModal}`, await renderSrrPanelData());
|