Skip to content

Commit 4147707

Browse files
chore(git): add missed files
1 parent 0248d31 commit 4147707

File tree

2 files changed

+100
-0
lines changed

2 files changed

+100
-0
lines changed

dist/amd/compose.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
define(['exports', 'aurelia-dependency-injection', 'aurelia-templating'], function (exports, _aureliaDependencyInjection, _aureliaTemplating) {
2+
'use strict';
3+
4+
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
5+
6+
exports.__esModule = true;
7+
8+
var Compose = (function () {
9+
function Compose(container, compositionEngine, viewSlot, viewResources) {
10+
_classCallCheck(this, _Compose);
11+
12+
this.container = container;
13+
this.compositionEngine = compositionEngine;
14+
this.viewSlot = viewSlot;
15+
this.viewResources = viewResources;
16+
}
17+
18+
var _Compose = Compose;
19+
20+
_Compose.prototype.bind = function bind(executionContext) {
21+
this.executionContext = executionContext;
22+
processInstruction(this, { view: this.view, viewModel: this.viewModel, model: this.model });
23+
};
24+
25+
_Compose.prototype.modelChanged = function modelChanged(newValue, oldValue) {
26+
var vm = this.currentViewModel;
27+
28+
if (vm && typeof vm.activate === 'function') {
29+
vm.activate(newValue);
30+
}
31+
};
32+
33+
_Compose.prototype.viewChanged = function viewChanged(newValue, oldValue) {
34+
processInstruction(this, { view: newValue, viewModel: this.currentViewModel || this.viewModel, model: this.model });
35+
};
36+
37+
_Compose.prototype.viewModelChanged = function viewModelChanged(newValue, oldValue) {
38+
processInstruction(this, { viewModel: newValue, view: this.view, model: this.model });
39+
};
40+
41+
Compose = _aureliaDependencyInjection.inject(_aureliaDependencyInjection.Container, _aureliaTemplating.CompositionEngine, _aureliaTemplating.ViewSlot, _aureliaTemplating.ViewResources)(Compose) || Compose;
42+
Compose = _aureliaTemplating.noView(Compose) || Compose;
43+
Compose = _aureliaTemplating.bindable('viewModel')(Compose) || Compose;
44+
Compose = _aureliaTemplating.bindable('view')(Compose) || Compose;
45+
Compose = _aureliaTemplating.bindable('model')(Compose) || Compose;
46+
Compose = _aureliaTemplating.customElement('compose')(Compose) || Compose;
47+
return Compose;
48+
})();
49+
50+
exports.Compose = Compose;
51+
52+
function processInstruction(composer, instruction) {
53+
composer.compositionEngine.compose(Object.assign(instruction, {
54+
executionContext: composer.executionContext,
55+
container: composer.container,
56+
viewSlot: composer.viewSlot,
57+
viewResources: composer.viewResources,
58+
currentBehavior: composer.currentBehavior
59+
})).then(function (next) {
60+
composer.currentBehavior = next;
61+
composer.currentViewModel = next ? next.executionContext : null;
62+
});
63+
}
64+
});

dist/commonjs/with.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
'use strict';
2+
3+
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } };
4+
5+
exports.__esModule = true;
6+
7+
var _inject = require('aurelia-dependency-injection');
8+
9+
var _BoundViewFactory$ViewSlot$customAttribute$templateController = require('aurelia-templating');
10+
11+
var With = (function () {
12+
function With(viewFactory, viewSlot) {
13+
_classCallCheck(this, _With);
14+
15+
this.viewFactory = viewFactory;
16+
this.viewSlot = viewSlot;
17+
}
18+
19+
var _With = With;
20+
21+
_With.prototype.valueChanged = function valueChanged(newValue) {
22+
if (!this.view) {
23+
this.view = this.viewFactory.create(newValue);
24+
this.viewSlot.add(this.view);
25+
} else {
26+
this.view.bind(newValue);
27+
}
28+
};
29+
30+
With = _inject.inject(_BoundViewFactory$ViewSlot$customAttribute$templateController.BoundViewFactory, _BoundViewFactory$ViewSlot$customAttribute$templateController.ViewSlot)(With) || With;
31+
With = _BoundViewFactory$ViewSlot$customAttribute$templateController.templateController(With) || With;
32+
With = _BoundViewFactory$ViewSlot$customAttribute$templateController.customAttribute('with')(With) || With;
33+
return With;
34+
})();
35+
36+
exports.With = With;

0 commit comments

Comments
 (0)