@coolon/angular-ui-powerups 12.4.0-alpha.47 → 12.4.0-alpha.48
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/assets/interaction/editor/inline-string-editor.scss +5 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-editor-model.js +2 -2
- package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-editor-model.js.map +1 -1
- package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-editor-model.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/package.json +1 -1
- package/schematics/place-routes/place-class-scanner.js +3 -1
- package/schematics/place-routes/place-class-scanner.js.map +1 -1
package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-editor-model.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DelegatingValueModel, Dsl, GarbageCollector, MutableListModel, MutableValueModel, TrackExternal } from '@coolon/pectin';
|
|
1
|
+
import { DelegatingValueModel, Dsl, GarbageCollector, MutableListModel, MutableValueModel, TrackExternal, assert } from '@coolon/pectin';
|
|
2
2
|
export class InlineEditorModel extends GarbageCollector {
|
|
3
3
|
constructor(valueModel, saveCallback) {
|
|
4
4
|
super();
|
|
@@ -7,6 +7,7 @@ export class InlineEditorModel extends GarbageCollector {
|
|
|
7
7
|
this.editing = new MutableValueModel(false);
|
|
8
8
|
this._validators = new MutableListModel();
|
|
9
9
|
this._editingEnabled = this.registerDisposable(new DelegatingValueModel().withDefault(true));
|
|
10
|
+
assert.notNil(valueModel);
|
|
10
11
|
const { when } = Dsl.disposeWith(this);
|
|
11
12
|
when(this.editingEnabled).becomesFalsey(() => this.cancelEdit());
|
|
12
13
|
}
|
|
@@ -29,7 +30,6 @@ export class InlineEditorModel extends GarbageCollector {
|
|
|
29
30
|
this._validators.push(validator);
|
|
30
31
|
return this;
|
|
31
32
|
}
|
|
32
|
-
;
|
|
33
33
|
isEditing() {
|
|
34
34
|
return this.editing.value;
|
|
35
35
|
}
|
package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-editor-model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-editor-model.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/editors/inline-string-editor/inline-editor-model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,GAAG,EACH,gBAAgB,EAEhB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,
|
|
1
|
+
{"version":3,"file":"inline-editor-model.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/editors/inline-string-editor/inline-editor-model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,GAAG,EACH,gBAAgB,EAEhB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EAGb,MAAM,EACP,MAAM,gBAAgB,CAAC;AAIxB,MAAM,OAAO,iBAAqB,SAAQ,gBAAgB;IAMxD,YAAqB,UAAyB,EAAW,YAA+C;QACtG,KAAK,EAAE,CAAC;QADW,eAAU,GAAV,UAAU,CAAe;QAAW,iBAAY,GAAZ,YAAY,CAAmC;QAJ/F,YAAO,GAAG,IAAI,iBAAiB,CAAU,KAAK,CAAC,CAAC;QACxC,gBAAW,GAAmC,IAAI,gBAAgB,EAAgB,CAAC;QAC5F,oBAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,oBAAoB,EAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;QAIvG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;QAC1B,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAA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,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC","sourcesContent":["import {\n DelegatingValueModel,\n Dsl,\n GarbageCollector,\n ListModel,\n MutableListModel,\n MutableValueModel,\n TrackExternal,\n Validator,\n ValueModel,\n assert\n} from '@coolon/pectin';\nimport { EditContext } from '../edit-context';\n\n\nexport class InlineEditorModel<T> extends GarbageCollector {\n\n readonly editing = new MutableValueModel<boolean>(false);\n private readonly _validators: MutableListModel<Validator<T>> = new MutableListModel<Validator<T>>();\n private _editingEnabled = this.registerDisposable(new DelegatingValueModel<boolean>().withDefault(true));\n\n constructor(readonly valueModel: ValueModel<T>, readonly saveCallback: InlineEditorModel.SaveCallback<T>) {\n super();\n assert.notNil(valueModel);\n const { when } = Dsl.disposeWith(this);\n when(this.editingEnabled).becomesFalsey(() => this.cancelEdit());\n }\n\n get editingEnabled(): ValueModel<boolean> {\n return this._editingEnabled.readonly;\n }\n\n disableWhile(condition: ValueModel<boolean>): this {\n const { chain } = Dsl.disposeWith(this);\n this.enableWhile(chain(condition).isFalsey());\n return this;\n }\n\n enableWhile(condition: ValueModel<boolean>): this {\n this._editingEnabled.setDelegate(condition);\n return this;\n }\n\n get validators(): ListModel<Validator<T>> {\n return this._validators.readonly;\n }\n\n validateUsing(validator: Validator<T>): this { //}, options?: HasValidators.Options): this {\n this._validators.push(validator);\n return this;\n }\n\n\n isEditing(): boolean {\n return this.editing.value;\n }\n\n cancelEdit() {\n this.editing.value = false;\n }\n\n startEditing() {\n this.editing.value = true;\n }\n\n}\n\nexport namespace InlineEditorModel {\n\n export type SaveCallback<T> = (value: T, context: EditContext<T>) => void | Promise<void>;\n\n export function create<T>(valueModel: ValueModel<T>, options: { save: SaveCallback<T> }): InlineEditorModel<T> {\n return new InlineEditorModel<T>(valueModel, options.save);\n }\n\n}\n\nTrackExternal.oneTimeBinding(InlineEditorModel);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"InlineEditorModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"InlineEditorModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":15,"character":42},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@coolon/pectin","name":"ValueModel","line":21,"character":35,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":21,"character":46,"context":{"typeName":"T"}}]},{"__symbolic":"select","expression":{"__symbolic":"reference","name":"InlineEditorModel"},"member":"SaveCallback","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":21,"character":104,"context":{"typeName":"T"}}]}]}],"disableWhile":[{"__symbolic":"method"}],"enableWhile":[{"__symbolic":"method"}],"validateUsing":[{"__symbolic":"method"}],"isEditing":[{"__symbolic":"method"}],"cancelEdit":[{"__symbolic":"method"}],"startEditing":[{"__symbolic":"method"}]}}}}]
|
|
@@ -5890,6 +5890,7 @@ class InlineEditorModel extends GarbageCollector {
|
|
|
5890
5890
|
this.editing = new MutableValueModel(false);
|
|
5891
5891
|
this._validators = new MutableListModel();
|
|
5892
5892
|
this._editingEnabled = this.registerDisposable(new DelegatingValueModel().withDefault(true));
|
|
5893
|
+
assert.notNil(valueModel);
|
|
5893
5894
|
const { when } = Dsl.disposeWith(this);
|
|
5894
5895
|
when(this.editingEnabled).becomesFalsey(() => this.cancelEdit());
|
|
5895
5896
|
}
|
|
@@ -5912,7 +5913,6 @@ class InlineEditorModel extends GarbageCollector {
|
|
|
5912
5913
|
this._validators.push(validator);
|
|
5913
5914
|
return this;
|
|
5914
5915
|
}
|
|
5915
|
-
;
|
|
5916
5916
|
isEditing() {
|
|
5917
5917
|
return this.editing.value;
|
|
5918
5918
|
}
|