scb-wc-test 0.1.351 → 0.1.352
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/all.js +2 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/mvc/components/all.js +1 -0
- package/mvc/components/scb-vignette/scb-vignette.js +30 -0
- package/package.json +6 -2
- package/scb-vignette/scb-vignette.d.ts +19 -0
- package/scb-vignette/scb-vignette.js +82 -0
- package/scb-wc-test.bundle.js +428 -399
- package/scb-wc-test.d.ts +2 -0
package/all.js
CHANGED
|
@@ -85,6 +85,7 @@ import './mvc/components/scb-textfield/scb-textfield.js';
|
|
|
85
85
|
import './mvc/components/scb-toc/scb-toc-item.js';
|
|
86
86
|
import './mvc/components/scb-toc/scb-toc.js';
|
|
87
87
|
import './mvc/components/scb-tooltip/scb-tooltip.js';
|
|
88
|
+
import './mvc/components/scb-vignette/scb-vignette.js';
|
|
88
89
|
import './mvc/components/scb-viz/scb-viz-actions-runtime.js';
|
|
89
90
|
import './mvc/components/scb-viz/scb-viz-print-runtime.js';
|
|
90
91
|
import './mvc/components/scb-viz/scb-viz-series-differentiation-registry.js';
|
|
@@ -179,6 +180,7 @@ import './scb-textfield/scb-textfield.js';
|
|
|
179
180
|
import './scb-toc/scb-toc-item.js';
|
|
180
181
|
import './scb-toc/scb-toc.js';
|
|
181
182
|
import './scb-tooltip/scb-tooltip.js';
|
|
183
|
+
import './scb-vignette/scb-vignette.js';
|
|
182
184
|
import './scb-viz/scb-viz-actions-runtime.js';
|
|
183
185
|
import './scb-viz/scb-viz-print-runtime.js';
|
|
184
186
|
import './scb-viz/scb-viz-series-differentiation-registry.js';
|
package/index.d.ts
CHANGED
|
@@ -81,6 +81,7 @@ export * from './scb-textfield/scb-textfield';
|
|
|
81
81
|
export * from './scb-toc/scb-toc-item';
|
|
82
82
|
export * from './scb-toc/scb-toc';
|
|
83
83
|
export * from './scb-tooltip/scb-tooltip';
|
|
84
|
+
export * from './scb-vignette/scb-vignette';
|
|
84
85
|
export * from './scb-viz/scb-viz-actions-runtime';
|
|
85
86
|
export * from './scb-viz/scb-viz-print-runtime';
|
|
86
87
|
export * from './scb-viz/scb-viz-series-differentiation-registry';
|
package/index.js
CHANGED
package/mvc/components/all.js
CHANGED
|
@@ -81,6 +81,7 @@ import './scb-textfield/scb-textfield.js';
|
|
|
81
81
|
import './scb-toc/scb-toc.js';
|
|
82
82
|
import './scb-toc/scb-toc-item.js';
|
|
83
83
|
import './scb-tooltip/scb-tooltip.js';
|
|
84
|
+
import './scb-vignette/scb-vignette.js';
|
|
84
85
|
import './scb-viz/scb-viz.js';
|
|
85
86
|
import './scb-viz/scb-viz-actions-runtime.js';
|
|
86
87
|
import './scb-viz/scb-viz-print-runtime.js';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{a as g,n as c,i as l,x as h,t as b}from"../../vendor/vendor.js";(function(){try{var t=typeof globalThis<"u"?globalThis:window;if(!t.__scb_ce_guard_installed__){t.__scb_ce_guard_installed__=!0;var e=customElements.define.bind(customElements);customElements.define=function(s,n,i){try{customElements.get(s)||e(s,n,i)}catch(o){var a=String(o||"");if(a.indexOf("already been used")===-1&&a.indexOf("NotSupportedError")===-1)throw o}}}}catch{}})();var v=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p=(t,e,s,n)=>{for(var i=n>1?void 0:n?d(e,s):e,a=t.length-1,o;a>=0;a--)(o=t[a])&&(i=(n?o(e,s,i):o(i))||i);return n&&i&&v(e,s,i),i};let r=class extends l{constructor(){super(...arguments),this.label="",this.spacing=void 0,this.spacingTop=void 0,this.spacingBottom=void 0,this.spacingLeft=void 0,this.spacingRight=void 0}updated(t){super.updated(t),(t.has("spacing")||t.has("spacingTop")||t.has("spacingBottom")||t.has("spacingLeft")||t.has("spacingRight"))&&this.applySpacing()}mapSpacingToken(t){if(!t)return;const e=String(t).trim();if(e)return/^\d+$/.test(e)?`var(--spacing-${Math.max(0,Math.min(14,parseInt(e,10)))})`:e}applySpacing(){const t=this.mapSpacingToken(this.spacing),e=this.mapSpacingToken(this.spacingTop)??t,s=this.mapSpacingToken(this.spacingBottom)??t,n=this.mapSpacingToken(this.spacingLeft),i=this.mapSpacingToken(this.spacingRight);e?this.style.setProperty("--scb-vignette-spacing-block-start",e):this.style.removeProperty("--scb-vignette-spacing-block-start"),s?this.style.setProperty("--scb-vignette-spacing-block-end",s):this.style.removeProperty("--scb-vignette-spacing-block-end"),n?this.style.setProperty("--scb-vignette-spacing-inline-start",n):this.style.removeProperty("--scb-vignette-spacing-inline-start"),i?this.style.setProperty("--scb-vignette-spacing-inline-end",i):this.style.removeProperty("--scb-vignette-spacing-inline-end")}render(){return h`
|
|
2
|
+
<div class="vignette">
|
|
3
|
+
<p>${this.label}</p>
|
|
4
|
+
</div>
|
|
5
|
+
`}};r.styles=g`
|
|
6
|
+
:host {
|
|
7
|
+
display: block;
|
|
8
|
+
margin-block-start: var(--scb-vignette-spacing-block-start, 0);
|
|
9
|
+
margin-block-end: var(--scb-vignette-spacing-block-end, 0);
|
|
10
|
+
margin-inline-start: var(--scb-vignette-spacing-inline-start, 0);
|
|
11
|
+
margin-inline-end: var(--scb-vignette-spacing-inline-end, 0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.vignette {
|
|
15
|
+
padding: 4px 8px;
|
|
16
|
+
border-radius: 8px;
|
|
17
|
+
border: 1px solid #484473;
|
|
18
|
+
width: fit-content;
|
|
19
|
+
color: #484473;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.vignette p {
|
|
23
|
+
font-size: 14px;
|
|
24
|
+
font-style: normal;
|
|
25
|
+
font-weight: 550;
|
|
26
|
+
line-height: 22px;
|
|
27
|
+
margin: 0;
|
|
28
|
+
color: var(--md-sys-color-on-surface);
|
|
29
|
+
}
|
|
30
|
+
`;p([c({type:String})],r.prototype,"label",2);p([c({type:String,reflect:!0})],r.prototype,"spacing",2);p([c({type:String,attribute:"spacing-top",reflect:!0})],r.prototype,"spacingTop",2);p([c({type:String,attribute:"spacing-bottom",reflect:!0})],r.prototype,"spacingBottom",2);p([c({type:String,attribute:"spacing-left",reflect:!0})],r.prototype,"spacingLeft",2);p([c({type:String,attribute:"spacing-right",reflect:!0})],r.prototype,"spacingRight",2);r=p([b("scb-vignette")],r);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scb-wc-test",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.352",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -396,6 +396,10 @@
|
|
|
396
396
|
"import": "./scb-tooltip/scb-tooltip.js",
|
|
397
397
|
"require": "./scb-tooltip/scb-tooltip.js"
|
|
398
398
|
},
|
|
399
|
+
"./scb-vignette": {
|
|
400
|
+
"import": "./scb-vignette/scb-vignette.js",
|
|
401
|
+
"require": "./scb-vignette/scb-vignette.js"
|
|
402
|
+
},
|
|
399
403
|
"./scb-viz": {
|
|
400
404
|
"import": "./scb-viz/scb-viz.js",
|
|
401
405
|
"require": "./scb-viz/scb-viz.js"
|
|
@@ -422,5 +426,5 @@
|
|
|
422
426
|
},
|
|
423
427
|
"./mvc/*": "./mvc/*"
|
|
424
428
|
},
|
|
425
|
-
"buildHash": "
|
|
429
|
+
"buildHash": "B73507616BFC413BD85E78BCEEAD144DF989B1B457AD9F6AD678E76661A0D5A1"
|
|
426
430
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class ScbVignette extends LitElement {
|
|
3
|
+
label: string;
|
|
4
|
+
spacing: undefined;
|
|
5
|
+
spacingTop: undefined;
|
|
6
|
+
spacingBottom: undefined;
|
|
7
|
+
spacingLeft: undefined;
|
|
8
|
+
spacingRight: undefined;
|
|
9
|
+
static styles: import('lit').CSSResult;
|
|
10
|
+
updated(changed: Map<string, unknown>): void;
|
|
11
|
+
private mapSpacingToken;
|
|
12
|
+
private applySpacing;
|
|
13
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
14
|
+
}
|
|
15
|
+
declare global {
|
|
16
|
+
interface HTMLElementTagNameMap {
|
|
17
|
+
'scb-vignette': ScbVignette;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { css as g, LitElement as l, html as h } from "lit";
|
|
2
|
+
import { property as o, customElement as v } from "lit/decorators.js";
|
|
3
|
+
var b = Object.defineProperty, m = Object.getOwnPropertyDescriptor, r = (t, e, n, p) => {
|
|
4
|
+
for (var i = p > 1 ? void 0 : p ? m(e, n) : e, a = t.length - 1, c; a >= 0; a--)
|
|
5
|
+
(c = t[a]) && (i = (p ? c(e, n, i) : c(i)) || i);
|
|
6
|
+
return p && i && b(e, n, i), i;
|
|
7
|
+
};
|
|
8
|
+
let s = class extends l {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments), this.label = "", this.spacing = void 0, this.spacingTop = void 0, this.spacingBottom = void 0, this.spacingLeft = void 0, this.spacingRight = void 0;
|
|
11
|
+
}
|
|
12
|
+
updated(t) {
|
|
13
|
+
super.updated(t), (t.has("spacing") || t.has("spacingTop") || t.has("spacingBottom") || t.has("spacingLeft") || t.has("spacingRight")) && this.applySpacing();
|
|
14
|
+
}
|
|
15
|
+
mapSpacingToken(t) {
|
|
16
|
+
if (!t) return;
|
|
17
|
+
const e = String(t).trim();
|
|
18
|
+
if (e)
|
|
19
|
+
return /^\d+$/.test(e) ? `var(--spacing-${Math.max(0, Math.min(14, parseInt(e, 10)))})` : e;
|
|
20
|
+
}
|
|
21
|
+
applySpacing() {
|
|
22
|
+
const t = this.mapSpacingToken(this.spacing), e = this.mapSpacingToken(this.spacingTop) ?? t, n = this.mapSpacingToken(this.spacingBottom) ?? t, p = this.mapSpacingToken(this.spacingLeft), i = this.mapSpacingToken(this.spacingRight);
|
|
23
|
+
e ? this.style.setProperty("--scb-vignette-spacing-block-start", e) : this.style.removeProperty("--scb-vignette-spacing-block-start"), n ? this.style.setProperty("--scb-vignette-spacing-block-end", n) : this.style.removeProperty("--scb-vignette-spacing-block-end"), p ? this.style.setProperty("--scb-vignette-spacing-inline-start", p) : this.style.removeProperty("--scb-vignette-spacing-inline-start"), i ? this.style.setProperty("--scb-vignette-spacing-inline-end", i) : this.style.removeProperty("--scb-vignette-spacing-inline-end");
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return h`
|
|
27
|
+
<div class="vignette">
|
|
28
|
+
<p>${this.label}</p>
|
|
29
|
+
</div>
|
|
30
|
+
`;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
s.styles = g`
|
|
34
|
+
:host {
|
|
35
|
+
display: block;
|
|
36
|
+
margin-block-start: var(--scb-vignette-spacing-block-start, 0);
|
|
37
|
+
margin-block-end: var(--scb-vignette-spacing-block-end, 0);
|
|
38
|
+
margin-inline-start: var(--scb-vignette-spacing-inline-start, 0);
|
|
39
|
+
margin-inline-end: var(--scb-vignette-spacing-inline-end, 0);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.vignette {
|
|
43
|
+
padding: 4px 8px;
|
|
44
|
+
border-radius: 8px;
|
|
45
|
+
border: 1px solid #484473;
|
|
46
|
+
width: fit-content;
|
|
47
|
+
color: #484473;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.vignette p {
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
font-style: normal;
|
|
53
|
+
font-weight: 550;
|
|
54
|
+
line-height: 22px;
|
|
55
|
+
margin: 0;
|
|
56
|
+
color: var(--md-sys-color-on-surface);
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
r([
|
|
60
|
+
o({ type: String })
|
|
61
|
+
], s.prototype, "label", 2);
|
|
62
|
+
r([
|
|
63
|
+
o({ type: String, reflect: !0 })
|
|
64
|
+
], s.prototype, "spacing", 2);
|
|
65
|
+
r([
|
|
66
|
+
o({ type: String, attribute: "spacing-top", reflect: !0 })
|
|
67
|
+
], s.prototype, "spacingTop", 2);
|
|
68
|
+
r([
|
|
69
|
+
o({ type: String, attribute: "spacing-bottom", reflect: !0 })
|
|
70
|
+
], s.prototype, "spacingBottom", 2);
|
|
71
|
+
r([
|
|
72
|
+
o({ type: String, attribute: "spacing-left", reflect: !0 })
|
|
73
|
+
], s.prototype, "spacingLeft", 2);
|
|
74
|
+
r([
|
|
75
|
+
o({ type: String, attribute: "spacing-right", reflect: !0 })
|
|
76
|
+
], s.prototype, "spacingRight", 2);
|
|
77
|
+
s = r([
|
|
78
|
+
v("scb-vignette")
|
|
79
|
+
], s);
|
|
80
|
+
export {
|
|
81
|
+
s as ScbVignette
|
|
82
|
+
};
|