@coolon/angular-ui-powerups 2.0.0-alpha.25 → 2.0.0-alpha.26

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.
@@ -22,7 +22,7 @@ let AbstractListInputComponent = class AbstractListInputComponent extends Abstra
22
22
  this.setValueIsInProgress = new Guard();
23
23
  this.valueChange = new EventEmitter();
24
24
  const { when, valueOf, chain } = Dsl.disposeWith(this);
25
- const binding = new Binding.Identity(this.formValueModel, this.componentListModel);
25
+ const binding = new Binding.Identity(this.formValueModel, this.componentListModel).writeRight();
26
26
  const inExternalChange = valueOf.any(this.setValueIsInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
27
27
  when(this.componentListModel).changes((is, was) => {
28
28
  this.valueChange.emit(is);
@@ -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;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,EAAK,CAAC;QAEhD,yBAAoB,GAAG,IAAI,KAAK,EAAE,CAAC;QAkBxB,gBAAW,GAAG,IAAI,YAA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AI,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
+ {"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,gBAAg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EAAE;gBACpB,IAAI,CAAC,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).writeRight();\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"]}
@@ -22,7 +22,7 @@ let AbstractValueInputComponent = class AbstractValueInputComponent extends Abst
22
22
  this.componentValueModel = new MutableValueModel();
23
23
  this.valueChange = new EventEmitter();
24
24
  const { when, chain, valueOf } = Dsl.disposeWith(this);
25
- const binding = new Binding.Identity(this.formValueModel, this.componentValueModel);
25
+ const binding = new Binding.Identity(this.formValueModel, this.componentValueModel).writeRight();
26
26
  const inExternalChange = valueOf.any(this.setValueInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
27
27
  when(this.componentValueModel).changes((is, was) => {
28
28
  this.valueChange.emit(is);
@@ -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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AAE,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACpD,CAAC,EAAE;YACD,YAAY,EAAE,QAAQ;YACtB,2EAA2E;YAC3E,gEAAgE;YAChE,gCAAgC;YAChC,MAAM,EAAE,gBAAgB;SACzB,CAAC,CAAC;QACH,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,iBAAiB,CAAC,CAAC;IACnF,CAAC;IApCD,uFAAuF;IACvF,wFAAwF;IACxF,gBAAgB;IACP,IAAI,KAAK,CAAC,KAAQ;QACzB,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,GAAG,EAAE;YACrC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,iBAAiB,CAAI,KAAK,CAAC,CAAC;gBACxD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC;aACzC;iBAAM;gBACL,IAAI,CAAC,gBAAgB,CAAC,KAAK,GAAG,KAAK,CAAC;aACrC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CA0BF,CAAA;AA1DC;IADC,KAAK,EAAE,EAAE,aAAa,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;;+DACE;AAuBlD;IAAR,KAAK,EAAE;;;wDASP;AAES;IAAT,MAAM,EAAE;;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
+ {"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,UAAU,EAAE,CAAC;QACjG,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAClC,IAAI,CAAC,kBAAkB,EACvB,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CACzD,CAAC,SAAS,EAAE,CAAC;QAEd,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,GAAG,EAAE,EAAE;YACjD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC1B,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,CAAC;QACpD,CAAC,EAAE;YACD,YAAY,EAAE,QAAQ;YACtB,2EAA2E;YAC3E,gEAAgE;YAChE,gCAAgC;YAChC,MAAM,EAAE,gBAAgB;SACzB,CAAC,CAAC;QACH,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,iBAAiB,CAAC,CAAC;IACnF,CAAC;IApCD,uFAAuF;IACvF,wFAAwF;IACxF,gBAAgB;IACP,IAAI,KAAK,CAAC,KAAQ;QACzB,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,GAAG,EAAE;YACrC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE;gBAC1B,IAAI,CAAC,gBAAgB,GAAG,IAAI,iBAAiB,CAAI,KAAK,CAAC,CAAC;gBACxD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC;aACzC;iBAAM;gBACL,IAAI,CAAC,gBAAgB,CAAC,KAAK,GAAG,KAAK,CAAC;aACrC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CA0BF,CAAA;AA1DC;IADC,KAAK,EAAE,EAAE,aAAa,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC;;+DACE;AAuBlD;IAAR,KAAK,EAAE;;;wDASP;AAES;IAAT,MAAM,EAAE;;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).writeRight();\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"]}
@@ -23,7 +23,7 @@ var AbstractListInputComponent = /** @class */ (function (_super) {
23
23
  _this.setValueIsInProgress = new Guard();
24
24
  _this.valueChange = new EventEmitter();
25
25
  var _a = Dsl.disposeWith(_this), when = _a.when, valueOf = _a.valueOf, chain = _a.chain;
26
- var binding = new Binding.Identity(_this.formValueModel, _this.componentListModel);
26
+ var binding = new Binding.Identity(_this.formValueModel, _this.componentListModel).writeRight();
27
27
  var inExternalChange = valueOf.any(_this.setValueIsInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
28
28
  when(_this.componentListModel).changes(function (is, was) {
29
29
  _this.valueChange.emit(is);
@@ -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;IAuC5E;QAAA,YACE,iBAAO,SAmBR;QAtDD;;;;;;;;;WASG;QACD,0FAA0F;QACzE,oBAAc,GAAG,KAAI,CAAC,kBAAkB,CAAC,IAAI,IAAI,CAAC,mBAAmB,EAAK,CAAC,CAAC;QACtF,wBAAkB,GAAG,IAAI,gBAAgB,EAAK,CAAC;QAEhD,0BAAoB,GAAG,IAAI,KAAK,EAAE,CAAC;QAkBxB,iBAAW,GAAG,IAAI,YAAY,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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"]}
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;IAuC5E;QAAA,YACE,iBAAO,SAmBR;QAtDD;;;;;;;;;WASG;QACD,0FAA0F;QACzE,oBAAc,GAAG,KAAI,CAAC,kBAAkB,CAAC,IAAI,IAAI,CAAC,mBAAmB,EAAK,CAAC,CAAC;QACtF,wBAAkB,GAAG,IAAI,gBAAgB,EAAK,CAAC;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I,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).writeRight();\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"]}
@@ -23,7 +23,7 @@ var AbstractValueInputComponent = /** @class */ (function (_super) {
23
23
  _this.componentValueModel = new MutableValueModel();
24
24
  _this.valueChange = new EventEmitter();
25
25
  var _a = Dsl.disposeWith(_this), when = _a.when, chain = _a.chain, valueOf = _a.valueOf;
26
- var binding = new Binding.Identity(_this.formValueModel, _this.componentValueModel);
26
+ var binding = new Binding.Identity(_this.formValueModel, _this.componentValueModel).writeRight();
27
27
  var inExternalChange = valueOf.any(_this.setValueInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
28
28
  when(_this.componentValueModel).changes(function (is, was) {
29
29
  _this.valueChange.emit(is);
@@ -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"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,CAAC,EAAV,CAAU,CAAC,CAAC;QACpD,CAAC,EAAE;YACD,YAAY,EAAE,QAAQ;YACtB,2EAA2E;YAC3E,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,8CAAK;QAHlB,uFAAuF;QACvF,wFAAwF;QACxF,gBAAgB;aACP,UAAU,KAAQ;YAA3B,iBASC;YARC,IAAI,CAAC,kBAAkB,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"]}
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,KAAI,CAAC,kBAAkB,CAAC,IAAI,IAAI,CAAC,oBAAoB,EAAK,CAAC,CAAC;QAEtF,wBAAkB,GAAG,IAAI,KAAK,EAAE,CAAC;QAClC,yBAAmB,GAAG,IAAI,iBAAiB,EAAK,CAAC;QAkBvC,iBAAW,GAAG,IAAI,YAAY,EAAK,CAAC;QAI/C,IAAA,2BAAgD,EAA9C,cAAI,EAAE,gBAAK,EAAE,oBAAiC,CAAC;QACvD,IAAM,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAI,CAAC,cAAc,EAAE,KAAI,CAAC,mBAAmB,CAAC,CAAC,UAAU,EAAE,CAAC;QACjG,IAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAClC,KAAI,CAAC,kBAAkB,EACvB,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CACzD,CAAC,SAAS,EAAE,CAAC;QAEd,IAAI,CAAC,KAAI,CAAC,mBAAmB,CAAC,CAAC,OAAO,CAAC,UAAC,EAAE,EAAE,GAAG;YAC7C,KAAI,CAAC,WAAW,CAAC,I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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).writeRight();\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"]}
@@ -649,7 +649,7 @@ let AbstractListInputComponent = class AbstractListInputComponent extends Abstra
649
649
  this.setValueIsInProgress = new Guard();
650
650
  this.valueChange = new EventEmitter();
651
651
  const { when, valueOf, chain } = Dsl.disposeWith(this);
652
- const binding = new Binding.Identity(this.formValueModel, this.componentListModel);
652
+ const binding = new Binding.Identity(this.formValueModel, this.componentListModel).writeRight();
653
653
  const inExternalChange = valueOf.any(this.setValueIsInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
654
654
  when(this.componentListModel).changes((is, was) => {
655
655
  this.valueChange.emit(is);
@@ -715,7 +715,7 @@ let AbstractValueInputComponent = class AbstractValueInputComponent extends Abst
715
715
  this.componentValueModel = new MutableValueModel();
716
716
  this.valueChange = new EventEmitter();
717
717
  const { when, chain, valueOf } = Dsl.disposeWith(this);
718
- const binding = new Binding.Identity(this.formValueModel, this.componentValueModel);
718
+ const binding = new Binding.Identity(this.formValueModel, this.componentValueModel).writeRight();
719
719
  const inExternalChange = valueOf.any(this.setValueInProgress, chain(binding.direction).equals(Binding.Direction.RIGHT)).areTruthy();
720
720
  when(this.componentValueModel).changes((is, was) => {
721
721
  this.valueChange.emit(is);