@wavemaker/app-ng-runtime 11.4.0-next.28701 → 11.4.0-rc.5342
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.
- app-ng-runtime/build-task/basic/tree/tree.build.d.ts +1 -2
- app-ng-runtime/build-task/bundles/index.umd.js +7 -9
- app-ng-runtime/build-task/bundles/index.umd.js.map +1 -1
- app-ng-runtime/build-task/esm2015/basic/tree/tree.build.js +3 -4
- app-ng-runtime/build-task/esm2015/navigation/popover/popover.build.js +3 -3
- app-ng-runtime/build-task/fesm2015/index.js +7 -9
- app-ng-runtime/build-task/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/base/bundles/index.umd.js +7 -4
- app-ng-runtime/components/base/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/base/esm2015/utils/widget-utils.js +7 -4
- app-ng-runtime/components/base/esm2015/widgets/common/dialog/dialog.service.js +3 -3
- app-ng-runtime/components/base/fesm2015/index.js +8 -5
- app-ng-runtime/components/base/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/base/utils/widget-utils.d.ts +1 -1
- app-ng-runtime/components/basic/tree/bundles/index.umd.js +280 -256
- app-ng-runtime/components/basic/tree/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/basic/tree/esm2015/public_api.js +2 -2
- app-ng-runtime/components/basic/tree/esm2015/tree.component.js +322 -0
- app-ng-runtime/components/basic/tree/esm2015/tree.module.js +3 -3
- app-ng-runtime/components/basic/tree/fesm2015/index.js +260 -248
- app-ng-runtime/components/basic/tree/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/basic/tree/index.metadata.json +1 -1
- app-ng-runtime/components/basic/tree/public_api.d.ts +1 -1
- app-ng-runtime/components/basic/tree/tree.component.d.ts +34 -0
- app-ng-runtime/components/containers/tabs/bundles/index.umd.js +39 -23
- app-ng-runtime/components/containers/tabs/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/containers/tabs/esm2015/tab-pane/tab-pane.component.js +8 -1
- app-ng-runtime/components/containers/tabs/esm2015/tabs.animator.js +33 -13
- app-ng-runtime/components/containers/tabs/fesm2015/index.js +40 -13
- app-ng-runtime/components/containers/tabs/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/containers/tabs/tabs.animator.d.ts +5 -1
- app-ng-runtime/components/data/list/bundles/index.umd.js +51 -42
- app-ng-runtime/components/data/list/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/list/esm2015/list.component.js +51 -42
- app-ng-runtime/components/data/list/fesm2015/index.js +50 -41
- app-ng-runtime/components/data/list/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/list/index.metadata.json +1 -1
- app-ng-runtime/components/data/pagination/bundles/index.umd.js +21 -4
- app-ng-runtime/components/data/pagination/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/pagination/esm2015/pagination.component.js +22 -5
- app-ng-runtime/components/data/pagination/fesm2015/index.js +21 -4
- app-ng-runtime/components/data/pagination/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/pagination/index.metadata.json +1 -1
- app-ng-runtime/components/data/pagination/pagination.component.d.ts +1 -0
- app-ng-runtime/components/data/table/bundles/index.umd.js +7 -0
- app-ng-runtime/components/data/table/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/data/table/esm2015/table.component.js +8 -1
- app-ng-runtime/components/data/table/fesm2015/index.js +7 -0
- app-ng-runtime/components/data/table/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/data/table/index.metadata.json +1 -1
- app-ng-runtime/components/dialogs/default/base-dialog.d.ts +1 -0
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js +13 -4
- app-ng-runtime/components/dialogs/default/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/dialogs/default/esm2015/base-dialog.js +14 -6
- app-ng-runtime/components/dialogs/default/fesm2015/index.js +13 -5
- app-ng-runtime/components/dialogs/default/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/dialogs/default/index.metadata.json +1 -1
- app-ng-runtime/components/input/epoch/bundles/index.umd.js +66 -29
- app-ng-runtime/components/input/epoch/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/input/epoch/date-time/date-time-picker.component.d.ts +1 -0
- app-ng-runtime/components/input/epoch/esm2015/base-date-time.component.js +43 -25
- app-ng-runtime/components/input/epoch/esm2015/date/date.component.js +3 -3
- app-ng-runtime/components/input/epoch/esm2015/date-time/date-time-picker.component.js +31 -11
- app-ng-runtime/components/input/epoch/esm2015/date-time/date-time.component.js +2 -2
- app-ng-runtime/components/input/epoch/fesm2015/index.js +75 -37
- app-ng-runtime/components/input/epoch/fesm2015/index.js.map +1 -1
- app-ng-runtime/components/input/epoch/index.metadata.json +1 -1
- app-ng-runtime/components/navigation/popover/bundles/index.umd.js +3 -4
- app-ng-runtime/components/navigation/popover/bundles/index.umd.js.map +1 -1
- app-ng-runtime/components/navigation/popover/esm2015/popover.component.js +5 -6
- app-ng-runtime/components/navigation/popover/fesm2015/index.js +4 -5
- app-ng-runtime/components/navigation/popover/fesm2015/index.js.map +1 -1
- app-ng-runtime/mobile/components/page/default/bundles/index.umd.js +24 -6
- app-ng-runtime/mobile/components/page/default/bundles/index.umd.js.map +1 -1
- app-ng-runtime/mobile/components/page/default/esm2015/page.directive.js +20 -3
- app-ng-runtime/mobile/components/page/default/fesm2015/index.js +19 -2
- app-ng-runtime/mobile/components/page/default/fesm2015/index.js.map +1 -1
- app-ng-runtime/mobile/components/page/default/index.metadata.json +1 -1
- app-ng-runtime/mobile/components/page/default/page.directive.d.ts +4 -1
- app-ng-runtime/package.json +1 -1
- app-ng-runtime/scripts/datatable/datatable.js +23 -23
- app-ng-runtime/scripts/tree-keyboard-navigation/keyboard-navigation.js +251 -0
- app-ng-runtime/variables/bundles/index.umd.js +14 -4
- app-ng-runtime/variables/bundles/index.umd.js.map +1 -1
- app-ng-runtime/variables/esm2015/manager/action/notification-action.manager.js +5 -6
- app-ng-runtime/variables/esm2015/service/variables.service.js +8 -1
- app-ng-runtime/variables/fesm2015/index.js +11 -5
- app-ng-runtime/variables/fesm2015/index.js.map +1 -1
- app-ng-runtime/variables/index.metadata.json +1 -1
- app-ng-runtime/variables/service/variables.service.d.ts +4 -0
- app-ng-runtime/components/basic/tree/esm2015/tree.directive.js +0 -310
- app-ng-runtime/components/basic/tree/tree.directive.d.ts +0 -35
|
@@ -1,18 +1,33 @@
|
|
|
1
1
|
import { Directive, ElementRef } from '@angular/core';
|
|
2
|
+
import { BsModalService } from 'ngx-bootstrap/modal';
|
|
2
3
|
import { addClass, AbstractNavigationService, App } from '@wm/core';
|
|
3
4
|
import { PageDirective } from '@wm/components/page';
|
|
4
5
|
import { DeviceService } from '@wm/mobile/core';
|
|
5
6
|
export class MobilePageDirective {
|
|
6
|
-
constructor(app, elRef, deviceService, page, navigationService) {
|
|
7
|
+
constructor(app, elRef, modalService, deviceService, page, navigationService) {
|
|
8
|
+
this.modalService = modalService;
|
|
7
9
|
this.deviceService = deviceService;
|
|
8
10
|
this.page = page;
|
|
9
11
|
this.navigationService = navigationService;
|
|
12
|
+
this.subscriptions = [];
|
|
10
13
|
addClass(elRef.nativeElement, 'mobile-app-page');
|
|
11
14
|
this._$ele = $(elRef.nativeElement);
|
|
12
15
|
page.subscribe('wmMobileTabbar:ready', () => this._$ele.addClass('has-tabbar'));
|
|
16
|
+
let modalsOpened = [];
|
|
17
|
+
this.subscriptions = [
|
|
18
|
+
modalService.onShown.subscribe(({ id }) => {
|
|
19
|
+
id && modalsOpened.push(id);
|
|
20
|
+
}),
|
|
21
|
+
modalService.onHidden.subscribe(({ id }) => {
|
|
22
|
+
id && _.remove(modalsOpened, id);
|
|
23
|
+
})
|
|
24
|
+
];
|
|
13
25
|
// add backbutton listener on every page.
|
|
14
26
|
this._backBtnListenerDestroyer = deviceService.onBackButtonTap($event => {
|
|
15
|
-
if (
|
|
27
|
+
if (modalsOpened.length > 0) {
|
|
28
|
+
modalService.hide(modalsOpened.pop());
|
|
29
|
+
}
|
|
30
|
+
else if (app.landingPageName === app.activePageName) {
|
|
16
31
|
window.navigator['app'].exitApp();
|
|
17
32
|
}
|
|
18
33
|
else {
|
|
@@ -22,6 +37,7 @@ export class MobilePageDirective {
|
|
|
22
37
|
});
|
|
23
38
|
}
|
|
24
39
|
ngOnDestroy() {
|
|
40
|
+
this.subscriptions.map((s) => s.unsubscribe());
|
|
25
41
|
this._backBtnListenerDestroyer();
|
|
26
42
|
}
|
|
27
43
|
}
|
|
@@ -33,8 +49,9 @@ MobilePageDirective.decorators = [
|
|
|
33
49
|
MobilePageDirective.ctorParameters = () => [
|
|
34
50
|
{ type: App },
|
|
35
51
|
{ type: ElementRef },
|
|
52
|
+
{ type: BsModalService },
|
|
36
53
|
{ type: DeviceService },
|
|
37
54
|
{ type: PageDirective },
|
|
38
55
|
{ type: AbstractNavigationService }
|
|
39
56
|
];
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
57
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFnZS5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9tb2JpbGUvY29tcG9uZW50cy9wYWdlL2RlZmF1bHQvc3JjL3BhZ2UuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsVUFBVSxFQUFhLE1BQU0sZUFBZSxDQUFDO0FBQ2pFLE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUdyRCxPQUFPLEVBQUUsUUFBUSxFQUFFLHlCQUF5QixFQUFFLEdBQUcsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUNwRSxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDcEQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLGlCQUFpQixDQ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uICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB0aGlzLm5hdmlnYXRpb25TZXJ2aWNlLmdvVG9QcmV2aW91cygpO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBwdWJsaWMgbmdPbkRlc3Ryb3koKSB7XG4gICAgICAgIHRoaXMuc3Vic2NyaXB0aW9ucy5tYXAoKHMpID0+IHMudW5zdWJzY3JpYmUoKSk7XG4gICAgICAgIHRoaXMuX2JhY2tCdG5MaXN0ZW5lckRlc3Ryb3llcigpO1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component, ElementRef, Directive, NgModule } from '@angular/core';
|
|
2
2
|
import { addClass, App, AbstractNavigationService } from '@wm/core';
|
|
3
3
|
import { provideAsWidgetRef, WmComponentsModule } from '@wm/components/base';
|
|
4
|
+
import { BsModalService } from 'ngx-bootstrap/modal';
|
|
4
5
|
import { PageDirective } from '@wm/components/page';
|
|
5
6
|
import { DeviceService } from '@wm/mobile/core';
|
|
6
7
|
import { CommonModule } from '@angular/common';
|
|
@@ -24,16 +25,30 @@ PageContentLoaderComponent.ctorParameters = () => [
|
|
|
24
25
|
];
|
|
25
26
|
|
|
26
27
|
class MobilePageDirective {
|
|
27
|
-
constructor(app, elRef, deviceService, page, navigationService) {
|
|
28
|
+
constructor(app, elRef, modalService, deviceService, page, navigationService) {
|
|
29
|
+
this.modalService = modalService;
|
|
28
30
|
this.deviceService = deviceService;
|
|
29
31
|
this.page = page;
|
|
30
32
|
this.navigationService = navigationService;
|
|
33
|
+
this.subscriptions = [];
|
|
31
34
|
addClass(elRef.nativeElement, 'mobile-app-page');
|
|
32
35
|
this._$ele = $(elRef.nativeElement);
|
|
33
36
|
page.subscribe('wmMobileTabbar:ready', () => this._$ele.addClass('has-tabbar'));
|
|
37
|
+
let modalsOpened = [];
|
|
38
|
+
this.subscriptions = [
|
|
39
|
+
modalService.onShown.subscribe(({ id }) => {
|
|
40
|
+
id && modalsOpened.push(id);
|
|
41
|
+
}),
|
|
42
|
+
modalService.onHidden.subscribe(({ id }) => {
|
|
43
|
+
id && _.remove(modalsOpened, id);
|
|
44
|
+
})
|
|
45
|
+
];
|
|
34
46
|
// add backbutton listener on every page.
|
|
35
47
|
this._backBtnListenerDestroyer = deviceService.onBackButtonTap($event => {
|
|
36
|
-
if (
|
|
48
|
+
if (modalsOpened.length > 0) {
|
|
49
|
+
modalService.hide(modalsOpened.pop());
|
|
50
|
+
}
|
|
51
|
+
else if (app.landingPageName === app.activePageName) {
|
|
37
52
|
window.navigator['app'].exitApp();
|
|
38
53
|
}
|
|
39
54
|
else {
|
|
@@ -43,6 +58,7 @@ class MobilePageDirective {
|
|
|
43
58
|
});
|
|
44
59
|
}
|
|
45
60
|
ngOnDestroy() {
|
|
61
|
+
this.subscriptions.map((s) => s.unsubscribe());
|
|
46
62
|
this._backBtnListenerDestroyer();
|
|
47
63
|
}
|
|
48
64
|
}
|
|
@@ -54,6 +70,7 @@ MobilePageDirective.decorators = [
|
|
|
54
70
|
MobilePageDirective.ctorParameters = () => [
|
|
55
71
|
{ type: App },
|
|
56
72
|
{ type: ElementRef },
|
|
73
|
+
{ type: BsModalService },
|
|
57
74
|
{ type: DeviceService },
|
|
58
75
|
{ type: PageDirective },
|
|
59
76
|
{ type: AbstractNavigationService }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../projects/mobile/components/page/default/src/page-content-loader/page-content-loader.component.ts","../../../../../../projects/mobile/components/page/default/src/page.directive.ts","../../../../../../projects/mobile/components/page/default/src/page.module.ts","../../../../../../projects/mobile/components/page/default/src/index.ts"],"sourcesContent":["import { Component, ElementRef } from '@angular/core';\n\nimport { addClass } from '@wm/core';\nimport { provideAsWidgetRef } from '@wm/components/base';\n\n@Component({\n selector: '[wmPageContentLoader]',\n templateUrl: './page-content-loader.component.html',\n providers: [\n provideAsWidgetRef(PageContentLoaderComponent)\n ]\n})\nexport class PageContentLoaderComponent {\n\n constructor(el: ElementRef) {\n addClass(el.nativeElement, 'app-page-content-loader');\n }\n}\n","import { Directive, ElementRef, OnDestroy } from '@angular/core';\n\nimport { addClass, AbstractNavigationService, App } from '@wm/core';\nimport { PageDirective } from '@wm/components/page';\nimport { DeviceService } from '@wm/mobile/core';\n\ndeclare const
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../projects/mobile/components/page/default/src/page-content-loader/page-content-loader.component.ts","../../../../../../projects/mobile/components/page/default/src/page.directive.ts","../../../../../../projects/mobile/components/page/default/src/page.module.ts","../../../../../../projects/mobile/components/page/default/src/index.ts"],"sourcesContent":["import { Component, ElementRef } from '@angular/core';\n\nimport { addClass } from '@wm/core';\nimport { provideAsWidgetRef } from '@wm/components/base';\n\n@Component({\n selector: '[wmPageContentLoader]',\n templateUrl: './page-content-loader.component.html',\n providers: [\n provideAsWidgetRef(PageContentLoaderComponent)\n ]\n})\nexport class PageContentLoaderComponent {\n\n constructor(el: ElementRef) {\n addClass(el.nativeElement, 'app-page-content-loader');\n }\n}\n","import { Directive, ElementRef, OnDestroy } from '@angular/core';\nimport { BsModalService } from 'ngx-bootstrap/modal';\nimport { Subscription } from 'rxjs';\n\nimport { addClass, AbstractNavigationService, App } from '@wm/core';\nimport { PageDirective } from '@wm/components/page';\nimport { DeviceService } from '@wm/mobile/core';\n\ndeclare const $, _;\n\n@Directive({\n selector: '[wmPage]'\n})\nexport class MobilePageDirective implements OnDestroy {\n\n private _$ele;\n\n private subscriptions: Subscription[] = [];\n private _backBtnListenerDestroyer;\n\n constructor(app: App,\n elRef: ElementRef,\n private modalService: BsModalService,\n private deviceService: DeviceService,\n private page: PageDirective,\n private navigationService: AbstractNavigationService) {\n addClass(elRef.nativeElement, 'mobile-app-page');\n this._$ele = $(elRef.nativeElement);\n page.subscribe('wmMobileTabbar:ready', () => this._$ele.addClass('has-tabbar'));\n let modalsOpened = [];\n this.subscriptions = [\n modalService.onShown.subscribe(({id}) => {\n id && modalsOpened.push(id);\n }),\n modalService.onHidden.subscribe(({id}) => {\n id && _.remove(modalsOpened, id);\n })\n ];\n // add backbutton listener on every page.\n this._backBtnListenerDestroyer = deviceService.onBackButtonTap($event => {\n if (modalsOpened.length > 0) {\n modalService.hide(modalsOpened.pop());\n } else if (app.landingPageName === app.activePageName) {\n window.navigator['app'].exitApp();\n } else {\n this.navigationService.goToPrevious();\n }\n return false;\n });\n }\n\n public ngOnDestroy() {\n this.subscriptions.map((s) => s.unsubscribe());\n this._backBtnListenerDestroyer();\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { WmComponentsModule } from '@wm/components/base';\n\nimport { MobilePageDirective } from './page.directive';\nimport { PageContentLoaderComponent } from './page-content-loader/page-content-loader.component';\n\nconst components = [\n MobilePageDirective,\n PageContentLoaderComponent\n];\n\n@NgModule({\n imports: [\n CommonModule,\n WmComponentsModule\n ],\n declarations: [...components],\n exports: [...components],\n entryComponents: []\n})\nexport class PageModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAYa,0BAA0B;IAEnC,YAAY,EAAc;QACtB,QAAQ,CAAC,EAAE,CAAC,aAAa,EAAE,yBAAyB,CAAC,CAAC;KACzD;;;YAXJ,SAAS,SAAC;gBACP,QAAQ,EAAE,uBAAuB;gBACjC,oFAAmD;gBACnD,SAAS,EAAE;oBACP,kBAAkB,CAAC,0BAA0B,CAAC;iBACjD;aACJ;;;YAXmB,UAAU;;;MCajB,mBAAmB;IAO5B,YAAY,GAAQ,EACR,KAAiB,EACT,YAA4B,EAC5B,aAA4B,EAC5B,IAAmB,EACnB,iBAA4C;QAH5C,iBAAY,GAAZ,YAAY,CAAgB;QAC5B,kBAAa,GAAb,aAAa,CAAe;QAC5B,SAAI,GAAJ,IAAI,CAAe;QACnB,sBAAiB,GAAjB,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AE,CAAC;KACpC;;;YA5CJ,SAAS,SAAC;gBACP,QAAQ,EAAE,UAAU;aACvB;;;YAR6C,GAAG;YAJ7B,UAAU;YACrB,cAAc;YAKd,aAAa;YADb,aAAa;YADH,yBAAyB;;;ACI5C,MAAM,UAAU,GAAG;IACf,mBAAmB;IACnB,0BAA0B;CAC7B,CAAC;MAWW,UAAU;;;YATtB,QAAQ,SAAC;gBACN,OAAO,EAAE;oBACL,YAAY;oBACZ,kBAAkB;iBACrB;gBACD,YAAY,EAAE,CAAC,GAAG,UAAU,CAAC;gBAC7B,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;gBACxB,eAAe,EAAE,EAAE;aACtB;;;ACrBD;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"PageContentLoaderComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"[wmPageContentLoader]","providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@wm/components/base","name":"provideAsWidgetRef","line":9,"character":8},"arguments":[{"__symbolic":"reference","name":"PageContentLoaderComponent"}]}],"template":"<div class=\"loader bg-primary\"></div>\n<div class=\"load-info\"></div>"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":14,"character":20}]}]}},"MobilePageDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"PageContentLoaderComponent":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":5,"character":1},"arguments":[{"selector":"[wmPageContentLoader]","providers":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@wm/components/base","name":"provideAsWidgetRef","line":9,"character":8},"arguments":[{"__symbolic":"reference","name":"PageContentLoaderComponent"}]}],"template":"<div class=\"loader bg-primary\"></div>\n<div class=\"load-info\"></div>"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":14,"character":20}]}]}},"MobilePageDirective":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":10,"character":1},"arguments":[{"selector":"[wmPage]"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@wm/core","name":"App","line":20,"character":21},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":21,"character":23},{"__symbolic":"reference","module":"ngx-bootstrap/modal","name":"BsModalService","line":22,"character":38},{"__symbolic":"reference","module":"@wm/mobile/core","name":"DeviceService","line":23,"character":39},{"__symbolic":"reference","module":"@wm/components/page","name":"PageDirective","line":24,"character":30},{"__symbolic":"reference","module":"@wm/core","name":"AbstractNavigationService","line":25,"character":43}]}],"ngOnDestroy":[{"__symbolic":"method"}]}},"PageModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":13,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":15,"character":8},{"__symbolic":"reference","module":"@wm/components/base","name":"WmComponentsModule","line":16,"character":8}],"declarations":[{"__symbolic":"reference","name":"MobilePageDirective"},{"__symbolic":"reference","name":"PageContentLoaderComponent"}],"exports":[{"__symbolic":"reference","name":"MobilePageDirective"},{"__symbolic":"reference","name":"PageContentLoaderComponent"}],"entryComponents":[]}]}],"members":{}}},"origins":{"PageContentLoaderComponent":"./page-content-loader/page-content-loader.component","MobilePageDirective":"./page.directive","PageModule":"./page.module"},"importAs":"@wm/mobile/components/page"}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { ElementRef, OnDestroy } from '@angular/core';
|
|
2
|
+
import { BsModalService } from 'ngx-bootstrap/modal';
|
|
2
3
|
import { AbstractNavigationService, App } from '@wm/core';
|
|
3
4
|
import { PageDirective } from '@wm/components/page';
|
|
4
5
|
import { DeviceService } from '@wm/mobile/core';
|
|
5
6
|
export declare class MobilePageDirective implements OnDestroy {
|
|
7
|
+
private modalService;
|
|
6
8
|
private deviceService;
|
|
7
9
|
private page;
|
|
8
10
|
private navigationService;
|
|
9
11
|
private _$ele;
|
|
12
|
+
private subscriptions;
|
|
10
13
|
private _backBtnListenerDestroyer;
|
|
11
|
-
constructor(app: App, elRef: ElementRef, deviceService: DeviceService, page: PageDirective, navigationService: AbstractNavigationService);
|
|
14
|
+
constructor(app: App, elRef: ElementRef, modalService: BsModalService, deviceService: DeviceService, page: PageDirective, navigationService: AbstractNavigationService);
|
|
12
15
|
ngOnDestroy(): void;
|
|
13
16
|
}
|
app-ng-runtime/package.json
CHANGED
|
@@ -983,7 +983,7 @@ $.widget('wm.datatable', {
|
|
|
983
983
|
this._render(true);
|
|
984
984
|
},
|
|
985
985
|
_setGridEditMode: function (val) {
|
|
986
|
-
if (
|
|
986
|
+
if (_.isFunction(this.options.setGridEditMode)) {
|
|
987
987
|
this.options.setGridEditMode(val);
|
|
988
988
|
}
|
|
989
989
|
},
|
|
@@ -1041,7 +1041,7 @@ $.widget('wm.datatable', {
|
|
|
1041
1041
|
$gridBody,
|
|
1042
1042
|
$alwaysNewRow;
|
|
1043
1043
|
|
|
1044
|
-
if (!alwaysNewRow &&
|
|
1044
|
+
if (!alwaysNewRow && _.isFunction(this.options.beforeRowInsert)) {
|
|
1045
1045
|
this.options.beforeRowInsert();
|
|
1046
1046
|
}
|
|
1047
1047
|
|
|
@@ -1680,10 +1680,10 @@ $.widget('wm.datatable', {
|
|
|
1680
1680
|
isQuickEdit = this.options.editmode === this.CONSTANTS.QUICK_EDIT;
|
|
1681
1681
|
|
|
1682
1682
|
function callRowSelectionEvents() {
|
|
1683
|
-
if (selected &&
|
|
1683
|
+
if (selected && _.isFunction(self.options.onRowSelect)) {
|
|
1684
1684
|
self.options.onRowSelect(data, e);
|
|
1685
1685
|
}
|
|
1686
|
-
if (!selected &&
|
|
1686
|
+
if (!selected && _.isFunction(self.options.onRowDeselect)) {
|
|
1687
1687
|
self.options.onRowDeselect(data, e);
|
|
1688
1688
|
}
|
|
1689
1689
|
}
|
|
@@ -1728,7 +1728,7 @@ $.widget('wm.datatable', {
|
|
|
1728
1728
|
if (!rowData) {
|
|
1729
1729
|
return;
|
|
1730
1730
|
}
|
|
1731
|
-
if (
|
|
1731
|
+
if (_.isFunction(this.options.onRowDblClick)) {
|
|
1732
1732
|
this.options.onRowDblClick(rowData, e);
|
|
1733
1733
|
}
|
|
1734
1734
|
},
|
|
@@ -1770,13 +1770,13 @@ $.widget('wm.datatable', {
|
|
|
1770
1770
|
if (selected) {
|
|
1771
1771
|
$column.addClass(selectedClass);
|
|
1772
1772
|
$th.addClass(selectedClass);
|
|
1773
|
-
if (
|
|
1773
|
+
if (_.isFunction(this.options.onColumnSelect) && e) {
|
|
1774
1774
|
this.options.onColumnSelect(colInfo, e);
|
|
1775
1775
|
}
|
|
1776
1776
|
} else {
|
|
1777
1777
|
$column.removeClass(selectedClass);
|
|
1778
1778
|
$th.removeClass(selectedClass);
|
|
1779
|
-
if (
|
|
1779
|
+
if (_.isFunction(this.options.onColumnDeselect) && e) {
|
|
1780
1780
|
this.options.onColumnDeselect(colInfo, e);
|
|
1781
1781
|
}
|
|
1782
1782
|
}
|
|
@@ -2029,7 +2029,7 @@ $.widget('wm.datatable', {
|
|
|
2029
2029
|
|
|
2030
2030
|
//On success of update or delete
|
|
2031
2031
|
function onSaveSuccess(skipFocus, error) {
|
|
2032
|
-
if (
|
|
2032
|
+
if (_.isFunction(options.success)) {
|
|
2033
2033
|
options.success(skipFocus, error);
|
|
2034
2034
|
}
|
|
2035
2035
|
if (!advancedEdit || self.options.actionsEnabled.edit) {
|
|
@@ -2060,7 +2060,7 @@ $.widget('wm.datatable', {
|
|
|
2060
2060
|
return;
|
|
2061
2061
|
}
|
|
2062
2062
|
$row.addClass('row-editing');
|
|
2063
|
-
if (
|
|
2063
|
+
if (_.isFunction(this.options.beforeRowUpdate)) {
|
|
2064
2064
|
this.options.beforeRowUpdate(rowData, e);
|
|
2065
2065
|
}
|
|
2066
2066
|
|
|
@@ -2073,7 +2073,7 @@ $.widget('wm.datatable', {
|
|
|
2073
2073
|
self.toggleNewRowActions(true);
|
|
2074
2074
|
}
|
|
2075
2075
|
//Event for on before form render. User can update row data here.
|
|
2076
|
-
if (
|
|
2076
|
+
if (_.isFunction(this.options.onBeforeFormRender)) {
|
|
2077
2077
|
isValid = this.options.onBeforeFormRender(rowData, e, options.operation || action);
|
|
2078
2078
|
if (isValid === false) {
|
|
2079
2079
|
return;
|
|
@@ -2096,7 +2096,7 @@ $.widget('wm.datatable', {
|
|
|
2096
2096
|
});
|
|
2097
2097
|
}
|
|
2098
2098
|
//Event for on before form render. User can access form widgets here.
|
|
2099
|
-
if (
|
|
2099
|
+
if (_.isFunction(this.options.onFormRender)) {
|
|
2100
2100
|
this.options.onFormRender($row, e, options.operation || action, $row.hasClass('always-new-row'));
|
|
2101
2101
|
}
|
|
2102
2102
|
} else {
|
|
@@ -2160,7 +2160,7 @@ $.widget('wm.datatable', {
|
|
|
2160
2160
|
}
|
|
2161
2161
|
self.options.setTouched($invalidTd.find('[formcontrolname]').attr('formcontrolname'));
|
|
2162
2162
|
});
|
|
2163
|
-
if (
|
|
2163
|
+
if (_.isFunction(options.success)) {
|
|
2164
2164
|
options.success(false, true);
|
|
2165
2165
|
}
|
|
2166
2166
|
return;
|
|
@@ -2168,14 +2168,14 @@ $.widget('wm.datatable', {
|
|
|
2168
2168
|
|
|
2169
2169
|
if (isNewRow && advancedEdit && _.isEmpty(rowData)) {
|
|
2170
2170
|
self.removeNewRow($row);
|
|
2171
|
-
if (
|
|
2171
|
+
if (_.isFunction(options.success)) {
|
|
2172
2172
|
options.success(false, undefined, true);
|
|
2173
2173
|
}
|
|
2174
2174
|
return;
|
|
2175
2175
|
}
|
|
2176
2176
|
|
|
2177
2177
|
if (isNewRow) {
|
|
2178
|
-
if (
|
|
2178
|
+
if (_.isFunction(this.options.onBeforeRowInsert)) {
|
|
2179
2179
|
isValid = this.options.onBeforeRowInsert(rowData, e, editOptions);
|
|
2180
2180
|
if (isValid === false) {
|
|
2181
2181
|
return;
|
|
@@ -2192,7 +2192,7 @@ $.widget('wm.datatable', {
|
|
|
2192
2192
|
self.removeNewRow($row);
|
|
2193
2193
|
}
|
|
2194
2194
|
} else {
|
|
2195
|
-
if (
|
|
2195
|
+
if (_.isFunction(this.options.onBeforeRowUpdate)) {
|
|
2196
2196
|
isValid = this.options.onBeforeRowUpdate(rowData, e, editOptions);
|
|
2197
2197
|
if (isValid === false) {
|
|
2198
2198
|
return;
|
|
@@ -2205,7 +2205,7 @@ $.widget('wm.datatable', {
|
|
|
2205
2205
|
if (!options.noMsg) {
|
|
2206
2206
|
this.options.noChangesDetected();
|
|
2207
2207
|
}
|
|
2208
|
-
if (
|
|
2208
|
+
if (_.isFunction(options.success)) {
|
|
2209
2209
|
options.success(false);
|
|
2210
2210
|
}
|
|
2211
2211
|
}
|
|
@@ -2315,7 +2315,7 @@ $.widget('wm.datatable', {
|
|
|
2315
2315
|
this.options.setActionRowIndex(rowId);
|
|
2316
2316
|
this.options.setLastActionPerformed(this.options.ACTIONS.DELETE);
|
|
2317
2317
|
|
|
2318
|
-
if (
|
|
2318
|
+
if (_.isFunction(this.options.beforeRowDelete)) {
|
|
2319
2319
|
this.options.beforeRowDelete(rowData, e);
|
|
2320
2320
|
}
|
|
2321
2321
|
if (isNewRow) {
|
|
@@ -2331,13 +2331,13 @@ $.widget('wm.datatable', {
|
|
|
2331
2331
|
return;
|
|
2332
2332
|
}
|
|
2333
2333
|
/* calling onbeforerowDelete callback function.*/
|
|
2334
|
-
if(
|
|
2334
|
+
if(_.isFunction(this.options.onBeforeRowDelete)) {
|
|
2335
2335
|
isValid = this.options.onBeforeRowDelete(rowData, e, options);
|
|
2336
2336
|
if (isValid === false) {
|
|
2337
2337
|
return;
|
|
2338
2338
|
}
|
|
2339
2339
|
}
|
|
2340
|
-
if (
|
|
2340
|
+
if (_.isFunction(this.options.onRowDelete)) {
|
|
2341
2341
|
className = this.options.cssClassNames.deleteRow;
|
|
2342
2342
|
isActiveRow = $row.attr('class').indexOf('active') !== -1;
|
|
2343
2343
|
if (isActiveRow) {
|
|
@@ -2982,10 +2982,10 @@ $.widget('wm.datatable', {
|
|
|
2982
2982
|
// If we enable multiselect and check header checkbox then updating selecteditem in datatable.
|
|
2983
2983
|
self.options.assignSelectedItems(rowData, e);
|
|
2984
2984
|
self.toggleRowSelection($row, checked, e, true);
|
|
2985
|
-
if (checked &&
|
|
2985
|
+
if (checked && _.isFunction(self.options.onRowSelect)) {
|
|
2986
2986
|
self.options.onRowSelect(rowData, e);
|
|
2987
2987
|
}
|
|
2988
|
-
if (!checked &&
|
|
2988
|
+
if (!checked && _.isFunction(self.options.onRowDeselect)) {
|
|
2989
2989
|
self.options.onRowDeselect(rowData, e);
|
|
2990
2990
|
}
|
|
2991
2991
|
});
|
|
@@ -3020,7 +3020,7 @@ $.widget('wm.datatable', {
|
|
|
3020
3020
|
/**Add event handler, to the select all checkbox on the header**/
|
|
3021
3021
|
$header.on('click', '.app-datagrid-header-cell input:checkbox', toggleSelectAll);
|
|
3022
3022
|
|
|
3023
|
-
if (
|
|
3023
|
+
if (_.isFunction(this.options.onHeaderClick)) {
|
|
3024
3024
|
this.gridHeaderElement.find('th.app-datagrid-header-cell').on('click', this.headerClickHandler.bind(this));
|
|
3025
3025
|
}
|
|
3026
3026
|
|
|
@@ -3168,7 +3168,7 @@ $.widget('wm.datatable', {
|
|
|
3168
3168
|
if (isCreated) {
|
|
3169
3169
|
this._setColSpan(this.options.headerConfig);
|
|
3170
3170
|
}
|
|
3171
|
-
if (
|
|
3171
|
+
if (_.isFunction(this.options.onDataRender)) {
|
|
3172
3172
|
this.options.onDataRender();
|
|
3173
3173
|
}
|
|
3174
3174
|
if (!isCreated && this.options.selectFirstRow) {
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
(function ($) {
|
|
2
|
+
/**
|
|
3
|
+
* Dummy function to provide a placeholder for the destroy function
|
|
4
|
+
*/
|
|
5
|
+
$.fn.zTreeKeyboardNavigationDestroy = function () {
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Creates a function that adds keyboard navigation:
|
|
10
|
+
* Home: home key (keycode 36) Goes to the first root element is visible
|
|
11
|
+
* End: end key (keycode 35) Goes to the last leaf node and will expand nodes and scroll the element into view
|
|
12
|
+
* Down: right cursor key (keycode 39) Goes to the next visible node in the tree following the hierarchy
|
|
13
|
+
* Next: down cursor key (keycode 40) Goes to the next visible node at the same level
|
|
14
|
+
* Up: up cursor key (keycode 37) Goes to the prior visible node at the same level
|
|
15
|
+
* Previous: left cursor key (keycode 38) Goes to the prior visible node following the hierarchy
|
|
16
|
+
* Toggle: space key (keycode 32) Toggles the expand/collapse state of a parent node
|
|
17
|
+
* @param {IxTreeObj} zTree
|
|
18
|
+
* @param {string|JQuery<HTMLElement} element
|
|
19
|
+
* @param {IJSON[]} selectedNodes
|
|
20
|
+
*/
|
|
21
|
+
$.fn.zTreeKeyboardNavigation = function (zTree, element, selectedNodes = null, treeicon) {
|
|
22
|
+
if (typeof element === 'string' || element instanceof String) {
|
|
23
|
+
element = $(element);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var rootNodes = zTree.getNodes();
|
|
27
|
+
if (!rootNodes) return;
|
|
28
|
+
|
|
29
|
+
var focusSelectedNode = function () {
|
|
30
|
+
if ((selectedNodes = zTree.getSelectedNodes()) && selectedNodes.length) {
|
|
31
|
+
$("#" + selectedNodes[0].tId).focus();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Clear the previous event handler (there may be none)
|
|
36
|
+
$.fn.zTreeKeyboardNavigationDestroy();
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Make it possible to destroy (remove the event handlers)
|
|
40
|
+
*/
|
|
41
|
+
$.fn.zTreeKeyboardNavigationDestroy = function () {
|
|
42
|
+
$(element).off('keydown');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
$.fn.changeTreeIcons = function () {
|
|
46
|
+
let eleClose = $('.app-tree li span.button.switch');
|
|
47
|
+
|
|
48
|
+
$(eleClose).map((idx, ele) => {
|
|
49
|
+
$(ele).addClass(treeicon);
|
|
50
|
+
$(ele).on("click", function (e) {
|
|
51
|
+
setTimeout(() => {
|
|
52
|
+
$(ele).addClass(treeicon);
|
|
53
|
+
}, 0);
|
|
54
|
+
});
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
$(element).on('keydown', function (e) {
|
|
60
|
+
var selectedNodes = zTree.getSelectedNodes();
|
|
61
|
+
var selectedNode = selectedNodes.length ? selectedNodes[0] : null;
|
|
62
|
+
|
|
63
|
+
var processSpace = function () {
|
|
64
|
+
// If there are no nodes or the selected node is not a parent, get out
|
|
65
|
+
if (selectedNode && selectedNode.isParent) {
|
|
66
|
+
// Toggle the node
|
|
67
|
+
zTree.expandNode(selectedNode, selectedNode.open ? false : true, true, true);
|
|
68
|
+
$.fn.changeTreeIcons()
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var processHome = function () {
|
|
73
|
+
zTree.selectNode(rootNodes[0], false, true);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
var processEnd = function () {
|
|
77
|
+
var nodes = zTree.transformToArray(rootNodes);
|
|
78
|
+
// Select the last node
|
|
79
|
+
zTree.selectNode(nodes[nodes.length - 1]);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
var processUp = function () {
|
|
83
|
+
var priorNode;
|
|
84
|
+
if (selectedNode) {
|
|
85
|
+
priorNode = selectedNode.getPreNode();
|
|
86
|
+
if (!priorNode) return;
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
processEnd();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (!priorNode) return;
|
|
93
|
+
|
|
94
|
+
zTree.selectNode(priorNode);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var processDown = function () {
|
|
98
|
+
var nextNode;
|
|
99
|
+
if (selectedNode) {
|
|
100
|
+
nextNode = selectedNode.getNextNode();
|
|
101
|
+
if (!nextNode) return;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
processHome();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (!nextNode) return;
|
|
108
|
+
|
|
109
|
+
zTree.selectNode(nextNode);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
var processOut = function () {
|
|
113
|
+
if (!selectedNode) return;
|
|
114
|
+
|
|
115
|
+
var parentNode = selectedNode.getParentNode();
|
|
116
|
+
var priorNode = selectedNode.getPreNode();
|
|
117
|
+
if (!parentNode && !priorNode) return; // Must have been the root node
|
|
118
|
+
|
|
119
|
+
if (priorNode) {
|
|
120
|
+
if (priorNode.isParent) {
|
|
121
|
+
// There is a prior node, now the the question is where is the last open node?
|
|
122
|
+
while (priorNode) {
|
|
123
|
+
if (!priorNode.isParent || !priorNode.open || !priorNode.children) break;
|
|
124
|
+
|
|
125
|
+
priorNode = priorNode.children[priorNode.children.length - 1];
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
zTree.selectNode(priorNode);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
zTree.selectNode(priorNode);
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Find the parent node with a valid prior sibling
|
|
138
|
+
if (parentNode) {
|
|
139
|
+
// This call should be silent otherwise (in my view a bug in)
|
|
140
|
+
// selectNode causes the root node to blur
|
|
141
|
+
zTree.selectNode(parentNode, false, true);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
var processIn = function () {
|
|
146
|
+
if (!selectedNode) return;
|
|
147
|
+
|
|
148
|
+
if (selectedNode.isParent && selectedNode.open && selectedNode.children) {
|
|
149
|
+
zTree.selectNode(selectedNode.children[0]);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
var nextNode = selectedNode.getNextNode();
|
|
154
|
+
if (nextNode) {
|
|
155
|
+
zTree.selectNode(nextNode);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
// Cannot be root if there is a selected node that is not a parent
|
|
159
|
+
var node = selectedNode;
|
|
160
|
+
// Find the parent node with a valid next sibling
|
|
161
|
+
while (node = node.getParentNode()) {
|
|
162
|
+
var nextNode = node.getNextNode();
|
|
163
|
+
if (nextNode) {
|
|
164
|
+
zTree.selectNode(nextNode);
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
var processLetter = function (keyCode) {
|
|
172
|
+
if (!Array.from({ length: 26 }, (v, i) => i + 65).includes(keyCode & 95)) return false;
|
|
173
|
+
|
|
174
|
+
var nodes = zTree.transformToArray(rootNodes);
|
|
175
|
+
nodes = nodes.filter(node => {
|
|
176
|
+
return 'accesskey' in node && node.accesskey.length && (node.accesskey.charCodeAt(0) & 95) == keyCode;
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
if (!nodes.length) return false;
|
|
180
|
+
|
|
181
|
+
var selectedNodes = zTree.getSelectedNodes();
|
|
182
|
+
if (!selectedNodes.length) return false;
|
|
183
|
+
|
|
184
|
+
if (selectedNodes[0] == nodes[0]) return false;
|
|
185
|
+
|
|
186
|
+
zTree.selectNode(nodes[0]);
|
|
187
|
+
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// console.log('before');
|
|
192
|
+
// console.log(document.activeElement);
|
|
193
|
+
|
|
194
|
+
switch (e.keyCode) {
|
|
195
|
+
case 32: /* Toggle parent nodes */
|
|
196
|
+
processSpace();
|
|
197
|
+
return;
|
|
198
|
+
|
|
199
|
+
case 36: /* Home - go to the root node */
|
|
200
|
+
processHome();
|
|
201
|
+
break;
|
|
202
|
+
|
|
203
|
+
case 35: /* End - go to the last node */
|
|
204
|
+
processEnd();
|
|
205
|
+
break;
|
|
206
|
+
|
|
207
|
+
case 33: /* PageUp */
|
|
208
|
+
// Do nothing
|
|
209
|
+
break;
|
|
210
|
+
|
|
211
|
+
case 34: /* PageDown */
|
|
212
|
+
// Do nothing
|
|
213
|
+
break;
|
|
214
|
+
|
|
215
|
+
case 37: /* Left */
|
|
216
|
+
processOut();
|
|
217
|
+
break;
|
|
218
|
+
|
|
219
|
+
case 38: /* Up */
|
|
220
|
+
processUp();
|
|
221
|
+
break;
|
|
222
|
+
|
|
223
|
+
case 39: /* Right */
|
|
224
|
+
processIn();
|
|
225
|
+
break;
|
|
226
|
+
|
|
227
|
+
case 40: /* Down */
|
|
228
|
+
processDown();
|
|
229
|
+
break;
|
|
230
|
+
|
|
231
|
+
default:
|
|
232
|
+
if (!processLetter(e.keyCode & 95)) return;
|
|
233
|
+
break;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// console.log('after');
|
|
237
|
+
// console.log(document.activeElement);
|
|
238
|
+
focusSelectedNode();
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
if (selectedNodes && selectedNodes.length) {
|
|
242
|
+
zTree.selectNode(selectedNodes[0]);
|
|
243
|
+
focusSelectedNode();
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
$(element).trigger({ type: 'keydown', which: 36, keyCode: 36 });
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
})(jQuery);
|