@emuanalytics/flow-rdf-ui 4.1.0-preview.2 → 4.1.0-preview.20
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/alert/alert.styles.mjs +1 -1
- package/dist/components/badge/badge.component.mjs +4 -0
- package/dist/components/badge/badge.styles.mjs +13 -0
- package/dist/components/breadcrumb-item/breadcrumb-item.styles.mjs +1 -1
- package/dist/components/button/button.styles.mjs +2 -2
- package/dist/components/calendar/calendar.component.mjs +3 -0
- package/dist/components/calendar/calendar.styles.mjs +13 -4
- package/dist/components/card/card.component.mjs +27 -7
- package/dist/components/card/card.styles.mjs +9 -37
- package/dist/components/chart/chart.component.mjs +19 -3
- package/dist/components/chart/chart.styles.mjs +20 -1
- package/dist/components/checkbox-group/checkbox-group.component.mjs +4 -0
- package/dist/components/date-time-picker/date-time-picker.component.mjs +2 -0
- package/dist/components/date-time-picker/date-time-picker.styles.mjs +2 -2
- package/dist/components/dialog/dialog.component.mjs +7 -6
- package/dist/components/dialog/dialog.styles.mjs +16 -7
- package/dist/components/form-group/form-group.component.mjs +19 -14
- package/dist/components/form-group/form-group.styles.mjs +10 -5
- 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/icon-button/icon-button.styles.mjs +1 -1
- package/dist/components/list/list.component.mjs +101 -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 +197 -0
- package/dist/components/list-item/list-item.mjs +5 -0
- package/dist/components/list-item/list-item.styles.mjs +63 -0
- package/dist/components/map/map.component.mjs +6 -1
- package/dist/components/map/map.styles.mjs +1 -0
- package/dist/components/menu/menu.styles.mjs +1 -0
- package/dist/components/menu-item/menu-item.styles.mjs +1 -1
- package/dist/components/menu-label/menu-label.styles.mjs +1 -1
- package/dist/components/option/option.styles.mjs +1 -1
- package/dist/components/panel/panel.component.mjs +10 -3
- package/dist/components/panel/panel.styles.mjs +4 -0
- package/dist/components/panel-header/panel-header.component.mjs +5 -4
- package/dist/components/panel-header/panel-header.styles.mjs +3 -2
- package/dist/components/query-builder/converters/flow-query-converters.mjs +1 -5
- package/dist/components/query-builder/converters/javascript-filter-converter.mjs +1 -5
- package/dist/components/query-builder/converters/map-layer-filter-converter.mjs +1 -5
- package/dist/components/query-builder/helpers.mjs +15 -1
- package/dist/components/query-builder/query-builder.component.mjs +38 -20
- package/dist/components/query-builder/query-builder.styles.mjs +21 -5
- package/dist/components/range/range.component.mjs +1 -1
- package/dist/components/range/range.styles.mjs +5 -1
- package/dist/components/select/select.styles.mjs +9 -0
- package/dist/components/spinner/spinner.styles.mjs +1 -1
- package/dist/components/stepper/stepper.styles.mjs +5 -6
- package/dist/components/switch/switch.styles.mjs +35 -15
- package/dist/components/tab/tab.component.mjs +4 -0
- package/dist/components/tab/tab.styles.mjs +13 -1
- package/dist/components/tab-group/tab-group.component.mjs +1 -0
- package/dist/components/tab-group/tab-group.styles.mjs +1 -0
- package/dist/components/tab-panel/tab-panel.component.mjs +7 -1
- package/dist/components/tab-panel/tab-panel.styles.mjs +7 -3
- package/dist/components/tag/tag.styles.mjs +13 -13
- package/dist/components/timer/timer.component.mjs +3 -2
- package/dist/components/timer/timer.styles.mjs +2 -2
- package/dist/components/tool-button/tool-button.styles.mjs +9 -9
- package/dist/components/tree-item/tree-item.styles.mjs +3 -3
- package/dist/custom-elements.json +2028 -1224
- package/dist/index.d.mts +200 -19
- package/dist/index.d.ts +200 -19
- package/dist/index.mjs +3 -1
- package/dist/package.json.mjs +1 -1
- package/dist/styles/form-control.styles.mjs +5 -0
- package/dist/utilities/register-components.mjs +7 -0
- package/dist/vscode.html-custom-data.json +138 -60
- package/package.json +1 -1
- package/themes/dark.css +141 -88
- package/themes/dark.styles.js +143 -88
- package/themes/light.css +144 -79
- package/themes/light.styles.js +146 -79
|
@@ -20,7 +20,7 @@ const styles = css`
|
|
|
20
20
|
border-top-width: calc(var(--flow-ui-alert-border-width) * 3);
|
|
21
21
|
border-radius: var(--flow-ui-border-radius-medium);
|
|
22
22
|
font-family: var(--flow-ui-font-sans);
|
|
23
|
-
font-size: var(--flow-ui-font-size-
|
|
23
|
+
font-size: var(--flow-ui-font-size-medium);
|
|
24
24
|
font-weight: var(--flow-ui-font-weight-normal);
|
|
25
25
|
line-height: 1.6;
|
|
26
26
|
color: var(--flow-ui-alert-color);
|
|
@@ -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);
|
|
@@ -14,7 +14,7 @@ const styles = css`
|
|
|
14
14
|
font-family: var(--flow-ui-font-sans);
|
|
15
15
|
font-size: var(--flow-ui-font-size-small);
|
|
16
16
|
font-weight: var(--flow-ui-font-weight-semibold);
|
|
17
|
-
color: var(--flow-ui-color-neutral-
|
|
17
|
+
color: var(--flow-ui-color-neutral-800);
|
|
18
18
|
line-height: var(--flow-ui-line-height-normal);
|
|
19
19
|
white-space: nowrap;
|
|
20
20
|
}
|
|
@@ -79,8 +79,8 @@ const buttonStyles = css`
|
|
|
79
79
|
/* Default */
|
|
80
80
|
.button--standard.button--default {
|
|
81
81
|
background-color: var(--flow-ui-color-background);
|
|
82
|
-
border-color: var(--flow-ui-color-neutral-
|
|
83
|
-
color: var(--flow-ui-color-neutral-
|
|
82
|
+
border-color: var(--flow-ui-color-neutral-600);
|
|
83
|
+
color: var(--flow-ui-color-neutral-800);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
.button--standard.button--default:hover:not(.button--disabled) {
|
|
@@ -227,6 +227,7 @@ class FlowUiCalendar extends FlowRdfElement {
|
|
|
227
227
|
return html`
|
|
228
228
|
<div class="calendar__time-container">
|
|
229
229
|
<flow-ui-input
|
|
230
|
+
filled
|
|
230
231
|
type="number"
|
|
231
232
|
size=${this.size === "small" ? "small" : "medium"}
|
|
232
233
|
name="hour"
|
|
@@ -239,6 +240,7 @@ class FlowUiCalendar extends FlowRdfElement {
|
|
|
239
240
|
></flow-ui-input>
|
|
240
241
|
<span class="calendar__time-separator">:</span>
|
|
241
242
|
<flow-ui-input
|
|
243
|
+
filled
|
|
242
244
|
type="number"
|
|
243
245
|
size=${this.size === "small" ? "small" : "medium"}
|
|
244
246
|
name="minute"
|
|
@@ -251,6 +253,7 @@ class FlowUiCalendar extends FlowRdfElement {
|
|
|
251
253
|
></flow-ui-input>
|
|
252
254
|
<span class="calendar__time-separator">:</span>
|
|
253
255
|
<flow-ui-input
|
|
256
|
+
filled
|
|
254
257
|
type="number"
|
|
255
258
|
size=${this.size === "small" ? "small" : "medium"}
|
|
256
259
|
name="second"
|
|
@@ -9,6 +9,10 @@ const styles = css`
|
|
|
9
9
|
--width: 300px;
|
|
10
10
|
--font-size: var(--flow-ui-font-size-medium);
|
|
11
11
|
--day-font-size: var(--flow-ui-font-size-small);
|
|
12
|
+
--day-color-filler: var(--flow-ui-calendar-day-color-filler);
|
|
13
|
+
--day-color-hover: var(--flow-ui-calendar-day-color-hover);
|
|
14
|
+
--day-color-selected: var(--flow-ui-calendar-day-color-selected);
|
|
15
|
+
--day-color-today: var(--flow-ui-calendar-day-color-today);
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
.calendar {
|
|
@@ -76,20 +80,20 @@ const styles = css`
|
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
.calendar__day:hover:not(.calendar__day--selected) {
|
|
79
|
-
background-color: var(--
|
|
83
|
+
background-color: var(--day-color-hover);
|
|
80
84
|
}
|
|
81
85
|
|
|
82
86
|
.calendar__day--filler {
|
|
83
|
-
color: var(--
|
|
87
|
+
color: var(--day-color-filler);
|
|
84
88
|
}
|
|
85
89
|
|
|
86
90
|
.calendar__day--today {
|
|
87
|
-
border: 1px solid var(--
|
|
91
|
+
border: 1px solid var(--day-color-today);
|
|
88
92
|
}
|
|
89
93
|
|
|
90
94
|
.calendar__day--selected {
|
|
91
95
|
color: var(--flow-ui-color-background);
|
|
92
|
-
background-color: var(--
|
|
96
|
+
background-color: var(--day-color-selected);
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
.calendar__header {
|
|
@@ -114,8 +118,13 @@ const styles = css`
|
|
|
114
118
|
--flow-ui-control-spacing-medium: var(--flow-ui-spacing-small);
|
|
115
119
|
}
|
|
116
120
|
|
|
121
|
+
.calendar__time-input::part(form-control-input) {
|
|
122
|
+
background-color: var(--flow-ui-calendar-time-color);
|
|
123
|
+
}
|
|
124
|
+
|
|
117
125
|
.calendar__time-input::part(input) {
|
|
118
126
|
/* Remove padding between spin controls to accommodate narrow calendars */
|
|
127
|
+
|
|
119
128
|
padding-right: 0;
|
|
120
129
|
}
|
|
121
130
|
|
|
@@ -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,15 +5,15 @@ 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);
|
|
11
|
-
--padding: var(--flow-ui-
|
|
13
|
+
--padding: var(--flow-ui-card-padding);
|
|
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,14 +36,13 @@ const styles = css`
|
|
|
63
36
|
padding: var(--padding);
|
|
64
37
|
}
|
|
65
38
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
padding: var(--padding);
|
|
39
|
+
/* Remove margin from first and last child of default slot */
|
|
40
|
+
::slotted(:nth-child(1 of :not([slot]))) {
|
|
41
|
+
margin-top: 0;
|
|
70
42
|
}
|
|
71
43
|
|
|
72
|
-
|
|
73
|
-
|
|
44
|
+
::slotted(:nth-last-child(1 of :not([slot]))) {
|
|
45
|
+
margin-bottom: 0;
|
|
74
46
|
}
|
|
75
47
|
`;
|
|
76
48
|
|
|
@@ -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
|
|
|
@@ -7,6 +7,7 @@ import { FormControlController, customErrorValidityState, valueMissingValiditySt
|
|
|
7
7
|
import { HasSlotController } from '../../internal/slot.mjs';
|
|
8
8
|
import { watch } from '../../internal/watch.mjs';
|
|
9
9
|
import styles from './checkbox-group.styles.mjs';
|
|
10
|
+
import { isNil } from '../../internal/type-checks.mjs';
|
|
10
11
|
|
|
11
12
|
var __defProp = Object.defineProperty;
|
|
12
13
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -119,6 +120,9 @@ class FlowUiCheckboxGroup extends FlowRdfFormControl {
|
|
|
119
120
|
this.syncCheckboxes();
|
|
120
121
|
}
|
|
121
122
|
handleValueChange() {
|
|
123
|
+
if (isNil(this.value)) {
|
|
124
|
+
this.value = [];
|
|
125
|
+
}
|
|
122
126
|
if (this.hasUpdated) {
|
|
123
127
|
this.updateCheckedState();
|
|
124
128
|
}
|
|
@@ -79,6 +79,7 @@ class FlowUiDateTimePicker extends FlowRdfFormControl {
|
|
|
79
79
|
this.required = boolean(this.required, true);
|
|
80
80
|
this.filled = boolean(this.filled, true);
|
|
81
81
|
this.pill = boolean(this.pill, true);
|
|
82
|
+
this.inline = boolean(this.inline, true);
|
|
82
83
|
this.handleDocumentFocusIn = this.handleDocumentFocusIn.bind(this);
|
|
83
84
|
this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);
|
|
84
85
|
this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
|
@@ -288,6 +289,7 @@ class FlowUiDateTimePicker extends FlowRdfFormControl {
|
|
|
288
289
|
"form-control--small": this.size === "small",
|
|
289
290
|
"form-control--medium": this.size === "medium",
|
|
290
291
|
"form-control--large": this.size === "large",
|
|
292
|
+
"form-control--filled": this.filled,
|
|
291
293
|
"form-control--has-label": hasLabel,
|
|
292
294
|
"form-control--has-help-text": hasHelpText,
|
|
293
295
|
"form-control--has-divider": this.divider,
|
|
@@ -237,7 +237,7 @@ const styles = css`
|
|
|
237
237
|
|
|
238
238
|
/* Mode icon (calendar/clock) */
|
|
239
239
|
.datepicker__mode-icon {
|
|
240
|
-
color: var(--flow-ui-color-neutral-
|
|
240
|
+
color: var(--flow-ui-color-neutral-800);
|
|
241
241
|
flex: 0 0 auto;
|
|
242
242
|
display: flex;
|
|
243
243
|
align-items: center;
|
|
@@ -256,7 +256,7 @@ const styles = css`
|
|
|
256
256
|
font-size: var(--flow-ui-font-size-medium);
|
|
257
257
|
font-weight: var(--flow-ui-font-weight-normal);
|
|
258
258
|
box-shadow: var(--flow-ui-shadow-large);
|
|
259
|
-
background: var(--flow-ui-
|
|
259
|
+
background: var(--flow-ui-calendar-background-color);
|
|
260
260
|
border: solid var(--flow-ui-menu-border-width) var(--flow-ui-menu-border-color);
|
|
261
261
|
border-radius: var(--flow-ui-border-radius-medium);
|
|
262
262
|
padding: var(--flow-ui-spacing-x-small);
|
|
@@ -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);
|
|
@@ -86,13 +95,13 @@ const styles = css`
|
|
|
86
95
|
flex: 0 0 auto;
|
|
87
96
|
display: flex;
|
|
88
97
|
align-items: center;
|
|
89
|
-
font-size: var(--flow-ui-font-size-
|
|
98
|
+
font-size: var(--flow-ui-font-size-large);
|
|
90
99
|
}
|
|
91
100
|
|
|
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 {
|
|
@@ -2,7 +2,7 @@ import { html } from 'lit';
|
|
|
2
2
|
import { query, property } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { boolean } from '../../internal/boolean.mjs';
|
|
5
|
-
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
5
|
+
import FlowRdfElement, { FlowRdfFormControl } from '../../internal/flow-ui-rdf-element.mjs';
|
|
6
6
|
import { HasSlotController } from '../../internal/slot.mjs';
|
|
7
7
|
import { watch } from '../../internal/watch.mjs';
|
|
8
8
|
import styles from './form-group.styles.mjs';
|
|
@@ -25,14 +25,16 @@ class FlowUiFormGroup extends FlowRdfElement {
|
|
|
25
25
|
this.label = "";
|
|
26
26
|
this.size = "medium";
|
|
27
27
|
this.helpText = "";
|
|
28
|
-
this.
|
|
29
|
-
this.noBorder = false;
|
|
28
|
+
this.borders = false;
|
|
30
29
|
this.variant = "default";
|
|
31
30
|
}
|
|
32
31
|
connectedCallback() {
|
|
33
32
|
super.connectedCallback();
|
|
34
|
-
this.
|
|
35
|
-
this.
|
|
33
|
+
this.classList.add(FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
|
|
34
|
+
this.borders = boolean(this.borders, true);
|
|
35
|
+
}
|
|
36
|
+
handleClassChange() {
|
|
37
|
+
this.classList.add(FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
|
|
36
38
|
}
|
|
37
39
|
handleStyleChange() {
|
|
38
40
|
this.syncControls();
|
|
@@ -42,7 +44,7 @@ class FlowUiFormGroup extends FlowRdfElement {
|
|
|
42
44
|
const controls = this.getAllControls();
|
|
43
45
|
controls.forEach((control, i) => {
|
|
44
46
|
control.size = this.size;
|
|
45
|
-
control.divider =
|
|
47
|
+
control.divider = this.borders && i < controls.length - 1;
|
|
46
48
|
});
|
|
47
49
|
} else {
|
|
48
50
|
customElements.whenDefined("flow-ui-form-group").then(() => this.syncControls());
|
|
@@ -72,8 +74,8 @@ class FlowUiFormGroup extends FlowRdfElement {
|
|
|
72
74
|
"form-control--default": this.variant === "default",
|
|
73
75
|
"form-control--warning": this.variant === "warning",
|
|
74
76
|
"form-control--danger": this.variant === "danger",
|
|
75
|
-
"form-group--has-dividers":
|
|
76
|
-
"form-group--has-border":
|
|
77
|
+
"form-group--has-dividers": this.borders,
|
|
78
|
+
"form-group--has-border": this.borders
|
|
77
79
|
})}
|
|
78
80
|
aria-labelledby="label"
|
|
79
81
|
aria-describedby="help-text"
|
|
@@ -108,7 +110,10 @@ __decorateClass([
|
|
|
108
110
|
query("slot:not([name])")
|
|
109
111
|
], FlowUiFormGroup.prototype, "defaultSlot", 2);
|
|
110
112
|
__decorateClass([
|
|
111
|
-
property()
|
|
113
|
+
property({ reflect: true })
|
|
114
|
+
], FlowUiFormGroup.prototype, "class", 2);
|
|
115
|
+
__decorateClass([
|
|
116
|
+
property({ reflect: true })
|
|
112
117
|
], FlowUiFormGroup.prototype, "label", 2);
|
|
113
118
|
__decorateClass([
|
|
114
119
|
property({ reflect: true })
|
|
@@ -117,14 +122,14 @@ __decorateClass([
|
|
|
117
122
|
property({ attribute: "help-text" })
|
|
118
123
|
], FlowUiFormGroup.prototype, "helpText", 2);
|
|
119
124
|
__decorateClass([
|
|
120
|
-
property({ type: Boolean, attribute: "
|
|
121
|
-
], FlowUiFormGroup.prototype, "
|
|
122
|
-
__decorateClass([
|
|
123
|
-
property({ type: Boolean, attribute: "no-border", reflect: true })
|
|
124
|
-
], FlowUiFormGroup.prototype, "noBorder", 2);
|
|
125
|
+
property({ type: Boolean, attribute: "borders", reflect: true })
|
|
126
|
+
], FlowUiFormGroup.prototype, "borders", 2);
|
|
125
127
|
__decorateClass([
|
|
126
128
|
property({ reflect: true })
|
|
127
129
|
], FlowUiFormGroup.prototype, "variant", 2);
|
|
130
|
+
__decorateClass([
|
|
131
|
+
watch("class")
|
|
132
|
+
], FlowUiFormGroup.prototype, "handleClassChange", 1);
|
|
128
133
|
__decorateClass([
|
|
129
134
|
watch(["size", "noDividers", "noBorder"], { waitUntilFirstUpdate: true })
|
|
130
135
|
], FlowUiFormGroup.prototype, "handleStyleChange", 1);
|
|
@@ -15,10 +15,6 @@ const styles = css`
|
|
|
15
15
|
margin-top: var(--flow-ui-spacing-x-large);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
:host(:first-child) {
|
|
19
|
-
margin-top: var(--flow-ui-spacing-x-small);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
.form-control {
|
|
23
19
|
display: grid;
|
|
24
20
|
grid-template-columns: 1fr;
|
|
@@ -28,10 +24,18 @@ const styles = css`
|
|
|
28
24
|
font-size: inherit;
|
|
29
25
|
font-weight: var(--flow-ui-control-font-weight);
|
|
30
26
|
line-height: var(--flow-ui-line-height-dense);
|
|
27
|
+
|
|
28
|
+
--control-background-color: transparent;
|
|
29
|
+
--control-border-color: transparent;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.form-control.form-group--has-border {
|
|
33
|
+
--control-background-color: var(--flow-ui-form-group-background-color);
|
|
34
|
+
--control-border-color: var(--flow-ui-form-group-border-color);
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
.form-control.form-control--has-label .form-control__label {
|
|
34
|
-
color: var(--flow-ui-color-
|
|
38
|
+
color: var(--flow-ui-color-text);
|
|
35
39
|
font-weight: var(--flow-ui-font-weight-semibold);
|
|
36
40
|
margin-top: 0 !important;
|
|
37
41
|
margin-bottom: 0 !important;
|
|
@@ -52,6 +56,7 @@ const styles = css`
|
|
|
52
56
|
grid-template-columns: 1fr;
|
|
53
57
|
grid-row-gap: var(--control-spacing);
|
|
54
58
|
padding-block: calc(var(--control-spacing) / 2);
|
|
59
|
+
background-color: var(--control-background-color);
|
|
55
60
|
}
|
|
56
61
|
|
|
57
62
|
.form-control.form-group--has-dividers .form-group__content {
|