@progress/kendo-angular-label 17.0.0-develop.8 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -18
- package/{esm2020 → esm2022}/floating-label/floating-label-input-adapter.mjs +25 -19
- package/{esm2020 → esm2022}/floating-label/floating-label.component.mjs +77 -41
- package/{esm2020 → esm2022}/floating-label/floating-label.module.mjs +4 -4
- package/{esm2020 → esm2022}/label/label.component.mjs +54 -19
- package/{esm2020 → esm2022}/label.directive.mjs +33 -23
- package/{esm2020 → esm2022}/label.module.mjs +4 -4
- package/{esm2020 → esm2022}/localization/custom-messages.component.mjs +9 -8
- package/{esm2020 → esm2022}/localization/localized-messages.directive.mjs +9 -8
- package/{esm2020 → esm2022}/localization/messages.mjs +7 -3
- package/{esm2020 → esm2022}/package-metadata.mjs +2 -2
- package/{fesm2015 → fesm2022}/progress-kendo-angular-label.mjs +224 -131
- package/floating-label/floating-label.component.d.ts +1 -1
- package/floating-label/models/label-position.d.ts +1 -1
- package/label/label.component.d.ts +1 -1
- package/label.directive.d.ts +1 -1
- package/localization/messages.d.ts +1 -1
- package/package.json +13 -19
- package/fesm2020/progress-kendo-angular-label.mjs +0 -900
- /package/{esm2020 → esm2022}/directives.mjs +0 -0
- /package/{esm2020 → esm2022}/floating-label/models/label-position.mjs +0 -0
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/progress-kendo-angular-label.mjs +0 -0
- /package/{esm2020 → esm2022}/util.mjs +0 -0
package/README.md
CHANGED
|
@@ -1,33 +1,47 @@
|
|
|
1
|
-
<a href="https://www.telerik.com/kendo-angular-ui/" target="_blank">
|
|
1
|
+
<a href="https://www.telerik.com/kendo-angular-ui/components/labels" target="_blank">
|
|
2
2
|
<img width="631" src="https://www.telerik.com/kendo-angular-ui/npm-banner.svg">
|
|
3
3
|
</a>
|
|
4
4
|
|
|
5
|
-
## Kendo UI for Angular Labels Package
|
|
5
|
+
## Kendo UI for Angular Labels Package
|
|
6
6
|
|
|
7
|
-
>
|
|
8
|
-
> *
|
|
9
|
-
> *
|
|
10
|
-
> * To receive a license key, you need to either [purchase a license](https://www.telerik.com/purchase/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-labels) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-angular-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-labels). Doing so indicates that you [accept the Kendo UI for Angular License Agreement](https://www.telerik.com/purchase/license-agreement/kendo-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-labels).
|
|
11
|
-
> * The 30-day free trial gives you access to all the Kendo UI for Angular components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Angular dev team!
|
|
12
|
-
>
|
|
13
|
-
> [Start using Kendo UI for Angular](https://www.telerik.com/download-login-v2-kendo-angular-ui?utm_medium=referral&utm_source=npm&utm_campaign=kendo-ui-angular-trial-npm-labels) and speed up your development process!
|
|
7
|
+
> * This package is part of the [Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui/)—a commercial UI library.
|
|
8
|
+
> * You must [install a license key](https://www.telerik.com/kendo-angular-ui/my-license) when adding the package to your project. To receive a license key, either [purchase a license](https://www.telerik.com/purchase/kendo-ui) or register for a [free trial](https://www.telerik.com/download-login-v2-kendo-angular-ui).
|
|
9
|
+
> * The 30-day free trial gives you access to all the Kendo UI for Angular components and their full functionality. Additionally, for the period of your license, you get access to our legendary technical support provided directly by the Kendo UI for Angular team!
|
|
14
10
|
|
|
15
|
-
Kendo UI for Angular
|
|
11
|
+
The Kendo UI for Angular Labels associate focusable components or HTML elements with an HTML Label element. The Labels are built from the ground up and specifically for Angular, so that you get high-performance label controls which integrate tightly with your application and with the rest of the Kendo UI for Angular components.
|
|
12
|
+
|
|
13
|
+
## What's Included in the Angular Labels Package
|
|
14
|
+
|
|
15
|
+
The [Angular Labels](https://www.telerik.com/kendo-angular-ui/components/labels) package includes two built-in components:
|
|
16
|
+
|
|
17
|
+
* [Angular Label](https://www.telerik.com/kendo-angular-ui/components/labels/label)
|
|
18
|
+
* [Angular FloatingLabel](https://www.telerik.com/kendo-angular-ui/components/labels/floatinglabel)
|
|
19
|
+
|
|
20
|
+
## Key Features
|
|
21
|
+
|
|
22
|
+
Among the many features which the Kendo UI for Angular Labels deliver are:
|
|
23
|
+
|
|
24
|
+
* Association—You can use the Labels to assosiate Kendo UI for Angular components, other Angular components, and regular HTML inputs. [Read more about the association options of the Label component...](https://www.telerik.com/kendo-angular-ui/components/labels/label/association)
|
|
25
|
+
* Optional Text—The Labels provide settings for toggling a text in a way it indicates that a form field is optional. [Read more about optional text of the Label...](https://www.telerik.com/kendo-angular-ui/components/labels/label/optional-text)
|
|
26
|
+
* Styling—The Labels components allow you to set custom CSS styles and classes on the actual label element thus customizing their appearance. [Read more about the styling options of the FloatingLabel component...](https://www.telerik.com/kendo-angular-ui/components/labels/floatinglabel/styling)
|
|
27
|
+
* Globalization—The Kendo UI for Angular Labels support globalization to ensure that each component can fit well in any application, no matter what languages and locales need to be supported. Additionally, the Labels support rendering in a right-to-left (RTL) direction. [Read more about Labels globalization...](https://www.telerik.com/kendo-angular-ui/components/labels/globalization)
|
|
28
|
+
|
|
29
|
+
## Support Options
|
|
30
|
+
|
|
31
|
+
For any issues you might encounter while working with the Kendo UI for Angular Labels, you have the following support channels available:
|
|
32
|
+
|
|
33
|
+
* Industry-leading technical support—Kendo UI for Angular paid license holders and users with an active (free) trial license can take advantage of our outstanding customer support. To submit a ticket, use the [dedicated Kendo UI for Angular support system](https://www.telerik.com/account/support-center/contact-us/technical-support).
|
|
34
|
+
* Product forums—The [Kendo UI for Angular forums](https://www.telerik.com/forums/kendo-angular-ui) are part of the free support you can get from the community and from the Kendo UI for Angular team.
|
|
35
|
+
* Feedback portal—The [Kendo UI for Angular feedback portal](https://feedback.telerik.com/kendo-angular-ui) is where you can request and vote for new features to be added.
|
|
16
36
|
|
|
17
37
|
## Resources
|
|
18
38
|
|
|
19
|
-
* [
|
|
39
|
+
* [Getting Started with Kendo UI for Angular](https://www.telerik.com/kendo-angular-ui/getting-started)
|
|
40
|
+
* [Getting Started with the Kendo UI for Angular Labels](https://www.telerik.com/kendo-angular-ui/components/labels/installation/getting-started)
|
|
20
41
|
* [Demos, documentation, and component reference](https://www.telerik.com/kendo-angular-ui/components)
|
|
21
42
|
* [Blogs](http://www.telerik.com/blogs/kendo-ui)
|
|
22
43
|
* [Kendo UI for Angular pricing and licensing](https://www.telerik.com/purchase/kendo-ui)
|
|
23
44
|
|
|
24
|
-
## Questions and Feedback
|
|
25
|
-
|
|
26
|
-
* [Official Forums](https://www.telerik.com/forums/kendo-angular-ui)
|
|
27
|
-
* [GitHub Issues](https://github.com/telerik/kendo-angular/issues)
|
|
28
|
-
* [Feedback Portal](https://feedback.telerik.com/kendo-angular-ui)
|
|
29
|
-
* [StackOverflow](https://stackoverflow.com/questions/tagged/kendo-ui-angular2)
|
|
30
|
-
|
|
31
45
|
*Copyright © 2024 Progress Software Corporation and/or one of its subsidiaries or affiliates. All rights reserved.*
|
|
32
46
|
|
|
33
47
|
*Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries.*
|
|
@@ -8,6 +8,31 @@ import { EventEmitter } from '@angular/core';
|
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
10
|
export class FloatingLabelInputAdapter {
|
|
11
|
+
component;
|
|
12
|
+
onFocus;
|
|
13
|
+
onBlur;
|
|
14
|
+
autoFillStart;
|
|
15
|
+
autoFillEnd;
|
|
16
|
+
onValueChange;
|
|
17
|
+
get focusableId() {
|
|
18
|
+
const component = this.component;
|
|
19
|
+
if ('focusableId' in component) {
|
|
20
|
+
return component.focusableId;
|
|
21
|
+
}
|
|
22
|
+
else if ('id' in component) {
|
|
23
|
+
return component.id;
|
|
24
|
+
}
|
|
25
|
+
return "";
|
|
26
|
+
}
|
|
27
|
+
set focusableId(value) {
|
|
28
|
+
const component = this.component;
|
|
29
|
+
if ('focusableId' in component) {
|
|
30
|
+
component.focusableId = value;
|
|
31
|
+
}
|
|
32
|
+
else if ('id' in component) {
|
|
33
|
+
component.id = value;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
11
36
|
constructor(component, formControl) {
|
|
12
37
|
this.component = component;
|
|
13
38
|
const isObservableOrEventEmitter = (event) => event instanceof Observable || event instanceof EventEmitter;
|
|
@@ -30,23 +55,4 @@ export class FloatingLabelInputAdapter {
|
|
|
30
55
|
this.onValueChange = component.valueChange;
|
|
31
56
|
}
|
|
32
57
|
}
|
|
33
|
-
get focusableId() {
|
|
34
|
-
const component = this.component;
|
|
35
|
-
if ('focusableId' in component) {
|
|
36
|
-
return component.focusableId;
|
|
37
|
-
}
|
|
38
|
-
else if ('id' in component) {
|
|
39
|
-
return component.id;
|
|
40
|
-
}
|
|
41
|
-
return "";
|
|
42
|
-
}
|
|
43
|
-
set focusableId(value) {
|
|
44
|
-
const component = this.component;
|
|
45
|
-
if ('focusableId' in component) {
|
|
46
|
-
component.focusableId = value;
|
|
47
|
-
}
|
|
48
|
-
else if ('id' in component) {
|
|
49
|
-
component.id = value;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
58
|
}
|
|
@@ -31,37 +31,10 @@ const isFunction = (x) => Object.prototype.toString.call(x) === '[object Functio
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
export class FloatingLabelComponent {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.localization = localization;
|
|
39
|
-
this.hostClasses = true;
|
|
40
|
-
/**
|
|
41
|
-
* Fires after the floating label position is changed.
|
|
42
|
-
*/
|
|
43
|
-
this.positionChange = new EventEmitter();
|
|
44
|
-
/**
|
|
45
|
-
* @hidden
|
|
46
|
-
*/
|
|
47
|
-
this.focused = false;
|
|
48
|
-
/**
|
|
49
|
-
* @hidden
|
|
50
|
-
*/
|
|
51
|
-
this.empty = true;
|
|
52
|
-
/**
|
|
53
|
-
* @hidden
|
|
54
|
-
*/
|
|
55
|
-
this.invalid = false;
|
|
56
|
-
/**
|
|
57
|
-
* @hidden
|
|
58
|
-
*/
|
|
59
|
-
this.labelId = `k-${guid()}`;
|
|
60
|
-
this.autoFillStarted = false;
|
|
61
|
-
validatePackage(packageMetadata);
|
|
62
|
-
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
63
|
-
this.renderer.removeAttribute(this.elementRef.nativeElement, "id");
|
|
64
|
-
}
|
|
34
|
+
elementRef;
|
|
35
|
+
renderer;
|
|
36
|
+
changeDetectorRef;
|
|
37
|
+
localization;
|
|
65
38
|
/**
|
|
66
39
|
* Represents the current floating label position.
|
|
67
40
|
*/
|
|
@@ -71,12 +44,75 @@ export class FloatingLabelComponent {
|
|
|
71
44
|
}
|
|
72
45
|
return this.focused ? 'Out' : 'In';
|
|
73
46
|
}
|
|
47
|
+
hostClasses = true;
|
|
74
48
|
get focusedClass() {
|
|
75
49
|
return this.focused;
|
|
76
50
|
}
|
|
77
51
|
get invalidClass() {
|
|
78
52
|
return this.invalid;
|
|
79
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* @hidden
|
|
56
|
+
*/
|
|
57
|
+
direction;
|
|
58
|
+
/**
|
|
59
|
+
* Sets the CSS Styles that will be rendered on the actual label element.
|
|
60
|
+
* Supports the type of values that are supported by [ngStyle](link:site.data.urls.angular['ngstyleapi']) directive.
|
|
61
|
+
*/
|
|
62
|
+
labelCssStyle;
|
|
63
|
+
/**
|
|
64
|
+
* Sets the CSS Classes that will be rendered on the actual label element.
|
|
65
|
+
* Supports the type of values that are supported by [ngClass](link:site.data.urls.angular['ngclassapi']) directive.
|
|
66
|
+
*/
|
|
67
|
+
labelCssClass;
|
|
68
|
+
/**
|
|
69
|
+
* Sets the `id` attribute of the input inside the floating label.
|
|
70
|
+
*/
|
|
71
|
+
id;
|
|
72
|
+
/**
|
|
73
|
+
* Specifies the text content of the floating label which describes the input.
|
|
74
|
+
*/
|
|
75
|
+
text;
|
|
76
|
+
/**
|
|
77
|
+
* Allows marking a form field as optional. By default renders the `Optional` text when enabled.
|
|
78
|
+
* The text can be customized by providing a custom message ([see example]({% slug label_globalization %}#toc-custom-messages)).
|
|
79
|
+
*
|
|
80
|
+
* The default value is `false`
|
|
81
|
+
*/
|
|
82
|
+
optional;
|
|
83
|
+
/**
|
|
84
|
+
* Fires after the floating label position is changed.
|
|
85
|
+
*/
|
|
86
|
+
positionChange = new EventEmitter();
|
|
87
|
+
kendoInput;
|
|
88
|
+
formControl;
|
|
89
|
+
/**
|
|
90
|
+
* @hidden
|
|
91
|
+
*/
|
|
92
|
+
focused = false;
|
|
93
|
+
/**
|
|
94
|
+
* @hidden
|
|
95
|
+
*/
|
|
96
|
+
empty = true;
|
|
97
|
+
/**
|
|
98
|
+
* @hidden
|
|
99
|
+
*/
|
|
100
|
+
invalid = false;
|
|
101
|
+
/**
|
|
102
|
+
* @hidden
|
|
103
|
+
*/
|
|
104
|
+
labelId = `k-${guid()}`;
|
|
105
|
+
subscription;
|
|
106
|
+
autoFillStarted = false;
|
|
107
|
+
constructor(elementRef, renderer, changeDetectorRef, localization) {
|
|
108
|
+
this.elementRef = elementRef;
|
|
109
|
+
this.renderer = renderer;
|
|
110
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
111
|
+
this.localization = localization;
|
|
112
|
+
validatePackage(packageMetadata);
|
|
113
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
114
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, "id");
|
|
115
|
+
}
|
|
80
116
|
/**
|
|
81
117
|
* @hidden
|
|
82
118
|
*/
|
|
@@ -229,15 +265,14 @@ export class FloatingLabelComponent {
|
|
|
229
265
|
return;
|
|
230
266
|
}
|
|
231
267
|
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}
|
|
240
|
-
], queries: [{ propertyName: "kendoInput", first: true, predicate: KendoInput, descendants: true }, { propertyName: "formControl", first: true, predicate: NgControl, descendants: true }], exportAs: ["kendoFloatingLabel"], ngImport: i0, template: `
|
|
268
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FloatingLabelComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
269
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: FloatingLabelComponent, isStandalone: true, selector: "kendo-floatinglabel", inputs: { labelCssStyle: "labelCssStyle", labelCssClass: "labelCssClass", id: "id", text: "text", optional: "optional" }, outputs: { positionChange: "positionChange" }, host: { properties: { "class.k-floating-label-container": "this.hostClasses", "class.k-focus": "this.focusedClass", "class.k-invalid": "this.invalidClass", "attr.dir": "this.direction" } }, providers: [
|
|
270
|
+
LocalizationService,
|
|
271
|
+
{
|
|
272
|
+
provide: L10N_PREFIX,
|
|
273
|
+
useValue: 'kendo.floatinglabel'
|
|
274
|
+
}
|
|
275
|
+
], queries: [{ propertyName: "kendoInput", first: true, predicate: KendoInput, descendants: true }, { propertyName: "formControl", first: true, predicate: NgControl, descendants: true }], exportAs: ["kendoFloatingLabel"], ngImport: i0, template: `
|
|
241
276
|
<ng-container kendoFloatingLabelLocalizedMessages
|
|
242
277
|
i18n-optional="kendo.floatinglabel.optional|The text for the optional segment of a FloatingLabel component"
|
|
243
278
|
optional="Optional"
|
|
@@ -248,7 +283,8 @@ FloatingLabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0",
|
|
|
248
283
|
{{ text }}<span *ngIf="optional" class="k-label-optional">({{textFor('optional')}})</span>
|
|
249
284
|
</label>
|
|
250
285
|
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "\n [kendoLabelLocalizedMessages],\n [kendoFloatingLabelLocalizedMessages]\n " }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
251
|
-
|
|
286
|
+
}
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FloatingLabelComponent, decorators: [{
|
|
252
288
|
type: Component,
|
|
253
289
|
args: [{
|
|
254
290
|
selector: 'kendo-floatinglabel',
|
|
@@ -38,11 +38,11 @@ import * as i2 from "../localization/custom-messages.component";
|
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
40
|
export class FloatingLabelModule {
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FloatingLabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
42
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: FloatingLabelModule, imports: [i1.FloatingLabelComponent, i2.CustomMessagesComponent], exports: [i1.FloatingLabelComponent, i2.CustomMessagesComponent] });
|
|
43
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FloatingLabelModule });
|
|
41
44
|
}
|
|
42
|
-
|
|
43
|
-
FloatingLabelModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FloatingLabelModule, imports: [i1.FloatingLabelComponent, i2.CustomMessagesComponent], exports: [i1.FloatingLabelComponent, i2.CustomMessagesComponent] });
|
|
44
|
-
FloatingLabelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FloatingLabelModule, imports: [KENDO_FLOATINGLABEL] });
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FloatingLabelModule, decorators: [{
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: FloatingLabelModule, decorators: [{
|
|
46
46
|
type: NgModule,
|
|
47
47
|
args: [{
|
|
48
48
|
exports: [...KENDO_FLOATINGLABEL],
|
|
@@ -27,15 +27,17 @@ import * as i1 from "@progress/kendo-angular-l10n";
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export class LabelComponent {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
elementRef;
|
|
31
|
+
renderer;
|
|
32
|
+
localization;
|
|
33
|
+
/**
|
|
34
|
+
* @hidden
|
|
35
|
+
*/
|
|
36
|
+
direction;
|
|
37
|
+
/**
|
|
38
|
+
* Specifies the text content of the label which describes the input.
|
|
39
|
+
*/
|
|
40
|
+
text;
|
|
39
41
|
/**
|
|
40
42
|
* Associates the label with a component by a template reference, or with an HTML element by id.
|
|
41
43
|
*/
|
|
@@ -48,6 +50,39 @@ export class LabelComponent {
|
|
|
48
50
|
get for() {
|
|
49
51
|
return this._for;
|
|
50
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Allows marking a form field as optional. By default renders the `Optional` text when enabled.
|
|
55
|
+
* The text can be customized by providing a custom message ([see example]({% slug label_globalization %}#toc-custom-messages)).
|
|
56
|
+
*
|
|
57
|
+
* The default value is `false`.
|
|
58
|
+
*/
|
|
59
|
+
optional;
|
|
60
|
+
/**
|
|
61
|
+
* Sets the CSS Styles that will be rendered on the actual label element.
|
|
62
|
+
* Supports the type of values that are supported by [ngStyle](link:site.data.urls.angular['ngstyleapi']) directive.
|
|
63
|
+
*/
|
|
64
|
+
labelCssStyle;
|
|
65
|
+
/**
|
|
66
|
+
* Sets the CSS Classes that will be rendered on the actual label element.
|
|
67
|
+
* Supports the type of values that are supported by [ngClass](link:site.data.urls.angular['ngclassapi']) directive.
|
|
68
|
+
*/
|
|
69
|
+
labelCssClass;
|
|
70
|
+
labelDirective;
|
|
71
|
+
kendoInput;
|
|
72
|
+
/**
|
|
73
|
+
* @hidden
|
|
74
|
+
*/
|
|
75
|
+
control;
|
|
76
|
+
subscriptions = new Subscription();
|
|
77
|
+
_for;
|
|
78
|
+
constructor(elementRef, renderer, localization) {
|
|
79
|
+
this.elementRef = elementRef;
|
|
80
|
+
this.renderer = renderer;
|
|
81
|
+
this.localization = localization;
|
|
82
|
+
validatePackage(packageMetadata);
|
|
83
|
+
this.direction = localization.rtl ? 'rtl' : 'ltr';
|
|
84
|
+
this.renderer.removeAttribute(this.elementRef.nativeElement, 'id');
|
|
85
|
+
}
|
|
51
86
|
/**
|
|
52
87
|
* @hidden
|
|
53
88
|
*/
|
|
@@ -93,15 +128,14 @@ export class LabelComponent {
|
|
|
93
128
|
textFor(key) {
|
|
94
129
|
return this.localization.get(key);
|
|
95
130
|
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
], queries: [{ propertyName: "kendoInput", first: true, predicate: KendoInput, descendants: true, static: true }], viewQueries: [{ propertyName: "labelDirective", first: true, predicate: LabelDirective, descendants: true, static: true }], exportAs: ["kendoLabel"], ngImport: i0, template: `
|
|
131
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LabelComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
132
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: LabelComponent, isStandalone: true, selector: "kendo-label", inputs: { text: "text", for: "for", optional: "optional", labelCssStyle: "labelCssStyle", labelCssClass: "labelCssClass" }, host: { properties: { "attr.dir": "this.direction" } }, providers: [
|
|
133
|
+
LocalizationService,
|
|
134
|
+
{
|
|
135
|
+
provide: L10N_PREFIX,
|
|
136
|
+
useValue: 'kendo.label'
|
|
137
|
+
}
|
|
138
|
+
], queries: [{ propertyName: "kendoInput", first: true, predicate: KendoInput, descendants: true, static: true }], viewQueries: [{ propertyName: "labelDirective", first: true, predicate: LabelDirective, descendants: true, static: true }], exportAs: ["kendoLabel"], ngImport: i0, template: `
|
|
105
139
|
<ng-container kendoLabelLocalizedMessages
|
|
106
140
|
i18n-optional="kendo.label.optional|The text for the optional segment of a Label component"
|
|
107
141
|
optional="Optional"
|
|
@@ -117,7 +151,8 @@ LabelComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version
|
|
|
117
151
|
</label>
|
|
118
152
|
<ng-content></ng-content>
|
|
119
153
|
`, isInline: true, dependencies: [{ kind: "directive", type: LocalizedMessagesDirective, selector: "\n [kendoLabelLocalizedMessages],\n [kendoFloatingLabelLocalizedMessages]\n " }, { kind: "directive", type: LabelDirective, selector: "label[for]", inputs: ["for", "labelClass"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
120
|
-
|
|
154
|
+
}
|
|
155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LabelComponent, decorators: [{
|
|
121
156
|
type: Component,
|
|
122
157
|
args: [{
|
|
123
158
|
selector: 'kendo-label',
|
|
@@ -38,26 +38,15 @@ import * as i0 from "@angular/core";
|
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
40
|
export class LabelDirective {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this.labelClass = true;
|
|
51
|
-
this.handleClick = () => {
|
|
52
|
-
const component = this.getFocusableComponent();
|
|
53
|
-
if (!component) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
if (component.focus) {
|
|
57
|
-
component.focus();
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
}
|
|
41
|
+
label;
|
|
42
|
+
renderer;
|
|
43
|
+
zone;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the focusable target to either of the following options ([see example]({% slug overview_label %})):
|
|
46
|
+
* * A [template reference variable](link:site.data.urls.angular['templatesyntax']#template-reference-variables--var-), or
|
|
47
|
+
* * An `id` HTML string value.
|
|
48
|
+
*/
|
|
49
|
+
for;
|
|
61
50
|
get labelFor() {
|
|
62
51
|
if (typeof this.for === 'string') {
|
|
63
52
|
return this.for;
|
|
@@ -71,6 +60,18 @@ export class LabelDirective {
|
|
|
71
60
|
}
|
|
72
61
|
return component.focusableId || component.id || null;
|
|
73
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* @hidden
|
|
65
|
+
*
|
|
66
|
+
* Allows the user to specify if the label CSS class should be rendered or not.
|
|
67
|
+
*/
|
|
68
|
+
labelClass = true;
|
|
69
|
+
clickListener;
|
|
70
|
+
constructor(label, renderer, zone) {
|
|
71
|
+
this.label = label;
|
|
72
|
+
this.renderer = renderer;
|
|
73
|
+
this.zone = zone;
|
|
74
|
+
}
|
|
74
75
|
/**
|
|
75
76
|
* @hidden
|
|
76
77
|
*/
|
|
@@ -128,10 +129,19 @@ export class LabelDirective {
|
|
|
128
129
|
const target = this.for;
|
|
129
130
|
return target && target.focus !== undefined ? target : null;
|
|
130
131
|
}
|
|
132
|
+
handleClick = () => {
|
|
133
|
+
const component = this.getFocusableComponent();
|
|
134
|
+
if (!component) {
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (component.focus) {
|
|
138
|
+
component.focus();
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LabelDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
142
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LabelDirective, isStandalone: true, selector: "label[for]", inputs: { for: "for", labelClass: "labelClass" }, host: { properties: { "attr.for": "this.labelFor", "class.k-label": "this.labelClass" } }, ngImport: i0 });
|
|
131
143
|
}
|
|
132
|
-
|
|
133
|
-
LabelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LabelDirective, isStandalone: true, selector: "label[for]", inputs: { for: "for", labelClass: "labelClass" }, host: { properties: { "attr.for": "this.labelFor", "class.k-label": "this.labelClass" } }, ngImport: i0 });
|
|
134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LabelDirective, decorators: [{
|
|
144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LabelDirective, decorators: [{
|
|
135
145
|
type: Directive,
|
|
136
146
|
args: [{
|
|
137
147
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
@@ -46,11 +46,11 @@ import * as i4 from "./floating-label/floating-label.component";
|
|
|
46
46
|
* ```
|
|
47
47
|
*/
|
|
48
48
|
export class LabelModule {
|
|
49
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LabelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
50
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: LabelModule, imports: [i1.LabelDirective, i2.LabelComponent, i3.CustomMessagesComponent, i4.FloatingLabelComponent, i3.CustomMessagesComponent], exports: [i1.LabelDirective, i2.LabelComponent, i3.CustomMessagesComponent, i4.FloatingLabelComponent, i3.CustomMessagesComponent] });
|
|
51
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LabelModule });
|
|
49
52
|
}
|
|
50
|
-
|
|
51
|
-
LabelModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: LabelModule, imports: [i1.LabelDirective, i2.LabelComponent, i3.CustomMessagesComponent, i4.FloatingLabelComponent, i3.CustomMessagesComponent], exports: [i1.LabelDirective, i2.LabelComponent, i3.CustomMessagesComponent, i4.FloatingLabelComponent, i3.CustomMessagesComponent] });
|
|
52
|
-
LabelModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LabelModule, imports: [i2.LabelComponent, i3.CustomMessagesComponent, i4.FloatingLabelComponent, i3.CustomMessagesComponent] });
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LabelModule, decorators: [{
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LabelModule, decorators: [{
|
|
54
54
|
type: NgModule,
|
|
55
55
|
args: [{
|
|
56
56
|
imports: [...KENDO_LABELS],
|
|
@@ -12,6 +12,7 @@ import * as i1 from "@progress/kendo-angular-l10n";
|
|
|
12
12
|
* ([see example](slug:label_globalization#toc-internationalization)).
|
|
13
13
|
*/
|
|
14
14
|
export class CustomMessagesComponent extends Messages {
|
|
15
|
+
service;
|
|
15
16
|
constructor(service) {
|
|
16
17
|
super();
|
|
17
18
|
this.service = service;
|
|
@@ -19,15 +20,15 @@ export class CustomMessagesComponent extends Messages {
|
|
|
19
20
|
get override() {
|
|
20
21
|
return true;
|
|
21
22
|
}
|
|
23
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CustomMessagesComponent, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CustomMessagesComponent, isStandalone: true, selector: "kendo-label-messages, kendo-floatinglabel-messages", providers: [
|
|
25
|
+
{
|
|
26
|
+
provide: Messages,
|
|
27
|
+
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
28
|
+
}
|
|
29
|
+
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
22
30
|
}
|
|
23
|
-
|
|
24
|
-
CustomMessagesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CustomMessagesComponent, isStandalone: true, selector: "kendo-label-messages, kendo-floatinglabel-messages", providers: [
|
|
25
|
-
{
|
|
26
|
-
provide: Messages,
|
|
27
|
-
useExisting: forwardRef(() => CustomMessagesComponent)
|
|
28
|
-
}
|
|
29
|
-
], usesInheritance: true, ngImport: i0, template: ``, isInline: true });
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CustomMessagesComponent, decorators: [{
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CustomMessagesComponent, decorators: [{
|
|
31
32
|
type: Component,
|
|
32
33
|
args: [{
|
|
33
34
|
providers: [
|
|
@@ -11,19 +11,20 @@ import * as i1 from "@progress/kendo-angular-l10n";
|
|
|
11
11
|
* @hidden
|
|
12
12
|
*/
|
|
13
13
|
export class LocalizedMessagesDirective extends Messages {
|
|
14
|
+
service;
|
|
14
15
|
constructor(service) {
|
|
15
16
|
super();
|
|
16
17
|
this.service = service;
|
|
17
18
|
}
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizedMessagesDirective, deps: [{ token: i1.LocalizationService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
20
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: LocalizedMessagesDirective, isStandalone: true, selector: "\n [kendoLabelLocalizedMessages],\n [kendoFloatingLabelLocalizedMessages]\n ", providers: [
|
|
21
|
+
{
|
|
22
|
+
provide: Messages,
|
|
23
|
+
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
24
|
+
}
|
|
25
|
+
], usesInheritance: true, ngImport: i0 });
|
|
18
26
|
}
|
|
19
|
-
|
|
20
|
-
LocalizedMessagesDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: LocalizedMessagesDirective, isStandalone: true, selector: "\n [kendoLabelLocalizedMessages],\n [kendoFloatingLabelLocalizedMessages]\n ", providers: [
|
|
21
|
-
{
|
|
22
|
-
provide: Messages,
|
|
23
|
-
useExisting: forwardRef(() => LocalizedMessagesDirective)
|
|
24
|
-
}
|
|
25
|
-
], usesInheritance: true, ngImport: i0 });
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: LocalizedMessagesDirective, decorators: [{
|
|
27
28
|
type: Directive,
|
|
28
29
|
args: [{
|
|
29
30
|
providers: [
|
|
@@ -9,10 +9,14 @@ import * as i0 from "@angular/core";
|
|
|
9
9
|
* @hidden
|
|
10
10
|
*/
|
|
11
11
|
export class Messages extends ComponentMessages {
|
|
12
|
+
/**
|
|
13
|
+
* The optional text.
|
|
14
|
+
*/
|
|
15
|
+
optional;
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Messages, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
17
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: Messages, selector: "kendo-label-messages-base", inputs: { optional: "optional" }, usesInheritance: true, ngImport: i0 });
|
|
12
18
|
}
|
|
13
|
-
|
|
14
|
-
Messages.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: Messages, selector: "kendo-label-messages-base", inputs: { optional: "optional" }, usesInheritance: true, ngImport: i0 });
|
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: Messages, decorators: [{
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: Messages, decorators: [{
|
|
16
20
|
type: Directive,
|
|
17
21
|
args: [{
|
|
18
22
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
@@ -9,7 +9,7 @@ export const packageMetadata = {
|
|
|
9
9
|
name: '@progress/kendo-angular-label',
|
|
10
10
|
productName: 'Kendo UI for Angular',
|
|
11
11
|
productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
|
|
12
|
-
publishDate:
|
|
13
|
-
version: '17.0.0
|
|
12
|
+
publishDate: 1731413991,
|
|
13
|
+
version: '17.0.0',
|
|
14
14
|
licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/'
|
|
15
15
|
};
|