mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
AAE-34298 Move viewer to separate entry point
This commit is contained in:
@@ -26,7 +26,6 @@ import { LANGUAGE_MENU_DIRECTIVES } from './language-menu/language-menu.module';
|
|||||||
import { LOGIN_DIRECTIVES } from './login/login.module';
|
import { LOGIN_DIRECTIVES } from './login/login.module';
|
||||||
import { PAGINATION_DIRECTIVES } from './pagination/pagination.module';
|
import { PAGINATION_DIRECTIVES } from './pagination/pagination.module';
|
||||||
import { TOOLBAR_DIRECTIVES } from './toolbar/toolbar.module';
|
import { TOOLBAR_DIRECTIVES } from './toolbar/toolbar.module';
|
||||||
import { VIEWER_DIRECTIVES } from './viewer/viewer.module';
|
|
||||||
import { FormBaseModule } from './form/form-base.module';
|
import { FormBaseModule } from './form/form-base.module';
|
||||||
import { LAYOUT_DIRECTIVES } from './layout/layout.module';
|
import { LAYOUT_DIRECTIVES } from './layout/layout.module';
|
||||||
import { CommentsComponent } from './comments/comments.component';
|
import { CommentsComponent } from './comments/comments.component';
|
||||||
@@ -61,7 +60,6 @@ import { MaterialModule } from './material.module';
|
|||||||
imports: [
|
imports: [
|
||||||
TranslateModule,
|
TranslateModule,
|
||||||
...ABOUT_DIRECTIVES,
|
...ABOUT_DIRECTIVES,
|
||||||
...VIEWER_DIRECTIVES,
|
|
||||||
...LAYOUT_DIRECTIVES,
|
...LAYOUT_DIRECTIVES,
|
||||||
...CORE_PIPES,
|
...CORE_PIPES,
|
||||||
IdentityUserInfoComponent,
|
IdentityUserInfoComponent,
|
||||||
@@ -97,7 +95,6 @@ import { MaterialModule } from './material.module';
|
|||||||
providers: [...CORE_PIPES],
|
providers: [...CORE_PIPES],
|
||||||
exports: [
|
exports: [
|
||||||
...ABOUT_DIRECTIVES,
|
...ABOUT_DIRECTIVES,
|
||||||
...VIEWER_DIRECTIVES,
|
|
||||||
...LAYOUT_DIRECTIVES,
|
...LAYOUT_DIRECTIVES,
|
||||||
...CORE_PIPES,
|
...CORE_PIPES,
|
||||||
...CORE_DIRECTIVES,
|
...CORE_DIRECTIVES,
|
||||||
|
@@ -29,7 +29,6 @@ import { InputMaskDirective } from './text/text-mask.component';
|
|||||||
import { TextWidgetComponent } from './text/text.widget';
|
import { TextWidgetComponent } from './text/text.widget';
|
||||||
import { DateTimeWidgetComponent } from './date-time/date-time.widget';
|
import { DateTimeWidgetComponent } from './date-time/date-time.widget';
|
||||||
import { JsonWidgetComponent } from './json/json.widget';
|
import { JsonWidgetComponent } from './json/json.widget';
|
||||||
import { BaseViewerWidgetComponent } from './base-viewer/base-viewer.widget';
|
|
||||||
import { DecimalWidgetComponent } from './decimal/decimal.component';
|
import { DecimalWidgetComponent } from './decimal/decimal.component';
|
||||||
|
|
||||||
// core
|
// core
|
||||||
@@ -50,7 +49,6 @@ export * from './amount/amount.widget';
|
|||||||
export * from './error/error.component';
|
export * from './error/error.component';
|
||||||
export * from './date-time/date-time.widget';
|
export * from './date-time/date-time.widget';
|
||||||
export * from './json/json.widget';
|
export * from './json/json.widget';
|
||||||
export * from './base-viewer/base-viewer.widget';
|
|
||||||
export * from './text/text-mask.component';
|
export * from './text/text-mask.component';
|
||||||
|
|
||||||
// widgets with schema
|
// widgets with schema
|
||||||
@@ -70,8 +68,7 @@ export const WIDGET_DIRECTIVES = [
|
|||||||
AmountWidgetComponent,
|
AmountWidgetComponent,
|
||||||
ErrorWidgetComponent,
|
ErrorWidgetComponent,
|
||||||
DateTimeWidgetComponent,
|
DateTimeWidgetComponent,
|
||||||
JsonWidgetComponent,
|
JsonWidgetComponent
|
||||||
BaseViewerWidgetComponent
|
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const MASK_DIRECTIVE = [InputMaskDirective] as const;
|
export const MASK_DIRECTIVE = [InputMaskDirective] as const;
|
||||||
|
@@ -43,7 +43,6 @@ export class FormRenderingService extends DynamicComponentMapper {
|
|||||||
[FormFieldTypes.READONLY_TEXT]: DynamicComponentResolver.fromType(widgets.DisplayTextWidgetComponent),
|
[FormFieldTypes.READONLY_TEXT]: DynamicComponentResolver.fromType(widgets.DisplayTextWidgetComponent),
|
||||||
[FormFieldTypes.JSON]: DynamicComponentResolver.fromType(widgets.JsonWidgetComponent),
|
[FormFieldTypes.JSON]: DynamicComponentResolver.fromType(widgets.JsonWidgetComponent),
|
||||||
[FormFieldTypes.DISPLAY_VALUE]: DynamicComponentResolver.fromType(widgets.TextWidgetComponent),
|
[FormFieldTypes.DISPLAY_VALUE]: DynamicComponentResolver.fromType(widgets.TextWidgetComponent),
|
||||||
[FormFieldTypes.DATETIME]: DynamicComponentResolver.fromType(widgets.DateTimeWidgetComponent),
|
[FormFieldTypes.DATETIME]: DynamicComponentResolver.fromType(widgets.DateTimeWidgetComponent)
|
||||||
[FormFieldTypes.VIEWER]: DynamicComponentResolver.fromType(widgets.BaseViewerWidgetComponent)
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,6 @@ export * from './lib/about/index';
|
|||||||
export * from './lib/avatar/avatar.component';
|
export * from './lib/avatar/avatar.component';
|
||||||
export * from './lib/button/button.component';
|
export * from './lib/button/button.component';
|
||||||
export * from './lib/progress/progress.component';
|
export * from './lib/progress/progress.component';
|
||||||
export * from './lib/viewer/index';
|
|
||||||
export * from './lib/toolbar/index';
|
export * from './lib/toolbar/index';
|
||||||
export * from './lib/header/index';
|
export * from './lib/header/index';
|
||||||
export * from './lib/pagination/index';
|
export * from './lib/pagination/index';
|
||||||
|
@@ -11,6 +11,8 @@
|
|||||||
"@alfresco/adf-core/shell": ["../shell/src/index.ts"],
|
"@alfresco/adf-core/shell": ["../shell/src/index.ts"],
|
||||||
"@alfresco/adf-core/api": ["../api/src/index.ts"],
|
"@alfresco/adf-core/api": ["../api/src/index.ts"],
|
||||||
"@alfresco/adf-core/feature-flags": ["../feature-flags/src/index.ts"],
|
"@alfresco/adf-core/feature-flags": ["../feature-flags/src/index.ts"],
|
||||||
|
"@alfresco/adf-core/viewer": ["../viewer/src/index.ts"],
|
||||||
|
"@alfresco/adf-core": ["../src/public-api.ts"],
|
||||||
"@alfresco/js-api": ["../../../dist/libs/js-api"],
|
"@alfresco/js-api": ["../../../dist/libs/js-api"],
|
||||||
"@alfresco/js-api/*": ["../../../dist/libs/js-api/*"]
|
"@alfresco/js-api/*": ["../../../dist/libs/js-api/*"]
|
||||||
},
|
},
|
||||||
|
8
lib/core/viewer/ng-package.json
Normal file
8
lib/core/viewer/ng-package.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"lib": {
|
||||||
|
"entryFile": "src/index.ts",
|
||||||
|
"styleIncludePaths": [
|
||||||
|
"../src/lib/styles"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@@ -15,4 +15,4 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export * from './public-api';
|
export * from './src/index';
|
@@ -1,4 +1,4 @@
|
|||||||
@use '../../../styles/mat-selectors' as ms;
|
@use 'mat-selectors' as ms;
|
||||||
|
|
||||||
.adf-image-viewer {
|
.adf-image-viewer {
|
||||||
width: 100%;
|
width: 100%;
|
@@ -34,9 +34,7 @@ import { MatButtonModule } from '@angular/material/button';
|
|||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import Cropper from 'cropperjs';
|
import Cropper from 'cropperjs';
|
||||||
import { AppConfigService } from '../../../app-config';
|
import { AppConfigService, UrlService, ToolbarComponent } from '@alfresco/adf-core';
|
||||||
import { UrlService } from '../../../common';
|
|
||||||
import { ToolbarComponent } from '../../../toolbar';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-img-viewer',
|
selector: 'adf-img-viewer',
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { NgClass, NgForOf } from '@angular/common';
|
import { NgClass, NgForOf } from '@angular/common';
|
||||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||||
import { UrlService } from '../../../common';
|
import { UrlService } from '@alfresco/adf-core';
|
||||||
import { Track } from '../../models/viewer.model';
|
import { Track } from '../../models/viewer.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
@@ -1,4 +1,4 @@
|
|||||||
@use '../../../styles/mat-selectors' as ms;
|
@use 'mat-selectors' as ms;
|
||||||
|
|
||||||
.adf-pdf-viewer {
|
.adf-pdf-viewer {
|
||||||
width: 100%;
|
width: 100%;
|
@@ -41,8 +41,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { from, Subject, switchMap } from 'rxjs';
|
import { from, Subject, switchMap } from 'rxjs';
|
||||||
import { catchError } from 'rxjs/operators';
|
import { catchError } from 'rxjs/operators';
|
||||||
import { AppConfigService } from '../../../app-config';
|
import { AppConfigService, ToolbarComponent, ToolbarDividerComponent } from '@alfresco/adf-core';
|
||||||
import { ToolbarComponent, ToolbarDividerComponent } from '../../../toolbar';
|
|
||||||
import { RenderingQueueServices } from '../../services/rendering-queue.services';
|
import { RenderingQueueServices } from '../../services/rendering-queue.services';
|
||||||
import { PdfPasswordDialogComponent } from '../pdf-viewer-password-dialog/pdf-viewer-password-dialog';
|
import { PdfPasswordDialogComponent } from '../pdf-viewer-password-dialog/pdf-viewer-password-dialog';
|
||||||
import { PdfThumbListComponent } from '../pdf-viewer-thumbnails/pdf-viewer-thumbnails.component';
|
import { PdfThumbListComponent } from '../pdf-viewer-thumbnails/pdf-viewer-thumbnails.component';
|
@@ -18,7 +18,7 @@
|
|||||||
import { SimpleChange } from '@angular/core';
|
import { SimpleChange } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { TxtViewerComponent } from './txt-viewer.component';
|
import { TxtViewerComponent } from './txt-viewer.component';
|
||||||
import { CoreTestingModule, UnitTestingUtils } from '../../../testing';
|
import { CoreTestingModule, UnitTestingUtils } from '@alfresco/adf-core';
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
|
|
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||||
import { AppConfigService } from '../../../app-config';
|
import { AppConfigService } from '@alfresco/adf-core';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-txt-viewer',
|
selector: 'adf-txt-viewer',
|
@@ -1,5 +1,5 @@
|
|||||||
/* stylelint-disable scss/at-extend-no-missing-placeholder */
|
/* stylelint-disable scss/at-extend-no-missing-placeholder */
|
||||||
@use '../../styles/mat-selectors' as ms;
|
@use 'mat-selectors' as ms;
|
||||||
|
|
||||||
.adf-full-screen {
|
.adf-full-screen {
|
||||||
width: 100%;
|
width: 100%;
|
@@ -41,8 +41,6 @@ import { MatMenuModule } from '@angular/material/menu';
|
|||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { fromEvent } from 'rxjs';
|
import { fromEvent } from 'rxjs';
|
||||||
import { filter, first, skipWhile } from 'rxjs/operators';
|
import { filter, first, skipWhile } from 'rxjs/operators';
|
||||||
import { AppConfigService } from '../../app-config';
|
|
||||||
import { ToolbarComponent, ToolbarDividerComponent, ToolbarTitleComponent } from '../../toolbar';
|
|
||||||
import { DownloadPromptActions } from '../models/download-prompt.actions';
|
import { DownloadPromptActions } from '../models/download-prompt.actions';
|
||||||
import { CloseButtonPosition, Track } from '../models/viewer.model';
|
import { CloseButtonPosition, Track } from '../models/viewer.model';
|
||||||
import { ViewUtilService } from '../services/view-util.service';
|
import { ViewUtilService } from '../services/view-util.service';
|
||||||
@@ -54,8 +52,14 @@ import { ViewerSidebarComponent } from './viewer-sidebar.component';
|
|||||||
import { ViewerToolbarComponent } from './viewer-toolbar.component';
|
import { ViewerToolbarComponent } from './viewer-toolbar.component';
|
||||||
import { ViewerToolbarActionsComponent } from './viewer-toolbar-actions.component';
|
import { ViewerToolbarActionsComponent } from './viewer-toolbar-actions.component';
|
||||||
import { ViewerToolbarCustomActionsComponent } from './viewer-toolbar-custom-actions.component';
|
import { ViewerToolbarCustomActionsComponent } from './viewer-toolbar-custom-actions.component';
|
||||||
import { IconComponent } from '../../icon';
|
import {
|
||||||
import { ThumbnailService } from '../../common';
|
ThumbnailService,
|
||||||
|
IconComponent,
|
||||||
|
ToolbarComponent,
|
||||||
|
ToolbarDividerComponent,
|
||||||
|
ToolbarTitleComponent,
|
||||||
|
AppConfigService
|
||||||
|
} from '@alfresco/adf-core';
|
||||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||||
|
|
||||||
const DEFAULT_NON_PREVIEW_CONFIG = {
|
const DEFAULT_NON_PREVIEW_CONFIG = {
|
@@ -16,9 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { CoreTestingModule } from '../../../../testing';
|
// import { CoreTestingModule } from '../../../../src/lib/testing';
|
||||||
import { FormService } from '../../../services/form.service';
|
// import { FormService } from '../../../../src/lib/form/services/form.service';
|
||||||
import { FormFieldModel, FormModel } from '../core';
|
// import { FormFieldModel, FormModel } from '../../../../src/lib/form/components/widgets/core';
|
||||||
|
import { CoreTestingModule, FormService, FormFieldModel, FormModel } from '@alfresco/adf-core';
|
||||||
import { BaseViewerWidgetComponent } from './base-viewer.widget';
|
import { BaseViewerWidgetComponent } from './base-viewer.widget';
|
||||||
|
|
||||||
describe('BaseViewerWidgetComponent', () => {
|
describe('BaseViewerWidgetComponent', () => {
|
@@ -18,10 +18,8 @@
|
|||||||
import { NgIf } from '@angular/common';
|
import { NgIf } from '@angular/common';
|
||||||
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
import { ViewerComponent } from '../../../../viewer';
|
import { ViewerComponent } from '@alfresco/adf-core/viewer';
|
||||||
import { FormService } from '../../../services/form.service';
|
import { FormService, ErrorWidgetComponent, WidgetComponent } from '@alfresco/adf-core';
|
||||||
import { ErrorWidgetComponent } from '../error/error.component';
|
|
||||||
import { WidgetComponent } from '../widget.component';
|
|
||||||
|
|
||||||
/* eslint-disable @angular-eslint/component-selector */
|
/* eslint-disable @angular-eslint/component-selector */
|
||||||
|
|
@@ -28,6 +28,7 @@
|
|||||||
"@alfresco/adf-core/api": ["lib/core/api/src/index.ts"],
|
"@alfresco/adf-core/api": ["lib/core/api/src/index.ts"],
|
||||||
"@alfresco/adf-core/auth": ["lib/core/auth/src/index.ts"],
|
"@alfresco/adf-core/auth": ["lib/core/auth/src/index.ts"],
|
||||||
"@alfresco/adf-core/breadcrumbs": ["lib/core/breadcrumbs/src/index.ts"],
|
"@alfresco/adf-core/breadcrumbs": ["lib/core/breadcrumbs/src/index.ts"],
|
||||||
|
"@alfresco/adf-core/viewer": ["lib/core/viewer/src/index.ts"],
|
||||||
"@alfresco/adf-core/feature-flags": ["lib/core/feature-flags/public-api.ts"],
|
"@alfresco/adf-core/feature-flags": ["lib/core/feature-flags/public-api.ts"],
|
||||||
"@alfresco/adf-core/shell": ["lib/core/shell/src/index.ts"],
|
"@alfresco/adf-core/shell": ["lib/core/shell/src/index.ts"],
|
||||||
"@alfresco/adf-extensions": ["lib/extensions/src/public-api.ts"],
|
"@alfresco/adf-extensions": ["lib/extensions/src/public-api.ts"],
|
||||||
|
Reference in New Issue
Block a user