From 53b13c0a78921043b0d5c8681eabb0c12ff7f7b6 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 09:47:34 -0300 Subject: [PATCH 001/111] fix(dropdownlist): fix disabled state of dropdownlist. --- .../components/dropdownlist/dropdownlist.html | 3 ++- .../components/dropdownlist/dropdownlist.ts | 23 +++++++++++++------ 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/projects/truly-ui/src/components/dropdownlist/dropdownlist.html b/projects/truly-ui/src/components/dropdownlist/dropdownlist.html index 0e99da6e4..06f9df948 100644 --- a/projects/truly-ui/src/components/dropdownlist/dropdownlist.html +++ b/projects/truly-ui/src/components/dropdownlist/dropdownlist.html @@ -10,7 +10,8 @@ #wrapper readonly #trigger="cdkOverlayOrigin" - (click)="!disabled ? isOpen = !isOpen : null" + [attr.disabled]="disabled ? true : null" + (click)="handleOpenList($event)" (keydown)="onKeyDown($event)" value="{{ selectedDescription ? selectedDescription : placeholder }}" [ngClass]="{ 'ng-invalid' : model?.invalid || controlName?.invalid }" diff --git a/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts b/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts index 9a25a82a4..267b494b1 100644 --- a/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts +++ b/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts @@ -65,7 +65,7 @@ export class TlDropDownList extends ElementBase implements OnInit, OnCha @Input( 'debounceTime' ) debounceTime = 200; - @Input( 'disabled' ) disabled = true; + @Input( 'disabled' ) disabled = false; @Input( 'labelPlacement' ) labelPlacement = 'left'; @@ -136,17 +136,24 @@ export class TlDropDownList extends ElementBase implements OnInit, OnCha const filter = []; this.datasource = this.data.slice(); this.datasource.filter( ( item ) => { - if ( (item[ this.keyText ].substr( 0, searchTextValue.length ).toLowerCase()) === (searchTextValue.toLowerCase()) ) { + if ( (this.getItemText(item).substr( 0, searchTextValue.length ).toLowerCase()) === (searchTextValue.toLowerCase()) ) { filter.push( item ); } } ); this.datasource = filter; } + getItemText(item) { + if (this.typeOfData === 'simple') { + return item; + } + return item[ this.keyText ]; + } + onKeyDown( $event ) { this.handleSelectInLetter( $event.key ); const keyEvent = { - [KeyEvent.SPACE]: () => this.handleKeySpace( $event ), + [KeyEvent.SPACE]: () => this.handleOpenList( $event ), [KeyEvent.ARROWDOWN]: () => this.stopEvent( $event ), [KeyEvent.ARROWUP]: () => this.stopEvent( $event ), }; @@ -178,10 +185,11 @@ export class TlDropDownList extends ElementBase implements OnInit, OnCha return this.modelMode === 'string'; } - private handleKeySpace( $event ) { + private handleOpenList( $event ) { this.stopEvent( $event ); - if ( !this.isOpen ) { + if ( !this.isOpen && !this.disabled ) { this.isOpen = true; + this.setUpComponent(); } } @@ -193,8 +201,9 @@ export class TlDropDownList extends ElementBase implements OnInit, OnCha private setUpComponent() { this.datasource = this.data; - this.disabled = false; - this.isLoading = false; + if (this.data.length > 0) { + this.isLoading = false; + } } private validateData() { From f006b4b085c92a2f650f0b75b91f90a50be3a115 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 09:52:15 -0300 Subject: [PATCH 002/111] refact(list-item): add css text properties to no wrap --- .../src/components/overlaylist/list-item/list-item.scss | 3 +++ .../src/components/overlaylist/list-item/list-item.ts | 8 +++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/projects/truly-ui/src/components/overlaylist/list-item/list-item.scss b/projects/truly-ui/src/components/overlaylist/list-item/list-item.scss index f01652cab..a4ed4ff7f 100644 --- a/projects/truly-ui/src/components/overlaylist/list-item/list-item.scss +++ b/projects/truly-ui/src/components/overlaylist/list-item/list-item.scss @@ -1,5 +1,8 @@ .ui-list-item { padding: 0 5px; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; &:focus { outline: none; } diff --git a/projects/truly-ui/src/components/overlaylist/list-item/list-item.ts b/projects/truly-ui/src/components/overlaylist/list-item/list-item.ts index 0ac7df513..07c021259 100644 --- a/projects/truly-ui/src/components/overlaylist/list-item/list-item.ts +++ b/projects/truly-ui/src/components/overlaylist/list-item/list-item.ts @@ -19,7 +19,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -import { Component, Input, ElementRef, ViewChild, Output, EventEmitter } from '@angular/core'; +import { Component, Input, ElementRef, ViewChild } from '@angular/core'; import { Highlightable } from '@angular/cdk/a11y'; @Component( { @@ -29,16 +29,14 @@ import { Highlightable } from '@angular/cdk/a11y'; } ) export class TlListItem implements Highlightable { - constructor() {} - - public selected = false; - @Input() item; @Input() disabled = false; @Input() height = '30px'; + public selected = false; + @ViewChild('listElement') element: ElementRef; setActiveStyles(): void { From 2b888cbd5f0fa36034c156850849e479d8d7efc6 Mon Sep 17 00:00:00 2001 From: Genesson Date: Wed, 27 Feb 2019 09:56:02 -0300 Subject: [PATCH 003/111] fix(avatar): add height on gratavar --- projects/truly-ui/src/components/avatar/avatar.html | 2 +- projects/truly-ui/src/components/avatar/avatar.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/truly-ui/src/components/avatar/avatar.html b/projects/truly-ui/src/components/avatar/avatar.html index 85719baaf..4c207af31 100644 --- a/projects/truly-ui/src/components/avatar/avatar.html +++ b/projects/truly-ui/src/components/avatar/avatar.html @@ -10,7 +10,7 @@
- +
Date: Wed, 27 Feb 2019 09:58:41 -0300 Subject: [PATCH 004/111] fix(multiselect): add multiselect model listen changes. --- .../src/components/multiselect/multiselect.ts | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/projects/truly-ui/src/components/multiselect/multiselect.ts b/projects/truly-ui/src/components/multiselect/multiselect.ts index d965312fc..68e962917 100644 --- a/projects/truly-ui/src/components/multiselect/multiselect.ts +++ b/projects/truly-ui/src/components/multiselect/multiselect.ts @@ -26,11 +26,11 @@ import { OnInit, Output, ViewChild, - ContentChild, AfterViewInit, ChangeDetectorRef, + ContentChild, AfterViewInit, ChangeDetectorRef, OnDestroy, } from '@angular/core'; import { KeyEvent } from '../core/enums/key-events'; import { MakeProvider } from '../core/base/value-accessor-provider'; -import { FormControlName, NG_ASYNC_VALIDATORS, NG_VALIDATORS, NgModel } from '@angular/forms'; +import { FormControl, FormControlName, NG_ASYNC_VALIDATORS, NG_VALIDATORS, NgModel } from '@angular/forms'; import { ValueAccessorBase } from '../input/core/value-accessor'; import { OverlayAnimation } from '../core/directives/overlay-animation'; import { Subject, Subscription } from 'rxjs'; @@ -48,7 +48,7 @@ import { scrollIntoView } from '../core/helper/scrollIntoView'; [ MakeProvider( TlMultiSelect ) ] ] } ) -export class TlMultiSelect extends ValueAccessorBase implements OnInit, AfterViewInit { +export class TlMultiSelect extends ValueAccessorBase implements OnInit, AfterViewInit, OnDestroy { @Input() keyColor: string; @@ -134,6 +134,8 @@ export class TlMultiSelect extends ValueAccessorBase implements OnInit, Aft private subscription: Subscription = new Subscription(); + private control; + constructor( private change: ChangeDetectorRef ) { super(); } @@ -148,10 +150,17 @@ export class TlMultiSelect extends ValueAccessorBase implements OnInit, Aft } ngAfterViewInit() { - this.validateHasModel(); + this.setControl(); this.setRequired(); this.setDisabled(); this.handleValidator(); + this.listenControlChanges(); + } + + private listenControlChanges() { + this.subscription.add(this.control.valueChanges.subscribe(() => { + this.validateHasModel(); + })); } private setDisabled() { @@ -185,6 +194,10 @@ export class TlMultiSelect extends ValueAccessorBase implements OnInit, Aft } } + private setControl() { + this.control = this.model ? this.model : this.controlName; + } + private validateHasModel() { setTimeout( () => { if ( this.value ) { @@ -556,5 +569,9 @@ export class TlMultiSelect extends ValueAccessorBase implements OnInit, Aft return this.filteredItems.length === this.dataSource.length; } + ngOnDestroy() { + this.subscription.unsubscribe(); + } + } From d37da0bf49a4551b08063cc88e8de53e11178805 Mon Sep 17 00:00:00 2001 From: Maicon Wagner Date: Wed, 27 Feb 2019 10:06:04 -0300 Subject: [PATCH 005/111] ci: create ci to compile to @dev --- .travis.yml | 5 +- package-lock.json | 217 +++++++++++++++++----------- package.json | 2 + tools/scripts/publish-dev-builds.js | 22 +++ tools/scripts/utils.js | 31 ++++ 5 files changed, 191 insertions(+), 86 deletions(-) create mode 100644 tools/scripts/publish-dev-builds.js create mode 100644 tools/scripts/utils.js diff --git a/.travis.yml b/.travis.yml index a40700d81..4b16d9720 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,9 +20,10 @@ before_script: - npm run test script: - npm run build:library + - npm run copy:assets + - npm run copy:marckdowns after_success: - - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run copy:assets; fi - - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run copy:marckdowns; fi + - if [[ "$TRAVIS_BRANCH" == "develop" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then publish:dev; fi - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run semantic-release; fi - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run build:showcase; fi deploy: diff --git a/package-lock.json b/package-lock.json index 2deccb760..1e8d7742a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -208,6 +208,12 @@ "uuid": "^3.1.0" } }, + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "dev": true + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -237,6 +243,14 @@ "@angular-devkit/core": "7.0.6", "rxjs": "6.3.3", "semver": "5.5.1" + }, + "dependencies": { + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "dev": true + } } }, "@angular-devkit/build-optimizer": { @@ -446,6 +460,12 @@ "signal-exit": "^3.0.2" } }, + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", @@ -685,7 +705,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -1051,6 +1071,14 @@ "rxjs": "6.3.3", "semver": "5.5.1", "semver-intersect": "1.4.0" + }, + "dependencies": { + "semver": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", + "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "dev": true + } } }, "@semantic-release/commit-analyzer": { @@ -1137,7 +1165,7 @@ }, "globby": { "version": "8.0.1", - "resolved": "http://registry.npmjs.org/globby/-/globby-8.0.1.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.1.tgz", "integrity": "sha512-oMrYrJERnKBLXNLVTqhm3vPEdJ/b2ZE28xN4YARiix1NOIOBPEpOUnm844K1iu/BkphCaf2WNFwMszv8Soi1pw==", "dev": true, "requires": { @@ -1343,7 +1371,7 @@ }, "@types/q": { "version": "0.0.32", - "resolved": "http://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", + "resolved": "https://registry.npmjs.org/@types/q/-/q-0.0.32.tgz", "integrity": "sha1-vShOV8hPEyXacCur/IKlMoGQwMU=", "dev": true }, @@ -1683,6 +1711,7 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, + "optional": true, "requires": { "kind-of": "^3.0.2", "longest": "^1.0.1", @@ -1881,7 +1910,7 @@ }, "array-equal": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=", "dev": true }, @@ -2072,7 +2101,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -2165,7 +2194,7 @@ }, "babel-plugin-istanbul": { "version": "4.1.6", - "resolved": "http://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz", "integrity": "sha512-PWP9FQ1AhZhS01T/4qLSKoHGY/xvkZdVBGlKM/HuxxS3+sC66HhTNR7+MpbO/so/cz/wY94MeSWJuP1hXIPfwQ==", "dev": true, "requires": { @@ -2183,7 +2212,7 @@ }, "babel-plugin-syntax-object-rest-spread": { "version": "6.13.0", - "resolved": "http://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", "dev": true }, @@ -2380,7 +2409,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -2563,7 +2592,7 @@ }, "browserify-aes": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -2608,7 +2637,7 @@ }, "browserify-rsa": { "version": "4.0.1", - "resolved": "http://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { @@ -2677,7 +2706,7 @@ }, "buffer": { "version": "4.9.1", - "resolved": "http://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", "dev": true, "requires": { @@ -2752,7 +2781,7 @@ }, "cacache": { "version": "10.0.4", - "resolved": "http://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", "dev": true, "requires": { @@ -2820,7 +2849,7 @@ }, "callsites": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", "dev": true }, @@ -2842,7 +2871,7 @@ }, "camelcase-keys": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { @@ -3130,7 +3159,7 @@ "dependencies": { "colors": { "version": "1.0.3", - "resolved": "http://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz", "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=", "dev": true } @@ -3522,7 +3551,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -3672,7 +3701,7 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -3848,7 +3877,7 @@ }, "create-hash": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -3861,7 +3890,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "http://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -4245,7 +4274,7 @@ }, "diffie-hellman": { "version": "5.0.3", - "resolved": "http://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { @@ -4553,7 +4582,7 @@ }, "es6-promisify": { "version": "5.0.0", - "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, "requires": { @@ -4680,7 +4709,7 @@ }, "events": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/events/-/events-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=", "dev": true }, @@ -5461,7 +5490,7 @@ }, "finalhandler": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz", "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==", "dev": true, "requires": { @@ -5971,7 +6000,8 @@ }, "ansi-regex": { "version": "2.1.1", - "bundled": true + "bundled": true, + "optional": true }, "aproba": { "version": "1.2.0", @@ -5989,11 +6019,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -6006,15 +6038,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -6117,7 +6152,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -6127,6 +6163,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -6139,17 +6176,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -6166,6 +6206,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -6238,7 +6279,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -6248,6 +6290,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -6323,7 +6366,8 @@ }, "safe-buffer": { "version": "5.1.1", - "bundled": true + "bundled": true, + "optional": true }, "safer-buffer": { "version": "2.1.2", @@ -6353,6 +6397,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -6370,6 +6415,7 @@ "strip-ansi": { "version": "3.0.1", "bundled": true, + "optional": true, "requires": { "ansi-regex": "^2.0.0" } @@ -6408,11 +6454,13 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "bundled": true, + "optional": true }, "yallist": { "version": "3.0.2", - "bundled": true + "bundled": true, + "optional": true } } }, @@ -6473,7 +6521,7 @@ }, "get-stream": { "version": "3.0.0", - "resolved": "http://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", "dev": true }, @@ -6830,7 +6878,7 @@ }, "got": { "version": "6.7.1", - "resolved": "http://registry.npmjs.org/got/-/got-6.7.1.tgz", + "resolved": "https://registry.npmjs.org/got/-/got-6.7.1.tgz", "integrity": "sha1-JAzQV4WpoY5WHcG0S0HHY+8ejbA=", "dev": true, "requires": { @@ -7046,7 +7094,7 @@ }, "handle-thing": { "version": "1.2.5", - "resolved": "http://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", + "resolved": "https://registry.npmjs.org/handle-thing/-/handle-thing-1.2.5.tgz", "integrity": "sha1-/Xqtcmvxpf0W38KbL3pmAdJxOcQ=", "dev": true }, @@ -7375,7 +7423,7 @@ }, "http-errors": { "version": "1.6.3", - "resolved": "http://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "dev": true, "requires": { @@ -7425,7 +7473,7 @@ }, "http-proxy-middleware": { "version": "0.18.0", - "resolved": "http://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-0.18.0.tgz", "integrity": "sha512-Fs25KVMPAIIcgjMZkVHJoKg9VcXcC1C8yb9JUgeDvVXY0S/zgVIhMb+qVswDIgtJe2DfckMSY2d6TuTEutlk6Q==", "dev": true, "requires": { @@ -7892,7 +7940,7 @@ }, "is-builtin-module": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { @@ -8056,7 +8104,7 @@ }, "is-obj": { "version": "1.0.1", - "resolved": "http://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, @@ -9022,7 +9070,7 @@ }, "jest-get-type": { "version": "22.4.3", - "resolved": "http://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-22.4.3.tgz", "integrity": "sha512-/jsz0Y+V29w1chdXVygEKSz2nBoHoYqNShPe+QgxSNjAuP1i8+k4LbQNrfoliKej0P45sivkSCh7yiD6ubHS3w==", "dev": true }, @@ -9814,7 +9862,7 @@ }, "json5": { "version": "0.5.1", - "resolved": "http://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, @@ -9860,13 +9908,13 @@ "dependencies": { "core-js": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=", "dev": true }, "es6-promise": { "version": "3.0.2", - "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=", "dev": true }, @@ -9878,7 +9926,7 @@ }, "readable-stream": { "version": "2.0.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", "integrity": "sha1-j5A0HmilPMySh4jaz80Rs265t44=", "dev": true, "requires": { @@ -10088,7 +10136,7 @@ }, "load-json-file": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { @@ -10101,7 +10149,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -10364,7 +10412,8 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true + "dev": true, + "optional": true }, "loose-envify": { "version": "1.4.0", @@ -10572,7 +10621,7 @@ }, "media-typer": { "version": "0.3.0", - "resolved": "http://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", "dev": true }, @@ -10599,7 +10648,7 @@ }, "meow": { "version": "3.7.0", - "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { @@ -10617,7 +10666,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -11208,7 +11257,7 @@ "dependencies": { "semver": { "version": "5.3.0", - "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", "dev": true } @@ -11475,7 +11524,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -14929,7 +14978,7 @@ }, "opn": { "version": "5.3.0", - "resolved": "http://registry.npmjs.org/opn/-/opn-5.3.0.tgz", + "resolved": "https://registry.npmjs.org/opn/-/opn-5.3.0.tgz", "integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==", "dev": true, "requires": { @@ -15028,7 +15077,7 @@ }, "os-locale": { "version": "1.4.0", - "resolved": "http://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "dev": true, "requires": { @@ -15090,7 +15139,7 @@ }, "p-is-promise": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-1.1.0.tgz", "integrity": "sha1-nJRWmJ6fZYgBewQ01WCXZ1w9oF4=", "dev": true }, @@ -15187,7 +15236,7 @@ }, "parse-asn1": { "version": "5.1.1", - "resolved": "http://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "dev": true, "requires": { @@ -15839,7 +15888,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { @@ -15867,7 +15916,7 @@ }, "globby": { "version": "5.0.0", - "resolved": "http://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", "dev": true, "requires": { @@ -15881,13 +15930,13 @@ }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true }, @@ -16122,7 +16171,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -16139,7 +16188,7 @@ "dependencies": { "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -16169,7 +16218,7 @@ }, "pify": { "version": "2.3.0", - "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "dev": true } @@ -16586,13 +16635,13 @@ }, "regjsgen": { "version": "0.2.0", - "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", "dev": true }, "regjsparser": { "version": "0.1.5", - "resolved": "http://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "dev": true, "requires": { @@ -17062,7 +17111,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -17132,7 +17181,7 @@ "dependencies": { "source-map": { "version": "0.4.4", - "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { @@ -17530,9 +17579,9 @@ } }, "semver": { - "version": "5.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.1.tgz", - "integrity": "sha512-PqpAxfrEhlSUWge8dwIp4tZnQ25DIOthpiaHNIthsjEFQD6EvqUKUDM7L8O2rShkFccYo1VjJR0coWfNkCubRw==", + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, "semver-diff": { @@ -17695,7 +17744,7 @@ }, "sha.js": { "version": "2.4.11", - "resolved": "http://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -18330,7 +18379,7 @@ }, "stream-browserify": { "version": "2.0.1", - "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "dev": true, "requires": { @@ -18390,7 +18439,7 @@ "dependencies": { "readable-stream": { "version": "2.3.6", - "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { @@ -18491,7 +18540,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, @@ -18562,7 +18611,7 @@ }, "source-map": { "version": "0.1.43", - "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", "dev": true, "requires": { @@ -18621,7 +18670,7 @@ }, "tar": { "version": "2.2.1", - "resolved": "http://registry.npmjs.org/tar/-/tar-2.2.1.tgz", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", "dev": true, "requires": { @@ -19185,7 +19234,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -19204,7 +19253,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true }, @@ -19965,7 +20014,7 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", "dev": true } @@ -20074,7 +20123,7 @@ }, "source-map": { "version": "0.4.4", - "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { @@ -20572,7 +20621,7 @@ }, "wrap-ansi": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { @@ -20638,7 +20687,7 @@ }, "xmlbuilder": { "version": "9.0.7", - "resolved": "http://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=", "dev": true }, diff --git a/package.json b/package.json index 6af97f026..bfce156b6 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "ci": "npm run lint && npm run test && npm run build:library && npm run build:showcase && npm run copy:marckdowns && npm run copy:assets", "copy:assets": "node ./tools/scripts/copy-assets.js", "copy:marckdowns": "node ./tools/scripts/copy-marckdowns-assets.js", + "publish:dev": "node ./tools/scripts/publish-dev-builds.js", "semantic-release": "semantic-release" }, "private": false, @@ -103,6 +104,7 @@ "protractor": "~5.4.1", "rimraf": "^2.6.2", "semantic-release": "^15.12.1", + "semver": "^5.6.0", "ts-node": "^7.0.1", "tsickle": "^0.34.0", "tslib": "^1.9.3", diff --git a/tools/scripts/publish-dev-builds.js b/tools/scripts/publish-dev-builds.js new file mode 100644 index 000000000..026cecdfe --- /dev/null +++ b/tools/scripts/publish-dev-builds.js @@ -0,0 +1,22 @@ +const { parse } = require('semver'); +const { execute, publishPackagesToNpm } = require('./utils'); + +async function main() { + const json = require('../../dist/package.json'); + let commit = process.env.TRAVIS_PULL_REQUEST_SHA; + if (!commit) { + const lastCommit = await execute('git rev-parse HEAD'); + commit = lastCommit.toString().trim(); + } + + // shorten commit + commit = commit.slice(0, 7); + + const version = parse(json.version); + const newVersion = `${version.major}.${version.minor}.${version.patch}-dev-develop-${commit}`; + console.log('publishing new version', newVersion); + + await publishPackagesToNpm(newVersion, 'dev'); +} + +main(); diff --git a/tools/scripts/utils.js b/tools/scripts/utils.js new file mode 100644 index 000000000..40b23f5be --- /dev/null +++ b/tools/scripts/utils.js @@ -0,0 +1,31 @@ +const { exec } = require('child_process'); +const { resolve } = require('path'); + +module.exports = { + execute: (script, options)=> { + console.log( script ); + return new Promise((resolvePromise, rejectPromise) => { + exec(script, options, (error, stdout, stderr) => { + if (error) { + rejectPromise({ error, stderr }); + } else { + resolvePromise(stdout); + } + }); + }); + }, + + publishPackagesToNpm: async (version, tag) => { + const buildPath = resolve(__dirname, '../../dist/'); + const packageDescription = `${buildPath} ${version} @${tag}`; + const script = `npm publish --access public --non-interactive --no-git-tag-version --new-version ${version} --tag ${tag}`; + + await module.exports.execute(script, { cwd: buildPath }) + .then(( output )=>{ + console.log(`Published ${packageDescription} /r/n -> ${output}`); + }).catch(({ error })=>{ + console.log(`Error Publishing ${packageDescription} /r/n -> ${error}`); + throw error; + }); + } +}; From d48218300082bd4251f593eb9fcb91d47384a5d7 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 10:13:36 -0300 Subject: [PATCH 006/111] fix(overlay-list): fix focus bug of some components that use overlaylist. --- projects/truly-ui/src/components/overlaylist/overlay-list.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/truly-ui/src/components/overlaylist/overlay-list.ts b/projects/truly-ui/src/components/overlaylist/overlay-list.ts index d243a6e25..09523af72 100644 --- a/projects/truly-ui/src/components/overlaylist/overlay-list.ts +++ b/projects/truly-ui/src/components/overlaylist/overlay-list.ts @@ -120,7 +120,7 @@ export class TlOverlayList implements OnInit, AfterViewInit, OnChanges { } handleInputFocus() { - if (this.searchOnList) { + if (this.searchOnList && !this.customFocus) { setTimeout(() => { this.tlInput.setFocus(); }, 1); From 1140179ae960b0b602f5887cb6e60aef06567e2a Mon Sep 17 00:00:00 2001 From: Maicon Wagner Date: Wed, 27 Feb 2019 10:15:14 -0300 Subject: [PATCH 007/111] ci: fix error publish:dev: command not found --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4b16d9720..8d0e2118c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ script: - npm run copy:assets - npm run copy:marckdowns after_success: - - if [[ "$TRAVIS_BRANCH" == "develop" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then publish:dev; fi + - if [[ "$TRAVIS_BRANCH" == "develop" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run publish:dev; fi - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run semantic-release; fi - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run build:showcase; fi deploy: From c2174dca268397963e4f25555ee343d573ac0d80 Mon Sep 17 00:00:00 2001 From: Genesson Date: Wed, 27 Feb 2019 10:45:19 -0300 Subject: [PATCH 008/111] fix(avatar): change element height --- projects/truly-ui/src/components/avatar/avatar.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/truly-ui/src/components/avatar/avatar.html b/projects/truly-ui/src/components/avatar/avatar.html index 4c207af31..8ab04825c 100644 --- a/projects/truly-ui/src/components/avatar/avatar.html +++ b/projects/truly-ui/src/components/avatar/avatar.html @@ -9,8 +9,9 @@
- + [style.width]="size" + [style.height]="!isPercentage() ? size : null"> +
Date: Wed, 27 Feb 2019 11:18:28 -0300 Subject: [PATCH 009/111] ci: fix ci npm ERR! code E404 npm ERR! 404 Not Found: 0.0.0-dev-develop-dc06503@latest #2 --- tools/scripts/publish-dev-builds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/publish-dev-builds.js b/tools/scripts/publish-dev-builds.js index 026cecdfe..45a6a135b 100644 --- a/tools/scripts/publish-dev-builds.js +++ b/tools/scripts/publish-dev-builds.js @@ -13,7 +13,7 @@ async function main() { commit = commit.slice(0, 7); const version = parse(json.version); - const newVersion = `${version.major}.${version.minor}.${version.patch}-dev-develop-${commit}`; + const newVersion = `${version.major}.${version.minor}.${version.patch}-development-develop-${commit}`; console.log('publishing new version', newVersion); await publishPackagesToNpm(newVersion, 'dev'); From 3b59745dc9cb027752c135bb957a80b229209cfe Mon Sep 17 00:00:00 2001 From: Maicon Wagner Date: Wed, 27 Feb 2019 11:41:06 -0300 Subject: [PATCH 010/111] ci: fix ci npm ERR! code E404 npm ERR! 404 Not Found: 0.0.0-dev-develop-dc06503@latest #3 --- tools/scripts/publish-dev-builds.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/scripts/publish-dev-builds.js b/tools/scripts/publish-dev-builds.js index 45a6a135b..dd75426ac 100644 --- a/tools/scripts/publish-dev-builds.js +++ b/tools/scripts/publish-dev-builds.js @@ -13,7 +13,7 @@ async function main() { commit = commit.slice(0, 7); const version = parse(json.version); - const newVersion = `${version.major}.${version.minor}.${version.patch}-development-develop-${commit}`; + const newVersion = `${version.major}.${version.minor}.${version.patch}-development.develop-${commit}`; console.log('publishing new version', newVersion); await publishPackagesToNpm(newVersion, 'dev'); From 1b0bb90ed6f862e3ce40bf9947450684cfb2858f Mon Sep 17 00:00:00 2001 From: Maicon Wagner Date: Wed, 27 Feb 2019 14:07:31 -0300 Subject: [PATCH 011/111] ci: fix ci npm ERR! code E404 npm ERR! 404 Not Found: 0.0.0-dev-develop-dc06503@latest #4 --- tools/scripts/publish-dev-builds.js | 9 +++++---- tools/scripts/utils.js | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/scripts/publish-dev-builds.js b/tools/scripts/publish-dev-builds.js index dd75426ac..d840122b9 100644 --- a/tools/scripts/publish-dev-builds.js +++ b/tools/scripts/publish-dev-builds.js @@ -12,11 +12,12 @@ async function main() { // shorten commit commit = commit.slice(0, 7); - const version = parse(json.version); - const newVersion = `${version.major}.${version.minor}.${version.patch}-development.develop-${commit}`; - console.log('publishing new version', newVersion); + await execute(`npm view ${json.name} version`).then( async ( version )=> { + const newVersion = (version + '-develop-' + commit); + console.log('publishing new version', newVersion); + await publishPackagesToNpm(newVersion, 'dev'); + }); - await publishPackagesToNpm(newVersion, 'dev'); } main(); diff --git a/tools/scripts/utils.js b/tools/scripts/utils.js index 40b23f5be..4d3ce15c4 100644 --- a/tools/scripts/utils.js +++ b/tools/scripts/utils.js @@ -18,7 +18,7 @@ module.exports = { publishPackagesToNpm: async (version, tag) => { const buildPath = resolve(__dirname, '../../dist/'); const packageDescription = `${buildPath} ${version} @${tag}`; - const script = `npm publish --access public --non-interactive --no-git-tag-version --new-version ${version} --tag ${tag}`; + const script = `npm publish --access public --tag ${tag}`; await module.exports.execute(script, { cwd: buildPath }) .then(( output )=>{ From 89fdaeb5dede5ac6b6fe35b6b33c6f13aebe24f1 Mon Sep 17 00:00:00 2001 From: Maicon Wagner Date: Wed, 27 Feb 2019 14:32:07 -0300 Subject: [PATCH 012/111] ci: fix ci npm ERR! code E404 npm ERR! 404 Not Found: 0.0.0-dev-develop-dc06503@latest #5 --- tools/scripts/publish-dev-builds.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/scripts/publish-dev-builds.js b/tools/scripts/publish-dev-builds.js index d840122b9..30a767ac7 100644 --- a/tools/scripts/publish-dev-builds.js +++ b/tools/scripts/publish-dev-builds.js @@ -1,8 +1,10 @@ const { parse } = require('semver'); const { execute, publishPackagesToNpm } = require('./utils'); +const { resolve } = require('path'); async function main() { const json = require('../../dist/package.json'); + const buildPath = resolve(__dirname, '../../dist/'); let commit = process.env.TRAVIS_PULL_REQUEST_SHA; if (!commit) { const lastCommit = await execute('git rev-parse HEAD'); @@ -12,10 +14,13 @@ async function main() { // shorten commit commit = commit.slice(0, 7); - await execute(`npm view ${json.name} version`).then( async ( version )=> { - const newVersion = (version + '-develop-' + commit); - console.log('publishing new version', newVersion); - await publishPackagesToNpm(newVersion, 'dev'); + await execute(`npm view ${json.name} version`).then( async ( version ) => { + console.log( buildPath); + await execute(`npm version ${version}`, { cwd: buildPath }).then( async () => { + const newVersion = (version + '-develop-' + commit); + console.log('publishing new version', newVersion); + await publishPackagesToNpm(newVersion, 'dev'); + }); }); } From 40d6dc98404320dd885fc30b4d858e048fe055c1 Mon Sep 17 00:00:00 2001 From: Maicon Wagner Date: Wed, 27 Feb 2019 15:07:16 -0300 Subject: [PATCH 013/111] ci: fix ci npm ERR! code E404 npm ERR! 404 Not Found: 0.0.0-dev-develop-dc06503@latest #6 --- .travis.yml | 9 +++++++++ tools/scripts/publish-dev-builds.js | 8 +++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d0e2118c..941f06584 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,6 +26,8 @@ after_success: - if [[ "$TRAVIS_BRANCH" == "develop" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run publish:dev; fi - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run semantic-release; fi - if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run build:showcase; fi +before_deploy: + - if [[ "$TRAVIS_BRANCH" == "develop" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then cd dist; fi deploy: - provider: s3 local_dir: showcase @@ -35,6 +37,13 @@ deploy: bucket: "truly-ui.com" region: us-east-1 acl: public_read + - provider: npm + skip_cleanup: true + email: "truly@temainfo.com.br" + api_key: $NPM_TOKEN + tag: dev + on: + branch: develop branches: except: - /^v\d+\.\d+\.\d+$/ diff --git a/tools/scripts/publish-dev-builds.js b/tools/scripts/publish-dev-builds.js index 30a767ac7..0e381fcdc 100644 --- a/tools/scripts/publish-dev-builds.js +++ b/tools/scripts/publish-dev-builds.js @@ -15,11 +15,9 @@ async function main() { commit = commit.slice(0, 7); await execute(`npm view ${json.name} version`).then( async ( version ) => { - console.log( buildPath); - await execute(`npm version ${version}`, { cwd: buildPath }).then( async () => { - const newVersion = (version + '-develop-' + commit); - console.log('publishing new version', newVersion); - await publishPackagesToNpm(newVersion, 'dev'); + const newVersion = (version.replace(/\n|\r/g, "") + '-dev-' + commit); + await execute(`npm version ${newVersion}`, { cwd: buildPath }).then( async () => { + console.log('Publishing new version', newVersion); }); }); From 4b038622120fa53a52334be0543b98818f1e5313 Mon Sep 17 00:00:00 2001 From: Maicon Wagner Date: Wed, 27 Feb 2019 15:28:38 -0300 Subject: [PATCH 014/111] cI: remove codes Not used --- tools/scripts/publish-dev-builds.js | 3 +-- tools/scripts/utils.js | 15 --------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/tools/scripts/publish-dev-builds.js b/tools/scripts/publish-dev-builds.js index 0e381fcdc..066855305 100644 --- a/tools/scripts/publish-dev-builds.js +++ b/tools/scripts/publish-dev-builds.js @@ -1,5 +1,4 @@ -const { parse } = require('semver'); -const { execute, publishPackagesToNpm } = require('./utils'); +const { execute } = require('./utils'); const { resolve } = require('path'); async function main() { diff --git a/tools/scripts/utils.js b/tools/scripts/utils.js index 4d3ce15c4..01292c56b 100644 --- a/tools/scripts/utils.js +++ b/tools/scripts/utils.js @@ -1,5 +1,4 @@ const { exec } = require('child_process'); -const { resolve } = require('path'); module.exports = { execute: (script, options)=> { @@ -14,18 +13,4 @@ module.exports = { }); }); }, - - publishPackagesToNpm: async (version, tag) => { - const buildPath = resolve(__dirname, '../../dist/'); - const packageDescription = `${buildPath} ${version} @${tag}`; - const script = `npm publish --access public --tag ${tag}`; - - await module.exports.execute(script, { cwd: buildPath }) - .then(( output )=>{ - console.log(`Published ${packageDescription} /r/n -> ${output}`); - }).catch(({ error })=>{ - console.log(`Error Publishing ${packageDescription} /r/n -> ${error}`); - throw error; - }); - } }; From ec1eb6cc84620043ce562c7893d59e76e4c8328d Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 15:38:52 -0300 Subject: [PATCH 015/111] refact(dropdownlist): change method to public --- projects/truly-ui/src/components/dropdownlist/dropdownlist.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts b/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts index 267b494b1..be1bc9a0f 100644 --- a/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts +++ b/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts @@ -185,7 +185,7 @@ export class TlDropDownList extends ElementBase implements OnInit, OnCha return this.modelMode === 'string'; } - private handleOpenList( $event ) { + public handleOpenList( $event ) { this.stopEvent( $event ); if ( !this.isOpen && !this.disabled ) { this.isOpen = true; From 4736bd28a94cffc442c75463580276601353c706 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 15:42:40 -0300 Subject: [PATCH 016/111] fix(listbox): fix listbox does not removing content after data changes. --- projects/truly-ui/src/components/listbox/listbox.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/truly-ui/src/components/listbox/listbox.ts b/projects/truly-ui/src/components/listbox/listbox.ts index 5ddf08ed3..77ac7e948 100644 --- a/projects/truly-ui/src/components/listbox/listbox.ts +++ b/projects/truly-ui/src/components/listbox/listbox.ts @@ -186,6 +186,7 @@ export class TlListBox extends ListBase implements AfterViewInit, OnDestroy, OnC } else { this.loading = false; this.nothingFound = true; + this.dataSource.dataStream.next([]); } } From 28570ae46c261acdd2b9caeea60b6190c6dbd363 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 15:43:47 -0300 Subject: [PATCH 017/111] fix(autocomplete): fix lazy load after searching on list. --- .../components/autocomplete/autocomplete.ts | 348 +++++++++--------- .../core/classes/datasource-list.ts | 9 +- 2 files changed, 190 insertions(+), 167 deletions(-) diff --git a/projects/truly-ui/src/components/autocomplete/autocomplete.ts b/projects/truly-ui/src/components/autocomplete/autocomplete.ts index 5b905e4e9..cf5ebc6a8 100644 --- a/projects/truly-ui/src/components/autocomplete/autocomplete.ts +++ b/projects/truly-ui/src/components/autocomplete/autocomplete.ts @@ -21,33 +21,34 @@ */ import { Component, Input, Optional, Inject, OnInit, OnChanges, ViewChildren, - EventEmitter, Output, ChangeDetectorRef, QueryList, AfterViewInit, ViewChild, ElementRef, + EventEmitter, Output, ChangeDetectorRef, QueryList, AfterViewInit, ViewChild, ElementRef, OnDestroy, } from '@angular/core'; -import {FormControl} from '@angular/forms'; - -import {MakeProvider} from '../core/base/value-accessor-provider'; -import {ElementBase} from '../input/core/element-base'; -import {NG_ASYNC_VALIDATORS, NG_VALIDATORS, NgModel} from '@angular/forms'; -import {ConnectedOverlayPositionChange} from '@angular/cdk/overlay'; -import {ActiveDescendantKeyManager} from '@angular/cdk/a11y'; -import {CdkVirtualScrollViewport} from '@angular/cdk/scrolling'; -import {I18nService} from '../i18n/i18n.service'; -import {AUTOCOMPLETE_CONFIG, AutoCompleteConfig} from './interfaces/autocomplete.config'; -import {DataSourceList} from '../core/classes/datasource-list'; -import {TlItemSelectedDirective} from '../core/directives/itemSelected/item-selected.directive'; -import {scrollIntoView} from '../core/helper/scrollIntoView'; -import {SelectedItemService} from './services/selected-item.service'; - -@Component({ +import { FormControl } from '@angular/forms'; + +import { MakeProvider } from '../core/base/value-accessor-provider'; +import { ElementBase } from '../input/core/element-base'; +import { NG_ASYNC_VALIDATORS, NG_VALIDATORS, NgModel } from '@angular/forms'; +import { ConnectedOverlayPositionChange } from '@angular/cdk/overlay'; +import { ActiveDescendantKeyManager } from '@angular/cdk/a11y'; +import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; +import { I18nService } from '../i18n/i18n.service'; +import { AUTOCOMPLETE_CONFIG, AutoCompleteConfig } from './interfaces/autocomplete.config'; +import { DataSourceList } from '../core/classes/datasource-list'; +import { TlItemSelectedDirective } from '../core/directives/itemSelected/item-selected.directive'; +import { scrollIntoView } from '../core/helper/scrollIntoView'; +import { SelectedItemService } from './services/selected-item.service'; +import { Subscription } from 'rxjs'; + +@Component( { selector: 'tl-autocomplete', templateUrl: './autocomplete.html', - styleUrls: ['./autocomplete.scss'], - providers: [MakeProvider(TlAutoComplete), SelectedItemService], -}) -export class TlAutoComplete extends ElementBase implements OnInit, OnChanges, AfterViewInit { + styleUrls: [ './autocomplete.scss' ], + providers: [ MakeProvider( TlAutoComplete ), SelectedItemService ], +} ) +export class TlAutoComplete extends ElementBase implements OnInit, OnChanges, OnDestroy, AfterViewInit { - @Input('data') - set data(value) { + @Input( 'data' ) + set data( value ) { this._data = value; } @@ -95,13 +96,13 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha @Output() filter: EventEmitter = new EventEmitter(); - @ViewChild(NgModel) model: NgModel; + @ViewChild( NgModel ) model: NgModel; - @ViewChild('input') input: ElementRef; + @ViewChild( 'input' ) input: ElementRef; - @ViewChild(CdkVirtualScrollViewport) cdkVirtualScroll: CdkVirtualScrollViewport; + @ViewChild( CdkVirtualScrollViewport ) cdkVirtualScroll: CdkVirtualScrollViewport; - @ViewChildren(TlItemSelectedDirective) listItems: QueryList; + @ViewChildren( TlItemSelectedDirective ) listItems: QueryList; public keyManager: ActiveDescendantKeyManager; @@ -115,7 +116,7 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha public nothingFound = false; - public searchControl = new FormControl(''); + public searchControl = new FormControl( '' ); public messageLoading = this.i18n.getLocale().AutoComplete.messageLoading; @@ -127,185 +128,196 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha private lastItemScrolled = 0; + private subscription: Subscription = new Subscription(); + private _data = []; - constructor(@Optional() @Inject(NG_VALIDATORS) validators: Array, - @Optional() @Inject(AUTOCOMPLETE_CONFIG) autoCompleteConfig: AutoCompleteConfig, - @Optional() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: Array, - private change: ChangeDetectorRef, private i18n: I18nService, private itemSelectedService: SelectedItemService) { - super(validators, asyncValidators); - this.setOptions(autoCompleteConfig); + constructor( @Optional() @Inject( NG_VALIDATORS ) validators: Array, + @Optional() @Inject( AUTOCOMPLETE_CONFIG ) autoCompleteConfig: AutoCompleteConfig, + @Optional() @Inject( NG_ASYNC_VALIDATORS ) asyncValidators: Array, + private change: ChangeDetectorRef, private i18n: I18nService, private itemSelectedService: SelectedItemService ) { + super( validators, asyncValidators ); + this.setOptions( autoCompleteConfig ); } ngOnInit() { } ngAfterViewInit() { - this.keyManager = new ActiveDescendantKeyManager(this.listItems); + this.keyManager = new ActiveDescendantKeyManager( this.listItems ); this.handleModel(); this.validateKeyValue(); this.change.detectChanges(); } private validateKeyValue() { - if (!this.isModelModeString() && !this.keyValue && !this.identifier) { - throw Error('The AutoComplete should have an [identifier] key property, ' + - ' because the property [keyValue] is null and the list is working on [modelMode] \'object\''); + if ( !this.isModelModeString() && !this.keyValue && !this.identifier ) { + throw Error( 'The AutoComplete should have an [identifier] key property, ' + + ' because the property [keyValue] is null and the list is working on [modelMode] \'object\'' ); } } private handleModel() { - this.model.valueChanges.subscribe(() => { - if (this.dataSource) { + this.model.valueChanges.subscribe( () => { + if ( this.dataSource ) { this.handleModelLazy(); this.handleModelCached(); } - }); + } ); } private handleItemSelected() { - if (this.itemSelectedService.itemSelected) { - this.scrollToIndex().then(value => { - setTimeout(() => { - this.keyManager.setActiveItem(this.itemSelectedService.itemSelected.indexSelected); - }, 200); - }); + if ( this.itemSelectedService.itemSelected ) { + this.scrollToIndex().then( value => { + setTimeout( () => { + this.keyManager.setActiveItem( this.itemSelectedService.itemSelected.indexSelected ); + }, 200 ); + } ); } } private scrollToIndex() { - return new Promise((resolve, reject) => { - setTimeout(() => { - this.cdkVirtualScroll.scrollToIndex(this.lastItemScrolled); + return new Promise( ( resolve, reject ) => { + setTimeout( () => { + this.cdkVirtualScroll.scrollToIndex( this.lastItemScrolled ); this.change.markForCheck(); resolve(); - }, 200); - }); + }, 200 ); + } ); } - onScrollIndexChange($event) { - if ($event > 0) { + onScrollIndexChange( $event ) { + if ( $event > 0 ) { this.lastItemScrolled = $event; } } onInput() { - this.setIsOpen(true); - this.setFiltering(true); + this.setIsOpen( true ); + this.setFiltering( true ); } onBackdropClick() { - this.setIsOpen(false); - this.setFiltering(false); + this.setIsOpen( false ); + this.setFiltering( false ); } private handleModelLazy() { - if (this.model.value && this.lazyMode && !this.modelInitialized) { - if (!this.isModelModeString()) { - this.setDescriptionValue(this.model.value[this.keyText]); + if ( this.model.value && this.lazyMode && !this.modelInitialized ) { + if ( !this.isModelModeString() ) { + this.setDescriptionValue( this.model.value[ this.keyText ] ); } else { - console.warn('The item provided is was not found, emitting filter'); - this.filter.emit(this.getFilters(this.model.value)); + console.warn( 'The item provided is was not found, emitting filter' ); + this.filter.emit( this.getFilters( this.model.value ) ); } - this.handleKeyModelValue(this.model.value); + this.handleKeyModelValue( this.model.value ); } } - private setDescriptionValue(value: string) { + private setDescriptionValue( value: string ) { this.input.nativeElement.value = value; } private handleModelCached() { - this.dataSource.getCachedData().forEach((value) => { - if (this.model.value) { - if (String(this.getItemCompare(value)) === String(this.getCompareModel())) { - this.setDescriptionValue(value[this.keyText]); - this.handleKeyModelValue(value); + this.dataSource.getCachedData().forEach( ( value ) => { + if ( this.model.value ) { + if ( String( this.getItemCompare( value ) ) === String( this.getCompareModel() ) ) { + this.setDescriptionValue( value[ this.keyText ] ); + this.handleKeyModelValue( value ); } } - }); + } ); } - private getItemCompare(value) { - if (!this.keyValue || this.isModelModeString()) { - return value[this.identifier]; + private getItemCompare( value ) { + if ( !this.keyValue || this.isModelModeString() ) { + return value[ this.identifier ]; } - return value[this.keyValue]; + return value[ this.keyValue ]; } - private handleKeyModelValue(value) { + private handleKeyModelValue( value ) { this.modelInitialized = true; - if (!this.isModelModeString() && this.keyValue) { - this.value = value[this.keyValue]; + if ( !this.isModelModeString() && this.keyValue ) { + this.value = value[ this.keyValue ]; return; } - if (this.isModelModeString() && !this.keyValue) { - this.value = value[this.identifier]; + if ( this.isModelModeString() && !this.keyValue ) { + this.value = value[ this.identifier ]; return; } - if (this.isModelModeString() && this.keyValue) { - this.value = value[this.keyValue]; + if ( this.isModelModeString() && this.keyValue ) { + this.value = value[ this.keyValue ]; return; } this.value = value; } - private setOptions(options: AutoCompleteConfig) { - if (options) { + private setOptions( options: AutoCompleteConfig ) { + if ( options ) { const self = this; - Object.keys(options).forEach(function (key) { - self[key] = options[key]; - }); + Object.keys( options ).forEach( function ( key ) { + self[ key ] = options[ key ]; + } ); } } - private setSelected(item: TlItemSelectedDirective) { - this.keyManager.setActiveItem(item); + private setSelected( item: TlItemSelectedDirective ) { + this.keyManager.setActiveItem( item ); this.itemSelectedService.itemSelected = item; } - stopEvent($event) { + stopEvent( $event ) { $event.preventDefault(); $event.stopPropagation(); } - handleKeyArrowDown($event) { - if (this.isOpen) { - this.stopEvent($event); + handleKeyArrowDown( $event ) { + this.handleEventOpenList( $event ); + if ( !this.keyManager.activeItem ) { + this.keyManager.setFirstItemActive(); + return; } - this.keyManager.onKeydown($event); - scrollIntoView(this.keyManager.activeItem.element.nativeElement); + this.keyManager.onKeydown( $event ); + scrollIntoView( this.keyManager.activeItem.element.nativeElement ); + } + handleKeyArrowUp( $event ) { + this.handleEventOpenList( $event ); + if ( !this.keyManager.activeItem ) { + this.keyManager.setFirstItemActive(); + return; + } + this.keyManager.onKeydown( $event ); + scrollIntoView( this.keyManager.activeItem.element.nativeElement ); } - handleKeyArrowUp($event) { - if (this.isOpen) { - this.stopEvent($event); + handleEventOpenList( $event ) { + if ( this.isOpen ) { + this.stopEvent( $event ); } - this.keyManager.onKeydown($event); - scrollIntoView(this.keyManager.activeItem.element.nativeElement); } - handleKeyEscape($event) { + handleKeyEscape( $event ) { $event.stopPropagation(); - this.setIsOpen(false); + this.setIsOpen( false ); } handleBlur() { - if (this.keyManager.activeItem && this.isOpen) { - this.setSelected( this.keyManager.activeItem); - this.setDescriptionValue(this.keyManager.activeItem.itemSelected[this.keyText]); - this.handleKeyModelValue(this.keyManager.activeItem.itemSelected); + if ( this.keyManager.activeItem && this.isOpen ) { + this.setSelected( this.keyManager.activeItem ); + this.setDescriptionValue( this.keyManager.activeItem.itemSelected[ this.keyText ] ); + this.handleKeyModelValue( this.keyManager.activeItem.itemSelected ); } - this.setIsOpen(false); + this.setIsOpen( false ); } handleFocus() { this.focused = true; - if (this.openFocus && !this.keyManager.activeItem) { - this.setIsOpen(true); + if ( this.openFocus && !this.keyManager.activeItem ) { + this.setIsOpen( true ); } } @@ -314,55 +326,63 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha } private getCompareModel() { - if (this.keyValue && !this.isModelModeString()) { - return this.model.value[this.keyValue]; + if ( this.keyValue && !this.isModelModeString() ) { + return this.model.value[ this.keyValue ]; } - if (!this.isModelModeString() && !this.keyValue) { - return this.model.value[this.identifier]; + if ( !this.isModelModeString() && !this.keyValue ) { + return this.model.value[ this.identifier ]; } return this.model.value; } - selectItem(value: any, item: TlItemSelectedDirective) { - this.setDescriptionValue(value[this.keyText]); - this.handleKeyModelValue(value); + selectItem( value: any, item: TlItemSelectedDirective ) { + this.setDescriptionValue( value[ this.keyText ] ); + this.handleKeyModelValue( value ); this.input.nativeElement.focus(); - this.select.emit(value); - this.setIsOpen(false); - this.setSelected(item); + this.select.emit( value ); + this.setIsOpen( false ); + this.setSelected( item ); this.change.detectChanges(); } - private setUpData(value?) { - if (!this.dataSource) { - this.dataSource = new DataSourceList({ + private setUpData( value? ) { + if ( !this.dataSource ) { + this.dataSource = new DataSourceList( { dataSource: value, pageSize: this.rowsPage, totalLength: this.totalLength, lazyMode: this.lazyMode - }); - this.dataSource.addPage(0); + } ); + this.listenLoadData(); + } + this.dataSource.setData( value ); + this.setNotFound( value.length === 0 ); + this.setFirstItemActive(); + } + + private setFirstItemActive() { + if ( this.keyManager ) { + setTimeout( () => { + this.keyManager.setFirstItemActive(); + }, 100 ); } - this.listenLoadData(); - this.setNotFound(false); - this.dataSource.setData(value); } private listenLoadData() { - if (!this.dataSource) { + if ( !this.dataSource ) { return; } - this.dataSource.loadMoreData.subscribe((data: any) => { - this.lazyLoad.emit({skip: data.skip, limit: data.limit, ...this.getFilters(this.searchControl.value)}); - }); + this.subscription.add(this.dataSource.loadMoreData.subscribe( ( data: any ) => { + this.lazyLoad.emit( { skip: data.skip, limit: data.limit, ...this.getFilters( this.searchControl.value ) } ); + } )); } - onPositionChange($event: ConnectedOverlayPositionChange) { + onPositionChange( $event: ConnectedOverlayPositionChange ) { this.positionOverlay = $event.connectionPair.originY; this.change.detectChanges(); } - private setIsOpen(value: boolean) { + private setIsOpen( value: boolean ) { this.isOpen = value; } @@ -372,61 +392,59 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha this.handleItemSelected(); } - private getFilters(term: string) { + private getFilters( term: string ) { const fields = {}; - fields[this.searchBy] = {matchMode: 'contains', value: term}; - return {fields: fields, operator: 'or'}; + fields[ this.searchBy ] = { matchMode: 'contains', value: term }; + return { fields: fields, operator: 'or' }; } private setScrollVirtual() { this.cdkVirtualScroll.elementRef.nativeElement.scrollTop = 0; } - onFilter($event) { + onFilter( $event ) { this.setScrollVirtual(); - this.setFiltering(true); - if (this.lazyMode) { - this.filter.emit(this.getFilters($event)); + this.setFiltering( true ); + this.dataSource.resetPages(); + if ( this.lazyMode ) { + this.filter.emit( this.getFilters( $event ) ); return; } - if ($event) { - this.setUpData($event); - this.dataSource.dataStream.next($event); - setTimeout(() => { - this.setSelected(this.listItems.toArray()[0]); - }, 100); + if ( $event ) { + this.dataSource.setArray( $event ); + this.setUpData( $event ); + setTimeout( () => { + this.setSelected( this.listItems.toArray()[ 0 ] ); + }, 100 ); return; } - this.dataSource.dataStream.next([]); - this.setNotFound(true); + this.dataSource.setData( $event ); + this.setNotFound( true ); } - private setFiltering(value: boolean) { + private setFiltering( value: boolean ) { this.filtering = value; } - private setNotFound(value: boolean) { + private setNotFound( value: boolean ) { this.nothingFound = value; } - ngOnChanges({data, totalLength}: any) { - if (data && !data['firstChange'] && this.lazyMode) { - this.setUpData(data['currentValue']); - this.dataSource.dataStream.next(data['currentValue']); - return; + ngOnChanges( { data, totalLength }: any ) { + if ( totalLength && !totalLength[ 'firstChange' ] ) { + this.dataSource.setArray( totalLength[ 'currentValue' ] ); } - if (data && data['currentValue']) { - this.setUpData(data['currentValue']); + if ( data && !data[ 'firstChange' ] && this.lazyMode ) { + this.setUpData( data[ 'currentValue' ] ); + return; } - if (totalLength && !totalLength['firstChange']) { - this.dataSource.setArray(totalLength['currentValue']); - } - if (this.filtering) { - this.setUpData(data['currentValue']); - this.dataSource.addPage(0); - this.dataSource.dataStream.next(data['currentValue']); - this.listenLoadData(); + if ( data && data[ 'currentValue' ] && !this.lazyMode ) { + this.setUpData( data[ 'currentValue' ] ); } } + ngOnDestroy() { + this.subscription.unsubscribe(); + } + } diff --git a/projects/truly-ui/src/components/core/classes/datasource-list.ts b/projects/truly-ui/src/components/core/classes/datasource-list.ts index 284a346e4..5d60b7344 100644 --- a/projects/truly-ui/src/components/core/classes/datasource-list.ts +++ b/projects/truly-ui/src/components/core/classes/datasource-list.ts @@ -76,6 +76,11 @@ export class DataSourceList extends DataSource { this.arrayTotal = Array.from( { length: length || this.totalLength } ); } + public resetPages() { + this.fetchedPages = new Set(); + this.fetchedPages.add(0); + } + private setProprieties(config) { Object.keys(config).forEach((value) => { this[value] = config[value]; @@ -89,8 +94,8 @@ export class DataSourceList extends DataSource { public setData(data: Array) { this.cachedData = data; this.arrayTotal.splice(this.currentPage * this.pageSize, this.pageSize, - ...data); - this.dataStream.next(this.arrayTotal); + ...data); + this.dataStream.next( this.arrayTotal ); } private getPageForIndex( index: number ): number { From 996b0f82c846d9617b49cf9d88877d11ad139635 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 15:45:52 -0300 Subject: [PATCH 018/111] docs(autocomplete): update documentation. --- src/app/components/autocomplete/autocompletedemo.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/autocomplete/autocompletedemo.component.ts b/src/app/components/autocomplete/autocompletedemo.component.ts index 09e36ba7a..bfc31e99f 100644 --- a/src/app/components/autocomplete/autocompletedemo.component.ts +++ b/src/app/components/autocomplete/autocompletedemo.component.ts @@ -89,7 +89,7 @@ export class AutoCompleteDemoComponent implements OnInit { const termo = event['fields']['firstName']['value']; setTimeout(() => { if (termo.length > 0) { - const filter = this.lazyCut.filter((item) => String(item.firstName).toLowerCase().includes(String(event.term).toLowerCase())); + const filter = this.lazyCut.filter((item) => String(item.firstName).toLowerCase().includes(String(termo).toLowerCase())); this.lazy = filter.splice(event.skip, event.limit); return; } From cd8077b287b2a5756d13e57a192f7a09c226a8e8 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 16:05:58 -0300 Subject: [PATCH 019/111] refact(listbox): validate datasource on set up data. --- projects/truly-ui/src/components/listbox/listbox.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projects/truly-ui/src/components/listbox/listbox.ts b/projects/truly-ui/src/components/listbox/listbox.ts index 77ac7e948..adf36f34e 100644 --- a/projects/truly-ui/src/components/listbox/listbox.ts +++ b/projects/truly-ui/src/components/listbox/listbox.ts @@ -186,7 +186,9 @@ export class TlListBox extends ListBase implements AfterViewInit, OnDestroy, OnC } else { this.loading = false; this.nothingFound = true; - this.dataSource.dataStream.next([]); + if (this.dataSource) { + this.dataSource.dataStream.next([]); + } } } From 8ce33e10a8ab909f01c7c0862ac7928922927b23 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 17:43:44 -0300 Subject: [PATCH 020/111] fix(autocomplete, multiselect): fix model changes to set as selected option. --- .../src/components/autocomplete/autocomplete.ts | 14 ++++++++------ .../src/components/multiselect/multiselect.ts | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/projects/truly-ui/src/components/autocomplete/autocomplete.ts b/projects/truly-ui/src/components/autocomplete/autocomplete.ts index cf5ebc6a8..42e9df731 100644 --- a/projects/truly-ui/src/components/autocomplete/autocomplete.ts +++ b/projects/truly-ui/src/components/autocomplete/autocomplete.ts @@ -145,7 +145,9 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha ngAfterViewInit() { this.keyManager = new ActiveDescendantKeyManager( this.listItems ); - this.handleModel(); + this.listenModelChanges(); + this.handleModelLazy(); + this.handleModelCached(); this.validateKeyValue(); this.change.detectChanges(); } @@ -157,7 +159,7 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha } } - private handleModel() { + private listenModelChanges() { this.model.valueChanges.subscribe( () => { if ( this.dataSource ) { this.handleModelLazy(); @@ -205,14 +207,14 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha } private handleModelLazy() { - if ( this.model.value && this.lazyMode && !this.modelInitialized ) { + if ( this.value && this.lazyMode && !this.modelInitialized ) { if ( !this.isModelModeString() ) { - this.setDescriptionValue( this.model.value[ this.keyText ] ); + this.setDescriptionValue( this.value[ this.keyText ] ); } else { console.warn( 'The item provided is was not found, emitting filter' ); - this.filter.emit( this.getFilters( this.model.value ) ); + this.filter.emit( this.getFilters( this.value ) ); } - this.handleKeyModelValue( this.model.value ); + this.handleKeyModelValue( this.value ); } } diff --git a/projects/truly-ui/src/components/multiselect/multiselect.ts b/projects/truly-ui/src/components/multiselect/multiselect.ts index 68e962917..a6a7a430c 100644 --- a/projects/truly-ui/src/components/multiselect/multiselect.ts +++ b/projects/truly-ui/src/components/multiselect/multiselect.ts @@ -150,6 +150,7 @@ export class TlMultiSelect extends ValueAccessorBase implements OnInit, Aft } ngAfterViewInit() { + this.validateHasModel(); this.setControl(); this.setRequired(); this.setDisabled(); From 7d5498aa625da14432c0d9d7842c714dbbea70ce Mon Sep 17 00:00:00 2001 From: William Aguera Date: Wed, 27 Feb 2019 18:00:29 -0300 Subject: [PATCH 021/111] fix(autocomplete): fix select on key enter not emitting the value. --- projects/truly-ui/src/components/autocomplete/autocomplete.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/truly-ui/src/components/autocomplete/autocomplete.ts b/projects/truly-ui/src/components/autocomplete/autocomplete.ts index 42e9df731..161c08390 100644 --- a/projects/truly-ui/src/components/autocomplete/autocomplete.ts +++ b/projects/truly-ui/src/components/autocomplete/autocomplete.ts @@ -312,6 +312,7 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha this.setSelected( this.keyManager.activeItem ); this.setDescriptionValue( this.keyManager.activeItem.itemSelected[ this.keyText ] ); this.handleKeyModelValue( this.keyManager.activeItem.itemSelected ); + this.select.emit( this.keyManager.activeItem.itemSelected ); } this.setIsOpen( false ); } From c7e74d25e3c217d67104cb33e524373b004bbac3 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Thu, 28 Feb 2019 10:40:12 -0300 Subject: [PATCH 022/111] fix(autocomplete): fix model changes when the data is not available yet. --- .../components/autocomplete/autocomplete.ts | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/projects/truly-ui/src/components/autocomplete/autocomplete.ts b/projects/truly-ui/src/components/autocomplete/autocomplete.ts index 161c08390..013ed7f62 100644 --- a/projects/truly-ui/src/components/autocomplete/autocomplete.ts +++ b/projects/truly-ui/src/components/autocomplete/autocomplete.ts @@ -147,7 +147,6 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha this.keyManager = new ActiveDescendantKeyManager( this.listItems ); this.listenModelChanges(); this.handleModelLazy(); - this.handleModelCached(); this.validateKeyValue(); this.change.detectChanges(); } @@ -223,14 +222,16 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha } private handleModelCached() { - this.dataSource.getCachedData().forEach( ( value ) => { - if ( this.model.value ) { - if ( String( this.getItemCompare( value ) ) === String( this.getCompareModel() ) ) { - this.setDescriptionValue( value[ this.keyText ] ); - this.handleKeyModelValue( value ); + if ( this.dataSource && !this.lazyMode ) { + this.dataSource.getCachedData().forEach( ( value ) => { + if ( this.value ) { + if ( String( this.getItemCompare( value ) ) === String( this.getCompareModel() ) ) { + this.setDescriptionValue( value[ this.keyText ] ); + this.handleKeyModelValue( value ); + } } - } - } ); + } ); + } } private getItemCompare( value ) { @@ -330,12 +331,12 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha private getCompareModel() { if ( this.keyValue && !this.isModelModeString() ) { - return this.model.value[ this.keyValue ]; + return this.value[ this.keyValue ]; } if ( !this.isModelModeString() && !this.keyValue ) { - return this.model.value[ this.identifier ]; + return this.value[ this.identifier ]; } - return this.model.value; + return this.value; } selectItem( value: any, item: TlItemSelectedDirective ) { @@ -361,6 +362,7 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha this.dataSource.setData( value ); this.setNotFound( value.length === 0 ); this.setFirstItemActive(); + this.handleModelCached(); } private setFirstItemActive() { @@ -375,9 +377,9 @@ export class TlAutoComplete extends ElementBase implements OnInit, OnCha if ( !this.dataSource ) { return; } - this.subscription.add(this.dataSource.loadMoreData.subscribe( ( data: any ) => { + this.subscription.add( this.dataSource.loadMoreData.subscribe( ( data: any ) => { this.lazyLoad.emit( { skip: data.skip, limit: data.limit, ...this.getFilters( this.searchControl.value ) } ); - } )); + } ) ); } onPositionChange( $event: ConnectedOverlayPositionChange ) { From 8dbac268d69958ca5b047a8bc67cf6f0314d0426 Mon Sep 17 00:00:00 2001 From: Maicon Wagner Date: Thu, 28 Feb 2019 14:22:43 -0300 Subject: [PATCH 023/111] doc: fix changelogs link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1bf78fee8..38f7ddafd 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ - ✨ Learn about it on the [docs site](http://truly-ui.com/) - 🚀 See it in action on [Stackblitz](https://stackblitz.com/edit/truly-ui-simple) - 😎 Checkout the [sample application](integration) -- 📝 Learn about updates from the [changelog](CHANGELOG.md) +- 📝 Learn about updates from the [changelog](https://github.com/TemainfoSoftware/truly-ui/releases) - 💬 Get to know the latest news first through [slack](https://trulyui.slack.com) From f21affbbb60d59b321b27ff134d45fea8ac1b568 Mon Sep 17 00:00:00 2001 From: William Aguera Date: Thu, 28 Feb 2019 15:24:49 -0300 Subject: [PATCH 024/111] feat(dropdownlist, overlaylist): add groupBy feature to allow items groups. --- .../components/dropdownlist/dropdownlist.html | 1 + .../components/dropdownlist/dropdownlist.ts | 4 +- .../overlaylist/list-item/list-item.html | 1 + .../overlaylist/list-item/list-item.ts | 2 + .../components/overlaylist/overlay-list.html | 44 ++++++++++----- .../components/overlaylist/overlay-list.scss | 8 +++ .../components/overlaylist/overlay-list.ts | 55 +++++++++++++++++-- 7 files changed, 95 insertions(+), 20 deletions(-) diff --git a/projects/truly-ui/src/components/dropdownlist/dropdownlist.html b/projects/truly-ui/src/components/dropdownlist/dropdownlist.html index 06f9df948..a5d7d47a6 100644 --- a/projects/truly-ui/src/components/dropdownlist/dropdownlist.html +++ b/projects/truly-ui/src/components/dropdownlist/dropdownlist.html @@ -39,6 +39,7 @@ [typeOfData]="typeOfData" [hasDefaultOption]="defaultOption" [defaultOptionText]="placeholder" + [groupBy]="groupBy" [optionSelected]="optionSelected" [inputModelIndex]="indexOptionSelectedModel" [datasource]="datasource" diff --git a/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts b/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts index be1bc9a0f..c6d719192 100644 --- a/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts +++ b/projects/truly-ui/src/components/dropdownlist/dropdownlist.ts @@ -83,6 +83,8 @@ export class TlDropDownList extends ElementBase implements OnInit, OnCha @Input( 'defaultOption' ) defaultOption = false; + @Input( 'groupBy' ) groupBy = null; + @Input( 'width' ) width = '120px'; @Input( 'placeholder' ) placeholder = 'Select Item'; @@ -187,7 +189,7 @@ export class TlDropDownList extends ElementBase implements OnInit, OnCha public handleOpenList( $event ) { this.stopEvent( $event ); - if ( !this.isOpen && !this.disabled ) { + if ( !this.isOpen && !this.disabled && !this.isLoading ) { this.isOpen = true; this.setUpComponent(); } diff --git a/projects/truly-ui/src/components/overlaylist/list-item/list-item.html b/projects/truly-ui/src/components/overlaylist/list-item/list-item.html index ace49f544..ad7bd9776 100644 --- a/projects/truly-ui/src/components/overlaylist/list-item/list-item.html +++ b/projects/truly-ui/src/components/overlaylist/list-item/list-item.html @@ -2,6 +2,7 @@
diff --git a/projects/truly-ui/src/components/overlaylist/list-item/list-item.ts b/projects/truly-ui/src/components/overlaylist/list-item/list-item.ts index 07c021259..fc11f1654 100644 --- a/projects/truly-ui/src/components/overlaylist/list-item/list-item.ts +++ b/projects/truly-ui/src/components/overlaylist/list-item/list-item.ts @@ -33,6 +33,8 @@ export class TlListItem implements Highlightable { @Input() disabled = false; + @Input() grouped = true; + @Input() height = '30px'; public selected = false; diff --git a/projects/truly-ui/src/components/overlaylist/overlay-list.html b/projects/truly-ui/src/components/overlaylist/overlay-list.html index 5a56ae847..2a7025ebc 100644 --- a/projects/truly-ui/src/components/overlaylist/overlay-list.html +++ b/projects/truly-ui/src/components/overlaylist/overlay-list.html @@ -10,22 +10,36 @@