diff --git a/demo-shell-ng2/app/components/files/files.component.html b/demo-shell-ng2/app/components/files/files.component.html index 4841e08d55..e99f78a2c9 100644 --- a/demo-shell-ng2/app/components/files/files.component.html +++ b/demo-shell-ng2/app/components/files/files.component.html @@ -92,10 +92,10 @@ - - + diff --git a/demo-shell-ng2/app/components/files/files.component.ts b/demo-shell-ng2/app/components/files/files.component.ts index d10605b54e..828f9f5181 100644 --- a/demo-shell-ng2/app/components/files/files.component.ts +++ b/demo-shell-ng2/app/components/files/files.component.ts @@ -25,8 +25,10 @@ import { MDL, AlfrescoContentService, CONTEXT_MENU_DIRECTIVES, - AlfrescoPipeTranslate + AlfrescoPipeTranslate/*, + PaginationComponent*/ } from 'ng2-alfresco-core'; +import { PaginationComponent } from 'ng2-alfresco-core'; import { ALFRESCO_ULPOAD_COMPONENTS } from 'ng2-alfresco-upload'; import { VIEWERCOMPONENT } from 'ng2-alfresco-viewer'; @@ -42,7 +44,8 @@ declare let __moduleName: string; MDL, ALFRESCO_ULPOAD_COMPONENTS, VIEWERCOMPONENT, - CONTEXT_MENU_DIRECTIVES + CONTEXT_MENU_DIRECTIVES, + PaginationComponent ], providers: [DOCUMENT_LIST_PROVIDERS], pipes: [AlfrescoPipeTranslate] diff --git a/ng2-components/ng2-alfresco-core/index.ts b/ng2-components/ng2-alfresco-core/index.ts index 62059dff40..231df2fe5b 100644 --- a/ng2-components/ng2-alfresco-core/index.ts +++ b/ng2-components/ng2-alfresco-core/index.ts @@ -15,37 +15,20 @@ * limitations under the License. */ -import { AlfrescoSettingsService } from './src/services/AlfrescoSettingsService.service'; -import { AlfrescoTranslationLoader } from './src/services/AlfrescoTranslationLoader.service'; -import { AlfrescoTranslationService } from './src/services/AlfrescoTranslationService.service'; -import { AlfrescoPipeTranslate } from './src/services/AlfrescoPipeTranslate.service'; -import { AlfrescoAuthenticationService } from './src/services/AlfrescoAuthenticationService.service'; -import { AlfrescoContentService } from './src/services/AlfrescoContentService.service'; -import { ContextMenuService } from './src/services/context-menu.service'; -import { ContextMenuHolderComponent } from './src/components/context-menu-holder.component'; -import { ContextMenuDirective } from './src/components/context-menu.directive'; -import { MDL } from './src/material/MaterialDesignLiteUpgradeElement'; -import { AlfrescoMdlButtonDirective } from './src/material/mdl-button.directive'; -import { AlfrescoMdlMenuDirective } from './src/material/mdl-menu.directive'; +import { + AlfrescoSettingsService, + AlfrescoTranslationLoader, + AlfrescoTranslationService, + AlfrescoPipeTranslate, + AlfrescoAuthenticationService, + AlfrescoContentService +} from './src/services/index'; -export * from './src/services/AlfrescoSettingsService.service'; -export * from './src/services/AlfrescoTranslationLoader.service'; -export * from './src/services/AlfrescoTranslationService.service'; -export * from './src/services/AlfrescoPipeTranslate.service'; -export * from './src/services/AlfrescoAuthenticationService.service'; -export * from './src/services/AlfrescoContentService.service'; +import { ContextMenuService } from './src/components/context-menu/context-menu.service'; -// Material Design Lite integration -export * from './src/material/MaterialDesignLiteUpgradeElement'; -export * from './src/material/mdl-button.directive'; -export * from './src/material/mdl-menu.directive'; - -export * from './src/services/context-menu.service'; -export * from './src/components/context-menu-holder.component'; -export * from './src/components/context-menu.directive'; - -export * from './src/data/pagination-provider'; -export * from './src/utils/object-utils'; +export * from './src/services/index'; +export * from './src/components/index'; +export * from './src/utils/index'; export const ALFRESCO_CORE_PROVIDERS: [any] = [ AlfrescoAuthenticationService, @@ -57,17 +40,3 @@ export const ALFRESCO_CORE_PROVIDERS: [any] = [ ContextMenuService ]; -export const CONTEXT_MENU_PROVIDERS: [any] = [ - ContextMenuService -]; - -export const CONTEXT_MENU_DIRECTIVES: [any] = [ - ContextMenuHolderComponent, - ContextMenuDirective -]; - -export const MATERIAL_DESIGN_DIRECTIVES: [any] = [ - MDL, - AlfrescoMdlButtonDirective, - AlfrescoMdlMenuDirective -]; diff --git a/ng2-components/ng2-alfresco-core/package.json b/ng2-components/ng2-alfresco-core/package.json index 873eebc038..8209070b39 100644 --- a/ng2-components/ng2-alfresco-core/package.json +++ b/ng2-components/ng2-alfresco-core/package.json @@ -6,13 +6,14 @@ "scripts": { "clean": "rimraf dist node_modules typings", "typings": "typings install", - "build": "npm run tslint && typings install && rimraf dist && tsc && license-check", + "build": "npm run tslint && typings install && rimraf dist && tsc && npm run copy-static && license-check", "build:w": "npm run tslint && typings install && rimraf dist && npm run watch-task", "watch-task": "concurrently \"npm run tsc:w\" \"license-check\"", "tslint": "npm run tslint-src && npm run tslint-root", "tslint-src": "tslint -c tslint.json src/{,**/}**.ts", "tslint-root": "tslint -c tslint.json *.ts", "licensecheck": "license-check", + "copy-static": "cpx \"./src/**/*.{html,css}\" ./dist/src", "tsc": "tsc", "tsc:w": "tsc -w", "pretest": "npm run build", diff --git a/ng2-components/ng2-alfresco-core/src/components/context-menu-holder.component.spec.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.spec.ts similarity index 97% rename from ng2-components/ng2-alfresco-core/src/components/context-menu-holder.component.spec.ts rename to ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.spec.ts index 496fac21e7..5ac723cc3d 100644 --- a/ng2-components/ng2-alfresco-core/src/components/context-menu-holder.component.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.spec.ts @@ -16,7 +16,7 @@ */ import { describe, it, beforeEach } from '@angular/core/testing'; -import { ContextMenuService } from './../services/context-menu.service'; +import { ContextMenuService } from './context-menu.service'; import { ContextMenuHolderComponent } from './context-menu-holder.component'; describe('ContextMenuHolderComponent', () => { diff --git a/ng2-components/ng2-alfresco-core/src/components/context-menu-holder.component.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.ts similarity index 97% rename from ng2-components/ng2-alfresco-core/src/components/context-menu-holder.component.ts rename to ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.ts index 40a3d9960f..9f406ed117 100644 --- a/ng2-components/ng2-alfresco-core/src/components/context-menu-holder.component.ts +++ b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu-holder.component.ts @@ -16,7 +16,7 @@ */ import { Component, HostListener } from '@angular/core'; -import { ContextMenuService } from './../services/context-menu.service'; +import { ContextMenuService } from './context-menu.service'; @Component({ selector:'context-menu-holder', diff --git a/ng2-components/ng2-alfresco-core/src/components/context-menu.directive.spec.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.spec.ts similarity index 96% rename from ng2-components/ng2-alfresco-core/src/components/context-menu.directive.spec.ts rename to ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.spec.ts index 7c1e56ccb9..b8b7b169f1 100644 --- a/ng2-components/ng2-alfresco-core/src/components/context-menu.directive.spec.ts +++ b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.spec.ts @@ -17,7 +17,7 @@ import { describe, it, beforeEach } from '@angular/core/testing'; import { ContextMenuDirective } from './context-menu.directive'; -import { ContextMenuService } from './../services/context-menu.service'; +import { ContextMenuService } from './context-menu.service'; describe('ContextMenuDirective', () => { diff --git a/ng2-components/ng2-alfresco-core/src/components/context-menu.directive.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.ts similarity index 94% rename from ng2-components/ng2-alfresco-core/src/components/context-menu.directive.ts rename to ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.ts index 05be1f4309..2859e76cd7 100644 --- a/ng2-components/ng2-alfresco-core/src/components/context-menu.directive.ts +++ b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.directive.ts @@ -16,7 +16,7 @@ */ import { Directive, Input, HostListener } from '@angular/core'; -import { ContextMenuService } from './../services/context-menu.service'; +import { ContextMenuService } from './context-menu.service'; @Directive({ selector:'[context-menu]' diff --git a/ng2-components/ng2-alfresco-core/src/services/context-menu.service.spec.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.service.spec.ts similarity index 100% rename from ng2-components/ng2-alfresco-core/src/services/context-menu.service.spec.ts rename to ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.service.spec.ts diff --git a/ng2-components/ng2-alfresco-core/src/services/context-menu.service.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.service.ts similarity index 100% rename from ng2-components/ng2-alfresco-core/src/services/context-menu.service.ts rename to ng2-components/ng2-alfresco-core/src/components/context-menu/context-menu.service.ts diff --git a/ng2-components/ng2-alfresco-core/src/components/context-menu/index.ts b/ng2-components/ng2-alfresco-core/src/components/context-menu/index.ts new file mode 100644 index 0000000000..a6b21baf9d --- /dev/null +++ b/ng2-components/ng2-alfresco-core/src/components/context-menu/index.ts @@ -0,0 +1,33 @@ +/*! + * @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 { ContextMenuService } from './context-menu.service'; +import { ContextMenuHolderComponent } from './context-menu-holder.component'; +import { ContextMenuDirective } from './context-menu.directive'; + +export * from './context-menu.service'; +export * from './context-menu-holder.component'; +export * from './context-menu.directive'; + +export const CONTEXT_MENU_PROVIDERS: [any] = [ + ContextMenuService +]; + +export const CONTEXT_MENU_DIRECTIVES: [any] = [ + ContextMenuHolderComponent, + ContextMenuDirective +]; diff --git a/ng2-components/ng2-alfresco-core/src/components/index.ts b/ng2-components/ng2-alfresco-core/src/components/index.ts new file mode 100644 index 0000000000..7c6259e8a1 --- /dev/null +++ b/ng2-components/ng2-alfresco-core/src/components/index.ts @@ -0,0 +1,20 @@ +/*! + * @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. + */ + +export * from './context-menu/index'; +export * from './material/index'; +export * from './pagination/index'; diff --git a/ng2-components/ng2-alfresco-core/src/material/MaterialDesignLiteUpgradeElement.ts b/ng2-components/ng2-alfresco-core/src/components/material/MaterialDesignLiteUpgradeElement.ts similarity index 100% rename from ng2-components/ng2-alfresco-core/src/material/MaterialDesignLiteUpgradeElement.ts rename to ng2-components/ng2-alfresco-core/src/components/material/MaterialDesignLiteUpgradeElement.ts diff --git a/ng2-components/ng2-alfresco-core/src/components/material/index.ts b/ng2-components/ng2-alfresco-core/src/components/material/index.ts new file mode 100644 index 0000000000..63ce268538 --- /dev/null +++ b/ng2-components/ng2-alfresco-core/src/components/material/index.ts @@ -0,0 +1,30 @@ +/*! + * @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 { MDL } from './MaterialDesignLiteUpgradeElement'; +import { AlfrescoMdlButtonDirective } from './mdl-button.directive'; +import { AlfrescoMdlMenuDirective } from './mdl-menu.directive'; + +export * from './MaterialDesignLiteUpgradeElement'; +export * from './mdl-button.directive'; +export * from './mdl-menu.directive'; + +export const MATERIAL_DESIGN_DIRECTIVES: [any] = [ + MDL, + AlfrescoMdlButtonDirective, + AlfrescoMdlMenuDirective +]; diff --git a/ng2-components/ng2-alfresco-core/src/material/mdl-button.directive.ts b/ng2-components/ng2-alfresco-core/src/components/material/mdl-button.directive.ts similarity index 100% rename from ng2-components/ng2-alfresco-core/src/material/mdl-button.directive.ts rename to ng2-components/ng2-alfresco-core/src/components/material/mdl-button.directive.ts diff --git a/ng2-components/ng2-alfresco-core/src/material/mdl-menu.directive.ts b/ng2-components/ng2-alfresco-core/src/components/material/mdl-menu.directive.ts similarity index 100% rename from ng2-components/ng2-alfresco-core/src/material/mdl-menu.directive.ts rename to ng2-components/ng2-alfresco-core/src/components/material/mdl-menu.directive.ts diff --git a/ng2-components/ng2-alfresco-core/src/components/pagination/index.ts b/ng2-components/ng2-alfresco-core/src/components/pagination/index.ts new file mode 100644 index 0000000000..9e25a61495 --- /dev/null +++ b/ng2-components/ng2-alfresco-core/src/components/pagination/index.ts @@ -0,0 +1,19 @@ +/*! + * @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. + */ + +export * from './pagination-provider'; +export * from './pagination.component'; diff --git a/ng2-components/ng2-alfresco-core/src/data/pagination-provider.ts b/ng2-components/ng2-alfresco-core/src/components/pagination/pagination-provider.ts similarity index 100% rename from ng2-components/ng2-alfresco-core/src/data/pagination-provider.ts rename to ng2-components/ng2-alfresco-core/src/components/pagination/pagination-provider.ts diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/pagination/pagination.component.css b/ng2-components/ng2-alfresco-core/src/components/pagination/pagination.component.css similarity index 100% rename from ng2-components/ng2-alfresco-documentlist/src/components/pagination/pagination.component.css rename to ng2-components/ng2-alfresco-core/src/components/pagination/pagination.component.css diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/pagination/pagination.component.html b/ng2-components/ng2-alfresco-core/src/components/pagination/pagination.component.html similarity index 100% rename from ng2-components/ng2-alfresco-documentlist/src/components/pagination/pagination.component.html rename to ng2-components/ng2-alfresco-core/src/components/pagination/pagination.component.html diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/pagination/pagination.component.ts b/ng2-components/ng2-alfresco-core/src/components/pagination/pagination.component.ts similarity index 91% rename from ng2-components/ng2-alfresco-documentlist/src/components/pagination/pagination.component.ts rename to ng2-components/ng2-alfresco-core/src/components/pagination/pagination.component.ts index 974e06b1ac..01a5c2bb08 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/pagination/pagination.component.ts +++ b/ng2-components/ng2-alfresco-core/src/components/pagination/pagination.component.ts @@ -16,21 +16,20 @@ */ import { Component, Input } from '@angular/core'; -import { - MATERIAL_DESIGN_DIRECTIVES, - PaginationProvider -} from 'ng2-alfresco-core'; + +import { MATERIAL_DESIGN_DIRECTIVES } from './../material/index'; +import { PaginationProvider } from './pagination-provider'; declare let __moduleName: string; @Component({ moduleId: __moduleName, - selector: 'alfresco-document-list-pagination', + selector: 'alfresco-pagination', templateUrl: './pagination.component.html', styleUrls: ['./pagination.component.css'], directives: [MATERIAL_DESIGN_DIRECTIVES] }) -export class DocumentListPagination { +export class PaginationComponent { DEFAULT_PAGE_SIZE: number = 20; diff --git a/ng2-components/ng2-alfresco-core/src/services/index.ts b/ng2-components/ng2-alfresco-core/src/services/index.ts new file mode 100644 index 0000000000..bdde5bffd4 --- /dev/null +++ b/ng2-components/ng2-alfresco-core/src/services/index.ts @@ -0,0 +1,23 @@ +/*! + * @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. + */ + +export * from './AlfrescoSettingsService.service'; +export * from './AlfrescoTranslationLoader.service'; +export * from './AlfrescoTranslationService.service'; +export * from './AlfrescoPipeTranslate.service'; +export * from './AlfrescoAuthenticationService.service'; +export * from './AlfrescoContentService.service'; diff --git a/ng2-components/ng2-alfresco-core/src/utils/index.ts b/ng2-components/ng2-alfresco-core/src/utils/index.ts new file mode 100644 index 0000000000..f3ae4ef189 --- /dev/null +++ b/ng2-components/ng2-alfresco-core/src/utils/index.ts @@ -0,0 +1,18 @@ +/*! + * @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. + */ + +export * from './object-utils'; diff --git a/ng2-components/ng2-alfresco-documentlist/index.ts b/ng2-components/ng2-alfresco-documentlist/index.ts index 0678520b1f..7c2f142c61 100644 --- a/ng2-components/ng2-alfresco-documentlist/index.ts +++ b/ng2-components/ng2-alfresco-documentlist/index.ts @@ -22,7 +22,6 @@ import { ContentAction } from './src/components/content-action'; import { ContentActionList } from './src/components/content-action-list'; import { EmptyFolderContent } from './src/components/empty-folder-content'; import { DocumentListBreadcrumb } from './src/components/breadcrumb/breadcrumb.component'; -import { DocumentListPagination } from './src/components/pagination/pagination.component'; import { FolderActionsService } from './src/services/folder-actions.service'; import { DocumentActionsService } from './src/services/document-actions.service'; @@ -36,7 +35,6 @@ export * from './src/components/content-action'; export * from './src/components/content-action-list'; export * from './src/components/empty-folder-content'; export * from './src/components/breadcrumb/breadcrumb.component'; -export * from './src/components/pagination/pagination.component'; // services export * from './src/services/folder-actions.service'; @@ -50,8 +48,7 @@ export const DOCUMENT_LIST_DIRECTIVES: [any] = [ ContentAction, ContentActionList, EmptyFolderContent, - DocumentListBreadcrumb, - DocumentListPagination + DocumentListBreadcrumb ]; export const DOCUMENT_LIST_PROVIDERS: [any] = [