@ajsf/material 0.5.1-beta.1 → 0.5.1

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.
Files changed (94) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -2
  3. package/ajsf-material.d.ts +4 -0
  4. package/ajsf-material.metadata.json +1 -0
  5. package/bundles/ajsf-material.umd.js +1422 -0
  6. package/bundles/ajsf-material.umd.js.map +1 -0
  7. package/esm2015/ajsf-material.js +5 -0
  8. package/esm2015/lib/angular-flex-monkey-patch.js +12 -0
  9. package/esm2015/lib/material-design-framework.component.js +101 -0
  10. package/esm2015/lib/material-design-framework.module.js +80 -0
  11. package/esm2015/lib/material-design.framework.js +54 -0
  12. package/esm2015/lib/widgets/flex-layout-root.component.js +55 -0
  13. package/esm2015/lib/widgets/flex-layout-section.component.js +221 -0
  14. package/esm2015/lib/widgets/material-add-reference.component.js +53 -0
  15. package/esm2015/lib/widgets/material-button-group.component.js +63 -0
  16. package/esm2015/lib/widgets/material-button.component.js +60 -0
  17. package/esm2015/lib/widgets/material-checkbox.component.js +109 -0
  18. package/esm2015/lib/widgets/material-checkboxes.component.js +101 -0
  19. package/esm2015/lib/widgets/material-chip-list.component.js +33 -0
  20. package/esm2015/lib/widgets/material-datepicker.component.js +90 -0
  21. package/esm2015/lib/widgets/material-file.component.js +33 -0
  22. package/esm2015/lib/widgets/material-input.component.js +95 -0
  23. package/esm2015/lib/widgets/material-number.component.js +97 -0
  24. package/esm2015/lib/widgets/material-one-of.component.js +33 -0
  25. package/esm2015/lib/widgets/material-radios.component.js +84 -0
  26. package/esm2015/lib/widgets/material-select.component.js +115 -0
  27. package/esm2015/lib/widgets/material-slider.component.js +60 -0
  28. package/esm2015/lib/widgets/material-stepper.component.js +33 -0
  29. package/esm2015/lib/widgets/material-tabs.component.js +69 -0
  30. package/esm2015/lib/widgets/material-textarea.component.js +88 -0
  31. package/esm2015/lib/widgets/public_api.js +52 -0
  32. package/esm2015/public_api.js +8 -0
  33. package/fesm2015/ajsf-material.js +1710 -0
  34. package/fesm2015/ajsf-material.js.map +1 -0
  35. package/lib/angular-flex-monkey-patch.d.ts +1 -0
  36. package/lib/material-design-framework.component.d.ts +25 -0
  37. package/lib/material-design-framework.module.d.ts +12 -0
  38. package/lib/material-design.framework.d.ts +41 -0
  39. package/lib/widgets/flex-layout-root.component.d.ts +12 -0
  40. package/lib/widgets/flex-layout-section.component.d.ts +22 -0
  41. package/lib/widgets/material-add-reference.component.d.ts +17 -0
  42. package/lib/widgets/material-button-group.component.d.ts +20 -0
  43. package/lib/widgets/material-button.component.d.ts +18 -0
  44. package/lib/widgets/material-checkbox.component.d.ts +22 -0
  45. package/lib/widgets/material-checkboxes.component.d.ts +24 -0
  46. package/lib/widgets/material-chip-list.component.d.ts +18 -0
  47. package/lib/widgets/material-datepicker.component.d.ts +19 -0
  48. package/lib/widgets/material-file.component.d.ts +18 -0
  49. package/lib/widgets/material-input.component.d.ts +20 -0
  50. package/lib/widgets/material-number.component.d.ts +23 -0
  51. package/lib/widgets/material-one-of.component.d.ts +18 -0
  52. package/lib/widgets/material-radios.component.d.ts +20 -0
  53. package/lib/widgets/material-select.component.d.ts +21 -0
  54. package/lib/widgets/material-slider.component.d.ts +22 -0
  55. package/lib/widgets/material-stepper.component.d.ts +18 -0
  56. package/lib/widgets/material-tabs.component.d.ts +17 -0
  57. package/lib/widgets/material-textarea.component.d.ts +19 -0
  58. package/{src/lib/widgets/public_api.ts → lib/widgets/public_api.d.ts} +1 -14
  59. package/package.json +12 -4
  60. package/{src/public_api.ts → public_api.d.ts} +0 -4
  61. package/karma.conf.js +0 -37
  62. package/ng-package.json +0 -16
  63. package/src/lib/angular-flex-monkey-patch.ts +0 -13
  64. package/src/lib/material-design-framework.component.html +0 -20
  65. package/src/lib/material-design-framework.component.scss +0 -51
  66. package/src/lib/material-design-framework.component.spec.ts +0 -37
  67. package/src/lib/material-design-framework.component.ts +0 -121
  68. package/src/lib/material-design-framework.module.ts +0 -84
  69. package/src/lib/material-design.framework.ts +0 -75
  70. package/src/lib/widgets/flex-layout-root.component.html +0 -11
  71. package/src/lib/widgets/flex-layout-root.component.ts +0 -52
  72. package/src/lib/widgets/flex-layout-section.component.ts +0 -216
  73. package/src/lib/widgets/material-add-reference.component.ts +0 -56
  74. package/src/lib/widgets/material-button-group.component.ts +0 -68
  75. package/src/lib/widgets/material-button.component.ts +0 -59
  76. package/src/lib/widgets/material-checkbox.component.ts +0 -112
  77. package/src/lib/widgets/material-checkboxes.component.ts +0 -109
  78. package/src/lib/widgets/material-chip-list.component.ts +0 -35
  79. package/src/lib/widgets/material-datepicker.component.ts +0 -103
  80. package/src/lib/widgets/material-file.component.ts +0 -35
  81. package/src/lib/widgets/material-input.component.ts +0 -97
  82. package/src/lib/widgets/material-number.component.ts +0 -95
  83. package/src/lib/widgets/material-one-of.component.ts +0 -35
  84. package/src/lib/widgets/material-radios.component.ts +0 -89
  85. package/src/lib/widgets/material-select.component.ts +0 -118
  86. package/src/lib/widgets/material-slider.component.ts +0 -61
  87. package/src/lib/widgets/material-stepper.component.ts +0 -35
  88. package/src/lib/widgets/material-tabs.component.ts +0 -69
  89. package/src/lib/widgets/material-textarea.component.ts +0 -88
  90. package/src/test.ts +0 -21
  91. package/tsconfig.lib.json +0 -26
  92. package/tsconfig.lib.prod.json +0 -9
  93. package/tsconfig.spec.json +0 -17
  94. package/tslint.json +0 -11
