mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
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:
committed by
Eugenio Romano
parent
3e342863fd
commit
4ca18bc8f9
@@ -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,
|
||||
|
25
ng2-components/ng2-alfresco-core/src/events/base-ui.event.ts
Normal file
25
ng2-components/ng2-alfresco-core/src/events/base-ui.event.ts
Normal 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;
|
||||
}
|
32
ng2-components/ng2-alfresco-core/src/events/base.event.ts
Normal file
32
ng2-components/ng2-alfresco-core/src/events/base.event.ts
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user