@telia-ace/widget-components-widget-header-flamingo 1.0.63 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +30 -0
- package/README.md +11 -0
- package/package.json +3 -8
- package/project.json +48 -0
- package/{index.d.ts → src/index.ts} +3 -0
- package/src/widget-header-component.ts +15 -0
- package/src/widget-header.ts +51 -0
- package/tsconfig.json +23 -0
- package/tsconfig.lib.json +10 -0
- package/tsconfig.spec.json +19 -0
- package/vite.config.ts +57 -0
- package/index-5087564d.mjs +0 -335
- package/index-6dd00f59.js +0 -1
- package/index-8690ade6.mjs +0 -2572
- package/index-9758471c.js +0 -148
- package/index.js +0 -1
- package/index.mjs +0 -4
- package/widget-header-7608ed74.js +0 -72
- package/widget-header-b3b55bf0.mjs +0 -350
- package/widget-header-component.d.ts +0 -3
- package/widget-header.d.ts +0 -7
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
import { p as _, P as w, h as L, i as m, n as x, t as p, E as f, m as O, x as y, A as $, s as E } from "./index-8690ade6.mjs";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright 2017 Google LLC
|
|
5
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
-
*/
|
|
7
|
-
const k = (n) => (t) => typeof t == "function" ? ((i, e) => (customElements.define(i, e), e))(n, t) : ((i, e) => {
|
|
8
|
-
const { kind: s, elements: o } = e;
|
|
9
|
-
return { kind: s, elements: o, finisher(r) {
|
|
10
|
-
customElements.define(i, r);
|
|
11
|
-
} };
|
|
12
|
-
})(n, t);
|
|
13
|
-
/**
|
|
14
|
-
* @license
|
|
15
|
-
* Copyright 2017 Google LLC
|
|
16
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/
|
|
18
|
-
const R = ({ finisher: n, descriptor: t }) => (i, e) => {
|
|
19
|
-
var s;
|
|
20
|
-
if (e === void 0) {
|
|
21
|
-
const o = (s = i.originalKey) !== null && s !== void 0 ? s : i.key, r = t != null ? { kind: "method", placement: "prototype", key: o, descriptor: t(i.key) } : { ...i, key: o };
|
|
22
|
-
return n != null && (r.finisher = function(c) {
|
|
23
|
-
n(c, o);
|
|
24
|
-
}), r;
|
|
25
|
-
}
|
|
26
|
-
{
|
|
27
|
-
const o = i.constructor;
|
|
28
|
-
t !== void 0 && Object.defineProperty(i, e, t(e)), n == null || n(o, e);
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* @license
|
|
33
|
-
* Copyright 2021 Google LLC
|
|
34
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
35
|
-
*/
|
|
36
|
-
let g = class extends Event {
|
|
37
|
-
constructor(t, i, e) {
|
|
38
|
-
super("context-request", { bubbles: !0, composed: !0 }), this.context = t, this.callback = i, this.subscribe = e != null && e;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* @license
|
|
43
|
-
* Copyright 2021 Google LLC
|
|
44
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
45
|
-
*/
|
|
46
|
-
/**
|
|
47
|
-
* @license
|
|
48
|
-
* Copyright 2021 Google LLC
|
|
49
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
50
|
-
*/
|
|
51
|
-
let q = class {
|
|
52
|
-
constructor(t, i, e, s) {
|
|
53
|
-
var o;
|
|
54
|
-
if (this.subscribe = !1, this.provided = !1, this.value = void 0, this.t = (r, c) => {
|
|
55
|
-
this.unsubscribe && (this.unsubscribe !== c && (this.provided = !1, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = r, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = !0, this.callback && this.callback(r, c)), this.unsubscribe = c;
|
|
56
|
-
}, this.host = t, i.context !== void 0) {
|
|
57
|
-
const r = i;
|
|
58
|
-
this.context = r.context, this.callback = r.callback, this.subscribe = (o = r.subscribe) !== null && o !== void 0 && o;
|
|
59
|
-
} else
|
|
60
|
-
this.context = i, this.callback = e, this.subscribe = s != null && s;
|
|
61
|
-
this.host.addController(this);
|
|
62
|
-
}
|
|
63
|
-
hostConnected() {
|
|
64
|
-
this.dispatchRequest();
|
|
65
|
-
}
|
|
66
|
-
hostDisconnected() {
|
|
67
|
-
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
|
|
68
|
-
}
|
|
69
|
-
dispatchRequest() {
|
|
70
|
-
this.host.dispatchEvent(new g(this.context, this.t, this.subscribe));
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* @license
|
|
75
|
-
* Copyright 2021 Google LLC
|
|
76
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
77
|
-
*/
|
|
78
|
-
class D {
|
|
79
|
-
constructor(t) {
|
|
80
|
-
this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
|
|
81
|
-
for (const [i, { disposer: e }] of this.subscriptions)
|
|
82
|
-
i(this.o, e);
|
|
83
|
-
}, t !== void 0 && (this.value = t);
|
|
84
|
-
}
|
|
85
|
-
get value() {
|
|
86
|
-
return this.o;
|
|
87
|
-
}
|
|
88
|
-
set value(t) {
|
|
89
|
-
this.setValue(t);
|
|
90
|
-
}
|
|
91
|
-
setValue(t, i = !1) {
|
|
92
|
-
const e = i || !Object.is(t, this.o);
|
|
93
|
-
this.o = t, e && this.updateObservers();
|
|
94
|
-
}
|
|
95
|
-
addCallback(t, i, e) {
|
|
96
|
-
if (!e)
|
|
97
|
-
return void t(this.value);
|
|
98
|
-
this.subscriptions.has(t) || this.subscriptions.set(t, { disposer: () => {
|
|
99
|
-
this.subscriptions.delete(t);
|
|
100
|
-
}, consumerHost: i });
|
|
101
|
-
const { disposer: s } = this.subscriptions.get(t);
|
|
102
|
-
t(this.value, s);
|
|
103
|
-
}
|
|
104
|
-
clearCallbacks() {
|
|
105
|
-
this.subscriptions.clear();
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* @license
|
|
110
|
-
* Copyright 2021 Google LLC
|
|
111
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
112
|
-
*/
|
|
113
|
-
class j extends Event {
|
|
114
|
-
constructor(t) {
|
|
115
|
-
super("context-provider", { bubbles: !0, composed: !0 }), this.context = t;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
class l extends D {
|
|
119
|
-
constructor(t, i, e) {
|
|
120
|
-
super(i.context !== void 0 ? i.initialValue : e), this.onContextRequest = (s) => {
|
|
121
|
-
const o = s.composedPath()[0];
|
|
122
|
-
s.context === this.context && o !== this.host && (s.stopPropagation(), this.addCallback(s.callback, o, s.subscribe));
|
|
123
|
-
}, this.onProviderRequest = (s) => {
|
|
124
|
-
const o = s.composedPath()[0];
|
|
125
|
-
if (s.context !== this.context || o === this.host)
|
|
126
|
-
return;
|
|
127
|
-
const r = /* @__PURE__ */ new Set();
|
|
128
|
-
for (const [c, { consumerHost: b }] of this.subscriptions)
|
|
129
|
-
r.has(c) || (r.add(c), b.dispatchEvent(new g(this.context, c, !0)));
|
|
130
|
-
s.stopPropagation();
|
|
131
|
-
}, this.host = t, i.context !== void 0 ? this.context = i.context : this.context = i, this.attachListeners(), this.host.addController(this);
|
|
132
|
-
}
|
|
133
|
-
attachListeners() {
|
|
134
|
-
this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
|
|
135
|
-
}
|
|
136
|
-
hostConnected() {
|
|
137
|
-
this.host.dispatchEvent(new j(this.context));
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* @license
|
|
142
|
-
* Copyright 2022 Google LLC
|
|
143
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
144
|
-
*/
|
|
145
|
-
function V({ context: n, subscribe: t }) {
|
|
146
|
-
return R({ finisher: (i, e) => {
|
|
147
|
-
i.addInitializer((s) => {
|
|
148
|
-
new q(s, { context: n, callback: (o) => {
|
|
149
|
-
s[e] = o;
|
|
150
|
-
}, subscribe: t });
|
|
151
|
-
});
|
|
152
|
-
} });
|
|
153
|
-
}
|
|
154
|
-
const z = "children", W = "descriptor", H = "container", I = "context", N = "layout", A = "properties";
|
|
155
|
-
class S {
|
|
156
|
-
constructor(t) {
|
|
157
|
-
(this.host = t).addController(this);
|
|
158
|
-
}
|
|
159
|
-
hostConnected() {
|
|
160
|
-
}
|
|
161
|
-
hostDisconnected() {
|
|
162
|
-
}
|
|
163
|
-
setDescriptor(t) {
|
|
164
|
-
this._descriptor = t;
|
|
165
|
-
}
|
|
166
|
-
setContainer(t) {
|
|
167
|
-
this._container = t;
|
|
168
|
-
}
|
|
169
|
-
async dispatch(t, i) {
|
|
170
|
-
if (!this._container || !this._descriptor)
|
|
171
|
-
return;
|
|
172
|
-
const e = await _.getInstance(
|
|
173
|
-
this._container
|
|
174
|
-
), s = new w(e).withId(
|
|
175
|
-
this._descriptor.id
|
|
176
|
-
);
|
|
177
|
-
await e.actions(
|
|
178
|
-
s,
|
|
179
|
-
this._descriptor.type || L()
|
|
180
|
-
).dispatch(t, i);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
const B = (n) => {
|
|
184
|
-
const t = {};
|
|
185
|
-
return Object.keys(n).forEach((i) => {
|
|
186
|
-
i.indexOf("css-") > -1 && (t[i] = n[i]);
|
|
187
|
-
}), t;
|
|
188
|
-
}, F = (n, t) => {
|
|
189
|
-
const i = B(t);
|
|
190
|
-
Object.entries(i).forEach(([e, s]) => {
|
|
191
|
-
n.style.setProperty(e.replace("css-", ""), s);
|
|
192
|
-
});
|
|
193
|
-
};
|
|
194
|
-
var K = Object.defineProperty, M = Object.getOwnPropertyDescriptor, a = (n, t, i, e) => {
|
|
195
|
-
for (var s = e > 1 ? void 0 : e ? M(t, i) : t, o = n.length - 1, r; o >= 0; o--)
|
|
196
|
-
(r = n[o]) && (s = (e ? r(t, i, s) : r(s)) || s);
|
|
197
|
-
return e && s && K(t, i, s), s;
|
|
198
|
-
};
|
|
199
|
-
const U = (n) => {
|
|
200
|
-
class t extends n {
|
|
201
|
-
constructor() {
|
|
202
|
-
super(...arguments), this.entry = "", this._descriptorProvider = new l(
|
|
203
|
-
this,
|
|
204
|
-
W,
|
|
205
|
-
void 0
|
|
206
|
-
), this._childrenProvider = new l(this, z, []), this._propertiesProvider = new l(this, A, {}), this._contextProvider = new l(this, I, {}), this._layoutProvider = new l(this, N, {}), this.actions = new S(this), this.context = {}, this.layout = {}, this.properties = {};
|
|
207
|
-
}
|
|
208
|
-
connectedCallback() {
|
|
209
|
-
super.connectedCallback(), this.container && (this.actions.setContainer(this.container), _.getInstance(this.container).then(
|
|
210
|
-
async (e) => {
|
|
211
|
-
var o, r;
|
|
212
|
-
const s = e.nodes.get(this.entry);
|
|
213
|
-
if (s) {
|
|
214
|
-
this._propertyChangeListener = e.events.subscribe(
|
|
215
|
-
"components:properties-changed",
|
|
216
|
-
(d, h) => {
|
|
217
|
-
s.id === h.node.id && this._setProperties(h.node.attributes.properties);
|
|
218
|
-
}
|
|
219
|
-
), this._contextChangeListener = e.events.subscribe(
|
|
220
|
-
"components:context-changed",
|
|
221
|
-
(d, h) => {
|
|
222
|
-
s.id === h.node.id && this._setContext(h.node.attributes.context);
|
|
223
|
-
}
|
|
224
|
-
), this._layoutChangeListener = e.events.subscribe(
|
|
225
|
-
"components:layout-changed",
|
|
226
|
-
(d, h) => {
|
|
227
|
-
s.id === h.node.id && this._setLayout(h.node.attributes.layout);
|
|
228
|
-
}
|
|
229
|
-
);
|
|
230
|
-
const c = "default";
|
|
231
|
-
this._unmountNode = s.mount(this.container), this._setDescriptor(f(s, c)), this._setProperties(s.attributes.properties), this._setContext(s.attributes.context), this._setLayout(this.layout);
|
|
232
|
-
const b = s.getChildren(c).map((d) => f(d));
|
|
233
|
-
this._childrenProvider.setValue(b);
|
|
234
|
-
const P = await this.container.getAsync("componentResolver");
|
|
235
|
-
if (((o = this.descriptor) == null ? void 0 : o.type) === "area")
|
|
236
|
-
return;
|
|
237
|
-
const v = P.getComponent(
|
|
238
|
-
((r = this.descriptor) == null ? void 0 : r.type) || ""
|
|
239
|
-
);
|
|
240
|
-
v.then && v.then((d) => {
|
|
241
|
-
this.component = d.default;
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
));
|
|
246
|
-
}
|
|
247
|
-
disconnectedCallback() {
|
|
248
|
-
super.disconnectedCallback(), this._propertyChangeListener && this._propertyChangeListener(), this._contextChangeListener && this._contextChangeListener(), this._layoutChangeListener && this._layoutChangeListener(), this._unmountNode && this._unmountNode();
|
|
249
|
-
}
|
|
250
|
-
updated() {
|
|
251
|
-
this.container && this.actions.setContainer(this.container), O(this.context, this.renderRoot.host), this.renderRoot.host.style.setProperty(
|
|
252
|
-
"--width",
|
|
253
|
-
this.layout.size === "full" ? "var(--columns, 1)" : `min(${this.layout.size || "var(--columns)"}, var(--columns))`
|
|
254
|
-
), F(this.renderRoot.host, this.properties);
|
|
255
|
-
}
|
|
256
|
-
_setProperties(e) {
|
|
257
|
-
this._propertiesProvider.setValue(e), this.properties = e;
|
|
258
|
-
}
|
|
259
|
-
_setContext(e) {
|
|
260
|
-
this._contextProvider.setValue(e), this.context = e;
|
|
261
|
-
}
|
|
262
|
-
_setLayout(e) {
|
|
263
|
-
this._layoutProvider.setValue(e), this.layout = e;
|
|
264
|
-
}
|
|
265
|
-
_setDescriptor(e) {
|
|
266
|
-
this.descriptor = e, this._descriptorProvider.setValue(e), this.actions.setDescriptor(e);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
return t.styles = [
|
|
270
|
-
n.styles ?? [],
|
|
271
|
-
m`
|
|
272
|
-
:host {
|
|
273
|
-
font-family: var(--font-family);
|
|
274
|
-
grid-column: span var(--width);
|
|
275
|
-
max-width: 100%;
|
|
276
|
-
overflow: hidden;
|
|
277
|
-
box-sizing: border-box;
|
|
278
|
-
display: block;
|
|
279
|
-
}
|
|
280
|
-
* {
|
|
281
|
-
box-sizing: border-box;
|
|
282
|
-
}
|
|
283
|
-
`
|
|
284
|
-
], a([
|
|
285
|
-
V({ context: H }),
|
|
286
|
-
x({ attribute: !1 })
|
|
287
|
-
], t.prototype, "container", 2), a([
|
|
288
|
-
x()
|
|
289
|
-
], t.prototype, "entry", 2), a([
|
|
290
|
-
p()
|
|
291
|
-
], t.prototype, "descriptor", 2), a([
|
|
292
|
-
p()
|
|
293
|
-
], t.prototype, "component", 2), a([
|
|
294
|
-
p()
|
|
295
|
-
], t.prototype, "context", 2), a([
|
|
296
|
-
p()
|
|
297
|
-
], t.prototype, "layout", 2), a([
|
|
298
|
-
p()
|
|
299
|
-
], t.prototype, "properties", 2), t;
|
|
300
|
-
};
|
|
301
|
-
var G = Object.defineProperty, J = Object.getOwnPropertyDescriptor, Q = (n, t, i, e) => {
|
|
302
|
-
for (var s = e > 1 ? void 0 : e ? J(t, i) : t, o = n.length - 1, r; o >= 0; o--)
|
|
303
|
-
(r = n[o]) && (s = (e ? r(t, i, s) : r(s)) || s);
|
|
304
|
-
return e && s && G(t, i, s), s;
|
|
305
|
-
};
|
|
306
|
-
const C = U(E);
|
|
307
|
-
let u = class extends C {
|
|
308
|
-
render() {
|
|
309
|
-
return y` <div class="widget-header">
|
|
310
|
-
<div>
|
|
311
|
-
<h1>${this.properties.header}</h1>
|
|
312
|
-
|
|
313
|
-
${this.properties.tagline ? y`<p>${this.properties.tagline}</p>` : $}
|
|
314
|
-
</div>
|
|
315
|
-
</div>`;
|
|
316
|
-
}
|
|
317
|
-
};
|
|
318
|
-
u.styles = [
|
|
319
|
-
C.styles || [],
|
|
320
|
-
m`
|
|
321
|
-
.widget-header {
|
|
322
|
-
background-color: var(--primary-color);
|
|
323
|
-
color: #fff;
|
|
324
|
-
height: 85px;
|
|
325
|
-
display: flex;
|
|
326
|
-
flex-direction: row;
|
|
327
|
-
align-items: center;
|
|
328
|
-
border-radius: var(--spacing-sm) var(--spacing-sm) 0px 0px;
|
|
329
|
-
padding: 0 var(--spacing-md);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
h1 {
|
|
333
|
-
font-size: 1.2rem;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
h1,
|
|
337
|
-
p {
|
|
338
|
-
margin: 0;
|
|
339
|
-
padding: 0;
|
|
340
|
-
}
|
|
341
|
-
`
|
|
342
|
-
];
|
|
343
|
-
u = Q([
|
|
344
|
-
k("ace-widget-header")
|
|
345
|
-
], u);
|
|
346
|
-
const Z = u;
|
|
347
|
-
export {
|
|
348
|
-
u as WidgetHeaderComponent,
|
|
349
|
-
Z as default
|
|
350
|
-
};
|
package/widget-header.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
declare const WidgetElement: (new (...args: any[]) => import("libs/runtime/src/mixins/widget-component.mixin").WidgetComponentInterface) & typeof LitElement;
|
|
3
|
-
export declare class WidgetHeaderComponent extends WidgetElement {
|
|
4
|
-
static styles: import("lit").CSSResultGroup[];
|
|
5
|
-
render(): import("lit").TemplateResult<1>;
|
|
6
|
-
}
|
|
7
|
-
export default WidgetHeaderComponent;
|