@energycap/components 0.28.6 → 0.28.7

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.
@@ -0,0 +1,70 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { AbstractControl } from '@angular/forms';
3
+ import { TranslateService } from '@ngx-translate/core';
4
+ import { ValidationMessageService } from '../../core/validation-message.service';
5
+ import { ControlLabelPosition } from '../form-control-base';
6
+ export declare class FormControlLabelComponent implements OnInit {
7
+ protected validationMessageService: ValidationMessageService;
8
+ private translateService;
9
+ /**
10
+ * Id
11
+ */
12
+ id?: string;
13
+ /**
14
+ * Bind id to host element
15
+ */
16
+ attrId?: string;
17
+ /**
18
+ * The form control label
19
+ */
20
+ label: string;
21
+ /**
22
+ * UI-oriented form model that retains the states and values of the HTML controls on screen.
23
+ * Can be a {@link FormControl}, a {@link FormGroup} or a {@link FormArray}
24
+ *
25
+ * @type {AbstractControl}
26
+ * @memberof FormControlBase
27
+ */
28
+ control?: AbstractControl;
29
+ /**
30
+ * The position of the form control label (top|bottom|left)
31
+ */
32
+ labelPosition?: ControlLabelPosition;
33
+ /**An optional string to show if any of the underlying controls has an error. If falsy, one of the
34
+ * errors from the underlying controls will be used.
35
+ */
36
+ overrideValidationError?: string;
37
+ /**An optional flag to hide the validation messages.
38
+ */
39
+ hideValidationMessage?: boolean;
40
+ /**
41
+ * All current validation errors
42
+ *
43
+ * @type {string}
44
+ * @memberof FormControlBase
45
+ */
46
+ validationErrors: string;
47
+ allControlsTouched: boolean;
48
+ private componentDestroyed;
49
+ constructor(validationMessageService: ValidationMessageService, translateService: TranslateService);
50
+ ngOnInit(): Promise<void>;
51
+ /**
52
+ * Angular onDestroy lifecyle hook.
53
+ * Unsubscribe from any observables
54
+ *
55
+ * @see https://angular.io/guide/lifecycle-hooks
56
+ * @memberof FormControlBase
57
+ */
58
+ ngOnDestroy(): void;
59
+ private getErrors;
60
+ private assignErrors;
61
+ /**
62
+ * Function that subscribes to the controls valueChanges Observable
63
+ * to take any erros and translate them
64
+ *
65
+ * @param {*} [data]
66
+ * @returns
67
+ * @memberof FormControlBase
68
+ */
69
+ private translateValidationMessages;
70
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energycap/components",
3
- "version": "0.28.6",
3
+ "version": "0.28.7",
4
4
  "dependencies": {
5
5
  "tslib": "^2.0.0"
6
6
  },
package/public-api.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from './lib/controls/collapsible-toggle/collapsible-toggle.component';
6
6
  export * from './lib/controls/combobox/combobox.component';
7
7
  export * from './lib/controls/dropdown/dropdown.component';
8
8
  export * from './lib/controls/form-control-base';
9
+ export * from './lib/controls/form-control-label/form-control-label.component';
9
10
  export * from './lib/controls/menu/menu.component';
10
11
  export * from './lib/controls/navigation/link-item';
11
12
  export * from './lib/controls/navigation/nav-group';
@@ -1,42 +1,21 @@
1
- @import '../variables';
1
+ @import '../mixins/card-base';
2
2
 
3
3
  .card {
4
- background-color: $ec-color-bg-content;
5
- background-clip: padding-box;
6
- border: 1px solid rgba($black, .1);
7
- border-radius: var(--ec-border-radius-card);
8
- overflow: auto;
9
- box-shadow: var(--ec-box-shadow);
4
+ @include card;
10
5
  }
11
6
 
12
7
  .card-header {
13
- display: flex;
14
- align-items: center;
15
- min-height: 2.5rem;
8
+ @include card-header;
16
9
  }
17
10
 
18
11
  .card-title {
19
- @extend .text-heading-2;
20
- @include truncate;
21
- cursor: default;
22
- display: flex;
23
- align-items: center;
24
- padding-left: .5rem;
25
- padding-right: .5rem;
26
- flex: 1 1;
27
- min-height: 0;
28
- min-width: 0;
12
+ @include card-title;
29
13
  }
30
14
 
31
15
  .card-footer {
32
- @extend .text-caption-1;
33
- border-top: 1px solid $ec-border-color-default;
34
- min-height: 2rem;
35
- padding: .5rem;
16
+ @include card-footer;
36
17
  }
37
18
 
38
19
  .card-actions {
39
- padding: .25rem;
40
- display: flex;
41
- margin-left: auto;
42
- }
20
+ @include card-actions;
21
+ }
@@ -0,0 +1,42 @@
1
+ @import '../variables';
2
+
3
+ @mixin card {
4
+ background-color: $ec-color-bg-content;
5
+ background-clip: padding-box;
6
+ border: 1px solid rgba($black, .1);
7
+ border-radius: var(--ec-border-radius-card);
8
+ overflow: auto;
9
+ box-shadow: var(--ec-box-shadow);
10
+ }
11
+
12
+ @mixin card-header {
13
+ display: flex;
14
+ align-items: center;
15
+ min-height: 2.5rem;
16
+ }
17
+
18
+ @mixin card-title {
19
+ @extend .text-heading-2;
20
+ @include truncate;
21
+ cursor: default;
22
+ display: flex;
23
+ align-items: center;
24
+ padding-left: .5rem;
25
+ padding-right: .5rem;
26
+ flex: 1 1;
27
+ min-height: 0;
28
+ min-width: 0;
29
+ }
30
+
31
+ @mixin card-footer {
32
+ @extend .text-caption-1;
33
+ border-top: 1px solid $ec-border-color-default;
34
+ min-height: 2rem;
35
+ padding: .5rem;
36
+ }
37
+
38
+ @mixin card-actions {
39
+ padding: .25rem;
40
+ display: flex;
41
+ margin-left: auto;
42
+ }
@@ -13,4 +13,5 @@
13
13
  @import 'mixins/resizable-base';
14
14
  @import 'mixins/login';
15
15
  @import 'mixins/tags-base';
16
- @import 'mixins/animations';
16
+ @import 'mixins/animations';
17
+ @import 'mixins/card-base';