@ni/nimble-angular 1.0.0-beta.13 → 1.0.0-beta.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +46 -20
  2. package/bundles/ni-nimble-angular.umd.js +1320 -0
  3. package/bundles/ni-nimble-angular.umd.js.map +1 -0
  4. package/directives/button/nimble-button.directive.d.ts +15 -0
  5. package/directives/button/nimble-button.module.d.ts +3 -0
  6. package/directives/button/nimble-button.module.ngfactory.d.ts +3 -0
  7. package/directives/checkbox/nimble-checkbox-control-value-accessor.directive.d.ts +9 -0
  8. package/directives/checkbox/nimble-checkbox.directive.d.ts +5 -0
  9. package/directives/checkbox/nimble-checkbox.module.d.ts +3 -0
  10. package/directives/checkbox/nimble-checkbox.module.ngfactory.d.ts +3 -0
  11. package/directives/drawer/nimble-drawer.directive.d.ts +23 -0
  12. package/directives/drawer/nimble-drawer.module.d.ts +3 -0
  13. package/directives/drawer/nimble-drawer.module.ngfactory.d.ts +3 -0
  14. package/directives/listbox-option/nimble-listbox-option.directive.d.ts +14 -0
  15. package/directives/listbox-option/nimble-listbox-option.module.d.ts +3 -0
  16. package/directives/listbox-option/nimble-listbox-option.module.ngfactory.d.ts +3 -0
  17. package/directives/menu/nimble-menu.directive.d.ts +5 -0
  18. package/directives/menu/nimble-menu.module.d.ts +3 -0
  19. package/directives/menu/nimble-menu.module.ngfactory.d.ts +3 -0
  20. package/directives/menu-item/nimble-menu-item.directive.d.ts +12 -0
  21. package/directives/menu-item/nimble-menu-item.module.d.ts +3 -0
  22. package/directives/menu-item/nimble-menu-item.module.ngfactory.d.ts +3 -0
  23. package/directives/number-field/nimble-number-field-control-value-accessor.directive.d.ts +9 -0
  24. package/directives/number-field/nimble-number-field.directive.d.ts +20 -0
  25. package/directives/number-field/nimble-number-field.module.d.ts +3 -0
  26. package/directives/number-field/nimble-number-field.module.ngfactory.d.ts +3 -0
  27. package/directives/select/nimble-select-control-value-accessor.directive.d.ts +11 -0
  28. package/directives/select/nimble-select.directive.d.ts +5 -0
  29. package/directives/select/nimble-select.module.d.ts +3 -0
  30. package/directives/select/nimble-select.module.ngfactory.d.ts +3 -0
  31. package/directives/tab/nimble-tab.directive.d.ts +12 -0
  32. package/directives/tab/nimble-tab.module.d.ts +3 -0
  33. package/directives/tab/nimble-tab.module.ngfactory.d.ts +3 -0
  34. package/directives/tab-panel/nimble-tab-panel.directive.d.ts +5 -0
  35. package/directives/tab-panel/nimble-tab-panel.module.d.ts +3 -0
  36. package/directives/tab-panel/nimble-tab-panel.module.ngfactory.d.ts +3 -0
  37. package/directives/tabs/nimble-tabs.directive.d.ts +14 -0
  38. package/directives/tabs/nimble-tabs.module.d.ts +3 -0
  39. package/directives/tabs/nimble-tabs.module.ngfactory.d.ts +3 -0
  40. package/directives/tabs-toolbar/nimble-tabs-toolbar.directive.d.ts +5 -0
  41. package/directives/tabs-toolbar/nimble-tabs-toolbar.module.d.ts +3 -0
  42. package/directives/tabs-toolbar/nimble-tabs-toolbar.module.ngfactory.d.ts +3 -0
  43. package/directives/text-field/nimble-text-field-control-value-accessor.directive.d.ts +9 -0
  44. package/directives/text-field/nimble-text-field.directive.d.ts +12 -0
  45. package/directives/text-field/nimble-text-field.module.d.ts +3 -0
  46. package/directives/text-field/nimble-text-field.module.ngfactory.d.ts +3 -0
  47. package/directives/theme-provider/nimble-theme-provider.directive.d.ts +14 -0
  48. package/directives/theme-provider/nimble-theme-provider.module.d.ts +3 -0
  49. package/directives/theme-provider/nimble-theme-provider.module.ngfactory.d.ts +3 -0
  50. package/directives/tree-item/nimble-tree-item.directive.d.ts +19 -0
  51. package/directives/tree-item/nimble-tree-item.module.d.ts +3 -0
  52. package/directives/tree-item/nimble-tree-item.module.ngfactory.d.ts +3 -0
  53. package/directives/tree-view/nimble-tree-view.directive.d.ts +15 -0
  54. package/directives/tree-view/nimble-tree-view.module.d.ts +3 -0
  55. package/directives/tree-view/nimble-tree-view.module.ngfactory.d.ts +3 -0
  56. package/directives/utilities/template-value-helpers.d.ts +18 -0
  57. package/esm2015/directives/button/nimble-button.directive.js +37 -0
  58. package/esm2015/directives/button/nimble-button.directive.ngsummary.json +1 -0
  59. package/esm2015/directives/button/nimble-button.module.js +14 -0
  60. package/esm2015/directives/button/nimble-button.module.ngfactory.js +12 -0
  61. package/esm2015/directives/button/nimble-button.module.ngsummary.json +1 -0
  62. package/esm2015/directives/checkbox/nimble-checkbox-control-value-accessor.directive.js +24 -0
  63. package/esm2015/directives/checkbox/nimble-checkbox-control-value-accessor.directive.ngsummary.json +1 -0
  64. package/esm2015/directives/checkbox/nimble-checkbox.directive.js +12 -0
  65. package/esm2015/directives/checkbox/nimble-checkbox.directive.ngsummary.json +1 -0
  66. package/esm2015/directives/checkbox/nimble-checkbox.module.js +15 -0
  67. package/esm2015/directives/checkbox/nimble-checkbox.module.ngfactory.js +12 -0
  68. package/esm2015/directives/checkbox/nimble-checkbox.module.ngsummary.json +1 -0
  69. package/esm2015/directives/drawer/nimble-drawer.directive.js +61 -0
  70. package/esm2015/directives/drawer/nimble-drawer.directive.ngsummary.json +1 -0
  71. package/esm2015/directives/drawer/nimble-drawer.module.js +14 -0
  72. package/esm2015/directives/drawer/nimble-drawer.module.ngfactory.js +12 -0
  73. package/esm2015/directives/drawer/nimble-drawer.module.ngsummary.json +1 -0
  74. package/esm2015/directives/listbox-option/nimble-listbox-option.directive.js +34 -0
  75. package/esm2015/directives/listbox-option/nimble-listbox-option.directive.ngsummary.json +1 -0
  76. package/esm2015/directives/listbox-option/nimble-listbox-option.module.js +14 -0
  77. package/esm2015/directives/listbox-option/nimble-listbox-option.module.ngfactory.js +12 -0
  78. package/esm2015/directives/listbox-option/nimble-listbox-option.module.ngsummary.json +1 -0
  79. package/esm2015/directives/menu/nimble-menu.directive.js +12 -0
  80. package/esm2015/directives/menu/nimble-menu.directive.ngsummary.json +1 -0
  81. package/esm2015/directives/menu/nimble-menu.module.js +14 -0
  82. package/esm2015/directives/menu/nimble-menu.module.ngfactory.js +12 -0
  83. package/esm2015/directives/menu/nimble-menu.module.ngsummary.json +1 -0
  84. package/esm2015/directives/menu-item/nimble-menu-item.directive.js +30 -0
  85. package/esm2015/directives/menu-item/nimble-menu-item.directive.ngsummary.json +1 -0
  86. package/esm2015/directives/menu-item/nimble-menu-item.module.js +14 -0
  87. package/esm2015/directives/menu-item/nimble-menu-item.module.ngfactory.js +12 -0
  88. package/esm2015/directives/menu-item/nimble-menu-item.module.ngsummary.json +1 -0
  89. package/esm2015/directives/number-field/nimble-number-field-control-value-accessor.directive.js +24 -0
  90. package/esm2015/directives/number-field/nimble-number-field-control-value-accessor.directive.ngsummary.json +1 -0
  91. package/esm2015/directives/number-field/nimble-number-field.directive.js +58 -0
  92. package/esm2015/directives/number-field/nimble-number-field.directive.ngsummary.json +1 -0
  93. package/esm2015/directives/number-field/nimble-number-field.module.js +15 -0
  94. package/esm2015/directives/number-field/nimble-number-field.module.ngfactory.js +12 -0
  95. package/esm2015/directives/number-field/nimble-number-field.module.ngsummary.json +1 -0
  96. package/esm2015/directives/select/nimble-select-control-value-accessor.directive.js +26 -0
  97. package/esm2015/directives/select/nimble-select-control-value-accessor.directive.ngsummary.json +1 -0
  98. package/esm2015/directives/select/nimble-select.directive.js +12 -0
  99. package/esm2015/directives/select/nimble-select.directive.ngsummary.json +1 -0
  100. package/esm2015/directives/select/nimble-select.module.js +15 -0
  101. package/esm2015/directives/select/nimble-select.module.ngfactory.js +12 -0
  102. package/esm2015/directives/select/nimble-select.module.ngsummary.json +1 -0
  103. package/esm2015/directives/tab/nimble-tab.directive.js +30 -0
  104. package/esm2015/directives/tab/nimble-tab.directive.ngsummary.json +1 -0
  105. package/esm2015/directives/tab/nimble-tab.module.js +14 -0
  106. package/esm2015/directives/tab/nimble-tab.module.ngfactory.js +12 -0
  107. package/esm2015/directives/tab/nimble-tab.module.ngsummary.json +1 -0
  108. package/esm2015/directives/tab-panel/nimble-tab-panel.directive.js +12 -0
  109. package/esm2015/directives/tab-panel/nimble-tab-panel.directive.ngsummary.json +1 -0
  110. package/esm2015/directives/tab-panel/nimble-tab-panel.module.js +14 -0
  111. package/esm2015/directives/tab-panel/nimble-tab-panel.module.ngfactory.js +12 -0
  112. package/esm2015/directives/tab-panel/nimble-tab-panel.module.ngsummary.json +1 -0
  113. package/esm2015/directives/tabs/nimble-tabs.directive.js +37 -0
  114. package/esm2015/directives/tabs/nimble-tabs.directive.ngsummary.json +1 -0
  115. package/esm2015/directives/tabs/nimble-tabs.module.js +14 -0
  116. package/esm2015/directives/tabs/nimble-tabs.module.ngfactory.js +12 -0
  117. package/esm2015/directives/tabs/nimble-tabs.module.ngsummary.json +1 -0
  118. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.directive.js +12 -0
  119. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.directive.ngsummary.json +1 -0
  120. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.module.js +14 -0
  121. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.module.ngfactory.js +12 -0
  122. package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.module.ngsummary.json +1 -0
  123. package/esm2015/directives/text-field/nimble-text-field-control-value-accessor.directive.js +29 -0
  124. package/esm2015/directives/text-field/nimble-text-field-control-value-accessor.directive.ngsummary.json +1 -0
  125. package/esm2015/directives/text-field/nimble-text-field.directive.js +30 -0
  126. package/esm2015/directives/text-field/nimble-text-field.directive.ngsummary.json +1 -0
  127. package/esm2015/directives/text-field/nimble-text-field.module.js +15 -0
  128. package/esm2015/directives/text-field/nimble-text-field.module.ngfactory.js +12 -0
  129. package/esm2015/directives/text-field/nimble-text-field.module.ngsummary.json +1 -0
  130. package/esm2015/directives/theme-provider/nimble-theme-provider.directive.js +31 -0
  131. package/esm2015/directives/theme-provider/nimble-theme-provider.directive.ngsummary.json +1 -0
  132. package/esm2015/directives/theme-provider/nimble-theme-provider.module.js +14 -0
  133. package/esm2015/directives/theme-provider/nimble-theme-provider.module.ngfactory.js +12 -0
  134. package/esm2015/directives/theme-provider/nimble-theme-provider.module.ngsummary.json +1 -0
  135. package/esm2015/directives/tree-item/nimble-tree-item.directive.js +55 -0
  136. package/esm2015/directives/tree-item/nimble-tree-item.directive.ngsummary.json +1 -0
  137. package/esm2015/directives/tree-item/nimble-tree-item.module.js +14 -0
  138. package/esm2015/directives/tree-item/nimble-tree-item.module.ngfactory.js +12 -0
  139. package/esm2015/directives/tree-item/nimble-tree-item.module.ngsummary.json +1 -0
  140. package/esm2015/directives/tree-view/nimble-tree-view.directive.js +32 -0
  141. package/esm2015/directives/tree-view/nimble-tree-view.directive.ngsummary.json +1 -0
  142. package/esm2015/directives/tree-view/nimble-tree-view.module.js +14 -0
  143. package/esm2015/directives/tree-view/nimble-tree-view.module.ngfactory.js +12 -0
  144. package/esm2015/directives/tree-view/nimble-tree-view.module.ngsummary.json +1 -0
  145. package/esm2015/directives/utilities/template-value-helpers.js +32 -0
  146. package/esm2015/directives/utilities/template-value-helpers.ngsummary.json +1 -0
  147. package/esm2015/ni-nimble-angular.js +5 -0
  148. package/esm2015/ni-nimble-angular.ngsummary.json +1 -0
  149. package/esm2015/public-api.js +40 -0
  150. package/esm2015/public-api.ngsummary.json +1 -0
  151. package/fesm2015/ni-nimble-angular.js +781 -0
  152. package/fesm2015/ni-nimble-angular.js.map +1 -0
  153. package/ni-nimble-angular.d.ts +4 -0
  154. package/ni-nimble-angular.metadata.json +1 -0
  155. package/package.json +11 -18
  156. package/public-api.d.ts +36 -0
  157. package/.eslintrc.js +0 -38
  158. package/karma.conf.js +0 -46
