@bravura/ui 1.5.0 → 1.6.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/CHANGELOG.md +17 -3
- package/README.md +1 -1
- package/bundles/bravura-ui-discrete-input.umd.js +738 -0
- package/bundles/bravura-ui-discrete-input.umd.js.map +1 -0
- package/bundles/bravura-ui-form-field.umd.js +9 -2
- package/bundles/bravura-ui-form-field.umd.js.map +1 -1
- package/bundles/bravura-ui-radio-panel.umd.js +11 -3
- package/bundles/bravura-ui-radio-panel.umd.js.map +1 -1
- package/bundles/bravura-ui-selection-panel.umd.js +47 -8
- package/bundles/bravura-ui-selection-panel.umd.js.map +1 -1
- package/discrete-input/bravura-ui-discrete-input.d.ts +5 -0
- package/discrete-input/discrete-input.component.d.ts +138 -0
- package/discrete-input/discrete-input.module.d.ts +11 -0
- package/discrete-input/package.json +10 -0
- package/discrete-input/public-api.d.ts +2 -0
- package/esm2015/discrete-input/bravura-ui-discrete-input.js +5 -0
- package/esm2015/discrete-input/discrete-input.component.js +333 -0
- package/esm2015/discrete-input/discrete-input.module.js +20 -0
- package/esm2015/discrete-input/public-api.js +3 -0
- package/esm2015/form-field/form-field.component.js +11 -4
- package/esm2015/radio-panel/radio-panel.directive.js +13 -5
- package/esm2015/selection-panel/selection-panel-item.component.js +22 -3
- package/esm2015/selection-panel/selection-panel.directive.js +20 -3
- package/fesm2015/bravura-ui-discrete-input.js +355 -0
- package/fesm2015/bravura-ui-discrete-input.js.map +1 -0
- package/fesm2015/bravura-ui-form-field.js +10 -3
- package/fesm2015/bravura-ui-form-field.js.map +1 -1
- package/fesm2015/bravura-ui-radio-panel.js +11 -3
- package/fesm2015/bravura-ui-radio-panel.js.map +1 -1
- package/fesm2015/bravura-ui-selection-panel.js +41 -6
- package/fesm2015/bravura-ui-selection-panel.js.map +1 -1
- package/form-field/form-field.component.d.ts +2 -0
- package/package.json +1 -1
- package/radio-panel/radio-panel.directive.d.ts +8 -3
- package/selection-panel/selection-panel-item.component.d.ts +7 -0
- package/selection-panel/selection-panel.directive.d.ts +12 -3
- package/theme/_ui-theme.scss +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bravura-ui-radio-panel.js","sources":["../../../projects/ui/radio-panel/radio-panel-item.component.ts","../../../projects/ui/radio-panel/radio-panel-item.component.html","../../../projects/ui/radio-panel/radio-panel.directive.ts","../../../projects/ui/radio-panel/radio-panel.module.ts","../../../projects/ui/radio-panel/bravura-ui-radio-panel.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport { UniqueSelectionDispatcher } from '@angular/cdk/collections';\nimport {\n\tAttribute,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tInject,\n\tInput,\n\tOptional\n} from '@angular/core';\nimport {\n\tMatRadioButton,\n\tMatRadioDefaultOptions,\n\tMatRadioGroup,\n\tMAT_RADIO_DEFAULT_OPTIONS,\n\tMAT_RADIO_GROUP\n} from '@angular/material/radio';\nimport { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';\n\n/**\n * Use `bui-radio-panel-item` instead of `mat-radio-button` in a `bui-radio-panel` to display an option.\n */\n@Component({\n\tselector: 'bui-radio-panel-item',\n\ttemplateUrl: './radio-panel-item.component.html',\n\tstyleUrls: ['./radio-panel-item.component.scss'],\n\t// tslint:disable-next-line: no-inputs-metadata-property\n\tinputs: ['disableRipple', 'tabIndex'],\n\texportAs: 'matRadioButton',\n\t// tslint:disable-next-line: no-host-metadata-property\n\thost: {\n\t\tclass: 'bui-radio-panel-item',\n\t\t'[class.bui-radio-checked]': 'checked',\n\t\t'[class.bui-disabled]': 'disabled',\n\t\t'[class._mat-animation-noopable]': '_noopAnimations',\n\t\t'[class.mat-primary]': 'color === \"primary\"',\n\t\t'[class.mat-accent]': 'color === \"accent\"',\n\t\t'[class.mat-warn]': 'color === \"warn\"',\n\t\t// Needs to be removed since it causes some a11y issues (see #21266).\n\t\t'[attr.tabindex]': 'null',\n\t\t'[attr.id]': 'id',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t// Note: under normal conditions focus shouldn't land on this element, however it may be\n\t\t// programmatically set, for example inside of a focus trap, in this case we want to forward\n\t\t// the focus to the native element.\n\t\t'(focus)': '_inputElement.nativeElement.focus()'\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RadioPanelItemComponent extends MatRadioButton {\n\t/**\n\t * This will be displayed as the panel header\n\t */\n\t@Input()\n\ttitle = '';\n\n\tconstructor(\n\t\t@Optional() @Inject(MAT_RADIO_GROUP) radioGroup: MatRadioGroup,\n\t\telementRef: ElementRef,\n\t\t_changeDetector: ChangeDetectorRef,\n\t\t_focusMonitor: FocusMonitor,\n\t\t_radioDispatcher: UniqueSelectionDispatcher,\n\t\t@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n\t\t@Optional()\n\t\t@Inject(MAT_RADIO_DEFAULT_OPTIONS)\n\t\t_providerOverride?: MatRadioDefaultOptions,\n\t\t@Attribute('tabindex') tabIndex?: string\n\t) {\n\t\tsuper(\n\t\t\tradioGroup,\n\t\t\telementRef,\n\t\t\t_changeDetector,\n\t\t\t_focusMonitor,\n\t\t\t_radioDispatcher,\n\t\t\tanimationMode,\n\t\t\t_providerOverride,\n\t\t\ttabIndex\n\t\t);\n\t}\n}\n","<label [attr.for]=\"inputId\" #label class=\"bui-radio-panel-item-label bui-border-{{ checked ? color : 'default' }}\">\n\t<div class=\"bui-radio-panel-item-wrapper\">\n\t\t<div matRipple matRippleColor=\"rgba(128,128,128,.1)\" class=\"bui-ripple\" *ngIf=\"!disabled\"></div>\n\t\t<div class=\"bui-label-header\">\n\t\t\t<span class=\"bui-label-title\" [innerHTML]=\"title\"></span>\n\t\t\t<span class=\"bui-radio-panel-item-circle\">\n\t\t\t\t<span class=\"bui-persistent-ripple\"></span>\n\t\t\t\t<mat-icon [color]=\"color\" *ngIf=\"checked\">check_circle</mat-icon>\n\t\t\t\t<mat-icon *ngIf=\"!checked\" class=\"bui-radio-panel-item-circle-unchecked\">radio_button_unchecked</mat-icon>\n\t\t\t</span>\n\t\t</div>\n\t\t<!-- The actual 'radio' part of the control. -->\n\t\t<span class=\"radio-container\">\n\t\t\t<input\n\t\t\t\t#input\n\t\t\t\tclass=\"mat-radio-input cdk-visually-hidden\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\t[id]=\"inputId\"\n\t\t\t\t[checked]=\"checked\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[tabIndex]=\"tabIndex\"\n\t\t\t\t[attr.name]=\"name\"\n\t\t\t\t[attr.value]=\"value\"\n\t\t\t\t[required]=\"required\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t\t\t[attr.aria-describedby]=\"ariaDescribedby\"\n\t\t\t\t(change)=\"_onInputInteraction($event)\"\n\t\t\t\t(click)=\"_onInputClick($event)\"\n\t\t\t/>\n\t\t</span>\n\n\t\t<div class=\"bui-label-content-gap\"></div>\n\t\t<!-- The label content for radio control. -->\n\t\t<div class=\"bui-label-content\">\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t</div>\n</label>\n","import {
|
|
1
|
+
{"version":3,"file":"bravura-ui-radio-panel.js","sources":["../../../projects/ui/radio-panel/radio-panel-item.component.ts","../../../projects/ui/radio-panel/radio-panel-item.component.html","../../../projects/ui/radio-panel/radio-panel.directive.ts","../../../projects/ui/radio-panel/radio-panel.module.ts","../../../projects/ui/radio-panel/bravura-ui-radio-panel.ts"],"sourcesContent":["import { FocusMonitor } from '@angular/cdk/a11y';\nimport { UniqueSelectionDispatcher } from '@angular/cdk/collections';\nimport {\n\tAttribute,\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tInject,\n\tInput,\n\tOptional\n} from '@angular/core';\nimport {\n\tMatRadioButton,\n\tMatRadioDefaultOptions,\n\tMatRadioGroup,\n\tMAT_RADIO_DEFAULT_OPTIONS,\n\tMAT_RADIO_GROUP\n} from '@angular/material/radio';\nimport { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';\n\n/**\n * Use `bui-radio-panel-item` instead of `mat-radio-button` in a `bui-radio-panel` to display an option.\n */\n@Component({\n\tselector: 'bui-radio-panel-item',\n\ttemplateUrl: './radio-panel-item.component.html',\n\tstyleUrls: ['./radio-panel-item.component.scss'],\n\t// tslint:disable-next-line: no-inputs-metadata-property\n\tinputs: ['disableRipple', 'tabIndex'],\n\texportAs: 'matRadioButton',\n\t// tslint:disable-next-line: no-host-metadata-property\n\thost: {\n\t\tclass: 'bui-radio-panel-item',\n\t\t'[class.bui-radio-checked]': 'checked',\n\t\t'[class.bui-disabled]': 'disabled',\n\t\t'[class._mat-animation-noopable]': '_noopAnimations',\n\t\t'[class.mat-primary]': 'color === \"primary\"',\n\t\t'[class.mat-accent]': 'color === \"accent\"',\n\t\t'[class.mat-warn]': 'color === \"warn\"',\n\t\t// Needs to be removed since it causes some a11y issues (see #21266).\n\t\t'[attr.tabindex]': 'null',\n\t\t'[attr.id]': 'id',\n\t\t'[attr.aria-label]': 'null',\n\t\t'[attr.aria-labelledby]': 'null',\n\t\t'[attr.aria-describedby]': 'null',\n\t\t// Note: under normal conditions focus shouldn't land on this element, however it may be\n\t\t// programmatically set, for example inside of a focus trap, in this case we want to forward\n\t\t// the focus to the native element.\n\t\t'(focus)': '_inputElement.nativeElement.focus()'\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class RadioPanelItemComponent extends MatRadioButton {\n\t/**\n\t * This will be displayed as the panel header\n\t */\n\t@Input()\n\ttitle = '';\n\n\tconstructor(\n\t\t@Optional() @Inject(MAT_RADIO_GROUP) radioGroup: MatRadioGroup,\n\t\telementRef: ElementRef,\n\t\t_changeDetector: ChangeDetectorRef,\n\t\t_focusMonitor: FocusMonitor,\n\t\t_radioDispatcher: UniqueSelectionDispatcher,\n\t\t@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n\t\t@Optional()\n\t\t@Inject(MAT_RADIO_DEFAULT_OPTIONS)\n\t\t_providerOverride?: MatRadioDefaultOptions,\n\t\t@Attribute('tabindex') tabIndex?: string\n\t) {\n\t\tsuper(\n\t\t\tradioGroup,\n\t\t\telementRef,\n\t\t\t_changeDetector,\n\t\t\t_focusMonitor,\n\t\t\t_radioDispatcher,\n\t\t\tanimationMode,\n\t\t\t_providerOverride,\n\t\t\ttabIndex\n\t\t);\n\t}\n}\n","<label [attr.for]=\"inputId\" #label class=\"bui-radio-panel-item-label bui-border-{{ checked ? color : 'default' }}\">\n\t<div class=\"bui-radio-panel-item-wrapper\">\n\t\t<div matRipple matRippleColor=\"rgba(128,128,128,.1)\" class=\"bui-ripple\" *ngIf=\"!disabled\"></div>\n\t\t<div class=\"bui-label-header\">\n\t\t\t<span class=\"bui-label-title\" [innerHTML]=\"title\"></span>\n\t\t\t<span class=\"bui-radio-panel-item-circle\">\n\t\t\t\t<span class=\"bui-persistent-ripple\"></span>\n\t\t\t\t<mat-icon [color]=\"color\" *ngIf=\"checked\">check_circle</mat-icon>\n\t\t\t\t<mat-icon *ngIf=\"!checked\" class=\"bui-radio-panel-item-circle-unchecked\">radio_button_unchecked</mat-icon>\n\t\t\t</span>\n\t\t</div>\n\t\t<!-- The actual 'radio' part of the control. -->\n\t\t<span class=\"radio-container\">\n\t\t\t<input\n\t\t\t\t#input\n\t\t\t\tclass=\"mat-radio-input cdk-visually-hidden\"\n\t\t\t\ttype=\"radio\"\n\t\t\t\t[id]=\"inputId\"\n\t\t\t\t[checked]=\"checked\"\n\t\t\t\t[disabled]=\"disabled\"\n\t\t\t\t[tabIndex]=\"tabIndex\"\n\t\t\t\t[attr.name]=\"name\"\n\t\t\t\t[attr.value]=\"value\"\n\t\t\t\t[required]=\"required\"\n\t\t\t\t[attr.aria-label]=\"ariaLabel\"\n\t\t\t\t[attr.aria-labelledby]=\"ariaLabelledby\"\n\t\t\t\t[attr.aria-describedby]=\"ariaDescribedby\"\n\t\t\t\t(change)=\"_onInputInteraction($event)\"\n\t\t\t\t(click)=\"_onInputClick($event)\"\n\t\t\t/>\n\t\t</span>\n\n\t\t<div class=\"bui-label-content-gap\"></div>\n\t\t<!-- The label content for radio control. -->\n\t\t<div class=\"bui-label-content\">\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\t</div>\n</label>\n","import {\n\tChangeDetectorRef,\n\tContentChildren,\n\tDirective,\n\tforwardRef,\n\tInput,\n\tOnChanges,\n\tQueryList,\n\tSimpleChanges\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ThemePalette } from '@angular/material/core';\nimport { MatRadioGroup, MAT_RADIO_GROUP } from '@angular/material/radio';\nimport { RadioPanelItemComponent } from './radio-panel-item.component';\n/**\n * Radio panel is a [control value accessor](https://angular.io/api/forms/ControlValueAccessor)\n * that extends Angular Material's [radio group component](https://material.angular.io/components/radio/overview).\n * It inherits all the features of `MatRadioGroup`, and arranges the child items in panels,\n * with the `title` attributes rendered as captions. The check box icon and the borders will be displayed\n * in the color selected by the theme attribute `color`.\n *\n */\n@Directive({\n\t// tslint:disable-next-line: directive-selector\n\tselector: 'bui-radio-panel',\n\texportAs: 'buiRadioPanel',\n\tproviders: [\n\t\t{\n\t\t\tprovide: NG_VALUE_ACCESSOR,\n\t\t\tuseExisting: forwardRef(() => RadioPanelDirective),\n\t\t\tmulti: true\n\t\t},\n\t\t{ provide: MAT_RADIO_GROUP, useExisting: forwardRef(() => RadioPanelDirective) }\n\t],\n\t// tslint:disable-next-line: no-host-metadata-property\n\thost: {\n\t\trole: 'radiogroup',\n\t\tclass: 'bui-radio-panel'\n\t}\n})\nexport class RadioPanelDirective extends MatRadioGroup implements OnChanges {\n\t/** Theme color for all of the radio panels in the group. */\n\t@Input() color: ThemePalette;\n\n\t/**\n\t * @ignore\n\t */\n\t@ContentChildren(RadioPanelItemComponent, { descendants: true })\n\t_radios!: QueryList<RadioPanelItemComponent>;\n\n\tconstructor(cd: ChangeDetectorRef) {\n\t\tsuper(cd);\n\t}\n\n\t/** @ignore */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tif (changes.color && this._radios) {\n\t\t\tthis._radios.forEach(item => item._markForCheck());\n\t\t}\n\t}\n}\n","import { RadioPanelItemComponent } from './radio-panel-item.component';\nimport { RadioPanelDirective } from './radio-panel.directive';\nimport { MatRippleModule } from '@angular/material/core';\nimport { MatRadioModule } from '@angular/material/radio';\nimport { MatIconModule } from '@angular/material/icon';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\n/**\n * Import this NgModule for the radio panel component\n */\n@NgModule({\n\tdeclarations: [RadioPanelItemComponent, RadioPanelDirective],\n\timports: [CommonModule, MatRadioModule, MatRippleModule, MatIconModule],\n\texports: [RadioPanelItemComponent, RadioPanelDirective]\n})\nexport class RadioPanelModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAqBA;;;MAgCa,uBAAwB,SAAQ,cAAc;IAO1D,YACsC,UAAyB,EAC9D,UAAsB,EACtB,eAAkC,EAClC,aAA2B,EAC3B,gBAA2C,EACA,aAAsB,EAGjE,iBAA0C,EACnB,QAAiB;QAExC,KAAK,CACJ,UAAU,EACV,UAAU,EACV,eAAe,EACf,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,QAAQ,CACR,CAAC;;;;QAvBH,UAAK,GAAG,EAAE,CAAC;KAwBV;;oHA7BW,uBAAuB,kBAQd,eAAe,6JAKf,qBAAqB,6BAEjC,yBAAyB,6BAEtB,UAAU;wGAjBV,uBAAuB,wsBCrDpC,qkDAuCA;2FDca,uBAAuB;kBA7BnC,SAAS;mBAAC;oBACV,QAAQ,EAAE,sBAAsB;oBAChC,WAAW,EAAE,mC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OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,mBAAmB,CAAC,EAAE;KAChF,kDAcgB,uBAAuB;2FAP5B,mBAAmB;kBAlB/B,SAAS;mBAAC;;oBAEV,QAAQ,EAAE,iBAAiB;oBAC3B,QAAQ,EAAE,eAAe;oBACzB,SAAS,EAAE;wBACV;4BACC,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,yBAAyB,CAAC;4BAClD,KAAK,EAAE,IAAI;yBACX;wBACD,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,CAAC,yBAAyB,CAAC,EAAE;qBAChF;;oBAED,IAAI,EAAE;wBACL,IAAI,EAAE,YAAY;wBAClB,KAAK,EAAE,iBAAiB;qBACxB;iBACD;wGAGS,KAAK;sBAAb,KAAK;gBAMN,OAAO;sBADN,eAAe;uBAAC,uBAAuB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;;ACvChE;;;MAQa,gBAAgB;;6GAAhB,gBAAgB;8GAAhB,gBAAgB,iBAJb,uBAAuB,EAAE,mBAAmB,aACjD,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,aAC5D,uBAAuB,EAAE,mBAAmB;8GAE1C,gBAAgB,YAHnB,CAAC,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,CAAC;2FAG3D,gBAAgB;kBAL5B,QAAQ;mBAAC;oBACT,YAAY,EAAE,CAAC,uBAAuB,EAAE,mBAAmB,CAAC;oBAC5D,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,CAAC;oBACvE,OAAO,EAAE,CAAC,uBAAuB,EAAE,mBAAmB,CAAC;iBACvD;;;ACfD;;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Input, forwardRef, Directive, ContentChildren, NgModule } from '@angular/core';
|
|
3
|
+
import { InjectionToken, Component, ChangeDetectionStrategy, Inject, Input, ViewChild, forwardRef, Directive, ContentChildren, NgModule } from '@angular/core';
|
|
4
|
+
import * as i3 from '@angular/material/core';
|
|
5
|
+
import { MatRipple, MatRippleModule } from '@angular/material/core';
|
|
4
6
|
import * as i1 from '@angular/material/checkbox';
|
|
5
7
|
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
6
8
|
import * as i2 from '@angular/common';
|
|
7
9
|
import { CommonModule } from '@angular/common';
|
|
8
|
-
import * as i3 from '@angular/material/core';
|
|
9
|
-
import { MatRippleModule } from '@angular/material/core';
|
|
10
10
|
import * as i4 from '@angular/forms';
|
|
11
11
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
|
12
12
|
|
|
@@ -63,6 +63,9 @@ class SelectionPanelItemComponent {
|
|
|
63
63
|
set color(newValue) {
|
|
64
64
|
this._color = newValue;
|
|
65
65
|
}
|
|
66
|
+
get _selectByHeader() {
|
|
67
|
+
return this._group.selectByHeader;
|
|
68
|
+
}
|
|
66
69
|
/** @ignore */
|
|
67
70
|
_markInteracted() {
|
|
68
71
|
this._group._onTouched();
|
|
@@ -71,6 +74,18 @@ class SelectionPanelItemComponent {
|
|
|
71
74
|
_notify() {
|
|
72
75
|
this._cd.markForCheck();
|
|
73
76
|
}
|
|
77
|
+
/** Toggle selection programmatically */
|
|
78
|
+
toggle() {
|
|
79
|
+
this.checked = !this.checked;
|
|
80
|
+
}
|
|
81
|
+
/** @ignore */
|
|
82
|
+
_contentClicked(event) {
|
|
83
|
+
var _a;
|
|
84
|
+
if (!this._selectByHeader) {
|
|
85
|
+
(_a = this._ripple) === null || _a === void 0 ? void 0 : _a.launch(event.clientX, event.clientY);
|
|
86
|
+
this.toggle();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
74
89
|
/** Sets the disabled state and marks for check if a change occurred. */
|
|
75
90
|
_setDisabled(value) {
|
|
76
91
|
if (this._disabled !== value) {
|
|
@@ -96,7 +111,7 @@ class SelectionPanelItemComponent {
|
|
|
96
111
|
}
|
|
97
112
|
}
|
|
98
113
|
SelectionPanelItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: SelectionPanelItemComponent, deps: [{ token: SELECTION_PANEL_GROUP }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
-
SelectionPanelItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: SelectionPanelItemComponent, selector: "bui-selection-panel-item", inputs: { title: "title", disabled: "disabled", value: "value", checked: "checked", color: "color" }, host: { properties: { "class.bui-selection-checked": "checked", "class.bui-border-accent": "checked && color ==='accent'", "class.bui-border-primary": "checked && color ==='primary'", "class.bui-border-warn": "checked && color ==='warn'", "class.bui-disabled": "disabled" }, classAttribute: "bui-selection-panel-item" }, ngImport: i0, template: "<div class=\"bui-selection-panel-item-wrapper\">\n\t<div\n\t\tmatRipple\n\t\tmatRippleColor=\"rgba(128,128,128,.1)\"\n\t\tclass=\"bui-ripple\"\n\t\t*ngIf=\"!disabled\"\n\t\t[matRippleTrigger]=\"toggleTrigger\"\n\t></div>\n\t<div class=\"bui-selection-panel-item-header\" #toggleTrigger>\n\t\t<mat-checkbox [(ngModel)]=\"checked\" [color]=\"color\" [disabled]=\"disabled\" (change)=\"_markInteracted()\">\n\t\t\t<div class=\"bui-selection-panel-item-title\" [innerHTML]=\"title\"></div>\n\t\t</mat-checkbox>\n\t</div>\n\n\t<div
|
|
114
|
+
SelectionPanelItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.4", type: SelectionPanelItemComponent, selector: "bui-selection-panel-item", inputs: { title: "title", disabled: "disabled", value: "value", checked: "checked", color: "color" }, host: { properties: { "class.bui-selection-checked": "checked", "class.bui-border-accent": "checked && color ==='accent'", "class.bui-border-primary": "checked && color ==='primary'", "class.bui-border-warn": "checked && color ==='warn'", "class.bui-disabled": "disabled" }, classAttribute: "bui-selection-panel-item" }, viewQueries: [{ propertyName: "_ripple", first: true, predicate: MatRipple, descendants: true }], ngImport: i0, template: "<div class=\"bui-selection-panel-item-wrapper\">\n\t<div\n\t\tmatRipple\n\t\tmatRippleColor=\"rgba(128,128,128,.1)\"\n\t\tclass=\"bui-ripple\"\n\t\t*ngIf=\"!disabled\"\n\t\t[matRippleTrigger]=\"toggleTrigger\"\n\t\t#ripple=\"matRipple\"\n\t></div>\n\t<div class=\"bui-selection-panel-item-header\" #toggleTrigger>\n\t\t<mat-checkbox [(ngModel)]=\"checked\" [color]=\"color\" [disabled]=\"disabled\" (change)=\"_markInteracted()\">\n\t\t\t<div class=\"bui-selection-panel-item-title\" [innerHTML]=\"title\"></div>\n\t\t</mat-checkbox>\n\t</div>\n\n\t<div\n\t\tclass=\"bui-selection-panel-item-content\"\n\t\t[class.bui-selectable]=\"!_selectByHeader\"\n\t\t(click)=\"_contentClicked($event)\"\n\t>\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"bui-selection-panel-item-bottom\"></div>\n</div>\n", styles: [":host{position:relative;border-radius:5px;border:1px solid rgba(128,128,128,.2);padding:1px}:host .bui-selection-panel-item-wrapper{padding-left:1rem;padding-right:1rem}:host .bui-ripple{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}:host .bui-selection-panel-item-header{margin-top:calc(1rem - 4px);margin-bottom:calc(1rem - 4px)}:host .bui-selection-panel-item-title{font-size:larger;font-weight:bold;white-space:normal;margin-top:2px}:host .bui-selection-panel-item-content{margin-top:1rem;margin-bottom:1rem}:host(:not(:first-child)){margin-top:1rem}:host(:not([hidden])){display:block}:host(:not(.bui-disabled)):hover{border-width:2px;padding:0;border-color:#8080804d}:host(:not(.bui-disabled)) .bui-selection-panel-item-content.bui-selectable{cursor:pointer}\n"], components: [{ type: i1.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex", "aria-label", "aria-labelledby", "id", "labelPosition", "name", "required", "checked", "disabled", "indeterminate", "aria-describedby", "value"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleRadius", "matRippleDisabled", "matRippleTrigger", "matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleAnimation"], exportAs: ["matRipple"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
100
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: SelectionPanelItemComponent, decorators: [{
|
|
101
116
|
type: Component,
|
|
102
117
|
args: [{
|
|
@@ -126,6 +141,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
|
|
|
126
141
|
type: Input
|
|
127
142
|
}], color: [{
|
|
128
143
|
type: Input
|
|
144
|
+
}], _ripple: [{
|
|
145
|
+
type: ViewChild,
|
|
146
|
+
args: [MatRipple]
|
|
129
147
|
}] } });
|
|
130
148
|
|
|
131
149
|
/**
|
|
@@ -146,6 +164,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
|
|
|
146
164
|
class SelectionPanelDirective {
|
|
147
165
|
constructor(_cd) {
|
|
148
166
|
this._cd = _cd;
|
|
167
|
+
/**
|
|
168
|
+
* When set to `false`, the selection is triggered by click everywhere within the panels that is
|
|
169
|
+
* not focus-trapping; otherwise, only clicking on the header will activate the selection.
|
|
170
|
+
*
|
|
171
|
+
* @default true
|
|
172
|
+
*/
|
|
173
|
+
this.selectByHeader = true;
|
|
149
174
|
/** @ignore */
|
|
150
175
|
this._isDisabled = false;
|
|
151
176
|
this._selected = [];
|
|
@@ -201,12 +226,20 @@ class SelectionPanelDirective {
|
|
|
201
226
|
this._items.forEach(it => it._notify());
|
|
202
227
|
}
|
|
203
228
|
}
|
|
229
|
+
/** @ignore */
|
|
230
|
+
ngOnChanges(changes) {
|
|
231
|
+
if (this._items) {
|
|
232
|
+
if (changes.color || changes.selectByHeader) {
|
|
233
|
+
this._items.forEach(item => item._notify());
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
204
237
|
}
|
|
205
238
|
SelectionPanelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: SelectionPanelDirective, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
206
|
-
SelectionPanelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.4", type: SelectionPanelDirective, selector: "bui-selection-panel", inputs: { color: "color" }, providers: [
|
|
239
|
+
SelectionPanelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.4", type: SelectionPanelDirective, selector: "bui-selection-panel", inputs: { color: "color", selectByHeader: "selectByHeader" }, providers: [
|
|
207
240
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectionPanelDirective), multi: true },
|
|
208
241
|
{ provide: SELECTION_PANEL_GROUP, useExisting: forwardRef(() => SelectionPanelDirective) }
|
|
209
|
-
], queries: [{ propertyName: "_items", predicate: SelectionPanelItemComponent, descendants: true }], exportAs: ["buiSelectionPanel"], ngImport: i0 });
|
|
242
|
+
], queries: [{ propertyName: "_items", predicate: SelectionPanelItemComponent, descendants: true }], exportAs: ["buiSelectionPanel"], usesOnChanges: true, ngImport: i0 });
|
|
210
243
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImport: i0, type: SelectionPanelDirective, decorators: [{
|
|
211
244
|
type: Directive,
|
|
212
245
|
args: [{
|
|
@@ -219,6 +252,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.4", ngImpor
|
|
|
219
252
|
}]
|
|
220
253
|
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { color: [{
|
|
221
254
|
type: Input
|
|
255
|
+
}], selectByHeader: [{
|
|
256
|
+
type: Input
|
|
222
257
|
}], _items: [{
|
|
223
258
|
type: ContentChildren,
|
|
224
259
|
args: [SelectionPanelItemComponent, { descendants: true }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bravura-ui-selection-panel.js","sources":["../../../projects/ui/selection-panel/selection-panel-item.component.ts","../../../projects/ui/selection-panel/selection-panel-item.component.html","../../../projects/ui/selection-panel/selection-panel.directive.ts","../../../projects/ui/selection-panel/selection-panel.module.ts","../../../projects/ui/selection-panel/bravura-ui-selection-panel.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject, InjectionToken, Input } from '@angular/core';\nimport { ThemePalette } from '@angular/material/core';\n\n/**\n * @ignore\n */\nexport interface SelectionPanelItemGroup {\n\t_selection: any[];\n\tcolor: ThemePalette;\n\t_isDisabled: boolean;\n\t_onTouched: () => void;\n}\n\n/**\n * @ignore\n */\nexport const SELECTION_PANEL_GROUP = new InjectionToken<SelectionPanelItemGroup>('SelectionPanelItemGroup');\n\n/**\n * Use `bui-selection-panel-item` within a `bui-selection-panel` to display an option.\n */\n@Component({\n\tselector: 'bui-selection-panel-item',\n\ttemplateUrl: './selection-panel-item.component.html',\n\tstyleUrls: ['./selection-panel-item.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\tclass: 'bui-selection-panel-item',\n\t\t'[class.bui-selection-checked]': 'checked',\n\t\t'[class.bui-border-accent]': `checked && color ==='accent'`,\n\t\t'[class.bui-border-primary]': `checked && color ==='primary'`,\n\t\t'[class.bui-border-warn]': `checked && color ==='warn'`,\n\t\t'[class.bui-disabled]': 'disabled'\n\t}\n})\nexport class SelectionPanelItemComponent {\n\t/** @ignore */\n\tstatic ngAcceptInputType_disabled: boolean | string;\n\n\t/** @ignore */\n\tstatic ngAcceptInputType_checked: boolean | string;\n\n\t/**\n\t * This will be displayed as the panel header\n\t */\n\t@Input()\n\ttitle = '';\n\n\t/** Whether the option is disabled. */\n\t@Input()\n\tget disabled(): boolean {\n\t\treturn this._disabled || this._group._isDisabled;\n\t}\n\tset disabled(value: boolean) {\n\t\tthis._setDisabled(coerceBooleanProperty(value));\n\t}\n\n\t/** The value of this option. */\n\t@Input()\n\tget value(): any {\n\t\treturn this._value;\n\t}\n\tset value(value: any) {\n\t\tif (this._value !== value) {\n\t\t\tthis._value = value;\n\t\t\tthis._cd.markForCheck();\n\t\t}\n\t}\n\n\t/** Whether this option is checked. */\n\t@Input()\n\tget checked(): boolean {\n\t\treturn this._group._selection.includes(this.value);\n\t}\n\tset checked(value: boolean) {\n\t\tif (!this._group._onTouched) {\n\t\t\tsetTimeout(() => this._setChecked(value), 0);\n\t\t} else {\n\t\t\tthis._setChecked(value);\n\t\t}\n\t}\n\n\t/** Theme color of the radio button. */\n\t@Input()\n\tget color(): ThemePalette {\n\t\treturn this._color || this._group.color;\n\t}\n\tset color(newValue: ThemePalette) {\n\t\tthis._color = newValue;\n\t}\n\n\tprivate _color: ThemePalette;\n\tprivate _disabled = false;\n\tprivate _value: any;\n\n\tconstructor(@Inject(SELECTION_PANEL_GROUP) private _group: SelectionPanelItemGroup, private _cd: ChangeDetectorRef) {}\n\n\t/** @ignore */\n\t_markInteracted() {\n\t\tthis._group._onTouched();\n\t}\n\n\t/** @ignore */\n\t_notify() {\n\t\tthis._cd.markForCheck();\n\t}\n\n\t/** Sets the disabled state and marks for check if a change occurred. */\n\tprivate _setDisabled(value: boolean) {\n\t\tif (this._disabled !== value) {\n\t\t\tthis._disabled = value;\n\t\t\tthis._cd.markForCheck();\n\t\t}\n\t}\n\n\tprivate _setChecked(value: boolean) {\n\t\tconst newCheckedState = coerceBooleanProperty(value);\n\t\tconst old = this._group._selection.includes(this.value);\n\t\tif (old !== newCheckedState) {\n\t\t\tconst contained = this._group._selection.some(v => v === this._value);\n\t\t\tif (newCheckedState && this._group && !contained) {\n\t\t\t\tthis._group._selection = [...this._group._selection, this._value];\n\t\t\t} else if (!newCheckedState && this._group && contained) {\n\t\t\t\t// When unchecking the selected item, update the selection\n\t\t\t\t// property on the group.\n\t\t\t\tthis._group._selection = this._group._selection.filter(v => v !== this._value);\n\t\t\t}\n\t\t\tthis._cd.markForCheck();\n\t\t}\n\t}\n}\n","<div class=\"bui-selection-panel-item-wrapper\">\n\t<div\n\t\tmatRipple\n\t\tmatRippleColor=\"rgba(128,128,128,.1)\"\n\t\tclass=\"bui-ripple\"\n\t\t*ngIf=\"!disabled\"\n\t\t[matRippleTrigger]=\"toggleTrigger\"\n\t></div>\n\t<div class=\"bui-selection-panel-item-header\" #toggleTrigger>\n\t\t<mat-checkbox [(ngModel)]=\"checked\" [color]=\"color\" [disabled]=\"disabled\" (change)=\"_markInteracted()\">\n\t\t\t<div class=\"bui-selection-panel-item-title\" [innerHTML]=\"title\"></div>\n\t\t</mat-checkbox>\n\t</div>\n\n\t<div class=\"bui-selection-panel-item-content\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"bui-selection-panel-item-bottom\"></div>\n</div>\n","import { ChangeDetectorRef, ContentChildren, Directive, forwardRef, Input, QueryList } from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ThemePalette } from '@angular/material/core';\nimport {\n\tSelectionPanelItemComponent,\n\tSelectionPanelItemGroup,\n\tSELECTION_PANEL_GROUP\n} from './selection-panel-item.component';\n\n/**\n * Selection panel is a [control value accessor](https://angular.io/api/forms/ControlValueAccessor)\n * that display a set of multi-selection items as bordered panels, in a similar fashion as Radio Panel `bui-radio-panel`.\n *\n * Accessibility features are not yet fully implemented.\n *\n * Example:\n *\n * ```html\n * <bui-selection-panel>\n * <bui-selection-panel-item *ngFor=\"let obj of objects\" [value]=\"obj\">{{obj.description}}</bui-selection-panel-item>\n * </bui-selection-panel>\n * ```\n *\n */\n@Directive({\n\tselector: 'bui-selection-panel',\n\tproviders: [\n\t\t{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectionPanelDirective), multi: true },\n\t\t{ provide: SELECTION_PANEL_GROUP, useExisting: forwardRef(() => SelectionPanelDirective) }\n\t],\n\texportAs: 'buiSelectionPanel'\n})\nexport class SelectionPanelDirective implements ControlValueAccessor, SelectionPanelItemGroup {\n\t/** Theme color for all of the selection checkboxes in the group. */\n\t@Input() color: ThemePalette;\n\n\t/**\n\t * @ignore\n\t * The selected values. Used by the child elements to modify the group's value\n\t */\n\tget _selection(): any[] {\n\t\treturn this._selected;\n\t}\n\tset _selection(value: any[]) {\n\t\tif (value !== this._selected) {\n\t\t\tthis._selected = value;\n\t\t\tthis._onChange(this._selected);\n\t\t\tthis._cd.markForCheck();\n\t\t}\n\t}\n\n\t/** @ignore */\n\t_onTouched!: () => void;\n\n\t/** @ignore */\n\t_isDisabled = false;\n\n\tprivate _onChange!: (_: any) => void;\n\n\tprivate _selected: any[] = [];\n\n\t@ContentChildren(SelectionPanelItemComponent, { descendants: true })\n\tprivate _items!: QueryList<SelectionPanelItemComponent>;\n\n\tconstructor(private _cd: ChangeDetectorRef) {}\n\n\t/**\n\t * @ignore\n\t */\n\twriteValue(obj: any): void {\n\t\tthis._selected = [];\n\t\tif (Array.isArray(obj)) {\n\t\t\tthis._selected.push(...obj);\n\t\t} else if (obj !== null && obj !== undefined) {\n\t\t\tthis._selected.push(obj);\n\t\t}\n\t\tthis._items?.forEach(it => it._notify());\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tregisterOnChange(fn: (_: any) => void): void {\n\t\tthis._onChange = fn;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tregisterOnTouched(fn: () => void): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\t/**\n\t * Sets the disabled state and marks for check if a change occurred.\n\t * @ignore\n\t */\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tif (this._isDisabled !== isDisabled) {\n\t\t\tthis._isDisabled = isDisabled;\n\t\t\tthis._cd.markForCheck();\n\t\t\tthis._items.forEach(it => it._notify());\n\t\t}\n\t}\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SelectionPanelDirective } from './selection-panel.directive';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { SelectionPanelItemComponent } from './selection-panel-item.component';\nimport { FormsModule } from '@angular/forms';\nimport { MatRippleModule } from '@angular/material/core';\n\n@NgModule({\n\tdeclarations: [SelectionPanelDirective, SelectionPanelItemComponent],\n\timports: [CommonModule, MatCheckboxModule, FormsModule, MatRippleModule]\n})\nexport class SelectionPanelModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAcA;;;AAGO,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAA0B,yBAAyB,CAAC,CAAC;AAE5G;;;MAiBa,2BAA2B;IA4DvC,YAAmD,MAA+B,EAAU,GAAsB;QAA/D,WAAM,GAAN,MAAM,CAAyB;QAAU,QAAG,GAAH,GAAG,CAAmB;;;;QAjDlH,UAAK,GAAG,EAAE,CAAC;QA8CH,cAAS,GAAG,KAAK,CAAC;KAG4F;;IA9CtH,IACI,QAAQ;QACX,OAAO,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;KACjD;IACD,IAAI,QAAQ,CAAC,KAAc;QAC1B,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC;KAChD;;IAGD,IACI,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;;;ACXD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"bravura-ui-selection-panel.js","sources":["../../../projects/ui/selection-panel/selection-panel-item.component.ts","../../../projects/ui/selection-panel/selection-panel-item.component.html","../../../projects/ui/selection-panel/selection-panel.directive.ts","../../../projects/ui/selection-panel/selection-panel.module.ts","../../../projects/ui/selection-panel/bravura-ui-selection-panel.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport {\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tInject,\n\tInjectionToken,\n\tInput,\n\tViewChild\n} from '@angular/core';\nimport { MatRipple, ThemePalette } from '@angular/material/core';\n\n/**\n * @ignore\n */\nexport interface SelectionPanelItemGroup {\n\t_selection: any[];\n\tcolor: ThemePalette;\n\t_isDisabled: boolean;\n\t_onTouched: () => void;\n\tselectByHeader: boolean;\n}\n\n/**\n * @ignore\n */\nexport const SELECTION_PANEL_GROUP = new InjectionToken<SelectionPanelItemGroup>('SelectionPanelItemGroup');\n\n/**\n * Use `bui-selection-panel-item` within a `bui-selection-panel` to display an option.\n */\n@Component({\n\tselector: 'bui-selection-panel-item',\n\ttemplateUrl: './selection-panel-item.component.html',\n\tstyleUrls: ['./selection-panel-item.component.scss'],\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\thost: {\n\t\tclass: 'bui-selection-panel-item',\n\t\t'[class.bui-selection-checked]': 'checked',\n\t\t'[class.bui-border-accent]': `checked && color ==='accent'`,\n\t\t'[class.bui-border-primary]': `checked && color ==='primary'`,\n\t\t'[class.bui-border-warn]': `checked && color ==='warn'`,\n\t\t'[class.bui-disabled]': 'disabled'\n\t}\n})\nexport class SelectionPanelItemComponent {\n\t/** @ignore */\n\tstatic ngAcceptInputType_disabled: boolean | string;\n\n\t/** @ignore */\n\tstatic ngAcceptInputType_checked: boolean | string;\n\n\t/**\n\t * This will be displayed as the panel header\n\t */\n\t@Input()\n\ttitle = '';\n\n\t/** Whether the option is disabled. */\n\t@Input()\n\tget disabled(): boolean {\n\t\treturn this._disabled || this._group._isDisabled;\n\t}\n\tset disabled(value: boolean) {\n\t\tthis._setDisabled(coerceBooleanProperty(value));\n\t}\n\n\t/** The value of this option. */\n\t@Input()\n\tget value(): any {\n\t\treturn this._value;\n\t}\n\tset value(value: any) {\n\t\tif (this._value !== value) {\n\t\t\tthis._value = value;\n\t\t\tthis._cd.markForCheck();\n\t\t}\n\t}\n\n\t/** Whether this option is checked. */\n\t@Input()\n\tget checked(): boolean {\n\t\treturn this._group._selection.includes(this.value);\n\t}\n\tset checked(value: boolean) {\n\t\tif (!this._group._onTouched) {\n\t\t\tsetTimeout(() => this._setChecked(value), 0);\n\t\t} else {\n\t\t\tthis._setChecked(value);\n\t\t}\n\t}\n\n\t/** Theme color of the radio button. */\n\t@Input()\n\tget color(): ThemePalette {\n\t\treturn this._color || this._group.color;\n\t}\n\tset color(newValue: ThemePalette) {\n\t\tthis._color = newValue;\n\t}\n\n\tget _selectByHeader(): boolean {\n\t\treturn this._group.selectByHeader;\n\t}\n\n\tprivate _color: ThemePalette;\n\tprivate _disabled = false;\n\tprivate _value: any;\n\n\t@ViewChild(MatRipple)\n\tprivate _ripple?: MatRipple;\n\n\tconstructor(@Inject(SELECTION_PANEL_GROUP) private _group: SelectionPanelItemGroup, private _cd: ChangeDetectorRef) {}\n\n\t/** @ignore */\n\t_markInteracted() {\n\t\tthis._group._onTouched();\n\t}\n\n\t/** @ignore */\n\t_notify() {\n\t\tthis._cd.markForCheck();\n\t}\n\n\t/** Toggle selection programmatically */\n\ttoggle() {\n\t\tthis.checked = !this.checked;\n\t}\n\n\t/** @ignore */\n\t_contentClicked(event: MouseEvent) {\n\t\tif (!this._selectByHeader) {\n\t\t\tthis._ripple?.launch(event.clientX, event.clientY);\n\t\t\tthis.toggle();\n\t\t}\n\t}\n\n\t/** Sets the disabled state and marks for check if a change occurred. */\n\tprivate _setDisabled(value: boolean) {\n\t\tif (this._disabled !== value) {\n\t\t\tthis._disabled = value;\n\t\t\tthis._cd.markForCheck();\n\t\t}\n\t}\n\n\tprivate _setChecked(value: boolean) {\n\t\tconst newCheckedState = coerceBooleanProperty(value);\n\t\tconst old = this._group._selection.includes(this.value);\n\t\tif (old !== newCheckedState) {\n\t\t\tconst contained = this._group._selection.some(v => v === this._value);\n\t\t\tif (newCheckedState && this._group && !contained) {\n\t\t\t\tthis._group._selection = [...this._group._selection, this._value];\n\t\t\t} else if (!newCheckedState && this._group && contained) {\n\t\t\t\t// When unchecking the selected item, update the selection\n\t\t\t\t// property on the group.\n\t\t\t\tthis._group._selection = this._group._selection.filter(v => v !== this._value);\n\t\t\t}\n\t\t\tthis._cd.markForCheck();\n\t\t}\n\t}\n}\n","<div class=\"bui-selection-panel-item-wrapper\">\n\t<div\n\t\tmatRipple\n\t\tmatRippleColor=\"rgba(128,128,128,.1)\"\n\t\tclass=\"bui-ripple\"\n\t\t*ngIf=\"!disabled\"\n\t\t[matRippleTrigger]=\"toggleTrigger\"\n\t\t#ripple=\"matRipple\"\n\t></div>\n\t<div class=\"bui-selection-panel-item-header\" #toggleTrigger>\n\t\t<mat-checkbox [(ngModel)]=\"checked\" [color]=\"color\" [disabled]=\"disabled\" (change)=\"_markInteracted()\">\n\t\t\t<div class=\"bui-selection-panel-item-title\" [innerHTML]=\"title\"></div>\n\t\t</mat-checkbox>\n\t</div>\n\n\t<div\n\t\tclass=\"bui-selection-panel-item-content\"\n\t\t[class.bui-selectable]=\"!_selectByHeader\"\n\t\t(click)=\"_contentClicked($event)\"\n\t>\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"bui-selection-panel-item-bottom\"></div>\n</div>\n","import {\n\tChangeDetectorRef,\n\tContentChildren,\n\tDirective,\n\tforwardRef,\n\tInput,\n\tOnChanges,\n\tQueryList,\n\tSimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { ThemePalette } from '@angular/material/core';\nimport {\n\tSelectionPanelItemComponent,\n\tSelectionPanelItemGroup,\n\tSELECTION_PANEL_GROUP\n} from './selection-panel-item.component';\n\n/**\n * Selection panel is a [control value accessor](https://angular.io/api/forms/ControlValueAccessor)\n * that display a set of multi-selection items as bordered panels, in a similar fashion as Radio Panel `bui-radio-panel`.\n *\n * Accessibility features are not yet fully implemented.\n *\n * Example:\n *\n * ```html\n * <bui-selection-panel>\n * <bui-selection-panel-item *ngFor=\"let obj of objects\" [value]=\"obj\">{{obj.description}}</bui-selection-panel-item>\n * </bui-selection-panel>\n * ```\n *\n */\n@Directive({\n\tselector: 'bui-selection-panel',\n\tproviders: [\n\t\t{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectionPanelDirective), multi: true },\n\t\t{ provide: SELECTION_PANEL_GROUP, useExisting: forwardRef(() => SelectionPanelDirective) }\n\t],\n\texportAs: 'buiSelectionPanel'\n})\nexport class SelectionPanelDirective implements ControlValueAccessor, SelectionPanelItemGroup, OnChanges {\n\t/** Theme color for all of the selection checkboxes in the group. */\n\t@Input() color: ThemePalette;\n\n\t/**\n\t * When set to `false`, the selection is triggered by click everywhere within the panels that is\n\t * not focus-trapping; otherwise, only clicking on the header will activate the selection.\n\t *\n\t * @default true\n\t */\n\t@Input() selectByHeader = true;\n\n\t/**\n\t * @ignore\n\t * The selected values. Used by the child elements to modify the group's value\n\t */\n\tget _selection(): any[] {\n\t\treturn this._selected;\n\t}\n\tset _selection(value: any[]) {\n\t\tif (value !== this._selected) {\n\t\t\tthis._selected = value;\n\t\t\tthis._onChange(this._selected);\n\t\t\tthis._cd.markForCheck();\n\t\t}\n\t}\n\n\t/** @ignore */\n\t_onTouched!: () => void;\n\n\t/** @ignore */\n\t_isDisabled = false;\n\n\tprivate _onChange!: (_: any) => void;\n\n\tprivate _selected: any[] = [];\n\n\t@ContentChildren(SelectionPanelItemComponent, { descendants: true })\n\tprivate _items!: QueryList<SelectionPanelItemComponent>;\n\n\tconstructor(private _cd: ChangeDetectorRef) {}\n\n\t/**\n\t * @ignore\n\t */\n\twriteValue(obj: any): void {\n\t\tthis._selected = [];\n\t\tif (Array.isArray(obj)) {\n\t\t\tthis._selected.push(...obj);\n\t\t} else if (obj !== null && obj !== undefined) {\n\t\t\tthis._selected.push(obj);\n\t\t}\n\t\tthis._items?.forEach(it => it._notify());\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tregisterOnChange(fn: (_: any) => void): void {\n\t\tthis._onChange = fn;\n\t}\n\n\t/**\n\t * @ignore\n\t */\n\tregisterOnTouched(fn: () => void): void {\n\t\tthis._onTouched = fn;\n\t}\n\n\t/**\n\t * Sets the disabled state and marks for check if a change occurred.\n\t * @ignore\n\t */\n\tsetDisabledState(isDisabled: boolean): void {\n\t\tif (this._isDisabled !== isDisabled) {\n\t\t\tthis._isDisabled = isDisabled;\n\t\t\tthis._cd.markForCheck();\n\t\t\tthis._items.forEach(it => it._notify());\n\t\t}\n\t}\n\n\t/** @ignore */\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tif (this._items) {\n\t\t\tif (changes.color || changes.selectByHeader) {\n\t\t\t\tthis._items.forEach(item => item._notify());\n\t\t\t}\n\t\t}\n\t}\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { SelectionPanelDirective } from './selection-panel.directive';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { SelectionPanelItemComponent } from './selection-panel-item.component';\nimport { FormsModule } from '@angular/forms';\nimport { MatRippleModule } from '@angular/material/core';\n\n@NgModule({\n\tdeclarations: [SelectionPanelDirective, SelectionPanelItemComponent],\n\timports: [CommonModule, MatCheckboxModule, FormsModule, MatRippleModule]\n})\nexport class SelectionPanelModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;AAuBA;;;AAGO,MAAM,qBAAqB,GAAG,IAAI,cAAc,CAA0B,yBAAyB,CAAC,CAAC;AAE5G;;;MAiBa,2BAA2B;IAmEvC,YAAmD,MAA+B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|
|
23
|
+
/** @ignore */
|
|
24
|
+
_hostClicked(event: MouseEvent): void;
|
|
23
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldComponent, never>;
|
|
24
26
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormFieldComponent, "bui-form-field", ["buiFormField"], { "color": "color"; }, {}, never, ["[matPrefix]", "*", "mat-placeholder", "mat-label", "[matSuffix]", "mat-error", "mat-hint:not([align='end'])", "mat-hint[align='end']"]>;
|
|
25
27
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ChangeDetectorRef, QueryList } from '@angular/core';
|
|
1
|
+
import { ChangeDetectorRef, OnChanges, QueryList, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { ThemePalette } from '@angular/material/core';
|
|
2
3
|
import { MatRadioGroup } from '@angular/material/radio';
|
|
3
4
|
import { RadioPanelItemComponent } from './radio-panel-item.component';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
@@ -10,12 +11,16 @@ import * as i0 from "@angular/core";
|
|
|
10
11
|
* in the color selected by the theme attribute `color`.
|
|
11
12
|
*
|
|
12
13
|
*/
|
|
13
|
-
export declare class RadioPanelDirective extends MatRadioGroup {
|
|
14
|
+
export declare class RadioPanelDirective extends MatRadioGroup implements OnChanges {
|
|
15
|
+
/** Theme color for all of the radio panels in the group. */
|
|
16
|
+
color: ThemePalette;
|
|
14
17
|
/**
|
|
15
18
|
* @ignore
|
|
16
19
|
*/
|
|
17
20
|
_radios: QueryList<RadioPanelItemComponent>;
|
|
18
21
|
constructor(cd: ChangeDetectorRef);
|
|
22
|
+
/** @ignore */
|
|
23
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
19
24
|
static ɵfac: i0.ɵɵFactoryDeclaration<RadioPanelDirective, never>;
|
|
20
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RadioPanelDirective, "bui-radio-panel", ["buiRadioPanel"], {}, {}, ["_radios"]>;
|
|
25
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RadioPanelDirective, "bui-radio-panel", ["buiRadioPanel"], { "color": "color"; }, {}, ["_radios"]>;
|
|
21
26
|
}
|
|
@@ -9,6 +9,7 @@ export interface SelectionPanelItemGroup {
|
|
|
9
9
|
color: ThemePalette;
|
|
10
10
|
_isDisabled: boolean;
|
|
11
11
|
_onTouched: () => void;
|
|
12
|
+
selectByHeader: boolean;
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* @ignore
|
|
@@ -40,14 +41,20 @@ export declare class SelectionPanelItemComponent {
|
|
|
40
41
|
/** Theme color of the radio button. */
|
|
41
42
|
get color(): ThemePalette;
|
|
42
43
|
set color(newValue: ThemePalette);
|
|
44
|
+
get _selectByHeader(): boolean;
|
|
43
45
|
private _color;
|
|
44
46
|
private _disabled;
|
|
45
47
|
private _value;
|
|
48
|
+
private _ripple?;
|
|
46
49
|
constructor(_group: SelectionPanelItemGroup, _cd: ChangeDetectorRef);
|
|
47
50
|
/** @ignore */
|
|
48
51
|
_markInteracted(): void;
|
|
49
52
|
/** @ignore */
|
|
50
53
|
_notify(): void;
|
|
54
|
+
/** Toggle selection programmatically */
|
|
55
|
+
toggle(): void;
|
|
56
|
+
/** @ignore */
|
|
57
|
+
_contentClicked(event: MouseEvent): void;
|
|
51
58
|
/** Sets the disabled state and marks for check if a change occurred. */
|
|
52
59
|
private _setDisabled;
|
|
53
60
|
private _setChecked;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectorRef } from '@angular/core';
|
|
1
|
+
import { ChangeDetectorRef, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
|
3
3
|
import { ThemePalette } from '@angular/material/core';
|
|
4
4
|
import { SelectionPanelItemGroup } from './selection-panel-item.component';
|
|
@@ -18,10 +18,17 @@ import * as i0 from "@angular/core";
|
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
|
-
export declare class SelectionPanelDirective implements ControlValueAccessor, SelectionPanelItemGroup {
|
|
21
|
+
export declare class SelectionPanelDirective implements ControlValueAccessor, SelectionPanelItemGroup, OnChanges {
|
|
22
22
|
private _cd;
|
|
23
23
|
/** Theme color for all of the selection checkboxes in the group. */
|
|
24
24
|
color: ThemePalette;
|
|
25
|
+
/**
|
|
26
|
+
* When set to `false`, the selection is triggered by click everywhere within the panels that is
|
|
27
|
+
* not focus-trapping; otherwise, only clicking on the header will activate the selection.
|
|
28
|
+
*
|
|
29
|
+
* @default true
|
|
30
|
+
*/
|
|
31
|
+
selectByHeader: boolean;
|
|
25
32
|
/**
|
|
26
33
|
* @ignore
|
|
27
34
|
* The selected values. Used by the child elements to modify the group's value
|
|
@@ -53,6 +60,8 @@ export declare class SelectionPanelDirective implements ControlValueAccessor, Se
|
|
|
53
60
|
* @ignore
|
|
54
61
|
*/
|
|
55
62
|
setDisabledState(isDisabled: boolean): void;
|
|
63
|
+
/** @ignore */
|
|
64
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
56
65
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectionPanelDirective, never>;
|
|
57
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<SelectionPanelDirective, "bui-selection-panel", ["buiSelectionPanel"], { "color": "color"; }, {}, ["_items"]>;
|
|
66
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SelectionPanelDirective, "bui-selection-panel", ["buiSelectionPanel"], { "color": "color"; "selectByHeader": "selectByHeader"; }, {}, ["_items"]>;
|
|
58
67
|
}
|
package/theme/_ui-theme.scss
CHANGED
|
@@ -8,14 +8,12 @@ $default-border-color-transition: border-color 100ms cubic-bezier(0.55, 0, 0.55,
|
|
|
8
8
|
border-color: currentColor !important;
|
|
9
9
|
transition: $border-color-transition;
|
|
10
10
|
}
|
|
11
|
-
}
|
|
12
11
|
|
|
13
|
-
@mixin theme($theme, $border-color-transition: $default-border-color-transition) {
|
|
14
12
|
$color-config: mat.get-color-config($theme);
|
|
15
13
|
@if $color-config != null {
|
|
16
14
|
@each $p in (primary, accent, warn) {
|
|
17
15
|
$primary-palette: map.get($color-config, $p);
|
|
18
|
-
$c: mat.get-color-from-palette($primary-palette,
|
|
16
|
+
$c: mat.get-color-from-palette($primary-palette, text);
|
|
19
17
|
.bui-border-#{$p} {
|
|
20
18
|
border-color: $c !important;
|
|
21
19
|
transition: $border-color-transition;
|
|
@@ -26,9 +24,14 @@ $default-border-color-transition: border-color 100ms cubic-bezier(0.55, 0, 0.55,
|
|
|
26
24
|
.bui-color-#{$p} {
|
|
27
25
|
color: $c !important;
|
|
28
26
|
}
|
|
27
|
+
.bui-outline-#{$p} {
|
|
28
|
+
outline-color: $c !important;
|
|
29
|
+
}
|
|
29
30
|
}
|
|
30
31
|
}
|
|
32
|
+
}
|
|
31
33
|
|
|
34
|
+
@mixin theme($theme, $border-color-transition: $default-border-color-transition) {
|
|
32
35
|
@include apply-colors($theme, $border-color-transition);
|
|
33
36
|
|
|
34
37
|
.mat-icon {
|