@coolon/angular-ui-powerups 2.0.0-alpha.18 → 2.0.0-alpha.19
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 +14 -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/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/forms/abstract-list-input.component.js +7 -1
- package/esm2015/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-list-input.component.metadata.json +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.js +7 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/abstract-value-input.component.metadata.json +1 -1
- package/esm5/lib/components/forms/abstract-list-input.component.js +7 -1
- package/esm5/lib/components/forms/abstract-list-input.component.js.map +1 -1
- package/esm5/lib/components/forms/abstract-value-input.component.js +7 -1
- package/esm5/lib/components/forms/abstract-value-input.component.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +14 -2
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +14 -2
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/forms/abstract-list-input.component.d.ts +1 -0
- package/lib/components/forms/abstract-value-input.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -41,7 +41,13 @@ let AbstractListInputComponent = class AbstractListInputComponent extends Abstra
|
|
|
41
41
|
// and the like.
|
|
42
42
|
set value(value) {
|
|
43
43
|
this.setValueIsInProgress.whileTrue(() => {
|
|
44
|
-
this.
|
|
44
|
+
if (!this.listHolder) {
|
|
45
|
+
this.listHolder = new MutableListModel(value);
|
|
46
|
+
this.listModel = this.listHolder;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.listHolder.value = value;
|
|
50
|
+
}
|
|
45
51
|
});
|
|
46
52
|
}
|
|
47
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-list-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-list-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,OAAO,EACP,YAAY,EACZ,GAAG,EAEH,IAAI,EACJ,KAAK,EAEL,gBAAgB,EAChB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,IAAa,0BAA0B,GAAvC,MAAa,0BAA8B,SAAQ,sBAA2B;
|
|
1
|
+
{"version":3,"file":"abstract-list-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-list-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,OAAO,EACP,YAAY,EACZ,GAAG,EAEH,IAAI,EACJ,KAAK,EAEL,gBAAgB,EAChB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,IAAa,0BAA0B,GAAvC,MAAa,0BAA8B,SAAQ,sBAA2B;IAuC5E;QACE,KAAK,EAAE,CAAC;QAnCV;;;;;;;;;WASG;QACD,0FAA0F;QACzE,mBAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,IAAI,CAAC,mBAAmB,EAAK,CAAC,CAAC;QACtF,uBAAkB,GAAG,IAAI,gBAAgB,E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AC,UAAU,GAAG,IAAI,gBAAgB,CAAI,KAAK,CAAC,CAAC;gBACjD,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,UAAU,CAAC;aAClC;iBAAM;gBACL,IAAI,CAAC,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;aAC/B;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CA0BF,CAAA;AA1DC;IADC,KAAK,EAAE,EAAE,aAAa,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;;6DACD;AAuB/C;IAAR,KAAK,EAAE;;;uDASP;AAES;IAAT,MAAM,EAAE;;+DAAgD;AArC9C,0BAA0B;IADtC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;;GACf,0BAA0B,CA6DtC;SA7DY,0BAA0B","sourcesContent":["/* tslint:disable:no-input-rename */\nimport { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport {\n Binding,\n DebugContext,\n Dsl,\n EventListenerList,\n Form,\n Guard,\n IMutableListModel,\n MutableListModel,\n TrackExternal\n} from '@coolon/pectin';\nimport { AbstractInputComponent } from './abstract-input.component';\n\n@Component({ template: '' })\nexport class AbstractListInputComponent<T> extends AbstractInputComponent<T[]> implements OnInit {\n\n @Input() @TrackExternal({ delegateTo: 'formValueModel' })\n listModel: Form.ListModelBase<T> | IMutableListModel<T>;\n\n /**\n * A backing model for all our @Input() valueModel properties which should be defined as follows.\n *\n * @Input() @TrackExternal({useExisting: \"inputModel\"})\n * valueModel: Form.ListModelBase<string> | IMutableListModel<string>;\n *\n * This approach allows the input to accept plain or form models but all backed by a form\n * friendly delegate. We have to use an existing delegate for union types as pectin just\n * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).\n */\n // We have to register it as a disposable so it ditches any listeners when we're disposed.\n protected readonly formValueModel = this.registerDisposable(new Form.DelegatingListModel<T>());\n readonly componentListModel = new MutableListModel<T>();\n\n private setValueIsInProgress = new Guard();\n // we need this for plain values otherwise our Form.DelegatingListModel will stay disabled.\n private listHolder: MutableListModel<T>;\n\n // We add support for simple direct display of values by allowing components to be used\n // by `component.value = ...` This use of the component without a value model in tables\n // and the like.\n @Input() set value(value: T[]) {\n this.setValueIsInProgress.whileTrue(() => {\n if (!this.listHolder) {\n this.listHolder = new MutableListModel<T>(value);\n this.listModel = this.listHolder;\n } else {\n this.listHolder.value = value;\n }\n });\n }\n\n @Output() readonly valueChange = new EventEmitter<T[]>();\n\n constructor() {\n super();\n const { when, valueOf, chain } = Dsl.disposeWith(this);\n const binding = new Binding.Identity(this.formValueModel, this.componentListModel);\n const inExternalChange = valueOf.any(\n this.setValueIsInProgress,\n chain(binding.direction).equals(Binding.Direction.RIGHT)\n ).areTruthy();\n\n when(this.componentListModel).changes((is, was) => {\n this.valueChange.emit(is);\n this.onValueEditedListeners.fire(l => l(is, was));\n }, {\n initialValue: 'ignore',\n // we never fire events during an external changes to the value. This allows\n // the component to behave when used in the conventional angular\n // fashion, i.e. [(value)]=\"...\"\n unless: inExternalChange\n });\n DebugContext.tag(this.formValueModel, `${this.constructor.name}.formValueModel`);\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AbstractListInputComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./abstract-input.component","name":"AbstractInputComponent","line":16,"character":51},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":15,"character":1},"arguments":[{"template":""}]}],"members":{"listModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":18,"character":12},"arguments":[{"delegateTo":"formValueModel"}]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AbstractListInputComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./abstract-input.component","name":"AbstractInputComponent","line":16,"character":51},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":15,"character":1},"arguments":[{"template":""}]}],"members":{"listModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":18,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":18,"character":12},"arguments":[{"delegateTo":"formValueModel"}]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":42,"character":3}}]}],"valueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":53,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}]
|
|
@@ -41,7 +41,13 @@ let AbstractValueInputComponent = class AbstractValueInputComponent extends Abst
|
|
|
41
41
|
// and the like.
|
|
42
42
|
set value(value) {
|
|
43
43
|
this.setValueInProgress.whileTrue(() => {
|
|
44
|
-
this.
|
|
44
|
+
if (!this.plainValueHolder) {
|
|
45
|
+
this.plainValueHolder = new MutableValueModel(value);
|
|
46
|
+
this.valueModel = this.plainValueHolder;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.plainValueHolder.value = value;
|
|
50
|
+
}
|
|
45
51
|
});
|
|
46
52
|
}
|
|
47
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-value-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-value-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,OAAO,EACP,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,KAAK,EAEL,iBAAiB,EACjB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,IAAa,2BAA2B,GAAxC,MAAa,2BAA+B,SAAQ,sBAAyB;
|
|
1
|
+
{"version":3,"file":"abstract-value-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-value-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,OAAO,EACP,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,KAAK,EAEL,iBAAiB,EACjB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE,IAAa,2BAA2B,GAAxC,MAAa,2BAA+B,SAAQ,sBAAyB;IAuC3E;QACE,KAAK,EAAE,CAAC;QAnCV;;;;;;;;;WASG;QACD,0FAA0F;QACzE,mBAAc,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,IAAI,CAAC,oBAAoB,EAAK,CAAC,CAAC;QAEtF,uBAAkB,GAAG,IAAI,KAAK,EAAE,CAAC;QAClC,wBAAmB,GAAG,IAAI,iBAAiB,EAAK,CAAC;QAkBvC,gBAAW,GAAG,IAAI,YAAY,EAAK,CAAC;QAIrD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;QACpF,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAClC,IAAI,CAAC,kB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AE;;gEAA8C;AArC5C,2BAA2B;IADvC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;;GACf,2BAA2B,CA6DvC;SA7DY,2BAA2B","sourcesContent":["/* tslint:disable:no-input-rename */\nimport { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport {\n Binding,\n DebugContext,\n Dsl,\n Form,\n Guard,\n IMutableValueModel,\n MutableValueModel,\n TrackExternal\n} from '@coolon/pectin';\nimport { AbstractInputComponent } from './abstract-input.component';\n\n@Component({ template: '' })\nexport class AbstractValueInputComponent<T> extends AbstractInputComponent<T> implements OnInit {\n\n @Input() @TrackExternal({ delegateTo: 'formValueModel' })\n valueModel: Form.ValueModelBase<T> | IMutableValueModel<T>;\n\n /**\n * A backing model for all our @Input() valueModel properties which should be defined as follows.\n *\n * @Input() @TrackExternal({useExisting: \"inputModel\"})\n * valueModel: DirtyTrackingForm.ValueModel<string> | IMutableValueModel<string>;\n *\n * This approach allows the input to accept plain or form models but all backed by a form\n * friendly delegate. We have to use an existing delegate for union types as pectin just\n * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).\n */\n // We have to register it as a disposable so it ditches any listeners when we're disposed.\n protected readonly formValueModel = this.registerDisposable(new Form.DelegatingValueModel<T>());\n\n protected setValueInProgress = new Guard();\n readonly componentValueModel = new MutableValueModel<T>();\n // we need this for plain values otherwise our Form.DelegatingValueModel will stay disabled.\n private plainValueHolder: MutableValueModel<T>;\n\n // We add support for simple direct display of values by allowing components to be used\n // by `component.value = ...` This use of the component without a value model in tables\n // and the like.\n @Input() set value(value: T) {\n this.setValueInProgress.whileTrue(() => {\n if (!this.plainValueHolder) {\n this.plainValueHolder = new MutableValueModel<T>(value);\n this.valueModel = this.plainValueHolder;\n } else {\n this.plainValueHolder.value = value;\n }\n });\n }\n\n @Output() readonly valueChange = new EventEmitter<T>();\n\n constructor() {\n super();\n const { when, chain, valueOf } = Dsl.disposeWith(this);\n const binding = new Binding.Identity(this.formValueModel, this.componentValueModel);\n const inExternalChange = valueOf.any(\n this.setValueInProgress,\n chain(binding.direction).equals(Binding.Direction.RIGHT)\n ).areTruthy();\n\n when(this.componentValueModel).changes((is, was) => {\n this.valueChange.emit(is);\n this.onValueEditedListeners.fire(l => l(is, was));\n }, {\n initialValue: 'ignore',\n // we never fire events during an external set value operation. This allows\n // the component to behave when used in the conventional angular\n // fashion, i.e. [(value)]=\"...\"\n unless: inExternalChange\n });\n DebugContext.tag(this.formValueModel, `${this.constructor.name}.formValueModel`);\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AbstractValueInputComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./abstract-input.component","name":"AbstractInputComponent","line":15,"character":52},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"template":""}]}],"members":{"valueModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":17,"character":12},"arguments":[{"delegateTo":"formValueModel"}]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AbstractValueInputComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./abstract-input.component","name":"AbstractInputComponent","line":15,"character":52},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"template":""}]}],"members":{"valueModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":17,"character":12},"arguments":[{"delegateTo":"formValueModel"}]}]}],"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":41,"character":3}}]}],"valueChange":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":52,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}]
|
|
@@ -45,7 +45,13 @@ var AbstractListInputComponent = /** @class */ (function (_super) {
|
|
|
45
45
|
set: function (value) {
|
|
46
46
|
var _this = this;
|
|
47
47
|
this.setValueIsInProgress.whileTrue(function () {
|
|
48
|
-
_this.
|
|
48
|
+
if (!_this.listHolder) {
|
|
49
|
+
_this.listHolder = new MutableListModel(value);
|
|
50
|
+
_this.listModel = _this.listHolder;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
_this.listHolder.value = value;
|
|
54
|
+
}
|
|
49
55
|
});
|
|
50
56
|
},
|
|
51
57
|
enumerable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-list-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-list-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,OAAO,EACP,YAAY,EACZ,GAAG,EAEH,IAAI,EACJ,KAAK,EAEL,gBAAgB,EAChB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE;IAAmD,8CAA2B;
|
|
1
|
+
{"version":3,"file":"abstract-list-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-list-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK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ACtB,4EAA4E;YAC5E,gEAAgE;YAChE,gCAAgC;YAChC,MAAM,EAAE,gBAAgB;SACzB,CAAC,CAAC;QACH,YAAY,CAAC,GAAG,CAAC,KAAI,CAAC,cAAc,EAAK,KAAI,CAAC,WAAW,CAAC,IAAI,oBAAiB,CAAC,CAAC;;IACnF,CAAC;IAjCQ,sBAAI,6CAAK;QAHlB,uFAAuF;QACvF,wFAAwF;QACxF,gBAAgB;aACP,UAAU,KAAU;YAA7B,iBASC;YARC,IAAI,CAAC,oBAAoB,CAAC,SAAS,CAAC;gBAClC,IAAI,CAAC,KAAI,CAAC,UAAU,EAAE;oBACpB,KAAI,CAAC,UAAU,GAAG,IAAI,gBAAgB,CAAI,KAAK,CAAC,CAAC;oBACjD,KAAI,CAAC,SAAS,GAAG,KAAI,CAAC,UAAU,CAAC;iBAClC;qBAAM;oBACL,KAAI,CAAC,UAAU,CAAC,KAAK,GAAG,KAAK,CAAC;iBAC/B;YACH,CAAC,CAAC,CAAC;QACL,CAAC;;;OAAA;IAhCD;QADC,KAAK,EAAE,EAAE,aAAa,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;;iEACD;IAuB/C;QAAR,KAAK,EAAE;;;2DASP;IAES;QAAT,MAAM,EAAE;;mEAAgD;IArC9C,0BAA0B;QADtC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;;OACf,0BAA0B,CA6DtC;IAAD,iCAAC;CAAA,AA7DD,CAAmD,sBAAsB,GA6DxE;SA7DY,0BAA0B","sourcesContent":["/* tslint:disable:no-input-rename */\nimport { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport {\n Binding,\n DebugContext,\n Dsl,\n EventListenerList,\n Form,\n Guard,\n IMutableListModel,\n MutableListModel,\n TrackExternal\n} from '@coolon/pectin';\nimport { AbstractInputComponent } from './abstract-input.component';\n\n@Component({ template: '' })\nexport class AbstractListInputComponent<T> extends AbstractInputComponent<T[]> implements OnInit {\n\n @Input() @TrackExternal({ delegateTo: 'formValueModel' })\n listModel: Form.ListModelBase<T> | IMutableListModel<T>;\n\n /**\n * A backing model for all our @Input() valueModel properties which should be defined as follows.\n *\n * @Input() @TrackExternal({useExisting: \"inputModel\"})\n * valueModel: Form.ListModelBase<string> | IMutableListModel<string>;\n *\n * This approach allows the input to accept plain or form models but all backed by a form\n * friendly delegate. We have to use an existing delegate for union types as pectin just\n * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).\n */\n // We have to register it as a disposable so it ditches any listeners when we're disposed.\n protected readonly formValueModel = this.registerDisposable(new Form.DelegatingListModel<T>());\n readonly componentListModel = new MutableListModel<T>();\n\n private setValueIsInProgress = new Guard();\n // we need this for plain values otherwise our Form.DelegatingListModel will stay disabled.\n private listHolder: MutableListModel<T>;\n\n // We add support for simple direct display of values by allowing components to be used\n // by `component.value = ...` This use of the component without a value model in tables\n // and the like.\n @Input() set value(value: T[]) {\n this.setValueIsInProgress.whileTrue(() => {\n if (!this.listHolder) {\n this.listHolder = new MutableListModel<T>(value);\n this.listModel = this.listHolder;\n } else {\n this.listHolder.value = value;\n }\n });\n }\n\n @Output() readonly valueChange = new EventEmitter<T[]>();\n\n constructor() {\n super();\n const { when, valueOf, chain } = Dsl.disposeWith(this);\n const binding = new Binding.Identity(this.formValueModel, this.componentListModel);\n const inExternalChange = valueOf.any(\n this.setValueIsInProgress,\n chain(binding.direction).equals(Binding.Direction.RIGHT)\n ).areTruthy();\n\n when(this.componentListModel).changes((is, was) => {\n this.valueChange.emit(is);\n this.onValueEditedListeners.fire(l => l(is, was));\n }, {\n initialValue: 'ignore',\n // we never fire events during an external changes to the value. This allows\n // the component to behave when used in the conventional angular\n // fashion, i.e. [(value)]=\"...\"\n unless: inExternalChange\n });\n DebugContext.tag(this.formValueModel, `${this.constructor.name}.formValueModel`);\n }\n\n}\n"]}
|
|
@@ -45,7 +45,13 @@ var AbstractValueInputComponent = /** @class */ (function (_super) {
|
|
|
45
45
|
set: function (value) {
|
|
46
46
|
var _this = this;
|
|
47
47
|
this.setValueInProgress.whileTrue(function () {
|
|
48
|
-
_this.
|
|
48
|
+
if (!_this.plainValueHolder) {
|
|
49
|
+
_this.plainValueHolder = new MutableValueModel(value);
|
|
50
|
+
_this.valueModel = _this.plainValueHolder;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
_this.plainValueHolder.value = value;
|
|
54
|
+
}
|
|
49
55
|
});
|
|
50
56
|
},
|
|
51
57
|
enumerable: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-value-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-value-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,OAAO,EACP,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,KAAK,EAEL,iBAAiB,EACjB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE;IAAoD,+CAAyB;
|
|
1
|
+
{"version":3,"file":"abstract-value-input.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/components/forms/abstract-value-input.component.ts"],"names":[],"mappings":";AAAA,oCAAoC;AACpC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EACL,OAAO,EACP,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,KAAK,EAEL,iBAAiB,EACjB,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGpE;IAAoD,+CAAyB;IAuC3E;QAAA,YACE,iBAAO,SAmBR;QAtDD;;;;;;;;;WASG;QACD,0FAA0F;QACzE,oBAAc,GAAG,K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kB,CAAC,SAAS,CAAC;gBAChC,IAAI,CAAC,KAAI,CAAC,gBAAgB,EAAE;oBAC1B,KAAI,CAAC,gBAAgB,GAAG,IAAI,iBAAiB,CAAI,KAAK,CAAC,CAAC;oBACxD,KAAI,CAAC,UAAU,GAAG,KAAI,CAAC,gBAAgB,CAAC;iBACzC;qBAAM;oBACL,KAAI,CAAC,gBAAgB,CAAC,KAAK,GAAG,KAAK,CAAC;iBACrC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;;;OAAA;IAhCD;QADC,KAAK,EAAE,EAAE,aAAa,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;;mEACE;IAuBlD;QAAR,KAAK,EAAE;;;4DASP;IAES;QAAT,MAAM,EAAE;;oEAA8C;IArC5C,2BAA2B;QADvC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;;OACf,2BAA2B,CA6DvC;IAAD,kCAAC;CAAA,AA7DD,CAAoD,sBAAsB,GA6DzE;SA7DY,2BAA2B","sourcesContent":["/* tslint:disable:no-input-rename */\nimport { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\nimport {\n Binding,\n DebugContext,\n Dsl,\n Form,\n Guard,\n IMutableValueModel,\n MutableValueModel,\n TrackExternal\n} from '@coolon/pectin';\nimport { AbstractInputComponent } from './abstract-input.component';\n\n@Component({ template: '' })\nexport class AbstractValueInputComponent<T> extends AbstractInputComponent<T> implements OnInit {\n\n @Input() @TrackExternal({ delegateTo: 'formValueModel' })\n valueModel: Form.ValueModelBase<T> | IMutableValueModel<T>;\n\n /**\n * A backing model for all our @Input() valueModel properties which should be defined as follows.\n *\n * @Input() @TrackExternal({useExisting: \"inputModel\"})\n * valueModel: DirtyTrackingForm.ValueModel<string> | IMutableValueModel<string>;\n *\n * This approach allows the input to accept plain or form models but all backed by a form\n * friendly delegate. We have to use an existing delegate for union types as pectin just\n * gets told it's an Object and can't scan for a base type annotated with @DelegateUsing(..).\n */\n // We have to register it as a disposable so it ditches any listeners when we're disposed.\n protected readonly formValueModel = this.registerDisposable(new Form.DelegatingValueModel<T>());\n\n protected setValueInProgress = new Guard();\n readonly componentValueModel = new MutableValueModel<T>();\n // we need this for plain values otherwise our Form.DelegatingValueModel will stay disabled.\n private plainValueHolder: MutableValueModel<T>;\n\n // We add support for simple direct display of values by allowing components to be used\n // by `component.value = ...` This use of the component without a value model in tables\n // and the like.\n @Input() set value(value: T) {\n this.setValueInProgress.whileTrue(() => {\n if (!this.plainValueHolder) {\n this.plainValueHolder = new MutableValueModel<T>(value);\n this.valueModel = this.plainValueHolder;\n } else {\n this.plainValueHolder.value = value;\n }\n });\n }\n\n @Output() readonly valueChange = new EventEmitter<T>();\n\n constructor() {\n super();\n const { when, chain, valueOf } = Dsl.disposeWith(this);\n const binding = new Binding.Identity(this.formValueModel, this.componentValueModel);\n const inExternalChange = valueOf.any(\n this.setValueInProgress,\n chain(binding.direction).equals(Binding.Direction.RIGHT)\n ).areTruthy();\n\n when(this.componentValueModel).changes((is, was) => {\n this.valueChange.emit(is);\n this.onValueEditedListeners.fire(l => l(is, was));\n }, {\n initialValue: 'ignore',\n // we never fire events during an external set value operation. This allows\n // the component to behave when used in the conventional angular\n // fashion, i.e. [(value)]=\"...\"\n unless: inExternalChange\n });\n DebugContext.tag(this.formValueModel, `${this.constructor.name}.formValueModel`);\n }\n\n}\n"]}
|
|
@@ -667,7 +667,13 @@ let AbstractListInputComponent = class AbstractListInputComponent extends Abstra
|
|
|
667
667
|
// and the like.
|
|
668
668
|
set value(value) {
|
|
669
669
|
this.setValueIsInProgress.whileTrue(() => {
|
|
670
|
-
this.
|
|
670
|
+
if (!this.listHolder) {
|
|
671
|
+
this.listHolder = new MutableListModel(value);
|
|
672
|
+
this.listModel = this.listHolder;
|
|
673
|
+
}
|
|
674
|
+
else {
|
|
675
|
+
this.listHolder.value = value;
|
|
676
|
+
}
|
|
671
677
|
});
|
|
672
678
|
}
|
|
673
679
|
};
|
|
@@ -727,7 +733,13 @@ let AbstractValueInputComponent = class AbstractValueInputComponent extends Abst
|
|
|
727
733
|
// and the like.
|
|
728
734
|
set value(value) {
|
|
729
735
|
this.setValueInProgress.whileTrue(() => {
|
|
730
|
-
this.
|
|
736
|
+
if (!this.plainValueHolder) {
|
|
737
|
+
this.plainValueHolder = new MutableValueModel(value);
|
|
738
|
+
this.valueModel = this.plainValueHolder;
|
|
739
|
+
}
|
|
740
|
+
else {
|
|
741
|
+
this.plainValueHolder.value = value;
|
|
742
|
+
}
|
|
731
743
|
});
|
|
732
744
|
}
|
|
733
745
|
};
|