@emuanalytics/flow-rdf-ui 4.1.0-preview.9 → 4.1.1
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/badge/badge.component.mjs +4 -0
- package/dist/components/badge/badge.styles.mjs +13 -0
- package/dist/components/busy-overlay/busy-overlay.component.mjs +56 -0
- package/dist/components/busy-overlay/busy-overlay.mjs +5 -0
- package/dist/components/busy-overlay/busy-overlay.styles.mjs +105 -0
- package/dist/components/button/button.component.mjs +4 -1
- package/dist/components/button/button.styles.mjs +14 -5
- package/dist/components/card/card.component.mjs +27 -7
- package/dist/components/card/card.styles.mjs +3 -41
- package/dist/components/chart/chart.component.mjs +19 -3
- package/dist/components/chart/chart.styles.mjs +20 -1
- package/dist/components/dialog/dialog.component.mjs +7 -6
- package/dist/components/dialog/dialog.styles.mjs +15 -6
- package/dist/components/form-group/form-group.styles.mjs +5 -0
- package/dist/components/gauge/gauge.component.mjs +7 -6
- package/dist/components/gauge/gauge.styles.mjs +2 -2
- package/dist/components/icon/library.system.mjs +2 -1
- package/dist/components/input/input.component.mjs +4 -2
- package/dist/components/input/input.styles.mjs +1 -0
- package/dist/components/list/list.component.mjs +201 -0
- package/dist/components/list/list.mjs +5 -0
- package/dist/components/list/list.styles.mjs +21 -0
- package/dist/components/list-item/list-item.component.mjs +248 -0
- package/dist/components/list-item/list-item.mjs +5 -0
- package/dist/components/list-item/list-item.styles.mjs +87 -0
- package/dist/components/map/map.component.mjs +12 -1
- package/dist/components/map/map.styles.mjs +1 -0
- package/dist/components/menu-label/menu-label.styles.mjs +1 -1
- package/dist/components/panel-header/panel-header.component.mjs +5 -4
- package/dist/components/panel-header/panel-header.styles.mjs +2 -2
- package/dist/components/progress-bar/progress-bar.component.mjs +14 -14
- package/dist/components/progress-bar/progress-bar.styles.mjs +41 -12
- package/dist/components/progress-ring/progress-ring.component.mjs +22 -20
- package/dist/components/progress-ring/progress-ring.styles.mjs +77 -4
- package/dist/components/query-builder/converters/flow-query-converters.mjs +1 -5
- package/dist/components/query-builder/converters/javascript-filter-converter.mjs +3 -5
- package/dist/components/query-builder/converters/map-layer-filter-converter.mjs +3 -5
- package/dist/components/query-builder/helpers.mjs +15 -1
- package/dist/components/query-builder/query-builder.component.mjs +40 -13
- package/dist/components/range/range.component.mjs +1 -1
- package/dist/components/range/range.styles.mjs +2 -2
- package/dist/components/switch/switch.styles.mjs +35 -15
- package/dist/components/tab-group/tab-group.styles.mjs +1 -0
- package/dist/components/timer/timer.component.mjs +1 -0
- package/dist/components/tree-item/tree-item.component.mjs +4 -1
- package/dist/custom-elements.json +1479 -452
- package/dist/index.d.mts +286 -80
- package/dist/index.d.ts +286 -80
- package/dist/index.mjs +4 -2
- package/dist/package.json.mjs +1 -1
- package/dist/utilities/register-components.mjs +9 -2
- package/dist/vscode.html-custom-data.json +213 -58
- package/package.json +1 -1
- package/themes/dark.css +70 -34
- package/themes/dark.styles.js +72 -34
- package/themes/light.css +102 -77
- package/themes/light.styles.js +103 -76
- package/dist/components/spinner/spinner.component.mjs +0 -22
- package/dist/components/spinner/spinner.mjs +0 -5
- package/dist/components/spinner/spinner.styles.mjs +0 -64
|
@@ -20,6 +20,7 @@ class FlowUiBadge extends FlowRdfElement {
|
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments);
|
|
22
22
|
this.variant = "primary";
|
|
23
|
+
this.size = "medium";
|
|
23
24
|
this.pill = false;
|
|
24
25
|
this.pulse = false;
|
|
25
26
|
}
|
|
@@ -52,6 +53,9 @@ FlowUiBadge.styles = styles;
|
|
|
52
53
|
__decorateClass([
|
|
53
54
|
property({ reflect: true })
|
|
54
55
|
], FlowUiBadge.prototype, "variant", 2);
|
|
56
|
+
__decorateClass([
|
|
57
|
+
property({ reflect: true })
|
|
58
|
+
], FlowUiBadge.prototype, "size", 2);
|
|
55
59
|
__decorateClass([
|
|
56
60
|
property({ type: Boolean, reflect: true })
|
|
57
61
|
], FlowUiBadge.prototype, "pill", 2);
|
|
@@ -60,6 +60,19 @@ const styles = css`
|
|
|
60
60
|
--background-color: var(--flow-ui-color-danger-500);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/* Size modifiers */
|
|
64
|
+
:host([size='small']) .badge {
|
|
65
|
+
font-size: var(--flow-ui-font-size-x-small);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host([size='medium']) .badge {
|
|
69
|
+
font-size: var(--flow-ui-font-size-small);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([size='large']) .badge {
|
|
73
|
+
font-size: var(--flow-ui-font-size-medium);
|
|
74
|
+
}
|
|
75
|
+
|
|
63
76
|
/* Pill modifier */
|
|
64
77
|
.badge--pill {
|
|
65
78
|
border-radius: var(--flow-ui-border-radius-pill);
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
4
|
+
import styles from './busy-overlay.styles.mjs';
|
|
5
|
+
import { boolean } from '../../internal/boolean.mjs';
|
|
6
|
+
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
+
if (decorator = decorators[i])
|
|
13
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
|
+
if (kind && result)
|
|
15
|
+
__defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
class FlowUiBusyOverlay extends FlowRdfElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.busy = false;
|
|
22
|
+
this.variant = "neutral";
|
|
23
|
+
this.size = "medium";
|
|
24
|
+
this.overlayParent = false;
|
|
25
|
+
}
|
|
26
|
+
connectedCallback() {
|
|
27
|
+
super.connectedCallback();
|
|
28
|
+
this.busy = boolean(this.busy, true);
|
|
29
|
+
this.overlayParent = boolean(this.overlayParent, true);
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return html`
|
|
33
|
+
<slot></slot>
|
|
34
|
+
<div class="busy-overlay">
|
|
35
|
+
<slot name="busy-animation">
|
|
36
|
+
<flow-ui-progress-ring variant=${this.variant} indeterminate></flow-ui-progress-ring>
|
|
37
|
+
</slot>
|
|
38
|
+
</div>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
FlowUiBusyOverlay.styles = styles;
|
|
43
|
+
__decorateClass([
|
|
44
|
+
property({ reflect: true, type: Boolean })
|
|
45
|
+
], FlowUiBusyOverlay.prototype, "busy", 2);
|
|
46
|
+
__decorateClass([
|
|
47
|
+
property({ reflect: true })
|
|
48
|
+
], FlowUiBusyOverlay.prototype, "variant", 2);
|
|
49
|
+
__decorateClass([
|
|
50
|
+
property({ reflect: true })
|
|
51
|
+
], FlowUiBusyOverlay.prototype, "size", 2);
|
|
52
|
+
__decorateClass([
|
|
53
|
+
property({ type: Boolean, reflect: true, attribute: "overlay-parent" })
|
|
54
|
+
], FlowUiBusyOverlay.prototype, "overlayParent", 2);
|
|
55
|
+
|
|
56
|
+
export { FlowUiBusyOverlay as default };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
|
|
4
|
+
const styles = css`
|
|
5
|
+
${componentStyles}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
--transition-delay: 1s;
|
|
9
|
+
--transition-duration: 0.3s;
|
|
10
|
+
|
|
11
|
+
--progress-ring-size: 1.5em;
|
|
12
|
+
--progress-ring-track-width: 0.15em;
|
|
13
|
+
--progress-ring-track-color: transparent;
|
|
14
|
+
--progress-ring-indicator-color: var(--flow-ui-busy-overlay-color);
|
|
15
|
+
|
|
16
|
+
--overlay-background-color: var(--flow-ui-busy-overlay-background-color);
|
|
17
|
+
|
|
18
|
+
display: block;
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.busy-overlay {
|
|
23
|
+
display: flex;
|
|
24
|
+
justify-content: center;
|
|
25
|
+
align-items: center;
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
bottom: 0;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
background: grey;
|
|
34
|
+
background-color: var(--overlay-background-color);
|
|
35
|
+
pointer-events: none;
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transition: opacity var(--transition-duration) ease-in-out;
|
|
38
|
+
z-index: 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
:host([overlay-parent]) {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
right: 0;
|
|
47
|
+
pointer-events: none;
|
|
48
|
+
z-index: 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
:host([busy]) .busy-overlay {
|
|
52
|
+
opacity: 1;
|
|
53
|
+
transition-delay: var(--transition-delay);
|
|
54
|
+
pointer-events: all;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([size='small']) {
|
|
58
|
+
--progress-ring-size: 1em;
|
|
59
|
+
--progress-ring-track-width: 0.15em;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
:host([size='medium']) {
|
|
63
|
+
--progress-ring-size: 1.5em;
|
|
64
|
+
--progress-ring-track-width: 0.15em;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
:host([size='large']) {
|
|
68
|
+
--progress-ring-size: 2.25em;
|
|
69
|
+
--progress-ring-track-width: 0.15em;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([variant='primary']) {
|
|
73
|
+
--progress-ring-indicator-color: var(--flow-ui-color-primary-500);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:host([variant='secondary']) {
|
|
77
|
+
--progress-ring-indicator-color: var(--flow-ui-color-secondary-500);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:host([variant='success']) {
|
|
81
|
+
--progress-ring-indicator-color: var(--flow-ui-color-success-500);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host([variant='neutral']) {
|
|
85
|
+
--progress-ring-indicator-color: var(--flow-ui-busy-overlay-color);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
:host([variant='warning']) {
|
|
89
|
+
--progress-ring-indicator-color: var(--flow-ui-color-warning-500);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:host([variant='danger']) {
|
|
93
|
+
--progress-ring-indicator-color: var(--flow-ui-color-danger-500);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
flow-ui-progress-ring::part(base) {
|
|
97
|
+
--size: var(--progress-ring-size);
|
|
98
|
+
--track-width: var(--progress-ring-track-width);
|
|
99
|
+
--indicator-width: var(--track-width);
|
|
100
|
+
--track-color: var(--progress-ring-track-color);
|
|
101
|
+
--indicator-color: var(--progress-ring-indicator-color);
|
|
102
|
+
}
|
|
103
|
+
`;
|
|
104
|
+
|
|
105
|
+
export { styles as default };
|
|
@@ -221,7 +221,10 @@ class FlowUiButton extends FlowRdfFormControl {
|
|
|
221
221
|
<flow-ui-icon part="caret" class="button__caret" library="system" name="caret"></flow-ui-icon>
|
|
222
222
|
` : ""}
|
|
223
223
|
${this.loading ? html`
|
|
224
|
-
<flow-ui-
|
|
224
|
+
<flow-ui-progress-ring
|
|
225
|
+
size=${this.size === "large" ? "medium" : this.size}
|
|
226
|
+
indeterminate
|
|
227
|
+
></flow-ui-progress-ring>
|
|
225
228
|
` : ""}
|
|
226
229
|
</${tag}>
|
|
227
230
|
`;
|
|
@@ -512,16 +512,25 @@ const buttonStyles = css`
|
|
|
512
512
|
visibility: hidden;
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
-
.button--loading flow-ui-
|
|
516
|
-
--indicator-color: currentColor;
|
|
515
|
+
.button--loading flow-ui-progress-ring {
|
|
517
516
|
position: absolute;
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.button--medium flow-ui-progress-ring,
|
|
520
|
+
.button--large flow-ui-progress-ring {
|
|
521
|
+
top: calc(50% - 0.75em);
|
|
522
|
+
left: calc(50% - 0.75em);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.button--small flow-ui-progress-ring {
|
|
521
526
|
top: calc(50% - 0.5em);
|
|
522
527
|
left: calc(50% - 0.5em);
|
|
523
528
|
}
|
|
524
529
|
|
|
530
|
+
.button--loading flow-ui-progress-ring::part(base) {
|
|
531
|
+
--indicator-color: currentColor;
|
|
532
|
+
}
|
|
533
|
+
|
|
525
534
|
/*
|
|
526
535
|
* Badges
|
|
527
536
|
*/
|
|
@@ -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 {
|
|
@@ -21,41 +21,13 @@ const styles = css`
|
|
|
21
21
|
flex-direction: column;
|
|
22
22
|
background-color: var(--background-color);
|
|
23
23
|
color: var(--color);
|
|
24
|
-
box-shadow: var(--flow-ui-shadow-x-small);
|
|
25
24
|
border: solid var(--border-width) var(--border-color);
|
|
26
25
|
border-radius: var(--border-radius);
|
|
27
26
|
}
|
|
28
27
|
|
|
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
28
|
.card__header {
|
|
47
|
-
display: block;
|
|
48
|
-
border-bottom: solid var(--border-width) var(--border-color);
|
|
49
29
|
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);
|
|
30
|
+
padding-bottom: 0;
|
|
59
31
|
}
|
|
60
32
|
|
|
61
33
|
.card__body {
|
|
@@ -63,16 +35,6 @@ const styles = css`
|
|
|
63
35
|
padding: var(--padding);
|
|
64
36
|
}
|
|
65
37
|
|
|
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
38
|
/* Remove margin from first and last child of default slot */
|
|
77
39
|
::slotted(:nth-child(1 of :not([slot]))) {
|
|
78
40
|
margin-top: 0;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Chart } from 'chart.js';
|
|
2
|
-
import { html } from 'lit';
|
|
2
|
+
import { html, nothing } from 'lit';
|
|
3
3
|
import { property } from 'lit/decorators.js';
|
|
4
4
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
5
5
|
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
6
6
|
import { watch } from '../../internal/watch.mjs';
|
|
7
7
|
import styles from './chart.styles.mjs';
|
|
8
|
+
import { HasSlotController } from '../../internal/slot.mjs';
|
|
9
|
+
import { isStringFull } from '../../internal/type-checks.mjs';
|
|
8
10
|
import { initializeChartJs } from './chartjs-support.mjs';
|
|
9
11
|
|
|
10
12
|
var __defProp = Object.defineProperty;
|
|
@@ -21,7 +23,9 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
21
23
|
class FlowUiChart extends FlowRdfElement {
|
|
22
24
|
constructor() {
|
|
23
25
|
super(...arguments);
|
|
26
|
+
this.hasSlotController = new HasSlotController(this, "label");
|
|
24
27
|
this._chartRef = createRef();
|
|
28
|
+
this.title = "";
|
|
25
29
|
this.plugins = [];
|
|
26
30
|
}
|
|
27
31
|
/** The Chart.js chart instance. */
|
|
@@ -54,14 +58,26 @@ class FlowUiChart extends FlowRdfElement {
|
|
|
54
58
|
}
|
|
55
59
|
}
|
|
56
60
|
render() {
|
|
61
|
+
const hasHeader = isStringFull(this.title) || this.hasSlotController.test("title");
|
|
57
62
|
return html`
|
|
58
|
-
<div part="base" class="chart">
|
|
59
|
-
|
|
63
|
+
<div part="base" class="chart" title="">
|
|
64
|
+
${hasHeader ? html`
|
|
65
|
+
<header part="header" class="chart__header">
|
|
66
|
+
<span part="title" class="chart__title"><slot name="title">${this.title}</slot></span>
|
|
67
|
+
</header>
|
|
68
|
+
` : nothing}
|
|
69
|
+
|
|
70
|
+
<div class="chart_container">
|
|
71
|
+
<canvas ${ref(this._chartRef)}></canvas>
|
|
72
|
+
</div>
|
|
60
73
|
</div>
|
|
61
74
|
`;
|
|
62
75
|
}
|
|
63
76
|
}
|
|
64
77
|
FlowUiChart.styles = styles;
|
|
78
|
+
__decorateClass([
|
|
79
|
+
property({ reflect: true })
|
|
80
|
+
], FlowUiChart.prototype, "title", 2);
|
|
65
81
|
__decorateClass([
|
|
66
82
|
property()
|
|
67
83
|
], FlowUiChart.prototype, "type", 2);
|
|
@@ -66,14 +66,33 @@ const styles = css`
|
|
|
66
66
|
|
|
67
67
|
--dataset-stroke-color-9: var(--flow-ui-chart-stroke-color-9, hsl(292.1 88.4% 57.7%));
|
|
68
68
|
--dataset-fill-color-9: var(--flow-ui-chart-fill-color-9, hsl(292.1 88.4% 57.7%));
|
|
69
|
+
|
|
70
|
+
--header-padding: var(--flow-ui-chart-header-padding, var(--flow-ui-spacing-x-small));
|
|
71
|
+
--header-height: var(--flow-ui-chart-header-height, var(--flow-ui-control-height-medium));
|
|
72
|
+
--header-font-size: var(--flow-ui-chart-header-font-size, var(--flow-ui-font-size-medium));
|
|
73
|
+
--header-color: var(--flow-ui-chart-header-color, var(--flow-ui-color-text));
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
.chart {
|
|
77
|
+
height: 100%;
|
|
72
78
|
background-color: var(--background-color);
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.chart__header {
|
|
84
|
+
flex: 0 0 auto;
|
|
85
|
+
padding: var(--header-padding);
|
|
86
|
+
height: var(--header-height);
|
|
87
|
+
font-size: var(--header-font-size);
|
|
88
|
+
color: var(--header-color);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.chart_container {
|
|
92
|
+
flex: 1;
|
|
73
93
|
position: relative;
|
|
74
94
|
width: 100%;
|
|
75
95
|
height: 100%;
|
|
76
|
-
/* padding: var(--flow-ui-spacing-x-small); */
|
|
77
96
|
}
|
|
78
97
|
`;
|
|
79
98
|
|
|
@@ -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);
|
|
@@ -6,9 +6,9 @@ const styles = css`
|
|
|
6
6
|
|
|
7
7
|
:host {
|
|
8
8
|
--width: 31rem;
|
|
9
|
-
--header-spacing: var(--flow-ui-spacing-
|
|
10
|
-
--body-spacing: var(--flow-ui-spacing-
|
|
11
|
-
--footer-spacing: var(--flow-ui-spacing-
|
|
9
|
+
--header-spacing: var(--flow-ui-spacing-large);
|
|
10
|
+
--body-spacing: var(--flow-ui-spacing-large);
|
|
11
|
+
--footer-spacing: var(--flow-ui-spacing-large);
|
|
12
12
|
|
|
13
13
|
display: contents;
|
|
14
14
|
}
|
|
@@ -18,6 +18,15 @@ 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 */
|
|
22
|
+
::slotted(:nth-child(1 of :not([slot]))) {
|
|
23
|
+
margin-top: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
::slotted(:nth-last-child(1 of :not([slot]))) {
|
|
27
|
+
margin-bottom: 0;
|
|
28
|
+
}
|
|
29
|
+
|
|
21
30
|
.dialog {
|
|
22
31
|
display: flex;
|
|
23
32
|
align-items: center;
|
|
@@ -63,7 +72,7 @@ const styles = css`
|
|
|
63
72
|
display: flex;
|
|
64
73
|
}
|
|
65
74
|
|
|
66
|
-
.
|
|
75
|
+
.dialog__title {
|
|
67
76
|
flex: 1 1 auto;
|
|
68
77
|
font: inherit;
|
|
69
78
|
font-size: var(--flow-ui-font-size-large);
|
|
@@ -92,7 +101,7 @@ const styles = css`
|
|
|
92
101
|
.dialog__body {
|
|
93
102
|
flex: 1 1 auto;
|
|
94
103
|
display: block;
|
|
95
|
-
padding: var(--body-spacing);
|
|
104
|
+
padding-inline: var(--body-spacing);
|
|
96
105
|
overflow: auto;
|
|
97
106
|
-webkit-overflow-scrolling: touch;
|
|
98
107
|
}
|
|
@@ -104,7 +113,7 @@ const styles = css`
|
|
|
104
113
|
}
|
|
105
114
|
|
|
106
115
|
.dialog__footer ::slotted(flow-ui-button:not(:first-of-type)) {
|
|
107
|
-
margin-inline-start: var(--flow-ui-spacing-
|
|
116
|
+
margin-inline-start: var(--flow-ui-spacing-small);
|
|
108
117
|
}
|
|
109
118
|
|
|
110
119
|
.dialog:not(.dialog--has-footer) .dialog__footer {
|
|
@@ -25,6 +25,11 @@ const styles = css`
|
|
|
25
25
|
font-weight: var(--flow-ui-control-font-weight);
|
|
26
26
|
line-height: var(--flow-ui-line-height-dense);
|
|
27
27
|
|
|
28
|
+
--control-background-color: transparent;
|
|
29
|
+
--control-border-color: transparent;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.form-control.form-group--has-border {
|
|
28
33
|
--control-background-color: var(--flow-ui-form-group-background-color);
|
|
29
34
|
--control-border-color: var(--flow-ui-form-group-border-color);
|
|
30
35
|
}
|
|
@@ -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="
|
|
82
|
+
<div slot="title" 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;
|
|
@@ -143,7 +143,8 @@ const icons = {
|
|
|
143
143
|
plus: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="flow-ui-icon"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32v144H48c-17.7 0-32 14.3-32 32s14.3 32 32 32h144v144c0 17.7 14.3 32 32 32s32-14.3 32-32V288h144c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"/></svg>',
|
|
144
144
|
"square-plus": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="flow-ui-icon"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M64 32C28.7 32 0 60.7 0 96v320c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm136 312v-64h-64c-13.3 0-24-10.7-24-24s10.7-24 24-24h64v-64c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24h-64v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"/></svg>',
|
|
145
145
|
"square-minus": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" class="flow-ui-icon"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d="M64 32C28.7 32 0 60.7 0 96v320c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zm88 200h144c13.3 0 24 10.7 24 24s-10.7 24-24 24H152c-13.3 0-24-10.7-24-24s10.7-24 24-24z"/></svg>',
|
|
146
|
-
"ellipsis-vertical": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 512' class='flow-ui-icon'><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d='M64 360a56 56 0 100 112 56 56 0 100-112zm0-160a56 56 0 100 112 56 56 0 100-112zm56-104A56 56 0 108 96a56 56 0 10112 0z'/></svg>"
|
|
146
|
+
"ellipsis-vertical": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 512' class='flow-ui-icon'><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d='M64 360a56 56 0 100 112 56 56 0 100-112zm0-160a56 56 0 100 112 56 56 0 100-112zm56-104A56 56 0 108 96a56 56 0 10112 0z'/></svg>",
|
|
147
|
+
bars: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 448 512' class='flow-ui-icon'><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><path d='M0 96c0-17.7 14.3-32 32-32h384c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zm0 160c0-17.7 14.3-32 32-32h384c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zm448 160c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32h384c17.7 0 32 14.3 32 32z'/></svg>"
|
|
147
148
|
};
|
|
148
149
|
const systemLibrary = {
|
|
149
150
|
name: "system",
|