@gravitee/ui-components 3.25.3-typescript-e7256ca → 3.25.3-typescript-9cbc31e
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/package.json +5 -13
- package/src/atoms/gv-autocomplete.js +422 -1
- package/src/atoms/gv-button.js +397 -1
- package/src/atoms/gv-checkbox.js +178 -1
- package/src/atoms/gv-date-picker-calendar.js +812 -1
- package/src/atoms/gv-date-picker-cell.js +174 -1
- package/src/atoms/gv-date-picker.js +638 -1
- package/src/atoms/gv-file-upload.js +348 -1
- package/src/atoms/gv-icon.js +93 -1
- package/src/atoms/gv-image.js +135 -1
- package/src/atoms/gv-input-message.js +78 -1
- package/src/atoms/gv-input.js +508 -1
- package/src/atoms/gv-link.js +204 -1
- package/src/atoms/gv-message.js +133 -1
- package/src/atoms/gv-metric.js +112 -1
- package/src/atoms/gv-relative-time.js +143 -1
- package/src/atoms/gv-select-native.js +363 -1
- package/src/atoms/gv-select.js +413 -1
- package/src/atoms/gv-spinner.js +54 -1
- package/src/atoms/gv-state.js +125 -1
- package/src/atoms/gv-switch.js +235 -1
- package/src/atoms/gv-tag.js +162 -1
- package/src/atoms/gv-text.js +160 -1
- package/src/charts/gv-chart-bar.js +101 -1
- package/src/charts/gv-chart-gauge.js +92 -1
- package/src/charts/gv-chart-histogram.js +78 -1
- package/src/charts/gv-chart-line.js +218 -1
- package/src/charts/gv-chart-map.js +111 -1
- package/src/charts/gv-chart-pie.js +89 -1
- package/src/index.js +77 -1
- package/src/lib/cron-expression.js +176 -1
- package/src/lib/date.js +43 -1
- package/src/lib/events.js +26 -1
- package/src/lib/http-client-schema-form.js +67 -1
- package/src/lib/http.js +237 -1
- package/src/lib/i18n.js +93 -1
- package/src/lib/item.js +110 -1
- package/src/lib/properties.js +171 -1
- package/src/lib/schema-form.js +39 -1
- package/src/lib/studio.js +144 -1
- package/src/lib/style.js +39 -1
- package/src/lib/text-format.js +65 -1
- package/src/lib/theme.js +60 -1
- package/src/lib/utils.js +106 -1
- package/src/mixins/chart-element.js +153 -1
- package/src/mixins/input-element.js +136 -1
- package/src/mixins/item-resource.js +102 -1
- package/src/mixins/keyboard-element.js +62 -1
- package/src/mixins/update-after-browser.js +30 -1
- package/src/mixins/with-resize-observer.js +62 -1
- package/src/mixins/with-skeleton-attribute.js +109 -1
- package/src/molecules/gv-card-full.js +209 -1
- package/src/molecules/gv-card-list.js +101 -1
- package/src/molecules/gv-card.js +130 -1
- package/src/molecules/gv-category-list.js +56 -1
- package/src/molecules/gv-category.js +163 -1
- package/src/molecules/gv-code.js +334 -1
- package/src/molecules/gv-confirm.js +175 -1
- package/src/molecules/gv-cron-editor.js +685 -1
- package/src/molecules/gv-dropdown-menu.js +108 -1
- package/src/molecules/gv-expandable.js +116 -1
- package/src/molecules/gv-expression-language.js +263 -1
- package/src/molecules/gv-identity-picture.js +139 -1
- package/src/molecules/gv-list.js +214 -1
- package/src/molecules/gv-metrics.js +147 -1
- package/src/molecules/gv-modal.js +203 -1
- package/src/molecules/gv-nav.js +180 -1
- package/src/molecules/gv-option.js +230 -1
- package/src/molecules/gv-plans.js +400 -1
- package/src/molecules/gv-popover.js +323 -1
- package/src/molecules/gv-promote.js +203 -1
- package/src/molecules/gv-rating-list.js +341 -1
- package/src/molecules/gv-rating.js +234 -1
- package/src/molecules/gv-row-expandable.js +42 -1
- package/src/molecules/gv-row.js +205 -1
- package/src/molecules/gv-stats.js +110 -1
- package/src/molecules/gv-stepper.js +274 -1
- package/src/molecules/gv-table.js +644 -1
- package/src/molecules/gv-tree.js +238 -1
- package/src/organisms/gv-documentation.js +205 -1
- package/src/organisms/gv-header.js +276 -1
- package/src/organisms/gv-http-client.js +258 -1
- package/src/organisms/gv-menu.js +258 -1
- package/src/organisms/gv-newsletter-subscription.js +258 -1
- package/src/organisms/gv-pagination.js +179 -1
- package/src/organisms/gv-properties.js +860 -1
- package/src/organisms/gv-resizable-views.js +371 -1
- package/src/organisms/gv-resources.js +496 -1
- package/src/organisms/gv-schema-form-array.js +237 -1
- package/src/organisms/gv-schema-form-control-object.js +141 -1
- package/src/organisms/gv-schema-form-control.js +419 -1
- package/src/organisms/gv-schema-form.js +700 -1
- package/src/organisms/gv-tabs.js +201 -1
- package/src/organisms/gv-user-menu.js +298 -1
- package/src/organisms/gv-vertical-menu.js +119 -1
- package/src/policy-studio/gv-flow-step.js +443 -1
- package/src/policy-studio/gv-flow.js +595 -1
- package/src/policy-studio/gv-policy-studio-menu.js +689 -1
- package/src/policy-studio/gv-policy-studio.js +1712 -1
- package/src/styles/empty.js +35 -1
- package/src/styles/input.js +262 -1
- package/src/styles/link.js +31 -1
- package/src/styles/shapes.js +17 -1
- package/src/styles/skeleton.js +52 -1
- package/src/styles/zoom.js +39 -1
- package/src/theme/gv-theme.js +197 -1
- package/wc/gv-autocomplete.js +1 -1
- package/wc/gv-button.js +1 -1
- package/wc/gv-card-full.js +1 -1
- package/wc/gv-card-list.js +1 -1
- package/wc/gv-card.js +1 -1
- package/wc/gv-category-list.js +1 -1
- package/wc/gv-category.js +1 -1
- package/wc/gv-chart-bar.js +1 -1
- package/wc/gv-chart-gauge.js +1 -1
- package/wc/gv-chart-histogram.js +1 -1
- package/wc/gv-chart-line.js +1 -1
- package/wc/gv-chart-map.js +1 -1
- package/wc/gv-chart-pie.js +1 -1
- package/wc/gv-checkbox.js +1 -1
- package/wc/gv-code.js +1 -1
- package/wc/gv-confirm.js +1 -1
- package/wc/gv-cron-editor.js +1 -1
- package/wc/gv-date-picker-calendar.js +1 -1
- package/wc/gv-date-picker-cell.js +1 -1
- package/wc/gv-date-picker.js +1 -1
- package/wc/gv-documentation.js +1 -1
- package/wc/gv-dropdown-menu.js +1 -1
- package/wc/gv-expandable.js +1 -1
- package/wc/gv-expression-language.js +1 -1
- package/wc/gv-file-upload.js +1 -1
- package/wc/gv-flow-step.js +1 -1
- package/wc/gv-flow.js +1 -1
- package/wc/gv-header.js +1 -1
- package/wc/gv-http-client.js +1 -1
- package/wc/gv-icon.js +1 -1
- package/wc/gv-identity-picture.js +1 -1
- package/wc/gv-image.js +1 -1
- package/wc/gv-input-message.js +1 -1
- package/wc/gv-input.js +1 -1
- package/wc/gv-link.js +1 -1
- package/wc/gv-list.js +1 -1
- package/wc/gv-menu.js +1 -1
- package/wc/gv-message.js +1 -1
- package/wc/gv-metric.js +1 -1
- package/wc/gv-metrics.js +1 -1
- package/wc/gv-modal.js +1 -1
- package/wc/gv-nav.js +1 -1
- package/wc/gv-newsletter-subscription.js +1 -1
- package/wc/gv-option.js +1 -1
- package/wc/gv-pagination.js +1 -1
- package/wc/gv-plans.js +1 -1
- package/wc/gv-policy-studio-menu.js +1 -1
- package/wc/gv-policy-studio.js +1 -1
- package/wc/gv-popover.js +1 -1
- package/wc/gv-promote.js +1 -1
- package/wc/gv-properties.js +1 -1
- package/wc/gv-rating-list.js +1 -1
- package/wc/gv-rating.js +1 -1
- package/wc/gv-relative-time.js +1 -1
- package/wc/gv-resizable-views.js +1 -1
- package/wc/gv-resources.js +1 -1
- package/wc/gv-row-expandable.js +1 -1
- package/wc/gv-row.js +1 -1
- package/wc/gv-schema-form-array.js +1 -1
- package/wc/gv-schema-form-control-object.js +1 -1
- package/wc/gv-schema-form-control.js +1 -1
- package/wc/gv-schema-form.js +1 -1
- package/wc/gv-select-native.js +1 -1
- package/wc/gv-select.js +1 -1
- package/wc/gv-spinner.js +1 -1
- package/wc/gv-state.js +1 -1
- package/wc/gv-stats.js +1 -1
- package/wc/gv-stepper.js +1 -1
- package/wc/gv-switch.js +1 -1
- package/wc/gv-table.js +1 -1
- package/wc/gv-tabs.js +1 -1
- package/wc/gv-tag.js +1 -1
- package/wc/gv-text.js +1 -1
- package/wc/gv-theme.js +1 -1
- package/wc/gv-tree.js +1 -1
- package/wc/gv-user-menu.js +1 -1
- package/wc/gv-vertical-menu.js +1 -1
|
@@ -1 +1,443 @@
|
|
|
1
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2015 The Gravitee team (http://gravitee.io)
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { LitElement, html, css } from 'lit';
|
|
17
|
+
import { withResizeObserver } from '../mixins/with-resize-observer';
|
|
18
|
+
import { classMap } from 'lit/directives/class-map';
|
|
19
|
+
import { dispatchCustomEvent } from '../lib/events';
|
|
20
|
+
import '../atoms/gv-image';
|
|
21
|
+
import '../molecules/gv-dropdown-menu';
|
|
22
|
+
import '../atoms/gv-switch';
|
|
23
|
+
/**
|
|
24
|
+
* Flow area component
|
|
25
|
+
*
|
|
26
|
+
* @fires gv-flow-step:duplicate - Duplicate event from actions
|
|
27
|
+
* @fires gv-flow-step:delete - Delete event from actions
|
|
28
|
+
* @fires gv-flow-step:edit - Edit event
|
|
29
|
+
* @fires gv-flow-step:copy - Copy event
|
|
30
|
+
* @fires gv-flow-step:move - Move event
|
|
31
|
+
*
|
|
32
|
+
* @attr {Object<{name, icon, configuration:{description, ...}}>} step - the flow step, configuration contains form conf for gv-schema-form component
|
|
33
|
+
* @attr {Boolean} editing - true, if edition in progress
|
|
34
|
+
* @attr {Boolean} dragging - true, if dragging in progress
|
|
35
|
+
* @attr {Boolean} hover - true, if area is hover
|
|
36
|
+
* @attr {String} title - title of area, default is "content.configuration.description" if exist
|
|
37
|
+
* @attr {Boolean} empty - true, if render empty state
|
|
38
|
+
* @attr {Boolean} confirm - true, if render confirm state
|
|
39
|
+
* @attr {Boolean} disabled - true for disabled
|
|
40
|
+
* @attr {Boolean} readonly - true if readonly
|
|
41
|
+
*/
|
|
42
|
+
export class GvFlowStep extends withResizeObserver(LitElement) {
|
|
43
|
+
static get properties() {
|
|
44
|
+
return {
|
|
45
|
+
id: { type: String, reflect: true },
|
|
46
|
+
group: { type: String, reflect: true },
|
|
47
|
+
parent: { type: String, reflect: true },
|
|
48
|
+
step: { type: Object },
|
|
49
|
+
policy: { type: Object },
|
|
50
|
+
editing: { type: Boolean, reflect: true },
|
|
51
|
+
dragging: { type: Boolean, reflect: true },
|
|
52
|
+
hover: { type: Boolean, reflect: true },
|
|
53
|
+
title: { type: String, reflect: true },
|
|
54
|
+
empty: { type: Boolean, reflect: true },
|
|
55
|
+
confirm: { type: Boolean, reflect: true },
|
|
56
|
+
disabled: { type: Boolean, reflect: true },
|
|
57
|
+
readonly: { type: Boolean, reflect: true },
|
|
58
|
+
_small: { type: Boolean, attribute: false },
|
|
59
|
+
_confirmDelete: { type: Boolean, reflect: true },
|
|
60
|
+
_confirmDuplicate: { type: Boolean, reflect: true },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
constructor() {
|
|
64
|
+
super();
|
|
65
|
+
this.empty = true;
|
|
66
|
+
this.breakpoints = {
|
|
67
|
+
width: [100, 200],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
onResize({ width }) {
|
|
71
|
+
this._small = width <= 200;
|
|
72
|
+
}
|
|
73
|
+
_onDuplicate() {
|
|
74
|
+
this._confirmDuplicate = true;
|
|
75
|
+
}
|
|
76
|
+
_onConfirmDuplicate() {
|
|
77
|
+
this._confirmDuplicate = false;
|
|
78
|
+
dispatchCustomEvent(this, 'duplicate', { step: this.step, policy: this.policy, target: this });
|
|
79
|
+
}
|
|
80
|
+
_onCancelDuplicate() {
|
|
81
|
+
this._confirmDuplicate = false;
|
|
82
|
+
}
|
|
83
|
+
_onClick(e) {
|
|
84
|
+
if (!e.target.classList.contains('action') && !this.editing) {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
this._edit();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
_edit() {
|
|
90
|
+
if (this.policy && !this.disabled) {
|
|
91
|
+
dispatchCustomEvent(this, 'edit', { step: this.step, policy: this.policy, group: this.group });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
_onMouseEnter() {
|
|
95
|
+
if (!this.disabled) {
|
|
96
|
+
this.hover = true;
|
|
97
|
+
if (!this.readonly) {
|
|
98
|
+
const dropdownMenu = this.shadowRoot.querySelector('gv-dropdown-menu');
|
|
99
|
+
dropdownMenu.setAttribute('open', true);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
_onMouseLeave() {
|
|
104
|
+
if (!this.disabled) {
|
|
105
|
+
this.hover = false;
|
|
106
|
+
if (!this.readonly) {
|
|
107
|
+
const dropdownMenu = this.shadowRoot.querySelector('gv-dropdown-menu');
|
|
108
|
+
dropdownMenu.removeAttribute('open');
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
_onDelete() {
|
|
113
|
+
this._confirmDelete = true;
|
|
114
|
+
}
|
|
115
|
+
_onConfirmDelete() {
|
|
116
|
+
this._confirmDelete = false;
|
|
117
|
+
dispatchCustomEvent(this, 'delete', { step: this.step });
|
|
118
|
+
}
|
|
119
|
+
_onCancelDelete() {
|
|
120
|
+
this._confirmDelete = false;
|
|
121
|
+
}
|
|
122
|
+
updated(properties) {
|
|
123
|
+
if (properties.has('dragging') && this.dragging === true) {
|
|
124
|
+
const dropdownMenu = this.shadowRoot.querySelector('gv-dropdown-menu');
|
|
125
|
+
dropdownMenu.removeAttribute('open');
|
|
126
|
+
}
|
|
127
|
+
if (properties.has('step') && this.step != null) {
|
|
128
|
+
this.empty = false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
_onCancel() {
|
|
132
|
+
this.remove();
|
|
133
|
+
}
|
|
134
|
+
_onCopy() {
|
|
135
|
+
dispatchCustomEvent(this, 'copy');
|
|
136
|
+
}
|
|
137
|
+
_onMove() {
|
|
138
|
+
dispatchCustomEvent(this, 'move');
|
|
139
|
+
}
|
|
140
|
+
_onChangeState({ detail }) {
|
|
141
|
+
dispatchCustomEvent(this, 'change-state', { step: this.step, enabled: detail });
|
|
142
|
+
}
|
|
143
|
+
_renderDropdownMenu() {
|
|
144
|
+
if (this.disabled || this.readonly) {
|
|
145
|
+
return html ``;
|
|
146
|
+
}
|
|
147
|
+
const enabled = this.step.enabled !== false;
|
|
148
|
+
return html `<gv-dropdown-menu right>
|
|
149
|
+
<gv-switch
|
|
150
|
+
slot="action"
|
|
151
|
+
class="action"
|
|
152
|
+
small
|
|
153
|
+
label="${enabled ? 'Enabled' : 'Disabled'}"
|
|
154
|
+
title="${enabled ? 'Disable policy ?' : 'Enable policy ?'}"
|
|
155
|
+
@gv-switch:input="${this._onChangeState}"
|
|
156
|
+
.value="${enabled}"
|
|
157
|
+
></gv-switch>
|
|
158
|
+
<gv-button slot="action" class="action" link small icon="general:duplicate" @gv-button:click="${this._onDuplicate}"
|
|
159
|
+
>Duplicate</gv-button
|
|
160
|
+
>
|
|
161
|
+
<gv-button slot="action" class="action" link small icon="home:trash" @gv-button:click="${this._onDelete}">Delete</gv-button>
|
|
162
|
+
</gv-dropdown-menu>`;
|
|
163
|
+
}
|
|
164
|
+
resetConfirm() {
|
|
165
|
+
this.confirm = false;
|
|
166
|
+
this._confirmDelete = false;
|
|
167
|
+
this._confirmDuplicate = false;
|
|
168
|
+
}
|
|
169
|
+
render() {
|
|
170
|
+
if (this.confirm) {
|
|
171
|
+
return html `<div class="drop-area drop-area-confirm">
|
|
172
|
+
<gv-button small @gv-button:click="${this._onCopy}">Copy</gv-button>
|
|
173
|
+
<gv-button small @gv-button:click="${this._onMove}">Move</gv-button>
|
|
174
|
+
<gv-button link small @gv-button:click="${this._onCancel}">Cancel</gv-button>
|
|
175
|
+
</div>`;
|
|
176
|
+
}
|
|
177
|
+
else if (this._confirmDelete) {
|
|
178
|
+
return html `<div class="drop-area drop-area-confirm">
|
|
179
|
+
<gv-button small danger @gv-button:click="${this._onConfirmDelete}">Delete</gv-button>
|
|
180
|
+
<gv-button link small @gv-button:click="${this._onCancelDelete}">Cancel</gv-button>
|
|
181
|
+
</div>`;
|
|
182
|
+
}
|
|
183
|
+
else if (this._confirmDuplicate) {
|
|
184
|
+
return html `<div class="drop-area drop-area-confirm">
|
|
185
|
+
<gv-button small @gv-button:click="${this._onConfirmDuplicate}">Duplicate</gv-button>
|
|
186
|
+
<gv-button link small @gv-button:click="${this._onCancelDuplicate}">Cancel</gv-button>
|
|
187
|
+
</div>`;
|
|
188
|
+
}
|
|
189
|
+
else if (!this.empty) {
|
|
190
|
+
const name = this.step ? this.step.name : '';
|
|
191
|
+
const description = this.step && this.step.description ? this.step.description : '';
|
|
192
|
+
const hasConditionalSteps = this.step && !!this.step.condition;
|
|
193
|
+
const icon = this.step ? this.policy && this.policy.icon : null;
|
|
194
|
+
const enabled = this.step && this.step.enabled !== false;
|
|
195
|
+
const notFound = this.policy == null;
|
|
196
|
+
if (notFound) {
|
|
197
|
+
this.title = 'Warning: policy not found in plugins folder';
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
this.title = description;
|
|
201
|
+
}
|
|
202
|
+
const classes = {
|
|
203
|
+
'drop-area': true,
|
|
204
|
+
'is-assigned': name !== '',
|
|
205
|
+
'has-icon': icon != null,
|
|
206
|
+
disabled: !enabled,
|
|
207
|
+
'not-found': notFound,
|
|
208
|
+
};
|
|
209
|
+
return html `<div
|
|
210
|
+
class="${classMap(classes)}"
|
|
211
|
+
@click="${this._onClick}"
|
|
212
|
+
@mouseenter="${this._onMouseEnter}"
|
|
213
|
+
@mouseleave="${this._onMouseLeave}"
|
|
214
|
+
>
|
|
215
|
+
${this._renderDropdownMenu()}
|
|
216
|
+
<div class="content">
|
|
217
|
+
<div class="content-icon">
|
|
218
|
+
${hasConditionalSteps ? html `<gv-icon class="content-icon-conditional" shape="design:conditional"></gv-icon>` : html ``}
|
|
219
|
+
${icon ? html `<gv-image src="${icon}"></gv-image>` : html ``}
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
${icon == null && notFound ? html `<gv-icon class="not-found__icon" shape="finance:folder-error"></gv-icon>` : ''}
|
|
223
|
+
<div>
|
|
224
|
+
<div class="name">${name}</div>
|
|
225
|
+
<div class="description">${description}</div>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
</div> `;
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
return html `<div class="drop-area"></div>`;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
static get styles() {
|
|
235
|
+
return [
|
|
236
|
+
// language=CSS
|
|
237
|
+
css `
|
|
238
|
+
:host {
|
|
239
|
+
box-sizing: border-box;
|
|
240
|
+
margin: 0.2rem;
|
|
241
|
+
display: block;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:host(:active) {
|
|
245
|
+
outline: none;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
:host([dragging]) {
|
|
249
|
+
opacity: 0.5;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
gv-dropdown-menu {
|
|
253
|
+
position: absolute;
|
|
254
|
+
right: 0;
|
|
255
|
+
display: flex;
|
|
256
|
+
flex-wrap: wrap;
|
|
257
|
+
justify-content: right;
|
|
258
|
+
top: -1px;
|
|
259
|
+
bottom: -1px;
|
|
260
|
+
z-index: 10;
|
|
261
|
+
--gv-dropdown-menu--bdw: 0 0 0 1px;
|
|
262
|
+
--gv-dropdown-menu--p: 0.1rem 0.3rem;
|
|
263
|
+
--gv-dropdown-menu--gg: 0;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
gv-switch {
|
|
267
|
+
margin: 0.2rem 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
:host([hover]) .drop-area {
|
|
271
|
+
transform: translateY(-4px);
|
|
272
|
+
box-shadow: 0 0 0 1px #5a7684, 0 1px 3px #5a7684;
|
|
273
|
+
border-color: transparent;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
:host([dragging]) .drop-area {
|
|
277
|
+
transform: translateY(-4px);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
:host([editing]) .drop-area {
|
|
281
|
+
border-color: #5a7684;
|
|
282
|
+
transform: translateY(-4px);
|
|
283
|
+
box-shadow: 0 0 0 1px #5a7684, 0 1px 3px #5a7684;
|
|
284
|
+
transition: all 0.2s;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
:host([w-lt-200]) gv-image {
|
|
288
|
+
position: absolute;
|
|
289
|
+
opacity: 0.1;
|
|
290
|
+
width: 100%;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
:host([w-lt-200]) .drop-area:hover gv-image {
|
|
294
|
+
opacity: 1;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
:host([w-lt-200]) .content-icon {
|
|
298
|
+
position: absolute;
|
|
299
|
+
width: 100%;
|
|
300
|
+
height: 100%;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
:host([w-lt-100]) .description {
|
|
304
|
+
display: none;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
:host([empty]) .drop-area {
|
|
308
|
+
position: relative;
|
|
309
|
+
background-color: transparent;
|
|
310
|
+
border: 2px dashed #bfbfbf;
|
|
311
|
+
font-size: 14px;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.description {
|
|
315
|
+
line-height: 14px;
|
|
316
|
+
font-size: 12px;
|
|
317
|
+
max-height: 42px;
|
|
318
|
+
overflow: hidden;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.drop-area {
|
|
322
|
+
position: relative;
|
|
323
|
+
border: 2px dashed #bfbfbf;
|
|
324
|
+
border-radius: 4px;
|
|
325
|
+
height: 80px;
|
|
326
|
+
min-width: 80px;
|
|
327
|
+
margin: 4px;
|
|
328
|
+
padding: 4px;
|
|
329
|
+
word-break: break-word;
|
|
330
|
+
display: flex;
|
|
331
|
+
align-items: center;
|
|
332
|
+
text-align: center;
|
|
333
|
+
justify-content: center;
|
|
334
|
+
flex-direction: column;
|
|
335
|
+
--gv-button--fz: 11px;
|
|
336
|
+
flex: 1;
|
|
337
|
+
transition: color 150ms ease-in-out, transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, border 0.3s ease-in-out;
|
|
338
|
+
background-color: white;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.drop-area.disabled {
|
|
342
|
+
/*opacity: 0.7;*/
|
|
343
|
+
/*background-color: #BFBFBF; !* fallback color if gradients are not supported *!*/
|
|
344
|
+
/*border-color: white;*/
|
|
345
|
+
text-decoration: line-through;
|
|
346
|
+
font-style: italic;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.drop-area.not-found {
|
|
350
|
+
border-color: var(--gv-theme-color-warning-light, #ffb74d);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.drop-area.has-icon {
|
|
354
|
+
padding-left: 0;
|
|
355
|
+
text-align: left;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.drop-area.has-icon .content {
|
|
359
|
+
justify-content: left;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.drop-area.is-assigned {
|
|
363
|
+
border-style: solid;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
:host([hover]) .drop-area.is-assigned:not(.not-found) {
|
|
367
|
+
cursor: grab;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
:host([hover]) .drop-area.is-assigned:not(.not-found):active {
|
|
371
|
+
cursor: grabbing;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
:host([readonly]) .drop-area.is-assigned:not(.not-found),
|
|
375
|
+
:host([readonly]) .drop-area.is-assigned:not(.not-found):active {
|
|
376
|
+
cursor: pointer;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.content {
|
|
380
|
+
display: flex;
|
|
381
|
+
align-items: center;
|
|
382
|
+
justify-content: center;
|
|
383
|
+
text-align: center;
|
|
384
|
+
width: 100%;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.content > div,
|
|
388
|
+
.content > mark {
|
|
389
|
+
width: 100%;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.content-icon {
|
|
393
|
+
flex: 0 1 0%;
|
|
394
|
+
display: flex;
|
|
395
|
+
margin: 0.2rem;
|
|
396
|
+
}
|
|
397
|
+
.content-icon-conditional {
|
|
398
|
+
position: absolute;
|
|
399
|
+
z-index: 10;
|
|
400
|
+
margin: 0.2rem;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
gv-image {
|
|
404
|
+
height: 80px;
|
|
405
|
+
width: 80px;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.not-found__icon {
|
|
409
|
+
--gv-icon--c: var(--gv-theme-color-warning-light, #ffb74d);
|
|
410
|
+
height: 60px;
|
|
411
|
+
width: 60px;
|
|
412
|
+
margin: 0.2rem;
|
|
413
|
+
justify-content: center;
|
|
414
|
+
align-items: center;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.drop-area-confirm {
|
|
418
|
+
flex-direction: row;
|
|
419
|
+
align-items: center;
|
|
420
|
+
justify-content: center;
|
|
421
|
+
background-color: white;
|
|
422
|
+
}
|
|
423
|
+
`,
|
|
424
|
+
];
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
export class PolicyDraggable {
|
|
428
|
+
static parse(str) {
|
|
429
|
+
const data = JSON.parse(str);
|
|
430
|
+
return new PolicyDraggable(data.policy, data.sourcePosition, data.sourceFlowKey, data.sourceFlowId, data.flowStep);
|
|
431
|
+
}
|
|
432
|
+
constructor(policy, sourcePosition, sourceFlowKey, sourceFlowId, flowStep) {
|
|
433
|
+
this.policy = policy;
|
|
434
|
+
this.sourcePosition = sourcePosition;
|
|
435
|
+
this.sourceFlowKey = sourceFlowKey;
|
|
436
|
+
this.sourceFlowId = sourceFlowId;
|
|
437
|
+
this.flowStep = flowStep;
|
|
438
|
+
}
|
|
439
|
+
toString() {
|
|
440
|
+
return JSON.stringify(this);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
window.customElements.define('gv-flow-step', GvFlowStep);
|