@emuanalytics/flow-rdf-ui 4.1.0-preview.2 → 4.1.0-preview.21
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 +2 -1
- 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 +4739 -3935
- 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 +169 -91
- 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
|
@@ -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",
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
5
|
+
import styles from './list.styles.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 FlowUiList extends FlowRdfElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this.draggedItem = null;
|
|
22
|
+
this.draggedOverItem = null;
|
|
23
|
+
this.readonly = false;
|
|
24
|
+
this.reorder = false;
|
|
25
|
+
this.removable = false;
|
|
26
|
+
}
|
|
27
|
+
connectedCallback() {
|
|
28
|
+
super.connectedCallback();
|
|
29
|
+
}
|
|
30
|
+
disconnectedCallback() {
|
|
31
|
+
super.disconnectedCallback();
|
|
32
|
+
}
|
|
33
|
+
get listItems() {
|
|
34
|
+
return [...this.querySelectorAll("flow-ui-list-item")];
|
|
35
|
+
}
|
|
36
|
+
handleDragStart(ev) {
|
|
37
|
+
this.draggedItem = ev.target;
|
|
38
|
+
console.log(`parent drag start: ${this.draggedItem.value}`, this.draggedItem);
|
|
39
|
+
}
|
|
40
|
+
handleDragOver(ev) {
|
|
41
|
+
ev.stopPropagation();
|
|
42
|
+
if (!this.draggedItem) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
let target = ev.target.closest("flow-ui-list-item");
|
|
46
|
+
if (target === this.draggedItem) {
|
|
47
|
+
target = null;
|
|
48
|
+
}
|
|
49
|
+
if (target && target !== this.draggedOverItem) {
|
|
50
|
+
if (this.draggedItem === target.previousElementSibling) {
|
|
51
|
+
console.log("moving down");
|
|
52
|
+
this.insertBefore(this.draggedItem, target.nextSibling);
|
|
53
|
+
} else if (this.draggedItem === target.nextElementSibling) {
|
|
54
|
+
this.insertBefore(this.draggedItem, target);
|
|
55
|
+
}
|
|
56
|
+
this.draggedOverItem = null;
|
|
57
|
+
} else {
|
|
58
|
+
this.draggedOverItem = target;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
handleDrop(_ev) {
|
|
62
|
+
if (!this.draggedItem || !this.draggedOverItem) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
console.log(`parent drop: ${this.draggedItem.value} onto target: ${this.draggedOverItem.value}`);
|
|
66
|
+
}
|
|
67
|
+
handleDragEnd(ev) {
|
|
68
|
+
const target = ev.target.value;
|
|
69
|
+
console.log(`parent drag end: target: ${target}`);
|
|
70
|
+
this.draggedItem = null;
|
|
71
|
+
this.draggedOverItem = null;
|
|
72
|
+
}
|
|
73
|
+
render() {
|
|
74
|
+
return html`
|
|
75
|
+
<div
|
|
76
|
+
part="base"
|
|
77
|
+
class=${classMap({
|
|
78
|
+
list: true
|
|
79
|
+
})}
|
|
80
|
+
@flow-ui-drag-start=${this.handleDragStart}
|
|
81
|
+
@flow-ui-drag-over=${this.handleDragOver}
|
|
82
|
+
@flow-ui-drag-drop=${this.handleDrop}
|
|
83
|
+
@flow-ui-drag-end=${this.handleDragEnd}
|
|
84
|
+
>
|
|
85
|
+
<slot></slot>
|
|
86
|
+
</div>
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
FlowUiList.styles = styles;
|
|
91
|
+
__decorateClass([
|
|
92
|
+
property({ type: Boolean })
|
|
93
|
+
], FlowUiList.prototype, "readonly", 2);
|
|
94
|
+
__decorateClass([
|
|
95
|
+
property({ type: Boolean })
|
|
96
|
+
], FlowUiList.prototype, "reorder", 2);
|
|
97
|
+
__decorateClass([
|
|
98
|
+
property({ type: Boolean })
|
|
99
|
+
], FlowUiList.prototype, "removable", 2);
|
|
100
|
+
|
|
101
|
+
export { FlowUiList as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
|
|
4
|
+
const styles = css`
|
|
5
|
+
${componentStyles}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
|
|
10
|
+
--divider-color: var(--flow-ui-divider-color);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.list {
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
gap: max(var(--flow-ui-divider-width), 2px);
|
|
17
|
+
background-color: var(--divider-color);
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
|
|
21
|
+
export { styles as default };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { html, nothing } from 'lit';
|
|
2
|
+
import { query, property } from 'lit/decorators.js';
|
|
3
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
4
|
+
import { boolean } from '../../internal/boolean.mjs';
|
|
5
|
+
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
6
|
+
import { HasSlotController } from '../../internal/slot.mjs';
|
|
7
|
+
import styles from './list-item.styles.mjs';
|
|
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
|
+
};
|
|
20
|
+
class FlowUiListItem extends FlowRdfElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.hasSlotController = new HasSlotController(this, "prefix", "suffix", "menu");
|
|
24
|
+
this.readonly = false;
|
|
25
|
+
this.reorder = false;
|
|
26
|
+
this.removable = false;
|
|
27
|
+
this.handleDragStart = (ev) => {
|
|
28
|
+
ev.stopPropagation();
|
|
29
|
+
ev.dataTransfer.setData("application/flow-ui-list-item", this.value);
|
|
30
|
+
ev.dataTransfer.effectAllowed = "move";
|
|
31
|
+
this.emit("flow-ui-drag-start");
|
|
32
|
+
};
|
|
33
|
+
this.handleDragStart = this.handleDragStart.bind(this);
|
|
34
|
+
this.handleDragOver = this.handleDragOver.bind(this);
|
|
35
|
+
this.handleDrop = this.handleDrop.bind(this);
|
|
36
|
+
this.handleDragEnd = this.handleDragEnd.bind(this);
|
|
37
|
+
}
|
|
38
|
+
connectedCallback() {
|
|
39
|
+
super.connectedCallback();
|
|
40
|
+
this.readonly = boolean(this.readonly);
|
|
41
|
+
this.reorder = boolean(this.reorder);
|
|
42
|
+
this.removable = boolean(this.removable);
|
|
43
|
+
this.addEventListener("dragover", this.handleDragOver);
|
|
44
|
+
this.addEventListener("drop", this.handleDrop);
|
|
45
|
+
}
|
|
46
|
+
disconnectedCallback() {
|
|
47
|
+
super.disconnectedCallback();
|
|
48
|
+
this.removeEventListener("dragover", this.handleDragOver);
|
|
49
|
+
this.removeEventListener("drop", this.handleDrop);
|
|
50
|
+
}
|
|
51
|
+
rename() {
|
|
52
|
+
this.input.focus();
|
|
53
|
+
}
|
|
54
|
+
handleMenuSelect(ev) {
|
|
55
|
+
const menuItem = ev.detail.item;
|
|
56
|
+
if (menuItem.value === "rename") {
|
|
57
|
+
this.updateComplete.then(() => this.rename());
|
|
58
|
+
} else if (menuItem.value === "remove") {
|
|
59
|
+
const requestRemove = this.emit("flow-ui-remove", { cancelable: true });
|
|
60
|
+
if (!requestRemove.defaultPrevented) {
|
|
61
|
+
this.remove();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
handleInputEvents(ev) {
|
|
66
|
+
if (ev.type === "flow-ui-change") {
|
|
67
|
+
this.label = this.input.value;
|
|
68
|
+
this.input.blur();
|
|
69
|
+
} else {
|
|
70
|
+
ev.stopPropagation();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
handleReorderPointerDown(_ev) {
|
|
74
|
+
this.addEventListener("dragstart", this.handleDragStart);
|
|
75
|
+
console.log("adding dragstart");
|
|
76
|
+
this.addEventListener("dragend", this.handleDragEnd);
|
|
77
|
+
this.setAttribute("draggable", "true");
|
|
78
|
+
}
|
|
79
|
+
handleReorderPointerUp(_ev) {
|
|
80
|
+
this.removeEventListener("dragstart", this.handleDragStart);
|
|
81
|
+
console.log("removing dragstart");
|
|
82
|
+
this.removeEventListener("dragend", this.handleDragEnd);
|
|
83
|
+
this.removeAttribute("draggable");
|
|
84
|
+
}
|
|
85
|
+
handleDragOver(ev) {
|
|
86
|
+
ev.stopPropagation();
|
|
87
|
+
ev.preventDefault();
|
|
88
|
+
if (ev.dataTransfer?.types.includes("application/flow-ui-list-item")) {
|
|
89
|
+
ev.dataTransfer.dropEffect = "move";
|
|
90
|
+
this.emit("flow-ui-drag-over");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
handleDragEnd(ev) {
|
|
94
|
+
ev.stopPropagation();
|
|
95
|
+
this.removeEventListener("dragstart", this.handleDragStart);
|
|
96
|
+
console.log("removing dragstart");
|
|
97
|
+
this.removeEventListener("dragend", this.handleDragEnd);
|
|
98
|
+
this.removeAttribute("draggable");
|
|
99
|
+
this.emit("flow-ui-drag-end");
|
|
100
|
+
}
|
|
101
|
+
handleDrop(ev) {
|
|
102
|
+
ev.preventDefault();
|
|
103
|
+
ev.stopPropagation();
|
|
104
|
+
this.emit("flow-ui-drag-drop");
|
|
105
|
+
}
|
|
106
|
+
renderMenu() {
|
|
107
|
+
const hasCustomMenuDivider = (!this.readonly || this.removable) && this.hasSlotController.test("menu");
|
|
108
|
+
return html`
|
|
109
|
+
<flow-ui-dropdown placement="bottom-end" class="list-item__menu-dropdown">
|
|
110
|
+
<flow-ui-icon-button
|
|
111
|
+
part="menu-button"
|
|
112
|
+
class="list-item__menu-button"
|
|
113
|
+
slot="trigger"
|
|
114
|
+
name="ellipsis-vertical"
|
|
115
|
+
library="system"
|
|
116
|
+
></flow-ui-icon-button>
|
|
117
|
+
<flow-ui-menu @flow-ui-select=${this.handleMenuSelect}>
|
|
118
|
+
${!this.readonly ? html`
|
|
119
|
+
<flow-ui-menu-item value="rename">Rename</flow-ui-menu-item>
|
|
120
|
+
` : nothing}
|
|
121
|
+
${this.removable ? html`
|
|
122
|
+
<flow-ui-menu-item value="remove">Delete</flow-ui-menu-item>
|
|
123
|
+
` : nothing}
|
|
124
|
+
${hasCustomMenuDivider ? html`
|
|
125
|
+
<flow-ui-divider></flow-ui-divider>
|
|
126
|
+
` : nothing}
|
|
127
|
+
${this.hasSlotController.test("menu") ? html`
|
|
128
|
+
<slot name="menu"></slot>
|
|
129
|
+
` : nothing}
|
|
130
|
+
</flow-ui-menu>
|
|
131
|
+
<slot name="menu"></slot>
|
|
132
|
+
</flow-ui-dropdown>
|
|
133
|
+
`;
|
|
134
|
+
}
|
|
135
|
+
render() {
|
|
136
|
+
const hasMenu = this.readonly || this.removable || this.hasSlotController.test("menu");
|
|
137
|
+
return html`
|
|
138
|
+
<div
|
|
139
|
+
part="base"
|
|
140
|
+
class=${classMap({
|
|
141
|
+
"list-item": true,
|
|
142
|
+
"list-item--has-prefix": this.hasSlotController.test("prefix"),
|
|
143
|
+
"list-item--has-suffix": this.hasSlotController.test("suffix"),
|
|
144
|
+
"list-item--has-menu": this.hasSlotController.test("menu"),
|
|
145
|
+
"list-item--readonly": this.readonly
|
|
146
|
+
})}
|
|
147
|
+
>
|
|
148
|
+
${this.reorder ? html`
|
|
149
|
+
<flow-ui-icon
|
|
150
|
+
part="reorder-icon"
|
|
151
|
+
name="bars"
|
|
152
|
+
library="system"
|
|
153
|
+
class="list-item__reorder-icon"
|
|
154
|
+
@pointerdown=${this.handleReorderPointerDown}
|
|
155
|
+
@pointerup=${this.handleReorderPointerUp}
|
|
156
|
+
></flow-ui-icon>
|
|
157
|
+
` : nothing}
|
|
158
|
+
<slot name="prefix" part="prefix" class="list-item__prefix"></slot>
|
|
159
|
+
|
|
160
|
+
<flow-ui-input
|
|
161
|
+
exportparts="input"
|
|
162
|
+
inline
|
|
163
|
+
class="list-item__input"
|
|
164
|
+
.value=${this.label}
|
|
165
|
+
.readonly=${this.readonly}
|
|
166
|
+
@flow-ui-change=${this.handleInputEvents}
|
|
167
|
+
@flow-ui-input=${this.handleInputEvents}
|
|
168
|
+
></flow-ui-input>
|
|
169
|
+
<div class="list-item__spacer"></div>
|
|
170
|
+
<slot name="suffix" part="suffix" class="list-item__suffix"></slot>
|
|
171
|
+
|
|
172
|
+
${hasMenu ? this.renderMenu() : nothing}
|
|
173
|
+
</div>
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
FlowUiListItem.styles = styles;
|
|
178
|
+
__decorateClass([
|
|
179
|
+
query(".list-item__input")
|
|
180
|
+
], FlowUiListItem.prototype, "input", 2);
|
|
181
|
+
__decorateClass([
|
|
182
|
+
property({ reflect: true })
|
|
183
|
+
], FlowUiListItem.prototype, "label", 2);
|
|
184
|
+
__decorateClass([
|
|
185
|
+
property({ reflect: true })
|
|
186
|
+
], FlowUiListItem.prototype, "value", 2);
|
|
187
|
+
__decorateClass([
|
|
188
|
+
property({ type: Boolean, reflect: true })
|
|
189
|
+
], FlowUiListItem.prototype, "readonly", 2);
|
|
190
|
+
__decorateClass([
|
|
191
|
+
property({ type: Boolean, reflect: true })
|
|
192
|
+
], FlowUiListItem.prototype, "reorder", 2);
|
|
193
|
+
__decorateClass([
|
|
194
|
+
property({ type: Boolean, reflect: true })
|
|
195
|
+
], FlowUiListItem.prototype, "removable", 2);
|
|
196
|
+
|
|
197
|
+
export { FlowUiListItem as default };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
|
|
4
|
+
const styles = css`
|
|
5
|
+
${componentStyles}
|
|
6
|
+
|
|
7
|
+
:host {
|
|
8
|
+
display: block;
|
|
9
|
+
--padding: var(--flow-ui-list-item-padding);
|
|
10
|
+
--height: var(--flow-ui-list-item-height);
|
|
11
|
+
--color: var(--flow-ui-list-item-color);
|
|
12
|
+
--accessory-color: var(--flow-ui-list-item-accessory-color);
|
|
13
|
+
--background-color: var(--flow-ui-list-item-background-color);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
:host([draggable='true']) {
|
|
17
|
+
opacity: 0.1;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.list-item {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--flow-ui-spacing-small);
|
|
24
|
+
|
|
25
|
+
height: var(--height);
|
|
26
|
+
padding: var(--padding);
|
|
27
|
+
|
|
28
|
+
color: var(--color);
|
|
29
|
+
background-color: var(--background-color);
|
|
30
|
+
user-select: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.list-item__prefix,
|
|
34
|
+
.list-item__suffix,
|
|
35
|
+
.list-item__menu-button,
|
|
36
|
+
.list-item__reorder-icon {
|
|
37
|
+
color: var(--accessory-color);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.list-item__spacer {
|
|
41
|
+
flex: 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.list-item.list-item--readonly .list-item__input::part(form-control) {
|
|
45
|
+
--control-background-color-hover: transparent;
|
|
46
|
+
--control-border-color-hover: transparent;
|
|
47
|
+
--control-background-color-focus: transparent;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.list-item__menu-button {
|
|
51
|
+
visibility: hidden;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.list-item:hover .list-item__menu-button {
|
|
55
|
+
visibility: visible;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.list-item__reorder-icon {
|
|
59
|
+
cursor: move;
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
|
|
63
|
+
export { styles as default };
|
|
@@ -29,6 +29,7 @@ class FlowUiMap extends FlowRdfElement {
|
|
|
29
29
|
this.busy = false;
|
|
30
30
|
this.fixed = false;
|
|
31
31
|
this.bearingSnap = 7;
|
|
32
|
+
this.fadeDuration = 300;
|
|
32
33
|
this._initialized = new Promise((resolve) => {
|
|
33
34
|
this._resolveInitialized = resolve;
|
|
34
35
|
});
|
|
@@ -94,7 +95,8 @@ class FlowUiMap extends FlowRdfElement {
|
|
|
94
95
|
baseStyle: this.baseStyle,
|
|
95
96
|
center: this.center,
|
|
96
97
|
zoom: this.zoom,
|
|
97
|
-
bearingSnap: this.bearingSnap
|
|
98
|
+
bearingSnap: this.bearingSnap,
|
|
99
|
+
fadeDuration: this.fadeDuration
|
|
98
100
|
});
|
|
99
101
|
await map.initialized;
|
|
100
102
|
if (this._pendingCenter) {
|
|
@@ -193,6 +195,9 @@ __decorateClass([
|
|
|
193
195
|
__decorateClass([
|
|
194
196
|
property({ type: Number, attribute: "bearing-snap" })
|
|
195
197
|
], FlowUiMap.prototype, "bearingSnap", 2);
|
|
198
|
+
__decorateClass([
|
|
199
|
+
property({ type: Number, attribute: "fade-duration" })
|
|
200
|
+
], FlowUiMap.prototype, "fadeDuration", 2);
|
|
196
201
|
__decorateClass([
|
|
197
202
|
watch(["center", "zoom", "bearing", "pitch"])
|
|
198
203
|
], FlowUiMap.prototype, "handleCenterChange", 1);
|
|
@@ -21,7 +21,7 @@ const styles = css`
|
|
|
21
21
|
font-weight: var(--flow-ui-font-weight-normal);
|
|
22
22
|
line-height: var(--flow-ui-line-height-normal);
|
|
23
23
|
letter-spacing: var(--flow-ui-letter-spacing-normal);
|
|
24
|
-
color: var(--flow-ui-color
|
|
24
|
+
color: var(--flow-ui-menu-color);
|
|
25
25
|
padding: var(--flow-ui-spacing-2x-small) var(--flow-ui-spacing-2x-small);
|
|
26
26
|
transition: var(--flow-ui-transition-fast) fill;
|
|
27
27
|
user-select: none;
|
|
@@ -15,7 +15,7 @@ const styles = css`
|
|
|
15
15
|
font-weight: var(--flow-ui-font-weight-semibold);
|
|
16
16
|
line-height: var(--flow-ui-line-height-normal);
|
|
17
17
|
letter-spacing: var(--flow-ui-letter-spacing-normal);
|
|
18
|
-
color: var(--flow-ui-color-neutral-
|
|
18
|
+
color: var(--flow-ui-color-neutral-800);
|
|
19
19
|
padding: var(--flow-ui-spacing-2x-small) var(--flow-ui-spacing-x-large);
|
|
20
20
|
user-select: none;
|
|
21
21
|
}
|
|
@@ -22,7 +22,7 @@ const styles = css`
|
|
|
22
22
|
font-weight: var(--flow-ui-font-weight-normal);
|
|
23
23
|
line-height: var(--flow-ui-line-height-normal);
|
|
24
24
|
letter-spacing: var(--flow-ui-letter-spacing-normal);
|
|
25
|
-
color: var(--flow-ui-color
|
|
25
|
+
color: var(--flow-ui-menu-color);
|
|
26
26
|
padding: var(--flow-ui-spacing-x-small) var(--flow-ui-spacing-medium) var(--flow-ui-spacing-x-small)
|
|
27
27
|
var(--flow-ui-spacing-x-small);
|
|
28
28
|
transition: var(--flow-ui-transition-fast) fill;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { html } from 'lit';
|
|
2
|
-
import { property } from 'lit/decorators.js';
|
|
2
|
+
import { queryAssignedElements, property } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { boolean } from '../../internal/boolean.mjs';
|
|
5
5
|
import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
@@ -50,6 +50,9 @@ class FlowUiPanel extends FlowRdfElement {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
+
handleSlotChange() {
|
|
54
|
+
this.requestUpdate();
|
|
55
|
+
}
|
|
53
56
|
render() {
|
|
54
57
|
return html`
|
|
55
58
|
<div
|
|
@@ -57,7 +60,8 @@ class FlowUiPanel extends FlowRdfElement {
|
|
|
57
60
|
panel: true,
|
|
58
61
|
"panel--closed": this.closed,
|
|
59
62
|
"panel--scrollable": this.scrollable,
|
|
60
|
-
"panel--with-padding": this.padding
|
|
63
|
+
"panel--with-padding": this.padding,
|
|
64
|
+
"panel--has-form-controls": this.formElements.length > 0
|
|
61
65
|
})}
|
|
62
66
|
>
|
|
63
67
|
<slot
|
|
@@ -69,7 +73,7 @@ class FlowUiPanel extends FlowRdfElement {
|
|
|
69
73
|
|
|
70
74
|
<div class="panel__body-wrapper">
|
|
71
75
|
<div part="body" class="panel__body">
|
|
72
|
-
<slot></slot>
|
|
76
|
+
<slot @slotchange=${this.handleSlotChange}></slot>
|
|
73
77
|
</div>
|
|
74
78
|
</div>
|
|
75
79
|
</div>
|
|
@@ -77,6 +81,9 @@ class FlowUiPanel extends FlowRdfElement {
|
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
FlowUiPanel.styles = styles;
|
|
84
|
+
__decorateClass([
|
|
85
|
+
queryAssignedElements({ selector: ".flow-ui-form-control[borders]" })
|
|
86
|
+
], FlowUiPanel.prototype, "formElements", 2);
|
|
80
87
|
__decorateClass([
|
|
81
88
|
property({ type: Boolean, reflect: true })
|
|
82
89
|
], FlowUiPanel.prototype, "closed", 2);
|
|
@@ -33,6 +33,10 @@ const styles = css`
|
|
|
33
33
|
padding: var(--padding);
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
.panel--scrollable.panel--with-padding.panel--has-form-controls .panel__body {
|
|
37
|
+
padding: calc(var(--padding) * 1.5);
|
|
38
|
+
}
|
|
39
|
+
|
|
36
40
|
/* For non-scrollable panel - fix body at 100% and disable scroll. Padding is added to wrapper */
|
|
37
41
|
.panel.panel--with-padding:not(.panel--scrollable) .panel__body-wrapper {
|
|
38
42
|
padding: var(--padding);
|
|
@@ -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,15 @@ 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
|
+
font-size: var(--flow-ui-panel-header-font-size);
|
|
44
45
|
font-weight: var(--flow-ui-panel-header-font-weight);
|
|
45
46
|
text-overflow: ellipsis;
|
|
46
47
|
overflow: hidden;
|