@ng-formworks/material 17.2.7 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/assets/material-design-themes.scss +34 -16
- package/esm2022/lib/material-design-cssframework.mjs +23 -0
- package/esm2022/lib/material-design-framework.component.mjs +119 -0
- package/esm2022/lib/material-design-framework.module.mjs +117 -0
- package/esm2022/lib/material-design.framework.mjs +61 -0
- package/esm2022/lib/widgets/flex-layout-root.component.mjs +75 -0
- package/esm2022/lib/widgets/flex-layout-section.component.mjs +347 -0
- package/esm2022/lib/widgets/material-add-reference.component.mjs +66 -0
- package/esm2022/lib/widgets/material-button-group.component.mjs +90 -0
- package/esm2022/lib/widgets/material-button.component.mjs +80 -0
- package/esm2022/lib/widgets/material-checkbox.component.mjs +166 -0
- package/esm2022/lib/widgets/material-checkboxes.component.mjs +129 -0
- package/esm2022/lib/widgets/material-chip-list.component.mjs +35 -0
- package/esm2022/lib/widgets/material-datepicker.component.mjs +141 -0
- package/esm2022/lib/widgets/material-file.component.mjs +35 -0
- package/esm2022/lib/widgets/material-input.component.mjs +149 -0
- package/esm2022/lib/widgets/material-number.component.mjs +145 -0
- package/esm2022/lib/widgets/material-one-of.component.mjs +35 -0
- package/esm2022/lib/widgets/material-radios.component.mjs +122 -0
- package/esm2022/lib/widgets/material-select.component.mjs +186 -0
- package/esm2022/lib/widgets/material-slider.component.mjs +91 -0
- package/esm2022/lib/widgets/material-stepper.component.mjs +35 -0
- package/esm2022/lib/widgets/material-tabs.component.mjs +92 -0
- package/esm2022/lib/widgets/material-textarea.component.mjs +134 -0
- package/esm2022/lib/widgets/public_api.mjs +52 -0
- package/esm2022/ng-formworks-material.mjs +5 -0
- package/esm2022/public_api.mjs +8 -0
- package/fesm2022/ng-formworks-material.mjs +2357 -0
- package/fesm2022/ng-formworks-material.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/material-design-cssframework.d.ts +1 -0
- package/lib/material-design-framework.component.d.ts +35 -0
- package/lib/material-design-framework.module.d.ts +61 -0
- package/lib/material-design.framework.d.ts +46 -0
- package/lib/widgets/flex-layout-root.component.d.ts +15 -0
- package/lib/widgets/flex-layout-section.component.d.ts +25 -0
- package/lib/widgets/material-add-reference.component.d.ts +20 -0
- package/lib/widgets/material-button-group.component.d.ts +23 -0
- package/lib/widgets/material-button.component.d.ts +24 -0
- package/lib/widgets/material-checkbox.component.d.ts +25 -0
- package/lib/widgets/material-checkboxes.component.d.ts +27 -0
- package/lib/widgets/material-chip-list.component.d.ts +21 -0
- package/lib/widgets/material-datepicker.component.d.ts +22 -0
- package/lib/widgets/material-file.component.d.ts +21 -0
- package/lib/widgets/material-input.component.d.ts +23 -0
- package/lib/widgets/material-number.component.d.ts +26 -0
- package/lib/widgets/material-one-of.component.d.ts +21 -0
- package/lib/widgets/material-radios.component.d.ts +23 -0
- package/lib/widgets/material-select.component.d.ts +24 -0
- package/lib/widgets/material-slider.component.d.ts +25 -0
- package/lib/widgets/material-stepper.component.d.ts +21 -0
- package/lib/widgets/material-tabs.component.d.ts +20 -0
- package/lib/widgets/material-textarea.component.d.ts +22 -0
- package/{src/lib/widgets/public_api.ts → lib/widgets/public_api.d.ts} +41 -54
- package/package.json +64 -48
- package/{src/public_api.ts → public_api.d.ts} +4 -9
- package/karma.conf.js +0 -46
- package/ng-package.json +0 -13
- package/src/lib/flexlayout-replacement-styles.scss +0 -95
- package/src/lib/material-design-cssframework.ts +0 -20
- package/src/lib/material-design-framework.component.html +0 -13
- package/src/lib/material-design-framework.component.scss +0 -58
- package/src/lib/material-design-framework.component.spec.ts +0 -39
- package/src/lib/material-design-framework.component.ts +0 -143
- package/src/lib/material-design-framework.module.ts +0 -81
- package/src/lib/material-design-themes.scss +0 -71
- package/src/lib/material-design.framework.ts +0 -83
- package/src/lib/tailwind-output.scss +0 -622
- package/src/lib/widgets/flex-layout-root.component.html +0 -4
- package/src/lib/widgets/flex-layout-root.component.ts +0 -52
- package/src/lib/widgets/flex-layout-section.component.ts +0 -216
- package/src/lib/widgets/material-add-reference.component.ts +0 -56
- package/src/lib/widgets/material-button-group.component.ts +0 -68
- package/src/lib/widgets/material-button.component.ts +0 -66
- package/src/lib/widgets/material-checkbox.component.ts +0 -112
- package/src/lib/widgets/material-checkboxes.component.ts +0 -108
- package/src/lib/widgets/material-chip-list.component.ts +0 -35
- package/src/lib/widgets/material-datepicker.component.ts +0 -89
- package/src/lib/widgets/material-file.component.ts +0 -35
- package/src/lib/widgets/material-input.component.ts +0 -97
- package/src/lib/widgets/material-number.component.ts +0 -95
- package/src/lib/widgets/material-one-of.component.ts +0 -35
- package/src/lib/widgets/material-radios.component.ts +0 -91
- package/src/lib/widgets/material-select.component.ts +0 -118
- package/src/lib/widgets/material-slider.component.ts +0 -65
- package/src/lib/widgets/material-stepper.component.ts +0 -35
- package/src/lib/widgets/material-tabs.component.ts +0 -72
- package/src/lib/widgets/material-textarea.component.ts +0 -88
- package/src/test.ts +0 -17
- package/tailwind-input.css +0 -3
- package/tailwind.config.js +0 -12
- package/tsconfig.lib.json +0 -25
- package/tsconfig.lib.prod.json +0 -9
- package/tsconfig.spec.json +0 -17
- package/tslint.json +0 -11
package/karma.conf.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Karma configuration file, see link for more information
|
|
2
|
-
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
-
|
|
4
|
-
module.exports = function (config) {
|
|
5
|
-
config.set({
|
|
6
|
-
basePath: '',
|
|
7
|
-
frameworks: ['jasmine', '@angular-devkit/build-angular'],
|
|
8
|
-
plugins: [
|
|
9
|
-
require('karma-jasmine'),
|
|
10
|
-
require('karma-chrome-launcher'),
|
|
11
|
-
require('karma-jasmine-html-reporter'),
|
|
12
|
-
require('karma-coverage'),
|
|
13
|
-
require('@angular-devkit/build-angular/plugins/karma'),
|
|
14
|
-
],
|
|
15
|
-
client: {
|
|
16
|
-
clearContext: false, // leave Jasmine Spec Runner output visible in browser
|
|
17
|
-
},
|
|
18
|
-
coverageReporter: {
|
|
19
|
-
dir: require('path').join(__dirname, '../../coverage/ajsf-material'),
|
|
20
|
-
reporters: [
|
|
21
|
-
{
|
|
22
|
-
type: 'html',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
type: 'lcov',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
type: 'text-summary',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
reporters: ['progress', 'kjhtml'],
|
|
33
|
-
port: 9876,
|
|
34
|
-
colors: true,
|
|
35
|
-
logLevel: config.LOG_INFO,
|
|
36
|
-
autoWatch: true,
|
|
37
|
-
singleRun: false,
|
|
38
|
-
browsers: ['Chrome', 'ChromeHeadlessCI'],
|
|
39
|
-
customLaunchers: {
|
|
40
|
-
ChromeHeadlessCI: {
|
|
41
|
-
base: 'ChromeHeadless',
|
|
42
|
-
flags: ['--no-sandbox'],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
};
|
package/ng-package.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
|
|
3
|
-
"dest": "../../dist/@ng-formworks/material",
|
|
4
|
-
"lib": {
|
|
5
|
-
"entryFile": "src/public_api.ts"
|
|
6
|
-
},
|
|
7
|
-
"assets": ["./assets"],
|
|
8
|
-
"allowedNonPeerDependencies": [
|
|
9
|
-
"lodash-es",
|
|
10
|
-
"@ng-formworks/core",
|
|
11
|
-
"@ng-formworks/cssframework"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/* style sheet created to help replace angular flex-layout package
|
|
2
|
-
which is out of maintenance
|
|
3
|
-
see-https://github.com/angular/flex-layout
|
|
4
|
-
adapted from
|
|
5
|
-
https://github.com/angular/flex-layout/issues/1433
|
|
6
|
-
https://github.com/angular/flex-layout/issues/1433#issue-1508899434
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
[fxLayout] {
|
|
10
|
-
box-sizing: border-box;
|
|
11
|
-
display: flex;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
[fxLayout="row wrap"] {
|
|
15
|
-
flex-flow: row wrap;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
[fxLayout="row"] {
|
|
19
|
-
flex-direction: row;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
[fxLayout="column"] {
|
|
23
|
-
flex-direction: column;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
[fxLayoutAlign="center center"] {
|
|
27
|
-
display: flex;
|
|
28
|
-
place-content: center;
|
|
29
|
-
align-items: center;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
[fxLayoutAlign="start center"] {
|
|
33
|
-
display: flex;
|
|
34
|
-
place-content: center flex-start;
|
|
35
|
-
align-items: center;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[fxLayoutAlign="start start"] {
|
|
39
|
-
display: flex;
|
|
40
|
-
place-content: flex-start flex-start;
|
|
41
|
-
align-items: center;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[fxLayoutAlign="end center"] {
|
|
45
|
-
display: flex;
|
|
46
|
-
place-content: center flex-end;
|
|
47
|
-
align-items: center;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
[fxFlex] {
|
|
51
|
-
box-sizing: border-box;
|
|
52
|
-
display: flex;
|
|
53
|
-
flex: 1 1 100%;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
[fxFlex="none"] {
|
|
57
|
-
flex: none;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
@media only screen and (min-width: 960px) {
|
|
61
|
-
[fxFlex-gt-sm="50"] {
|
|
62
|
-
flex: 1 1 50% !important;
|
|
63
|
-
box-sizing: border-box;
|
|
64
|
-
max-width: 50% !important;
|
|
65
|
-
}
|
|
66
|
-
[fxFlex-gt-sm="33"] {
|
|
67
|
-
flex: 1 1 33% !important;
|
|
68
|
-
box-sizing: border-box;
|
|
69
|
-
max-width: 33% !important;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
[fxFlex="33"] {
|
|
74
|
-
flex: 1 1 33%;
|
|
75
|
-
box-sizing: border-box;
|
|
76
|
-
max-width: 33%;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
[fxFlex="67"] {
|
|
80
|
-
flex: 1 1 67%;
|
|
81
|
-
box-sizing: border-box;
|
|
82
|
-
max-width: 67%;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
@mixin flex {
|
|
86
|
-
@for $i from 0 through 20 {
|
|
87
|
-
[fxFlex="#{$i*5}"] {
|
|
88
|
-
flex: 1 1 $i*5%;
|
|
89
|
-
box-sizing: border-box;
|
|
90
|
-
max-width: $i*5%;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
@include flex;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export const cssFrameworkCfgMaterialDesign:any={
|
|
3
|
-
"name": "material-design",
|
|
4
|
-
"text":"Material Design",
|
|
5
|
-
"scripts": [],
|
|
6
|
-
"stylesheets": [
|
|
7
|
-
'//fonts.googleapis.com/icon?family=Material+Icons',
|
|
8
|
-
'//fonts.googleapis.com/css?family=Roboto:300,400,500,700',
|
|
9
|
-
],
|
|
10
|
-
"widgetstyles": {
|
|
11
|
-
"__themes__": [
|
|
12
|
-
{"name":"material_default","text":"Default Theme"},
|
|
13
|
-
{"name":"indigo-pink","text":"Indigo & Pink"},
|
|
14
|
-
{"name":"purple-green","text":"Purple & Green"},
|
|
15
|
-
{"name":"deeppurple-amber","text":"Deep Purple & Amber"},
|
|
16
|
-
{"name":"pink-bluegrey","text":"Pink & Blue-Grey"}
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<div [class]="theme">
|
|
2
|
-
<div class="mat-app-background">
|
|
3
|
-
|
|
4
|
-
<div [class.array-item]="widgetLayoutNode?.arrayItem && widgetLayoutNode?.type !== '$ref'" [orderable]="isOrderable" [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [layoutNode]="widgetLayoutNode">
|
|
5
|
-
<svg *ngIf="showRemoveButton" xmlns="http://www.w3.org/2000/svg" height="18" width="18" viewBox="0 0 24 24" class="close-button" (click)="removeItem()">
|
|
6
|
-
<path
|
|
7
|
-
d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/>
|
|
8
|
-
</svg>
|
|
9
|
-
<select-widget-widget [dataIndex]="dataIndex" [layoutIndex]="layoutIndex" [layoutNode]="widgetLayoutNode"></select-widget-widget>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="spacer" *ngIf="widgetLayoutNode?.arrayItem && widgetLayoutNode?.type !== '$ref'"></div>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
.array-item {
|
|
2
|
-
border-radius: 2px;
|
|
3
|
-
box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px 0 rgba(0, 0, 0, .14), 0 1px 5px 0 rgba(0, 0, 0, .12);
|
|
4
|
-
padding: 6px;
|
|
5
|
-
position: relative;
|
|
6
|
-
transition: all 280ms cubic-bezier(.4, 0, .2, 1);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.close-button {
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
position: absolute;
|
|
12
|
-
top: 6px;
|
|
13
|
-
right: 6px;
|
|
14
|
-
fill: rgba(0, 0, 0, .4);
|
|
15
|
-
visibility: hidden;
|
|
16
|
-
z-index: 500;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.close-button:hover {
|
|
20
|
-
fill: rgba(0, 0, 0, .8);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.array-item:hover>.close-button {
|
|
24
|
-
visibility: visible;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.spacer {
|
|
28
|
-
margin: 6px 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
[draggable=true]:hover {
|
|
32
|
-
box-shadow: 0 5px 5px -3px rgba(0, 0, 0, .2), 0 8px 10px 1px rgba(0, 0, 0, .14), 0 3px 14px 2px rgba(0, 0, 0, .12);
|
|
33
|
-
cursor: move;
|
|
34
|
-
z-index: 10;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
[draggable=true].drag-target-top {
|
|
38
|
-
box-shadow: 0 -2px 0 #000;
|
|
39
|
-
position: relative;
|
|
40
|
-
z-index: 20;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
[draggable=true].drag-target-bottom {
|
|
44
|
-
box-shadow: 0 2px 0 #000;
|
|
45
|
-
position: relative;
|
|
46
|
-
z-index: 20;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/*
|
|
51
|
-
.purple-green {
|
|
52
|
-
@import './material-design-themes.scss';
|
|
53
|
-
}
|
|
54
|
-
*/
|
|
55
|
-
|
|
56
|
-
@import './material-design-themes.scss';
|
|
57
|
-
@import './flexlayout-replacement-styles.scss';
|
|
58
|
-
@import './tailwind-output.scss';
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
3
|
-
import {
|
|
4
|
-
JsonSchemaFormModule,
|
|
5
|
-
JsonSchemaFormService,
|
|
6
|
-
WidgetLibraryModule
|
|
7
|
-
} from '@ng-formworks/core';
|
|
8
|
-
import { MaterialDesignFrameworkComponent } from './material-design-framework.component';
|
|
9
|
-
|
|
10
|
-
describe('FwBootstrap4Component', () => {
|
|
11
|
-
let component: MaterialDesignFrameworkComponent;
|
|
12
|
-
let fixture: ComponentFixture<MaterialDesignFrameworkComponent>;
|
|
13
|
-
|
|
14
|
-
beforeEach(waitForAsync(() => {
|
|
15
|
-
TestBed.configureTestingModule({
|
|
16
|
-
imports: [
|
|
17
|
-
JsonSchemaFormModule,
|
|
18
|
-
CommonModule,
|
|
19
|
-
WidgetLibraryModule,
|
|
20
|
-
],
|
|
21
|
-
declarations: [MaterialDesignFrameworkComponent],
|
|
22
|
-
providers: [JsonSchemaFormService]
|
|
23
|
-
})
|
|
24
|
-
.compileComponents();
|
|
25
|
-
}));
|
|
26
|
-
|
|
27
|
-
beforeEach(() => {
|
|
28
|
-
fixture = TestBed.createComponent(MaterialDesignFrameworkComponent);
|
|
29
|
-
component = fixture.componentInstance;
|
|
30
|
-
component.layoutNode = { options: {} };
|
|
31
|
-
component.layoutIndex = [];
|
|
32
|
-
component.dataIndex = [];
|
|
33
|
-
fixture.detectChanges();
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it('should create', () => {
|
|
37
|
-
expect(component).toBeTruthy();
|
|
38
|
-
});
|
|
39
|
-
});
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
|
|
2
|
-
import { FrameworkLibraryService, JsonSchemaFormService, isDefined } from '@ng-formworks/core';
|
|
3
|
-
import { CssframeworkService } from '@ng-formworks/cssframework';
|
|
4
|
-
import cloneDeep from 'lodash/cloneDeep';
|
|
5
|
-
import { Subscription } from 'rxjs';
|
|
6
|
-
import { cssFrameworkCfgMaterialDesign } from './material-design-cssframework';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
// tslint:disable-next-line:component-selector
|
|
10
|
-
selector: 'material-design-framework',
|
|
11
|
-
templateUrl: './material-design-framework.component.html',
|
|
12
|
-
styleUrls: ['./material-design-framework.component.scss'],
|
|
13
|
-
//changeDetection:ChangeDetectionStrategy.OnPush
|
|
14
|
-
})
|
|
15
|
-
export class MaterialDesignFrameworkComponent implements OnInit, OnChanges ,OnDestroy {
|
|
16
|
-
frameworkInitialized = false;
|
|
17
|
-
inputType: string;
|
|
18
|
-
options: any; // Options used in this framework
|
|
19
|
-
widgetLayoutNode: any; // layoutNode passed to child widget
|
|
20
|
-
widgetOptions: any; // Options passed to child widget
|
|
21
|
-
formControl: any = null;
|
|
22
|
-
parentArray: any = null;
|
|
23
|
-
isOrderable = false;
|
|
24
|
-
dynamicTitle: string = null;
|
|
25
|
-
@Input() layoutNode: any;
|
|
26
|
-
@Input() layoutIndex: number[];
|
|
27
|
-
@Input() dataIndex: number[];
|
|
28
|
-
|
|
29
|
-
theme:string="material-default-theme";
|
|
30
|
-
frameworkThemeSubs:Subscription;
|
|
31
|
-
constructor(
|
|
32
|
-
private changeDetector: ChangeDetectorRef,
|
|
33
|
-
private jsf: JsonSchemaFormService,
|
|
34
|
-
public jsfFLService:FrameworkLibraryService,
|
|
35
|
-
public cssFWService:CssframeworkService
|
|
36
|
-
) {
|
|
37
|
-
let activeFramework:any=this.jsfFLService.activeFramework;
|
|
38
|
-
let fwcfg=activeFramework.config||{};
|
|
39
|
-
let defaultTheme=cssFrameworkCfgMaterialDesign.widgetstyles?.__themes__[0];
|
|
40
|
-
let defaultThemeName=cssFWService.activeRequestedTheme||defaultTheme.name;
|
|
41
|
-
this.theme=this.options?.theme|| defaultThemeName;
|
|
42
|
-
this.frameworkThemeSubs= cssFWService.frameworkTheme$.subscribe(newTheme=>{
|
|
43
|
-
this.theme=newTheme;
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
ngOnDestroy(): void {
|
|
49
|
-
this.frameworkThemeSubs.unsubscribe();
|
|
50
|
-
this.frameworkThemeSubs=null;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
get showRemoveButton(): boolean {
|
|
54
|
-
if (!this.layoutNode || !this.widgetOptions.removable ||
|
|
55
|
-
this.widgetOptions.readonly || this.layoutNode.type === '$ref'
|
|
56
|
-
) {
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
if (this.layoutNode.recursiveReference) {
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
if (!this.layoutNode.arrayItem || !this.parentArray) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
// If array length <= minItems, don't allow removing any items
|
|
66
|
-
return this.parentArray.items.length - 1 <= this.parentArray.options.minItems ? false :
|
|
67
|
-
// For removable list items, allow removing any item
|
|
68
|
-
this.layoutNode.arrayItemType === 'list' ? true :
|
|
69
|
-
// For removable tuple items, only allow removing last item in list
|
|
70
|
-
this.layoutIndex[this.layoutIndex.length - 1] === this.parentArray.items.length - 2;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
ngOnInit() {
|
|
74
|
-
this.initializeFramework();
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
ngOnChanges() {
|
|
78
|
-
if (!this.frameworkInitialized) {
|
|
79
|
-
this.initializeFramework();
|
|
80
|
-
}
|
|
81
|
-
if (this.dynamicTitle) {
|
|
82
|
-
this.updateTitle();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
initializeFramework() {
|
|
87
|
-
if (this.layoutNode) {
|
|
88
|
-
this.options = cloneDeep(this.layoutNode.options || {});
|
|
89
|
-
this.widgetLayoutNode = {
|
|
90
|
-
...this.layoutNode,
|
|
91
|
-
options: cloneDeep(this.layoutNode.options || {})
|
|
92
|
-
};
|
|
93
|
-
this.widgetOptions = this.widgetLayoutNode.options;
|
|
94
|
-
this.formControl = this.jsf.getFormControl(this);
|
|
95
|
-
|
|
96
|
-
if (
|
|
97
|
-
isDefined(this.widgetOptions.minimum) &&
|
|
98
|
-
isDefined(this.widgetOptions.maximum) &&
|
|
99
|
-
this.widgetOptions.multipleOf >= 1
|
|
100
|
-
) {
|
|
101
|
-
this.layoutNode.type = 'range';
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if (
|
|
105
|
-
!['$ref', 'advancedfieldset', 'authfieldset', 'button', 'card',
|
|
106
|
-
'checkbox', 'expansion-panel', 'help', 'message', 'msg', 'section',
|
|
107
|
-
'submit', 'tabarray', 'tabs'].includes(this.layoutNode.type) &&
|
|
108
|
-
/{{.+?}}/.test(this.widgetOptions.title || '')
|
|
109
|
-
) {
|
|
110
|
-
this.dynamicTitle = this.widgetOptions.title;
|
|
111
|
-
this.updateTitle();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
if (this.layoutNode.arrayItem && this.layoutNode.type !== '$ref') {
|
|
115
|
-
this.parentArray = this.jsf.getParentNode(this);
|
|
116
|
-
if (this.parentArray) {
|
|
117
|
-
this.isOrderable =
|
|
118
|
-
this.parentArray.type.slice(0, 3) !== 'tab' &&
|
|
119
|
-
this.layoutNode.arrayItemType === 'list' &&
|
|
120
|
-
!this.widgetOptions.readonly &&
|
|
121
|
-
this.parentArray.options.orderable;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
this.frameworkInitialized = true;
|
|
126
|
-
} else {
|
|
127
|
-
this.options = {};
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
updateTitle() {
|
|
132
|
-
this.widgetLayoutNode.options.title = this.jsf.parseText(
|
|
133
|
-
this.dynamicTitle,
|
|
134
|
-
this.jsf.getFormControlValue(this),
|
|
135
|
-
this.jsf.getFormControlGroup(this).value,
|
|
136
|
-
this.dataIndex[this.dataIndex.length - 1]
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
removeItem() {
|
|
141
|
-
this.jsf.removeItem(this);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { NgModule } from '@angular/core';
|
|
3
|
-
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
-
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
|
5
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
-
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
7
|
-
import { MatCardModule } from '@angular/material/card';
|
|
8
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
9
|
-
import { MatChipsModule } from '@angular/material/chips';
|
|
10
|
-
import { MatNativeDateModule } from '@angular/material/core';
|
|
11
|
-
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
12
|
-
import { MatExpansionModule } from '@angular/material/expansion';
|
|
13
|
-
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
14
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
15
|
-
import { MatInputModule } from '@angular/material/input';
|
|
16
|
-
import { MatMenuModule } from '@angular/material/menu';
|
|
17
|
-
import { MatRadioModule } from '@angular/material/radio';
|
|
18
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
19
|
-
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
20
|
-
import { MatSliderModule } from '@angular/material/slider';
|
|
21
|
-
import { MatStepperModule } from '@angular/material/stepper';
|
|
22
|
-
import { MatTabsModule } from '@angular/material/tabs';
|
|
23
|
-
import { MatToolbarModule } from '@angular/material/toolbar';
|
|
24
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
25
|
-
import {
|
|
26
|
-
Framework,
|
|
27
|
-
FrameworkLibraryService,
|
|
28
|
-
JsonSchemaFormModule,
|
|
29
|
-
JsonSchemaFormService,
|
|
30
|
-
WidgetLibraryModule, WidgetLibraryService
|
|
31
|
-
} from '@ng-formworks/core';
|
|
32
|
-
import { CssFrameworkModule } from '@ng-formworks/cssframework';
|
|
33
|
-
import { MaterialDesignFramework } from './material-design.framework';
|
|
34
|
-
import { MATERIAL_FRAMEWORK_COMPONENTS } from './widgets/public_api';
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* unused @angular/material modules:
|
|
39
|
-
* MatDialogModule, MatGridListModule, MatListModule, MatMenuModule,
|
|
40
|
-
* MatPaginatorModule, MatProgressBarModule, MatProgressSpinnerModule,
|
|
41
|
-
* MatSidenavModule, MatSnackBarModule, MatSortModule, MatTableModule,
|
|
42
|
-
* ,
|
|
43
|
-
*/
|
|
44
|
-
export const ANGULAR_MATERIAL_MODULES = [
|
|
45
|
-
MatAutocompleteModule, MatButtonModule, MatButtonToggleModule, MatCardModule,
|
|
46
|
-
MatCheckboxModule, MatChipsModule, MatDatepickerModule, MatExpansionModule,
|
|
47
|
-
MatFormFieldModule, MatIconModule, MatInputModule, MatNativeDateModule,
|
|
48
|
-
MatRadioModule, MatSelectModule, MatSliderModule, MatSlideToggleModule,
|
|
49
|
-
MatStepperModule, MatTabsModule, MatTooltipModule,
|
|
50
|
-
MatToolbarModule, MatMenuModule, MatToolbarModule,
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
@NgModule({
|
|
54
|
-
imports: [
|
|
55
|
-
CommonModule,
|
|
56
|
-
FormsModule,
|
|
57
|
-
ReactiveFormsModule,
|
|
58
|
-
...ANGULAR_MATERIAL_MODULES,
|
|
59
|
-
WidgetLibraryModule,
|
|
60
|
-
JsonSchemaFormModule,
|
|
61
|
-
CssFrameworkModule
|
|
62
|
-
],
|
|
63
|
-
declarations: [
|
|
64
|
-
...MATERIAL_FRAMEWORK_COMPONENTS,
|
|
65
|
-
],
|
|
66
|
-
exports: [
|
|
67
|
-
JsonSchemaFormModule,
|
|
68
|
-
...MATERIAL_FRAMEWORK_COMPONENTS,
|
|
69
|
-
],
|
|
70
|
-
providers: [
|
|
71
|
-
JsonSchemaFormService,
|
|
72
|
-
FrameworkLibraryService,
|
|
73
|
-
WidgetLibraryService,
|
|
74
|
-
{ provide: Framework, useClass: MaterialDesignFramework, multi: true },
|
|
75
|
-
]
|
|
76
|
-
})
|
|
77
|
-
export class MaterialDesignFrameworkModule {
|
|
78
|
-
constructor() {
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/* see https://material.angular.io/guide/theming */
|
|
2
|
-
|
|
3
|
-
@use '@angular/material' as mat;
|
|
4
|
-
@include mat.core();
|
|
5
|
-
$indigo-primary: mat.define-palette(mat.$indigo-palette, 500);
|
|
6
|
-
$green-accent: mat.define-palette(mat.$green-palette, A200, A100, A400);
|
|
7
|
-
$red-warn: mat.define-palette(mat.$red-palette);
|
|
8
|
-
$pink-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
|
|
9
|
-
$deep-purple-primary: mat.define-palette(mat.$deep-purple-palette, 500);
|
|
10
|
-
$amber-accent: mat.define-palette(mat.$amber-palette, A200, A100, A400);
|
|
11
|
-
$pink-primary: mat.define-palette(mat.$pink-palette, 500);
|
|
12
|
-
$bluegrey-accent: mat.define-palette(mat.$blue-grey-palette, A200, A100, A400);
|
|
13
|
-
$typography:mat.define-typography-config();
|
|
14
|
-
$density:0;
|
|
15
|
-
|
|
16
|
-
/*Palettes (primary, accent, warn)-indigo, pink, red */
|
|
17
|
-
|
|
18
|
-
$indigo-pink-primary: $indigo-primary;
|
|
19
|
-
$indigo-pink-accent: $pink-accent;
|
|
20
|
-
$indigo-pink-warn: $red-warn;
|
|
21
|
-
$indigo-pink-theme: mat.define-light-theme(( color: ( primary: $indigo-pink-primary, accent: $indigo-pink-accent, warn:$indigo-pink-warn), typography: $typography, density: $density));
|
|
22
|
-
.indigo-pink {
|
|
23
|
-
@include mat.core-theme($indigo-pink-theme);
|
|
24
|
-
@include mat.all-component-themes($indigo-pink-theme);
|
|
25
|
-
@include mat.button-color($indigo-pink-theme);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
/*Palettes (primary, accent, warn)-purple, green, red */
|
|
30
|
-
|
|
31
|
-
$purple-green-primary: $indigo-primary;
|
|
32
|
-
$purple-green-accent: $green-accent;
|
|
33
|
-
$purple-green-warn: $red-warn;
|
|
34
|
-
$purple-green-theme: mat.define-dark-theme(( color: ( primary: $purple-green-primary, accent: $purple-green-accent, warn:$purple-green-warn)));
|
|
35
|
-
.purple-green {
|
|
36
|
-
@include mat.core-color($purple-green-theme);
|
|
37
|
-
@include mat.all-component-colors($purple-green-theme);
|
|
38
|
-
@include mat.button-color($purple-green-theme);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
/*Palettes (primary, accent, warn)-deep-purple, amber, red */
|
|
43
|
-
|
|
44
|
-
$deeppurple-amber-primary: $deep-purple-primary;
|
|
45
|
-
$deeppurple-amber-accent: $amber-accent;
|
|
46
|
-
$deeppurple-amber-warn: $red-warn;
|
|
47
|
-
$deeppurple-amber-theme: mat.define-light-theme(( color: ( primary: $deeppurple-amber-primary, accent: $deeppurple-amber-accent, warn:$deeppurple-amber-warn)));
|
|
48
|
-
.deeppurple-amber {
|
|
49
|
-
@include mat.core-color($deeppurple-amber-theme);
|
|
50
|
-
@include mat.all-component-colors($deeppurple-amber-theme);
|
|
51
|
-
@include mat.button-color($deeppurple-amber-theme);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
/*Palettes (primary, accent, warn)-pink, blue-grey, red */
|
|
56
|
-
|
|
57
|
-
$pink-bluegrey-primary: $pink-primary;
|
|
58
|
-
$pink-bluegrey-accent: $bluegrey-accent;
|
|
59
|
-
$pink-bluegrey-warn: $red-warn;
|
|
60
|
-
$pink-bluegrey-theme: mat.define-dark-theme(( color: ( primary: $pink-bluegrey-primary, accent: $pink-bluegrey-accent, warn:$pink-bluegrey-warn)));
|
|
61
|
-
.pink-bluegrey {
|
|
62
|
-
@include mat.core-color($pink-bluegrey-theme);
|
|
63
|
-
@include mat.all-component-colors($pink-bluegrey-theme);
|
|
64
|
-
@include mat.button-color($pink-bluegrey-theme);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
.material_default {
|
|
68
|
-
@include mat.core-color($indigo-pink-theme);
|
|
69
|
-
@include mat.all-component-colors($indigo-pink-theme);
|
|
70
|
-
@include mat.button-color($indigo-pink-theme);
|
|
71
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import { CssFramework, CssframeworkService } from '@ng-formworks/cssframework';
|
|
3
|
-
import { cssFrameworkCfgMaterialDesign } from './material-design-cssframework';
|
|
4
|
-
import {
|
|
5
|
-
FlexLayoutRootComponent,
|
|
6
|
-
FlexLayoutSectionComponent,
|
|
7
|
-
MaterialAddReferenceComponent,
|
|
8
|
-
MaterialButtonComponent,
|
|
9
|
-
MaterialButtonGroupComponent,
|
|
10
|
-
MaterialCheckboxComponent,
|
|
11
|
-
MaterialCheckboxesComponent,
|
|
12
|
-
MaterialChipListComponent,
|
|
13
|
-
MaterialDatepickerComponent,
|
|
14
|
-
MaterialDesignFrameworkComponent,
|
|
15
|
-
MaterialFileComponent,
|
|
16
|
-
MaterialInputComponent,
|
|
17
|
-
MaterialNumberComponent,
|
|
18
|
-
MaterialOneOfComponent,
|
|
19
|
-
MaterialRadiosComponent,
|
|
20
|
-
MaterialSelectComponent,
|
|
21
|
-
MaterialSliderComponent,
|
|
22
|
-
MaterialStepperComponent,
|
|
23
|
-
MaterialTabsComponent,
|
|
24
|
-
MaterialTextareaComponent
|
|
25
|
-
} from './widgets/public_api';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// Material Design Framework
|
|
29
|
-
// https://github.com/angular/material2
|
|
30
|
-
|
|
31
|
-
@Injectable()
|
|
32
|
-
export class MaterialDesignFramework extends CssFramework {
|
|
33
|
-
name = 'material-design';
|
|
34
|
-
|
|
35
|
-
framework = MaterialDesignFrameworkComponent;
|
|
36
|
-
|
|
37
|
-
stylesheets = [
|
|
38
|
-
'//fonts.googleapis.com/icon?family=Material+Icons',
|
|
39
|
-
'//fonts.googleapis.com/css?family=Roboto:300,400,500,700',
|
|
40
|
-
];
|
|
41
|
-
|
|
42
|
-
_widgets = {
|
|
43
|
-
'root': FlexLayoutRootComponent,
|
|
44
|
-
'section': FlexLayoutSectionComponent,
|
|
45
|
-
'$ref': MaterialAddReferenceComponent,
|
|
46
|
-
'button': MaterialButtonComponent,
|
|
47
|
-
'button-group': MaterialButtonGroupComponent,
|
|
48
|
-
'checkbox': MaterialCheckboxComponent,
|
|
49
|
-
'checkboxes': MaterialCheckboxesComponent,
|
|
50
|
-
'chip-list': MaterialChipListComponent,
|
|
51
|
-
'date': MaterialDatepickerComponent,
|
|
52
|
-
'file': MaterialFileComponent,
|
|
53
|
-
'number': MaterialNumberComponent,
|
|
54
|
-
'one-of': MaterialOneOfComponent,
|
|
55
|
-
'radios': MaterialRadiosComponent,
|
|
56
|
-
'select': MaterialSelectComponent,
|
|
57
|
-
'slider': MaterialSliderComponent,
|
|
58
|
-
'stepper': MaterialStepperComponent,
|
|
59
|
-
'tabs': MaterialTabsComponent,
|
|
60
|
-
'text': MaterialInputComponent,
|
|
61
|
-
'textarea': MaterialTextareaComponent,
|
|
62
|
-
'alt-date': 'date',
|
|
63
|
-
'any-of': 'one-of',
|
|
64
|
-
'card': 'section',
|
|
65
|
-
'color': 'text',
|
|
66
|
-
'expansion-panel': 'section',
|
|
67
|
-
'hidden': 'none',
|
|
68
|
-
'image': 'none',
|
|
69
|
-
'integer': 'number',
|
|
70
|
-
'radiobuttons': 'button-group',
|
|
71
|
-
'range': 'slider',
|
|
72
|
-
'submit': 'button',
|
|
73
|
-
'tagsinput': 'chip-list',
|
|
74
|
-
'wizard': 'stepper',
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
constructor(public cssFWService:CssframeworkService){
|
|
78
|
-
super(cssFrameworkCfgMaterialDesign,cssFWService);
|
|
79
|
-
this.widgets=this._widgets
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|