@ni/nimble-angular 1.0.0-beta.98 → 1.1.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 +87 -21
- package/bundles/ni-nimble-angular.umd.js +1422 -1045
- package/bundles/ni-nimble-angular.umd.js.map +1 -1
- package/directives/button/nimble-button.directive.d.ts +17 -5
- package/directives/button/nimble-button.module.d.ts +0 -6
- package/directives/button/nimble-button.module.ngfactory.d.ts +3 -0
- package/directives/checkbox/nimble-checkbox-control-value-accessor.directive.d.ts +1 -4
- package/directives/checkbox/nimble-checkbox.directive.d.ts +2 -3
- package/directives/checkbox/nimble-checkbox.module.d.ts +0 -7
- package/directives/checkbox/nimble-checkbox.module.ngfactory.d.ts +3 -0
- package/directives/drawer/nimble-drawer.directive.d.ts +25 -0
- package/directives/drawer/nimble-drawer.module.d.ts +3 -0
- package/directives/drawer/nimble-drawer.module.ngfactory.d.ts +3 -0
- package/directives/listbox-option/nimble-listbox-option.directive.d.ts +9 -7
- package/directives/listbox-option/nimble-listbox-option.module.d.ts +0 -6
- package/directives/listbox-option/nimble-listbox-option.module.ngfactory.d.ts +3 -0
- package/directives/menu/nimble-menu.directive.d.ts +7 -0
- package/directives/menu/nimble-menu.module.d.ts +3 -0
- package/directives/menu/nimble-menu.module.ngfactory.d.ts +3 -0
- package/directives/menu-item/nimble-menu-item.directive.d.ts +14 -0
- package/directives/menu-item/nimble-menu-item.module.d.ts +3 -0
- package/directives/menu-item/nimble-menu-item.module.ngfactory.d.ts +3 -0
- package/directives/number-field/nimble-number-field-control-value-accessor.directive.d.ts +9 -0
- package/directives/number-field/nimble-number-field.directive.d.ts +17 -8
- package/directives/number-field/nimble-number-field.module.d.ts +0 -7
- package/directives/number-field/nimble-number-field.module.ngfactory.d.ts +3 -0
- package/directives/select/nimble-select-control-value-accessor.directive.d.ts +0 -3
- package/directives/select/nimble-select.directive.d.ts +2 -3
- package/directives/select/nimble-select.module.d.ts +0 -7
- package/directives/select/nimble-select.module.ngfactory.d.ts +3 -0
- package/directives/tab/nimble-tab.directive.d.ts +9 -4
- package/directives/tab/nimble-tab.module.d.ts +0 -6
- package/directives/tab/nimble-tab.module.ngfactory.d.ts +3 -0
- package/directives/tab-panel/nimble-tab-panel.directive.d.ts +2 -3
- package/directives/tab-panel/nimble-tab-panel.module.d.ts +0 -6
- package/directives/tab-panel/nimble-tab-panel.module.ngfactory.d.ts +3 -0
- package/directives/tabs/nimble-tabs.directive.d.ts +9 -9
- package/directives/tabs/nimble-tabs.module.d.ts +0 -6
- package/directives/tabs/nimble-tabs.module.ngfactory.d.ts +3 -0
- package/directives/tabs-toolbar/nimble-tabs-toolbar.directive.d.ts +2 -3
- package/directives/tabs-toolbar/nimble-tabs-toolbar.module.d.ts +0 -6
- package/directives/tabs-toolbar/nimble-tabs-toolbar.module.ngfactory.d.ts +3 -0
- package/directives/text-field/nimble-text-field-control-value-accessor.directive.d.ts +9 -0
- package/directives/text-field/nimble-text-field.directive.d.ts +14 -4
- package/directives/text-field/nimble-text-field.module.d.ts +0 -7
- package/directives/text-field/nimble-text-field.module.ngfactory.d.ts +3 -0
- package/directives/theme-provider/nimble-theme-provider.directive.d.ts +11 -4
- package/directives/theme-provider/nimble-theme-provider.module.d.ts +0 -6
- package/directives/theme-provider/nimble-theme-provider.module.ngfactory.d.ts +3 -0
- package/directives/toggle-button/nimble-toggle-button-control-value-accessor.directive.d.ts +9 -0
- package/directives/toggle-button/nimble-toggle-button.directive.d.ts +22 -0
- package/directives/toggle-button/nimble-toggle-button.module.d.ts +3 -0
- package/directives/toggle-button/nimble-toggle-button.module.ngfactory.d.ts +3 -0
- package/directives/tree-item/nimble-tree-item.directive.d.ts +14 -13
- package/directives/tree-item/nimble-tree-item.module.d.ts +0 -6
- package/directives/tree-item/nimble-tree-item.module.ngfactory.d.ts +3 -0
- package/directives/tree-view/nimble-tree-view.directive.d.ts +11 -3
- package/directives/tree-view/nimble-tree-view.module.d.ts +0 -6
- package/directives/tree-view/nimble-tree-view.module.ngfactory.d.ts +3 -0
- package/directives/utilities/template-value-helpers.d.ts +20 -0
- package/esm2015/directives/button/nimble-button.directive.js +50 -21
- package/esm2015/directives/button/nimble-button.directive.ngsummary.json +1 -0
- package/esm2015/directives/button/nimble-button.module.js +8 -13
- package/esm2015/directives/button/nimble-button.module.ngfactory.js +12 -0
- package/esm2015/directives/button/nimble-button.module.ngsummary.json +1 -0
- package/esm2015/directives/checkbox/nimble-checkbox-control-value-accessor.directive.js +15 -23
- package/esm2015/directives/checkbox/nimble-checkbox-control-value-accessor.directive.ngsummary.json +1 -0
- package/esm2015/directives/checkbox/nimble-checkbox.directive.js +6 -10
- package/esm2015/directives/checkbox/nimble-checkbox.directive.ngsummary.json +1 -0
- package/esm2015/directives/checkbox/nimble-checkbox.module.js +8 -13
- package/esm2015/directives/checkbox/nimble-checkbox.module.ngfactory.js +12 -0
- package/esm2015/directives/checkbox/nimble-checkbox.module.ngsummary.json +1 -0
- package/esm2015/directives/drawer/nimble-drawer.directive.js +60 -0
- package/esm2015/directives/drawer/nimble-drawer.directive.ngsummary.json +1 -0
- package/esm2015/directives/drawer/nimble-drawer.module.js +14 -0
- package/esm2015/directives/drawer/nimble-drawer.module.ngfactory.js +12 -0
- package/esm2015/directives/drawer/nimble-drawer.module.ngsummary.json +1 -0
- package/esm2015/directives/listbox-option/nimble-listbox-option.directive.js +27 -23
- package/esm2015/directives/listbox-option/nimble-listbox-option.directive.ngsummary.json +1 -0
- package/esm2015/directives/listbox-option/nimble-listbox-option.module.js +8 -13
- package/esm2015/directives/listbox-option/nimble-listbox-option.module.ngfactory.js +12 -0
- package/esm2015/directives/listbox-option/nimble-listbox-option.module.ngsummary.json +1 -0
- package/esm2015/directives/menu/nimble-menu.directive.js +12 -0
- package/esm2015/directives/menu/nimble-menu.directive.ngsummary.json +1 -0
- package/esm2015/directives/menu/nimble-menu.module.js +14 -0
- package/esm2015/directives/menu/nimble-menu.module.ngfactory.js +12 -0
- package/esm2015/directives/menu/nimble-menu.module.ngsummary.json +1 -0
- package/esm2015/directives/menu-item/nimble-menu-item.directive.js +30 -0
- package/esm2015/directives/menu-item/nimble-menu-item.directive.ngsummary.json +1 -0
- package/esm2015/directives/menu-item/nimble-menu-item.module.js +14 -0
- package/esm2015/directives/menu-item/nimble-menu-item.module.ngfactory.js +12 -0
- package/esm2015/directives/menu-item/nimble-menu-item.module.ngsummary.json +1 -0
- package/esm2015/directives/number-field/nimble-number-field-control-value-accessor.directive.js +24 -0
- package/esm2015/directives/number-field/nimble-number-field-control-value-accessor.directive.ngsummary.json +1 -0
- package/esm2015/directives/number-field/nimble-number-field.directive.js +56 -36
- package/esm2015/directives/number-field/nimble-number-field.directive.ngsummary.json +1 -0
- package/esm2015/directives/number-field/nimble-number-field.module.js +9 -15
- package/esm2015/directives/number-field/nimble-number-field.module.ngfactory.js +12 -0
- package/esm2015/directives/number-field/nimble-number-field.module.ngsummary.json +1 -0
- package/esm2015/directives/select/nimble-select-control-value-accessor.directive.js +14 -22
- package/esm2015/directives/select/nimble-select-control-value-accessor.directive.ngsummary.json +1 -0
- package/esm2015/directives/select/nimble-select.directive.js +6 -10
- package/esm2015/directives/select/nimble-select.directive.ngsummary.json +1 -0
- package/esm2015/directives/select/nimble-select.module.js +8 -13
- package/esm2015/directives/select/nimble-select.module.ngfactory.js +12 -0
- package/esm2015/directives/select/nimble-select.module.ngsummary.json +1 -0
- package/esm2015/directives/tab/nimble-tab.directive.js +25 -16
- package/esm2015/directives/tab/nimble-tab.directive.ngsummary.json +1 -0
- package/esm2015/directives/tab/nimble-tab.module.js +8 -13
- package/esm2015/directives/tab/nimble-tab.module.ngfactory.js +12 -0
- package/esm2015/directives/tab/nimble-tab.module.ngsummary.json +1 -0
- package/esm2015/directives/tab-panel/nimble-tab-panel.directive.js +6 -10
- package/esm2015/directives/tab-panel/nimble-tab-panel.directive.ngsummary.json +1 -0
- package/esm2015/directives/tab-panel/nimble-tab-panel.module.js +8 -13
- package/esm2015/directives/tab-panel/nimble-tab-panel.module.ngfactory.js +12 -0
- package/esm2015/directives/tab-panel/nimble-tab-panel.module.ngsummary.json +1 -0
- package/esm2015/directives/tabs/nimble-tabs.directive.js +29 -25
- package/esm2015/directives/tabs/nimble-tabs.directive.ngsummary.json +1 -0
- package/esm2015/directives/tabs/nimble-tabs.module.js +8 -13
- package/esm2015/directives/tabs/nimble-tabs.module.ngfactory.js +12 -0
- package/esm2015/directives/tabs/nimble-tabs.module.ngsummary.json +1 -0
- package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.directive.js +6 -10
- package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.directive.ngsummary.json +1 -0
- package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.module.js +8 -13
- package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.module.ngfactory.js +12 -0
- package/esm2015/directives/tabs-toolbar/nimble-tabs-toolbar.module.ngsummary.json +1 -0
- package/esm2015/directives/text-field/nimble-text-field-control-value-accessor.directive.js +29 -0
- package/esm2015/directives/text-field/nimble-text-field-control-value-accessor.directive.ngsummary.json +1 -0
- package/esm2015/directives/text-field/nimble-text-field.directive.js +37 -16
- package/esm2015/directives/text-field/nimble-text-field.directive.ngsummary.json +1 -0
- package/esm2015/directives/text-field/nimble-text-field.module.js +9 -15
- package/esm2015/directives/text-field/nimble-text-field.module.ngfactory.js +12 -0
- package/esm2015/directives/text-field/nimble-text-field.module.ngsummary.json +1 -0
- package/esm2015/directives/theme-provider/nimble-theme-provider.directive.js +26 -16
- package/esm2015/directives/theme-provider/nimble-theme-provider.directive.ngsummary.json +1 -0
- package/esm2015/directives/theme-provider/nimble-theme-provider.module.js +8 -13
- package/esm2015/directives/theme-provider/nimble-theme-provider.module.ngfactory.js +12 -0
- package/esm2015/directives/theme-provider/nimble-theme-provider.module.ngsummary.json +1 -0
- package/esm2015/directives/toggle-button/nimble-toggle-button-control-value-accessor.directive.js +24 -0
- package/esm2015/directives/toggle-button/nimble-toggle-button-control-value-accessor.directive.ngsummary.json +1 -0
- package/esm2015/directives/toggle-button/nimble-toggle-button.directive.js +53 -0
- package/esm2015/directives/toggle-button/nimble-toggle-button.directive.ngsummary.json +1 -0
- package/esm2015/directives/toggle-button/nimble-toggle-button.module.js +15 -0
- package/esm2015/directives/toggle-button/nimble-toggle-button.module.ngfactory.js +12 -0
- package/esm2015/directives/toggle-button/nimble-toggle-button.module.ngsummary.json +1 -0
- package/esm2015/directives/tree-item/nimble-tree-item.directive.js +43 -52
- package/esm2015/directives/tree-item/nimble-tree-item.directive.ngsummary.json +1 -0
- package/esm2015/directives/tree-item/nimble-tree-item.module.js +8 -13
- package/esm2015/directives/tree-item/nimble-tree-item.module.ngfactory.js +12 -0
- package/esm2015/directives/tree-item/nimble-tree-item.module.ngsummary.json +1 -0
- package/esm2015/directives/tree-view/nimble-tree-view.directive.js +28 -11
- package/esm2015/directives/tree-view/nimble-tree-view.directive.ngsummary.json +1 -0
- package/esm2015/directives/tree-view/nimble-tree-view.module.js +8 -13
- package/esm2015/directives/tree-view/nimble-tree-view.module.ngfactory.js +12 -0
- package/esm2015/directives/tree-view/nimble-tree-view.module.ngsummary.json +1 -0
- package/esm2015/directives/utilities/template-value-helpers.js +37 -0
- package/esm2015/directives/utilities/template-value-helpers.ngsummary.json +1 -0
- package/esm2015/ni-nimble-angular.js +2 -1
- package/esm2015/ni-nimble-angular.ngsummary.json +1 -0
- package/esm2015/public-api.js +40 -15
- package/esm2015/public-api.ngsummary.json +1 -0
- package/esm2015/testing/async-helpers.js +12 -0
- package/esm2015/testing/async-helpers.ngsummary.json +1 -0
- package/fesm2015/ni-nimble-angular.js +798 -540
- package/fesm2015/ni-nimble-angular.js.map +1 -1
- package/ni-nimble-angular.d.ts +1 -1
- package/ni-nimble-angular.metadata.json +1 -0
- package/package.json +4 -20
- package/public-api.d.ts +39 -14
- package/styles/fonts.scss +4 -0
- package/styles/tokens.scss +6 -0
- package/testing/async-helpers.d.ts +11 -0
- 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 -9
- package/directives/control-value-accessor/nimble-default-control-value-accessor.directive.d.ts +0 -12
- package/directives/control-value-accessor/nimble-number-control-value-accessor.directive.d.ts +0 -12
- package/directives/listbox-option/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/checkbox/index.js +0 -4
- package/esm2015/directives/control-value-accessor/index.js +0 -4
- package/esm2015/directives/control-value-accessor/nimble-control-value-accessor.module.js +0 -19
- package/esm2015/directives/control-value-accessor/nimble-default-control-value-accessor.directive.js +0 -37
- package/esm2015/directives/control-value-accessor/nimble-number-control-value-accessor.directive.js +0 -32
- package/esm2015/directives/listbox-option/index.js +0 -3
- package/esm2015/directives/number-field/index.js +0 -3
- package/esm2015/directives/select/index.js +0 -4
- package/esm2015/directives/tab/index.js +0 -3
- package/esm2015/directives/tab-panel/index.js +0 -3
- package/esm2015/directives/tabs/index.js +0 -3
- package/esm2015/directives/tabs-toolbar/index.js +0 -3
- package/esm2015/directives/text-field/index.js +0 -3
- package/esm2015/directives/theme-provider/index.js +0 -3
- package/esm2015/directives/tree-item/index.js +0 -3
- package/esm2015/directives/tree-view/index.js +0 -3
|
@@ -1,232 +1,238 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { Directive, Renderer2, ElementRef, Input, NgModule, forwardRef, EventEmitter, Output, HostListener, Inject, Optional, Host } from '@angular/core';
|
|
2
|
+
export { ButtonAppearance } from '@ni/nimble-components/dist/esm/button/types';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
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
4
|
import '@ni/nimble-components/dist/esm/button';
|
|
11
|
-
import '@
|
|
12
|
-
import '@ni/nimble-components/dist/esm/tree-item';
|
|
5
|
+
import { CheckboxControlValueAccessor, NG_VALUE_ACCESSOR, SelectControlValueAccessor, NgSelectOption, NumberValueAccessor, DefaultValueAccessor } from '@angular/forms';
|
|
13
6
|
import '@ni/nimble-components/dist/esm/checkbox';
|
|
14
|
-
import '@ni/nimble-components/dist/esm/
|
|
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/drawer';
|
|
10
|
+
import '@ni/nimble-components/dist/esm/listbox-option';
|
|
11
|
+
import '@ni/nimble-components/dist/esm/menu';
|
|
12
|
+
import '@ni/nimble-components/dist/esm/menu-item';
|
|
13
|
+
import '@ni/nimble-components/dist/esm/number-field';
|
|
14
|
+
import '@ni/nimble-components/dist/esm/select';
|
|
15
15
|
import '@ni/nimble-components/dist/esm/tab';
|
|
16
16
|
import '@ni/nimble-components/dist/esm/tab-panel';
|
|
17
|
+
import '@ni/nimble-components/dist/esm/tabs';
|
|
17
18
|
import '@ni/nimble-components/dist/esm/tabs-toolbar';
|
|
19
|
+
export { TextFieldType } from '@ni/nimble-components/dist/esm/text-field/types';
|
|
20
|
+
import '@ni/nimble-components/dist/esm/text-field';
|
|
21
|
+
export { Theme } from '@ni/nimble-components/dist/esm/theme-provider/types';
|
|
22
|
+
import '@ni/nimble-components/dist/esm/theme-provider';
|
|
23
|
+
import '@ni/nimble-components/dist/esm/toggle-button';
|
|
24
|
+
import '@ni/nimble-components/dist/esm/tree-item';
|
|
25
|
+
export { TreeViewSelectionMode } from '@ni/nimble-components/dist/esm/tree-view/types';
|
|
26
|
+
import '@ni/nimble-components/dist/esm/tree-view';
|
|
27
|
+
import { waitForUpdatesAsync as waitForUpdatesAsync$1 } from '@ni/nimble-components/dist/esm/testing/async-helpers';
|
|
28
|
+
export { processUpdates } from '@ni/nimble-components/dist/esm/testing/async-helpers';
|
|
18
29
|
|
|
19
30
|
/**
|
|
20
|
-
*
|
|
31
|
+
* Conversion helpers for values coming from template attributes or property bindings
|
|
21
32
|
*/
|
|
22
|
-
class NimbleThemeProviderDirective {
|
|
23
|
-
}
|
|
24
|
-
NimbleThemeProviderDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleThemeProviderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
25
|
-
NimbleThemeProviderDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: NimbleThemeProviderDirective, selector: "nimble-theme-provider", inputs: { theme: "theme" }, host: { properties: { "attr.theme": "this.theme" } }, ngImport: i0 });
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleThemeProviderDirective, decorators: [{
|
|
27
|
-
type: Directive,
|
|
28
|
-
args: [{
|
|
29
|
-
selector: 'nimble-theme-provider'
|
|
30
|
-
}]
|
|
31
|
-
}], propDecorators: { theme: [{
|
|
32
|
-
type: HostBinding,
|
|
33
|
-
args: ['attr.theme']
|
|
34
|
-
}, {
|
|
35
|
-
type: Input
|
|
36
|
-
}] } });
|
|
37
|
-
|
|
38
|
-
class NimbleThemeProviderModule {
|
|
39
|
-
}
|
|
40
|
-
NimbleThemeProviderModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleThemeProviderModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
41
|
-
NimbleThemeProviderModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleThemeProviderModule, declarations: [NimbleThemeProviderDirective], imports: [CommonModule], exports: [NimbleThemeProviderDirective] });
|
|
42
|
-
NimbleThemeProviderModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleThemeProviderModule, imports: [[CommonModule]] });
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleThemeProviderModule, decorators: [{
|
|
44
|
-
type: NgModule,
|
|
45
|
-
args: [{
|
|
46
|
-
declarations: [NimbleThemeProviderDirective],
|
|
47
|
-
imports: [CommonModule],
|
|
48
|
-
exports: [NimbleThemeProviderDirective]
|
|
49
|
-
}]
|
|
50
|
-
}] });
|
|
51
|
-
|
|
52
33
|
/**
|
|
53
|
-
*
|
|
34
|
+
* Converts values from templates (empty string or null) or boolean bindings to a boolean property representation
|
|
54
35
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
36
|
+
const toBooleanProperty = (value) => {
|
|
37
|
+
if (value === false || value === null) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
// For boolean attributes the empty string value is true
|
|
41
|
+
return true;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Converts values from templates (empty string or null) or boolean bindings to an Aria boolean
|
|
45
|
+
* attribute representation (the strings "true" or "false")
|
|
46
|
+
*/
|
|
47
|
+
const toBooleanAriaAttribute = (value) => {
|
|
48
|
+
if (value === false || value === null) {
|
|
49
|
+
return 'false';
|
|
50
|
+
}
|
|
51
|
+
// For boolean attributes the empty string value is true
|
|
52
|
+
return 'true';
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Converts values from templates (number representation as a string) or number bindings to a number property representation
|
|
56
|
+
*/
|
|
57
|
+
const toNumberProperty = (value) => {
|
|
58
|
+
// Angular: https://github.com/angular/angular/blob/2664bc2b3ef4ee5fd671f915828cfcc274a36c77/packages/forms/src/directives/number_value_accessor.ts#L67
|
|
59
|
+
// And Fast: https://github.com/microsoft/fast/blob/46bb6d9aab2c37105f4434db3795e176c2354a4f/packages/web-components/fast-element/src/components/attributes.ts#L100
|
|
60
|
+
// Handle numeric conversions from the view differently
|
|
61
|
+
// Since Number(val) https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec-number-constructor-number-value
|
|
62
|
+
// and val * 1 https://tc39.es/ecma262/multipage/ecmascript-language-expressions.html#sec-applystringornumericbinaryoperator
|
|
63
|
+
// Are identical (use ToNumeric algorithm), went with Number() for clarity
|
|
64
|
+
return Number(value);
|
|
65
|
+
};
|
|
70
66
|
|
|
71
67
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* Directive decorator based on DefaultValueAccessor decorator
|
|
75
|
-
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/default_value_accessor.ts#L72
|
|
68
|
+
* Directive to provide Angular integration for the button.
|
|
76
69
|
*/
|
|
77
|
-
class
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
70
|
+
class NimbleButtonDirective {
|
|
71
|
+
constructor(renderer, elementRef) {
|
|
72
|
+
this.renderer = renderer;
|
|
73
|
+
this.elementRef = elementRef;
|
|
74
|
+
}
|
|
75
|
+
get appearance() {
|
|
76
|
+
return this.elementRef.nativeElement.appearance;
|
|
77
|
+
}
|
|
78
|
+
set appearance(value) {
|
|
79
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'appearance', value);
|
|
80
|
+
}
|
|
81
|
+
get disabled() {
|
|
82
|
+
return this.elementRef.nativeElement.disabled;
|
|
83
|
+
}
|
|
84
|
+
set disabled(value) {
|
|
85
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
86
|
+
}
|
|
87
|
+
get type() {
|
|
88
|
+
return this.elementRef.nativeElement.type;
|
|
89
|
+
}
|
|
90
|
+
set type(value) {
|
|
91
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'type', value);
|
|
92
|
+
}
|
|
93
|
+
get contentHidden() {
|
|
94
|
+
return this.elementRef.nativeElement.contentHidden;
|
|
95
|
+
}
|
|
96
|
+
// contentHidden property intentionally maps to the content-hidden attribute
|
|
97
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
98
|
+
set contentHidden(value) {
|
|
99
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'contentHidden', toBooleanProperty(value));
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
NimbleButtonDirective.decorators = [
|
|
103
|
+
{ type: Directive, args: [{
|
|
104
|
+
selector: 'nimble-button'
|
|
105
|
+
},] }
|
|
106
|
+
];
|
|
107
|
+
NimbleButtonDirective.ctorParameters = () => [
|
|
108
|
+
{ type: Renderer2 },
|
|
109
|
+
{ type: ElementRef }
|
|
110
|
+
];
|
|
111
|
+
NimbleButtonDirective.propDecorators = {
|
|
112
|
+
appearance: [{ type: Input }],
|
|
113
|
+
disabled: [{ type: Input }],
|
|
114
|
+
type: [{ type: Input }],
|
|
115
|
+
contentHidden: [{ type: Input, args: ['content-hidden',] }]
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
class NimbleButtonModule {
|
|
119
|
+
}
|
|
120
|
+
NimbleButtonModule.decorators = [
|
|
121
|
+
{ type: NgModule, args: [{
|
|
122
|
+
declarations: [NimbleButtonDirective],
|
|
123
|
+
imports: [CommonModule],
|
|
124
|
+
exports: [NimbleButtonDirective]
|
|
125
|
+
},] }
|
|
126
|
+
];
|
|
104
127
|
|
|
105
128
|
/**
|
|
106
|
-
* Extension of Angular's
|
|
129
|
+
* Extension of Angular's CheckboxControlValueAccessor to target the Nimble checkbox control.
|
|
107
130
|
*
|
|
108
|
-
* Directive decorator based on
|
|
109
|
-
* https://github.com/angular/angular/blob/
|
|
131
|
+
* Directive decorator based on CheckboxControlValueAccessor decorator
|
|
132
|
+
* https://github.com/angular/angular/blob/bbababe5900ea8f4c8fccd88238f6fe08a2ceb63/packages/forms/src/directives/checkbox_value_accessor.ts#L42
|
|
110
133
|
*/
|
|
111
|
-
class
|
|
112
|
-
}
|
|
113
|
-
NimbleNumberControlValueAccessorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleNumberControlValueAccessorDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
114
|
-
NimbleNumberControlValueAccessorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.5", type: NimbleNumberControlValueAccessorDirective, selector: "nimble-number-field[formControlName],nimble-number-field[formControl],nimble-number-field[ngModel]", host: { listeners: { "input": "onChange($event.target.value)", "blur": "onTouched()" } }, providers: [{
|
|
115
|
-
provide: NG_VALUE_ACCESSOR,
|
|
116
|
-
useExisting: forwardRef(() => NimbleNumberControlValueAccessorDirective),
|
|
117
|
-
multi: true
|
|
118
|
-
}], usesInheritance: true, ngImport: i0 });
|
|
119
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleNumberControlValueAccessorDirective, decorators: [{
|
|
120
|
-
type: Directive,
|
|
121
|
-
args: [{
|
|
122
|
-
selector: 'nimble-number-field[formControlName],nimble-number-field[formControl],nimble-number-field[ngModel]',
|
|
123
|
-
// The following host metadata is duplicated from NumberValueAccessor
|
|
124
|
-
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
125
|
-
host: { '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
|
|
126
|
-
providers: [{
|
|
127
|
-
provide: NG_VALUE_ACCESSOR,
|
|
128
|
-
useExisting: forwardRef(() => NimbleNumberControlValueAccessorDirective),
|
|
129
|
-
multi: true
|
|
130
|
-
}]
|
|
131
|
-
}]
|
|
132
|
-
}] });
|
|
133
|
-
|
|
134
|
-
class NimbleControlValueAccessorModule {
|
|
135
|
-
}
|
|
136
|
-
NimbleControlValueAccessorModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleControlValueAccessorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
137
|
-
NimbleControlValueAccessorModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleControlValueAccessorModule, declarations: [NimbleDefaultControlValueAccessorDirective, NimbleNumberControlValueAccessorDirective], imports: [CommonModule], exports: [NimbleDefaultControlValueAccessorDirective, NimbleNumberControlValueAccessorDirective] });
|
|
138
|
-
NimbleControlValueAccessorModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleControlValueAccessorModule, imports: [[CommonModule]] });
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleControlValueAccessorModule, decorators: [{
|
|
140
|
-
type: NgModule,
|
|
141
|
-
args: [{
|
|
142
|
-
declarations: [NimbleDefaultControlValueAccessorDirective, NimbleNumberControlValueAccessorDirective],
|
|
143
|
-
imports: [CommonModule],
|
|
144
|
-
exports: [NimbleDefaultControlValueAccessorDirective, NimbleNumberControlValueAccessorDirective]
|
|
145
|
-
}]
|
|
146
|
-
}] });
|
|
147
|
-
|
|
148
|
-
class NimbleTextFieldModule {
|
|
134
|
+
class NimbleCheckboxControlValueAccessorDirective extends CheckboxControlValueAccessor {
|
|
149
135
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
136
|
+
NimbleCheckboxControlValueAccessorDirective.decorators = [
|
|
137
|
+
{ type: Directive, args: [{
|
|
138
|
+
selector: 'nimble-checkbox[formControlName],nimble-checkbox[formControl],nimble-checkbox[ngModel]',
|
|
139
|
+
// The following host metadata is duplicated from CheckboxControlValueAccessor
|
|
140
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
141
|
+
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
|
|
142
|
+
providers: [{
|
|
143
|
+
provide: NG_VALUE_ACCESSOR,
|
|
144
|
+
useExisting: forwardRef(() => NimbleCheckboxControlValueAccessorDirective),
|
|
145
|
+
multi: true
|
|
146
|
+
}]
|
|
147
|
+
},] }
|
|
148
|
+
];
|
|
162
149
|
|
|
163
150
|
/**
|
|
164
|
-
* Directive to provide Angular integration for the
|
|
151
|
+
* Directive to provide Angular integration for the checkbox.
|
|
165
152
|
*/
|
|
166
|
-
class
|
|
153
|
+
class NimbleCheckboxDirective {
|
|
167
154
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
selector: 'nimble-number-field'
|
|
174
|
-
}]
|
|
175
|
-
}], propDecorators: { readonly: [{
|
|
176
|
-
type: HostBinding,
|
|
177
|
-
args: ['attr.readonly']
|
|
178
|
-
}, {
|
|
179
|
-
type: Input
|
|
180
|
-
}], min: [{
|
|
181
|
-
type: HostBinding,
|
|
182
|
-
args: ['attr.min']
|
|
183
|
-
}, {
|
|
184
|
-
type: Input
|
|
185
|
-
}], max: [{
|
|
186
|
-
type: HostBinding,
|
|
187
|
-
args: ['attr.max']
|
|
188
|
-
}, {
|
|
189
|
-
type: Input
|
|
190
|
-
}], step: [{
|
|
191
|
-
type: HostBinding,
|
|
192
|
-
args: ['attr.step']
|
|
193
|
-
}, {
|
|
194
|
-
type: Input
|
|
195
|
-
}], placeholder: [{
|
|
196
|
-
type: HostBinding,
|
|
197
|
-
args: ['attr.placeholder']
|
|
198
|
-
}, {
|
|
199
|
-
type: Input
|
|
200
|
-
}] } });
|
|
155
|
+
NimbleCheckboxDirective.decorators = [
|
|
156
|
+
{ type: Directive, args: [{
|
|
157
|
+
selector: 'nimble-checkbox'
|
|
158
|
+
},] }
|
|
159
|
+
];
|
|
201
160
|
|
|
202
|
-
class
|
|
161
|
+
class NimbleCheckboxModule {
|
|
203
162
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
imports: [CommonModule, NimbleControlValueAccessorModule],
|
|
212
|
-
providers: [],
|
|
213
|
-
exports: [NimbleNumberFieldDirective, NimbleControlValueAccessorModule]
|
|
214
|
-
}]
|
|
215
|
-
}] });
|
|
163
|
+
NimbleCheckboxModule.decorators = [
|
|
164
|
+
{ type: NgModule, args: [{
|
|
165
|
+
declarations: [NimbleCheckboxDirective, NimbleCheckboxControlValueAccessorDirective],
|
|
166
|
+
imports: [CommonModule],
|
|
167
|
+
exports: [NimbleCheckboxDirective, NimbleCheckboxControlValueAccessorDirective]
|
|
168
|
+
},] }
|
|
169
|
+
];
|
|
216
170
|
|
|
217
171
|
/**
|
|
218
|
-
* Directive
|
|
172
|
+
* Directive to provide Angular integration for the drawer.
|
|
219
173
|
*/
|
|
220
|
-
class
|
|
174
|
+
class NimbleDrawerDirective {
|
|
175
|
+
constructor(renderer, elementRef) {
|
|
176
|
+
this.renderer = renderer;
|
|
177
|
+
this.elementRef = elementRef;
|
|
178
|
+
this.stateChange = new EventEmitter();
|
|
179
|
+
}
|
|
180
|
+
get location() {
|
|
181
|
+
return this.elementRef.nativeElement.location;
|
|
182
|
+
}
|
|
183
|
+
set location(value) {
|
|
184
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'location', value);
|
|
185
|
+
}
|
|
186
|
+
get state() {
|
|
187
|
+
return this.elementRef.nativeElement.state;
|
|
188
|
+
}
|
|
189
|
+
set state(value) {
|
|
190
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'state', value);
|
|
191
|
+
}
|
|
192
|
+
get modal() {
|
|
193
|
+
return this.elementRef.nativeElement.modal;
|
|
194
|
+
}
|
|
195
|
+
set modal(value) {
|
|
196
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'modal', toBooleanProperty(value));
|
|
197
|
+
}
|
|
198
|
+
show() {
|
|
199
|
+
this.state = DrawerState.Opening;
|
|
200
|
+
}
|
|
201
|
+
hide() {
|
|
202
|
+
this.state = DrawerState.Closing;
|
|
203
|
+
}
|
|
204
|
+
onStateChanged($event) {
|
|
205
|
+
if ($event.target === this.elementRef.nativeElement) {
|
|
206
|
+
this.stateChange.emit(this.state);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
221
209
|
}
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
210
|
+
NimbleDrawerDirective.decorators = [
|
|
211
|
+
{ type: Directive, args: [{
|
|
212
|
+
selector: 'nimble-drawer'
|
|
213
|
+
},] }
|
|
214
|
+
];
|
|
215
|
+
NimbleDrawerDirective.ctorParameters = () => [
|
|
216
|
+
{ type: Renderer2 },
|
|
217
|
+
{ type: ElementRef }
|
|
218
|
+
];
|
|
219
|
+
NimbleDrawerDirective.propDecorators = {
|
|
220
|
+
location: [{ type: Input }],
|
|
221
|
+
state: [{ type: Input }],
|
|
222
|
+
modal: [{ type: Input }],
|
|
223
|
+
stateChange: [{ type: Output }],
|
|
224
|
+
onStateChanged: [{ type: HostListener, args: ['state-change', ['$event'],] }]
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
class NimbleDrawerModule {
|
|
228
|
+
}
|
|
229
|
+
NimbleDrawerModule.decorators = [
|
|
230
|
+
{ type: NgModule, args: [{
|
|
231
|
+
declarations: [NimbleDrawerDirective],
|
|
232
|
+
imports: [CommonModule],
|
|
233
|
+
exports: [NimbleDrawerDirective]
|
|
234
|
+
},] }
|
|
235
|
+
];
|
|
230
236
|
|
|
231
237
|
/**
|
|
232
238
|
* Extension of Angular's SelectControlValueAccessor to target the Nimble select control.
|
|
@@ -238,412 +244,664 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
238
244
|
*/
|
|
239
245
|
class NimbleSelectControlValueAccessorDirective extends SelectControlValueAccessor {
|
|
240
246
|
}
|
|
241
|
-
NimbleSelectControlValueAccessorDirective
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
providers: [{
|
|
255
|
-
provide: NG_VALUE_ACCESSOR,
|
|
256
|
-
useExisting: forwardRef(() => NimbleSelectControlValueAccessorDirective),
|
|
257
|
-
multi: true
|
|
258
|
-
}]
|
|
259
|
-
}]
|
|
260
|
-
}] });
|
|
261
|
-
|
|
262
|
-
class NimbleSelectModule {
|
|
263
|
-
}
|
|
264
|
-
NimbleSelectModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
265
|
-
NimbleSelectModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleSelectModule, declarations: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective], imports: [CommonModule], exports: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective] });
|
|
266
|
-
NimbleSelectModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleSelectModule, imports: [[CommonModule]] });
|
|
267
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImport: i0, type: NimbleSelectModule, decorators: [{
|
|
268
|
-
type: NgModule,
|
|
269
|
-
args: [{
|
|
270
|
-
declarations: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective],
|
|
271
|
-
imports: [CommonModule],
|
|
272
|
-
exports: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective]
|
|
273
|
-
}]
|
|
274
|
-
}] });
|
|
247
|
+
NimbleSelectControlValueAccessorDirective.decorators = [
|
|
248
|
+
{ type: Directive, args: [{
|
|
249
|
+
selector: 'nimble-select:not([multiple])[formControlName],nimble-select:not([multiple])[formControl],nimble-select:not([multiple])[ngModel]',
|
|
250
|
+
// The following host metadata is duplicated from SelectControlValueAccessor
|
|
251
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
252
|
+
host: { '(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
|
|
253
|
+
providers: [{
|
|
254
|
+
provide: NG_VALUE_ACCESSOR,
|
|
255
|
+
useExisting: forwardRef(() => NimbleSelectControlValueAccessorDirective),
|
|
256
|
+
multi: true
|
|
257
|
+
}]
|
|
258
|
+
},] }
|
|
259
|
+
];
|
|
275
260
|
|
|
276
261
|
/**
|
|
277
262
|
* Directive to provide Angular integration for the listbox option.
|
|
278
263
|
*/
|
|
279
264
|
class NimbleListboxOptionDirective extends NgSelectOption {
|
|
280
|
-
constructor(
|
|
281
|
-
super(
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
265
|
+
constructor(elementRef, renderer, select) {
|
|
266
|
+
super(elementRef, renderer, select);
|
|
267
|
+
this.elementRef = elementRef;
|
|
268
|
+
this.renderer = renderer;
|
|
269
|
+
}
|
|
270
|
+
get disabled() {
|
|
271
|
+
return this.elementRef.nativeElement.disabled;
|
|
272
|
+
}
|
|
273
|
+
set disabled(value) {
|
|
274
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
NimbleListboxOptionDirective.decorators = [
|
|
278
|
+
{ type: Directive, args: [{
|
|
279
|
+
selector: 'nimble-listbox-option'
|
|
280
|
+
},] }
|
|
281
|
+
];
|
|
282
|
+
NimbleListboxOptionDirective.ctorParameters = () => [
|
|
283
|
+
{ type: ElementRef },
|
|
284
|
+
{ type: Renderer2 },
|
|
285
|
+
{ type: NimbleSelectControlValueAccessorDirective, decorators: [{ type: Inject, args: [NimbleSelectControlValueAccessorDirective,] }, { type: Optional }, { type: Host }] }
|
|
286
|
+
];
|
|
287
|
+
NimbleListboxOptionDirective.propDecorators = {
|
|
288
|
+
disabled: [{ type: Input }]
|
|
289
|
+
};
|
|
301
290
|
|
|
302
291
|
class NimbleListboxOptionModule {
|
|
303
292
|
}
|
|
304
|
-
NimbleListboxOptionModule
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
imports: [CommonModule],
|
|
312
|
-
exports: [NimbleListboxOptionDirective]
|
|
313
|
-
}]
|
|
314
|
-
}] });
|
|
293
|
+
NimbleListboxOptionModule.decorators = [
|
|
294
|
+
{ type: NgModule, args: [{
|
|
295
|
+
declarations: [NimbleListboxOptionDirective],
|
|
296
|
+
imports: [CommonModule],
|
|
297
|
+
exports: [NimbleListboxOptionDirective]
|
|
298
|
+
},] }
|
|
299
|
+
];
|
|
315
300
|
|
|
316
301
|
/**
|
|
317
|
-
* Directive to provide Angular integration for the
|
|
302
|
+
* Directive to provide Angular integration for the menu.
|
|
318
303
|
*/
|
|
319
|
-
class
|
|
304
|
+
class NimbleMenuDirective {
|
|
320
305
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
selector: 'nimble-button'
|
|
327
|
-
}]
|
|
328
|
-
}], propDecorators: { disabled: [{
|
|
329
|
-
type: HostBinding,
|
|
330
|
-
args: ['disabled']
|
|
331
|
-
}, {
|
|
332
|
-
type: Input
|
|
333
|
-
}], appearance: [{
|
|
334
|
-
type: HostBinding,
|
|
335
|
-
args: ['appearance']
|
|
336
|
-
}, {
|
|
337
|
-
type: Input
|
|
338
|
-
}] } });
|
|
306
|
+
NimbleMenuDirective.decorators = [
|
|
307
|
+
{ type: Directive, args: [{
|
|
308
|
+
selector: 'nimble-menu'
|
|
309
|
+
},] }
|
|
310
|
+
];
|
|
339
311
|
|
|
340
|
-
class
|
|
312
|
+
class NimbleMenuModule {
|
|
341
313
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
imports: [CommonModule],
|
|
350
|
-
exports: [NimbleButtonDirective]
|
|
351
|
-
}]
|
|
352
|
-
}] });
|
|
314
|
+
NimbleMenuModule.decorators = [
|
|
315
|
+
{ type: NgModule, args: [{
|
|
316
|
+
declarations: [NimbleMenuDirective],
|
|
317
|
+
imports: [CommonModule],
|
|
318
|
+
exports: [NimbleMenuDirective]
|
|
319
|
+
},] }
|
|
320
|
+
];
|
|
353
321
|
|
|
354
322
|
/**
|
|
355
|
-
* Directive to provide Angular integration for the
|
|
323
|
+
* Directive to provide Angular integration for the menu.
|
|
356
324
|
*/
|
|
357
|
-
class
|
|
325
|
+
class NimbleMenuItemDirective {
|
|
326
|
+
constructor(renderer, elementRef) {
|
|
327
|
+
this.renderer = renderer;
|
|
328
|
+
this.elementRef = elementRef;
|
|
329
|
+
}
|
|
330
|
+
get disabled() {
|
|
331
|
+
return this.elementRef.nativeElement.disabled;
|
|
332
|
+
}
|
|
333
|
+
set disabled(value) {
|
|
334
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
NimbleMenuItemDirective.decorators = [
|
|
338
|
+
{ type: Directive, args: [{
|
|
339
|
+
selector: 'nimble-menu-item'
|
|
340
|
+
},] }
|
|
341
|
+
];
|
|
342
|
+
NimbleMenuItemDirective.ctorParameters = () => [
|
|
343
|
+
{ type: Renderer2 },
|
|
344
|
+
{ type: ElementRef }
|
|
345
|
+
];
|
|
346
|
+
NimbleMenuItemDirective.propDecorators = {
|
|
347
|
+
disabled: [{ type: Input }]
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
class NimbleMenuItemModule {
|
|
358
351
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}] });
|
|
352
|
+
NimbleMenuItemModule.decorators = [
|
|
353
|
+
{ type: NgModule, args: [{
|
|
354
|
+
declarations: [NimbleMenuItemDirective],
|
|
355
|
+
imports: [CommonModule],
|
|
356
|
+
exports: [NimbleMenuItemDirective]
|
|
357
|
+
},] }
|
|
358
|
+
];
|
|
367
359
|
|
|
368
|
-
|
|
360
|
+
/**
|
|
361
|
+
* Extension of Angular's NumberValueAccessor to target the number-based inputs.
|
|
362
|
+
*
|
|
363
|
+
* Directive decorator based on NumberValueAccessor decorator
|
|
364
|
+
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/number_value_accessor.ts#L43
|
|
365
|
+
*/
|
|
366
|
+
class NimbleNumberFieldControlValueAccessorDirective extends NumberValueAccessor {
|
|
369
367
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
368
|
+
NimbleNumberFieldControlValueAccessorDirective.decorators = [
|
|
369
|
+
{ type: Directive, args: [{
|
|
370
|
+
selector: 'nimble-number-field[formControlName],nimble-number-field[formControl],nimble-number-field[ngModel]',
|
|
371
|
+
// The following host metadata is duplicated from NumberValueAccessor
|
|
372
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
373
|
+
host: { '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' },
|
|
374
|
+
providers: [{
|
|
375
|
+
provide: NG_VALUE_ACCESSOR,
|
|
376
|
+
useExisting: forwardRef(() => NimbleNumberFieldControlValueAccessorDirective),
|
|
377
|
+
multi: true
|
|
378
|
+
}]
|
|
379
|
+
},] }
|
|
380
|
+
];
|
|
381
381
|
|
|
382
382
|
/**
|
|
383
|
-
* Directive to provide Angular integration for the
|
|
383
|
+
* Directive to provide Angular integration for the number field.
|
|
384
384
|
*/
|
|
385
|
-
class
|
|
386
|
-
constructor(
|
|
387
|
-
this.
|
|
388
|
-
this.
|
|
389
|
-
this.expandedChange = new EventEmitter();
|
|
385
|
+
class NimbleNumberFieldDirective {
|
|
386
|
+
constructor(renderer, elementRef) {
|
|
387
|
+
this.renderer = renderer;
|
|
388
|
+
this.elementRef = elementRef;
|
|
390
389
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
if ($event.target === treeItemElement) {
|
|
394
|
-
this.selected = treeItemElement.selected;
|
|
395
|
-
this.selectedChange.emit(this.selected);
|
|
396
|
-
}
|
|
390
|
+
get readOnly() {
|
|
391
|
+
return this.elementRef.nativeElement.readOnly;
|
|
397
392
|
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
393
|
+
// readOnly property maps to the readonly attribute
|
|
394
|
+
// https://github.com/microsoft/fast/blob/46bb6d9aab2c37105f4434db3795e176c2354a4f/packages/web-components/fast-foundation/src/number-field/number-field.ts#L38
|
|
395
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
396
|
+
set readOnly(value) {
|
|
397
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'readOnly', toBooleanProperty(value));
|
|
398
|
+
}
|
|
399
|
+
get min() {
|
|
400
|
+
return this.elementRef.nativeElement.min;
|
|
401
|
+
}
|
|
402
|
+
set min(value) {
|
|
403
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'min', toNumberProperty(value));
|
|
404
|
+
}
|
|
405
|
+
get max() {
|
|
406
|
+
return this.elementRef.nativeElement.max;
|
|
407
|
+
}
|
|
408
|
+
set max(value) {
|
|
409
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'max', toNumberProperty(value));
|
|
410
|
+
}
|
|
411
|
+
get step() {
|
|
412
|
+
return this.elementRef.nativeElement.step;
|
|
413
|
+
}
|
|
414
|
+
set step(value) {
|
|
415
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'step', toNumberProperty(value));
|
|
416
|
+
}
|
|
417
|
+
get placeholder() {
|
|
418
|
+
return this.elementRef.nativeElement.placeholder;
|
|
419
|
+
}
|
|
420
|
+
set placeholder(value) {
|
|
421
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'placeholder', value);
|
|
404
422
|
}
|
|
405
423
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
type: Input
|
|
423
|
-
}], selected: [{
|
|
424
|
-
type: HostBinding,
|
|
425
|
-
args: ['selected']
|
|
426
|
-
}, {
|
|
427
|
-
type: HostBinding,
|
|
428
|
-
args: ['attr.aria-selected']
|
|
429
|
-
}, {
|
|
430
|
-
type: Input
|
|
431
|
-
}], selectedChange: [{
|
|
432
|
-
type: Output
|
|
433
|
-
}], expandedChange: [{
|
|
434
|
-
type: Output
|
|
435
|
-
}], onSelectedChange: [{
|
|
436
|
-
type: HostListener,
|
|
437
|
-
args: ['selected-change', ['$event']]
|
|
438
|
-
}], onExpandedChange: [{
|
|
439
|
-
type: HostListener,
|
|
440
|
-
args: ['expanded-change', ['$event']]
|
|
441
|
-
}] } });
|
|
424
|
+
NimbleNumberFieldDirective.decorators = [
|
|
425
|
+
{ type: Directive, args: [{
|
|
426
|
+
selector: 'nimble-number-field'
|
|
427
|
+
},] }
|
|
428
|
+
];
|
|
429
|
+
NimbleNumberFieldDirective.ctorParameters = () => [
|
|
430
|
+
{ type: Renderer2 },
|
|
431
|
+
{ type: ElementRef }
|
|
432
|
+
];
|
|
433
|
+
NimbleNumberFieldDirective.propDecorators = {
|
|
434
|
+
readOnly: [{ type: Input, args: ['readonly',] }],
|
|
435
|
+
min: [{ type: Input }],
|
|
436
|
+
max: [{ type: Input }],
|
|
437
|
+
step: [{ type: Input }],
|
|
438
|
+
placeholder: [{ type: Input }]
|
|
439
|
+
};
|
|
442
440
|
|
|
443
|
-
class
|
|
441
|
+
class NimbleNumberFieldModule {
|
|
444
442
|
}
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
imports: [CommonModule],
|
|
453
|
-
exports: [NimbleTreeItemDirective]
|
|
454
|
-
}]
|
|
455
|
-
}] });
|
|
443
|
+
NimbleNumberFieldModule.decorators = [
|
|
444
|
+
{ type: NgModule, args: [{
|
|
445
|
+
declarations: [NimbleNumberFieldDirective, NimbleNumberFieldControlValueAccessorDirective],
|
|
446
|
+
imports: [CommonModule],
|
|
447
|
+
exports: [NimbleNumberFieldDirective, NimbleNumberFieldControlValueAccessorDirective]
|
|
448
|
+
},] }
|
|
449
|
+
];
|
|
456
450
|
|
|
457
451
|
/**
|
|
458
|
-
* Directive
|
|
452
|
+
* Directive for Nimble select control Angular integration
|
|
459
453
|
*/
|
|
460
|
-
class
|
|
454
|
+
class NimbleSelectDirective {
|
|
455
|
+
}
|
|
456
|
+
NimbleSelectDirective.decorators = [
|
|
457
|
+
{ type: Directive, args: [{
|
|
458
|
+
selector: 'nimble-select',
|
|
459
|
+
},] }
|
|
460
|
+
];
|
|
461
|
+
|
|
462
|
+
class NimbleSelectModule {
|
|
461
463
|
}
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}] });
|
|
464
|
+
NimbleSelectModule.decorators = [
|
|
465
|
+
{ type: NgModule, args: [{
|
|
466
|
+
declarations: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective],
|
|
467
|
+
imports: [CommonModule],
|
|
468
|
+
exports: [NimbleSelectDirective, NimbleSelectControlValueAccessorDirective]
|
|
469
|
+
},] }
|
|
470
|
+
];
|
|
470
471
|
|
|
471
472
|
/**
|
|
472
|
-
*
|
|
473
|
-
*
|
|
474
|
-
* Directive decorator based on CheckboxControlValueAccessor decorator
|
|
475
|
-
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/checkbox_value_accessor.ts#L42
|
|
473
|
+
* Directive to provide Angular integration for the tab element.
|
|
476
474
|
*/
|
|
477
|
-
class
|
|
475
|
+
class NimbleTabDirective {
|
|
476
|
+
constructor(renderer, elementRef) {
|
|
477
|
+
this.renderer = renderer;
|
|
478
|
+
this.elementRef = elementRef;
|
|
479
|
+
}
|
|
480
|
+
get disabled() {
|
|
481
|
+
return this.elementRef.nativeElement.disabled;
|
|
482
|
+
}
|
|
483
|
+
set disabled(value) {
|
|
484
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
485
|
+
}
|
|
478
486
|
}
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
|
|
492
|
-
providers: [{
|
|
493
|
-
provide: NG_VALUE_ACCESSOR,
|
|
494
|
-
useExisting: forwardRef(() => NimbleCheckboxControlValueAccessorDirective),
|
|
495
|
-
multi: true
|
|
496
|
-
}]
|
|
497
|
-
}]
|
|
498
|
-
}] });
|
|
487
|
+
NimbleTabDirective.decorators = [
|
|
488
|
+
{ type: Directive, args: [{
|
|
489
|
+
selector: 'nimble-tab'
|
|
490
|
+
},] }
|
|
491
|
+
];
|
|
492
|
+
NimbleTabDirective.ctorParameters = () => [
|
|
493
|
+
{ type: Renderer2 },
|
|
494
|
+
{ type: ElementRef }
|
|
495
|
+
];
|
|
496
|
+
NimbleTabDirective.propDecorators = {
|
|
497
|
+
disabled: [{ type: Input }]
|
|
498
|
+
};
|
|
499
499
|
|
|
500
|
-
class
|
|
500
|
+
class NimbleTabModule {
|
|
501
501
|
}
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
502
|
+
NimbleTabModule.decorators = [
|
|
503
|
+
{ type: NgModule, args: [{
|
|
504
|
+
declarations: [NimbleTabDirective],
|
|
505
|
+
imports: [CommonModule],
|
|
506
|
+
exports: [NimbleTabDirective]
|
|
507
|
+
},] }
|
|
508
|
+
];
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Directive to provide Angular integration for the tab panel.
|
|
512
|
+
*/
|
|
513
|
+
class NimbleTabPanelDirective {
|
|
514
|
+
}
|
|
515
|
+
NimbleTabPanelDirective.decorators = [
|
|
516
|
+
{ type: Directive, args: [{
|
|
517
|
+
selector: 'nimble-tab-panel'
|
|
518
|
+
},] }
|
|
519
|
+
];
|
|
520
|
+
|
|
521
|
+
class NimbleTabPanelModule {
|
|
522
|
+
}
|
|
523
|
+
NimbleTabPanelModule.decorators = [
|
|
524
|
+
{ type: NgModule, args: [{
|
|
525
|
+
declarations: [NimbleTabPanelDirective],
|
|
526
|
+
imports: [CommonModule],
|
|
527
|
+
exports: [NimbleTabPanelDirective]
|
|
528
|
+
},] }
|
|
529
|
+
];
|
|
513
530
|
|
|
514
531
|
/**
|
|
515
532
|
* Directive to provide Angular integration for the tabs element.
|
|
516
533
|
*/
|
|
517
534
|
class NimbleTabsDirective {
|
|
518
|
-
constructor(
|
|
519
|
-
this.
|
|
535
|
+
constructor(renderer, elementRef) {
|
|
536
|
+
this.renderer = renderer;
|
|
537
|
+
this.elementRef = elementRef;
|
|
520
538
|
this.activeidChange = new EventEmitter();
|
|
521
539
|
}
|
|
522
|
-
|
|
523
|
-
this.
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
540
|
+
get activeid() {
|
|
541
|
+
return this.elementRef.nativeElement.activeid;
|
|
542
|
+
}
|
|
543
|
+
set activeid(value) {
|
|
544
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'activeid', value);
|
|
545
|
+
}
|
|
546
|
+
onChange($event) {
|
|
547
|
+
if ($event.target === this.elementRef.nativeElement) {
|
|
548
|
+
this.activeidChange.emit(this.activeid);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
NimbleTabsDirective.decorators = [
|
|
553
|
+
{ type: Directive, args: [{
|
|
554
|
+
selector: 'nimble-tabs'
|
|
555
|
+
},] }
|
|
556
|
+
];
|
|
557
|
+
NimbleTabsDirective.ctorParameters = () => [
|
|
558
|
+
{ type: Renderer2 },
|
|
559
|
+
{ type: ElementRef }
|
|
560
|
+
];
|
|
561
|
+
NimbleTabsDirective.propDecorators = {
|
|
562
|
+
activeid: [{ type: Input }],
|
|
563
|
+
activeidChange: [{ type: Output }],
|
|
564
|
+
onChange: [{ type: HostListener, args: ['change', ['$event'],] }]
|
|
565
|
+
};
|
|
544
566
|
|
|
545
567
|
class NimbleTabsModule {
|
|
546
568
|
}
|
|
547
|
-
NimbleTabsModule
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
imports: [CommonModule],
|
|
555
|
-
exports: [NimbleTabsDirective]
|
|
556
|
-
}]
|
|
557
|
-
}] });
|
|
569
|
+
NimbleTabsModule.decorators = [
|
|
570
|
+
{ type: NgModule, args: [{
|
|
571
|
+
declarations: [NimbleTabsDirective],
|
|
572
|
+
imports: [CommonModule],
|
|
573
|
+
exports: [NimbleTabsDirective]
|
|
574
|
+
},] }
|
|
575
|
+
];
|
|
558
576
|
|
|
559
577
|
/**
|
|
560
|
-
* Directive to provide Angular integration for the
|
|
578
|
+
* Directive to provide Angular integration for the tabs toolbar.
|
|
561
579
|
*/
|
|
562
|
-
class
|
|
580
|
+
class NimbleTabsToolbarDirective {
|
|
563
581
|
}
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
selector: 'nimble-tab'
|
|
570
|
-
}]
|
|
571
|
-
}], propDecorators: { disabled: [{
|
|
572
|
-
type: HostBinding,
|
|
573
|
-
args: ['attr.disabled']
|
|
574
|
-
}, {
|
|
575
|
-
type: Input
|
|
576
|
-
}] } });
|
|
582
|
+
NimbleTabsToolbarDirective.decorators = [
|
|
583
|
+
{ type: Directive, args: [{
|
|
584
|
+
selector: 'nimble-tabs-toolbar'
|
|
585
|
+
},] }
|
|
586
|
+
];
|
|
577
587
|
|
|
578
|
-
class
|
|
588
|
+
class NimbleTabsToolbarModule {
|
|
579
589
|
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
imports: [CommonModule],
|
|
588
|
-
exports: [NimbleTabDirective]
|
|
589
|
-
}]
|
|
590
|
-
}] });
|
|
590
|
+
NimbleTabsToolbarModule.decorators = [
|
|
591
|
+
{ type: NgModule, args: [{
|
|
592
|
+
declarations: [NimbleTabsToolbarDirective],
|
|
593
|
+
imports: [CommonModule],
|
|
594
|
+
exports: [NimbleTabsToolbarDirective]
|
|
595
|
+
},] }
|
|
596
|
+
];
|
|
591
597
|
|
|
592
598
|
/**
|
|
593
|
-
*
|
|
599
|
+
* Extension of Angular's DefaultValueAccessor to target the text-based inputs.
|
|
600
|
+
*
|
|
601
|
+
* Directive decorator based on DefaultValueAccessor decorator
|
|
602
|
+
* https://github.com/angular/angular/blob/master/packages/forms/src/directives/default_value_accessor.ts#L72
|
|
594
603
|
*/
|
|
595
|
-
class
|
|
604
|
+
class NimbleTextFieldControlValueAccessorDirective extends DefaultValueAccessor {
|
|
596
605
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
606
|
+
NimbleTextFieldControlValueAccessorDirective.decorators = [
|
|
607
|
+
{ type: Directive, args: [{
|
|
608
|
+
selector: 'nimble-text-field[formControlName],nimble-text-field[formControl],nimble-text-field[ngModel]',
|
|
609
|
+
// The following host metadata is duplicated from DefaultValueAccessor
|
|
610
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
611
|
+
host: {
|
|
612
|
+
'(input)': '$any(this)._handleInput($event.target.value)',
|
|
613
|
+
'(blur)': 'onTouched()',
|
|
614
|
+
'(compositionstart)': '$any(this)._compositionStart()',
|
|
615
|
+
'(compositionend)': '$any(this)._compositionEnd($event.target.value)'
|
|
616
|
+
},
|
|
617
|
+
providers: [{
|
|
618
|
+
provide: NG_VALUE_ACCESSOR,
|
|
619
|
+
useExisting: forwardRef(() => NimbleTextFieldControlValueAccessorDirective),
|
|
620
|
+
multi: true
|
|
621
|
+
}]
|
|
622
|
+
},] }
|
|
623
|
+
];
|
|
605
624
|
|
|
606
|
-
|
|
625
|
+
/**
|
|
626
|
+
* Directive to provide Angular integration for the text field
|
|
627
|
+
*/
|
|
628
|
+
class NimbleTextFieldDirective {
|
|
629
|
+
constructor(renderer, elementRef) {
|
|
630
|
+
this.renderer = renderer;
|
|
631
|
+
this.elementRef = elementRef;
|
|
632
|
+
}
|
|
633
|
+
get readOnly() {
|
|
634
|
+
return this.elementRef.nativeElement.readOnly;
|
|
635
|
+
}
|
|
636
|
+
// readOnly property maps to the readonly attribute
|
|
637
|
+
// See: https://github.com/microsoft/fast/blob/46bb6d9aab2c37105f4434db3795e176c2354a4f/packages/web-components/fast-foundation/src/text-field/text-field.ts#L33
|
|
638
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
639
|
+
set readOnly(value) {
|
|
640
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'readOnly', toBooleanProperty(value));
|
|
641
|
+
}
|
|
642
|
+
get type() {
|
|
643
|
+
return this.elementRef.nativeElement.type;
|
|
644
|
+
}
|
|
645
|
+
set type(value) {
|
|
646
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'type', value);
|
|
647
|
+
}
|
|
607
648
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
649
|
+
NimbleTextFieldDirective.decorators = [
|
|
650
|
+
{ type: Directive, args: [{
|
|
651
|
+
selector: 'nimble-text-field'
|
|
652
|
+
},] }
|
|
653
|
+
];
|
|
654
|
+
NimbleTextFieldDirective.ctorParameters = () => [
|
|
655
|
+
{ type: Renderer2 },
|
|
656
|
+
{ type: ElementRef }
|
|
657
|
+
];
|
|
658
|
+
NimbleTextFieldDirective.propDecorators = {
|
|
659
|
+
readOnly: [{ type: Input, args: ['readonly',] }],
|
|
660
|
+
type: [{ type: Input }]
|
|
661
|
+
};
|
|
662
|
+
|
|
663
|
+
class NimbleTextFieldModule {
|
|
664
|
+
}
|
|
665
|
+
NimbleTextFieldModule.decorators = [
|
|
666
|
+
{ type: NgModule, args: [{
|
|
667
|
+
declarations: [NimbleTextFieldDirective, NimbleTextFieldControlValueAccessorDirective],
|
|
668
|
+
imports: [CommonModule],
|
|
669
|
+
exports: [NimbleTextFieldDirective, NimbleTextFieldControlValueAccessorDirective]
|
|
670
|
+
},] }
|
|
671
|
+
];
|
|
619
672
|
|
|
620
673
|
/**
|
|
621
|
-
* Directive
|
|
674
|
+
* Directive for Angular integration for the theme provider
|
|
622
675
|
*/
|
|
623
|
-
class
|
|
676
|
+
class NimbleThemeProviderDirective {
|
|
677
|
+
constructor(renderer, elementRef) {
|
|
678
|
+
this.renderer = renderer;
|
|
679
|
+
this.elementRef = elementRef;
|
|
680
|
+
}
|
|
681
|
+
get theme() {
|
|
682
|
+
return this.elementRef.nativeElement.theme;
|
|
683
|
+
}
|
|
684
|
+
set theme(value) {
|
|
685
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'theme', value);
|
|
686
|
+
}
|
|
624
687
|
}
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
688
|
+
NimbleThemeProviderDirective.decorators = [
|
|
689
|
+
{ type: Directive, args: [{
|
|
690
|
+
selector: 'nimble-theme-provider'
|
|
691
|
+
},] }
|
|
692
|
+
];
|
|
693
|
+
NimbleThemeProviderDirective.ctorParameters = () => [
|
|
694
|
+
{ type: Renderer2 },
|
|
695
|
+
{ type: ElementRef }
|
|
696
|
+
];
|
|
697
|
+
NimbleThemeProviderDirective.propDecorators = {
|
|
698
|
+
theme: [{ type: Input }]
|
|
699
|
+
};
|
|
633
700
|
|
|
634
|
-
class
|
|
701
|
+
class NimbleThemeProviderModule {
|
|
702
|
+
}
|
|
703
|
+
NimbleThemeProviderModule.decorators = [
|
|
704
|
+
{ type: NgModule, args: [{
|
|
705
|
+
declarations: [NimbleThemeProviderDirective],
|
|
706
|
+
imports: [CommonModule],
|
|
707
|
+
exports: [NimbleThemeProviderDirective]
|
|
708
|
+
},] }
|
|
709
|
+
];
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Directive to provide Angular integration for the toggle button.
|
|
713
|
+
*/
|
|
714
|
+
class NimbleToggleButtonDirective {
|
|
715
|
+
constructor(renderer, elementRef) {
|
|
716
|
+
this.renderer = renderer;
|
|
717
|
+
this.elementRef = elementRef;
|
|
718
|
+
}
|
|
719
|
+
get appearance() {
|
|
720
|
+
return this.elementRef.nativeElement.appearance;
|
|
721
|
+
}
|
|
722
|
+
set appearance(value) {
|
|
723
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'appearance', value);
|
|
724
|
+
}
|
|
725
|
+
get disabled() {
|
|
726
|
+
return this.elementRef.nativeElement.disabled;
|
|
727
|
+
}
|
|
728
|
+
set disabled(value) {
|
|
729
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
730
|
+
}
|
|
731
|
+
get contentHidden() {
|
|
732
|
+
return this.elementRef.nativeElement.contentHidden;
|
|
733
|
+
}
|
|
734
|
+
// contentHidden property intentionally maps to the content-hidden attribute
|
|
735
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
736
|
+
set contentHidden(value) {
|
|
737
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'contentHidden', toBooleanProperty(value));
|
|
738
|
+
}
|
|
739
|
+
get checked() {
|
|
740
|
+
return this.elementRef.nativeElement.checked;
|
|
741
|
+
}
|
|
742
|
+
set checked(value) {
|
|
743
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'checked', toBooleanProperty(value));
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
NimbleToggleButtonDirective.decorators = [
|
|
747
|
+
{ type: Directive, args: [{
|
|
748
|
+
selector: 'nimble-toggle-button'
|
|
749
|
+
},] }
|
|
750
|
+
];
|
|
751
|
+
NimbleToggleButtonDirective.ctorParameters = () => [
|
|
752
|
+
{ type: Renderer2 },
|
|
753
|
+
{ type: ElementRef }
|
|
754
|
+
];
|
|
755
|
+
NimbleToggleButtonDirective.propDecorators = {
|
|
756
|
+
appearance: [{ type: Input }],
|
|
757
|
+
disabled: [{ type: Input }],
|
|
758
|
+
contentHidden: [{ type: Input, args: ['content-hidden',] }],
|
|
759
|
+
checked: [{ type: Input }]
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
/**
|
|
763
|
+
* Extension of Angular's CheckboxControlValueAccessor to target the Nimble toggle button control.
|
|
764
|
+
*
|
|
765
|
+
* Directive decorator based on CheckboxControlValueAccessor decorator
|
|
766
|
+
* https://github.com/angular/angular/blob/bbababe5900ea8f4c8fccd88238f6fe08a2ceb63/packages/forms/src/directives/checkbox_value_accessor.ts#L42
|
|
767
|
+
*/
|
|
768
|
+
class NimbleToggleButtonControlValueAccessorDirective extends CheckboxControlValueAccessor {
|
|
769
|
+
}
|
|
770
|
+
NimbleToggleButtonControlValueAccessorDirective.decorators = [
|
|
771
|
+
{ type: Directive, args: [{
|
|
772
|
+
selector: 'nimble-toggle-button[formControlName],nimble-toggle-button[formControl],nimble-toggle-button[ngModel]',
|
|
773
|
+
// The following host metadata is duplicated from CheckboxControlValueAccessor
|
|
774
|
+
// eslint-disable-next-line @angular-eslint/no-host-metadata-property
|
|
775
|
+
host: { '(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()' },
|
|
776
|
+
providers: [{
|
|
777
|
+
provide: NG_VALUE_ACCESSOR,
|
|
778
|
+
useExisting: forwardRef(() => NimbleToggleButtonControlValueAccessorDirective),
|
|
779
|
+
multi: true
|
|
780
|
+
}]
|
|
781
|
+
},] }
|
|
782
|
+
];
|
|
783
|
+
|
|
784
|
+
class NimbleToggleButtonModule {
|
|
785
|
+
}
|
|
786
|
+
NimbleToggleButtonModule.decorators = [
|
|
787
|
+
{ type: NgModule, args: [{
|
|
788
|
+
declarations: [NimbleToggleButtonDirective, NimbleToggleButtonControlValueAccessorDirective],
|
|
789
|
+
imports: [CommonModule],
|
|
790
|
+
exports: [NimbleToggleButtonDirective, NimbleToggleButtonControlValueAccessorDirective]
|
|
791
|
+
},] }
|
|
792
|
+
];
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Directive to provide Angular integration for the tree item.
|
|
796
|
+
*/
|
|
797
|
+
class NimbleTreeItemDirective {
|
|
798
|
+
constructor(renderer, elementRef) {
|
|
799
|
+
this.renderer = renderer;
|
|
800
|
+
this.elementRef = elementRef;
|
|
801
|
+
this.expandedChange = new EventEmitter();
|
|
802
|
+
}
|
|
803
|
+
get disabled() {
|
|
804
|
+
return this.elementRef.nativeElement.disabled;
|
|
805
|
+
}
|
|
806
|
+
set disabled(value) {
|
|
807
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'disabled', toBooleanProperty(value));
|
|
808
|
+
}
|
|
809
|
+
get expanded() {
|
|
810
|
+
return this.elementRef.nativeElement.expanded;
|
|
811
|
+
}
|
|
812
|
+
set expanded(value) {
|
|
813
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'expanded', toBooleanProperty(value));
|
|
814
|
+
}
|
|
815
|
+
get selected() {
|
|
816
|
+
return this.elementRef.nativeElement.selected;
|
|
817
|
+
}
|
|
818
|
+
set selected(value) {
|
|
819
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'selected', toBooleanProperty(value));
|
|
820
|
+
// Needed because fast-foundation TreeView sets initial selection with an aria-selected query
|
|
821
|
+
this.renderer.setAttribute(this.elementRef.nativeElement, 'selected', toBooleanAriaAttribute(value));
|
|
822
|
+
}
|
|
823
|
+
onExpandedChange($event) {
|
|
824
|
+
if ($event.target === this.elementRef.nativeElement) {
|
|
825
|
+
this.expandedChange.emit(this.expanded);
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
NimbleTreeItemDirective.decorators = [
|
|
830
|
+
{ type: Directive, args: [{
|
|
831
|
+
selector: 'nimble-tree-item'
|
|
832
|
+
},] }
|
|
833
|
+
];
|
|
834
|
+
NimbleTreeItemDirective.ctorParameters = () => [
|
|
835
|
+
{ type: Renderer2 },
|
|
836
|
+
{ type: ElementRef }
|
|
837
|
+
];
|
|
838
|
+
NimbleTreeItemDirective.propDecorators = {
|
|
839
|
+
disabled: [{ type: Input }],
|
|
840
|
+
expanded: [{ type: Input }],
|
|
841
|
+
selected: [{ type: Input }],
|
|
842
|
+
expandedChange: [{ type: Output }],
|
|
843
|
+
onExpandedChange: [{ type: HostListener, args: ['expanded-change', ['$event'],] }]
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
class NimbleTreeItemModule {
|
|
847
|
+
}
|
|
848
|
+
NimbleTreeItemModule.decorators = [
|
|
849
|
+
{ type: NgModule, args: [{
|
|
850
|
+
declarations: [NimbleTreeItemDirective],
|
|
851
|
+
imports: [CommonModule],
|
|
852
|
+
exports: [NimbleTreeItemDirective]
|
|
853
|
+
},] }
|
|
854
|
+
];
|
|
855
|
+
|
|
856
|
+
/**
|
|
857
|
+
* Directive to provide Angular integration for the tree view.
|
|
858
|
+
*/
|
|
859
|
+
class NimbleTreeViewDirective {
|
|
860
|
+
constructor(renderer, elementRef) {
|
|
861
|
+
this.renderer = renderer;
|
|
862
|
+
this.elementRef = elementRef;
|
|
863
|
+
}
|
|
864
|
+
get selectionMode() {
|
|
865
|
+
return this.elementRef.nativeElement.selectionMode;
|
|
866
|
+
}
|
|
867
|
+
// selectionMode property intentionally maps to the selection-mode attribute
|
|
868
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
869
|
+
set selectionMode(value) {
|
|
870
|
+
this.renderer.setProperty(this.elementRef.nativeElement, 'selectionMode', value);
|
|
871
|
+
}
|
|
635
872
|
}
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
873
|
+
NimbleTreeViewDirective.decorators = [
|
|
874
|
+
{ type: Directive, args: [{
|
|
875
|
+
selector: 'nimble-tree-view'
|
|
876
|
+
},] }
|
|
877
|
+
];
|
|
878
|
+
NimbleTreeViewDirective.ctorParameters = () => [
|
|
879
|
+
{ type: Renderer2 },
|
|
880
|
+
{ type: ElementRef }
|
|
881
|
+
];
|
|
882
|
+
NimbleTreeViewDirective.propDecorators = {
|
|
883
|
+
selectionMode: [{ type: Input, args: ['selection-mode',] }]
|
|
884
|
+
};
|
|
885
|
+
|
|
886
|
+
class NimbleTreeViewModule {
|
|
887
|
+
}
|
|
888
|
+
NimbleTreeViewModule.decorators = [
|
|
889
|
+
{ type: NgModule, args: [{
|
|
890
|
+
declarations: [NimbleTreeViewDirective],
|
|
891
|
+
imports: [CommonModule],
|
|
892
|
+
exports: [NimbleTreeViewDirective]
|
|
893
|
+
},] }
|
|
894
|
+
];
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* Immediately processes all updates in queue.
|
|
898
|
+
*
|
|
899
|
+
* Useful for synchronously testing Nimble elements. Call this in fakeAsync tests to
|
|
900
|
+
* immediately resolve tasks which otherwise would require waiting for an animation
|
|
901
|
+
* frame. This should also be called after every fakeAsync test to clear the internal
|
|
902
|
+
* process queue and allow subsequent tests to run normally.
|
|
903
|
+
*/
|
|
904
|
+
const waitForUpdatesAsync = waitForUpdatesAsync$1;
|
|
647
905
|
|
|
648
906
|
/*
|
|
649
907
|
* Public API Surface of nimble-angular
|
|
@@ -653,5 +911,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.5", ngImpor
|
|
|
653
911
|
* Generated bundle index. Do not edit.
|
|
654
912
|
*/
|
|
655
913
|
|
|
656
|
-
export { NimbleButtonDirective, NimbleButtonModule, NimbleCheckboxControlValueAccessorDirective, NimbleCheckboxDirective, NimbleCheckboxModule,
|
|
914
|
+
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, NimbleToggleButtonDirective, NimbleToggleButtonModule, NimbleTreeItemDirective, NimbleTreeItemModule, NimbleTreeViewDirective, NimbleTreeViewModule, waitForUpdatesAsync, NimbleToggleButtonControlValueAccessorDirective as ɵa };
|
|
657
915
|
//# sourceMappingURL=ni-nimble-angular.js.map
|