mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
@@ -5,7 +5,7 @@
|
|||||||
"author": "Alfresco Software, Ltd.",
|
"author": "Alfresco Software, Ltd.",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"clean": "npm install rimraf && npm run clean-build && rimraf dist node_modules typings dist",
|
"clean": "npm install rimraf && npm run clean-build && rimraf dist node_modules typings dist",
|
||||||
"start": "npm run server-versions && webpack-dev-server --inline --progress --port 3000",
|
"start": "npm run server-versions && webpack-dev-server --inline --progress --port 3000 --max_old_space_size=4096 --max_new_space_size=4096",
|
||||||
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
|
"start:dist": "wsrv -s dist/ -p 3000 -a 0.0.0.0",
|
||||||
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
|
"clean-build": "rimraf 'app/{,**/}**.js' 'app/{,**/}**.js.map' 'app/{,**/}**.d.ts'",
|
||||||
"test": "karma start",
|
"test": "karma start",
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
<div class="container-widget">
|
<div class="container-widget">
|
||||||
<div *ngIf="content?.isGroup() && content?.isVisible" class="container-widget__header">
|
<div [ngClass]="{'hidden':!(content?.isGroup() && content?.isVisible)}" class="container-widget__header">
|
||||||
<h4 class="container-widget__header-text" id="container-header"
|
<h4 class="container-widget__header-text" id="container-header"
|
||||||
[class.collapsible]="content?.isCollapsible()">
|
[class.collapsible]="content?.isCollapsible()">
|
||||||
<button *ngIf="content?.isCollapsible()"
|
<button *ngIf="content?.isCollapsible()"
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
<span (click)="onExpanderClicked()" id="container-header-label">{{content.name}}</span>
|
<span (click)="onExpanderClicked()" id="container-header-label">{{content.name}}</span>
|
||||||
</h4>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="mdl-grid" *ngIf="content?.isVisible && content?.isExpanded">
|
<div class="mdl-grid" [ngClass]="{'hidden':!(content?.isVisible && content?.isExpanded)}">
|
||||||
<div *ngFor="let col of content.columns" class="mdl-cell mdl-cell--{{col.size}}-col">
|
<div *ngFor="let col of content.columns" class="mdl-cell mdl-cell--{{col.size}}-col">
|
||||||
<div class="mdl-grid" *ngIf="col.hasFields()">
|
<div class="mdl-grid" *ngIf="col.hasFields()">
|
||||||
<div *ngFor="let field of col.fields" class="mdl-cell mdl-cell--12-col">
|
<div *ngFor="let field of col.fields" class="mdl-cell mdl-cell--12-col">
|
||||||
|
@@ -169,8 +169,7 @@ describe('ContainerWidget', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
fixture.whenStable()
|
fixture.whenStable()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(element.querySelector('#container-header')).toBeDefined();
|
expect(element.querySelector('.container-widget__header').classList.contains('hidden')).toBe(false);
|
||||||
expect(element.querySelector('#container-header')).not.toBeNull();
|
|
||||||
expect(element.querySelector('#container-header-label')).toBeDefined();
|
expect(element.querySelector('#container-header-label')).toBeDefined();
|
||||||
expect(element.querySelector('#container-header-label').innerHTML).toContain('fake-cont-1-name');
|
expect(element.querySelector('#container-header-label').innerHTML).toContain('fake-cont-1-name');
|
||||||
});
|
});
|
||||||
@@ -181,8 +180,7 @@ describe('ContainerWidget', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
fixture.whenStable()
|
fixture.whenStable()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(element.querySelector('#container-header')).toBeNull();
|
expect(element.querySelector('.container-widget__header').classList.contains('hidden')).toBe(true);
|
||||||
expect(element.querySelector('#container-header-label')).toBeNull();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -194,8 +192,7 @@ describe('ContainerWidget', () => {
|
|||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
fixture.whenStable()
|
fixture.whenStable()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
expect(element.querySelector('#container-header')).toBeNull();
|
expect(element.querySelector('.container-widget__header').classList.contains('hidden')).toBe(true);
|
||||||
expect(element.querySelector('#container-header-label')).toBeNull();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
containerWidgetComponent.onFieldChanged(null);
|
containerWidgetComponent.onFieldChanged(null);
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
<div [ngSwitch]="fieldType" class="display-value-widget">
|
<div [ngSwitch]="fieldType" class="display-value-widget" *ngIf="field?.isVisible">
|
||||||
<div *ngSwitchCase="'boolean'">
|
<div *ngSwitchCase="'boolean'">
|
||||||
<label class="mdl-checkbox mdl-js-checkbox" [attr.for]="field.id" *ngIf="field?.isVisible">
|
<label class="mdl-checkbox mdl-js-checkbox" [attr.for]="field.id" >
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
[attr.id]="field.id"
|
[attr.id]="field.id"
|
||||||
[checked]="field.value"
|
[checked]="field.value"
|
||||||
@@ -12,9 +12,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div *ngSwitchCase="'text'"
|
<div *ngSwitchCase="'text'"
|
||||||
class="mdl-textfield mdl-js-textfield text-widget">
|
class="mdl-textfield mdl-js-textfield text-widget">
|
||||||
<label *ngIf="field?.isVisible" [attr.for]="field.id">{{field.name}}</label>
|
<label [attr.for]="field.id">{{field.name}}</label>
|
||||||
<input
|
<input
|
||||||
*ngIf="field?.isVisible"
|
|
||||||
class="mdl-textfield__input"
|
class="mdl-textfield__input"
|
||||||
type="text"
|
type="text"
|
||||||
[attr.id]="field.id"
|
[attr.id]="field.id"
|
||||||
@@ -28,13 +27,12 @@
|
|||||||
rows="3"
|
rows="3"
|
||||||
[value]="value"
|
[value]="value"
|
||||||
[attr.id]="field.id"
|
[attr.id]="field.id"
|
||||||
disabled
|
disabled>
|
||||||
*ngIf="field?.isVisible">
|
|
||||||
</textarea>
|
</textarea>
|
||||||
<label *ngIf="field?.isVisible" class="mdl-textfield__label" [attr.for]="field.id">{{field.name}}</label>
|
<label class="mdl-textfield__label" [attr.for]="field.id">{{field.name}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div *ngSwitchCase="'hyperlink'" class="hyperlink-widget">
|
<div *ngSwitchCase="'hyperlink'" class="hyperlink-widget">
|
||||||
<div *ngIf="field?.isVisible">
|
<div>
|
||||||
<div>
|
<div>
|
||||||
<span>{{field.name}}</span>
|
<span>{{field.name}}</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -45,7 +43,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div *ngSwitchCase="'dynamic-table'">
|
<div *ngSwitchCase="'dynamic-table'">
|
||||||
|
|
||||||
<div class="display-value-widget__dynamic-table" *ngIf="field?.isVisible">
|
<div class="display-value-widget__dynamic-table">
|
||||||
<div>{{field.name}}</div>
|
<div>{{field.name}}</div>
|
||||||
<div class="display-value-dynamic-table-widget__table-container">
|
<div class="display-value-dynamic-table-widget__table-container">
|
||||||
<table class="mdl-data-table mdl-js-data-table">
|
<table class="mdl-data-table mdl-js-data-table">
|
||||||
@@ -70,7 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngSwitchCase="'upload'">
|
<div *ngSwitchCase="'upload'">
|
||||||
<div class="upload-widget" *ngIf="field?.isVisible">
|
<div class="upload-widget">
|
||||||
<div>
|
<div>
|
||||||
<label class="upload-widget__label" [attr.for]="field.id">{{field.name}}</label>
|
<label class="upload-widget__label" [attr.for]="field.id">{{field.name}}</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -85,9 +83,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div *ngSwitchDefault
|
<div *ngSwitchDefault
|
||||||
class="mdl-textfield mdl-js-textfield text-widget is-disabled is-dirty is-upgraded">
|
class="mdl-textfield mdl-js-textfield text-widget is-disabled is-dirty is-upgraded">
|
||||||
<label *ngIf="field?.isVisible" [attr.for]="field.id">{{field.name}}</label>
|
<label [attr.for]="field.id">{{field.name}}</label>
|
||||||
<input
|
<input
|
||||||
*ngIf="field?.isVisible"
|
|
||||||
class="mdl-textfield__input"
|
class="mdl-textfield__input"
|
||||||
type="text"
|
type="text"
|
||||||
[attr.id]="field.id"
|
[attr.id]="field.id"
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, OnInit, AfterViewChecked } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { WidgetComponent } from './../widget.component';
|
import { WidgetComponent } from './../widget.component';
|
||||||
import { FormFieldTypes } from '../core/form-field-types';
|
import { FormFieldTypes } from '../core/form-field-types';
|
||||||
import { FormService } from '../../../services/form.service';
|
import { FormService } from '../../../services/form.service';
|
||||||
@@ -31,7 +31,7 @@ import * as moment from 'moment';
|
|||||||
templateUrl: './display-value.widget.html',
|
templateUrl: './display-value.widget.html',
|
||||||
styleUrls: ['./display-value.widget.css']
|
styleUrls: ['./display-value.widget.css']
|
||||||
})
|
})
|
||||||
export class DisplayValueWidget extends WidgetComponent implements OnInit, AfterViewChecked {
|
export class DisplayValueWidget extends WidgetComponent implements OnInit {
|
||||||
|
|
||||||
value: any;
|
value: any;
|
||||||
fieldType: string;
|
fieldType: string;
|
||||||
@@ -139,13 +139,10 @@ export class DisplayValueWidget extends WidgetComponent implements OnInit, After
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.visibilityService.refreshVisibility(this.field.form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewChecked() {
|
|
||||||
this.visibilityService.refreshVisibility(this.field.form);
|
|
||||||
}
|
|
||||||
|
|
||||||
loadRadioButtonValue() {
|
loadRadioButtonValue() {
|
||||||
let options = this.field.options || [];
|
let options = this.field.options || [];
|
||||||
let toSelect = options.find(item => item.id === this.field.value);
|
let toSelect = options.find(item => item.id === this.field.value);
|
||||||
|
Reference in New Issue
Block a user