@ng-formworks/material 17.2.7 → 17.3.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.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/esm2022/lib/material-design-cssframework.mjs +19 -0
  3. package/esm2022/lib/material-design-framework.component.mjs +119 -0
  4. package/esm2022/lib/material-design-framework.module.mjs +117 -0
  5. package/esm2022/lib/material-design.framework.mjs +61 -0
  6. package/esm2022/lib/widgets/flex-layout-root.component.mjs +75 -0
  7. package/esm2022/lib/widgets/flex-layout-section.component.mjs +347 -0
  8. package/esm2022/lib/widgets/material-add-reference.component.mjs +66 -0
  9. package/esm2022/lib/widgets/material-button-group.component.mjs +90 -0
  10. package/esm2022/lib/widgets/material-button.component.mjs +80 -0
  11. package/esm2022/lib/widgets/material-checkbox.component.mjs +166 -0
  12. package/esm2022/lib/widgets/material-checkboxes.component.mjs +129 -0
  13. package/esm2022/lib/widgets/material-chip-list.component.mjs +35 -0
  14. package/esm2022/lib/widgets/material-datepicker.component.mjs +141 -0
  15. package/esm2022/lib/widgets/material-file.component.mjs +35 -0
  16. package/esm2022/lib/widgets/material-input.component.mjs +149 -0
  17. package/esm2022/lib/widgets/material-number.component.mjs +145 -0
  18. package/esm2022/lib/widgets/material-one-of.component.mjs +35 -0
  19. package/esm2022/lib/widgets/material-radios.component.mjs +122 -0
  20. package/esm2022/lib/widgets/material-select.component.mjs +186 -0
  21. package/esm2022/lib/widgets/material-slider.component.mjs +91 -0
  22. package/esm2022/lib/widgets/material-stepper.component.mjs +35 -0
  23. package/esm2022/lib/widgets/material-tabs.component.mjs +92 -0
  24. package/esm2022/lib/widgets/material-textarea.component.mjs +134 -0
  25. package/esm2022/lib/widgets/public_api.mjs +52 -0
  26. package/esm2022/ng-formworks-material.mjs +5 -0
  27. package/esm2022/public_api.mjs +8 -0
  28. package/fesm2022/ng-formworks-material.mjs +2353 -0
  29. package/fesm2022/ng-formworks-material.mjs.map +1 -0
  30. package/index.d.ts +5 -0
  31. package/lib/material-design-cssframework.d.ts +1 -0
  32. package/lib/material-design-framework.component.d.ts +35 -0
  33. package/lib/material-design-framework.module.d.ts +61 -0
  34. package/lib/material-design.framework.d.ts +46 -0
  35. package/lib/widgets/flex-layout-root.component.d.ts +15 -0
  36. package/lib/widgets/flex-layout-section.component.d.ts +25 -0
  37. package/lib/widgets/material-add-reference.component.d.ts +20 -0
  38. package/lib/widgets/material-button-group.component.d.ts +23 -0
  39. package/lib/widgets/material-button.component.d.ts +24 -0
  40. package/lib/widgets/material-checkbox.component.d.ts +25 -0
  41. package/lib/widgets/material-checkboxes.component.d.ts +27 -0
  42. package/lib/widgets/material-chip-list.component.d.ts +21 -0
  43. package/lib/widgets/material-datepicker.component.d.ts +22 -0
  44. package/lib/widgets/material-file.component.d.ts +21 -0
  45. package/lib/widgets/material-input.component.d.ts +23 -0
  46. package/lib/widgets/material-number.component.d.ts +26 -0
  47. package/lib/widgets/material-one-of.component.d.ts +21 -0
  48. package/lib/widgets/material-radios.component.d.ts +23 -0
  49. package/lib/widgets/material-select.component.d.ts +24 -0
  50. package/lib/widgets/material-slider.component.d.ts +25 -0
  51. package/lib/widgets/material-stepper.component.d.ts +21 -0
  52. package/lib/widgets/material-tabs.component.d.ts +20 -0
  53. package/lib/widgets/material-textarea.component.d.ts +22 -0
  54. package/{src/lib/widgets/public_api.ts → lib/widgets/public_api.d.ts} +41 -54
  55. package/package.json +62 -48
  56. package/{src/public_api.ts → public_api.d.ts} +4 -9
  57. package/karma.conf.js +0 -46
  58. package/ng-package.json +0 -13
  59. package/src/lib/flexlayout-replacement-styles.scss +0 -95
  60. package/src/lib/material-design-cssframework.ts +0 -20
  61. package/src/lib/material-design-framework.component.html +0 -13
  62. package/src/lib/material-design-framework.component.scss +0 -58
  63. package/src/lib/material-design-framework.component.spec.ts +0 -39
  64. package/src/lib/material-design-framework.component.ts +0 -143
  65. package/src/lib/material-design-framework.module.ts +0 -81
  66. package/src/lib/material-design-themes.scss +0 -71
  67. package/src/lib/material-design.framework.ts +0 -83
  68. package/src/lib/tailwind-output.scss +0 -622
  69. package/src/lib/widgets/flex-layout-root.component.html +0 -4
  70. package/src/lib/widgets/flex-layout-root.component.ts +0 -52
  71. package/src/lib/widgets/flex-layout-section.component.ts +0 -216
  72. package/src/lib/widgets/material-add-reference.component.ts +0 -56
  73. package/src/lib/widgets/material-button-group.component.ts +0 -68
  74. package/src/lib/widgets/material-button.component.ts +0 -66
  75. package/src/lib/widgets/material-checkbox.component.ts +0 -112
  76. package/src/lib/widgets/material-checkboxes.component.ts +0 -108
  77. package/src/lib/widgets/material-chip-list.component.ts +0 -35
  78. package/src/lib/widgets/material-datepicker.component.ts +0 -89
  79. package/src/lib/widgets/material-file.component.ts +0 -35
  80. package/src/lib/widgets/material-input.component.ts +0 -97
  81. package/src/lib/widgets/material-number.component.ts +0 -95
  82. package/src/lib/widgets/material-one-of.component.ts +0 -35
  83. package/src/lib/widgets/material-radios.component.ts +0 -91
  84. package/src/lib/widgets/material-select.component.ts +0 -118
  85. package/src/lib/widgets/material-slider.component.ts +0 -65
  86. package/src/lib/widgets/material-stepper.component.ts +0 -35
  87. package/src/lib/widgets/material-tabs.component.ts +0 -72
  88. package/src/lib/widgets/material-textarea.component.ts +0 -88
  89. package/src/test.ts +0 -17
  90. package/tailwind-input.css +0 -3
  91. package/tailwind.config.js +0 -12
  92. package/tsconfig.lib.json +0 -25
  93. package/tsconfig.lib.prod.json +0 -9
  94. package/tsconfig.spec.json +0 -17
  95. package/tslint.json +0 -11
