@progress/kendo-angular-label 19.1.0 → 19.1.1-develop.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.
- package/directives.d.ts +18 -3
- package/esm2022/directives.mjs +18 -3
- package/esm2022/floating-label/floating-label.component.mjs +17 -17
- package/esm2022/floating-label/floating-label.module.mjs +10 -22
- package/esm2022/label/label.component.mjs +36 -10
- package/esm2022/label.directive.mjs +8 -12
- package/esm2022/label.module.mjs +5 -17
- package/esm2022/localization/custom-messages.component.mjs +2 -2
- package/esm2022/package-metadata.mjs +2 -2
- package/fesm2022/progress-kendo-angular-label.mjs +98 -85
- package/floating-label/floating-label.component.d.ts +17 -17
- package/floating-label/floating-label.module.d.ts +10 -22
- package/floating-label/models/label-position.d.ts +27 -1
- package/label/label.component.d.ts +36 -10
- package/label.directive.d.ts +8 -12
- package/label.module.d.ts +5 -17
- package/localization/custom-messages.component.d.ts +2 -2
- package/package.json +5 -5
package/directives.d.ts
CHANGED
|
@@ -7,14 +7,29 @@ import { LabelDirective } from "./label.directive";
|
|
|
7
7
|
import { LabelComponent } from "./label/label.component";
|
|
8
8
|
import { CustomMessagesComponent } from "./localization/custom-messages.component";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Holds all `Label`-related components and directives.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { KENDO_LABEL } from '@progress/kendo-angular-label';
|
|
15
|
+
* ```
|
|
11
16
|
*/
|
|
12
17
|
export declare const KENDO_LABEL: readonly [typeof LabelDirective, typeof LabelComponent, typeof CustomMessagesComponent];
|
|
13
18
|
/**
|
|
14
|
-
*
|
|
19
|
+
* Holds all `FloatingLabel`-related components and directives.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { KENDO_FLOATINGLABEL } from '@progress/kendo-angular-label';
|
|
24
|
+
* ```
|
|
15
25
|
*/
|
|
16
26
|
export declare const KENDO_FLOATINGLABEL: readonly [typeof FloatingLabelComponent, typeof CustomMessagesComponent];
|
|
17
27
|
/**
|
|
18
|
-
*
|
|
28
|
+
* Holds all `@progress/kendo-angular-label`-related components and directives.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* import { KENDO_LABELS } from '@progress/kendo-angular-label';
|
|
33
|
+
* ```
|
|
19
34
|
*/
|
|
20
35
|
export declare const KENDO_LABELS: readonly [typeof LabelDirective, typeof LabelComponent, typeof CustomMessagesComponent, typeof FloatingLabelComponent, typeof CustomMessagesComponent];
|
package/esm2022/directives.mjs
CHANGED
|
@@ -7,7 +7,12 @@ import { LabelDirective } from "./label.directive";
|
|
|
7
7
|
import { LabelComponent } from "./label/label.component";
|
|
8
8
|
import { CustomMessagesComponent } from "./localization/custom-messages.component";
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Holds all `Label`-related components and directives.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { KENDO_LABEL } from '@progress/kendo-angular-label';
|
|
15
|
+
* ```
|
|
11
16
|
*/
|
|
12
17
|
export const KENDO_LABEL = [
|
|
13
18
|
LabelDirective,
|
|
@@ -15,14 +20,24 @@ export const KENDO_LABEL = [
|
|
|
15
20
|
CustomMessagesComponent
|
|
16
21
|
];
|
|
17
22
|
/**
|
|
18
|
-
*
|
|
23
|
+
* Holds all `FloatingLabel`-related components and directives.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { KENDO_FLOATINGLABEL } from '@progress/kendo-angular-label';
|
|
28
|
+
* ```
|
|
19
29
|
*/
|
|
20
30
|
export const KENDO_FLOATINGLABEL = [
|
|
21
31
|
FloatingLabelComponent,
|
|
22
32
|
CustomMessagesComponent
|
|
23
33
|
];
|
|
24
34
|
/**
|
|
25
|
-
*
|
|
35
|
+
* Holds all `@progress/kendo-angular-label`-related components and directives.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* import { KENDO_LABELS } from '@progress/kendo-angular-label';
|
|
40
|
+
* ```
|
|
26
41
|
*/
|
|
27
42
|
export const KENDO_LABELS = [
|
|
28
43
|
...KENDO_LABEL,
|
|
@@ -17,17 +17,17 @@ import * as i1 from "@progress/kendo-angular-l10n";
|
|
|
17
17
|
const isFunction = (x) => Object.prototype.toString.call(x) === '[object Function]';
|
|
18
18
|
/**
|
|
19
19
|
* Represents the [Kendo UI FloatingLabel component for Angular]({% slug overview_floatinglabel %}).
|
|
20
|
-
*
|
|
20
|
+
* Use this component to provide floating labels to `input` elements.
|
|
21
21
|
*
|
|
22
|
-
* The FloatingLabel supports
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* The FloatingLabel supports Template and Reactive Forms.
|
|
23
|
+
* You can use it with Kendo UI for Angular Inputs components such as `kendo-combobox`, `kendo-numerictextbox`, or `kendo-textbox`.
|
|
24
|
+
* [See example.](slug:associate_floatinglabel)
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```html
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* <kendo-floatinglabel text="First name">
|
|
29
|
+
* <kendo-textbox [(ngModel)]="name"></kendo-textbox>
|
|
30
|
+
* </kendo-floatinglabel>
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
export class FloatingLabelComponent {
|
|
@@ -36,7 +36,7 @@ export class FloatingLabelComponent {
|
|
|
36
36
|
changeDetectorRef;
|
|
37
37
|
localization;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Gets the current floating label position.
|
|
40
40
|
*/
|
|
41
41
|
get labelPosition() {
|
|
42
42
|
if (!this.empty) {
|
|
@@ -56,13 +56,13 @@ export class FloatingLabelComponent {
|
|
|
56
56
|
*/
|
|
57
57
|
direction;
|
|
58
58
|
/**
|
|
59
|
-
* Sets the CSS
|
|
60
|
-
*
|
|
59
|
+
* Sets the CSS styles for the internal label element.
|
|
60
|
+
* Accepts values supported by the [`ngStyle`](link:site.data.urls.angular['ngstyleapi']) directive.
|
|
61
61
|
*/
|
|
62
62
|
labelCssStyle;
|
|
63
63
|
/**
|
|
64
|
-
* Sets the CSS
|
|
65
|
-
*
|
|
64
|
+
* Sets the CSS classes for the label element.
|
|
65
|
+
* Accepts values supported by the [`ngClass`](link:site.data.urls.angular['ngclassapi']) directive.
|
|
66
66
|
*/
|
|
67
67
|
labelCssClass;
|
|
68
68
|
/**
|
|
@@ -70,18 +70,18 @@ export class FloatingLabelComponent {
|
|
|
70
70
|
*/
|
|
71
71
|
id;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Sets the text content of the floating label that describes the input.
|
|
74
74
|
*/
|
|
75
75
|
text;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
77
|
+
* Marks a form field as optional. When enabled, renders the `Optional` text by default.
|
|
78
|
+
* You can customize the text by providing a custom message ([see example]({% slug label_globalization %}#toc-custom-messages)).
|
|
79
79
|
*
|
|
80
|
-
*
|
|
80
|
+
* @default false
|
|
81
81
|
*/
|
|
82
82
|
optional;
|
|
83
83
|
/**
|
|
84
|
-
* Fires after the
|
|
84
|
+
* Fires after the FloatingLabel position changes.
|
|
85
85
|
*/
|
|
86
86
|
positionChange = new EventEmitter();
|
|
87
87
|
kendoInput;
|
|
@@ -9,32 +9,20 @@ import * as i1 from "./floating-label.component";
|
|
|
9
9
|
import * as i2 from "../localization/custom-messages.component";
|
|
10
10
|
//IMPORTANT: NgModule export kept for backwards compatibility
|
|
11
11
|
/**
|
|
12
|
-
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
|
13
|
-
* definition for the TextBox directive.
|
|
12
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the FloatingLabel component.
|
|
14
13
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* ```ts-no-run
|
|
18
|
-
*
|
|
19
|
-
* // The browser platform with a compiler
|
|
20
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
21
|
-
*
|
|
22
|
-
* import { NgModule } from '@angular/core';
|
|
14
|
+
* Import this module to use the FloatingLabel component in your application.
|
|
23
15
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { FloatingLabelModule } from '@progress/kendo-angular-label';
|
|
26
19
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* bootstrap: [AppComponent]
|
|
20
|
+
* @NgModule({
|
|
21
|
+
* imports: [BrowserModule, FloatingLabelModule],
|
|
22
|
+
* declarations: [AppComponent],
|
|
23
|
+
* bootstrap: [AppComponent]
|
|
32
24
|
* })
|
|
33
|
-
* export class AppModule {}
|
|
34
|
-
*
|
|
35
|
-
* // Compile and launch the module
|
|
36
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
37
|
-
*
|
|
25
|
+
* export class AppModule { }
|
|
38
26
|
* ```
|
|
39
27
|
*/
|
|
40
28
|
export class FloatingLabelModule {
|
|
@@ -17,7 +17,7 @@ import * as i1 from "@progress/kendo-angular-l10n";
|
|
|
17
17
|
/**
|
|
18
18
|
* Represents the [Kendo UI Label component for Angular]({% slug overview_label %}).
|
|
19
19
|
*
|
|
20
|
-
*
|
|
20
|
+
* Use the `LabelComponent` to associate a label with input elements or components.
|
|
21
21
|
*
|
|
22
22
|
* @example
|
|
23
23
|
* ```html
|
|
@@ -31,15 +31,27 @@ export class LabelComponent {
|
|
|
31
31
|
renderer;
|
|
32
32
|
localization;
|
|
33
33
|
/**
|
|
34
|
+
* Specifies the `dir` attribute value for the component.
|
|
34
35
|
* @hidden
|
|
35
36
|
*/
|
|
36
37
|
direction;
|
|
37
38
|
/**
|
|
38
|
-
*
|
|
39
|
+
* Sets the text content of the Label. Use this property to describe the input.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```html
|
|
43
|
+
* <kendo-label text="Email"></kendo-label>
|
|
44
|
+
* ```
|
|
39
45
|
*/
|
|
40
46
|
text;
|
|
41
47
|
/**
|
|
42
|
-
* Associates the label with a component by a template reference
|
|
48
|
+
* Associates the label with a component by a template reference or with an HTML element by `id`.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```html
|
|
52
|
+
* <input #myInput />
|
|
53
|
+
* <kendo-label [for]="myInput" text="Username"></kendo-label>
|
|
54
|
+
* ```
|
|
43
55
|
*/
|
|
44
56
|
set for(forValue) {
|
|
45
57
|
if (forValue !== this._for) {
|
|
@@ -51,20 +63,34 @@ export class LabelComponent {
|
|
|
51
63
|
return this._for;
|
|
52
64
|
}
|
|
53
65
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
66
|
+
* Marks a form field as optional. When enabled, the label displays the `Optional` text by default.
|
|
67
|
+
* You can customize the text by providing a custom message. ([See example]({% slug label_globalization %}#toc-custom-messages)).
|
|
56
68
|
*
|
|
57
|
-
*
|
|
69
|
+
* @default false
|
|
70
|
+
* @example
|
|
71
|
+
* ```html
|
|
72
|
+
* <kendo-label text="Phone" [optional]="true"></kendo-label>
|
|
73
|
+
* ```
|
|
58
74
|
*/
|
|
59
75
|
optional;
|
|
60
76
|
/**
|
|
61
|
-
* Sets the CSS
|
|
62
|
-
*
|
|
77
|
+
* Sets the CSS styles for the label element.
|
|
78
|
+
* Accepts values supported by the [`ngStyle`](link:site.data.urls.angular['ngstyleapi']) directive.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```html
|
|
82
|
+
* <kendo-label text="Name" [labelCssStyle]="{ color: 'red' }"></kendo-label>
|
|
83
|
+
* ```
|
|
63
84
|
*/
|
|
64
85
|
labelCssStyle;
|
|
65
86
|
/**
|
|
66
|
-
* Sets the CSS
|
|
67
|
-
*
|
|
87
|
+
* Sets the CSS classes for the label element.
|
|
88
|
+
* Accepts values supported by the [`ngClass`](link:site.data.urls.angular['ngclassapi']) directive.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```html
|
|
92
|
+
* <kendo-label text="Address" [labelCssClass]="'custom-label'"></kendo-label>
|
|
93
|
+
* ```
|
|
68
94
|
*/
|
|
69
95
|
labelCssClass;
|
|
70
96
|
labelDirective;
|
|
@@ -7,18 +7,16 @@ import { Directive, Input, HostBinding, ElementRef, Renderer2, NgZone } from '@a
|
|
|
7
7
|
import { isDocumentAvailable, guid } from '@progress/kendo-angular-common';
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
/**
|
|
10
|
-
* Represents the [Kendo UI Label directive for Angular]({% slug
|
|
11
|
-
*
|
|
12
|
-
* with a `label` tag by using the `[for]` property binding.
|
|
10
|
+
* Represents the [Kendo UI Label directive for Angular]({% slug label_directive %}).
|
|
11
|
+
* Use the `LabelDirective` to link a focusable Angular component or HTML element to a `<label>` tag with the `[for]` property binding.
|
|
13
12
|
*
|
|
14
|
-
* To
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* * Set the `[for]` property binding to an `id` HTML string value.
|
|
13
|
+
* To link a component with the `label` element:
|
|
14
|
+
* - Set the `[for]` property binding to a [template reference variable](link:site.data.urls.angular['templatesyntax']#template-reference-variables--var-), or
|
|
15
|
+
* - Set the `[for]` property binding to an `id` HTML string value.
|
|
18
16
|
*
|
|
19
17
|
* @example
|
|
20
18
|
* ```ts
|
|
21
|
-
*
|
|
19
|
+
* @Component({
|
|
22
20
|
* selector: 'my-app',
|
|
23
21
|
* template: `
|
|
24
22
|
* <div class="row example-wrapper" style="min-height: 450px;">
|
|
@@ -42,9 +40,8 @@ export class LabelDirective {
|
|
|
42
40
|
renderer;
|
|
43
41
|
zone;
|
|
44
42
|
/**
|
|
45
|
-
* Sets the focusable target
|
|
46
|
-
*
|
|
47
|
-
* * An `id` HTML string value.
|
|
43
|
+
* Sets the focusable target for the label.
|
|
44
|
+
* Accepts a [template reference variable](link:site.data.urls.angular['templatesyntax']#template-reference-variables--var-) or an `id` HTML string value.
|
|
48
45
|
*/
|
|
49
46
|
for;
|
|
50
47
|
get labelFor() {
|
|
@@ -62,7 +59,6 @@ export class LabelDirective {
|
|
|
62
59
|
}
|
|
63
60
|
/**
|
|
64
61
|
* @hidden
|
|
65
|
-
*
|
|
66
62
|
* Allows the user to specify if the label CSS class should be rendered or not.
|
|
67
63
|
*/
|
|
68
64
|
labelClass = true;
|
package/esm2022/label.module.mjs
CHANGED
|
@@ -16,33 +16,21 @@ import * as i4 from "./floating-label/floating-label.component";
|
|
|
16
16
|
* The package exports:
|
|
17
17
|
* - `LabelDirective`—The Label directive class.
|
|
18
18
|
* - `LabelComponent`—The Label component class
|
|
19
|
-
* - `
|
|
19
|
+
* - `FloatingLabel`—The FloatingLabel component class.
|
|
20
20
|
*
|
|
21
21
|
* @example
|
|
22
22
|
*
|
|
23
|
-
* ```ts
|
|
24
|
-
* // Import the Label module
|
|
23
|
+
* ```ts
|
|
25
24
|
* import { LabelModule } from '@progress/kendo-angular-label';
|
|
26
|
-
*
|
|
27
|
-
* // The browser platform with a compiler
|
|
28
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
29
|
-
*
|
|
30
25
|
* import { NgModule } from '@angular/core';
|
|
31
|
-
*
|
|
32
|
-
* // Import the app component
|
|
33
26
|
* import { AppComponent } from './app.component';
|
|
34
27
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* imports: [BrowserModule, LabelModule], // import Label module
|
|
28
|
+
* @NgModule({
|
|
29
|
+
* declarations: [AppComponent],
|
|
30
|
+
* imports: [BrowserModule, LabelModule],
|
|
39
31
|
* bootstrap: [AppComponent]
|
|
40
32
|
* })
|
|
41
33
|
* export class AppModule {}
|
|
42
|
-
*
|
|
43
|
-
* // Compile and launch the module
|
|
44
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
45
|
-
*
|
|
46
34
|
* ```
|
|
47
35
|
*/
|
|
48
36
|
export class LabelModule {
|
|
@@ -8,8 +8,8 @@ import { Messages } from './messages';
|
|
|
8
8
|
import * as i0 from "@angular/core";
|
|
9
9
|
import * as i1 from "@progress/kendo-angular-l10n";
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Use the `CustomMessagesComponent` to override default component messages. ([See example](slug:label_globalization#toc-internationalization))
|
|
12
|
+
*
|
|
13
13
|
*/
|
|
14
14
|
export class CustomMessagesComponent extends Messages {
|
|
15
15
|
service;
|
|
@@ -10,7 +10,7 @@ export const packageMetadata = {
|
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCode: 'KENDOUIANGULAR',
|
|
12
12
|
productCodes: ['KENDOUIANGULAR'],
|
|
13
|
-
publishDate:
|
|
14
|
-
version: '19.1.
|
|
13
|
+
publishDate: 1749139739,
|
|
14
|
+
version: '19.1.1-develop.1',
|
|
15
15
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
16
16
|
};
|
|
@@ -43,18 +43,16 @@ const getRootElement = (element) => {
|
|
|
43
43
|
const nativeLabelForTargets = ['BUTTON', 'INPUT', 'METER', 'OUTPUT', 'PROGRESS', 'SELECT', 'TEXTAREA']; // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* Represents the [Kendo UI Label directive for Angular]({% slug
|
|
47
|
-
*
|
|
48
|
-
* with a `label` tag by using the `[for]` property binding.
|
|
46
|
+
* Represents the [Kendo UI Label directive for Angular]({% slug label_directive %}).
|
|
47
|
+
* Use the `LabelDirective` to link a focusable Angular component or HTML element to a `<label>` tag with the `[for]` property binding.
|
|
49
48
|
*
|
|
50
|
-
* To
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* * Set the `[for]` property binding to an `id` HTML string value.
|
|
49
|
+
* To link a component with the `label` element:
|
|
50
|
+
* - Set the `[for]` property binding to a [template reference variable](link:site.data.urls.angular['templatesyntax']#template-reference-variables--var-), or
|
|
51
|
+
* - Set the `[for]` property binding to an `id` HTML string value.
|
|
54
52
|
*
|
|
55
53
|
* @example
|
|
56
54
|
* ```ts
|
|
57
|
-
*
|
|
55
|
+
* @Component({
|
|
58
56
|
* selector: 'my-app',
|
|
59
57
|
* template: `
|
|
60
58
|
* <div class="row example-wrapper" style="min-height: 450px;">
|
|
@@ -78,9 +76,8 @@ class LabelDirective {
|
|
|
78
76
|
renderer;
|
|
79
77
|
zone;
|
|
80
78
|
/**
|
|
81
|
-
* Sets the focusable target
|
|
82
|
-
*
|
|
83
|
-
* * An `id` HTML string value.
|
|
79
|
+
* Sets the focusable target for the label.
|
|
80
|
+
* Accepts a [template reference variable](link:site.data.urls.angular['templatesyntax']#template-reference-variables--var-) or an `id` HTML string value.
|
|
84
81
|
*/
|
|
85
82
|
for;
|
|
86
83
|
get labelFor() {
|
|
@@ -98,7 +95,6 @@ class LabelDirective {
|
|
|
98
95
|
}
|
|
99
96
|
/**
|
|
100
97
|
* @hidden
|
|
101
|
-
*
|
|
102
98
|
* Allows the user to specify if the label CSS class should be rendered or not.
|
|
103
99
|
*/
|
|
104
100
|
labelClass = true;
|
|
@@ -204,8 +200,8 @@ const packageMetadata = {
|
|
|
204
200
|
productName: 'Kendo UI for Angular',
|
|
205
201
|
productCode: 'KENDOUIANGULAR',
|
|
206
202
|
productCodes: ['KENDOUIANGULAR'],
|
|
207
|
-
publishDate:
|
|
208
|
-
version: '19.1.
|
|
203
|
+
publishDate: 1749139739,
|
|
204
|
+
version: '19.1.1-develop.1',
|
|
209
205
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
210
206
|
};
|
|
211
207
|
|
|
@@ -320,17 +316,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
320
316
|
const isFunction = (x) => Object.prototype.toString.call(x) === '[object Function]';
|
|
321
317
|
/**
|
|
322
318
|
* Represents the [Kendo UI FloatingLabel component for Angular]({% slug overview_floatinglabel %}).
|
|
323
|
-
*
|
|
319
|
+
* Use this component to provide floating labels to `input` elements.
|
|
324
320
|
*
|
|
325
|
-
* The FloatingLabel supports
|
|
326
|
-
*
|
|
327
|
-
*
|
|
321
|
+
* The FloatingLabel supports Template and Reactive Forms.
|
|
322
|
+
* You can use it with Kendo UI for Angular Inputs components such as `kendo-combobox`, `kendo-numerictextbox`, or `kendo-textbox`.
|
|
323
|
+
* [See example.](slug:associate_floatinglabel)
|
|
328
324
|
*
|
|
329
325
|
* @example
|
|
330
326
|
* ```html
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
*
|
|
327
|
+
* <kendo-floatinglabel text="First name">
|
|
328
|
+
* <kendo-textbox [(ngModel)]="name"></kendo-textbox>
|
|
329
|
+
* </kendo-floatinglabel>
|
|
334
330
|
* ```
|
|
335
331
|
*/
|
|
336
332
|
class FloatingLabelComponent {
|
|
@@ -339,7 +335,7 @@ class FloatingLabelComponent {
|
|
|
339
335
|
changeDetectorRef;
|
|
340
336
|
localization;
|
|
341
337
|
/**
|
|
342
|
-
*
|
|
338
|
+
* Gets the current floating label position.
|
|
343
339
|
*/
|
|
344
340
|
get labelPosition() {
|
|
345
341
|
if (!this.empty) {
|
|
@@ -359,13 +355,13 @@ class FloatingLabelComponent {
|
|
|
359
355
|
*/
|
|
360
356
|
direction;
|
|
361
357
|
/**
|
|
362
|
-
* Sets the CSS
|
|
363
|
-
*
|
|
358
|
+
* Sets the CSS styles for the internal label element.
|
|
359
|
+
* Accepts values supported by the [`ngStyle`](link:site.data.urls.angular['ngstyleapi']) directive.
|
|
364
360
|
*/
|
|
365
361
|
labelCssStyle;
|
|
366
362
|
/**
|
|
367
|
-
* Sets the CSS
|
|
368
|
-
*
|
|
363
|
+
* Sets the CSS classes for the label element.
|
|
364
|
+
* Accepts values supported by the [`ngClass`](link:site.data.urls.angular['ngclassapi']) directive.
|
|
369
365
|
*/
|
|
370
366
|
labelCssClass;
|
|
371
367
|
/**
|
|
@@ -373,18 +369,18 @@ class FloatingLabelComponent {
|
|
|
373
369
|
*/
|
|
374
370
|
id;
|
|
375
371
|
/**
|
|
376
|
-
*
|
|
372
|
+
* Sets the text content of the floating label that describes the input.
|
|
377
373
|
*/
|
|
378
374
|
text;
|
|
379
375
|
/**
|
|
380
|
-
*
|
|
381
|
-
*
|
|
376
|
+
* Marks a form field as optional. When enabled, renders the `Optional` text by default.
|
|
377
|
+
* You can customize the text by providing a custom message ([see example]({% slug label_globalization %}#toc-custom-messages)).
|
|
382
378
|
*
|
|
383
|
-
*
|
|
379
|
+
* @default false
|
|
384
380
|
*/
|
|
385
381
|
optional;
|
|
386
382
|
/**
|
|
387
|
-
* Fires after the
|
|
383
|
+
* Fires after the FloatingLabel position changes.
|
|
388
384
|
*/
|
|
389
385
|
positionChange = new EventEmitter();
|
|
390
386
|
kendoInput;
|
|
@@ -648,7 +644,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
648
644
|
/**
|
|
649
645
|
* Represents the [Kendo UI Label component for Angular]({% slug overview_label %}).
|
|
650
646
|
*
|
|
651
|
-
*
|
|
647
|
+
* Use the `LabelComponent` to associate a label with input elements or components.
|
|
652
648
|
*
|
|
653
649
|
* @example
|
|
654
650
|
* ```html
|
|
@@ -662,15 +658,27 @@ class LabelComponent {
|
|
|
662
658
|
renderer;
|
|
663
659
|
localization;
|
|
664
660
|
/**
|
|
661
|
+
* Specifies the `dir` attribute value for the component.
|
|
665
662
|
* @hidden
|
|
666
663
|
*/
|
|
667
664
|
direction;
|
|
668
665
|
/**
|
|
669
|
-
*
|
|
666
|
+
* Sets the text content of the Label. Use this property to describe the input.
|
|
667
|
+
*
|
|
668
|
+
* @example
|
|
669
|
+
* ```html
|
|
670
|
+
* <kendo-label text="Email"></kendo-label>
|
|
671
|
+
* ```
|
|
670
672
|
*/
|
|
671
673
|
text;
|
|
672
674
|
/**
|
|
673
|
-
* Associates the label with a component by a template reference
|
|
675
|
+
* Associates the label with a component by a template reference or with an HTML element by `id`.
|
|
676
|
+
*
|
|
677
|
+
* @example
|
|
678
|
+
* ```html
|
|
679
|
+
* <input #myInput />
|
|
680
|
+
* <kendo-label [for]="myInput" text="Username"></kendo-label>
|
|
681
|
+
* ```
|
|
674
682
|
*/
|
|
675
683
|
set for(forValue) {
|
|
676
684
|
if (forValue !== this._for) {
|
|
@@ -682,20 +690,34 @@ class LabelComponent {
|
|
|
682
690
|
return this._for;
|
|
683
691
|
}
|
|
684
692
|
/**
|
|
685
|
-
*
|
|
686
|
-
*
|
|
693
|
+
* Marks a form field as optional. When enabled, the label displays the `Optional` text by default.
|
|
694
|
+
* You can customize the text by providing a custom message. ([See example]({% slug label_globalization %}#toc-custom-messages)).
|
|
687
695
|
*
|
|
688
|
-
*
|
|
696
|
+
* @default false
|
|
697
|
+
* @example
|
|
698
|
+
* ```html
|
|
699
|
+
* <kendo-label text="Phone" [optional]="true"></kendo-label>
|
|
700
|
+
* ```
|
|
689
701
|
*/
|
|
690
702
|
optional;
|
|
691
703
|
/**
|
|
692
|
-
* Sets the CSS
|
|
693
|
-
*
|
|
704
|
+
* Sets the CSS styles for the label element.
|
|
705
|
+
* Accepts values supported by the [`ngStyle`](link:site.data.urls.angular['ngstyleapi']) directive.
|
|
706
|
+
*
|
|
707
|
+
* @example
|
|
708
|
+
* ```html
|
|
709
|
+
* <kendo-label text="Name" [labelCssStyle]="{ color: 'red' }"></kendo-label>
|
|
710
|
+
* ```
|
|
694
711
|
*/
|
|
695
712
|
labelCssStyle;
|
|
696
713
|
/**
|
|
697
|
-
* Sets the CSS
|
|
698
|
-
*
|
|
714
|
+
* Sets the CSS classes for the label element.
|
|
715
|
+
* Accepts values supported by the [`ngClass`](link:site.data.urls.angular['ngclassapi']) directive.
|
|
716
|
+
*
|
|
717
|
+
* @example
|
|
718
|
+
* ```html
|
|
719
|
+
* <kendo-label text="Address" [labelCssClass]="'custom-label'"></kendo-label>
|
|
720
|
+
* ```
|
|
699
721
|
*/
|
|
700
722
|
labelCssClass;
|
|
701
723
|
labelDirective;
|
|
@@ -836,8 +858,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
836
858
|
}] } });
|
|
837
859
|
|
|
838
860
|
/**
|
|
839
|
-
*
|
|
840
|
-
*
|
|
861
|
+
* Use the `CustomMessagesComponent` to override default component messages. ([See example](slug:label_globalization#toc-internationalization))
|
|
862
|
+
*
|
|
841
863
|
*/
|
|
842
864
|
class CustomMessagesComponent extends Messages {
|
|
843
865
|
service;
|
|
@@ -872,7 +894,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
872
894
|
}], ctorParameters: function () { return [{ type: i1.LocalizationService }]; } });
|
|
873
895
|
|
|
874
896
|
/**
|
|
875
|
-
*
|
|
897
|
+
* Holds all `Label`-related components and directives.
|
|
898
|
+
*
|
|
899
|
+
* @example
|
|
900
|
+
* ```typescript
|
|
901
|
+
* import { KENDO_LABEL } from '@progress/kendo-angular-label';
|
|
902
|
+
* ```
|
|
876
903
|
*/
|
|
877
904
|
const KENDO_LABEL = [
|
|
878
905
|
LabelDirective,
|
|
@@ -880,14 +907,24 @@ const KENDO_LABEL = [
|
|
|
880
907
|
CustomMessagesComponent
|
|
881
908
|
];
|
|
882
909
|
/**
|
|
883
|
-
*
|
|
910
|
+
* Holds all `FloatingLabel`-related components and directives.
|
|
911
|
+
*
|
|
912
|
+
* @example
|
|
913
|
+
* ```typescript
|
|
914
|
+
* import { KENDO_FLOATINGLABEL } from '@progress/kendo-angular-label';
|
|
915
|
+
* ```
|
|
884
916
|
*/
|
|
885
917
|
const KENDO_FLOATINGLABEL = [
|
|
886
918
|
FloatingLabelComponent,
|
|
887
919
|
CustomMessagesComponent
|
|
888
920
|
];
|
|
889
921
|
/**
|
|
890
|
-
*
|
|
922
|
+
* Holds all `@progress/kendo-angular-label`-related components and directives.
|
|
923
|
+
*
|
|
924
|
+
* @example
|
|
925
|
+
* ```typescript
|
|
926
|
+
* import { KENDO_LABELS } from '@progress/kendo-angular-label';
|
|
927
|
+
* ```
|
|
891
928
|
*/
|
|
892
929
|
const KENDO_LABELS = [
|
|
893
930
|
...KENDO_LABEL,
|
|
@@ -901,33 +938,21 @@ const KENDO_LABELS = [
|
|
|
901
938
|
* The package exports:
|
|
902
939
|
* - `LabelDirective`—The Label directive class.
|
|
903
940
|
* - `LabelComponent`—The Label component class
|
|
904
|
-
* - `
|
|
941
|
+
* - `FloatingLabel`—The FloatingLabel component class.
|
|
905
942
|
*
|
|
906
943
|
* @example
|
|
907
944
|
*
|
|
908
|
-
* ```ts
|
|
909
|
-
* // Import the Label module
|
|
945
|
+
* ```ts
|
|
910
946
|
* import { LabelModule } from '@progress/kendo-angular-label';
|
|
911
|
-
*
|
|
912
|
-
* // The browser platform with a compiler
|
|
913
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
914
|
-
*
|
|
915
947
|
* import { NgModule } from '@angular/core';
|
|
916
|
-
*
|
|
917
|
-
* // Import the app component
|
|
918
948
|
* import { AppComponent } from './app.component';
|
|
919
949
|
*
|
|
920
|
-
*
|
|
921
|
-
*
|
|
922
|
-
*
|
|
923
|
-
* imports: [BrowserModule, LabelModule], // import Label module
|
|
950
|
+
* @NgModule({
|
|
951
|
+
* declarations: [AppComponent],
|
|
952
|
+
* imports: [BrowserModule, LabelModule],
|
|
924
953
|
* bootstrap: [AppComponent]
|
|
925
954
|
* })
|
|
926
955
|
* export class AppModule {}
|
|
927
|
-
*
|
|
928
|
-
* // Compile and launch the module
|
|
929
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
930
|
-
*
|
|
931
956
|
* ```
|
|
932
957
|
*/
|
|
933
958
|
class LabelModule {
|
|
@@ -945,32 +970,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
945
970
|
|
|
946
971
|
//IMPORTANT: NgModule export kept for backwards compatibility
|
|
947
972
|
/**
|
|
948
|
-
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
|
949
|
-
* definition for the TextBox directive.
|
|
950
|
-
*
|
|
951
|
-
* @example
|
|
952
|
-
*
|
|
953
|
-
* ```ts-no-run
|
|
973
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the FloatingLabel component.
|
|
954
974
|
*
|
|
955
|
-
*
|
|
956
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
975
|
+
* Import this module to use the FloatingLabel component in your application.
|
|
957
976
|
*
|
|
958
|
-
*
|
|
959
|
-
*
|
|
960
|
-
*
|
|
961
|
-
* import { AppComponent } from './app.component';
|
|
977
|
+
* @example
|
|
978
|
+
* ```typescript
|
|
979
|
+
* import { FloatingLabelModule } from '@progress/kendo-angular-label';
|
|
962
980
|
*
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
* bootstrap: [AppComponent]
|
|
981
|
+
* @NgModule({
|
|
982
|
+
* imports: [BrowserModule, FloatingLabelModule],
|
|
983
|
+
* declarations: [AppComponent],
|
|
984
|
+
* bootstrap: [AppComponent]
|
|
968
985
|
* })
|
|
969
|
-
* export class AppModule {}
|
|
970
|
-
*
|
|
971
|
-
* // Compile and launch the module
|
|
972
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
973
|
-
*
|
|
986
|
+
* export class AppModule { }
|
|
974
987
|
* ```
|
|
975
988
|
*/
|
|
976
989
|
class FloatingLabelModule {
|
|
@@ -9,17 +9,17 @@ import { FloatingLabelPosition } from './models/label-position';
|
|
|
9
9
|
import * as i0 from "@angular/core";
|
|
10
10
|
/**
|
|
11
11
|
* Represents the [Kendo UI FloatingLabel component for Angular]({% slug overview_floatinglabel %}).
|
|
12
|
-
*
|
|
12
|
+
* Use this component to provide floating labels to `input` elements.
|
|
13
13
|
*
|
|
14
|
-
* The FloatingLabel supports
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* The FloatingLabel supports Template and Reactive Forms.
|
|
15
|
+
* You can use it with Kendo UI for Angular Inputs components such as `kendo-combobox`, `kendo-numerictextbox`, or `kendo-textbox`.
|
|
16
|
+
* [See example.](slug:associate_floatinglabel)
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
* ```html
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* <kendo-floatinglabel text="First name">
|
|
21
|
+
* <kendo-textbox [(ngModel)]="name"></kendo-textbox>
|
|
22
|
+
* </kendo-floatinglabel>
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export declare class FloatingLabelComponent implements AfterContentInit, OnDestroy {
|
|
@@ -28,7 +28,7 @@ export declare class FloatingLabelComponent implements AfterContentInit, OnDestr
|
|
|
28
28
|
private changeDetectorRef;
|
|
29
29
|
private localization;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* Gets the current floating label position.
|
|
32
32
|
*/
|
|
33
33
|
get labelPosition(): FloatingLabelPosition;
|
|
34
34
|
hostClasses: boolean;
|
|
@@ -39,13 +39,13 @@ export declare class FloatingLabelComponent implements AfterContentInit, OnDestr
|
|
|
39
39
|
*/
|
|
40
40
|
direction: string;
|
|
41
41
|
/**
|
|
42
|
-
* Sets the CSS
|
|
43
|
-
*
|
|
42
|
+
* Sets the CSS styles for the internal label element.
|
|
43
|
+
* Accepts values supported by the [`ngStyle`](link:site.data.urls.angular['ngstyleapi']) directive.
|
|
44
44
|
*/
|
|
45
45
|
labelCssStyle: any;
|
|
46
46
|
/**
|
|
47
|
-
* Sets the CSS
|
|
48
|
-
*
|
|
47
|
+
* Sets the CSS classes for the label element.
|
|
48
|
+
* Accepts values supported by the [`ngClass`](link:site.data.urls.angular['ngclassapi']) directive.
|
|
49
49
|
*/
|
|
50
50
|
labelCssClass: any;
|
|
51
51
|
/**
|
|
@@ -53,18 +53,18 @@ export declare class FloatingLabelComponent implements AfterContentInit, OnDestr
|
|
|
53
53
|
*/
|
|
54
54
|
id: string;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Sets the text content of the floating label that describes the input.
|
|
57
57
|
*/
|
|
58
58
|
text: string;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
60
|
+
* Marks a form field as optional. When enabled, renders the `Optional` text by default.
|
|
61
|
+
* You can customize the text by providing a custom message ([see example]({% slug label_globalization %}#toc-custom-messages)).
|
|
62
62
|
*
|
|
63
|
-
*
|
|
63
|
+
* @default false
|
|
64
64
|
*/
|
|
65
65
|
optional: boolean;
|
|
66
66
|
/**
|
|
67
|
-
* Fires after the
|
|
67
|
+
* Fires after the FloatingLabel position changes.
|
|
68
68
|
*/
|
|
69
69
|
positionChange: EventEmitter<FloatingLabelPosition>;
|
|
70
70
|
kendoInput: any;
|
|
@@ -6,32 +6,20 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
import * as i1 from "./floating-label.component";
|
|
7
7
|
import * as i2 from "../localization/custom-messages.component";
|
|
8
8
|
/**
|
|
9
|
-
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi'])
|
|
10
|
-
* definition for the TextBox directive.
|
|
9
|
+
* Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the FloatingLabel component.
|
|
11
10
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* ```ts-no-run
|
|
15
|
-
*
|
|
16
|
-
* // The browser platform with a compiler
|
|
17
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
18
|
-
*
|
|
19
|
-
* import { NgModule } from '@angular/core';
|
|
11
|
+
* Import this module to use the FloatingLabel component in your application.
|
|
20
12
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { FloatingLabelModule } from '@progress/kendo-angular-label';
|
|
23
16
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* bootstrap: [AppComponent]
|
|
17
|
+
* @NgModule({
|
|
18
|
+
* imports: [BrowserModule, FloatingLabelModule],
|
|
19
|
+
* declarations: [AppComponent],
|
|
20
|
+
* bootstrap: [AppComponent]
|
|
29
21
|
* })
|
|
30
|
-
* export class AppModule {}
|
|
31
|
-
*
|
|
32
|
-
* // Compile and launch the module
|
|
33
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
34
|
-
*
|
|
22
|
+
* export class AppModule { }
|
|
35
23
|
* ```
|
|
36
24
|
*/
|
|
37
25
|
export declare class FloatingLabelModule {
|
|
@@ -3,10 +3,36 @@
|
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
5
|
/**
|
|
6
|
-
* Represents the type of the [labelPosition](slug:api_label_floatinglabelcomponent#labelposition) field and the parameter of the [positionChange](slug:api_label_floatinglabelcomponent#positionchange) event.
|
|
6
|
+
* Represents the type of the [`labelPosition`](slug:api_label_floatinglabelcomponent#labelposition) field and the parameter of the [`positionChange`](slug:api_label_floatinglabelcomponent#positionchange) event.
|
|
7
|
+
* Do not use this type to specify whether the FloatingLabel is outside or inside the associated component. [See example.](slug:events_floatinglabel)
|
|
7
8
|
*
|
|
8
9
|
* The possible values are:
|
|
9
10
|
* - `Out`—Indicates that the FloatingLabel is outside the component it is associated with.
|
|
10
11
|
* - `In`—Indicates that the FloatingLabel is inside the component it is associated with.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* import { Component } from "@angular/core";
|
|
16
|
+
* import { KENDO_FLOATINGLABEL, FloatingLabelPosition } from "@progress/kendo-angular-label";
|
|
17
|
+
*
|
|
18
|
+
* @Component({
|
|
19
|
+
* selector: "my-app",
|
|
20
|
+
* standalone: true,
|
|
21
|
+
* imports: [KENDO_FLOATINGLABEL],
|
|
22
|
+
* template: `
|
|
23
|
+
* <kendo-floatinglabel
|
|
24
|
+
* (positionChange)="labelPosition($event)"
|
|
25
|
+
* text="Enter First Name"
|
|
26
|
+
* >
|
|
27
|
+
* <kendo-textbox [style.width.px]="180"></kendo-textbox>
|
|
28
|
+
* </kendo-floatinglabel>
|
|
29
|
+
* `,
|
|
30
|
+
* })
|
|
31
|
+
* export class AppComponent {
|
|
32
|
+
* labelPosition(position: FloatingLabelPosition): void {
|
|
33
|
+
* ...
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
* ```
|
|
11
37
|
*/
|
|
12
38
|
export type FloatingLabelPosition = 'Out' | 'In';
|
|
@@ -9,7 +9,7 @@ import * as i0 from "@angular/core";
|
|
|
9
9
|
/**
|
|
10
10
|
* Represents the [Kendo UI Label component for Angular]({% slug overview_label %}).
|
|
11
11
|
*
|
|
12
|
-
*
|
|
12
|
+
* Use the `LabelComponent` to associate a label with input elements or components.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```html
|
|
@@ -23,33 +23,59 @@ export declare class LabelComponent implements AfterContentInit {
|
|
|
23
23
|
private renderer;
|
|
24
24
|
private localization;
|
|
25
25
|
/**
|
|
26
|
+
* Specifies the `dir` attribute value for the component.
|
|
26
27
|
* @hidden
|
|
27
28
|
*/
|
|
28
29
|
direction: string;
|
|
29
30
|
/**
|
|
30
|
-
*
|
|
31
|
+
* Sets the text content of the Label. Use this property to describe the input.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```html
|
|
35
|
+
* <kendo-label text="Email"></kendo-label>
|
|
36
|
+
* ```
|
|
31
37
|
*/
|
|
32
38
|
text: string;
|
|
33
39
|
/**
|
|
34
|
-
* Associates the label with a component by a template reference
|
|
40
|
+
* Associates the label with a component by a template reference or with an HTML element by `id`.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```html
|
|
44
|
+
* <input #myInput />
|
|
45
|
+
* <kendo-label [for]="myInput" text="Username"></kendo-label>
|
|
46
|
+
* ```
|
|
35
47
|
*/
|
|
36
48
|
set for(forValue: any);
|
|
37
49
|
get for(): any;
|
|
38
50
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
51
|
+
* Marks a form field as optional. When enabled, the label displays the `Optional` text by default.
|
|
52
|
+
* You can customize the text by providing a custom message. ([See example]({% slug label_globalization %}#toc-custom-messages)).
|
|
41
53
|
*
|
|
42
|
-
*
|
|
54
|
+
* @default false
|
|
55
|
+
* @example
|
|
56
|
+
* ```html
|
|
57
|
+
* <kendo-label text="Phone" [optional]="true"></kendo-label>
|
|
58
|
+
* ```
|
|
43
59
|
*/
|
|
44
60
|
optional: boolean;
|
|
45
61
|
/**
|
|
46
|
-
* Sets the CSS
|
|
47
|
-
*
|
|
62
|
+
* Sets the CSS styles for the label element.
|
|
63
|
+
* Accepts values supported by the [`ngStyle`](link:site.data.urls.angular['ngstyleapi']) directive.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```html
|
|
67
|
+
* <kendo-label text="Name" [labelCssStyle]="{ color: 'red' }"></kendo-label>
|
|
68
|
+
* ```
|
|
48
69
|
*/
|
|
49
70
|
labelCssStyle: any;
|
|
50
71
|
/**
|
|
51
|
-
* Sets the CSS
|
|
52
|
-
*
|
|
72
|
+
* Sets the CSS classes for the label element.
|
|
73
|
+
* Accepts values supported by the [`ngClass`](link:site.data.urls.angular['ngclassapi']) directive.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```html
|
|
77
|
+
* <kendo-label text="Address" [labelCssClass]="'custom-label'"></kendo-label>
|
|
78
|
+
* ```
|
|
53
79
|
*/
|
|
54
80
|
labelCssClass: any;
|
|
55
81
|
labelDirective: LabelDirective;
|
package/label.directive.d.ts
CHANGED
|
@@ -5,18 +5,16 @@
|
|
|
5
5
|
import { ElementRef, Renderer2, NgZone } from '@angular/core';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
/**
|
|
8
|
-
* Represents the [Kendo UI Label directive for Angular]({% slug
|
|
9
|
-
*
|
|
10
|
-
* with a `label` tag by using the `[for]` property binding.
|
|
8
|
+
* Represents the [Kendo UI Label directive for Angular]({% slug label_directive %}).
|
|
9
|
+
* Use the `LabelDirective` to link a focusable Angular component or HTML element to a `<label>` tag with the `[for]` property binding.
|
|
11
10
|
*
|
|
12
|
-
* To
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* * Set the `[for]` property binding to an `id` HTML string value.
|
|
11
|
+
* To link a component with the `label` element:
|
|
12
|
+
* - Set the `[for]` property binding to a [template reference variable](link:site.data.urls.angular['templatesyntax']#template-reference-variables--var-), or
|
|
13
|
+
* - Set the `[for]` property binding to an `id` HTML string value.
|
|
16
14
|
*
|
|
17
15
|
* @example
|
|
18
16
|
* ```ts
|
|
19
|
-
*
|
|
17
|
+
* @Component({
|
|
20
18
|
* selector: 'my-app',
|
|
21
19
|
* template: `
|
|
22
20
|
* <div class="row example-wrapper" style="min-height: 450px;">
|
|
@@ -40,9 +38,8 @@ export declare class LabelDirective {
|
|
|
40
38
|
private renderer;
|
|
41
39
|
private zone;
|
|
42
40
|
/**
|
|
43
|
-
* Sets the focusable target
|
|
44
|
-
*
|
|
45
|
-
* * An `id` HTML string value.
|
|
41
|
+
* Sets the focusable target for the label.
|
|
42
|
+
* Accepts a [template reference variable](link:site.data.urls.angular['templatesyntax']#template-reference-variables--var-) or an `id` HTML string value.
|
|
46
43
|
*/
|
|
47
44
|
for: string | {
|
|
48
45
|
focus: Function;
|
|
@@ -50,7 +47,6 @@ export declare class LabelDirective {
|
|
|
50
47
|
get labelFor(): string;
|
|
51
48
|
/**
|
|
52
49
|
* @hidden
|
|
53
|
-
*
|
|
54
50
|
* Allows the user to specify if the label CSS class should be rendered or not.
|
|
55
51
|
*/
|
|
56
52
|
labelClass: boolean;
|
package/label.module.d.ts
CHANGED
|
@@ -13,33 +13,21 @@ import * as i4 from "./floating-label/floating-label.component";
|
|
|
13
13
|
* The package exports:
|
|
14
14
|
* - `LabelDirective`—The Label directive class.
|
|
15
15
|
* - `LabelComponent`—The Label component class
|
|
16
|
-
* - `
|
|
16
|
+
* - `FloatingLabel`—The FloatingLabel component class.
|
|
17
17
|
*
|
|
18
18
|
* @example
|
|
19
19
|
*
|
|
20
|
-
* ```ts
|
|
21
|
-
* // Import the Label module
|
|
20
|
+
* ```ts
|
|
22
21
|
* import { LabelModule } from '@progress/kendo-angular-label';
|
|
23
|
-
*
|
|
24
|
-
* // The browser platform with a compiler
|
|
25
|
-
* import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
26
|
-
*
|
|
27
22
|
* import { NgModule } from '@angular/core';
|
|
28
|
-
*
|
|
29
|
-
* // Import the app component
|
|
30
23
|
* import { AppComponent } from './app.component';
|
|
31
24
|
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* imports: [BrowserModule, LabelModule], // import Label module
|
|
25
|
+
* @NgModule({
|
|
26
|
+
* declarations: [AppComponent],
|
|
27
|
+
* imports: [BrowserModule, LabelModule],
|
|
36
28
|
* bootstrap: [AppComponent]
|
|
37
29
|
* })
|
|
38
30
|
* export class AppModule {}
|
|
39
|
-
*
|
|
40
|
-
* // Compile and launch the module
|
|
41
|
-
* platformBrowserDynamic().bootstrapModule(AppModule);
|
|
42
|
-
*
|
|
43
31
|
* ```
|
|
44
32
|
*/
|
|
45
33
|
export declare class LabelModule {
|
|
@@ -6,8 +6,8 @@ import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
|
6
6
|
import { Messages } from './messages';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Use the `CustomMessagesComponent` to override default component messages. ([See example](slug:label_globalization#toc-internationalization))
|
|
10
|
+
*
|
|
11
11
|
*/
|
|
12
12
|
export declare class CustomMessagesComponent extends Messages {
|
|
13
13
|
protected service: LocalizationService;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-angular-label",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.1.1-develop.1",
|
|
4
4
|
"description": "Kendo UI Label for Angular",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "Progress",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"package": {
|
|
20
20
|
"productName": "Kendo UI for Angular",
|
|
21
21
|
"productCode": "KENDOUIANGULAR",
|
|
22
|
-
"publishDate":
|
|
22
|
+
"publishDate": 1749139739,
|
|
23
23
|
"licensingDocsUrl": "https://www.telerik.com/kendo-angular-ui/my-license/"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"@angular/forms": "16 - 20",
|
|
31
31
|
"@angular/platform-browser": "16 - 20",
|
|
32
32
|
"@progress/kendo-licensing": "^1.5.0",
|
|
33
|
-
"@progress/kendo-angular-common": "19.1.
|
|
34
|
-
"@progress/kendo-angular-l10n": "19.1.
|
|
33
|
+
"@progress/kendo-angular-common": "19.1.1-develop.1",
|
|
34
|
+
"@progress/kendo-angular-l10n": "19.1.1-develop.1",
|
|
35
35
|
"rxjs": "^6.5.3 || ^7.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"tslib": "^2.3.1",
|
|
39
|
-
"@progress/kendo-angular-schematics": "19.1.
|
|
39
|
+
"@progress/kendo-angular-schematics": "19.1.1-develop.1"
|
|
40
40
|
},
|
|
41
41
|
"schematics": "./schematics/collection.json",
|
|
42
42
|
"module": "fesm2022/progress-kendo-angular-label.mjs",
|