@emuanalytics/flow-rdf-ui 4.0.18 → 4.1.0-preview.2
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 +4 -4
- package/dist/components/avatar/avatar.styles.mjs +4 -2
- package/dist/components/badge/badge.styles.mjs +24 -19
- package/dist/components/base-control/base-control.component.mjs +188 -0
- package/dist/components/base-control/base-control.mjs +5 -0
- package/dist/components/base-control/base-control.styles.mjs +39 -0
- package/dist/components/button/button.component.mjs +3 -3
- package/dist/components/button/button.styles.mjs +53 -36
- package/dist/components/calendar/calendar.component.mjs +4 -0
- package/dist/components/calendar/calendar.styles.mjs +5 -11
- package/dist/components/card/card.styles.mjs +8 -4
- package/dist/components/checkbox/checkbox.component.mjs +9 -18
- package/dist/components/checkbox/checkbox.styles.mjs +29 -71
- package/dist/components/checkbox-group/checkbox-group.component.mjs +290 -0
- package/dist/components/checkbox-group/checkbox-group.mjs +5 -0
- package/dist/components/checkbox-group/checkbox-group.styles.mjs +73 -0
- package/dist/components/color-mapper/color-mapper.component.mjs +8 -2
- package/dist/components/color-mapper/color-mapper.styles.mjs +9 -11
- package/dist/components/color-picker/color-picker.styles.mjs +18 -12
- package/dist/components/color-stop/color-stop.styles.mjs +7 -12
- package/dist/components/date-time-picker/date-time-picker.component.mjs +48 -33
- package/dist/components/date-time-picker/date-time-picker.styles.mjs +59 -47
- package/dist/components/details/details.styles.mjs +27 -5
- package/dist/components/dialog/dialog.component.mjs +74 -29
- package/dist/components/dialog/dialog.styles.mjs +21 -6
- package/dist/components/drawer/drawer.styles.mjs +1 -1
- package/dist/components/form-group/form-group.component.mjs +132 -0
- package/dist/components/form-group/form-group.mjs +5 -0
- package/dist/components/form-group/form-group.styles.mjs +81 -0
- package/dist/components/gauge/gauge.component.mjs +6 -9
- package/dist/components/gauge/gauge.styles.mjs +7 -7
- package/dist/components/icon/library.system.mjs +2 -1
- package/dist/components/input/input.component.mjs +50 -35
- package/dist/components/input/input.styles.mjs +56 -187
- package/dist/components/menu/menu.styles.mjs +12 -2
- package/dist/components/menu-item/menu-item.component.mjs +9 -5
- package/dist/components/menu-item/menu-item.styles.mjs +4 -4
- package/dist/components/option/option.styles.mjs +7 -7
- package/dist/components/panel/panel.styles.mjs +1 -5
- package/dist/components/panel-header/panel-header.component.mjs +3 -3
- package/dist/components/panel-header/panel-header.styles.mjs +2 -2
- package/dist/components/popup/popup.styles.mjs +1 -1
- package/dist/components/progress-bar/progress-bar.component.mjs +1 -1
- package/dist/components/query-builder/default-value-templates.mjs +6 -0
- package/dist/components/query-builder/query-builder.component.mjs +132 -86
- package/dist/components/query-builder/query-builder.styles.mjs +56 -13
- package/dist/components/radio/radio.component.mjs +5 -5
- package/dist/components/radio/radio.styles.mjs +20 -64
- package/dist/components/radio-group/radio-group.component.mjs +23 -20
- package/dist/components/radio-group/radio-group.styles.mjs +35 -11
- package/dist/components/range/range.component.mjs +82 -63
- package/dist/components/range/range.styles.mjs +57 -65
- package/dist/components/select/select.component.mjs +79 -48
- package/dist/components/select/select.styles.mjs +94 -143
- package/dist/components/split-view-divider/split-view-divider.styles.mjs +2 -8
- package/dist/components/stepper/stepper.component.mjs +2 -1
- package/dist/components/stepper/stepper.styles.mjs +3 -2
- package/dist/components/stepper-panel/stepper-panel.component.mjs +0 -4
- package/dist/components/switch/switch.component.mjs +67 -33
- package/dist/components/switch/switch.styles.mjs +48 -102
- package/dist/components/tab/tab.component.mjs +3 -0
- package/dist/components/tab-group/tab-group.component.mjs +38 -33
- package/dist/components/tab-group/tab-group.styles.mjs +2 -9
- package/dist/components/tab-panel/tab-panel.styles.mjs +0 -4
- package/dist/components/tag/tag.styles.mjs +57 -70
- package/dist/components/textarea/textarea.component.mjs +12 -12
- package/dist/components/textarea/textarea.styles.mjs +41 -34
- package/dist/components/timer/timer.styles.mjs +2 -2
- package/dist/components/tool-button/tool-button.styles.mjs +8 -8
- package/dist/components/tool-button-group/tool-button-group.styles.mjs +6 -6
- package/dist/custom-elements.json +3471 -2059
- package/dist/index.d.mts +553 -258
- package/dist/index.d.ts +553 -258
- package/dist/index.mjs +3 -0
- package/dist/internal/computed-style.mjs +13 -0
- package/dist/internal/flow-ui-rdf-element.mjs +16 -1
- package/dist/internal/string.mjs +11 -3
- package/dist/package.json.mjs +1 -1
- package/dist/styles/form-control.styles.mjs +155 -33
- package/dist/utilities/register-components.mjs +6 -0
- package/dist/vscode.html-custom-data.json +288 -101
- package/package.json +2 -1
- package/themes/dark-new.css +723 -0
- package/themes/dark-new.styles.js +745 -0
- package/themes/dark.css +174 -117
- package/themes/dark.styles.js +188 -119
- package/themes/light.css +215 -121
- package/themes/light.styles.js +229 -123
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { html } from 'lit';
|
|
1
|
+
import { html, nothing } from 'lit';
|
|
2
2
|
import { query, property } from 'lit/decorators.js';
|
|
3
3
|
import { classMap } from 'lit/directives/class-map.js';
|
|
4
4
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
@@ -9,6 +9,7 @@ import FlowRdfElement from '../../internal/flow-ui-rdf-element.mjs';
|
|
|
9
9
|
import Modal from '../../internal/modal.mjs';
|
|
10
10
|
import { lockBodyScrolling, unlockBodyScrolling } from '../../internal/scroll.mjs';
|
|
11
11
|
import { HasSlotController } from '../../internal/slot.mjs';
|
|
12
|
+
import { capitalize } from '../../internal/string.mjs';
|
|
12
13
|
import { watch } from '../../internal/watch.mjs';
|
|
13
14
|
import { getAnimation, setDefaultAnimation } from '../../utilities/animation-registry.mjs';
|
|
14
15
|
import { LocalizeController } from '../../utilities/localize.mjs';
|
|
@@ -31,13 +32,15 @@ class FlowUiDialog extends FlowRdfElement {
|
|
|
31
32
|
this.hasSlotController = new HasSlotController(this, "footer");
|
|
32
33
|
this.localize = new LocalizeController(this);
|
|
33
34
|
this.open = false;
|
|
34
|
-
this.
|
|
35
|
+
this.heading = "";
|
|
35
36
|
this.noHeader = false;
|
|
37
|
+
this.tabbed = false;
|
|
36
38
|
}
|
|
37
39
|
connectedCallback() {
|
|
38
40
|
super.connectedCallback();
|
|
39
41
|
this.noHeader = boolean(this.noHeader, true);
|
|
40
42
|
this.open = boolean(this.open, true);
|
|
43
|
+
this.tabbed = boolean(this.tabbed, true);
|
|
41
44
|
this.handleDocumentKeyDown = this.handleDocumentKeyDown.bind(this);
|
|
42
45
|
this.modal = new Modal(this);
|
|
43
46
|
}
|
|
@@ -48,6 +51,9 @@ class FlowUiDialog extends FlowRdfElement {
|
|
|
48
51
|
this.modal.activate();
|
|
49
52
|
lockBodyScrolling(this);
|
|
50
53
|
}
|
|
54
|
+
if (this.tabbed) {
|
|
55
|
+
this.tabGroup.updateComplete.then(() => this.syncTabbedDialog());
|
|
56
|
+
}
|
|
51
57
|
}
|
|
52
58
|
disconnectedCallback() {
|
|
53
59
|
super.disconnectedCallback();
|
|
@@ -152,6 +158,63 @@ class FlowUiDialog extends FlowRdfElement {
|
|
|
152
158
|
this.open = false;
|
|
153
159
|
return waitForEvent(this, "flow-ui-after-hide");
|
|
154
160
|
}
|
|
161
|
+
handleTabShow() {
|
|
162
|
+
this.syncTabbedDialog();
|
|
163
|
+
}
|
|
164
|
+
syncTabbedDialog() {
|
|
165
|
+
this.heading = capitalize(this.tabGroup.activeTab?.panel) || "";
|
|
166
|
+
}
|
|
167
|
+
handleChildHide(ev) {
|
|
168
|
+
ev.stopPropagation();
|
|
169
|
+
}
|
|
170
|
+
renderHeader(slot) {
|
|
171
|
+
return html`
|
|
172
|
+
<header slot=${ifDefined(slot)} part="header" class="dialog__header">
|
|
173
|
+
<h2 part="heading" class="dialog__heading" id="heading">
|
|
174
|
+
<slot name="heading">${this.heading.length > 0 ? this.heading : String.fromCharCode(65279)}</slot>
|
|
175
|
+
</h2>
|
|
176
|
+
<div part="header-actions" class="dialog__header-actions">
|
|
177
|
+
<slot name="header-actions"></slot>
|
|
178
|
+
<flow-ui-icon-button
|
|
179
|
+
part="close-button"
|
|
180
|
+
exportparts="base:close-button__base"
|
|
181
|
+
class="dialog__close"
|
|
182
|
+
name="x-lg"
|
|
183
|
+
label=${this.localize.term("close")}
|
|
184
|
+
library="system"
|
|
185
|
+
@click="${() => this.requestClose("close-button")}"
|
|
186
|
+
></flow-ui-icon-button>
|
|
187
|
+
</div>
|
|
188
|
+
</header>
|
|
189
|
+
`;
|
|
190
|
+
}
|
|
191
|
+
renderTabContainer() {
|
|
192
|
+
return html`
|
|
193
|
+
<flow-ui-tab-group class="dialog__tab-group" exportparts="nav:tab-group__nav,tabs:tab-group__tabs,active-tab-indicator:tab-group__active-tab-indicator,body:tab-group__tab-group-body" placement="start" @flow-ui-tab-show=${this.handleTabShow}>
|
|
194
|
+
${!this.noHeader ? this.renderHeader("header") : nothing}</slot>
|
|
195
|
+
<slot name="nav" slot="nav"></slot>
|
|
196
|
+
<slot @flow-ui-hide=${this.handleChildHide} @flow-ui-after-hide=${this.handleChildHide}></slot>
|
|
197
|
+
</flow-ui-tab-group>
|
|
198
|
+
`;
|
|
199
|
+
}
|
|
200
|
+
renderDefaultContainer() {
|
|
201
|
+
return html`
|
|
202
|
+
${!this.noHeader ? this.renderHeader() : nothing}
|
|
203
|
+
|
|
204
|
+
<slot
|
|
205
|
+
part="body"
|
|
206
|
+
class=${classMap({
|
|
207
|
+
dialog__body: true
|
|
208
|
+
})}
|
|
209
|
+
@flow-ui-hide=${this.handleChildHide}
|
|
210
|
+
@flow-ui-after-hide=${this.handleChildHide}
|
|
211
|
+
></slot>
|
|
212
|
+
|
|
213
|
+
<footer part="footer" class="dialog__footer">
|
|
214
|
+
<slot name="footer"></slot>
|
|
215
|
+
</footer>
|
|
216
|
+
`;
|
|
217
|
+
}
|
|
155
218
|
render() {
|
|
156
219
|
return html`
|
|
157
220
|
<div
|
|
@@ -170,35 +233,11 @@ class FlowUiDialog extends FlowRdfElement {
|
|
|
170
233
|
role="dialog"
|
|
171
234
|
aria-modal="true"
|
|
172
235
|
aria-hidden=${this.open ? "false" : "true"}
|
|
173
|
-
aria-label=${ifDefined(this.noHeader ? this.
|
|
236
|
+
aria-label=${ifDefined(this.noHeader ? this.heading : void 0)}
|
|
174
237
|
aria-labelledby=${ifDefined(!this.noHeader ? "title" : void 0)}
|
|
175
238
|
tabindex="0"
|
|
176
239
|
>
|
|
177
|
-
${
|
|
178
|
-
<header part="header" class="dialog__header">
|
|
179
|
-
<h2 part="title" class="dialog__title" id="title">
|
|
180
|
-
<slot name="label">${this.label.length > 0 ? this.label : String.fromCharCode(65279)}</slot>
|
|
181
|
-
</h2>
|
|
182
|
-
<div part="header-actions" class="dialog__header-actions">
|
|
183
|
-
<slot name="header-actions"></slot>
|
|
184
|
-
<flow-ui-icon-button
|
|
185
|
-
part="close-button"
|
|
186
|
-
exportparts="base:close-button__base"
|
|
187
|
-
class="dialog__close"
|
|
188
|
-
name="x-lg"
|
|
189
|
-
label=${this.localize.term("close")}
|
|
190
|
-
library="system"
|
|
191
|
-
@click="${() => this.requestClose("close-button")}"
|
|
192
|
-
></flow-ui-icon-button>
|
|
193
|
-
</div>
|
|
194
|
-
</header>
|
|
195
|
-
` : ""}
|
|
196
|
-
|
|
197
|
-
<slot part="body" class="dialog__body"></slot>
|
|
198
|
-
|
|
199
|
-
<footer part="footer" class="dialog__footer">
|
|
200
|
-
<slot name="footer"></slot>
|
|
201
|
-
</footer>
|
|
240
|
+
${this.tabbed ? this.renderTabContainer() : this.renderDefaultContainer()}
|
|
202
241
|
</div>
|
|
203
242
|
</div>
|
|
204
243
|
`;
|
|
@@ -214,15 +253,21 @@ __decorateClass([
|
|
|
214
253
|
__decorateClass([
|
|
215
254
|
query(".dialog__overlay")
|
|
216
255
|
], FlowUiDialog.prototype, "overlay", 2);
|
|
256
|
+
__decorateClass([
|
|
257
|
+
query(".dialog__tab-group")
|
|
258
|
+
], FlowUiDialog.prototype, "tabGroup", 2);
|
|
217
259
|
__decorateClass([
|
|
218
260
|
property({ type: Boolean, reflect: true })
|
|
219
261
|
], FlowUiDialog.prototype, "open", 2);
|
|
220
262
|
__decorateClass([
|
|
221
263
|
property({ reflect: true })
|
|
222
|
-
], FlowUiDialog.prototype, "
|
|
264
|
+
], FlowUiDialog.prototype, "heading", 2);
|
|
223
265
|
__decorateClass([
|
|
224
266
|
property({ attribute: "no-header", type: Boolean, reflect: true })
|
|
225
267
|
], FlowUiDialog.prototype, "noHeader", 2);
|
|
268
|
+
__decorateClass([
|
|
269
|
+
property({ type: Boolean, reflect: true })
|
|
270
|
+
], FlowUiDialog.prototype, "tabbed", 2);
|
|
226
271
|
__decorateClass([
|
|
227
272
|
watch("open", { waitUntilFirstUpdate: true })
|
|
228
273
|
], FlowUiDialog.prototype, "handleOpenChange", 1);
|
|
@@ -6,13 +6,18 @@ 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-medium);
|
|
10
|
+
--body-spacing: var(--flow-ui-spacing-medium);
|
|
11
|
+
--footer-spacing: var(--flow-ui-spacing-medium);
|
|
12
12
|
|
|
13
13
|
display: contents;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
:host([tabbed]) {
|
|
17
|
+
--header-spacing: var(--flow-ui-spacing-medium) var(--flow-ui-spacing-x-large);
|
|
18
|
+
--body-spacing: 0 var(--flow-ui-spacing-x-large);
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
.dialog {
|
|
17
22
|
display: flex;
|
|
18
23
|
align-items: center;
|
|
@@ -32,7 +37,7 @@ const styles = css`
|
|
|
32
37
|
width: var(--width);
|
|
33
38
|
max-width: calc(100% - var(--flow-ui-spacing-2x-large));
|
|
34
39
|
max-height: calc(100% - var(--flow-ui-spacing-2x-large));
|
|
35
|
-
background-color: var(--flow-ui-
|
|
40
|
+
background-color: var(--flow-ui-dialog-background-color);
|
|
36
41
|
border-radius: var(--flow-ui-border-radius-medium);
|
|
37
42
|
box-shadow: var(--flow-ui-shadow-x-large);
|
|
38
43
|
}
|
|
@@ -58,7 +63,7 @@ const styles = css`
|
|
|
58
63
|
display: flex;
|
|
59
64
|
}
|
|
60
65
|
|
|
61
|
-
.
|
|
66
|
+
.dialog__heading {
|
|
62
67
|
flex: 1 1 auto;
|
|
63
68
|
font: inherit;
|
|
64
69
|
font-size: var(--flow-ui-font-size-large);
|
|
@@ -73,7 +78,7 @@ const styles = css`
|
|
|
73
78
|
flex-wrap: wrap;
|
|
74
79
|
justify-content: end;
|
|
75
80
|
gap: var(--flow-ui-spacing-2x-small);
|
|
76
|
-
padding:
|
|
81
|
+
padding: var(--header-spacing);
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
.dialog__header-actions flow-ui-icon-button,
|
|
@@ -115,6 +120,16 @@ const styles = css`
|
|
|
115
120
|
background-color: var(--flow-ui-overlay-background-color);
|
|
116
121
|
}
|
|
117
122
|
|
|
123
|
+
/* Tabbed dialogs */
|
|
124
|
+
.dialog__tab-group {
|
|
125
|
+
flex: 1;
|
|
126
|
+
min-height: 0;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.dialog__tab-group ::slotted(flow-ui-tab-panel) {
|
|
130
|
+
--padding: var(--body-spacing);
|
|
131
|
+
}
|
|
132
|
+
|
|
118
133
|
@media (forced-colors: active) {
|
|
119
134
|
.dialog__panel {
|
|
120
135
|
border: solid 1px var(--flow-ui-color-neutral-0);
|
|
@@ -39,7 +39,7 @@ const styles = css`
|
|
|
39
39
|
z-index: 2;
|
|
40
40
|
max-width: 100%;
|
|
41
41
|
max-height: 100%;
|
|
42
|
-
background-color: var(--flow-ui-
|
|
42
|
+
background-color: var(--flow-ui-background-color);
|
|
43
43
|
box-shadow: var(--flow-ui-shadow-x-large);
|
|
44
44
|
overflow: auto;
|
|
45
45
|
pointer-events: all;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { html } 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 { watch } from '../../internal/watch.mjs';
|
|
8
|
+
import styles from './form-group.styles.mjs';
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
13
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
14
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
15
|
+
if (decorator = decorators[i])
|
|
16
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
17
|
+
if (kind && result)
|
|
18
|
+
__defProp(target, key, result);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
class FlowUiFormGroup extends FlowRdfElement {
|
|
22
|
+
constructor() {
|
|
23
|
+
super(...arguments);
|
|
24
|
+
this.hasSlotController = new HasSlotController(this, "help-text", "label");
|
|
25
|
+
this.label = "";
|
|
26
|
+
this.size = "medium";
|
|
27
|
+
this.helpText = "";
|
|
28
|
+
this.noDividers = false;
|
|
29
|
+
this.noBorder = false;
|
|
30
|
+
this.variant = "default";
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
super.connectedCallback();
|
|
34
|
+
this.noDividers = boolean(this.noDividers, true);
|
|
35
|
+
this.noBorder = boolean(this.noBorder, true);
|
|
36
|
+
}
|
|
37
|
+
handleStyleChange() {
|
|
38
|
+
this.syncControls();
|
|
39
|
+
}
|
|
40
|
+
syncControls() {
|
|
41
|
+
if (customElements.get("flow-ui-form-group")) {
|
|
42
|
+
const controls = this.getAllControls();
|
|
43
|
+
controls.forEach((control, i) => {
|
|
44
|
+
control.size = this.size;
|
|
45
|
+
control.divider = !this.noDividers && i < controls.length - 1;
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
customElements.whenDefined("flow-ui-form-group").then(() => this.syncControls());
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
getAllControls() {
|
|
52
|
+
return [...this.querySelectorAll(".flow-ui-form-control")];
|
|
53
|
+
}
|
|
54
|
+
render() {
|
|
55
|
+
const hasLabelSlot = this.hasSlotController.test("label");
|
|
56
|
+
const hasHelpTextSlot = this.hasSlotController.test("help-text");
|
|
57
|
+
const hasLabel = this.label ? true : !!hasLabelSlot;
|
|
58
|
+
const hasHelpText = this.helpText ? true : !!hasHelpTextSlot;
|
|
59
|
+
const defaultSlot = html`
|
|
60
|
+
<slot @slotchange=${this.syncControls}></slot>
|
|
61
|
+
`;
|
|
62
|
+
return html`
|
|
63
|
+
<div
|
|
64
|
+
part="form-control"
|
|
65
|
+
class=${classMap({
|
|
66
|
+
"form-control": true,
|
|
67
|
+
"form-control--has-label": hasLabel,
|
|
68
|
+
"form-control--has-help-text": hasHelpText,
|
|
69
|
+
"form-control--small": this.size === "small",
|
|
70
|
+
"form-control--medium": this.size === "medium",
|
|
71
|
+
"form-control--large": this.size === "large",
|
|
72
|
+
"form-control--default": this.variant === "default",
|
|
73
|
+
"form-control--warning": this.variant === "warning",
|
|
74
|
+
"form-control--danger": this.variant === "danger",
|
|
75
|
+
"form-group--has-dividers": !this.noDividers,
|
|
76
|
+
"form-group--has-border": !this.noBorder
|
|
77
|
+
})}
|
|
78
|
+
aria-labelledby="label"
|
|
79
|
+
aria-describedby="help-text"
|
|
80
|
+
aria-errormessage="error-message"
|
|
81
|
+
>
|
|
82
|
+
<slot
|
|
83
|
+
name="label"
|
|
84
|
+
part="label"
|
|
85
|
+
id="label"
|
|
86
|
+
class="form-control__label"
|
|
87
|
+
aria-hidden=${hasLabel ? "false" : "true"}
|
|
88
|
+
>
|
|
89
|
+
${this.label}
|
|
90
|
+
</slot>
|
|
91
|
+
|
|
92
|
+
<slot
|
|
93
|
+
name="help-text"
|
|
94
|
+
part="help-text"
|
|
95
|
+
class="form-control__help-text"
|
|
96
|
+
aria-hidden=${hasHelpText ? "false" : "true"}
|
|
97
|
+
>
|
|
98
|
+
${this.helpText}
|
|
99
|
+
</slot>
|
|
100
|
+
|
|
101
|
+
<div part="control" class="form-group__content">${defaultSlot}</div>
|
|
102
|
+
</div>
|
|
103
|
+
`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
FlowUiFormGroup.styles = styles;
|
|
107
|
+
__decorateClass([
|
|
108
|
+
query("slot:not([name])")
|
|
109
|
+
], FlowUiFormGroup.prototype, "defaultSlot", 2);
|
|
110
|
+
__decorateClass([
|
|
111
|
+
property()
|
|
112
|
+
], FlowUiFormGroup.prototype, "label", 2);
|
|
113
|
+
__decorateClass([
|
|
114
|
+
property({ reflect: true })
|
|
115
|
+
], FlowUiFormGroup.prototype, "size", 2);
|
|
116
|
+
__decorateClass([
|
|
117
|
+
property({ attribute: "help-text" })
|
|
118
|
+
], FlowUiFormGroup.prototype, "helpText", 2);
|
|
119
|
+
__decorateClass([
|
|
120
|
+
property({ type: Boolean, attribute: "no-dividers", reflect: true })
|
|
121
|
+
], FlowUiFormGroup.prototype, "noDividers", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
property({ type: Boolean, attribute: "no-border", reflect: true })
|
|
124
|
+
], FlowUiFormGroup.prototype, "noBorder", 2);
|
|
125
|
+
__decorateClass([
|
|
126
|
+
property({ reflect: true })
|
|
127
|
+
], FlowUiFormGroup.prototype, "variant", 2);
|
|
128
|
+
__decorateClass([
|
|
129
|
+
watch(["size", "noDividers", "noBorder"], { waitUntilFirstUpdate: true })
|
|
130
|
+
], FlowUiFormGroup.prototype, "handleStyleChange", 1);
|
|
131
|
+
|
|
132
|
+
export { FlowUiFormGroup as default };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
import componentStyles from '../../styles/component.styles.mjs';
|
|
3
|
+
import formControlStyles from '../../styles/form-control.styles.mjs';
|
|
4
|
+
|
|
5
|
+
const styles = css`
|
|
6
|
+
${componentStyles}
|
|
7
|
+
${formControlStyles}
|
|
8
|
+
|
|
9
|
+
:host {
|
|
10
|
+
display: block;
|
|
11
|
+
margin-block: var(--flow-ui-spacing-medium);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([label]) {
|
|
15
|
+
margin-top: var(--flow-ui-spacing-x-large);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
:host(:first-child) {
|
|
19
|
+
margin-top: var(--flow-ui-spacing-x-small);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.form-control {
|
|
23
|
+
display: grid;
|
|
24
|
+
grid-template-columns: 1fr;
|
|
25
|
+
grid-row-gap: var(--flow-ui-spacing-x-small);
|
|
26
|
+
align-items: center;
|
|
27
|
+
font-family: var(--flow-ui-control-font-family);
|
|
28
|
+
font-size: inherit;
|
|
29
|
+
font-weight: var(--flow-ui-control-font-weight);
|
|
30
|
+
line-height: var(--flow-ui-line-height-dense);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.form-control.form-control--has-label .form-control__label {
|
|
34
|
+
color: var(--flow-ui-color-neutral-900);
|
|
35
|
+
font-weight: var(--flow-ui-font-weight-semibold);
|
|
36
|
+
margin-top: 0 !important;
|
|
37
|
+
margin-bottom: 0 !important;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.form-control.form-control--has-help-text .form-control__help-text {
|
|
41
|
+
margin-top: 0 !important;
|
|
42
|
+
margin-bottom: 0 !important;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.form-control.form-control--has-label .form-group__content,
|
|
46
|
+
.form-control.form-control--has-help-text .form-group__content {
|
|
47
|
+
margin-top: var(--flow-ui-spacing-x-small);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.form-group__content {
|
|
51
|
+
display: grid;
|
|
52
|
+
grid-template-columns: 1fr;
|
|
53
|
+
grid-row-gap: var(--control-spacing);
|
|
54
|
+
padding-block: calc(var(--control-spacing) / 2);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.form-control.form-group--has-dividers .form-group__content {
|
|
58
|
+
grid-row-gap: var(--flow-ui-spacing-x-small);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Borders */
|
|
62
|
+
|
|
63
|
+
.form-group--has-border .form-group__content {
|
|
64
|
+
margin-inline: calc(var(--control-spacing) * -1 - var(--control-border-width));
|
|
65
|
+
padding-inline: var(--control-spacing);
|
|
66
|
+
border: solid var(--control-border-width) var(--control-border-color);
|
|
67
|
+
border-radius: var(--control-border-radius);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Variants */
|
|
71
|
+
|
|
72
|
+
.form-control.form-control--warning {
|
|
73
|
+
--control-border-color: var(--flow-ui-color-warning-500);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.form-control.form-control--danger {
|
|
77
|
+
--control-border-color: var(--flow-ui-color-danger-500);
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
|
|
81
|
+
export { styles as default };
|
|
@@ -79,13 +79,10 @@ class FlowUiGauge extends FlowRdfElement {
|
|
|
79
79
|
infoDialogTemplate() {
|
|
80
80
|
return html`
|
|
81
81
|
<flow-ui-dialog class="gauge__info-dialog">
|
|
82
|
-
<div slot="
|
|
83
|
-
${this.headerIconTemplate()}
|
|
84
|
-
<slot name="title-text">${this.title}</slot>
|
|
85
|
-
</div>
|
|
82
|
+
<div slot="heading" class="gauge__info-dialog-heading">${this.headerIconTemplate()} ${this.label}</div>
|
|
86
83
|
<slot name="info"></slot>
|
|
87
84
|
<div slot="footer">
|
|
88
|
-
<flow-ui-button slot="footer" variant="primary" @click=${this.hideInfoDialog}>OK</flow-ui-button>
|
|
85
|
+
<flow-ui-button autofocus slot="footer" variant="primary" @click=${this.hideInfoDialog}>OK</flow-ui-button>
|
|
89
86
|
</div>
|
|
90
87
|
</flow-ui-dialog>
|
|
91
88
|
`;
|
|
@@ -101,9 +98,9 @@ class FlowUiGauge extends FlowRdfElement {
|
|
|
101
98
|
>
|
|
102
99
|
<div part="header" class="gauge__header">
|
|
103
100
|
${this.headerIconTemplate()}
|
|
104
|
-
<span class="
|
|
105
|
-
<span part="
|
|
106
|
-
<slot name="
|
|
101
|
+
<span class="gauge__label-wrapper">
|
|
102
|
+
<span part="label" class="gauge__label">
|
|
103
|
+
<slot name="label">${this.label}</slot>
|
|
107
104
|
</span>
|
|
108
105
|
</span>
|
|
109
106
|
${hasInfo ? this.infoButtonTemplate() : nothing}
|
|
@@ -128,7 +125,7 @@ __decorateClass([
|
|
|
128
125
|
], FlowUiGauge.prototype, "_infoDialog", 2);
|
|
129
126
|
__decorateClass([
|
|
130
127
|
property()
|
|
131
|
-
], FlowUiGauge.prototype, "
|
|
128
|
+
], FlowUiGauge.prototype, "label", 2);
|
|
132
129
|
__decorateClass([
|
|
133
130
|
property()
|
|
134
131
|
], FlowUiGauge.prototype, "units", 2);
|
|
@@ -7,16 +7,16 @@ const styles = css`
|
|
|
7
7
|
:host {
|
|
8
8
|
display: inline-block;
|
|
9
9
|
|
|
10
|
-
--color: var(--flow-ui-gauge-color, var(--flow-ui-color-
|
|
10
|
+
--color: var(--flow-ui-gauge-color, var(--flow-ui-color-text));
|
|
11
11
|
--background-color: var(--flow-ui-gauge-background-color, var(--flow-ui-color-neutral-100));
|
|
12
12
|
--padding: var(--flow-ui-gauge-padding, var(--flow-ui-spacing-x-small));
|
|
13
|
-
--header-height: var(--flow-ui-gauge-font-header-height, var(--flow-ui-
|
|
13
|
+
--header-height: var(--flow-ui-gauge-font-header-height, var(--flow-ui-control-height-medium));
|
|
14
14
|
--header-font-size: var(--flow-ui-gauge-font-header-font-size, var(--flow-ui-font-size-medium));
|
|
15
|
-
--header-color: var(--flow-ui-gauge-header-color, var(--flow-ui-color-
|
|
15
|
+
--header-color: var(--flow-ui-gauge-header-color, var(--flow-ui-color-text));
|
|
16
16
|
--header-icon-color: var(--flow-ui-gauge-header-icon-color, var(--flow-ui-color-neutral-700));
|
|
17
17
|
--value-font-size: var(--flow-ui-gauge-value-font-size, var(--flow-ui-font-size-2x-large));
|
|
18
18
|
--units-font-size: var(--flow-ui-gauge-units-font-size, var(--flow-ui-font-size-small));
|
|
19
|
-
--units-color: var(--flow-ui-gauge-units-color, var(--flow-ui-color-
|
|
19
|
+
--units-color: var(--flow-ui-gauge-units-color, var(--flow-ui-color-text));
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.gauge {
|
|
@@ -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__label-wrapper {
|
|
60
60
|
flex: 1;
|
|
61
61
|
min-width: 0;
|
|
62
62
|
display: flex;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.
|
|
65
|
+
.gauge__label {
|
|
66
66
|
text-overflow: ellipsis;
|
|
67
67
|
white-space: nowrap;
|
|
68
68
|
overflow: hidden;
|
|
@@ -117,7 +117,7 @@ const styles = css`
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
/* Info Dialog */
|
|
120
|
-
.gauge__info-dialog-
|
|
120
|
+
.gauge__info-dialog-heading {
|
|
121
121
|
display: flex;
|
|
122
122
|
gap: var(--flow-ui-spacing-small);
|
|
123
123
|
align-items: center;
|
|
@@ -142,7 +142,8 @@ const icons = {
|
|
|
142
142
|
pause: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 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="M48 64C21.5 64 0 85.5 0 112v288c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48H48zm192 0c-26.5 0-48 21.5-48 48v288c0 26.5 21.5 48 48 48h32c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48h-32z"/></svg>',
|
|
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
|
-
"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>'
|
|
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
147
|
};
|
|
147
148
|
const systemLibrary = {
|
|
148
149
|
name: "system",
|