@@ -1,72 +0,0 @@
1
- import { Component, Input, OnInit } from '@angular/core';
2
- import { JsonSchemaFormService } from '@ng-formworks/core';
3
-
4
- @Component({
5
- // tslint:disable-next-line:component-selector
6
- selector: 'material-tabs-widget',
7
- template: `
8
- <nav mat-tab-nav-bar [tabPanel]="tabPanel"
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
- <mat-tab-nav-panel #tabPanel>
19
- <div *ngFor="let layoutItem of layoutNode?.items; let i = index"
20
- [class]="options?.htmlClass || ''">
21
- <select-framework-widget *ngIf="selectedItem === i"
22
- [class]="(options?.fieldHtmlClass || '') + ' ' + (options?.activeClass || '') + ' ' + (options?.style?.selected || '')"
23
- [dataIndex]="layoutNode?.dataType === 'array' ? (dataIndex || []).concat(i) : dataIndex"
24
- [layoutIndex]="(layoutIndex || []).concat(i)"
25
- [layoutNode]="layoutItem"></select-framework-widget>
26
- </div>
27
- </mat-tab-nav-panel>
28
- `,
29
- styles: [` a { cursor: pointer; } `],
30
- })
31
- export class MaterialTabsComponent implements OnInit {
32
- options: any;
33
- itemCount: number;
34
- selectedItem = 0;
35
- showAddTab = true;
36
- @Input() layoutNode: any;
37
- @Input() layoutIndex: number[];
38
- @Input() dataIndex: number[];
39
-
40
- constructor(
41
- private jsf: JsonSchemaFormService
42
- ) { }
43
-
44
- ngOnInit() {
45
- this.options = this.layoutNode.options || {};
46
- this.itemCount = this.layoutNode.items.length - 1;
47
- this.updateControl();
48
- }
49
-
50
- select(index) {
51
- if (this.layoutNode.items[index].type === '$ref') {
52
- this.jsf.addItem({
53
- layoutNode: this.layoutNode.items[index],
54
- layoutIndex: this.layoutIndex.concat(index),
55
- dataIndex: this.dataIndex.concat(index)
56
- });
57
- this.updateControl();
58
- }
59
- this.selectedItem = index;
60
- }
61
-
62
- updateControl() {
63
- this.itemCount = this.layoutNode.items.length - 1;
64
- const lastItem = this.layoutNode.items[this.layoutNode.items.length - 1];
65
- this.showAddTab = lastItem.type === '$ref' &&
66
- this.itemCount < (lastItem.options.maxItems || 1000);
67
- }
68
-
69
- setTabTitle(item: any, index: number): string {
70
- return this.jsf.setArrayItemTitle(this, item, index);
71
- }
72
- }
@@ -1,88 +0,0 @@
1
- import { Component, Inject, Input, OnInit, Optional } from '@angular/core';
2
- import { AbstractControl } from '@angular/forms';
3
- import { MAT_FORM_FIELD_DEFAULT_OPTIONS } from '@angular/material/form-field';
4
- import { JsonSchemaFormService } from '@ng-formworks/core';
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 || 'fill'"
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-mdc-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,17 +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
- // First, initialize the Angular testing environment.
12
- getTestBed().initTestEnvironment(
13
- BrowserDynamicTestingModule,
14
- platformBrowserDynamicTesting(), {
15
- teardown: { destroyAfterEach: false }
16
- }
17
- );
@@ -1,3 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
@@ -1,12 +0,0 @@
1
- /** @type {import('tailwindcss').Config} */
2
- /** @type {import('tailwindcss').Config} */
3
- module.exports = {
4
- content: [
5
- "./src/**/*.{html,ts}",
6
- "./projects/ng-formworks-material/**/*.{html,ts}"
7
- ],
8
- theme: {
9
- extend: {},
10
- },
11
- plugins: [],
12
- }
package/tsconfig.lib.json DELETED
@@ -1,25 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../out-tsc/lib",
5
- "declarationMap": true,
6
- "declaration": true,
7
- "inlineSources": true,
8
- "types": [],
9
- "lib": [
10
- "dom",
11
- "es2018"
12
- ]
13
- },
14
- "angularCompilerOptions": {
15
- "skipTemplateCodegen": true,
16
- "strictMetadataEmit": true,
17
- "fullTemplateTypeCheck": true,
18
- "strictInjectionParameters": true,
19
- "enableResourceInlining": true
20
- },
21
- "exclude": [
22
- "src/test.ts",
23
- "**/*.spec.ts"
24
- ]
25
- }
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "./tsconfig.lib.json",
3
- "compilerOptions": {
4
- "declarationMap": false
5
- },
6
- "angularCompilerOptions": {
7
- "compilationMode": "partial"
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
- }