@rws-framework/client 2.13.1 → 2.13.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/.bin/add-v.sh +9 -9
- package/.bin/emerge.sh +15 -15
- package/.emerge-fast.yaml +46 -46
- package/.emerge-typescript-template.yaml +23 -23
- package/.emerge-vis-output/fast-element/emerge-file_result_dependency_graph.graphml +693 -693
- package/.emerge-vis-output/fast-element/emerge-filesystem_graph.graphml +705 -705
- package/.emerge-vis-output/fast-element/emerge-statistics-metrics.txt +440 -440
- package/.emerge-vis-output/fast-element/html/emerge.html +500 -500
- package/.emerge-vis-output/fast-element/html/jsconfig.json +8 -8
- package/.emerge-vis-output/fast-element/html/resources/css/custom.css +211 -211
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_common.js +44 -44
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_data.js +13 -13
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_git.js +1413 -1413
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_graph.js +539 -539
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_heatmap.js +219 -219
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_hull.js +179 -179
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_main.js +1002 -1002
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_search.js +71 -71
- package/.emerge-vis-output/fast-element/html/resources/js/emerge_ui.js +199 -199
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-grid.css +4123 -4123
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-grid.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-grid.rtl.css +4122 -4122
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-grid.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-reboot.css +487 -487
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-reboot.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-reboot.rtl.css +484 -484
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-utilities.css +4265 -4265
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-utilities.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css +4256 -4256
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap.css +10877 -10877
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap.rtl.css +10841 -10841
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/css/bootstrap.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.bundle.js +7075 -7075
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.bundle.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.esm.js +5202 -5202
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.esm.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.js +5249 -5249
- package/.emerge-vis-output/fast-element/html/vendors/bootstrap/js/bootstrap.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/d3/d3.v7.8.4.min.js +2 -2
- package/.emerge-vis-output/fast-element/html/vendors/d3/d3.v7.min.js +2 -2
- package/.emerge-vis-output/fast-element/html/vendors/dark-mode-switch/css/dark-mode.css +148 -148
- package/.emerge-vis-output/fast-element/html/vendors/daterangepicker/daterangepicker.min.js +7 -7
- package/.emerge-vis-output/fast-element/html/vendors/daterangepicker/moment.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/hull/hull.js +373 -373
- package/.emerge-vis-output/fast-element/html/vendors/jquery/jquery-3.6.0.min.js +2 -2
- package/.emerge-vis-output/fast-element/html/vendors/popper/popper.min.js +6 -6
- package/.emerge-vis-output/fast-element/html/vendors/simpleheat/simpleheat.js +141 -141
- package/.emerge-vis-output/fast-foundation/emerge-file_result_dependency_graph.graphml +4043 -4043
- package/.emerge-vis-output/fast-foundation/emerge-filesystem_graph.graphml +4538 -4538
- package/.emerge-vis-output/fast-foundation/emerge-statistics-metrics.txt +2510 -2510
- package/.emerge-vis-output/fast-foundation/html/emerge.html +500 -500
- package/.emerge-vis-output/fast-foundation/html/jsconfig.json +8 -8
- package/.emerge-vis-output/fast-foundation/html/resources/css/custom.css +211 -211
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_common.js +44 -44
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_data.js +13 -13
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_git.js +1413 -1413
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_graph.js +539 -539
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_heatmap.js +219 -219
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_hull.js +179 -179
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_main.js +1002 -1002
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_search.js +71 -71
- package/.emerge-vis-output/fast-foundation/html/resources/js/emerge_ui.js +199 -199
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-grid.css +4123 -4123
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-grid.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-grid.rtl.css +4122 -4122
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-grid.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-reboot.css +487 -487
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-reboot.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-reboot.rtl.css +484 -484
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-utilities.css +4265 -4265
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-utilities.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css +4256 -4256
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap.css +10877 -10877
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap.rtl.css +10841 -10841
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/css/bootstrap.rtl.min.css +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.bundle.js +7075 -7075
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.bundle.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.esm.js +5202 -5202
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.esm.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.js +5249 -5249
- package/.emerge-vis-output/fast-foundation/html/vendors/bootstrap/js/bootstrap.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/d3/d3.v7.8.4.min.js +2 -2
- package/.emerge-vis-output/fast-foundation/html/vendors/d3/d3.v7.min.js +2 -2
- package/.emerge-vis-output/fast-foundation/html/vendors/dark-mode-switch/css/dark-mode.css +148 -148
- package/.emerge-vis-output/fast-foundation/html/vendors/daterangepicker/daterangepicker.min.js +7 -7
- package/.emerge-vis-output/fast-foundation/html/vendors/daterangepicker/moment.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/hull/hull.js +373 -373
- package/.emerge-vis-output/fast-foundation/html/vendors/jquery/jquery-3.6.0.min.js +2 -2
- package/.emerge-vis-output/fast-foundation/html/vendors/popper/popper.min.js +6 -6
- package/.emerge-vis-output/fast-foundation/html/vendors/simpleheat/simpleheat.js +141 -141
- package/.emerge-vis-output/rws-client/emerge-file_result_dependency_graph.graphml +1143 -1143
- package/.emerge-vis-output/rws-client/emerge-filesystem_graph.graphml +1003 -1003
- package/.emerge-vis-output/rws-client/emerge-statistics-metrics.txt +655 -655
- package/.emerge-vis-output/rws-client/html/emerge.html +500 -500
- package/.emerge-vis-output/rws-client/html/jsconfig.json +8 -8
- package/.emerge-vis-output/rws-client/html/resources/css/custom.css +211 -211
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_common.js +44 -44
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_data.js +13 -13
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_git.js +1413 -1413
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_graph.js +539 -539
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_heatmap.js +219 -219
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_hull.js +179 -179
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_main.js +1002 -1002
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_search.js +71 -71
- package/.emerge-vis-output/rws-client/html/resources/js/emerge_ui.js +199 -199
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.css +4123 -4123
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.rtl.css +4122 -4122
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-grid.rtl.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.css +487 -487
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.css +484 -484
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-reboot.rtl.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.css +4265 -4265
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.css +4256 -4256
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap-utilities.rtl.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.css +10877 -10877
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.rtl.css +10841 -10841
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/css/bootstrap.rtl.min.css +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.bundle.js +7075 -7075
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.bundle.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.esm.js +5202 -5202
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.esm.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.js +5249 -5249
- package/.emerge-vis-output/rws-client/html/vendors/bootstrap/js/bootstrap.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/d3/d3.v7.8.4.min.js +2 -2
- package/.emerge-vis-output/rws-client/html/vendors/d3/d3.v7.min.js +2 -2
- package/.emerge-vis-output/rws-client/html/vendors/dark-mode-switch/css/dark-mode.css +148 -148
- package/.emerge-vis-output/rws-client/html/vendors/daterangepicker/daterangepicker.min.js +7 -7
- package/.emerge-vis-output/rws-client/html/vendors/daterangepicker/moment.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/hull/hull.js +373 -373
- package/.emerge-vis-output/rws-client/html/vendors/jquery/jquery-3.6.0.min.js +2 -2
- package/.emerge-vis-output/rws-client/html/vendors/popper/popper.min.js +6 -6
- package/.emerge-vis-output/rws-client/html/vendors/simpleheat/simpleheat.js +141 -141
- package/.eslintrc.json +51 -51
- package/.gitmodules +2 -2
- package/.setup/.eslintrc.json +11 -11
- package/.setup/_base.eslintrc.json +48 -48
- package/.setup/tsconfig.json +28 -28
- package/PLUGINS.MD +188 -188
- package/README.md +1023 -1023
- package/_tools.js +396 -396
- package/builder/vite/index.ts +4 -4
- package/{cfg/build_steps → builder}/vite/loaders/html.ts +11 -11
- package/{cfg/build_steps → builder}/vite/loaders/index.ts +8 -8
- package/{cfg/build_steps → builder}/vite/loaders/loader.type.ts +27 -27
- package/{cfg/build_steps → builder}/vite/loaders/scss.ts +32 -32
- package/{cfg/build_steps → builder}/vite/loaders/ts.ts +309 -312
- package/builder/vite/rws.vite.config.ts +56 -49
- package/{cfg/build_steps → builder}/vite/rws_scss_plugin.ts +61 -60
- package/{cfg/build_steps → builder}/vite/scss/_compiler.ts +95 -94
- package/{cfg/build_steps → builder}/vite/scss/_fonts.ts +80 -80
- package/{cfg/build_steps → builder}/vite/scss/_fs.ts +83 -81
- package/{cfg/build_steps → builder}/vite/scss/_import.ts +191 -184
- package/builder/webpack/after/copy.js +78 -78
- package/builder/webpack/after/sw.js +13 -13
- package/builder/webpack/index.js +10 -10
- package/builder/webpack/loaders/rws_fast_html_loader.js +17 -17
- package/builder/webpack/loaders/rws_fast_scss_loader.js +43 -43
- package/builder/webpack/loaders/rws_fast_ts_loader.js +96 -96
- package/builder/webpack/loaders/ts/html_error.js +19 -19
- package/builder/webpack/rws.webpack.config.js +169 -169
- package/builder/webpack/rws_scss_plugin.js +62 -62
- package/builder/webpack/rws_webpack_plugin.js +137 -137
- package/builder/webpack/scss/_compiler.js +97 -97
- package/builder/webpack/scss/_fonts.js +80 -80
- package/builder/webpack/scss/_fs.js +84 -84
- package/builder/webpack/scss/_import.js +186 -186
- package/cfg/_default.cfg.js +26 -26
- package/cfg/_storage.d.ts +22 -22
- package/cfg/_storage.js +42 -42
- package/cfg/build_steps/vite/_build_config.ts +105 -105
- package/cfg/build_steps/vite/_env_defines.ts +17 -17
- package/cfg/build_steps/vite/_loaders.ts +187 -184
- package/cfg/build_steps/vite/index.ts +2 -2
- package/cfg/build_steps/vite/types.ts +7 -7
- package/cfg/build_steps/webpack/_actions.js +85 -85
- package/cfg/build_steps/webpack/_aliases.js +9 -9
- package/cfg/build_steps/webpack/_build_config.js +76 -76
- package/cfg/build_steps/webpack/_cache.js +98 -98
- package/cfg/build_steps/webpack/_component_handling.js +60 -60
- package/cfg/build_steps/webpack/_dev_servers.js +14 -14
- package/cfg/build_steps/webpack/_env_defines.js +18 -18
- package/cfg/build_steps/webpack/_info.js +18 -18
- package/cfg/build_steps/webpack/_loaders.js +223 -223
- package/cfg/build_steps/webpack/_plugins.js +102 -102
- package/cfg/build_steps/webpack/_production.js +37 -37
- package/cfg/build_steps/webpack/_rws_externals.js +68 -68
- package/cfg/build_steps/webpack/_timing.js +52 -52
- package/cfg/build_steps/webpack/_webpack_config.js +58 -58
- package/cfg/tsconfigSetup.js +150 -150
- package/console.js +86 -86
- package/docs/assets/26e93147f10415a0ed4a.svg +6 -6
- package/docs/assets/75c9471662e97ee24f29.svg +7 -7
- package/docs/assets/db90e4df2373980c497d.svg +9 -9
- package/docs/assets/highlight.css +127 -127
- package/docs/assets/main.js +59 -59
- package/docs/assets/style.css +1414 -1414
- package/docs/classes/ApiServiceInstance.html +25 -25
- package/docs/classes/ConfigServiceInstance.html +21 -21
- package/docs/classes/DOMServiceInstance.html +17 -17
- package/docs/classes/NotifyServiceInstance.html +15 -15
- package/docs/classes/RWSClientInstance.html +45 -45
- package/docs/classes/RWSPlugin.html +13 -13
- package/docs/classes/RWSService.html +10 -10
- package/docs/classes/RWSViewComponent.html +1022 -1022
- package/docs/classes/ServiceWorkerServiceInstance.html +13 -13
- package/docs/classes/UtilsServiceInstance.html +13 -13
- package/docs/functions/attr.html +5 -5
- package/docs/functions/observable.html +3 -3
- package/docs/index.html +179 -179
- package/docs/interfaces/HTMLTag.html +3 -3
- package/docs/interfaces/IRWSConfig.html +20 -20
- package/docs/interfaces/IRWSDecoratorOptions.html +5 -5
- package/docs/interfaces/IRWSHttpRoute.html +2 -2
- package/docs/interfaces/IRWSPrefixedHTTProutes.html +2 -2
- package/docs/interfaces/IRWSUser.html +5 -5
- package/docs/modules.html +45 -45
- package/foundation/index.js +1 -1
- package/foundation/rws-foundation.d.ts +7 -7
- package/foundation/rws-foundation.js +7 -7
- package/package.json +108 -108
- package/service_worker/src/_service_worker.ts +83 -83
- package/service_worker/tsconfig.json +20 -20
- package/service_worker/webpack.config.js +66 -66
- package/src/client/components.ts +67 -67
- package/src/client/config.ts +165 -165
- package/src/client/services.ts +27 -27
- package/src/client.ts +212 -212
- package/src/components/_attrs/_default_observable_accessor.ts +8 -8
- package/src/components/_attrs/_extended_accessor.ts +40 -40
- package/src/components/_attrs/_external_handler.ts +7 -7
- package/src/components/_attrs/_external_observable_accessor.ts +8 -8
- package/src/components/_attrs/angular-attr.ts +34 -34
- package/src/components/_attrs/external-attr.ts +59 -59
- package/src/components/_attrs/external-observable.ts +52 -52
- package/src/components/_attrs/sanitize-html.ts +80 -80
- package/src/components/_component.ts +245 -245
- package/src/components/_container.ts +15 -15
- package/src/components/_decorator.ts +122 -122
- package/src/components/_decorators/RWSFillBuild.ts +54 -54
- package/src/components/_decorators/RWSInject.ts +49 -49
- package/src/components/_decorators/RWSService.ts +11 -11
- package/src/components/_decorators/_di.ts +15 -15
- package/src/components/_definitions.ts +64 -64
- package/src/components/_event_handling.ts +40 -40
- package/src/components/index.ts +14 -14
- package/src/components/loader/component.ts +12 -12
- package/src/components/loader/styles/layout.scss +13 -13
- package/src/components/progress/component.ts +54 -54
- package/src/components/progress/styles/layout.scss +90 -90
- package/src/components/progress/template.html +24 -24
- package/src/components/uploader/component.ts +83 -83
- package/src/components/uploader/styles/layout.scss +130 -130
- package/src/components/uploader/template.html +16 -16
- package/src/index.ts +93 -93
- package/src/plugins/_builder.js +31 -31
- package/src/plugins/_plugin.ts +63 -63
- package/src/services/ApiService.ts +242 -242
- package/src/services/ConfigService.ts +134 -134
- package/src/services/DOMService.ts +100 -100
- package/src/services/NotifyService.ts +47 -47
- package/src/services/ServiceWorkerService.ts +60 -60
- package/src/services/UtilsService.ts +60 -60
- package/src/services/_service.ts +64 -64
- package/src/styles/_darkreader.scss +30 -30
- package/src/styles/_grid.scss +75 -75
- package/src/styles/_misc.scss +8 -8
- package/src/styles/_scrollbars.scss +40 -40
- package/src/styles/includes.scss +4 -4
- package/src/types/IRWSConfig.ts +30 -30
- package/src/types/IRWSPlugin.ts +18 -18
- package/src/types/IRWSUser.ts +6 -6
- package/src/types/IRWSViewComponent.ts +36 -36
- package/src/types/RWSNotify.ts +6 -6
- package/src/types/RWSWindow.ts +41 -41
- package/tsconfig.json +30 -30
- package/typedoc.json +13 -13
- package/types/declarations.d.ts +8 -8
- package/types/docs-typings.d.ts +15 -15
package/src/client.ts
CHANGED
|
@@ -1,213 +1,213 @@
|
|
|
1
|
-
import IRWSConfig, { RWSPluginEntry } from './types/IRWSConfig';
|
|
2
|
-
|
|
3
|
-
import RWSNotify from './types/RWSNotify';
|
|
4
|
-
|
|
5
|
-
import ConfigService, { ConfigServiceInstance } from './services/ConfigService';
|
|
6
|
-
import UtilsService, { UtilsServiceInstance } from './services/UtilsService';
|
|
7
|
-
import DOMService, { DOMServiceInstance } from './services/DOMService';
|
|
8
|
-
import ApiService, { ApiServiceInstance } from './services/ApiService';
|
|
9
|
-
import NotifyService, { NotifyServiceInstance } from './services/NotifyService';
|
|
10
|
-
|
|
11
|
-
import ServiceWorkerService, { ServiceWorkerServiceInstance } from './services/ServiceWorkerService';
|
|
12
|
-
import { IBackendRoute } from './services/ApiService';
|
|
13
|
-
import IRWSUser from './types/IRWSUser';
|
|
14
|
-
import RWSWindow, { RWSWindowComponentRegister, loadRWSRichWindow } from './types/RWSWindow';
|
|
15
|
-
|
|
16
|
-
import { DI, Container, Registration } from './components/_container';
|
|
17
|
-
|
|
18
|
-
import RWSViewComponent, { IWithCompose } from './components/_component';
|
|
19
|
-
import RWSContainer from './components/_container';
|
|
20
|
-
import TheRWSService from './services/_service';
|
|
21
|
-
|
|
22
|
-
import ComponentHelper, { ComponentHelperStatic, RWSInfoType } from './client/components';
|
|
23
|
-
import ServicesHelper from './client/services';
|
|
24
|
-
import ConfigHelper from './client/config';
|
|
25
|
-
import { DefaultRWSPluginOptionsType, RWSPlugin } from './plugins/_plugin';
|
|
26
|
-
import { IStaticRWSPlugin } from './types/IRWSPlugin'
|
|
27
|
-
|
|
28
|
-
interface IHotModule extends NodeModule {
|
|
29
|
-
hot?: {
|
|
30
|
-
accept(dependencies: string[], callback?: (updatedDependencies: string[]) => void): void;
|
|
31
|
-
accept(dependency: string, callback?: () => void): void;
|
|
32
|
-
accept(errHandler?: (err: Error) => void): void;
|
|
33
|
-
dispose(callback: (data: any) => void): void;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type RWSEventListener = (event: CustomEvent) => void;
|
|
38
|
-
|
|
39
|
-
class RWSClient {
|
|
40
|
-
protected _container: Container;
|
|
41
|
-
protected user: IRWSUser = null;
|
|
42
|
-
|
|
43
|
-
protected config: IRWSConfig = {};
|
|
44
|
-
protected plugins: {[key: string]: RWSPlugin<DefaultRWSPluginOptionsType>} = {}
|
|
45
|
-
protected isSetup = false;
|
|
46
|
-
protected devStorage: { [key: string]: any } = {};
|
|
47
|
-
protected customServices: { [serviceName: string]: TheRWSService} = {};
|
|
48
|
-
protected defaultServices: { [serviceName: string]: TheRWSService} = {};
|
|
49
|
-
|
|
50
|
-
private componentHelper = ComponentHelper.bind(this)();
|
|
51
|
-
private servicesHelper = ServicesHelper.bind(this)();
|
|
52
|
-
private configHelper = ConfigHelper.bind(this)();
|
|
53
|
-
|
|
54
|
-
protected initCallback: () => Promise<void> = async () => { };
|
|
55
|
-
|
|
56
|
-
constructor(
|
|
57
|
-
@ConfigService public appConfig: ConfigServiceInstance,
|
|
58
|
-
@DOMService public domService: DOMServiceInstance,
|
|
59
|
-
@UtilsService public utilsService: UtilsServiceInstance,
|
|
60
|
-
@ApiService public apiService: ApiServiceInstance,
|
|
61
|
-
@ServiceWorkerService public swService: ServiceWorkerServiceInstance,
|
|
62
|
-
@NotifyService public notifyService: NotifyServiceInstance
|
|
63
|
-
) {
|
|
64
|
-
this._container = RWSContainer();
|
|
65
|
-
this.user = this.getUser();
|
|
66
|
-
|
|
67
|
-
this.loadServices();
|
|
68
|
-
|
|
69
|
-
this.config.plugins = [];
|
|
70
|
-
this.pushDataToServiceWorker('SET_WS_URL', { url: this.appConfig.get('wsUrl') }, 'ws_url');
|
|
71
|
-
|
|
72
|
-
if (this.user) {
|
|
73
|
-
this.pushUserToServiceWorker({ ...this.user, instructor: false });
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
addPlugin<T extends DefaultRWSPluginOptionsType>(pluginEntry: IStaticRWSPlugin)
|
|
78
|
-
{
|
|
79
|
-
this.config.plugins.push(pluginEntry);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
async setup(config: IRWSConfig = {}): Promise<IRWSConfig> {
|
|
83
|
-
return this.configHelper.setup(config);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async start(config: IRWSConfig = {}): Promise<RWSClient> {
|
|
87
|
-
return this.configHelper.start(config);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
private loadServices(){
|
|
91
|
-
return this.servicesHelper.loadServices();
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
get(key: string): any | null
|
|
95
|
-
{
|
|
96
|
-
return this.configHelper.get(key);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
setNotifier(notifier: RWSNotify): RWSClient {
|
|
100
|
-
this.notifyService.setNotifier(notifier);
|
|
101
|
-
|
|
102
|
-
return this;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
setDefaultLayout(DefaultLayout: any): RWSClient {
|
|
106
|
-
this.config.defaultLayout = DefaultLayout;
|
|
107
|
-
|
|
108
|
-
return this;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
setBackendRoutes(routes: IBackendRoute[]): RWSClient {
|
|
112
|
-
this.config.backendRoutes = routes;
|
|
113
|
-
this.appConfig.set('backendRoutes', routes);
|
|
114
|
-
return this;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
async onInit(callback: () => Promise<void>): Promise<RWSClient> {
|
|
118
|
-
this.initCallback = callback;
|
|
119
|
-
|
|
120
|
-
for (const plugin of RWSPlugin.getAllPlugins()){
|
|
121
|
-
plugin.onComponentsDeclare();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
return this;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
pushDataToServiceWorker(type: string, data: any, asset_type: string = 'data_push'): void {
|
|
128
|
-
this.configHelper.pushDataToServiceWorker(type, data, asset_type);
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
pushUserToServiceWorker(userData: any) {
|
|
133
|
-
this.configHelper.pushUserToServiceWorker(userData);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
getUser(): IRWSUser {
|
|
137
|
-
return this.configHelper.getUser();
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
setUser(user: IRWSUser): RWSClient {
|
|
141
|
-
return this.configHelper.setUser(user);
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
getConfig(): ConfigServiceInstance {
|
|
145
|
-
return this.appConfig;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
on<T>(eventName: string, listener: RWSEventListener): void {
|
|
149
|
-
document.addEventListener(eventName, (event: Event) => {
|
|
150
|
-
listener(event as CustomEvent<T>);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
setDevStorage(key: string, stuff: any): RWSClient {
|
|
155
|
-
this.devStorage[key] = stuff;
|
|
156
|
-
return this;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
getDevStorage(key: string): any {
|
|
160
|
-
return this.devStorage[key];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
registerToDI(): void {
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
async loadPartedComponents(): Promise<RWSInfoType> {
|
|
168
|
-
return this.componentHelper.loadPartedComponents();
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
async onDOMLoad(): Promise<void> {
|
|
172
|
-
return this.domService.onDOMLoad()
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
assignClientToBrowser(): void {
|
|
176
|
-
this.getBrowserObject().RWS.client = this;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
enableRouting(): void {
|
|
180
|
-
this.appConfig.mergeConfig({ routing_enabled: true });
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
disableRouting(): void {
|
|
184
|
-
this.appConfig.mergeConfig({ routing_enabled: false });
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
private getBrowserObject(): RWSWindow {
|
|
188
|
-
loadRWSRichWindow();
|
|
189
|
-
return window;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
static getDI(): typeof DI {
|
|
193
|
-
return DI;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
static defineAllComponents() {
|
|
197
|
-
ComponentHelperStatic.defineAllComponents();
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
defineComponents(){
|
|
202
|
-
ComponentHelperStatic.defineAllComponents();
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
logout(){
|
|
207
|
-
this.user = null;
|
|
208
|
-
localStorage.removeItem('the_rws_user');
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
export default DI.createInterface<RWSClient>(x => x.singleton(RWSClient));
|
|
1
|
+
import IRWSConfig, { RWSPluginEntry } from './types/IRWSConfig';
|
|
2
|
+
|
|
3
|
+
import RWSNotify from './types/RWSNotify';
|
|
4
|
+
|
|
5
|
+
import ConfigService, { ConfigServiceInstance } from './services/ConfigService';
|
|
6
|
+
import UtilsService, { UtilsServiceInstance } from './services/UtilsService';
|
|
7
|
+
import DOMService, { DOMServiceInstance } from './services/DOMService';
|
|
8
|
+
import ApiService, { ApiServiceInstance } from './services/ApiService';
|
|
9
|
+
import NotifyService, { NotifyServiceInstance } from './services/NotifyService';
|
|
10
|
+
|
|
11
|
+
import ServiceWorkerService, { ServiceWorkerServiceInstance } from './services/ServiceWorkerService';
|
|
12
|
+
import { IBackendRoute } from './services/ApiService';
|
|
13
|
+
import IRWSUser from './types/IRWSUser';
|
|
14
|
+
import RWSWindow, { RWSWindowComponentRegister, loadRWSRichWindow } from './types/RWSWindow';
|
|
15
|
+
|
|
16
|
+
import { DI, Container, Registration } from './components/_container';
|
|
17
|
+
|
|
18
|
+
import RWSViewComponent, { IWithCompose } from './components/_component';
|
|
19
|
+
import RWSContainer from './components/_container';
|
|
20
|
+
import TheRWSService from './services/_service';
|
|
21
|
+
|
|
22
|
+
import ComponentHelper, { ComponentHelperStatic, RWSInfoType } from './client/components';
|
|
23
|
+
import ServicesHelper from './client/services';
|
|
24
|
+
import ConfigHelper from './client/config';
|
|
25
|
+
import { DefaultRWSPluginOptionsType, RWSPlugin } from './plugins/_plugin';
|
|
26
|
+
import { IStaticRWSPlugin } from './types/IRWSPlugin'
|
|
27
|
+
|
|
28
|
+
interface IHotModule extends NodeModule {
|
|
29
|
+
hot?: {
|
|
30
|
+
accept(dependencies: string[], callback?: (updatedDependencies: string[]) => void): void;
|
|
31
|
+
accept(dependency: string, callback?: () => void): void;
|
|
32
|
+
accept(errHandler?: (err: Error) => void): void;
|
|
33
|
+
dispose(callback: (data: any) => void): void;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
type RWSEventListener = (event: CustomEvent) => void;
|
|
38
|
+
|
|
39
|
+
class RWSClient {
|
|
40
|
+
protected _container: Container;
|
|
41
|
+
protected user: IRWSUser = null;
|
|
42
|
+
|
|
43
|
+
protected config: IRWSConfig = {};
|
|
44
|
+
protected plugins: {[key: string]: RWSPlugin<DefaultRWSPluginOptionsType>} = {}
|
|
45
|
+
protected isSetup = false;
|
|
46
|
+
protected devStorage: { [key: string]: any } = {};
|
|
47
|
+
protected customServices: { [serviceName: string]: TheRWSService} = {};
|
|
48
|
+
protected defaultServices: { [serviceName: string]: TheRWSService} = {};
|
|
49
|
+
|
|
50
|
+
private componentHelper = ComponentHelper.bind(this)();
|
|
51
|
+
private servicesHelper = ServicesHelper.bind(this)();
|
|
52
|
+
private configHelper = ConfigHelper.bind(this)();
|
|
53
|
+
|
|
54
|
+
protected initCallback: () => Promise<void> = async () => { };
|
|
55
|
+
|
|
56
|
+
constructor(
|
|
57
|
+
@ConfigService public appConfig: ConfigServiceInstance,
|
|
58
|
+
@DOMService public domService: DOMServiceInstance,
|
|
59
|
+
@UtilsService public utilsService: UtilsServiceInstance,
|
|
60
|
+
@ApiService public apiService: ApiServiceInstance,
|
|
61
|
+
@ServiceWorkerService public swService: ServiceWorkerServiceInstance,
|
|
62
|
+
@NotifyService public notifyService: NotifyServiceInstance
|
|
63
|
+
) {
|
|
64
|
+
this._container = RWSContainer();
|
|
65
|
+
this.user = this.getUser();
|
|
66
|
+
|
|
67
|
+
this.loadServices();
|
|
68
|
+
|
|
69
|
+
this.config.plugins = [];
|
|
70
|
+
this.pushDataToServiceWorker('SET_WS_URL', { url: this.appConfig.get('wsUrl') }, 'ws_url');
|
|
71
|
+
|
|
72
|
+
if (this.user) {
|
|
73
|
+
this.pushUserToServiceWorker({ ...this.user, instructor: false });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
addPlugin<T extends DefaultRWSPluginOptionsType>(pluginEntry: IStaticRWSPlugin)
|
|
78
|
+
{
|
|
79
|
+
this.config.plugins.push(pluginEntry);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
async setup(config: IRWSConfig = {}): Promise<IRWSConfig> {
|
|
83
|
+
return this.configHelper.setup(config);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
async start(config: IRWSConfig = {}): Promise<RWSClient> {
|
|
87
|
+
return this.configHelper.start(config);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
private loadServices(){
|
|
91
|
+
return this.servicesHelper.loadServices();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
get(key: string): any | null
|
|
95
|
+
{
|
|
96
|
+
return this.configHelper.get(key);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
setNotifier(notifier: RWSNotify): RWSClient {
|
|
100
|
+
this.notifyService.setNotifier(notifier);
|
|
101
|
+
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
setDefaultLayout(DefaultLayout: any): RWSClient {
|
|
106
|
+
this.config.defaultLayout = DefaultLayout;
|
|
107
|
+
|
|
108
|
+
return this;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
setBackendRoutes(routes: IBackendRoute[]): RWSClient {
|
|
112
|
+
this.config.backendRoutes = routes;
|
|
113
|
+
this.appConfig.set('backendRoutes', routes);
|
|
114
|
+
return this;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async onInit(callback: () => Promise<void>): Promise<RWSClient> {
|
|
118
|
+
this.initCallback = callback;
|
|
119
|
+
|
|
120
|
+
for (const plugin of RWSPlugin.getAllPlugins()){
|
|
121
|
+
plugin.onComponentsDeclare();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return this;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
pushDataToServiceWorker(type: string, data: any, asset_type: string = 'data_push'): void {
|
|
128
|
+
this.configHelper.pushDataToServiceWorker(type, data, asset_type);
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
pushUserToServiceWorker(userData: any) {
|
|
133
|
+
this.configHelper.pushUserToServiceWorker(userData);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
getUser(): IRWSUser {
|
|
137
|
+
return this.configHelper.getUser();
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
setUser(user: IRWSUser): RWSClient {
|
|
141
|
+
return this.configHelper.setUser(user);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
getConfig(): ConfigServiceInstance {
|
|
145
|
+
return this.appConfig;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
on<T>(eventName: string, listener: RWSEventListener): void {
|
|
149
|
+
document.addEventListener(eventName, (event: Event) => {
|
|
150
|
+
listener(event as CustomEvent<T>);
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
setDevStorage(key: string, stuff: any): RWSClient {
|
|
155
|
+
this.devStorage[key] = stuff;
|
|
156
|
+
return this;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
getDevStorage(key: string): any {
|
|
160
|
+
return this.devStorage[key];
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
registerToDI(): void {
|
|
164
|
+
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async loadPartedComponents(): Promise<RWSInfoType> {
|
|
168
|
+
return this.componentHelper.loadPartedComponents();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
async onDOMLoad(): Promise<void> {
|
|
172
|
+
return this.domService.onDOMLoad()
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
assignClientToBrowser(): void {
|
|
176
|
+
this.getBrowserObject().RWS.client = this;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
enableRouting(): void {
|
|
180
|
+
this.appConfig.mergeConfig({ routing_enabled: true });
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
disableRouting(): void {
|
|
184
|
+
this.appConfig.mergeConfig({ routing_enabled: false });
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
private getBrowserObject(): RWSWindow {
|
|
188
|
+
loadRWSRichWindow();
|
|
189
|
+
return window;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
static getDI(): typeof DI {
|
|
193
|
+
return DI;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
static defineAllComponents() {
|
|
197
|
+
ComponentHelperStatic.defineAllComponents();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
defineComponents(){
|
|
202
|
+
ComponentHelperStatic.defineAllComponents();
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
logout(){
|
|
207
|
+
this.user = null;
|
|
208
|
+
localStorage.removeItem('the_rws_user');
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export default DI.createInterface<RWSClient>(x => x.singleton(RWSClient));
|
|
213
213
|
export { IHotModule, RWSClient as RWSClientInstance };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Accessor, Observable } from "@microsoft/fast-element";
|
|
2
|
-
import { ExtendedObservableAccessor } from "./_extended_accessor";
|
|
3
|
-
|
|
4
|
-
export class DefaultObservableAccessor extends ExtendedObservableAccessor {
|
|
5
|
-
|
|
6
|
-
constructor(public name: string, protected customGet: (source: any, field: string) => any = null, protected customSet: (source: any, field: string, newVal: any) => boolean | void = null, protected watcher: any = void 0, suffix: string = 'Changed') {
|
|
7
|
-
super(name, customGet, customSet, watcher, suffix);
|
|
8
|
-
}
|
|
1
|
+
import { Accessor, Observable } from "@microsoft/fast-element";
|
|
2
|
+
import { ExtendedObservableAccessor } from "./_extended_accessor";
|
|
3
|
+
|
|
4
|
+
export class DefaultObservableAccessor extends ExtendedObservableAccessor {
|
|
5
|
+
|
|
6
|
+
constructor(public name: string, protected customGet: (source: any, field: string) => any = null, protected customSet: (source: any, field: string, newVal: any) => boolean | void = null, protected watcher: any = void 0, suffix: string = 'Changed') {
|
|
7
|
+
super(name, customGet, customSet, watcher, suffix);
|
|
8
|
+
}
|
|
9
9
|
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { Observable, Accessor } from "@microsoft/fast-element";
|
|
2
|
-
|
|
3
|
-
export abstract class ExtendedObservableAccessor implements Accessor {
|
|
4
|
-
protected field: string;
|
|
5
|
-
protected callback: string;
|
|
6
|
-
|
|
7
|
-
constructor(public name: string, protected customGet: (source: any, field: string) => any = null, protected customSet: (source: any, field: string, newVal: any) => boolean | void = null, protected watcher: any = void 0, suffix: string = 'Changed') {
|
|
8
|
-
this.field = `_${name}`;
|
|
9
|
-
this.callback = `${name}${suffix}`;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
getValue(source: any): any {
|
|
13
|
-
Observable.track(source, this.name);
|
|
14
|
-
|
|
15
|
-
return this.customGet ? this.customGet(source, this.field) : source[this.field];
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
setValue(source: any, newValue: any): void {
|
|
19
|
-
if(this.customSet){
|
|
20
|
-
if(this.customSet(source, this.field, newValue) === false){
|
|
21
|
-
return;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const field = this.field;
|
|
26
|
-
const oldValue = source[field];
|
|
27
|
-
|
|
28
|
-
if (oldValue !== newValue) {
|
|
29
|
-
source[field] = newValue;
|
|
30
|
-
|
|
31
|
-
const callback = source[this.callback];
|
|
32
|
-
|
|
33
|
-
if (typeof callback === 'function') {
|
|
34
|
-
callback.call(source, oldValue, newValue);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
Observable.getNotifier(source).notify(this.name);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
1
|
+
import { Observable, Accessor } from "@microsoft/fast-element";
|
|
2
|
+
|
|
3
|
+
export abstract class ExtendedObservableAccessor implements Accessor {
|
|
4
|
+
protected field: string;
|
|
5
|
+
protected callback: string;
|
|
6
|
+
|
|
7
|
+
constructor(public name: string, protected customGet: (source: any, field: string) => any = null, protected customSet: (source: any, field: string, newVal: any) => boolean | void = null, protected watcher: any = void 0, suffix: string = 'Changed') {
|
|
8
|
+
this.field = `_${name}`;
|
|
9
|
+
this.callback = `${name}${suffix}`;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
getValue(source: any): any {
|
|
13
|
+
Observable.track(source, this.name);
|
|
14
|
+
|
|
15
|
+
return this.customGet ? this.customGet(source, this.field) : source[this.field];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
setValue(source: any, newValue: any): void {
|
|
19
|
+
if(this.customSet){
|
|
20
|
+
if(this.customSet(source, this.field, newValue) === false){
|
|
21
|
+
return;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const field = this.field;
|
|
26
|
+
const oldValue = source[field];
|
|
27
|
+
|
|
28
|
+
if (oldValue !== newValue) {
|
|
29
|
+
source[field] = newValue;
|
|
30
|
+
|
|
31
|
+
const callback = source[this.callback];
|
|
32
|
+
|
|
33
|
+
if (typeof callback === 'function') {
|
|
34
|
+
callback.call(source, oldValue, newValue);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Observable.getNotifier(source).notify(this.name);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
41
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Observable } from "@microsoft/fast-element";
|
|
2
|
-
|
|
3
|
-
export function handleExternalChange(_target: any, $prop: string)
|
|
4
|
-
{
|
|
5
|
-
if(!!_target['externalChanged']){
|
|
6
|
-
_target['externalChanged'].call(_target, $prop, null, _target[$prop]);
|
|
7
|
-
}
|
|
1
|
+
import { Observable } from "@microsoft/fast-element";
|
|
2
|
+
|
|
3
|
+
export function handleExternalChange(_target: any, $prop: string)
|
|
4
|
+
{
|
|
5
|
+
if(!!_target['externalChanged']){
|
|
6
|
+
_target['externalChanged'].call(_target, $prop, null, _target[$prop]);
|
|
7
|
+
}
|
|
8
8
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Accessor, Observable } from "@microsoft/fast-element";
|
|
2
|
-
import { ExtendedObservableAccessor } from "./_extended_accessor";
|
|
3
|
-
|
|
4
|
-
export class ExternalObservableAccessor extends ExtendedObservableAccessor {
|
|
5
|
-
|
|
6
|
-
constructor(public name: string, protected customGet: (source: any, field: string) => any = null, protected customSet: (source: any, field: string, newVal: any) => boolean | void = null, protected watcher: any = void 0) {
|
|
7
|
-
super(name, customGet, customSet, watcher, '');
|
|
8
|
-
}
|
|
1
|
+
import { Accessor, Observable } from "@microsoft/fast-element";
|
|
2
|
+
import { ExtendedObservableAccessor } from "./_extended_accessor";
|
|
3
|
+
|
|
4
|
+
export class ExternalObservableAccessor extends ExtendedObservableAccessor {
|
|
5
|
+
|
|
6
|
+
constructor(public name: string, protected customGet: (source: any, field: string) => any = null, protected customSet: (source: any, field: string, newVal: any) => boolean | void = null, protected watcher: any = void 0) {
|
|
7
|
+
super(name, customGet, customSet, watcher, '');
|
|
8
|
+
}
|
|
9
9
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DecoratorAttributeConfiguration,
|
|
3
|
-
AttributeConfiguration,
|
|
4
|
-
Observable,
|
|
5
|
-
} from "@microsoft/fast-element";
|
|
6
|
-
import { handleExternalChange } from "./_external_handler";
|
|
7
|
-
import RWSViewComponent, { IWithCompose } from "../_component";
|
|
8
|
-
import { externalAttr } from "./external-attr";
|
|
9
|
-
|
|
10
|
-
export function ngAttr(
|
|
11
|
-
config?: DecoratorAttributeConfiguration
|
|
12
|
-
): (target: {}, property: string) => void;
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Decorator: Specifies an HTML attribute.
|
|
16
|
-
* @param target - The class to define the attribute on.
|
|
17
|
-
* @param prop - The property name to be associated with the attribute.
|
|
18
|
-
* @public
|
|
19
|
-
*/
|
|
20
|
-
export function ngAttr(target: {}, prop: string): void;
|
|
21
|
-
export function ngAttr(
|
|
22
|
-
configOrTarget?: DecoratorAttributeConfiguration | {},
|
|
23
|
-
prop?: string
|
|
24
|
-
): void | ((target: {}, property: string) => void) {
|
|
25
|
-
return externalAttr(configOrTarget, prop, {
|
|
26
|
-
converter: (val: any) => {
|
|
27
|
-
if(val && val.indexOf('{{') > -1){
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return val;
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
DecoratorAttributeConfiguration,
|
|
3
|
+
AttributeConfiguration,
|
|
4
|
+
Observable,
|
|
5
|
+
} from "@microsoft/fast-element";
|
|
6
|
+
import { handleExternalChange } from "./_external_handler";
|
|
7
|
+
import RWSViewComponent, { IWithCompose } from "../_component";
|
|
8
|
+
import { externalAttr } from "./external-attr";
|
|
9
|
+
|
|
10
|
+
export function ngAttr(
|
|
11
|
+
config?: DecoratorAttributeConfiguration
|
|
12
|
+
): (target: {}, property: string) => void;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Decorator: Specifies an HTML attribute.
|
|
16
|
+
* @param target - The class to define the attribute on.
|
|
17
|
+
* @param prop - The property name to be associated with the attribute.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export function ngAttr(target: {}, prop: string): void;
|
|
21
|
+
export function ngAttr(
|
|
22
|
+
configOrTarget?: DecoratorAttributeConfiguration | {},
|
|
23
|
+
prop?: string
|
|
24
|
+
): void | ((target: {}, property: string) => void) {
|
|
25
|
+
return externalAttr(configOrTarget, prop, {
|
|
26
|
+
converter: (val: any) => {
|
|
27
|
+
if(val && val.indexOf('{{') > -1){
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return val;
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}
|