@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.
Files changed (74) hide show
  1. package/dist/components/alert/alert.styles.mjs +1 -1
  2. package/dist/components/badge/badge.component.mjs +4 -0
  3. package/dist/components/badge/badge.styles.mjs +13 -0
  4. package/dist/components/breadcrumb-item/breadcrumb-item.styles.mjs +1 -1
  5. package/dist/components/button/button.styles.mjs +2 -2
  6. package/dist/components/calendar/calendar.component.mjs +3 -0
  7. package/dist/components/calendar/calendar.styles.mjs +13 -4
  8. package/dist/components/card/card.component.mjs +27 -7
  9. package/dist/components/card/card.styles.mjs +9 -37
  10. package/dist/components/chart/chart.component.mjs +19 -3
  11. package/dist/components/chart/chart.styles.mjs +20 -1
  12. package/dist/components/checkbox-group/checkbox-group.component.mjs +4 -0
  13. package/dist/components/date-time-picker/date-time-picker.component.mjs +2 -0
  14. package/dist/components/date-time-picker/date-time-picker.styles.mjs +2 -2
  15. package/dist/components/dialog/dialog.component.mjs +7 -6
  16. package/dist/components/dialog/dialog.styles.mjs +16 -7
  17. package/dist/components/form-group/form-group.component.mjs +19 -14
  18. package/dist/components/form-group/form-group.styles.mjs +10 -5
  19. package/dist/components/gauge/gauge.component.mjs +7 -6
  20. package/dist/components/gauge/gauge.styles.mjs +2 -2
  21. package/dist/components/icon/library.system.mjs +2 -1
  22. package/dist/components/icon-button/icon-button.styles.mjs +1 -1
  23. package/dist/components/list/list.component.mjs +101 -0
  24. package/dist/components/list/list.mjs +5 -0
  25. package/dist/components/list/list.styles.mjs +21 -0
  26. package/dist/components/list-item/list-item.component.mjs +197 -0
  27. package/dist/components/list-item/list-item.mjs +5 -0
  28. package/dist/components/list-item/list-item.styles.mjs +63 -0
  29. package/dist/components/map/map.component.mjs +6 -1
  30. package/dist/components/map/map.styles.mjs +1 -0
  31. package/dist/components/menu/menu.styles.mjs +1 -0
  32. package/dist/components/menu-item/menu-item.styles.mjs +1 -1
  33. package/dist/components/menu-label/menu-label.styles.mjs +1 -1
  34. package/dist/components/option/option.styles.mjs +1 -1
  35. package/dist/components/panel/panel.component.mjs +10 -3
  36. package/dist/components/panel/panel.styles.mjs +4 -0
  37. package/dist/components/panel-header/panel-header.component.mjs +5 -4
  38. package/dist/components/panel-header/panel-header.styles.mjs +3 -2
  39. package/dist/components/query-builder/converters/flow-query-converters.mjs +1 -5
  40. package/dist/components/query-builder/converters/javascript-filter-converter.mjs +1 -5
  41. package/dist/components/query-builder/converters/map-layer-filter-converter.mjs +1 -5
  42. package/dist/components/query-builder/helpers.mjs +15 -1
  43. package/dist/components/query-builder/query-builder.component.mjs +38 -20
  44. package/dist/components/query-builder/query-builder.styles.mjs +21 -5
  45. package/dist/components/range/range.component.mjs +1 -1
  46. package/dist/components/range/range.styles.mjs +5 -1
  47. package/dist/components/select/select.styles.mjs +9 -0
  48. package/dist/components/spinner/spinner.styles.mjs +1 -1
  49. package/dist/components/stepper/stepper.styles.mjs +5 -6
  50. package/dist/components/switch/switch.styles.mjs +35 -15
  51. package/dist/components/tab/tab.component.mjs +4 -0
  52. package/dist/components/tab/tab.styles.mjs +13 -1
  53. package/dist/components/tab-group/tab-group.component.mjs +1 -0
  54. package/dist/components/tab-group/tab-group.styles.mjs +1 -0
  55. package/dist/components/tab-panel/tab-panel.component.mjs +7 -1
  56. package/dist/components/tab-panel/tab-panel.styles.mjs +7 -3
  57. package/dist/components/tag/tag.styles.mjs +13 -13
  58. package/dist/components/timer/timer.component.mjs +2 -1
  59. package/dist/components/timer/timer.styles.mjs +2 -2
  60. package/dist/components/tool-button/tool-button.styles.mjs +9 -9
  61. package/dist/components/tree-item/tree-item.styles.mjs +3 -3
  62. package/dist/custom-elements.json +4739 -3935
  63. package/dist/index.d.mts +200 -19
  64. package/dist/index.d.ts +200 -19
  65. package/dist/index.mjs +3 -1
  66. package/dist/package.json.mjs +1 -1
  67. package/dist/styles/form-control.styles.mjs +5 -0
  68. package/dist/utilities/register-components.mjs +7 -0
  69. package/dist/vscode.html-custom-data.json +169 -91
  70. package/package.json +1 -1
  71. package/themes/dark.css +141 -88
  72. package/themes/dark.styles.js +143 -88
  73. package/themes/light.css +144 -79
  74. package/themes/light.styles.js +146 -79
