inviton-powerduck 0.0.114 → 0.0.115
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/README.md +2 -1
- package/app/powerduck-initializer.ts +39 -38
- package/app/powerduck-state.ts +157 -159
- package/app/powerduck-system-resources.ts +49 -49
- package/app/vuestsx-extended.ts +2 -2
- package/app/vuetsx.ts +66 -68
- package/common/IWebClient.ts +7 -7
- package/common/ajax-xhr.ts +112 -112
- package/common/api-http.ts +844 -740
- package/common/base-component.tsx +52 -29
- package/common/cdn-webpack-shim.ts +4 -4
- package/common/country-iso-mapping.ts +248 -248
- package/common/css/dialog-utils.css +2 -2
- package/common/date-wrapper.ts +135 -73
- package/common/dialog-utils.ts +558 -484
- package/common/enum-translation/bool-translator.ts +7 -7
- package/common/enum-translation/currency-code-translator.ts +17 -17
- package/common/enum-translation/day-translator.ts +24 -20
- package/common/enum-translation/language-translator.ts +5 -5
- package/common/enums/api.ts +2 -2
- package/common/enums/currency.ts +6 -6
- package/common/enums/day.ts +8 -8
- package/common/enums/dialog-icons.ts +22 -22
- package/common/enums/language.ts +8 -8
- package/common/enums/menu.ts +2 -3
- package/common/enums/modal.ts +3 -3
- package/common/excel/excel-js-provider.ts +96 -92
- package/common/excel/excel-reader.ts +62 -55
- package/common/external-barcode-scanner.ts +317 -317
- package/common/history-extended.ts +253 -222
- package/common/history-handler.ts +181 -151
- package/common/json-column-utils.ts +10 -10
- package/common/keyboard-open-tracker.ts +4 -8
- package/common/ladda-lite.ts +410 -390
- package/common/local-storage-shim.ts +119 -115
- package/common/localized-text.ts +15 -15
- package/common/localized-value-helper.ts +49 -49
- package/common/path-resolver.ts +13 -13
- package/common/query-string-utils.ts +57 -57
- package/common/resource-helper.ts +68 -75
- package/common/scroll-utils.ts +92 -76
- package/common/set-current-url.ts +5 -5
- package/common/slot-name-identifier.ts +3 -3
- package/common/slot-unwrapper.ts +6 -8
- package/common/static-wrappers/interfaces/validation-interface.ts +8 -12
- package/common/timezone-helper.ts +71 -62
- package/common/utils/array-extend.ts +198 -161
- package/common/utils/array-remove.ts +9 -11
- package/common/utils/array-sort.ts +56 -54
- package/common/utils/base/country-utils-base.ts +1322 -66
- package/common/utils/broswer-image-compression.ts +22 -21
- package/common/utils/capitalize-string.ts +11 -11
- package/common/utils/checkbox-utils.ts +59 -55
- package/common/utils/clipboard-provider.ts +92 -91
- package/common/utils/cookie.ts +54 -46
- package/common/utils/country-utils.ts +31 -32
- package/common/utils/currency-utils.ts +22 -15
- package/common/utils/date-localization-utils.ts +116 -51
- package/common/utils/date-utils.ts +8 -13
- package/common/utils/domain-helper.ts +64 -55
- package/common/utils/dropdown-utils.ts +68 -57
- package/common/utils/esmodule-import-helper.ts +7 -7
- package/common/utils/file-helper.ts +13 -13
- package/common/utils/flags-enum.ts +52 -48
- package/common/utils/form-utils.ts +40 -36
- package/common/utils/format-string.ts +11 -12
- package/common/utils/is-null-or-empty.ts +2 -4
- package/common/utils/language-utils.ts +139 -132
- package/common/utils/latinize-string.ts +7 -8
- package/common/utils/string-utils.ts +24 -20
- package/common/utils/upload-image-helper.ts +44 -40
- package/common/utils/utils.ts +424 -421
- package/common/validation.ts +255 -249
- package/components/accordion/accordion-page.tsx +19 -19
- package/components/accordion/accordion.tsx +112 -112
- package/components/accordion/css/accordion.css +30 -30
- package/components/alert/alert-layout.ts +8 -8
- package/components/alert/alert.tsx +10 -10
- package/components/app/breadcrumb.ts +4 -4
- package/components/app/css/navmenu.css +3 -3
- package/components/app/dynamic-component-container.tsx +82 -84
- package/components/app/dynamic-component-contracts.ts +9 -9
- package/components/app/menu.ts +10 -10
- package/components/app/navigation-guard.ts +54 -52
- package/components/app/root-dynamic-component-container.tsx +24 -24
- package/components/app/vue-plugin-jsxtransform.ts +34 -28
- package/components/app/vue-plugin-toplevelpage.ts +28 -28
- package/components/bootstrap-toggle/css/bootstrap-toggle.css +99 -99
- package/components/bootstrap-toggle/index.tsx +179 -179
- package/components/button/button-layout.ts +39 -39
- package/components/button/button-message-container.tsx +21 -21
- package/components/button/button.tsx +107 -107
- package/components/button/css/button-message-container.css +9 -9
- package/components/button/excel-upload-button.tsx +49 -49
- package/components/button/ladda-button.tsx +55 -54
- package/components/button/social-button.tsx +27 -26
- package/components/button/text-button.tsx +48 -50
- package/components/button/upload-button.tsx +171 -163
- package/components/card/card-body.tsx +8 -7
- package/components/card/card-header-with-options.tsx +55 -47
- package/components/card/card-header.tsx +29 -23
- package/components/card/card.tsx +42 -42
- package/components/card/css/card-header-with-options.css +7 -7
- package/components/card/image-card.tsx +48 -48
- package/components/chart-js/bar-chart.tsx +206 -195
- package/components/chart-js/css/line-chart-flot.css +6 -6
- package/components/chart-js/css/pie-chart.css +33 -33
- package/components/chart-js/line-chart-flot.tsx +349 -309
- package/components/chart-js/line-chart.tsx +211 -211
- package/components/chart-js/pie-chart.tsx +197 -190
- package/components/chart-js/plot.tsx +208 -197
- package/components/chart-js/thirdparty/flot/jquery.flot-patched.js +3899 -3162
- package/components/chart-js/thirdparty/flot/jquery.flot.categories.js +168 -134
- package/components/chart-js/thirdparty/flot/jquery.flot.crosshair.js +114 -109
- package/components/chart-js/thirdparty/flot/jquery.flot.navigate.js +423 -332
- package/components/chart-js/thirdparty/flot/jquery.flot.pie.js +901 -749
- package/components/chart-js/thirdparty/flot/jquery.flot.resize.js +164 -154
- package/components/chart-js/thirdparty/flot/jquery.flot.stack.js +142 -138
- package/components/chart-js/ts/color-helper.ts +182 -100
- package/components/chart-js/ts/line-chart-contracts.ts +20 -20
- package/components/chart-js/ts/utils.ts +10 -10
- package/components/chart-js/utils.ts +10 -10
- package/components/collapse/index.tsx +37 -36
- package/components/container-with-breakpoints/index.tsx +31 -33
- package/components/container-with-breakpoints/ts/breakpoint-handler.ts +59 -59
- package/components/contenteditable/index.tsx +47 -46
- package/components/context-menu/context-menu-binder.ts +32 -32
- package/components/context-menu/context-menu.tsx +17 -16
- package/components/counter/fetchdata.tsx +80 -80
- package/components/counter/index.tsx +125 -88
- package/components/counter/testall.tsx +180 -150
- package/components/datatable/col-vis-modal.tsx +54 -55
- package/components/datatable/css/datatable.css +613 -572
- package/components/datatable/css/reorder.css +8 -8
- package/components/datatable/datatable-static.tsx +28 -26
- package/components/datatable/datatable.tsx +2365 -2241
- package/components/datatable/export-excel-modal.tsx +215 -190
- package/components/datatable/filter-modal.tsx +167 -155
- package/components/datatable/ts/reorder.ts +156 -153
- package/components/datatable/upper-buttons-wrapper.tsx +12 -12
- package/components/dropdown/country-dropdown.tsx +143 -144
- package/components/dropdown/css/dropdown.css +77 -72
- package/components/dropdown/css/image-dropdown.css +53 -53
- package/components/dropdown/currency-code-picker.tsx +49 -49
- package/components/dropdown/image-dropdown.tsx +232 -227
- package/components/dropdown/index.tsx +254 -239
- package/components/dropdown/language-dropdown.tsx +64 -68
- package/components/dropdown/language-picker.tsx +59 -62
- package/components/dropdown/mobile/legacy_fdd.css +352 -355
- package/components/dropdown/mobile/legacy_fdd.ts +168 -181
- package/components/dropdown/mobile/legacy_lvb.ts +360 -355
- package/components/dropdown/timezone-picker.tsx +279 -279
- package/components/dropdown/ts/select2-multi-checkboxes.ts +93 -87
- package/components/dropdown-button/css/dropdown-button.css +22 -22
- package/components/dropdown-button/dropdown-button-element.tsx +63 -62
- package/components/dropdown-button/dropdown-button-heading.tsx +10 -9
- package/components/dropdown-button/dropdown-button-item.tsx +77 -77
- package/components/dropdown-button/dropdown-button-separator.tsx +8 -7
- package/components/dropdown-button/dropdown-button.tsx +81 -82
- package/components/dropdown-button/language-dropdown-button.tsx +46 -44
- package/components/dropzone/css/gallery-dropzone.css +16 -16
- package/components/dropzone/gallery-dropzone.tsx +393 -351
- package/components/file-downloader/index.tsx +264 -254
- package/components/form/css/fieldset.css +52 -52
- package/components/form/css/flex.css +65 -66
- package/components/form/css/form-item-wrapper.css +3 -3
- package/components/form/css/separator.css +11 -11
- package/components/form/fieldset.tsx +70 -68
- package/components/form/flex-container.tsx +26 -26
- package/components/form/footer-buttons.tsx +12 -11
- package/components/form/form-item-flex.tsx +31 -31
- package/components/form/form-item-wrapper.tsx +91 -95
- package/components/form/form.tsx +8 -7
- package/components/form/multiple-input-wrapper.tsx +93 -92
- package/components/form/separator.tsx +10 -10
- package/components/form/validation-result-displayer.tsx +24 -24
- package/components/fullcalendar/css/fullcalendar.css +40 -40
- package/components/fullcalendar/fullcalendar-draggable-event.tsx +69 -69
- package/components/fullcalendar/timegrid-calendar.tsx +506 -472
- package/components/google/maps.tsx +146 -146
- package/components/google/places-autocomplete.tsx +300 -300
- package/components/google/ts/google-maps-api.ts +40 -40
- package/components/highlight-js/index.tsx +55 -55
- package/components/home/index.tsx +75 -45
- package/components/html-literal/html-literal.tsx +20 -17
- package/components/image-crop/css/image-cropping-modal.css +2 -2
- package/components/image-crop/image-cropping-modal.tsx +321 -296
- package/components/image-crop/upload-and-crop.tsx +168 -166
- package/components/image-crop/vendor/jcrop.js +3261 -2788
- package/components/image-crop/vendor/jquery.Jcrop.css +201 -201
- package/components/import/css/import-mapper.css +21 -22
- package/components/import/import-mapper.tsx +219 -219
- package/components/input/checkbox-without-label.tsx +58 -57
- package/components/input/checkbox.tsx +140 -138
- package/components/input/color-picker.tsx +67 -67
- package/components/input/css/checkbox-without-label.css +11 -11
- package/components/input/css/color-picker.css +7 -7
- package/components/input/css/daterange-picker.css +27 -16
- package/components/input/css/image-upload.css +42 -42
- package/components/input/css/input-spinner.css +11 -11
- package/components/input/css/localized-string-input.css +60 -60
- package/components/input/css/pin.css +1 -1
- package/components/input/css/radio-button-group.css +2 -2
- package/components/input/css/wysiwig.css +29 -29
- package/components/input/currency-input.tsx +167 -163
- package/components/input/daterange-picker.tsx +155 -127
- package/components/input/datetime-picker.tsx +354 -327
- package/components/input/geo-json.tsx +47 -48
- package/components/input/gps-input.tsx +108 -108
- package/components/input/image-upload.tsx +105 -100
- package/components/input/localized-info-input.tsx +129 -114
- package/components/input/localized-string-input.tsx +236 -230
- package/components/input/localized-string-textarea.tsx +102 -101
- package/components/input/localized-string-wysiwyg.tsx +106 -105
- package/components/input/localized-url-input.tsx +325 -318
- package/components/input/numeric-input.tsx +202 -201
- package/components/input/pin-input.tsx +31 -31
- package/components/input/plugins/currency-editor/api.ts +32 -32
- package/components/input/plugins/currency-editor/currency-editor.ts +330 -311
- package/components/input/plugins/currency-editor/currency-format.ts +165 -154
- package/components/input/plugins/currency-editor/inputMask.ts +78 -73
- package/components/input/plugins/currency-editor/utils.ts +4 -12
- package/components/input/plugins/daterangepicker/daterangepicker-config.ts +2 -2
- package/components/input/plugins/daterangepicker/daterangepicker.css +326 -329
- package/components/input/plugins/daterangepicker/jquery.daterangepicker.ts +1070 -856
- package/components/input/plugins/trumbowyg/custom-cleanpaste.ts +104 -102
- package/components/input/plugins/trumbowyg/custom-colors.ts +249 -241
- package/components/input/plugins/trumbowyg/custom-upload.ts +283 -266
- package/components/input/plugins/trumbowyg/lang/cs.ts +48 -48
- package/components/input/plugins/trumbowyg/lang/de.ts +50 -50
- package/components/input/plugins/trumbowyg/lang/sk.ts +53 -55
- package/components/input/plugins/trumbowyg/modal-issues-fix.ts +146 -140
- package/components/input/plugins/trumbowyg/wysiwyg-config.ts +50 -51
- package/components/input/radio-button-group.tsx +199 -195
- package/components/input/textarea.tsx +72 -71
- package/components/input/textbox-without-label.tsx +92 -92
- package/components/input/textbox.tsx +135 -132
- package/components/input/ts/bootstrapInputSpinner.ts +380 -361
- package/components/input/ts/dateInputHelper.ts +124 -117
- package/components/input/video-urls.tsx +171 -172
- package/components/input/wysiwig.tsx +668 -573
- package/components/lightbox/css/lightbox.css +7 -7
- package/components/lightbox/index.tsx +84 -83
- package/components/loading-indicator/index.tsx +30 -30
- package/components/long-content-container/css/index.css +1 -1
- package/components/long-content-container/index.tsx +29 -27
- package/components/memory-cache/index.ts +35 -37
- package/components/mobile-optimized-hero-filter/css/mobile-optimized-hero-filter.css +4 -5
- package/components/mobile-optimized-hero-filter/index.tsx +43 -43
- package/components/modal/animation-error.tsx +20 -20
- package/components/modal/animation-success.tsx +22 -22
- package/components/modal/css/file-manager-dialog.css +12 -12
- package/components/modal/css/modal.css +52 -53
- package/components/modal/icon-question.tsx +17 -17
- package/components/modal/icon-warning.tsx +17 -17
- package/components/modal/modal-body.tsx +10 -9
- package/components/modal/modal-footer.tsx +8 -7
- package/components/modal/modal-utils.ts +22 -21
- package/components/modal/modal.tsx +161 -160
- package/components/modal/ts/file-manager-dialog.ts +81 -81
- package/components/modal-wrap/css/modal-section-wrapper.css +2 -2
- package/components/modal-wrap/css/modal-subtitle.css +8 -8
- package/components/modal-wrap/modal-section-wrapper.tsx +51 -52
- package/components/modal-wrap/modal-section.tsx +34 -35
- package/components/modal-wrap/modal-subtitle.tsx +10 -10
- package/components/modal-wrap/modal-wrapper-helper.ts +10 -10
- package/components/open-street-map/css/open-street-map.css +28 -29
- package/components/open-street-map/open-street-map.tsx +118 -98
- package/components/open-street-map/ts/gesture-handling/css/leaflet-gesture-handling.scss +47 -48
- package/components/open-street-map/ts/gesture-handling/gesture-handling.ts +337 -312
- package/components/parallax/css/parallax.css +11 -11
- package/components/parallax/parallax-background.tsx +14 -14
- package/components/parallax/parallax-container.tsx +20 -20
- package/components/parallax/parallax-content.tsx +10 -10
- package/components/photos/photo-manager.tsx +117 -122
- package/components/progress-bar/css/progress-bar.css +29 -29
- package/components/progress-bar/index.tsx +73 -61
- package/components/progress-circle/css/index.css +513 -411
- package/components/progress-circle/fake-progress-circle.tsx +46 -46
- package/components/progress-circle/index.tsx +19 -19
- package/components/quick-edit/quick-edit-modal-base.tsx +127 -127
- package/components/quick-edit/quick-edit-modal-status-base.tsx +52 -51
- package/components/rating/css/rating.css +4 -4
- package/components/rating/rating-displayer.tsx +21 -21
- package/components/rating/rating-picker.tsx +65 -68
- package/components/share/css/share.css +16 -16
- package/components/share/share-modal.tsx +258 -260
- package/components/share/share.tsx +226 -229
- package/components/sortable/sortable-container.tsx +51 -51
- package/components/sortable/sortable-item.tsx +9 -10
- package/components/spreadsheet/css/spreadsheet.css +1 -1
- package/components/spreadsheet/spreadsheet.tsx +116 -119
- package/components/stars/css/stars.css +2 -3
- package/components/stars/stars.tsx +60 -59
- package/components/summary-stats/css/summary-stats.css +35 -35
- package/components/summary-stats/summary-stats-item.tsx +53 -52
- package/components/summary-stats/summary-stats.tsx +13 -12
- package/components/sweetalert2/css/sweetalert2.css +852 -829
- package/components/swiper/css/gallery-swiper.css +21 -21
- package/components/swiper/css/swiper.css +1 -1
- package/components/swiper/swiper-gallery.tsx +72 -70
- package/components/swiper/swiper-slide.tsx +6 -5
- package/components/swiper/swiper.tsx +78 -72
- package/components/table-wrapper/css/table-wrapper.css +51 -51
- package/components/table-wrapper/table-wrapper.tsx +19 -19
- package/components/tabs/tab-page.tsx +20 -20
- package/components/tabs/tabs.tsx +284 -266
- package/components/teleport/teleport.tsx +29 -31
- package/components/tilebox/css/tilebox-alt.css +243 -243
- package/components/tilebox/css/tilebox.css +248 -248
- package/components/tilebox/tilebox.tsx +68 -68
- package/components/tooltip/index.tsx +80 -80
- package/components/transition/css/transition.css +3 -3
- package/components/transition/index.tsx +13 -12
- package/components/ui/notification.ts +187 -170
- package/components/wizard/css/wizard.css +154 -154
- package/components/wizard/wizard-subtitle.tsx +8 -7
- package/components/wizard/wizard-tab.tsx +20 -20
- package/components/wizard/wizard.tsx +174 -169
- package/data/geo.ts +10 -10
- package/data/image.ts +6 -6
- package/data/photo.ts +7 -7
- package/package.json +87 -70
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Inviton Powerduck framework
|
|
2
|
+
|
|
2
3
|

