@vertexvis/ui 0.1.2-canary.0 → 0.1.2-canary.1
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/auto-resize-textarea.js +157 -0
- package/dist/components/color-swatch.js +124 -0
- package/dist/components/dom.js +13 -0
- package/dist/components/expandable.js +100 -0
- package/dist/components/icon-button.js +63 -0
- package/dist/components/icon-helper.js +722 -0
- package/dist/components/icon.js +43 -0
- package/dist/components/index.d.ts +71 -0
- package/dist/components/index.js +52 -0
- package/dist/components/index2.js +89 -0
- package/dist/components/menu.js +89 -0
- package/dist/components/popover.js +1737 -0
- package/dist/components/result-list.js +565 -0
- package/dist/components/slots.js +26 -0
- package/dist/components/text-field.js +171 -0
- package/dist/components/tooltip.js +360 -0
- package/dist/components/tslib.es6.js +65 -0
- package/dist/components/vertex-auto-resize-textarea.d.ts +11 -0
- package/dist/components/vertex-auto-resize-textarea.js +6 -0
- package/dist/components/vertex-avatar-group.d.ts +11 -0
- package/dist/components/vertex-avatar-group.js +34 -0
- package/dist/components/vertex-avatar.d.ts +11 -0
- package/dist/components/vertex-avatar.js +68 -0
- package/dist/components/vertex-badge.d.ts +11 -0
- package/dist/components/vertex-badge.js +43 -0
- package/dist/components/vertex-banner.d.ts +11 -0
- package/dist/components/vertex-banner.js +141 -0
- package/dist/components/vertex-button.d.ts +11 -0
- package/dist/components/vertex-button.js +96 -0
- package/dist/components/vertex-card-group.d.ts +11 -0
- package/dist/components/vertex-card-group.js +51 -0
- package/dist/components/vertex-card.d.ts +11 -0
- package/dist/components/vertex-card.js +49 -0
- package/dist/components/vertex-chip.d.ts +11 -0
- package/dist/components/vertex-chip.js +45 -0
- package/dist/components/vertex-click-to-edit-textfield.d.ts +11 -0
- package/dist/components/vertex-click-to-edit-textfield.js +156 -0
- package/dist/components/vertex-collapsible.d.ts +11 -0
- package/dist/components/vertex-collapsible.js +63 -0
- package/dist/components/vertex-color-circle-picker.d.ts +11 -0
- package/dist/components/vertex-color-circle-picker.js +104 -0
- package/dist/components/vertex-color-picker.d.ts +11 -0
- package/dist/components/vertex-color-picker.js +75 -0
- package/dist/components/vertex-color-swatch.d.ts +11 -0
- package/dist/components/vertex-color-swatch.js +6 -0
- package/dist/components/vertex-context-menu.d.ts +11 -0
- package/dist/components/vertex-context-menu.js +125 -0
- package/dist/components/vertex-dialog.d.ts +11 -0
- package/dist/components/vertex-dialog.js +263 -0
- package/dist/components/vertex-draggable-popover.d.ts +11 -0
- package/dist/components/vertex-draggable-popover.js +119 -0
- package/dist/components/vertex-dropdown-menu.d.ts +11 -0
- package/dist/components/vertex-dropdown-menu.js +64 -0
- package/dist/components/vertex-expandable.d.ts +11 -0
- package/dist/components/vertex-expandable.js +6 -0
- package/dist/components/vertex-help-tooltip.d.ts +11 -0
- package/dist/components/vertex-help-tooltip.js +67 -0
- package/dist/components/vertex-icon-button.d.ts +11 -0
- package/dist/components/vertex-icon-button.js +6 -0
- package/dist/components/vertex-icon.d.ts +11 -0
- package/dist/components/vertex-icon.js +6 -0
- package/dist/components/vertex-logo-loading.d.ts +11 -0
- package/dist/components/vertex-logo-loading.js +34 -0
- package/dist/components/vertex-menu-divider.d.ts +11 -0
- package/dist/components/vertex-menu-divider.js +34 -0
- package/dist/components/vertex-menu-item.d.ts +11 -0
- package/dist/components/vertex-menu-item.js +44 -0
- package/dist/components/vertex-menu.d.ts +11 -0
- package/dist/components/vertex-menu.js +6 -0
- package/dist/components/vertex-popover.d.ts +11 -0
- package/dist/components/vertex-popover.js +6 -0
- package/dist/components/vertex-radio-group.d.ts +11 -0
- package/dist/components/vertex-radio-group.js +88 -0
- package/dist/components/vertex-radio.d.ts +11 -0
- package/dist/components/vertex-radio.js +56 -0
- package/dist/components/vertex-resizable.d.ts +11 -0
- package/dist/components/vertex-resizable.js +445 -0
- package/dist/components/vertex-result-list.d.ts +11 -0
- package/dist/components/vertex-result-list.js +6 -0
- package/dist/components/vertex-search-bar.d.ts +11 -0
- package/dist/components/vertex-search-bar.js +568 -0
- package/dist/components/vertex-select.d.ts +11 -0
- package/dist/components/vertex-select.js +200 -0
- package/dist/components/vertex-slider.d.ts +11 -0
- package/dist/components/vertex-slider.js +81 -0
- package/dist/components/vertex-spinner.d.ts +11 -0
- package/dist/components/vertex-spinner.js +49 -0
- package/dist/components/vertex-tab.d.ts +11 -0
- package/dist/components/vertex-tab.js +46 -0
- package/dist/components/vertex-tabs.d.ts +11 -0
- package/dist/components/vertex-tabs.js +133 -0
- package/dist/components/vertex-textfield.d.ts +11 -0
- package/dist/components/vertex-textfield.js +6 -0
- package/dist/components/vertex-toast.d.ts +11 -0
- package/dist/components/vertex-toast.js +127 -0
- package/dist/components/vertex-toggle.d.ts +11 -0
- package/dist/components/vertex-toggle.js +67 -0
- package/dist/components/vertex-tooltip.d.ts +11 -0
- package/dist/components/vertex-tooltip.js +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { readTask, proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as classnames } from './index2.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './icon.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './icon-button.js';
|
|
5
|
+
|
|
6
|
+
function readDOM(callback) {
|
|
7
|
+
readTask(callback);
|
|
8
|
+
}
|
|
9
|
+
function getBoundingClientRect(el) {
|
|
10
|
+
return el.getBoundingClientRect();
|
|
11
|
+
}
|
|
12
|
+
function getComputedStyle(el) {
|
|
13
|
+
return window.getComputedStyle(el);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const dialogCss = ":host{--backdrop-color:rgba(0,0,0,0.4);--z-index:var(--vertex-ui-dialog-layer)}.hidden>.dialog{opacity:0;width:0;height:0;visibility:hidden}.hidden{pointer-events:none;display:none}.close{margin-left:auto}.shown{display:flex;justify-content:center;align-items:center}.header{width:100%;display:flex;font-size:1.125rem;height:2rem;margin-bottom:1rem}.body{position:relative;width:100%;height:100%}.dialog-backdrop{position:fixed;z-index:var(--z-index);left:0;top:0;width:100%;height:100%;overflow:auto;background-color:var(--backdrop-color);padding:2rem;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.dialog{background-color:var(--vertex-ui-white);position:absolute;align-items:center;color:var(--vertex-ui-neutral-800);font-family:var(--vertex-ui-font-family);overflow:hidden}.dialog.no-select{user-select:none}.overlay{border:1px solid var(--vertex-ui-neutral-300);border-radius:6px;box-shadow:0 1px 2px rgba(0, 0, 0, 0.15);display:flex}.overlay.resizable{min-height:var(--min-height, var(--vertex-ui-min-dialog-height))}.fullscreen{height:100vh;width:100vw}.contents{display:flex;position:relative;flex-direction:column;padding:1.5rem;width:100%;height:100%;box-sizing:border-box}.close:hover,.close:focus{color:black;text-decoration:none;cursor:pointer}.footer{display:flex}.resize{cursor:nwse-resize;position:absolute;bottom:0.125rem;right:0.125rem}.resize-cursor{cursor:nwse-resize}";
|
|
17
|
+
|
|
18
|
+
const Dialog = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this.__registerHost();
|
|
22
|
+
this.__attachShadow();
|
|
23
|
+
this.backdropClick = createEvent(this, "backdropClick", 7);
|
|
24
|
+
this.closed = createEvent(this, "closed", 7);
|
|
25
|
+
this.handleKeyDown = (_) => {
|
|
26
|
+
if (this.open) {
|
|
27
|
+
this.open = false;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
this.handlePointerDown = (e) => {
|
|
31
|
+
this.isResizing = true;
|
|
32
|
+
readDOM(() => {
|
|
33
|
+
if (this.dialogElement != null) {
|
|
34
|
+
const boundingRect = getBoundingClientRect(this.dialogElement);
|
|
35
|
+
this.initialDialogBoundingRect = boundingRect;
|
|
36
|
+
this.lastPointerPosition = {
|
|
37
|
+
x: boundingRect.right,
|
|
38
|
+
y: boundingRect.bottom,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
window.addEventListener('pointermove', this.handlePointerMove);
|
|
43
|
+
window.addEventListener('pointerup', this.handlePointerUp);
|
|
44
|
+
};
|
|
45
|
+
this.handlePointerMove = (e) => {
|
|
46
|
+
if (this.lastPointerPosition != null &&
|
|
47
|
+
this.initialDialogBoundingRect != null &&
|
|
48
|
+
this.width != null &&
|
|
49
|
+
this.height != null) {
|
|
50
|
+
const diffX = e.clientX - this.lastPointerPosition.x;
|
|
51
|
+
const diffY = e.clientY - this.lastPointerPosition.y;
|
|
52
|
+
const expectedWidth = this.width + diffX * 2;
|
|
53
|
+
const expectedHeight = this.height + diffY * 2;
|
|
54
|
+
this.width = this.constrainDimension(expectedWidth, this.getMinWidth(), this.getMaxWidth());
|
|
55
|
+
this.height = this.constrainDimension(expectedHeight, this.getMinHeight(), this.getMaxHeight());
|
|
56
|
+
this.lastPointerPosition = {
|
|
57
|
+
x: this.constrainX(e.clientX, this.width, this.initialDialogBoundingRect),
|
|
58
|
+
y: this.constrainY(e.clientY, this.height, this.initialDialogBoundingRect),
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
this.handlePointerUp = (e) => {
|
|
63
|
+
this.lastPointerPosition = undefined;
|
|
64
|
+
this.initialDialogBoundingRect = undefined;
|
|
65
|
+
this.isResizing = false;
|
|
66
|
+
window.removeEventListener('pointermove', this.handlePointerMove);
|
|
67
|
+
window.removeEventListener('pointerup', this.handlePointerUp);
|
|
68
|
+
};
|
|
69
|
+
this.constrainDimension = (value, min, max) => {
|
|
70
|
+
return Math.min(Math.max(value, min), max);
|
|
71
|
+
};
|
|
72
|
+
this.constrainX = (x, width, bounds) => {
|
|
73
|
+
if (width <= this.getMinWidth()) {
|
|
74
|
+
return bounds.right;
|
|
75
|
+
}
|
|
76
|
+
else if (width >= this.getMinHeight()) {
|
|
77
|
+
return bounds.right + (width - bounds.width) / 2;
|
|
78
|
+
}
|
|
79
|
+
return x;
|
|
80
|
+
};
|
|
81
|
+
this.constrainY = (y, height, bounds) => {
|
|
82
|
+
if (height <= this.getMinHeight()) {
|
|
83
|
+
return bounds.bottom;
|
|
84
|
+
}
|
|
85
|
+
else if (height >= this.getMaxHeight()) {
|
|
86
|
+
return bounds.bottom + (height - bounds.height) / 2;
|
|
87
|
+
}
|
|
88
|
+
return y;
|
|
89
|
+
};
|
|
90
|
+
this.getMaxWidth = () => {
|
|
91
|
+
var _a;
|
|
92
|
+
return (_a = this.maxWidth) !== null && _a !== void 0 ? _a : Number.POSITIVE_INFINITY;
|
|
93
|
+
};
|
|
94
|
+
this.getMaxHeight = () => {
|
|
95
|
+
var _a;
|
|
96
|
+
return (_a = this.maxHeight) !== null && _a !== void 0 ? _a : Number.POSITIVE_INFINITY;
|
|
97
|
+
};
|
|
98
|
+
this.getMinWidth = () => {
|
|
99
|
+
var _a;
|
|
100
|
+
return (_a = this.minWidth) !== null && _a !== void 0 ? _a : Number.NEGATIVE_INFINITY;
|
|
101
|
+
};
|
|
102
|
+
this.getMinHeight = () => {
|
|
103
|
+
var _a;
|
|
104
|
+
return (_a = this.minHeight) !== null && _a !== void 0 ? _a : Number.NEGATIVE_INFINITY;
|
|
105
|
+
};
|
|
106
|
+
this.resize = () => {
|
|
107
|
+
readDOM(() => {
|
|
108
|
+
if (this.backdropElement != null) {
|
|
109
|
+
const styles = getComputedStyle(this.backdropElement);
|
|
110
|
+
const boundaryPadding = parseFloat(styles.padding);
|
|
111
|
+
this.boundaryPadding = isNaN(boundaryPadding) ? 0 : boundaryPadding;
|
|
112
|
+
this.maxHeight = window.innerHeight - this.boundaryPadding * 2;
|
|
113
|
+
this.maxWidth = window.innerWidth - this.boundaryPadding * 2;
|
|
114
|
+
this.width =
|
|
115
|
+
this.width != null ? Math.min(this.maxWidth, this.width) : undefined;
|
|
116
|
+
this.height =
|
|
117
|
+
this.height != null
|
|
118
|
+
? Math.min(this.maxHeight, this.height)
|
|
119
|
+
: undefined;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
this.open = false;
|
|
124
|
+
this.fullscreen = false;
|
|
125
|
+
this.resizable = false;
|
|
126
|
+
this.width = undefined;
|
|
127
|
+
this.height = undefined;
|
|
128
|
+
this.minWidth = undefined;
|
|
129
|
+
this.minHeight = undefined;
|
|
130
|
+
this.maxWidth = undefined;
|
|
131
|
+
this.maxHeight = undefined;
|
|
132
|
+
this.isResizing = false;
|
|
133
|
+
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
134
|
+
this.mutationObserver = new MutationObserver(this.resize);
|
|
135
|
+
this.resizeObserver = new ResizeObserver(this.resize);
|
|
136
|
+
}
|
|
137
|
+
componentDidLoad() {
|
|
138
|
+
window.addEventListener('resize', this.resize);
|
|
139
|
+
this.mutationObserver.observe(this.hostEl, {
|
|
140
|
+
attributes: true,
|
|
141
|
+
attributeFilter: ['style'],
|
|
142
|
+
});
|
|
143
|
+
this.resizeObserver.observe(this.hostEl);
|
|
144
|
+
}
|
|
145
|
+
componentWillRender() {
|
|
146
|
+
if (this.open && this.width == null && this.height == null) {
|
|
147
|
+
readDOM(() => {
|
|
148
|
+
if (this.dialogElement != null) {
|
|
149
|
+
const boundingRect = getBoundingClientRect(this.dialogElement);
|
|
150
|
+
this.minWidth = boundingRect.width;
|
|
151
|
+
this.minHeight = boundingRect.height;
|
|
152
|
+
this.width = this.minWidth;
|
|
153
|
+
this.height = this.minHeight;
|
|
154
|
+
this.resize();
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
disconnectedCallback() {
|
|
160
|
+
this.width = undefined;
|
|
161
|
+
this.height = undefined;
|
|
162
|
+
this.lastPointerPosition = undefined;
|
|
163
|
+
this.isResizing = false;
|
|
164
|
+
}
|
|
165
|
+
clearComputedValues() {
|
|
166
|
+
this.width = undefined;
|
|
167
|
+
this.height = undefined;
|
|
168
|
+
this.minWidth = undefined;
|
|
169
|
+
this.minHeight = undefined;
|
|
170
|
+
this.maxWidth = undefined;
|
|
171
|
+
this.maxHeight = undefined;
|
|
172
|
+
}
|
|
173
|
+
updateOpened(open) {
|
|
174
|
+
if (!open) {
|
|
175
|
+
this.closed.emit();
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
keyDownListener(ev) {
|
|
179
|
+
if (this.open && ev.key === 'Escape') {
|
|
180
|
+
this.open = false;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
render() {
|
|
184
|
+
var _a, _b;
|
|
185
|
+
const width = this.width != null || this.minWidth != null
|
|
186
|
+
? `${(_a = this.width) !== null && _a !== void 0 ? _a : this.minWidth}px`
|
|
187
|
+
: undefined;
|
|
188
|
+
const height = this.height != null || this.minHeight != null
|
|
189
|
+
? `${(_b = this.height) !== null && _b !== void 0 ? _b : this.minHeight}px`
|
|
190
|
+
: undefined;
|
|
191
|
+
return (h("div", { ref: (el) => {
|
|
192
|
+
this.backdropElement = el;
|
|
193
|
+
}, onPointerDown: () => {
|
|
194
|
+
this.backdropClick.emit();
|
|
195
|
+
}, class: classnames('dialog-backdrop', {
|
|
196
|
+
hidden: !this.open,
|
|
197
|
+
shown: this.open,
|
|
198
|
+
'resize-cursor': this.isResizing,
|
|
199
|
+
}) }, h("div", { ref: (el) => {
|
|
200
|
+
this.dialogElement = el;
|
|
201
|
+
}, class: classnames('dialog', {
|
|
202
|
+
resizable: this.resizable,
|
|
203
|
+
fullscreen: this.fullscreen,
|
|
204
|
+
overlay: !this.fullscreen,
|
|
205
|
+
'no-select': this.lastPointerPosition != null,
|
|
206
|
+
}), onPointerDown: (e) => {
|
|
207
|
+
e.stopPropagation();
|
|
208
|
+
}, style: this.resizable && !this.fullscreen
|
|
209
|
+
? {
|
|
210
|
+
width,
|
|
211
|
+
height,
|
|
212
|
+
}
|
|
213
|
+
: undefined }, h("div", { class: "contents" }, h("slot", { name: "header" }, h("div", { class: "header" }, h("slot", { name: "heading" }), h("div", { class: "close" }, h("slot", { name: "close-dialog" }, h("vertex-icon-button", { onPointerDown: () => {
|
|
214
|
+
this.open = false;
|
|
215
|
+
}, iconSize: "sm", iconName: "close" }))))), h("div", { class: "body" }, h("slot", null)), h("div", { class: "footer" }, h("slot", { name: "footer" }, h("slot", { name: "footer-actions" }))), this.resizable && !this.fullscreen && (h("vertex-icon", { class: "resize", onPointerDown: this.handlePointerDown, name: "resize", size: "xs" }))))));
|
|
216
|
+
}
|
|
217
|
+
get hostEl() { return this; }
|
|
218
|
+
static get watchers() { return {
|
|
219
|
+
"resizable": ["clearComputedValues"],
|
|
220
|
+
"open": ["updateOpened"]
|
|
221
|
+
}; }
|
|
222
|
+
static get style() { return dialogCss; }
|
|
223
|
+
}, [1, "vertex-dialog", {
|
|
224
|
+
"open": [1540],
|
|
225
|
+
"fullscreen": [4],
|
|
226
|
+
"resizable": [4],
|
|
227
|
+
"width": [32],
|
|
228
|
+
"height": [32],
|
|
229
|
+
"minWidth": [32],
|
|
230
|
+
"minHeight": [32],
|
|
231
|
+
"maxWidth": [32],
|
|
232
|
+
"maxHeight": [32],
|
|
233
|
+
"isResizing": [32]
|
|
234
|
+
}, [[4, "keydown", "keyDownListener"]]]);
|
|
235
|
+
function defineCustomElement$1() {
|
|
236
|
+
if (typeof customElements === "undefined") {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
const components = ["vertex-dialog", "vertex-icon", "vertex-icon-button"];
|
|
240
|
+
components.forEach(tagName => { switch (tagName) {
|
|
241
|
+
case "vertex-dialog":
|
|
242
|
+
if (!customElements.get(tagName)) {
|
|
243
|
+
customElements.define(tagName, Dialog);
|
|
244
|
+
}
|
|
245
|
+
break;
|
|
246
|
+
case "vertex-icon":
|
|
247
|
+
if (!customElements.get(tagName)) {
|
|
248
|
+
defineCustomElement$3();
|
|
249
|
+
}
|
|
250
|
+
break;
|
|
251
|
+
case "vertex-icon-button":
|
|
252
|
+
if (!customElements.get(tagName)) {
|
|
253
|
+
defineCustomElement$2();
|
|
254
|
+
}
|
|
255
|
+
break;
|
|
256
|
+
} });
|
|
257
|
+
}
|
|
258
|
+
defineCustomElement$1();
|
|
259
|
+
|
|
260
|
+
const VertexDialog = Dialog;
|
|
261
|
+
const defineCustomElement = defineCustomElement$1;
|
|
262
|
+
|
|
263
|
+
export { Dialog as D, VertexDialog, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexDraggablePopover extends Components.VertexDraggablePopover, HTMLElement {}
|
|
4
|
+
export const VertexDraggablePopover: {
|
|
5
|
+
prototype: VertexDraggablePopover;
|
|
6
|
+
new (): VertexDraggablePopover;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, readTask, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as classnames } from './index2.js';
|
|
3
|
+
import { d as defineCustomElement$3 } from './icon.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './popover.js';
|
|
5
|
+
|
|
6
|
+
const draggablePopoverCss = "button{border:none;background-color:transparent;font-family:var(--vertex-ui-font-family);font-size:0.875rem;padding:0}:host{position:fixed;top:0;left:0;white-space:nowrap;--background-color:var(--vertex-ui-white);--color:var(--vertex-ui-neutral-700);--font-family:var(--vertex-ui-font-family);--font-size:var(--vertex-ui-text-base);--drag-icon:all-scroll;--dragging-icon:all-scroll}.container{display:flex;column-gap:0.5rem;padding:0.8125rem 0.5625rem 1rem 0.625rem;background-color:var(--background-color);opacity:0.95;border-radius:0.5rem;box-shadow:0 0 5px rgba(0, 0, 0, 0.25);color:var(--color);font-family:var(--font-family);font-size:var(--font-size)}.container:not(.dragging) .icon{cursor:var(--drag-icon)}.container.dragging{cursor:var(--dragging-icon)}.container.dragging *{user-select:none}.icon-container{display:flex;flex-direction:column}.icon-button{display:flex;align-items:center}";
|
|
7
|
+
|
|
8
|
+
const DraggablePopover = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
this.positionChanged = createEvent(this, "positionChanged", 7);
|
|
14
|
+
this.handlePointerDown = (event) => {
|
|
15
|
+
this.updateAnchorPosition();
|
|
16
|
+
this.lastPosition = { x: event.clientX, y: event.clientY };
|
|
17
|
+
this.dragging = true;
|
|
18
|
+
window.addEventListener('pointermove', this.handlePointerMove);
|
|
19
|
+
window.addEventListener('pointerup', this.handlePointerUp);
|
|
20
|
+
};
|
|
21
|
+
this.handlePointerMove = (event) => {
|
|
22
|
+
const currentPosition = {
|
|
23
|
+
x: event.clientX,
|
|
24
|
+
y: event.clientY,
|
|
25
|
+
};
|
|
26
|
+
const deltaX = currentPosition.x - this.lastPosition.x;
|
|
27
|
+
const deltaY = currentPosition.y - this.lastPosition.y;
|
|
28
|
+
this.anchorPosition = {
|
|
29
|
+
x: this.anchorPosition.x + deltaX,
|
|
30
|
+
y: this.anchorPosition.y + deltaY,
|
|
31
|
+
};
|
|
32
|
+
this.lastPosition = currentPosition;
|
|
33
|
+
};
|
|
34
|
+
this.handlePointerUp = (event) => {
|
|
35
|
+
this.updateAnchorPosition();
|
|
36
|
+
this.lastPosition = this.anchorPosition;
|
|
37
|
+
this.dragging = false;
|
|
38
|
+
window.removeEventListener('pointermove', this.handlePointerMove);
|
|
39
|
+
window.removeEventListener('pointerup', this.handlePointerUp);
|
|
40
|
+
};
|
|
41
|
+
this.updateAnchorPosition = () => {
|
|
42
|
+
readTask(() => {
|
|
43
|
+
if (this.containerEl != null) {
|
|
44
|
+
const rect = this.containerEl.getBoundingClientRect();
|
|
45
|
+
this.anchorPosition = { x: rect.x, y: rect.y };
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
this.position = undefined;
|
|
50
|
+
this.boundarySelector = undefined;
|
|
51
|
+
this.boundaryPadding = undefined;
|
|
52
|
+
this.anchorPosition = { x: 0, y: 0 };
|
|
53
|
+
this.lastPosition = { x: 0, y: 0 };
|
|
54
|
+
this.dragging = false;
|
|
55
|
+
}
|
|
56
|
+
connectedCallback() {
|
|
57
|
+
this.updatePosition(this.position);
|
|
58
|
+
}
|
|
59
|
+
updatePosition(position) {
|
|
60
|
+
if (position != null) {
|
|
61
|
+
this.anchorPosition =
|
|
62
|
+
typeof position === 'object' ? position : JSON.parse(position);
|
|
63
|
+
this.lastPosition = this.anchorPosition;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
lastPositionChanged() {
|
|
67
|
+
this.positionChanged.emit(this.anchorPosition);
|
|
68
|
+
}
|
|
69
|
+
render() {
|
|
70
|
+
return (h("vertex-popover", { position: this.anchorPosition, boundarySelector: this.boundarySelector, backdrop: false, open: true, resizeBehavior: "fixed", updateOnResize: !this.dragging, overflowBehavior: {
|
|
71
|
+
altBoundary: true,
|
|
72
|
+
padding: this.boundaryPadding,
|
|
73
|
+
}, flipBehavior: {
|
|
74
|
+
fallbackPlacements: [],
|
|
75
|
+
fallbackStrategy: 'initialPlacement',
|
|
76
|
+
} }, h("div", { ref: (el) => (this.containerEl = el), class: classnames('container', { dragging: this.dragging }) }, h("div", { class: "icon-container" }, h("div", { class: "icon", onPointerDown: this.handlePointerDown }, h("slot", { name: "drag-icon" }, h("vertex-icon", { size: "sm", name: "drag-indicator" })))), h("slot", null))));
|
|
77
|
+
}
|
|
78
|
+
static get watchers() { return {
|
|
79
|
+
"position": ["updatePosition"],
|
|
80
|
+
"lastPosition": ["lastPositionChanged"]
|
|
81
|
+
}; }
|
|
82
|
+
static get style() { return draggablePopoverCss; }
|
|
83
|
+
}, [1, "vertex-draggable-popover", {
|
|
84
|
+
"position": [1],
|
|
85
|
+
"boundarySelector": [1, "boundary-selector"],
|
|
86
|
+
"boundaryPadding": [2, "boundary-padding"],
|
|
87
|
+
"anchorPosition": [32],
|
|
88
|
+
"lastPosition": [32],
|
|
89
|
+
"dragging": [32]
|
|
90
|
+
}]);
|
|
91
|
+
function defineCustomElement$1() {
|
|
92
|
+
if (typeof customElements === "undefined") {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const components = ["vertex-draggable-popover", "vertex-icon", "vertex-popover"];
|
|
96
|
+
components.forEach(tagName => { switch (tagName) {
|
|
97
|
+
case "vertex-draggable-popover":
|
|
98
|
+
if (!customElements.get(tagName)) {
|
|
99
|
+
customElements.define(tagName, DraggablePopover);
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
case "vertex-icon":
|
|
103
|
+
if (!customElements.get(tagName)) {
|
|
104
|
+
defineCustomElement$3();
|
|
105
|
+
}
|
|
106
|
+
break;
|
|
107
|
+
case "vertex-popover":
|
|
108
|
+
if (!customElements.get(tagName)) {
|
|
109
|
+
defineCustomElement$2();
|
|
110
|
+
}
|
|
111
|
+
break;
|
|
112
|
+
} });
|
|
113
|
+
}
|
|
114
|
+
defineCustomElement$1();
|
|
115
|
+
|
|
116
|
+
const VertexDraggablePopover = DraggablePopover;
|
|
117
|
+
const defineCustomElement = defineCustomElement$1;
|
|
118
|
+
|
|
119
|
+
export { DraggablePopover as D, VertexDraggablePopover, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexDropdownMenu extends Components.VertexDropdownMenu, HTMLElement {}
|
|
4
|
+
export const VertexDropdownMenu: {
|
|
5
|
+
prototype: VertexDropdownMenu;
|
|
6
|
+
new (): VertexDropdownMenu;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$3 } from './menu.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './popover.js';
|
|
4
|
+
|
|
5
|
+
const DropdownMenu = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.menuOpened = createEvent(this, "menuOpened", 7);
|
|
11
|
+
this.menuClosed = createEvent(this, "menuClosed", 7);
|
|
12
|
+
this.animated = true;
|
|
13
|
+
this.placement = 'bottom-end';
|
|
14
|
+
this.open = false;
|
|
15
|
+
this.handleClick = this.handleClick.bind(this);
|
|
16
|
+
this.handleMenuClosed = this.handleMenuClosed.bind(this);
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (h("vertex-menu", { open: this.open, animated: this.animated, placement: this.placement, onMenuClosed: this.handleMenuClosed }, h("div", { slot: "anchor", onClick: this.handleClick }, h("slot", { name: "anchor" })), h("div", { slot: "header" }, h("slot", { name: "header" })), h("slot", null)));
|
|
20
|
+
}
|
|
21
|
+
handleClick(e) {
|
|
22
|
+
if (!this.open) {
|
|
23
|
+
this.open = true;
|
|
24
|
+
this.menuOpened.emit(e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
handleMenuClosed() {
|
|
28
|
+
this.open = false;
|
|
29
|
+
this.menuClosed.emit();
|
|
30
|
+
}
|
|
31
|
+
}, [1, "vertex-dropdown-menu", {
|
|
32
|
+
"animated": [4],
|
|
33
|
+
"placement": [1],
|
|
34
|
+
"open": [32]
|
|
35
|
+
}]);
|
|
36
|
+
function defineCustomElement$1() {
|
|
37
|
+
if (typeof customElements === "undefined") {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const components = ["vertex-dropdown-menu", "vertex-menu", "vertex-popover"];
|
|
41
|
+
components.forEach(tagName => { switch (tagName) {
|
|
42
|
+
case "vertex-dropdown-menu":
|
|
43
|
+
if (!customElements.get(tagName)) {
|
|
44
|
+
customElements.define(tagName, DropdownMenu);
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
case "vertex-menu":
|
|
48
|
+
if (!customElements.get(tagName)) {
|
|
49
|
+
defineCustomElement$3();
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
case "vertex-popover":
|
|
53
|
+
if (!customElements.get(tagName)) {
|
|
54
|
+
defineCustomElement$2();
|
|
55
|
+
}
|
|
56
|
+
break;
|
|
57
|
+
} });
|
|
58
|
+
}
|
|
59
|
+
defineCustomElement$1();
|
|
60
|
+
|
|
61
|
+
const VertexDropdownMenu = DropdownMenu;
|
|
62
|
+
const defineCustomElement = defineCustomElement$1;
|
|
63
|
+
|
|
64
|
+
export { DropdownMenu as D, VertexDropdownMenu, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexExpandable extends Components.VertexExpandable, HTMLElement {}
|
|
4
|
+
export const VertexExpandable: {
|
|
5
|
+
prototype: VertexExpandable;
|
|
6
|
+
new (): VertexExpandable;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexHelpTooltip extends Components.VertexHelpTooltip, HTMLElement {}
|
|
4
|
+
export const VertexHelpTooltip: {
|
|
5
|
+
prototype: VertexHelpTooltip;
|
|
6
|
+
new (): VertexHelpTooltip;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$3 } from './menu.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './popover.js';
|
|
4
|
+
|
|
5
|
+
const helpTooltipCss = ".root{margin:var(--padding-4)}.header{margin-bottom:var(--padding-2);font-size:0.95em;font-weight:normal;color:var(--neutral-800)}.body,.learn-more{width:225px;font-size:0.85em;color:var(--neutral-700);line-height:1.2em}.learn-more{margin-top:var(--padding-4);color:var(--blue-700);text-align:right}";
|
|
6
|
+
|
|
7
|
+
const HelpTooltip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.menuOpened = createEvent(this, "menuOpened", 7);
|
|
13
|
+
this.menuClosed = createEvent(this, "menuClosed", 7);
|
|
14
|
+
this.animated = true;
|
|
15
|
+
this.placement = 'bottom-end';
|
|
16
|
+
this.open = false;
|
|
17
|
+
this.handleClick = this.handleClick.bind(this);
|
|
18
|
+
this.handleMenuClosed = this.handleMenuClosed.bind(this);
|
|
19
|
+
}
|
|
20
|
+
render() {
|
|
21
|
+
return (h("vertex-menu", { open: this.open, animated: this.animated, placement: this.placement, onMenuClosed: this.handleMenuClosed }, h("div", { slot: "anchor", onClick: this.handleClick }, h("slot", { name: "anchor" })), h("div", { class: "root" }, h("div", { slot: "header", class: "header" }, h("slot", { name: "header" })), h("div", { class: "body" }, h("slot", { name: "body" })), h("div", { class: "learn-more" }, h("slot", { name: "learnMore" })))));
|
|
22
|
+
}
|
|
23
|
+
handleClick(e) {
|
|
24
|
+
if (!this.open) {
|
|
25
|
+
this.open = true;
|
|
26
|
+
this.menuOpened.emit(e);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
handleMenuClosed() {
|
|
30
|
+
this.open = false;
|
|
31
|
+
this.menuClosed.emit();
|
|
32
|
+
}
|
|
33
|
+
static get style() { return helpTooltipCss; }
|
|
34
|
+
}, [1, "vertex-help-tooltip", {
|
|
35
|
+
"animated": [4],
|
|
36
|
+
"placement": [1],
|
|
37
|
+
"open": [32]
|
|
38
|
+
}]);
|
|
39
|
+
function defineCustomElement$1() {
|
|
40
|
+
if (typeof customElements === "undefined") {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
const components = ["vertex-help-tooltip", "vertex-menu", "vertex-popover"];
|
|
44
|
+
components.forEach(tagName => { switch (tagName) {
|
|
45
|
+
case "vertex-help-tooltip":
|
|
46
|
+
if (!customElements.get(tagName)) {
|
|
47
|
+
customElements.define(tagName, HelpTooltip);
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
case "vertex-menu":
|
|
51
|
+
if (!customElements.get(tagName)) {
|
|
52
|
+
defineCustomElement$3();
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
case "vertex-popover":
|
|
56
|
+
if (!customElements.get(tagName)) {
|
|
57
|
+
defineCustomElement$2();
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
} });
|
|
61
|
+
}
|
|
62
|
+
defineCustomElement$1();
|
|
63
|
+
|
|
64
|
+
const VertexHelpTooltip = HelpTooltip;
|
|
65
|
+
const defineCustomElement = defineCustomElement$1;
|
|
66
|
+
|
|
67
|
+
export { HelpTooltip as H, VertexHelpTooltip, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexIconButton extends Components.VertexIconButton, HTMLElement {}
|
|
4
|
+
export const VertexIconButton: {
|
|
5
|
+
prototype: VertexIconButton;
|
|
6
|
+
new (): VertexIconButton;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexIcon extends Components.VertexIcon, HTMLElement {}
|
|
4
|
+
export const VertexIcon: {
|
|
5
|
+
prototype: VertexIcon;
|
|
6
|
+
new (): VertexIcon;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexLogoLoading extends Components.VertexLogoLoading, HTMLElement {}
|
|
4
|
+
export const VertexLogoLoading: {
|
|
5
|
+
prototype: VertexLogoLoading;
|
|
6
|
+
new (): VertexLogoLoading;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const logoLoadingCss = "@keyframes color-loading{0%{transform:translate(30px, -50px)}10%{transform:translateY(0)}70%{opacity:1}75%,100%{opacity:0}}@keyframes center-loading{0%{transform:translate(-30px, 50px)}10%{transform:translate(0, 0)}70%{opacity:1}75%,100%{opacity:0}}.container{width:100%;height:100%}.visual-center{transform:translateX(7%)}.color-loading-fill{animation:color-loading 2.5s infinite linear}.center-loading-fill{animation:center-loading 2.5s infinite linear}";
|
|
4
|
+
|
|
5
|
+
const LogoLoading = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
return (h("div", { class: "container" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100%", height: "100%", viewBox: "0 0 100 100" }, h("defs", null, h("mask", { id: "orange-loading-diamond" }, h("polygon", { points: "70.75 50.7 57.09 74.45 84.32 74.42 98 50.66 70.75 50.7", fill: "#fff", class: "color-loading-fill" })), h("mask", { id: "blue-loading-diamond" }, h("polygon", { points: "16.05 98.04 2.43 74.44 16.06 50.78 29.68 74.44 16.05 98.04", fill: "#fff", class: "color-loading-fill" })), h("mask", { id: "green-loading-diamond" }, h("polygon", { points: "16.05 3.53 2.43 27.13 16.06 50.78 29.68 27.12 16.05 3.53", fill: "#fff", class: "color-loading-fill" })), h("mask", { id: "left-center-loading-diamond" }, h("polygon", { points: "29.68 27.18 16.06 50.78 29.69 74.44 43.31 50.78 29.68 27.18", fill: "#fff", class: "center-loading-fill" })), h("mask", { id: "right-center-loading-diamond" }, h("polygon", { points: "43.31 50.78 29.68 74.46 57.09 74.45 70.75 50.7 43.31 50.78", fill: "#fff", class: "center-loading-fill" }))), h("polyline", { points: "57.09 27.11 70.75 50.7 70.67 50.84 57.09 74.45 84.32 74.42 98 50.66 84.34 27.08 57.09 27.11", fill: "#f90" }), h("polyline", { mask: "url(#orange-loading-diamond)", points: "70.75 50.7 57.09 74.45 84.32 74.42 98 50.66 70.75 50.7", fill: "#d37f00" }), h("polygon", { points: "29.68 74.44 57.09 74.45 43.46 98.05 16.05 98.04 2.43 74.44 16.06 50.78 29.68 74.44", fill: "#09c" }), h("polygon", { mask: "url(#blue-loading-diamond)", points: "16.05 98.04 2.43 74.44 16.06 50.78 29.68 74.44 16.05 98.04", fill: "#007fa9" }), h("polygon", { points: "29.68 27.12 57.09 27.11 43.46 3.52 16.05 3.53 2.43 27.13 16.06 50.78 29.68 27.12", fill: "#00b600" }), h("polygon", { mask: "url(#green-loading-diamond)", points: "16.05 3.53 2.43 27.13 16.06 50.78 29.68 27.12 16.05 3.53", fill: "#009700" }), h("polygon", { mask: "url(#left-center-loading-diamond)", points: "29.68 27.18 16.06 50.78 29.69 74.44 43.31 50.78 29.68 27.18", fill: "#bdbdbd" }), h("polygon", { mask: "url(#right-center-loading-diamond)", points: "43.31 50.78 29.68 74.46 57.09 74.45 70.75 50.7 43.31 50.78", fill: "#e0e0e0" }))));
|
|
13
|
+
}
|
|
14
|
+
static get style() { return logoLoadingCss; }
|
|
15
|
+
}, [1, "vertex-logo-loading"]);
|
|
16
|
+
function defineCustomElement$1() {
|
|
17
|
+
if (typeof customElements === "undefined") {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const components = ["vertex-logo-loading"];
|
|
21
|
+
components.forEach(tagName => { switch (tagName) {
|
|
22
|
+
case "vertex-logo-loading":
|
|
23
|
+
if (!customElements.get(tagName)) {
|
|
24
|
+
customElements.define(tagName, LogoLoading);
|
|
25
|
+
}
|
|
26
|
+
break;
|
|
27
|
+
} });
|
|
28
|
+
}
|
|
29
|
+
defineCustomElement$1();
|
|
30
|
+
|
|
31
|
+
const VertexLogoLoading = LogoLoading;
|
|
32
|
+
const defineCustomElement = defineCustomElement$1;
|
|
33
|
+
|
|
34
|
+
export { LogoLoading as L, VertexLogoLoading, defineCustomElement };
|