cancellable events for DataTable and DocumentList (#1682)

* cancellable events for DataTable and DocumentList

* more typed events and code fixes

* code fixes
This commit is contained in:
Denys Vuika
2017-03-02 14:49:55 +00:00
committed by Eugenio Romano
parent 3e342863fd
commit 4ca18bc8f9
15 changed files with 256 additions and 90 deletions

View File

@@ -45,6 +45,8 @@ import { CONTEXT_MENU_PROVIDERS, CONTEXT_MENU_DIRECTIVES } from './src/component
export * from './src/services/index';
export * from './src/components/index';
export * from './src/utils/index';
export * from './src/events/base.event';
export * from './src/events/base-ui.event';
export const ALFRESCO_CORE_PROVIDERS: any[] = [
NotificationService,

View File

@@ -0,0 +1,25 @@
/*!
* @license
* Copyright 2016 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BaseEvent } from './base.event';
/** Base container for any event which takes place in the DOM */
export class BaseUIEvent<T> extends BaseEvent<T> {
/** Original DOM event */
event: Event;
}

View File

@@ -0,0 +1,32 @@
/*!
* @license
* Copyright 2016 Alfresco Software, Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/** Base cancellable event implementation */
export class BaseEvent<T> {
private isDefaultPrevented: boolean = false;
value: T;
get defaultPrevented() {
return this.isDefaultPrevented;
}
preventDefault() {
this.isDefaultPrevented = true;
}
}