kanbancast-components
Advanced tools
Comparing version
@@ -58,5 +58,5 @@ import { LitElement } from 'lit'; | ||
order: number; | ||
votes?: number | undefined; | ||
votes?: number; | ||
status_id: number; | ||
comments?: Comment[] | undefined; | ||
comments?: Comment[]; | ||
}[]; | ||
@@ -63,0 +63,0 @@ handleTitleChange(e: Event): void; |
@@ -1,2 +0,2 @@ | ||
import { css as _, LitElement as T, html as u } from "lit"; | ||
import { css as _, LitElement as T, html as m } from "lit"; | ||
/** | ||
@@ -17,7 +17,6 @@ * @license | ||
*/ | ||
const f = globalThis, x = f.ShadowRoot && (f.ShadyCSS === void 0 || f.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, E = Symbol(), k = /* @__PURE__ */ new WeakMap(); | ||
const b = globalThis, x = b.ShadowRoot && (b.ShadyCSS === void 0 || b.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, E = Symbol(), k = /* @__PURE__ */ new WeakMap(); | ||
let U = class { | ||
constructor(t, e, o) { | ||
if (this._$cssResult$ = !0, o !== E) | ||
throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); | ||
if (this._$cssResult$ = !0, o !== E) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); | ||
this.cssText = t, this.t = e; | ||
@@ -39,13 +38,10 @@ } | ||
const j = (s) => new U(typeof s == "string" ? s : s + "", void 0, E), A = (s, t) => { | ||
if (x) | ||
s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); | ||
else | ||
for (const e of t) { | ||
const o = document.createElement("style"), i = f.litNonce; | ||
i !== void 0 && o.setAttribute("nonce", i), o.textContent = e.cssText, s.appendChild(o); | ||
} | ||
if (x) s.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet); | ||
else for (const e of t) { | ||
const o = document.createElement("style"), i = b.litNonce; | ||
i !== void 0 && o.setAttribute("nonce", i), o.textContent = e.cssText, s.appendChild(o); | ||
} | ||
}, $ = x ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => { | ||
let e = ""; | ||
for (const o of t.cssRules) | ||
e += o.cssText; | ||
for (const o of t.cssRules) e += o.cssText; | ||
return j(e); | ||
@@ -58,6 +54,6 @@ })(s) : s; | ||
*/ | ||
const { is: L, defineProperty: O, getOwnPropertyDescriptor: M, getOwnPropertyNames: D, getOwnPropertySymbols: R, getPrototypeOf: V } = Object, d = globalThis, C = d.trustedTypes, z = C ? C.emptyScript : "", w = d.reactiveElementPolyfillSupport, g = (s, t) => s, b = { toAttribute(s, t) { | ||
const { is: L, defineProperty: O, getOwnPropertyDescriptor: M, getOwnPropertyNames: D, getOwnPropertySymbols: R, getPrototypeOf: z } = Object, d = globalThis, C = d.trustedTypes, V = C ? C.emptyScript : "", y = d.reactiveElementPolyfillSupport, f = (s, t) => s, w = { toAttribute(s, t) { | ||
switch (t) { | ||
case Boolean: | ||
s = s ? z : null; | ||
s = s ? V : null; | ||
break; | ||
@@ -87,5 +83,5 @@ case Object: | ||
return e; | ||
} }, v = (s, t) => !L(s, t), S = { attribute: !0, type: String, converter: b, reflect: !1, hasChanged: v }; | ||
} }, v = (s, t) => !L(s, t), S = { attribute: !0, type: String, converter: w, reflect: !1, hasChanged: v }; | ||
Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), d.litPropertyMetadata ?? (d.litPropertyMetadata = /* @__PURE__ */ new WeakMap()); | ||
class m extends HTMLElement { | ||
class g extends HTMLElement { | ||
static addInitializer(t) { | ||
@@ -120,14 +116,11 @@ this._$Ei(), (this.l ?? (this.l = [])).push(t); | ||
static _$Ei() { | ||
if (this.hasOwnProperty(g("elementProperties"))) | ||
return; | ||
const t = V(this); | ||
if (this.hasOwnProperty(f("elementProperties"))) return; | ||
const t = z(this); | ||
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties); | ||
} | ||
static finalize() { | ||
if (this.hasOwnProperty(g("finalized"))) | ||
return; | ||
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(g("properties"))) { | ||
if (this.hasOwnProperty(f("finalized"))) return; | ||
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(f("properties"))) { | ||
const e = this.properties, o = [...D(e), ...R(e)]; | ||
for (const i of o) | ||
this.createProperty(i, e[i]); | ||
for (const i of o) this.createProperty(i, e[i]); | ||
} | ||
@@ -137,5 +130,3 @@ const t = this[Symbol.metadata]; | ||
const e = litPropertyMetadata.get(t); | ||
if (e !== void 0) | ||
for (const [o, i] of e) | ||
this.elementProperties.set(o, i); | ||
if (e !== void 0) for (const [o, i] of e) this.elementProperties.set(o, i); | ||
} | ||
@@ -153,6 +144,4 @@ this._$Eh = /* @__PURE__ */ new Map(); | ||
const o = new Set(t.flat(1 / 0).reverse()); | ||
for (const i of o) | ||
e.unshift($(i)); | ||
} else | ||
t !== void 0 && e.push($(t)); | ||
for (const i of o) e.unshift($(i)); | ||
} else t !== void 0 && e.push($(t)); | ||
return e; | ||
@@ -181,4 +170,3 @@ } | ||
const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties; | ||
for (const o of e.keys()) | ||
this.hasOwnProperty(o) && (t.set(o, this[o]), delete this[o]); | ||
for (const o of e.keys()) this.hasOwnProperty(o) && (t.set(o, this[o]), delete this[o]); | ||
t.size > 0 && (this._$Ep = t); | ||
@@ -213,3 +201,3 @@ } | ||
if (i !== void 0 && o.reflect === !0) { | ||
const r = (((n = o.converter) == null ? void 0 : n.toAttribute) !== void 0 ? o.converter : b).toAttribute(e, o.type); | ||
const r = (((n = o.converter) == null ? void 0 : n.toAttribute) !== void 0 ? o.converter : w).toAttribute(e, o.type); | ||
this._$Em = t, r == null ? this.removeAttribute(i) : this.setAttribute(i, r), this._$Em = null; | ||
@@ -222,3 +210,3 @@ } | ||
if (i !== void 0 && this._$Em !== i) { | ||
const r = o.getPropertyOptions(i), l = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((n = r.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? r.converter : b; | ||
const r = o.getPropertyOptions(i), l = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((n = r.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? r.converter : w; | ||
this._$Em = i, this[i] = l.fromAttribute(e, r.type), this._$Em = null; | ||
@@ -229,4 +217,3 @@ } | ||
if (t !== void 0) { | ||
if (o ?? (o = this.constructor.getPropertyOptions(t)), !(o.hasChanged ?? v)(this[t], e)) | ||
return; | ||
if (o ?? (o = this.constructor.getPropertyOptions(t)), !(o.hasChanged ?? v)(this[t], e)) return; | ||
this.P(t, e, o); | ||
@@ -254,14 +241,10 @@ } | ||
var o; | ||
if (!this.isUpdatePending) | ||
return; | ||
if (!this.isUpdatePending) return; | ||
if (!this.hasUpdated) { | ||
if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) { | ||
for (const [n, r] of this._$Ep) | ||
this[n] = r; | ||
for (const [n, r] of this._$Ep) this[n] = r; | ||
this._$Ep = void 0; | ||
} | ||
const i = this.constructor.elementProperties; | ||
if (i.size > 0) | ||
for (const [n, r] of i) | ||
r.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], r); | ||
if (i.size > 0) for (const [n, r] of i) r.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], r); | ||
} | ||
@@ -309,3 +292,3 @@ let t = !1; | ||
} | ||
m.elementStyles = [], m.shadowRootOptions = { mode: "open" }, m[g("elementProperties")] = /* @__PURE__ */ new Map(), m[g("finalized")] = /* @__PURE__ */ new Map(), w == null || w({ ReactiveElement: m }), (d.reactiveElementVersions ?? (d.reactiveElementVersions = [])).push("2.0.4"); | ||
g.elementStyles = [], g.shadowRootOptions = { mode: "open" }, g[f("elementProperties")] = /* @__PURE__ */ new Map(), g[f("finalized")] = /* @__PURE__ */ new Map(), y == null || y({ ReactiveElement: g }), (d.reactiveElementVersions ?? (d.reactiveElementVersions = [])).push("2.0.4"); | ||
/** | ||
@@ -316,3 +299,3 @@ * @license | ||
*/ | ||
const q = { attribute: !0, type: String, converter: b, reflect: !1, hasChanged: v }, I = (s = q, t, e) => { | ||
const q = { attribute: !0, type: String, converter: w, reflect: !1, hasChanged: v }, I = (s = q, t, e) => { | ||
const { kind: o, metadata: i } = e; | ||
@@ -323,4 +306,4 @@ let n = globalThis.litPropertyMetadata.get(i); | ||
return { set(l) { | ||
const y = t.get.call(this); | ||
t.set.call(this, l), this.requestUpdate(r, y, s); | ||
const p = t.get.call(this); | ||
t.set.call(this, l), this.requestUpdate(r, p, s); | ||
}, init(l) { | ||
@@ -333,4 +316,4 @@ return l !== void 0 && this.P(r, void 0, s), l; | ||
return function(l) { | ||
const y = this[r]; | ||
t.call(this, l), this.requestUpdate(r, y, s); | ||
const p = this[r]; | ||
t.call(this, l), this.requestUpdate(r, p, s); | ||
}; | ||
@@ -340,3 +323,3 @@ } | ||
}; | ||
function p(s) { | ||
function h(s) { | ||
return (t, e) => typeof e == "object" ? I(s, t, e) : ((o, i, n) => { | ||
@@ -352,4 +335,4 @@ const r = i.hasOwnProperty(n); | ||
*/ | ||
function h(s) { | ||
return p({ ...s, state: !0, attribute: !1 }); | ||
function u(s) { | ||
return h({ ...s, state: !0, attribute: !1 }); | ||
} | ||
@@ -607,3 +590,3 @@ /** | ||
render() { | ||
return u` | ||
return m` | ||
<div> | ||
@@ -642,7 +625,7 @@ <div style="background-color: ${this.containerColor}" class="container"> | ||
${this.tasksForSelectedTab.map((s) => { | ||
var i, n; | ||
var i, n, r, l; | ||
const { emoji: t, bgColor: e, textColor: o } = this.getStatusStyles( | ||
((i = s.status) == null ? void 0 : i.title) ?? "" | ||
); | ||
return u` | ||
return m` | ||
<li class="task-item"> | ||
@@ -689,2 +672,3 @@ <div class="task-details-container"> | ||
${this.showComments[s.id] ? "Hide Comments" : "Show Comments"} | ||
${s.comments != null && ((r = s.comments) == null ? void 0 : r.length) > 0 ? `(${(l = s.comments) == null ? void 0 : l.length})` : ""} | ||
<svg | ||
@@ -745,10 +729,10 @@ version="1.1" | ||
</li> | ||
${this.showComments[s.id] ? u` | ||
${this.showComments[s.id] ? m` | ||
<div class="comments-section"> | ||
<div> | ||
${s.comments && s.comments.map( | ||
(r) => u` | ||
(p) => m` | ||
<p class="comment-item"> | ||
<button | ||
@click=${() => this.upvoteComment(r)} | ||
@click=${() => this.upvoteComment(p)} | ||
class="upvote-comment" | ||
@@ -770,6 +754,6 @@ > | ||
<span | ||
>${this.commentVotes[r.id] ?? 0}</span | ||
>${this.commentVotes[p.id] ?? 0}</span | ||
> | ||
</button> | ||
<span>${r.content}</span> | ||
<span>${p.content}</span> | ||
</p> | ||
@@ -793,3 +777,3 @@ ` | ||
</div> | ||
` : u``} | ||
` : m``} | ||
`; | ||
@@ -801,3 +785,3 @@ })} | ||
this.showModal, | ||
() => u` <div> | ||
() => m` <div> | ||
<div class="dialog"> | ||
@@ -954,2 +938,3 @@ <div class="overlay" @click="${() => this.showModal = !1}"> | ||
cursor: pointer; | ||
font-size: 16px; | ||
} | ||
@@ -959,2 +944,3 @@ | ||
background-color: white; | ||
font-weight: 600; | ||
} | ||
@@ -1023,3 +1009,3 @@ | ||
font-size: large; | ||
font-weight: 600; | ||
font-weight: 500; | ||
padding-bottom: 0; | ||
@@ -1177,39 +1163,39 @@ margin-bottom: 0; | ||
c([ | ||
p({ type: Array }) | ||
h({ type: Array }) | ||
], a.prototype, "statuses", 2); | ||
c([ | ||
p({ type: Number }) | ||
h({ type: Number }) | ||
], a.prototype, "projectId", 2); | ||
c([ | ||
p({ type: String }) | ||
h({ type: String }) | ||
], a.prototype, "newTaskTitle", 2); | ||
c([ | ||
p({ type: String }) | ||
h({ type: String }) | ||
], a.prototype, "newTaskDescription", 2); | ||
c([ | ||
p({ type: String }) | ||
h({ type: String }) | ||
], a.prototype, "apiKey", 2); | ||
c([ | ||
p({ type: String }) | ||
h({ type: String }) | ||
], a.prototype, "containerColor", 2); | ||
c([ | ||
h() | ||
u() | ||
], a.prototype, "selectedTab", 2); | ||
c([ | ||
h() | ||
u() | ||
], a.prototype, "showModal", 2); | ||
c([ | ||
h() | ||
u() | ||
], a.prototype, "theme", 2); | ||
c([ | ||
h() | ||
u() | ||
], a.prototype, "commentContent", 2); | ||
c([ | ||
h() | ||
u() | ||
], a.prototype, "taskVotes", 2); | ||
c([ | ||
h() | ||
u() | ||
], a.prototype, "commentVotes", 2); | ||
c([ | ||
h() | ||
u() | ||
], a.prototype, "showComments", 2); | ||
@@ -1216,0 +1202,0 @@ a = c([ |
{ | ||
"name": "kanbancast-components", | ||
"private": false, | ||
"version": "1.1.5", | ||
"version": "1.1.6", | ||
"type": "module", | ||
@@ -6,0 +6,0 @@ "types": "dist/board-view.d.ts", |
@@ -195,2 +195,3 @@ import { LitElement, html, css } from "lit"; | ||
cursor: pointer; | ||
font-size: 16px; | ||
} | ||
@@ -200,2 +201,3 @@ | ||
background-color: white; | ||
font-weight: 600; | ||
} | ||
@@ -264,3 +266,3 @@ | ||
font-size: large; | ||
font-weight: 600; | ||
font-weight: 500; | ||
padding-bottom: 0; | ||
@@ -729,2 +731,3 @@ margin-bottom: 0; | ||
: "Show Comments"} | ||
${task.comments != null && task.comments?.length > 0 ? `(${task.comments?.length})` : ''} | ||
<svg | ||
@@ -731,0 +734,0 @@ version="1.1" |
67673
0.32%2159
-0.51%