|
|
3
4
|
|
|
4
5
|
Framework containing main TSX components and frontend utility functions for use in projects.
|
|
5
6
|
|
|
6
|
-
Built using Vue3 + vue-facing-decorator package.
|
|
7
|
+
Built using Vue3 + vue-facing-decorator package.
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { LanguageUtils } from '../common/utils/language-utils';
|
|
1
|
+
import type { Language } from '../common/enums/language';
|
|
2
|
+
import type { PowerduckStateInitArgs } from './powerduck-state';
|
|
3
|
+
import type { IPowerduckSystemResources } from './powerduck-system-resources';
|
|
4
|
+
import jquery from 'jquery';
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import select2 from 'select2';
|
|
8
7
|
import { isNullOrEmpty } from '../common/utils/is-null-or-empty';
|
|
8
|
+
import { LanguageUtils } from '../common/utils/language-utils';
|
|
9
|
+
import PowerduckState from './powerduck-state';
|
|
9
10
|
|
|
10
11
|
export interface PoweduckInitFrameworkArgs {
|
|
11
|
-
|
|
12
|
+
supportedLanguages?: Language[];
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export default class PowerduckInitializer {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
static initFramework(args?: PoweduckInitFrameworkArgs) {
|
|
17
|
+
window.jQuery = jquery;
|
|
18
|
+
window.$ = window.jQuery;
|
|
19
|
+
window.moment = moment;
|
|
20
|
+
window.select2 = select2();
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
if ((window as any).__viteErrHandlerBound != true) {
|
|
23
|
+
(window as any).__viteErrHandlerBound = true;
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
window.addEventListener('vite:preloadError', (event) => {
|
|
26
|
+
const key = `${PowerduckState.getAppPrefix()}errLastReload`;
|
|
27
|
+
const lastTry = Number(localStorage.getItem(key) || '0');
|
|
28
|
+
if (new Date().getTime() - lastTry > 3000) {
|
|
29
|
+
localStorage.setItem(key, new Date().getTime().toString());
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
if ((window as any).__routerNextTo != null && !isNullOrEmpty((window as any).__routerNextTo.path)) {
|
|
32
|
+
location.href = (window as any).__routerNextTo.path;
|
|
33
|
+
} else {
|
|
34
|
+
location.reload();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
if (args != null) {
|
|
41
|
+
if (args.supportedLanguages?.length as number > 0) {
|
|
42
|
+
LanguageUtils.supportedLanguages = args.supportedLanguages as Language[];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
47
|
+
static initState<TResoures extends IPowerduckSystemResources>(resources: TResoures, args?: PowerduckStateInitArgs) {
|
|
48
|
+
PowerduckState.initialize(resources, args);
|
|
49
|
+
}
|
|
50
|
+
}
|
package/app/powerduck-state.ts
CHANGED
|
@@ -1,182 +1,180 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import type { IDynamicComponentContainer } from '../components/app/dynamic-component-contracts';
|
|
2
|
+
import type { IPowerduckSystemResources } from './powerduck-system-resources';
|
|
3
|
+
import { Language } from '../common/enums/language';
|
|
4
|
+
import { ModalSectionMode } from '../common/enums/modal';
|
|
5
|
+
import { isNullOrEmpty } from '../common/utils/is-null-or-empty';
|
|
7
6
|
|
|
8
7
|
type PublicStaticMethods<T> = {
|
|
9
|
-
|
|
8
|
+
[K in keyof T]: T[K] extends (...args: any[]) => any ? T[K] : never;
|
|
10
9
|
};
|
|
11
10
|
|
|
12
11
|
// Extract the public static methods from PowerduckState
|
|
13
12
|
export type PowerduckStateInitArgs = Partial<PublicStaticMethods<typeof PowerduckState>> & {
|
|
14
|
-
|
|
13
|
+
keyPrefix: string;
|
|
15
14
|
};
|
|
16
15
|
|
|
17
16
|
export default class PowerduckState {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
17
|
+
private static _resources: IPowerduckSystemResources;
|
|
18
|
+
private static _language: Language;
|
|
19
|
+
private static _fullBlockerHtml = document.querySelector('.loading-full-overlay')?.outerHTML || `<div class="loading-full-overlay"><div class="loading-inner"><div class="loading-indicator-wrap"><div class="holdon-white holdon-overlay holdon-element"><div class="holdon-content"><div class="sk-rect"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div></div></div></div></div></div>`;
|
|
20
|
+
private static _blockerHtml = '<div class="holdon-white holdon-overlay holdon-element"><div class="holdon-content"><div class="sk-rect"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div></div></div>';
|
|
21
|
+
private static _blockerSelector = '.holdon-overlay';
|
|
22
|
+
private static _stickyMap: { [index: string]: IStickyDeclaration } = {};
|
|
23
|
+
private static _prefix: string = '';
|
|
24
|
+
|
|
25
|
+
static initialize(resources: IPowerduckSystemResources, args?: PowerduckStateInitArgs) {
|
|
26
|
+
PowerduckState._resources = resources;
|
|
27
|
+
PowerduckState._prefix = args.keyPrefix;
|
|
28
|
+
|
|
29
|
+
if (args != null) {
|
|
30
|
+
for (const key in args) {
|
|
31
|
+
PowerduckState[key] = args[key];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static getAppPrefix(): string {
|
|
37
|
+
return PowerduckState._prefix;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static getCurrentLanguage(): Language {
|
|
41
|
+
return this._language ?? Language.sk;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static getIntransparentBlockerHtml(): string {
|
|
45
|
+
return PowerduckState._fullBlockerHtml;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static getBlockerHtml(): string {
|
|
49
|
+
return PowerduckState._blockerHtml;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static getBlockerSelector(): string {
|
|
53
|
+
return PowerduckState._blockerSelector;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static getResourceValue(key: keyof IPowerduckSystemResources) {
|
|
57
|
+
if (this._resources != null) {
|
|
58
|
+
return this._resources[key] || `{{${key}}}`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return `{{${key}}}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static getCdnPath() {
|
|
65
|
+
return '';
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static getAssetRootDirectory() {
|
|
69
|
+
return `${PowerduckState.getCdnPath()}/assets`;
|
|
70
|
+
}
|
|
72
71
|
|
|
73
72
|
static getFilesPath() {
|
|
74
73
|
return '';
|
|
75
74
|
}
|
|
76
75
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
static getCurrentRouteQuery(): any {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
80
79
|
|
|
81
80
|
static getRouter(): any {
|
|
82
81
|
return null;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
84
|
+
static getBootstrapOnStyle(): 'primary' | 'info' {
|
|
85
|
+
return 'primary';
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
static getFormControlCssClass(): string {
|
|
89
|
+
return 'form-control maxwidth-input';
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
static getGeonamesUsername(): string {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
static getGoogleMapsApiKey(): string {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
static getModalSectionMode(): ModalSectionMode {
|
|
101
|
+
if ((PowerduckState as any)._modalSectionMode == null) {
|
|
102
|
+
if (localStorage.getItem(`${PowerduckState._prefix}modalSectionMode`) != null) {
|
|
103
|
+
(PowerduckState as any)._modalSectionMode = Number(localStorage.getItem(`${PowerduckState._prefix}modalSectionMode`));
|
|
104
|
+
} else {
|
|
105
|
+
PowerduckState.setModalSectionMode(ModalSectionMode.navPills);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return (PowerduckState as any)._modalSectionMode;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
static setModalSectionMode(mode: ModalSectionMode): void {
|
|
113
|
+
localStorage.setItem(`${PowerduckState._prefix}modalSectionMode`, mode.toString());
|
|
114
|
+
(PowerduckState as any)._modalSectionMode = mode;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static parseErrorMessage(respText: string): string {
|
|
118
|
+
let parsedErr: any;
|
|
119
|
+
if (respText == null || respText.indexOf('{') != 0) {
|
|
120
|
+
return respText;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
parsedErr = JSON.parse(respText);
|
|
125
|
+
} catch (error) {
|
|
126
|
+
parsedErr = respText as any;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (!isNullOrEmpty(parsedErr?.messages)) {
|
|
130
|
+
let msgBuilder = '';
|
|
131
|
+
parsedErr.messages.forEach((msgData) => {
|
|
132
|
+
if (!isNullOrEmpty(msgData.message)) {
|
|
133
|
+
if (msgBuilder.length > 0) {
|
|
134
|
+
msgBuilder += '\n\n';
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
msgBuilder += msgData.message;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
return msgBuilder;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
static get rootDynamicComponentContainer(): IDynamicComponentContainer {
|
|
148
|
+
return window.RootDynamicContainerInstance;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
static registerStickyTabs(id: string, state: IStickyDeclaration): void {
|
|
152
|
+
PowerduckState._stickyMap[id] = state;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
static unregisterStickyTabs(id: string): void {
|
|
156
|
+
if (PowerduckState._stickyMap[id] != null) {
|
|
157
|
+
try {
|
|
158
|
+
delete PowerduckState._stickyMap[id];
|
|
159
|
+
} catch (e) { }
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
static get stickyTabs(): IStickyDeclaration {
|
|
164
|
+
for (const id in PowerduckState._stickyMap) {
|
|
165
|
+
if (PowerduckState._stickyMap[id].HasSticky) {
|
|
166
|
+
return PowerduckState._stickyMap[id];
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
AllowTabChange: true,
|
|
172
|
+
HasSticky: false,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
177
175
|
}
|
|
178
176
|
|
|
179
177
|
interface IStickyDeclaration {
|
|
180
|
-
|
|
181
|
-
|
|
178
|
+
HasSticky: boolean;
|
|
179
|
+
AllowTabChange: boolean;
|
|
182
180
|
}
|
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
export interface IPowerduckSystemResources {
|
|
2
|
-
requestTimeout: string
|
|
3
|
-
yes: string
|
|
2
|
+
requestTimeout: string;
|
|
3
|
+
yes: string;
|
|
4
4
|
no: string;
|
|
5
|
-
all: string
|
|
6
|
-
add: string
|
|
7
|
-
error: string
|
|
8
|
-
errorFetchingData: string
|
|
5
|
+
all: string;
|
|
6
|
+
add: string;
|
|
7
|
+
error: string;
|
|
8
|
+
errorFetchingData: string;
|
|
9
9
|
allTogether: string;
|
|
10
|
-
edit: string
|
|
11
|
-
remove: string
|
|
12
|
-
warning: string
|
|
13
|
-
cancel: string
|
|
14
|
-
negationBase: string
|
|
15
|
-
continue: string
|
|
16
|
-
back: string
|
|
17
|
-
submit: string
|
|
18
|
-
close: string
|
|
19
|
-
save: string
|
|
20
|
-
search: string
|
|
21
|
-
searchedValue: string
|
|
22
|
-
image: string
|
|
23
|
-
noResultsFound: string
|
|
24
|
-
colVisLabel: string
|
|
25
|
-
deletePromptSingular: string
|
|
26
|
-
dtMassOperationWarningText: string
|
|
27
|
-
dtLayoutMobile: string
|
|
28
|
-
dtLayoutTable: string
|
|
29
|
-
dtLayoutCompact: string
|
|
30
|
-
recordsDtLabel: string
|
|
31
|
-
dtCountText: string
|
|
32
|
-
dtCountFilteredOutOf: string
|
|
33
|
-
dtNoMobileFilter: string
|
|
34
|
-
dtOnlyExclusive: string
|
|
35
|
-
itemsOutOfArray: string
|
|
36
|
-
fileDownloadTitle: string
|
|
37
|
-
imageCrop: string
|
|
38
|
-
uploadImage: string
|
|
39
|
-
copyToClipboard: string
|
|
40
|
-
copyToClipboardSuccess: string
|
|
41
|
-
loginExpired: string
|
|
42
|
-
gpsLabel: string
|
|
43
|
-
gpsSubtitle: string
|
|
44
|
-
gpsLatitudeCaption: string
|
|
45
|
-
gpsLongitudeCaption: string
|
|
46
|
-
currencyCode: string
|
|
47
|
-
photosErrorMessage: string
|
|
48
|
-
photosInitialMessage: string
|
|
49
|
-
photosInvalidFileMessage: string
|
|
50
|
-
quickEdit: string
|
|
51
|
-
quickEditItemsCount: string
|
|
52
|
-
quickEditErrorNamed: string
|
|
10
|
+
edit: string;
|
|
11
|
+
remove: string;
|
|
12
|
+
warning: string;
|
|
13
|
+
cancel: string;
|
|
14
|
+
negationBase: string;
|
|
15
|
+
continue: string;
|
|
16
|
+
back: string;
|
|
17
|
+
submit: string;
|
|
18
|
+
close: string;
|
|
19
|
+
save: string;
|
|
20
|
+
search: string;
|
|
21
|
+
searchedValue: string;
|
|
22
|
+
image: string;
|
|
23
|
+
noResultsFound: string;
|
|
24
|
+
colVisLabel: string;
|
|
25
|
+
deletePromptSingular: string;
|
|
26
|
+
dtMassOperationWarningText: string;
|
|
27
|
+
dtLayoutMobile: string;
|
|
28
|
+
dtLayoutTable: string;
|
|
29
|
+
dtLayoutCompact: string;
|
|
30
|
+
recordsDtLabel: string;
|
|
31
|
+
dtCountText: string;
|
|
32
|
+
dtCountFilteredOutOf: string;
|
|
33
|
+
dtNoMobileFilter: string;
|
|
34
|
+
dtOnlyExclusive: string;
|
|
35
|
+
itemsOutOfArray: string;
|
|
36
|
+
fileDownloadTitle: string;
|
|
37
|
+
imageCrop: string;
|
|
38
|
+
uploadImage: string;
|
|
39
|
+
copyToClipboard: string;
|
|
40
|
+
copyToClipboardSuccess: string;
|
|
41
|
+
loginExpired: string;
|
|
42
|
+
gpsLabel: string;
|
|
43
|
+
gpsSubtitle: string;
|
|
44
|
+
gpsLatitudeCaption: string;
|
|
45
|
+
gpsLongitudeCaption: string;
|
|
46
|
+
currencyCode: string;
|
|
47
|
+
photosErrorMessage: string;
|
|
48
|
+
photosInitialMessage: string;
|
|
49
|
+
photosInvalidFileMessage: string;
|
|
50
|
+
quickEdit: string;
|
|
51
|
+
quickEditItemsCount: string;
|
|
52
|
+
quickEditErrorNamed: string;
|
|
53
53
|
|
|
54
54
|
languageSK: string;
|
|
55
55
|
languageEN: string;
|
package/app/vuestsx-extended.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { PowerduckViewModelBase } from '../common/base-component';
|
|
2
2
|
|
|
3
3
|
export abstract class TsxComponentExtendedBase<P> extends PowerduckViewModelBase {
|
|
4
|
-
|
|
4
|
+
private vueTsxProps: Readonly<{ ref?: string; key?: string | number }> & Readonly<P>;
|
|
5
5
|
}
|