From f8ce4fe1b2153a51d13ee6d9c6a0909951d634fc Mon Sep 17 00:00:00 2001 From: krupa Date: Fri, 11 Aug 2017 03:39:25 +0000 Subject: [PATCH] 4f40477 publish-0.0.28 --- autocomplete/autocomplete.d.ts | 1 + autocomplete/autocomplete.html | 2 +- autocomplete/autocomplete.js | 6 ++++-- autocomplete/autocomplete.js.map | 2 +- autocomplete/autocomplete.metadata.json | 2 +- bundles/md2.js | 21 ++++++++++++++------- bundles/md2.umd.js | 21 ++++++++++++++------- data-table/data-table.css | 2 +- data-table/data-table.css.map | 2 +- data-table/data-table.d.ts | 1 + data-table/data-table.js | 11 ++++++++--- data-table/data-table.js.map | 2 +- data-table/data-table.metadata.json | 2 +- data-table/data-table.scss | 5 +++++ data-table/pagination.html | 2 +- datepicker/calendar-body.css | 2 +- datepicker/calendar-body.css.map | 2 +- datepicker/calendar-body.js | 2 +- datepicker/calendar-body.scss | 1 + package.json | 2 +- 20 files changed, 60 insertions(+), 31 deletions(-) diff --git a/autocomplete/autocomplete.d.ts b/autocomplete/autocomplete.d.ts index 6e821dca9..ad18c4128 100644 --- a/autocomplete/autocomplete.d.ts +++ b/autocomplete/autocomplete.d.ts @@ -58,6 +58,7 @@ export declare class Md2Autocomplete implements AfterContentInit, ControlValueAc * input event listner * @param event */ + _handleKeyup(event: KeyboardEvent): void; _handleKeydown(event: KeyboardEvent): void; /** * select option diff --git a/autocomplete/autocomplete.html b/autocomplete/autocomplete.html index 377808fc3..9b6fe0c5f 100644 --- a/autocomplete/autocomplete.html +++ b/autocomplete/autocomplete.html @@ -1 +1 @@ -
{{ placeholder }}
\ No newline at end of file +
{{ placeholder }}
\ No newline at end of file diff --git a/autocomplete/autocomplete.js b/autocomplete/autocomplete.js index 1583d2558..c88697aa1 100644 --- a/autocomplete/autocomplete.js +++ b/autocomplete/autocomplete.js @@ -186,12 +186,14 @@ var Md2Autocomplete = (function () { * input event listner * @param event */ + Md2Autocomplete.prototype._handleKeyup = function (event) { + this.textChange.emit(this._inputValue); + }; Md2Autocomplete.prototype._handleKeydown = function (event) { var _this = this; if (this.disabled) { return; } - this.textChange.emit(this._inputValue); switch (event.keyCode) { case TAB: this._handleMouseLeave(); @@ -407,7 +409,7 @@ __decorate([ ], Md2Autocomplete.prototype, "value", null); Md2Autocomplete = __decorate([ Component({selector: 'md2-autocomplete', - template: "
{{ placeholder }}
", + template: "
{{ placeholder }}
", styles: ["md2-autocomplete{position:relative;display:block;margin:18px 0;outline:0;user-select:none;backface-visibility:hidden}md2-autocomplete.md2-autocomplete-disabled{pointer-events:none;cursor:default}.md2-autocomplete-trigger{position:relative;display:block;width:100%;padding:2px 2px 1px;border-bottom:1px solid rgba(0,0,0,.12);box-sizing:border-box;min-width:64px;min-height:26px;cursor:pointer}.md2-autocomplete-trigger.is-focused{padding-bottom:0;border-bottom:2px solid #106cc8}md2-autocomplete.ng-invalid.ng-touched:not(.md2-autocomplete-disabled) .md2-autocomplete-trigger{color:#f44336;border-bottom-color:#f44336}md2-autocomplete.md2-autocomplete-disabled .md2-autocomplete-trigger{color:rgba(0,0,0,.38);border-color:transparent;background-image:linear-gradient(to right,rgba(0,0,0,.38) 0,rgba(0,0,0,.38) 33%,transparent 0);background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x;cursor:default}md2-autocomplete.md2-autocomplete-disabled .md2-autocomplete-trigger.is-focused{padding-bottom:1px;border-bottom:1px solid transparent}.md2-autocomplete-input{width:100%;height:26px;font-size:15px;outline:0;background:0 0;border:0;box-sizing:border-box}md2-autocomplete.md2-autocomplete-disabled .md2-autocomplete-input{color:rgba(0,0,0,.38)}.md2-autocomplete-placeholder{position:absolute;right:26px;bottom:100%;left:0;max-width:100%;padding-left:3px;padding-right:0;line-height:1.4;color:rgba(0,0,0,.38);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;z-index:1;transform:translate3d(0,26px,0) scale(1);transition:transform .4s cubic-bezier(.25,.8,.25,1);transform-origin:left top}[aria-required=true] .md2-autocomplete-placeholder::after{content:'*'}.md2-autocomplete-trigger.is-focused .md2-autocomplete-placeholder{color:#106cc8}.md2-autocomplete-trigger.is-focused .md2-autocomplete-placeholder,md2-autocomplete .md2-autocomplete-placeholder.has-value{transform:translate3d(0,6px,0) scale(.75)}.md2-autocomplete-trigger svg{position:absolute;right:0;top:0;display:block;height:100%;background:#fff;fill:currentColor;color:rgba(0,0,0,.54)}.md2-autocomplete-menu{position:absolute;left:0;top:100%;display:block;z-index:10;width:100%;margin:0;padding:8px 0;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:auto;background:#fff}.md2-autocomplete-menu .md2-option{position:relative;display:block;color:#212121;cursor:pointer;width:auto;padding:0 16px;height:48px;line-height:48px;transition:background 150ms linear}.md2-autocomplete-menu .md2-option.focus,.md2-autocomplete-menu .md2-option:hover{background:#ededed}.md2-autocomplete-menu .md2-option .md2-text{width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px}.md2-autocomplete-menu .highlight{color:#737373} /*# sourceMappingURL=autocomplete.css.map */ "], providers: [MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR], host: { diff --git a/autocomplete/autocomplete.js.map b/autocomplete/autocomplete.js.map index 1f8c21b0d..962de1df6 100644 --- a/autocomplete/autocomplete.js.map +++ b/autocomplete/autocomplete.js.map @@ -1 +1 @@ -{"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../../src/lib/autocomplete/autocomplete.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAEL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,UAAU,EACV,KAAK,EACL,MAAM,EACN,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,GAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,qBAAqB,EACrB,QAAQ,EACR,UAAU,EACV,KAAK,EACL,M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KAAK,CAAC,YAAY,CAAC;;kDAAuB;AAG3C;IADC,KAAK,EAAE;;;+CAC0C;AAIlD;IADC,KAAK,EAAE;;;+CAC0C;AAIlD;IADC,KAAK,EAAE;;;+CAC0C;AAIlD;IADC,KAAK,EAAE;8BACS,KAAK;qCAAL,KAAK;4CAA+B;AAGrD;IADC,KAAK,EAAE;;;4CACgC;AAlD7B,eAAe;IAlB3B,SAAS,CAAC;QACT,QAAQ,EAAE,MAAM,CAAC,EAAE;QACnB,QAAQ,EAAE,kBAAkB;QAC5B,WAAW,EAAE,mBAAmB;QAChC,SAAS,EAAE,CAAC,kBAAkB,CAAC;QAC/B,SAAS,EAAE,CAAC,uCAAuC,CAAC;QACpD,IAAI,EAAE;YACJ,MAAM,EAAE,cAAc;YACtB,MAAM,EAAE,IAAI;YACZ,mBAAmB,EAAE,aAAa;YAClC,sBAAsB,EAAE,qBAAqB;YAC7C,sBAAsB,EAAE,qBAAqB;YAC7C,mCAAmC,EAAE,UAAU;SAChD;QACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;QACrC,QAAQ,EAAE,iBAAiB;KAC5B,CAAC;qCAI8B,UAAU;GAF7B,eAAe,CAgS3B;SAhSY,eAAe","sourcesContent":["import {\n AfterContentInit,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n NG_VALUE_ACCESSOR,\n ControlValueAccessor,\n} from '@angular/forms';\nimport {\n coerceBooleanProperty,\n UP_ARROW,\n DOWN_ARROW,\n ENTER,\n ESCAPE,\n TAB\n} from '../core/core';\n\nexport class Item {\n text: string;\n value: string;\n\n constructor(source: any, textKey: string, valueKey: string) {\n if (typeof source === 'string') {\n this.text = this.value = source;\n }\n if (typeof source === 'object') {\n this.text = source[textKey];\n this.value = valueKey ? source[valueKey] : source;\n }\n }\n}\n\nlet nextId = 0;\n\nexport const MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Md2Autocomplete),\n multi: true\n};\n\n/** Change event object emitted by Md2Autocomplete. */\nexport class Md2AutocompleteChange {\n source: Md2Autocomplete;\n value: any;\n}\n\n@Component({\n moduleId: module.id,\n selector: 'md2-autocomplete',\n templateUrl: 'autocomplete.html',\n styleUrls: ['autocomplete.css'],\n providers: [MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR],\n host: {\n 'role': 'autocomplete',\n '[id]': 'id',\n '[attr.aria-label]': 'placeholder',\n '[attr.aria-required]': 'required.toString()',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[class.md2-autocomplete-disabled]': 'disabled',\n },\n encapsulation: ViewEncapsulation.None,\n exportAs: 'md2Autocomplete'\n})\n\nexport class Md2Autocomplete implements AfterContentInit, ControlValueAccessor {\n\n constructor(private _element: ElementRef) { }\n\n ngAfterContentInit() { this._isInitialized = true; }\n\n @Output() change: EventEmitter = new EventEmitter();\n @Output() textChange = new EventEmitter();\n\n private _value: any = '';\n private _readonly: boolean = false;\n private _required: boolean = false;\n private _disabled: boolean = false;\n private _isInitialized: boolean = false;\n\n _onChange: (value: any) => void = () => { };\n _onTouched = () => { };\n\n private _items: Array = [];\n _list: Array = [];\n\n private selectedItem: Item = null;\n private noBlur: boolean = false;\n _focusedOption: number = 0;\n _inputValue: string = '';\n _inputFocused: boolean = false;\n\n @Input() id: string = 'md2-autocomplete-' + (++nextId);\n @Input() tabindex: number = 0;\n @Input() placeholder: string = '';\n @Input('item-text') textKey: string = 'text';\n @Input('item-value') valueKey: string = null;\n @Input('min-length') minLength: number = 1;\n\n @Input()\n get readonly(): boolean { return this._readonly; }\n set readonly(value) { this._readonly = coerceBooleanProperty(value); }\n\n @Input()\n get required(): boolean { return this._required; }\n set required(value) { this._required = coerceBooleanProperty(value); }\n\n @Input()\n get disabled(): boolean { return this._disabled; }\n set disabled(value) { this._disabled = coerceBooleanProperty(value); }\n\n @Input()\n set items(value: Array) { this._items = value; }\n\n @Input()\n get value(): any { return this._value; }\n set value(value: any) {\n if (value !== this._value) {\n this._value = value;\n this._inputValue = '';\n if (value) {\n let selItm = this._items.find((i: any) => this.equals(this.valueKey ?\n i[this.valueKey] : i, value));\n this.selectedItem = new Item(selItm, this.textKey, this.valueKey);\n if (this.selectedItem) { this._inputValue = this.selectedItem.text; }\n }\n if (!this._inputValue) { this._inputValue = ''; }\n if (this._isInitialized) {\n this._emitChangeEvent();\n }\n }\n }\n\n /**\n * Compare two vars or objects\n * @param o1 compare first object\n * @param o2 compare second object\n * @return boolean comparation result\n */\n private equals(o1: any, o2: any) {\n if (o1 === o2) { return true; }\n if (o1 === null || o2 === null) { return false; }\n if (o1 !== o1 && o2 !== o2) { return true; }\n let t1 = typeof o1, t2 = typeof o2, key: any, keySet: any;\n if (t1 === t2 && t1 === 'object') {\n keySet = Object.create(null);\n for (key in o1) {\n if (!this.equals(o1[key], o2[key])) { return false; }\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) && key.charAt(0) !== '$' && o2[key]) { return false; }\n }\n return true;\n }\n return false;\n }\n\n get isMenuVisible(): boolean {\n return ((this._inputFocused || this.noBlur) && this._list && this._list.length &&\n !this.selectedItem) && !this.readonly ? true : false;\n }\n\n /**\n * update scroll of suggestion menu\n */\n private updateScroll() {\n if (this._focusedOption < 0) { return; }\n let menuContainer = this._element.nativeElement.querySelector('.md2-autocomplete-menu');\n if (!menuContainer) { return; }\n\n let choices = menuContainer.querySelectorAll('.md2-option');\n if (choices.length < 1) { return; }\n\n let highlighted: any = choices[this._focusedOption];\n if (!highlighted) { return; }\n\n let top: number = highlighted.offsetTop + highlighted.clientHeight - menuContainer.scrollTop;\n let height: number = menuContainer.offsetHeight;\n\n if (top > height) {\n menuContainer.scrollTop += top - height;\n } else if (top < highlighted.clientHeight) {\n menuContainer.scrollTop -= highlighted.clientHeight - top;\n }\n }\n\n /**\n * input event listner\n * @param event\n */\n _handleKeydown(event: KeyboardEvent) {\n if (this.disabled) { return; }\n this.textChange.emit(this._inputValue);\n switch (event.keyCode) {\n case TAB: this._handleMouseLeave(); break;\n case ESCAPE:\n event.stopPropagation();\n event.preventDefault();\n if (this._inputValue) {\n this._onClear();\n }\n break;\n\n case ENTER:\n event.preventDefault();\n event.stopPropagation();\n if (this.isMenuVisible) {\n this._selectOption(event, this._focusedOption);\n }\n break;\n\n case DOWN_ARROW:\n event.preventDefault();\n event.stopPropagation();\n if (this.isMenuVisible) {\n this._focusedOption = (this._focusedOption === this._list.length - 1) ? 0 :\n Math.min(this._focusedOption + 1, this._list.length - 1);\n this.updateScroll();\n }\n break;\n case UP_ARROW:\n event.preventDefault();\n event.stopPropagation();\n if (this.isMenuVisible) {\n this._focusedOption = (this._focusedOption === 0) ? this._list.length - 1 :\n Math.max(0, this._focusedOption - 1);\n this.updateScroll();\n }\n break;\n default:\n setTimeout(() => {\n this.updateItems();\n }, 10);\n }\n }\n\n /**\n * select option\n * @param event\n * @param index of selected item\n */\n _selectOption(event: Event, index: number) {\n event.preventDefault();\n event.stopPropagation();\n this.selectedItem = this._list[index];\n this._inputValue = this._list[index].text;\n this.updateValue();\n this._handleMouseLeave();\n }\n\n /**\n * clear selected suggestion\n */\n _onClear() {\n if (this.disabled) { return; }\n this._inputValue = '';\n this.selectedItem = null;\n this.updateItems();\n this._value = this.selectedItem ? this.selectedItem.value : this.selectedItem;\n this.updateValue();\n }\n\n /**\n * update value\n */\n private updateValue() {\n this._value = this.selectedItem ? this.selectedItem.value : this.selectedItem;\n this._emitChangeEvent();\n this.onFocus();\n }\n\n /**\n * component focus listener\n */\n private onFocus() {\n if (this.disabled) { return; }\n this._element.nativeElement.querySelector('input').focus();\n }\n\n /**\n * input focus listener\n */\n _handleFocus() {\n this._inputFocused = true;\n this.updateItems();\n this._focusedOption = 0;\n }\n\n /**\n * input blur listener\n */\n _handleBlur() {\n this._inputFocused = false;\n this._onTouched();\n }\n\n /**\n * suggestion menu mouse enter listener\n */\n _handleMouseEnter() { this.noBlur = true; }\n\n /**\n * suggestion menu mouse leave listener\n */\n _handleMouseLeave() { this.noBlur = false; }\n\n /**\n * Update suggestion to filter the query\n * @param query\n */\n private updateItems() {\n if (this._inputValue.length < this.minLength) {\n this._list = [];\n } else {\n this._list = this._items.map((i: any) => new Item(i, this.textKey,\n this.valueKey)).filter(i => new RegExp(this._inputValue, 'ig').test(i.text));\n if (this._list.length && this._list[0].text !== this._inputValue) {\n this.selectedItem = null;\n }\n }\n }\n\n _emitChangeEvent(): void {\n let event = new Md2AutocompleteChange();\n event.source = this;\n event.value = this._value;\n this._onChange(event.value);\n this.change.emit(event);\n }\n\n writeValue(value: any): void {\n if (value !== this._value) {\n this._value = value;\n this._inputValue = '';\n if (value) {\n let selItm = this._items.find((i: any) => this.equals(this.valueKey ?\n i[this.valueKey] : i, value));\n this.selectedItem = new Item(selItm, this.textKey, this.valueKey);\n if (this.selectedItem) { this._inputValue = this.selectedItem.text; }\n }\n if (!this._inputValue) { this._inputValue = ''; }\n }\n }\n\n registerOnChange(fn: (value: any) => void): void { this._onChange = fn; }\n\n registerOnTouched(fn: () => {}): void { this._onTouched = fn; }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n}\n"]} \ No newline at end of file +{"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../../src/lib/autocomplete/autocomplete.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAEL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,UAAU,EACV,KAAK,EACL,MAAM,EACN,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,GAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,qBAAqB,EACrB,QAAQ,EACR,UAAU,EACV,KAAK,EACL,MAAM,EACN,GAAG,EACJ,MAAM,cAAc,CAAC;AAEtB;IAIE,cAAY,MAAW,EAAE,OAAe,EAAE,QAAgB;QACxD,EAAE,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,C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C;AAIlD;IADC,KAAK,EAAE;;;+CAC0C;AAIlD;IADC,KAAK,EAAE;8BACS,KAAK;qCAAL,KAAK;4CAA+B;AAGrD;IADC,KAAK,EAAE;;;4CACgC;AAlD7B,eAAe;IAlB3B,SAAS,CAAC;QACT,QAAQ,EAAE,MAAM,CAAC,EAAE;QACnB,QAAQ,EAAE,kBAAkB;QAC5B,WAAW,EAAE,mBAAmB;QAChC,SAAS,EAAE,CAAC,kBAAkB,CAAC;QAC/B,SAAS,EAAE,CAAC,uCAAuC,CAAC;QACpD,IAAI,EAAE;YACJ,MAAM,EAAE,cAAc;YACtB,MAAM,EAAE,IAAI;YACZ,mBAAmB,EAAE,aAAa;YAClC,sBAAsB,EAAE,qBAAqB;YAC7C,sBAAsB,EAAE,qBAAqB;YAC7C,mCAAmC,EAAE,UAAU;SAChD;QACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;QACrC,QAAQ,EAAE,iBAAiB;KAC5B,CAAC;qCAI8B,UAAU;GAF7B,eAAe,CAmS3B;SAnSY,eAAe","sourcesContent":["import {\n AfterContentInit,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n Output,\n ViewEncapsulation\n} from '@angular/core';\nimport {\n NG_VALUE_ACCESSOR,\n ControlValueAccessor,\n} from '@angular/forms';\nimport {\n coerceBooleanProperty,\n UP_ARROW,\n DOWN_ARROW,\n ENTER,\n ESCAPE,\n TAB\n} from '../core/core';\n\nexport class Item {\n text: string;\n value: string;\n\n constructor(source: any, textKey: string, valueKey: string) {\n if (typeof source === 'string') {\n this.text = this.value = source;\n }\n if (typeof source === 'object') {\n this.text = source[textKey];\n this.value = valueKey ? source[valueKey] : source;\n }\n }\n}\n\nlet nextId = 0;\n\nexport const MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => Md2Autocomplete),\n multi: true\n};\n\n/** Change event object emitted by Md2Autocomplete. */\nexport class Md2AutocompleteChange {\n source: Md2Autocomplete;\n value: any;\n}\n\n@Component({\n moduleId: module.id,\n selector: 'md2-autocomplete',\n templateUrl: 'autocomplete.html',\n styleUrls: ['autocomplete.css'],\n providers: [MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR],\n host: {\n 'role': 'autocomplete',\n '[id]': 'id',\n '[attr.aria-label]': 'placeholder',\n '[attr.aria-required]': 'required.toString()',\n '[attr.aria-disabled]': 'disabled.toString()',\n '[class.md2-autocomplete-disabled]': 'disabled',\n },\n encapsulation: ViewEncapsulation.None,\n exportAs: 'md2Autocomplete'\n})\n\nexport class Md2Autocomplete implements AfterContentInit, ControlValueAccessor {\n\n constructor(private _element: ElementRef) { }\n\n ngAfterContentInit() { this._isInitialized = true; }\n\n @Output() change: EventEmitter = new EventEmitter();\n @Output() textChange = new EventEmitter();\n\n private _value: any = '';\n private _readonly: boolean = false;\n private _required: boolean = false;\n private _disabled: boolean = false;\n private _isInitialized: boolean = false;\n\n _onChange: (value: any) => void = () => { };\n _onTouched = () => { };\n\n private _items: Array = [];\n _list: Array = [];\n\n private selectedItem: Item = null;\n private noBlur: boolean = false;\n _focusedOption: number = 0;\n _inputValue: string = '';\n _inputFocused: boolean = false;\n\n @Input() id: string = 'md2-autocomplete-' + (++nextId);\n @Input() tabindex: number = 0;\n @Input() placeholder: string = '';\n @Input('item-text') textKey: string = 'text';\n @Input('item-value') valueKey: string = null;\n @Input('min-length') minLength: number = 1;\n\n @Input()\n get readonly(): boolean { return this._readonly; }\n set readonly(value) { this._readonly = coerceBooleanProperty(value); }\n\n @Input()\n get required(): boolean { return this._required; }\n set required(value) { this._required = coerceBooleanProperty(value); }\n\n @Input()\n get disabled(): boolean { return this._disabled; }\n set disabled(value) { this._disabled = coerceBooleanProperty(value); }\n\n @Input()\n set items(value: Array) { this._items = value; }\n\n @Input()\n get value(): any { return this._value; }\n set value(value: any) {\n if (value !== this._value) {\n this._value = value;\n this._inputValue = '';\n if (value) {\n let selItm = this._items.find((i: any) => this.equals(this.valueKey ?\n i[this.valueKey] : i, value));\n this.selectedItem = new Item(selItm, this.textKey, this.valueKey);\n if (this.selectedItem) { this._inputValue = this.selectedItem.text; }\n }\n if (!this._inputValue) { this._inputValue = ''; }\n if (this._isInitialized) {\n this._emitChangeEvent();\n }\n }\n }\n\n /**\n * Compare two vars or objects\n * @param o1 compare first object\n * @param o2 compare second object\n * @return boolean comparation result\n */\n private equals(o1: any, o2: any) {\n if (o1 === o2) { return true; }\n if (o1 === null || o2 === null) { return false; }\n if (o1 !== o1 && o2 !== o2) { return true; }\n let t1 = typeof o1, t2 = typeof o2, key: any, keySet: any;\n if (t1 === t2 && t1 === 'object') {\n keySet = Object.create(null);\n for (key in o1) {\n if (!this.equals(o1[key], o2[key])) { return false; }\n keySet[key] = true;\n }\n for (key in o2) {\n if (!(key in keySet) && key.charAt(0) !== '$' && o2[key]) { return false; }\n }\n return true;\n }\n return false;\n }\n\n get isMenuVisible(): boolean {\n return ((this._inputFocused || this.noBlur) && this._list && this._list.length &&\n !this.selectedItem) && !this.readonly ? true : false;\n }\n\n /**\n * update scroll of suggestion menu\n */\n private updateScroll() {\n if (this._focusedOption < 0) { return; }\n let menuContainer = this._element.nativeElement.querySelector('.md2-autocomplete-menu');\n if (!menuContainer) { return; }\n\n let choices = menuContainer.querySelectorAll('.md2-option');\n if (choices.length < 1) { return; }\n\n let highlighted: any = choices[this._focusedOption];\n if (!highlighted) { return; }\n\n let top: number = highlighted.offsetTop + highlighted.clientHeight - menuContainer.scrollTop;\n let height: number = menuContainer.offsetHeight;\n\n if (top > height) {\n menuContainer.scrollTop += top - height;\n } else if (top < highlighted.clientHeight) {\n menuContainer.scrollTop -= highlighted.clientHeight - top;\n }\n }\n\n /**\n * input event listner\n * @param event\n */\n _handleKeyup(event: KeyboardEvent) {\n this.textChange.emit(this._inputValue);\n }\n\n _handleKeydown(event: KeyboardEvent) {\n if (this.disabled) { return; }\n switch (event.keyCode) {\n case TAB: this._handleMouseLeave(); break;\n case ESCAPE:\n event.stopPropagation();\n event.preventDefault();\n if (this._inputValue) {\n this._onClear();\n }\n break;\n\n case ENTER:\n event.preventDefault();\n event.stopPropagation();\n if (this.isMenuVisible) {\n this._selectOption(event, this._focusedOption);\n }\n break;\n\n case DOWN_ARROW:\n event.preventDefault();\n event.stopPropagation();\n if (this.isMenuVisible) {\n this._focusedOption = (this._focusedOption === this._list.length - 1) ? 0 :\n Math.min(this._focusedOption + 1, this._list.length - 1);\n this.updateScroll();\n }\n break;\n case UP_ARROW:\n event.preventDefault();\n event.stopPropagation();\n if (this.isMenuVisible) {\n this._focusedOption = (this._focusedOption === 0) ? this._list.length - 1 :\n Math.max(0, this._focusedOption - 1);\n this.updateScroll();\n }\n break;\n default:\n setTimeout(() => {\n this.updateItems();\n }, 10);\n }\n }\n\n /**\n * select option\n * @param event\n * @param index of selected item\n */\n _selectOption(event: Event, index: number) {\n event.preventDefault();\n event.stopPropagation();\n this.selectedItem = this._list[index];\n this._inputValue = this._list[index].text;\n this.updateValue();\n this._handleMouseLeave();\n }\n\n /**\n * clear selected suggestion\n */\n _onClear() {\n if (this.disabled) { return; }\n this._inputValue = '';\n this.selectedItem = null;\n this.updateItems();\n this._value = this.selectedItem ? this.selectedItem.value : this.selectedItem;\n this.updateValue();\n }\n\n /**\n * update value\n */\n private updateValue() {\n this._value = this.selectedItem ? this.selectedItem.value : this.selectedItem;\n this._emitChangeEvent();\n this.onFocus();\n }\n\n /**\n * component focus listener\n */\n private onFocus() {\n if (this.disabled) { return; }\n this._element.nativeElement.querySelector('input').focus();\n }\n\n /**\n * input focus listener\n */\n _handleFocus() {\n this._inputFocused = true;\n this.updateItems();\n this._focusedOption = 0;\n }\n\n /**\n * input blur listener\n */\n _handleBlur() {\n this._inputFocused = false;\n this._onTouched();\n }\n\n /**\n * suggestion menu mouse enter listener\n */\n _handleMouseEnter() { this.noBlur = true; }\n\n /**\n * suggestion menu mouse leave listener\n */\n _handleMouseLeave() { this.noBlur = false; }\n\n /**\n * Update suggestion to filter the query\n * @param query\n */\n private updateItems() {\n if (this._inputValue.length < this.minLength) {\n this._list = [];\n } else {\n this._list = this._items.map((i: any) => new Item(i, this.textKey,\n this.valueKey)).filter(i => new RegExp(this._inputValue, 'ig').test(i.text));\n if (this._list.length && this._list[0].text !== this._inputValue) {\n this.selectedItem = null;\n }\n }\n }\n\n _emitChangeEvent(): void {\n let event = new Md2AutocompleteChange();\n event.source = this;\n event.value = this._value;\n this._onChange(event.value);\n this.change.emit(event);\n }\n\n writeValue(value: any): void {\n if (value !== this._value) {\n this._value = value;\n this._inputValue = '';\n if (value) {\n let selItm = this._items.find((i: any) => this.equals(this.valueKey ?\n i[this.valueKey] : i, value));\n this.selectedItem = new Item(selItm, this.textKey, this.valueKey);\n if (this.selectedItem) { this._inputValue = this.selectedItem.text; }\n }\n if (!this._inputValue) { this._inputValue = ''; }\n }\n }\n\n registerOnChange(fn: (value: any) => void): void { this._onChange = fn; }\n\n registerOnTouched(fn: () => {}): void { this._onTouched = fn; }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n}\n"]} \ No newline at end of file diff --git a/autocomplete/autocomplete.metadata.json b/autocomplete/autocomplete.metadata.json index 1e2831fc8..9f2ff6761 100644 --- a/autocomplete/autocomplete.metadata.json +++ b/autocomplete/autocomplete.metadata.json @@ -1 +1 @@ -[{"__symbolic":"module","version":3,"metadata":{"Item":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}]}},"MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"Md2Autocomplete"},"multi":true},"Md2AutocompleteChange":{"__symbolic":"class"},"Md2Autocomplete":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"moduleId":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"module"},"member":"id"},"selector":"md2-autocomplete","templateUrl":"autocomplete.html","styleUrls":["autocomplete.css"],"providers":[{"__symbolic":"reference","name":"MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR"}],"host":{"role":"autocomplete","[id]":"id","[attr.aria-label]":"placeholder","[attr.aria-required]":"required.toString()","[attr.aria-disabled]":"disabled.toString()","[class.md2-autocomplete-disabled]":"disabled","$quoted$":["role","[id]","[attr.aria-label]","[attr.aria-required]","[attr.aria-disabled]","[class.md2-autocomplete-disabled]"]},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"},"exportAs":"md2Autocomplete"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"change":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"textChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tabindex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"textKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["item-text"]}]}],"valueKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["item-value"]}]}],"minLength":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["min-length"]}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"items":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"equals":[{"__symbolic":"method"}],"updateScroll":[{"__symbolic":"method"}],"_handleKeydown":[{"__symbolic":"method"}],"_selectOption":[{"__symbolic":"method"}],"_onClear":[{"__symbolic":"method"}],"updateValue":[{"__symbolic":"method"}],"onFocus":[{"__symbolic":"method"}],"_handleFocus":[{"__symbolic":"method"}],"_handleBlur":[{"__symbolic":"method"}],"_handleMouseEnter":[{"__symbolic":"method"}],"_handleMouseLeave":[{"__symbolic":"method"}],"updateItems":[{"__symbolic":"method"}],"_emitChangeEvent":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"Item":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}]}},"MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"Md2Autocomplete"},"multi":true},"Md2AutocompleteChange":{"__symbolic":"class"},"Md2Autocomplete":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"moduleId":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"module"},"member":"id"},"selector":"md2-autocomplete","templateUrl":"autocomplete.html","styleUrls":["autocomplete.css"],"providers":[{"__symbolic":"reference","name":"MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR"}],"host":{"role":"autocomplete","[id]":"id","[attr.aria-label]":"placeholder","[attr.aria-required]":"required.toString()","[attr.aria-disabled]":"disabled.toString()","[class.md2-autocomplete-disabled]":"disabled"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"},"exportAs":"md2Autocomplete"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"change":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"textChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tabindex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"textKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["item-text"]}]}],"valueKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["item-value"]}]}],"minLength":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["min-length"]}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"items":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"equals":[{"__symbolic":"method"}],"updateScroll":[{"__symbolic":"method"}],"_handleKeydown":[{"__symbolic":"method"}],"_selectOption":[{"__symbolic":"method"}],"_onClear":[{"__symbolic":"method"}],"updateValue":[{"__symbolic":"method"}],"onFocus":[{"__symbolic":"method"}],"_handleFocus":[{"__symbolic":"method"}],"_handleBlur":[{"__symbolic":"method"}],"_handleMouseEnter":[{"__symbolic":"method"}],"_handleMouseLeave":[{"__symbolic":"method"}],"updateItems":[{"__symbolic":"method"}],"_emitChangeEvent":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}]}}}}] \ No newline at end of file +[{"__symbolic":"module","version":3,"metadata":{"Item":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}]}},"MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"Md2Autocomplete"},"multi":true},"Md2AutocompleteChange":{"__symbolic":"class"},"Md2Autocomplete":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"moduleId":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"module"},"member":"id"},"selector":"md2-autocomplete","templateUrl":"autocomplete.html","styleUrls":["autocomplete.css"],"providers":[{"__symbolic":"reference","name":"MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR"}],"host":{"role":"autocomplete","[id]":"id","[attr.aria-label]":"placeholder","[attr.aria-required]":"required.toString()","[attr.aria-disabled]":"disabled.toString()","[class.md2-autocomplete-disabled]":"disabled","$quoted$":["role","[id]","[attr.aria-label]","[attr.aria-required]","[attr.aria-disabled]","[class.md2-autocomplete-disabled]"]},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"},"exportAs":"md2Autocomplete"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"change":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"textChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tabindex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"textKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["item-text"]}]}],"valueKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["item-value"]}]}],"minLength":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["min-length"]}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"items":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"equals":[{"__symbolic":"method"}],"updateScroll":[{"__symbolic":"method"}],"_handleKeyup":[{"__symbolic":"method"}],"_handleKeydown":[{"__symbolic":"method"}],"_selectOption":[{"__symbolic":"method"}],"_onClear":[{"__symbolic":"method"}],"updateValue":[{"__symbolic":"method"}],"onFocus":[{"__symbolic":"method"}],"_handleFocus":[{"__symbolic":"method"}],"_handleBlur":[{"__symbolic":"method"}],"_handleMouseEnter":[{"__symbolic":"method"}],"_handleMouseLeave":[{"__symbolic":"method"}],"updateItems":[{"__symbolic":"method"}],"_emitChangeEvent":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"Item":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}]}},"MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR":{"provide":{"__symbolic":"reference","module":"@angular/forms","name":"NG_VALUE_ACCESSOR"},"useExisting":{"__symbolic":"reference","name":"Md2Autocomplete"},"multi":true},"Md2AutocompleteChange":{"__symbolic":"class"},"Md2Autocomplete":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"moduleId":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"module"},"member":"id"},"selector":"md2-autocomplete","templateUrl":"autocomplete.html","styleUrls":["autocomplete.css"],"providers":[{"__symbolic":"reference","name":"MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR"}],"host":{"role":"autocomplete","[id]":"id","[attr.aria-label]":"placeholder","[attr.aria-required]":"required.toString()","[attr.aria-disabled]":"disabled.toString()","[class.md2-autocomplete-disabled]":"disabled"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"},"exportAs":"md2Autocomplete"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef"}]}],"ngAfterContentInit":[{"__symbolic":"method"}],"change":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"textChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"id":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"tabindex":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"placeholder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"textKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["item-text"]}]}],"valueKey":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["item-value"]}]}],"minLength":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"},"arguments":["min-length"]}]}],"readonly":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"required":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"disabled":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"items":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"equals":[{"__symbolic":"method"}],"updateScroll":[{"__symbolic":"method"}],"_handleKeyup":[{"__symbolic":"method"}],"_handleKeydown":[{"__symbolic":"method"}],"_selectOption":[{"__symbolic":"method"}],"_onClear":[{"__symbolic":"method"}],"updateValue":[{"__symbolic":"method"}],"onFocus":[{"__symbolic":"method"}],"_handleFocus":[{"__symbolic":"method"}],"_handleBlur":[{"__symbolic":"method"}],"_handleMouseEnter":[{"__symbolic":"method"}],"_handleMouseLeave":[{"__symbolic":"method"}],"updateItems":[{"__symbolic":"method"}],"_emitChangeEvent":[{"__symbolic":"method"}],"writeValue":[{"__symbolic":"method"}],"registerOnChange":[{"__symbolic":"method"}],"registerOnTouched":[{"__symbolic":"method"}],"setDisabledState":[{"__symbolic":"method"}]}}}}] \ No newline at end of file diff --git a/bundles/md2.js b/bundles/md2.js index 6f54a5489..e5cfc69e3 100644 --- a/bundles/md2.js +++ b/bundles/md2.js @@ -1,5 +1,5 @@ /** - * @license Md2 v0.0.26 + * @license Md2 v0.0.28 * Copyright (c) 2017 Promact, Inc. http://code.promactinfo.com/md2/ * License: MIT */ @@ -5264,11 +5264,13 @@ let Md2Autocomplete = class Md2Autocomplete { * input event listner * @param event */ + _handleKeyup(event) { + this.textChange.emit(this._inputValue); + } _handleKeydown(event) { if (this.disabled) { return; } - this.textChange.emit(this._inputValue); switch (event.keyCode) { case TAB: this._handleMouseLeave(); @@ -5481,7 +5483,7 @@ __decorate$42([ ], Md2Autocomplete.prototype, "value", null); Md2Autocomplete = __decorate$42([ Component({selector: 'md2-autocomplete', - template: "
{{ placeholder }}
", + template: "
{{ placeholder }}
", styles: ["md2-autocomplete{position:relative;display:block;margin:18px 0;outline:0;user-select:none;backface-visibility:hidden}md2-autocomplete.md2-autocomplete-disabled{pointer-events:none;cursor:default}.md2-autocomplete-trigger{position:relative;display:block;width:100%;padding:2px 2px 1px;border-bottom:1px solid rgba(0,0,0,.12);box-sizing:border-box;min-width:64px;min-height:26px;cursor:pointer}.md2-autocomplete-trigger.is-focused{padding-bottom:0;border-bottom:2px solid #106cc8}md2-autocomplete.ng-invalid.ng-touched:not(.md2-autocomplete-disabled) .md2-autocomplete-trigger{color:#f44336;border-bottom-color:#f44336}md2-autocomplete.md2-autocomplete-disabled .md2-autocomplete-trigger{color:rgba(0,0,0,.38);border-color:transparent;background-image:linear-gradient(to right,rgba(0,0,0,.38) 0,rgba(0,0,0,.38) 33%,transparent 0);background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x;cursor:default}md2-autocomplete.md2-autocomplete-disabled .md2-autocomplete-trigger.is-focused{padding-bottom:1px;border-bottom:1px solid transparent}.md2-autocomplete-input{width:100%;height:26px;font-size:15px;outline:0;background:0 0;border:0;box-sizing:border-box}md2-autocomplete.md2-autocomplete-disabled .md2-autocomplete-input{color:rgba(0,0,0,.38)}.md2-autocomplete-placeholder{position:absolute;right:26px;bottom:100%;left:0;max-width:100%;padding-left:3px;padding-right:0;line-height:1.4;color:rgba(0,0,0,.38);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;z-index:1;transform:translate3d(0,26px,0) scale(1);transition:transform .4s cubic-bezier(.25,.8,.25,1);transform-origin:left top}[aria-required=true] .md2-autocomplete-placeholder::after{content:'*'}.md2-autocomplete-trigger.is-focused .md2-autocomplete-placeholder{color:#106cc8}.md2-autocomplete-trigger.is-focused .md2-autocomplete-placeholder,md2-autocomplete .md2-autocomplete-placeholder.has-value{transform:translate3d(0,6px,0) scale(.75)}.md2-autocomplete-trigger svg{position:absolute;right:0;top:0;display:block;height:100%;background:#fff;fill:currentColor;color:rgba(0,0,0,.54)}.md2-autocomplete-menu{position:absolute;left:0;top:100%;display:block;z-index:10;width:100%;margin:0;padding:8px 0;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:auto;background:#fff}.md2-autocomplete-menu .md2-option{position:relative;display:block;color:#212121;cursor:pointer;width:auto;padding:0 16px;height:48px;line-height:48px;transition:background 150ms linear}.md2-autocomplete-menu .md2-option.focus,.md2-autocomplete-menu .md2-option:hover{background:#ededed}.md2-autocomplete-menu .md2-option .md2-text{width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px}.md2-autocomplete-menu .highlight{color:#737373} /*# sourceMappingURL=autocomplete.css.map */ "], providers: [MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR], host: { @@ -8653,7 +8655,7 @@ Md2DataTableSortBy = __decorate$49([ Component({ selector: '[md2SortBy]', template: "  ", - styles: ["$primary: #106cc8 !default; /* * Data Table */ /* * Sort */ [md2SortBy] { line-height: 24px; color: rgba(black, 0.54); white-space: nowrap; cursor: pointer; user-select: none; svg { display: inline-block; vertical-align: middle; fill: currentColor; opacity: 0; } &:hover:not(.md2-sort-active) { svg { color: rgba(black, 0.26); opacity: 1; } } &.md2-sort-active { color: rgba(black, 0.87); svg { opacity: 1; } } } /* * Pagination */ md2-pagination { display: block; color: rgba(black, 0.54); user-select: none; &::before, &::after { display: table; content: ''; } &::after { clear: both; } .md2-pagination { display: inline-block; margin: 8px 0; padding: 0; li { position: relative; display: inline-block; width: 36px; vertical-align: top; text-align: center; line-height: 36px; border-radius: 100px; cursor: pointer; box-sizing: border-box; &:hover:not(.disabled):not(.active) { background: rgba(black, 0.12); } &.disabled { pointer-events: none; background: transparent; cursor: default; opacity: 0.48; } &.active { background: $primary; color: white; cursor: default; } svg { fill: currentColor; margin-bottom: -7px; } } } .md2-rows-select { display: inline-block; margin: 8px 0; padding: 0; float: right; color: rgba(black, 0.54); line-height: 36px; md2-select { display: inline-block; border: 0; outline: 0; } .md2-select-trigger { border-width: 0; min-width: 40px; } } } "], + styles: ["$primary: #106cc8 !default; /* * Data Table */ /* * Sort */ [md2SortBy] { line-height: 24px; color: rgba(black, 0.54); white-space: nowrap; cursor: pointer; user-select: none; svg { display: inline-block; vertical-align: middle; fill: currentColor; opacity: 0; } &:hover:not(.md2-sort-active) { svg { color: rgba(black, 0.26); opacity: 1; } } &.md2-sort-active { color: rgba(black, 0.87); svg { opacity: 1; } } } /* * Pagination */ md2-pagination { display: block; color: rgba(black, 0.54); user-select: none; &::before, &::after { display: table; content: ''; } &::after { clear: both; } .md2-pagination { display: inline-block; margin: 8px 0; padding: 0; li { position: relative; display: inline-block; width: 36px; vertical-align: top; text-align: center; line-height: 36px; border-radius: 100px; cursor: pointer; box-sizing: border-box; &:hover:not(.disabled):not(.active) { background: rgba(black, 0.12); } &.disabled { pointer-events: none; background: transparent; cursor: default; opacity: 0.48; } &.active { background: $primary; color: white; cursor: default; } svg { fill: currentColor; margin-bottom: -7px; } } } .md2-rows-select { display: inline-block; margin: 8px 0; padding: 0; float: right; color: rgba(black, 0.54); line-height: 36px; label { vertical-align: sub; margin-right: 10px; } md2-select { display: inline-block; border: 0; outline: 0; } .md2-select-trigger { border-width: 0; min-width: 40px; } } } "], host: { '[class.md2-sort-active]': '_isAsc || _isDesc', '(click)': '_sort()' @@ -8667,6 +8669,7 @@ let Md2Pagination = class Md2Pagination { this._dataTable = _dataTable; this._activePage = 1; this.rowsPerPageSet = []; + this.paginationLabel = 'Rows per page:'; this._dataLength = 0; this.onPageChangeSubscriber = (event) => { this._activePage = event.activePage; @@ -8695,11 +8698,15 @@ __decorate$49([ Input(), __metadata$28("design:type", Md2DataTable) ], Md2Pagination.prototype, "md2Table", void 0); +__decorate$49([ + Input(), + __metadata$28("design:type", String) +], Md2Pagination.prototype, "paginationLabel", void 0); Md2Pagination = __decorate$49([ Component({ selector: 'md2-pagination', - template: "
    _rowsPerPage\">
  • 4 && _activePage + 1 > _lastPage\" (click)=\"_setPage(_activePage - 4)\">{{_activePage-4}}
  • 3 && _activePage + 2 > _lastPage\" (click)=\"_setPage(_activePage - 3)\">{{_activePage-3}}
  • 2\" (click)=\"_setPage(_activePage - 2)\">{{_activePage-2}}
  • 1\" (click)=\"_setPage(_activePage - 1)\">{{_activePage-1}}
  • {{_activePage}}
  • {{_activePage+1}}
  • {{_activePage+2}}
  • {{_activePage+3}}
  • {{_activePage+4}}
  • = _lastPage\" (click)=\"_setPage(_activePage + 1)\">
0\">Rows per page:{{row}}
", - styles: ["[md2SortBy]{line-height:24px;color:rgba(0,0,0,.54);white-space:nowrap;cursor:pointer;user-select:none}[md2SortBy] svg{display:inline-block;vertical-align:middle;fill:currentColor;opacity:0}[md2SortBy]:hover:not(.md2-sort-active) svg{color:rgba(0,0,0,.26);opacity:1}[md2SortBy].md2-sort-active{color:rgba(0,0,0,.87)}[md2SortBy].md2-sort-active svg{opacity:1}md2-pagination{display:block;color:rgba(0,0,0,.54);user-select:none}md2-pagination::after,md2-pagination::before{display:table;content:''}md2-pagination::after{clear:both}md2-pagination .md2-pagination{display:inline-block;margin:8px 0;padding:0}md2-pagination .md2-pagination li{position:relative;display:inline-block;width:36px;vertical-align:top;text-align:center;line-height:36px;border-radius:100px;cursor:pointer;box-sizing:border-box}md2-pagination .md2-pagination li:hover:not(.disabled):not(.active){background:rgba(0,0,0,.12)}md2-pagination .md2-pagination li.disabled{pointer-events:none;background:0 0;cursor:default;opacity:.48}md2-pagination .md2-pagination li.active{background:#106cc8;color:#fff;cursor:default}md2-pagination .md2-pagination li svg{fill:currentColor;margin-bottom:-7px}md2-pagination .md2-rows-select{display:inline-block;margin:8px 0;padding:0;float:right;color:rgba(0,0,0,.54);line-height:36px}md2-pagination .md2-rows-select md2-select{display:inline-block;border:0;outline:0}md2-pagination .md2-rows-select .md2-select-trigger{border-width:0;min-width:40px} /*# sourceMappingURL=data-table.css.map */ "], + template: "
    _rowsPerPage\">
  • 4 && _activePage + 1 > _lastPage\" (click)=\"_setPage(_activePage - 4)\">{{_activePage-4}}
  • 3 && _activePage + 2 > _lastPage\" (click)=\"_setPage(_activePage - 3)\">{{_activePage-3}}
  • 2\" (click)=\"_setPage(_activePage - 2)\">{{_activePage-2}}
  • 1\" (click)=\"_setPage(_activePage - 1)\">{{_activePage-1}}
  • {{_activePage}}
  • {{_activePage+1}}
  • {{_activePage+2}}
  • {{_activePage+3}}
  • {{_activePage+4}}
  • = _lastPage\" (click)=\"_setPage(_activePage + 1)\">
0\">{{row}}
", + styles: ["[md2SortBy]{line-height:24px;color:rgba(0,0,0,.54);white-space:nowrap;cursor:pointer;user-select:none}[md2SortBy] svg{display:inline-block;vertical-align:middle;fill:currentColor;opacity:0}[md2SortBy]:hover:not(.md2-sort-active) svg{color:rgba(0,0,0,.26);opacity:1}[md2SortBy].md2-sort-active{color:rgba(0,0,0,.87)}[md2SortBy].md2-sort-active svg{opacity:1}md2-pagination{display:block;color:rgba(0,0,0,.54);user-select:none}md2-pagination::after,md2-pagination::before{display:table;content:''}md2-pagination::after{clear:both}md2-pagination .md2-pagination{display:inline-block;margin:8px 0;padding:0}md2-pagination .md2-pagination li{position:relative;display:inline-block;width:36px;vertical-align:top;text-align:center;line-height:36px;border-radius:100px;cursor:pointer;box-sizing:border-box}md2-pagination .md2-pagination li:hover:not(.disabled):not(.active){background:rgba(0,0,0,.12)}md2-pagination .md2-pagination li.disabled{pointer-events:none;background:0 0;cursor:default;opacity:.48}md2-pagination .md2-pagination li.active{background:#106cc8;color:#fff;cursor:default}md2-pagination .md2-pagination li svg{fill:currentColor;margin-bottom:-7px}md2-pagination .md2-rows-select{display:inline-block;margin:8px 0;padding:0;float:right;color:rgba(0,0,0,.54);line-height:36px}md2-pagination .md2-rows-select label{vertical-align:sub;margin-right:10px}md2-pagination .md2-rows-select md2-select{display:inline-block;border:0;outline:0}md2-pagination .md2-rows-select .md2-select-trigger{border-width:0;min-width:40px} /*# sourceMappingURL=data-table.css.map */ "], exportAs: 'md2Pagination', encapsulation: ViewEncapsulation.None }), @@ -10575,7 +10582,7 @@ __decorate$61([ Md2CalendarBody = __decorate$61([ Component({selector: '[md2-calendar-body]', template: "{{label}}{{_firstRowOffset >= labelMinRequiredCells ? label : ''}}
{{item.displayValue}}
", - styles: [".md2-calendar-body{font-size:13px;min-width:224px}.md2-calendar-body-label{padding:7.14286% 0 7.14286% 7.14286%;height:0;line-height:0;color:rgba(0,0,0,.54);transform:translateX(-6px);text-align:left}.md2-calendar-body-cell{position:relative;width:14.28571%;height:0;line-height:0;padding:7.14286% 0;text-align:center;outline:0;cursor:pointer}.md2-calendar-body-disabled{cursor:default}.md2-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;color:rgba(0,0,0,.87);border-width:1px;border-style:solid;border-color:transparent;border-radius:50%}.md2-calendar-body-disabled>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){color:rgba(0,0,0,.38)}.md2-calendar:focus .md2-calendar-body-active>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected),:not(.md2-calendar-body-disabled):hover>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){background-color:rgba(0,0,0,.12)}.md2-calendar-body-selected{background-color:#106cc8;color:#fff}.md2-calendar-body-disabled>.md2-calendar-body-selected{background-color:rgba(16,108,200,.4)}.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:#106cc8}.md2-calendar-body-today.md2-calendar-body-selected{box-shadow:inset 0 0 0 1px md2-color(#106cc8,default-contrast)}.md2-calendar-body-disabled>.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:rgba(0,0,0,.18)}[dir=rtl] .md2-calendar-body-label{padding:0 7.14286% 0 0;transform:translateX(6px);text-align:right} /*# sourceMappingURL=calendar-body.css.map */ "], + styles: [".md2-calendar-body{font-size:13px;min-width:224px}.md2-calendar-body-label{padding:7.14286% 0 7.14286% 7.14286%;height:0;line-height:0;color:rgba(0,0,0,.54);transform:translateX(-6px);text-align:left}.md2-calendar-body-cell{position:relative;width:14.28571%;height:0;line-height:0;padding:7.14286% 0;text-align:center;outline:0;cursor:pointer}.md2-calendar-body-disabled{cursor:default;pointer-events:none}.md2-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;color:rgba(0,0,0,.87);border-width:1px;border-style:solid;border-color:transparent;border-radius:50%}.md2-calendar-body-disabled>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){color:rgba(0,0,0,.38)}.md2-calendar:focus .md2-calendar-body-active>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected),:not(.md2-calendar-body-disabled):hover>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){background-color:rgba(0,0,0,.12)}.md2-calendar-body-selected{background-color:#106cc8;color:#fff}.md2-calendar-body-disabled>.md2-calendar-body-selected{background-color:rgba(16,108,200,.4)}.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:#106cc8}.md2-calendar-body-today.md2-calendar-body-selected{box-shadow:inset 0 0 0 1px md2-color(#106cc8,default-contrast)}.md2-calendar-body-disabled>.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:rgba(0,0,0,.18)}[dir=rtl] .md2-calendar-body-label{padding:0 7.14286% 0 0;transform:translateX(6px);text-align:right} /*# sourceMappingURL=calendar-body.css.map */ "], host: { 'class': 'md2-calendar-body', }, diff --git a/bundles/md2.umd.js b/bundles/md2.umd.js index de01d256a..4a5e4b1cd 100644 --- a/bundles/md2.umd.js +++ b/bundles/md2.umd.js @@ -1,5 +1,5 @@ /** - * @license Md2 v0.0.26 + * @license Md2 v0.0.28 * Copyright (c) 2017 Promact, Inc. http://code.promactinfo.com/md2/ * License: MIT */ @@ -5607,12 +5607,14 @@ exports.Md2Autocomplete = (function () { * input event listner * @param event */ + Md2Autocomplete.prototype._handleKeyup = function (event) { + this.textChange.emit(this._inputValue); + }; Md2Autocomplete.prototype._handleKeydown = function (event) { var _this = this; if (this.disabled) { return; } - this.textChange.emit(this._inputValue); switch (event.keyCode) { case TAB: this._handleMouseLeave(); @@ -5828,7 +5830,7 @@ __decorate$42([ ], exports.Md2Autocomplete.prototype, "value", null); exports.Md2Autocomplete = __decorate$42([ _angular_core.Component({selector: 'md2-autocomplete', - template: "
{{ placeholder }}
", + template: "
{{ placeholder }}
", styles: ["md2-autocomplete{position:relative;display:block;margin:18px 0;outline:0;user-select:none;backface-visibility:hidden}md2-autocomplete.md2-autocomplete-disabled{pointer-events:none;cursor:default}.md2-autocomplete-trigger{position:relative;display:block;width:100%;padding:2px 2px 1px;border-bottom:1px solid rgba(0,0,0,.12);box-sizing:border-box;min-width:64px;min-height:26px;cursor:pointer}.md2-autocomplete-trigger.is-focused{padding-bottom:0;border-bottom:2px solid #106cc8}md2-autocomplete.ng-invalid.ng-touched:not(.md2-autocomplete-disabled) .md2-autocomplete-trigger{color:#f44336;border-bottom-color:#f44336}md2-autocomplete.md2-autocomplete-disabled .md2-autocomplete-trigger{color:rgba(0,0,0,.38);border-color:transparent;background-image:linear-gradient(to right,rgba(0,0,0,.38) 0,rgba(0,0,0,.38) 33%,transparent 0);background-position:bottom -1px left 0;background-size:4px 1px;background-repeat:repeat-x;cursor:default}md2-autocomplete.md2-autocomplete-disabled .md2-autocomplete-trigger.is-focused{padding-bottom:1px;border-bottom:1px solid transparent}.md2-autocomplete-input{width:100%;height:26px;font-size:15px;outline:0;background:0 0;border:0;box-sizing:border-box}md2-autocomplete.md2-autocomplete-disabled .md2-autocomplete-input{color:rgba(0,0,0,.38)}.md2-autocomplete-placeholder{position:absolute;right:26px;bottom:100%;left:0;max-width:100%;padding-left:3px;padding-right:0;line-height:1.4;color:rgba(0,0,0,.38);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;z-index:1;transform:translate3d(0,26px,0) scale(1);transition:transform .4s cubic-bezier(.25,.8,.25,1);transform-origin:left top}[aria-required=true] .md2-autocomplete-placeholder::after{content:'*'}.md2-autocomplete-trigger.is-focused .md2-autocomplete-placeholder{color:#106cc8}.md2-autocomplete-trigger.is-focused .md2-autocomplete-placeholder,md2-autocomplete .md2-autocomplete-placeholder.has-value{transform:translate3d(0,6px,0) scale(.75)}.md2-autocomplete-trigger svg{position:absolute;right:0;top:0;display:block;height:100%;background:#fff;fill:currentColor;color:rgba(0,0,0,.54)}.md2-autocomplete-menu{position:absolute;left:0;top:100%;display:block;z-index:10;width:100%;margin:0;padding:8px 0;box-shadow:0 1px 3px 0 rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 2px 1px -1px rgba(0,0,0,.12);max-height:256px;min-height:48px;overflow-y:auto;background:#fff}.md2-autocomplete-menu .md2-option{position:relative;display:block;color:#212121;cursor:pointer;width:auto;padding:0 16px;height:48px;line-height:48px;transition:background 150ms linear}.md2-autocomplete-menu .md2-option.focus,.md2-autocomplete-menu .md2-option:hover{background:#ededed}.md2-autocomplete-menu .md2-option .md2-text{width:auto;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:16px}.md2-autocomplete-menu .highlight{color:#737373} /*# sourceMappingURL=autocomplete.css.map */ "], providers: [MD2_AUTOCOMPLETE_CONTROL_VALUE_ACCESSOR], host: { @@ -9242,7 +9244,7 @@ exports.Md2DataTableSortBy = __decorate$49([ _angular_core.Component({ selector: '[md2SortBy]', template: "  ", - styles: ["$primary: #106cc8 !default; /* * Data Table */ /* * Sort */ [md2SortBy] { line-height: 24px; color: rgba(black, 0.54); white-space: nowrap; cursor: pointer; user-select: none; svg { display: inline-block; vertical-align: middle; fill: currentColor; opacity: 0; } &:hover:not(.md2-sort-active) { svg { color: rgba(black, 0.26); opacity: 1; } } &.md2-sort-active { color: rgba(black, 0.87); svg { opacity: 1; } } } /* * Pagination */ md2-pagination { display: block; color: rgba(black, 0.54); user-select: none; &::before, &::after { display: table; content: ''; } &::after { clear: both; } .md2-pagination { display: inline-block; margin: 8px 0; padding: 0; li { position: relative; display: inline-block; width: 36px; vertical-align: top; text-align: center; line-height: 36px; border-radius: 100px; cursor: pointer; box-sizing: border-box; &:hover:not(.disabled):not(.active) { background: rgba(black, 0.12); } &.disabled { pointer-events: none; background: transparent; cursor: default; opacity: 0.48; } &.active { background: $primary; color: white; cursor: default; } svg { fill: currentColor; margin-bottom: -7px; } } } .md2-rows-select { display: inline-block; margin: 8px 0; padding: 0; float: right; color: rgba(black, 0.54); line-height: 36px; md2-select { display: inline-block; border: 0; outline: 0; } .md2-select-trigger { border-width: 0; min-width: 40px; } } } "], + styles: ["$primary: #106cc8 !default; /* * Data Table */ /* * Sort */ [md2SortBy] { line-height: 24px; color: rgba(black, 0.54); white-space: nowrap; cursor: pointer; user-select: none; svg { display: inline-block; vertical-align: middle; fill: currentColor; opacity: 0; } &:hover:not(.md2-sort-active) { svg { color: rgba(black, 0.26); opacity: 1; } } &.md2-sort-active { color: rgba(black, 0.87); svg { opacity: 1; } } } /* * Pagination */ md2-pagination { display: block; color: rgba(black, 0.54); user-select: none; &::before, &::after { display: table; content: ''; } &::after { clear: both; } .md2-pagination { display: inline-block; margin: 8px 0; padding: 0; li { position: relative; display: inline-block; width: 36px; vertical-align: top; text-align: center; line-height: 36px; border-radius: 100px; cursor: pointer; box-sizing: border-box; &:hover:not(.disabled):not(.active) { background: rgba(black, 0.12); } &.disabled { pointer-events: none; background: transparent; cursor: default; opacity: 0.48; } &.active { background: $primary; color: white; cursor: default; } svg { fill: currentColor; margin-bottom: -7px; } } } .md2-rows-select { display: inline-block; margin: 8px 0; padding: 0; float: right; color: rgba(black, 0.54); line-height: 36px; label { vertical-align: sub; margin-right: 10px; } md2-select { display: inline-block; border: 0; outline: 0; } .md2-select-trigger { border-width: 0; min-width: 40px; } } } "], host: { '[class.md2-sort-active]': '_isAsc || _isDesc', '(click)': '_sort()' @@ -9257,6 +9259,7 @@ exports.Md2Pagination = (function () { this._dataTable = _dataTable; this._activePage = 1; this.rowsPerPageSet = []; + this.paginationLabel = 'Rows per page:'; this._dataLength = 0; this.onPageChangeSubscriber = function (event) { _this._activePage = event.activePage; @@ -9286,11 +9289,15 @@ __decorate$49([ _angular_core.Input(), __metadata$28("design:type", exports.Md2DataTable) ], exports.Md2Pagination.prototype, "md2Table", void 0); +__decorate$49([ + _angular_core.Input(), + __metadata$28("design:type", String) +], exports.Md2Pagination.prototype, "paginationLabel", void 0); exports.Md2Pagination = __decorate$49([ _angular_core.Component({ selector: 'md2-pagination', - template: "
    _rowsPerPage\">
  • 4 && _activePage + 1 > _lastPage\" (click)=\"_setPage(_activePage - 4)\">{{_activePage-4}}
  • 3 && _activePage + 2 > _lastPage\" (click)=\"_setPage(_activePage - 3)\">{{_activePage-3}}
  • 2\" (click)=\"_setPage(_activePage - 2)\">{{_activePage-2}}
  • 1\" (click)=\"_setPage(_activePage - 1)\">{{_activePage-1}}
  • {{_activePage}}
  • {{_activePage+1}}
  • {{_activePage+2}}
  • {{_activePage+3}}
  • {{_activePage+4}}
  • = _lastPage\" (click)=\"_setPage(_activePage + 1)\">
0\">Rows per page:{{row}}
", - styles: ["[md2SortBy]{line-height:24px;color:rgba(0,0,0,.54);white-space:nowrap;cursor:pointer;user-select:none}[md2SortBy] svg{display:inline-block;vertical-align:middle;fill:currentColor;opacity:0}[md2SortBy]:hover:not(.md2-sort-active) svg{color:rgba(0,0,0,.26);opacity:1}[md2SortBy].md2-sort-active{color:rgba(0,0,0,.87)}[md2SortBy].md2-sort-active svg{opacity:1}md2-pagination{display:block;color:rgba(0,0,0,.54);user-select:none}md2-pagination::after,md2-pagination::before{display:table;content:''}md2-pagination::after{clear:both}md2-pagination .md2-pagination{display:inline-block;margin:8px 0;padding:0}md2-pagination .md2-pagination li{position:relative;display:inline-block;width:36px;vertical-align:top;text-align:center;line-height:36px;border-radius:100px;cursor:pointer;box-sizing:border-box}md2-pagination .md2-pagination li:hover:not(.disabled):not(.active){background:rgba(0,0,0,.12)}md2-pagination .md2-pagination li.disabled{pointer-events:none;background:0 0;cursor:default;opacity:.48}md2-pagination .md2-pagination li.active{background:#106cc8;color:#fff;cursor:default}md2-pagination .md2-pagination li svg{fill:currentColor;margin-bottom:-7px}md2-pagination .md2-rows-select{display:inline-block;margin:8px 0;padding:0;float:right;color:rgba(0,0,0,.54);line-height:36px}md2-pagination .md2-rows-select md2-select{display:inline-block;border:0;outline:0}md2-pagination .md2-rows-select .md2-select-trigger{border-width:0;min-width:40px} /*# sourceMappingURL=data-table.css.map */ "], + template: "
    _rowsPerPage\">
  • 4 && _activePage + 1 > _lastPage\" (click)=\"_setPage(_activePage - 4)\">{{_activePage-4}}
  • 3 && _activePage + 2 > _lastPage\" (click)=\"_setPage(_activePage - 3)\">{{_activePage-3}}
  • 2\" (click)=\"_setPage(_activePage - 2)\">{{_activePage-2}}
  • 1\" (click)=\"_setPage(_activePage - 1)\">{{_activePage-1}}
  • {{_activePage}}
  • {{_activePage+1}}
  • {{_activePage+2}}
  • {{_activePage+3}}
  • {{_activePage+4}}
  • = _lastPage\" (click)=\"_setPage(_activePage + 1)\">
0\">{{row}}
", + styles: ["[md2SortBy]{line-height:24px;color:rgba(0,0,0,.54);white-space:nowrap;cursor:pointer;user-select:none}[md2SortBy] svg{display:inline-block;vertical-align:middle;fill:currentColor;opacity:0}[md2SortBy]:hover:not(.md2-sort-active) svg{color:rgba(0,0,0,.26);opacity:1}[md2SortBy].md2-sort-active{color:rgba(0,0,0,.87)}[md2SortBy].md2-sort-active svg{opacity:1}md2-pagination{display:block;color:rgba(0,0,0,.54);user-select:none}md2-pagination::after,md2-pagination::before{display:table;content:''}md2-pagination::after{clear:both}md2-pagination .md2-pagination{display:inline-block;margin:8px 0;padding:0}md2-pagination .md2-pagination li{position:relative;display:inline-block;width:36px;vertical-align:top;text-align:center;line-height:36px;border-radius:100px;cursor:pointer;box-sizing:border-box}md2-pagination .md2-pagination li:hover:not(.disabled):not(.active){background:rgba(0,0,0,.12)}md2-pagination .md2-pagination li.disabled{pointer-events:none;background:0 0;cursor:default;opacity:.48}md2-pagination .md2-pagination li.active{background:#106cc8;color:#fff;cursor:default}md2-pagination .md2-pagination li svg{fill:currentColor;margin-bottom:-7px}md2-pagination .md2-rows-select{display:inline-block;margin:8px 0;padding:0;float:right;color:rgba(0,0,0,.54);line-height:36px}md2-pagination .md2-rows-select label{vertical-align:sub;margin-right:10px}md2-pagination .md2-rows-select md2-select{display:inline-block;border:0;outline:0}md2-pagination .md2-rows-select .md2-select-trigger{border-width:0;min-width:40px} /*# sourceMappingURL=data-table.css.map */ "], exportAs: 'md2Pagination', encapsulation: _angular_core.ViewEncapsulation.None }), @@ -11263,7 +11270,7 @@ __decorate$61([ exports.Md2CalendarBody = __decorate$61([ _angular_core.Component({selector: '[md2-calendar-body]', template: "{{label}}{{_firstRowOffset >= labelMinRequiredCells ? label : ''}}
{{item.displayValue}}
", - styles: [".md2-calendar-body{font-size:13px;min-width:224px}.md2-calendar-body-label{padding:7.14286% 0 7.14286% 7.14286%;height:0;line-height:0;color:rgba(0,0,0,.54);transform:translateX(-6px);text-align:left}.md2-calendar-body-cell{position:relative;width:14.28571%;height:0;line-height:0;padding:7.14286% 0;text-align:center;outline:0;cursor:pointer}.md2-calendar-body-disabled{cursor:default}.md2-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;color:rgba(0,0,0,.87);border-width:1px;border-style:solid;border-color:transparent;border-radius:50%}.md2-calendar-body-disabled>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){color:rgba(0,0,0,.38)}.md2-calendar:focus .md2-calendar-body-active>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected),:not(.md2-calendar-body-disabled):hover>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){background-color:rgba(0,0,0,.12)}.md2-calendar-body-selected{background-color:#106cc8;color:#fff}.md2-calendar-body-disabled>.md2-calendar-body-selected{background-color:rgba(16,108,200,.4)}.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:#106cc8}.md2-calendar-body-today.md2-calendar-body-selected{box-shadow:inset 0 0 0 1px md2-color(#106cc8,default-contrast)}.md2-calendar-body-disabled>.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:rgba(0,0,0,.18)}[dir=rtl] .md2-calendar-body-label{padding:0 7.14286% 0 0;transform:translateX(6px);text-align:right} /*# sourceMappingURL=calendar-body.css.map */ "], + styles: [".md2-calendar-body{font-size:13px;min-width:224px}.md2-calendar-body-label{padding:7.14286% 0 7.14286% 7.14286%;height:0;line-height:0;color:rgba(0,0,0,.54);transform:translateX(-6px);text-align:left}.md2-calendar-body-cell{position:relative;width:14.28571%;height:0;line-height:0;padding:7.14286% 0;text-align:center;outline:0;cursor:pointer}.md2-calendar-body-disabled{cursor:default;pointer-events:none}.md2-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;color:rgba(0,0,0,.87);border-width:1px;border-style:solid;border-color:transparent;border-radius:50%}.md2-calendar-body-disabled>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){color:rgba(0,0,0,.38)}.md2-calendar:focus .md2-calendar-body-active>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected),:not(.md2-calendar-body-disabled):hover>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){background-color:rgba(0,0,0,.12)}.md2-calendar-body-selected{background-color:#106cc8;color:#fff}.md2-calendar-body-disabled>.md2-calendar-body-selected{background-color:rgba(16,108,200,.4)}.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:#106cc8}.md2-calendar-body-today.md2-calendar-body-selected{box-shadow:inset 0 0 0 1px md2-color(#106cc8,default-contrast)}.md2-calendar-body-disabled>.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:rgba(0,0,0,.18)}[dir=rtl] .md2-calendar-body-label{padding:0 7.14286% 0 0;transform:translateX(6px);text-align:right} /*# sourceMappingURL=calendar-body.css.map */ "], host: { 'class': 'md2-calendar-body', }, diff --git a/data-table/data-table.css b/data-table/data-table.css index 44e1bd1cd..065b193f8 100644 --- a/data-table/data-table.css +++ b/data-table/data-table.css @@ -1,2 +1,2 @@ -[md2SortBy]{line-height:24px;color:rgba(0,0,0,.54);white-space:nowrap;cursor:pointer;user-select:none}[md2SortBy] svg{display:inline-block;vertical-align:middle;fill:currentColor;opacity:0}[md2SortBy]:hover:not(.md2-sort-active) svg{color:rgba(0,0,0,.26);opacity:1}[md2SortBy].md2-sort-active{color:rgba(0,0,0,.87)}[md2SortBy].md2-sort-active svg{opacity:1}md2-pagination{display:block;color:rgba(0,0,0,.54);user-select:none}md2-pagination::after,md2-pagination::before{display:table;content:''}md2-pagination::after{clear:both}md2-pagination .md2-pagination{display:inline-block;margin:8px 0;padding:0}md2-pagination .md2-pagination li{position:relative;display:inline-block;width:36px;vertical-align:top;text-align:center;line-height:36px;border-radius:100px;cursor:pointer;box-sizing:border-box}md2-pagination .md2-pagination li:hover:not(.disabled):not(.active){background:rgba(0,0,0,.12)}md2-pagination .md2-pagination li.disabled{pointer-events:none;background:0 0;cursor:default;opacity:.48}md2-pagination .md2-pagination li.active{background:#106cc8;color:#fff;cursor:default}md2-pagination .md2-pagination li svg{fill:currentColor;margin-bottom:-7px}md2-pagination .md2-rows-select{display:inline-block;margin:8px 0;padding:0;float:right;color:rgba(0,0,0,.54);line-height:36px}md2-pagination .md2-rows-select md2-select{display:inline-block;border:0;outline:0}md2-pagination .md2-rows-select .md2-select-trigger{border-width:0;min-width:40px} +[md2SortBy]{line-height:24px;color:rgba(0,0,0,.54);white-space:nowrap;cursor:pointer;user-select:none}[md2SortBy] svg{display:inline-block;vertical-align:middle;fill:currentColor;opacity:0}[md2SortBy]:hover:not(.md2-sort-active) svg{color:rgba(0,0,0,.26);opacity:1}[md2SortBy].md2-sort-active{color:rgba(0,0,0,.87)}[md2SortBy].md2-sort-active svg{opacity:1}md2-pagination{display:block;color:rgba(0,0,0,.54);user-select:none}md2-pagination::after,md2-pagination::before{display:table;content:''}md2-pagination::after{clear:both}md2-pagination .md2-pagination{display:inline-block;margin:8px 0;padding:0}md2-pagination .md2-pagination li{position:relative;display:inline-block;width:36px;vertical-align:top;text-align:center;line-height:36px;border-radius:100px;cursor:pointer;box-sizing:border-box}md2-pagination .md2-pagination li:hover:not(.disabled):not(.active){background:rgba(0,0,0,.12)}md2-pagination .md2-pagination li.disabled{pointer-events:none;background:0 0;cursor:default;opacity:.48}md2-pagination .md2-pagination li.active{background:#106cc8;color:#fff;cursor:default}md2-pagination .md2-pagination li svg{fill:currentColor;margin-bottom:-7px}md2-pagination .md2-rows-select{display:inline-block;margin:8px 0;padding:0;float:right;color:rgba(0,0,0,.54);line-height:36px}md2-pagination .md2-rows-select label{vertical-align:sub;margin-right:10px}md2-pagination .md2-rows-select md2-select{display:inline-block;border:0;outline:0}md2-pagination .md2-rows-select .md2-select-trigger{border-width:0;min-width:40px} /*# sourceMappingURL=data-table.css.map */ diff --git a/data-table/data-table.css.map b/data-table/data-table.css.map index 326c4e1c1..a402e545e 100644 --- a/data-table/data-table.css.map +++ b/data-table/data-table.css.map @@ -1 +1 @@ -{"version":3,"sources":["data-table/data-table.css","data-table/data-table.scss"],"names":[],"mappings":"AAMA,YCKE,YAAa,KACb,MAAY,gBACZ,YAAa,OACb,OAAQ,QACR,YAAa,KDHb,gBCME,QAAS,aACT,eAAgB,OAChB,KAAM,aACN,QAAS,EDJX,4CCSI,MAAY,gBACZ,QAAS,EDPb,4BCYE,MAAY,gBDVZ,gCCaE,QAAS,EASf,eACE,QAAS,MACT,MAAY,gBACZ,YAAa,KAHf,sBAAA,uBAOI,QAAS,MACT,QAAS,GARb,sBAYI,MAAO,KAZX,+BAgBI,QAAS,aACT,OAAQ,IAAA,EACR,QAAS,EAlBb,kCAqBM,SAAU,SACV,QAAS,aACT,MAAO,KACP,eAAgB,IAChB,WAAY,OACZ,YAAa,KACb,cAAe,MACf,OAAQ,QACR,WAAY,WA7BlB,oEAgCQ,WAAiB,gBAhCzB,2CAoCQ,eAAgB,KAChB,WAAY,IACZ,OAAQ,QACR,QAAS,IAvCjB,yCA2CQ,WAvFE,QAwFF,MAAO,KACP,OAAQ,QA7ChB,sCAiDQ,KAAM,aACN,cAAe,KAlDvB,gCAwDI,QAAS,aACT,OAAQ,IAAA,EACR,QAAS,EACT,MAAO,MACP,MAAY,gBACZ,YAAa,KA7DjB,2CAgEM,QAAS,aACT,OAAQ,EACR,QAAS,EAlEf,oDAsEM,aAAc,EACd,UAAW","file":"data-table.css","sourcesContent":[null,"$primary: #106cc8 !default;\n\n/*\n * Data Table\n */\n\n\n/*\n * Sort\n */\n[md2SortBy] {\n line-height: 24px;\n color: rgba(black, 0.54);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n\n svg {\n display: inline-block;\n vertical-align: middle;\n fill: currentColor;\n opacity: 0;\n }\n\n &:hover:not(.md2-sort-active) {\n svg {\n color: rgba(black, 0.26);\n opacity: 1;\n }\n }\n\n &.md2-sort-active {\n color: rgba(black, 0.87);\n\n svg {\n opacity: 1;\n }\n }\n}\n\n\n/*\n * Pagination\n */\nmd2-pagination {\n display: block;\n color: rgba(black, 0.54);\n user-select: none;\n\n &::before,\n &::after {\n display: table;\n content: '';\n }\n\n &::after {\n clear: both;\n }\n\n .md2-pagination {\n display: inline-block;\n margin: 8px 0;\n padding: 0;\n\n li {\n position: relative;\n display: inline-block;\n width: 36px;\n vertical-align: top;\n text-align: center;\n line-height: 36px;\n border-radius: 100px;\n cursor: pointer;\n box-sizing: border-box;\n\n &:hover:not(.disabled):not(.active) {\n background: rgba(black, 0.12);\n }\n\n &.disabled {\n pointer-events: none;\n background: transparent;\n cursor: default;\n opacity: 0.48;\n }\n\n &.active {\n background: $primary;\n color: white;\n cursor: default;\n }\n\n svg {\n fill: currentColor;\n margin-bottom: -7px;\n }\n }\n }\n\n .md2-rows-select {\n display: inline-block;\n margin: 8px 0;\n padding: 0;\n float: right;\n color: rgba(black, 0.54);\n line-height: 36px;\n\n md2-select {\n display: inline-block;\n border: 0;\n outline: 0;\n }\n\n .md2-select-trigger {\n border-width: 0;\n min-width: 40px;\n }\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["data-table/data-table.css","data-table/data-table.scss"],"names":[],"mappings":"AAMA,YCKE,YAAa,KACb,MAAY,gBACZ,YAAa,OACb,OAAQ,QACR,YAAa,KDHb,gBCME,QAAS,aACT,eAAgB,OAChB,KAAM,aACN,QAAS,EDJX,4CCSI,MAAY,gBACZ,QAAS,EDPb,4BCYE,MAAY,gBDVZ,gCCaE,QAAS,EASf,eACE,QAAS,MACT,MAAY,gBACZ,YAAa,KAHf,sBAAA,uBAOI,QAAS,MACT,QAAS,GARb,sBAYI,MAAO,KAZX,+BAgBI,QAAS,aACT,OAAQ,IAAA,EACR,QAAS,EAlBb,kCAqBM,SAAU,SACV,QAAS,aACT,MAAO,KACP,eAAgB,IAChB,WAAY,OACZ,YAAa,KACb,cAAe,MACf,OAAQ,QACR,WAAY,WA7BlB,oEAgCQ,WAAiB,gBAhCzB,2CAoCQ,eAAgB,KAChB,WAAY,IACZ,OAAQ,QACR,QAAS,IAvCjB,yCA2CQ,WAvFE,QAwFF,MAAO,KACP,OAAQ,QA7ChB,sCAiDQ,KAAM,aACN,cAAe,KAlDvB,gCAwDI,QAAS,aACT,OAAQ,IAAA,EACR,QAAS,EACT,MAAO,MACP,MAAY,gBACZ,YAAa,KA7DjB,sCAgEM,eAAgB,IAChB,aAAc,KAjEpB,2CAqEM,QAAS,aACT,OAAQ,EACR,QAAS,EAvEf,oDA2EM,aAAc,EACd,UAAW","file":"data-table.css","sourcesContent":[null,"$primary: #106cc8 !default;\n\n/*\n * Data Table\n */\n\n\n/*\n * Sort\n */\n[md2SortBy] {\n line-height: 24px;\n color: rgba(black, 0.54);\n white-space: nowrap;\n cursor: pointer;\n user-select: none;\n\n svg {\n display: inline-block;\n vertical-align: middle;\n fill: currentColor;\n opacity: 0;\n }\n\n &:hover:not(.md2-sort-active) {\n svg {\n color: rgba(black, 0.26);\n opacity: 1;\n }\n }\n\n &.md2-sort-active {\n color: rgba(black, 0.87);\n\n svg {\n opacity: 1;\n }\n }\n}\n\n\n/*\n * Pagination\n */\nmd2-pagination {\n display: block;\n color: rgba(black, 0.54);\n user-select: none;\n\n &::before,\n &::after {\n display: table;\n content: '';\n }\n\n &::after {\n clear: both;\n }\n\n .md2-pagination {\n display: inline-block;\n margin: 8px 0;\n padding: 0;\n\n li {\n position: relative;\n display: inline-block;\n width: 36px;\n vertical-align: top;\n text-align: center;\n line-height: 36px;\n border-radius: 100px;\n cursor: pointer;\n box-sizing: border-box;\n\n &:hover:not(.disabled):not(.active) {\n background: rgba(black, 0.12);\n }\n\n &.disabled {\n pointer-events: none;\n background: transparent;\n cursor: default;\n opacity: 0.48;\n }\n\n &.active {\n background: $primary;\n color: white;\n cursor: default;\n }\n\n svg {\n fill: currentColor;\n margin-bottom: -7px;\n }\n }\n }\n\n .md2-rows-select {\n display: inline-block;\n margin: 8px 0;\n padding: 0;\n float: right;\n color: rgba(black, 0.54);\n line-height: 36px;\n\n label {\n vertical-align: sub;\n margin-right: 10px;\n }\n\n md2-select {\n display: inline-block;\n border: 0;\n outline: 0;\n }\n\n .md2-select-trigger {\n border-width: 0;\n min-width: 40px;\n }\n }\n}\n"]} \ No newline at end of file diff --git a/data-table/data-table.d.ts b/data-table/data-table.d.ts index 300695da0..476cdd42b 100644 --- a/data-table/data-table.d.ts +++ b/data-table/data-table.d.ts @@ -61,6 +61,7 @@ export declare class Md2Pagination { private _activePage; rowsPerPageSet: any; md2Table: Md2DataTable; + paginationLabel: string; _rowsPerPage: number; _dataLength: number; _lastPage: number; diff --git a/data-table/data-table.js b/data-table/data-table.js index e30443617..4c162d6ff 100644 --- a/data-table/data-table.js +++ b/data-table/data-table.js @@ -281,7 +281,7 @@ Md2DataTableSortBy = __decorate([ Component({ selector: '[md2SortBy]', template: "  ", - styles: ["$primary: #106cc8 !default; /* * Data Table */ /* * Sort */ [md2SortBy] { line-height: 24px; color: rgba(black, 0.54); white-space: nowrap; cursor: pointer; user-select: none; svg { display: inline-block; vertical-align: middle; fill: currentColor; opacity: 0; } &:hover:not(.md2-sort-active) { svg { color: rgba(black, 0.26); opacity: 1; } } &.md2-sort-active { color: rgba(black, 0.87); svg { opacity: 1; } } } /* * Pagination */ md2-pagination { display: block; color: rgba(black, 0.54); user-select: none; &::before, &::after { display: table; content: ''; } &::after { clear: both; } .md2-pagination { display: inline-block; margin: 8px 0; padding: 0; li { position: relative; display: inline-block; width: 36px; vertical-align: top; text-align: center; line-height: 36px; border-radius: 100px; cursor: pointer; box-sizing: border-box; &:hover:not(.disabled):not(.active) { background: rgba(black, 0.12); } &.disabled { pointer-events: none; background: transparent; cursor: default; opacity: 0.48; } &.active { background: $primary; color: white; cursor: default; } svg { fill: currentColor; margin-bottom: -7px; } } } .md2-rows-select { display: inline-block; margin: 8px 0; padding: 0; float: right; color: rgba(black, 0.54); line-height: 36px; md2-select { display: inline-block; border: 0; outline: 0; } .md2-select-trigger { border-width: 0; min-width: 40px; } } } "], + styles: ["$primary: #106cc8 !default; /* * Data Table */ /* * Sort */ [md2SortBy] { line-height: 24px; color: rgba(black, 0.54); white-space: nowrap; cursor: pointer; user-select: none; svg { display: inline-block; vertical-align: middle; fill: currentColor; opacity: 0; } &:hover:not(.md2-sort-active) { svg { color: rgba(black, 0.26); opacity: 1; } } &.md2-sort-active { color: rgba(black, 0.87); svg { opacity: 1; } } } /* * Pagination */ md2-pagination { display: block; color: rgba(black, 0.54); user-select: none; &::before, &::after { display: table; content: ''; } &::after { clear: both; } .md2-pagination { display: inline-block; margin: 8px 0; padding: 0; li { position: relative; display: inline-block; width: 36px; vertical-align: top; text-align: center; line-height: 36px; border-radius: 100px; cursor: pointer; box-sizing: border-box; &:hover:not(.disabled):not(.active) { background: rgba(black, 0.12); } &.disabled { pointer-events: none; background: transparent; cursor: default; opacity: 0.48; } &.active { background: $primary; color: white; cursor: default; } svg { fill: currentColor; margin-bottom: -7px; } } } .md2-rows-select { display: inline-block; margin: 8px 0; padding: 0; float: right; color: rgba(black, 0.54); line-height: 36px; label { vertical-align: sub; margin-right: 10px; } md2-select { display: inline-block; border: 0; outline: 0; } .md2-select-trigger { border-width: 0; min-width: 40px; } } } "], host: { '[class.md2-sort-active]': '_isAsc || _isDesc', '(click)': '_sort()' @@ -297,6 +297,7 @@ var Md2Pagination = (function () { this._dataTable = _dataTable; this._activePage = 1; this.rowsPerPageSet = []; + this.paginationLabel = 'Rows per page:'; this._dataLength = 0; this.onPageChangeSubscriber = function (event) { _this._activePage = event.activePage; @@ -326,11 +327,15 @@ __decorate([ Input(), __metadata("design:type", Md2DataTable) ], Md2Pagination.prototype, "md2Table", void 0); +__decorate([ + Input(), + __metadata("design:type", String) +], Md2Pagination.prototype, "paginationLabel", void 0); Md2Pagination = __decorate([ Component({ selector: 'md2-pagination', - template: "
    _rowsPerPage\">
  • 4 && _activePage + 1 > _lastPage\" (click)=\"_setPage(_activePage - 4)\">{{_activePage-4}}
  • 3 && _activePage + 2 > _lastPage\" (click)=\"_setPage(_activePage - 3)\">{{_activePage-3}}
  • 2\" (click)=\"_setPage(_activePage - 2)\">{{_activePage-2}}
  • 1\" (click)=\"_setPage(_activePage - 1)\">{{_activePage-1}}
  • {{_activePage}}
  • {{_activePage+1}}
  • {{_activePage+2}}
  • {{_activePage+3}}
  • {{_activePage+4}}
  • = _lastPage\" (click)=\"_setPage(_activePage + 1)\">
0\">Rows per page:{{row}}
", - styles: ["[md2SortBy]{line-height:24px;color:rgba(0,0,0,.54);white-space:nowrap;cursor:pointer;user-select:none}[md2SortBy] svg{display:inline-block;vertical-align:middle;fill:currentColor;opacity:0}[md2SortBy]:hover:not(.md2-sort-active) svg{color:rgba(0,0,0,.26);opacity:1}[md2SortBy].md2-sort-active{color:rgba(0,0,0,.87)}[md2SortBy].md2-sort-active svg{opacity:1}md2-pagination{display:block;color:rgba(0,0,0,.54);user-select:none}md2-pagination::after,md2-pagination::before{display:table;content:''}md2-pagination::after{clear:both}md2-pagination .md2-pagination{display:inline-block;margin:8px 0;padding:0}md2-pagination .md2-pagination li{position:relative;display:inline-block;width:36px;vertical-align:top;text-align:center;line-height:36px;border-radius:100px;cursor:pointer;box-sizing:border-box}md2-pagination .md2-pagination li:hover:not(.disabled):not(.active){background:rgba(0,0,0,.12)}md2-pagination .md2-pagination li.disabled{pointer-events:none;background:0 0;cursor:default;opacity:.48}md2-pagination .md2-pagination li.active{background:#106cc8;color:#fff;cursor:default}md2-pagination .md2-pagination li svg{fill:currentColor;margin-bottom:-7px}md2-pagination .md2-rows-select{display:inline-block;margin:8px 0;padding:0;float:right;color:rgba(0,0,0,.54);line-height:36px}md2-pagination .md2-rows-select md2-select{display:inline-block;border:0;outline:0}md2-pagination .md2-rows-select .md2-select-trigger{border-width:0;min-width:40px} /*# sourceMappingURL=data-table.css.map */ "], + template: "
    _rowsPerPage\">
  • 4 && _activePage + 1 > _lastPage\" (click)=\"_setPage(_activePage - 4)\">{{_activePage-4}}
  • 3 && _activePage + 2 > _lastPage\" (click)=\"_setPage(_activePage - 3)\">{{_activePage-3}}
  • 2\" (click)=\"_setPage(_activePage - 2)\">{{_activePage-2}}
  • 1\" (click)=\"_setPage(_activePage - 1)\">{{_activePage-1}}
  • {{_activePage}}
  • {{_activePage+1}}
  • {{_activePage+2}}
  • {{_activePage+3}}
  • {{_activePage+4}}
  • = _lastPage\" (click)=\"_setPage(_activePage + 1)\">
0\">{{row}}
", + styles: ["[md2SortBy]{line-height:24px;color:rgba(0,0,0,.54);white-space:nowrap;cursor:pointer;user-select:none}[md2SortBy] svg{display:inline-block;vertical-align:middle;fill:currentColor;opacity:0}[md2SortBy]:hover:not(.md2-sort-active) svg{color:rgba(0,0,0,.26);opacity:1}[md2SortBy].md2-sort-active{color:rgba(0,0,0,.87)}[md2SortBy].md2-sort-active svg{opacity:1}md2-pagination{display:block;color:rgba(0,0,0,.54);user-select:none}md2-pagination::after,md2-pagination::before{display:table;content:''}md2-pagination::after{clear:both}md2-pagination .md2-pagination{display:inline-block;margin:8px 0;padding:0}md2-pagination .md2-pagination li{position:relative;display:inline-block;width:36px;vertical-align:top;text-align:center;line-height:36px;border-radius:100px;cursor:pointer;box-sizing:border-box}md2-pagination .md2-pagination li:hover:not(.disabled):not(.active){background:rgba(0,0,0,.12)}md2-pagination .md2-pagination li.disabled{pointer-events:none;background:0 0;cursor:default;opacity:.48}md2-pagination .md2-pagination li.active{background:#106cc8;color:#fff;cursor:default}md2-pagination .md2-pagination li svg{fill:currentColor;margin-bottom:-7px}md2-pagination .md2-rows-select{display:inline-block;margin:8px 0;padding:0;float:right;color:rgba(0,0,0,.54);line-height:36px}md2-pagination .md2-rows-select label{vertical-align:sub;margin-right:10px}md2-pagination .md2-rows-select md2-select{display:inline-block;border:0;outline:0}md2-pagination .md2-rows-select .md2-select-trigger{border-width:0;min-width:40px} /*# sourceMappingURL=data-table.css.map */ "], exportAs: 'md2Pagination', encapsulation: ViewEncapsulation.None }), diff --git a/data-table/data-table.js.map b/data-table/data-table.js.map index 87b620191..aeccdf4d6 100644 --- a/data-table/data-table.js.map +++ b/data-table/data-table.js.map @@ -1 +1 @@ -{"version":3,"file":"data-table.js","sourceRoot":"","sources":["../../../src/lib/data-table/data-table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,KAAK,EACL,MAAM,EAEN,QAAQ,EAER,eAAe,EAEf,iBAAiB,EACjB,QAAQ,GACT,MAA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AC;GACW,kBAAkB,CAAI;SAAtB,kBAAkB","sourcesContent":["import {\n Component,\n Directive,\n EventEmitter,\n Input,\n Output,\n OnInit,\n Optional,\n DoCheck,\n IterableDiffers,\n IterableDiffer,\n ViewEncapsulation,\n NgModule,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { Md2SelectModule } from '../select/index';\n\nexport class Md2PaginationChange {\n source: Md2Pagination;\n activePage: number;\n}\n\nexport interface SortEvent {\n sortBy: string | string[];\n sortOrder: string;\n}\n\nexport interface PageEvent {\n activePage: number;\n rowsPerPage: number;\n dataLength: number;\n}\n\nexport interface DataEvent {\n length: number;\n}\n\n@Directive({\n selector: 'table[md2Data]',\n exportAs: 'md2DataTable'\n})\nexport class Md2DataTable implements DoCheck {\n\n private diff: IterableDiffer;\n private isDataChanged = false;\n private _data: Array = [];\n private _activePage: number = 1;\n private _rowsPerPage: number = 1000;\n private _sortBy: string | Array = '';\n private _sortOrder: string = 'asc';\n\n data: Array;\n\n @Input()\n get md2Data() { return this._data; }\n set md2Data(value: Array) {\n if (this._data !== value) {\n this._data = value || [];\n this.recalculatePage();\n this.isDataChanged = true;\n }\n }\n\n @Input()\n get activePage() { return this._activePage; }\n set activePage(value: number) {\n if (this._activePage !== value) {\n this._activePage = value;\n }\n }\n\n @Input()\n get rowsPerPage() { return this._rowsPerPage; }\n set rowsPerPage(value: number) {\n if (this._rowsPerPage !== value) {\n this._rowsPerPage = value;\n this.setPage(this.activePage, value);\n this.isDataChanged = true;\n }\n }\n\n @Input()\n get sortBy() { return this._sortBy; }\n set sortBy(value: string | Array) {\n if (this._sortBy !== value) {\n this._sortBy = value;\n if (value) {\n this.onSortChange.next({ sortBy: this.sortBy, sortOrder: this.sortOrder });\n }\n this.isDataChanged = true;\n }\n }\n\n @Input()\n get sortOrder() { return this._sortOrder; }\n set sortOrder(value: string) {\n if (!(value === 'asc' || value === 'desc')) {\n console.warn('sortOrder value must be one of [\"asc\", \"desc\"], but is:', value);\n value = 'asc';\n }\n if (this._sortOrder !== value) {\n this._sortOrder = value;\n this.isDataChanged = true;\n }\n }\n\n @Output() activePageChange = new EventEmitter();\n @Output() rowsPerPageChange = new EventEmitter();\n @Output() sortByChange = new EventEmitter();\n @Output() sortOrderChange = new EventEmitter();\n\n onSortChange = new EventEmitter();\n onPageChange = new EventEmitter();\n\n constructor(private differs: IterableDiffers) {\n this.diff = differs.find([]).create(null);\n }\n\n ngDoCheck(): any {\n let changes = this.diff.diff(this.md2Data);\n if (changes) {\n this.recalculatePage();\n this.isDataChanged = true;\n }\n if (this.isDataChanged) {\n this.fillData();\n this.diff.diff(this.md2Data);\n this.isDataChanged = false;\n }\n }\n\n getSort(): SortEvent {\n return { sortBy: this.sortBy, sortOrder: this.sortOrder };\n }\n\n setSort(sortBy: string | string[], sortOrder: string) {\n if (this.sortBy !== sortBy || this.sortOrder !== sortOrder) {\n this.sortBy = sortBy;\n this.sortOrder = sortOrder;\n this.isDataChanged = true;\n this.onSortChange.next({ sortBy: sortBy, sortOrder: sortOrder });\n this.sortByChange.emit(this.sortBy);\n this.sortOrderChange.emit(this.sortOrder);\n }\n }\n\n getPage(): PageEvent {\n return {\n activePage: this.activePage,\n rowsPerPage: this.rowsPerPage,\n dataLength: this.md2Data.length\n };\n }\n\n setPage(activePage: number, rowsPerPage: number): void {\n if (this.rowsPerPage !== rowsPerPage || this.activePage !== activePage) {\n this.activePage = this.activePage !== activePage ?\n activePage : this.calculateNewActivePage(this.rowsPerPage, rowsPerPage);\n if (this.rowsPerPage !== rowsPerPage) {\n this._rowsPerPage = rowsPerPage;\n this.rowsPerPageChange.emit(this.rowsPerPage);\n }\n this.isDataChanged = true;\n this.onPageChange.emit({\n activePage: this.activePage,\n rowsPerPage: this.rowsPerPage,\n dataLength: this.md2Data ? this.md2Data.length : 0\n });\n this.activePageChange.emit(this.activePage);\n }\n }\n\n private calculateNewActivePage(previousRowsPerPage: number, currentRowsPerPage: number): number {\n let firstRowOnPage = (this.activePage - 1) * previousRowsPerPage + 1;\n let newActivePage = Math.ceil(firstRowOnPage / currentRowsPerPage);\n return newActivePage;\n }\n\n private recalculatePage() {\n let lastPage = Math.ceil(this.md2Data.length / this.rowsPerPage);\n if (lastPage < this.activePage) {\n this._activePage = lastPage || 1;\n setTimeout(() => {\n this.activePageChange.emit(this.activePage);\n }, 10);\n } else { }\n\n this.onPageChange.emit({\n activePage: this.activePage,\n rowsPerPage: this.rowsPerPage,\n dataLength: this.md2Data.length\n });\n }\n\n private fillData() {\n let offset = (this.activePage - 1) * this.rowsPerPage;\n let data = this.md2Data;\n let sortInt = this.sortOrder === 'desc' ? -1 : 1;\n if (this.sortBy) {\n data = data.sort((a: any, b: any) => {\n let x = this.caseInsensitiveIteratee(a);\n let y = this.caseInsensitiveIteratee(b);\n return ((x > y) ? 1 : (y > x) ? -1 : 0) * sortInt;\n });\n }\n this.data = data.slice(offset, offset + this.rowsPerPage);\n }\n\n private caseInsensitiveIteratee(value: any) {\n if (typeof this.sortBy === 'string' || this.sortBy instanceof String) {\n for (let sortByProperty of this.sortBy.split('.')) {\n value = value[sortByProperty];\n }\n } else {\n value = value[this.sortBy + ''];\n }\n if (value && typeof value === 'string' || value instanceof String) {\n return value.toLowerCase();\n }\n return value;\n }\n\n}\n\n@Component({\n selector: '[md2SortBy]',\n templateUrl: 'sort.html',\n styleUrls: ['data-table.scss'],\n host: {\n '[class.md2-sort-active]': '_isAsc || _isDesc',\n '(click)': '_sort()'\n },\n encapsulation: ViewEncapsulation.None\n})\nexport class Md2DataTableSortBy implements OnInit {\n\n @Input() md2SortBy: string;\n\n _isAsc: boolean = false;\n _isDesc: boolean = false;\n\n constructor(private _md2Table: Md2DataTable) {\n }\n\n ngOnInit() {\n this._md2Table.onSortChange.subscribe((event: SortEvent) => {\n this._isAsc = (event.sortBy === this.md2SortBy && event.sortOrder === 'asc');\n this._isDesc = (event.sortBy === this.md2SortBy && event.sortOrder === 'desc');\n });\n }\n\n _sort() {\n if (this._isAsc) {\n this._md2Table.setSort(this.md2SortBy, 'desc');\n } else {\n this._md2Table.setSort(this.md2SortBy, 'asc');\n }\n }\n\n}\n\n@Component({\n selector: 'md2-pagination',\n templateUrl: 'pagination.html',\n styleUrls: ['data-table.css'],\n exportAs: 'md2Pagination',\n encapsulation: ViewEncapsulation.None\n})\nexport class Md2Pagination {\n\n private _activePage: number = 1;\n\n @Input() rowsPerPageSet: any = [];\n @Input() md2Table: Md2DataTable;\n\n _rowsPerPage: number;\n _dataLength: number = 0;\n _lastPage: number;\n\n constructor( @Optional() private _dataTable: Md2DataTable) { }\n\n ngDoCheck() {\n this.md2Table = this.md2Table || this._dataTable;\n this.onPageChangeSubscriber(this.md2Table.getPage());\n this.md2Table.onPageChange.subscribe(this.onPageChangeSubscriber);\n }\n\n _setPage(pageNumber: number): void {\n this.md2Table.setPage(pageNumber, this._rowsPerPage);\n }\n\n _setRows(event: any): void {\n this.md2Table.setPage(this._activePage, parseInt(event.value));\n }\n\n private onPageChangeSubscriber = (event: PageEvent) => {\n this._activePage = event.activePage;\n this._rowsPerPage = event.rowsPerPage;\n this._dataLength = event.dataLength;\n this._lastPage = Math.ceil(this._dataLength / this._rowsPerPage);\n }\n\n}\n\nexport const MD2_DATA_TABLE_DIRECTIVES: any[] = [\n Md2DataTable,\n Md2DataTableSortBy,\n Md2Pagination\n];\n\n@NgModule({\n imports: [CommonModule, FormsModule, Md2SelectModule],\n exports: MD2_DATA_TABLE_DIRECTIVES,\n declarations: MD2_DATA_TABLE_DIRECTIVES,\n})\nexport class Md2DataTableModule { }\n"]} \ No newline at end of file +{"version":3,"file":"data-table.js","sourceRoot":"","sources":["../../../src/lib/data-table/data-table.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EACL,SAAS,EACT,SAAS,EACT,YAAY,EACZ,KAAK,EACL,MAAM,EAEN,QAAQ,EAER,eAAe,EAEf,iBAAiB,EACjB,QAAQ,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,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B;QAClC,YAAY,EAAE,yBAAyB;KACxC,CAAC;GACW,kBAAkB,CAAI;SAAtB,kBAAkB","sourcesContent":["import {\n Component,\n Directive,\n EventEmitter,\n Input,\n Output,\n OnInit,\n Optional,\n DoCheck,\n IterableDiffers,\n IterableDiffer,\n ViewEncapsulation,\n NgModule,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { Md2SelectModule } from '../select/index';\n\nexport class Md2PaginationChange {\n source: Md2Pagination;\n activePage: number;\n}\n\nexport interface SortEvent {\n sortBy: string | string[];\n sortOrder: string;\n}\n\nexport interface PageEvent {\n activePage: number;\n rowsPerPage: number;\n dataLength: number;\n}\n\nexport interface DataEvent {\n length: number;\n}\n\n@Directive({\n selector: 'table[md2Data]',\n exportAs: 'md2DataTable'\n})\nexport class Md2DataTable implements DoCheck {\n\n private diff: IterableDiffer;\n private isDataChanged = false;\n private _data: Array = [];\n private _activePage: number = 1;\n private _rowsPerPage: number = 1000;\n private _sortBy: string | Array = '';\n private _sortOrder: string = 'asc';\n\n data: Array;\n\n @Input()\n get md2Data() { return this._data; }\n set md2Data(value: Array) {\n if (this._data !== value) {\n this._data = value || [];\n this.recalculatePage();\n this.isDataChanged = true;\n }\n }\n\n @Input()\n get activePage() { return this._activePage; }\n set activePage(value: number) {\n if (this._activePage !== value) {\n this._activePage = value;\n }\n }\n\n @Input()\n get rowsPerPage() { return this._rowsPerPage; }\n set rowsPerPage(value: number) {\n if (this._rowsPerPage !== value) {\n this._rowsPerPage = value;\n this.setPage(this.activePage, value);\n this.isDataChanged = true;\n }\n }\n\n @Input()\n get sortBy() { return this._sortBy; }\n set sortBy(value: string | Array) {\n if (this._sortBy !== value) {\n this._sortBy = value;\n if (value) {\n this.onSortChange.next({ sortBy: this.sortBy, sortOrder: this.sortOrder });\n }\n this.isDataChanged = true;\n }\n }\n\n @Input()\n get sortOrder() { return this._sortOrder; }\n set sortOrder(value: string) {\n if (!(value === 'asc' || value === 'desc')) {\n console.warn('sortOrder value must be one of [\"asc\", \"desc\"], but is:', value);\n value = 'asc';\n }\n if (this._sortOrder !== value) {\n this._sortOrder = value;\n this.isDataChanged = true;\n }\n }\n\n @Output() activePageChange = new EventEmitter();\n @Output() rowsPerPageChange = new EventEmitter();\n @Output() sortByChange = new EventEmitter();\n @Output() sortOrderChange = new EventEmitter();\n\n onSortChange = new EventEmitter();\n onPageChange = new EventEmitter();\n\n constructor(private differs: IterableDiffers) {\n this.diff = differs.find([]).create(null);\n }\n\n ngDoCheck(): any {\n let changes = this.diff.diff(this.md2Data);\n if (changes) {\n this.recalculatePage();\n this.isDataChanged = true;\n }\n if (this.isDataChanged) {\n this.fillData();\n this.diff.diff(this.md2Data);\n this.isDataChanged = false;\n }\n }\n\n getSort(): SortEvent {\n return { sortBy: this.sortBy, sortOrder: this.sortOrder };\n }\n\n setSort(sortBy: string | string[], sortOrder: string) {\n if (this.sortBy !== sortBy || this.sortOrder !== sortOrder) {\n this.sortBy = sortBy;\n this.sortOrder = sortOrder;\n this.isDataChanged = true;\n this.onSortChange.next({ sortBy: sortBy, sortOrder: sortOrder });\n this.sortByChange.emit(this.sortBy);\n this.sortOrderChange.emit(this.sortOrder);\n }\n }\n\n getPage(): PageEvent {\n return {\n activePage: this.activePage,\n rowsPerPage: this.rowsPerPage,\n dataLength: this.md2Data.length\n };\n }\n\n setPage(activePage: number, rowsPerPage: number): void {\n if (this.rowsPerPage !== rowsPerPage || this.activePage !== activePage) {\n this.activePage = this.activePage !== activePage ?\n activePage : this.calculateNewActivePage(this.rowsPerPage, rowsPerPage);\n if (this.rowsPerPage !== rowsPerPage) {\n this._rowsPerPage = rowsPerPage;\n this.rowsPerPageChange.emit(this.rowsPerPage);\n }\n this.isDataChanged = true;\n this.onPageChange.emit({\n activePage: this.activePage,\n rowsPerPage: this.rowsPerPage,\n dataLength: this.md2Data ? this.md2Data.length : 0\n });\n this.activePageChange.emit(this.activePage);\n }\n }\n\n private calculateNewActivePage(previousRowsPerPage: number, currentRowsPerPage: number): number {\n let firstRowOnPage = (this.activePage - 1) * previousRowsPerPage + 1;\n let newActivePage = Math.ceil(firstRowOnPage / currentRowsPerPage);\n return newActivePage;\n }\n\n private recalculatePage() {\n let lastPage = Math.ceil(this.md2Data.length / this.rowsPerPage);\n if (lastPage < this.activePage) {\n this._activePage = lastPage || 1;\n setTimeout(() => {\n this.activePageChange.emit(this.activePage);\n }, 10);\n } else { }\n\n this.onPageChange.emit({\n activePage: this.activePage,\n rowsPerPage: this.rowsPerPage,\n dataLength: this.md2Data.length\n });\n }\n\n private fillData() {\n let offset = (this.activePage - 1) * this.rowsPerPage;\n let data = this.md2Data;\n let sortInt = this.sortOrder === 'desc' ? -1 : 1;\n if (this.sortBy) {\n data = data.sort((a: any, b: any) => {\n let x = this.caseInsensitiveIteratee(a);\n let y = this.caseInsensitiveIteratee(b);\n return ((x > y) ? 1 : (y > x) ? -1 : 0) * sortInt;\n });\n }\n this.data = data.slice(offset, offset + this.rowsPerPage);\n }\n\n private caseInsensitiveIteratee(value: any) {\n if (typeof this.sortBy === 'string' || this.sortBy instanceof String) {\n for (let sortByProperty of this.sortBy.split('.')) {\n value = value[sortByProperty];\n }\n } else {\n value = value[this.sortBy + ''];\n }\n if (value && typeof value === 'string' || value instanceof String) {\n return value.toLowerCase();\n }\n return value;\n }\n\n}\n\n@Component({\n selector: '[md2SortBy]',\n templateUrl: 'sort.html',\n styleUrls: ['data-table.scss'],\n host: {\n '[class.md2-sort-active]': '_isAsc || _isDesc',\n '(click)': '_sort()'\n },\n encapsulation: ViewEncapsulation.None\n})\nexport class Md2DataTableSortBy implements OnInit {\n\n @Input() md2SortBy: string;\n\n _isAsc: boolean = false;\n _isDesc: boolean = false;\n\n constructor(private _md2Table: Md2DataTable) {\n }\n\n ngOnInit() {\n this._md2Table.onSortChange.subscribe((event: SortEvent) => {\n this._isAsc = (event.sortBy === this.md2SortBy && event.sortOrder === 'asc');\n this._isDesc = (event.sortBy === this.md2SortBy && event.sortOrder === 'desc');\n });\n }\n\n _sort() {\n if (this._isAsc) {\n this._md2Table.setSort(this.md2SortBy, 'desc');\n } else {\n this._md2Table.setSort(this.md2SortBy, 'asc');\n }\n }\n\n}\n\n@Component({\n selector: 'md2-pagination',\n templateUrl: 'pagination.html',\n styleUrls: ['data-table.css'],\n exportAs: 'md2Pagination',\n encapsulation: ViewEncapsulation.None\n})\nexport class Md2Pagination {\n\n private _activePage: number = 1;\n\n @Input() rowsPerPageSet: any = [];\n @Input() md2Table: Md2DataTable;\n @Input() paginationLabel: string = 'Rows per page:';\n\n _rowsPerPage: number;\n _dataLength: number = 0;\n _lastPage: number;\n\n constructor( @Optional() private _dataTable: Md2DataTable) { }\n\n ngDoCheck() {\n this.md2Table = this.md2Table || this._dataTable;\n this.onPageChangeSubscriber(this.md2Table.getPage());\n this.md2Table.onPageChange.subscribe(this.onPageChangeSubscriber);\n }\n\n _setPage(pageNumber: number): void {\n this.md2Table.setPage(pageNumber, this._rowsPerPage);\n }\n\n _setRows(event: any): void {\n this.md2Table.setPage(this._activePage, parseInt(event.value));\n }\n\n private onPageChangeSubscriber = (event: PageEvent) => {\n this._activePage = event.activePage;\n this._rowsPerPage = event.rowsPerPage;\n this._dataLength = event.dataLength;\n this._lastPage = Math.ceil(this._dataLength / this._rowsPerPage);\n }\n\n}\n\nexport const MD2_DATA_TABLE_DIRECTIVES: any[] = [\n Md2DataTable,\n Md2DataTableSortBy,\n Md2Pagination\n];\n\n@NgModule({\n imports: [CommonModule, FormsModule, Md2SelectModule],\n exports: MD2_DATA_TABLE_DIRECTIVES,\n declarations: MD2_DATA_TABLE_DIRECTIVES,\n})\nexport class Md2DataTableModule { }\n"]} \ No newline at end of file diff --git a/data-table/data-table.metadata.json b/data-table/data-table.metadata.json index 696d3ac73..5fd2df372 100644 --- a/data-table/data-table.metadata.json +++ b/data-table/data-table.metadata.json @@ -1 +1 @@ -[{"__symbolic":"module","version":3,"metadata":{"Md2PaginationChange":{"__symbolic":"class"},"SortEvent":{"__symbolic":"interface"},"PageEvent":{"__symbolic":"interface"},"DataEvent":{"__symbolic":"interface"},"Md2DataTable":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"table[md2Data]","exportAs":"md2DataTable"}]}],"members":{"md2Data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"activePage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"rowsPerPage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"sortBy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"sortOrder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"activePageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"rowsPerPageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"sortByChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"sortOrderChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"IterableDiffers"}]}],"ngDoCheck":[{"__symbolic":"method"}],"getSort":[{"__symbolic":"method"}],"setSort":[{"__symbolic":"method"}],"getPage":[{"__symbolic":"method"}],"setPage":[{"__symbolic":"method"}],"calculateNewActivePage":[{"__symbolic":"method"}],"recalculatePage":[{"__symbolic":"method"}],"fillData":[{"__symbolic":"method"}],"caseInsensitiveIteratee":[{"__symbolic":"method"}]}},"Md2DataTableSortBy":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"[md2SortBy]","templateUrl":"sort.html","styleUrls":["data-table.scss"],"host":{"[class.md2-sort-active]":"_isAsc || _isDesc","(click)":"_sort()","$quoted$":["[class.md2-sort-active]","(click)"]},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"md2SortBy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Md2DataTable"}]}],"ngOnInit":[{"__symbolic":"method"}],"_sort":[{"__symbolic":"method"}]}},"Md2Pagination":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"md2-pagination","templateUrl":"pagination.html","styleUrls":["data-table.css"],"exportAs":"md2Pagination","encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"rowsPerPageSet":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"md2Table":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}]],"parameters":[{"__symbolic":"reference","name":"Md2DataTable"}]}],"ngDoCheck":[{"__symbolic":"method"}],"_setPage":[{"__symbolic":"method"}],"_setRows":[{"__symbolic":"method"}]}},"MD2_DATA_TABLE_DIRECTIVES":[{"__symbolic":"reference","name":"Md2DataTable"},{"__symbolic":"reference","name":"Md2DataTableSortBy"},{"__symbolic":"reference","name":"Md2Pagination"}],"Md2DataTableModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule"},{"__symbolic":"reference","module":"../select/index","name":"Md2SelectModule"}],"exports":{"__symbolic":"reference","name":"MD2_DATA_TABLE_DIRECTIVES"},"declarations":{"__symbolic":"reference","name":"MD2_DATA_TABLE_DIRECTIVES"}}]}]}}},{"__symbolic":"module","version":1,"metadata":{"Md2PaginationChange":{"__symbolic":"class"},"SortEvent":{"__symbolic":"interface"},"PageEvent":{"__symbolic":"interface"},"DataEvent":{"__symbolic":"interface"},"Md2DataTable":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"table[md2Data]","exportAs":"md2DataTable"}]}],"members":{"md2Data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"activePage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"rowsPerPage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"sortBy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"sortOrder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"activePageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"rowsPerPageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"sortByChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"sortOrderChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"IterableDiffers"}]}],"ngDoCheck":[{"__symbolic":"method"}],"getSort":[{"__symbolic":"method"}],"setSort":[{"__symbolic":"method"}],"getPage":[{"__symbolic":"method"}],"setPage":[{"__symbolic":"method"}],"calculateNewActivePage":[{"__symbolic":"method"}],"recalculatePage":[{"__symbolic":"method"}],"fillData":[{"__symbolic":"method"}],"caseInsensitiveIteratee":[{"__symbolic":"method"}]}},"Md2DataTableSortBy":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"[md2SortBy]","templateUrl":"sort.html","styleUrls":["data-table.scss"],"host":{"[class.md2-sort-active]":"_isAsc || _isDesc","(click)":"_sort()"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"md2SortBy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Md2DataTable"}]}],"ngOnInit":[{"__symbolic":"method"}],"_sort":[{"__symbolic":"method"}]}},"Md2Pagination":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"md2-pagination","templateUrl":"pagination.html","styleUrls":["data-table.css"],"exportAs":"md2Pagination","encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"rowsPerPageSet":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"md2Table":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}]],"parameters":[{"__symbolic":"reference","name":"Md2DataTable"}]}],"ngDoCheck":[{"__symbolic":"method"}],"_setPage":[{"__symbolic":"method"}],"_setRows":[{"__symbolic":"method"}]}},"MD2_DATA_TABLE_DIRECTIVES":[{"__symbolic":"reference","name":"Md2DataTable"},{"__symbolic":"reference","name":"Md2DataTableSortBy"},{"__symbolic":"reference","name":"Md2Pagination"}],"Md2DataTableModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule"},{"__symbolic":"reference","module":"../select/index","name":"Md2SelectModule"}],"exports":{"__symbolic":"reference","name":"MD2_DATA_TABLE_DIRECTIVES"},"declarations":{"__symbolic":"reference","name":"MD2_DATA_TABLE_DIRECTIVES"}}]}]}}}] \ No newline at end of file +[{"__symbolic":"module","version":3,"metadata":{"Md2PaginationChange":{"__symbolic":"class"},"SortEvent":{"__symbolic":"interface"},"PageEvent":{"__symbolic":"interface"},"DataEvent":{"__symbolic":"interface"},"Md2DataTable":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"table[md2Data]","exportAs":"md2DataTable"}]}],"members":{"md2Data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"activePage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"rowsPerPage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"sortBy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"sortOrder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"activePageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"rowsPerPageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"sortByChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"sortOrderChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"IterableDiffers"}]}],"ngDoCheck":[{"__symbolic":"method"}],"getSort":[{"__symbolic":"method"}],"setSort":[{"__symbolic":"method"}],"getPage":[{"__symbolic":"method"}],"setPage":[{"__symbolic":"method"}],"calculateNewActivePage":[{"__symbolic":"method"}],"recalculatePage":[{"__symbolic":"method"}],"fillData":[{"__symbolic":"method"}],"caseInsensitiveIteratee":[{"__symbolic":"method"}]}},"Md2DataTableSortBy":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"[md2SortBy]","templateUrl":"sort.html","styleUrls":["data-table.scss"],"host":{"[class.md2-sort-active]":"_isAsc || _isDesc","(click)":"_sort()","$quoted$":["[class.md2-sort-active]","(click)"]},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"md2SortBy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Md2DataTable"}]}],"ngOnInit":[{"__symbolic":"method"}],"_sort":[{"__symbolic":"method"}]}},"Md2Pagination":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"md2-pagination","templateUrl":"pagination.html","styleUrls":["data-table.css"],"exportAs":"md2Pagination","encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"rowsPerPageSet":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"md2Table":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"paginationLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}]],"parameters":[{"__symbolic":"reference","name":"Md2DataTable"}]}],"ngDoCheck":[{"__symbolic":"method"}],"_setPage":[{"__symbolic":"method"}],"_setRows":[{"__symbolic":"method"}]}},"MD2_DATA_TABLE_DIRECTIVES":[{"__symbolic":"reference","name":"Md2DataTable"},{"__symbolic":"reference","name":"Md2DataTableSortBy"},{"__symbolic":"reference","name":"Md2Pagination"}],"Md2DataTableModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule"},{"__symbolic":"reference","module":"../select/index","name":"Md2SelectModule"}],"exports":{"__symbolic":"reference","name":"MD2_DATA_TABLE_DIRECTIVES"},"declarations":{"__symbolic":"reference","name":"MD2_DATA_TABLE_DIRECTIVES"}}]}]}}},{"__symbolic":"module","version":1,"metadata":{"Md2PaginationChange":{"__symbolic":"class"},"SortEvent":{"__symbolic":"interface"},"PageEvent":{"__symbolic":"interface"},"DataEvent":{"__symbolic":"interface"},"Md2DataTable":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive"},"arguments":[{"selector":"table[md2Data]","exportAs":"md2DataTable"}]}],"members":{"md2Data":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"activePage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"rowsPerPage":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"sortBy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"sortOrder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"activePageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"rowsPerPageChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"sortByChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"sortOrderChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"IterableDiffers"}]}],"ngDoCheck":[{"__symbolic":"method"}],"getSort":[{"__symbolic":"method"}],"setSort":[{"__symbolic":"method"}],"getPage":[{"__symbolic":"method"}],"setPage":[{"__symbolic":"method"}],"calculateNewActivePage":[{"__symbolic":"method"}],"recalculatePage":[{"__symbolic":"method"}],"fillData":[{"__symbolic":"method"}],"caseInsensitiveIteratee":[{"__symbolic":"method"}]}},"Md2DataTableSortBy":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"[md2SortBy]","templateUrl":"sort.html","styleUrls":["data-table.scss"],"host":{"[class.md2-sort-active]":"_isAsc || _isDesc","(click)":"_sort()"},"encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"md2SortBy":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Md2DataTable"}]}],"ngOnInit":[{"__symbolic":"method"}],"_sort":[{"__symbolic":"method"}]}},"Md2Pagination":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component"},"arguments":[{"selector":"md2-pagination","templateUrl":"pagination.html","styleUrls":["data-table.css"],"exportAs":"md2Pagination","encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation"},"member":"None"}}]}],"members":{"rowsPerPageSet":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"md2Table":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"paginationLabel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input"}}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional"}}]],"parameters":[{"__symbolic":"reference","name":"Md2DataTable"}]}],"ngDoCheck":[{"__symbolic":"method"}],"_setPage":[{"__symbolic":"method"}],"_setRows":[{"__symbolic":"method"}]}},"MD2_DATA_TABLE_DIRECTIVES":[{"__symbolic":"reference","name":"Md2DataTable"},{"__symbolic":"reference","name":"Md2DataTableSortBy"},{"__symbolic":"reference","name":"Md2Pagination"}],"Md2DataTableModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule"},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule"},{"__symbolic":"reference","module":"@angular/forms","name":"FormsModule"},{"__symbolic":"reference","module":"../select/index","name":"Md2SelectModule"}],"exports":{"__symbolic":"reference","name":"MD2_DATA_TABLE_DIRECTIVES"},"declarations":{"__symbolic":"reference","name":"MD2_DATA_TABLE_DIRECTIVES"}}]}]}}}] \ No newline at end of file diff --git a/data-table/data-table.scss b/data-table/data-table.scss index 079e97d7e..3db04014c 100644 --- a/data-table/data-table.scss +++ b/data-table/data-table.scss @@ -105,6 +105,11 @@ md2-pagination { color: rgba(black, 0.54); line-height: 36px; + label { + vertical-align: sub; + margin-right: 10px; + } + md2-select { display: inline-block; border: 0; diff --git a/data-table/pagination.html b/data-table/pagination.html index db393071e..6d925fdc5 100644 --- a/data-table/pagination.html +++ b/data-table/pagination.html @@ -1 +1 @@ -
  • {{_activePage-4}}
  • {{_activePage-3}}
  • {{_activePage-2}}
  • {{_activePage-1}}
  • {{_activePage}}
  • {{_activePage+1}}
  • {{_activePage+2}}
  • {{_activePage+3}}
  • {{_activePage+4}}
Rows per page:{{row}}
\ No newline at end of file +
  • {{_activePage-4}}
  • {{_activePage-3}}
  • {{_activePage-2}}
  • {{_activePage-1}}
  • {{_activePage}}
  • {{_activePage+1}}
  • {{_activePage+2}}
  • {{_activePage+3}}
  • {{_activePage+4}}
{{row}}
\ No newline at end of file diff --git a/datepicker/calendar-body.css b/datepicker/calendar-body.css index 0bd428538..8469cc4fa 100644 --- a/datepicker/calendar-body.css +++ b/datepicker/calendar-body.css @@ -1,2 +1,2 @@ -.md2-calendar-body{font-size:13px;min-width:224px}.md2-calendar-body-label{padding:7.14286% 0 7.14286% 7.14286%;height:0;line-height:0;color:rgba(0,0,0,.54);transform:translateX(-6px);text-align:left}.md2-calendar-body-cell{position:relative;width:14.28571%;height:0;line-height:0;padding:7.14286% 0;text-align:center;outline:0;cursor:pointer}.md2-calendar-body-disabled{cursor:default}.md2-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;color:rgba(0,0,0,.87);border-width:1px;border-style:solid;border-color:transparent;border-radius:50%}.md2-calendar-body-disabled>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){color:rgba(0,0,0,.38)}.md2-calendar:focus .md2-calendar-body-active>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected),:not(.md2-calendar-body-disabled):hover>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){background-color:rgba(0,0,0,.12)}.md2-calendar-body-selected{background-color:#106cc8;color:#fff}.md2-calendar-body-disabled>.md2-calendar-body-selected{background-color:rgba(16,108,200,.4)}.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:#106cc8}.md2-calendar-body-today.md2-calendar-body-selected{box-shadow:inset 0 0 0 1px md2-color(#106cc8,default-contrast)}.md2-calendar-body-disabled>.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:rgba(0,0,0,.18)}[dir=rtl] .md2-calendar-body-label{padding:0 7.14286% 0 0;transform:translateX(6px);text-align:right} +.md2-calendar-body{font-size:13px;min-width:224px}.md2-calendar-body-label{padding:7.14286% 0 7.14286% 7.14286%;height:0;line-height:0;color:rgba(0,0,0,.54);transform:translateX(-6px);text-align:left}.md2-calendar-body-cell{position:relative;width:14.28571%;height:0;line-height:0;padding:7.14286% 0;text-align:center;outline:0;cursor:pointer}.md2-calendar-body-disabled{cursor:default;pointer-events:none}.md2-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;color:rgba(0,0,0,.87);border-width:1px;border-style:solid;border-color:transparent;border-radius:50%}.md2-calendar-body-disabled>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){color:rgba(0,0,0,.38)}.md2-calendar:focus .md2-calendar-body-active>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected),:not(.md2-calendar-body-disabled):hover>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){background-color:rgba(0,0,0,.12)}.md2-calendar-body-selected{background-color:#106cc8;color:#fff}.md2-calendar-body-disabled>.md2-calendar-body-selected{background-color:rgba(16,108,200,.4)}.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:#106cc8}.md2-calendar-body-today.md2-calendar-body-selected{box-shadow:inset 0 0 0 1px md2-color(#106cc8,default-contrast)}.md2-calendar-body-disabled>.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:rgba(0,0,0,.18)}[dir=rtl] .md2-calendar-body-label{padding:0 7.14286% 0 0;transform:translateX(6px);text-align:right} /*# sourceMappingURL=calendar-body.css.map */ diff --git a/datepicker/calendar-body.css.map b/datepicker/calendar-body.css.map index a95302240..ed4cf4739 100644 --- a/datepicker/calendar-body.css.map +++ b/datepicker/calendar-body.css.map @@ -1 +1 @@ -{"version":3,"sources":["datepicker/calendar-body.scss","datepicker/calendar-body.css"],"names":[],"mappings":"AAeA,mBACE,UAf4B,KAgB5B,UAP2B,MAU7B,yBACE,QAV+B,SAUU,EAVV,SAAA,SAW/B,OAAQ,EACR,YAAa,EACb,MAAY,gBACZ,UAAW,iBACX,WAAY,KAGd,wBACE,SAAU,SACV,MAzB4B,UA0B5B,OAAQ,EACR,YAAa,EACb,QAvB+B,SAuBU,EACzC,WAAY,OACZ,QAAS,EACT,OAAQ,QAGV,4BACE,OAAQ,QAGV,gCACE,SAAU,SACV,IAvCsC,GAwCtC,KAxCsC,GAyCtC,QAAS,KACT,YAAa,OACb,gBAAiB,OACjB,WAAY,WACZ,MAxCoC,IAyCpC,OAzCoC,IA0CpC,MAAY,gBACZ,aA/C4C,IAgD5C,aAAc,MACd,aAAc,YACd,cAAe,IAEf,6FACE,MAAY,gBAKhB,+GADA,yGAGI,iBAAuB,gBAI3B,4BACE,iBAzEQ,QA0ER,MAAO,KAGT,wDACE,iBA9EQ,oBAiFV,0DAEI,aAnFM,QAiFV,oDAMI,WAAY,MAAM,EAAE,EAAE,EA1EuB,IA0E2B,oCAI5E,sFACE,aAAmB,gBC7BrB,mCDkCI,QAAS,EAtFoB,SAsFc,EAAE,EAC7C,UAAW,gBACX,WAAY","file":"calendar-body.css","sourcesContent":["$primary: #106cc8 !default;\n$md2-calendar-body-font-size: 13px !default;\n$md2-calendar-body-header-font-size: 14px !default;\n$md2-calendar-body-label-padding-start: 5% !default;\n$md2-calendar-body-label-translation: -6px !default;\n$md2-calendar-body-cell-min-size: 32px !default;\n$md2-calendar-body-cell-size: 100% / 7 !default;\n$md2-calendar-body-cell-content-margin: 5% !default;\n$md2-calendar-body-cell-content-border-width: 1px !default;\n\n$md2-calendar-body-min-size: 7 * $md2-calendar-body-cell-min-size !default;\n$md2-calendar-body-cell-padding: $md2-calendar-body-cell-size / 2 !default;\n$md2-calendar-body-cell-content-size: 100% - $md2-calendar-body-cell-content-margin * 2 !default;\n$md2-datepicker-selected-today-box-shadow-width: 1px;\n\n.md2-calendar-body {\n font-size: $md2-calendar-body-font-size;\n min-width: $md2-calendar-body-min-size;\n}\n\n.md2-calendar-body-label {\n padding: $md2-calendar-body-cell-padding 0 $md2-calendar-body-cell-padding $md2-calendar-body-cell-padding;\n height: 0;\n line-height: 0;\n color: rgba(black, 0.54);\n transform: translateX($md2-calendar-body-label-translation);\n text-align: left;\n}\n\n.md2-calendar-body-cell {\n position: relative;\n width: $md2-calendar-body-cell-size;\n height: 0;\n line-height: 0;\n padding: $md2-calendar-body-cell-padding 0;\n text-align: center;\n outline: none;\n cursor: pointer;\n}\n\n.md2-calendar-body-disabled {\n cursor: default;\n}\n\n.md2-calendar-body-cell-content {\n position: absolute;\n top: $md2-calendar-body-cell-content-margin;\n left: $md2-calendar-body-cell-content-margin;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: $md2-calendar-body-cell-content-size;\n height: $md2-calendar-body-cell-content-size;\n color: rgba(black, 0.87);\n border-width: $md2-calendar-body-cell-content-border-width;\n border-style: solid;\n border-color: transparent;\n border-radius: 50%;\n\n .md2-calendar-body-disabled > &:not(.md2-calendar-body-selected) {\n color: rgba(black, 0.38);\n }\n}\n\n:not(.md2-calendar-body-disabled):hover,\n.md2-calendar:focus .md2-calendar-body-active {\n & > .md2-calendar-body-cell-content:not(.md2-calendar-body-selected) {\n background-color: rgba(black, 0.12);\n }\n}\n\n.md2-calendar-body-selected {\n background-color: $primary;\n color: white;\n}\n\n.md2-calendar-body-disabled > .md2-calendar-body-selected {\n background-color: rgba($primary, 0.4);\n}\n\n.md2-calendar-body-today {\n &:not(.md2-calendar-body-selected) {\n border-color: $primary;\n }\n\n &.md2-calendar-body-selected {\n box-shadow: inset 0 0 0 $md2-datepicker-selected-today-box-shadow-width md2-color($primary, default-contrast);\n }\n}\n\n.md2-calendar-body-disabled > .md2-calendar-body-today:not(.md2-calendar-body-selected) {\n border-color: rgba(black, 0.18);\n}\n\n[dir='rtl'] {\n .md2-calendar-body-label {\n padding: 0 $md2-calendar-body-cell-padding 0 0;\n transform: translateX(-$md2-calendar-body-label-translation);\n text-align: right;\n }\n}\n",null]} \ No newline at end of file +{"version":3,"sources":["datepicker/calendar-body.scss","datepicker/calendar-body.css"],"names":[],"mappings":"AAeA,mBACE,UAf4B,KAgB5B,UAP2B,MAU7B,yBACE,QAV+B,SAUU,EAVV,SAAA,SAW/B,OAAQ,EACR,YAAa,EACb,MAAY,gBACZ,UAAW,iBACX,WAAY,KAGd,wBACE,SAAU,SACV,MAzB4B,UA0B5B,OAAQ,EACR,YAAa,EACb,QAvB+B,SAuBU,EACzC,WAAY,OACZ,QAAS,EACT,OAAQ,QAGV,4BACE,OAAQ,QACR,eAAe,KAGjB,gCACE,SAAU,SACV,IAxCsC,GAyCtC,KAzCsC,GA0CtC,QAAS,KACT,YAAa,OACb,gBAAiB,OACjB,WAAY,WACZ,MAzCoC,IA0CpC,OA1CoC,IA2CpC,MAAY,gBACZ,aAhD4C,IAiD5C,aAAc,MACd,aAAc,YACd,cAAe,IAEf,6FACE,MAAY,gBAKhB,+GADA,yGAGI,iBAAuB,gBAI3B,4BACE,iBA1EQ,QA2ER,MAAO,KAGT,wDACE,iBA/EQ,oBAkFV,0DAEI,aApFM,QAkFV,oDAMI,WAAY,MAAM,EAAE,EAAE,EA3EuB,IA2E2B,oCAI5E,sFACE,aAAmB,gBC7BrB,mCDkCI,QAAS,EAvFoB,SAuFc,EAAE,EAC7C,UAAW,gBACX,WAAY","file":"calendar-body.css","sourcesContent":["$primary: #106cc8 !default;\n$md2-calendar-body-font-size: 13px !default;\n$md2-calendar-body-header-font-size: 14px !default;\n$md2-calendar-body-label-padding-start: 5% !default;\n$md2-calendar-body-label-translation: -6px !default;\n$md2-calendar-body-cell-min-size: 32px !default;\n$md2-calendar-body-cell-size: 100% / 7 !default;\n$md2-calendar-body-cell-content-margin: 5% !default;\n$md2-calendar-body-cell-content-border-width: 1px !default;\n\n$md2-calendar-body-min-size: 7 * $md2-calendar-body-cell-min-size !default;\n$md2-calendar-body-cell-padding: $md2-calendar-body-cell-size / 2 !default;\n$md2-calendar-body-cell-content-size: 100% - $md2-calendar-body-cell-content-margin * 2 !default;\n$md2-datepicker-selected-today-box-shadow-width: 1px;\n\n.md2-calendar-body {\n font-size: $md2-calendar-body-font-size;\n min-width: $md2-calendar-body-min-size;\n}\n\n.md2-calendar-body-label {\n padding: $md2-calendar-body-cell-padding 0 $md2-calendar-body-cell-padding $md2-calendar-body-cell-padding;\n height: 0;\n line-height: 0;\n color: rgba(black, 0.54);\n transform: translateX($md2-calendar-body-label-translation);\n text-align: left;\n}\n\n.md2-calendar-body-cell {\n position: relative;\n width: $md2-calendar-body-cell-size;\n height: 0;\n line-height: 0;\n padding: $md2-calendar-body-cell-padding 0;\n text-align: center;\n outline: none;\n cursor: pointer;\n}\n\n.md2-calendar-body-disabled {\n cursor: default;\n pointer-events:none;\n}\n\n.md2-calendar-body-cell-content {\n position: absolute;\n top: $md2-calendar-body-cell-content-margin;\n left: $md2-calendar-body-cell-content-margin;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n width: $md2-calendar-body-cell-content-size;\n height: $md2-calendar-body-cell-content-size;\n color: rgba(black, 0.87);\n border-width: $md2-calendar-body-cell-content-border-width;\n border-style: solid;\n border-color: transparent;\n border-radius: 50%;\n\n .md2-calendar-body-disabled > &:not(.md2-calendar-body-selected) {\n color: rgba(black, 0.38);\n }\n}\n\n:not(.md2-calendar-body-disabled):hover,\n.md2-calendar:focus .md2-calendar-body-active {\n & > .md2-calendar-body-cell-content:not(.md2-calendar-body-selected) {\n background-color: rgba(black, 0.12);\n }\n}\n\n.md2-calendar-body-selected {\n background-color: $primary;\n color: white;\n}\n\n.md2-calendar-body-disabled > .md2-calendar-body-selected {\n background-color: rgba($primary, 0.4);\n}\n\n.md2-calendar-body-today {\n &:not(.md2-calendar-body-selected) {\n border-color: $primary;\n }\n\n &.md2-calendar-body-selected {\n box-shadow: inset 0 0 0 $md2-datepicker-selected-today-box-shadow-width md2-color($primary, default-contrast);\n }\n}\n\n.md2-calendar-body-disabled > .md2-calendar-body-today:not(.md2-calendar-body-selected) {\n border-color: rgba(black, 0.18);\n}\n\n[dir='rtl'] {\n .md2-calendar-body-label {\n padding: 0 $md2-calendar-body-cell-padding 0 0;\n transform: translateX(-$md2-calendar-body-label-translation);\n text-align: right;\n }\n}\n",null]} \ No newline at end of file diff --git a/datepicker/calendar-body.js b/datepicker/calendar-body.js index cf22cada6..74c0b6f0c 100644 --- a/datepicker/calendar-body.js +++ b/datepicker/calendar-body.js @@ -101,7 +101,7 @@ __decorate([ Md2CalendarBody = __decorate([ Component({selector: '[md2-calendar-body]', template: "{{label}}{{_firstRowOffset >= labelMinRequiredCells ? label : ''}}
{{item.displayValue}}
", - styles: [".md2-calendar-body{font-size:13px;min-width:224px}.md2-calendar-body-label{padding:7.14286% 0 7.14286% 7.14286%;height:0;line-height:0;color:rgba(0,0,0,.54);transform:translateX(-6px);text-align:left}.md2-calendar-body-cell{position:relative;width:14.28571%;height:0;line-height:0;padding:7.14286% 0;text-align:center;outline:0;cursor:pointer}.md2-calendar-body-disabled{cursor:default}.md2-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;color:rgba(0,0,0,.87);border-width:1px;border-style:solid;border-color:transparent;border-radius:50%}.md2-calendar-body-disabled>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){color:rgba(0,0,0,.38)}.md2-calendar:focus .md2-calendar-body-active>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected),:not(.md2-calendar-body-disabled):hover>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){background-color:rgba(0,0,0,.12)}.md2-calendar-body-selected{background-color:#106cc8;color:#fff}.md2-calendar-body-disabled>.md2-calendar-body-selected{background-color:rgba(16,108,200,.4)}.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:#106cc8}.md2-calendar-body-today.md2-calendar-body-selected{box-shadow:inset 0 0 0 1px md2-color(#106cc8,default-contrast)}.md2-calendar-body-disabled>.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:rgba(0,0,0,.18)}[dir=rtl] .md2-calendar-body-label{padding:0 7.14286% 0 0;transform:translateX(6px);text-align:right} /*# sourceMappingURL=calendar-body.css.map */ "], + styles: [".md2-calendar-body{font-size:13px;min-width:224px}.md2-calendar-body-label{padding:7.14286% 0 7.14286% 7.14286%;height:0;line-height:0;color:rgba(0,0,0,.54);transform:translateX(-6px);text-align:left}.md2-calendar-body-cell{position:relative;width:14.28571%;height:0;line-height:0;padding:7.14286% 0;text-align:center;outline:0;cursor:pointer}.md2-calendar-body-disabled{cursor:default;pointer-events:none}.md2-calendar-body-cell-content{position:absolute;top:5%;left:5%;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:90%;height:90%;color:rgba(0,0,0,.87);border-width:1px;border-style:solid;border-color:transparent;border-radius:50%}.md2-calendar-body-disabled>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){color:rgba(0,0,0,.38)}.md2-calendar:focus .md2-calendar-body-active>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected),:not(.md2-calendar-body-disabled):hover>.md2-calendar-body-cell-content:not(.md2-calendar-body-selected){background-color:rgba(0,0,0,.12)}.md2-calendar-body-selected{background-color:#106cc8;color:#fff}.md2-calendar-body-disabled>.md2-calendar-body-selected{background-color:rgba(16,108,200,.4)}.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:#106cc8}.md2-calendar-body-today.md2-calendar-body-selected{box-shadow:inset 0 0 0 1px md2-color(#106cc8,default-contrast)}.md2-calendar-body-disabled>.md2-calendar-body-today:not(.md2-calendar-body-selected){border-color:rgba(0,0,0,.18)}[dir=rtl] .md2-calendar-body-label{padding:0 7.14286% 0 0;transform:translateX(6px);text-align:right} /*# sourceMappingURL=calendar-body.css.map */ "], host: { 'class': 'md2-calendar-body', }, diff --git a/datepicker/calendar-body.scss b/datepicker/calendar-body.scss index 323333fc1..48eed692e 100644 --- a/datepicker/calendar-body.scss +++ b/datepicker/calendar-body.scss @@ -40,6 +40,7 @@ $md2-datepicker-selected-today-box-shadow-width: 1px; .md2-calendar-body-disabled { cursor: default; + pointer-events:none; } .md2-calendar-body-cell-content { diff --git a/package.json b/package.json index 7b1896075..e5d813916 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "md2", - "version": "0.0.26", + "version": "0.0.28", "description": "Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Chips(Tags), Collapse, Colorpicker, Data Table, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.", "main": "./md2.umd.js", "module": "./index.js",