author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
530,388
24.02.2017 15:32:46
-19,080
3e117deef9d6b91f2437864a3adb4ad3d62f5748
chore(multiselect) removed depricated multiselect component
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -51,7 +51,6 @@ export class AppModule { }\n- [md2-datepicker](https://github.com/Promact/md2/tree/master/src/lib/datepicker)\n- [md2-dialog](https://github.com/Promact/md2/tree/master/src/lib/dialog)\n- [md2-menu](https://github.com/Promact/md2/tree/master/src/lib/menu)\n-- [md2-multiselect](https://github.com/Promact/md2/tree/master/src/lib/multiselect)\n- [md2-select](https://github.com/Promact/md2/tree/master/src/lib/select)\n- [md2-tabs](https://github.com/Promact/md2/tree/master/src/lib/tabs)\n- [md2-tags](https://github.com/Promact/md2/tree/master/src/lib/tags)\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/demo-app-module.ts", "new_path": "src/demo-app/demo-app-module.ts", "diff": "@@ -15,7 +15,6 @@ import {DataTableDemo, DataTablePipe} from './data-table/data-table-demo';\nimport {DatepickerDemo} from './datepicker/datepicker-demo';\nimport {DialogDemo} from './dialog/dialog-demo';\nimport {MenuDemo} from './menu/menu-demo';\n-import {MultiselectDemo} from './multiselect/multiselect-demo';\nimport {SelectDemo} from './select/select-demo';\nimport {TabsDemo} from './tabs/tabs-demo';\nimport {TagsDemo} from './tags/tags-demo';\n@@ -44,7 +43,6 @@ import {TooltipDemo} from './tooltip/tooltip-demo';\nDatepickerDemo,\nDialogDemo,\nMenuDemo,\n- MultiselectDemo,\nSelectDemo,\nTabsDemo,\nTagsDemo,\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/demo-app/demo-app.ts", "new_path": "src/demo-app/demo-app/demo-app.ts", "diff": "@@ -32,7 +32,6 @@ export class DemoApp {\n{ name: 'Datepicker', route: 'datepicker' },\n{ name: 'Dialog', route: 'dialog' },\n{ name: 'Menu', route: 'menu' },\n- { name: 'Multiselect', route: 'multiselect' },\n{ name: 'Select', route: 'select' },\n{ name: 'Tabs', route: 'tabs' },\n{ name: 'Tags', route: 'tags' },\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/demo-app/routes.ts", "new_path": "src/demo-app/demo-app/routes.ts", "diff": "@@ -9,7 +9,6 @@ import { DataTableDemo } from '../data-table/data-table-demo';\nimport { DatepickerDemo } from '../datepicker/datepicker-demo';\nimport { DialogDemo } from '../dialog/dialog-demo';\nimport { MenuDemo } from '../menu/menu-demo';\n-import { MultiselectDemo } from '../multiselect/multiselect-demo';\nimport { SelectDemo } from '../select/select-demo';\nimport { TabsDemo } from '../tabs/tabs-demo';\nimport { TagsDemo } from '../tags/tags-demo';\n@@ -27,7 +26,6 @@ export const DEMO_APP_ROUTES: Routes = [\n{ path: 'datepicker', component: DatepickerDemo },\n{ path: 'dialog', component: DialogDemo },\n{ path: 'menu', component: MenuDemo },\n- { path: 'multiselect', component: MultiselectDemo },\n{ path: 'select', component: SelectDemo },\n{ path: 'tabs', component: TabsDemo },\n{ path: 'tags', component: TagsDemo },\n" }, { "change_type": "DELETE", "old_path": "src/demo-app/multiselect/multiselect-demo.html", "new_path": null, "diff": "-<div class=\"demo-multiselect\">\n- <h1>Multiselect Demo</h1>\n- <hr />\n- <h4>Basic Multiselect</h4>\n- <div>\n- <md2-multiselect [items]=\"items\"\n- [item-text]=\"'name'\"\n- [(ngModel)]=\"item\"\n- (change)=\"handleChange($event)\"\n- placeholder=\"Select City\">\n- </md2-multiselect>\n- </div>\n- <h4>Disabled Multiselect</h4>\n- <div>\n- <md2-multiselect [items]=\"items\"\n- [item-text]=\"'name'\"\n- [(ngModel)]=\"item\"\n- disabled\n- placeholder=\"Select City\">\n- </md2-multiselect>\n- </div>\n-</div>\n" }, { "change_type": "DELETE", "old_path": "src/demo-app/multiselect/multiselect-demo.ts", "new_path": null, "diff": "-import { Component } from '@angular/core';\n-\n-@Component({\n- moduleId: module.id,\n- selector: 'multiselect',\n- templateUrl: 'multiselect-demo.html'\n-})\n-export class MultiselectDemo {\n- items: Array<any> =\n- [\n- { name: 'Vadodara', value: '1', disabled: false },\n- { name: 'Rajkot', value: '2', disabled: false },\n- { name: 'Delhi', value: '3', disabled: false },\n- { name: 'Chennai', value: '4', disabled: true },\n- { name: 'Mumbai', value: '5', disabled: false },\n- { name: 'Goa', value: '6', disabled: true }\n- ];\n- item: Array<any> = [{ name: 'Birmingham', value: '2' }, { name: 'Dortmund', value: '3' }];\n- handleChange(value: any) {\n- console.log('Changed data: ', value);\n- }\n-}\n" }, { "change_type": "MODIFY", "old_path": "src/lib/index.ts", "new_path": "src/lib/index.ts", "diff": "@@ -10,7 +10,6 @@ export * from './data-table/index';\nexport * from './datepicker/index';\nexport * from './dialog/index';\nexport * from './menu/index';\n-export * from './multiselect/index';\nexport * from './select/index';\nexport * from './tabs/index';\nexport * from './tags/index';\n" }, { "change_type": "MODIFY", "old_path": "src/lib/module.ts", "new_path": "src/lib/module.ts", "diff": "@@ -20,7 +20,6 @@ import { Md2DataTableModule } from './data-table/index';\nimport { Md2DatepickerModule } from './datepicker/index';\nimport { Md2DialogModule } from './dialog/index';\nimport { Md2MenuModule } from './menu/index';\n-import { Md2MultiselectModule } from './multiselect/index';\nimport { Md2SelectModule } from './select/index';\nimport { Md2TabsModule } from './tabs/index';\nimport { Md2TagsModule } from './tags/index';\n@@ -39,7 +38,6 @@ const MD2_MODULES = [\nMd2DatepickerModule,\nMd2DialogModule,\nMd2MenuModule,\n- Md2MultiselectModule,\nMdRippleModule,\nMd2SelectModule,\nMd2TabsModule,\n@@ -67,7 +65,6 @@ const MD2_MODULES = [\nMd2DatepickerModule.forRoot(),\nMd2DialogModule.forRoot(),\nMd2MenuModule.forRoot(),\n- Md2MultiselectModule.forRoot(),\nMdRippleModule.forRoot(),\nMd2SelectModule.forRoot(),\nMd2TabsModule.forRoot(),\n" }, { "change_type": "DELETE", "old_path": "src/lib/multiselect/README.md", "new_path": null, "diff": "-# Md2Multiselect\n-Multiselect allow the user to select multiple options to the select option list.\n-\n-## `<md2-multiselect>`\n-### Properties\n-\n-| Name | Type | Description |\n-| --- | --- | --- |\n-| `items` | `Array<any>` | List of options |\n-| `item-text` | `string` | Map property for display text |\n-| `item-value` | `string` | Map property for return value, by default it returns whole object of selected options |\n-| `placeholder` | `string` | Hint label |\n-| `readonly` | `boolean` | Whether or not the multiselect is readonly |\n-| `required` | `boolean` | Whether or not the multiselect is required |\n-| `disabled` | `boolean` | Whether or not the multiselect is disabled |\n-\n-### Events\n-\n-| Name | Type | Description |\n-| --- | --- | --- |\n-| `change` | `Event` | Fired when changed options |\n-\n-### Examples\n-A multiselect would have the following markup.\n-```html\n-<md2-multiselect [items]=\"items\"\n- item-text=\"name\"\n- item-value=\"value\"\n- [(ngModel)]=\"item\"\n- (change)=\"selected($event)\"\n- placeholder=\"Placeholder Text\">\n-</md2-multiselect>\n-```\n" }, { "change_type": "DELETE", "old_path": "src/lib/multiselect/index.ts", "new_path": null, "diff": "-export * from './multiselect';\n" }, { "change_type": "DELETE", "old_path": "src/lib/multiselect/multiselect.html", "new_path": null, "diff": "-<div class=\"md2-multiselect-container\">\n- <span class=\"md2-multiselect-placeholder\" [class.has-value]=\"_items.length\">\n- {{placeholder}}\n- </span>\n- <div class=\"md2-multiselect-value\">\n- <div *ngFor=\"let v of _items; let last = last\" class=\"md2-multiselect-value-item\">\n- <span class=\"md2-multiselect-text\">{{v.text}}</span><span *ngIf=\"!last\">,&nbsp;</span>\n- </div>\n- </div>\n- <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n- <path d=\"M7 10l5 5 5-5z\" />\n- </svg>\n-</div>\n-<ul *ngIf=\"isMenuVisible\" class=\"md2-multiselect-menu\">\n- <li *ngFor=\"let l of _list; let i = index;\"\n- class=\"md2-option\"\n- [class.active]=\"_isActive(i)\"\n- [class.focus]=\"_focusedOption === i\"\n- (click)=\"_handleOptionClick($event, i)\">\n- <div class=\"md2-option-icon\"></div>\n- <div class=\"md2-option-text\" [innerHtml]=\"l.text\"></div>\n- </li>\n-</ul>\n" }, { "change_type": "DELETE", "old_path": "src/lib/multiselect/multiselect.scss", "new_path": null, "diff": "-\n-md2-multiselect {\n- position: relative;\n- display: block;\n- margin: 18px 0;\n- user-select: none;\n- backface-visibility: hidden;\n-}\n-\n-md2-multiselect:focus {\n- outline: none;\n-}\n-\n-md2-multiselect.md2-multiselect-disabled {\n- pointer-events: none;\n- cursor: default;\n-}\n-\n-md2-multiselect .md2-multiselect-container {\n- position: relative;\n- width: 100%;\n- min-width: 64px;\n- min-height: 30px;\n- align-items: center;\n- padding: 2px 2px 1px;\n- border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n- box-sizing: border-box;\n- cursor: pointer;\n-}\n-\n-md2-multiselect:focus .md2-multiselect-container {\n- padding-bottom: 0;\n- border-bottom: 2px solid #106cc8;\n-}\n-\n-md2-multiselect.md2-multiselect-disabled .md2-multiselect-container {\n- color: rgba(0, 0, 0, 0.38);\n- border-color: transparent;\n- background-image: linear-gradient(to right, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0.38) 33%, transparent 0%);\n- background-position: bottom -1px left 0;\n- background-size: 4px 1px;\n- background-repeat: repeat-x;\n- cursor: default;\n-}\n-\n-md2-multiselect.md2-multiselect-disabled:focus .md2-multiselect-container {\n- padding-bottom: 1px;\n- border-bottom: 1px solid transparent;\n-}\n-\n-md2-multiselect .md2-multiselect-placeholder {\n- position: absolute;\n- right: 26px;\n- bottom: 100%;\n- left: 0;\n- color: rgba(0, 0, 0, 0.38);\n- max-width: 100%;\n- padding-left: 3px;\n- padding-right: 0;\n- line-height: 1.4;\n- overflow: hidden;\n- text-overflow: ellipsis;\n- white-space: nowrap;\n- pointer-events: none;\n- z-index: 1;\n- transform: translate3d(0, 26px, 0) scale(1);\n- transition: transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\n- transform-origin: left top;\n-}\n-\n-md2-multiselect:focus .md2-multiselect-placeholder {\n- color: #2196f3;\n-}\n-\n-md2-multiselect:focus .md2-multiselect-placeholder,\n-md2-multiselect .md2-multiselect-placeholder.has-value {\n- transform: translate3d(0, 6px, 0) scale(0.75);\n-}\n-\n-md2-multiselect.md2-multiselect-disabled:focus .md2-multiselect-placeholder {\n- color: rgba(0, 0, 0, 0.38);\n-}\n-\n-md2-multiselect .md2-multiselect-container .md2-multiselect-value {\n- display: block;\n- max-height: 80px;\n- padding-right: 26px;\n- overflow-y: auto;\n- font-size: 15px;\n- line-height: 26px;\n-}\n-\n-md2-multiselect .md2-multiselect-container .md2-multiselect-value-item {\n- word-wrap: break-word;\n-}\n-\n-md2-multiselect .md2-multiselect-container svg {\n- position: absolute;\n- right: 0;\n- top: 0;\n- display: block;\n- height: 100%;\n- background: #fff;\n- fill: currentColor;\n- color: rgba(0, 0, 0, 0.54);\n-}\n-\n-md2-multiselect .md2-multiselect-menu {\n- position: absolute;\n- left: 0;\n- top: 0;\n- display: block;\n- z-index: 10;\n- width: 100%;\n- margin: 0;\n- padding: 8px 0;\n- box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 2px 1px -1px rgba(0, 0, 0, 0.12);\n- max-height: 256px;\n- min-height: 48px;\n- overflow-y: auto;\n- transform: scale(1);\n- background: #fff;\n-}\n-\n-md2-multiselect .md2-multiselect-menu .md2-option {\n- position: relative;\n- display: block;\n- cursor: pointer;\n- width: auto;\n- transition: background 150ms linear;\n- padding: 0 16px 0 40px;\n- height: 48px;\n- line-height: 48px;\n-}\n-\n-md2-multiselect .md2-multiselect-menu .md2-option.active {\n- color: #106cc8;\n-}\n-\n-md2-multiselect .md2-multiselect-menu .md2-option:hover,\n-md2-multiselect .md2-multiselect-menu .md2-option.focus {\n- background: #eeeeee;\n-}\n-\n-md2-multiselect .md2-multiselect-menu .md2-option .md2-option-text {\n- width: auto;\n- white-space: nowrap;\n- overflow: hidden;\n- text-overflow: ellipsis;\n- font-size: 16px;\n-}\n-\n-md2-multiselect .md2-option .md2-option-icon {\n- position: absolute;\n- top: 14px;\n- left: 12px;\n- width: 16px;\n- height: 16px;\n- border: 2px solid rgba(0, 0, 0, 0.54);\n- border-radius: 2px;\n- box-sizing: border-box;\n- transition: 240ms;\n-}\n-\n-md2-multiselect .md2-option.active .md2-option-icon {\n- transform: rotate(-45deg);\n- height: 8px;\n- top: 17px;\n- border-color: #106cc8;\n- border-top-style: none;\n- border-right-style: none;\n-}\n" }, { "change_type": "DELETE", "old_path": "src/lib/multiselect/multiselect.ts", "new_path": null, "diff": "-import {\n- AfterContentInit,\n- Component,\n- ElementRef,\n- EventEmitter,\n- forwardRef,\n- HostListener,\n- Input,\n- Output,\n- ViewEncapsulation,\n- NgModule,\n- ModuleWithProviders\n-} from '@angular/core';\n-import {\n- NG_VALUE_ACCESSOR,\n- ControlValueAccessor,\n- FormsModule,\n-} from '@angular/forms';\n-import { CommonModule } from '@angular/common';\n-import {\n- coerceBooleanProperty,\n- ENTER,\n- SPACE,\n- TAB,\n- ESCAPE,\n- DOWN_ARROW,\n- UP_ARROW\n-} from '../core/core';\n-\n-export class Option {\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-\n-const noop = () => { };\n-\n-let nextId = 0;\n-\n-export const MD2_MULTISELECT_CONTROL_VALUE_ACCESSOR: any = {\n- provide: NG_VALUE_ACCESSOR,\n- useExisting: forwardRef(() => Md2Multiselect),\n- multi: true\n-};\n-\n-@Component({\n- moduleId: module.id,\n- selector: 'md2-multiselect',\n- templateUrl: 'multiselect.html',\n- styleUrls: ['multiselect.css'],\n- providers: [MD2_MULTISELECT_CONTROL_VALUE_ACCESSOR],\n- host: {\n- 'role': 'select',\n- '[id]': 'id',\n- '[class.md2-multiselect-disabled]': 'disabled',\n- '[tabindex]': 'disabled ? -1 : tabindex',\n- '[attr.aria-disabled]': 'disabled'\n- },\n- encapsulation: ViewEncapsulation.None\n-})\n-\n-export class Md2Multiselect implements AfterContentInit, ControlValueAccessor {\n-\n- constructor(private element: ElementRef) { }\n-\n- ngAfterContentInit() { this._isInitialized = true; }\n-\n- @Output() change: EventEmitter<any> = new EventEmitter<any>();\n-\n- private _value: any = '';\n- private _readonly: boolean;\n- private _disabled: boolean;\n- private _isInitialized: boolean;\n- private _onTouchedCallback: () => void = noop;\n- private _onChangeCallback: (_: any) => void = noop;\n-\n- private _options: Array<any> = [];\n- _list: Array<Option> = [];\n- _items: Array<Option> = [];\n-\n- _focusedOption: number = 0;\n- private isFocused: boolean = false;\n-\n- @Input() id: string = 'md2-multiselect-' + (++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-\n- @Input()\n- get readonly(): boolean { return this._readonly; }\n- set readonly(value) { this._readonly = coerceBooleanProperty(value); }\n-\n- @Input()\n- get disabled(): boolean { return this._disabled; }\n- set disabled(value) { this._disabled = coerceBooleanProperty(value); }\n-\n- @Input('items')\n- set options(value: Array<any>) { this._options = value; }\n-\n- @Input()\n- get value(): any { return this._value; }\n- set value(value: any) { this.setValue(value); }\n-\n- /**\n- * set value\n- * @param value\n- */\n- private setValue(value: any) {\n- if (value !== this._value) {\n- this._value = value;\n- this._items = [];\n- if (value && value.length && typeof value === 'object' && Array.isArray(value)) {\n- for (let i = 0; i < value.length; i++) {\n- let selItm = this._options.find((itm: any) => this.equals(this.valueKey ?\n- itm[this.valueKey] : itm, value[i]));\n- if (selItm) { this._items.push(new Option(selItm, this.textKey, this.valueKey)); }\n- }\n- }\n- if (this._isInitialized) {\n- this._onChangeCallback(value);\n- this.change.emit(this._value);\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.isFocused && this._list && this._list.length) && !this.readonly ? true : false;\n- }\n-\n- /**\n- * to update scroll of options\n- */\n- private updateScroll() {\n- if (this._focusedOption < 0) { return; }\n- let menuContainer = this.element.nativeElement.querySelector('.md2-multiselect-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- @HostListener('click', ['$event'])\n- _handleClick(event: MouseEvent) {\n- if (this.disabled) {\n- event.stopPropagation();\n- event.preventDefault();\n- return;\n- }\n- this.updateOptions();\n- this.element.nativeElement.focus();\n- }\n-\n- @HostListener('keydown', ['$event'])\n- _handleKeydown(event: KeyboardEvent) {\n- if (this.disabled) { return; }\n-\n- if (this.isMenuVisible) {\n- event.preventDefault();\n- event.stopPropagation();\n-\n- switch (event.keyCode) {\n- case TAB:\n- case ESCAPE: this._onBlur(); break;\n- case ENTER:\n- case SPACE: this._handleOptionClick(event, this._focusedOption); break;\n-\n- case DOWN_ARROW:\n- this._focusedOption = (this._focusedOption === this._list.length - 1) ?\n- 0 : Math.min(this._focusedOption + 1, this._list.length - 1);\n- this.updateScroll();\n- break;\n- case UP_ARROW:\n- this._focusedOption = (this._focusedOption === 0) ?\n- this._list.length - 1 : Math.max(0, this._focusedOption - 1);\n- this.updateScroll();\n- break;\n- }\n- } else {\n- switch (event.keyCode) {\n- case ENTER:\n- case SPACE:\n- case DOWN_ARROW:\n- case UP_ARROW:\n- event.preventDefault();\n- event.stopPropagation();\n- this.updateOptions();\n- break;\n- }\n- }\n- }\n-\n- /**\n- * on focus current component\n- */\n- private onFocus() {\n- this.isFocused = true;\n- this._focusedOption = 0;\n- }\n-\n- @HostListener('blur')\n- _onBlur() { this.isFocused = false; }\n-\n- /**\n- * to check current option is active or not\n- * @param index\n- * @return boolean the item is active or not\n- */\n- _isActive(index: number): boolean {\n- return this._items.map(i => i.text).indexOf(this._list[index].text) < 0 ? false : true;\n- }\n-\n- /**\n- * to toggle option to select/deselect option\n- * @param event\n- * @param index\n- */\n- _handleOptionClick(event: Event, index: number) {\n- event.preventDefault();\n- event.stopPropagation();\n-\n- let ind = this._items.map(i => i.text).indexOf(this._list[index].text);\n- if (ind < 0) {\n- this._items.push(this._list[index]);\n- this._items = this._items.sort((a, b) => {\n- return this._list.findIndex((i: any) =>\n- i.text === a.text) - this._list.findIndex((i: any) => i.text === b.text);\n- });\n- } else {\n- this._items.splice(ind, 1);\n- }\n-\n- this._value = new Array<any>();\n- for (let i = 0; i < this._items.length; i++) {\n- this._value.push(this._items[i].value);\n- }\n- this._onChangeCallback(this._value);\n- this.change.emit(this._value);\n- }\n-\n- /**\n- * update options\n- */\n- private updateOptions() {\n- this._list = this._options.map((item: any) => new Option(item, this.textKey, this.valueKey));\n- if (this._list.length > 0) {\n- this.onFocus();\n- }\n- }\n-\n- /**\n- * Implemented as part of ControlValueAccessor.\n- * TODO: internal\n- */\n- writeValue(value: any) {\n- if (value !== this._value) {\n- this._value = value;\n- this._items = [];\n- if (value && value.length && typeof value === 'object' && Array.isArray(value)) {\n- for (let i = 0; i < value.length; i++) {\n- let selItm = this._options.find((itm: any) =>\n- this.equals(this.valueKey ? itm[this.valueKey] : itm, value[i]));\n- if (selItm) { this._items.push(new Option(selItm, this.textKey, this.valueKey)); }\n- }\n- }\n- }\n- }\n-\n- /**\n- * Implemented as part of ControlValueAccessor.\n- * TODO: internal\n- */\n- registerOnChange(fn: any) { this._onChangeCallback = fn; }\n-\n- /**\n- * Implemented as part of ControlValueAccessor.\n- * TODO: internal\n- */\n- registerOnTouched(fn: any) { this._onTouchedCallback = fn; }\n-}\n-\n-export const MD2_MULTISELECT_DIRECTIVES = [Md2Multiselect];\n-\n-@NgModule({\n- imports: [CommonModule, FormsModule],\n- exports: MD2_MULTISELECT_DIRECTIVES,\n- declarations: MD2_MULTISELECT_DIRECTIVES,\n-})\n-export class Md2MultiselectModule {\n- static forRoot(): ModuleWithProviders {\n- return {\n- ngModule: Md2MultiselectModule,\n- providers: []\n- };\n- }\n-}\n" } ]
TypeScript
MIT License
promact/md2
chore(multiselect) removed depricated multiselect component
530,396
24.02.2017 16:16:27
-19,080
70bdc985bfdc226880c61438200691f69429d02a
Fix(chips) data binding issue of autocomplete in chips
[ { "change_type": "MODIFY", "old_path": "src/lib/chips/chips.html", "new_path": "src/lib/chips/chips.html", "diff": "-<div class=\"md2-chips-container\" [class.md2-chip-disabled]=\"readonly\">\n+<div class=\"md2-chips-container\" [class.md2-chip-disabled]=\"readonly\" [class.md2-chip-remove]=\"!isRemovable\">\n<span *ngFor=\"let chip of chipItemList; let i = index\" class=\"md2-chip\" [class.active]=\"selectedChip === i\">\n<span *ngIf=\"isObject\">{{chip.text}}</span>\n<span *ngIf=\"!isObject\">{{chip}}</span>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/chips/chips.scss", "new_path": "src/lib/chips/chips.scss", "diff": "-.template-content {\n- display: inline;\n-}\n+.template-content { display: inline; }\n-md2-chips {\n- outline: none;\n+md2-chips { outline: none;\n- .md2-chips-container {\n- display: block;\n- box-shadow: 0 1px #ccc;\n- padding: 5px 0;\n- margin-bottom: 10px;\n- min-height: 50px;\n- box-sizing: border-box;\n- clear: both;\n- }\n+ .md2-chips-container { display: block; box-shadow: 0 1px #ccc; padding: 5px 0; margin-bottom: 10px; min-height: 50px; box-sizing: border-box; clear: both; }\n- .md2-chips-container::after {\n- clear: both;\n- content: '';\n- display: table;\n- }\n+ .md2-chips-container::after { clear: both; content: ''; display: table; }\n- &.chip-input-focus .md2-chips-container {\n- box-shadow: 0 2px #0d8bff;\n- }\n+ &.chip-input-focus .md2-chips-container { box-shadow: 0 2px #0d8bff; }\n- .md2-chip-disabled {\n- cursor: default;\n- }\n+ .md2-chip-disabled { cursor: default; }\n- md2-autocomplete {\n- margin: 0;\n- }\n+ md2-autocomplete { margin: 0; }\n- .md2-autocomplete-wrap {\n- border-bottom: 0 !important;\n+ .md2-autocomplete-wrap { border-bottom: 0 !important; }\n}\n+.md2-chip-remove {\n+ .md2-chip { padding: 0 12px; }\n}\n+.md2-chip { font-size: 14px; position: relative; cursor: default; border-radius: 16px; display: block; height: 32px; line-height: 32px; margin: 8px 8px 0 0; padding: 0 28px 0 12px; float: left; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; max-width: 100%; background: rgb(224, 224, 224); color: rgb(66, 66, 66); white-space: nowrap; overflow: hidden; -ms-text-overflow: ellipsis; -o-text-overflow: ellipsis; text-overflow: ellipsis;\n-.md2-chip {\n- font-size: 14px;\n- position: relative;\n- cursor: default;\n- border-radius: 16px;\n- display: block;\n- height: 32px;\n- line-height: 32px;\n- margin: 8px 8px 0 0;\n- padding: 0 28px 0 12px;\n- float: left;\n- -moz-box-sizing: border-box;\n- -webkit-box-sizing: border-box;\n- box-sizing: border-box;\n- max-width: 100%;\n- background: rgb(224, 224, 224);\n- color: rgb(66, 66, 66);\n- white-space: nowrap;\n- overflow: hidden;\n- -ms-text-overflow: ellipsis;\n- -o-text-overflow: ellipsis;\n- text-overflow: ellipsis;\n-\n- &.active {\n- color: white;\n- background: #0d8bff;\n-\n- svg {\n- color: rgba(white, 0.87);\n- }\n- }\n+ &.active { color: white; background: #0d8bff;\n- svg {\n- position: absolute;\n- top: 4px;\n- right: 4px;\n- cursor: pointer;\n- display: inline-block;\n- overflow: hidden;\n- fill: currentColor;\n- color: rgba(black, 0.54);\n- }\n+ svg { color: rgba(white, 0.87); }\n}\n-.md2-template {\n- display: none;\n+ svg { position: absolute; top: 4px; right: 4px; cursor: pointer; display: inline-block; overflow: hidden; fill: currentColor; color: rgba(black, 0.54); }\n}\n-.chip-input-disabled {\n- pointer-events: none;\n- cursor: default;\n-}\n+.md2-template { display: none; }\n-.chip-input-form {\n- display: inline-block;\n- height: 32px;\n- margin: 8px 8px 0 0;\n-}\n+.chip-input-disabled { pointer-events: none; cursor: default; }\n-.chip-remove {\n- cursor: pointer;\n- display: inline-block;\n- padding: 0 3px;\n- color: #616161;\n- font-size: 30px;\n- vertical-align: top;\n- line-height: 21px;\n- font-family: serif;\n-}\n+.chip-input-form { display: inline-block; height: 32px; margin: 8px 8px 0 0; }\n-.chip-input {\n- display: inline-block;\n- width: auto;\n- border: 0;\n- outline: none;\n- height: 32px;\n- line-height: 32px;\n- font-size: 16px;\n-}\n+.chip-remove { cursor: pointer; display: inline-block; padding: 0 3px; color: #616161; font-size: 30px; vertical-align: top; line-height: 21px; font-family: serif; }\n-.chip-error {\n- font-size: 13px;\n- color: #fd0f0f;\n-}\n+.chip-input { display: inline-block; width: auto; border: 0; outline: none; height: 32px; line-height: 32px; font-size: 16px; }\n+\n+.chip-error { font-size: 13px; color: #fd0f0f; }\n.md2-chips-container {\n- .chip-input-form .md2-autocomplete-wrap {\n- border-bottom: 0;\n- }\n+ .chip-input-form .md2-autocomplete-wrap { border-bottom: 0; }\n.md2-autocomplete-wrap {\n- &.is-focused .md2-autocomplete-placeholder {\n- display: none;\n- }\n+ &.is-focused .md2-autocomplete-placeholder { display: none; }\n- .md2-autocomplete-placeholder.has-value {\n- display: none;\n- }\n+ .md2-autocomplete-placeholder.has-value { display: none; }\n- svg {\n- display: none;\n- }\n+ svg { display: none; }\n- .md2-autocomplete-input {\n- height: 32px;\n- font-size: 16px;\n- }\n+ .md2-autocomplete-input { height: 32px; font-size: 16px; }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/lib/chips/chips.ts", "new_path": "src/lib/chips/chips.ts", "diff": "@@ -80,8 +80,9 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\n@Input() maxChips: number = 10000;\n@Input() id: string = 'md2-chips-' + (++nextId);\n@Input('autocomplete-item-text') autocompleteItemText: string = 'text';\n+ @Input('autocomplete-item-value') autocompleteItemValue: string = 'value';\n@Input('item-text') textKey: string = 'text';\n- @Input('item-value') valueKey: string = null;\n+ @Input('item-value') valueKey: string = 'value';\n@Output() change: EventEmitter<any> = new EventEmitter<any>();\n@ViewChild('chipInputForm') chipInputForm: NgForm;\n@@ -138,7 +139,7 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\nchangeAutocomplete(value: any) {\nif (value) {\n- let objText = value[this.autocompleteItemText];\n+ let objText = value.value;\nthis.addNewChip(objText);\nthis.item = null;\n}\n@@ -274,7 +275,7 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\nif (chipString) {\nlet isExist: any;\nif (this.isObject) {\n- isExist = this.chipItemList.filter((chip) => chip.text === chipString);\n+ isExist = this.chipItemList.filter((chip) => chip.text === chipString.text);\nreturn isExist.length ? false : true;\n} else if (this.chipItemList.indexOf(chipString) === -1) {\nreturn this.allowedPattern.test(chipString);\n@@ -292,7 +293,8 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\nif (this.chipItemList.length < this.maxChips) {\nif (this.isObject && this.chipItemList.length > 0) {\nlet a: any = {};\n- a[this.textKey] = chips;\n+ a[this.textKey] = chips[this.autocompleteItemText];\n+ a[this.valueKey] = chips[this.autocompleteItemValue];\nthis.chipItemList.push(new Chip(a, this.textKey, this.valueKey));\n} else {\nthis.chipItemList.push(chips);\n@@ -347,12 +349,13 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\nprivate updateValue() {\nthis._value = new Array<any>();\nfor (let i = 0; i < this.chipItemList.length; i++) {\n- if (this.isObject) {\n- this._value.push(this.chipItemList[i].value);\n- } else {\n+ //if (this.isObject) {\n+ // this._value.push(this.chipItemList[i].value);\n+ //} else {\n+ // this._value.push(this.chipItemList[i]);\n+ //}\nthis._value.push(this.chipItemList[i]);\n}\n- }\nthis.onChangeCallback(this._value);\nthis.change.emit(this._value);\n}\n" } ]
TypeScript
MIT License
promact/md2
Fix(chips) data binding issue of autocomplete in chips
530,396
24.02.2017 17:14:26
-19,080
e553c0ba633eb99389840b7438f25e2e2f3515f9
Fix(Chips) placeholder text
[ { "change_type": "MODIFY", "old_path": "src/demo-app/chips/chips-demo.html", "new_path": "src/demo-app/chips/chips-demo.html", "diff": "<h4>Basic Chips</h4>\n<div>\n<md2-chips [(ngModel)]=\"_item\"\n- placeholder=\"Add\"\n+ [placeholder]=\"Add\"\n[maxChips]=\"8\"\n[isRemovable]=\"true\"\n[readonly]=\"false\"\n" }, { "change_type": "MODIFY", "old_path": "src/lib/chips/README.md", "new_path": "src/lib/chips/README.md", "diff": "@@ -28,7 +28,7 @@ A chips would have the following markup.\n[minChips]=\"2\"\n[maxChips]=\"5\"\n(change)=\"selected($event)\"\n- [placeholder]=\"Add\"\n+ placeholder=\"Add\"\n[allowedPattern]=\"onlyTextPattern\"\n[isAutoComplete]=\"true\"\n[autocompleteDataList]=\"itemList\"\n" } ]
TypeScript
MIT License
promact/md2
Fix(Chips) placeholder text
530,388
25.02.2017 14:21:25
-19,080
a60397725c55ab3272fd8b2c4b35419618108e41
core: update docs
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "# MD2\n-Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Collapse, Colorpicker, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.\n+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.\n+[![npm version](https://badge.fury.io/js/md2.svg)](https://www.npmjs.com/package/md2)\n[![Build Status](https://travis-ci.org/Promact/md2.svg?branch=master)](https://travis-ci.org/Promact/md2)\n-## Quick start\n+### Installation\n-1. A recommended way to install ***md2*** is through [npm](https://www.npmjs.com/package/md2) package manager using the following command:\n+The latest release of MD2 can be installed from npm\n- `npm install md2 --save`\n+`npm install --save md2`\n+\n+Playing with the latest changes from [master](https://github.com/Promact/md2/tree/master) is also possible\n+\n+`npm install --save https://github.com/Promact/md2.git`\n+\n+### Getting started\n+\n+Setup `MD2` in your project\n-2. Setup `MD2` in your project\n```ts\n// system.config.js\n// ================\n{\nmap: {\n- 'md2': 'md2/bundles/md2.umd.js'\n+ 'md2': 'node_modules/md2/bundles/md2.umd.js'\n}\n}\n@@ -36,7 +44,8 @@ export class AppModule { }\n```\n-3. More information regarding of using ***md2*** is located in\n+### Demo\n+\n[demo](http://code.promactinfo.com/md2) and [demo sources](https://github.com/Promact/md2/tree/master/src/demo-app).\n@@ -56,3 +65,27 @@ export class AppModule { }\n- [md2-tags](https://github.com/Promact/md2/tree/master/src/lib/tags)\n- [md2-toast](https://github.com/Promact/md2/tree/master/src/lib/toast)\n- [md2-tooltip](https://github.com/Promact/md2/tree/master/src/lib/tooltip)\n+\n+\n+## The goal of MD2\n+Our goal is to build a set of high-quality UI components built with Angular and TypeScript,\n+following the Material Design spec. These\n+components will serve as an example of how to write Angular code following best practices.\n+\n+### What do we mean by \"high-quality\"?\n+* Internationalized and accessible so that all users can use them.\n+* Straightforward APIs that don't confuse developers.\n+* Behave as expected across a wide variety of use-cases without bugs.\n+* Behavior is well-tested with both unit and integration tests.\n+* Customizable within the bounds of the Material Design specification.\n+* Performance cost is minimized.\n+* Code is clean and well-documented to serve as an example for Angular devs.\n+\n+## Browser and screen reader support\n+MD2 supports the most recent two versions of all major browsers:\n+Chrome (including Android), Firefox, Safari (including iOS), and IE11 / Edge\n+\n+We also aim for great user experience with the following screen readers:\n+* NVDA and JAWS with IE / FF / Chrome (on Windows).\n+* VoiceOver with Safari on iOS and Safari / Chrome on OSX.\n+* TalkBack with Chrome on Android.\n" }, { "change_type": "MODIFY", "old_path": "package.json", "new_path": "package.json", "diff": "{\n\"name\": \"md2\",\n\"version\": \"0.0.15\",\n- \"description\": \"Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Collapse, Colorpicker, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.\",\n+ \"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.\",\n\"author\": \"Dharmesh Pipariya <[email protected]>\",\n\"homepage\": \"https://github.com/Promact/md2\",\n\"bugs\": \"https://github.com/Promact/md2/issues\",\n\"autocomplete\",\n\"collapse\",\n\"colorpicker\",\n+ \"data-table\",\n\"datepicker\",\n\"dialog\",\n\"modal\",\n" }, { "change_type": "MODIFY", "old_path": "src/lib/package.json", "new_path": "src/lib/package.json", "diff": "{\n\"name\": \"md2\",\n\"version\": \"0.0.15\",\n- \"description\": \"Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Collapse, Colorpicker, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.\",\n+ \"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.\",\n\"main\": \"./md2.umd.js\",\n\"module\": \"./index.js\",\n\"typings\": \"./index.d.ts\",\n\"autocomplete\",\n\"collapse\",\n\"colorpicker\",\n+ \"data-table\",\n\"datepicker\",\n\"dialog\",\n\"modal\",\n" } ]
TypeScript
MIT License
promact/md2
core: update docs
530,388
26.02.2017 18:34:36
-19,080
59cb08fd2d5d27305586e550f3171954be264ed3
chore(datepicker) fixed type update issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -71,6 +71,8 @@ export interface IWeek {\nlet nextId = 0;\n+export type Type = 'date' | 'time' | 'datetime';\n+\n@Component({\nmoduleId: module.id,\nselector: 'md2-datepicker',\n@@ -107,6 +109,7 @@ export class Md2Datepicker implements AfterContentInit, OnDestroy, ControlValueA\nprivate _panelOpen = false;\nprivate _openOnFocus: boolean = false;\n+ private _type: Type = 'date';\nprivate _format: string;\nprivate _required: boolean = false;\nprivate _disabled: boolean = false;\n@@ -166,7 +169,6 @@ export class Md2Datepicker implements AfterContentInit, OnDestroy, ControlValueA\nngOnDestroy() { this.destroyPanel(); }\n- @Input() type: 'date' | 'time' | 'datetime' = 'date';\n@Input() name: string = '';\n@Input() id: string = 'md2-datepicker-' + (++nextId);\n@Input() placeholder: string;\n@@ -218,6 +220,13 @@ export class Md2Datepicker implements AfterContentInit, OnDestroy, ControlValueA\n}\n}\n+ @Input()\n+ get type() { return this._type; }\n+ set type(value: Type) {\n+ this._type = value || 'date';\n+ this._viewValue = this._formatDate(this._value);\n+ }\n+\n@Input()\nget selected() { return this._selected; }\nset selected(value: Date) { this._selected = value; }\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) fixed type update issue
530,388
27.02.2017 08:18:14
-19,080
7a50267f0b5c1e5dc5929e92f14a31aace18c5bd
fix(datepicker) type change update popup issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "import {\n- AfterContentInit,\nComponent,\nElementRef,\nHostListener,\n@@ -97,7 +96,7 @@ export type Type = 'date' | 'time' | 'datetime';\n],\nencapsulation: ViewEncapsulation.None\n})\n-export class Md2Datepicker implements AfterContentInit, OnDestroy, ControlValueAccessor {\n+export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nprivate _overlayRef: OverlayRef;\nprivate _backdropSubscription: Subscription;\n@@ -113,7 +112,6 @@ export class Md2Datepicker implements AfterContentInit, OnDestroy, ControlValueA\nprivate _format: string;\nprivate _required: boolean = false;\nprivate _disabled: boolean = false;\n- private _isInitialized: boolean = false;\nprivate today: Date = new Date();\n_viewValue: string = '';\n@@ -162,11 +160,6 @@ export class Md2Datepicker implements AfterContentInit, OnDestroy, ControlValueA\nthis.getYears();\n}\n- ngAfterContentInit() {\n- this._isInitialized = true;\n- this._isCalendarVisible = this.type !== 'time' ? true : false;\n- }\n-\nngOnDestroy() { this.destroyPanel(); }\n@Input() name: string = '';\n@@ -291,6 +284,7 @@ export class Md2Datepicker implements AfterContentInit, OnDestroy, ControlValueA\n/** Opens the overlay panel. */\nopen(): void {\nif (this.disabled) { return; }\n+ this._isCalendarVisible = this.type !== 'time' ? true : false;\nthis._createOverlay();\nthis._overlayRef.attach(this.templatePortals.first);\nthis._subscribeToBackdrop();\n" } ]
TypeScript
MIT License
promact/md2
fix(datepicker) type change update popup issue
530,388
27.02.2017 15:35:42
-19,080
929c369906ad3545ef378a088a5a72ace0ca36da
chore(tooltip) added support for html bindings
[ { "change_type": "MODIFY", "old_path": "src/lib/tooltip/tooltip.html", "new_path": "src/lib/tooltip/tooltip.html", "diff": "<div class=\"md2-tooltip\"\n[style.transform-origin]=\"_transformOrigin\"\n[@state]=\"_visibility\"\n- (@state.done)=\"_afterVisibilityAnimation($event)\">\n- {{message}}\n+ (@state.done)=\"_afterVisibilityAnimation($event)\"\n+ [innerHTML]=\"message\">\n</div>\n\\ No newline at end of file\n" } ]
TypeScript
MIT License
promact/md2
chore(tooltip) added support for html bindings
530,388
27.02.2017 15:38:02
-19,080
875d50eb066178f93caee404bd0478bffd69cfe0
chore(datepicker) update date format with filter
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "</div>\n<div class=\"md2-datepicker-input\">\n<span class=\"md2-datepicker-placeholder\" [class.has-value]=\"value\"> {{ placeholder }} </span>\n- <span class=\"md2-datepicker-input-text\">{{ _viewValue }}</span>\n+ <span class=\"md2-datepicker-input-text\">{{ value | date:format }}</span>\n<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n<path d=\"M7 10l5 5 5-5z\" />\n</svg>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -114,7 +114,6 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nprivate _disabled: boolean = false;\nprivate today: Date = new Date();\n- _viewValue: string = '';\nprivate _min: Date = null;\nprivate _max: Date = null;\n@@ -184,7 +183,6 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis._value = new Date(value);\n}\n}\n- this._viewValue = this._formatDate(this._value);\n}\nthis.date = this._value;\n}\n@@ -217,7 +215,6 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nget type() { return this._type; }\nset type(value: Type) {\nthis._type = value || 'date';\n- this._viewValue = this._formatDate(this._value);\n}\n@Input()\n@@ -231,12 +228,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n'dd/MM/y HH:mm' : 'dd/MM/y');\n}\nset format(value: string) {\n- if (this._format !== value) {\n- this._format = value;\n- if (this._viewValue && this._value) {\n- this._viewValue = this._formatDate(this._value);\n- }\n- }\n+ if (this._format !== value) { this._format = value; }\n}\n@Input()\n@@ -761,29 +753,6 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis.close();\n}\n- /**\n- * format date\n- * @param date Date Object\n- * @return string with formatted date\n- */\n- private _formatDate(date: Date): string {\n- return this.format\n- .replace('yy', ('00' + date.getFullYear()).slice(-2))\n- .replace('y', '' + date.getFullYear())\n- .replace('MMMM', this._locale.months[date.getMonth()].full)\n- .replace('MMM', this._locale.months[date.getMonth()].short)\n- .replace('MM', ('0' + (date.getMonth() + 1)).slice(-2))\n- .replace('M', '' + (date.getMonth() + 1))\n- .replace('dd', ('0' + date.getDate()).slice(-2))\n- .replace('d', '' + date.getDate())\n- .replace('HH', ('0' + date.getHours()).slice(-2))\n- .replace('H', '' + date.getHours())\n- .replace('mm', ('0' + date.getMinutes()).slice(-2))\n- .replace('m', '' + date.getMinutes())\n- .replace('ss', ('0' + date.getSeconds()).slice(-2))\n- .replace('s', '' + date.getSeconds());\n- }\n-\n/** Emits an event when the user selects a date. */\n_emitChangeEvent(): void {\nthis._onChange(this.value);\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update date format with filter
530,388
27.02.2017 16:18:12
-19,080
d83c6ecc9fb54c47f48a01071cf8394536ece2cd
chore(datepicker) updated binding reflection issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -202,13 +202,13 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nget time() { return this.date.getHours() + ':' + this.date.getMinutes(); }\nset time(value: string) {\n- //this.date = new Date(this.date.getFullYear(), this.date.getMonth(), this.date.getDate(),\n- // parseInt(value.split(':')[0]), parseInt(value.split(':')[1]));\n- if (this._clockView === 'hour') {\n- this.date.setHours(parseInt(value.split(':')[0]));\n- } else {\n- this.date.setMinutes(parseInt(value.split(':')[1]));\n- }\n+ this.date = new Date(this.date.getFullYear(), this.date.getMonth(), this.date.getDate(),\n+ parseInt(value.split(':')[0]), parseInt(value.split(':')[1]));\n+ //if (this._clockView === 'hour') {\n+ // this.date.setHours(parseInt(value.split(':')[0]));\n+ //} else {\n+ // this.date.setMinutes(parseInt(value.split(':')[1]));\n+ //}\n}\n@Input()\n@@ -340,6 +340,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nprivate coerceDateProperty(value: any, fallbackValue = new Date()): Date {\nlet timestamp = Date.parse(value);\n+ fallbackValue = null;\nreturn isNaN(timestamp) ? fallbackValue : new Date(timestamp);\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) updated binding reflection issue
530,388
27.02.2017 19:48:58
-19,080
68666c5033aecf6c69ecdae9cdf1d6f46a55b1d8
fix(datepicker) open on focus issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -284,13 +284,16 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis.selected = this.value || new Date(1, 0, 1);\nthis.date = this.value || this.today;\nthis.generateCalendar();\n- this._element.nativeElement.focus();\n}\n/** Closes the overlay panel and focuses the host element. */\nclose(): void {\nsetTimeout(() => {\nthis._panelOpen = false;\n+ if (this._openOnFocus) {\n+ this._openOnFocus = false;\n+ setTimeout(() => { this._openOnFocus = true; }, 100);\n+ }\n//if (!this._date) {\n// this._placeholderState = '';\n//}\n" } ]
TypeScript
MIT License
promact/md2
fix(datepicker) open on focus issue #91
530,388
28.02.2017 10:48:25
-19,080
c1ab5e779bc175c3ea4c6d61a1cea48b655faf6b
chore(datepicker) update input design
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "</svg>\n</div>\n<div class=\"md2-datepicker-input\">\n- <span class=\"md2-datepicker-placeholder\" [class.has-value]=\"value\"> {{ placeholder }} </span>\n- <span class=\"md2-datepicker-input-text\">{{ value | date:format }}</span>\n- <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\">\n- <path d=\"M7 10l5 5 5-5z\" />\n- </svg>\n+ <span class=\"md2-datepicker-placeholder\" [class.md2-floating-placeholder]=\"value\">{{ placeholder }}</span>\n+ <span class=\"md2-datepicker-value\">{{ value | date:format }}</span>\n+ <span class=\"md2-datepicker-arrow\"></span>\n</div>\n</div>\n<template portal>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -2,7 +2,7 @@ $primary: #106cc8 !default;\n$warn: #f44336 !default;\n$md2-datepicker-trigger-height: 30px !default;\n-$md2-datepicker-trigger-min-width: 112px !default;\n+$md2-datepicker-trigger-min-width: 168px !default;\n$md2-datepicker-arrow-size: 5px !default;\n$md2-datepicker-arrow-margin: 4px !default;\n$md2-datepicker-date-cell-size: 40px !default;\n@@ -42,87 +42,113 @@ md2-datepicker {\nvertical-align: middle;\nfill: currentColor;\ncolor: rgba(black, 0.54);\n+\n+ .md2-datepicker-disabled & {\n+ color: rgba(black, 0.38);\n+ }\n}\n.md2-datepicker-input {\n+ color: rgba(black, 0.38);\n+ border-bottom: 1px solid rgba(black, 0.12);\n+ display: flex;\n+ justify-content: space-between;\n+ align-items: center;\n+ height: $md2-datepicker-trigger-height;\n+ min-width: $md2-datepicker-trigger-min-width;\n+ line-height: 22px;\nposition: relative;\n- display: block;\n- min-width: 150px;\n- height: 30px;\n- padding: 2px 26px 1px 2px;\n- margin: 0;\n- line-height: 26px;\n- color: rgba(black, 0.87);\n- vertical-align: middle;\nbox-sizing: border-box;\n- border-bottom: 1px solid rgba(black, 0.12);\n- svg {\n- position: absolute;\n- right: 0;\n- top: 2px;\n- fill: currentColor;\n- color: rgba(black, 0.54);\n+ [aria-disabled='true'] & {\n+ background-image: linear-gradient(to right, rgba(black, 0.26) 0, rgba(black, 0.26) 33%, transparent 0);\n+ background-size: 4px 1px;\n+ background-repeat: repeat-x;\n+ border-color: transparent;\n+ background-position: 0 bottom;\n+ cursor: default;\n+ user-select: none;\n}\n- md2-datepicker.ng-invalid.ng-touched:not(.md2-datepicker-disabled) & {\n- color: $warn;\n- border-bottom: 1px solid $warn;\n+ md2-datepicker:focus:not(.md2-datepicker-disabled) & {\n+ color: $primary;\n+ border-color: $primary;\n}\n- .md2-datepicker-disabled & {\n- color: rgba(black, 0.38);\n- border-color: transparent;\n- background-image: linear-gradient(to right, rgba(black, 0.38) 0%, rgba(black, 0.38) 33%, transparent 0%);\n- background-position: bottom -1px left 0;\n- background-size: 4px 1px;\n- background-repeat: repeat-x;\n+ md2-datepicker.ng-invalid.ng-touched:not(.md2-datepicker-disabled) & {\n+ color: $warn;\n+ border-color: $warn;\n}\n}\n.md2-datepicker-placeholder {\nposition: absolute;\n- right: 26px;\n+ right: 18px;\nbottom: 100%;\nleft: 0;\n- color: rgba(black, 0.38);\n- max-width: 100%;\n- padding-left: 3px;\n- padding-right: 0;\n- line-height: 1.4;\n- overflow: hidden;\n- text-overflow: ellipsis;\n- white-space: nowrap;\n- pointer-events: none;\n- z-index: 1;\n+ padding: 0 2px;\ntransform: translate3d(0, 26px, 0) scale(1);\n- transition: transform 400ms cubic-bezier(0.25, 0.8, 0.25, 1);\ntransform-origin: left top;\n+ white-space: nowrap;\n+ overflow-x: hidden;\n+ text-overflow: ellipsis;\n+ transition: all 150ms cubic-bezier(.25, .8, .25, 1);\n+\n+ &.md2-floating-placeholder {\n+ left: -2px;\n+ text-align: left;\n+ transform: translate3d(0, 6px, 0) scale(.75);\n+ }\n+\n+ [dir='rtl'] & {\n+ right: 0;\n+ left: 18px;\n+ transform-origin: right top;\n+\n+ &.md2-floating-placeholder {\n+ right: -2px;\n+ text-align: right;\n+ }\n+ }\n[aria-required=true] &::after {\ncontent: '*';\n}\n+}\n+\n+.md2-datepicker-value {\n+ position: relative;\n+ white-space: nowrap;\n+ overflow-x: hidden;\n+ text-overflow: ellipsis;\n+ color: rgba(black, 0.87);\n- &.has-value {\n- transform: translate3d(0, 6px, 0) scale(0.75);\n+ .md2-datepicker-disabled & {\n+ color: rgba(black, 0.38);\n}\n- md2-datepicker:focus &, md2-datepicker.md2-datepicker-opened & {\n- color: $primary;\n- transform: translate3d(0, 6px, 0) scale(0.75);\n+ [dir='rtl'] & {\n+ left: auto;\n+ right: 0;\n}\n}\n-md2-datepicker.md2-datepicker-disabled:focus {\n- .md2-datepicker-placeholder {\n+.md2-datepicker-arrow {\n+ width: 0;\n+ height: 0;\n+ border-left: $md2-datepicker-arrow-size solid transparent;\n+ border-right: $md2-datepicker-arrow-size solid transparent;\n+ border-top: $md2-datepicker-arrow-size solid;\n+ margin: 0 $md2-datepicker-arrow-margin;\ncolor: rgba(black, 0.38);\n- }\n+\n+ md2-datepicker:focus:not(.md2-datepicker-disabled) & {\n+ color: $primary;\n}\n-.md2-datepicker-input-text {\n- display: block;\n- font-size: 15px;\n- line-height: 26px;\n+ md2-datepicker.ng-invalid.ng-touched:not(.md2-datepicker-disabled) & {\n+ color: $warn;\n+ }\n}\n.md2-datepicker-panel {\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update input design
530,388
28.02.2017 13:51:04
-19,080
3d82e670643b2c7458ba81fa1398b6e9d4a9b632
chore(toast) update performance and view-container issue
[ { "change_type": "MODIFY", "old_path": "src/lib/toast/toast.ts", "new_path": "src/lib/toast/toast.ts", "diff": "import {\nComponent,\nInjectable,\n+ ViewContainerRef,\nNgModule,\nModuleWithProviders,\nViewEncapsulation,\n@@ -22,6 +23,7 @@ export class Toast {\nexport class Md2ToastConfig {\nduration: number = 3000;\n+ viewContainerRef?: ViewContainerRef = null;\n}\n@Injectable()\n@@ -46,57 +48,66 @@ export class Md2Toast {\n* @param toastObj string or object with message and other properties of toast\n*/\nshow(message: string, duration?: number) {\n+ if (!message || !message.trim()) { return; }\n+\n+ if (duration) { this._config.duration = duration; }\n+\nlet toast: Toast;\ntoast = new Toast(message);\n- if (duration) { this._config.duration = duration; }\nif (toast) {\nif (!this._toastInstance) {\n- let strategy = this._overlay.position().global().top('0').right('0');\n- let config = new OverlayState();\n- config.positionStrategy = strategy;\n+ this._createToast();\n+ }\n- this._overlayRef = this._overlay.create(config);\n- let portal = new ComponentPortal(Md2ToastComponent);\n+ this._setToastMessage(toast);\n+ }\n+ }\n+\n+ /** Create the toast to display */\n+ private _createToast(): void {\n+ this._createOverlay();\n+ let portal = new ComponentPortal(Md2ToastComponent, this._config.viewContainerRef);\nthis._toastInstance = this._overlayRef.attach(portal).instance;\n+ }\n- this.setupToast(toast);\n+ /** Create the overlay config and position strategy */\n+ private _createOverlay(): void {\n+ if (!this._overlayRef) {\n+ let config = new OverlayState();\n+ config.positionStrategy = this._overlay.position()\n+ .global()\n+ .top('0').right('0');\n- } else {\n- this.setupToast(toast);\n- }\n+ this._overlayRef = this._overlay.create(config);\n}\n}\n- /**\n- * toast timeout\n- * @param toastId\n- */\n- startTimeout(toastId: number) {\n- setTimeout(() => {\n- this.clear(toastId);\n- }, this._config.duration);\n+ /** Disposes the current toast and the overlay it is attached to */\n+ private _disposeToast(): void {\n+ this._overlayRef.dispose();\n+ this._overlayRef = null;\n+ this._toastInstance = null;\n}\n- /**\n- * setup toast\n- * @param toast\n- */\n- setupToast(toast: Toast) {\n+ /** Updates the toast message and repositions the overlay according to the new message length */\n+ private _setToastMessage(toast: Toast) {\ntoast.id = ++this.index;\n- this._toastInstance.add(toast);\n- this.startTimeout(toast.id);\n+ this._toastInstance.addToast(toast);\n+ setTimeout(() => {\n+ this.clearToast(toast.id);\n+ }, this._config.duration);\n}\n/**\n* clear specific toast\n* @param toastId\n*/\n- clear(toastId: number) {\n+ private clearToast(toastId: number) {\nif (this._toastInstance) {\n- this._toastInstance.remove(toastId);\n+ this._toastInstance.removeToast(toastId);\nsetTimeout(() => {\n- if (!this._toastInstance.hasToast()) { this.dispose(); }\n+ if (!this._toastInstance.hasToast()) { this._disposeToast(); }\n}, 250);\n}\n@@ -105,25 +116,16 @@ export class Md2Toast {\n/**\n* clear all toasts\n*/\n- clearAll() {\n+ clearAllToasts() {\nif (this._toastInstance) {\n- this._toastInstance.removeAll();\n+ this._toastInstance.removeAllToasts();\nsetTimeout(() => {\n- if (!this._toastInstance.hasToast()) { this.dispose(); }\n+ if (!this._toastInstance.hasToast()) { this._disposeToast(); }\n}, 250);\n}\n}\n- /**\n- * dispose all toasts\n- */\n- dispose() {\n- this._overlayRef.dispose();\n- this._overlayRef = null;\n- this._toastInstance = null;\n- }\n-\n}\n@Component({\n@@ -140,7 +142,7 @@ export class Md2ToastComponent {\n* add toast\n* @param toast toast object with all parameters\n*/\n- add(toast: Toast) {\n+ addToast(toast: Toast) {\nsetTimeout(() => {\ntoast.isVisible = true;\n}, 1);\n@@ -157,7 +159,7 @@ export class Md2ToastComponent {\n* remove toast\n* @param toastId number of toast id\n*/\n- remove(toastId: number) {\n+ removeToast(toastId: number) {\nthis.toasts.forEach((t: any) => { if (t.id === toastId) { t.isVisible = false; } });\nsetTimeout(() => {\nthis.toasts = this.toasts.filter((toast) => { return toast.id !== toastId; });\n@@ -168,7 +170,7 @@ export class Md2ToastComponent {\n* remove all toasts\n* @param toastId number of toast id\n*/\n- removeAll() {\n+ removeAllToasts() {\nthis.toasts.forEach((t: any) => { t.isVisible = false; });\nsetTimeout(() => {\nthis.toasts = [];\n" } ]
TypeScript
MIT License
promact/md2
chore(toast) update performance and view-container issue
530,388
02.03.2017 12:11:52
-19,080
fef08295d7a7db86cf8744cba8c37e1ef2077b0c
chore(datepicker) update calender design
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "</div>\n</div>\n<div class=\"md2-calendar-month\" [class.active]=\"!_isYearsVisible\">\n- <div class=\"md2-calendar-month-header\">\n+ <div class=\"md2-calendar-header\">\n<div class=\"md2-button\"\n[class.disabled]=\"!_isBeforeMonth()\"\n(click)=\"_isBeforeMonth() && _updateMonth(-1)\">\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -300,7 +300,7 @@ md2-datepicker {\n}\n}\n-.md2-calendar-month-header {\n+.md2-calendar-header {\ndisplay: flex;\njustify-content: space-between;\nfont-size: 14px;\n@@ -308,6 +308,10 @@ md2-datepicker {\ntext-align: center;\nline-height: 48px;\n+ .md2-calendar-month-year-header {\n+ width: 100%;\n+ }\n+\n.md2-button {\ndisplay: inline-block;\nwidth: 48px;\n@@ -323,10 +327,6 @@ md2-datepicker {\nvertical-align: top;\n}\n}\n-\n- .md2-calendar-month-year-header {\n- width: 100%;\n- }\n}\n.md2-calendar-dates {\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update calender design
530,388
02.03.2017 16:28:48
-19,080
7f42513d6108a7dd4b820a017add6d89683b3a2f
chore(datepicker) added skeleton of input
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "</div>\n<div class=\"md2-datepicker-input\">\n<span class=\"md2-datepicker-placeholder\" [class.md2-floating-placeholder]=\"value\">{{ placeholder }}</span>\n- <span class=\"md2-datepicker-value\">{{ value | date:format }}</span>\n+ <input class=\"md2-datepicker-value\" type=\"text\" [value]=\"value | date:format\" />\n<span class=\"md2-datepicker-arrow\"></span>\n</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -118,10 +118,14 @@ md2-datepicker {\n.md2-datepicker-value {\nposition: relative;\n+ width: 100%;\nwhite-space: nowrap;\noverflow-x: hidden;\ntext-overflow: ellipsis;\ncolor: rgba(black, 0.87);\n+ border: 0;\n+ outline: none;\n+ background: transparent;\n.md2-datepicker-disabled & {\ncolor: rgba(black, 0.38);\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) added skeleton of input
530,388
03.03.2017 08:41:36
-19,080
4ece28b7b37e8e0b80a645c35d48030bddbe2bb0
chore(datepicker) added animation on calendar
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker-animations.ts", "new_path": "src/lib/datepicker/datepicker-animations.ts", "diff": "import {\nanimate,\nAnimationEntryMetadata,\n+ keyframes,\nstate,\nstyle,\ntransition,\n@@ -19,3 +20,20 @@ export const fadeInContent: AnimationEntryMetadata = trigger('fadeInContent', [\nanimate(`150ms 100ms cubic-bezier(0.55, 0, 0.55, 0.2)`)\n])\n]);\n+\n+export const slideCalendar: AnimationEntryMetadata = trigger('slideCalendar', [\n+ transition('* => left', [\n+ animate(180, keyframes([\n+ style({ transform: 'translateX(105%)', offset: 0.5 }),\n+ style({ transform: 'translateX(-130%)', offset: 0.51 }),\n+ style({ transform: 'translateX(0)', offset: 1 })\n+ ]))\n+ ]),\n+ transition('* => right', [\n+ animate(180, keyframes([\n+ style({ transform: 'translateX(-105%)', offset: 0.5 }),\n+ style({ transform: 'translateX(130%)', offset: 0.51 }),\n+ style({ transform: 'translateX(0)', offset: 1 })\n+ ]))\n+ ])\n+]);\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "</div>\n<table class=\"md2-calendar-dates\">\n<thead><tr><th *ngFor=\"let day of _weekDays\">{{day.xshort}}</th></tr></thead>\n- <tbody>\n+ <tbody [@slideCalendar]=\"_calendarState\">\n<tr *ngFor=\"let w of _dates\">\n<td *ngFor=\"let d of w\">\n<div class=\"md2-calendar-day\"\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -44,7 +44,7 @@ import {\nTemplatePortalDirective,\nPortalModule\n} from '../core';\n-import { fadeInContent } from './datepicker-animations';\n+import { fadeInContent, slideCalendar } from './datepicker-animations';\nimport { Subscription } from 'rxjs/Subscription';\n/** Change event object emitted by Md2Select. */\n@@ -92,7 +92,8 @@ export type Type = 'date' | 'time' | 'datetime';\n'(blur)': '_onBlur()'\n},\nanimations: [\n- fadeInContent\n+ fadeInContent,\n+ slideCalendar\n],\nencapsulation: ViewEncapsulation.None\n})\n@@ -124,6 +125,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n_isYearsVisible: boolean;\n_isCalendarVisible: boolean;\n_clockView: string = 'hour';\n+ _calendarState: string;\n_weekDays: Array<any>;\n@@ -601,6 +603,11 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n_updateMonth(noOfMonths: number) {\nthis.date = this._locale.incrementMonths(this.date, noOfMonths);\nthis.generateCalendar();\n+ if (noOfMonths > 0) {\n+ this.calendarState('right');\n+ } else {\n+ this.calendarState('left');\n+ }\n}\n/**\n@@ -801,6 +808,11 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n}\n}\n+ private calendarState(direction: string): void {\n+ this._calendarState = direction;\n+ setTimeout(() => this._calendarState = 'reset', 185);\n+ }\n+\n}\nexport const MD2_DATEPICKER_DIRECTIVES = [Md2Datepicker, Md2Clock];\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) added animation on calendar
530,388
03.03.2017 09:38:07
-19,080
a3d2d76628f144b73fda3eb7d3a2cb28550c3d1b
chore(datepicker) update animations
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker-animations.ts", "new_path": "src/lib/datepicker/datepicker-animations.ts", "diff": "@@ -24,15 +24,15 @@ export const fadeInContent: AnimationEntryMetadata = trigger('fadeInContent', [\nexport const slideCalendar: AnimationEntryMetadata = trigger('slideCalendar', [\ntransition('* => left', [\nanimate(180, keyframes([\n- style({ transform: 'translateX(105%)', offset: 0.5 }),\n- style({ transform: 'translateX(-130%)', offset: 0.51 }),\n+ style({ transform: 'translateX(100%)', offset: 0.5 }),\n+ style({ transform: 'translateX(-100%)', offset: 0.51 }),\nstyle({ transform: 'translateX(0)', offset: 1 })\n]))\n]),\ntransition('* => right', [\nanimate(180, keyframes([\n- style({ transform: 'translateX(-105%)', offset: 0.5 }),\n- style({ transform: 'translateX(130%)', offset: 0.51 }),\n+ style({ transform: 'translateX(-100%)', offset: 0.5 }),\n+ style({ transform: 'translateX(100%)', offset: 0.51 }),\nstyle({ transform: 'translateX(0)', offset: 1 })\n]))\n])\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "<path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n</svg>\n</div>\n- <div class=\"md2-calendar-month-year\">{{ date | date: 'MMMM y' }}</div>\n+ <div class=\"md2-calendar-month-year\" [@slideCalendar]=\"_calendarState\">{{ date | date: 'MMMM y' }}</div>\n<div class=\"md2-button\"\n[class.disabled]=\"!_isAfterMonth()\"\n(click)=\"_isAfterMonth() && _updateMonth(1)\">\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -810,7 +810,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nprivate calendarState(direction: string): void {\nthis._calendarState = direction;\n- setTimeout(() => this._calendarState = 'reset', 185);\n+ setTimeout(() => this._calendarState = '', 180);\n}\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update animations
530,388
03.03.2017 14:44:37
-19,080
65adf7aaa6dfa37742cb2603c10e0b273af953b9
feat(datepicker) added firstDayOfWeek and update performance
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/date-locale.ts", "new_path": "src/lib/datepicker/date-locale.ts", "diff": "@@ -32,12 +32,27 @@ export class DateLocale {\n{ full: 'Saturday', short: 'Sat', xshort: 'S' },\n];\n+ getDays() {\n+ return this.days.slice(this.firstDayOfWeek, this.days.length)\n+ .concat(this.days.slice(0, this.firstDayOfWeek));\n+ }\n+\ngetDateLabel(d: number) { return `${d}`; }\ngetMonthLabel(m: number, y: number) { return `${this.months[m].short.toUpperCase()} ${y}`; }\ngetYearLabel(y: number) { return `${y}`; }\n+ /**\n+ * Gets the first day of the month for the given date's month.\n+ * @param {Date} date\n+ * @returns {Date}\n+ */\n+ getFirstDateOfWeek(date: Date) {\n+ let day: number = date.getDate() - ((7 + date.getDay() - this.firstDayOfWeek) % 7);\n+ return new Date(date.getFullYear(), date.getMonth(), day, date.getHours(), date.getMinutes());\n+ }\n+\n/**\n* Gets the first day of the month for the given date's month.\n* @param {Date} date\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "[class.prev-month]=\"d.calMonth===_prevMonth\"\n[class.curr-month]=\"d.calMonth===_currMonth\"\n[class.next-month]=\"d.calMonth===_nextMonth\"\n- (click)=\"_onClickDate($event,d)\">{{d.dateObj.day}}</div>\n+ (click)=\"_onClickDate($event,d)\">{{d.index}}</div>\n</td>\n</tr>\n</tbody>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -52,22 +52,6 @@ export class Md2DateChange {\nconstructor(public source: Md2Datepicker, public value: Date) { }\n}\n-export interface IDate {\n- year: number;\n- month: number;\n- day: number;\n- hour: number;\n- minute: number;\n-}\n-\n-export interface IWeek {\n- dateObj: IDate;\n- date: Date;\n- calMonth: number;\n- today: boolean;\n- disabled: boolean;\n-}\n-\nlet nextId = 0;\nexport type Type = 'date' | 'time' | 'datetime';\n@@ -156,7 +140,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis._control.valueAccessor = this;\n}\n- this._weekDays = _locale.days;\n+ this._weekDays = this._locale.getDays();\nthis.getYears();\n}\n@@ -571,8 +555,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nif (date.calMonth === this._prevMonth) {\nthis._updateMonth(-1);\n} else if (date.calMonth === this._currMonth) {\n- this.setDate(new Date(date.dateObj.year, date.dateObj.month,\n- date.dateObj.day, this.date.getHours(), this.date.getMinutes()));\n+ this.setDate(date.date);\n} else if (date.calMonth === this._nextMonth) {\nthis._updateMonth(1);\n}\n@@ -678,66 +661,101 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis._dates.length = 0;\nlet firstDayOfMonth = this._locale.getFirstDateOfMonth(this.date);\n- let numberOfDaysInMonth = this._locale.getNumberOfDaysInMonth(this.date);\n- let numberOfDaysInPrevMonth = this._locale.getNumberOfDaysInMonth(\n- this._locale.incrementMonths(this.date, -1));\n+ //let numberOfDaysInMonth = this._locale.getNumberOfDaysInMonth(this.date);\n+ //let numberOfDaysInPrevMonth = this._locale.getNumberOfDaysInMonth(\n+ // this._locale.incrementMonths(this.date, -1));\n+\n+ //let dayNbr = 1;\n+ //let calMonth = this._prevMonth;\n+ //for (let i = 1; i < 7; i++) {\n+ // let week: IWeek[] = [];\n+ // if (i === 1) {\n+ // let prevMonth = numberOfDaysInPrevMonth - firstDayOfMonth.getDay() + 1;\n+ // for (let j = prevMonth; j <= numberOfDaysInPrevMonth; j++) {\n+ // let iDate: IDate = { year: year, month: month - 1, day: j, hour: 0, minute: 0 };\n+ // let date: Date = new Date(year, month - 1, j);\n+ // week.push({\n+ // date: date,\n+ // dateObj: iDate,\n+ // calMonth: calMonth,\n+ // today: this._locale.isSameDay(this.today, date),\n+ // disabled: this._isDisabledDate(date)\n+ // });\n+ // }\n- let dayNbr = 1;\n- let calMonth = this._prevMonth;\n- for (let i = 1; i < 7; i++) {\n- let week: IWeek[] = [];\n- if (i === 1) {\n- let prevMonth = numberOfDaysInPrevMonth - firstDayOfMonth.getDay() + 1;\n- for (let j = prevMonth; j <= numberOfDaysInPrevMonth; j++) {\n- let iDate: IDate = { year: year, month: month - 1, day: j, hour: 0, minute: 0 };\n- let date: Date = new Date(year, month - 1, j);\n- week.push({\n- date: date,\n- dateObj: iDate,\n- calMonth: calMonth,\n- today: this._locale.isSameDay(this.today, date),\n- disabled: this._isDisabledDate(date)\n- });\n- }\n+ // calMonth = this._currMonth;\n+ // let daysLeft = 7 - week.length;\n+ // for (let j = 0; j < daysLeft; j++) {\n+ // let iDate: IDate = { year: year, month: month, day: dayNbr, hour: 0, minute: 0 };\n+ // let date: Date = new Date(year, month, dayNbr);\n+ // week.push({\n+ // date: date,\n+ // dateObj: iDate,\n+ // calMonth: calMonth,\n+ // today: this._locale.isSameDay(this.today, date),\n+ // disabled: this._isDisabledDate(date)\n+ // });\n+ // dayNbr++;\n+ // }\n+ // } else {\n+ // for (let j = 1; j < 8; j++) {\n+ // if (dayNbr > numberOfDaysInMonth) {\n+ // dayNbr = 1;\n+ // calMonth = this._nextMonth;\n+ // }\n+ // let iDate: IDate = {\n+ // year: year,\n+ // month: calMonth === this._currMonth ? month : month + 1,\n+ // day: dayNbr, hour: 0, minute: 0\n+ // };\n+ // let date: Date = new Date(year, iDate.month, dayNbr);\n+ // week.push({\n+ // date: date,\n+ // dateObj: iDate,\n+ // calMonth: calMonth,\n+ // today: this._locale.isSameDay(this.today, date),\n+ // disabled: this._isDisabledDate(date)\n+ // });\n+ // dayNbr++;\n+ // }\n+ // }\n+ // this._dates.push(week);\n+ //}\n+\n+ //============================================\n+\n+ //date = this.weekStartDate(new Date(year, month, 1));\n+\n+ //let startDate = new Date(this.date.getTime());\n+ //while (startDate.getDay() !== this._locale.firstDayOfWeek) {\n+ // startDate.setDate(startDate.getDate() - 1);\n+ //}\n+ //let date = startDate;\n+ let calMonth = this._prevMonth;\n+ let date = this._locale.getFirstDateOfWeek(firstDayOfMonth);\n+ do {\n+ let week: Array<any> = [];\n+ for (let i = 0; i < 7; i++) {\n+ if (date.getDate() === 1) {\n+ if (calMonth === this._prevMonth) {\ncalMonth = this._currMonth;\n- let daysLeft = 7 - week.length;\n- for (let j = 0; j < daysLeft; j++) {\n- let iDate: IDate = { year: year, month: month, day: dayNbr, hour: 0, minute: 0 };\n- let date: Date = new Date(year, month, dayNbr);\n- week.push({\n- date: date,\n- dateObj: iDate,\n- calMonth: calMonth,\n- today: this._locale.isSameDay(this.today, date),\n- disabled: this._isDisabledDate(date)\n- });\n- dayNbr++;\n- }\n} else {\n- for (let j = 1; j < 8; j++) {\n- if (dayNbr > numberOfDaysInMonth) {\n- dayNbr = 1;\ncalMonth = this._nextMonth;\n}\n- let iDate: IDate = {\n- year: year,\n- month: calMonth === this._currMonth ? month : month + 1,\n- day: dayNbr, hour: 0, minute: 0\n- };\n- let date: Date = new Date(year, iDate.month, dayNbr);\n+ }\nweek.push({\ndate: date,\n- dateObj: iDate,\n+ index: date.getDate(),\ncalMonth: calMonth,\ntoday: this._locale.isSameDay(this.today, date),\ndisabled: this._isDisabledDate(date)\n});\n- dayNbr++;\n- }\n+ date = new Date(date.getTime());\n+ date.setDate(date.getDate() + 1);\n}\nthis._dates.push(week);\n- }\n+ } while ((date.getMonth() <= month) && (date.getFullYear() === year));\n}\n/**\n" } ]
TypeScript
MIT License
promact/md2
feat(datepicker) added firstDayOfWeek and update performance
530,388
03.03.2017 15:16:07
-19,080
565356f15ca35339c5a2277bf45d86cdf8569ec9
chore(datepicker) lint free
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -655,83 +655,10 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n* Generate Month Calendar\n*/\nprivate generateCalendar(): void {\n+ this._dates.length = 0;\nlet year = this.date.getFullYear();\nlet month = this.date.getMonth();\n-\n- this._dates.length = 0;\n-\nlet firstDayOfMonth = this._locale.getFirstDateOfMonth(this.date);\n- //let numberOfDaysInMonth = this._locale.getNumberOfDaysInMonth(this.date);\n- //let numberOfDaysInPrevMonth = this._locale.getNumberOfDaysInMonth(\n- // this._locale.incrementMonths(this.date, -1));\n-\n- //let dayNbr = 1;\n- //let calMonth = this._prevMonth;\n- //for (let i = 1; i < 7; i++) {\n- // let week: IWeek[] = [];\n- // if (i === 1) {\n- // let prevMonth = numberOfDaysInPrevMonth - firstDayOfMonth.getDay() + 1;\n- // for (let j = prevMonth; j <= numberOfDaysInPrevMonth; j++) {\n- // let iDate: IDate = { year: year, month: month - 1, day: j, hour: 0, minute: 0 };\n- // let date: Date = new Date(year, month - 1, j);\n- // week.push({\n- // date: date,\n- // dateObj: iDate,\n- // calMonth: calMonth,\n- // today: this._locale.isSameDay(this.today, date),\n- // disabled: this._isDisabledDate(date)\n- // });\n- // }\n-\n- // calMonth = this._currMonth;\n- // let daysLeft = 7 - week.length;\n- // for (let j = 0; j < daysLeft; j++) {\n- // let iDate: IDate = { year: year, month: month, day: dayNbr, hour: 0, minute: 0 };\n- // let date: Date = new Date(year, month, dayNbr);\n- // week.push({\n- // date: date,\n- // dateObj: iDate,\n- // calMonth: calMonth,\n- // today: this._locale.isSameDay(this.today, date),\n- // disabled: this._isDisabledDate(date)\n- // });\n- // dayNbr++;\n- // }\n- // } else {\n- // for (let j = 1; j < 8; j++) {\n- // if (dayNbr > numberOfDaysInMonth) {\n- // dayNbr = 1;\n- // calMonth = this._nextMonth;\n- // }\n- // let iDate: IDate = {\n- // year: year,\n- // month: calMonth === this._currMonth ? month : month + 1,\n- // day: dayNbr, hour: 0, minute: 0\n- // };\n- // let date: Date = new Date(year, iDate.month, dayNbr);\n- // week.push({\n- // date: date,\n- // dateObj: iDate,\n- // calMonth: calMonth,\n- // today: this._locale.isSameDay(this.today, date),\n- // disabled: this._isDisabledDate(date)\n- // });\n- // dayNbr++;\n- // }\n- // }\n- // this._dates.push(week);\n- //}\n-\n- //============================================\n-\n- //date = this.weekStartDate(new Date(year, month, 1));\n-\n-\n- //let startDate = new Date(this.date.getTime());\n- //while (startDate.getDay() !== this._locale.firstDayOfWeek) {\n- // startDate.setDate(startDate.getDate() - 1);\n- //}\n- //let date = startDate;\nlet calMonth = this._prevMonth;\nlet date = this._locale.getFirstDateOfWeek(firstDayOfMonth);\ndo {\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) lint free
530,388
03.03.2017 16:07:03
-19,080
55f75a781dfec8a2168291154afe73f30e48768d
chore(datepicker) enable and disable specific dates
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -151,6 +151,9 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n@Input() id: string = 'md2-datepicker-' + (++nextId);\n@Input() placeholder: string;\n@Input() tabindex: number = 0;\n+ @Input() enableDates: Array<Date> = [];\n+ @Input() disableDates: Array<Date> = [];\n+ @Input() disableWeekDays: Array<number> = [];\n@Input()\nget value() { return this._value; }\n@@ -225,14 +228,17 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nget disabled(): boolean { return this._disabled; }\nset disabled(value) { this._disabled = coerceBooleanProperty(value); }\n- @Input() set min(value: Date) {\n+ @Input()\n+ set min(value: Date) {\nif (value && this._locale.isValidDate(value)) {\nthis._min = new Date(value);\nthis._min.setHours(0, 0, 0, 0);\nthis.getYears();\n} else { this._min = null; }\n}\n- @Input() set max(value: Date) {\n+\n+ @Input()\n+ set max(value: Date) {\nif (value && this._locale.isValidDate(value)) {\nthis._max = new Date(value);\nthis._max.setHours(0, 0, 0, 0);\n@@ -632,23 +638,22 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n* @return boolean\n*/\nprivate _isDisabledDate(date: Date): boolean {\n- if (this._min && this._max) {\n- return (this._min > date) || (this._max < date);\n- } else if (this._min) {\n- return (this._min > date);\n- } else if (this._max) {\n- return (this._max < date);\n- } else {\n- return false;\n+ for (let d of this.enableDates) {\n+ return !this._locale.isSameDay(date, d);\n}\n+ for (let d of this.disableDates) {\n+ return this._locale.isSameDay(date, d);\n+ }\n+ // for (let d of this.disableWeekDays) {\n- // if (this.disableWeekends) {\n+ // }\n+ // if (disableWeekends) {\n// let dayNbr = this.getDayNumber(date);\n// if (dayNbr === 0 || dayNbr === 6) {\n// return true;\n// }\n- // }\n- // return false;\n+\n+ return !this._locale.isDateWithinRange(date, this._min, this._max);\n}\n/**\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) enable and disable specific dates #56
530,388
03.03.2017 17:55:28
-19,080
57f99eccfa13d8999386909504a151b81923b350
fix(datepicker) date enable disable issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -639,10 +639,10 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n*/\nprivate _isDisabledDate(date: Date): boolean {\nfor (let d of this.enableDates) {\n- return !this._locale.isSameDay(date, d);\n+ if (this._locale.isSameDay(date, d)) { return false; }\n}\nfor (let d of this.disableDates) {\n- return this._locale.isSameDay(date, d);\n+ if (this._locale.isSameDay(date, d)) { return true; }\n}\n// for (let d of this.disableWeekDays) {\n" } ]
TypeScript
MIT License
promact/md2
fix(datepicker) date enable disable issue
530,388
04.03.2017 17:25:08
-19,080
29946c47145c971d805322431620b8e1d8d47317
chore(datepicker) implemented disable week days
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -158,6 +158,7 @@ md2-datepicker {\n.md2-datepicker-panel {\nwidth: 300px;\nborder-radius: 3px;\n+ color: rgba(black, 0.87);\nbackground-color: white;\noverflow: hidden;\nbox-shadow: 0 11px 15px -7px rgba(black, 0.2), 0 24px 38px 3px rgba(black, 0.14), 0 9px 46px 8px rgba(black, 0.12);\n@@ -377,7 +378,7 @@ md2-datepicker {\n&.disabled,\n&.disabled:hover {\n- color: rgba(black, 0.45);\n+ color: rgba(black, 0.43);\nbackground: transparent;\npointer-events: none;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -644,9 +644,9 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nfor (let d of this.disableDates) {\nif (this._locale.isSameDay(date, d)) { return true; }\n}\n- // for (let d of this.disableWeekDays) {\n-\n- // }\n+ for (let d of this.disableWeekDays) {\n+ if (date.getDay() === d) { return true; }\n+ }\n// if (disableWeekends) {\n// let dayNbr = this.getDayNumber(date);\n// if (dayNbr === 0 || dayNbr === 6) {\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) implemented disable week days
530,388
04.03.2017 17:25:43
-19,080
dc1864835608d47af4621db01a203421a75b790e
chore(datepicker) update demo with enable and disable days
[ { "change_type": "MODIFY", "old_path": "src/demo-app/datepicker/datepicker-demo.html", "new_path": "src/demo-app/datepicker/datepicker-demo.html", "diff": "[openOnFocus]=\"isOpenOnFocus\"\n[isOpen]=\"isOpen\"\n[type]=\"type\"\n+ [enableDates]=\"enableDates\"\n+ [disableDates]=\"disableDates\"\n+ [disableWeekDays]=\"disableWeekDays\"\n[min]=\"minDate\"\n[max]=\"maxDate\"\n#dateControl=\"ngModel\"></md2-datepicker>\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/datepicker/datepicker-demo.ts", "new_path": "src/demo-app/datepicker/datepicker-demo.ts", "diff": "@@ -11,6 +11,7 @@ export class DatepickerDemo {\nisDisabled = false;\nisOpenOnFocus = false;\nisOpen = false;\n+ today: Date = new Date();\ntype: string = 'date';\ntypes: Array<any> = [\n{ text: 'Date', value: 'date' },\n@@ -20,6 +21,21 @@ export class DatepickerDemo {\ndate: Date = null;\nminDate: Date = null;\nmaxDate: Date = null;\n+ enableDates: Array<Date> = [\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() - 7),\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() - 1),\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() + 5),\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() + 7),\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() + 8)\n+ ];\n+ disableDates: Array<Date> = [\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() - 2),\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() - 1),\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() + 2),\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() + 5),\n+ new Date(this.today.getFullYear(), this.today.getMonth(), this.today.getDate() + 9)\n+ ];\n+ disableWeekDays: Array<number> = [0, 6];\nopenDatepicker() {\nthis.isOpen = true;\n@@ -29,13 +45,13 @@ export class DatepickerDemo {\n}\nsetDate() {\n- this.date = new Date();\n+ this.date = new Date(this.today);\n}\nsetDateRange() {\n- this.minDate = new Date();\n+ this.minDate = new Date(this.today);\nthis.minDate.setMonth(this.minDate.getMonth() - 3);\n- this.maxDate = new Date();\n+ this.maxDate = new Date(this.today);\nthis.maxDate.setMonth(this.maxDate.getMonth() + 3);\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update demo with enable and disable days
530,388
04.03.2017 17:36:15
-19,080
7c6d1034df1a5e02cb36870fcc58ce534c66a536
chore(datepicker) update design
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -6,7 +6,7 @@ $md2-datepicker-trigger-min-width: 168px !default;\n$md2-datepicker-arrow-size: 5px !default;\n$md2-datepicker-arrow-margin: 4px !default;\n$md2-datepicker-date-cell-size: 40px !default;\n-$md2-datepicker-calendar-height: 300px !default;\n+$md2-datepicker-calendar-height: 280px !default;\n$md2-clock-size: 240px !default;\n$md2-clock-tick-size: 34px !default;\n@@ -339,9 +339,9 @@ md2-datepicker {\nth {\nwidth: 35px;\n- height: 20px;\n+ height: 16px;\nfont-weight: 500;\n- line-height: 15px;\n+ line-height: 10px;\nopacity: 0.5;\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update design
530,388
04.03.2017 17:40:10
-19,080
bdc5f318cfd14671f08b9331c94a769441f97e70
chore(datepicker) update docs with enable and disable dates
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/README.md", "new_path": "src/lib/datepicker/README.md", "diff": "@@ -18,6 +18,9 @@ Datepicker allow the user to select date and time.\n| `tabindex` | `number` | The tabIndex of the datepicker. |\n| `openOnFocus` | `boolean` | Opend Calendar Whether or not the datepicker is openOnFocus. |\n| `isOpen` | `number` | Opend Calendar Whether or not the datepicker is isOpen. |\n+| `enableDates` | `Array<Date>` | Enable dates. |\n+| `disableDates` | `Array<Date>` | Disable Dates. |\n+| `disableWeekDays` | `Array<number>` | Disable Week Days. |\n### Events\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update docs with enable and disable dates
530,388
05.03.2017 12:50:08
-19,080
9531cbd0dc771d7c1122b870e78acfbca41bb236
feat(datepicker) basic mode of panel
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -42,7 +42,9 @@ import {\nOverlayModule,\nPortal,\nTemplatePortalDirective,\n- PortalModule\n+ PortalModule,\n+ HorizontalConnectionPos,\n+ VerticalConnectionPos,\n} from '../core';\nimport { fadeInContent, slideCalendar } from './datepicker-animations';\nimport { Subscription } from 'rxjs/Subscription';\n@@ -55,6 +57,11 @@ export class Md2DateChange {\nlet nextId = 0;\nexport type Type = 'date' | 'time' | 'datetime';\n+export type Mode = 'inline' | 'popup';\n+export type PanelPositionX = 'before' | 'after';\n+export type PanelPositionY = 'above' | 'below';\n+\n+\n@Component({\nmoduleId: module.id,\n@@ -94,6 +101,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nprivate _openOnFocus: boolean = false;\nprivate _type: Type = 'date';\n+ private _mode: Mode = 'inline';\nprivate _format: string;\nprivate _required: boolean = false;\nprivate _disabled: boolean = false;\n@@ -155,6 +163,12 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n@Input() disableDates: Array<Date> = [];\n@Input() disableWeekDays: Array<number> = [];\n+ /** Position of the menu in the X axis. */\n+ positionX: PanelPositionX = 'after';\n+\n+ /** Position of the menu in the Y axis. */\n+ positionY: PanelPositionY = 'below';\n+\n@Input()\nget value() { return this._value; }\nset value(value: Date) {\n@@ -206,6 +220,13 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis._type = value || 'date';\n}\n+ @Input()\n+ get mode() { return this._mode; }\n+ set mode(value: Mode) {\n+ this._mode = value || 'inline';\n+ if (this.panelOpen) { this.close(); }\n+ }\n+\n@Input()\nget selected() { return this._selected; }\nset selected(value: Date) { this._selected = value; }\n@@ -741,13 +762,41 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nprivate _createOverlay(): void {\nif (!this._overlayRef) {\nlet config = new OverlayState();\n+ if (this.mode === 'inline') {\n+ const [posX, fallbackX]: HorizontalConnectionPos[] =\n+ this.positionX === 'before' ? ['end', 'start'] : ['start', 'end'];\n+\n+ const [overlayY, fallbackOverlayY]: VerticalConnectionPos[] =\n+ this.positionY === 'above' ? ['bottom', 'top'] : ['top', 'bottom'];\n+\n+ let originY = overlayY;\n+ let fallbackOriginY = fallbackOverlayY;\n+\n+ //if (!this.menu.overlapTrigger) {\n+ // originY = overlayY === 'top' ? 'bottom' : 'top';\n+ // fallbackOriginY = fallbackOverlayY === 'top' ? 'bottom' : 'top';\n+ //}\n+ config.positionStrategy = this.overlay.position().connectedTo(this._element,\n+ { originX: posX, originY: originY }, { overlayX: posX, overlayY: overlayY })\n+ .withFallbackPosition(\n+ { originX: fallbackX, originY: originY },\n+ { overlayX: fallbackX, overlayY: overlayY })\n+ .withFallbackPosition(\n+ { originX: posX, originY: fallbackOriginY },\n+ { overlayX: posX, overlayY: fallbackOverlayY })\n+ .withFallbackPosition(\n+ { originX: fallbackX, originY: fallbackOriginY },\n+ { overlayX: fallbackX, overlayY: fallbackOverlayY });\n+ config.hasBackdrop = true;\n+ config.backdropClass = 'cdk-overlay-transparent-backdrop';\n+ } else {\nconfig.positionStrategy = this.overlay.position()\n.global()\n.centerHorizontally()\n.centerVertically();\nconfig.hasBackdrop = true;\nconfig.backdropClass = 'cdk-overlay-dark-backdrop';\n-\n+ }\nthis._overlayRef = this.overlay.create(config);\n}\n}\n" } ]
TypeScript
MIT License
promact/md2
feat(datepicker) basic mode of panel
530,388
14.03.2017 13:39:22
-19,080
cce1b5ea76b6534436b31d653cfe2c226d1bf659
chore(accordion) update performance and design and added animations
[ { "change_type": "MODIFY", "old_path": "src/lib/accordion/accordion.scss", "new_path": "src/lib/accordion/accordion.scss", "diff": "-.md2-accordion {\n+$primary: #106cc8 !default;\n+\n+md2-accordion {\ndisplay: block;\n}\n@@ -6,81 +8,74 @@ md2-accordion-tab {\nposition: relative;\ndisplay: block;\noutline: 0;\n- border: 0;\n- border-width: 0 0 1px;\n- border-style: solid;\n- border-color: rgba(0, 0, 0, 0.12);\nbox-sizing: border-box;\n-}\n-md2-accordion-tab[hidden] {\n+ &[hidden] {\ndisplay: none;\n}\n-\n-md2-accordion-tab.md2-accordion-tab-active {\n- border-color: rgba(0, 0, 0, 0.12);\n}\n-md2-accordion-tab .md2-accordion-header {\n+.md2-accordion-header {\nposition: relative;\n- border-radius: 0;\n- color: rgba(0, 0, 0, 0.85);\n- font-weight: 500;\n- cursor: pointer;\ndisplay: block;\n- align-items: inherit;\n+ padding-right: 30px;\n+ font-weight: 500;\nline-height: 40px;\n- margin: 0;\n- max-height: 40px;\n- overflow: hidden;\n- padding: 0 35px 0 16px;\ntext-align: left;\n- text-decoration: none;\n+ color: rgba(black, 0.87);\n+ cursor: pointer;\nwhite-space: nowrap;\n- width: 100%;\n+ border-bottom: 1px solid rgba(black, 0.12);\n+ border-radius: 0;\nbox-sizing: border-box;\nuser-select: none;\n- -webkit-user-drag: none;\n-}\n-md2-accordion-tab.md2-accordion-tab-active .md2-accordion-header {\n- color: #106cc8;\n+ md2-accordion-tab.md2-accordion-tab-active > & {\n+ border-color: $primary;\n+ box-shadow: 0 1px 0 $primary;\n}\n-md2-accordion-tab.md2-accordion-tab-disabled .md2-accordion-header {\n+ md2-accordion-tab.md2-accordion-tab-disabled > & {\npointer-events: none;\n- user-select: none;\n- -webkit-user-drag: none;\n- opacity: 0.5;\n+ color: rgba(black, 0.26);\n+ background-image: linear-gradient(to right, rgba(black, 0.26) 0, rgba(black, 0.26) 33%, transparent 0);\n+ background-size: 4px 1px;\n+ background-repeat: repeat-x;\n+ background-position: 0 bottom;\n+ border-color: transparent;\n+ box-shadow: none;\ncursor: default;\n}\n+}\n-md2-accordion-tab .md2-accordion-header-icon {\n+.md2-accordion-header-icon {\nposition: absolute;\ntop: 12px;\n- right: 17px;\n+ right: 8px;\nwidth: 8px;\nheight: 8px;\noverflow: hidden;\ndisplay: inline-block;\nborder-width: 0 2px 2px 0;\nborder-style: solid;\n- border-color: rgba(0, 0, 0, 0.54);\n+ border-color: currentColor;\n+ opacity: 0.64;\ntransform: rotate(45deg);\ntransition: 300ms ease-in-out;\n-}\n-md2-accordion-tab.md2-accordion-tab-active .md2-accordion-header-icon {\n+ md2-accordion-tab.md2-accordion-tab-active > .md2-accordion-header > & {\ntransform: rotate(225deg);\ntop: 16px;\n}\n+}\n-md2-accordion-tab .md2-accordion-tab-content {\n+.md2-accordion-tab-body {\nposition: relative;\n- display: none;\n- padding: 16px;\n+ overflow: hidden;\n}\n-md2-accordion-tab.md2-accordion-tab-active .md2-accordion-tab-content {\n- display: block;\n+.md2-accordion-tab-content {\n+ position: relative;\n+ padding: 20px 0;\n+ border-bottom: 1px solid rgba(black, 0.12);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/lib/accordion/accordionpanel.ts", "new_path": "src/lib/accordion/accordionpanel.ts", "diff": "-import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';\n+import {\n+ Component,\n+ EventEmitter,\n+ Input,\n+ Output,\n+ ViewEncapsulation\n+} from '@angular/core';\nimport { Md2AccordionTab } from './accordiontab';\nimport { coerceBooleanProperty } from '../core/core';\n+\n@Component({\nmoduleId: module.id,\nselector: 'md2-accordion',\ntemplate: `<ng-content></ng-content>`,\nstyleUrls: ['accordion.css'],\n- host: {\n- '[class]': 'class',\n- '[class.md2-accordion]': 'true'\n- },\nencapsulation: ViewEncapsulation.None\n})\n-\nexport class Md2Accordion {\nprivate _multiple: boolean;\n@@ -21,10 +23,7 @@ export class Md2Accordion {\nget multiple(): boolean { return this._multiple; }\nset multiple(value) { this._multiple = coerceBooleanProperty(value); }\n- @Input() class: string = '';\n-\n@Output() close: EventEmitter<any> = new EventEmitter<any>();\n-\n@Output() open: EventEmitter<any> = new EventEmitter<any>();\ntabs: Md2AccordionTab[] = [];\n" }, { "change_type": "MODIFY", "old_path": "src/lib/accordion/accordiontab.ts", "new_path": "src/lib/accordion/accordiontab.ts", "diff": "import {\n+ animate,\nComponent,\nDirective,\nInput,\n- ViewEncapsulation\n+ state,\n+ style,\n+ transition,\n+ trigger,\n+ ViewEncapsulation,\n} from '@angular/core';\nimport { Md2Accordion } from './accordionpanel';\nimport { coerceBooleanProperty } from '../core';\n@@ -19,11 +24,31 @@ export class Md2AccordionHeader { }\n<ng-content select=\"md2-accordion-header\"></ng-content>\n<span class=\"md2-accordion-header-icon\"></span>\n</div>\n+ <div class=\"md2-accordion-tab-body\" [@slide]=\"slide\">\n<div class=\"md2-accordion-tab-content\">\n<ng-content></ng-content>\n</div>\n+ </div>\n`,\nstyleUrls: ['accordion.css'],\n+ animations: [\n+ trigger('slide', [\n+ state('up', style({ height: 0 })),\n+ state('down', style({ height: '*' })),\n+ transition('down => up', [\n+ style({ height: '*' }),\n+ animate(300, style({\n+ height: 0\n+ }))\n+ ]),\n+ transition('up => down', [\n+ style({ height: 0 }),\n+ animate(300, style({\n+ height: '*'\n+ }))\n+ ])\n+ ])\n+ ],\nhost: {\n'role': 'accordion-tab',\n'[class.md2-accordion-tab-active]': 'active',\n@@ -49,6 +74,10 @@ export class Md2AccordionTab {\n}\n}\n+ get slide(): string {\n+ return this.active ? 'down' : 'up';\n+ }\n+\n@Input()\nget disabled(): boolean { return this._disabled; }\nset disabled(value) { this._disabled = coerceBooleanProperty(value); }\n@@ -63,10 +92,7 @@ export class Md2AccordionTab {\n* @return if it is disabled\n*/\n_handleClick(event: Event) {\n- if (this.disabled) {\n- event.preventDefault();\n- return;\n- }\n+ if (this.disabled) { return; }\nlet index = this.findTabIndex();\n" } ]
TypeScript
MIT License
promact/md2
chore(accordion) update performance and design and added animations
530,388
14.03.2017 14:32:24
-19,080
63c9fb7c0217077c8efdf69872b24a680c537932
chore(collapse) update performance and added events
[ { "change_type": "MODIFY", "old_path": "src/lib/collapse/README.md", "new_path": "src/lib/collapse/README.md", "diff": "@@ -8,6 +8,13 @@ Collapse is a directive, it's allow the user to toggle visiblity of the section.\n| --- | --- | --- |\n| `collapse` | `boolean` | toggle the visiblity of the section |\n+### Events\n+\n+| Name | Type | Description |\n+| --- | --- | --- |\n+| `expanded` | `Event` | Fired when collapse expanded |\n+| `collapsed` | `Event` | Fired when collapse collapsed |\n+\n### Examples\nA collapse would have the following markup.\n```html\n" }, { "change_type": "MODIFY", "old_path": "src/lib/collapse/collapse.ts", "new_path": "src/lib/collapse/collapse.ts", "diff": "import {\nDirective,\n+ EventEmitter,\nInput,\n+ Output,\nNgModule,\nModuleWithProviders\n} from '@angular/core';\n@@ -9,22 +11,26 @@ import { CommonModule } from '@angular/common';\n@Directive({\nselector: '[collapse]',\nhost: {\n- '[class.in]': '_isExpanded',\n+ 'role': 'collapse',\n+ '[class.in]': '_collapse',\n'[class.collapse]': 'true',\n- '[class.collapsing]': '_isCollapsing',\n- '[attr.aria-expanded]': '_isExpanded',\n- '[attr.aria-hidden]': '!_isExpanded',\n- }\n+ '[class.collapsing]': '_collapsing',\n+ '[attr.aria-expanded]': '_collapse',\n+ '[attr.aria-hidden]': '!_collapse'\n+ },\n+ exportAs: 'md2Collapse'\n})\n-\nexport class Md2Collapse {\n- _isExpanded: boolean = true;\n- _isCollapsing: boolean = false;\n+ _collapse: boolean = true;\n+ _collapsing: boolean = false;\n+\n+ @Output() collapsed: EventEmitter<void> = new EventEmitter<void>();\n+ @Output() expanded: EventEmitter<void> = new EventEmitter<void>();\n@Input()\n- get collapse(): boolean { return this._isExpanded; }\n+ get collapse(): boolean { return this._collapse; }\nset collapse(value: boolean) {\n- this._isExpanded = value;\n+ this._collapse = value;\nthis.toggle();\n}\n@@ -32,33 +38,36 @@ export class Md2Collapse {\n* toggle collapse\n*/\ntoggle() {\n- if (this._isExpanded) { this.hide(); } else { this.show(); }\n+ if (this._collapse) { this.hide(); } else { this.show(); }\n}\n/**\n- * hide collapse\n+ * show collapse\n*/\n- hide() {\n- this._isCollapsing = true;\n- this._isExpanded = false;\n+ show() {\n+ this._collapsing = true;\n+ this._collapse = true;\nsetTimeout(() => {\n- this._isCollapsing = false;\n+ this._collapsing = false;\n}, 4);\n+ this.expanded.emit();\n}\n/**\n- * show collapse\n+ * hide collapse\n*/\n- show() {\n- this._isCollapsing = true;\n- this._isExpanded = true;\n+ hide() {\n+ this._collapsing = true;\n+ this._collapse = false;\nsetTimeout(() => {\n- this._isCollapsing = false;\n+ this._collapsing = false;\n}, 4);\n+ this.collapsed.emit();\n}\n+\n}\n-export const MD2_COLLAPSE_DIRECTIVES: any[] = [Md2Collapse];\n+export const MD2_COLLAPSE_DIRECTIVES = [Md2Collapse];\n@NgModule({\nimports: [CommonModule],\n" } ]
TypeScript
MIT License
promact/md2
chore(collapse) update performance and added events
530,388
14.03.2017 14:33:20
-19,080
7872e94d2aa0fd9c3d38a613fc3dc91b37ce926a
chore: added exportAs for access the component
[ { "change_type": "MODIFY", "old_path": "src/lib/accordion/accordionpanel.ts", "new_path": "src/lib/accordion/accordionpanel.ts", "diff": "@@ -13,7 +13,8 @@ import { coerceBooleanProperty } from '../core/core';\nselector: 'md2-accordion',\ntemplate: `<ng-content></ng-content>`,\nstyleUrls: ['accordion.css'],\n- encapsulation: ViewEncapsulation.None\n+ encapsulation: ViewEncapsulation.None,\n+ exportAs: 'md2Accordion'\n})\nexport class Md2Accordion {\n" }, { "change_type": "MODIFY", "old_path": "src/lib/accordion/accordiontab.ts", "new_path": "src/lib/accordion/accordiontab.ts", "diff": "@@ -54,7 +54,8 @@ export class Md2AccordionHeader { }\n'[class.md2-accordion-tab-active]': 'active',\n'[class.md2-accordion-tab-disabled]': 'disabled'\n},\n- encapsulation: ViewEncapsulation.None\n+ encapsulation: ViewEncapsulation.None,\n+ exportAs: 'md2AccordionTab'\n})\nexport class Md2AccordionTab {\n" }, { "change_type": "MODIFY", "old_path": "src/lib/autocomplete/autocomplete.ts", "new_path": "src/lib/autocomplete/autocomplete.ts", "diff": "@@ -69,7 +69,8 @@ export class Md2AutocompleteChange {\n'[attr.aria-disabled]': 'disabled.toString()',\n'[class.md2-autocomplete-disabled]': 'disabled',\n},\n- encapsulation: ViewEncapsulation.None\n+ encapsulation: ViewEncapsulation.None,\n+ exportAs: 'md2Autocomplete'\n})\nexport class Md2Autocomplete implements AfterContentInit, ControlValueAccessor {\n" }, { "change_type": "MODIFY", "old_path": "src/lib/tags/tags.ts", "new_path": "src/lib/tags/tags.ts", "diff": "@@ -67,7 +67,8 @@ export const MD2_TAGS_CONTROL_VALUE_ACCESSOR: any = {\n'[attr.aria-disabled]': 'disabled'\n},\nproviders: [MD2_TAGS_CONTROL_VALUE_ACCESSOR],\n- encapsulation: ViewEncapsulation.None\n+ encapsulation: ViewEncapsulation.None,\n+ exportAs: 'md2Tags'\n})\nexport class Md2Tags implements AfterContentInit, ControlValueAccessor {\n" } ]
TypeScript
MIT License
promact/md2
chore: added exportAs for access the component
530,388
15.03.2017 10:53:00
-19,080
5e35cd39b5bc4d6de8f46891869a1b5bebbd0b50
chore(datepicker) added mode and container
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "<template portal>\n<div class=\"md2-datepicker-panel\" [@fadeInContent]=\"'showing'\" (@fadeInContent.done)=\"_onPanelDone()\"\n(keydown)=\"_handleKeydown($event)\" [style.transformOrigin]=\"_transformOrigin\"\n- [class.md2-datepicker-panel-done-animating]=\"_panelDoneAnimating\" tabindex=\"0\">\n+ [class.md2-datepicker-panel-done-animating]=\"_panelDoneAnimating\" tabindex=\"0\"\n+ [attr.container]=\"container\" [attr.mode]=\"mode\">\n<div class=\"md2-datepicker-header\">\n<div class=\"md2-datepicker-header-year\"\n[class.active]=\"_isYearsVisible\"\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -161,9 +161,18 @@ md2-datepicker {\ncolor: rgba(black, 0.87);\nbackground-color: white;\noverflow: hidden;\n- box-shadow: 0 11px 15px -7px rgba(black, 0.2), 0 24px 38px 3px rgba(black, 0.14), 0 9px 46px 8px rgba(black, 0.12);\n+ box-shadow: 0 5px 5px -3px rgba(black, 0.2), 0 8px 10px 1px rgba(black, 0.14), 0 3px 14px 2px rgba(black, 0.12);\noutline: none;\nuser-select: none;\n+\n+ &[container='dialog'] {\n+ box-shadow: 0 11px 15px -7px rgba(black, 0.2), 0 24px 38px 3px rgba(black, 0.14), 0 9px 46px 8px rgba(black, 0.12);\n+ }\n+\n+ &[mode='landscape'] {\n+ display: flex;\n+ width: 450px;\n+ }\n}\n.md2-datepicker-header {\n@@ -177,6 +186,14 @@ md2-datepicker {\n.hidden {\ndisplay: none;\n}\n+\n+ [mode='landscape'] & {\n+ width: 150px;\n+ min-width: 150px;\n+ padding-right: 15px;\n+ white-space: normal;\n+ word-wrap: break-word;\n+ }\n}\n.md2-datepicker-header-year {\n@@ -225,6 +242,11 @@ md2-datepicker {\n}\n}\n}\n+\n+ [mode='landscape'] & {\n+ display: block;\n+ padding-left: 0;\n+ }\n}\n.md2-datepicker-content {\n@@ -443,7 +465,6 @@ md2-clock {\nborder-radius: 50%;\nbackground-color: $primary;\n}\n- /*transition: all 100ms;*/\n}\n.md2-clock-hours,\n@@ -513,11 +534,12 @@ md2-clock {\n}\n@media (min-width: 480px) {\n- .md2-datepicker-panel {\n+ .md2-datepicker-panel[mode='auto'] {\ndisplay: flex;\nwidth: 450px;\n}\n+ [mode='auto'] {\n.md2-datepicker-header {\nwidth: 150px;\nmin-width: 150px;\n@@ -530,8 +552,6 @@ md2-clock {\ndisplay: block;\npadding-left: 0;\n}\n-\n- .md2-datepicker-content {\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -54,15 +54,12 @@ export class Md2DateChange {\nconstructor(public source: Md2Datepicker, public value: Date) { }\n}\n-let nextId = 0;\n-\nexport type Type = 'date' | 'time' | 'datetime';\n-export type Mode = 'inline' | 'popup';\n+export type Mode = 'auto' | 'portrait' | 'landscape';\n+export type Container = 'inline' | 'dialog';\nexport type PanelPositionX = 'before' | 'after';\nexport type PanelPositionY = 'above' | 'below';\n-\n-\n@Component({\nmoduleId: module.id,\nselector: 'md2-datepicker',\n@@ -70,7 +67,6 @@ export type PanelPositionY = 'above' | 'below';\nstyleUrls: ['datepicker.css'],\nhost: {\n'role': 'datepicker',\n- '[id]': 'id',\n'[class.md2-datepicker-disabled]': 'disabled',\n'[class.md2-datepicker-opened]': 'panelOpen',\n'[attr.tabindex]': 'disabled ? -1 : tabindex',\n@@ -101,7 +97,8 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nprivate _openOnFocus: boolean = false;\nprivate _type: Type = 'date';\n- private _mode: Mode = 'inline';\n+ private _mode: Mode = 'auto';\n+ private _container: Container = 'inline';\nprivate _format: string;\nprivate _required: boolean = false;\nprivate _disabled: boolean = false;\n@@ -155,8 +152,6 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nngOnDestroy() { this.destroyPanel(); }\n- @Input() name: string = '';\n- @Input() id: string = 'md2-datepicker-' + (++nextId);\n@Input() placeholder: string;\n@Input() tabindex: number = 0;\n@Input() enableDates: Array<Date> = [];\n@@ -223,8 +218,16 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n@Input()\nget mode() { return this._mode; }\nset mode(value: Mode) {\n- this._mode = value || 'inline';\n- if (this.panelOpen) { this.close(); }\n+ this._mode = value || 'auto';\n+ }\n+\n+ @Input()\n+ get container() { return this._container; }\n+ set container(value: Container) {\n+ if (this._container !== value) {\n+ this._container = value || 'inline';\n+ this.destroyPanel();\n+ }\n}\n@Input()\n@@ -762,7 +765,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nprivate _createOverlay(): void {\nif (!this._overlayRef) {\nlet config = new OverlayState();\n- if (this.mode === 'inline') {\n+ if (this.container === 'inline') {\nconst [posX, fallbackX]: HorizontalConnectionPos[] =\nthis.positionX === 'before' ? ['end', 'start'] : ['start', 'end'];\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) added mode and container
530,388
15.03.2017 10:53:24
-19,080
5d6be170eca30f3cc942437e8b219381aa68f776
chore(datepicker) update demo with mode and container
[ { "change_type": "MODIFY", "old_path": "src/demo-app/datepicker/datepicker-demo.html", "new_path": "src/demo-app/datepicker/datepicker-demo.html", "diff": "[disableWeekDays]=\"disableWeekDays\"\n[min]=\"minDate\"\n[max]=\"maxDate\"\n+ [mode]=\"mode\"\n+ [container]=\"container\"\n#dateControl=\"ngModel\"></md2-datepicker>\n<p> Value: {{ date }} </p>\n<p> Touched: {{ dateControl.touched }} </p>\n<p> Dirty: {{ dateControl.dirty }} </p>\n<p> Status: {{ dateControl.control?.status }} </p>\n- <div class=\"type\">\n- <md2-select [(ngModel)]=\"type\" placeholder=\"Select Picker Type\">\n+ <div>\n+ <div class=\"inline-control\">\n+ <md2-select [(ngModel)]=\"type\" placeholder=\"Picker Type\">\n<md2-option *ngFor=\"let t of types\" [value]=\"t.value\">{{ t.text }}</md2-option>\n</md2-select>\n</div>\n+ <div class=\"inline-control\">\n+ <md2-select [(ngModel)]=\"mode\" placeholder=\"Picker Mode\">\n+ <md2-option *ngFor=\"let m of modes\" [value]=\"m.value\">{{ m.text }}</md2-option>\n+ </md2-select>\n+ </div>\n+ <div class=\"inline-control\">\n+ <md2-select [(ngModel)]=\"container\" placeholder=\"Picker Container\">\n+ <md2-option *ngFor=\"let c of containers\" [value]=\"c.value\">{{ c.text }}</md2-option>\n+ </md2-select>\n+ </div>\n+ </div>\n+ <div>\n<button type=\"button\" button=\"primary\" (click)=\"setDate()\">SET VALUE</button>\n<button type=\"button\" button=\"primary\" (click)=\"setDateRange()\">SET RANGE</button>\n<button type=\"button\" button=\"primary\" (click)=\"isRequired=!isRequired\">TOGGLE REQUIRED</button>\n<button type=\"button\" button=\"primary\" (click)=\"dateControl.reset()\">RESET</button>\n</div>\n</div>\n+</div>\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/datepicker/datepicker-demo.ts", "new_path": "src/demo-app/datepicker/datepicker-demo.ts", "diff": "@@ -4,7 +4,7 @@ import { Component } from '@angular/core';\nmoduleId: module.id,\nselector: 'datepicker-demo',\ntemplateUrl: 'datepicker-demo.html',\n- styles: [` .type { width: 150px; padding: 16px 0; } `]\n+ styles: [` .inline-control { display: inline-block; width: 150px; margin-right: 16px; padding: 16px 0; } `]\n})\nexport class DatepickerDemo {\nisRequired = false;\n@@ -18,6 +18,17 @@ export class DatepickerDemo {\n{ text: 'Time', value: 'time' },\n{ text: 'Date Time', value: 'datetime' }];\n+ mode: string = 'auto';\n+ modes: Array<any> = [\n+ { text: 'Auto', value: 'auto' },\n+ { text: 'Portrait', value: 'portrait' },\n+ { text: 'Landscape', value: 'landscape' }];\n+\n+ container: string = 'inline';\n+ containers: Array<any> = [\n+ { text: 'Inline', value: 'inline' },\n+ { text: 'Dialog', value: 'dialog' }];\n+\ndate: Date = null;\nminDate: Date = null;\nmaxDate: Date = null;\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update demo with mode and container
530,388
15.03.2017 10:53:47
-19,080
d44e2056fef3d23d2835c6178b5118e1708872d7
chore(datepicker) update docs and APIs
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/README.md", "new_path": "src/lib/datepicker/README.md", "diff": "@@ -9,24 +9,26 @@ Datepicker allow the user to select date and time.\n| `type` | `'date' | 'time' | 'datetime'` | The type of the datepicker |\n| `required` | `boolean` | Whether or not the datepicker is required |\n| `disabled` | `boolean` | Whether or not the datepicker is disabled |\n-| `name` | `number` | Datepicker name. |\n-| `id` | `number` | The unique ID of this datepicker. |\n-| `min` | `number` | The min date of Datepicker. |\n-| `max` | `number` | The max date of Datepicker. |\n-| `placeholder` | `number` | Datepicker placeholder label |\n-| `format` | `number` | The date format of datepicker |\n+| `min` | `date` | The min date of Datepicker. |\n+| `max` | `date` | The max date of Datepicker. |\n+| `placeholder` | `string` | Datepicker placeholder label |\n+| `format` | `string` | The date format of datepicker |\n| `tabindex` | `number` | The tabIndex of the datepicker. |\n| `openOnFocus` | `boolean` | Opend Calendar Whether or not the datepicker is openOnFocus. |\n-| `isOpen` | `number` | Opend Calendar Whether or not the datepicker is isOpen. |\n+| `isOpen` | `boolean` | Opend Calendar Whether or not the datepicker is isOpen. |\n| `enableDates` | `Array<Date>` | Enable dates. |\n| `disableDates` | `Array<Date>` | Disable Dates. |\n| `disableWeekDays` | `Array<number>` | Disable Week Days. |\n+| `mode` | `'auto' | 'portrait' | 'landscape'` | Mode of the Datepicker, default auto. |\n+| `container` | `'inline' | 'dialog'` | Container of the Datepicker, default inline. |\n### Events\n| Name | Type | Description |\n| --- | --- | --- |\n| `change` | `Event` | Fired when change date |\n+| `onOpen` | `Event` | Fired when open the Datepicker Panel |\n+| `onClose` | `Event` | Fired when close the Datepicker Panel |\n### Examples\nA datepicker would have the following markup.\n@@ -34,7 +36,7 @@ A datepicker would have the following markup.\n<md2-datepicker [(ngModel)]=\"date\"></md2-datepicker>\n```\n-### Format\n+### Date Format\n| COMPONENT | SYMBOL | NARROW | SHORT FORM | LONG FORM | NUMERIC | 2-DIGIT |\n| --------- | ------ | ------ | ---------- | ---------------- | ------- | ------- |\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update docs and APIs
530,388
15.03.2017 11:05:51
-19,080
e038eb0208e9e91388108a83d2c71f1e156e18fa
chore(datepicker) fixed header issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "[attr.container]=\"container\" [attr.mode]=\"mode\">\n<div class=\"md2-datepicker-header\">\n<div class=\"md2-datepicker-header-year\"\n+ *ngIf=\"type!=='time'\"\n[class.active]=\"_isYearsVisible\"\n- [class.hidden]=\"type==='time'\"\n(click)=\"_showYear()\">{{ date | date: 'y' }}</div>\n<div class=\"md2-datepicker-header-date-time\">\n<span class=\"md2-datepicker-header-date\"\n+ *ngIf=\"type!=='time'\"\n[class.active]=\"_isCalendarVisible && !_isYearsVisible\"\n- [class.hidden]=\"type==='time'\"\n(click)=\"_showCalendar()\">\n{{ date | date: 'EEE, MMM dd' }}\n</span>\n<span class=\"md2-datepicker-header-time\"\n- [class.active]=\"!_isCalendarVisible\"\n- [class.hidden]=\"type==='date'\">\n+ *ngIf=\"type!=='date'\"\n+ [class.active]=\"!_isCalendarVisible\">\n<span class=\"md2-datepicker-header-hour\"\n[class.active]=\"_clockView === 'hour'\"\n(click)=\"_toggleHours('hour')\">{{ date.getHours() }}</span>:<span class=\"md2-datepicker-header-minute\"\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -183,10 +183,6 @@ md2-datepicker {\nbackground: $primary;\nbox-sizing: border-box;\n- .hidden {\n- display: none;\n- }\n-\n[mode='landscape'] & {\nwidth: 150px;\nmin-width: 150px;\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -798,7 +798,6 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n.centerHorizontally()\n.centerVertically();\nconfig.hasBackdrop = true;\n- config.backdropClass = 'cdk-overlay-dark-backdrop';\n}\nthis._overlayRef = this.overlay.create(config);\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) fixed header issue
530,388
15.03.2017 11:06:18
-19,080
be2356872abeebe1fa997b39127f6098741ba972
chore(dialog) remove un-used backdrop class
[ { "change_type": "MODIFY", "old_path": "src/lib/dialog/dialog.ts", "new_path": "src/lib/dialog/dialog.ts", "diff": "@@ -146,7 +146,6 @@ export class Md2Dialog implements OnDestroy {\n.centerHorizontally()\n.centerVertically();\nconfig.hasBackdrop = true;\n- config.backdropClass = 'cdk-overlay-dark-backdrop';\nthis._overlayRef = this._overlay.create(config);\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(dialog) remove un-used backdrop class
530,388
15.03.2017 14:37:50
-19,080
2c75cd10f2490fb42f6ff091e1e8acc9861af2ad
chore(datepicker) update overlay issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -27,7 +27,7 @@ md2-datepicker {\n.md2-datepicker-trigger {\ndisplay: block;\n- padding: 18px 0 18px 32px;\n+ padding: 18px 0 4px 32px;\nwhite-space: nowrap;\ncursor: pointer;\n}\n@@ -156,7 +156,7 @@ md2-datepicker {\n}\n.md2-datepicker-panel {\n- width: 300px;\n+ width: 276px;\nborder-radius: 3px;\ncolor: rgba(black, 0.87);\nbackground-color: white;\n@@ -171,7 +171,7 @@ md2-datepicker {\n&[mode='landscape'] {\ndisplay: flex;\n- width: 450px;\n+ width: 426px;\n}\n}\n@@ -353,7 +353,7 @@ md2-datepicker {\n}\n.md2-calendar-dates {\n- margin: 0 auto;\n+ margin: 0 8px;\nth {\nwidth: 35px;\n@@ -532,7 +532,7 @@ md2-clock {\n@media (min-width: 480px) {\n.md2-datepicker-panel[mode='auto'] {\ndisplay: flex;\n- width: 450px;\n+ width: 426px;\n}\n[mode='auto'] {\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -76,7 +76,8 @@ export type PanelPositionY = 'above' | 'below';\n'[attr.aria-invalid]': '_control?.invalid || \"false\"',\n'(keydown)': '_handleKeydown($event)',\n'(focus)': '_onFocus()',\n- '(blur)': '_onBlur()'\n+ '(blur)': '_onBlur()',\n+ '(window:resize)': '_handleWindowResize($event)'\n},\nanimations: [\nfadeInContent,\n@@ -164,6 +165,8 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n/** Position of the menu in the Y axis. */\npositionY: PanelPositionY = 'below';\n+ overlapTrigger: boolean = true;\n+\n@Input()\nget value() { return this._value; }\nset value(value: Date) {\n@@ -348,6 +351,12 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis._panelDoneAnimating = this.panelOpen;\n}\n+ _handleWindowResize(event: Event) {\n+ if (this.container === 'inline') {\n+ this.close();\n+ }\n+ }\n+\nprivate _focusPanel(): void {\nlet el: any = document.querySelectorAll('.md2-datepicker-panel')[0];\nel.focus();\n@@ -671,12 +680,6 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nfor (let d of this.disableWeekDays) {\nif (date.getDay() === d) { return true; }\n}\n- // if (disableWeekends) {\n- // let dayNbr = this.getDayNumber(date);\n- // if (dayNbr === 0 || dayNbr === 6) {\n- // return true;\n- // }\n-\nreturn !this._locale.isDateWithinRange(date, this._min, this._max);\n}\n@@ -775,12 +778,13 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nlet originY = overlayY;\nlet fallbackOriginY = fallbackOverlayY;\n- //if (!this.menu.overlapTrigger) {\n- // originY = overlayY === 'top' ? 'bottom' : 'top';\n- // fallbackOriginY = fallbackOverlayY === 'top' ? 'bottom' : 'top';\n- //}\n+ if (!this.overlapTrigger) {\n+ originY = overlayY === 'top' ? 'bottom' : 'top';\n+ fallbackOriginY = fallbackOverlayY === 'top' ? 'bottom' : 'top';\n+ }\nconfig.positionStrategy = this.overlay.position().connectedTo(this._element,\n- { originX: posX, originY: originY }, { overlayX: posX, overlayY: overlayY })\n+ { originX: posX, originY: originY },\n+ { overlayX: posX, overlayY: overlayY })\n.withFallbackPosition(\n{ originX: fallbackX, originY: originY },\n{ overlayX: fallbackX, overlayY: overlayY })\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update overlay issue
530,388
15.03.2017 15:18:06
-19,080
b6833978426c958bf0eb160178e055fd81740c65
chore(datepicker) added feature to user can able to clear the selected date value
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "<div class=\"md2-datepicker-input\">\n<span class=\"md2-datepicker-placeholder\" [class.md2-floating-placeholder]=\"value\">{{ placeholder }}</span>\n<input class=\"md2-datepicker-value\" type=\"text\" [value]=\"value | date:format\" />\n- <span class=\"md2-datepicker-arrow\"></span>\n+ <span *ngIf=\"!value || required || disabled\" class=\"md2-datepicker-arrow\"></span>\n+ <span *ngIf=\"value && !required && !disabled\"\n+ class=\"md2-datepicker-clear\" (click)=\"_clearValue($event)\">\n+ <svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\">\n+ <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n+ </svg>\n+ </span>\n</div>\n</div>\n<template portal>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -58,6 +58,7 @@ md2-datepicker {\nmin-width: $md2-datepicker-trigger-min-width;\nline-height: 22px;\nposition: relative;\n+ padding-right: 20px;\nbox-sizing: border-box;\n[aria-disabled='true'] & {\n@@ -138,6 +139,8 @@ md2-datepicker {\n}\n.md2-datepicker-arrow {\n+ position: absolute;\n+ right: 0;\nwidth: 0;\nheight: 0;\nborder-left: $md2-datepicker-arrow-size solid transparent;\n@@ -155,6 +158,17 @@ md2-datepicker {\n}\n}\n+.md2-datepicker-clear {\n+ position: absolute;\n+ right: 0;\n+ height: 20px;\n+ color: rgba(black, 0.54);\n+\n+ svg {\n+ fill: currentColor;\n+ }\n+}\n+\n.md2-datepicker-panel {\nwidth: 276px;\nborder-radius: 3px;\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -507,6 +507,11 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n}\n}\n+ _clearValue(event: Event) {\n+ event.stopPropagation();\n+ this.value = null;\n+ }\n+\n/**\n* Display Years\n*/\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) added feature to user can able to clear the selected date value
530,388
15.03.2017 16:01:41
-19,080
ef1ec005d9a0d6bed7bc7799e417760cac2f9a35
chore(datepicker) replaced input with span
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "</div>\n<div class=\"md2-datepicker-input\">\n<span class=\"md2-datepicker-placeholder\" [class.md2-floating-placeholder]=\"value\">{{ placeholder }}</span>\n- <input class=\"md2-datepicker-value\" type=\"text\" [value]=\"value | date:format\" />\n+ <span class=\"md2-datepicker-value\">{{ value | date:format }}</span>\n<span *ngIf=\"!value || required || disabled\" class=\"md2-datepicker-arrow\"></span>\n<span *ngIf=\"value && !required && !disabled\"\nclass=\"md2-datepicker-clear\" (click)=\"_clearValue($event)\">\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) replaced input with span
530,388
16.03.2017 09:39:52
-19,080
24979ee170511784f0277a3cad8229de54466dc1
fix(datepicker) set time static issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -168,23 +168,40 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\noverlapTrigger: boolean = true;\n@Input()\n- get value() { return this._value; }\n- set value(value: Date) {\n- this._value = this.coerceDateProperty(value);\n- if (value && value !== this._value) {\n- if (this._locale.isValidDate(value)) {\n- this._value = value;\n- } else {\n- if (this.type === 'time') {\n- let t = value + '';\n- this._value = new Date();\n- this._value.setHours(parseInt(t.substring(0, 2)));\n- this._value.setMinutes(parseInt(t.substring(3, 5)));\n- } else {\n- this._value = new Date(value);\n+ get type() { return this._type; }\n+ set type(value: Type) {\n+ this._type = value || 'date';\n+ }\n+\n+ @Input()\n+ get format() {\n+ return this._format || (this.type === 'date' ?\n+ 'dd/MM/y' : this.type === 'time' ? 'HH:mm' : this.type === 'datetime' ?\n+ 'dd/MM/y HH:mm' : 'dd/MM/y');\n+ }\n+ set format(value: string) {\n+ if (this._format !== value) { this._format = value; }\n}\n+\n+ @Input()\n+ get mode() { return this._mode; }\n+ set mode(value: Mode) {\n+ this._mode = value || 'auto';\n}\n+\n+ @Input()\n+ get container() { return this._container; }\n+ set container(value: Container) {\n+ if (this._container !== value) {\n+ this._container = value || 'inline';\n+ this.destroyPanel();\n}\n+ }\n+\n+ @Input()\n+ get value() { return this._value; }\n+ set value(value: Date) {\n+ this._value = this.coerceDateProperty(value);\nthis.date = this._value;\n}\n@@ -212,41 +229,10 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n// }\n}\n- @Input()\n- get type() { return this._type; }\n- set type(value: Type) {\n- this._type = value || 'date';\n- }\n-\n- @Input()\n- get mode() { return this._mode; }\n- set mode(value: Mode) {\n- this._mode = value || 'auto';\n- }\n-\n- @Input()\n- get container() { return this._container; }\n- set container(value: Container) {\n- if (this._container !== value) {\n- this._container = value || 'inline';\n- this.destroyPanel();\n- }\n- }\n-\n@Input()\nget selected() { return this._selected; }\nset selected(value: Date) { this._selected = value; }\n- @Input()\n- get format() {\n- return this._format || (this.type === 'date' ?\n- 'dd/MM/y' : this.type === 'time' ? 'HH:mm' : this.type === 'datetime' ?\n- 'dd/MM/y HH:mm' : 'dd/MM/y');\n- }\n- set format(value: string) {\n- if (this._format !== value) { this._format = value; }\n- }\n-\n@Input()\nget required(): boolean { return this._required; }\nset required(value) { this._required = coerceBooleanProperty(value); }\n@@ -366,10 +352,22 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis._renderer.invokeElementMethod(this._element.nativeElement, 'focus');\n}\n- private coerceDateProperty(value: any, fallbackValue = new Date()): Date {\n+ private coerceDateProperty(value: any): Date {\n+ let v: Date = null;\n+ if (this._locale.isValidDate(value)) {\n+ v = value;\n+ } else {\n+ if (value && this.type === 'time') {\n+ let t = value + '';\n+ v = new Date();\n+ v.setHours(parseInt(t.substring(0, 2)));\n+ v.setMinutes(parseInt(t.substring(3, 5)));\n+ } else {\nlet timestamp = Date.parse(value);\n- fallbackValue = null;\n- return isNaN(timestamp) ? fallbackValue : new Date(timestamp);\n+ v = isNaN(timestamp) ? null : new Date(timestamp);\n+ }\n+ }\n+ return v;\n}\n@HostListener('click', ['$event'])\n" } ]
TypeScript
MIT License
promact/md2
fix(datepicker) set time static issue #117
530,388
16.03.2017 11:07:03
-19,080
550377fdfff49481eb529f1b13fdadcd6ca47e2d
chore(datepicker) added property for set label of 'Ok' and 'Cancel' buttons and update local property issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/date-locale.ts", "new_path": "src/lib/datepicker/date-locale.ts", "diff": "@@ -37,9 +37,13 @@ export class DateLocale {\n.concat(this.days.slice(0, this.firstDayOfWeek));\n}\n- getDateLabel(d: number) { return `${d}`; }\n+ getDayLabel(d: number) { return `${d}`; }\n- getMonthLabel(m: number, y: number) { return `${this.months[m].short.toUpperCase()} ${y}`; }\n+ getDateLabel(d: Date) {\n+ return `${this.days[d.getDay()].short}, ${this.months[d.getMonth()].short} ${d.getDate()}`;\n+ }\n+\n+ getMonthLabel(m: number, y: number) { return `${this.months[m].full} ${y}`; }\ngetYearLabel(y: number) { return `${y}`; }\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "*ngIf=\"type!=='time'\"\n[class.active]=\"_isCalendarVisible && !_isYearsVisible\"\n(click)=\"_showCalendar()\">\n- {{ date | date: 'EEE, MMM dd' }}\n+ {{ getDateLabel }}\n</span>\n<span class=\"md2-datepicker-header-time\"\n*ngIf=\"type!=='date'\"\n<path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"></path>\n</svg>\n</div>\n- <div class=\"md2-calendar-month-year\" [@slideCalendar]=\"_calendarState\">{{ date | date: 'MMMM y' }}</div>\n+ <div class=\"md2-calendar-month-year\" [@slideCalendar]=\"_calendarState\">{{ getMonthLabel }}</div>\n<div class=\"md2-button\"\n[class.disabled]=\"!_isAfterMonth()\"\n(click)=\"_isAfterMonth() && _updateMonth(1)\">\n(onHourChange)=\"_onHourChange($event)\"\n(onMinuteChange)=\"_onMinuteChange($event)\"></md2-clock>\n<div class=\"md2-datepicker-actions\">\n- <div class=\"md2-button\" (click)=\"close()\">Cancel</div>\n- <div class=\"md2-button\" (click)=\"_onClickOk()\">Ok</div>\n+ <div class=\"md2-button\" (click)=\"close()\">{{ cancelLabel }}</div>\n+ <div class=\"md2-button\" (click)=\"_onClickOk()\">{{ okLabel }}</div>\n</div>\n</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -154,6 +154,8 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nngOnDestroy() { this.destroyPanel(); }\n@Input() placeholder: string;\n+ @Input() okLabel: string = 'Ok';\n+ @Input() cancelLabel: string = 'Cancel';\n@Input() tabindex: number = 0;\n@Input() enableDates: Array<Date> = [];\n@Input() disableDates: Array<Date> = [];\n@@ -274,6 +276,14 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nreturn this._panelOpen;\n}\n+ get getDateLabel(): string {\n+ return this._locale.getDateLabel(this.date);\n+ }\n+\n+ get getMonthLabel(): string {\n+ return this._locale.getMonthLabel(this.date.getMonth(), this.date.getFullYear());\n+ }\n+\ntoggle(): void {\nthis.panelOpen ? this.close() : this.open();\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) added property for set label of 'Ok' and 'Cancel' buttons #121 and update local property issue #122
530,388
16.03.2017 11:07:50
-19,080
61005186d14de0cdc4b08bf9d88e4e47a7931778
chore(datepicker) update docs property
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/README.md", "new_path": "src/lib/datepicker/README.md", "diff": "@@ -12,6 +12,8 @@ Datepicker allow the user to select date and time.\n| `min` | `date` | The min date of Datepicker. |\n| `max` | `date` | The max date of Datepicker. |\n| `placeholder` | `string` | Datepicker placeholder label |\n+| `okLabel` | `string` | Datepicker Ok label |\n+| `cancelLabel` | `string` | Datepicker Cancel label |\n| `format` | `string` | The date format of datepicker |\n| `tabindex` | `number` | The tabIndex of the datepicker. |\n| `openOnFocus` | `boolean` | Opend Calendar Whether or not the datepicker is openOnFocus. |\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update docs property
530,388
16.03.2017 14:10:19
-19,080
46825b85f64d78d17ac0b0eac67398f178664127
chore(select) update animation
[ { "change_type": "MODIFY", "old_path": "src/lib/select/select-animations.ts", "new_path": "src/lib/select/select-animations.ts", "diff": "@@ -11,7 +11,7 @@ import {\n* The following are all the animations for the md2-select component, with each\n* const containing the metadata for one animation.\n*\n- * The values below match the implementation of the Material 1 md2-select animation.\n+ * The values below match the implementation of the AngularJS Material md2-select animation.\n*/\n/**\n@@ -46,13 +46,13 @@ export const transformPanel: AnimationEntryMetadata = trigger('transformPanel',\nstate('showing', style({\nopacity: 1,\nminWidth: 'calc(100% + 32px)',\n- transform: `translate3d(0,0,0) scaleY(1)`\n+ transform: `scaleY(1)`\n})),\ntransition('void => *', [\nstyle({\nopacity: 0,\nminWidth: '100%',\n- transform: `translate3d(0, 0, 0) scaleY(0)`\n+ transform: `scaleY(0)`\n}),\nanimate(`150ms cubic-bezier(0.25, 0.8, 0.25, 1)`)\n]),\n" } ]
TypeScript
MIT License
promact/md2
chore(select) update animation
530,388
16.03.2017 14:17:30
-19,080
662240202002b64c5e8019c577ed88c48b0cfffc
chore(datepicker) update clear value model event
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -518,6 +518,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n_clearValue(event: Event) {\nevent.stopPropagation();\nthis.value = null;\n+ this._emitChangeEvent();\n}\n/**\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update clear value model event
530,388
16.03.2017 19:46:18
-19,080
58eef1077d4460f10d85243b920e74c349ab92a5
chore: update demo app style
[ { "change_type": "MODIFY", "old_path": "src/demo-app/assets/css/style.scss", "new_path": "src/demo-app/assets/css/style.scss", "diff": "@@ -33,13 +33,14 @@ summary {\nline-height: 26px;\nborder: 0;\nborder-bottom: 1px solid rgba(0, 0, 0, 0.12);\n-}\n+ background: transparent;\n-.md2-input:focus {\n+ &:focus {\nmargin-bottom: 7px;\nborder-bottom: 2px solid $primary;\noutline: none;\n}\n+}\na {\ncolor: $primary;\n@@ -281,17 +282,19 @@ html, body {\n.main {\nposition: relative;\nmargin-left: 280px;\n- padding: 0 30px 130px;\n+ padding: 60px 30px 130px;\nmin-height: 100%;\nbox-sizing: border-box;\n.toolbar {\n- position: relative;\n- margin: 0 -30px;\n+ position: absolute;\n+ top: 0;\n+ right: 0;\n+ left: 0;\npadding: 0 30px;\ncolor: $white;\nbackground: rgba($primary, 0.9);\n- box-shadow: 0 0 8px rgba($black, 0.3);\n+ box-shadow: 0 1px 8px rgba($black, 0.3);\n.sidenav-toggle {\nposition: relative;\n@@ -410,7 +413,6 @@ html, body {\nposition: fixed;\ntop: 0;\nwidth: 100%;\n- margin: 0 -15px;\npadding: 0 15px;\nz-index: 111;\nbox-sizing: border-box;\n" } ]
TypeScript
MIT License
promact/md2
chore: update demo app style
530,396
17.03.2017 10:31:16
-19,080
5b2f9c81659d13d15c89f2e4d17eb5b4f46aa53d
chore(color picker) integrate colorpicker container configure
[ { "change_type": "MODIFY", "old_path": "src/demo-app/colorpicker/colorpicker-demo.html", "new_path": "src/demo-app/colorpicker/colorpicker-demo.html", "diff": "-<div class=\"demo-autocomplete\">\n+<div class=\"demo-colorpicker\">\n<h1>Colorpicker</h1>\n<hr />\n<div class=\"card\">\n(change)=\"handleChange($event)\"\n[required]=\"isRequired\"\n[disabled]=\"isDisabled\"\n+ [container]=\"container\"\n#colorpickerControl=\"ngModel\"></md2-colorpicker>\n+\n<p> Value: {{ _color }} </p>\n<p> Touched: {{ colorpickerControl.touched }} </p>\n<p> Dirty: {{ colorpickerControl.dirty }} </p>\n<p> Status: {{ colorpickerControl.control?.status }} </p>\n+ <div class=\"inline-control\">\n+ <md2-select name=\"container\" [(ngModel)]=\"container\" placeholder=\"Picker Container\">\n+ <md2-option *ngFor=\"let c of containers\" [value]=\"c.value\">{{ c.text }}</md2-option>\n+ </md2-select>\n+ </div>\n+\n<button type=\"button\" button=\"primary\" (click)=\"_color='#234321'\">SET VALUE</button>\n<button type=\"button\" button=\"primary\" (click)=\"isRequired=!isRequired\">TOGGLE REQUIRED</button>\n<button type=\"button\" button=\"primary\" (click)=\"isDisabled=!isDisabled\">TOGGLE DISABLED</button>\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/colorpicker/colorpicker-demo.ts", "new_path": "src/demo-app/colorpicker/colorpicker-demo.ts", "diff": "@@ -9,6 +9,10 @@ export class ColorpickerDemo {\n_color: string = null;\nisRequired = false;\nisDisabled = false;\n+ container: string = 'inline';\n+ containers: Array<any> = [\n+ { text: 'Inline', value: 'inline' },\n+ { text: 'Dialog', value: 'dialog' }];\nhandleChange(value: any) {\nconsole.log('Changed color: ', value);\n}\n" }, { "change_type": "MODIFY", "old_path": "src/lib/colorpicker/colorpicker.scss", "new_path": "src/lib/colorpicker/colorpicker.scss", "diff": "@@ -70,7 +70,11 @@ $warn: #f44336 !default;\ncolor: $primary;\nborder-color: $primary;\n}\n-\n+.inline-control {\n+ width: 150px;\n+ margin-right: 16px;\n+ padding: 16px 0;\n+}\n.md2-colorpicker-placeholder {\nposition: absolute;\nright: 18px;\n" }, { "change_type": "MODIFY", "old_path": "src/lib/colorpicker/colorpicker.ts", "new_path": "src/lib/colorpicker/colorpicker.ts", "diff": "@@ -29,11 +29,14 @@ import {\nOverlayRef,\nPortal,\nPortalModule,\n- TemplatePortalDirective\n+ TemplatePortalDirective,\n+ HorizontalConnectionPos,\n+ VerticalConnectionPos\n} from '../core';\nimport { Subscription } from 'rxjs/Subscription';\nimport { ColorpickerService } from './calculateColor';\nimport { coerceBooleanProperty } from '../core/coercion/boolean-property';\n+import { Container, PanelPositionX, PanelPositionY } from '../datepicker/datepicker';\nlet nextId = 0;\n@@ -167,6 +170,7 @@ export class Md2ColorChange {\nconstructor(public source: Md2Colorpicker, public color: string) { }\n}\n+\n@Component({\nmoduleId: module.id,\nselector: 'md2-colorpicker',\n@@ -220,10 +224,10 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\nisInputFocus: boolean = false;\n/** The placeholder displayed in the trigger of the select. */\n- private _placeholder: string = 'Color';\n+ private _placeholder: string;\nprivate fontColor: string;\nprivate backAreaColor: string;\n-\n+ private _container: Container = 'inline';\nprivate isInputValidColor: boolean = false;\n_onChange = (value: any) => { };\n@@ -255,6 +259,12 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n@Input() tabindex: number = 0;\n@Input() id: string = 'md2-colorpicker-' + (++nextId);\n+ /** Position of the colorpicker in the X axis. */\n+ positionX: PanelPositionX = 'after';\n+\n+ /** Position of the colorpicker in the Y axis. */\n+ positionY: PanelPositionY = 'below';\n+ overlapTrigger: boolean = true;\nget value(): any {\nreturn this._innerValue;\n@@ -271,6 +281,15 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n}\n}\n+ @Input()\n+ get container() { return this._container; }\n+ set container(value: Container) {\n+ if (this._container !== value) {\n+ this._container = value || 'inline';\n+ this.destroyPanel();\n+ }\n+ }\n+\nget setGradient() {\nreturn {\n'background-image': 'linear-gradient(to right, transparent, transparent),' +\n@@ -355,8 +374,10 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\nthis._backdropSubscription.unsubscribe();\n}\nthis._isColorpickerVisible = false;\n+ if (this._innerValue) {\nthis.setColorFromString(this._innerValue);\n}\n+ }\n/** Removes the panel from the DOM. */\ndestroyPanel(): void {\n@@ -584,13 +605,44 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\nprivate _createOverlay(): void {\nif (!this._overlayRef) {\nlet config = new OverlayState();\n+ if (this.container === 'inline') {\n+ const [posX, fallbackX]: HorizontalConnectionPos[] =\n+ this.positionX === 'before' ? ['end', 'start'] : ['start', 'end'];\n+\n+ const [overlayY, fallbackOverlayY]: VerticalConnectionPos[] =\n+ this.positionY === 'above' ? ['bottom', 'top'] : ['top', 'bottom'];\n+\n+ let originY = overlayY;\n+ let fallbackOriginY = fallbackOverlayY;\n+\n+ if (!this.overlapTrigger) {\n+ originY = overlayY === 'top' ? 'bottom' : 'top';\n+ fallbackOriginY = fallbackOverlayY === 'top' ? 'bottom' : 'top';\n+ }\n+ config.positionStrategy = this.overlay.position().connectedTo(this._element,\n+ { originX: posX, originY: originY },\n+ { overlayX: posX, overlayY: overlayY })\n+ .withFallbackPosition(\n+ { originX: fallbackX, originY: originY },\n+ { overlayX: fallbackX, overlayY: overlayY })\n+ .withFallbackPosition(\n+ { originX: posX, originY: fallbackOriginY },\n+ { overlayX: posX, overlayY: fallbackOverlayY })\n+ .withFallbackPosition(\n+ { originX: fallbackX, originY: fallbackOriginY },\n+ { overlayX: fallbackX, overlayY: fallbackOverlayY });\n+ config.hasBackdrop = true;\n+ config.backdropClass = 'cdk-overlay-transparent-backdrop';\n+ } else {\nconfig.positionStrategy = this.overlay.position()\n.global()\n.centerHorizontally()\n.centerVertically();\nconfig.hasBackdrop = true;\n- config.backdropClass = 'cdk-overlay-dark-backdrop';\n+ //config.backdropClass = 'cdk-overlay-dark-backdrop';\n+\n+ }\nthis._overlayRef = this.overlay.create(config);\n}\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(color picker) integrate colorpicker container configure
530,388
17.03.2017 16:23:20
-19,080
f72703f8e17aa6b64bec72f907509a1907989e3d
chore(dialog) initialized dialog configurations
[ { "change_type": "MODIFY", "old_path": "src/lib/dialog/dialog.html", "new_path": "src/lib/dialog/dialog.html", "diff": "<template md2DialogPortal>\n- <div class=\"md2-dialog-panel\" [@state]=\"_visibility\" (@state.done)=\"_onPanelDone()\">\n+ <div class=\"md2-dialog-panel\" [attr.role]=\"dialogConfig?.role\"\n+ [@state]=\"_visibility\" (@state.done)=\"_onPanelDone()\">\n<div class=\"md2-dialog-content\">\n<div class=\"md2-dialog-header\">\n- <button type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"close()\">&times;</button>\n+ <button *ngIf=\"!config.disableClose\" type=\"button\" class=\"close\" aria-label=\"Close\" (click)=\"close()\">&times;</button>\n<h2 *ngIf=\"dialogTitle\" class=\"md2-dialog-title\" id=\"myDialogLabel\" [innerHtml]=\"dialogTitle\"></h2>\n<ng-content select=\"md2-dialog-title\"></ng-content>\n</div>\n<div class=\"md2-dialog-body\">\n+ <ng-content select=\"md2-dialog-content\"></ng-content>\n<ng-content></ng-content>\n</div>\n<ng-content select=\"md2-dialog-footer\"></ng-content>\n+ <ng-content select=\"md2-dialog-actions\"></ng-content>\n</div>\n</div>\n</template>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/lib/dialog/dialog.ts", "new_path": "src/lib/dialog/dialog.ts", "diff": "@@ -25,10 +25,17 @@ import {\nOverlayModule,\nTemplatePortalDirective\n} from '../core/core';\n+import { extendObject } from '../core/util/object-extend';\nimport { Subscription } from 'rxjs/Subscription';\nimport 'rxjs/add/operator/first';\nexport type DialogVisibility = 'initial' | 'visible' | 'hidden';\n+export type DialogRole = 'dialog' | 'alertdialog';\n+\n+export class Md2DialogConfig {\n+ role?: DialogRole = 'dialog';\n+ disableClose?: boolean = false;\n+}\n@Directive({ selector: '[md2DialogPortal]' })\nexport class Md2DialogPortal extends TemplatePortalDirective {\n@@ -37,11 +44,24 @@ export class Md2DialogPortal extends TemplatePortalDirective {\n}\n}\n+/**\n+ * Title of a dialog element. Stays fixed to the top of the dialog when scrolling.\n+ */\n@Directive({ selector: 'md2-dialog-title' })\nexport class Md2DialogTitle { }\n-@Directive({ selector: 'md2-dialog-footer' })\n-export class Md2DialogFooter { }\n+/**\n+ * Scrollable content container of a dialog.\n+ */\n+@Directive({ selector: 'md2-dialog-content' })\n+export class Md2DialogContent { }\n+\n+/**\n+ * Container for the bottom action buttons in a dialog.\n+ * Stays fixed to the bottom when scrolling.\n+ */\n+@Directive({ selector: 'md2-dialog-footer, md2-dialog-actions' })\n+export class Md2DialogActions { }\n@Component({\nmoduleId: module.id,\n@@ -50,6 +70,7 @@ export class Md2DialogFooter { }\nstyleUrls: ['dialog.css'],\nhost: {\n'tabindex': '0',\n+ '[attr.role]': 'config?.role',\n'(body:keydown.esc)': '_handleEscKeydown($event)'\n},\nanimations: [\n@@ -70,6 +91,7 @@ export class Md2Dialog implements OnDestroy {\nprivate _panelOpen = false;\nprivate _overlayRef: OverlayRef = null;\nprivate _backdropSubscription: Subscription;\n+ config: Md2DialogConfig;\n/** Property watched by the animation framework to show or hide the dialog */\n_visibility: DialogVisibility = 'initial';\n@@ -87,7 +109,8 @@ export class Md2Dialog implements OnDestroy {\nngOnDestroy() { this.destroyPanel(); }\n/** Open the dialog */\n- open(): Promise<Md2Dialog> {\n+ open(config?: Md2DialogConfig): Promise<Md2Dialog> {\n+ this.config = _applyConfigDefaults(config);\nif (this._panelOpen) {\nreturn Promise.resolve<Md2Dialog>(this);\n}\n@@ -105,8 +128,10 @@ export class Md2Dialog implements OnDestroy {\nthis._panelOpen = false;\nif (this._overlayRef) {\nthis._overlayRef.detach();\n+ if (this._backdropSubscription) {\nthis._backdropSubscription.unsubscribe();\n}\n+ }\nreturn Promise.resolve<Md2Dialog>(this);\n}\n@@ -129,13 +154,15 @@ export class Md2Dialog implements OnDestroy {\n}\n_handleEscKeydown(event: KeyboardEvent) {\n+ if (this._panelOpen && !this.config.disableClose) {\nthis.close();\n}\n+ }\nprivate _subscribeToBackdrop(): void {\n- this._backdropSubscription = this._overlayRef.backdropClick().subscribe(() => {\n- this.close();\n- });\n+ if (!this.config.disableClose) {\n+ this._backdropSubscription = this._overlayRef.backdropClick().first().subscribe(() => this.close());\n+ }\n}\nprivate _createOverlay(): void {\n@@ -159,10 +186,20 @@ export class Md2Dialog implements OnDestroy {\n}\n+/**\n+ * Applies default options to the dialog config.\n+ * @param dialogConfig Config to be modified.\n+ * @returns The new configuration object.\n+ */\n+function _applyConfigDefaults(dialogConfig: Md2DialogConfig): Md2DialogConfig {\n+ return extendObject(new Md2DialogConfig(), dialogConfig);\n+}\n+\nexport const MD2_DIALOG_DIRECTIVES: any[] = [\nMd2Dialog,\nMd2DialogTitle,\n- Md2DialogFooter,\n+ Md2DialogContent,\n+ Md2DialogActions,\nMd2DialogPortal\n];\n" } ]
TypeScript
MIT License
promact/md2
chore(dialog) initialized dialog configurations
530,388
17.03.2017 16:23:34
-19,080
540a2e1f94499a3384419e262f56dd52c8227aa7
chore(dialog) update docs
[ { "change_type": "MODIFY", "old_path": "src/lib/dialog/README.md", "new_path": "src/lib/dialog/README.md", "diff": "@@ -9,11 +9,10 @@ Dialog allow the user to display content in popup.\n| `title` | `string` | Title of Dialog |\n### Methods\n-\n-| Name | Description |\n-| --- | --- |\n-| `open()`/`show()` | Open a Dialog. |\n-| `close()` | Close a Dialog. |\n+| Name | Argument Type | Description |\n+| --- | --- | --- |\n+| `open(config?)` | `Md2DialogConfig` | Open a Dialog, config is optional. |\n+| `close()` | - | Close a Dialog. |\n### Events\n@@ -22,6 +21,26 @@ Dialog allow the user to display content in popup.\n| `onOpen` | `Event` | Fired when open the dialog |\n| `onClose` | `Event` | Fired when close the dialog |\n+## Directives\n+\n+| Name | Description |\n+| --- | --- |\n+| `<md2-dialog-title>` | Title of Dialog. |\n+| `<md2-dialog-content>` | Content of Dialog. |\n+| `<md2-dialog-content>` | Content of Dialog. |\n+| `<md2-dialog-footer> or <md2-dialog-actions>` | Footer of Dialog. |\n+\n+\n+### `Md2DialogConfig`\n+\n+Configuration for opening a modal dialog with the Md2Dialog service.\n+\n+| Name | Description |\n+| --- | --- |\n+| `role` | The ARIA role of the dialog element. |\n+| `disableClose` | Whether the user can use escape or clicking outside to close a modal. |\n+\n+\n### Examples\nA dialog would have the following markup.\n```html\n" } ]
TypeScript
MIT License
promact/md2
chore(dialog) update docs
530,388
20.03.2017 08:54:32
-19,080
fd6d31d5203ad96777eb521e2657676114c573af
fix(tooltip) alignment and wrap text issue
[ { "change_type": "MODIFY", "old_path": "src/lib/tooltip/tooltip.scss", "new_path": "src/lib/tooltip/tooltip.scss", "diff": "@@ -17,6 +17,7 @@ md2-tooltip {\nmargin: $md2-tooltip-margin;\nmax-width: $md2-tooltip-max-width;\nbackground: rgba(97, 97, 97, 0.9);\n+ word-wrap: break-word;\n}\n.cdk-overlay-container, .cdk-global-overlay-wrapper {\n" } ]
TypeScript
MIT License
promact/md2
fix(tooltip) alignment and wrap text issue #126
530,388
20.03.2017 08:54:47
-19,080
d361b0fb30ec3e33d9029a2974f837a55f382805
chore(tooltip) update demo
[ { "change_type": "MODIFY", "old_path": "src/demo-app/tooltip/tooltip-demo.html", "new_path": "src/demo-app/tooltip/tooltip-demo.html", "diff": "<p class=\"text-center\">\n<button type=\"button\"\nbutton=\"primary\"\n- tooltip=\"to see a tooltip\"\n+ [tooltip]=\"tooltip\"\n[tooltip-position]=\"position\"\n[tooltip-delay]=\"delay * 1000\">\nMouse over here\n</button>\n</p>\n+ <p>\n+ <strong>Tooltip Message</strong><br />\n+ <input type=\"text\" name=\"message\" class=\"md2-input\" [(ngModel)]=\"tooltip\" />\n+ <br />\n+ </p>\n<p>\n<strong>Tooltip Delay</strong><br />\n- Seconds: <input type=\"number\" name=\"delay\" class=\"md2-input\" [(ngModel)]=\"delay\" />\n+ <input type=\"number\" name=\"delay\" class=\"md2-input\" [(ngModel)]=\"delay\" /> Second(s)\n<br />\n</p>\n<p>\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/tooltip/tooltip-demo.ts", "new_path": "src/demo-app/tooltip/tooltip-demo.ts", "diff": "@@ -6,6 +6,7 @@ import {Component} from '@angular/core';\ntemplateUrl: 'tooltip-demo.html'\n})\nexport class TooltipDemo {\n+ tooltip: string = 'Tooltip!';\nposition: string = 'below';\ndelay: number = 0;\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(tooltip) update demo
530,388
20.03.2017 09:29:19
-19,080
56f47f41ecf9cb53bf936b7f0cd47549c5058259
chore(datepicker) key navigation docs
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/README.md", "new_path": "src/lib/datepicker/README.md", "diff": "@@ -48,3 +48,21 @@ A datepicker would have the following markup.\n| hour | `H` | - | - | - | H(13) | HH(13) |\n| minute | `m` | - | - | - | m(5) | mm(05) |\n| second | `s` | - | - | - | s(5) | ss(05) |\n+\n+\n+### Keyboard Navigation\n+\n+Focus can be moved with the following keys:\n+\n+| Key | Description |\n+| --- | --- |\n+| LEFT_ARROW | a day backward |\n+| RIGHT_ARROW | a day forward |\n+| UP_ARROW | a week backward |\n+| DOWN_ARROW | a week forward |\n+| HOME | focus first day of the month |\n+| END | focus last day of the month |\n+| PAGE_UP | a month backward |\n+| PAGE_DOWN | a month forward |\n+| SHIFT + PAGE_UP | a year backward |\n+| SHIFT + PAGE_DOWN | a year forward |\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) key navigation docs
530,388
20.03.2017 11:43:28
-19,080
c2f45d79221e510cb29e9cab57ea9cf3ce585c65
chore(dialog) update escape key to close dialog issue
[ { "change_type": "MODIFY", "old_path": "src/lib/dialog/dialog.ts", "new_path": "src/lib/dialog/dialog.ts", "diff": "@@ -3,6 +3,8 @@ import {\nOutput,\nInput,\nEventEmitter,\n+ Optional,\n+ SkipSelf,\nViewChild,\nViewEncapsulation,\nOnDestroy,\n@@ -19,6 +21,7 @@ import {\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport {\n+ ESCAPE,\nOverlay,\nOverlayState,\nOverlayRef,\n@@ -71,7 +74,6 @@ export class Md2DialogActions { }\nhost: {\n'tabindex': '0',\n'[attr.role]': 'config?.role',\n- '(body:keydown.esc)': '_handleEscKeydown($event)'\n},\nanimations: [\ntrigger('state', [\n@@ -88,6 +90,8 @@ export class Md2DialogActions { }\n})\nexport class Md2Dialog implements OnDestroy {\n+ private _openDialogsAtThisLevel: Array<any> = [];\n+ private _boundKeydown = this._handleKeydown.bind(this);\nprivate _panelOpen = false;\nprivate _overlayRef: OverlayRef = null;\nprivate _backdropSubscription: Subscription;\n@@ -96,7 +100,8 @@ export class Md2Dialog implements OnDestroy {\n/** Property watched by the animation framework to show or hide the dialog */\n_visibility: DialogVisibility = 'initial';\n- constructor(private _overlay: Overlay) { }\n+ constructor(private _overlay: Overlay,\n+ @Optional() @SkipSelf() private _parentDialog: Md2Dialog) { }\n@Output() onOpen: EventEmitter<Md2Dialog> = new EventEmitter<Md2Dialog>();\n@Output() onClose: EventEmitter<any> = new EventEmitter<any>();\n@@ -108,6 +113,10 @@ export class Md2Dialog implements OnDestroy {\nngOnDestroy() { this.destroyPanel(); }\n+ get _openDialogs(): Array<any> {\n+ return this._parentDialog ? this._parentDialog._openDialogs : this._openDialogsAtThisLevel;\n+ }\n+\n/** Open the dialog */\nopen(config?: Md2DialogConfig): Promise<Md2Dialog> {\nthis.config = _applyConfigDefaults(config);\n@@ -117,6 +126,12 @@ export class Md2Dialog implements OnDestroy {\nthis._createOverlay();\nthis._overlayRef.attach(this._portal);\nthis._subscribeToBackdrop();\n+\n+ if (!this._openDialogs.length && !this._parentDialog) {\n+ document.addEventListener('keydown', this._boundKeydown);\n+ }\n+\n+ this._openDialogs.push(this);\nthis._panelOpen = true;\nthis._visibility = 'visible';\nreturn Promise.resolve<Md2Dialog>(this);\n@@ -132,6 +147,17 @@ export class Md2Dialog implements OnDestroy {\nthis._backdropSubscription.unsubscribe();\n}\n}\n+\n+ let index = this._openDialogs.indexOf(this);\n+\n+ if (index > -1) {\n+ this._openDialogs.splice(index, 1);\n+\n+ // no open dialogs are left, call next on afterAllClosed Subject\n+ if (!this._openDialogs.length) {\n+ document.removeEventListener('keydown', this._boundKeydown);\n+ }\n+ }\nreturn Promise.resolve<Md2Dialog>(this);\n}\n@@ -153,9 +179,12 @@ export class Md2Dialog implements OnDestroy {\n}\n}\n- _handleEscKeydown(event: KeyboardEvent) {\n- if (this._panelOpen && !this.config.disableClose) {\n- this.close();\n+ _handleKeydown(event: KeyboardEvent) {\n+ let topDialog = this._openDialogs[this._openDialogs.length - 1];\n+\n+ if (event.keyCode === ESCAPE && topDialog &&\n+ !topDialog.config.disableClose) {\n+ topDialog.close();\n}\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(dialog) update escape key to close dialog issue
530,388
20.03.2017 12:09:02
-19,080
94864e90b280b9c6b46c8c387fbd99a184753e06
chore(colorpicker) update demo
[ { "change_type": "MODIFY", "old_path": "src/demo-app/colorpicker/colorpicker-demo.html", "new_path": "src/demo-app/colorpicker/colorpicker-demo.html", "diff": "<div class=\"header\">\n<h3 class=\"title\">Basic Colorpicker</h3>\n</div>\n- <div class=\"content\">\n+ <form class=\"content\">\n<md2-colorpicker name=\"background\"\nplaceholder=\"Background Color\"\n[(ngModel)]=\"_color\"\n- (change)=\"handleChange($event)\"\n[required]=\"isRequired\"\n[disabled]=\"isDisabled\"\n[container]=\"container\"\n#colorpickerControl=\"ngModel\"></md2-colorpicker>\n-\n<p> Value: {{ _color }} </p>\n<p> Touched: {{ colorpickerControl.touched }} </p>\n<p> Dirty: {{ colorpickerControl.dirty }} </p>\n<button type=\"button\" button=\"primary\" (click)=\"isRequired=!isRequired\">TOGGLE REQUIRED</button>\n<button type=\"button\" button=\"primary\" (click)=\"isDisabled=!isDisabled\">TOGGLE DISABLED</button>\n<button type=\"button\" button=\"primary\" (click)=\"colorpickerControl.reset()\">RESET</button>\n- </div>\n+ </form>\n</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/colorpicker/colorpicker-demo.ts", "new_path": "src/demo-app/colorpicker/colorpicker-demo.ts", "diff": "@@ -13,7 +13,4 @@ export class ColorpickerDemo {\ncontainers: Array<any> = [\n{ text: 'Inline', value: 'inline' },\n{ text: 'Dialog', value: 'dialog' }];\n- handleChange(value: any) {\n- console.log('Changed color: ', value);\n- }\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(colorpicker) update demo
530,388
20.03.2017 12:10:14
-19,080
195de42b660a5b116e4d634dba43eb0260c9be01
chore(colorpicker) linting issues
[ { "change_type": "MODIFY", "old_path": "src/lib/colorpicker/colorpicker.html", "new_path": "src/lib/colorpicker/colorpicker.html", "diff": "</div>\n<div class=\"md2-colorpicker-input\" [class.input-focused]=\"isInputFocus\">\n<span class=\"md2-colorpicker-placeholder\" [class.md2-floating-placeholder]=\"color\">{{ placeholder }}</span>\n- <!--<span class=\"md2-colorpicker-value\">{{color}}</span>-->\n<input class=\"md2-colorpicker-value\" value=\"color\" [tabindex]=\"tabindex\" [disabled]=\"disabled\" [(ngModel)]=\"color\" (focus)=\"isInputFocus=true\" (blur)=\"checkInputVal($event)\" />\n<span *ngIf=\"color && !required && !disabled\" class=\"color-clear\" (click)=\"clearColor($event)\">\n<svg viewBox=\"0 0 20 20\" width=\"20\" height=\"20\">\n" }, { "change_type": "MODIFY", "old_path": "src/lib/colorpicker/colorpicker.scss", "new_path": "src/lib/colorpicker/colorpicker.scss", "diff": "@@ -70,11 +70,13 @@ $warn: #f44336 !default;\ncolor: $primary;\nborder-color: $primary;\n}\n+\n.inline-control {\nwidth: 150px;\nmargin-right: 16px;\npadding: 16px 0;\n}\n+\n.md2-colorpicker-placeholder {\nposition: absolute;\nright: 18px;\n" }, { "change_type": "MODIFY", "old_path": "src/lib/colorpicker/colorpicker.ts", "new_path": "src/lib/colorpicker/colorpicker.ts", "diff": "@@ -639,9 +639,6 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n.centerHorizontally()\n.centerVertically();\nconfig.hasBackdrop = true;\n- //config.backdropClass = 'cdk-overlay-dark-backdrop';\n-\n-\n}\nthis._overlayRef = this.overlay.create(config);\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(colorpicker) linting issues
530,388
21.03.2017 08:48:20
-19,080
587db7437276abf5da5febd4455e1c4cf2425163
fix: reactive form disable property issue
[ { "change_type": "MODIFY", "old_path": "src/lib/autocomplete/autocomplete.ts", "new_path": "src/lib/autocomplete/autocomplete.ts", "diff": "@@ -357,6 +357,10 @@ export class Md2Autocomplete implements AfterContentInit, ControlValueAccessor {\nregisterOnTouched(fn: () => {}): void { this._onTouched = fn; }\n+ setDisabledState(isDisabled: boolean): void {\n+ this.disabled = isDisabled;\n+ }\n+\n}\nexport const MD2_AUTOCOMPLETE_DIRECTIVES = [Md2Autocomplete, HighlightPipe];\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -769,6 +769,10 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nregisterOnTouched(fn: () => {}): void { this._onTouched = fn; }\n+ setDisabledState(isDisabled: boolean): void {\n+ this.disabled = isDisabled;\n+ }\n+\nprivate _subscribeToBackdrop(): void {\nthis._backdropSubscription = this._overlayRef.backdropClick().subscribe(() => {\nthis.close();\n" }, { "change_type": "MODIFY", "old_path": "src/lib/tags/tags.ts", "new_path": "src/lib/tags/tags.ts", "diff": "@@ -411,6 +411,11 @@ export class Md2Tags implements AfterContentInit, ControlValueAccessor {\nregisterOnChange(fn: any) { this._onChangeCallback = fn; }\nregisterOnTouched(fn: any) { this._onTouchedCallback = fn; }\n+\n+ setDisabledState(isDisabled: boolean): void {\n+ this.disabled = isDisabled;\n+ }\n+\n}\nexport const MD2_TAGS_DIRECTIVES = [Md2Tags];\n" } ]
TypeScript
MIT License
promact/md2
fix: reactive form disable property issue #114
530,388
21.03.2017 12:22:10
-19,080
be27e8203b6e43f23f6a238ef6c4a27d17ca2d1f
chore: update configurations
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "/.idea\n/.vscode\n/.vs\n+/md2\n/*.sln\n# misc\n" }, { "change_type": "MODIFY", "old_path": ".travis.yml", "new_path": ".travis.yml", "diff": "@@ -2,7 +2,11 @@ language: node_js\nsudo: false\nnode_js:\n- - '6.9.1'\n+ - '6.9.4'\n+\n+branches:\n+ only:\n+ - master\ninstall:\n- npm install\n" }, { "change_type": "MODIFY", "old_path": "src/lib/tsconfig.json", "new_path": "src/lib/tsconfig.json", "diff": "\"emitDecoratorMetadata\": true,\n\"experimentalDecorators\": true,\n\"lib\": [\"es6\", \"es2015\", \"dom\"],\n- \"module\": \"commonjs\",\n+ \"module\": \"es2015\",\n\"moduleResolution\": \"node\",\n\"noEmitOnError\": true,\n\"noImplicitAny\": true,\n\"outDir\": \"../../dist/md2\",\n\"rootDir\": \".\",\n\"sourceMap\": true,\n- \"target\": \"es5\",\n+ \"target\": \"es6\",\n\"inlineSources\": true,\n\"stripInternal\": false,\n\"baseUrl\": \"\",\n- \"paths\": {\n- },\n\"typeRoots\": [\n\"../../node_modules/@types/!(node)\"\n],\n" }, { "change_type": "MODIFY", "old_path": "stylelint-config.json", "new_path": "stylelint-config.json", "diff": "{\n+ \"plugins\": [\n+ \"./tools/stylelint/no-prefixes/no-prefixes.js\"\n+ ],\n\"rules\": {\n+ \"material/no-prefixes\": [[\"last 2 versions\", \"not ie <= 10\", \"not ie_mob <= 10\"]],\n\"color-hex-case\": \"lower\",\n\"color-no-invalid-hex\": true,\n" }, { "change_type": "MODIFY", "old_path": "tslint.json", "new_path": "tslint.json", "diff": "\"no-shadowed-variable\": true,\n\"no-unused-expression\": true,\n\"no-unused-var\": [true, {\"ignore-pattern\": \"^(_.*)$\"}],\n+ \"no-var-keyword\": true,\n+ \"no-debugger\": true,\n\"one-line\": [\ntrue,\n\"check-catch\",\n\"check-operator\",\n\"check-separator\",\n\"check-type\"\n- ]\n+ ],\n+ // Bans jasmine helper functions that will prevent the CI from properly running tests.\n+ \"ban\": [true, [\"fit\"], [\"fdescribe\"], [\"xit\"], [\"xdescribe\"]],\n+ // Disallows importing the whole RxJS library. Submodules can be still imported.\n+ \"import-blacklist\": [true, \"rxjs\"],\n+ // Avoids inconsistent linebreak styles in source files. Forces developers to use LF linebreaks.\n+ \"linebreak-style\": [true, \"LF\"]\n}\n}\n" } ]
TypeScript
MIT License
promact/md2
chore: update configurations
530,388
22.03.2017 08:47:25
-19,080
46368b043c9f746ad7d22123606a7f0ba0c7d69e
chore(tooltip) integrated disable tooltip feature
[ { "change_type": "MODIFY", "old_path": "src/lib/tooltip/index.ts", "new_path": "src/lib/tooltip/index.ts", "diff": "+import {NgModule, ModuleWithProviders} from '@angular/core';\n+import {OverlayModule, CompatibilityModule} from '../core';\n+import {PlatformModule} from '../core/platform/index';\n+import {MdTooltip, TooltipComponent} from './tooltip';\n+\n+\n+@NgModule({\n+ imports: [OverlayModule, CompatibilityModule, PlatformModule],\n+ exports: [MdTooltip, TooltipComponent, CompatibilityModule],\n+ declarations: [MdTooltip, TooltipComponent],\n+ entryComponents: [TooltipComponent],\n+})\n+export class MdTooltipModule {\n+ /** @deprecated */\n+ static forRoot(): ModuleWithProviders {\n+ return {\n+ ngModule: MdTooltipModule,\n+ providers: []\n+ };\n+ }\n+}\n+\n+\nexport * from './tooltip';\n" }, { "change_type": "MODIFY", "old_path": "src/lib/tooltip/tooltip.ts", "new_path": "src/lib/tooltip/tooltip.ts", "diff": "import {\n- NgModule,\n- ModuleWithProviders,\nComponent,\nDirective,\nInput,\n@@ -23,13 +21,10 @@ import {\nimport {\nOverlay,\nOverlayState,\n- OverlayModule,\nOverlayRef,\nComponentPortal,\nOverlayConnectionPosition,\nOriginConnectionPosition,\n- CompatibilityModule,\n- PlatformModule,\n} from '../core';\nimport { Md2TooltipInvalidPositionError } from './tooltip-errors';\nimport { Observable } from 'rxjs/Observable';\n@@ -39,6 +34,7 @@ import { Platform } from '../core/platform/index';\nimport 'rxjs/add/operator/first';\nimport { ScrollDispatcher } from '../core/overlay/scroll/scroll-dispatcher';\nimport { Subscription } from 'rxjs/Subscription';\n+import { coerceBooleanProperty } from '../core/coercion/boolean-property';\nexport type TooltipPosition = 'left' | 'right' | 'above' | 'below' | 'before' | 'after';\n@@ -68,6 +64,7 @@ export class Md2Tooltip implements OnInit, OnDestroy {\nscrollSubscription: Subscription;\nprivate _position: TooltipPosition = 'below';\n+ private _disabled: boolean = false;\n/** Allows the user to define the position of the tooltip relative to the parent element */\n@Input('tooltip-position')\n@@ -84,6 +81,18 @@ export class Md2Tooltip implements OnInit, OnDestroy {\n}\n}\n+ /** Disables the display of the tooltip. */\n+ @Input('tooltipDisabled')\n+ get disabled(): boolean { return this._disabled; }\n+ set disabled(value) {\n+ this._disabled = coerceBooleanProperty(value);\n+\n+ // If tooltip is disabled, hide immediately.\n+ if (this._disabled) {\n+ this.hide(0);\n+ }\n+ }\n+\n/** The default delay in ms before showing the tooltip after show is called */\n@Input('tooltip-delay') showDelay = 0;\n@@ -143,7 +152,7 @@ export class Md2Tooltip implements OnInit, OnDestroy {\n/** Shows the tooltip after the delay in ms, defaults to tooltip-delay-show or 0ms if no input */\nshow(delay: number = this.showDelay): void {\n- if (!this._message || !this._message.trim()) { return; }\n+ if (this.disabled || !this._message || !this._message.trim()) { return; }\nif (!this._tooltipInstance) {\nthis._createTooltip();\n@@ -167,7 +176,7 @@ export class Md2Tooltip implements OnInit, OnDestroy {\n/** Returns true if the tooltip is currently visible to the user */\n_isTooltipVisible(): boolean {\n- return this._tooltipInstance && this._tooltipInstance.isVisible();\n+ return !!this._tooltipInstance && this._tooltipInstance.isVisible();\n}\n/** Create the tooltip to display */\n@@ -419,20 +428,3 @@ export class Md2TooltipComponent {\n}\n}\n}\n-\n-\n-@NgModule({\n- imports: [OverlayModule, CompatibilityModule, PlatformModule],\n- exports: [Md2Tooltip, Md2TooltipComponent, CompatibilityModule],\n- declarations: [Md2Tooltip, Md2TooltipComponent],\n- entryComponents: [Md2TooltipComponent],\n-})\n-export class Md2TooltipModule {\n- /** @deprecated */\n- static forRoot(): ModuleWithProviders {\n- return {\n- ngModule: Md2TooltipModule,\n- providers: []\n- };\n- }\n-}\n" } ]
TypeScript
MIT License
promact/md2
chore(tooltip) integrated disable tooltip feature
530,388
22.03.2017 08:48:20
-19,080
9d3a2b2807bda9fcd6a5a2033c8aee6af3a95b6a
chore(tooltip) update module
[ { "change_type": "MODIFY", "old_path": "src/lib/tooltip/index.ts", "new_path": "src/lib/tooltip/index.ts", "diff": "import {NgModule, ModuleWithProviders} from '@angular/core';\nimport {OverlayModule, CompatibilityModule} from '../core';\nimport {PlatformModule} from '../core/platform/index';\n-import {MdTooltip, TooltipComponent} from './tooltip';\n+import {Md2Tooltip, Md2TooltipComponent} from './tooltip';\n@NgModule({\nimports: [OverlayModule, CompatibilityModule, PlatformModule],\n- exports: [MdTooltip, TooltipComponent, CompatibilityModule],\n- declarations: [MdTooltip, TooltipComponent],\n- entryComponents: [TooltipComponent],\n+ exports: [Md2Tooltip, Md2TooltipComponent, CompatibilityModule],\n+ declarations: [Md2Tooltip, Md2TooltipComponent],\n+ entryComponents: [Md2TooltipComponent],\n})\n-export class MdTooltipModule {\n+export class Md2TooltipModule {\n/** @deprecated */\nstatic forRoot(): ModuleWithProviders {\nreturn {\n- ngModule: MdTooltipModule,\n+ ngModule: Md2TooltipModule,\nproviders: []\n};\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(tooltip) update module
530,388
22.03.2017 08:51:30
-19,080
3130f6f7d1ebc9697b49d9ddc76dc63aa7666009
chore(tooltip) update docs
[ { "change_type": "MODIFY", "old_path": "src/lib/tooltip/README.md", "new_path": "src/lib/tooltip/README.md", "diff": "@@ -6,8 +6,10 @@ Tooltip is a directive, it allows the user to show hint text while the user mous\n| Name | Type | Description |\n| --- | --- | --- |\n| `tooltip` | `string` | The message of the Tooltip |\n+| `tooltipDisabled` | `boolean` | Enable/Disable the Tooltip |\n| `tooltip-position` | `'above'|'below'|'before'|'after'` | The position of the Tooltip |\n| `tooltip-delay` | `number` | The delay of the Tooltip |\n+| `tooltip-delay` | `number` | The delay of the Tooltip |\n### Examples\nA tooltip would have the following markup.\n" } ]
TypeScript
MIT License
promact/md2
chore(tooltip) update docs
530,388
22.03.2017 15:08:04
-19,080
7952f1d72ba4480f8909aa33928be28fd4cbd88c
chore(datepicker) update docs
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/README.md", "new_path": "src/lib/datepicker/README.md", "diff": "@@ -50,19 +50,15 @@ A datepicker would have the following markup.\n| second | `s` | - | - | - | s(5) | ss(05) |\n-### Keyboard Navigation\n-\n-Focus can be moved with the following keys:\n-\n-| Key | Description |\n-| --- | --- |\n-| LEFT_ARROW | a day backward |\n-| RIGHT_ARROW | a day forward |\n-| UP_ARROW | a week backward |\n-| DOWN_ARROW | a week forward |\n-| HOME | focus first day of the month |\n-| END | focus last day of the month |\n-| PAGE_UP | a month backward |\n-| PAGE_DOWN | a month forward |\n-| SHIFT + PAGE_UP | a year backward |\n-| SHIFT + PAGE_DOWN | a year forward |\n+#### Keyboard interaction:\n+- <kbd>LEFT_ARROW</kbd>: Focus a day backward\n+- <kbd>RIGHT_ARROW</kbd>: Focus a day forward\n+- <kbd>UP_ARROW</kbd>: Focus a week backward\n+- <kbd>DOWN_ARROW</kbd>: Focus a week forward\n+- <kbd>HOME</kbd>: Focus first day of the month\n+- <kbd>END</kbd>: Focus last day of the month\n+- <kbd>PAGE_UP</kbd>: Focus a month backward\n+- <kbd>PAGE_DOWN</kbd>: Focus a month forward\n+- <kbd>SHIFT + PAGE_UP</kbd>: Focus a year backward\n+- <kbd>SHIFT + PAGE_DOWN</kbd>: Focus a year forward\n+- <kbd>ENTER</kbd> or <kbd>SPACE</kbd>: Select focused item\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update docs
530,388
23.03.2017 10:34:42
-19,080
06461e48552e2de83cf406c1964f7354cfe7e335
chore(select) added header feature
[ { "change_type": "MODIFY", "old_path": "src/lib/select/index.ts", "new_path": "src/lib/select/index.ts", "diff": "import { NgModule, ModuleWithProviders } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Md2Select } from './select';\n+import { Md2SelectHeader } from './select-header';\nimport { Md2OptionModule } from './option';\nimport { CompatibilityModule, OverlayModule } from '../core';\n@NgModule({\nimports: [CommonModule, OverlayModule, Md2OptionModule, CompatibilityModule],\n- exports: [Md2Select, Md2OptionModule, CompatibilityModule],\n- declarations: [Md2Select],\n+ exports: [Md2Select, Md2SelectHeader, Md2OptionModule, CompatibilityModule],\n+ declarations: [Md2Select, Md2SelectHeader],\n})\nexport class Md2SelectModule {\n/** @deprecated */\n@@ -22,5 +23,6 @@ export class Md2SelectModule {\nexport * from './select';\n+export * from './select-header';\nexport * from './option';\nexport { fadeInContent, transformPanel, transformPlaceholder } from './select-animations';\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/lib/select/select-header.ts", "diff": "+import { Directive } from '@angular/core';\n+\n+\n+/**\n+ * Fixed header that will be rendered above a select's options.\n+ */\n+@Directive({\n+ selector: 'md2-select-header',\n+ host: {\n+ 'class': 'md2-select-header',\n+ }\n+})\n+export class Md2SelectHeader { }\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/lib/select/select.html", "new_path": "src/lib/select/select.html", "diff": "(keydown)=\"_keyManager.onKeydown($event)\" [style.transformOrigin]=\"_transformOrigin\"\n[class.md2-select-panel-done-animating]=\"_panelDoneAnimating\">\n<div class=\"md2-select-content\" [@fadeInContent]=\"'showing'\" (@fadeInContent.done)=\"_onFadeInDone()\">\n+ <ng-content select=\"md2-select-header\"></ng-content>\n<ng-content></ng-content>\n</div>\n</div>\n" } ]
TypeScript
MIT License
promact/md2
chore(select) added header feature
530,388
23.03.2017 11:15:29
-19,080
68b3d03ba6c49c0b77239ca62cd2d25d35044fac
chore(select) update demo with select-header
[ { "change_type": "MODIFY", "old_path": "src/demo-app/data-table/data-table-demo.ts", "new_path": "src/demo-app/data-table/data-table-demo.ts", "diff": "@@ -9,7 +9,8 @@ import { Http } from '@angular/http';\nexport class DataTablePipe implements PipeTransform {\ntransform(array: any[], query: string): any {\nif (query) {\n- return array.filter((value: any, index: number, arr: any) => value.name.indexOf(query) > -1);\n+ query = query.toLowerCase();\n+ return array.filter((value: any, index: number, arr: any) => value.name.toLowerCase().indexOf(query) > -1);\n}\nreturn array;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/select/select-demo.html", "new_path": "src/demo-app/select/select-demo.html", "diff": "[required]=\"isRequired\"\n[disabled]=\"isDisabled\"\n#selectControl=\"ngModel\">\n- <md2-option *ngFor=\"let i of items\" [value]=\"i.value\">{{i.name}}</md2-option>\n+ <md2-select-header>\n+ <input name=\"search\"\n+ type=\"text\"\n+ placeholder=\"Search for Cities\"\n+ [(ngModel)]=\"search\" />\n+ </md2-select-header>\n+ <md2-option *ngFor=\"let i of items | dataPipe : search\" [value]=\"i.value\">{{i.name}}</md2-option>\n</md2-select>\n<p> Value: {{ item }} </p>\n<p> Touched: {{ selectControl.touched }} </p>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/demo-app/select/select-demo.scss", "diff": "+.md2-select-header {\n+ position: relative;\n+ display: block;\n+ height: 48px;\n+ padding-left: 10px;\n+ border-bottom: 1px solid rgba(black, 0.12);\n+\n+ input {\n+ border: none;\n+ outline: none;\n+ height: 100%;\n+ width: 100%;\n+ padding: 0;\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/select/select-demo.ts", "new_path": "src/demo-app/select/select-demo.ts", "diff": "-import { Component } from '@angular/core';\n+import { Component, ViewEncapsulation } from '@angular/core';\n@Component({\nmoduleId: module.id,\nselector: 'select-demo',\n- templateUrl: 'select-demo.html'\n+ templateUrl: 'select-demo.html',\n+ styleUrls: ['select-demo.css'],\n+ encapsulation: ViewEncapsulation.None\n})\nexport class SelectDemo {\nisRequired = false;\n" } ]
TypeScript
MIT License
promact/md2
chore(select) update demo with select-header
530,388
23.03.2017 12:22:31
-19,080
9b22c85c97959624d4bd9b29b50d1d09582c921d
chore(datepicker) added skeleton for input and
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -27,21 +27,35 @@ md2-datepicker {\n.md2-datepicker-trigger {\ndisplay: block;\n- padding: 18px 0 4px 32px;\n+ padding: 18px 0 4px 46px;\nwhite-space: nowrap;\n- cursor: pointer;\n}\n-.md2-datepicker-icon {\n+.md2-datepicker-button {\nposition: absolute;\n- top: 21px;\n+ top: 13px;\nleft: 0;\n- display: block;\n- height: 24px;\n- width: 24px;\n- vertical-align: middle;\n- fill: currentColor;\n+ display: inline-block;\n+ height: 40px;\n+ width: 40px;\n+ padding: 8px;\n+ line-height: 24px;\ncolor: rgba(black, 0.54);\n+ fill: currentColor;\n+ border: 0;\n+ border-radius: 50%;\n+ outline: none;\n+ user-select: none;\n+ cursor: pointer;\n+ box-sizing: border-box;\n+ background: none;\n+ vertical-align: middle;\n+ align-items: center;\n+ text-align: center;\n+\n+ &:focus {\n+ background-color: rgba(158, 158, 158, 0.2);\n+ }\n.md2-datepicker-disabled & {\ncolor: rgba(black, 0.38);\n@@ -71,7 +85,8 @@ md2-datepicker {\nuser-select: none;\n}\n- md2-datepicker:focus:not(.md2-datepicker-disabled) & {\n+\n+ &.md2-datepicker-input-focused {\ncolor: $primary;\nborder-color: $primary;\n}\n@@ -149,7 +164,7 @@ md2-datepicker {\nmargin: 0 $md2-datepicker-arrow-margin;\ncolor: rgba(black, 0.38);\n- md2-datepicker:focus:not(.md2-datepicker-disabled) & {\n+ .md2-datepicker-input-focused & {\ncolor: $primary;\n}\n@@ -163,6 +178,7 @@ md2-datepicker {\nright: 0;\nheight: 20px;\ncolor: rgba(black, 0.54);\n+ cursor: pointer;\nsvg {\nfill: currentColor;\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -17,7 +17,8 @@ import {\n} from '@angular/core';\nimport {\nControlValueAccessor,\n- NgControl\n+ NgControl,\n+ FormsModule\n} from '@angular/forms';\nimport { CommonModule } from '@angular/common';\nimport { DateLocale } from './date-locale';\n@@ -69,7 +70,6 @@ export type PanelPositionY = 'above' | 'below';\n'role': 'datepicker',\n'[class.md2-datepicker-disabled]': 'disabled',\n'[class.md2-datepicker-opened]': 'panelOpen',\n- '[attr.tabindex]': 'disabled ? -1 : tabindex',\n'[attr.aria-label]': 'placeholder',\n'[attr.aria-required]': 'required.toString()',\n'[attr.aria-disabled]': 'disabled.toString()',\n@@ -126,6 +126,8 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n_transformOrigin: string = 'top';\n_panelDoneAnimating: boolean = false;\n+ _inputFocused: boolean = false;\n+\n_onChange = (value: any) => { };\n_onTouched = () => { };\n@@ -515,6 +517,18 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n}\n}\n+ _handleFocus(event: Event) {\n+ this._inputFocused = true;\n+ }\n+\n+ _handleBlur(event: Event) {\n+ this._inputFocused = false;\n+ if (!this.panelOpen) {\n+ this._onTouched();\n+ }\n+ //if (this._locale.isDateValid(this.date)) { this._emitChangeEvent(); }\n+ }\n+\n_clearValue(event: Event) {\nevent.stopPropagation();\nthis.value = null;\n@@ -841,7 +855,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nexport const MD2_DATEPICKER_DIRECTIVES = [Md2Datepicker, Md2Clock];\n@NgModule({\n- imports: [CommonModule, OverlayModule, PortalModule],\n+ imports: [CommonModule, FormsModule, OverlayModule, PortalModule],\nexports: MD2_DATEPICKER_DIRECTIVES,\ndeclarations: MD2_DATEPICKER_DIRECTIVES,\nproviders: [DateLocale]\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) added skeleton for input #38 and #106
530,388
25.03.2017 09:53:03
-19,080
aad0519c30b90427b7408c3131e4279a92f43045
fix(tags) error `this.onFocus is not a function` issue
[ { "change_type": "MODIFY", "old_path": "src/lib/tags/tags.ts", "new_path": "src/lib/tags/tags.ts", "diff": "@@ -343,10 +343,10 @@ export class Md2Tags implements AfterContentInit, ControlValueAccessor {\nprivate selectAndFocusTagSafe = function (index: number) {\nif (!this._items.length) {\nthis._selectTag(-1);\n- this.onFocus();\n+ this._handleFocus();\nreturn;\n}\n- if (index === this._items.length) { return this.onFocus(); }\n+ if (index === this._items.length) { return this._handleFocus(); }\nindex = Math.max(index, 0);\nindex = Math.min(index, this._items.length - 1);\nthis._selectTag(index);\n" } ]
TypeScript
MIT License
promact/md2
fix(tags) error `this.onFocus is not a function` issue #134
530,388
28.03.2017 14:07:04
-19,080
df54e5e00640fee55a9e1d52d4a594e52595d89d
chore: update keycodes
[ { "change_type": "MODIFY", "old_path": "src/lib/chips/chips.ts", "new_path": "src/lib/chips/chips.ts", "diff": "@@ -21,7 +21,15 @@ import {\nimport { CommonModule } from '@angular/common';\nimport { Md2AutocompleteModule } from '../autocomplete/autocomplete';\n-import { KeyCodes } from '../core/core';\n+import {\n+ ENTER,\n+ SPACE,\n+ BACKSPACE,\n+ DELETE,\n+ COMMA,\n+ LEFT_ARROW,\n+ RIGHT_ARROW\n+} from '../core/keyboard/keycodes';\nconst noop = () => { };\n@@ -167,15 +175,15 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\nlet key = event.keyCode;\nswitch (key) {\n// back space\n- case KeyCodes.BACKSPACE:\n+ case BACKSPACE:\nthis.backspaceEvent();\nbreak;\n// delete\n- case KeyCodes.DELETE:\n+ case DELETE:\nthis.backspaceEvent();\nbreak;\n// left arrow\n- case KeyCodes.LEFT_ARROW:\n+ case LEFT_ARROW:\nif (this.isAutoComplete && this.isEmptyAutoComplete) {\nthis.leftArrowKeyEvents();\n} else if (!this.isAutoComplete && !this.inputValue) {\n@@ -183,7 +191,7 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\n}\nbreak;\n// right arrow\n- case KeyCodes.RIGHT_ARROW:\n+ case RIGHT_ARROW:\nif (this.isAutoComplete && this.isEmptyAutoComplete) {\nthis.rightArrowKeyEvents();\n} else if (!this.isAutoComplete && !this.inputValue) {\n@@ -191,21 +199,21 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\n}\nbreak;\n// enter\n- case KeyCodes.ENTER:\n+ case ENTER:\nif (this.addOnEnter) {\nthis.addNewChip(this.inputValue);\nevent.preventDefault();\n}\nbreak;\n// comma\n- case KeyCodes.COMMA:\n+ case COMMA:\nif (this.addOnComma) {\nthis.addNewChip(this.inputValue);\nevent.preventDefault();\n}\nbreak;\n// space\n- case KeyCodes.SPACE:\n+ case SPACE:\nif (this.addOnSpace) {\nthis.addNewChip(this.inputValue);\nevent.preventDefault();\n" }, { "change_type": "MODIFY", "old_path": "src/lib/core/keyboard/keycodes.ts", "new_path": "src/lib/core/keyboard/keycodes.ts", "diff": "@@ -23,18 +23,4 @@ export const ESCAPE = 27;\nexport const BACKSPACE = 8;\nexport const DELETE = 46;\n-export enum KeyCodes {\n- UP_ARROW = 38,\n- DOWN_ARROW = 40,\n- RIGHT_ARROW = 39,\n- LEFT_ARROW = 37,\n-\n- ENTER = 13,\n- SPACE = 32,\n- BACKSPACE = 8,\n- DELETE = 46,\n-\n- TAB = 9,\n- ESCAPE = 27,\n- COMMA = 188,\n-}\n+export const COMMA = 188;\n" } ]
TypeScript
MIT License
promact/md2
chore: update keycodes
530,388
28.03.2017 16:22:05
-19,080
6b6c0d912b77a1bd00386550ad25cba083defe10
fix: regex filter issue in autocomplete and tags
[ { "change_type": "MODIFY", "old_path": "src/lib/autocomplete/autocomplete.ts", "new_path": "src/lib/autocomplete/autocomplete.ts", "diff": "@@ -240,7 +240,7 @@ export class Md2Autocomplete implements AfterContentInit, ControlValueAccessor {\nbreak;\ndefault:\nsetTimeout(() => {\n- this.updateItems(new RegExp(this._inputValue, 'ig'));\n+ this.updateItems();\n}, 10);\n}\n}\n@@ -266,7 +266,7 @@ export class Md2Autocomplete implements AfterContentInit, ControlValueAccessor {\nif (this.disabled) { return; }\nthis._inputValue = '';\nthis.selectedItem = null;\n- this.updateItems(new RegExp(this._inputValue, 'ig'));\n+ this.updateItems();\nthis._value = this.selectedItem ? this.selectedItem.value : this.selectedItem;\nthis.updateValue();\n}\n@@ -293,7 +293,7 @@ export class Md2Autocomplete implements AfterContentInit, ControlValueAccessor {\n*/\n_handleFocus() {\nthis._inputFocused = true;\n- this.updateItems(new RegExp(this._inputValue, 'ig'));\n+ this.updateItems();\nthis._focusedOption = 0;\n}\n@@ -319,12 +319,12 @@ export class Md2Autocomplete implements AfterContentInit, ControlValueAccessor {\n* Update suggestion to filter the query\n* @param query\n*/\n- private updateItems(query: RegExp) {\n+ private updateItems() {\nif (this._inputValue.length < this.minLength) {\nthis._list = [];\n} else {\nthis._list = this._items.map((i: any) => new Item(i, this.textKey,\n- this.valueKey)).filter(i => query.test(i.text));\n+ this.valueKey)).filter(i => new RegExp(this._inputValue, 'ig').test(i.text));\nif (this._list.length && this._list[0].text !== this._inputValue) {\nthis.selectedItem = null;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/lib/tags/tags.ts", "new_path": "src/lib/tags/tags.ts", "diff": "@@ -250,7 +250,7 @@ export class Md2Tags implements AfterContentInit, ControlValueAccessor {\nif (this._selectedTag >= 0) { this.resetselectedTag(); }\n// filter\nsetTimeout(() => {\n- this.filterMatches(new RegExp(this._inputValue, 'ig'));\n+ this.filterMatches();\n}, 10);\n}\n@@ -385,10 +385,10 @@ export class Md2Tags implements AfterContentInit, ControlValueAccessor {\n* update suggestion menu with filter\n* @param query\n*/\n- private filterMatches(query: RegExp) {\n+ private filterMatches() {\nlet tempList = this._tags.map((tag: any) => new Tag(tag, this.textKey, this.valueKey));\nthis._list = tempList.filter((t: Tag) =>\n- (query.test(t.text) && !this._items.find((i: Tag) => t.text === i.text)));\n+ (new RegExp(this._inputValue, 'ig').test(t.text) && !this._items.find((i: Tag) => t.text === i.text)));\nif (this._list.length > 0) {\nthis._focusedTag = 0;\n}\n" } ]
TypeScript
MIT License
promact/md2
fix: regex filter issue in autocomplete and tags
530,388
28.03.2017 16:58:09
-19,080
ef25f25834492e1b13e0d7a05b20344525bd97e7
chore: fixed AOT issues in demo-app
[ { "change_type": "MODIFY", "old_path": "src/demo-app/chips/chips-demo.ts", "new_path": "src/demo-app/chips/chips-demo.ts", "diff": "@@ -9,13 +9,13 @@ export class ChipsDemo {\nisDisabled: boolean = false;\nisRemovable: boolean = true;\n- private _item: Array<any>;\n- private _itemsData: Array<any> = [\n+ _item: Array<any>;\n+ _itemsData: Array<any> = [\n{ name: 'Vadodara', value: '1' },\n{ name: 'Mumbai', value: '5' },\n{ name: 'Goa', value: '6' }\n];\n- private _items: Array<any> = [\n+ _items: Array<any> = [\n{ text: 'Vadodaraa', id: '8' },\n{ text: 'Mumbaia', id: '2' },\n{ text: 'Goaa', id: '4' }\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/collapse/collapse-demo.ts", "new_path": "src/demo-app/collapse/collapse-demo.ts", "diff": "@@ -17,6 +17,6 @@ import { Component, ViewEncapsulation } from '@angular/core';\nencapsulation: ViewEncapsulation.None\n})\nexport class CollapseDemo {\n- isCollapsedContent: boolean = false;\n- isCollapsedImage: boolean = true;\n+ _isCollapsedContent: boolean = false;\n+ _isCollapsedImage: boolean = true;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/demo-app/demo-app.ts", "new_path": "src/demo-app/demo-app/demo-app.ts", "diff": "@@ -20,8 +20,8 @@ export class Home { }\nencapsulation: ViewEncapsulation.None,\n})\nexport class DemoApp {\n- private isSidenavOpened: boolean = false;\n- private footerNav: any = { prev: null, next: null };\n+ isSidenavOpened: boolean = false;\n+ footerNav: any = { prev: null, next: null };\nnavItems = [\n{ name: 'Accordion', route: 'accordion' },\n{ name: 'Autocomplete', route: 'autocomplete' },\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/select/select-demo.html", "new_path": "src/demo-app/select/select-demo.html", "diff": "<input name=\"search\"\ntype=\"text\"\nplaceholder=\"Search for Cities\"\n- [(ngModel)]=\"search\" />\n+ [(ngModel)]=\"_search\" />\n</md2-select-header>\n- <md2-option *ngFor=\"let i of items | dataPipe : search\" [value]=\"i.value\">{{i.name}}</md2-option>\n+ <md2-option *ngFor=\"let i of items | dataPipe : _search\" [value]=\"i.value\">{{i.name}}</md2-option>\n</md2-select>\n<p> Value: {{ item }} </p>\n<p> Touched: {{ selectControl.touched }} </p>\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/select/select-demo.ts", "new_path": "src/demo-app/select/select-demo.ts", "diff": "@@ -10,6 +10,7 @@ import { Component, ViewEncapsulation } from '@angular/core';\nexport class SelectDemo {\nisRequired = false;\nisDisabled = false;\n+ _search: string = '';\nisDisabledMultiple = false;\nitem: any = null;\nitemMultiple: any = null;\n" } ]
TypeScript
MIT License
promact/md2
chore: fixed AOT issues in demo-app
530,388
30.03.2017 11:49:44
-19,080
e504ee5145fdbd448b32e4ea10478eda3efbbffe
chore: update linting issues
[ { "change_type": "MODIFY", "old_path": "scripts/release/publish-build-artifacts.sh", "new_path": "scripts/release/publish-build-artifacts.sh", "diff": "@@ -8,7 +8,7 @@ set -e -o pipefail\n# Go to the project root directory\ncd $(dirname $0)/../..\n-buildDir=\"dist/@angular/material\"\n+buildDir=\"dist/md2\"\nbuildVersion=$(sed -nE 's/^\\s*\"version\": \"(.*?)\",$/\\1/p' package.json)\ncommitSha=$(git rev-parse --short HEAD)\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/tsconfig-aot.json", "new_path": "src/demo-app/tsconfig-aot.json", "diff": "\"../node_modules/@types/!(node)\"\n],\n\"paths\": {\n- \"@angular/material\": [\n- \"./@angular/material\"\n+ \"md2\": [\n+ \"./md2\"\n]\n}\n},\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/date-locale.ts", "new_path": "src/lib/datepicker/date-locale.ts", "diff": "@@ -2,6 +2,14 @@ import {\nInjectable,\n} from '@angular/core';\n+/** Whether the browser supports the Intl API. */\n+const SUPPORTS_INTL_API = !!Intl;\n+\n+/** Creates an array and fills it with values. */\n+function range<T>(length: number, valueFunction: (index: number) => T): T[] {\n+ return Array.apply(null, Array(length)).map((v: undefined, i: number) => valueFunction(i));\n+}\n+\n/** Date locale info. TODO(mmalerba): Integrate with i18n solution once we know what we're doing. */\n@Injectable()\nexport class DateLocale {\n@@ -22,6 +30,28 @@ export class DateLocale {\n{ full: 'December', short: 'Dec' },\n];\n+ fullMonths = SUPPORTS_INTL_API ? this._createMonthsArray('long') :\n+ [\n+ 'January',\n+ 'February',\n+ 'March',\n+ 'April',\n+ 'May',\n+ 'June',\n+ 'July',\n+ 'August',\n+ 'September',\n+ 'October',\n+ 'November',\n+ 'December'\n+ ];\n+\n+ shortMonths = SUPPORTS_INTL_API ? this._createMonthsArray('short') :\n+ ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n+\n+ narrowMonths = SUPPORTS_INTL_API ? this._createMonthsArray('narrow') :\n+ ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'];\n+\ndays = [\n{ full: 'Sunday', short: 'Sun', xshort: 'S' },\n{ full: 'Monday', short: 'Mon', xshort: 'M' },\n@@ -32,6 +62,15 @@ export class DateLocale {\n{ full: 'Saturday', short: 'Sat', xshort: 'S' },\n];\n+ fullDays = SUPPORTS_INTL_API ? this._createDaysArray('long') :\n+ ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n+\n+ shortDays = SUPPORTS_INTL_API ? this._createDaysArray('short') :\n+ ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n+\n+ narrowDays = SUPPORTS_INTL_API ? this._createDaysArray('narrow') :\n+ ['S', 'M', 'T', 'W', 'T', 'F', 'S'];\n+\ngetDays() {\nreturn this.days.slice(this.firstDayOfWeek, this.days.length)\n.concat(this.days.slice(0, this.firstDayOfWeek));\n@@ -47,4 +86,14 @@ export class DateLocale {\ngetYearLabel(y: number) { return `${y}`; }\n+ private _createMonthsArray(format: string) {\n+ let dtf = new Intl.DateTimeFormat(undefined, { month: format });\n+ return range(12, i => dtf.format(new Date(2017, i, 1)));\n+ }\n+\n+ private _createDaysArray(format: string) {\n+ let dtf = new Intl.DateTimeFormat(undefined, { weekday: format });\n+ return range(7, i => dtf.format(new Date(2017, 0, i + 1)));\n+ }\n+\n}\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/date-util.ts", "new_path": "src/lib/datepicker/date-util.ts", "diff": "+import { DateLocale } from './date-locale';\n-function val3(v: string) { return v.substr(0, 3); }\n-function split(str: string, regexp: any) {\n- // @condblock ie8compatibility\n- let start = 0;\n- let m: any, r: any = [];\n- while (m = regexp.exec(str)) {\n- r.push(str.substring(start, m.index));\n- start = m.index + m[0].length;\n- }\n- r.push(str.substr(start));\n- return r;\n- // @condend ie8compatibility\n-\n- // @cond !ie8compatibility return str.split(regexp);\n-}\n-\n-function map(list: any, mapFunc: any, ctx?: any) {\n- let result: any = [];\n- each(list, (item: any, index: number) => {\n- result.push(mapFunc.call(ctx || list, item, index));\n- });\n- return result;\n-}\n-\n-function each(list: any, cb: any, ctx?: any) {\n- if (list) {\n- for (let i = 0; i < list.length; i++) {\n- cb.call(ctx || list, list[i], i);\n- }\n- }\n- return list;\n-}\n+export class DateUtil {\n-export const MONTH_LONG_NAMES = split('January,February,March,April,May,June,July,August,September,October,November,December', /,/g);\n-export const MONTH_SHORT_NAMES = map(MONTH_LONG_NAMES, val3); // ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n-export const WEEK_LONG_NAMES = split('Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday', /,/g);\n-export const WEEK_SHORT_NAMES = map(WEEK_LONG_NAMES, val3);\n-export const MERIDIAN_NAMES = split('am,pm', /,/g);\n-export const MERIDIAN_NAMES_FULL = split('am,am,am,am,am,am,am,am,am,am,am,am,pm,pm,pm,pm,pm,pm,pm,pm,pm,pm,pm,pm', /,/g);\n+ _locale: DateLocale = new DateLocale();\n-export const PARSE_DATE_MAP: any = {\n+ parseDateMap: any = {\n'y': 0, // placeholder -> ctorIndex\n'Y': [0, -2000],\n'M': [1, 1], // placeholder -> [ctorIndex, offset|value array]\n- 'n': [1, MONTH_SHORT_NAMES],\n- 'N': [1, MONTH_LONG_NAMES],\n+ 'n': [1, this._locale.shortMonths],\n+ 'N': [1, this._locale.fullMonths],\n'd': 2,\n'm': 4,\n'H': 3,\n@@ -53,11 +18,9 @@ export const PARSE_DATE_MAP: any = {\n'k': [3, 1],\n's': 5,\n'S': 6,\n- 'a': [3, MERIDIAN_NAMES]\n+ 'a': [3, ['am', 'pm']]\n};\n-export class DateUtil {\n-\nreplace(s: string, regexp: any, sub?: string) {\nreturn (s != null ? '' + s : '').replace(regexp, sub != null ? sub : '');\n}\n@@ -167,7 +130,7 @@ export class DateUtil {\nlet indexEntry: any = indexMap[i];\nif (this.isList(indexEntry)) { // for a, n or N\nlet placeholderChar = indexEntry[0];\n- let mapEntry = PARSE_DATE_MAP[placeholderChar];\n+ let mapEntry = this.parseDateMap[placeholderChar];\nlet ctorIndex = mapEntry[0];\nlet valList = indexEntry[1] || mapEntry[1];\nlet listValue = this.find(valList,\n@@ -186,7 +149,7 @@ export class DateUtil {\n}\n} else if (indexEntry) { // for numeric values (yHmMs)\nlet value = parseFloat(matchVal);\n- let mapEntry = PARSE_DATE_MAP[indexEntry];\n+ let mapEntry = this.parseDateMap[indexEntry];\nif (this.isList(mapEntry)) {\nctorArgs[mapEntry[0]] += value - mapEntry[1];\n} else {\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "[tabindex]=\"tabindex\"\n[disabled]=\"disabled\"\n[value]=\"value | date:format\"\n+ autocomplete=\"off\"\n(change)=\"$event.stopPropagation()\"\n(focus)=\"_handleFocus($event)\"\n- (blur)=\"_handleBlur($event)\" />\n+ (blur)=\"_handleBlur($event)\"\n+ (keydown)=\"_handleKeydown($event)\" />\n<span *ngIf=\"!value || required || disabled\" class=\"md2-datepicker-arrow\"></span>\n<span *ngIf=\"value && !required && !disabled\"\nclass=\"md2-datepicker-clear\" (click)=\"_clearValue($event)\">\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -7,7 +7,6 @@ import {\nOutput,\nOptional,\nEventEmitter,\n- Renderer,\nSelf,\nTemplateRef,\nViewChild,\n@@ -75,9 +74,6 @@ export type PanelPositionY = 'above' | 'below';\n'[attr.aria-required]': 'required.toString()',\n'[attr.aria-disabled]': 'disabled.toString()',\n'[attr.aria-invalid]': '_control?.invalid || \"false\"',\n- '(keydown)': '_handleKeydown($event)',\n- '(focus)': '_onFocus()',\n- '(blur)': '_onBlur()',\n'(window:resize)': '_handleWindowResize($event)'\n},\nanimations: [\n@@ -144,7 +140,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n/** Event emitted when the selected date has been changed by the user. */\n@Output() change: EventEmitter<Md2DateChange> = new EventEmitter<Md2DateChange>();\n- constructor(private _element: ElementRef, private overlay: Overlay, private _renderer: Renderer,\n+ constructor(private _element: ElementRef, private overlay: Overlay,\nprivate _viewContainerRef: ViewContainerRef, private _locale: DateLocale,\nprivate _util: DateUtil, @Self() @Optional() public _control: NgControl) {\nif (this._control) {\n@@ -369,7 +365,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n}\nprivate _focusHost(): void {\n- this._renderer.invokeElementMethod(this._element.nativeElement, 'focus');\n+ this._element.nativeElement.querySelectorAll('input')[0].focus();\n}\nprivate coerceDateProperty(value: any): Date {\n@@ -513,12 +509,6 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n}\n}\n- _onFocus() {\n- if (!this.panelOpen && this.openOnFocus) {\n- this.open();\n- }\n- }\n-\n_onBlur() {\nif (!this.panelOpen) {\nthis._onTouched();\n@@ -527,6 +517,9 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n_handleFocus(event: Event) {\nthis._inputFocused = true;\n+ if (!this.panelOpen && this.openOnFocus) {\n+ this.open();\n+ }\n}\n_handleBlur(event: Event) {\n@@ -536,7 +529,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n}\nlet el: any = event.target;\nlet d: any = this._util.parseDate(el.value, this.format);\n- if (this._util.isValidDate(d)) {\n+ if (this._util.isValidDate(d) && !this._util.isSameDay(this.value, d)) {\nthis.value = d;\nthis._emitChangeEvent();\n}\n@@ -546,6 +539,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nevent.stopPropagation();\nthis.value = null;\nthis._emitChangeEvent();\n+ this._focusHost();\n}\n/**\n" }, { "change_type": "MODIFY", "old_path": "src/lib/tags/tags.ts", "new_path": "src/lib/tags/tags.ts", "diff": "@@ -388,7 +388,8 @@ export class Md2Tags implements AfterContentInit, ControlValueAccessor {\nprivate filterMatches() {\nlet tempList = this._tags.map((tag: any) => new Tag(tag, this.textKey, this.valueKey));\nthis._list = tempList.filter((t: Tag) =>\n- (new RegExp(this._inputValue, 'ig').test(t.text) && !this._items.find((i: Tag) => t.text === i.text)));\n+ (new RegExp(this._inputValue, 'ig').test(t.text) &&\n+ !this._items.find((i: Tag) => t.text === i.text)));\nif (this._list.length > 0) {\nthis._focusedTag = 0;\n}\n" }, { "change_type": "MODIFY", "old_path": "tools/gulp/tasks/deploy.ts", "new_path": "tools/gulp/tasks/deploy.ts", "diff": "@@ -14,9 +14,9 @@ gulp.task('deploy', ['build:devapp'], () => {\nif (err) { return console.log(err); }\nconst result = data.replace('<base href=\"/\">', '<base href=\".\">');\n- fs.writeFile('./dist/index.html', result, 'utf8', (err) => {\n- if (err) {\n- return console.log(err);\n+ fs.writeFile('./dist/index.html', result, 'utf8', (e) => {\n+ if (e) {\n+ return console.log(e);\n} else {\nreturn gulp.src('./dist/**/*')\n.pipe(gulp.dest('./deploy'));\n" } ]
TypeScript
MIT License
promact/md2
chore: update linting issues
530,388
30.03.2017 13:52:24
-19,080
aa1f90fe25ce754ba22ce76c4ef27ae60913ee96
chore(tags) wrapped text of autocomplete menu option
[ { "change_type": "MODIFY", "old_path": "src/lib/tags/tags.html", "new_path": "src/lib/tags/tags.html", "diff": "<path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n</svg>\n</span>\n- <span class=\"md2-tag-add\">\n+ <div class=\"md2-tag-add\">\n<input [(ngModel)]=\"_inputValue\" type=\"text\" tabs=\"false\" autocomplete=\"off\" tabindex=\"-1\" [disabled]=\"disabled\" class=\"md2-tags-input\" [placeholder]=\"placeholder\" (focus)=\"_onInputFocus()\" (blur)=\"_onInputBlur()\" (keydown)=\"_handleInputKeydown($event)\" (change)=\"$event.stopPropagation()\" />\n- <ul *ngIf=\"isMenuVisible\" class=\"md2-tags-menu\" (mouseenter)=\"_listEnter()\" (mouseleave)=\"_listLeave()\">\n+ <ul class=\"md2-tags-menu\" (mouseenter)=\"_listEnter()\" (mouseleave)=\"_listLeave()\">\n<li class=\"md2-option\" *ngFor=\"let l of _list; let i = index;\" [class.focused]=\"_focusedTag === i\" (click)=\"_addTag($event, i)\">\n<span class=\"md2-option-text\" [innerHtml]=\"l.text | highlight:_inputValue\"></span>\n</li>\n</ul>\n- </span>\n+ </div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/tags/tags.scss", "new_path": "src/lib/tags/tags.scss", "diff": "@@ -145,9 +145,8 @@ md2-tags .md2-tags-menu .md2-option {\nalign-items: center;\nwidth: auto;\ntransition: background 150ms linear;\n- padding: 0 16px;\n- height: 48px;\n- line-height: 48px;\n+ padding: 12px 16px;\n+ line-height: 24px;\n}\nmd2-tags .md2-tags-menu .md2-option:hover, md2-tags .md2-tags-menu .md2-option.focused {\n@@ -156,11 +155,6 @@ md2-tags .md2-tags-menu .md2-option:hover, md2-tags .md2-tags-menu .md2-option.f\nmd2-tags .md2-tags-menu .md2-option .md2-option-text {\nwidth: auto;\n- white-space: nowrap;\n- overflow: hidden;\n- -ms-text-overflow: ellipsis;\n- -o-text-overflow: ellipsis;\n- text-overflow: ellipsis;\nfont-size: 16px;\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(tags) wrapped text of autocomplete menu option
530,388
30.03.2017 13:57:19
-19,080
d0f0faa74f6c54f824aa4b54de8c4b9d63f22944
chore(tags) fix menu visiblity issue
[ { "change_type": "MODIFY", "old_path": "src/lib/tags/tags.html", "new_path": "src/lib/tags/tags.html", "diff": "</span>\n<div class=\"md2-tag-add\">\n<input [(ngModel)]=\"_inputValue\" type=\"text\" tabs=\"false\" autocomplete=\"off\" tabindex=\"-1\" [disabled]=\"disabled\" class=\"md2-tags-input\" [placeholder]=\"placeholder\" (focus)=\"_onInputFocus()\" (blur)=\"_onInputBlur()\" (keydown)=\"_handleInputKeydown($event)\" (change)=\"$event.stopPropagation()\" />\n- <ul class=\"md2-tags-menu\" (mouseenter)=\"_listEnter()\" (mouseleave)=\"_listLeave()\">\n+ <ul *ngIf=\"isMenuVisible\" class=\"md2-tags-menu\" (mouseenter)=\"_listEnter()\" (mouseleave)=\"_listLeave()\">\n<li class=\"md2-option\" *ngFor=\"let l of _list; let i = index;\" [class.focused]=\"_focusedTag === i\" (click)=\"_addTag($event, i)\">\n<span class=\"md2-option-text\" [innerHtml]=\"l.text | highlight:_inputValue\"></span>\n</li>\n" } ]
TypeScript
MIT License
promact/md2
chore(tags) fix menu visiblity issue
530,388
30.03.2017 14:23:30
-19,080
891e3d847fcf6829fa81f33272606c0d97b40bd3
chore(select) update panel offset
[ { "change_type": "MODIFY", "old_path": "src/lib/select/select.ts", "new_path": "src/lib/select/select.ts", "diff": "@@ -71,7 +71,7 @@ export const SELECT_PANEL_PADDING_X = 16;\n* the browser adds ~4px, because we're using inline elements.\n* The checkbox width is 20px.\n*/\n-export const SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_PANEL_PADDING_X * 1.75 + 20;\n+export const SELECT_MULTIPLE_PANEL_PADDING_X = SELECT_PANEL_PADDING_X * 1.25 + 20;\n/**\n* The panel's padding on the y-axis. This padding indicates there are more\n" } ]
TypeScript
MIT License
promact/md2
chore(select) update panel offset
530,388
31.03.2017 13:56:51
-19,080
2ef3072bf5b28714209f9ed828c5db3c88a87ace
chore(colorpicker) fix AOT issues and update performance
[ { "change_type": "RENAME", "old_path": "src/lib/colorpicker/calculateColor.ts", "new_path": "src/lib/colorpicker/color-util.ts", "diff": "@@ -5,7 +5,7 @@ export const COLOR_RGB = /(rgb)a?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*%?,\\s*(\\d{1,3}\nexport const COLOR_HSL = /(hsl)a?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})%\\s*,\\s*(\\d{1,3})%\\s*(?:,\\s*(\\d+(?:\\.\\d+)?)\\s*)?\\)/;\n@Injectable()\n-export class ColorpickerService {\n+export class ColorUtil {\n/**\n* hsla to hsva\n* @param hsla\n" }, { "change_type": "MODIFY", "old_path": "src/lib/colorpicker/colorpicker.scss", "new_path": "src/lib/colorpicker/colorpicker.scss", "diff": "@@ -3,23 +3,15 @@ $primary: #106cc8 !default;\n$warn: #f44336 !default;\n.md2-colorpicker-wrapper {\n- width: 270px;\n- height: 355px;\n- border-radius: 2px;\n+ border-radius: 3px;\nbackground-color: #fff;\nz-index: 10;\nbox-shadow: 0 2px 6px rgba($black, 0.4);\n- transform: scale(0);\n- transform-origin: left top;\n- transition: 150ms;\n- user-select: none;\n-\n- &.active {\n- transform: scale(1);\n- }\n+ overflow: hidden;\n}\n.md2-colorpicker-panel {\n+ outline: 0;\nbox-shadow: 0 5px 5px -3px rgba(black, 0.2), 0 8px 10px 1px rgba(black, 0.14), 0 3px 14px 2px rgba(black, 0.12);\n&[container='dialog'] {\n@@ -60,7 +52,6 @@ $warn: #f44336 !default;\nborder-color: transparent;\nbackground-position: 0 bottom;\ncursor: default;\n- user-select: none;\n}\nmd2-colorpicker:focus:not(.md2-colorpicker-disabled) & {\n@@ -125,10 +116,10 @@ md2-colorpicker .md2-colorpicker-placeholder.has-value {\n.color-picker-selector {\ndisplay: block;\n- padding: 18px 0 18px 32px;\n+ padding: 18px 0 4px 46px;\nwhite-space: nowrap;\n- .color-div {\n+ .md2-colorpicker-preview {\ncontent: '';\nwidth: 24px;\nheight: 24px;\n@@ -139,8 +130,8 @@ md2-colorpicker .md2-colorpicker-placeholder.has-value {\nbackground-size: 8px 8px;\nbackground-position: 0 0, 4px 4px;\nposition: absolute;\n- top: 21px;\n- left: 0;\n+ top: 19px;\n+ left: 6px;\nborder: 2px solid #fafafa;\ndisplay: block;\nfill: #5a5a5a;\n@@ -178,24 +169,21 @@ md2-colorpicker {\ndisplay: block;\nmax-width: 215px;\noutline: none;\n- -webkit-backface-visibility: hidden;\n- backface-visibility: hidden;\n}\n.md2-color-picker {\nposition: relative;\ndisplay: block;\n+ width: 266px;\noutline: none;\n- backface-visibility: hidden;\n* {\nbox-sizing: border-box;\n}\n.input-color-content {\n- width: 250px;\nposition: relative;\n- margin: 10px auto;\n+ padding: 8px;\n}\ni {\n@@ -242,11 +230,9 @@ md2-colorpicker {\n.saturation-lightness {\nwidth: 100%;\nheight: 130px;\n- border: none;\n+ border-radius: 2px;\noverflow: hidden;\nbackground-image: linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, rgba(255, 255, 255, 0));\n- -ms-filter: 'progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)';\n- filter: progid:dximagetransform.microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000');\n}\n.saturation-lightness:hover {\n@@ -254,23 +240,22 @@ md2-colorpicker {\n}\n.hue {\n+ position: relative;\nwidth: 100%;\nheight: 30px;\n- border: none;\n- margin: 10px 0;\n- background: -webkit-linear-gradient(left, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%);\n+ margin: 8px 0;\n+ border-radius: 2px;\n+ background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);\n}\n.alpha {\n- border: 1px solid rgb(239, 239, 239);\n+ position: relative;\nwidth: 100%;\nheight: 30px;\n- background-color: #fff;\n- background-size: 8px 8px;\n+ border-radius: 2px;\n+ background: linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\n+ background-size: 8px 8px, 8px 8px;\nbackground-position: 0 0, 4px 4px;\n- position: relative; /*background-image: linear-gradient(to left, transparent, transparent), linear-gradient(to right, #fff, rgba(255, 255, 255, 0));*/\n- background-image: linear-gradient(45deg, rgb(221, 221, 221) 25%, transparent 0px, transparent 75%, rgb(221, 221, 221) 0px, rgb(221, 221, 221)), linear-gradient(45deg, rgb(221, 221, 221) 25%, transparent 0px, transparent 75%, rgb(221, 221, 221) 0px, rgb(221, 221, 221));\n- background-image: -webkit-linear-gradient(45deg,#ddd 25%,transparent 0,transparent 75%,#ddd 0,#ddd),-webkit-linear-gradient(45deg,#ddd 25%,transparent 0,transparent 75%,#ddd 0,#ddd);\n.alpha-main {\nposition: absolute;\n@@ -288,7 +273,7 @@ md2-colorpicker {\nbackground-size: 8px 8px;\nbackground-position: 0 0,4px 4px;\nposition: relative;\n- background-image: linear-gradient(45deg, #dddddd 25%, transparent 0px, transparent 75%, #dddddd 0px, #dddddd), linear-gradient(45deg, #dddddd 25%, transparent 0px, transparent 75%, #dddddd 0px, #dddddd);\n+ background-image: linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\nbackground-image: -webkit-linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), -webkit-linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\n.selected-color-bg {\n@@ -315,6 +300,7 @@ md2-colorpicker {\ncursor: pointer;\nsvg {\n+ vertical-align: bottom;\nfill: #686868;\n}\n}\n@@ -413,14 +399,25 @@ md2-colorpicker {\nfont-size: 14px;\ndisplay: inline-block;\nfloat: left;\n- padding: 3px;\n+ padding: 4px 8px 3px;\n+ border-bottom: 2px solid transparent;\ncursor: pointer;\n- background: rgba(255, 255, 255, 0.4);\n+ background: rgba(white, 0.25);\n+\n+ .dark & {\n+ background: rgba(black, 0.25);\n}\n-.type-policy.active {\n- background: rgba(153, 153, 153, 0.35) !important;\n+ &.active {\n+ border-color: rgba(white, 0.5);\n+ background: transparent;\n+\n+ .dark & {\n+ border-color: rgba(black, 0.5);\n+ }\n}\n+}\n+\n.cdk-overlay-container, .cdk-global-overlay-wrapper {\npointer-events: none;\n" }, { "change_type": "MODIFY", "old_path": "src/lib/colorpicker/colorpicker.ts", "new_path": "src/lib/colorpicker/colorpicker.ts", "diff": "@@ -12,8 +12,8 @@ import {\nOptional,\nRenderer,\nSelf,\n- ViewChildren,\n- QueryList,\n+ TemplateRef,\n+ ViewChild,\nViewContainerRef\n} from '@angular/core';\nimport {\n@@ -27,14 +27,13 @@ import {\nOverlayModule,\nOverlayState,\nOverlayRef,\n- Portal,\n+ TemplatePortal,\nPortalModule,\n- TemplatePortalDirective,\nHorizontalConnectionPos,\nVerticalConnectionPos\n} from '../core';\nimport { Subscription } from 'rxjs/Subscription';\n-import { ColorpickerService } from './calculateColor';\n+import { ColorUtil } from './color-util';\nimport { coerceBooleanProperty } from '../core/coercion/boolean-property';\nimport { Container, PanelPositionX, PanelPositionY } from '../datepicker/datepicker';\n@@ -186,6 +185,12 @@ export class Md2ColorChange {\nencapsulation: ViewEncapsulation.None\n})\nexport class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n+\n+ private _portal: TemplatePortal;\n+ private _overlayRef: OverlayRef;\n+ private _backdropSubscription: Subscription;\n+ private _positionSubscription: Subscription;\n+\n_innerValue: string = '';\n_isColorpickerVisible: boolean;\n_hueSliderColor: string;\n@@ -203,9 +208,6 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\nprivate _created: boolean;\nprivate _defalutColor: string = '#000000';\nprivate _initialColor: string;\n- private _overlayRef: OverlayRef;\n- private _backdropSubscription: Subscription;\n- private _positionSubscription: Subscription;\n/** Whether or not the overlay panel is open. */\nprivate _panelOpen = false;\n@@ -223,7 +225,7 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\nprivate _container: Container = 'inline';\nfontColor: string;\n- backAreaColor: string;\n+ _isDark: boolean;\nisInputValidColor: boolean = false;\n_onChange = (value: any) => { };\n@@ -271,7 +273,7 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\nset value(v: any) {\nif (v !== this._innerValue) {\nif (v) {\n- this.hsva = this.service.stringToHsva(v);\n+ this.hsva = this._util.stringToHsva(v);\n}\nthis._innerValue = v;\n}\n@@ -300,12 +302,11 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n/** Event emitted when the select has been closed. */\n@Output() onClose: EventEmitter<void> = new EventEmitter<void>();\n- @ViewChildren(TemplatePortalDirective) templatePortals: QueryList<Portal<any>>;\n- @ViewChildren(TemplatePortalDirective) templatePortal: Portal<any>;\n+ @ViewChild('portal') _templatePortal: TemplateRef<any>;\nconstructor(private _element: ElementRef, private overlay: Overlay,\nprivate _viewContainerRef: ViewContainerRef, private _renderer: Renderer,\n- private service: ColorpickerService, @Self() @Optional() public _control: NgControl) {\n+ private _util: ColorUtil, @Self() @Optional() public _control: NgControl) {\nthis._created = false;\nif (this._control) {\nthis._control.valueAccessor = this;\n@@ -326,12 +327,12 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n/** Opens the overlay panel. */\nopen(): void {\n- let hsva = this.service.stringToHsva(this.color + '');\n+ let hsva = this._util.stringToHsva(this.color + '');\nthis.isInputFocus = true;\nif (hsva) {\nthis.hsva = hsva;\n} else {\n- this.hsva = this.service.stringToHsva(this._defalutColor);\n+ this.hsva = this._util.stringToHsva(this._defalutColor);\n}\nthis.sliderDim = new SliderDimension(245, 250, 130, 245);\n@@ -355,7 +356,12 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n}\nthis._createOverlay();\n- this._overlayRef.attach(this.templatePortals.first);\n+\n+ if (!this._portal) {\n+ this._portal = new TemplatePortal(this._templatePortal, this._viewContainerRef);\n+ }\n+\n+ this._overlayRef.attach(this._portal);\nthis._subscribeToBackdrop();\nthis._panelOpen = true;\nthis.onOpen.emit();\n@@ -413,16 +419,16 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n* @param rg\n*/\nsetSaturation(val: { v: number, rg: number }) {\n- let hsla = this.service.hsva2hsla(this.hsva);\n+ let hsla = this._util.hsva2hsla(this.hsva);\nhsla.s = val.v / val.rg;\n- this.hsva = this.service.hsla2hsva(hsla);\n+ this.hsva = this._util.hsla2hsva(hsla);\nthis.update();\n}\nsetLightness(val: { v: number, rg: number }) {\n- let hsla = this.service.hsva2hsla(this.hsva);\n+ let hsla = this._util.hsva2hsla(this.hsva);\nhsla.l = val.v / val.rg;\n- this.hsva = this.service.hsla2hsva(hsla);\n+ this.hsva = this._util.hsla2hsva(hsla);\nthis.update();\n}\n@@ -437,21 +443,21 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n}\nsetR(val: { v: number, rg: number }) {\n- let rgba = this.service.hsvaToRgba(this.hsva);\n+ let rgba = this._util.hsvaToRgba(this.hsva);\nrgba.r = val.v / val.rg;\n- this.hsva = this.service.rgbaToHsva(rgba);\n+ this.hsva = this._util.rgbaToHsva(rgba);\nthis.update();\n}\nsetG(val: { v: number, rg: number }) {\n- let rgba = this.service.hsvaToRgba(this.hsva);\n+ let rgba = this._util.hsvaToRgba(this.hsva);\nrgba.g = val.v / val.rg;\n- this.hsva = this.service.rgbaToHsva(rgba);\n+ this.hsva = this._util.rgbaToHsva(rgba);\nthis.update();\n}\nsetB(val: { v: number, rg: number }) {\n- let rgba = this.service.hsvaToRgba(this.hsva);\n+ let rgba = this._util.hsvaToRgba(this.hsva);\nrgba.b = val.v / val.rg;\n- this.hsva = this.service.rgbaToHsva(rgba);\n+ this.hsva = this._util.rgbaToHsva(rgba);\nthis.update();\n}\nsetSaturationAndBrightness(val: { s: number, v: number, pointX: number, pointY: number }) {\n@@ -489,7 +495,7 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\nvalue = '#000000';\nthis.backColor = false;\n}\n- let hsva = this.service.stringToHsva(value);\n+ let hsva = this._util.stringToHsva(value);\nif (hsva !== null) {\nthis.hsva = hsva;\n}\n@@ -508,9 +514,9 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n* update color\n*/\nupdate() {\n- let hsla = this.service.hsva2hsla(this.hsva);\n- let rgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(this.hsva));\n- let hueRgba = this.service.denormalizeRGBA(this.service.hsvaToRgba(\n+ let hsla = this._util.hsva2hsla(this.hsva);\n+ let rgba = this._util.denormalizeRGBA(this._util.hsvaToRgba(this.hsva));\n+ let hueRgba = this._util.denormalizeRGBA(this._util.hsvaToRgba(\nnew Hsva(this.hsva.h, 1, 1, 1)));\nthis.alphaColor = 'rgb(' + rgba.r + ',' + rgba.g + ',' + rgba.b + ')';\n@@ -519,23 +525,23 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\nMath.round(hsla.l * 100), Math.round(hsla.a * 100) / 100);\nthis.rgbaText = new Rgba(rgba.r, rgba.g, rgba.b, Math.round(rgba.a * 100) / 100);\nif (this.backColor) {\n- this.hexText = this.service.hexText(rgba);\n+ this.hexText = this._util.hexText(rgba);\n}\nthis.backColor = true;\nlet colorCode = Math.round((this.rgbaText.r * 299 + this.rgbaText.g * 587 +\nthis.rgbaText.b * 114) / 1000);\nif (colorCode >= 128 || this.hsva.a < 0.35) {\nthis.fontColor = 'black';\n- this.backAreaColor = 'rgba(0,0,0,.4)';\n+ this._isDark = true;\n} else {\nthis.fontColor = 'white';\n- this.backAreaColor = 'rgba(255,255,255,.4)';\n+ this._isDark = false;\n}\nif (this.format === 0 && this.hsva.a < 1) {\nthis.format++;\n}\n- this.outputColor = this.service.outputFormat(this.hsva, this.cFormat);\n+ this.outputColor = this._util.outputFormat(this.hsva, this.cFormat);\nthis.slider = new SliderPosition((this.hsva.h) * this.sliderDim.h,\nthis.hsva.s * this.sliderDim.s - 7, (1 - this.hsva.v) * this.sliderDim.v - 7,\nthis.hsva.a * this.sliderDim.a);\n@@ -549,7 +555,7 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n}\nisDescendant(parent: any, child: any) {\n- var node = child.parentNode;\n+ let node = child.parentNode;\nwhile (node !== null) {\nif (node === parent) {\nreturn true;\n@@ -560,7 +566,7 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\n}\ncheckInputVal(event: Event): void {\n- this.hsva = this.service.stringToHsva(this.color + '');\n+ this.hsva = this._util.stringToHsva(this.color + '');\nthis.isInputFocus = false;\nif (this.hsva) {\nif (this._innerValue !== this.color) {\n@@ -588,6 +594,10 @@ export class Md2Colorpicker implements OnDestroy, ControlValueAccessor {\nregisterOnTouched(fn: () => {}): void { this._onTouched = fn; }\n+ setDisabledState(isDisabled: boolean): void {\n+ this.disabled = isDisabled;\n+ }\n+\nprivate _subscribeToBackdrop(): void {\nthis._backdropSubscription = this._overlayRef.backdropClick().subscribe(() => {\nthis._innerValue = this._initialColor;\n@@ -676,7 +686,7 @@ export const MD2_COLORPICKER_DIRECTIVES = [\ndeclarations: MD2_COLORPICKER_DIRECTIVES,\nimports: [CommonModule, FormsModule, OverlayModule, PortalModule],\nexports: MD2_COLORPICKER_DIRECTIVES,\n- providers: [ColorpickerService]\n+ providers: [ColorUtil]\n})\nexport class Md2ColorpickerModule {\nstatic forRoot(): ModuleWithProviders {\n" } ]
TypeScript
MIT License
promact/md2
chore(colorpicker) fix AOT issues and update performance #137, #143
530,388
31.03.2017 14:10:15
-19,080
4725a513220c7c79d395c26f4872df69aeaac2e1
chore(colorpicker) update lint issues
[ { "change_type": "MODIFY", "old_path": "src/lib/colorpicker/colorpicker.scss", "new_path": "src/lib/colorpicker/colorpicker.scss", "diff": "@@ -120,18 +120,17 @@ md2-colorpicker .md2-colorpicker-placeholder.has-value {\nwhite-space: nowrap;\n.md2-colorpicker-preview {\n+ position: absolute;\n+ top: 19px;\n+ left: 6px;\ncontent: '';\nwidth: 24px;\nheight: 24px;\noverflow: hidden;\nbackground-color: #fff;\n- background-image: -webkit-linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), -webkit-linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\n- background-image: linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\n+ background: linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\nbackground-size: 8px 8px;\nbackground-position: 0 0, 4px 4px;\n- position: absolute;\n- top: 19px;\n- left: 6px;\nborder: 2px solid #fafafa;\ndisplay: block;\nfill: #5a5a5a;\n@@ -254,7 +253,7 @@ md2-colorpicker {\nheight: 30px;\nborder-radius: 2px;\nbackground: linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\n- background-size: 8px 8px, 8px 8px;\n+ background-size: 8px 8px;\nbackground-position: 0 0, 4px 4px;\n.alpha-main {\n@@ -267,14 +266,13 @@ md2-colorpicker {\n}\n.selected-color {\n+ position: relative;\nwidth: 100%;\nheight: 75px;\nbackground-color: #fff;\n+ background: linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\nbackground-size: 8px 8px;\nbackground-position: 0 0, 4px 4px;\n- position: relative;\n- background-image: linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\n- background-image: -webkit-linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd), -webkit-linear-gradient(45deg, #ddd 25%, transparent 0, transparent 75%, #ddd 0, #ddd);\n.selected-color-bg {\nposition: absolute;\n@@ -306,13 +304,13 @@ md2-colorpicker {\n}\n.clearfix {\n- &:before,\n- &:after {\n- content: \" \";\n+ &::before,\n+ &::after {\n+ content: ' ';\ndisplay: table;\n}\n- &:after {\n+ &::after {\nclear: both;\n}\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(colorpicker) update lint issues
530,388
03.04.2017 08:48:39
-19,080
ec78310f4acf203af4da1ee75f06e5c37f73b620
chore: update scripts and tasks
[ { "change_type": "MODIFY", "old_path": "scripts/release/publish-build-artifacts.sh", "new_path": "scripts/release/publish-build-artifacts.sh", "diff": "@@ -16,8 +16,8 @@ commitAuthorName=$(git --no-pager show -s --format='%an' HEAD)\ncommitAuthorEmail=$(git --no-pager show -s --format='%ae' HEAD)\ncommitMessage=$(git log --oneline -n 1)\n-repoName=\"material2-builds\"\n-repoUrl=\"https://github.com/angular/material2-builds.git\"\n+repoName=\"md2-builds\"\n+repoUrl=\"https://github.com/Promact/md2-builds.git\"\nrepoDir=\"tmp/$repoName\"\n# Create a release of the current repository.\n" }, { "change_type": "MODIFY", "old_path": "scripts/release/publish-docs-content.sh", "new_path": "scripts/release/publish-docs-content.sh", "diff": "#!/bin/bash\n-# Publish material2 docs assets to the material2-docs-content repo\n-# material.angular.io will pull from this assets repo to get the latest docs\n+# Publish md2 docs assets to the md2-docs-content repo\n+# code.promactinfo.com/md2 will pull from this assets repo to get the latest docs\ncd \"$(dirname $0)/../../\"\ndocsPath=\"./dist/docs\"\n-repoPath=\"/tmp/material2-docs-content\"\n-repoUrl=\"https://github.com/angular/material2-docs-content\"\n+repoPath=\"/tmp/md2-docs-content\"\n+repoUrl=\"https://github.com/Promact/md2-docs-content\"\nexamplesSource=\"./dist/docs/examples\"\n# If the docs directory is not present, generate docs\n" }, { "change_type": "MODIFY", "old_path": "src/lib/autocomplete/index.ts", "new_path": "src/lib/autocomplete/index.ts", "diff": "export * from './autocomplete';\n+export * from './autocomplete-pipe';\n" }, { "change_type": "MODIFY", "old_path": "tools/dgeni/index.js", "new_path": "tools/dgeni/index.js", "diff": "@@ -33,7 +33,7 @@ const dgeniPackageDeps = [\ntypescriptPackage,\n];\n-let apiDocsPackage = new DgeniPackage('material2-api-docs', dgeniPackageDeps)\n+let apiDocsPackage = new DgeniPackage('md2-api-docs', dgeniPackageDeps)\n.processor(require('./processors/link-inherited-docs'))\n" }, { "change_type": "MODIFY", "old_path": "tools/stylelint/no-prefixes/no-prefixes.js", "new_path": "tools/stylelint/no-prefixes/no-prefixes.js", "diff": "@@ -2,7 +2,7 @@ const stylelint = require('stylelint');\nconst NeedsPrefix = require('./needs-prefix');\nconst parseSelector = require('stylelint/lib/utils/parseSelector');\n-const ruleName = 'material/no-prefixes';\n+const ruleName = 'md2/no-prefixes';\nconst messages = stylelint.utils.ruleMessages(ruleName, {\nproperty: property => `Unprefixed property \"${property}\".`,\nvalue: (property, value) => `Unprefixed value in \"${property}: ${value}\".`,\n" } ]
TypeScript
MIT License
promact/md2
chore: update scripts and tasks
530,388
03.04.2017 16:35:29
-19,080
73fe53fc2ed2785cc83453efc8abe6242779a3c0
chore(datepicker) update weekdays
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/calendar.html", "new_path": "src/lib/datepicker/calendar.html", "diff": "</svg>\n</button>\n</div>\n-\n- <table class=\"md2-calendar-weekday-table\">\n- <tr><td *ngFor=\"let day of _weekdays\">{{day}}</td></tr>\n- </table>\n</div>\n<div class=\"md2-calendar-body\" tabindex=\"0\" (keydown)=\"_handleCalendarBodyKeydown($event)\"\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/calendar.ts", "new_path": "src/lib/datepicker/calendar.ts", "diff": "@@ -91,9 +91,6 @@ export class Md2Calendar implements AfterContentInit {\n/** Whether the calendar is in month view. */\n_monthView: boolean;\n- /** The names of the weekdays. */\n- _weekdays: string[];\n-\n/** The label for the current calendar view. */\nget _label(): string {\nreturn this._monthView ?\n@@ -101,10 +98,7 @@ export class Md2Calendar implements AfterContentInit {\nthis._locale.getCalendarYearHeaderLabel(this._activeDate);\n}\n- constructor(private _locale: DateLocale, private _util: DateUtil) {\n- this._weekdays = this._locale.narrowDays.slice(this._locale.firstDayOfWeek)\n- .concat(this._locale.narrowDays.slice(0, this._locale.firstDayOfWeek));\n- }\n+ constructor(private _locale: DateLocale, private _util: DateUtil) { }\nngAfterContentInit() {\nthis._activeDate = this.startAt || this._util.today();\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/month-view.html", "new_path": "src/lib/datepicker/month-view.html", "diff": "+<table class=\"md2-calendar-weekday-table\">\n+ <tr><td *ngFor=\"let day of _weekdays\">{{day}}</td></tr>\n+</table>\n<md2-calendar-table [label]=\"_monthLabel\"\n[rows]=\"_weeks\"\n[todayValue]=\"_todayDate\"\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/month-view.ts", "new_path": "src/lib/datepicker/month-view.ts", "diff": "@@ -65,6 +65,9 @@ export class Md2MonthView implements AfterContentInit {\n/** The number of blank cells in the first row before the 1st of the month. */\n_firstWeekOffset: number;\n+ /** The names of the weekdays. */\n+ _weekdays: string[];\n+\n/**\n* The date of the month that the currently selected Date falls on.\n* Null if the currently selected Date is in another month.\n@@ -74,7 +77,10 @@ export class Md2MonthView implements AfterContentInit {\n/** The date of the month that today falls on. Null if today is in another month. */\n_todayDate: number;\n- constructor(private _locale: DateLocale, private _util: DateUtil) { }\n+ constructor(private _locale: DateLocale, private _util: DateUtil) {\n+ this._weekdays = this._locale.narrowDays.slice(this._locale.firstDayOfWeek)\n+ .concat(this._locale.narrowDays.slice(0, this._locale.firstDayOfWeek));\n+ }\nngAfterContentInit(): void {\nthis._init();\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update weekdays
530,388
04.04.2017 08:45:29
-19,080
2983ed3da50bb82399c7dadc15eaffadf5d4f1f9
docs: added code review and contribution guide docs
[ { "change_type": "ADD", "old_path": null, "new_path": "CODE_REVIEWS.md", "diff": "+# Code reviews for MD2\n+\n+* Before any coding begins on new, large, or breaking work, a design discussion should take place.\n+* All code changes require a review and approval.\n+* Authors should attempt to keep PRs to 200 - 300 line changes.\n+\n+## Workflow\n+1. The code author sends a PR for review. This request should include:\n+ * A mention of the intended reviewer(s) (e.g., `@dharmeshpipariya`)\n+ * A high-level description of the change being made.\n+ * Links to any relevant issues.\n+ * Screenshots (for visual changes or new additions)\n+2. Reviews provide comments and the author responds / makes changes. Repeat until LGTM.\n+3. One or more of the reviewers applies the \"LGTM\" label.\n+4. The party responsible for merging PRs will do so.\n" }, { "change_type": "ADD", "old_path": null, "new_path": "CODING_STANDARDS.md", "diff": "+# MD2 Coding Standards\n+\n+\n+## Code style\n+\n+The [Google JavaScript Style Guide](https://google.github.io/styleguide/jsguide.html) is the\n+basis for our coding style, with additional guidance here where that style guide is not aligned with\n+ES6 or TypeScript.\n+\n+## Coding practices\n+\n+### General\n+\n+#### Write useful comments\n+Comments that explain what some block of code does are nice; they can tell you something in less\n+time than it would take to follow through the code itself.\n+\n+Comments that explain why some block of code exists at all, or does something the way it does,\n+are _invaluable_. The \"why\" is difficult, or sometimes impossible, to track down without seeking out\n+the original author. When collaborators are in the same room, this hurts productivity.\n+When collaborators are in different timezones, this can be devastating to productivity.\n+\n+For example, this is a not-very-useful comment:\n+```ts\n+// Set default tabindex.\n+if (!$attrs['tabindex']) {\n+ $element.attr('tabindex', '-1');\n+}\n+```\n+\n+While this is much more useful:\n+```ts\n+// Unless the user specifies so, the calendar should not be a tab stop.\n+// This is necessary because ngAria might add a tabindex to anything with an ng-model\n+// (based on whether or not the user has turned that particular feature on/off).\n+if (!$attrs['tabindex']) {\n+ $element.attr('tabindex', '-1');\n+}\n+```\n+\n+#### Prefer more focused, granular components vs. complex, configurable components.\n+\n+For example, rather than doing this:\n+```html\n+<span tooltip=\"Basic tooltip!\">test tooltip</span>\n+```\n+\n+do this:\n+```html\n+<md2-tooltip>Basic tooltip!</md2-tooltip>\n+```\n+\n+#### Prefer small, focused modules\n+Keeping modules to a single responsibility makes the code easier to test, consume, and maintain.\n+ES6 modules offer a straightforward way to organize code into logical, granular units.\n+Ideally, individual files are 200 - 300 lines of code.\n+\n+As a rule of thumb, once a file draws near 400 lines (barring abnormally long constants / comments),\n+start considering how to refactor into smaller pieces.\n+\n+#### Less is more\n+Once a feature is released, it never goes away. We should avoid adding features that don't offer\n+high user value for price we pay both in maintenance, complexity, and payload size. When in doubt,\n+leave it out.\n+\n+This applies especially so to providing two different APIs to accomplish the same thing. Always\n+prefer sticking to a _single_ API for accomplishing something.\n+\n+### 100 column limit\n+All code and docs in the repo should be 100 columns or fewer. This applies to TypeScript, SCSS,\n+ HTML, bash scripts, and markdown files.\n+\n+### TypeScript\n+\n+#### Typing\n+Avoid `any` where possible. If you find yourself using `any`, consider whether a generic may be\n+appropriate in your case.\n+\n+For methods and properties that are part of a component's public API, all types must be explicitly\n+specified because our documentation tooling cannot currently infer types in places where TypeScript\n+can.\n+\n+#### Fluent APIs\n+When creating a fluent or builder-pattern style API, use the `this` return type for methods:\n+```\n+class ConfigBuilder {\n+ withName(name: string): this {\n+ this.config.name = name;\n+ return this;\n+ }\n+}\n+```\n+\n+#### Access modifiers\n+* Omit the `public` keyword as it is the default behavior.\n+* Use `private` when appropriate and possible, prefixing the name with an underscore.\n+* Use `protected` when appropriate and possible with no prefix.\n+* Prefix *library-internal* properties and methods with an underscore without using the `private`\n+keyword. This is necessary for anything that must be public (to be used by Angular), but should not\n+be part of the user-facing API. This typically applies to symbols used in template expressions,\n+`@ViewChildren` / `@ContentChildren` properties, host bindings, and `@Input` / `@Output` properties\n+(when using an alias).\n+\n+Additionally, the `@docs-private` JsDoc annotation can be used to hide any symbol from the public\n+API docs.\n+\n+#### JsDoc comments\n+\n+All public APIs must have user-facing comments. These are extracted and shown in the documation\n+on [https://github.com/Promact/md2](https://github.com/Promact/md2).\n+\n+Private and internal APIs should have JsDoc when they are not obvious. Ultimately it is the purview\n+of the code reviwer as to what is \"obvious\", but the rule of thumb is that *most* classes,\n+properties, and methods should have a JsDoc description.\n+\n+Properties should have a concise description of what the property means:\n+```ts\n+ /** The label position relative to the checkbox. Defaults to 'after' */\n+ @Input() labelPosition: 'before' | 'after' = 'after';\n+```\n+\n+Methods blocks should describe what the function does and provide a description for each parameter\n+and the return value:\n+```ts\n+ /**\n+ * Opens a modal dialog containing the given component.\n+ * @param component Type of the component to load into the dialog.\n+ * @param config Dialog configuration options.\n+ * @returns Reference to the newly-opened dialog.\n+ */\n+ open<T>(component: ComponentType<T>, config?: Md2DialogConfig): Md2DialogRef<T> { ... }\n+```\n+\n+Boolean properties and return values should use \"Whether...\" as opposed to \"True if...\":\n+```ts\n+ /** Whether the button is disabled. */\n+ disabled: boolean = false;\n+```\n+\n+#### Naming\n+\n+##### General\n+* Prefer writing out words instead of using abbreviations.\n+* Prefer *exact* names over short names (within reason). E.g., `labelPosition` is better than\n+`align` because the former much more exactly communicates what the property means.\n+* Except for `@Input` properties, use `is` and `has` prefixes for boolean properties / methods.\n+\n+##### Classes\n+Classes should be named based on what they're responsible for. Names should capture what the code\n+*does*, not how it is used:\n+```\n+/** NO: */\n+class RadioService { }\n+\n+/** YES: */\n+class UniqueSelectionDispatcher { }\n+```\n+\n+Avoid suffixing a class with \"Service\", as it communicates nothing about what the class does. Try to\n+think of the class name as a person's job title.\n+\n+##### Methods\n+The name of a method should capture the action that is performed *by* that method.\n+\n+### Angular\n+\n+#### Host bindings\n+Prefer using the `host` object in the directive configuration instead of `@HostBinding` and\n+`@HostListener`. We do this because TypeScript preserves the type information of methods with\n+decorators, and when one of the arguments for the method is a native `Event` type, this preserved\n+type information can lead to runtime errors in non-browser environments (e.g., server-side\n+pre-rendering).\n+\n+\n+### CSS\n+\n+#### Be cautious with use of `display: flex`\n+* The [baseline calculation for flex elements](http://www.w3.org/TR/css-flexbox-1/#flex-baselines)\n+is different than other display values, making it difficult to align flex elements with standard\n+elements like input and button.\n+* Component outermost elements are never flex (block or inline-block)\n+* Don't use `display: flex` on elements that will contain projected content.\n+\n+#### Use lowest specificity possible\n+Always prioritize lower specificity over other factors. Most style definitions should consist of a\n+single element or css selector plus necessary state modifiers. **Avoid SCSS nesting for the sake of\n+code organization.** This will allow users to much more easily override styles.\n+\n+For example, rather than doing this:\n+```scss\n+.md2-calendar {\n+ display: block;\n+\n+ .md2-month {\n+ display: inline-block;\n+\n+ .md2-date.md2-selected {\n+ font-weight: bold;\n+ }\n+ }\n+}\n+```\n+\n+do this:\n+```scss\n+.md2-calendar {\n+ display: block;\n+}\n+\n+.md2-calendar-month {\n+ display: inline-block;\n+}\n+\n+.md2-calendar-date.md2-selected {\n+ font-weight: bold;\n+}\n+```\n+\n+#### Never set a margin on a host element.\n+The end-user of a component should be the one to decide how much margin a component has around it.\n+\n+#### Prefer styling the host element vs. elements inside the template (where possible).\n+This makes it easier to override styles when necessary. For example, rather than\n+\n+```scss\n+the-host-element {\n+ // ...\n+\n+ .some-child-element {\n+ color: red;\n+ }\n+}\n+```\n+\n+you can write\n+```scss\n+the-host-element {\n+ // ...\n+ color: red;\n+}\n+```\n+\n+The latter is equivalent for the component, but makes it easier override when necessary.\n+\n+#### Support styles for Windows high-contrast mode\n+This is a low-effort task that makes a big difference for low-vision users. Example:\n+```css\n+@media screen and (-ms-high-contrast: active) {\n+ .unicorn-motocycle {\n+ border: 1px solid #fff !important;\n+ }\n+}\n+```\n+\n+#### Explain what CSS classes are for\n+When it is not super obvious, include a brief description of what a class represents. For example:\n+```scss\n+// The calendar icon button used to open the calendar pane.\n+.md2-datepicker-button { ... }\n+\n+// Floating pane that contains the calendar at the bottom of the input.\n+.md2-datepicker-calendar-pane { ... }\n+\n+// Portion of the floating panel that sits, invisibly, on top of the input.\n+.md2-datepicker-input-mask { }\n+```\n" }, { "change_type": "ADD", "old_path": null, "new_path": "CONTRIBUTING.md", "diff": "+# Contributing to MD2\n+\n+We would love for you to contribute to Md2 and help make it ever better!\n+As a contributor, here are the guidelines we would like you to follow:\n+\n+ - [Code of Conduct](#coc)\n+ - [Question or Problem?](#question)\n+ - [Issues and Bugs](#issue)\n+ - [Feature Requests](#feature)\n+ - [Submission Guidelines](#submit-pr)\n+ - [Coding Rules](#rules)\n+ - [Commit Message Guidelines](#commit)\n+ - [Signing the CLA](#cla)\n+\n+## <a name=\"coc\"></a> Code of Conduct\n+Help us keep Angular open and inclusive. Please read and follow our [Code of Conduct][coc].\n+\n+## <a name=\"question\"></a> Got a Question or Problem?\n+\n+If you have questions about how to *use* MD2, please direct them to the\n+[Google Group][material-group] discussion list or [StackOverflow][stackoverflow].\n+Please note that MD2 is still in very early development, and the team's capacity\n+to answer usage questions is limited. Community chat is also available on [Gitter][gitter].\n+\n+## <a name=\"issue\"></a> Found an Issue?\n+If you find a bug in the source code or a mistake in the documentation, you can help us by\n+[submitting an issue](#submit-issue) to our [GitHub Repository][github]. Including an issue\n+reproduction (via CodePen, JsBin, Plunkr, etc.) is the absolute best way to help the team quickly\n+diagnose the problem. Screenshots are also helpful.\n+\n+You can help the team even more and [submit a Pull Request](#submit-pr) with a fix.\n+\n+## <a name=\"feature\"></a> Want a Feature?\n+You can *request* a new feature by [submitting an issue](#submit-issue) to our [GitHub\n+Repository][github]. If you would like to *implement* a new feature, please submit an issue with\n+a proposal for your work first, to be sure that we can use it. MD2 is in very early\n+stages and we are not ready to accept major contributions ahead of the full release.\n+Please consider what kind of change it is:\n+\n+* For a **Major Feature**, first open an issue and outline your proposal so that it can be\n+discussed. This will also allow us to better coordinate our efforts, prevent duplication of work,\n+and help you to craft the change so that it is successfully accepted into the project.\n+* **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).\n+\n+### <a name=\"submit-issue\"></a> Submitting an Issue\n+Before you submit an issue, search the archive, maybe your question was already answered.\n+\n+If your issue appears to be a bug, and hasn't been reported, open a new issue.\n+Help us to maximize the effort we can spend fixing issues and adding new\n+features by not reporting duplicate issues. Providing the following information will increase the\n+chances of your issue being dealt with quickly:\n+\n+* **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps\n+* **Angular and Material Versions** - which versions of Angular and Material are affected\n+ (e.g. 2.0.0-alpha.53)\n+* **Motivation for or Use Case** - explain what are you trying to do and why the current behavior\n+ is a bug for you\n+* **Browsers and Operating System** - is this a problem with all browsers?\n+* **Reproduce the Error** - provide a live example (using [CodePen][codepen], [JsBin][jsbin],\n+ [Plunker][plunker], etc.) or a unambiguous set of steps\n+* **Screenshots** - Due to the visual nature of MD2, screenshots can help the team\n+ triage issues far more quickly than a text descrption.\n+* **Related Issues** - has a similar issue been reported before?\n+* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be\n+ causing the problem (line of code or commit)\n+\n+You can file new issues by providing the above information [here](https://github.com/angular/material2/issues/new).\n+\n+\n+### <a name=\"submit-pr\"></a> Submitting a Pull Request (PR)\n+Before you submit your Pull Request (PR) consider the following guidelines:\n+\n+* Search [GitHub](https://github.com/angular/material2/pulls) for an open or closed PR\n+ that relates to your submission. You don't want to duplicate effort.\n+* Please sign our [Contributor License Agreement (CLA)](#cla) before sending PRs.\n+ We cannot accept code without this.\n+* Make your changes in a new git branch:\n+\n+ ```shell\n+ git checkout -b my-fix-branch master\n+ ```\n+\n+* Create your patch, **including appropriate test cases**.\n+* Follow our [Coding Rules](#rules).\n+* Test your changes with our supported browsers and screen readers.\n+* Run the full MD2 test suite, as described in the [developer documentation][dev-doc],\n+ and ensure that all tests pass.\n+* Commit your changes using a descriptive commit message that follows our\n+ [commit message conventions](#commit). Adherence to these conventions\n+ is necessary because release notes are automatically generated from these messages.\n+\n+ ```shell\n+ git commit -a\n+ ```\n+ Note: the optional commit `-a` command line option will automatically \"add\" and \"rm\" edited files.\n+\n+* Push your branch to GitHub:\n+\n+ ```shell\n+ git push my-fork my-fix-branch\n+ ```\n+\n+* In GitHub, send a pull request to `md2:master`.\n+* If we suggest changes then:\n+ * Make the required updates.\n+ * Re-run the MD2 test suites to ensure tests are still passing.\n+ * Rebase your branch and force push to your GitHub repository (this will update your Pull\n+ Request):\n+\n+ ```shell\n+ git rebase master -i\n+ git push -f\n+ ```\n+\n+That's it! Thank you for your contribution!\n+\n+#### After your pull request is merged\n+\n+After your pull request is merged, you can safely delete your branch and pull the changes\n+from the main (upstream) repository:\n+\n+* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as\n+ follows:\n+\n+ ```shell\n+ git push my-fork --delete my-fix-branch\n+ ```\n+\n+* Check out the master branch:\n+\n+ ```shell\n+ git checkout master -f\n+ ```\n+\n+* Delete the local branch:\n+\n+ ```shell\n+ git branch -D my-fix-branch\n+ ```\n+\n+* Update your master with the latest upstream version:\n+\n+ ```shell\n+ git pull --ff upstream master\n+ ```\n+\n+## <a name=\"rules\"></a> Coding Rules\n+To ensure consistency throughout the source code, keep these rules in mind as you are working:\n+\n+* All features or bug fixes **must be tested** by one or more specs (unit-tests).\n+* All public API methods **must be documented**. (Details TBD).\n+* We follow [Google's JavaScript Style Guide][js-style-guide], but wrap all code at\n+ **100 characters**.\n+\n+## <a name=\"commit\"></a> Commit Message Guidelines\n+\n+We have very precise rules over how our git commit messages can be formatted. This leads to **more\n+readable messages** that are easy to follow when looking through the **project history**. But also,\n+we use the git commit messages to **generate the MD2 change log**.\n+\n+### Commit Message Format\n+Each commit message consists of a **header**, a **body** and a **footer**. The header has a special\n+format that includes a **type**, a **scope** and a **subject**:\n+\n+```\n+<type>(<scope>): <subject>\n+<BLANK LINE>\n+<body>\n+<BLANK LINE>\n+<footer>\n+```\n+\n+The **header** is mandatory and the **scope** of the header is optional.\n+\n+Any line of the commit message cannot be longer 100 characters! This allows the message to be easier\n+to read on GitHub as well as in various git tools.\n+\n+### Revert\n+If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of\n+the reverted commit. In the body it should say: `This reverts commit <hash>.`, where the hash is\n+the SHA of the commit being reverted.\n+\n+### Type\n+Must be one of the following:\n+\n+* **feat**: A new feature\n+* **fix**: A bug fix\n+* **docs**: Documentation only changes\n+* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing\n+ semi-colons, etc)\n+* **refactor**: A code change that neither fixes a bug nor adds a feature\n+* **perf**: A code change that improves performance\n+* **test**: Adding missing tests or correcting existing tests\n+* **build**: Changes that affect the build system, CI configuration or external dependencies\n+ (example scopes: gulp, broccoli, npm)\n+* **chore**: Other changes that don't modify `src` or `test` files\n+\n+### Scope\n+The scope could be anything specifying place of the commit change. For example\n+`datepicker`, `dialog`, etc.\n+\n+### Subject\n+The subject contains succinct description of the change:\n+\n+* use the imperative, present tense: \"change\" not \"changed\" nor \"changes\"\n+* don't capitalize first letter\n+* no dot (.) at the end\n+\n+### Body\n+Just as in the **subject**, use the imperative, present tense: \"change\" not \"changed\" nor \"changes\".\n+The body should include the motivation for the change and contrast this with previous behavior.\n+\n+### Footer\n+The footer should contain any information about **Breaking Changes** and is also the place to\n+reference GitHub issues that this commit **Closes**.\n+\n+**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines.\n+The rest of the commit message is then used for this.\n+\n+A detailed explanation can be found in this [document][commit-message-format].\n+\n+## <a name=\"cla\"></a> Signing the CLA\n+\n+Please sign our Contributor License Agreement (CLA) before sending pull requests. For any code\n+changes to be accepted, the CLA must be signed. It's a quick process, we promise!\n+\n+* For individuals we have a [simple click-through form][individual-cla].\n+* For corporations we'll need you to\n+ [print, sign and one of scan+email, fax or mail the form][corporate-cla].\n+\n+\n+[material-group]: https://groups.google.com/forum/#!forum/angular-material2\n+[coc]: https://github.com/angular/code-of-conduct/blob/master/CODE_OF_CONDUCT.md\n+[commit-message-format]: https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/preview\n+[corporate-cla]: http://code.google.com/legal/corporate-cla-v1.0.html\n+[dev-doc]: https://github.com/angular/material2/blob/master/DEV_ENVIRONMENT.md\n+[github]: https://github.com/angular/material2\n+[gitter]: https://gitter.im/angular/material2\n+[individual-cla]: http://code.google.com/legal/individual-cla-v1.0.html\n+[js-style-guide]: https://google.github.io/styleguide/jsguide.html\n+[codepen]: http://codepen.io/\n+[jsbin]: http://jsbin.com/\n+[jsfiddle]: http://jsfiddle.net/\n+[plunker]: http://plnkr.co/edit\n+[runnable]: http://runnable.com/\n+[stackoverflow]: http://stackoverflow.com/\n" }, { "change_type": "ADD", "old_path": null, "new_path": "DEV_ENVIRONMENT.md", "diff": "+# Developer guide: getting your environment set up\n+\n+1. Make sure you have `node` installed with a version at _least_ 5.5.0.\n+2. Run `npm install -g gulp` to install gulp.\n+3. Fork the `md2` repo.\n+4. Clone your fork.\n+ Recommendation: name your git remotes `upstream` for `md2`\n+ and `<your-username>` for your fork. Also see the [team git shortcuts](https://github.com/Promact/md2/wiki/Team-git----bash-shortcuts).\n+5. From the root of the project, run `npm install`.\n+\n+\n+To build the components in dev mode, run `gulp build:components`.\n+To build the components in release mode, run `gulp build:release`\n+\n+To bring up a local server, run `gulp serve:devapp`. This will automatically watch for changes\n+and rebuild. The browser should refresh automatically when changes are made.\n+\n+### Running tests\n+\n+To run lint, run `gulp lint`.\n+\n+\n+### Running benchmarks\n+Not yet implemented.\n+\n+### Running screenshot diff tests\n+Not yet implemented.\n" } ]
TypeScript
MIT License
promact/md2
docs: added code review and contribution guide docs
530,388
04.04.2017 16:08:39
-19,080
3b6358331ab4bdff122b3ae1ec249114c45dd6be
chore(datepicker) implemented year view of calendat
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/calendar.scss", "new_path": "src/lib/datepicker/calendar.scss", "diff": "+$primary: #106cc8 !default;\n$md2-calendar-padding: 8px !default;\n$md2-calendar-controls-vertical-padding: 5%;\n$md2-calendar-period-font-size: 14px;\n@@ -59,3 +60,43 @@ $md2-calendar-weekday-table-font-size: 11px !default;\nfont-size: $md2-calendar-weekday-table-font-size;\ncolor: rgba(black, 0.36);\n}\n+\n+/* Year View */\n+md2-year-view {\n+ display: block;\n+ width: 100%;\n+ height: 276px;\n+ line-height: 40px;\n+ background: white;\n+ overflow-x: hidden;\n+ overflow-y: auto;\n+ transition: 300ms;\n+}\n+\n+.md2-year-view-content {\n+ display: flex;\n+ flex-direction: column;\n+ justify-content: center;\n+ min-height: 100%;\n+}\n+\n+.md2-calendar-year {\n+ position: relative;\n+ display: block;\n+ margin: 0 auto;\n+ padding: 0;\n+ font-size: 17px;\n+ font-weight: 400;\n+ text-align: center;\n+ cursor: pointer;\n+\n+ &.md2-year-focused,\n+ &.md2-year-selected {\n+ color: $primary;\n+ }\n+\n+ &.md2-calendar-year-selected {\n+ font-size: 26px;\n+ font-weight: 500;\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/year-view.html", "new_path": "src/lib/datepicker/year-view.html", "diff": "-<md2-calendar-table allowDisabledSelection=\"true\"\n- [label]=\"_yearLabel\"\n- [rows]=\"_months\"\n- [todayValue]=\"_todayMonth\"\n- [selectedValue]=\"_selectedMonth\"\n- [labelMinRequiredCells]=\"2\"\n- [activeCell]=\"activeDate.month\"\n- (selectedValueChange)=\"_monthSelected($event)\">\n-</md2-calendar-table>\n+<div class=\"md2-year-view-content\">\n+ <div *ngFor=\"let year of _years\"\n+ class=\"md2-calendar-year\"\n+ [class.md2-year-focused]=\"_activeYear === year\"\n+ [class.md2-year-selected]=\"_selectedYear === year\"\n+ (click)=\"_yearSelected(year)\">\n+ {{ year }}\n+ </div>\n+</div>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/year-view.ts", "new_path": "src/lib/datepicker/year-view.ts", "diff": "@@ -2,6 +2,7 @@ import {\nComponent,\nViewEncapsulation,\nChangeDetectionStrategy,\n+ ElementRef,\nInput,\nAfterContentInit,\nOutput,\n@@ -30,6 +31,7 @@ export class Md2YearView implements AfterContentInit {\nset activeDate(value) {\nlet oldActiveDate = this._activeDate;\nthis._activeDate = this._locale.parseDate(value) || this._util.today();\n+ this._activeYear = this._getYearInCurrentDate(this._activeDate);\nif (oldActiveDate.getFullYear() != this._activeDate.getFullYear()) {\nthis._init();\n}\n@@ -41,7 +43,7 @@ export class Md2YearView implements AfterContentInit {\nget selected() { return this._selected; }\nset selected(value) {\nthis._selected = this._locale.parseDate(value);\n- this._selectedMonth = this._getMonthInCurrentYear(this.selected);\n+ this._selectedYear = this._getYearInCurrentDate(this.selected);\n}\nprivate _selected: Date;\n@@ -52,71 +54,60 @@ export class Md2YearView implements AfterContentInit {\n@Output() selectedChange = new EventEmitter<Date>();\n/** Grid of calendar cells representing the months of the year. */\n- _months: Md2CalendarCell[][];\n-\n- /** The label for this year (e.g. \"2017\"). */\n- _yearLabel: string;\n-\n- /** The month in this year that today falls on. Null if today is in a different year. */\n- _todayMonth: number;\n+ _years: Array<number>;\n/**\n* The month in this year that the selected Date falls on.\n* Null if the selected Date is in a different year.\n*/\n- _selectedMonth: number;\n+ _selectedYear: number;\n+ _activeYear: number;\n- constructor(private _locale: DateLocale, private _util: DateUtil) { }\n+ constructor(private _element: ElementRef,\n+ private _locale: DateLocale, private _util: DateUtil) { }\nngAfterContentInit() {\nthis._init();\n}\n/** Handles when a new month is selected. */\n- _monthSelected(month: number) {\n- this.selectedChange.emit(new Date(this.activeDate.getFullYear(), month, this._activeDate.getDate(),\n+ _yearSelected(year: number) {\n+ this.selectedChange.emit(new Date(year, this.activeDate.getMonth(), this._activeDate.getDate(),\nthis.activeDate.getHours(), this.activeDate.getMinutes(), this.activeDate.getSeconds()));\n}\n/** Initializes this month view. */\nprivate _init() {\n- this._selectedMonth = this._getMonthInCurrentYear(this.selected);\n- this._todayMonth = this._getMonthInCurrentYear(this._util.today());\n- this._yearLabel = this._locale.getCalendarYearHeaderLabel(this.activeDate);\n-\n- // First row of months only contains 5 elements so we can fit the year label on the same row.\n- this._months = [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9, 10, 11]].map(row => row.map(\n- month => this._createCellForMonth(month)));\n+ this._selectedYear = this._getYearInCurrentDate(this.selected);\n+ this._createYears();\n}\n- /**\n- * Gets the month in this year that the given Date falls on.\n- * Returns null if the given Date is in another year.\n- */\n- private _getMonthInCurrentYear(date: Date) {\n- return date && date.getFullYear() == this.activeDate.getFullYear() ? date.getMonth() : null;\n+ /** Create years. */\n+ private _createYears() {\n+ let startYear = 1900; // this._min ? this._min.getFullYear() :\n+ let endYear = this._util.today().getFullYear() + 100; // this._max ? this._max.getFullYear() :\n+ this._years = [];\n+ for (let i = startYear; i <= endYear; i++) {\n+ this._years.push(i);\n}\n-\n- /** Creates an Md2CalendarCell for the given month. */\n- private _createCellForMonth(month: number) {\n- return new Md2CalendarCell(\n- month, this._locale.shortMonths[month].toLocaleUpperCase(), this._isMonthEnabled(month));\n+ this._setScrollTop();\n}\n- /** Whether the given month is enabled. */\n- private _isMonthEnabled(month: number) {\n- if (!this.dateFilter) {\n- return true;\n+ /** Set Scroll of the years container. */\n+ private _setScrollTop(): void {\n+ setTimeout(() => {\n+ const scrollContainer =\n+ this._element.nativeElement;\n+ const selectedIndex = (this._selectedYear ? this._selectedYear : this._activeYear) - 1900;\n+ scrollContainer.scrollTop = 20 + (selectedIndex * 40) - (scrollContainer.clientHeight / 2);\n+ }, 10);\n}\n- // If any date in the month is enabled count the month as enabled.\n- for (let date = new Date(this.activeDate.getFullYear(), month, 1); date.getMonth() === month;\n- date = this._util.incrementDays(date, 1)) {\n- if (this.dateFilter(date)) {\n- return true;\n- }\n- }\n-\n- return false;\n+ /**\n+ * Gets the month in this year that the given Date falls on.\n+ * Returns null if the given Date is in another year.\n+ */\n+ private _getYearInCurrentDate(date: Date) {\n+ return date ? date.getFullYear() : null;\n}\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) implemented year view of calendat
530,392
04.04.2017 17:22:48
-10,800
7058c173957be99d57e6fbb74ae556a712d228e5
fix(datepicker): emit change when time changed
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -522,7 +522,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n}\nlet el: any = event.target;\nlet d: any = this._util.parseDate(el.value, this.format);\n- if (this._util.isValidDate(d) && !this._util.isSameDay(this.value, d)) {\n+ if (this._util.isValidDate(d)) {\nthis.value = d;\nthis._emitChangeEvent();\n}\n" } ]
TypeScript
MIT License
promact/md2
fix(datepicker): emit change when time changed
530,388
05.04.2017 11:55:44
-19,080
27b690c4757f4c886c0e8493f3eb65e38bfc39d2
chore(demo) update demo home with "Hire Us" ribbon
[ { "change_type": "MODIFY", "old_path": "src/demo-app/assets/css/style.scss", "new_path": "src/demo-app/assets/css/style.scss", "diff": "@@ -320,8 +320,12 @@ html, body {\nline-height: 28px;\n}\n+ .pull-right {\n+ margin-right: -15px;\n+ }\n+\n.source-code {\n- float: right;\n+ margin-right: 16px;\nfill: currentColor;\ncolor: $white;\n}\n" }, { "change_type": "ADD", "old_path": "src/demo-app/assets/img/hireus-ribbon.png", "new_path": "src/demo-app/assets/img/hireus-ribbon.png", "diff": "Binary files /dev/null and b/src/demo-app/assets/img/hireus-ribbon.png differ\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/demo-app/demo-app.html", "new_path": "src/demo-app/demo-app/demo-app.html", "diff": "<div class=\"sidenav-container\">\n<header>\n<a (click)=\"sidenav(false)\" [routerLink]=\"['']\">\n- <img src=\"./assets/img/logo.png\">\n+ <img src=\"./assets/img/logo.png\" alt=\"MD2\">\n<h3>Material Design 2</h3>\n</a>\n</header>\n<button type=\"button\" (click)=\"sidenavToggle()\" class=\"sidenav-toggle\"><em class=\"fa fa-bars\"></em></button>\n<h3>\nMaterial Design 2\n+ <span class=\"pull-right\">\n<a href=\"https://github.com/Promact/md2\" target=\"_blank\" class=\"source-code\">\n- <svg class=\"source-code\" width=\"28\" height=\"28\" viewBox=\"0 0 16 16\">\n+ <svg width=\"28\" height=\"28\" viewBox=\"0 0 16 16\">\n<path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z\"></path>\n</svg>\n</a>\n+ <a href=\"http://promactinfo.com/\" target=\"_blank\">\n+ <img src=\"./assets/img/hireus-ribbon.png\" alt=\"Hire Us\">\n+ </a>\n+ </span>\n</h3>\n</header>\n<section class=\"demo-container\">\n" } ]
TypeScript
MIT License
promact/md2
chore(demo) update demo home with "Hire Us" ribbon
530,388
05.04.2017 12:08:04
-19,080
a0867af97320f9f3d3df1de60c63c81db3f98140
chore(datepicker) update calendar date active cell style
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/calendar-table.scss", "new_path": "src/lib/datepicker/calendar-table.scss", "diff": "@@ -74,7 +74,8 @@ $md2-datepicker-today-fade-amount: 0.2;\n}\n-:not(.md2-calendar-table-disabled):hover {\n+:not(.md2-calendar-table-disabled):hover,\n+.md2-calendar-table-active { // .cdk-keyboard-focused\n& > .md2-calendar-table-cell-content:not(.md2-calendar-table-selected) {\nbackground-color: rgba(black, 0.1);\n}\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update calendar date active cell style
530,388
06.04.2017 07:59:39
-19,080
fc197e9458744c30a37df40a246a6c4eeccec4e5
chore: added google analytics tracking code into md2 demo
[ { "change_type": "MODIFY", "old_path": "src/demo-app/index.html", "new_path": "src/demo-app/index.html", "diff": "<link rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\">\n<title>Angular2 Material</title>\n+ <script>\n+ (function (i, s, o, g, r, a, m) {\n+ i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {\n+ (i[r].q = i[r].q || []).push(arguments)\n+ }, i[r].l = 1 * new Date(); a = s.createElement(o),\n+ m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)\n+ })(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');\n+\n+ ga('create', 'UA-29870290-4', 'auto');\n+ ga('send', 'pageview');\n+\n+ </script>\n+\n<link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">\n<link href=\"assets/css/style.css\" rel=\"stylesheet\">\n" } ]
TypeScript
MIT License
promact/md2
chore: added google analytics tracking code into md2 demo
530,388
06.04.2017 16:24:38
-19,080
23efcdefaceff9a57223c08ca524d8e7ccc9d530
chore: added AOT tasks for demo app
[ { "change_type": "MODIFY", "old_path": "tools/gulp/tasks/deploy.ts", "new_path": "tools/gulp/tasks/deploy.ts", "diff": "import { task, watch, src, dest } from 'gulp';\n-import * as path from 'path';\n+import { join } from 'path';\n+import { ScriptTarget, ModuleKind } from 'typescript';\nimport * as fs from 'fs';\n-import gulpRunSequence = require('run-sequence');\n+import {\n+ DIST_ROOT, PROJECT_ROOT, COMPONENTS_DIR, HTML_MINIFIER_OPTIONS, LICENSE_BANNER\n+} from '../constants';\n+import {\n+ sassBuildTask, tsBuildTask, execNodeTask, sequenceTask,\n+ triggerLivereload\n+} from '../util/task_helpers';\n+\n+// There are no type definitions available for these imports.\n+const gulpRollup = require('gulp-better-rollup');\n+const gulpMinifyHtml = require('gulp-htmlmin');\n+const gulpIf = require('gulp-if');\n+\n+import gulpRunSequence = require('run-sequence');\nconst bump = require('gulp-bump');\nconst git = require('gulp-git');\nconst changelog = require('gulp-conventional-changelog');\n+const systemjsBuilder = require('gulp-systemjs-builder');\n+const sysBuilder = require('systemjs-builder');\n+const rollup = require('rollup-stream');\n+const exec = require('child_process').exec;\n// const releaser = require('conventional-github-releaser');\n+task(':demoapp:aot', sequenceTask(\n+ 'aot:build',\n+ ':build:devapp:vendor',\n+ ':demoapp:rollup1'\n+));\n+\n+task('demoapp:aot', ['build:devapp'], (cb: any) => {\n+ exec('node_modules\\.bin\\ngc -p ' + join(DIST_ROOT, 'tsconfig-aot.json'), (err: any) => {\n+ cb(err);\n+ });\n+});\n+\n+task(':demoapp:rollup', execNodeTask(\n+ join(PROJECT_ROOT, 'node_modules', '.bin', 'rollup'), ['-c', join(DIST_ROOT, 'rollup-config.js')])\n+);\n+\n+task(':demoapp:rollup1', (cb: any) => {\n+ exec('node_modules\\.bin\\rollup -c ' + join(DIST_ROOT, 'rollup-config.js'), (err: any) => {\n+ cb(err);\n+ });\n+});\n+\n+task('bundle', (done: any) => {\n+ var builder = new sysBuilder(DIST_ROOT, join(DIST_ROOT, 'system-config.ts'));\n+ builder\n+ .buildStatic(DIST_ROOT, join(DIST_ROOT, 'bundle.js'), {\n+ runtime: false\n+ }).then(() => {\n+ done();\n+ });\n+});\n+\n+task(':build:devapp:sysbundle', ['build:devapp'], () => {\n+ var builder = systemjsBuilder()\n+ builder.loadConfigSync(join(DIST_ROOT, 'system-config.js'))\n+\n+ builder.buildStatic(join(DIST_ROOT, 'main.js'), {\n+ minify: false,\n+ mangle: false\n+ }).pipe(dest(join(DIST_ROOT, 'bundle')));\n+})\n+\n+/** Builds a bundle for demo app components. */\n+task(':build:devapp:bundle', [':build:devapp:vendor'], () => {//'build:devapp',\n+ return src(join(DIST_ROOT, 'main.js'))\n+ .pipe(createRollupBundle('iife', 'bundle.js'))\n+ .pipe(dest(join(DIST_ROOT, 'bundles')));\n+});\n+\n+const ROLLUP_GLOBALS = {\n+ // Angular dependencies\n+ '@angular/core': 'ng.core',\n+ '@angular/common': 'ng.common',\n+ '@angular/forms': 'ng.forms',\n+ '@angular/http': 'ng.http',\n+ '@angular/animations': 'ng.animations',\n+ '@angular/animations/browser': 'ng.animations.browser',\n+ '@angular/platform-browser': 'ng.platformBrowser',\n+ '@angular/platform-browser/animations': 'ng.platformBrowser.animations',\n+\n+ // Rxjs dependencies\n+ 'rxjs/Subject': 'Rx',\n+ 'rxjs/add/observable/fromEvent': 'Rx.Observable',\n+ 'rxjs/add/observable/forkJoin': 'Rx.Observable',\n+ 'rxjs/add/observable/of': 'Rx.Observable',\n+ 'rxjs/add/observable/merge': 'Rx.Observable',\n+ 'rxjs/add/observable/throw': 'Rx.Observable',\n+ 'rxjs/add/operator/auditTime': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/toPromise': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/map': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/filter': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/do': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/share': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/finally': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/catch': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/first': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/startWith': 'Rx.Observable.prototype',\n+ 'rxjs/add/operator/switchMap': 'Rx.Observable.prototype',\n+ 'rxjs/Observable': 'Rx'\n+};\n+\n+/** Creates a rollup bundles of the Material components.*/\n+function createRollupBundle(format: string, outFile: string) {\n+ let rollupOptions = {\n+ context: 'this',\n+ //external: Object.keys(ROLLUP_GLOBALS)\n+ };\n+\n+ let rollupGenerateOptions = {\n+ // Keep the moduleId empty because we don't want to force developers to a specific moduleId.\n+ moduleId: '',\n+ moduleName: 'ng.app',\n+ banner: LICENSE_BANNER,\n+ format: format,\n+ entry: 'main.js',\n+ dest: outFile,\n+ sourceMap: false,\n+ //globals: ROLLUP_GLOBALS,\n+ //onwarn: (warning) =>{\n+ // // Skip certain warnings\n+ // // should intercept ... but doesn't in some rollup versions\n+ // if (warning.code === 'THIS_IS_UNDEFINED') { return; }\n+ // // intercepts in some rollup versions\n+ // if (warning.indexOf(\"The 'this' keyword is equivalent to 'undefined'\") > -1) { return; }\n+ // // console.warn everything else\n+ // console.warn(warning.message);\n+ //},\n+ //plugins: [\n+ // nodeResolve({ jsnext: true, module: true }),\n+ // commonjs({\n+ // include: 'node_modules/rxjs/**',\n+ // }),\n+ // uglify()\n+ //]\n+ };\n+\n+ return gulpRollup(rollupOptions, rollupGenerateOptions);\n+}\n+\n// Deploy demo source\ntask('deploy', ['build:devapp'], () => {\nfs.readFile('./dist/index.html', 'utf8', (err, data) => {\n" } ]
TypeScript
MIT License
promact/md2
chore: added AOT tasks for demo app
530,388
07.04.2017 14:13:20
-19,080
39c5f4ad903a3b54cc1f5fbbd7dfafc43a43895d
chore: update aot task
[ { "change_type": "MODIFY", "old_path": "tools/gulp/tasks/aot.ts", "new_path": "tools/gulp/tasks/aot.ts", "diff": "@@ -4,7 +4,7 @@ import {DIST_ROOT} from '../constants';\nimport {execNodeTask, sequenceTask} from '../util/task_helpers';\n/** Copies the source files of the demo-app to the dist folder. */\n-task('aot:copy', [':build:devapp:scss', ':build:devapp:assets']);\n+task('aot:copy', [':build:devapp:vendor', ':build:devapp:scss', ':build:devapp:assets']);\n/**\n* Prepares the AOT compilation by copying the demo-app and building the components with their\n" } ]
TypeScript
MIT License
promact/md2
chore: update aot task
530,388
07.04.2017 14:29:25
-19,080
a72e4b9ab40f80518b735f97d810053a486427b7
chore: update aot build tasks
[ { "change_type": "MODIFY", "old_path": "tools/gulp/tasks/deploy.ts", "new_path": "tools/gulp/tasks/deploy.ts", "diff": "@@ -26,27 +26,9 @@ const rollup = require('rollup-stream');\nconst exec = require('child_process').exec;\n// const releaser = require('conventional-github-releaser');\n-task(':demoapp:aot', sequenceTask(\n- 'aot:build',\n- ':build:devapp:vendor',\n- ':demoapp:rollup1'\n-));\n-\n-task('demoapp:aot', ['build:devapp'], (cb: any) => {\n- exec('node_modules\\.bin\\ngc -p ' + join(DIST_ROOT, 'tsconfig-aot.json'), (err: any) => {\n- cb(err);\n- });\n-});\n-\n-task(':demoapp:rollup', execNodeTask(\n- join(PROJECT_ROOT, 'node_modules', '.bin', 'rollup'), ['-c', join(DIST_ROOT, 'rollup-config.js')])\n-);\n-\n-task(':demoapp:rollup1', (cb: any) => {\n- exec('node_modules\\.bin\\rollup -c ' + join(DIST_ROOT, 'rollup-config.js'), (err: any) => {\n- cb(err);\n- });\n-});\n+//task(':build:devapp:bundle:sys', ['build:devapp'], () => {\n+// var builder = systemjsBuilder()\n+// builder.loadConfigSync(join(DIST_ROOT, 'system-config.js'))\ntask('bundle', (done: any) => {\nvar builder = new sysBuilder(DIST_ROOT, join(DIST_ROOT, 'system-config.ts'));\n@@ -58,21 +40,29 @@ task('bundle', (done: any) => {\n});\n});\n-task(':build:devapp:sysbundle', ['build:devapp'], () => {\n- var builder = systemjsBuilder()\n- builder.loadConfigSync(join(DIST_ROOT, 'system-config.js'))\n+// builder.buildStatic(join(DIST_ROOT, 'main.js'), {\n+// minify: false,\n+// mangle: false\n+// }).pipe(dest(join(DIST_ROOT, 'bundle')));\n+//})\n+\n+/** Builds the demo-app with the Angular compiler to verify that all components work. */\n+//task('rollup:build', ['aot:build'], execNodeTask(\n+// '@angular/compiler-cli', 'ngc', ['-p', join(DIST_ROOT, 'tsconfig-aot.json')])\n+//);\n+\n+task('rollup:build', ['aot:build'], (cb: any) => {\n+ exec('node_modules\\.bin\\rollup -c ' + join(DIST_ROOT, 'rollup-config.js'), (err: any) => {\n+ cb(err);\n+ });\n+});\n- builder.buildStatic(join(DIST_ROOT, 'main.js'), {\n- minify: false,\n- mangle: false\n- }).pipe(dest(join(DIST_ROOT, 'bundle')));\n-})\n/** Builds a bundle for demo app components. */\n-task(':build:devapp:bundle', [':build:devapp:vendor'], () => {//'build:devapp',\n- return src(join(DIST_ROOT, 'main.js'))\n+task(':build:devapp:bundle:rollup', ['aot:build'], () => {\n+ return src(join(DIST_ROOT, 'main.ts'))\n.pipe(createRollupBundle('iife', 'bundle.js'))\n- .pipe(dest(join(DIST_ROOT, 'bundles')));\n+ .pipe(dest(DIST_ROOT));\n});\nconst ROLLUP_GLOBALS = {\n@@ -81,10 +71,12 @@ const ROLLUP_GLOBALS = {\n'@angular/common': 'ng.common',\n'@angular/forms': 'ng.forms',\n'@angular/http': 'ng.http',\n+ '@angular/router': 'ng.router',\n'@angular/animations': 'ng.animations',\n'@angular/animations/browser': 'ng.animations.browser',\n'@angular/platform-browser': 'ng.platformBrowser',\n'@angular/platform-browser/animations': 'ng.platformBrowser.animations',\n+ '@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',\n// Rxjs dependencies\n'rxjs/Subject': 'Rx',\n@@ -111,35 +103,19 @@ const ROLLUP_GLOBALS = {\nfunction createRollupBundle(format: string, outFile: string) {\nlet rollupOptions = {\ncontext: 'this',\n- //external: Object.keys(ROLLUP_GLOBALS)\n+ external: Object.keys(ROLLUP_GLOBALS)\n};\nlet rollupGenerateOptions = {\n// Keep the moduleId empty because we don't want to force developers to a specific moduleId.\nmoduleId: '',\n- moduleName: 'ng.app',\n+ moduleName: 'ng.demo',\nbanner: LICENSE_BANNER,\nformat: format,\n- entry: 'main.js',\n+ entry: './dist/main-aot.js',\ndest: outFile,\nsourceMap: false,\n- //globals: ROLLUP_GLOBALS,\n- //onwarn: (warning) =>{\n- // // Skip certain warnings\n- // // should intercept ... but doesn't in some rollup versions\n- // if (warning.code === 'THIS_IS_UNDEFINED') { return; }\n- // // intercepts in some rollup versions\n- // if (warning.indexOf(\"The 'this' keyword is equivalent to 'undefined'\") > -1) { return; }\n- // // console.warn everything else\n- // console.warn(warning.message);\n- //},\n- //plugins: [\n- // nodeResolve({ jsnext: true, module: true }),\n- // commonjs({\n- // include: 'node_modules/rxjs/**',\n- // }),\n- // uglify()\n- //]\n+ globals: ROLLUP_GLOBALS,\n};\nreturn gulpRollup(rollupOptions, rollupGenerateOptions);\n" } ]
TypeScript
MIT License
promact/md2
chore: update aot build tasks
530,388
07.04.2017 15:10:44
-19,080
b1dd1e457a353c7f80322754d54564293aaec977
chore: update ts-config for aot
[ { "change_type": "MODIFY", "old_path": "src/demo-app/tsconfig-aot.json", "new_path": "src/demo-app/tsconfig-aot.json", "diff": "\"emitDecoratorMetadata\": true,\n\"experimentalDecorators\": true,\n\"lib\": [\"es6\", \"es2015\", \"dom\"],\n- \"module\": \"commonjs\",\n+ \"module\": \"es2015\",\n\"moduleResolution\": \"node\",\n- \"noEmitOnError\": true,\n\"noImplicitAny\": true,\n\"target\": \"es5\",\n+ \"sourceMap\": true,\n+ \"suppressImplicitAnyIndexErrors\": true,\n\"baseUrl\": \"\",\n- \"typeRoots\": [\n- \"../node_modules/@types/!(node)\"\n- ],\n\"paths\": {\n\"md2\": [\n\"./md2\"\n}\n},\n\"files\": [\n- \"./demo-app-types.d.ts\",\n\"./demo-app-module.ts\",\n\"./main-aot.ts\"\n],\n\"angularCompilerOptions\": {\n- \"skipTemplateCodegen\": false,\n- \"debug\": true\n+ \"skipMetadataEmit\": true\n}\n}\n" } ]
TypeScript
MIT License
promact/md2
chore: update ts-config for aot
530,388
07.04.2017 18:27:28
-19,080
587009cf868cb626e0995ddaafc626c9fd50d3c3
chore: update rollup tasks
[ { "change_type": "MODIFY", "old_path": "src/demo-app/index.html", "new_path": "src/demo-app/index.html", "diff": "</div>\n</demo-app>\n- <script src=\"libs/core-js/client/core.js\"></script>\n- <script src=\"libs/web-animations-js/web-animations.min.js\"></script>\n- <script src=\"libs/systemjs/dist/system.src.js\"></script>\n<script src=\"libs/zone.js/dist/zone.js\"></script>\n+ <script src=\"libs/reflect-metadata/Reflect.js\"></script>\n<script src=\"libs/hammerjs/hammer.min.js\"></script>\n+ <script src=\"bundle.js\"></script>\n- <script>\n- System.import('system-config.js').then(function () {\n- System.import('main');\n- }).catch(console.error.bind(console));\n- </script>\n</body>\n</html>\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/rollup-config.js", "new_path": "src/demo-app/rollup-config.js", "diff": "@@ -4,9 +4,10 @@ import commonjs from 'rollup-plugin-commonjs';\nimport uglify from 'rollup-plugin-uglify';\nexport default {\n+ moduleName: 'demo',\nentry: 'dist/main-aot.ts',\n- dest: 'dist/build.js', // output a single application bundle\n- sourceMap: false,\n+ dest: 'dist/bundle.js', // output a single application bundle\n+ sourceMap: true,\nformat: 'iife',\nonwarn: function (warning) {\n// Skip certain warnings\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/tsconfig-aot.json", "new_path": "src/demo-app/tsconfig-aot.json", "diff": "\"lib\": [\"es6\", \"es2015\", \"dom\"],\n\"module\": \"es2015\",\n\"moduleResolution\": \"node\",\n+ \"noEmitOnError\": true,\n\"noImplicitAny\": true,\n\"target\": \"es5\",\n- \"sourceMap\": true,\n- \"suppressImplicitAnyIndexErrors\": true,\n\"baseUrl\": \"\",\n+ \"typeRoots\": [\n+ \"../node_modules/@types/!(node)\"\n+ ],\n\"paths\": {\n\"md2\": [\n\"./md2\"\n\"./main-aot.ts\"\n],\n\"angularCompilerOptions\": {\n- \"skipMetadataEmit\": true\n+ \"skipTemplateCodegen\": false,\n+ \"debug\": true\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/tsconfig.json", "new_path": "src/demo-app/tsconfig.json", "diff": "}\n},\n\"files\": [\n- \"./demo-app-types.d.ts\",\n\"./demo-app-module.ts\",\n\"./system-config.ts\",\n\"./main.ts\"\n" }, { "change_type": "MODIFY", "old_path": "tools/gulp/tasks/deploy.ts", "new_path": "tools/gulp/tasks/deploy.ts", "diff": "@@ -26,14 +26,10 @@ const rollup = require('rollup-stream');\nconst exec = require('child_process').exec;\n// const releaser = require('conventional-github-releaser');\n-//task(':build:devapp:bundle:sys', ['build:devapp'], () => {\n-// var builder = systemjsBuilder()\n-// builder.loadConfigSync(join(DIST_ROOT, 'system-config.js'))\n-\n-task('bundle', (done: any) => {\n+task(':bundle:app', (done: any) => {//['build:devapp'],\nvar builder = new sysBuilder(DIST_ROOT, join(DIST_ROOT, 'system-config.ts'));\nbuilder\n- .buildStatic(DIST_ROOT, join(DIST_ROOT, 'bundle.js'), {\n+ .buildStatic(join(DIST_ROOT, 'demo-app-module.js'), join(DIST_ROOT, 'bundle.js'), {\nruntime: false\n}).then(() => {\ndone();\n@@ -57,7 +53,6 @@ task('rollup:build', ['aot:build'], (cb: any) => {\n});\n});\n-\n/** Builds a bundle for demo app components. */\ntask(':build:devapp:bundle:rollup', ['aot:build'], () => {\nreturn src(join(DIST_ROOT, 'main.ts'))\n@@ -77,6 +72,7 @@ const ROLLUP_GLOBALS = {\n'@angular/platform-browser': 'ng.platformBrowser',\n'@angular/platform-browser/animations': 'ng.platformBrowser.animations',\n'@angular/platform-browser-dynamic': 'ng.platformBrowserDynamic',\n+ 'md2': 'ng.md2',\n// Rxjs dependencies\n'rxjs/Subject': 'Rx',\n@@ -109,7 +105,6 @@ function createRollupBundle(format: string, outFile: string) {\nlet rollupGenerateOptions = {\n// Keep the moduleId empty because we don't want to force developers to a specific moduleId.\nmoduleId: '',\n- moduleName: 'ng.demo',\nbanner: LICENSE_BANNER,\nformat: format,\nentry: './dist/main-aot.js',\n" } ]
TypeScript
MIT License
promact/md2
chore: update rollup tasks
530,388
10.04.2017 14:01:32
-19,080
ecb292083e928680dacdacd75b6e2e3305f8663d
chore: updated 'Hire Us' reference URL
[ { "change_type": "MODIFY", "old_path": "src/demo-app/demo-app/demo-app.html", "new_path": "src/demo-app/demo-app/demo-app.html", "diff": "<path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z\"></path>\n</svg>\n</a>\n- <a href=\"http://promactinfo.com/\" target=\"_blank\">\n+ <a href=\"https://promactinfo.com/?utm_source=github&utm_medium=banner&utm_campaign=github_md2\" target=\"_blank\">\n<img src=\"./assets/img/hireus-ribbon.png\" alt=\"Hire Us\">\n</a>\n</span>\n" } ]
TypeScript
MIT License
promact/md2
chore: updated 'Hire Us' reference URL
530,388
10.04.2017 17:11:43
-19,080
8886750bbf94e744326320892ae108d2624210e8
publish-demo : update gulp task with rollup bundle paths and published demo
[ { "change_type": "MODIFY", "old_path": "scripts/deploy/deploy.sh", "new_path": "scripts/deploy/deploy.sh", "diff": "@@ -22,6 +22,8 @@ git clone https://Promact:[email protected]/Promact/md2.git --branch=gh-pages\nrm -rf deploy/**/* || exit 0\n# Deploy demo.\n+gulp rollup:prepare\n+./node_modules/.bin/rollup -c ./dist/rollup-config.js\ngulp deploy\n# Configure cloned repo.\n" }, { "change_type": "MODIFY", "old_path": "tools/gulp/tasks/deploy.ts", "new_path": "tools/gulp/tasks/deploy.ts", "diff": "@@ -29,14 +29,8 @@ task('rollup:prepare',['aot:build'], () => {\n.pipe(dest(join(DIST_ROOT, 'node_modules')));\n});\n-task('rollup:build', ['rollup:prepare'], (cb: any) => {\n- exec('./node_modules/.bin/rollup -c ./dist/rollup-config.js', (err: any) => {\n- cb(err);\n- });\n- });\n-\n// Deploy demo source\n-task('deploy',['rollup:build'], () => {\n+task('deploy', () => {\nsrc(join(DIST_ROOT, 'index-aot.html'))\n.pipe(rename('index.html'))\n.pipe(dest(join(PROJECT_ROOT, 'deploy')));\n" } ]
TypeScript
MIT License
promact/md2
publish-demo : update gulp task with rollup bundle paths and published demo
530,388
12.04.2017 08:36:56
-19,080
8ae54d3a3a19eb69e86354f821848948c4f8a756
chore(select) update to compare value as object
[ { "change_type": "MODIFY", "old_path": "src/lib/select/select.ts", "new_path": "src/lib/select/select.ts", "diff": "@@ -521,7 +521,7 @@ export class Md2Select implements AfterContentInit, ControlValueAccessor, OnDest\n* @returns Option that has the corresponding value.\n*/\nprivate _selectValue(value: any): Md2Option {\n- let correspondingOption = this.options.find(option => option.value === value);\n+ let correspondingOption = this.options.find(option => this.equals(option.value, value));\nif (correspondingOption) {\ncorrespondingOption.select();\n@@ -531,6 +531,31 @@ export class Md2Select implements AfterContentInit, ControlValueAccessor, OnDest\nreturn correspondingOption;\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/**\n* Clears the select trigger and deselects every option in the list.\n* @param skip Option that should not be deselected.\n" } ]
TypeScript
MIT License
promact/md2
chore(select) update to compare value as object
530,388
12.04.2017 16:51:08
-19,080
32f766c42fff02a2422037e38e5ea807a2c15552
chore(datepicker) update month-year views of calendar
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/month-view.ts", "new_path": "src/lib/datepicker/month-view.ts", "diff": "@@ -7,11 +7,19 @@ import {\nOutput,\nAfterContentInit\n} from '@angular/core';\n-import { Md2CalendarCell } from './calendar-table';\nimport { DateLocale } from './date-locale';\nimport { DateUtil } from './date-util';\n+/**\n+ * An internal class that represents the data corresponding to a single calendar cell.\n+ * @docs-private\n+ */\n+export class Md2CalendarCell {\n+ constructor(public value: number, public displayValue: string, public enabled: boolean) { }\n+}\n+\n+\nconst DAYS_PER_WEEK = 7;\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/year-view.ts", "new_path": "src/lib/datepicker/year-view.ts", "diff": "@@ -8,7 +8,6 @@ import {\nOutput,\nEventEmitter\n} from '@angular/core';\n-import { Md2CalendarCell } from './calendar-table';\nimport { DateLocale } from './date-locale';\nimport { DateUtil } from './date-util';\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) update month-year views of calendar
530,388
12.04.2017 18:16:14
-19,080
30b89cd30e23ad303361fc8318e16a52077fc6ac
chore(datepicker) added sketelon of panel
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/clock.html", "new_path": "src/lib/datepicker/clock.html", "diff": "cdkMonitorSubtreeFocus>\n<div class=\"md2-clock-center\"></div>\n<div class=\"md2-clock-hand\" [ngStyle]=\"_hand\"></div>\n+ <div class=\"md2-clock-hours\" [class.active]=\"_hourView\">\n<div *ngFor=\"let h of _hours\"\nclass=\"md2-clock-cell\"\n[class.md2-clock-cell-selected]=\"_hour == h.hour\"\n[style.top]=\"h.top+'%'\"\n[style.left]=\"h.left+'%'\">{{ h.hour }}</div>\n- <!--<div class=\"md2-clock-minutes\" [class.active]=\"!_view\">\n+ </div>\n+ <div class=\"md2-clock-minutes\" [class.active]=\"!_hourView\">\n<div *ngFor=\"let m of _minutes\"\n- class=\"md2-clock-minute\"\n- [class.active]=\"_minute == m.minute\"\n- [style.top.px]=\"m.top\"\n- [style.left.px]=\"m.left\">{{ m.minute }}</div>\n- </div>-->\n+ class=\"md2-clock-cell\"\n+ [class.md2-clock-cell-selected]=\"_minute == m.minute\"\n+ [style.top]=\"m.top+'%'\"\n+ [style.left]=\"m.left+'%'\">{{ m.minute }}</div>\n+ </div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/clock.scss", "new_path": "src/lib/datepicker/clock.scss", "diff": "@@ -55,6 +55,29 @@ md2-clock {\n}\n}\n+.md2-clock-hours,\n+.md2-clock-minutes {\n+ position: absolute;\n+ top: 0;\n+ left: 0;\n+ width: 100%;\n+ height: 100%;\n+ opacity: 0;\n+ visibility: hidden;\n+ transition: 350ms;\n+ transform: scale(1.2);\n+\n+ &.active {\n+ opacity: 1;\n+ visibility: visible;\n+ transform: scale(1);\n+ }\n+}\n+\n+.md2-clock-minutes {\n+ transform: scale(0.8);\n+}\n+\n.md2-clock-cell {\nposition: absolute;\ndisplay: flex;\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/clock.ts", "new_path": "src/lib/datepicker/clock.ts", "diff": "@@ -106,10 +106,8 @@ export class Md2Clock implements AfterContentInit {\n}\nget _hand(): any {\n- let CLOCK_RADIUS = 50;\nlet CLOCK_INNER_RADIUS = 27.5;\nlet CLOCK_OUTER_RADIUS = 41.25;\n- let CLOCK_TICK_RADIUS = 7.0833;\nlet deg = 0;\nlet radius = CLOCK_OUTER_RADIUS;\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.scss", "new_path": "src/lib/datepicker/datepicker.scss", "diff": "@@ -493,7 +493,7 @@ md2-clock1 {\n}\n}*/\n-.md2-clock-hours,\n+/*.md2-clock-hours,\n.md2-clock-minutes {\nposition: absolute;\ntop: 0;\n@@ -514,7 +514,7 @@ md2-clock1 {\n.md2-clock-minutes {\ntransform: scale(0.8);\n-}\n+}*/\n.md2-clock-hour,\n.md2-clock-minute {\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/index.ts", "new_path": "src/lib/datepicker/index.ts", "diff": "import { NgModule } from '@angular/core';\n-import { Md2MonthView } from './month-view';\nimport { CommonModule } from '@angular/common';\n-import { Md2YearView } from './year-view';\n-import { DateUtil } from './date-util';\n-import { DateLocale } from './date-locale';\nimport { OverlayModule, PortalModule } from '../core';\nimport { Md2Datepicker } from './datepicker';\n+import { Md2DatepickerPanel } from './datepicker-panel';\n+import { Md2Calendar } from './calendar';\n+import { Md2MonthView } from './month-view';\n+import { Md2YearView } from './year-view';\nimport { Md2Clock } from './clock';\nimport { Md2Clock1 } from './clock1';\n-import { Md2Calendar } from './calendar';\n+import { DateUtil } from './date-util';\n+import { DateLocale } from './date-locale';\nimport { StyleModule } from '../core/style/index';\n-export * from './calendar';\nexport * from './datepicker';\n+export * from './calendar';\nexport * from './month-view';\nexport * from './year-view';\nexport * from './clock';\nexport * from './clock1';\n+export * from './date-util';\n+export * from './date-locale';\n@NgModule({\n@@ -29,13 +32,15 @@ export * from './clock1';\n],\nexports: [\nMd2Datepicker,\n+ Md2DatepickerPanel,\nMd2Calendar,\nMd2Clock,\nMd2Clock1\n],\ndeclarations: [\n- Md2Calendar,\nMd2Datepicker,\n+ Md2DatepickerPanel,\n+ Md2Calendar,\nMd2MonthView,\nMd2YearView,\nMd2Clock,\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) added sketelon of panel
530,394
12.04.2017 20:15:12
14,400
2b0ffec11d2573c031316dfa275cb37fe66f10cc
feat: zero padded hours and minutes Padded single digit hours and minutes in the datepicker header with zeros. Work requested in issue
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "[class.active]=\"!_isCalendarVisible\">\n<span class=\"md2-datepicker-header-hour\"\n[class.active]=\"_clockView === 'hour'\"\n- (click)=\"_toggleHours('hour')\">{{ date.getHours() }}</span>:<span class=\"md2-datepicker-header-minute\"\n+ (click)=\"_toggleHours('hour')\">{{ hours }}</span>:<span class=\"md2-datepicker-header-minute\"\n[class.active]=\"_clockView === 'minute'\"\n- (click)=\"_toggleHours('minute')\">{{ date.getMinutes() }}</span>\n+ (click)=\"_toggleHours('minute')\">{{ minutes }}</span>\n</span>\n</div>\n</div>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -214,7 +214,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n}\n}\n- get time() { return this.date.getHours() + ':' + this.date.getMinutes(); }\n+ get time() { return this.hours + ':' + this.minutes }\nset time(value: string) {\nthis.date = new Date(this.date.getFullYear(), this.date.getMonth(), this.date.getDate(),\nparseInt(value.split(':')[0]), parseInt(value.split(':')[1]));\n@@ -225,6 +225,14 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n// }\n}\n+ private padWithZero(n: number){ return (n < 10 ? '0' : '') + n }\n+ get minutes(): string {\n+ return this.padWithZero(this._date.getMinutes());\n+ }\n+ get hours(): string {\n+ return this.padWithZero(this._date.getHours());\n+ }\n+\n@Input()\nget selected() { return this._selected; }\nset selected(value: Date) { this._selected = value; }\n" } ]
TypeScript
MIT License
promact/md2
feat: zero padded hours and minutes Padded single digit hours and minutes in the datepicker header with zeros. Work requested in issue #166
530,388
13.04.2017 16:42:09
-19,080
929d2b439c4c341a48ea8f5bde0df16115b7b0e8
chore(datepicker) implement basic functionality
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/clock.ts", "new_path": "src/lib/datepicker/clock.ts", "diff": "@@ -2,6 +2,7 @@ import {\nAfterContentInit,\nChangeDetectionStrategy,\nComponent,\n+ ElementRef,\nEventEmitter,\nInput,\nOutput,\n@@ -20,6 +21,11 @@ import {\nUP_ARROW\n} from '../core/keyboard/keycodes';\n+const CLOCK_RADIUS = 50;\n+const CLOCK_INNER_RADIUS = 27.5;\n+const CLOCK_OUTER_RADIUS = 41.25;\n+const CLOCK_TICK_RADIUS = 7.0833;\n+\n/**\n* A clock that is used as part of the datepicker.\n* @docs-private\n@@ -29,6 +35,10 @@ import {\nselector: 'md2-clock',\ntemplateUrl: 'clock.html',\nstyleUrls: ['clock.css'],\n+ host: {\n+ 'role': 'clock',\n+ '(mousedown)': '_handleMousedown($event)',\n+ },\nencapsulation: ViewEncapsulation.None,\nchangeDetection: ChangeDetectionStrategy.OnPush,\n})\n@@ -86,7 +96,7 @@ export class Md2Clock implements AfterContentInit {\nget _activeDate() { return this._clampedActiveDate; }\nset _activeDate(value: Date) {\nthis._clampedActiveDate = this._util.clampDate(value, this.minDate, this.maxDate);\n- this._init();\n+ //this._init();\n}\n/** Grid of calendar cells representing the dates of the month. */\n@@ -98,27 +108,16 @@ export class Md2Clock implements AfterContentInit {\n/** Whether the clock is in hour view. */\n_hourView: boolean;\n- /** The label for the current clock view. */\n- get _label(): string {\n- return this._hourView ?\n- this._locale.getCalendarMonthHeaderLabel(this._activeDate) :\n- this._locale.getCalendarYearHeaderLabel(this._activeDate);\n- }\n-\nget _hand(): any {\n- let CLOCK_INNER_RADIUS = 27.5;\n- let CLOCK_OUTER_RADIUS = 41.25;\n-\nlet deg = 0;\nlet radius = CLOCK_OUTER_RADIUS;\n- //if (this._view) {\n- let inner = this._hour > 0 && this._hour < 13;\n+ if (this._hourView) {\n+ let inner = this._activeDate.getHours() > 0 && this._activeDate.getHours() < 13;\nradius = inner ? CLOCK_INNER_RADIUS : CLOCK_OUTER_RADIUS;\n- deg = Math.round(this._hour * (360 / (24 / 2)));\n- //} else {\n- // deg = Math.round(this._minute * (360 / 60));\n- //}\n-\n+ deg = Math.round(this._activeDate.getHours() * (360 / (24 / 2)));\n+ } else {\n+ deg = Math.round(this._activeDate.getMinutes() * (360 / 60));\n+ }\nreturn {\n'transform': `rotate(${deg}deg)`,\n'height': `${radius}%`,\n@@ -126,7 +125,14 @@ export class Md2Clock implements AfterContentInit {\n};\n}\n- constructor(private _locale: DateLocale, private _util: DateUtil) { }\n+ private mouseMoveListener: any;\n+ private mouseUpListener: any;\n+\n+ constructor(private _element: ElementRef, private _locale: DateLocale,\n+ private _util: DateUtil) {\n+ this.mouseMoveListener = (event: any) => { this._handleMousemove(event); };\n+ this.mouseUpListener = (event: any) => { this._handleMouseup(event); };\n+ }\nngAfterContentInit() {\nthis._activeDate = this.startAt || this._util.today();\n@@ -135,37 +141,17 @@ export class Md2Clock implements AfterContentInit {\n}\n/** Handles date selection in the hour view. */\n- _dateSelected(date: Date): void {\n- if ((!date || !this.selected) && date != this.selected || this._util.isSameDay(date, this.selected)) {\n+ _minuteSelected(date: Date): void {\n+ //if ((!date || !this.selected) && date != this.selected || this._util.isSameDay(date, this.selected)) {\nthis.selectedChange.emit(date);\n- }\n+ //}\n}\n- /** Initializes this month view. */\n+ /** Initializes this clock view. */\nprivate _init() {\n- //this._selected = this._getMonthInCurrentYear(this.selected);\n- //this._todayMonth = this._getMonthInCurrentYear(SimpleDate.today());\n- //this._yearLabel = this._locale.getCalendarYearHeaderLabel(this.activeDate);\n-\n- // First row of months only contains 5 elements so we can fit the year label on the same row.\n- //this._hours = [[0, 1, 2, 3, 4], [5, 6, 7, 8, 9, 10, 11]].map(row => row.map(\n- // month => this._createCellForMonth(month)));\n- let CLOCK_RADIUS = 50;\n- let CLOCK_INNER_RADIUS = 27.5;\n- let CLOCK_OUTER_RADIUS = 41.25;\n- let CLOCK_TICK_RADIUS = 7.0833;\n-\nthis._hours.length = 0;\nfor (let i = 0; i < 24; i++) {\n- //let x = -(50 * (Math.sin(-Math.PI * (i / 6))));\n- //let y = -(50 * (Math.cos(-Math.PI * (i / 6))));\n- //this._hours.push({\n- // hour: i === 0 ? '00' : i,\n- // top: y,\n- // left: x\n- //});\n-\nlet radian = i / 6 * Math.PI;\nlet inner = i > 0 && i < 13,\nradius = inner ? CLOCK_INNER_RADIUS : CLOCK_OUTER_RADIUS;\n@@ -189,12 +175,7 @@ export class Md2Clock implements AfterContentInit {\n/** Handles hour selection in the minute view. */\n_hourSelected(hour: Date): void {\nthis._activeDate = hour;\n- this._hourView = true;\n- }\n-\n- /** Handles user clicks on the period label. */\n- _currentPeriodClicked(): void {\n- this._hourView = !this._hourView;\n+ this._hourView = false;\n}\n/** Handles user clicks on the previous button. */\n@@ -232,124 +213,117 @@ export class Md2Clock implements AfterContentInit {\n/** Handles keydown events on the clock body. */\n_handleClockBodyKeydown(event: KeyboardEvent): void {\n- // TODO(mmalerba): We currently allow keyboard navigation to disabled dates, but just prevent\n- // disabled ones from being selected. This may not be ideal, we should look into whether\n- // navigation should skip over disabled dates, and if so, how to implement that efficiently.\nif (this._hourView) {\n- this._handleCalendarBodyKeydownInMonthView(event);\n- } else {\n- this._handleCalendarBodyKeydownInYearView(event);\n- }\n- }\n-\n- /** Handles keydown events on the clock body when clock is in hour view. */\n- private _handleCalendarBodyKeydownInMonthView(event: KeyboardEvent): void {\nswitch (event.keyCode) {\n- case LEFT_ARROW:\n- this._activeDate = this._util.incrementDays(this._activeDate, -1);\n- break;\n- case RIGHT_ARROW:\n- this._activeDate = this._util.incrementDays(this._activeDate, 1);\n- break;\ncase UP_ARROW:\n- this._activeDate = this._util.incrementDays(this._activeDate, -7);\n+ this._activeDate = this._util.incrementHours(this._activeDate, -1);\nbreak;\ncase DOWN_ARROW:\n- this._activeDate = this._util.incrementDays(this._activeDate, 7);\n- break;\n- case HOME:\n- this._activeDate = this._util.getFirstDateOfMonth(this._activeDate);\n- break;\n- case END:\n- this._activeDate = this._util.getLastDateOfMonth(this._activeDate);\n- break;\n- case PAGE_UP:\n- this._activeDate = event.altKey ?\n- this._util.incrementYears(this._activeDate, -1) :\n- this._util.incrementHours(this._activeDate, -1);\n- break;\n- case PAGE_DOWN:\n- this._activeDate = event.altKey ?\n- this._util.incrementYears(this._activeDate, 1) :\n- this._util.incrementHours(this._activeDate, 1);\n+ this._activeDate = this._util.incrementHours(this._activeDate, 1);\nbreak;\ncase ENTER:\n- if (this._dateFilterForViews(this._activeDate)) {\n- this._dateSelected(this._activeDate);\n+ this._hourSelected(this._activeDate);\nbreak;\n- }\n- return;\ndefault:\n- // Don't prevent default on keys that we don't explicitly handle.\nreturn;\n}\n-\n- event.preventDefault();\n- }\n-\n- /** Handles keydown events on the clock body when clock is in minute view. */\n- private _handleCalendarBodyKeydownInYearView(event: KeyboardEvent): void {\n+ } else {\nswitch (event.keyCode) {\n- case LEFT_ARROW:\n- this._activeDate = this._util.incrementHours(this._activeDate, -1);\n- break;\n- case RIGHT_ARROW:\n- this._activeDate = this._util.incrementHours(this._activeDate, 1);\n- break;\ncase UP_ARROW:\n- this._activeDate = this._prevMonthInSameCol(this._activeDate);\n+ this._activeDate = this._util.incrementMinutes(this._activeDate, -1);\nbreak;\ncase DOWN_ARROW:\n- this._activeDate = this._nextMonthInSameCol(this._activeDate);\n- break;\n- case HOME:\n- this._activeDate = this._util.incrementHours(this._activeDate, -this._activeDate.getHours());\n- break;\n- case END:\n- this._activeDate = this._util.incrementHours(this._activeDate, 11 - this._activeDate.getHours());\n- break;\n- case PAGE_UP:\n- this._activeDate = this._util.incrementYears(this._activeDate, event.altKey ? -10 : -1);\n- break;\n- case PAGE_DOWN:\n- this._activeDate = this._util.incrementYears(this._activeDate, event.altKey ? 10 : 1);\n+ this._activeDate = this._util.incrementMinutes(this._activeDate, 1);\nbreak;\ncase ENTER:\n- this._hourSelected(this._activeDate);\n+ if (this._dateFilterForViews(this._activeDate)) {\n+ this._minuteSelected(this._activeDate);\nbreak;\n+ }\n+ return;\ndefault:\n- // Don't prevent default on keys that we don't explicitly handle.\nreturn;\n}\n+ }\n+ event.preventDefault();\n+ }\n+\n+ /** Handles mousedown events on the clock body. */\n+ _handleMousedown(event: any) {\n+ this.setTime(event);\n+ document.addEventListener('mousemove', this.mouseMoveListener);\n+ document.addEventListener('touchmove', this.mouseMoveListener);\n+ document.addEventListener('mouseup', this.mouseUpListener);\n+ document.addEventListener('touchend', this.mouseUpListener);\n+ }\n+ _handleMousemove(event: any) {\nevent.preventDefault();\n+ this.setTime(event);\n+ console.log('moving');\n}\n- /**\n- * Determine the date for the hour that comes before the given hour in the same column in the\n- * clock table.\n- */\n- private _prevMonthInSameCol(date: Date) {\n- // Determine how many hours to jump forward given that there are 2 empty slots at the beginning\n- // of each minute.\n- let increment = date.getHours() <= 4 ? -5 : (date.getHours() >= 7 ? -7 : -12);\n- return this._util.incrementHours(date, increment);\n+ _handleMouseup(event: any) {\n+ document.removeEventListener('mousemove', this.mouseMoveListener);\n+ document.removeEventListener('touchmove', this.mouseMoveListener);\n+ document.removeEventListener('mouseup', this.mouseUpListener);\n+ document.removeEventListener('touchend', this.mouseUpListener);\n+ //if (!cell.enabled || this._selectedDate == cell.value) {\n+ // return;\n+ //}\n+ if (this._hourView) {\n+ this._hourSelected(this._activeDate);\n+ } else {\n+ this.selectedChange.emit(this._activeDate);\n+ }\n+ console.log('up');\n}\n/**\n- * Determine the date for the hour that comes after the given hour in the same column in the\n- * clock table.\n+ * Set Time\n+ * @param event\n*/\n- private _nextMonthInSameCol(date: Date): Date {\n- // Determine how many hours to jump forward given that there are 2 empty slots at the beginning\n- // of each minute.\n- let increment = date.getHours() <= 4 ? 7 : (date.getHours() >= 7 ? 5 : 12);\n- return this._util.incrementHours(date, increment);\n+ private setTime(event: any) {\n+ let trigger = this._element.nativeElement;\n+ let triggerRect = trigger.getBoundingClientRect();\n+ let width = trigger.offsetWidth;\n+ let height = trigger.offsetHeight;\n+ let pageX = event.pageX !== undefined ? event.pageX : event.touches[0].pageX;\n+ let pageY = event.pageY !== undefined ? event.pageY : event.touches[0].pageY;\n+ let x = (width / 2) - (pageX - triggerRect.left - window.pageXOffset);\n+ let y = (height / 2) - (pageY - triggerRect.top - window.pageYOffset);\n+ let radian = Math.atan2(-x, y);\n+ let unit = Math.PI / (this._hourView ? 6 : 30);\n+ let z = Math.sqrt(x * x + y * y);\n+ let inner = false;//this._hourView && z < (CLOCK_OUTER_RADIUS + CLOCK_INNER_RADIUS) / 2;\n+ let value = 0;\n+\n+ if (radian < 0) { radian = Math.PI * 2 + radian; }\n+ value = Math.round(radian / unit);\n+ radian = value * unit;\n+\n+ if (this._hourView) {\n+ if (value === 12) { value = 0; }\n+ value = inner ? (value === 0 ? 12 : value) : value === 0 ? 0 : value + 12;\n+ this._activeDate.setHours(value);\n+ //this._activeDate = new Date(this._activeDate.getFullYear(),\n+ // this._activeDate.getMonth(), this._activeDate.getDate(), value,\n+ // this._activeDate.getMinutes(), this._activeDate.getSeconds());\n+ } else {\n+ if (value === 60) { value = 0; }\n+ this._activeDate.setMinutes(value);\n+ //this._activeDate = new Date(this._activeDate.getFullYear(),\n+ // this._activeDate.getMonth(), this._activeDate.getDate(), this._activeDate.getHours(),\n+ // value, this._activeDate.getSeconds());\n+\n+ }\n+ //this._time = this._hour + ':' + this._minute;\n+ //this._emitChangeEvent();\n}\n/**\n- * Gets the month in this year that the given Date falls on.\n- * Returns null if the given Date is in another year.\n+ * Gets the time given in the Date falls on.\n+ * Returns null if the given Time is in another Date.\n*/\nprivate _getTimeInCurrentDate(date: Date) {\nthis._hour = date ? date.getHours() : null;\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) implement basic functionality
530,388
19.04.2017 15:47:32
-19,080
36b2cd88dde751775da4470c30035724e3cbfc6c
fix(demo) issue with IE11
[ { "change_type": "MODIFY", "old_path": "src/demo-app/data-table/data-table-demo.ts", "new_path": "src/demo-app/data-table/data-table-demo.ts", "diff": "@@ -27,7 +27,7 @@ export class DataTableDemo {\nsearch: string = null;\nconstructor(private http: Http) {\n- this.http.get('../assets/data/data.json')\n+ this.http.get('./assets/data/data.json')\n.subscribe((data) => {\nthis.data = data.json();\n});\n" }, { "change_type": "MODIFY", "old_path": "src/demo-app/index-aot.html", "new_path": "src/demo-app/index-aot.html", "diff": "</div>\n</demo-app>\n+ <script src=\"libs/core-js/client/shim.min.js\"></script>\n<script src=\"libs/zone.js/dist/zone.js\"></script>\n<script src=\"libs/reflect-metadata/Reflect.js\"></script>\n<script src=\"libs/hammerjs/hammer.min.js\"></script>\n" }, { "change_type": "MODIFY", "old_path": "tools/gulp/tasks/deploy.ts", "new_path": "tools/gulp/tasks/deploy.ts", "diff": "@@ -26,7 +26,7 @@ task('deploy', () => {\n.pipe(dest(join(PROJECT_ROOT, 'deploy')));\nreturn src(['assets/**/*', 'libs/reflect-metadata/**/*', 'libs/zone.js/**/*',\n- 'libs/hammerjs/**/*', 'bundle.js', 'bundle.js.map', 'favicon.ico'],\n+ 'libs/core-js/**/*', 'libs/hammerjs/**/*', 'bundle.js', 'bundle.js.map', 'favicon.ico'],\n{ cwd: join(DIST_ROOT, '**') })\n.pipe(dest(join(PROJECT_ROOT, 'deploy')));\n});\n" } ]
TypeScript
MIT License
promact/md2
fix(demo) issue with IE11 #171
530,388
20.04.2017 10:58:38
-19,080
5e43f3d1e5710cba76b9be670b808bb5190402d8
chore: update demo hire-us ribbon url
[ { "change_type": "MODIFY", "old_path": "src/demo-app/demo-app/demo-app.html", "new_path": "src/demo-app/demo-app/demo-app.html", "diff": "<path d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z\"></path>\n</svg>\n</a>\n- <a href=\"https://promactinfo.com/?utm_source=github&utm_medium=banner&utm_campaign=github_md2\" target=\"_blank\">\n+ <a href=\"https://promactinfo.com/hire-us?utm_source=github&utm_medium=banner&utm_campaign=github_md2\" target=\"_blank\">\n<img src=\"./assets/img/hireus-ribbon.png\" alt=\"Hire Us\">\n</a>\n</span>\n" } ]
TypeScript
MIT License
promact/md2
chore: update demo hire-us ribbon url
530,388
20.04.2017 15:50:58
-19,080
6581537985cbf107ece60c2228fa9e0bdace70c8
fix(datepicker) date format issue and removed clear option
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.html", "new_path": "src/lib/datepicker/datepicker.html", "diff": "</button>\n<div class=\"md2-datepicker-input\" [class.md2-datepicker-input-focused]=\"_inputFocused\">\n<span class=\"md2-datepicker-placeholder\" [class.md2-floating-placeholder]=\"value || _inputFocused\">{{ placeholder }}</span>\n- <input type=\"text\"\n+ <input #input\n+ type=\"text\"\nclass=\"md2-datepicker-value\"\n[tabindex]=\"tabindex\"\n[disabled]=\"disabled\"\n- [value]=\"value | date:format\"\nautocomplete=\"off\"\n(change)=\"$event.stopPropagation()\"\n(focus)=\"_handleFocus($event)\"\n(blur)=\"_handleBlur($event)\"\n(keydown)=\"_handleKeydown($event)\" />\n- <span *ngIf=\"!value || required || disabled\" class=\"md2-datepicker-arrow\"></span>\n- <span *ngIf=\"value && !required && !disabled\"\n- class=\"md2-datepicker-clear\" (click)=\"_clearValue($event)\">\n- <svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\">\n- <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\" />\n- </svg>\n- </span>\n+ <span class=\"md2-datepicker-arrow\"></span>\n</div>\n</div>\n<ng-template #portal>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -123,6 +123,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n_onTouched = () => { };\n@ViewChild('portal') _templatePortal: TemplateRef<any>;\n+ @ViewChild('input') _input: ElementRef;\n/** Event emitted when the select has been opened. */\n@Output() onOpen: EventEmitter<void> = new EventEmitter<void>();\n@@ -167,6 +168,7 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nget type() { return this._type; }\nset type(value: Type) {\nthis._type = value || 'date';\n+ this._input.nativeElement.value = this._formatDate(this._value);\n}\n@Input()\n@@ -176,7 +178,10 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\n'dd/MM/y HH:mm' : 'dd/MM/y');\n}\nset format(value: string) {\n- if (this._format !== value) { this._format = value; }\n+ if (this._format !== value) {\n+ this._format = value;\n+ this._input.nativeElement.value = this._formatDate(this._value);\n+ }\n}\n@Input()\n@@ -199,6 +204,9 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nset value(value: Date) {\nthis._value = this.coerceDateProperty(value);\nthis.date = this._value;\n+ setTimeout(() => {\n+ this._input.nativeElement.value = this._formatDate(this._value);\n+ });\n}\nget date() { return this._date || this.today; }\n@@ -528,20 +536,13 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis._onTouched();\n}\nlet el: any = event.target;\n- let d: any = this._util.parseDate(el.value, this.format);\n- if (this._util.isValidDate(d)) {\n- this.value = d;\n+ let date: Date = this._util.parseDate(el.value, this.format);\n+ if (this.value !== date) {\n+ this.value = date ? date : null;\nthis._emitChangeEvent();\n}\n}\n- _clearValue(event: Event) {\n- event.stopPropagation();\n- this.value = null;\n- this._emitChangeEvent();\n- this._focusHost();\n- }\n-\n/**\n* Display Years\n*/\n@@ -794,6 +795,30 @@ export class Md2Datepicker implements OnDestroy, ControlValueAccessor {\nthis.disabled = isDisabled;\n}\n+ /**\n+ * format date\n+ * @param date Date Object\n+ * @return string with formatted date\n+ */\n+ private _formatDate(date: Date): string {\n+ if (!this.format || !date) { return ''; }\n+ return this.format\n+ .replace('yy', ('00' + date.getFullYear()).slice(-2))\n+ .replace('y', '' + date.getFullYear())\n+ .replace('MMMM', this._locale.months[date.getMonth()].full)\n+ .replace('MMM', this._locale.months[date.getMonth()].short)\n+ .replace('MM', ('0' + (date.getMonth() + 1)).slice(-2))\n+ .replace('M', '' + (date.getMonth() + 1))\n+ .replace('dd', ('0' + date.getDate()).slice(-2))\n+ .replace('d', '' + date.getDate())\n+ .replace('HH', ('0' + date.getHours()).slice(-2))\n+ .replace('H', '' + date.getHours())\n+ .replace('mm', ('0' + date.getMinutes()).slice(-2))\n+ .replace('m', '' + date.getMinutes())\n+ .replace('ss', ('0' + date.getSeconds()).slice(-2))\n+ .replace('s', '' + date.getSeconds());\n+ }\n+\nprivate _subscribeToBackdrop(): void {\nthis._backdropSubscription = this._overlayRef.backdropClick().subscribe(() => {\nthis.close();\n" } ]
TypeScript
MIT License
promact/md2
fix(datepicker) date format issue and removed clear option #164, #173, #176, #172, #159, #136
530,388
20.04.2017 16:21:56
-19,080
c13c8a428f05f667e8686ecc9f1aad69ddd1d31e
deploy-0.0.19 updated build script
[ { "change_type": "MODIFY", "old_path": "scripts/deploy/deploy.sh", "new_path": "scripts/deploy/deploy.sh", "diff": "@@ -6,7 +6,7 @@ TARGET_BRANCH=\"gh-pages\"\nCOMMIT_MSG=`git log --format=%B --no-merges -n 1`\n# Pull requests and commits to other branches shouldn't try to deploy, just build to verify\n-if [ \"$TRAVIS_PULL_REQUEST\" != \"false\" ] || [ \"$TRAVIS_BRANCH\" != \"$SOURCE_BRANCH\" ] || [[ $COMMIT_MSG != \"deploy-\"* ]]; then\n+if [ \"$TRAVIS_PULL_REQUEST\" != \"false\" ] || [ \"$TRAVIS_BRANCH\" != \"$SOURCE_BRANCH\" ] || [[ $COMMIT_MSG != \"publish-\"* ]]; then\necho \"Building demo-app\"\ngulp build:devapp\nexit 0\n" } ]
TypeScript
MIT License
promact/md2
deploy-0.0.19 updated build script
530,388
21.04.2017 14:47:08
-19,080
a5d936a7f478e55f86ee1e0c7138588f7ca2d3a0
chore: added git issue template
[ { "change_type": "ADD", "old_path": null, "new_path": ".github/ISSUE_TEMPLATE.md", "diff": "+#### Bug, feature request, or proposal:\n+\n+\n+#### What is the expected behavior?\n+\n+\n+#### What is the current behavior?\n+\n+\n+#### What are the steps to reproduce?\n+\n+Providing a Plunker (or similar) is the *best* way to get the team to see your issue.\n+\n+\n+#### What is the use-case or motivation for changing an existing behavior?\n+\n+\n+#### Which versions of Angular, MD2, OS, browsers are affected?\n+\n+\n+#### Is there anything else we should know?\n" } ]
TypeScript
MIT License
promact/md2
chore: added git issue template
530,393
24.04.2017 10:22:50
14,400
8f12bb2060d94a766cd225a6bcb9d01b0b2140b9
feat (chips): add type attribute to input
[ { "change_type": "MODIFY", "old_path": "src/demo-app/chips/chips-demo.html", "new_path": "src/demo-app/chips/chips-demo.html", "diff": "<form class=\"content\">\n<md2-chips name=\"item\"\n[(ngModel)]=\"_item\"\n+ type=\"text\"\nplaceholder=\"Add\"\n[maxChips]=\"8\"\n[isRemovable]=\"isRemovable\"\n<form class=\"content\">\n<md2-chips name=\"item\"\n[(ngModel)]=\"_itemsData\"\n+ type=\"text\"\nplaceholder=\"Add\"\n[maxChips]=\"8\"\n[isRemovable]=\"isRemovable\"\n" }, { "change_type": "MODIFY", "old_path": "src/lib/chips/chips.html", "new_path": "src/lib/chips/chips.html", "diff": "</span>\n<ng-content select=\".md2-template\"></ng-content>\n<form #chipInputForm=\"ngForm\" class=\"chip-input-form\">\n- <input *ngIf=\"!isAutoComplete\" class=\"chip-input\" [disabled]=\"disabled\" type=\"text\" [(ngModel)]=\"inputValue\" name=\"chipInput\" [placeholder]=\"placeholder\" (paste)=\"inputPaste($event)\" (keydown)=\"inputChanged($event)\" (blur)=\"inputBlurred($event)\" (focus)=\"inputFocus()\" />\n+ <input *ngIf=\"!isAutoComplete\" class=\"chip-input\" [disabled]=\"disabled\" [type]=\"type\" [(ngModel)]=\"inputValue\" name=\"chipInput\" [placeholder]=\"placeholder\" (paste)=\"inputPaste($event)\" (keydown)=\"inputChanged($event)\" (blur)=\"inputBlurred($event)\" (focus)=\"inputFocus()\" />\n<div *ngIf=\"isAutoComplete\">\n<md2-autocomplete [items]=\"autocompleteDataList\"\n[item-text]=\"autocompleteItemText\"\n" }, { "change_type": "MODIFY", "old_path": "src/lib/chips/chips.ts", "new_path": "src/lib/chips/chips.ts", "diff": "@@ -90,6 +90,7 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\n@Input() disabled: boolean = false;\n@Input() minChips: number = 0;\n@Input() maxChips: number = 10000;\n+ @Input() type: string = 'text';\n@Input() id: string = 'md2-chips-' + (++nextId);\n@Input('autocomplete-item-text') autocompleteItemText: string = 'text';\n@Input('autocomplete-item-value') autocompleteItemValue: string = 'value';\n" } ]
TypeScript
MIT License
promact/md2
feat (chips): add type attribute to input
530,388
26.04.2017 09:32:58
-19,080
ffc75be3453f811f05a38f0f7f7b9fde93f346a2
chore: added reference of plunkr template
[ { "change_type": "MODIFY", "old_path": ".github/ISSUE_TEMPLATE.md", "new_path": ".github/ISSUE_TEMPLATE.md", "diff": "#### What are the steps to reproduce?\nProviding a Plunker (or similar) is the *best* way to get the team to see your issue.\n+Plunker template: http://plnkr.co/edit/rQmUz8WYRh5Vz4gwY8E4?p=info\n#### What is the use-case or motivation for changing an existing behavior?\n" } ]
TypeScript
MIT License
promact/md2
chore: added reference of plunkr template
530,397
26.04.2017 16:07:50
18,000
fdb88b3c87d50184dcb89c5330b08b4afd547979
Don't close other active tabs on init when accordion allows multiple open
[ { "change_type": "MODIFY", "old_path": "src/lib/accordion/accordiontab.ts", "new_path": "src/lib/accordion/accordiontab.ts", "diff": "@@ -70,7 +70,7 @@ export class Md2AccordionTab {\nget active(): boolean { return this._active; }\nset active(value) {\nthis._active = coerceBooleanProperty(value);\n- if (this._active) {\n+ if (this._active && !this._accordion.multiple) {\nfor (let i = 0; i < this._accordion.tabs.length; i++) {\nif (this._accordion.tabs[i] !== this) { this._accordion.tabs[i].active = false; }\n}\n" } ]
TypeScript
MIT License
promact/md2
Don't close other active tabs on init when accordion allows multiple open
530,388
28.04.2017 09:31:27
-19,080
03ef05d546388720df938a3b9b5e04fe64990049
chore(datepicker) fix issue while empty date input blur
[ { "change_type": "MODIFY", "old_path": "src/lib/datepicker/datepicker.ts", "new_path": "src/lib/datepicker/datepicker.ts", "diff": "@@ -523,6 +523,7 @@ export class Md2Datepicker implements AfterContentInit, OnDestroy, ControlValueA\n}\nlet el: any = event.target;\nlet date: Date = this._util.parseDate(el.value, this.format);\n+ if (this._util.isValidDate(date)) {\nlet d: Date = new Date(this.value);\nif (this.type !== 'time') {\nd.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());\n@@ -531,9 +532,15 @@ export class Md2Datepicker implements AfterContentInit, OnDestroy, ControlValueA\nd.setHours(date.getHours(), date.getMinutes());\n}\nif (this.value !== d) {\n- this.value = d ? d : null;\n+ this.value = d;\nthis._emitChangeEvent();\n}\n+ } else {\n+ if (this.value) {\n+ this.value = null;\n+ this._emitChangeEvent();\n+ }\n+ }\n}\n/**\n" } ]
TypeScript
MIT License
promact/md2
chore(datepicker) fix issue while empty date input blur
530,396
01.05.2017 13:31:15
-19,080
1dd2c05d9cf8aeaf446de61d5214d128f4f75e8c
Fix (Chips) place holder issue and focus issue
[ { "change_type": "MODIFY", "old_path": "src/lib/chips/chips.html", "new_path": "src/lib/chips/chips.html", "diff": "<div *ngIf=\"isAutoComplete\">\n<md2-autocomplete [items]=\"autocompleteDataList\"\n[item-text]=\"autocompleteItemText\"\n- [(ngModel)]=\"item\" name=\"autocomplete\" [disabled]=\"disabled\" (textChange)=\"valueupdate($event)\" (change)=\"changeAutocomplete($event)\" [placeholder]=\"placeholder\" (keydown)=\"inputChanged($event)\">\n+ [(ngModel)]=\"item\" name=\"autocomplete\" [disabled]=\"disabled\" (textChange)=\"valueupdate($event)\" (change)=\"changeAutocomplete($event)\" [placeholder]=\"placeholder\" (keydown)=\"inputChanged($event)\" (click)=\"getFocusAutocomplete()\">\n</md2-autocomplete>\n</div>\n</form>\n" }, { "change_type": "MODIFY", "old_path": "src/lib/chips/chips.ts", "new_path": "src/lib/chips/chips.ts", "diff": "@@ -83,7 +83,7 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\n@Input() allowedPattern: RegExp = /.+/;\n@Input() ngModel: string[];\n@Input() pasteSplitPattern: string = ',';\n- @Input() placeholder: string = 'Add New';\n+ @Input() placeholder: string = '';\n@Input() autocompleteDataList: string[];\n@Input() isAutoComplete: boolean = false;\n@Input() isRemovable: boolean = true;\n@@ -107,6 +107,7 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\ninputValue: string = '';\nselectedChip: number = -1;\ninputFocused: boolean = false;\n+ autoCompleteFocued: boolean = false;\nprivate _value: any = '';\nprivate splitRegExp: RegExp;\n@@ -145,6 +146,10 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\nthis._emitChangeEvent();\n}\n+ getFocusAutocomplete() {\n+ this._onTouched();\n+ }\n+\nchangeAutocomplete(value: any) {\nif (value) {\nlet objText = value.value;\n@@ -230,6 +235,10 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\nif (!this.isAutoComplete) {\nthis.elementRef.nativeElement.querySelector('input.chip-input').focus();\n}\n+ else {\n+ this.autoCompleteFocued = true;\n+ this._onTouched();\n+ }\nthis._resetSelected();\n}\n@@ -285,14 +294,16 @@ export class Md2Chips implements ControlValueAccessor, AfterContentInit {\n}\nprivate _isValid(chipString: any): boolean {\n- if (chipString) {\n+ let typeString = typeof chipString;\n+ if (typeString === 'string') {\n+ chipString = chipString.trim();\n+ }\nlet isExist: any;\nisExist = this.chipItemList.filter((chip) => chip.text === chipString);\nif (this.chipItemList.indexOf(chipString) === -1 && (isExist.length ? false : true)) {\nreturn this.allowedPattern.test(chipString);\n}\n}\n- }\n/**\n* add new chip\n* @param chips\n" } ]
TypeScript
MIT License
promact/md2
Fix (Chips) place holder issue and focus issue