@realsee/dnalogel
Version:
169 lines (168 loc) • 4.57 kB
JavaScript
import { SvelteComponent as p, init as C, safe_not_equal as I, append_styles as L, element as v, attr as k, set_style as f, insert as b, noop as y, detach as _, onMount as x, onDestroy as B, text as M, space as O, toggle_class as z, append as j, listen as A, is_function as D, set_data as E, binding_callbacks as G } from "../../vendor/svelte/internal/index.js";
import { ROOM_LABEL_BG as R } from "./Assets/roomLabelBg.js";
function S(n) {
L(n, "svelte-qxepni", ".room-label-item.svelte-qxepni{position:absolute;font-size:0.5rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;color:#fff}.room-label-item__text.svelte-qxepni{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-qxepni{position:absolute;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-qxepni{font-size:0.625rem}");
}
function q(n) {
let e, i, l, o, a, m;
return {
c() {
e = v("span"), i = M(
/*content*/
n[0]
), l = O(), o = v("div"), k(e, "class", "room-label-item__text svelte-qxepni"), f(e, "background-image", "url(" + R + ")"), z(
e,
"wide",
/*content*/
n[0].length > 3
), k(o, "class", "room-label-item__bar svelte-qxepni");
},
m(s, r) {
b(s, e, r), j(e, i), b(s, l, r), b(s, o, r), a || (m = A(e, "click", function() {
D(
/*onClick*/
n[4]
) && n[4].apply(this, arguments);
}), a = !0);
},
p(s, r) {
n = s, r & /*content*/
1 && E(
i,
/*content*/
n[0]
), r & /*content*/
1 && z(
e,
"wide",
/*content*/
n[0].length > 3
);
},
d(s) {
s && _(e), s && _(l), s && _(o), a = !1, m();
}
};
}
function F(n) {
let e, i = !/*renderer*/
n[5] && q(n);
return {
c() {
e = v("div"), i && i.c(), k(e, "class", "room-label-item svelte-qxepni"), f(
e,
"z-index",
/*zIndex*/
n[2]
), f(
e,
"transform",
/*transform*/
n[3]
), f(
e,
"opacity",
/*opacity*/
n[1]
), f(
e,
"visibility",
/*visibility*/
n[7]
);
},
m(l, o) {
b(l, e, o), i && i.m(e, null), n[10](e);
},
p(l, [o]) {
/*renderer*/
l[5] ? i && (i.d(1), i = null) : i ? i.p(l, o) : (i = q(l), i.c(), i.m(e, null)), o & /*zIndex*/
4 && f(
e,
"z-index",
/*zIndex*/
l[2]
), o & /*transform*/
8 && f(
e,
"transform",
/*transform*/
l[3]
), o & /*opacity*/
2 && f(
e,
"opacity",
/*opacity*/
l[1]
), o & /*visibility*/
128 && f(
e,
"visibility",
/*visibility*/
l[7]
);
},
i: y,
o: y,
d(l) {
l && _(e), i && i.d(), n[10](null);
}
};
}
function H(n, e, i) {
let l, { content: o } = e, { visible: a } = e, { opacity: m = 1 } = e, { zIndex: s = 0 } = e, { transform: r } = e, { onClick: h = () => {
} } = e, { renderer: c } = e, { data: g } = e, u, d;
x(() => {
u && typeof c == "function" && (d = c(u, g));
}), B(() => {
d == null || d();
});
function w(t) {
G[t ? "unshift" : "push"](() => {
u = t, i(6, u);
});
}
return n.$$set = (t) => {
"content" in t && i(0, o = t.content), "visible" in t && i(8, a = t.visible), "opacity" in t && i(1, m = t.opacity), "zIndex" in t && i(2, s = t.zIndex), "transform" in t && i(3, r = t.transform), "onClick" in t && i(4, h = t.onClick), "renderer" in t && i(5, c = t.renderer), "data" in t && i(9, g = t.data);
}, n.$$.update = () => {
n.$$.dirty & /*visible*/
256 && i(7, l = a ? "visible" : "hidden");
}, [
o,
m,
s,
r,
h,
c,
u,
l,
a,
g,
w
];
}
class N extends p {
constructor(e) {
super(), C(
this,
e,
H,
F,
I,
{
content: 0,
visible: 8,
opacity: 1,
zIndex: 2,
transform: 3,
onClick: 4,
renderer: 5,
data: 9
},
S
);
}
}
export {
N as LabelItem
};