|
|
|
/* generated by Svelte vX.Y.Z */
|
|
|
|
import { SvelteComponent as SvelteComponent_1, addResizeListener, add_render_callback, createElement, detachNode, flush, init, insert, noop, run, safe_not_equal } from "svelte/internal.js";
|
|
|
|
|
|
|
|
function create_fragment(component, ctx) {
|
|
|
|
var div, div_resize_listener, current;
|
|
|
|
|
|
|
|
return {
|
|
|
|
c() {
|
|
|
|
div = createElement("div");
|
|
|
|
div.textContent = "some content";
|
|
|
|
add_render_callback(() => ctx.div_resize_handler.call(div));
|
|
|
|
},
|
|
|
|
|
|
|
|
m(target, anchor) {
|
|
|
|
insert(target, div, anchor);
|
|
|
|
div_resize_listener = addResizeListener(div, ctx.div_resize_handler);
|
|
|
|
current = true;
|
|
|
|
},
|
|
|
|
|
|
|
|
p: noop,
|
|
|
|
|
|
|
|
i(target, anchor) {
|
|
|
|
if (current) return;
|
|
|
|
this.m(target, anchor);
|
|
|
|
},
|
|
|
|
|
|
|
|
o: run,
|
|
|
|
|
|
|
|
d(detach) {
|
|
|
|
if (detach) {
|
|
|
|
detachNode(div);
|
|
|
|
}
|
|
|
|
|
|
|
|
div_resize_listener.cancel();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
function define($$self, $$props, $$make_dirty) {
|
|
|
|
let { w, h } = $$props;
|
|
|
|
|
|
|
|
function div_resize_handler() {
|
|
|
|
w = this.offsetWidth;
|
|
|
|
h = this.offsetHeight;
|
|
|
|
$$make_dirty('w');
|
|
|
|
$$make_dirty('h');
|
|
|
|
}
|
|
|
|
|
|
|
|
$$self.$$.get = () => ({ w, h, div_resize_handler });
|
|
|
|
|
|
|
|
$$self.$$.set = $$props => {
|
|
|
|
if ('w' in $$props) w = $$props.w;
|
|
|
|
if ('h' in $$props) h = $$props.h;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
class SvelteComponent extends SvelteComponent_1 {
|
|
|
|
constructor(options) {
|
|
|
|
super();
|
|
|
|
init(this, options, define, create_fragment, safe_not_equal);
|
|
|
|
}
|
|
|
|
|
|
|
|
get w() {
|
|
|
|
return this.$$.get().w;
|
|
|
|
}
|
|
|
|
|
|
|
|
set w(value) {
|
|
|
|
this.$set({ w: value });
|
|
|
|
flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
get h() {
|
|
|
|
return this.$$.get().h;
|
|
|
|
}
|
|
|
|
|
|
|
|
set h(value) {
|
|
|
|
this.$set({ h: value });
|
|
|
|
flush();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SvelteComponent;
|