@@ -8,7 +8,7 @@ function isStringType(field) {
8
8
  }
9
9
  function whereClausesFromRuleSet(rule, config, options) {
10
10
  if (isRule(rule)) {
11
- if (!rule.enabled) {
11
+ if (!rule.enabled || !rule.field) {
12
12
  return void 0;
13
13
  }
14
14
  if (isNil(rule.field) || isNil(rule.operator)) {
@@ -16,10 +16,6 @@ function whereClausesFromRuleSet(rule, config, options) {
16
16
  return void 0;
17
17
  }
18
18
  const field = config.fields[rule.field];
19
- if (!field) {
20
- console.warn(`flowQueryConverter: Skipping unknown field '${rule.field}' in rule`, rule);
21
- return void 0;
22
- }
23
19
  if (isNil(rule.value) && field.nullable !== true) {
24
20
  console.warn(`flowQueryConverter: Skipping nil field '${rule.field}' in rule (non-nullable)`, rule);
25
21
  return void 0;
@@ -29,7 +29,7 @@ function convertDateTime(value, field) {
29
29
  }
30
30
  function rulesetToJavascript(rule, config, options) {
31
31
  if (isRule(rule)) {
32
- if (!rule.enabled) {
32
+ if (!rule.enabled || !rule.field) {
33
33
  return void 0;
34
34
  }
35
35
  if (isNil(rule.field) || isNil(rule.operator)) {
@@ -37,10 +37,6 @@ function rulesetToJavascript(rule, config, options) {
37
37
  return void 0;
38
38
  }
39
39
  const field = config.fields[rule.field];
40
- if (!field) {
41
- console.warn(`JavascriptFilterConverter: Skipping unknown field '${rule.field}' in rule`, rule);
42
- return void 0;
43
- }
44
40
  if (isNil(rule.value) && field.nullable !== true) {
45
41
  console.warn(`JavascriptFilterConverter: Skipping nil field '${rule.field}' in rule (non-nullable)`, rule);
46
42
  return void 0;
@@ -8,7 +8,7 @@ function isStringType(field) {
8
8
  }
9
9
  function mapLayerFilterFromRuleSet(rule, config, options) {
10
10
  if (isRule(rule)) {
11
- if (!rule.enabled) {
11
+ if (!rule.enabled || !rule.field) {
12
12
  return void 0;
13
13
  }
14
14
  if (isNil(rule.field) || isNil(rule.operator)) {
@@ -16,10 +16,6 @@ function mapLayerFilterFromRuleSet(rule, config, options) {
16
16
  return void 0;
17
17
  }
18
18
  const field = config.fields[rule.field];
19
- if (!field) {
20
- console.warn(`mapLayerFilterConverter: Skipping unknown field '${rule.field}' in rule`, rule);
21
- return void 0;
22
- }
23
19
  if (isNil(rule.value) && field.nullable !== true) {
24
20
  console.warn(`mapLayerFilterConverter: Skipping nil field '${rule.field}' in rule (non-nullable)`, rule);
25
21
  return void 0;
@@ -35,8 +35,22 @@ function transformRuleSet(ruleSet, transformFn, clone = true) {
35
35
  }).filter(isRuleOrRuleset);
36
36
  return ruleSet;
37
37
  }
38
+ function countRuleSet(ruleset) {
39
+ const activeFilters = (ruleSet) => {
40
+ let count = 0;
41
+ for (const rule of ruleSet.rules) {
42
+ if (isRule(rule) && rule.field && rule.enabled) {
43
+ count += 1;
44
+ } else if (isRuleSet(rule)) {
45
+ count += activeFilters(rule);
46
+ }
47
+ }
48
+ return count;
49
+ };
50
+ return activeFilters(ruleset);
51
+ }
38
52
  const isRule = (r) => isObjectFull(r) && "field" in r;
39
53
  const isRuleSet = (r) => isObjectFull(r) && "rules" in r;
40
54
  const isRuleOrRuleset = (r) => isRule(r) || isRuleSet(r);
41
55
 
42
- export { filterRuleSet, isRule, isRuleOrRuleset, isRuleSet, renameRuleSetFields, transformRuleSet };
56
+ export { countRuleSet, filterRuleSet, isRule, isRuleOrRuleset, isRuleSet, renameRuleSetFields, transformRuleSet };
@@ -25,7 +25,7 @@ var __decorateClass = (decorators, target, key, kind) => {
25
25
  const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
26
26
  constructor() {
27
27
  super(...arguments);
28
- this._value = { condition: "and", rules: [] };
28
+ this._value = { condition: "and", rules: [{ field: "", operator: "=", enabled: true }] };
29
29
  this.hasSlotController = new HasSlotController(
30
30
  this,
31
31
  "help-text",
@@ -42,6 +42,7 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
42
42
  this.helpText = "";
43
43
  this.treeLines = false;
44
44
  this.subQueryBuilder = false;
45
+ this.borders = false;
45
46
  }
46
47
  /**
47
48
  * Register a custom field definition.
@@ -62,6 +63,8 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
62
63
  super.connectedCallback();
63
64
  this.classList.add(FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
64
65
  this.disabled = boolean(this.disabled, true);
66
+ this.borders = boolean(this.borders, true);
67
+ this.treeLines = boolean(this.treeLines, true);
65
68
  }
66
69
  handleClassChange() {
67
70
  this.classList.add(FlowRdfFormControl.FLOW_UI_FORM_CONTROL_CLASS);
@@ -115,11 +118,14 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
115
118
  */
116
119
  handleRemoveRule(ev, index) {
117
120
  ev.stopPropagation();
118
- this._value.rules.splice(index, 1);
119
- this.requestUpdate();
120
- this.updateComplete.then(() => {
121
- this.emitValueChange();
122
- });
121
+ const confirmDelete = this.emit("flow-ui-remove", { cancelable: true });
122
+ if (!confirmDelete.defaultPrevented) {
123
+ this._value.rules.splice(index, 1);
124
+ this.requestUpdate();
125
+ this.updateComplete.then(() => {
126
+ this.emitValueChange();
127
+ });
128
+ }
123
129
  }
124
130
  handleSubQueryValueChange(ev) {
125
131
  ev.stopPropagation();
@@ -157,9 +163,12 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
157
163
  const duplicateRule = cloneDeep(rule);
158
164
  this._value.rules.splice(index, 0, duplicateRule);
159
165
  } else if (menuItem.value === "delete") {
160
- this._value.rules.splice(index, 1);
161
- if (this._value.rules.length === 0) {
162
- this._value.rules.push({ field: "", operator: "=", enabled: true });
166
+ const confirmDelete = this.emit("flow-ui-remove", { cancelable: true });
167
+ if (!confirmDelete.defaultPrevented) {
168
+ this._value.rules.splice(index, 1);
169
+ if (this._value.rules.length === 0) {
170
+ this._value.rules.push({ field: "", operator: "=", enabled: true });
171
+ }
163
172
  }
164
173
  }
165
174
  this.requestUpdate();
@@ -180,8 +189,13 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
180
189
  } else if (menuItem.value === "delete-group") {
181
190
  this.emit("flow-ui-remove");
182
191
  } else if (menuItem.value === "clear-filters") {
183
- updateValue = true;
192
+ updateValue = false;
184
193
  this._value = emptyRuleSet;
194
+ this.requestUpdate();
195
+ this.updateComplete.then(() => {
196
+ this.emitValueChange();
197
+ this.emit("flow-ui-clear");
198
+ });
185
199
  }
186
200
  if (updateValue) {
187
201
  this.requestUpdate();
@@ -222,7 +236,6 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
222
236
  size=${andOrSize}
223
237
  pill
224
238
  outline
225
- variant="secondary"
226
239
  class="query-builder-and-or-button-group"
227
240
  value=${ruleSet.condition}
228
241
  @flow-ui-change=${this.handleConditionChange}
@@ -247,6 +260,10 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
247
260
  library="system"
248
261
  ></flow-ui-icon-button>
249
262
  <flow-ui-menu @flow-ui-select=${(ev) => this.handleToolbarMenuSelect(ev)}>
263
+ ${this.hasSlotController.test("menu") ? html`
264
+ <slot name="menu"></slot>
265
+ <flow-ui-divider></flow-ui-divider>
266
+ ` : nothing}
250
267
  <flow-ui-menu-item value="add-group">Add Filter Group</flow-ui-menu-item>
251
268
  ${this.subQueryBuilder ? html`
252
269
  <flow-ui-divider></flow-ui-divider>
@@ -254,10 +271,6 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
254
271
  Delete Filter Group
255
272
  </flow-ui-menu-item>
256
273
  ` : nothing}
257
- ${this.hasSlotController.test("menu") ? html`
258
- <flow-ui-divider></flow-ui-divider>
259
- <slot name="menu"></slot>
260
- ` : nothing}
261
274
  ${this.subQueryBuilder ? nothing : html`
262
275
  <flow-ui-divider></flow-ui-divider>
263
276
  <flow-ui-menu-item value="clear-filters" class="menu-item--danger">Clear Filters</flow-ui-menu-item>
@@ -382,7 +395,8 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
382
395
  "form-control--medium": this.size === "medium",
383
396
  "form-control--large": this.size === "large",
384
397
  "form-control--has-label": hasLabel,
385
- "form-control--has-help-text": hasHelpText
398
+ "form-control--has-help-text": hasHelpText,
399
+ "form-control--has-border": this.borders
386
400
  })}
387
401
  >
388
402
  <label
@@ -412,6 +426,7 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
412
426
  "query-builder--large": this.size === "large",
413
427
  "query-builder--disabled": this.disabled,
414
428
  "query-builder--tree-lines": this.treeLines,
429
+ "query-builder--has-border": this.borders,
415
430
  "query-builder--no-rules": this.subQueryBuilder && this._value.rules.length === 0
416
431
  })}
417
432
  >
@@ -436,11 +451,11 @@ const _FlowUiQueryBuilder = class _FlowUiQueryBuilder extends FlowRdfElement {
436
451
  >
437
452
  Add filter
438
453
  </flow-ui-tool-button>
439
- <div part="footer-accessories" class="query-builder__footer-auxiliary">
440
- <slot name="footer-accessory"></slot>
441
- </div>
442
454
  </div>
443
455
  </div>
456
+ <div part="footer-accessories" class="query-builder__footer-auxiliary">
457
+ <slot name="footer-accessory"></slot>
458
+ </div>
444
459
  </div>
445
460
  `;
446
461
  }
@@ -466,7 +481,7 @@ __decorateClass([
466
481
  property({ type: Boolean, reflect: true })
467
482
  ], _FlowUiQueryBuilder.prototype, "disabled", 2);
468
483
  __decorateClass([
469
- property()
484
+ property({ reflect: true })
470
485
  ], _FlowUiQueryBuilder.prototype, "label", 2);
471
486
  __decorateClass([
472
487
  property({ attribute: "help-text" })
@@ -477,6 +492,9 @@ __decorateClass([
477
492
  __decorateClass([
478
493
  property({ type: Boolean, attribute: "sub-query-builder" })
479
494
  ], _FlowUiQueryBuilder.prototype, "subQueryBuilder", 2);
495
+ __decorateClass([
496
+ property({ type: Boolean })
497
+ ], _FlowUiQueryBuilder.prototype, "borders", 2);
480
498
  __decorateClass([
481
499
  watch("class")
482
500
  ], _FlowUiQueryBuilder.prototype, "handleClassChange", 1);
@@ -12,6 +12,10 @@ const styles = css`
12
12
  --footer-spacing: var(--flow-ui-spacing-x-small);
13
13
  }
14
14
 
15
+ :host([label]) {
16
+ margin-top: var(--flow-ui-spacing-x-large);
17
+ }
18
+
15
19
  .form-control__label {
16
20
  font-weight: var(--flow-ui-font-weight-semibold);
17
21
  }
@@ -41,6 +45,14 @@ const styles = css`
41
45
  padding-inline: 0;
42
46
  }
43
47
 
48
+ .query-builder.query-builder--has-border {
49
+ margin-inline: calc(var(--control-spacing) * -1 - var(--control-border-width));
50
+ padding-top: var(--flow-ui-spacing-x-small);
51
+ padding-inline: var(--control-spacing);
52
+ border: solid var(--control-border-width) var(--control-border-color);
53
+ border-radius: var(--control-border-radius);
54
+ }
55
+
44
56
  /* Rule */
45
57
  .query-builder__rule:not(.query-builder--child) {
46
58
  display: flex;
@@ -103,17 +115,17 @@ const styles = css`
103
115
  right: 5px;
104
116
  z-index: 1;
105
117
 
106
- border-bottom: 1px solid var(--flow-ui-color-neutral-300);
118
+ border-bottom: 1px solid var(--flow-ui-color-danger-300);
107
119
  }
108
120
 
109
121
  .query-builder__rule-menu-button {
110
122
  margin-inline: calc(var(--flow-ui-spacing-x-small) * -1);
111
- color: var(--flow-ui-color-neutral-400);
123
+ color: var(--flow-ui-color-neutral-700);
112
124
  }
113
125
 
114
126
  .query-builder__toolbar:hover .query-builder__rule-menu-button,
115
127
  .query-builder__rule:hover .query-builder__rule-menu-button {
116
- color: var(--flow-ui-color-neutral-600);
128
+ color: var(--flow-ui-color-neutral-900);
117
129
  }
118
130
 
119
131
  .menu-item--danger::part(base) {
@@ -291,9 +303,13 @@ const styles = css`
291
303
  display: flex;
292
304
  flex: 1;
293
305
  justify-content: end;
294
- gap: var(--flow-ui-spacing-x-small);
306
+ gap: var(--flow-ui-spacing-small);
295
307
 
296
- padding-top: var(--flow-ui-spacing-small);
308
+ padding-top: var(--footer-spacing);
309
+ }
310
+
311
+ .form-control--has-border .query-builder__footer-auxiliary {
312
+ margin-right: calc(var(--control-spacing) * -1 - var(--control-border-width));
297
313
  }
298
314
 
299
315
  .query-builder__footer ::slotted(flow-ui-button:not(:first-of-type)) {
@@ -114,7 +114,7 @@ class FlowUiRange extends FlowRdfFormControl {
114
114
  }
115
115
  handleValueChange() {
116
116
  this.formControlController.updateValidity();
117
- this.input.value = this.value.toString();
117
+ this.input.value = this.value?.toString();
118
118
  this.value = parseFloat(this.input.value);
119
119
  this.syncRange();
120
120
  }
@@ -9,7 +9,7 @@ const styles = css`
9
9
  :host {
10
10
  --thumb-size: 14px;
11
11
  --track-color-active: var(--flow-ui-color-primary-500);
12
- --track-color-inactive: var(--flow-ui-color-neutral-200);
12
+ --track-color-inactive: var(--flow-ui-color-neutral-600);
13
13
  --track-active-offset: 0%;
14
14
  --track-height: 6px;
15
15
 
@@ -36,6 +36,10 @@ const styles = css`
36
36
  grid-template-columns: 1fr 1fr;
37
37
  }
38
38
 
39
+ .form-control.form-control--inline .form-control__input {
40
+ background-color: transparent;
41
+ }
42
+
39
43
  .form-control .form-control__input,
40
44
  .form-control:not(.form-control--disabled) .form-control__input:hover,
41
45
  .form-control:not(.form-control--disabled).form-control--focused .form-control__input {
@@ -112,6 +112,14 @@ const styles = css`
112
112
  color: var(--flow-ui-control-placeholder-color);
113
113
  }
114
114
 
115
+ .form-control.form-control--disabled .select__display-input::placeholder {
116
+ color: var(--flow-ui-control-placeholder-color-disabled);
117
+ }
118
+
119
+ .form-control.form-control--disabled .select__display-input {
120
+ color: var(--flow-ui-control-color-disabled);
121
+ }
122
+
115
123
  .select:not(.select--disabled):hover .select__display-input {
116
124
  color: var(--flow-ui-control-color-hover);
117
125
  }
@@ -275,6 +283,7 @@ const styles = css`
275
283
  .select__listbox ::slotted(flow-ui-divider) {
276
284
  --spacing: var(--flow-ui-spacing-x-small);
277
285
  --inset: var(--flow-ui-spacing-medium);
286
+ --color: var(--flow-ui-menu-divider-color);
278
287
  }
279
288
 
280
289
  .select__listbox ::slotted(small) {
@@ -6,7 +6,7 @@ const styles = css`
6
6
 
7
7
  :host {
8
8
  --track-width: 2px;
9
- --track-color: rgb(128 128 128 / 25%);
9
+ --track-color: var(--flow-ui-color-neutral-600);
10
10
  --indicator-color: var(--flow-ui-color-primary-500);
11
11
  --speed: 2s;
12
12
 
@@ -38,7 +38,7 @@ const styles = css`
38
38
  }
39
39
 
40
40
  .stepper__header-item--active {
41
- background-color: var(--flow-ui-color-neutral-200);
41
+ background-color: var(--flow-ui-color-neutral-400);
42
42
  }
43
43
 
44
44
  .stepper__header-item-icon {
@@ -49,7 +49,7 @@ const styles = css`
49
49
  flex: none;
50
50
  border-radius: var(--flow-ui-border-radius-circle);
51
51
  color: var(--flow-ui-color-neutral-800);
52
- background-color: var(--flow-ui-color-neutral-400);
52
+ background-color: var(--flow-ui-color-neutral-500);
53
53
  }
54
54
 
55
55
  .stepper__header-item--active .stepper__header-item-icon,
@@ -73,7 +73,7 @@ const styles = css`
73
73
  min-width: 50px;
74
74
  vertical-align: middle;
75
75
  line-height: var(--flow-ui-line-height-dense);
76
- color: var(--flow-ui-color-neutral-700);
76
+ color: var(--flow-ui-color-neutral-800);
77
77
  }
78
78
 
79
79
  .stepper__header-item--active .stepper__header-item-label {
@@ -86,8 +86,7 @@ const styles = css`
86
86
  }
87
87
 
88
88
  .stepper__header-item-subtitle {
89
- font-size: var(--flow-ui-font-size-small);
90
- color: var(--flow-ui-color-neutral-700);
89
+ font-size: var(--flow-ui-font-size-800);
91
90
  }
92
91
 
93
92
  .stepper__header-line {
@@ -97,7 +96,7 @@ const styles = css`
97
96
  height: 0;
98
97
  margin: 0 calc(var(--flow-ui-spacing-large) / -2);
99
98
  min-width: 32px;
100
- border-top-color: var(--flow-ui-color-neutral-300);
99
+ border-top-color: var(--flow-ui-color-neutral-600);
101
100
  }
102
101
  `;
103
102
 
@@ -9,7 +9,27 @@ const styles = css`
9
9
  :host {
10
10
  display: inline-block;
11
11
  --switch-height: var(--flow-ui-toggle-size-medium);
12
- --switch-thumb-size: calc(var(--flow-ui-toggle-size-medium));
12
+
13
+ --switch-color: var(--flow-ui-switch-color, var(--flow-ui-color-neutral-400));
14
+ --switch-border-color: var(--flow-ui-switch-border-color, var(--flow-ui-color-neutral-500));
15
+
16
+ --switch-color-hover: var(--flow-ui-switch-color-hover, var(--flow-ui-color-neutral-400));
17
+ --switch-border-color-hover: var(--flow-ui-switch-border-color-hover, var(--flow-ui-color-neutral-500));
18
+
19
+ --switch-color-checked: var(--flow-ui-switch-color-checked, var(--flow-ui-color-primary-500));
20
+ --switch-border-color-checked: var(--flow-ui-switch-border-color-checked, var(--flow-ui-color-primary-500));
21
+
22
+ --thumb-color: var(--flow-ui-switch-thumb-color, var(--flow-ui-color-neutral-800));
23
+ --thumb-border-color: var(--flow-ui-switch-thumb-border-color, var(--flow-ui-color-neutral-800));
24
+
25
+ --thumb-color-hover: var(--flow-ui-switch-thumb-color-hover, var(--flow-ui-color-neutral-900));
26
+ --thumb-border-color-hover: var(--flow-ui-switch-thumb-border-color-hover, var(--flow-ui-color-neutral-950));
27
+
28
+ --thumb-color-checked: var(--flow-ui-switch-thumb-color-checked, var(--flow-ui-color-neutral-950));
29
+ --thumb-border-color-checked: var(--flow-ui-switch-thumb-border-color-checked, var(--flow-ui-color-neutral-950));
30
+
31
+ --thumb-size: calc(var(--flow-ui-toggle-size-medium));
32
+
13
33
  --switch-width: calc(var(--switch-height) * 1.8);
14
34
  }
15
35
 
@@ -44,8 +64,8 @@ const styles = css`
44
64
  justify-content: center;
45
65
  width: var(--switch-width);
46
66
  height: var(--switch-height);
47
- background-color: var(--flow-ui-color-neutral-300);
48
- border: solid var(--flow-ui-control-border-width) var(--flow-ui-color-neutral-400);
67
+ background-color: var(--switch-color);
68
+ border: solid var(--flow-ui-control-border-width) var(--switch-border-color);
49
69
  border-radius: var(--switch-height);
50
70
  transition:
51
71
  var(--flow-ui-transition-fast) border-color,
@@ -54,11 +74,11 @@ const styles = css`
54
74
  }
55
75
 
56
76
  .switch__control .switch__thumb {
57
- width: var(--switch-thumb-size);
58
- height: var(--switch-thumb-size);
59
- background-color: var(--flow-ui-color-neutral-800);
77
+ width: var(--thumb-size);
78
+ height: var(--thumb-size);
79
+ background-color: var(--thumb-color);
60
80
  border-radius: 50%;
61
- border: solid var(--flow-ui-control-border-width) var(--flow-ui-color-neutral-800);
81
+ border: solid var(--flow-ui-control-border-width) var(--thumb-border-color);
62
82
  translate: calc((var(--switch-width) - var(--switch-height)) / -2);
63
83
  transition:
64
84
  var(--flow-ui-transition-fast) translate ease,
@@ -77,13 +97,13 @@ const styles = css`
77
97
 
78
98
  /* Hover */
79
99
  .form-control:not(.switch--checked):not(.switch--disabled) .switch__control:hover {
80
- background-color: var(--flow-ui-color-neutral-400);
81
- border-color: var(--flow-ui-control-border-color);
100
+ background-color: var(--switch-color-hover);
101
+ border-color: var(--switch-border-color-hover);
82
102
  }
83
103
 
84
104
  .form-control:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {
85
- background-color: var(--flow-ui-color-neutral-900);
86
- border-color: var(--flow-ui-color-neutral-900);
105
+ background-color: var(--thumb-color-hover);
106
+ border-color: var(--thumb-border-color-hover);
87
107
  }
88
108
 
89
109
  /* Focus */
@@ -94,13 +114,13 @@ const styles = css`
94
114
 
95
115
  /* Checked */
96
116
  .switch--checked .switch__control {
97
- background-color: var(--flow-ui-color-primary-500);
98
- border-color: var(--flow-ui-color-primary-500);
117
+ background-color: var(--switch-color-checked);
118
+ border-color: var(--switch-border-color-checked);
99
119
  }
100
120
 
101
121
  .switch--checked .switch__control .switch__thumb {
102
- background-color: var(--flow-ui-color-neutral-800);
103
- border-color: var(--flow-ui-color-primary-800);
122
+ background-color: var(--thumb-color-checked);
123
+ border-color: var(--thumb-border-color-checked);
104
124
  translate: calc((var(--switch-width) - var(--switch-height)) / 2);
105
125
  }
106
126
 
@@ -33,6 +33,7 @@ class FlowUiTab extends FlowRdfElement {
33
33
  this.iconOnly = false;
34
34
  this.closable = false;
35
35
  this.disabled = false;
36
+ this.placement = "top";
36
37
  this.tooltipPlacement = "top";
37
38
  this.tooltipDistance = -4;
38
39
  this.tooltipSkidding = 0;
@@ -143,6 +144,9 @@ __decorateClass([
143
144
  __decorateClass([
144
145
  property()
145
146
  ], FlowUiTab.prototype, "label", 2);
147
+ __decorateClass([
148
+ property({ reflect: true })
149
+ ], FlowUiTab.prototype, "placement", 2);
146
150
  __decorateClass([
147
151
  property({ attribute: "tooltip-placement" })
148
152
  ], FlowUiTab.prototype, "tooltipPlacement", 2);
@@ -5,10 +5,12 @@ const styles = css`
5
5
  ${componentStyles}
6
6
 
7
7
  :host {
8
- display: inline-block;
8
+ display: inline-flex;
9
+ align-items: center;
9
10
  --color: var(--flow-ui-tab-color);
10
11
  --active-label-color: var(--flow-ui-tab-active-label-color);
11
12
  --active-icon-color: var(--flow-ui-tab-active-icon-color);
13
+ --min-size: auto;
12
14
  }
13
15
 
14
16
  .tab {
@@ -30,6 +32,16 @@ const styles = css`
30
32
  var(--transition-speed) color;
31
33
  }
32
34
 
35
+ :host([placement='top']) .tab,
36
+ :host([placement='bottom']) .tab {
37
+ min-width: var(--min-size);
38
+ }
39
+
40
+ :host([placement='start']) .tab,
41
+ :host([placement='end']) .tab {
42
+ min-height: var(--min-size);
43
+ }
44
+
33
45
  /* Highlight icon only on hover */
34
46
  .tab:hover:not(.tab--disabled) .tab__icon {
35
47
  color: var(--flow-ui-tab-active-label-color);
@@ -259,6 +259,7 @@ class FlowUiTabGroup extends FlowRdfElement {
259
259
  this.panels = this.getAllPanels();
260
260
  this.tabs.forEach((tab) => {
261
261
  tab.tabGroup = this;
262
+ tab.placement = this.placement;
262
263
  });
263
264
  if (this._activeTab && this.tabs.includes(this._activeTab) === false) {
264
265
  this.setActiveTab(this.tabs.find((el) => !el.disabled) ?? this.tabs[0], { emitEvents: true });
@@ -46,6 +46,7 @@ const styles = css`
46
46
  display: flex;
47
47
  flex-direction: row;
48
48
  align-items: center;
49
+ flex-shrink: 0;
49
50
  }
50
51
 
51
52
  .tab-group__accessory-divider {
@@ -26,11 +26,13 @@ class FlowUiTabPanel extends FlowRdfElement {
26
26
  this.name = "";
27
27
  this.active = false;
28
28
  this.scrollable = false;
29
+ this.padding = false;
29
30
  }
30
31
  connectedCallback() {
31
32
  super.connectedCallback();
32
33
  this.active = boolean(this.active, true);
33
34
  this.scrollable = boolean(this.scrollable, true);
35
+ this.padding = boolean(this.padding, true);
34
36
  this.id = this.id.length > 0 ? this.id : this.componentId;
35
37
  this.setAttribute("role", "tabpanel");
36
38
  }
@@ -43,7 +45,8 @@ class FlowUiTabPanel extends FlowRdfElement {
43
45
  class=${classMap({
44
46
  panel: true,
45
47
  "panel--active": this.active,
46
- "panel--scrollable": this.scrollable
48
+ "panel--scrollable": this.scrollable,
49
+ "panel--with-padding": this.padding
47
50
  })}
48
51
  >
49
52
  <div class="panel__body-wrapper">
@@ -65,6 +68,9 @@ __decorateClass([
65
68
  __decorateClass([
66
69
  property({ type: Boolean, reflect: true })
67
70
  ], FlowUiTabPanel.prototype, "scrollable", 2);
71
+ __decorateClass([
72
+ property({ type: Boolean, reflect: true })
73
+ ], FlowUiTabPanel.prototype, "padding", 2);
68
74
  __decorateClass([
69
75
  watch("active")
70
76
  ], FlowUiTabPanel.prototype, "handleActiveChange", 1);
@@ -8,7 +8,7 @@ const styles = css`
8
8
  display: none;
9
9
  min-height: 0;
10
10
 
11
- --padding: 0;
11
+ --padding: var(--flow-ui-panel-padding);
12
12
  }
13
13
 
14
14
  :host([active]) {
@@ -33,12 +33,16 @@ const styles = css`
33
33
  overflow-y: auto;
34
34
  }
35
35
 
36
- .panel--scrollable .panel__body {
36
+ .panel--scrollable.panel--with-padding .panel__body {
37
37
  padding: var(--padding);
38
38
  }
39
39
 
40
+ .panel--scrollable.panel--with-padding.panel--has-form-controls .panel__body {
41
+ padding: calc(var(--padding) * 1.5);
42
+ }
43
+
40
44
  /* For non-scrollable panel - fix body at 100% and disable scroll. Padding is added to wrapper */
41
- .panel:not(.panel--scrollable) .panel__body-wrapper {
45
+ .panel.panel--with-padding:not(.panel--scrollable) .panel__body-wrapper {
42
46
  padding: var(--padding);
43
47
  }
44
48