|
|
|
@ -5,6 +5,12 @@ function assign(tar, src) {
|
|
|
|
|
return tar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addLoc(element, file, line, column, char) {
|
|
|
|
|
element.__svelte_meta = {
|
|
|
|
|
loc: { file, line, column, char }
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function append(target, node) {
|
|
|
|
|
target.appendChild(node);
|
|
|
|
|
}
|
|
|
|
@ -49,6 +55,13 @@ function destroy(detach) {
|
|
|
|
|
this._state = {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function destroyDev(detach) {
|
|
|
|
|
destroy.call(this, detach);
|
|
|
|
|
this.destroy = function() {
|
|
|
|
|
console.warn('Component was already destroyed');
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function _differs(a, b) {
|
|
|
|
|
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
|
|
|
|
|
}
|
|
|
|
@ -128,6 +141,17 @@ function _set(newState) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setDev(newState) {
|
|
|
|
|
if (typeof newState !== 'object') {
|
|
|
|
|
throw new Error(
|
|
|
|
|
this._debugName + '.set was called without an object of data key-values to update.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this._checkReadOnly(newState);
|
|
|
|
|
set.call(this, newState);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function callAll(fns) {
|
|
|
|
|
while (fns && fns.length) fns.shift()();
|
|
|
|
|
}
|
|
|
|
@ -136,12 +160,12 @@ function _mount(target, anchor) {
|
|
|
|
|
this._fragment[this._fragment.i ? 'i' : 'm'](target, anchor || null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var proto = {
|
|
|
|
|
destroy,
|
|
|
|
|
var protoDev = {
|
|
|
|
|
destroy: destroyDev,
|
|
|
|
|
get,
|
|
|
|
|
fire,
|
|
|
|
|
on,
|
|
|
|
|
set,
|
|
|
|
|
set: setDev,
|
|
|
|
|
_recompute: noop,
|
|
|
|
|
_set,
|
|
|
|
|
_mount,
|
|
|
|
@ -150,6 +174,8 @@ var proto = {
|
|
|
|
|
|
|
|
|
|
/* generated by Svelte vX.Y.Z */
|
|
|
|
|
|
|
|
|
|
const file = undefined;
|
|
|
|
|
|
|
|
|
|
function create_main_fragment(component, ctx) {
|
|
|
|
|
var text, p, text_1, text_2;
|
|
|
|
|
|
|
|
|
@ -162,7 +188,7 @@ function create_main_fragment(component, ctx) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
c() {
|
|
|
|
|
c: function create() {
|
|
|
|
|
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
|
|
|
each_blocks[i].c();
|
|
|
|
|
}
|
|
|
|
@ -171,9 +197,10 @@ function create_main_fragment(component, ctx) {
|
|
|
|
|
p = createElement("p");
|
|
|
|
|
text_1 = createText("foo: ");
|
|
|
|
|
text_2 = createText(ctx.foo);
|
|
|
|
|
addLoc(p, file, 5, 0, 91);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
m(target, anchor) {
|
|
|
|
|
m: function mount(target, anchor) {
|
|
|
|
|
for (var i = 0; i < each_blocks.length; i += 1) {
|
|
|
|
|
each_blocks[i].m(target, anchor);
|
|
|
|
|
}
|
|
|
|
@ -184,7 +211,7 @@ function create_main_fragment(component, ctx) {
|
|
|
|
|
append(p, text_2);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
p(changed, ctx) {
|
|
|
|
|
p: function update(changed, ctx) {
|
|
|
|
|
if (changed.things) {
|
|
|
|
|
each_value = ctx.things;
|
|
|
|
|
|
|
|
|
@ -211,7 +238,7 @@ function create_main_fragment(component, ctx) {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
d(detach) {
|
|
|
|
|
d: function destroy$$1(detach) {
|
|
|
|
|
destroyEach(each_blocks, detach);
|
|
|
|
|
|
|
|
|
|
if (detach) {
|
|
|
|
@ -227,7 +254,7 @@ function create_each_block(component, ctx) {
|
|
|
|
|
var span, text_value = ctx.thing.name, text, text_1;
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
c() {
|
|
|
|
|
c: function create() {
|
|
|
|
|
span = createElement("span");
|
|
|
|
|
text = createText(text_value);
|
|
|
|
|
text_1 = createText("\n\t");
|
|
|
|
@ -235,15 +262,16 @@ function create_each_block(component, ctx) {
|
|
|
|
|
const { foo, bar, baz, thing } = ctx;
|
|
|
|
|
console.log({ foo, bar, baz, thing });
|
|
|
|
|
debugger;
|
|
|
|
|
addLoc(span, file, 1, 1, 25);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
m(target, anchor) {
|
|
|
|
|
m: function mount(target, anchor) {
|
|
|
|
|
insert(target, span, anchor);
|
|
|
|
|
append(span, text);
|
|
|
|
|
insert(target, text_1, anchor);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
p(changed, ctx) {
|
|
|
|
|
p: function update(changed, ctx) {
|
|
|
|
|
if ((changed.things) && text_value !== (text_value = ctx.thing.name)) {
|
|
|
|
|
setData(text, text_value);
|
|
|
|
|
}
|
|
|
|
@ -255,7 +283,7 @@ function create_each_block(component, ctx) {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
d(detach) {
|
|
|
|
|
d: function destroy$$1(detach) {
|
|
|
|
|
if (detach) {
|
|
|
|
|
detachNode(span);
|
|
|
|
|
detachNode(text_1);
|
|
|
|
@ -273,18 +301,28 @@ function get_each_context(ctx, list, i) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function SvelteComponent(options) {
|
|
|
|
|
this._debugName = '<SvelteComponent>';
|
|
|
|
|
if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");
|
|
|
|
|
init(this, options);
|
|
|
|
|
this._state = assign({}, options.data);
|
|
|
|
|
if (!('things' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'things'");
|
|
|
|
|
if (!('foo' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'foo'");
|
|
|
|
|
if (!('bar' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'bar'");
|
|
|
|
|
if (!('baz' in this._state)) console.warn("<SvelteComponent> was created without expected data property 'baz'");
|
|
|
|
|
this._intro = true;
|
|
|
|
|
|
|
|
|
|
this._fragment = create_main_fragment(this, this._state);
|
|
|
|
|
|
|
|
|
|
if (options.target) {
|
|
|
|
|
if (options.hydrate) throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
|
|
|
this._fragment.c();
|
|
|
|
|
this._mount(options.target, options.anchor);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
assign(SvelteComponent.prototype, proto);
|
|
|
|
|
assign(SvelteComponent.prototype, protoDev);
|
|
|
|
|
|
|
|
|
|
SvelteComponent.prototype._checkReadOnly = function _checkReadOnly(newState) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default SvelteComponent;
|
|
|
|
|
export default SvelteComponent;
|
|
|
|
|