@ni/nimble-angular 1.0.0-beta.124 → 1.0.0-beta.128
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/bundles/ni-nimble-angular.umd.js +636 -373
- package/bundles/ni-nimble-angular.umd.js.map +1 -1
- package/directives/button/nimble-button.directive.d.ts +9 -2
- package/directives/drawer/nimble-drawer.directive.d.ts +11 -7
- package/directives/listbox-option/nimble-listbox-option.directive.d.ts +6 -3
- package/directives/menu-item/nimble-menu-item.directive.d.ts +7 -1
- package/directives/{control-value-accessor/nimble-number-control-value-accessor.directive.d.ts → number-field/nimble-number-field-control-value-accessor.directive.d.ts} +1 -1
- package/directives/number-field/nimble-number-field.directive.d.ts +15 -5
- package/directives/tab/nimble-tab.directive.d.ts +7 -1
- package/directives/tabs/nimble-tabs.directive.d.ts +7 -5
- package/directives/{control-value-accessor/nimble-default-control-value-accessor.directive.d.ts → text-field/nimble-text-field-control-value-accessor.directive.d.ts} +1 -1
- package/directives/text-field/nimble-text-field.directive.d.ts +7 -1
- package/directives/theme-provider/nimble-theme-provider.directive.d.ts +7 -1
- package/directives/tree-item/nimble-tree-item.directive.d.ts +11 -7
- package/directives/tree-view/nimble-tree-view.directive.d.ts +6 -1
- package/directives/utilities/template-value-helpers.d.ts +18 -0
- package/esm2015/directives/button/nimble-button.directive.js +25 -4
- package/esm2015/directives/button/nimble-button.directive.ngsummary.json +1 -1
- package/esm2015/directives/drawer/nimble-drawer.directive.js +29 -13
- package/esm2015/directives/drawer/nimble-drawer.directive.ngsummary.json +1 -1
- package/esm2015/directives/listbox-option/nimble-listbox-option.directive.js +15 -6
- package/esm2015/directives/listbox-option/nimble-listbox-option.directive.ngsummary.json +1 -1
- package/esm2015/directives/menu-item/nimble-menu-item.directive.js +18 -3
- package/esm2015/directives/menu-item/nimble-menu-item.directive.ngsummary.json +1 -1
- package/esm2015/directives/number-field/nimble-number-field-control-value-accessor.directive.js +24 -0
- package/esm2015/directives/{control-value-accessor/nimble-number-control-value-accessor.directive.ngsummary.json → number-field/nimble-number-field-control-value-accessor.directive.ngsummary.json} +1 -1
- package/esm2015/directives/number-field/nimble-number-field.directive.js +46 -7
- package/esm2015/directives/number-field/nimble-number-field.directive.ngsummary.json +1 -1
- package/esm2015/directives/number-field/nimble-number-field.module.js +5 -6
- package/esm2015/directives/number-field/nimble-number-field.module.ngfactory.js +2 -3
- package/esm2015/directives/number-field/nimble-number-field.module.ngsummary.json +1 -1
- package/esm2015/directives/tab/nimble-tab.directive.js +18 -3
- package/esm2015/directives/tab/nimble-tab.directive.ngsummary.json +1 -1
- package/esm2015/directives/tabs/nimble-tabs.directive.js +18 -8
- package/esm2015/directives/tabs/nimble-tabs.directive.ngsummary.json +1 -1
- package/esm2015/directives/text-field/nimble-text-field-control-value-accessor.directive.js +29 -0
- package/esm2015/directives/{control-value-accessor/nimble-default-control-value-accessor.directive.ngsummary.json → text-field/nimble-text-field-control-value-accessor.directive.ngsummary.json} +1 -1
- package/esm2015/directives/text-field/nimble-text-field.directive.js +18 -3
- package/esm2015/directives/text-field/nimble-text-field.directive.ngsummary.json +1 -1
- package/esm2015/directives/text-field/nimble-text-field.module.js +5 -6
- package/esm2015/directives/text-field/nimble-text-field.module.ngfactory.js +2 -3
- package/esm2015/directives/text-field/nimble-text-field.module.ngsummary.json +1 -1
- package/esm2015/directives/theme-provider/nimble-theme-provider.directive.js +17 -3
- package/esm2015/directives/theme-provider/nimble-theme-provider.directive.ngsummary.json +1 -1
- package/esm2015/directives/tree-item/nimble-tree-item.directive.js +32 -12
- package/esm2015/directives/tree-item/nimble-tree-item.directive.ngsummary.json +1 -1
- package/esm2015/directives/tree-view/nimble-tree-view.directive.js +17 -3
- package/esm2015/directives/tree-view/nimble-tree-view.directive.ngsummary.json +1 -1
- package/esm2015/directives/utilities/template-value-helpers.js +32 -0
- package/esm2015/directives/utilities/template-value-helpers.ngsummary.json +1 -0
- package/esm2015/ni-nimble-angular.ngsummary.json +1 -1
- package/esm2015/public-api.js +37 -18
- package/esm2015/public-api.ngsummary.json +1 -1
- package/fesm2015/ni-nimble-angular.js +497 -297
- package/fesm2015/ni-nimble-angular.js.map +1 -1
- package/ni-nimble-angular.metadata.json +1 -1
- package/package.json +2 -2
- package/public-api.d.ts +36 -17
- package/directives/button/index.d.ts +0 -2
- package/directives/checkbox/index.d.ts +0 -3
- package/directives/control-value-accessor/index.d.ts +0 -3
- package/directives/control-value-accessor/nimble-control-value-accessor.module.d.ts +0 -2
- package/directives/control-value-accessor/nimble-control-value-accessor.module.ngfactory.d.ts +0 -3
- package/directives/drawer/index.d.ts +0 -2
- package/directives/listbox-option/index.d.ts +0 -2
- package/directives/menu/index.d.ts +0 -2
- package/directives/menu-item/index.d.ts +0 -2
- package/directives/number-field/index.d.ts +0 -2
- package/directives/select/index.d.ts +0 -3
- package/directives/tab/index.d.ts +0 -2
- package/directives/tab-panel/index.d.ts +0 -2
- package/directives/tabs/index.d.ts +0 -2
- package/directives/tabs-toolbar/index.d.ts +0 -2
- package/directives/text-field/index.d.ts +0 -2
- package/directives/theme-provider/index.d.ts +0 -2
- package/directives/tree-item/index.d.ts +0 -2
- package/directives/tree-view/index.d.ts +0 -2
- package/esm2015/directives/button/index.js +0 -3
- package/esm2015/directives/button/index.ngsummary.json +0 -1
- package/esm2015/directives/checkbox/index.js +0 -4
- package/esm2015/directives/checkbox/index.ngsummary.json +0 -1
- package/esm2015/directives/control-value-accessor/index.js +0 -4
- package/esm2015/directives/control-value-accessor/index.ngsummary.json +0 -1
- package/esm2015/directives/control-value-accessor/nimble-control-value-accessor.module.js +0 -14
- package/esm2015/directives/control-value-accessor/nimble-control-value-accessor.module.ngfactory.js +0 -12
- package/esm2015/directives/control-value-accessor/nimble-control-value-accessor.module.ngsummary.json +0 -1
- package/esm2015/directives/control-value-accessor/nimble-default-control-value-accessor.directive.js +0 -29
- package/esm2015/directives/control-value-accessor/nimble-number-control-value-accessor.directive.js +0 -24
- package/esm2015/directives/drawer/index.js +0 -3
- package/esm2015/directives/drawer/index.ngsummary.json +0 -1
- package/esm2015/directives/listbox-option/index.js +0 -3
- package/esm2015/directives/listbox-option/index.ngsummary.json +0 -1
- package/esm2015/directives/menu/index.js +0 -3
- package/esm2015/directives/menu/index.ngsummary.json +0 -1
- package/esm2015/directives/menu-item/index.js +0 -3
- package/esm2015/directives/menu-item/index.ngsummary.json +0 -1
- package/esm2015/directives/number-field/index.js +0 -3
- package/esm2015/directives/number-field/index.ngsummary.json +0 -1
- package/esm2015/directives/select/index.js +0 -4
- package/esm2015/directives/select/index.ngsummary.json +0 -1
- package/esm2015/directives/tab/index.js +0 -3
- package/esm2015/directives/tab/index.ngsummary.json +0 -1
- package/esm2015/directives/tab-panel/index.js +0 -3
- package/esm2015/directives/tab-panel/index.ngsummary.json +0 -1
- package/esm2015/directives/tabs/index.js +0 -3
- package/esm2015/directives/tabs/index.ngsummary.json +0 -1
- package/esm2015/directives/tabs-toolbar/index.js +0 -3
- package/esm2015/directives/tabs-toolbar/index.ngsummary.json +0 -1
- package/esm2015/directives/text-field/index.js +0 -3
- package/esm2015/directives/text-field/index.ngsummary.json +0 -1
- package/esm2015/directives/theme-provider/index.js +0 -3
- package/esm2015/directives/theme-provider/index.ngsummary.json +0 -1
- package/esm2015/directives/tree-item/index.js +0 -3
- package/esm2015/directives/tree-item/index.ngsummary.json +0 -1
- package/esm2015/directives/tree-view/index.js +0 -3
- package/esm2015/directives/tree-view/index.ngsummary.json +0 -1
|
@@ -1,172 +1,210 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, Renderer2, ElementRef, Input, NgModule, forwardRef, EventEmitter, Output, HostListener, Optional, Host } from '@angular/core';
|
|
2
2
|
import { CommonModule } from '@angular/common';
|
|
3
|
-
export { NimbleTheme } from '@ni/nimble-components/dist/esm/theme-provider/themes';
|
|
4
|
-
import '@ni/nimble-components/dist/esm/theme-provider';
|
|
5
|
-
import { DefaultValueAccessor, NG_VALUE_ACCESSOR, NumberValueAccessor, SelectControlValueAccessor, NgSelectOption, CheckboxControlValueAccessor } from '@angular/forms';
|
|
6
|
-
import '@ni/nimble-components/dist/esm/text-field';
|
|
7
|
-
import '@ni/nimble-components/dist/esm/number-field';
|
|
8
|
-
import '@ni/nimble-components/dist/esm/select';
|
|
9
|
-
import '@ni/nimble-components/dist/esm/listbox-option';
|
|
10
3
|
import '@ni/nimble-components/dist/esm/button';
|
|
11
|
-
import '@
|
|
12
|
-
export { SelectionMode } from '@ni/nimble-components/dist/esm/tree-view/types';
|
|
13
|
-
import '@ni/nimble-components/dist/esm/tree-item';
|
|
4
|
+
import { CheckboxControlValueAccessor, NG_VALUE_ACCESSOR, SelectControlValueAccessor, NgSelectOption, NumberValueAccessor, DefaultValueAccessor } from '@angular/forms';
|
|
14
5
|
import '@ni/nimble-components/dist/esm/checkbox';
|
|
15
6
|
import '@ni/nimble-components/dist/esm/drawer';
|
|
16
|
-
import {
|
|
7
|
+
import { DrawerState } from '@ni/nimble-components/dist/esm/drawer/types';
|
|
17
8
|
export { DrawerLocation, DrawerState } from '@ni/nimble-components/dist/esm/drawer/types';
|
|
9
|
+
import '@ni/nimble-components/dist/esm/listbox-option';
|
|
18
10
|
import '@ni/nimble-components/dist/esm/menu';
|
|
19
11
|
import '@ni/nimble-components/dist/esm/menu-item';
|
|
20
|
-
import '@ni/nimble-components/dist/esm/
|
|
12
|
+
import '@ni/nimble-components/dist/esm/number-field';
|
|
13
|
+
import '@ni/nimble-components/dist/esm/select';
|
|
21
14
|
import '@ni/nimble-components/dist/esm/tab';
|
|
22
15
|
import '@ni/nimble-components/dist/esm/tab-panel';
|
|
16
|
+
import '@ni/nimble-components/dist/esm/tabs';
|
|
23
17
|
import '@ni/nimble-components/dist/esm/tabs-toolbar';
|
|
18
|
+
import '@ni/nimble-components/dist/esm/text-field';
|
|
19
|
+
export { NimbleTheme } from '@ni/nimble-components/dist/esm/theme-provider/themes';
|
|
20
|
+
import '@ni/nimble-components/dist/esm/theme-provider';
|
|
21
|
+
import '@ni/nimble-components/dist/esm/tree-item';
|
|
22
|
+
import '@ni/nimble-components/dist/esm/tree-view';
|
|
23
|
+
export { SelectionMode } from '@ni/nimble-components/dist/esm/tree-view/types';
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Conversion helpers for values coming from Angular templates via
|
|
27
|
+
* strings specified in templates or via property bindings
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Converts values from templates (empty string or null) or boolean bindings to a boolean property representation
|
|
31
|
+
*/
|
|
32
|
+
const toBooleanProperty = (value) => {
|
|
33
|
+
if (value === false || value === null) {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
// For boolean attributes the empty string value is true
|
|
37
|
+
return true;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Converts values from templates (empty string or null) or boolean bindings to an Aria boolean
|
|
41
|
+
* attribute representation (the strings "true" or "false")
|
|
42
|
+
*/
|
|
43
|
+
const toBooleanAriaAttribute = (value) => {
|
|
44
|
+
if (value === false || value === null) {
|
|
45
|
+
return 'false';
|
|
46
|
+
}
|
|
47
|
+
// For boolean attributes the empty string value is true
|
|
48
|
+
return 'true';
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Converts values from templates (number representation as a string) or number bindings to a number property representation
|
|
52
|
+
*/
|
|
53
|
+
const toNumberProperty = (value) => {
|
|
54
|
+
return Number(value);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Directive to provide Angular integration for the button.
|
|
59
|
+
*/
|
|
60
|
+
class NimbleButtonDirective {
|
|
61
|
+
constructor(renderer, elementRef) {
|
|
62
|
+
this.renderer = renderer;
|
|
63
|
+
this.elementRef = elementRef;
|
|
64
|
+
}
|
|
65
|
+
get appearance() {
|
|
66
|
+
return this.elementRef.nativeElement.appearance;
|
|
67
|
+
}
|
|
68
|
+
set appearance(value) {
|
|
69
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'appearance', value);
|
|
70
|
+
}
|
|
71
|
+
get disabled() {
|
|
72
|
+
return this.elementRef.nativeElement.disabled;
|
|
73
|
+
}
|
|
74
|
+
set disabled(value) {
|
|
75
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
76
|
+
}
|
|
29
77
|
}
|
|
30
|
-
|
|
78
|
+
NimbleButtonDirective.decorators = [
|
|
31
79
|
{ type: Directive, args: [{
|
|
32
|
-
selector: 'nimble-
|
|
80
|
+
selector: 'nimble-button'
|
|
33
81
|
},] }
|
|
34
82
|
];
|
|
35
|
-
|
|
36
|
-
|
|
83
|
+
NimbleButtonDirective.ctorParameters = () => [
|
|
84
|
+
{ type: Renderer2 },
|
|
85
|
+
{ type: ElementRef }
|
|
86
|
+
];
|
|
87
|
+
NimbleButtonDirective.propDecorators = {
|
|
88
|
+
appearance: [{ type: Input }],
|
|
89
|
+
disabled: [{ type: Input }]
|
|
37
90
|
};
|
|
38
91
|
|
|
39
|
-
class
|
|
92
|
+
class NimbleButtonModule {
|
|
40
93
|
}
|
|
41
|
-
|
|
94
|
+
NimbleButtonModule.decorators = [
|
|
42
95
|
{ type: NgModule, args: [{
|
|
43
|
-
declarations: [
|
|
96
|
+
declarations: [NimbleButtonDirective],
|
|
44
97
|
imports: [CommonModule],
|
|
45
|
-
exports: [
|
|
46
|
-
},] }
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Directive to provide Angular integration for the text field
|
|
51
|
-
*/
|
|
52
|
-
class NimbleTextFieldDirective {
|
|
53
|
-
}
|
|
54
|
-
NimbleTextFieldDirective.decorators = [
|
|
55
|
-
{ type: Directive, args: [{
|
|
56
|
-
selector: 'nimble-text-field'
|
|
98
|
+
exports: [NimbleButtonDirective]
|
|
57
99
|
},] }
|
|
58
100
|
];
|
|
59
|
-
NimbleTextFieldDirective.propDecorators = {
|
|
60
|
-
readonly: [{ type: HostBinding, args: ['attr.readonly',] }, { type: Input }]
|
|
61
|
-
};
|
|
62
101
|
|
|
63
102
|
/**
|
|
64
|
-
* Extension of Angular's
|
|
103
|
+
* Extension of Angular's CheckboxControlValueAccessor to target the Nimble checkbox control.
|
|
65
104
|
*
|
|
66
|
-
* Directive decorator based on
|
|
67
|
-
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/
|
|
105
|
+
* Directive decorator based on CheckboxControlValueAccessor decorator
|
|
106
|
+
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/checkbox_value_accessor.ts#L42
|
|
68
107
|
*/
|
|
69
|
-
class
|
|
108
|
+
class NimbleCheckboxControlValueAccessorDirective extends CheckboxControlValueAccessor {
|
|
70
109
|
}
|
|
71
|
-
|
|
110
|
+
NimbleCheckboxControlValueAccessorDirective.decorators = [
|
|
72
111
|
{ type: Directive, args: [{
|
|
73
|
-
selector: 'nimble-
|
|
74
|
-
// The following host metadata is duplicated from
|
|
112
|
+
selector: 'nimble-checkbox[formControlName],nimble-checkbox[formControl],nimble-checkbox[ngModel]',
|
|
113
|
+
// The following host metadata is duplicated from CheckboxControlValueAccessor
|
|
75
114
|
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
76
|
-
host: {
|
|
77
|
-
'(input)': '$any(this)._handleInput($event.target.value)',
|
|
78
|
-
'(blur)': 'onTouched()',
|
|
79
|
-
'(compositionstart)': '$any(this)._compositionStart()',
|
|
80
|
-
'(compositionend)': '$any(this)._compositionEnd($event.target.value)'
|
|
81
|
-
},
|
|
115
|
+
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
|
|
82
116
|
providers: [{
|
|
83
117
|
provide: NG_VALUE_ACCESSOR,
|
|
84
|
-
useExisting: forwardRef(() =>
|
|
118
|
+
useExisting: forwardRef(() => NimbleCheckboxControlValueAccessorDirective),
|
|
85
119
|
multi: true
|
|
86
120
|
}]
|
|
87
121
|
},] }
|
|
88
122
|
];
|
|
89
123
|
|
|
90
124
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* Directive decorator based on NumberValueAccessor decorator
|
|
94
|
-
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/number_value_accessor.ts#L43
|
|
125
|
+
* Directive to provide Angular integration for the checkbox.
|
|
95
126
|
*/
|
|
96
|
-
class
|
|
127
|
+
class NimbleCheckboxDirective {
|
|
97
128
|
}
|
|
98
|
-
|
|
129
|
+
NimbleCheckboxDirective.decorators = [
|
|
99
130
|
{ type: Directive, args: [{
|
|
100
|
-
selector: 'nimble-
|
|
101
|
-
// The following host metadata is duplicated from NumberValueAccessor
|
|
102
|
-
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
103
|
-
host: { '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
|
|
104
|
-
providers: [{
|
|
105
|
-
provide: NG_VALUE_ACCESSOR,
|
|
106
|
-
useExisting: forwardRef(() => NimbleNumberControlValueAccessorDirective),
|
|
107
|
-
multi: true
|
|
108
|
-
}]
|
|
131
|
+
selector: 'nimble-checkbox'
|
|
109
132
|
},] }
|
|
110
133
|
];
|
|
111
134
|
|
|
112
|
-
class
|
|
135
|
+
class NimbleCheckboxModule {
|
|
113
136
|
}
|
|
114
|
-
|
|
137
|
+
NimbleCheckboxModule.decorators = [
|
|
115
138
|
{ type: NgModule, args: [{
|
|
116
|
-
declarations: [
|
|
139
|
+
declarations: [NimbleCheckboxDirective, NimbleCheckboxControlValueAccessorDirective],
|
|
117
140
|
imports: [CommonModule],
|
|
118
|
-
exports: [
|
|
119
|
-
},] }
|
|
120
|
-
];
|
|
121
|
-
|
|
122
|
-
class NimbleTextFieldModule {
|
|
123
|
-
}
|
|
124
|
-
NimbleTextFieldModule.decorators = [
|
|
125
|
-
{ type: NgModule, args: [{
|
|
126
|
-
declarations: [NimbleTextFieldDirective],
|
|
127
|
-
imports: [CommonModule, NimbleControlValueAccessorModule],
|
|
128
|
-
providers: [],
|
|
129
|
-
exports: [NimbleTextFieldDirective, NimbleControlValueAccessorModule]
|
|
141
|
+
exports: [NimbleCheckboxDirective, NimbleCheckboxControlValueAccessorDirective]
|
|
130
142
|
},] }
|
|
131
143
|
];
|
|
132
144
|
|
|
133
145
|
/**
|
|
134
|
-
* Directive to provide Angular integration for the
|
|
146
|
+
* Directive to provide Angular integration for the drawer.
|
|
135
147
|
*/
|
|
136
|
-
class
|
|
148
|
+
class NimbleDrawerDirective {
|
|
149
|
+
constructor(renderer, elementRef) {
|
|
150
|
+
this.renderer = renderer;
|
|
151
|
+
this.elementRef = elementRef;
|
|
152
|
+
this.stateChange = new EventEmitter();
|
|
153
|
+
}
|
|
154
|
+
get location() {
|
|
155
|
+
return this.elementRef.nativeElement.location;
|
|
156
|
+
}
|
|
157
|
+
set location(value) {
|
|
158
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'location', value);
|
|
159
|
+
}
|
|
160
|
+
get state() {
|
|
161
|
+
return this.elementRef.nativeElement.state;
|
|
162
|
+
}
|
|
163
|
+
set state(value) {
|
|
164
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'state', value);
|
|
165
|
+
}
|
|
166
|
+
get modal() {
|
|
167
|
+
return this.elementRef.nativeElement.modal;
|
|
168
|
+
}
|
|
169
|
+
set modal(value) {
|
|
170
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'modal', toBooleanProperty(value));
|
|
171
|
+
}
|
|
172
|
+
show() {
|
|
173
|
+
this.state = DrawerState.Opening;
|
|
174
|
+
}
|
|
175
|
+
hide() {
|
|
176
|
+
this.state = DrawerState.Closing;
|
|
177
|
+
}
|
|
178
|
+
onStateChanged($event) {
|
|
179
|
+
if ($event.target === this.elementRef.nativeElement) {
|
|
180
|
+
this.stateChange.emit(this.state);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
137
183
|
}
|
|
138
|
-
|
|
184
|
+
NimbleDrawerDirective.decorators = [
|
|
139
185
|
{ type: Directive, args: [{
|
|
140
|
-
selector: 'nimble-
|
|
186
|
+
selector: 'nimble-drawer'
|
|
141
187
|
},] }
|
|
142
188
|
];
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
189
|
+
NimbleDrawerDirective.ctorParameters = () => [
|
|
190
|
+
{ type: Renderer2 },
|
|
191
|
+
{ type: ElementRef }
|
|
192
|
+
];
|
|
193
|
+
NimbleDrawerDirective.propDecorators = {
|
|
194
|
+
location: [{ type: Input }],
|
|
195
|
+
state: [{ type: Input }],
|
|
196
|
+
modal: [{ type: Input }],
|
|
197
|
+
stateChange: [{ type: Output }],
|
|
198
|
+
onStateChanged: [{ type: HostListener, args: ['state-change', ['$event'],] }]
|
|
149
199
|
};
|
|
150
200
|
|
|
151
|
-
class
|
|
201
|
+
class NimbleDrawerModule {
|
|
152
202
|
}
|
|
153
|
-
|
|
203
|
+
NimbleDrawerModule.decorators = [
|
|
154
204
|
{ type: NgModule, args: [{
|
|
155
|
-
declarations: [
|
|
156
|
-
imports: [CommonModule
|
|
157
|
-
|
|
158
|
-
exports: [NimbleNumberFieldDirective, NimbleControlValueAccessorModule]
|
|
159
|
-
},] }
|
|
160
|
-
];
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Directive for Nimble select control Angular integration
|
|
164
|
-
*/
|
|
165
|
-
class NimbleSelectDirective {
|
|
166
|
-
}
|
|
167
|
-
NimbleSelectDirective.decorators = [
|
|
168
|
-
{ type: Directive, args: [{
|
|
169
|
-
selector: 'nimble-select',
|
|
205
|
+
declarations: [NimbleDrawerDirective],
|
|
206
|
+
imports: [CommonModule],
|
|
207
|
+
exports: [NimbleDrawerDirective]
|
|
170
208
|
},] }
|
|
171
209
|
];
|
|
172
210
|
|
|
@@ -194,22 +232,20 @@ NimbleSelectControlValueAccessorDirective.decorators = [
|
|
|
194
232
|
},] }
|
|
195
233
|
];
|
|
196
234
|
|
|
197
|
-
class NimbleSelectModule {
|
|
198
|
-
}
|
|
199
|
-
NimbleSelectModule.decorators = [
|
|
200
|
-
{ type: NgModule, args: [{
|
|
201
|
-
declarations: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective],
|
|
202
|
-
imports: [CommonModule],
|
|
203
|
-
exports: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective]
|
|
204
|
-
},] }
|
|
205
|
-
];
|
|
206
|
-
|
|
207
235
|
/**
|
|
208
236
|
* Directive to provide Angular integration for the listbox option.
|
|
209
237
|
*/
|
|
210
238
|
class NimbleListboxOptionDirective extends NgSelectOption {
|
|
211
|
-
constructor(
|
|
212
|
-
super(
|
|
239
|
+
constructor(elementRef, renderer, select) {
|
|
240
|
+
super(elementRef, renderer, select);
|
|
241
|
+
this.elementRef = elementRef;
|
|
242
|
+
this.renderer = renderer;
|
|
243
|
+
}
|
|
244
|
+
get disabled() {
|
|
245
|
+
return this.elementRef.nativeElement.disabled;
|
|
246
|
+
}
|
|
247
|
+
set disabled(value) {
|
|
248
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
213
249
|
}
|
|
214
250
|
}
|
|
215
251
|
NimbleListboxOptionDirective.decorators = [
|
|
@@ -223,7 +259,7 @@ NimbleListboxOptionDirective.ctorParameters = () => [
|
|
|
223
259
|
{ type: NimbleSelectControlValueAccessorDirective, decorators: [{ type: Optional }, { type: Host }] }
|
|
224
260
|
];
|
|
225
261
|
NimbleListboxOptionDirective.propDecorators = {
|
|
226
|
-
disabled: [{ type:
|
|
262
|
+
disabled: [{ type: Input }]
|
|
227
263
|
};
|
|
228
264
|
|
|
229
265
|
class NimbleListboxOptionModule {
|
|
@@ -237,335 +273,499 @@ NimbleListboxOptionModule.decorators = [
|
|
|
237
273
|
];
|
|
238
274
|
|
|
239
275
|
/**
|
|
240
|
-
* Directive to provide Angular integration for the
|
|
276
|
+
* Directive to provide Angular integration for the menu.
|
|
241
277
|
*/
|
|
242
|
-
class
|
|
278
|
+
class NimbleMenuDirective {
|
|
243
279
|
}
|
|
244
|
-
|
|
280
|
+
NimbleMenuDirective.decorators = [
|
|
245
281
|
{ type: Directive, args: [{
|
|
246
|
-
selector: 'nimble-
|
|
282
|
+
selector: 'nimble-menu'
|
|
247
283
|
},] }
|
|
248
284
|
];
|
|
249
|
-
NimbleButtonDirective.propDecorators = {
|
|
250
|
-
disabled: [{ type: HostBinding, args: ['disabled',] }, { type: Input }],
|
|
251
|
-
appearance: [{ type: HostBinding, args: ['appearance',] }, { type: Input }]
|
|
252
|
-
};
|
|
253
285
|
|
|
254
|
-
class
|
|
286
|
+
class NimbleMenuModule {
|
|
255
287
|
}
|
|
256
|
-
|
|
288
|
+
NimbleMenuModule.decorators = [
|
|
257
289
|
{ type: NgModule, args: [{
|
|
258
|
-
declarations: [
|
|
290
|
+
declarations: [NimbleMenuDirective],
|
|
259
291
|
imports: [CommonModule],
|
|
260
|
-
exports: [
|
|
292
|
+
exports: [NimbleMenuDirective]
|
|
261
293
|
},] }
|
|
262
294
|
];
|
|
263
295
|
|
|
264
296
|
/**
|
|
265
|
-
* Directive to provide Angular integration for the
|
|
297
|
+
* Directive to provide Angular integration for the menu.
|
|
266
298
|
*/
|
|
267
|
-
class
|
|
299
|
+
class NimbleMenuItemDirective {
|
|
300
|
+
constructor(renderer, elementRef) {
|
|
301
|
+
this.renderer = renderer;
|
|
302
|
+
this.elementRef = elementRef;
|
|
303
|
+
}
|
|
304
|
+
get disabled() {
|
|
305
|
+
return this.elementRef.nativeElement.disabled;
|
|
306
|
+
}
|
|
307
|
+
set disabled(value) {
|
|
308
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
309
|
+
}
|
|
268
310
|
}
|
|
269
|
-
|
|
311
|
+
NimbleMenuItemDirective.decorators = [
|
|
270
312
|
{ type: Directive, args: [{
|
|
271
|
-
selector: 'nimble-
|
|
313
|
+
selector: 'nimble-menu-item'
|
|
272
314
|
},] }
|
|
273
315
|
];
|
|
274
|
-
|
|
275
|
-
|
|
316
|
+
NimbleMenuItemDirective.ctorParameters = () => [
|
|
317
|
+
{ type: Renderer2 },
|
|
318
|
+
{ type: ElementRef }
|
|
319
|
+
];
|
|
320
|
+
NimbleMenuItemDirective.propDecorators = {
|
|
321
|
+
disabled: [{ type: Input }]
|
|
276
322
|
};
|
|
277
323
|
|
|
278
|
-
class
|
|
324
|
+
class NimbleMenuItemModule {
|
|
279
325
|
}
|
|
280
|
-
|
|
326
|
+
NimbleMenuItemModule.decorators = [
|
|
281
327
|
{ type: NgModule, args: [{
|
|
282
|
-
declarations: [
|
|
328
|
+
declarations: [NimbleMenuItemDirective],
|
|
283
329
|
imports: [CommonModule],
|
|
284
|
-
exports: [
|
|
330
|
+
exports: [NimbleMenuItemDirective]
|
|
285
331
|
},] }
|
|
286
332
|
];
|
|
287
333
|
|
|
288
334
|
/**
|
|
289
|
-
*
|
|
335
|
+
* Extension of Angular's NumberValueAccessor to target the number-based inputs.
|
|
336
|
+
*
|
|
337
|
+
* Directive decorator based on NumberValueAccessor decorator
|
|
338
|
+
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/number_value_accessor.ts#L43
|
|
290
339
|
*/
|
|
291
|
-
class
|
|
292
|
-
constructor(treeItemReference) {
|
|
293
|
-
this.treeItemReference = treeItemReference;
|
|
294
|
-
this.expandedChange = new EventEmitter();
|
|
295
|
-
}
|
|
296
|
-
onExpandedChange($event) {
|
|
297
|
-
const treeItemElement = this.treeItemReference.nativeElement;
|
|
298
|
-
if ($event.target === treeItemElement) {
|
|
299
|
-
this.expanded = treeItemElement.expanded;
|
|
300
|
-
this.expandedChange.emit(treeItemElement.expanded);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
340
|
+
class NimbleNumberFieldControlValueAccessorDirective extends NumberValueAccessor {
|
|
303
341
|
}
|
|
304
|
-
|
|
342
|
+
NimbleNumberFieldControlValueAccessorDirective.decorators = [
|
|
305
343
|
{ type: Directive, args: [{
|
|
306
|
-
selector: 'nimble-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
selected: [{ type: HostBinding, args: ['selected',] }, { type: HostBinding, args: ['attr.aria-selected', // Needed because fast-foundation TreeView sets initial selection with an aria-selected query
|
|
316
|
-
] }, { type: Input }],
|
|
317
|
-
expandedChange: [{ type: Output }],
|
|
318
|
-
onExpandedChange: [{ type: HostListener, args: ['expanded-change', ['$event'],] }]
|
|
319
|
-
};
|
|
320
|
-
|
|
321
|
-
class NimbleTreeItemModule {
|
|
322
|
-
}
|
|
323
|
-
NimbleTreeItemModule.decorators = [
|
|
324
|
-
{ type: NgModule, args: [{
|
|
325
|
-
declarations: [NimbleTreeItemDirective],
|
|
326
|
-
imports: [CommonModule],
|
|
327
|
-
exports: [NimbleTreeItemDirective]
|
|
344
|
+
selector: 'nimble-number-field[formControlName],nimble-number-field[formControl],nimble-number-field[ngModel]',
|
|
345
|
+
// The following host metadata is duplicated from NumberValueAccessor
|
|
346
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
347
|
+
host: { '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
|
|
348
|
+
providers: [{
|
|
349
|
+
provide: NG_VALUE_ACCESSOR,
|
|
350
|
+
useExisting: forwardRef(() => NimbleNumberFieldControlValueAccessorDirective),
|
|
351
|
+
multi: true
|
|
352
|
+
}]
|
|
328
353
|
},] }
|
|
329
354
|
];
|
|
330
355
|
|
|
331
356
|
/**
|
|
332
|
-
* Directive to provide Angular integration for the
|
|
357
|
+
* Directive to provide Angular integration for the number field.
|
|
333
358
|
*/
|
|
334
|
-
class
|
|
359
|
+
class NimbleNumberFieldDirective {
|
|
360
|
+
constructor(renderer, elementRef) {
|
|
361
|
+
this.renderer = renderer;
|
|
362
|
+
this.elementRef = elementRef;
|
|
363
|
+
}
|
|
364
|
+
get readOnly() {
|
|
365
|
+
return this.elementRef.nativeElement.readOnly;
|
|
366
|
+
}
|
|
367
|
+
set readOnly(value) {
|
|
368
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'readOnly', toBooleanProperty(value));
|
|
369
|
+
}
|
|
370
|
+
get min() {
|
|
371
|
+
return this.elementRef.nativeElement.min;
|
|
372
|
+
}
|
|
373
|
+
set min(value) {
|
|
374
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'min', toNumberProperty(value));
|
|
375
|
+
}
|
|
376
|
+
get max() {
|
|
377
|
+
return this.elementRef.nativeElement.max;
|
|
378
|
+
}
|
|
379
|
+
set max(value) {
|
|
380
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'max', toNumberProperty(value));
|
|
381
|
+
}
|
|
382
|
+
get step() {
|
|
383
|
+
return this.elementRef.nativeElement.step;
|
|
384
|
+
}
|
|
385
|
+
set step(value) {
|
|
386
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'step', toNumberProperty(value));
|
|
387
|
+
}
|
|
388
|
+
get placeholder() {
|
|
389
|
+
return this.elementRef.nativeElement.placeholder;
|
|
390
|
+
}
|
|
391
|
+
set placeholder(value) {
|
|
392
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'placeholder', value);
|
|
393
|
+
}
|
|
335
394
|
}
|
|
336
|
-
|
|
395
|
+
NimbleNumberFieldDirective.decorators = [
|
|
337
396
|
{ type: Directive, args: [{
|
|
338
|
-
selector: 'nimble-
|
|
397
|
+
selector: 'nimble-number-field'
|
|
398
|
+
},] }
|
|
399
|
+
];
|
|
400
|
+
NimbleNumberFieldDirective.ctorParameters = () => [
|
|
401
|
+
{ type: Renderer2 },
|
|
402
|
+
{ type: ElementRef }
|
|
403
|
+
];
|
|
404
|
+
NimbleNumberFieldDirective.propDecorators = {
|
|
405
|
+
readOnly: [{ type: Input }],
|
|
406
|
+
min: [{ type: Input }],
|
|
407
|
+
max: [{ type: Input }],
|
|
408
|
+
step: [{ type: Input }],
|
|
409
|
+
placeholder: [{ type: Input }]
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
class NimbleNumberFieldModule {
|
|
413
|
+
}
|
|
414
|
+
NimbleNumberFieldModule.decorators = [
|
|
415
|
+
{ type: NgModule, args: [{
|
|
416
|
+
declarations: [NimbleNumberFieldDirective, NimbleNumberFieldControlValueAccessorDirective],
|
|
417
|
+
imports: [CommonModule],
|
|
418
|
+
exports: [NimbleNumberFieldDirective, NimbleNumberFieldControlValueAccessorDirective]
|
|
339
419
|
},] }
|
|
340
420
|
];
|
|
341
421
|
|
|
342
422
|
/**
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* Directive decorator based on CheckboxControlValueAccessor decorator
|
|
346
|
-
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/checkbox_value_accessor.ts#L42
|
|
423
|
+
* Directive for Nimble select control Angular integration
|
|
347
424
|
*/
|
|
348
|
-
class
|
|
425
|
+
class NimbleSelectDirective {
|
|
349
426
|
}
|
|
350
|
-
|
|
427
|
+
NimbleSelectDirective.decorators = [
|
|
351
428
|
{ type: Directive, args: [{
|
|
352
|
-
selector: 'nimble-
|
|
353
|
-
// The following host metadata is duplicated from CheckboxControlValueAccessor
|
|
354
|
-
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
355
|
-
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
|
|
356
|
-
providers: [{
|
|
357
|
-
provide: NG_VALUE_ACCESSOR,
|
|
358
|
-
useExisting: forwardRef(() => NimbleCheckboxControlValueAccessorDirective),
|
|
359
|
-
multi: true
|
|
360
|
-
}]
|
|
429
|
+
selector: 'nimble-select',
|
|
361
430
|
},] }
|
|
362
431
|
];
|
|
363
432
|
|
|
364
|
-
class
|
|
433
|
+
class NimbleSelectModule {
|
|
365
434
|
}
|
|
366
|
-
|
|
435
|
+
NimbleSelectModule.decorators = [
|
|
367
436
|
{ type: NgModule, args: [{
|
|
368
|
-
declarations: [
|
|
437
|
+
declarations: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective],
|
|
369
438
|
imports: [CommonModule],
|
|
370
|
-
exports: [
|
|
439
|
+
exports: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective]
|
|
371
440
|
},] }
|
|
372
441
|
];
|
|
373
442
|
|
|
374
443
|
/**
|
|
375
|
-
* Directive to provide Angular integration for the
|
|
444
|
+
* Directive to provide Angular integration for the tab element.
|
|
376
445
|
*/
|
|
377
|
-
class
|
|
378
|
-
constructor(
|
|
379
|
-
this.
|
|
380
|
-
this.
|
|
381
|
-
this.state = DrawerState.Closed;
|
|
382
|
-
this.modal = true;
|
|
383
|
-
this.stateChange = new EventEmitter();
|
|
384
|
-
}
|
|
385
|
-
show() {
|
|
386
|
-
this.state = DrawerState.Opening;
|
|
446
|
+
class NimbleTabDirective {
|
|
447
|
+
constructor(renderer, elementRef) {
|
|
448
|
+
this.renderer = renderer;
|
|
449
|
+
this.elementRef = elementRef;
|
|
387
450
|
}
|
|
388
|
-
|
|
389
|
-
this.
|
|
451
|
+
get disabled() {
|
|
452
|
+
return this.elementRef.nativeElement.disabled;
|
|
390
453
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
if ($event.target === drawer) {
|
|
394
|
-
this.state = drawer.state;
|
|
395
|
-
this.stateChange.emit(this.state);
|
|
396
|
-
}
|
|
454
|
+
set disabled(value) {
|
|
455
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
397
456
|
}
|
|
398
457
|
}
|
|
399
|
-
|
|
458
|
+
NimbleTabDirective.decorators = [
|
|
400
459
|
{ type: Directive, args: [{
|
|
401
|
-
selector: 'nimble-
|
|
460
|
+
selector: 'nimble-tab'
|
|
402
461
|
},] }
|
|
403
462
|
];
|
|
404
|
-
|
|
463
|
+
NimbleTabDirective.ctorParameters = () => [
|
|
464
|
+
{ type: Renderer2 },
|
|
405
465
|
{ type: ElementRef }
|
|
406
466
|
];
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
state: [{ type: HostBinding, args: ['state',] }, { type: Input }],
|
|
410
|
-
modal: [{ type: HostBinding, args: ['modal',] }, { type: Input }],
|
|
411
|
-
stateChange: [{ type: Output }],
|
|
412
|
-
onStateChanged: [{ type: HostListener, args: ['state-change', ['$event'],] }]
|
|
467
|
+
NimbleTabDirective.propDecorators = {
|
|
468
|
+
disabled: [{ type: Input }]
|
|
413
469
|
};
|
|
414
470
|
|
|
415
|
-
class
|
|
471
|
+
class NimbleTabModule {
|
|
416
472
|
}
|
|
417
|
-
|
|
473
|
+
NimbleTabModule.decorators = [
|
|
418
474
|
{ type: NgModule, args: [{
|
|
419
|
-
declarations: [
|
|
475
|
+
declarations: [NimbleTabDirective],
|
|
420
476
|
imports: [CommonModule],
|
|
421
|
-
exports: [
|
|
477
|
+
exports: [NimbleTabDirective]
|
|
422
478
|
},] }
|
|
423
479
|
];
|
|
424
480
|
|
|
425
481
|
/**
|
|
426
|
-
* Directive to provide Angular integration for the
|
|
482
|
+
* Directive to provide Angular integration for the tab panel.
|
|
427
483
|
*/
|
|
428
|
-
class
|
|
484
|
+
class NimbleTabPanelDirective {
|
|
429
485
|
}
|
|
430
|
-
|
|
486
|
+
NimbleTabPanelDirective.decorators = [
|
|
431
487
|
{ type: Directive, args: [{
|
|
432
|
-
selector: 'nimble-
|
|
488
|
+
selector: 'nimble-tab-panel'
|
|
433
489
|
},] }
|
|
434
490
|
];
|
|
435
491
|
|
|
436
|
-
class
|
|
492
|
+
class NimbleTabPanelModule {
|
|
437
493
|
}
|
|
438
|
-
|
|
494
|
+
NimbleTabPanelModule.decorators = [
|
|
439
495
|
{ type: NgModule, args: [{
|
|
440
|
-
declarations: [
|
|
496
|
+
declarations: [NimbleTabPanelDirective],
|
|
441
497
|
imports: [CommonModule],
|
|
442
|
-
exports: [
|
|
498
|
+
exports: [NimbleTabPanelDirective]
|
|
443
499
|
},] }
|
|
444
500
|
];
|
|
445
501
|
|
|
446
502
|
/**
|
|
447
|
-
* Directive to provide Angular integration for the
|
|
503
|
+
* Directive to provide Angular integration for the tabs element.
|
|
448
504
|
*/
|
|
449
|
-
class
|
|
505
|
+
class NimbleTabsDirective {
|
|
506
|
+
constructor(renderer, elementRef) {
|
|
507
|
+
this.renderer = renderer;
|
|
508
|
+
this.elementRef = elementRef;
|
|
509
|
+
this.activeidChange = new EventEmitter();
|
|
510
|
+
}
|
|
511
|
+
get activeid() {
|
|
512
|
+
return this.elementRef.nativeElement.activeid;
|
|
513
|
+
}
|
|
514
|
+
set activeid(value) {
|
|
515
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'activeid', value);
|
|
516
|
+
}
|
|
517
|
+
onChange($event) {
|
|
518
|
+
if ($event.target === this.elementRef.nativeElement) {
|
|
519
|
+
this.activeidChange.emit(this.activeid);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
450
522
|
}
|
|
451
|
-
|
|
523
|
+
NimbleTabsDirective.decorators = [
|
|
452
524
|
{ type: Directive, args: [{
|
|
453
|
-
selector: 'nimble-
|
|
525
|
+
selector: 'nimble-tabs'
|
|
454
526
|
},] }
|
|
455
527
|
];
|
|
456
|
-
|
|
457
|
-
|
|
528
|
+
NimbleTabsDirective.ctorParameters = () => [
|
|
529
|
+
{ type: Renderer2 },
|
|
530
|
+
{ type: ElementRef }
|
|
531
|
+
];
|
|
532
|
+
NimbleTabsDirective.propDecorators = {
|
|
533
|
+
activeid: [{ type: Input }],
|
|
534
|
+
activeidChange: [{ type: Output }],
|
|
535
|
+
onChange: [{ type: HostListener, args: ['change', ['$event'],] }]
|
|
458
536
|
};
|
|
459
537
|
|
|
460
|
-
class
|
|
538
|
+
class NimbleTabsModule {
|
|
461
539
|
}
|
|
462
|
-
|
|
540
|
+
NimbleTabsModule.decorators = [
|
|
463
541
|
{ type: NgModule, args: [{
|
|
464
|
-
declarations: [
|
|
542
|
+
declarations: [NimbleTabsDirective],
|
|
465
543
|
imports: [CommonModule],
|
|
466
|
-
exports: [
|
|
544
|
+
exports: [NimbleTabsDirective]
|
|
467
545
|
},] }
|
|
468
546
|
];
|
|
469
547
|
|
|
470
548
|
/**
|
|
471
|
-
* Directive to provide Angular integration for the tabs
|
|
549
|
+
* Directive to provide Angular integration for the tabs toolbar.
|
|
472
550
|
*/
|
|
473
|
-
class
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
551
|
+
class NimbleTabsToolbarDirective {
|
|
552
|
+
}
|
|
553
|
+
NimbleTabsToolbarDirective.decorators = [
|
|
554
|
+
{ type: Directive, args: [{
|
|
555
|
+
selector: 'nimble-tabs-toolbar'
|
|
556
|
+
},] }
|
|
557
|
+
];
|
|
558
|
+
|
|
559
|
+
class NimbleTabsToolbarModule {
|
|
560
|
+
}
|
|
561
|
+
NimbleTabsToolbarModule.decorators = [
|
|
562
|
+
{ type: NgModule, args: [{
|
|
563
|
+
declarations: [NimbleTabsToolbarDirective],
|
|
564
|
+
imports: [CommonModule],
|
|
565
|
+
exports: [NimbleTabsToolbarDirective]
|
|
566
|
+
},] }
|
|
567
|
+
];
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Extension of Angular's DefaultValueAccessor to target the text-based inputs.
|
|
571
|
+
*
|
|
572
|
+
* Directive decorator based on DefaultValueAccessor decorator
|
|
573
|
+
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/default_value_accessor.ts#L72
|
|
574
|
+
*/
|
|
575
|
+
class NimbleTextFieldControlValueAccessorDirective extends DefaultValueAccessor {
|
|
576
|
+
}
|
|
577
|
+
NimbleTextFieldControlValueAccessorDirective.decorators = [
|
|
578
|
+
{ type: Directive, args: [{
|
|
579
|
+
selector: 'nimble-text-field[formControlName],nimble-text-field[formControl],nimble-text-field[ngModel]',
|
|
580
|
+
// The following host metadata is duplicated from DefaultValueAccessor
|
|
581
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
582
|
+
host: {
|
|
583
|
+
'(input)': '$any(this)._handleInput($event.target.value)',
|
|
584
|
+
'(blur)': 'onTouched()',
|
|
585
|
+
'(compositionstart)': '$any(this)._compositionStart()',
|
|
586
|
+
'(compositionend)': '$any(this)._compositionEnd($event.target.value)'
|
|
587
|
+
},
|
|
588
|
+
providers: [{
|
|
589
|
+
provide: NG_VALUE_ACCESSOR,
|
|
590
|
+
useExisting: forwardRef(() => NimbleTextFieldControlValueAccessorDirective),
|
|
591
|
+
multi: true
|
|
592
|
+
}]
|
|
593
|
+
},] }
|
|
594
|
+
];
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Directive to provide Angular integration for the text field
|
|
598
|
+
*/
|
|
599
|
+
class NimbleTextFieldDirective {
|
|
600
|
+
constructor(renderer, elementRef) {
|
|
601
|
+
this.renderer = renderer;
|
|
602
|
+
this.elementRef = elementRef;
|
|
603
|
+
}
|
|
604
|
+
get readOnly() {
|
|
605
|
+
return this.elementRef.nativeElement.readOnly;
|
|
477
606
|
}
|
|
478
|
-
|
|
479
|
-
this.
|
|
607
|
+
set readOnly(value) {
|
|
608
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'readOnly', toBooleanProperty(value));
|
|
480
609
|
}
|
|
481
610
|
}
|
|
482
|
-
|
|
611
|
+
NimbleTextFieldDirective.decorators = [
|
|
483
612
|
{ type: Directive, args: [{
|
|
484
|
-
selector: 'nimble-
|
|
613
|
+
selector: 'nimble-text-field'
|
|
485
614
|
},] }
|
|
486
615
|
];
|
|
487
|
-
|
|
616
|
+
NimbleTextFieldDirective.ctorParameters = () => [
|
|
617
|
+
{ type: Renderer2 },
|
|
488
618
|
{ type: ElementRef }
|
|
489
619
|
];
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
activeidChange: [{ type: Output }],
|
|
493
|
-
onChange: [{ type: HostListener, args: ['change',] }]
|
|
620
|
+
NimbleTextFieldDirective.propDecorators = {
|
|
621
|
+
readOnly: [{ type: Input }]
|
|
494
622
|
};
|
|
495
623
|
|
|
496
|
-
class
|
|
624
|
+
class NimbleTextFieldModule {
|
|
497
625
|
}
|
|
498
|
-
|
|
626
|
+
NimbleTextFieldModule.decorators = [
|
|
499
627
|
{ type: NgModule, args: [{
|
|
500
|
-
declarations: [
|
|
628
|
+
declarations: [NimbleTextFieldDirective, NimbleTextFieldControlValueAccessorDirective],
|
|
501
629
|
imports: [CommonModule],
|
|
502
|
-
exports: [
|
|
630
|
+
exports: [NimbleTextFieldDirective, NimbleTextFieldControlValueAccessorDirective]
|
|
503
631
|
},] }
|
|
504
632
|
];
|
|
505
633
|
|
|
506
634
|
/**
|
|
507
|
-
* Directive
|
|
635
|
+
* Directive for Angular integration for the theme provider
|
|
508
636
|
*/
|
|
509
|
-
class
|
|
637
|
+
class NimbleThemeProviderDirective {
|
|
638
|
+
constructor(renderer, elementRef) {
|
|
639
|
+
this.renderer = renderer;
|
|
640
|
+
this.elementRef = elementRef;
|
|
641
|
+
}
|
|
642
|
+
get theme() {
|
|
643
|
+
return this.elementRef.nativeElement.theme;
|
|
644
|
+
}
|
|
645
|
+
set theme(value) {
|
|
646
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'theme', value);
|
|
647
|
+
}
|
|
510
648
|
}
|
|
511
|
-
|
|
649
|
+
NimbleThemeProviderDirective.decorators = [
|
|
512
650
|
{ type: Directive, args: [{
|
|
513
|
-
selector: 'nimble-
|
|
651
|
+
selector: 'nimble-theme-provider'
|
|
514
652
|
},] }
|
|
515
653
|
];
|
|
516
|
-
|
|
517
|
-
|
|
654
|
+
NimbleThemeProviderDirective.ctorParameters = () => [
|
|
655
|
+
{ type: Renderer2 },
|
|
656
|
+
{ type: ElementRef }
|
|
657
|
+
];
|
|
658
|
+
NimbleThemeProviderDirective.propDecorators = {
|
|
659
|
+
theme: [{ type: Input }]
|
|
518
660
|
};
|
|
519
661
|
|
|
520
|
-
class
|
|
662
|
+
class NimbleThemeProviderModule {
|
|
521
663
|
}
|
|
522
|
-
|
|
664
|
+
NimbleThemeProviderModule.decorators = [
|
|
523
665
|
{ type: NgModule, args: [{
|
|
524
|
-
declarations: [
|
|
666
|
+
declarations: [NimbleThemeProviderDirective],
|
|
525
667
|
imports: [CommonModule],
|
|
526
|
-
exports: [
|
|
668
|
+
exports: [NimbleThemeProviderDirective]
|
|
527
669
|
},] }
|
|
528
670
|
];
|
|
529
671
|
|
|
530
672
|
/**
|
|
531
|
-
* Directive to provide Angular integration for the
|
|
673
|
+
* Directive to provide Angular integration for the tree item.
|
|
532
674
|
*/
|
|
533
|
-
class
|
|
675
|
+
class NimbleTreeItemDirective {
|
|
676
|
+
constructor(renderer, elementRef) {
|
|
677
|
+
this.renderer = renderer;
|
|
678
|
+
this.elementRef = elementRef;
|
|
679
|
+
this.expandedChange = new EventEmitter();
|
|
680
|
+
}
|
|
681
|
+
get disabled() {
|
|
682
|
+
return this.elementRef.nativeElement.disabled;
|
|
683
|
+
}
|
|
684
|
+
set disabled(value) {
|
|
685
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
686
|
+
}
|
|
687
|
+
get expanded() {
|
|
688
|
+
return this.elementRef.nativeElement.expanded;
|
|
689
|
+
}
|
|
690
|
+
set expanded(value) {
|
|
691
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'expanded', toBooleanProperty(value));
|
|
692
|
+
}
|
|
693
|
+
get selected() {
|
|
694
|
+
return this.elementRef.nativeElement.selected;
|
|
695
|
+
}
|
|
696
|
+
set selected(value) {
|
|
697
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'selected', toBooleanProperty(value));
|
|
698
|
+
// Needed because fast-foundation TreeView sets initial selection with an aria-selected query
|
|
699
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'selected', toBooleanAriaAttribute(value));
|
|
700
|
+
}
|
|
701
|
+
onExpandedChange($event) {
|
|
702
|
+
if ($event.target === this.elementRef.nativeElement) {
|
|
703
|
+
this.expandedChange.emit(this.expanded);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
534
706
|
}
|
|
535
|
-
|
|
707
|
+
NimbleTreeItemDirective.decorators = [
|
|
536
708
|
{ type: Directive, args: [{
|
|
537
|
-
selector: 'nimble-
|
|
709
|
+
selector: 'nimble-tree-item'
|
|
538
710
|
},] }
|
|
539
711
|
];
|
|
712
|
+
NimbleTreeItemDirective.ctorParameters = () => [
|
|
713
|
+
{ type: Renderer2 },
|
|
714
|
+
{ type: ElementRef }
|
|
715
|
+
];
|
|
716
|
+
NimbleTreeItemDirective.propDecorators = {
|
|
717
|
+
disabled: [{ type: Input }],
|
|
718
|
+
expanded: [{ type: Input }],
|
|
719
|
+
selected: [{ type: Input }],
|
|
720
|
+
expandedChange: [{ type: Output }],
|
|
721
|
+
onExpandedChange: [{ type: HostListener, args: ['expanded-change', ['$event'],] }]
|
|
722
|
+
};
|
|
540
723
|
|
|
541
|
-
class
|
|
724
|
+
class NimbleTreeItemModule {
|
|
542
725
|
}
|
|
543
|
-
|
|
726
|
+
NimbleTreeItemModule.decorators = [
|
|
544
727
|
{ type: NgModule, args: [{
|
|
545
|
-
declarations: [
|
|
728
|
+
declarations: [NimbleTreeItemDirective],
|
|
546
729
|
imports: [CommonModule],
|
|
547
|
-
exports: [
|
|
730
|
+
exports: [NimbleTreeItemDirective]
|
|
548
731
|
},] }
|
|
549
732
|
];
|
|
550
733
|
|
|
551
734
|
/**
|
|
552
|
-
* Directive to provide Angular integration for the
|
|
735
|
+
* Directive to provide Angular integration for the tree view.
|
|
553
736
|
*/
|
|
554
|
-
class
|
|
737
|
+
class NimbleTreeViewDirective {
|
|
738
|
+
constructor(renderer, elementRef) {
|
|
739
|
+
this.renderer = renderer;
|
|
740
|
+
this.elementRef = elementRef;
|
|
741
|
+
}
|
|
742
|
+
get selectionMode() {
|
|
743
|
+
return this.elementRef.nativeElement.selectionMode;
|
|
744
|
+
}
|
|
745
|
+
set selectionMode(value) {
|
|
746
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'selectionMode', value);
|
|
747
|
+
}
|
|
555
748
|
}
|
|
556
|
-
|
|
749
|
+
NimbleTreeViewDirective.decorators = [
|
|
557
750
|
{ type: Directive, args: [{
|
|
558
|
-
selector: 'nimble-
|
|
751
|
+
selector: 'nimble-tree-view'
|
|
559
752
|
},] }
|
|
560
753
|
];
|
|
754
|
+
NimbleTreeViewDirective.ctorParameters = () => [
|
|
755
|
+
{ type: Renderer2 },
|
|
756
|
+
{ type: ElementRef }
|
|
757
|
+
];
|
|
758
|
+
NimbleTreeViewDirective.propDecorators = {
|
|
759
|
+
selectionMode: [{ type: Input }]
|
|
760
|
+
};
|
|
561
761
|
|
|
562
|
-
class
|
|
762
|
+
class NimbleTreeViewModule {
|
|
563
763
|
}
|
|
564
|
-
|
|
764
|
+
NimbleTreeViewModule.decorators = [
|
|
565
765
|
{ type: NgModule, args: [{
|
|
566
|
-
declarations: [
|
|
766
|
+
declarations: [NimbleTreeViewDirective],
|
|
567
767
|
imports: [CommonModule],
|
|
568
|
-
exports: [
|
|
768
|
+
exports: [NimbleTreeViewDirective]
|
|
569
769
|
},] }
|
|
570
770
|
];
|
|
571
771
|
|
|
@@ -577,5 +777,5 @@ NimbleTabsToolbarModule.decorators = [
|
|
|
577
777
|
* Generated bundle index. Do not edit.
|
|
578
778
|
*/
|
|
579
779
|
|
|
580
|
-
export { NimbleButtonDirective, NimbleButtonModule, NimbleCheckboxControlValueAccessorDirective, NimbleCheckboxDirective, NimbleCheckboxModule,
|
|
780
|
+
export { NimbleButtonDirective, NimbleButtonModule, NimbleCheckboxControlValueAccessorDirective, NimbleCheckboxDirective, NimbleCheckboxModule, NimbleDrawerDirective, NimbleDrawerModule, NimbleListboxOptionDirective, NimbleListboxOptionModule, NimbleMenuDirective, NimbleMenuItemDirective, NimbleMenuItemModule, NimbleMenuModule, NimbleNumberFieldControlValueAccessorDirective, NimbleNumberFieldDirective, NimbleNumberFieldModule, NimbleSelectControlValueAccessorDirective, NimbleSelectDirective, NimbleSelectModule, NimbleTabDirective, NimbleTabModule, NimbleTabPanelDirective, NimbleTabPanelModule, NimbleTabsDirective, NimbleTabsModule, NimbleTabsToolbarDirective, NimbleTabsToolbarModule, NimbleTextFieldControlValueAccessorDirective, NimbleTextFieldDirective, NimbleTextFieldModule, NimbleThemeProviderDirective, NimbleThemeProviderModule, NimbleTreeItemDirective, NimbleTreeItemModule, NimbleTreeViewDirective, NimbleTreeViewModule };
|
|
581
781
|
//# sourceMappingURL=ni-nimble-angular.js.map
|