@enigmatry/entry-components 19.0.1-preview.5 → 19.1.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 (30) hide show
  1. package/fesm2022/enigmatry-entry-components-button.mjs +8 -8
  2. package/fesm2022/enigmatry-entry-components-button.mjs.map +1 -1
  3. package/fesm2022/enigmatry-entry-components-common.mjs +35 -35
  4. package/fesm2022/enigmatry-entry-components-common.mjs.map +1 -1
  5. package/fesm2022/enigmatry-entry-components-date-time-picker.mjs +11 -11
  6. package/fesm2022/enigmatry-entry-components-date-time-picker.mjs.map +1 -1
  7. package/fesm2022/enigmatry-entry-components-dialog.mjs +20 -20
  8. package/fesm2022/enigmatry-entry-components-dialog.mjs.map +1 -1
  9. package/fesm2022/enigmatry-entry-components-file-input.mjs +8 -8
  10. package/fesm2022/enigmatry-entry-components-file-input.mjs.map +1 -1
  11. package/fesm2022/enigmatry-entry-components-permissions.mjs +11 -11
  12. package/fesm2022/enigmatry-entry-components-permissions.mjs.map +1 -1
  13. package/fesm2022/enigmatry-entry-components-search-filter.mjs +24 -24
  14. package/fesm2022/enigmatry-entry-components-search-filter.mjs.map +1 -1
  15. package/fesm2022/enigmatry-entry-components-spinner.mjs +11 -11
  16. package/fesm2022/enigmatry-entry-components-spinner.mjs.map +1 -1
  17. package/fesm2022/enigmatry-entry-components-table.mjs +17 -17
  18. package/fesm2022/enigmatry-entry-components-table.mjs.map +1 -1
  19. package/fesm2022/enigmatry-entry-components-validation.mjs +11 -11
  20. package/fesm2022/enigmatry-entry-components-validation.mjs.map +1 -1
  21. package/fesm2022/enigmatry-entry-components.mjs +4 -4
  22. package/fesm2022/enigmatry-entry-components.mjs.map +1 -1
  23. package/package.json +8 -8
  24. package/styles/modules/_default-theme.scss +24 -3
  25. package/styles/modules/components/buttons/_generator.scss +3 -3
  26. package/styles/modules/components/buttons/_radio.scss +20 -2
  27. package/styles/modules/components/checkboxes/_generator.scss +19 -2
  28. package/styles/modules/components/inputs/_generator.scss +59 -5
  29. package/styles/modules/vendors/angular-material/_generator.scss +1 -1
  30. package/styles/partials/generator-test.scss +11 -9
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, Input, Directive, Inject, NgModule } from '@angular/core';
2
+ import { Input, ChangeDetectionStrategy, Component, Inject, Directive, NgModule } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i2 from '@angular/material/form-field';
@@ -18,8 +18,8 @@ import { MatInputModule } from '@angular/material/input';
18
18
  * ```
19
19
  */
20
20
  class EntryFormErrorsComponent {
21
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryFormErrorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
22
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.3", type: EntryFormErrorsComponent, isStandalone: false, selector: "entry-form-errors", inputs: { form: "form" }, ngImport: i0, template: `
21
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryFormErrorsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
22
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: EntryFormErrorsComponent, isStandalone: false, selector: "entry-form-errors", inputs: { form: "form" }, ngImport: i0, template: `
23
23
  <div *ngIf="form.errors">
24
24
  <mat-error *ngFor="let error of form.errors.general">
25
25
  <span class="mat-body-2">{{error}}</span>
@@ -27,7 +27,7 @@ class EntryFormErrorsComponent {
27
27
  </div>
28
28
  `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }], changeDetection: i0.ChangeDetectionStrategy.Default }); }
29
29
  }