@@ -1,35 +0,0 @@
1
- import { AbstractControl } from '@angular/forms';
2
- import { Component, Input, OnInit } from '@angular/core';
3
- import { JsonSchemaFormService } from '@ajsf/core';
4
-
5
- // TODO: Add this control
6
-
7
- @Component({
8
- // tslint:disable-next-line:component-selector
9
- selector: 'material-stepper-widget',
10
- template: ``,
11
- })
12
- export class MaterialStepperComponent implements OnInit {
13
- formControl: AbstractControl;
14
- controlName: string;
15
- controlValue: any;
16
- controlDisabled = false;
17
- boundControl = false;
18
- options: any;
19
- @Input() layoutNode: any;
20
- @Input() layoutIndex: number[];
21
- @Input() dataIndex: number[];
22
-
23
- constructor(
24
- private jsf: JsonSchemaFormService
25
- ) { }
26
-
27
- ngOnInit() {
28
- this.options = this.layoutNode.options || {};
29
- this.jsf.initializeControl(this);
30
- }
31
-
32
- updateValue(event) {
33
- this.jsf.updateValue(this, event.target.value);
34
- }
35
- }
@@ -1,69 +0,0 @@
1
- import { Component, Input, OnInit } from '@angular/core';
2
- import { JsonSchemaFormService } from '@ajsf/core';
3
-
4
- @Component({
5
- // tslint:disable-next-line:component-selector
6
- selector: 'material-tabs-widget',
7
- template: `
8
- <nav mat-tab-nav-bar
9
- [attr.aria-label]="options?.label || options?.title || ''"
10
- [style.width]="'100%'">
11
- <a mat-tab-link *ngFor="let item of layoutNode?.items; let i = index"
12
- [active]="selectedItem === i"
13
- (click)="select(i)">
14
- <span *ngIf="showAddTab || item.type !== '$ref'"
15
- [innerHTML]="setTabTitle(item, i)"></span>
16
- </a>
17
- </nav>
18
- <div *ngFor="let layoutItem of layoutNode?.items; let i = index"
19
- [class]="options?.htmlClass || ''">
20
- <select-framework-widget *ngIf="selectedItem === i"
21
- [class]="(options?.fieldHtmlClass || '') + ' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')"
22
- [dataIndex]="layoutNode?.dataType === 'array' ? (dataIndex || []).concat(i) : dataIndex"
23
- [layoutIndex]="(layoutIndex || []).concat(i)"
24
- [layoutNode]="layoutItem"></select-framework-widget>
25
- </div>`,
26
- styles: [` a { cursor: pointer; } `],
27
- })
28
- export class MaterialTabsComponent implements OnInit {
29
- options: any;
30
- itemCount: number;
31
- selectedItem = 0;
32
- showAddTab = true;
33
- @Input() layoutNode: any;
34
- @Input() layoutIndex: number[];
35
- @Input() dataIndex: number[];
36
-
37
- constructor(
38
- private jsf: JsonSchemaFormService
39
- ) { }
40
-
41
- ngOnInit() {
42
- this.options = this.layoutNode.options || {};
43
- this.itemCount = this.layoutNode.items.length - 1;
44
- this.updateControl();
45
- }
46
-
47
- select(index) {
48
- if (this.layoutNode.items[index].type === '$ref') {
49
- this.jsf.addItem({
50
- layoutNode: this.layoutNode.items[index],
51
- layoutIndex: this.layoutIndex.concat(index),
52
- dataIndex: this.dataIndex.concat(index)
53
- });
54
- this.updateControl();
55
- }
56
- this.selectedItem = index;
57
- }
58
-
59
- updateControl() {
60
- this.itemCount = this.layoutNode.items.length - 1;
61
- const lastItem = this.layoutNode.items[this.layoutNode.items.length - 1];
62
- this.showAddTab = lastItem.type === '$ref' &&
63
- this.itemCount < (lastItem.options.maxItems || 1000);
64
- }
65
-
66
- setTabTitle(item: any, index: number): string {
67
- return this.jsf.setArrayItemTitle(this, item, index);
68
- }
69
- }
@@ -1,88 +0,0 @@
1
- import { AbstractControl } from '@angular/forms';
2
- import {Component, Inject, Input, OnInit, Optional} from '@angular/core';
3
- import { JsonSchemaFormService } from '@ajsf/core';
4
- import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
5
-
6
- @Component({
7
- // tslint:disable-next-line:component-selector
8
- selector: 'material-textarea-widget',
9
- template: `
10
- <mat-form-field [appearance]="options?.appearance || matFormFieldDefaultOptions?.appearance || 'standard'"
11
- [class]="options?.htmlClass || ''"
12
- [floatLabel]="options?.floatLabel || matFormFieldDefaultOptions?.floatLabel || (options?.notitle ? 'never' : 'auto')"
13
- [hideRequiredMarker]="options?.hideRequired ? 'true' : 'false'"
14
- [style.width]="'100%'">
15
- <mat-label *ngIf="!options?.notitle">{{options?.title}}</mat-label>
16
- <span matPrefix *ngIf="options?.prefix || options?.fieldAddonLeft"
17
- [innerHTML]="options?.prefix || options?.fieldAddonLeft"></span>
18
- <textarea matInput *ngIf="boundControl"
19
- [formControl]="formControl"
20
- [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
21
- [attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
22
- [attr.maxlength]="options?.maxLength"
23
- [attr.minlength]="options?.minLength"
24
- [attr.pattern]="options?.pattern"
25
- [required]="options?.required"
26
- [id]="'control' + layoutNode?._id"
27
- [name]="controlName"
28
- [placeholder]="options?.notitle ? options?.placeholder : options?.title"
29
- [readonly]="options?.readonly ? 'readonly' : null"
30
- [style.width]="'100%'"
31
- (blur)="options.showErrors = true"></textarea>
32
- <textarea matInput *ngIf="!boundControl"
33
- [attr.aria-describedby]="'control' + layoutNode?._id + 'Status'"
34
- [attr.list]="'control' + layoutNode?._id + 'Autocomplete'"
35
- [attr.maxlength]="options?.maxLength"
36
- [attr.minlength]="options?.minLength"
37
- [attr.pattern]="options?.pattern"
38
- [required]="options?.required"
39
- [disabled]="controlDisabled"
40
- [id]="'control' + layoutNode?._id"
41
- [name]="controlName"
42
- [placeholder]="options?.notitle ? options?.placeholder : options?.title"
43
- [readonly]="options?.readonly ? 'readonly' : null"
44
- [style.width]="'100%'"
45
- [value]="controlValue"
46
- (input)="updateValue($event)"
47
- (blur)="options.showErrors = true"></textarea>
48
- <span matSuffix *ngIf="options?.suffix || options?.fieldAddonRight"
49
- [innerHTML]="options?.suffix || options?.fieldAddonRight"></span>
50
- <mat-hint *ngIf="options?.description && (!options?.showErrors || !options?.errorMessage)"
51
- align="end" [innerHTML]="options?.description"></mat-hint>
52
- </mat-form-field>
53
- <mat-error *ngIf="options?.showErrors && options?.errorMessage"
54
- [innerHTML]="options?.errorMessage"></mat-error>`,
55
- styles: [`
56
- mat-error { font-size: 75%; margin-top: -1rem; margin-bottom: 0.5rem; }
57
- ::ng-deep json-schema-form mat-form-field .mat-form-field-wrapper .mat-form-field-flex
58
- .mat-form-field-infix { width: initial; }
59
- `],
60
- })
61
- export class MaterialTextareaComponent implements OnInit {
62
- formControl: AbstractControl;
63
- controlName: string;
64
- controlValue: any;
65
- controlDisabled = false;
66
- boundControl = false;
67
- options: any;
68
- @Input() layoutNode: any;
69
- @Input() layoutIndex: number[];
70
- @Input() dataIndex: number[];
71
-
72
- constructor(
73
- @Inject(MAT_FORM_FIELD_DEFAULT_OPTIONS) @Optional() public matFormFieldDefaultOptions,
74
- private jsf: JsonSchemaFormService
75
- ) { }
76
-
77
- ngOnInit() {
78
- this.options = this.layoutNode.options || {};
79
- this.jsf.initializeControl(this);
80
- if (!this.options.notitle && !this.options.description && this.options.placeholder) {
81
- this.options.description = this.options.placeholder;
82
- }
83
- }
84
-
85
- updateValue(event) {
86
- this.jsf.updateValue(this, event.target.value);
87
- }
88
- }
package/src/test.ts DELETED
@@ -1,21 +0,0 @@
1
- // This file is required by karma.conf.js and loads recursively all the .spec and framework files
2
-
3
- import 'zone.js';
4
- import 'zone.js/testing';
5
- import { getTestBed } from '@angular/core/testing';
6
- import {
7
- BrowserDynamicTestingModule,
8
- platformBrowserDynamicTesting
9
- } from '@angular/platform-browser-dynamic/testing';
10
-
11
- declare const require: any;
12
-
13
- // First, initialize the Angular testing environment.
14
- getTestBed().initTestEnvironment(
15
- BrowserDynamicTestingModule,
16
- platformBrowserDynamicTesting()
17
- );
18
- // Then we find all the tests.
19
- const context = require.context('./', true, /\.spec\.ts$/);
20
- // And load the modules.
21
- context.keys().map(context);
package/tsconfig.lib.json DELETED
@@ -1,26 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../out-tsc/lib",
5
- "declarationMap": true,
6
- "target": "es2015",
7
- "declaration": true,
8
- "inlineSources": true,
9
- "types": [],
10
- "lib": [
11
- "dom",
12
- "es2018"
13
- ]
14
- },
15
- "angularCompilerOptions": {
16
- "skipTemplateCodegen": true,
17
- "strictMetadataEmit": true,
18
- "fullTemplateTypeCheck": true,
19
- "strictInjectionParameters": true,
20
- "enableResourceInlining": true
21
- },
22
- "exclude": [
23
- "src/test.ts",
24
- "**/*.spec.ts"
25
- ]
26
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig.lib.json",
3
- "compilerOptions": {
4
- "declarationMap": false
5
- },
6
- "angularCompilerOptions": {
7
- "enableIvy": false
8
- }
9
- }
@@ -1,17 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../out-tsc/spec",
5
- "types": [
6
- "jasmine",
7
- "node"
8
- ]
9
- },
10
- "files": [
11
- "src/test.ts"
12
- ],
13
- "include": [
14
- "**/*.spec.ts",
15
- "**/*.d.ts"
16
- ]
17
- }
package/tslint.json DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "extends": "../../tslint.json",
3
- "rules": {
4
- "directive-selector": [
5
- true,
6
- "attribute",
7
- "lib",
8
- "camelCase"
9
- ]
10
- }
11
- }