@emuanalytics/flow-rdf-ui 4.1.0-preview.14 → 4.1.0-preview.15
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/dist/components/card/card.component.mjs +27 -7
- package/dist/components/card/card.styles.mjs +3 -40
- package/dist/components/chart/chart.component.mjs +6 -6
- package/dist/components/dialog/dialog.component.mjs +7 -6
- package/dist/components/dialog/dialog.styles.mjs +2 -1
- package/dist/components/gauge/gauge.component.mjs +7 -6
- package/dist/components/gauge/gauge.styles.mjs +2 -2
- package/dist/components/panel-header/panel-header.component.mjs +5 -4
- package/dist/components/panel-header/panel-header.styles.mjs +2 -2
- package/dist/custom-elements.json +919 -870
- package/dist/index.d.mts +23 -14
- package/dist/index.d.ts +23 -14
- package/dist/package.json.mjs +1 -1
- package/dist/vscode.html-custom-data.json +116 -116
- package/package.json +1 -1
- package/themes/dark.css +26 -26
- package/themes/dark.styles.js +26 -26
|
@@ -1,33 +1,53 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
1
|
+
import { html, nothing } from 'lit';
|
|
2
2
|
import { classMap } from 'lit/directives/class-map.js';
|
|
3
3
|
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
4
4
|
import { HasSlotController } from '../../internal/slot.mjs';
|
|
5
5
|
import styles from './card.styles.mjs';
|
|
6
|
+
import { isStringFull } from '@emuanalytics/flow-rdf-core/utils';
|
|
7
|
+
import { property } from 'lit/decorators.js';
|
|
6
8
|
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
12
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
13
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
14
|
+
if (decorator = decorators[i])
|
|
15
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
16
|
+
if (kind && result)
|
|
17
|
+
__defProp(target, key, result);
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
7
20
|
class FlowUiCard extends FlowRdfElement {
|
|
8
21
|
constructor() {
|
|
9
22
|
super(...arguments);
|
|
10
23
|
this.hasSlotController = new HasSlotController(this, "footer", "header", "image");
|
|
24
|
+
this.title = "";
|
|
11
25
|
}
|
|
12
26
|
render() {
|
|
27
|
+
const hasHeader = isStringFull(this.title) ?? this.hasSlotController.test("title");
|
|
13
28
|
return html`
|
|
14
29
|
<div
|
|
15
30
|
part="base"
|
|
16
31
|
class=${classMap({
|
|
17
32
|
card: true,
|
|
18
|
-
"card--has-
|
|
19
|
-
"card--has-image": this.hasSlotController.test("image"),
|
|
20
|
-
"card--has-header": this.hasSlotController.test("header")
|
|
33
|
+
"card--has-header": hasHeader
|
|
21
34
|
})}
|
|
35
|
+
title=""
|
|
22
36
|
>
|
|
23
|
-
|
|
24
|
-
|
|
37
|
+
${hasHeader ? html`
|
|
38
|
+
<header part="header" class="card__header">
|
|
39
|
+
<span part="title" class="card__title"><slot name="title">${this.title}</slot></span>
|
|
40
|
+
</header>
|
|
41
|
+
` : nothing}
|
|
42
|
+
|
|
25
43
|
<slot part="body" class="card__body"></slot>
|
|
26
|
-
<slot name="footer" part="footer" class="card__footer"></slot>
|
|
27
44
|
</div>
|
|
28
45
|
`;
|
|
29
46
|
}
|
|
30
47
|
}
|
|
31
48
|
FlowUiCard.styles = styles;
|
|
49
|
+
__decorateClass([
|
|
50
|
+
property({ reflect: true })
|
|
51
|
+
], FlowUiCard.prototype, "title", 2);
|
|
32
52
|
|
|
33
53
|
export { FlowUiCard as default };
|
|
@@ -5,6 +5,8 @@ const styles = css`
|
|
|
5
5
|
${componentStyles}
|
|
6
6
|
|
|
7
7
|
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
|
|
8
10
|
--border-color: var(--flow-ui-card-border-color);
|
|
9
11
|
--border-radius: var(--flow-ui-card-border-radius);
|
|
10
12
|
--border-width: var(--flow-ui-card-border-width);
|
|
@@ -12,8 +14,6 @@ const styles = css`
|
|
|
12
14
|
|
|
13
15
|
--background-color: var(--flow-ui-card-background-color);
|
|
14
16
|
--color: var(--flow-ui-card-color);
|
|
15
|
-
|
|
16
|
-
display: inline-block;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.card {
|
|
@@ -26,36 +26,9 @@ const styles = css`
|
|
|
26
26
|
border-radius: var(--border-radius);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.card__image {
|
|
30
|
-
display: flex;
|
|
31
|
-
border-top-left-radius: var(--border-radius);
|
|
32
|
-
border-top-right-radius: var(--border-radius);
|
|
33
|
-
margin: calc(-1 * var(--border-width));
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.card__image::slotted(img) {
|
|
38
|
-
display: block;
|
|
39
|
-
width: 100%;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.card:not(.card--has-image) .card__image {
|
|
43
|
-
display: none;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
29
|
.card__header {
|
|
47
|
-
display: block;
|
|
48
|
-
border-bottom: solid var(--border-width) var(--border-color);
|
|
49
30
|
padding: calc(var(--padding) / 2) var(--padding);
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
.card:not(.card--has-header) .card__header {
|
|
53
|
-
display: none;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.card:not(.card--has-image) .card__header {
|
|
57
|
-
border-top-left-radius: var(--border-radius);
|
|
58
|
-
border-top-right-radius: var(--border-radius);
|
|
31
|
+
padding-bottom: 0;
|
|
59
32
|
}
|
|
60
33
|
|
|
61
34
|
.card__body {
|
|
@@ -63,16 +36,6 @@ const styles = css`
|
|
|
63
36
|
padding: var(--padding);
|
|
64
37
|
}
|
|
65
38
|
|
|
66
|
-
.card--has-footer .card__footer {
|
|
67
|
-
display: block;
|
|
68
|
-
border-top: solid var(--border-width) var(--border-color);
|
|
69
|
-
padding: var(--padding);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.card:not(.card--has-footer) .card__footer {
|
|
73
|
-
display: none;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
39
|
/* Remove margin from first and last child of default slot */
|
|
77
40
|
::slotted(:nth-child(1 of :not([slot]))) {
|
|
78
41
|
margin-top: 0;
|
|
@@ -25,7 +25,7 @@ class FlowUiChart extends FlowRdfElement {
|
|
|
25
25
|
super(...arguments);
|
|
26
26
|
this.hasSlotController = new HasSlotController(this, "label");
|
|
27
27
|
this._chartRef = createRef();
|
|
28
|
-
this.
|
|
28
|
+
this.title = "";
|
|
29
29
|
this.plugins = [];
|
|
30
30
|
}
|
|
31
31
|
/** The Chart.js chart instance. */
|
|
@@ -58,12 +58,12 @@ class FlowUiChart extends FlowRdfElement {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
render() {
|
|
61
|
-
const hasHeader = isStringFull(this.
|
|
61
|
+
const hasHeader = isStringFull(this.title) || this.hasSlotController.test("title");
|
|
62
62
|
return html`
|
|
63
|
-
<div part="base" class="chart">
|
|
63
|
+
<div part="base" class="chart" title="">
|
|
64
64
|
${hasHeader ? html`
|
|
65
65
|
<header part="header" class="chart__header">
|
|
66
|
-
<span part="
|
|
66
|
+
<span part="title" class="chart__title"><slot name="title">${this.title}</slot></span>
|
|
67
67
|
</header>
|
|
68
68
|
` : nothing}
|
|
69
69
|
|
|
@@ -76,8 +76,8 @@ class FlowUiChart extends FlowRdfElement {
|
|
|
76
76
|
}
|
|
77
77
|
FlowUiChart.styles = styles;
|
|
78
78
|
__decorateClass([
|
|
79
|
-
property()
|
|
80
|
-
], FlowUiChart.prototype, "
|
|
79
|
+
property({ reflect: true })
|
|
80
|
+
], FlowUiChart.prototype, "title", 2);
|
|
81
81
|
__decorateClass([
|
|
82
82
|
property()
|
|
83
83
|
], FlowUiChart.prototype, "type", 2);
|
|
@@ -32,7 +32,7 @@ class FlowUiDialog extends FlowRdfElement {
|
|
|
32
32
|
this.hasSlotController = new HasSlotController(this, "footer");
|
|
33
33
|
this.localize = new LocalizeController(this);
|
|
34
34
|
this.open = false;
|
|
35
|
-
this.
|
|
35
|
+
this.title = "";
|
|
36
36
|
this.noHeader = false;
|
|
37
37
|
this.tabbed = false;
|
|
38
38
|
}
|
|
@@ -162,7 +162,7 @@ class FlowUiDialog extends FlowRdfElement {
|
|
|
162
162
|
this.syncTabbedDialog();
|
|
163
163
|
}
|
|
164
164
|
syncTabbedDialog() {
|
|
165
|
-
this.
|
|
165
|
+
this.title = capitalize(this.tabGroup.activeTab?.panel) || "";
|
|
166
166
|
}
|
|
167
167
|
handleChildHide(ev) {
|
|
168
168
|
ev.stopPropagation();
|
|
@@ -170,8 +170,8 @@ class FlowUiDialog extends FlowRdfElement {
|
|
|
170
170
|
renderHeader(slot) {
|
|
171
171
|
return html`
|
|
172
172
|
<header slot=${ifDefined(slot)} part="header" class="dialog__header">
|
|
173
|
-
<h2 part="heading" class="
|
|
174
|
-
<slot name="
|
|
173
|
+
<h2 part="heading" class="dialog__title" id="heading">
|
|
174
|
+
<slot name="title">${this.title.length > 0 ? this.title : String.fromCharCode(65279)}</slot>
|
|
175
175
|
</h2>
|
|
176
176
|
<div part="header-actions" class="dialog__header-actions">
|
|
177
177
|
<slot name="header-actions"></slot>
|
|
@@ -224,6 +224,7 @@ class FlowUiDialog extends FlowRdfElement {
|
|
|
224
224
|
"dialog--open": this.open,
|
|
225
225
|
"dialog--has-footer": this.hasSlotController.test("footer")
|
|
226
226
|
})}
|
|
227
|
+
title=""
|
|
227
228
|
>
|
|
228
229
|
<div part="overlay" class="dialog__overlay" @click=${() => this.requestClose("overlay")} tabindex="-1"></div>
|
|
229
230
|
|
|
@@ -233,7 +234,7 @@ class FlowUiDialog extends FlowRdfElement {
|
|
|
233
234
|
role="dialog"
|
|
234
235
|
aria-modal="true"
|
|
235
236
|
aria-hidden=${this.open ? "false" : "true"}
|
|
236
|
-
aria-label=${ifDefined(this.noHeader ? this.
|
|
237
|
+
aria-label=${ifDefined(this.noHeader ? this.title : void 0)}
|
|
237
238
|
aria-labelledby=${ifDefined(!this.noHeader ? "title" : void 0)}
|
|
238
239
|
tabindex="0"
|
|
239
240
|
>
|
|
@@ -261,7 +262,7 @@ __decorateClass([
|
|
|
261
262
|
], FlowUiDialog.prototype, "open", 2);
|
|
262
263
|
__decorateClass([
|
|
263
264
|
property({ reflect: true })
|
|
264
|
-
], FlowUiDialog.prototype, "
|
|
265
|
+
], FlowUiDialog.prototype, "title", 2);
|
|
265
266
|
__decorateClass([
|
|
266
267
|
property({ attribute: "no-header", type: Boolean, reflect: true })
|
|
267
268
|
], FlowUiDialog.prototype, "noHeader", 2);
|
|
@@ -18,6 +18,7 @@ const styles = css`
|
|
|
18
18
|
--body-spacing: 0 var(--flow-ui-spacing-x-large);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
/* Remove margins from first and last items slotted into dialog body */
|
|
21
22
|
::slotted(:nth-child(1 of :not([slot]))) {
|
|
22
23
|
margin-top: 0;
|
|
23
24
|
}
|
|
@@ -71,7 +72,7 @@ const styles = css`
|
|
|
71
72
|
display: flex;
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
.
|
|
75
|
+
.dialog__title {
|
|
75
76
|
flex: 1 1 auto;
|
|
76
77
|
font: inherit;
|
|
77
78
|
font-size: var(--flow-ui-font-size-large);
|
|
@@ -79,7 +79,7 @@ class FlowUiGauge extends FlowRdfElement {
|
|
|
79
79
|
infoDialogTemplate() {
|
|
80
80
|
return html`
|
|
81
81
|
<flow-ui-dialog class="gauge__info-dialog">
|
|
82
|
-
<div slot="heading" class="gauge__info-dialog-heading">${this.headerIconTemplate()} ${this.
|
|
82
|
+
<div slot="heading" class="gauge__info-dialog-heading">${this.headerIconTemplate()} ${this.title}</div>
|
|
83
83
|
<slot name="info"></slot>
|
|
84
84
|
<div slot="footer">
|
|
85
85
|
<flow-ui-button autofocus slot="footer" variant="primary" @click=${this.hideInfoDialog}>OK</flow-ui-button>
|
|
@@ -95,12 +95,13 @@ class FlowUiGauge extends FlowRdfElement {
|
|
|
95
95
|
class=${classMap({
|
|
96
96
|
gauge: true
|
|
97
97
|
})}
|
|
98
|
+
title=""
|
|
98
99
|
>
|
|
99
100
|
<div part="header" class="gauge__header">
|
|
100
101
|
${this.headerIconTemplate()}
|
|
101
|
-
<span class="
|
|
102
|
-
<span part="
|
|
103
|
-
<slot name="
|
|
102
|
+
<span class="gauge__title-wrapper">
|
|
103
|
+
<span part="title" class="gauge__title">
|
|
104
|
+
<slot name="title">${this.title}</slot>
|
|
104
105
|
</span>
|
|
105
106
|
</span>
|
|
106
107
|
${hasInfo ? this.infoButtonTemplate() : nothing}
|
|
@@ -124,8 +125,8 @@ __decorateClass([
|
|
|
124
125
|
query(".gauge__info-dialog")
|
|
125
126
|
], FlowUiGauge.prototype, "_infoDialog", 2);
|
|
126
127
|
__decorateClass([
|
|
127
|
-
property()
|
|
128
|
-
], FlowUiGauge.prototype, "
|
|
128
|
+
property({ reflect: true })
|
|
129
|
+
], FlowUiGauge.prototype, "title", 2);
|
|
129
130
|
__decorateClass([
|
|
130
131
|
property()
|
|
131
132
|
], FlowUiGauge.prototype, "units", 2);
|
|
@@ -56,13 +56,13 @@ const styles = css`
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/* Wrapper needed to support text ellipsis in flex item */
|
|
59
|
-
.
|
|
59
|
+
.gauge__title-wrapper {
|
|
60
60
|
flex: 1;
|
|
61
61
|
min-width: 0;
|
|
62
62
|
display: flex;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.
|
|
65
|
+
.gauge__title {
|
|
66
66
|
text-overflow: ellipsis;
|
|
67
67
|
white-space: nowrap;
|
|
68
68
|
overflow: hidden;
|
|
@@ -82,6 +82,7 @@ class FlowUiPanelHeader extends FlowRdfElement {
|
|
|
82
82
|
tabindex="0"
|
|
83
83
|
@click=${this.handleHeaderClick}
|
|
84
84
|
@keydown=${this.handleHeaderKeyDown}
|
|
85
|
+
title=""
|
|
85
86
|
>
|
|
86
87
|
<slot
|
|
87
88
|
name="prefix"
|
|
@@ -91,8 +92,8 @@ class FlowUiPanelHeader extends FlowRdfElement {
|
|
|
91
92
|
@keydown=${this.handleHeaderKeyDown}
|
|
92
93
|
></slot>
|
|
93
94
|
|
|
94
|
-
<slot name="
|
|
95
|
-
<span class="panel-
|
|
95
|
+
<slot name="title" part="title" class="panel-header__title-slot">
|
|
96
|
+
<span class="panel-header__title">${this.title}</span>
|
|
96
97
|
</slot>
|
|
97
98
|
|
|
98
99
|
<slot
|
|
@@ -122,8 +123,8 @@ __decorateClass([
|
|
|
122
123
|
property({ type: Boolean, reflect: true })
|
|
123
124
|
], FlowUiPanelHeader.prototype, "closed", 2);
|
|
124
125
|
__decorateClass([
|
|
125
|
-
property()
|
|
126
|
-
], FlowUiPanelHeader.prototype, "
|
|
126
|
+
property({ reflect: true })
|
|
127
|
+
], FlowUiPanelHeader.prototype, "title", 2);
|
|
127
128
|
__decorateClass([
|
|
128
129
|
property({ type: Boolean, reflect: true })
|
|
129
130
|
], FlowUiPanelHeader.prototype, "fixed", 2);
|
|
@@ -33,14 +33,14 @@ const styles = css`
|
|
|
33
33
|
color: var(--accessory-color);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.panel-
|
|
36
|
+
.panel-header__title-slot {
|
|
37
37
|
display: flex;
|
|
38
38
|
align-items: center;
|
|
39
39
|
flex: 1;
|
|
40
40
|
min-width: 0;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
.panel-
|
|
43
|
+
.panel-header__title {
|
|
44
44
|
font-size: var(--flow-ui-panel-header-font-size);
|
|
45
45
|
font-weight: var(--flow-ui-panel-header-font-weight);
|
|
46
46
|
text-overflow: ellipsis;
|