@@ -0,0 +1,781 @@
1
+ import { Directive, Renderer2, ElementRef, Input, NgModule, forwardRef, EventEmitter, Output, HostListener, Optional, Host } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import '@ni/nimble-components/dist/esm/button';
4
+ import { CheckboxControlValueAccessor, NG_VALUE_ACCESSOR, SelectControlValueAccessor, NgSelectOption, NumberValueAccessor, DefaultValueAccessor } from '@angular/forms';
5
+ import '@ni/nimble-components/dist/esm/checkbox';
6
+ import '@ni/nimble-components/dist/esm/drawer';
7
+ import { DrawerState } from '@ni/nimble-components/dist/esm/drawer/types';
8
+ export { DrawerLocation, DrawerState } from '@ni/nimble-components/dist/esm/drawer/types';
9
+ import '@ni/nimble-components/dist/esm/listbox-option';
10
+ import '@ni/nimble-components/dist/esm/menu';
11
+ import '@ni/nimble-components/dist/esm/menu-item';
12
+ import '@ni/nimble-components/dist/esm/number-field';
13
+ import '@ni/nimble-components/dist/esm/select';
14
+ import '@ni/nimble-components/dist/esm/tab';
15
+ import '@ni/nimble-components/dist/esm/tab-panel';
16
+ import '@ni/nimble-components/dist/esm/tabs';
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
+
25
+ /**
26
+ * Conversion helpers for values coming from Angular templates via
27
+ * strings specified in templates or via property bindings
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
+ }
77
+ }
78
+ NimbleButtonDirective.decorators = [
79
+ { type: Directive, args: [{
80
+ selector: 'nimble-button'
81
+ },] }
82
+ ];
83
+ NimbleButtonDirective.ctorParameters = () => [
84
+ { type: Renderer2 },
85
+ { type: ElementRef }
86
+ ];
87
+ NimbleButtonDirective.propDecorators = {
88
+ appearance: [{ type: Input }],
89
+ disabled: [{ type: Input }]
90
+ };
91
+
92
+ class NimbleButtonModule {
93
+ }
94
+ NimbleButtonModule.decorators = [
95
+ { type: NgModule, args: [{
96
+ declarations: [NimbleButtonDirective],
97
+ imports: [CommonModule],
98
+ exports: [NimbleButtonDirective]
99
+ },] }
100
+ ];
101
+
102
+ /**
103
+ * Extension of Angular's CheckboxControlValueAccessor to target the Nimble checkbox control.
104
+ *
105
+ * Directive decorator based on CheckboxControlValueAccessor decorator
106
+ * https://github.com/angular/angular/blob/master/packages/forms/src/directives/checkbox_value_accessor.ts#L42
107
+ */
108
+ class NimbleCheckboxControlValueAccessorDirective extends CheckboxControlValueAccessor {
109
+ }
110
+ NimbleCheckboxControlValueAccessorDirective.decorators = [
111
+ { type: Directive, args: [{
112
+ selector: 'nimble-checkbox[formControlName],nimble-checkbox[formControl],nimble-checkbox[ngModel]',
113
+ // The following host metadata is duplicated from CheckboxControlValueAccessor
114
+ // eslint-disable-next-line @angular-eslint/no-host-metadata-property
115
+ host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
116
+ providers: [{
117
+ provide: NG_VALUE_ACCESSOR,
118
+ useExisting: forwardRef(() => NimbleCheckboxControlValueAccessorDirective),
119
+ multi: true
120
+ }]
121
+ },] }
122
+ ];
123
+
124
+ /**
125
+ * Directive to provide Angular integration for the checkbox.
126
+ */
127
+ class NimbleCheckboxDirective {
128
+ }
129
+ NimbleCheckboxDirective.decorators = [
130
+ { type: Directive, args: [{
131
+ selector: 'nimble-checkbox'
132
+ },] }
133
+ ];
134
+
135
+ class NimbleCheckboxModule {
136
+ }
137
+ NimbleCheckboxModule.decorators = [
138
+ { type: NgModule, args: [{
139
+ declarations: [NimbleCheckboxDirective, NimbleCheckboxControlValueAccessorDirective],
140
+ imports: [CommonModule],
141
+ exports: [NimbleCheckboxDirective, NimbleCheckboxControlValueAccessorDirective]
142
+ },] }
143
+ ];
144
+
145
+ /**
146
+ * Directive to provide Angular integration for the drawer.
147
+ */
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
+ }
183
+ }
184
+ NimbleDrawerDirective.decorators = [
185
+ { type: Directive, args: [{
186
+ selector: 'nimble-drawer'
187
+ },] }
188
+ ];
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'],] }]
199
+ };
200
+
201
+ class NimbleDrawerModule {
202
+ }
203
+ NimbleDrawerModule.decorators = [
204
+ { type: NgModule, args: [{
205
+ declarations: [NimbleDrawerDirective],
206
+ imports: [CommonModule],
207
+ exports: [NimbleDrawerDirective]
208
+ },] }
209
+ ];
210
+
211
+ /**
212
+ * Extension of Angular's SelectControlValueAccessor to target the Nimble select control.
213
+ *
214
+ * @see NimbleSelectOptionDirective
215
+ *
216
+ * Directive decorator based on SelectControlValueAccessor decorator
217
+ * https://github.com/angular/angular/blob/master/packages/forms/src/directives/select_control_value_accessor.ts#L85
218
+ */
219
+ class NimbleSelectControlValueAccessorDirective extends SelectControlValueAccessor {
220
+ }
221
+ NimbleSelectControlValueAccessorDirective.decorators = [
222
+ { type: Directive, args: [{
223
+ selector: 'nimble-select:not([multiple])[formControlName],nimble-select:not([multiple])[formControl],nimble-select:not([multiple])[ngModel]',
224
+ // The following host metadata is duplicated from SelectControlValueAccessor
225
+ // eslint-disable-next-line @angular-eslint/no-host-metadata-property
226
+ host: { '(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
227
+ providers: [{
228
+ provide: NG_VALUE_ACCESSOR,
229
+ useExisting: forwardRef(() => NimbleSelectControlValueAccessorDirective),
230
+ multi: true
231
+ }]
232
+ },] }
233
+ ];
234
+
235
+ /**
236
+ * Directive to provide Angular integration for the listbox option.
237
+ */
238
+ class NimbleListboxOptionDirective extends NgSelectOption {
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));
249
+ }
250
+ }
251
+ NimbleListboxOptionDirective.decorators = [
252
+ { type: Directive, args: [{
253
+ selector: 'nimble-listbox-option'
254
+ },] }
255
+ ];
256
+ NimbleListboxOptionDirective.ctorParameters = () => [
257
+ { type: ElementRef },
258
+ { type: Renderer2 },
259
+ { type: NimbleSelectControlValueAccessorDirective, decorators: [{ type: Optional }, { type: Host }] }
260
+ ];
261
+ NimbleListboxOptionDirective.propDecorators = {
262
+ disabled: [{ type: Input }]
263
+ };
264
+
265
+ class NimbleListboxOptionModule {
266
+ }
267
+ NimbleListboxOptionModule.decorators = [
268
+ { type: NgModule, args: [{
269
+ declarations: [NimbleListboxOptionDirective],
270
+ imports: [CommonModule],
271
+ exports: [NimbleListboxOptionDirective]
272
+ },] }
273
+ ];
274
+
275
+ /**
276
+ * Directive to provide Angular integration for the menu.
277
+ */
278
+ class NimbleMenuDirective {
279
+ }
280
+ NimbleMenuDirective.decorators = [
281
+ { type: Directive, args: [{
282
+ selector: 'nimble-menu'
283
+ },] }
284
+ ];
285
+
286
+ class NimbleMenuModule {
287
+ }
288
+ NimbleMenuModule.decorators = [
289
+ { type: NgModule, args: [{
290
+ declarations: [NimbleMenuDirective],
291
+ imports: [CommonModule],
292
+ exports: [NimbleMenuDirective]
293
+ },] }
294
+ ];
295
+
296
+ /**
297
+ * Directive to provide Angular integration for the menu.
298
+ */
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
+ }
310
+ }
311
+ NimbleMenuItemDirective.decorators = [
312
+ { type: Directive, args: [{
313
+ selector: 'nimble-menu-item'
314
+ },] }
315
+ ];
316
+ NimbleMenuItemDirective.ctorParameters = () => [
317
+ { type: Renderer2 },
318
+ { type: ElementRef }
319
+ ];
320
+ NimbleMenuItemDirective.propDecorators = {
321
+ disabled: [{ type: Input }]
322
+ };
323
+
324
+ class NimbleMenuItemModule {
325
+ }
326
+ NimbleMenuItemModule.decorators = [
327
+ { type: NgModule, args: [{
328
+ declarations: [NimbleMenuItemDirective],
329
+ imports: [CommonModule],
330
+ exports: [NimbleMenuItemDirective]
331
+ },] }
332
+ ];
333
+
334
+ /**
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
339
+ */
340
+ class NimbleNumberFieldControlValueAccessorDirective extends NumberValueAccessor {
341
+ }
342
+ NimbleNumberFieldControlValueAccessorDirective.decorators = [
343
+ { type: Directive, args: [{
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
+ }]
353
+ },] }
354
+ ];
355
+
356
+ /**
357
+ * Directive to provide Angular integration for the number field.
358
+ */
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
+ }
394
+ }
395
+ NimbleNumberFieldDirective.decorators = [
396
+ { type: Directive, args: [{
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]
419
+ },] }
420
+ ];
421
+
422
+ /**
423
+ * Directive for Nimble select control Angular integration
424
+ */
425
+ class NimbleSelectDirective {
426
+ }
427
+ NimbleSelectDirective.decorators = [
428
+ { type: Directive, args: [{
429
+ selector: 'nimble-select',
430
+ },] }
431
+ ];
432
+
433
+ class NimbleSelectModule {
434
+ }
435
+ NimbleSelectModule.decorators = [
436
+ { type: NgModule, args: [{
437
+ declarations: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective],
438
+ imports: [CommonModule],
439
+ exports: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective]
440
+ },] }
441
+ ];
442
+
443
+ /**
444
+ * Directive to provide Angular integration for the tab element.
445
+ */
446
+ class NimbleTabDirective {
447
+ constructor(renderer, elementRef) {
448
+ this.renderer = renderer;
449
+ this.elementRef = elementRef;
450
+ }
451
+ get disabled() {
452
+ return this.elementRef.nativeElement.disabled;
453
+ }
454
+ set disabled(value) {
455
+ this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
456
+ }
457
+ }
458
+ NimbleTabDirective.decorators = [
459
+ { type: Directive, args: [{
460
+ selector: 'nimble-tab'
461
+ },] }
462
+ ];
463
+ NimbleTabDirective.ctorParameters = () => [
464
+ { type: Renderer2 },
465
+ { type: ElementRef }
466
+ ];
467
+ NimbleTabDirective.propDecorators = {
468
+ disabled: [{ type: Input }]
469
+ };
470
+
471
+ class NimbleTabModule {
472
+ }
473
+ NimbleTabModule.decorators = [
474
+ { type: NgModule, args: [{
475
+ declarations: [NimbleTabDirective],
476
+ imports: [CommonModule],
477
+ exports: [NimbleTabDirective]
478
+ },] }
479
+ ];
480
+
481
+ /**
482
+ * Directive to provide Angular integration for the tab panel.
483
+ */
484
+ class NimbleTabPanelDirective {
485
+ }
486
+ NimbleTabPanelDirective.decorators = [
487
+ { type: Directive, args: [{
488
+ selector: 'nimble-tab-panel'
489
+ },] }
490
+ ];
491
+
492
+ class NimbleTabPanelModule {
493
+ }
494
+ NimbleTabPanelModule.decorators = [
495
+ { type: NgModule, args: [{
496
+ declarations: [NimbleTabPanelDirective],
497
+ imports: [CommonModule],
498
+ exports: [NimbleTabPanelDirective]
499
+ },] }
500
+ ];
501
+
502
+ /**
503
+ * Directive to provide Angular integration for the tabs element.
504
+ */
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
+ }
522
+ }
523
+ NimbleTabsDirective.decorators = [
524
+ { type: Directive, args: [{
525
+ selector: 'nimble-tabs'
526
+ },] }
527
+ ];
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'],] }]
536
+ };
537
+
538
+ class NimbleTabsModule {
539
+ }
540
+ NimbleTabsModule.decorators = [
541
+ { type: NgModule, args: [{
542
+ declarations: [NimbleTabsDirective],
543
+ imports: [CommonModule],
544
+ exports: [NimbleTabsDirective]
545
+ },] }
546
+ ];
547
+
548
+ /**
549
+ * Directive to provide Angular integration for the tabs toolbar.
550
+ */
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;
606
+ }
607
+ set readOnly(value) {
608
+ this.renderer.setProperty(this.elementRef.nativeElement, 'readOnly', toBooleanProperty(value));
609
+ }
610
+ }
611
+ NimbleTextFieldDirective.decorators = [
612
+ { type: Directive, args: [{
613
+ selector: 'nimble-text-field'
614
+ },] }
615
+ ];
616
+ NimbleTextFieldDirective.ctorParameters = () => [
617
+ { type: Renderer2 },
618
+ { type: ElementRef }
619
+ ];
620
+ NimbleTextFieldDirective.propDecorators = {
621
+ readOnly: [{ type: Input }]
622
+ };
623
+
624
+ class NimbleTextFieldModule {
625
+ }
626
+ NimbleTextFieldModule.decorators = [
627
+ { type: NgModule, args: [{
628
+ declarations: [NimbleTextFieldDirective, NimbleTextFieldControlValueAccessorDirective],
629
+ imports: [CommonModule],
630
+ exports: [NimbleTextFieldDirective, NimbleTextFieldControlValueAccessorDirective]
631
+ },] }
632
+ ];
633
+
634
+ /**
635
+ * Directive for Angular integration for the theme provider
636
+ */
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
+ }
648
+ }
649
+ NimbleThemeProviderDirective.decorators = [
650
+ { type: Directive, args: [{
651
+ selector: 'nimble-theme-provider'
652
+ },] }
653
+ ];
654
+ NimbleThemeProviderDirective.ctorParameters = () => [
655
+ { type: Renderer2 },
656
+ { type: ElementRef }
657
+ ];
658
+ NimbleThemeProviderDirective.propDecorators = {
659
+ theme: [{ type: Input }]
660
+ };
661
+
662
+ class NimbleThemeProviderModule {
663
+ }
664
+ NimbleThemeProviderModule.decorators = [
665
+ { type: NgModule, args: [{
666
+ declarations: [NimbleThemeProviderDirective],
667
+ imports: [CommonModule],
668
+ exports: [NimbleThemeProviderDirective]
669
+ },] }
670
+ ];
671
+
672
+ /**
673
+ * Directive to provide Angular integration for the tree item.
674
+ */
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
+ }
706
+ }
707
+ NimbleTreeItemDirective.decorators = [
708
+ { type: Directive, args: [{
709
+ selector: 'nimble-tree-item'
710
+ },] }
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
+ };
723
+
724
+ class NimbleTreeItemModule {
725
+ }
726
+ NimbleTreeItemModule.decorators = [
727
+ { type: NgModule, args: [{
728
+ declarations: [NimbleTreeItemDirective],
729
+ imports: [CommonModule],
730
+ exports: [NimbleTreeItemDirective]
731
+ },] }
732
+ ];
733
+
734
+ /**
735
+ * Directive to provide Angular integration for the tree view.
736
+ */
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
+ }
748
+ }
749
+ NimbleTreeViewDirective.decorators = [
750
+ { type: Directive, args: [{
751
+ selector: 'nimble-tree-view'
752
+ },] }
753
+ ];
754
+ NimbleTreeViewDirective.ctorParameters = () => [
755
+ { type: Renderer2 },
756
+ { type: ElementRef }
757
+ ];
758
+ NimbleTreeViewDirective.propDecorators = {
759
+ selectionMode: [{ type: Input }]
760
+ };
761
+
762
+ class NimbleTreeViewModule {
763
+ }
764
+ NimbleTreeViewModule.decorators = [
765
+ { type: NgModule, args: [{
766
+ declarations: [NimbleTreeViewDirective],
767
+ imports: [CommonModule],
768
+ exports: [NimbleTreeViewDirective]
769
+ },] }
770
+ ];
771
+
772
+ /*
773
+ * Public API Surface of nimble-angular
774
+ */
775
+
776
+ /**
777
+ * Generated bundle index. Do not edit.
778
+ */
779
+
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 };
781
+ //# sourceMappingURL=ni-nimble-angular.js.map