@coolon/angular-ui-powerups 2.0.0-alpha.16 → 2.0.0-alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +0 -2
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js +1 -3
- package/esm2015/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -1
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js +1 -3
- package/esm5/lib/components/forms/autocomplete-input/autocomplete-input.component.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +1 -3
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +1 -3
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __metadata } from "tslib";
|
|
2
2
|
import { Component, ContentChild, Input, TemplateRef } from '@angular/core';
|
|
3
|
-
import { Dsl, ListModel, MutableValueModel, StoreInListModel, TrackExternal
|
|
3
|
+
import { Dsl, ListModel, MutableValueModel, StoreInListModel, TrackExternal } from '@coolon/pectin';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import { AbstractValueInputComponent } from '../abstract-value-input.component';
|
|
6
6
|
/**
|
|
@@ -21,8 +21,6 @@ let AutocompleteInputComponent = class AutocompleteInputComponent extends Abstra
|
|
|
21
21
|
.select(option => {
|
|
22
22
|
return _.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
|
|
23
23
|
}, { dependsOn: lowerCaseFilterValue });
|
|
24
|
-
const txo = new TransactionObserver().onEvent(e => console.log(e.name, e.payload));
|
|
25
|
-
txo.observe('this.valueModel', this.valueModel);
|
|
26
24
|
}
|
|
27
25
|
ngOnInit() {
|
|
28
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,EACL,GAAG,EACH,SAAS,EAET,iBAAiB,EACjB,gBAAgB,EAEhB,aAAa,
|
|
1
|
+
{"version":3,"file":"autocomplete-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,EACL,GAAG,EACH,SAAS,EAET,iBAAiB,EACjB,gBAAgB,EAEhB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF;;;;;GAKG;AAMH,IAAa,0BAA0B,GAAvC,MAAa,0BAAoC,SAAQ,2BAA8B;IAuBrF;QACE,KAAK,EAAE,CAAC;QAPF,gBAAW,GAAG,IAAI,iBAAiB,EAAU,CAAC;QAItD,sBAAiB,GAAuB,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QAInH,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,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8BACZ,WAAW;wEAAM;AAMvC;IADC,KAAK,EAAE;;qEAC6G;AArB1G,0BAA0B;IALtC,SAAS,CAAC;QACT,QAAQ,EAAE,wBAAwB;QAClC,umCAAkD;;KAEnD,CAAC;;GACW,0BAA0B,CAiDtC;SAjDY,0BAA0B","sourcesContent":["import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';\nimport { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';\nimport {\n Dsl,\n ListModel,\n ListModelChain,\n MutableValueModel,\n StoreInListModel,\n Trace,\n TrackExternal, TransactionObserver\n} from '@coolon/pectin';\nimport _ from 'lodash';\nimport { AbstractValueInputComponent } from '../abstract-value-input.component';\n\n/**\n * Using templates (not only supported for nil values:\n * <aup-autocomplete-input [valueModel]=\"myModel\" [options]=\"myOptions\">\n * <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>\n * </aup-autocomplete-input>\n */\n@Component({\n selector: 'aup-autocomplete-input',\n templateUrl: './autocomplete-input.component.html',\n styleUrls: ['./autocomplete-input.component.scss']\n})\nexport class AutocompleteInputComponent<T = any> extends AbstractValueInputComponent<T> implements OnInit {\n\n @Input() @TrackExternal()\n optionsModel: ListModel<T>;\n\n @Input() @StoreInListModel('optionsModel')\n options: T[];\n\n @Input()\n optionLabel: keyof T;\n\n @Input()\n allowNil: boolean;\n\n @ContentChild('nilOptionTemplate')\n nilOptionTemplateRef: TemplateRef<any>;\n\n private filterValue = new MutableValueModel<string>();\n readonly filteredOptions: ListModelChain<T>;\n\n @Input()\n optionLabelFormat: (option: T) => any = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n const lowerCaseFilterValue = chain(this.filterValue)\n .map(v => _.isString(v) ? v.toLowerCase() : '');\n\n this.filteredOptions = chain(this.optionsModel)\n .select(option => {\n return _.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);\n }, { dependsOn: lowerCaseFilterValue });\n }\n\n ngOnInit() {\n }\n\n formatOption(option: T) {\n return this.optionLabelFormat(option);\n }\n\n updateFilter($event: string) {\n this.filterValue.value = $event;\n }\n\n onSelect($event: MatAutocompleteSelectedEvent) {\n this.valueModel.value = $event.option.value;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __extends, __metadata } from "tslib";
|
|
2
2
|
import { Component, ContentChild, Input, TemplateRef } from '@angular/core';
|
|
3
|
-
import { Dsl, ListModel, MutableValueModel, StoreInListModel, TrackExternal
|
|
3
|
+
import { Dsl, ListModel, MutableValueModel, StoreInListModel, TrackExternal } from '@coolon/pectin';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import { AbstractValueInputComponent } from '../abstract-value-input.component';
|
|
6
6
|
/**
|
|
@@ -22,8 +22,6 @@ var AutocompleteInputComponent = /** @class */ (function (_super) {
|
|
|
22
22
|
.select(function (option) {
|
|
23
23
|
return _.isEmpty(_this.filterValue.value) || _this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
|
|
24
24
|
}, { dependsOn: lowerCaseFilterValue });
|
|
25
|
-
var txo = new TransactionObserver().onEvent(function (e) { return console.log(e.name, e.payload); });
|
|
26
|
-
txo.observe('this.valueModel', _this.valueModel);
|
|
27
25
|
return _this;
|
|
28
26
|
}
|
|
29
27
|
AutocompleteInputComponent.prototype.ngOnInit = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,EACL,GAAG,EACH,SAAS,EAET,iBAAiB,EACjB,gBAAgB,EAEhB,aAAa,
|
|
1
|
+
{"version":3,"file":"autocomplete-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/autocomplete-input/autocomplete-input.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpF,OAAO,EACL,GAAG,EACH,SAAS,EAET,iBAAiB,EACjB,gBAAgB,EAEhB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF;;;;;GAKG;AAMH;IAAyD,8CAA8B;IAuBrF;QAAA,YACE,iBAAO,SASR;QAhBO,iBAAW,GAAG,IAAI,iBAAiB,EAAU,CAAC;QAItD,uBAAiB,GAAuB,UAAC,MAAM,IAAK,OAAA,CAAC,MAAM,IAAI,KAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,EAAhE,CAAgE,CAAC;QAI7G,IAAA,2BAAkF,EAAhF,gBAAK,EAAE,oBAAO,EAAE,kBAAM,EAAE,cAAI,EAAE,gBAAK,EAAE,oBAAO,EAAE,sBAAkC,CAAC;QACzF,IAAO,oBAAoB,GAAG,KAAK,CAAC,KAAI,CAAC,WAAW,CAAC;aAClD,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EAApC,CAAoC,CAAC,CAAC;QAElD,KAAI,CAAC,eAAe,GAAG,KAAK,CAAC,KAAI,CAAC,YAAY,CAAC;aAC5C,MAAM,CAAC,UAAA,MAAM;YACZ,OAAO,CAAC,CAAC,OAAO,CAAC,KAAI,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,KAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC3I,CAAC,EAAE,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;;IAC5C,CAAC;IAED,6CAAQ,GAAR;IACA,CAAC;IAED,iDAAY,GAAZ,UAAa,MAAS;QACpB,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,iDAAY,GAAZ,UAAa,MAAc;QACzB,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,MAAM,CAAC;IAClC,CAAC;IAED,6CAAQ,GAAR,UAAS,MAAoC;QAC3C,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;IAC9C,CAAC;IA7CD;QADC,KAAK,EAAE,EAAE,aAAa,EAAE;kCACX,SAAS;oEAAI;IAG3B;QADC,KAAK,EAAE,EAAE,gBAAgB,CAAC,cAAc,CAAC;;+DAC7B;IAGb;QADC,KAAK,EAAE;;mEACa;IAGrB;QADC,KAAK,EAAE;;gEACU;IAGlB;QADC,YAAY,CAAC,mBAAmB,CAAC;kCACZ,WAAW;4EAAM;IAMvC;QADC,KAAK,EAAE;;yEAC6G;IArB1G,0BAA0B;QALtC,SAAS,CAAC;YACT,QAAQ,EAAE,wBAAwB;YAClC,umCAAkD;;SAEnD,CAAC;;OACW,0BAA0B,CAiDtC;IAAD,iCAAC;CAAA,AAjDD,CAAyD,2BAA2B,GAiDnF;SAjDY,0BAA0B","sourcesContent":["import { Component, ContentChild, Input, OnInit, TemplateRef } from '@angular/core';\nimport { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';\nimport {\n Dsl,\n ListModel,\n ListModelChain,\n MutableValueModel,\n StoreInListModel,\n Trace,\n TrackExternal, TransactionObserver\n} from '@coolon/pectin';\nimport _ from 'lodash';\nimport { AbstractValueInputComponent } from '../abstract-value-input.component';\n\n/**\n * Using templates (not only supported for nil values:\n * <aup-autocomplete-input [valueModel]=\"myModel\" [options]=\"myOptions\">\n * <ng-template #nilOptionTemplate let-option>{{option.thePropertyYouWant}}</ng-template>\n * </aup-autocomplete-input>\n */\n@Component({\n selector: 'aup-autocomplete-input',\n templateUrl: './autocomplete-input.component.html',\n styleUrls: ['./autocomplete-input.component.scss']\n})\nexport class AutocompleteInputComponent<T = any> extends AbstractValueInputComponent<T> implements OnInit {\n\n @Input() @TrackExternal()\n optionsModel: ListModel<T>;\n\n @Input() @StoreInListModel('optionsModel')\n options: T[];\n\n @Input()\n optionLabel: keyof T;\n\n @Input()\n allowNil: boolean;\n\n @ContentChild('nilOptionTemplate')\n nilOptionTemplateRef: TemplateRef<any>;\n\n private filterValue = new MutableValueModel<string>();\n readonly filteredOptions: ListModelChain<T>;\n\n @Input()\n optionLabelFormat: (option: T) => any = (option) => (option && this.optionLabel) ? option[this.optionLabel] : option;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n const lowerCaseFilterValue = chain(this.filterValue)\n .map(v => _.isString(v) ? v.toLowerCase() : '');\n\n this.filteredOptions = chain(this.optionsModel)\n .select(option => {\n return _.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);\n }, { dependsOn: lowerCaseFilterValue });\n }\n\n ngOnInit() {\n }\n\n formatOption(option: T) {\n return this.optionLabelFormat(option);\n }\n\n updateFilter($event: string) {\n this.filterValue.value = $event;\n }\n\n onSelect($event: MatAutocompleteSelectedEvent) {\n this.valueModel.value = $event.option.value;\n }\n}\n"]}
|
|
@@ -17,7 +17,7 @@ import { MatTableModule } from '@angular/material/table';
|
|
|
17
17
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
18
18
|
import { FaIconLibrary, FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|
19
19
|
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
20
|
-
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, FocusManager, Form, Guard, DebugContext, MutableListModel, MutableValueModel,
|
|
20
|
+
import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, FocusManager, Form, Guard, DebugContext, MutableListModel, MutableValueModel, ListModel, StoreInListModel, ValueModel, StoreInValueModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Binding, Functions } from '@coolon/pectin';
|
|
21
21
|
import ___default, { isEqual, isNil } from 'lodash';
|
|
22
22
|
import { assert as assert$1, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
|
|
23
23
|
import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
|
|
@@ -750,8 +750,6 @@ let AutocompleteInputComponent = class AutocompleteInputComponent extends Abstra
|
|
|
750
750
|
.select(option => {
|
|
751
751
|
return ___default.isEmpty(this.filterValue.value) || this.optionLabelFormat(option).toString().toLowerCase().includes(lowerCaseFilterValue.value);
|
|
752
752
|
}, { dependsOn: lowerCaseFilterValue });
|
|
753
|
-
const txo = new TransactionObserver().onEvent(e => console.log(e.name, e.payload));
|
|
754
|
-
txo.observe('this.valueModel', this.valueModel);
|
|
755
753
|
}
|
|
756
754
|
ngOnInit() {
|
|
757
755
|
}
|