30
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryFormErrorsComponent, decorators: [{
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryFormErrorsComponent, decorators: [{
31
31
  type: Component,
32
32
  args: [{
33
33
  selector: 'entry-form-errors',
@@ -160,10 +160,10 @@ class EntryDisplayControlValidationDirective {
160
160
  const serverErrorsString = serverErrors instanceof Array ? serverErrors.join(', ') : '';
161
161
  return [errorsString, serverErrorsString].filter(x => x !== '').join(', ');
162
162
  }
163
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryDisplayControlValidationDirective, deps: [{ token: ENTRY_VALIDATION_CONFIG }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
164
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.3", type: EntryDisplayControlValidationDirective, isStandalone: false, selector: "[entryDisplayControlValidation]", inputs: { control: "control" }, ngImport: i0 }); }
163
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryDisplayControlValidationDirective, deps: [{ token: ENTRY_VALIDATION_CONFIG }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
164
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: EntryDisplayControlValidationDirective, isStandalone: false, selector: "[entryDisplayControlValidation]", inputs: { control: "control" }, ngImport: i0 }); }
165
165
  }
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryDisplayControlValidationDirective, decorators: [{
166
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryDisplayControlValidationDirective, decorators: [{
167
167
  type: Directive,
168
168
  args: [{
169
169
  selector: '[entryDisplayControlValidation]',
@@ -177,19 +177,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImpor
177
177
  }] } });
178
178
 
179
179
  class EntryValidationModule {
180
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryValidationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
181
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: EntryValidationModule, declarations: [EntryFormErrorsComponent,
180
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryValidationModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
181
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EntryValidationModule, declarations: [EntryFormErrorsComponent,
182
182
  EntryDisplayControlValidationDirective], imports: [CommonModule,
183
183
  FormsModule,
184
184
  ReactiveFormsModule,
185
185
  MatInputModule], exports: [EntryFormErrorsComponent,
186
186
  EntryDisplayControlValidationDirective] }); }
187
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryValidationModule, imports: [CommonModule,
187
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryValidationModule, imports: [CommonModule,
188
188
  FormsModule,
189
189
  ReactiveFormsModule,
190
190
  MatInputModule] }); }
191
191
  }
192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryValidationModule, decorators: [{
192
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryValidationModule, decorators: [{
193
193
  type: NgModule,
194
194
  args: [{
195
195
  declarations: [
@@ -1 +1 @@
1
- {"version":3,"file":"enigmatry-entry-components-validation.mjs","sources":["../../../../libs/entry-components/validation/entry-form-errors.component.ts","../../../../libs/entry-components/validation/entry-validation-config.model.ts","../../../../libs/entry-components/validation/entry-validation.ts","../../../../libs/entry-components/validation/entry-display-control-validation.directive.ts","../../../../libs/entry-components/validation/entry-validation.module.ts","../../../../libs/entry-components/validation/enigmatry-entry-components-validation.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { UntypedFormGroup } from '@angular/forms';\n\n/**\n * A component used to display generic (form level) server side validation messages.\n * The messages are displayed as a list, each message in a new row.\n *\n * @example\n * ```html\n * <entry-form-errors [form]=\"myForm\">\n * </entry-form-errors>\n * ```\n */\n@Component({\n selector: 'entry-form-errors',\n template: `\n <div *ngIf=\"form.errors\">\n <mat-error *ngFor=\"let error of form.errors.general\">\n <span class=\"mat-body-2\">{{error}}</span>\n </mat-error>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.Default,\n standalone: false\n})\nexport class EntryFormErrorsComponent {\n /** A form group for which the validation errors are being displayed. */\n @Input() form: UntypedFormGroup;\n}\n","import { Provider } from '@angular/core';\nimport { AbstractControl } from '@angular/forms';\nimport { createInjectionToken, provideConfig } from '@enigmatry/entry-components/common';\n\n/** Used to configure mapping between validation keys and messages */\nexport interface IEntryValidationMessage {\n /** Validation key (e.g. '_required_', '_minlength_', '_email_', etc.) */\n name: string;\n /**\n * Validation message. Can be static string or expression returning string\n * (when messages need to be resolved dynamically: parametrization, localization, etc.).\n */\n message: string | ((control: AbstractControl) => string);\n}\n\n/**\n * Used to provide default configurations on module level.\n */\nexport class EntryValidationConfig {\n /**\n * Validation key to message configuration on module level. Used to configure client side validation messages\n * for standard validators (_required_, _minLength_, _email_, etc.).\n *\n * **NOTE:** If using _Formly_ package to render forms, this configuration should not be used.\n * Instead, use `FormlyModule` to configure validation messages.\n *\n * @example\n * ```ts\n * new EntryValidationConfig() {\n * validationMessages: [\n * { name: 'required': message: 'This field is mandatory' },\n * { name: 'minlength', message: (control: AbstractControl) => `Minimal length is ${control.errors.minlength.requiredLength}`}\n * ]\n * }\n * ```\n */\n validationMessages: IEntryValidationMessage[];\n\n constructor(config: Partial<EntryValidationConfig> = {}) {\n this.validationMessages = config.validationMessages ?? [];\n }\n}\n\n/**\n * Entry validation injection token of EntryValidationConfig type containing validation default configurations.\n * Can be updated with custom configuration.\n *\n * Defaults:\n * - validationMessages: []\n */\nexport const ENTRY_VALIDATION_CONFIG = createInjectionToken(new EntryValidationConfig());\n\n/**\n * Can be used to provide entry validation configuration.\n */\nexport function provideEntryValidationConfig(config: Partial<EntryValidationConfig>): Provider {\n return provideConfig(ENTRY_VALIDATION_CONFIG, () => new EntryValidationConfig(config));\n}\n","import { AbstractControl, FormArray, FormGroup, UntypedFormGroup, ValidationErrors } from '@angular/forms';\nimport { IValidationProblemDetails } from './validation-problem-details.interface';\n\n/** A key used to map server side validation errors on form level */\nconst FORM_ERROR_KEY = 'general';\n/** A key used to map server side validation errors on form field level */\nconst FORM_FIELD_ERROR_KEY = 'fromServer';\n\nconst getFormControl = (formControl: AbstractControl | null | undefined, keys: string[]): AbstractControl | null | undefined => {\n if (keys.length === 0) {\n return formControl;\n }\n if (formControl instanceof FormGroup) {\n return getFormControl(formControl.controls[keys[0].charAt(0).toLowerCase() + keys[0].slice(1)], keys.slice(1));\n }\n if (formControl instanceof FormArray && +keys[0] >= 0) {\n return getFormControl(formControl.controls[+keys[0]], keys.slice(1));\n }\n return null;\n};\n\n/**\n * Applies validation errors received from server side to the form.\n * The errors are applied to multiple levels: form, form group, form array, and form field.\n *\n * @param error Server side validation errors response.\n * @param form Form to apply validation errors to.\n */\nconst setServerSideValidationErrors = (error: IValidationProblemDetails, form: UntypedFormGroup) => {\n form.setErrors(null);\n const validationErrors = error?.errors;\n const formErrors: ValidationErrors = {};\n\n if (validationErrors) {\n // eslint-disable-next-line guard-for-in\n for (const key in validationErrors) {\n const control = getFormControl(form, key.split(/[.[\\]]+/gu));\n\n if (control) {\n const fieldErrors = {} as ValidationErrors;\n fieldErrors[FORM_FIELD_ERROR_KEY] = validationErrors[key];\n control.setErrors(fieldErrors);\n control.markAsTouched();\n } else {\n formErrors[FORM_ERROR_KEY] =\n formErrors[FORM_ERROR_KEY]?.concat(validationErrors[key]) || validationErrors[key];\n }\n }\n } else {\n formErrors[FORM_ERROR_KEY] = [`An error occurred on the server.`];\n }\n\n form.setErrors(formErrors);\n};\n\nexport {\n FORM_ERROR_KEY,\n FORM_FIELD_ERROR_KEY,\n setServerSideValidationErrors\n};\n","import { Directive, ElementRef, Inject, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ENTRY_VALIDATION_CONFIG, EntryValidationConfig } from './entry-validation-config.model';\nimport { AbstractControl, FormControlStatus } from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { FORM_FIELD_ERROR_KEY } from './entry-validation';\n\n/**\n * A directive that displays configured validation messages or server side validations for given form control.\n * The messages are separated with coma(,) and displayed as _innerHTML_ value of host component.\n *\n * @example\n * ```html\n * <div entryDisplayControlValidation [control]=\"myForm.controls.firstName\">\n * </div\n * ```\n */\n@Directive({\n selector: '[entryDisplayControlValidation]',\n standalone: false\n})\nexport class EntryDisplayControlValidationDirective implements OnInit, OnDestroy {\n /** Form control for which the validation messages are displayed for. */\n @Input() control: AbstractControl;\n\n private _controlSubscription: Subscription | undefined;\n\n constructor(\n @Inject(ENTRY_VALIDATION_CONFIG) private readonly _config: EntryValidationConfig,\n private readonly _element: ElementRef) {}\n\n ngOnInit(): void {\n this._controlSubscription = this.control.statusChanges\n .subscribe((controlStatus: FormControlStatus) => {\n if (controlStatus === 'INVALID') {\n this._element.nativeElement.innerText = this.extractValidationMessages();\n }\n });\n }\n\n ngOnDestroy(): void {\n if (this._controlSubscription) {\n this._controlSubscription.unsubscribe();\n }\n }\n\n private extractValidationMessages(): string {\n if (!this.control.errors) {\n return '';\n }\n const errorsString = this._config.validationMessages\n .map(validationMessage => this.control.errors[validationMessage.name]\n ? typeof(validationMessage.message) === 'string'\n ? validationMessage.message : validationMessage.message(this.control)\n : ''\n )\n .filter(message => message !== '')\n .join(', ');\n\n const serverErrors = this.control.errors[FORM_FIELD_ERROR_KEY];\n const serverErrorsString = serverErrors instanceof Array ? serverErrors.join(', ') : '';\n\n return [errorsString, serverErrorsString].filter(x => x !== '').join(', ');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EntryFormErrorsComponent } from './entry-form-errors.component';\nimport { MatInputModule } from '@angular/material/input';\nimport { EntryDisplayControlValidationDirective } from './entry-display-control-validation.directive';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\n@NgModule({\n declarations: [\n EntryFormErrorsComponent,\n EntryDisplayControlValidationDirective\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n MatInputModule\n ],\n exports: [\n EntryFormErrorsComponent,\n EntryDisplayControlValidationDirective\n ]\n})\nexport class EntryValidationModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAGA;;;;;;;;;AASG;MAaU,wBAAwB,CAAA;8GAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,wBAAwB,EAVvB,YAAA,EAAA,KAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;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qB,CAAA;8GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,iBAd9B,wBAAwB;AACxB,YAAA,sCAAsC,aAGtC,YAAY;YACZ,WAAW;YACX,mBAAmB;AACnB,YAAA,cAAc,aAGd,wBAAwB;YACxB,sCAAsC,CAAA,EAAA,CAAA,CAAA;AAG7B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAV9B,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,cAAc,CAAA,EAAA,CAAA,CAAA;;2FAOL,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAhBjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,wBAAwB;wBACxB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB;AACD;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
1
+ {"version":3,"file":"enigmatry-entry-components-validation.mjs","sources":["../../../../libs/entry-components/validation/entry-form-errors.component.ts","../../../../libs/entry-components/validation/entry-validation-config.model.ts","../../../../libs/entry-components/validation/entry-validation.ts","../../../../libs/entry-components/validation/entry-display-control-validation.directive.ts","../../../../libs/entry-components/validation/entry-validation.module.ts","../../../../libs/entry-components/validation/enigmatry-entry-components-validation.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { UntypedFormGroup } from '@angular/forms';\n\n/**\n * A component used to display generic (form level) server side validation messages.\n * The messages are displayed as a list, each message in a new row.\n *\n * @example\n * ```html\n * <entry-form-errors [form]=\"myForm\">\n * </entry-form-errors>\n * ```\n */\n@Component({\n selector: 'entry-form-errors',\n template: `\n <div *ngIf=\"form.errors\">\n <mat-error *ngFor=\"let error of form.errors.general\">\n <span class=\"mat-body-2\">{{error}}</span>\n </mat-error>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.Default,\n standalone: false\n})\nexport class EntryFormErrorsComponent {\n /** A form group for which the validation errors are being displayed. */\n @Input() form: UntypedFormGroup;\n}\n","import { Provider } from '@angular/core';\nimport { AbstractControl } from '@angular/forms';\nimport { createInjectionToken, provideConfig } from '@enigmatry/entry-components/common';\n\n/** Used to configure mapping between validation keys and messages */\nexport interface IEntryValidationMessage {\n /** Validation key (e.g. '_required_', '_minlength_', '_email_', etc.) */\n name: string;\n /**\n * Validation message. Can be static string or expression returning string\n * (when messages need to be resolved dynamically: parametrization, localization, etc.).\n */\n message: string | ((control: AbstractControl) => string);\n}\n\n/**\n * Used to provide default configurations on module level.\n */\nexport class EntryValidationConfig {\n /**\n * Validation key to message configuration on module level. Used to configure client side validation messages\n * for standard validators (_required_, _minLength_, _email_, etc.).\n *\n * **NOTE:** If using _Formly_ package to render forms, this configuration should not be used.\n * Instead, use `FormlyModule` to configure validation messages.\n *\n * @example\n * ```ts\n * new EntryValidationConfig() {\n * validationMessages: [\n * { name: 'required': message: 'This field is mandatory' },\n * { name: 'minlength', message: (control: AbstractControl) => `Minimal length is ${control.errors.minlength.requiredLength}`}\n * ]\n * }\n * ```\n */\n validationMessages: IEntryValidationMessage[];\n\n constructor(config: Partial<EntryValidationConfig> = {}) {\n this.validationMessages = config.validationMessages ?? [];\n }\n}\n\n/**\n * Entry validation injection token of EntryValidationConfig type containing validation default configurations.\n * Can be updated with custom configuration.\n *\n * Defaults:\n * - validationMessages: []\n */\nexport const ENTRY_VALIDATION_CONFIG = createInjectionToken(new EntryValidationConfig());\n\n/**\n * Can be used to provide entry validation configuration.\n */\nexport function provideEntryValidationConfig(config: Partial<EntryValidationConfig>): Provider {\n return provideConfig(ENTRY_VALIDATION_CONFIG, () => new EntryValidationConfig(config));\n}\n","import { AbstractControl, FormArray, FormGroup, UntypedFormGroup, ValidationErrors } from '@angular/forms';\nimport { IValidationProblemDetails } from './validation-problem-details.interface';\n\n/** A key used to map server side validation errors on form level */\nconst FORM_ERROR_KEY = 'general';\n/** A key used to map server side validation errors on form field level */\nconst FORM_FIELD_ERROR_KEY = 'fromServer';\n\nconst getFormControl = (formControl: AbstractControl | null | undefined, keys: string[]): AbstractControl | null | undefined => {\n if (keys.length === 0) {\n return formControl;\n }\n if (formControl instanceof FormGroup) {\n return getFormControl(formControl.controls[keys[0].charAt(0).toLowerCase() + keys[0].slice(1)], keys.slice(1));\n }\n if (formControl instanceof FormArray && +keys[0] >= 0) {\n return getFormControl(formControl.controls[+keys[0]], keys.slice(1));\n }\n return null;\n};\n\n/**\n * Applies validation errors received from server side to the form.\n * The errors are applied to multiple levels: form, form group, form array, and form field.\n *\n * @param error Server side validation errors response.\n * @param form Form to apply validation errors to.\n */\nconst setServerSideValidationErrors = (error: IValidationProblemDetails, form: UntypedFormGroup) => {\n form.setErrors(null);\n const validationErrors = error?.errors;\n const formErrors: ValidationErrors = {};\n\n if (validationErrors) {\n // eslint-disable-next-line guard-for-in\n for (const key in validationErrors) {\n const control = getFormControl(form, key.split(/[.[\\]]+/gu));\n\n if (control) {\n const fieldErrors = {} as ValidationErrors;\n fieldErrors[FORM_FIELD_ERROR_KEY] = validationErrors[key];\n control.setErrors(fieldErrors);\n control.markAsTouched();\n } else {\n formErrors[FORM_ERROR_KEY] =\n formErrors[FORM_ERROR_KEY]?.concat(validationErrors[key]) || validationErrors[key];\n }\n }\n } else {\n formErrors[FORM_ERROR_KEY] = [`An error occurred on the server.`];\n }\n\n form.setErrors(formErrors);\n};\n\nexport {\n FORM_ERROR_KEY,\n FORM_FIELD_ERROR_KEY,\n setServerSideValidationErrors\n};\n","import { Directive, ElementRef, Inject, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ENTRY_VALIDATION_CONFIG, EntryValidationConfig } from './entry-validation-config.model';\nimport { AbstractControl, FormControlStatus } from '@angular/forms';\nimport { Subscription } from 'rxjs';\nimport { FORM_FIELD_ERROR_KEY } from './entry-validation';\n\n/**\n * A directive that displays configured validation messages or server side validations for given form control.\n * The messages are separated with coma(,) and displayed as _innerHTML_ value of host component.\n *\n * @example\n * ```html\n * <div entryDisplayControlValidation [control]=\"myForm.controls.firstName\">\n * </div\n * ```\n */\n@Directive({\n selector: '[entryDisplayControlValidation]',\n standalone: false\n})\nexport class EntryDisplayControlValidationDirective implements OnInit, OnDestroy {\n /** Form control for which the validation messages are displayed for. */\n @Input() control: AbstractControl;\n\n private _controlSubscription: Subscription | undefined;\n\n constructor(\n @Inject(ENTRY_VALIDATION_CONFIG) private readonly _config: EntryValidationConfig,\n private readonly _element: ElementRef) {}\n\n ngOnInit(): void {\n this._controlSubscription = this.control.statusChanges\n .subscribe((controlStatus: FormControlStatus) => {\n if (controlStatus === 'INVALID') {\n this._element.nativeElement.innerText = this.extractValidationMessages();\n }\n });\n }\n\n ngOnDestroy(): void {\n if (this._controlSubscription) {\n this._controlSubscription.unsubscribe();\n }\n }\n\n private extractValidationMessages(): string {\n if (!this.control.errors) {\n return '';\n }\n const errorsString = this._config.validationMessages\n .map(validationMessage => this.control.errors[validationMessage.name]\n ? typeof(validationMessage.message) === 'string'\n ? validationMessage.message : validationMessage.message(this.control)\n : ''\n )\n .filter(message => message !== '')\n .join(', ');\n\n const serverErrors = this.control.errors[FORM_FIELD_ERROR_KEY];\n const serverErrorsString = serverErrors instanceof Array ? serverErrors.join(', ') : '';\n\n return [errorsString, serverErrorsString].filter(x => x !== '').join(', ');\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EntryFormErrorsComponent } from './entry-form-errors.component';\nimport { MatInputModule } from '@angular/material/input';\nimport { EntryDisplayControlValidationDirective } from './entry-display-control-validation.directive';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\n\n@NgModule({\n declarations: [\n EntryFormErrorsComponent,\n EntryDisplayControlValidationDirective\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n MatInputModule\n ],\n exports: [\n EntryFormErrorsComponent,\n EntryDisplayControlValidationDirective\n ]\n})\nexport class EntryValidationModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAGA;;;;;;;;;AASG;MAaU,wBAAwB,CAAA;+GAAxB,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAxB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,wBAAwB,EAVvB,YAAA,EAAA,KAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA;;;;;;AAMX,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,OAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,SAAA,EAAA,cAAA,EAAA,eAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAA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AAA,cAAc,aAGd,wBAAwB;YACxB,sCAAsC,CAAA,EAAA,CAAA,CAAA;AAG7B,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAV9B,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,cAAc,CAAA,EAAA,CAAA,CAAA;;4FAOL,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAhBjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,wBAAwB;wBACxB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,wBAAwB;wBACxB;AACD;AACF,iBAAA;;;ACtBD;;AAEG;;;;"}
@@ -37,8 +37,8 @@ class EntryComponentsModule {
37
37
  providers
38
38
  };
39
39
  }
40
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
41
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.3", ngImport: i0, type: EntryComponentsModule, exports: [EntryButtonModule,
40
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
41
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: EntryComponentsModule, exports: [EntryButtonModule,
42
42
  EntryCommonModule,
43
43
  EntryDialogModule,
44
44
  EntryFileInputModule,
@@ -47,7 +47,7 @@ class EntryComponentsModule {
47
47
  EntrySearchFilterModule,
48
48
  EntrySpinnerModule,
49
49
  EntryTableModule] }); }
50
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryComponentsModule, imports: [EntryButtonModule,
50
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryComponentsModule, imports: [EntryButtonModule,
51
51
  EntryCommonModule,
52
52
  EntryDialogModule,
53
53
  EntryFileInputModule,
@@ -57,7 +57,7 @@ class EntryComponentsModule {
57
57
  EntrySpinnerModule,
58
58
  EntryTableModule] }); }
59
59
  }
60
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.3", ngImport: i0, type: EntryComponentsModule, decorators: [{
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: EntryComponentsModule, decorators: [{
61
61
  type: NgModule,
62
62
  args: [{
63
63
  declarations: [],
@@ -1 +1 @@
1
- {"version":3,"file":"enigmatry-entry-components.mjs","sources":["../../../../libs/entry-components/modules/entry-components.module.ts","../../../../libs/entry-components/public-api.ts","../../../../libs/entry-components/enigmatry-entry-components.ts"],"sourcesContent":["import { ModuleWithProviders, NgModule, Provider, Type } from '@angular/core';\r\nimport { EntryButtonModule } from '@enigmatry/entry-components/button';\r\nimport { EntryDialogModule } from '@enigmatry/entry-components/dialog';\r\nimport { EntryPermissionModule, EntryPermissionService } from '@enigmatry/entry-components/permissions';\r\nimport { EntrySearchFilterModule } from '@enigmatry/entry-components/search-filter';\r\nimport { EntryValidationModule } from '@enigmatry/entry-components/validation';\r\nimport { EntryFileInputModule } from '@enigmatry/entry-components/file-input';\r\nimport { EntryTableModule } from '@enigmatry/entry-components/table';\r\nimport { EntryCommonModule, NG_EVENT_PLUGINS } from '@enigmatry/entry-components/common';\r\nimport { EntrySpinnerModule } from '@enigmatry/entry-components/spinner';\r\n\r\ninterface EntryComponentsModuleOptions {\r\n permissionService?: Type<any>;\r\n}\r\n\r\n/**\r\n * Exports all entry components.\r\n *\r\n * Usage\r\n * import EntryComponentsModule in shared.module.ts to have access to all components, directives, pipes.\r\n * import EntryComponentsModule.forRoot() in app.module.ts to register root module providers.\r\n */\r\n@NgModule({\r\n declarations: [],\r\n exports: [\r\n EntryButtonModule,\r\n EntryCommonModule,\r\n EntryDialogModule,\r\n EntryFileInputModule,\r\n EntryValidationModule,\r\n EntryPermissionModule,\r\n EntrySearchFilterModule,\r\n EntrySpinnerModule,\r\n EntryTableModule\r\n ]\r\n})\r\nexport class EntryComponentsModule {\r\n static forRoot(options: EntryComponentsModuleOptions = {}): ModuleWithProviders<EntryComponentsModule> {\r\n\r\n const permissionServiceProvider: Provider[] = options.permissionService\r\n ? [{ provide: EntryPermissionService, useClass: options.permissionService }]\r\n : [];\r\n\r\n const providers: Provider[] = [...permissionServiceProvider, ...NG_EVENT_PLUGINS];\r\n return {\r\n ngModule: EntryComponentsModule,\r\n providers\r\n };\r\n }\r\n}\r\n","\n/*\n * Public API Surface of entry-components\n */\nexport * from '@enigmatry/entry-components/button';\nexport * from '@enigmatry/entry-components/common';\nexport * from '@enigmatry/entry-components/dialog';\nexport * from '@enigmatry/entry-components/file-input';\nexport * from '@enigmatry/entry-components/permissions';\nexport * from '@enigmatry/entry-components/search-filter';\nexport * from '@enigmatry/entry-components/spinner';\nexport * from '@enigmatry/entry-components/validation';\nexport * from '@enigmatry/entry-components/table';\n\nexport { EntryComponentsModule } from './modules/entry-components.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA;;;;;;AAMG;MAeU,qBAAqB,CAAA;AAChC,IAAA,OAAO,OAAO,CAAC,OAAA,GAAwC,EAAE,EAAA;AAEvD,QAAA,MAAM,yBAAyB,GAAe,OAAO,CAAC;AACpD,cAAE,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ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ACHH;;AAEG;;;;"}
1
+ {"version":3,"file":"enigmatry-entry-components.mjs","sources":["../../../../libs/entry-components/modules/entry-components.module.ts","../../../../libs/entry-components/public-api.ts","../../../../libs/entry-components/enigmatry-entry-components.ts"],"sourcesContent":["import { ModuleWithProviders, NgModule, Provider, Type } from '@angular/core';\r\nimport { EntryButtonModule } from '@enigmatry/entry-components/button';\r\nimport { EntryDialogModule } from '@enigmatry/entry-components/dialog';\r\nimport { EntryPermissionModule, EntryPermissionService } from '@enigmatry/entry-components/permissions';\r\nimport { EntrySearchFilterModule } from '@enigmatry/entry-components/search-filter';\r\nimport { EntryValidationModule } from '@enigmatry/entry-components/validation';\r\nimport { EntryFileInputModule } from '@enigmatry/entry-components/file-input';\r\nimport { EntryTableModule } from '@enigmatry/entry-components/table';\r\nimport { EntryCommonModule, NG_EVENT_PLUGINS } from '@enigmatry/entry-components/common';\r\nimport { EntrySpinnerModule } from '@enigmatry/entry-components/spinner';\r\n\r\ninterface EntryComponentsModuleOptions {\r\n permissionService?: Type<any>;\r\n}\r\n\r\n/**\r\n * Exports all entry components.\r\n *\r\n * Usage\r\n * import EntryComponentsModule in shared.module.ts to have access to all components, directives, pipes.\r\n * import EntryComponentsModule.forRoot() in app.module.ts to register root module providers.\r\n */\r\n@NgModule({\r\n declarations: [],\r\n exports: [\r\n EntryButtonModule,\r\n EntryCommonModule,\r\n EntryDialogModule,\r\n EntryFileInputModule,\r\n EntryValidationModule,\r\n EntryPermissionModule,\r\n EntrySearchFilterModule,\r\n EntrySpinnerModule,\r\n EntryTableModule\r\n ]\r\n})\r\nexport class EntryComponentsModule {\r\n static forRoot(options: EntryComponentsModuleOptions = {}): ModuleWithProviders<EntryComponentsModule> {\r\n\r\n const permissionServiceProvider: Provider[] = options.permissionService\r\n ? [{ provide: EntryPermissionService, useClass: options.permissionService }]\r\n : [];\r\n\r\n const providers: Provider[] = [...permissionServiceProvider, ...NG_EVENT_PLUGINS];\r\n return {\r\n ngModule: EntryComponentsModule,\r\n providers\r\n };\r\n }\r\n}\r\n","\n/*\n * Public API Surface of entry-components\n */\nexport * from '@enigmatry/entry-components/button';\nexport * from '@enigmatry/entry-components/common';\nexport * from '@enigmatry/entry-components/dialog';\nexport * from '@enigmatry/entry-components/file-input';\nexport * from '@enigmatry/entry-components/permissions';\nexport * from '@enigmatry/entry-components/search-filter';\nexport * from '@enigmatry/entry-components/spinner';\nexport * from '@enigmatry/entry-components/validation';\nexport * from '@enigmatry/entry-components/table';\n\nexport { EntryComponentsModule } from './modules/entry-components.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAeA;;;;;;AAMG;MAeU,qBAAqB,CAAA;AAChC,IAAA,OAAO,OAAO,CAAC,OAAA,GAAwC,EAAE,EAAA;AAEvD,QAAA,MAAM,yBAAyB,GAAe,OAAO,CAAC;AACpD,cAAE,CAAC,EAAE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,OAAO,CAAC,iBAAiB,EAAE;cACzE,EAAE;QAEN,MAAM,SAAS,GAAe,CAAC,GAAG,yBAAyB,EAAE,GAAG,gBAAgB,CAAC;QACjF,OAAO;AACL,YAAA,QAAQ,EAAE,qBAAqB;YAC/B;SACD;;+GAXQ,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAX9B,iBAAiB;YACjB,iBAAiB;YACjB,iBAAiB;YACjB,oBAAoB;YACpB,qBAAqB;YACrB,qBAAqB;YACrB,uBAAuB;YACvB,kBAAkB;YAClB,gBAAgB,CAAA,EAAA,CAAA,CAAA;AAGP,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAX9B,iBAAiB;YACjB,iBAAiB;YACjB,iBAAiB;YACjB,oBAAoB;YACpB,qBAAqB;YACrB,qBAAqB;YACrB,uBAAuB;YACvB,kBAAkB;YAClB,gBAAgB,CAAA,EAAA,CAAA,CAAA;;4FAGP,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAdjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,iBAAiB;wBACjB,iBAAiB;wBACjB,iBAAiB;wBACjB,oBAAoB;wBACpB,qBAAqB;wBACrB,qBAAqB;wBACrB,uBAAuB;wBACvB,kBAAkB;wBAClB;AACD;AACF,iBAAA;;;AClCD;;AAEG;;ACHH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enigmatry/entry-components",
3
- "version": "19.0.1-preview.5",
3
+ "version": "19.1.1",
4
4
  "author": "Enigmatry",
5
5
  "description": "Enigmatry entry angular material components",
6
6
  "homepage": "https://github.com/enigmatry/entry-angular-building-blocks/tree/master/libs/entry-components#readme",
@@ -10,13 +10,13 @@
10
10
  },
11
11
  "license": "Apache-2.0",
12
12
  "peerDependencies": {
13
- "@angular/animations": "^19.1.3",
14
- "@angular/cdk": "^19.1.1",
15
- "@angular/common": "^19.1.3",
16
- "@angular/core": "^19.1.3",
17
- "@angular/material": "^19.1.1",
18
- "@angular/forms": "^19.1.3",
19
- "@angular/platform-browser": "^19.1.3"
13
+ "@angular/animations": "^19.2.0",
14
+ "@angular/cdk": "^19.2.0",
15
+ "@angular/common": "^19.2.0",
16
+ "@angular/core": "^19.2.0",
17
+ "@angular/material": "^19.2.0",
18
+ "@angular/forms": "^19.2.0",
19
+ "@angular/platform-browser": "^19.2.0"
20
20
  },
21
21
  "dependencies": {
22
22
  "lodash-es": "^4.17.21",
@@ -6,6 +6,7 @@ $theme: (
6
6
  accent-theme: null,
7
7
  primary: #2581C4,
8
8
  accent: #EA518D,
9
+ warn: #BA1A1A,
9
10
  font: #323232,
10
11
  disabled: (
11
12
  foreground: rgb(0 0 0 / .38),
@@ -39,17 +40,37 @@ $theme: (
39
40
  default: 15px
40
41
  ),
41
42
  inputs: (
42
- background: null
43
+ background: null,
44
+ hover-background: null,
45
+ label-focus-color: null,
46
+ arrow-focus-color: null,
47
+ disabled: (
48
+ color: null,
49
+ background-color: null,
50
+ border-color: null
51
+ )
43
52
  ),
44
53
  buttons: (
45
54
  icon-size: 48px,
55
+ disabled: (
56
+ foreground: rgb(0 0 0 / .38),
57
+ background: rgb(0 0 0 / .12)
58
+ ),
46
59
  radio: (
47
- background: null
60
+ background: null,
61
+ disabled: (
62
+ color: null,
63
+ border-color: null
64
+ )
48
65
  )
49
66
  ),
50
67
  checkboxes: (
51
68
  background: null,
52
- border-hover-color: null
69
+ border-hover-color: null,
70
+ disabled: (
71
+ color: null,
72
+ border-color: null
73
+ )
53
74
  ),
54
75
  toggle: (
55
76
  on: (
@@ -2,9 +2,9 @@
2
2
  @use 'radio';
3
3
 
4
4
  @mixin generate-from($theme) {
5
- .entry-button.mdc-button:disabled {
6
- background-color: map.get($theme, 'general', 'colors', 'disabled', 'background');
7
- color: map.get($theme, 'general', 'colors', 'disabled', 'foreground');
5
+ .mdc-button.mat-mdc-button-base.mat-mdc-button-disabled {
6
+ background-color: map.get($theme, 'general', 'buttons', 'disabled', 'background');
7
+ color: map.get($theme, 'general', 'buttons', 'disabled', 'foreground');
8
8
  }
9
9
 
10
10
  @include radio.generate-from($theme);
@@ -5,15 +5,33 @@ $radio-circles-selector: '.mdc-radio__outer-circle, .mdc-radio__inner-circle';
5
5
 
6
6
  @mixin generate-from($theme) {
7
7
  $radio-border: map.get($theme, 'general', 'buttons', 'radio', 'background');
8
+ $disabled-border-color: map.get($theme, 'general', 'buttons', 'radio', 'disabled', 'border-color');
9
+ $disabled-color: map.get($theme, 'general', 'buttons', 'radio', 'disabled', 'color');
8
10
 
9
11
  @if $radio-border {
10
12
  .mat-mdc-radio-group .mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio {
11
-
12
- &:not(:disabled):active #{$radio-selector}, #{$radio-selector} {
13
+ &:not(:disabled):active #{$radio-selector},
14
+ #{$radio-selector} {
13
15
  #{$radio-circles-selector} {
14
16
  border-color: $radio-border;
15
17
  }
16
18
  }
17
19
  }
18
20
  }
21
+
22
+ @if $disabled-border-color or $disabled-color {
23
+ .mat-mdc-radio-button.mat-mdc-radio-disabled {
24
+ #{$radio-circles-selector} {
25
+ @if $disabled-border-color {
26
+ border-color: $disabled-border-color;
27
+ }
28
+ }
29
+
30
+ .mdc-label {
31
+ @if $disabled-color {
32
+ color: $disabled-color;
33
+ }
34
+ }
35
+ }
36
+ }
19
37
  }
@@ -1,3 +1,4 @@
1
+ /* stylelint-disable max-nesting-depth, selector-max-pseudo-class, scss/block-no-redundant-nesting */
1
2
  @use 'sass:map';
2
3
 
3
4
  /* stylelint-disable-next-line @stylistic/max-line-length */
@@ -6,6 +7,8 @@ $checkbox-selector: '.mdc-checkbox__native-control:enabled:not(:checked):not(:in
6
7
  @mixin generate-from($theme) {
7
8
  $background: map.get($theme, 'general', 'checkboxes', 'background');
8
9
  $border-hover-color: map.get($theme, 'general', 'checkboxes', 'border-hover-color');
10
+ $disabled-color: map.get($theme, 'general', 'checkboxes', 'disabled', 'color');
11
+ $disabled-border-color: map.get($theme, 'general', 'checkboxes', 'disabled', 'border-color');
9
12
 
10
13
  @if $background or $border-hover-color {
11
14
  .mat-mdc-checkbox {
@@ -16,9 +19,7 @@ $checkbox-selector: '.mdc-checkbox__native-control:enabled:not(:checked):not(:in
16
19
  }
17
20
 
18
21
  &:hover {
19
- /* stylelint-disable-next-line selector-max-pseudo-class */
20
22
  .mdc-checkbox:hover {
21
- /* stylelint-disable-next-line max-nesting-depth */
22
23
  @if $background and $border-hover-color {
23
24
  #{$checkbox-selector} {
24
25
  border-color: $border-hover-color;
@@ -29,4 +30,20 @@ $checkbox-selector: '.mdc-checkbox__native-control:enabled:not(:checked):not(:in
29
30
  }
30
31
  }
31
32
  }
33
+
34
+ @if $disabled-color or $disabled-border-color {
35
+ .mat-mdc-checkbox.mdc-checkbox--disabled {
36
+ .mdc-checkbox__background {
37
+ @if $disabled-border-color {
38
+ border-color: $disabled-border-color;
39
+ }
40
+ }
41
+
42
+ .mdc-label {
43
+ @if $disabled-color {
44
+ color: $disabled-color;
45
+ }
46
+ }
47
+ }
48
+ }
32
49
  }
@@ -1,14 +1,68 @@
1
+ /* stylelint-disable max-nesting-depth, @stylistic/max-line-length */
1
2
  @use 'sass:map';
2
3
 
4
+ $focused-label: '.mdc-text-field--filled:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label, .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--focused .mdc-floating-label';
5
+ $disabled-field: '.mdc-text-field--filled.mdc-text-field--disabled, .mdc-text-field--outlined.mdc-text-field--disabled';
6
+ $disabled-outline-border: '.mat-mdc-notch-piece';
7
+
3
8
  @mixin generate-from($theme) {
4
9
  $input-background: map.get($theme, 'general', 'inputs', 'background');
10
+ $input-hover-background: map.get($theme, 'general', 'inputs', 'hover-background');
11
+ $label-focus-color: map.get($theme, 'general', 'inputs', 'label-focus-color');
12
+ $arrow-focus-color: map.get($theme, 'general', 'inputs', 'arrow-focus-color');
13
+ $disabled-color: map.get($theme, 'general', 'inputs', 'disabled', 'color');
14
+ $disabled-background: map.get($theme, 'general', 'inputs', 'disabled', 'background-color');
15
+ $disabled-border: map.get($theme, 'general', 'inputs', 'disabled', 'border-color');
16
+
17
+ .mat-mdc-form-field {
18
+ @if $input-background {
19
+ .mat-mdc-text-field-wrapper.mdc-text-field {
20
+ background-color: $input-background;
21
+
22
+ &.mdc-text-field--outlined {
23
+ border-radius: 4px;
24
+ }
25
+ }
26
+ }
27
+
28
+ @if $input-hover-background {
29
+ .mat-mdc-form-field-focus-overlay {
30
+ background-color: $input-hover-background;
31
+ }
32
+ }
33
+
34
+ @if $label-focus-color {
35
+ #{$focused-label} {
36
+ color: $label-focus-color;
37
+ }
38
+ }
39
+
40
+ @if $arrow-focus-color {
41
+ &.mat-focused .mat-mdc-select-arrow-wrapper .mat-mdc-select-arrow {
42
+ color: $arrow-focus-color;
43
+ }
44
+ }
45
+
46
+ @if $disabled-color or $disabled-background or $disabled-border {
47
+ #{$disabled-field} {
48
+ @if $disabled-background {
49
+ background-color: $disabled-background;
50
+ }
5
51
 
6
- @if $input-background {
7
- .mat-mdc-form-field .mat-mdc-text-field-wrapper.mdc-text-field {
8
- background-color: $input-background;
52
+ @if $disabled-color {
53
+ .mdc-floating-label, .mdc-text-field__input {
54
+ color: $disabled-color;
55
+ }
56
+ }
9
57
 
10
- &.mdc-text-field--outlined {
11
- border-radius: 4px;
58
+ @if $disabled-border {
59
+ .mdc-line-ripple::before {
60
+ border-bottom-color: $disabled-border;
61
+ }
62
+ #{$disabled-outline-border} {
63
+ border-color: $disabled-border;
64
+ }
65
+ }
12
66
  }
13
67
  }
14
68
  }
@@ -16,7 +16,7 @@
16
16
 
17
17
  $primary-palette: theming.m2-define-palette(-get-material-palette-for('primary', $entry-theme));
18
18
  $accent-palette: theming.m2-define-palette(-get-material-palette-for('accent', $entry-theme));
19
- $warn-palette: theming.m2-define-palette(theming.$m2-red-palette);
19
+ $warn-palette: theming.m2-define-palette(-get-material-palette-for('warn', $entry-theme));
20
20
 
21
21
  $typography: typography-generator.generate-from($entry-theme);
22
22
  @include theming.typography-hierarchy($typography);
@@ -3,11 +3,7 @@
3
3
  $custom-theme: (
4
4
  general: (
5
5
  colors: (
6
- primary: #FAE3C1,
7
- disabled: (
8
- foreground: cyan,
9
- background: magenta
10
- )
6
+ primary: #FAE3C1
11
7
  ),
12
8
  fonts: (
13
9
  body: (
@@ -20,12 +16,18 @@ $custom-theme: (
20
16
  ),
21
17
  inputs: (
22
18
  background: yellow
23
- ),
24
- checkboxes: (
25
- background: red,
26
- border-hover-color: green
27
19
  )
28
20
  ),
21
+ buttons: (
22
+ disabled: (
23
+ foreground: cyan,
24
+ background: magenta
25
+ )
26
+ ),
27
+ checkboxes: (
28
+ background: red,
29
+ border-hover-color: green
30
+ ),
29
31
  tables: (
30
32
  cells: (
31
33
  edge-gap: 11px,