@vertexvis/ui 0.1.2-canary.0 → 0.1.2-canary.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/cjs/index.cjs.js +3 -3
- package/dist/cjs/{menu-d1ecf43b.js → menu-25f83cd7.js} +13 -3
- package/dist/cjs/{resizable-e4248256.js → resizable-c0a69532.js} +22 -4
- package/dist/cjs/vertex-menu.cjs.entry.js +1 -1
- package/dist/cjs/vertex-resizable.cjs.entry.js +2 -1
- package/dist/collection/components/menu/menu.js +13 -3
- package/dist/collection/components/resizable/resizable.js +23 -5
- package/dist/components/auto-resize-textarea.js +157 -0
- package/dist/components/color-swatch.js +124 -0
- package/dist/components/components.esm.js +1 -1
- 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.esm.js +1 -1
- package/dist/components/index.js +52 -0
- package/dist/components/index2.js +89 -0
- package/dist/components/menu.js +99 -0
- package/dist/components/p-1b85c1d1.entry.js +1 -0
- package/dist/components/p-95358d00.entry.js +1 -0
- package/dist/components/p-c9a967d9.js +1 -0
- package/dist/components/p-ee5c8bd3.js +1 -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 +463 -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/dist/esm/index.js +3 -3
- package/dist/esm/{menu-daa7f9c9.js → menu-b8ff7d6a.js} +13 -3
- package/dist/esm/{resizable-a147709b.js → resizable-833336bf.js} +23 -5
- package/dist/esm/vertex-menu.entry.js +1 -1
- package/dist/esm/vertex-resizable.entry.js +2 -1
- package/dist/types/components/menu/menu.d.ts +2 -0
- package/dist/types/components/resizable/resizable.d.ts +1 -0
- package/package.json +2 -2
- package/dist/components/p-0517ca62.entry.js +0 -1
- package/dist/components/p-6ec189d2.js +0 -1
- package/dist/components/p-7b75e004.js +0 -1
- package/dist/components/p-ea4a2f74.entry.js +0 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { 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-button.js';
|
|
4
|
+
import { d as defineCustomElement$2 } from './popover.js';
|
|
5
|
+
|
|
6
|
+
const toastCss = ":host{--toast-width:auto;--toast-min-width:17rem;--toast-max-width:25rem;--toast-white-space:normal}.anchor{position:fixed}.bottom-left{left:1rem;bottom:1rem}.bottom{left:50vw;bottom:1rem}.bottom-right{right:1rem;bottom:1rem}.top-left{left:1rem;top:1rem}.top{left:50vw;top:1rem}.top-right{right:1rem;top:1rem}.popover{position:fixed;--open-animation-name:open-fade-in;--close-animation-name:close-fade-out}.actions{display:flex;align-items:center;margin-left:auto}.close{cursor:pointer;padding-left:1rem}.close:hover{color:var(--vertex-ui-neutral-300)}.toast{position:relative;display:flex;align-items:center;width:var(--toast-width);min-width:var(--toast-min-width);max-width:var(--toast-max-width);padding:1rem 1rem 1rem 1.5rem;font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-base);background-color:var(--vertex-ui-neutral-800);color:var(--vertex-ui-white);border-radius:4px;white-space:var(--toast-white-space);user-select:none}.toast.hidden{pointer-events:none}.warn{background-color:var(--vertex-ui-orange-100);color:var(--vertex-ui-neutral-800)}.error{background-color:var(--vertex-ui-red-700);color:white}";
|
|
7
|
+
|
|
8
|
+
const DEFAULT_TOAST_DURATION = 3000;
|
|
9
|
+
const Toast = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
this.closed = createEvent(this, "closed", 7);
|
|
15
|
+
this.content = undefined;
|
|
16
|
+
this.placement = 'bottom-left';
|
|
17
|
+
this.duration = DEFAULT_TOAST_DURATION;
|
|
18
|
+
this.animated = true;
|
|
19
|
+
this.open = false;
|
|
20
|
+
this.type = 'info';
|
|
21
|
+
this.isOpen = undefined;
|
|
22
|
+
this.handleClose = this.handleClose.bind(this);
|
|
23
|
+
this.startCloseTimeout = this.startCloseTimeout.bind(this);
|
|
24
|
+
this.clearCloseTimeout = this.clearCloseTimeout.bind(this);
|
|
25
|
+
this.restartCloseTimeout = this.restartCloseTimeout.bind(this);
|
|
26
|
+
}
|
|
27
|
+
componentDidLoad() {
|
|
28
|
+
// This allows the component to render once initially to correctly
|
|
29
|
+
// place the popover anchor.
|
|
30
|
+
this.isOpen = this.open;
|
|
31
|
+
if (this.isOpen) {
|
|
32
|
+
this.restartCloseTimeout();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async handleOpenChanged(open) {
|
|
36
|
+
if (open) {
|
|
37
|
+
this.restartCloseTimeout();
|
|
38
|
+
this.isOpen = open;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
return (h("vertex-popover", { class: "popover", open: this.isOpen, resizeBehavior: "fixed", backdrop: false, placement: this.getPopoverPlacement(), animated: this.animated }, h("div", { slot: "anchor", class: classnames('anchor', this.placement) }), h("div", { class: classnames('toast', {
|
|
43
|
+
hidden: !this.isOpen,
|
|
44
|
+
warn: this.type === 'warn',
|
|
45
|
+
error: this.type === 'error',
|
|
46
|
+
}) }, this.content ? h("div", { class: "content" }, this.content) : h("slot", null), h("div", { class: "actions" }, h("slot", { name: "action" }), h("vertex-icon-button", { class: "close", iconName: "close", iconSize: "sm", variant: "plain", onClick: this.handleClose })))));
|
|
47
|
+
}
|
|
48
|
+
handleClose() {
|
|
49
|
+
this.clearCloseTimeout();
|
|
50
|
+
this.isOpen = false;
|
|
51
|
+
this.closed.emit();
|
|
52
|
+
}
|
|
53
|
+
startCloseTimeout() {
|
|
54
|
+
if (this.closeTimeout == null && this.duration > 0) {
|
|
55
|
+
this.closeTimeout = setTimeout(() => {
|
|
56
|
+
this.handleClose();
|
|
57
|
+
}, this.duration);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
clearCloseTimeout() {
|
|
61
|
+
if (this.closeTimeout != null) {
|
|
62
|
+
clearTimeout(this.closeTimeout);
|
|
63
|
+
this.closeTimeout = undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
restartCloseTimeout() {
|
|
67
|
+
this.clearCloseTimeout();
|
|
68
|
+
this.startCloseTimeout();
|
|
69
|
+
}
|
|
70
|
+
getPopoverPlacement() {
|
|
71
|
+
switch (this.placement) {
|
|
72
|
+
case 'bottom-left':
|
|
73
|
+
return 'top-start';
|
|
74
|
+
case 'bottom':
|
|
75
|
+
return 'top';
|
|
76
|
+
case 'bottom-right':
|
|
77
|
+
return 'top-end';
|
|
78
|
+
case 'top-left':
|
|
79
|
+
return 'bottom-start';
|
|
80
|
+
case 'top':
|
|
81
|
+
return 'bottom';
|
|
82
|
+
case 'top-right':
|
|
83
|
+
return 'bottom-end';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
static get watchers() { return {
|
|
87
|
+
"open": ["handleOpenChanged"]
|
|
88
|
+
}; }
|
|
89
|
+
static get style() { return toastCss; }
|
|
90
|
+
}, [1, "vertex-toast", {
|
|
91
|
+
"content": [1],
|
|
92
|
+
"placement": [1],
|
|
93
|
+
"duration": [2],
|
|
94
|
+
"animated": [4],
|
|
95
|
+
"open": [4],
|
|
96
|
+
"type": [1],
|
|
97
|
+
"isOpen": [32]
|
|
98
|
+
}]);
|
|
99
|
+
function defineCustomElement$1() {
|
|
100
|
+
if (typeof customElements === "undefined") {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const components = ["vertex-toast", "vertex-icon-button", "vertex-popover"];
|
|
104
|
+
components.forEach(tagName => { switch (tagName) {
|
|
105
|
+
case "vertex-toast":
|
|
106
|
+
if (!customElements.get(tagName)) {
|
|
107
|
+
customElements.define(tagName, Toast);
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
case "vertex-icon-button":
|
|
111
|
+
if (!customElements.get(tagName)) {
|
|
112
|
+
defineCustomElement$3();
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
case "vertex-popover":
|
|
116
|
+
if (!customElements.get(tagName)) {
|
|
117
|
+
defineCustomElement$2();
|
|
118
|
+
}
|
|
119
|
+
break;
|
|
120
|
+
} });
|
|
121
|
+
}
|
|
122
|
+
defineCustomElement$1();
|
|
123
|
+
|
|
124
|
+
const VertexToast = Toast;
|
|
125
|
+
const defineCustomElement = defineCustomElement$1;
|
|
126
|
+
|
|
127
|
+
export { Toast as T, VertexToast, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexToggle extends Components.VertexToggle, HTMLElement {}
|
|
4
|
+
export const VertexToggle: {
|
|
5
|
+
prototype: VertexToggle;
|
|
6
|
+
new (): VertexToggle;
|
|
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 { c as classnames } from './index2.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './icon.js';
|
|
4
|
+
|
|
5
|
+
const toggleCss = "button{border:none;background-color:transparent;font-family:var(--vertex-ui-font-family);font-size:0.875rem;padding:0}:host{display:flex}.check{border:1px solid var(--vertex-ui-neutral-400);box-shadow:0 0 2px var(--vertex-ui-neutral-400);border-radius:4px;width:1rem;height:1rem;padding:0}.check:not(.disabled){cursor:pointer}.check.disabled{border:1px solid var(--vertex-ui-neutral-200);box-shadow:0 0 2px var(--vertex-ui-neutral-200)}.check:focus-visible:not(.disabled){outline:none;border:1px solid var(--vertex-ui-neutral-600);box-shadow:0 0 2px var(--vertex-ui-neutral-600)}.check:focus-visible:not(.disabled)>.checked-content.checked{background-color:var(--vertex-ui-blue-800);box-shadow:0 0 2px var(--vertex-ui-blue-800)}.check:hover:not(.disabled){border:1px solid var(--vertex-ui-neutral-500);box-shadow:0 0 2px var(--vertex-ui-neutral-500)}.check.checked:not(.disabled){border:none;box-shadow:none}.check:hover:not(.disabled)>.checked-content.checked{background-color:var(--vertex-ui-blue-500);box-shadow:0 0 2px var(--vertex-ui-blue-500)}.checked-content{width:100%;height:100%;border-radius:4px}.checked-content.disabled{background-color:var(--vertex-ui-neutral-050);color:var(--vertex-ui-neutral-500)}.checked-content.checked:not(.disabled){background-color:var(--vertex-ui-blue-700);box-shadow:0 0 2px var(--vertex-ui-blue-700);color:var(--vertex-ui-white)}.switch{position:relative;width:2.25rem;height:1.25rem;padding:0;display:inline-block}.switch:not(.disabled){cursor:pointer}.track{position:absolute;top:0;background-color:var(--vertex-ui-neutral-300);width:2rem;padding:0 0.125rem;margin:0.1875rem 0;height:0.875rem;border-radius:7rem}.track.disabled{background-color:var(--vertex-ui-neutral-200)}.track.disabled.checked{background-color:var(--vertex-ui-blue-200)}.handle{position:absolute;top:0;left:0;background-color:var(--vertex-ui-neutral-100);box-shadow:-1px 1px rgba(0, 0, 0, 0.15);width:1.25rem;height:1.25rem;border-radius:100%;display:flex;transition:left 0.25s}.handle.disabled{box-shadow:none}.track:not(.disabled).checked{background-color:var(--vertex-ui-blue-300)}.handle.checked{left:1rem}.handle.checked:not(.disabled){background-color:var(--vertex-ui-blue-600)}.handle.checked.disabled{background-color:var(--vertex-ui-blue-300)}";
|
|
6
|
+
|
|
7
|
+
const Toggle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
this.__registerHost();
|
|
11
|
+
this.__attachShadow();
|
|
12
|
+
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
13
|
+
this.variant = 'check';
|
|
14
|
+
this.disabled = false;
|
|
15
|
+
this.checked = false;
|
|
16
|
+
}
|
|
17
|
+
render() {
|
|
18
|
+
const flipValue = () => {
|
|
19
|
+
if (!this.disabled) {
|
|
20
|
+
this.checked = !this.checked;
|
|
21
|
+
this.valueChanged.emit(this.checked);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
return (h("button", { class: classnames(this.variant, {
|
|
25
|
+
checked: this.checked,
|
|
26
|
+
disabled: this.disabled,
|
|
27
|
+
}), onClick: flipValue, onSubmit: flipValue }, this.variant === 'check' && (h("div", { class: classnames('checked-content', {
|
|
28
|
+
checked: this.checked,
|
|
29
|
+
disabled: this.disabled,
|
|
30
|
+
}) }, this.checked && h("vertex-icon", { name: "check", size: "md" }))), this.variant === 'switch' && (h("div", { class: classnames('track', {
|
|
31
|
+
disabled: this.disabled,
|
|
32
|
+
checked: this.checked,
|
|
33
|
+
}) })), this.variant === 'switch' && (h("div", { class: classnames('handle', {
|
|
34
|
+
disabled: this.disabled,
|
|
35
|
+
checked: this.checked,
|
|
36
|
+
}) }))));
|
|
37
|
+
}
|
|
38
|
+
static get style() { return toggleCss; }
|
|
39
|
+
}, [1, "vertex-toggle", {
|
|
40
|
+
"variant": [1],
|
|
41
|
+
"disabled": [4],
|
|
42
|
+
"checked": [1540]
|
|
43
|
+
}]);
|
|
44
|
+
function defineCustomElement$1() {
|
|
45
|
+
if (typeof customElements === "undefined") {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const components = ["vertex-toggle", "vertex-icon"];
|
|
49
|
+
components.forEach(tagName => { switch (tagName) {
|
|
50
|
+
case "vertex-toggle":
|
|
51
|
+
if (!customElements.get(tagName)) {
|
|
52
|
+
customElements.define(tagName, Toggle);
|
|
53
|
+
}
|
|
54
|
+
break;
|
|
55
|
+
case "vertex-icon":
|
|
56
|
+
if (!customElements.get(tagName)) {
|
|
57
|
+
defineCustomElement$2();
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
} });
|
|
61
|
+
}
|
|
62
|
+
defineCustomElement$1();
|
|
63
|
+
|
|
64
|
+
const VertexToggle = Toggle;
|
|
65
|
+
const defineCustomElement = defineCustomElement$1;
|
|
66
|
+
|
|
67
|
+
export { Toggle as T, VertexToggle, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexTooltip extends Components.VertexTooltip, HTMLElement {}
|
|
4
|
+
export const VertexTooltip: {
|
|
5
|
+
prototype: VertexTooltip;
|
|
6
|
+
new (): VertexTooltip;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
package/dist/esm/index.js
CHANGED
|
@@ -21,13 +21,13 @@ export { H as HelpTooltip } from './help-tooltip-c2f0d996.js';
|
|
|
21
21
|
export { I as Icon } from './icon-a74a8129.js';
|
|
22
22
|
export { I as IconButton } from './icon-button-33aa27cb.js';
|
|
23
23
|
export { L as LogoLoading } from './logo-loading-3c7fa23d.js';
|
|
24
|
-
export { M as Menu } from './menu-
|
|
24
|
+
export { M as Menu } from './menu-b8ff7d6a.js';
|
|
25
25
|
export { M as MenuDivider } from './menu-divider-87c888cb.js';
|
|
26
26
|
export { M as MenuItem } from './menu-item-c33aa9dd.js';
|
|
27
27
|
export { P as Popover } from './popover-6e806354.js';
|
|
28
28
|
export { R as Radio } from './radio-39c11ba4.js';
|
|
29
29
|
export { R as RadioGroup } from './radio-group-7c35d2f0.js';
|
|
30
|
-
export { R as Resizable } from './resizable-
|
|
30
|
+
export { R as Resizable } from './resizable-833336bf.js';
|
|
31
31
|
export { R as ResultList } from './result-list-16c6afbd.js';
|
|
32
32
|
export { S as SearchBar } from './search-bar-8d18626e.js';
|
|
33
33
|
export { S as Select } from './select-78aeff96.js';
|
|
@@ -44,6 +44,6 @@ import './slots-fbb5afb3.js';
|
|
|
44
44
|
import './index-9c609209.js';
|
|
45
45
|
import './icon-helper-2f57104b.js';
|
|
46
46
|
import './lib-73fbca8b.js';
|
|
47
|
+
import './dom-9d0f7bf4.js';
|
|
47
48
|
import './templates-797420bf.js';
|
|
48
49
|
import './tslib.es6-99cd0de8.js';
|
|
49
|
-
import './dom-9d0f7bf4.js';
|
|
@@ -26,6 +26,9 @@ const Menu = class {
|
|
|
26
26
|
disconnectedCallback() {
|
|
27
27
|
this.removeEventListeners();
|
|
28
28
|
}
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
this.addEventListeners();
|
|
31
|
+
}
|
|
29
32
|
render() {
|
|
30
33
|
return (h("vertex-popover", Object.assign({ ref: (element) => {
|
|
31
34
|
this.popoverRef = element;
|
|
@@ -41,12 +44,19 @@ const Menu = class {
|
|
|
41
44
|
}) }, h("slot", { name: "header" }), h("slot", null))));
|
|
42
45
|
}
|
|
43
46
|
addEventListeners() {
|
|
44
|
-
var _a;
|
|
45
|
-
(_a = this.
|
|
47
|
+
var _a, _b;
|
|
48
|
+
(_a = this.listenerDisposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
49
|
+
(_b = this.popoverRef) === null || _b === void 0 ? void 0 : _b.addEventListener('dismissed', this.handlePopoverDismiss);
|
|
50
|
+
this.listenerDisposable = {
|
|
51
|
+
dispose: () => {
|
|
52
|
+
var _a;
|
|
53
|
+
(_a = this.popoverRef) === null || _a === void 0 ? void 0 : _a.removeEventListener('dismissed', this.handlePopoverDismiss);
|
|
54
|
+
},
|
|
55
|
+
};
|
|
46
56
|
}
|
|
47
57
|
removeEventListeners() {
|
|
48
58
|
var _a;
|
|
49
|
-
(_a = this.
|
|
59
|
+
(_a = this.listenerDisposable) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
50
60
|
}
|
|
51
61
|
handlePopoverDismiss() {
|
|
52
62
|
this.open = false;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, H as Host,
|
|
1
|
+
import { r as registerInstance, e as createEvent, h, H as Host, g as getElement } from './index-72f28b71.js';
|
|
2
2
|
import { c as classnames } from './index-9c609209.js';
|
|
3
|
+
import { r as readDOM } from './dom-9d0f7bf4.js';
|
|
3
4
|
|
|
4
5
|
const resizableCss = ":host{--hover-shadow-color:var(--vertex-ui-blue-500);--vertical-handle-size:1rem;--vertical-handle-offset:-0.9rem;--horizontal-handle-size:1rem;--horizontal-handle-offset:-0.9rem;--side-direction-handle-z-index:var(--vertex-ui-popover-layer);--corner-handle-z-index:var(--vertex-ui-context-menu-layer)}:host(:not([dimensions-computed=\"\"])){position:absolute;display:none}.container{position:relative;height:100%;width:100%}.container.hidden{position:absolute;visibility:hidden}.shadow{pointer-events:none;position:absolute;width:100%;height:100%;z-index:var(--vertex-ui-popover-layer)}.shadow.hovered-location-left{box-shadow:inset 1px 0 0 var(--hover-shadow-color)}.shadow.hovered-location-right{box-shadow:inset -1px 0 0 var(--hover-shadow-color)}.shadow.hovered-location-top{box-shadow:inset 0 1px 0 var(--hover-shadow-color)}.shadow.hovered-location-bottom{box-shadow:inset 0 -1px 0 var(--hover-shadow-color)}.shadow.hovered-location-bottom-left{box-shadow:inset 1px -1px 0 var(--hover-shadow-color)}.shadow.hovered-location-bottom-right{box-shadow:inset -1px -1px 0 var(--hover-shadow-color)}.shadow.hovered-location-top-left{box-shadow:inset 1px 1px 0 var(--hover-shadow-color)}.shadow.hovered-location-top-right{box-shadow:inset -1px 1px 0 var(--hover-shadow-color)}.handle{position:absolute;visibility:hidden;z-index:var(--side-direction-handle-z-index)}.corner-handle{z-index:var(--corner-handle-z-index)}.left-handle.horizontal-direction-left,.left-handle.horizontal-direction-both{visibility:visible;left:var(--horizontal-handle-offset);top:0;height:100%;width:var(--horizontal-handle-size);cursor:col-resize}.right-handle.horizontal-direction-right,.right-handle.horizontal-direction-both{visibility:visible;right:var(--horizontal-handle-offset);top:0;height:100%;width:var(--horizontal-handle-size);cursor:col-resize}.bottom-handle.vertical-direction-bottom,.bottom-handle.vertical-direction-both{visibility:visible;left:0;bottom:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:100%;cursor:row-resize}.top-handle.vertical-direction-top,.top-handle.vertical-direction-both{visibility:visible;left:0;top:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:100%;cursor:row-resize}.bottom-right-handle.vertical-direction-bottom.horizontal-direction-right,.bottom-right-handle.vertical-direction-both.horizontal-direction-right,.bottom-right-handle.vertical-direction-bottom.horizontal-direction-both,.bottom-right-handle.vertical-direction-both.horizontal-direction-both{visibility:visible;right:var(--horizontal-handle-offset);bottom:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:var(--horizontal-handle-size);cursor:nwse-resize}.bottom-left-handle.vertical-direction-bottom.horizontal-direction-left,.bottom-left-handle.vertical-direction-both.horizontal-direction-left,.bottom-left-handle.vertical-direction-bottom.horizontal-direction-both,.bottom-left-handle.vertical-direction-both.horizontal-direction-both{visibility:visible;left:var(--horizontal-handle-offset);bottom:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:var(--horizontal-handle-size);cursor:nesw-resize}.top-right-handle.vertical-direction-top.horizontal-direction-right,.top-right-handle.vertical-direction-both.horizontal-direction-right,.top-right-handle.vertical-direction-top.horizontal-direction-both,.top-right-handle.vertical-direction-both.horizontal-direction-both{visibility:visible;right:var(--horizontal-handle-offset);top:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:var(--horizontal-handle-size);cursor:nesw-resize}.top-left-handle.vertical-direction-top.horizontal-direction-left,.top-left-handle.vertical-direction-both.horizontal-direction-left,.top-left-handle.vertical-direction-top.horizontal-direction-both,.top-left-handle.vertical-direction-both.horizontal-direction-both{visibility:visible;left:var(--horizontal-handle-offset);top:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:var(--horizontal-handle-size);cursor:nwse-resize}";
|
|
5
6
|
|
|
@@ -38,7 +39,9 @@ const Resizable = class {
|
|
|
38
39
|
this.handleDragLeft = this.handleDragLeft.bind(this);
|
|
39
40
|
this.handleDragRight = this.handleDragRight.bind(this);
|
|
40
41
|
this.handleWindowPointerUp = this.handleWindowPointerUp.bind(this);
|
|
42
|
+
this.updateDimensions = this.updateDimensions.bind(this);
|
|
41
43
|
this.recomputeDimensions = this.recomputeDimensions.bind(this);
|
|
44
|
+
this.computeDimensions = this.computeDimensions.bind(this);
|
|
42
45
|
this.mutationObserver = new MutationObserver(this.recomputeDimensions);
|
|
43
46
|
this.resizeObserver = new ResizeObserver(this.recomputeDimensions);
|
|
44
47
|
}
|
|
@@ -63,6 +66,21 @@ const Resizable = class {
|
|
|
63
66
|
this.mutationObserver.disconnect();
|
|
64
67
|
this.resizeObserver.disconnect();
|
|
65
68
|
}
|
|
69
|
+
connectedCallback() {
|
|
70
|
+
this.computeDimensions();
|
|
71
|
+
window.addEventListener('resize', this.recomputeDimensions);
|
|
72
|
+
this.mutationObserver.observe(this.hostElement, {
|
|
73
|
+
attributes: true,
|
|
74
|
+
attributeFilter: ['class'],
|
|
75
|
+
});
|
|
76
|
+
if (this.parentSelector != null) {
|
|
77
|
+
const parent = document.querySelector(this.parentSelector);
|
|
78
|
+
if (parent != null) {
|
|
79
|
+
this.resizeObserver.observe(parent);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
this.resizeObserver.observe(this.hostElement);
|
|
83
|
+
}
|
|
66
84
|
render() {
|
|
67
85
|
const width = this.width < 0 || this.horizontalDirection === 'none'
|
|
68
86
|
? '100%'
|
|
@@ -141,7 +159,7 @@ const Resizable = class {
|
|
|
141
159
|
: 0;
|
|
142
160
|
}
|
|
143
161
|
computeDimensions() {
|
|
144
|
-
|
|
162
|
+
readDOM(() => {
|
|
145
163
|
var _a;
|
|
146
164
|
const slotted = this.getSlottedElement();
|
|
147
165
|
if (typeof window !== 'undefined' && slotted != null) {
|
|
@@ -169,7 +187,7 @@ const Resizable = class {
|
|
|
169
187
|
}
|
|
170
188
|
this.resizeTimeout = setTimeout(() => {
|
|
171
189
|
this.resizeTimeout = undefined;
|
|
172
|
-
|
|
190
|
+
readDOM(() => {
|
|
173
191
|
var _a;
|
|
174
192
|
const slotted = this.getSlottedElement();
|
|
175
193
|
if (typeof window !== 'undefined' && slotted != null) {
|
|
@@ -372,12 +390,12 @@ const Resizable = class {
|
|
|
372
390
|
return 0;
|
|
373
391
|
}
|
|
374
392
|
emitResizeStart(location) {
|
|
375
|
-
|
|
393
|
+
readDOM(() => {
|
|
376
394
|
this.resizeStart.emit(this.computeResizeEventDetails(location));
|
|
377
395
|
});
|
|
378
396
|
}
|
|
379
397
|
emitResizeEnd(location) {
|
|
380
|
-
|
|
398
|
+
readDOM(() => {
|
|
381
399
|
this.resizeEnd.emit(this.computeResizeEventDetails(location));
|
|
382
400
|
});
|
|
383
401
|
}
|
|
@@ -41,9 +41,11 @@ export declare class Menu {
|
|
|
41
41
|
private hostElement;
|
|
42
42
|
private popoverRef?;
|
|
43
43
|
private headerSlot?;
|
|
44
|
+
private listenerDisposable?;
|
|
44
45
|
constructor();
|
|
45
46
|
componentDidLoad(): void;
|
|
46
47
|
disconnectedCallback(): void;
|
|
48
|
+
connectedCallback(): void;
|
|
47
49
|
render(): h.JSX.IntrinsicElements;
|
|
48
50
|
private addEventListeners;
|
|
49
51
|
private removeEventListeners;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertexvis/ui",
|
|
3
|
-
"version": "0.1.2-canary.
|
|
3
|
+
"version": "0.1.2-canary.2",
|
|
4
4
|
"description": "The Vertex UI component library.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"@vertexvis/utils": "^0.23.2",
|
|
88
88
|
"fast-deep-equal": "^3.1.3"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "90a063b058db9bfdb5707a0b3789c556fdc83598"
|
|
91
91
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{M as vertex_menu}from"./p-7b75e004.js";import"./p-6834631c.js";import"./p-fe062eb0.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,e as i,h as o,H as h,c as e,g as s}from"./p-6834631c.js";import{c as n}from"./p-fe062eb0.js";const r=class{constructor(o){t(this,o),this.resizeStart=i(this,"resizeStart",7),this.resizeEnd=i(this,"resizeEnd",7),this.containerTop=0,this.containerLeft=0,this.horizontalDirection="both",this.verticalDirection="both",this.initialHorizontalScale=void 0,this.initialVerticalScale=void 0,this.initializeWithOffset=!1,this.parentSelector=void 0,this.verticalSiblingSelector=void 0,this.horizontalSiblingSelector=void 0,this.contentSelector=void 0,this.position="relative",this.dimensionsComputed=!1,this.width=-1,this.minWidth=void 0,this.maxWidth=void 0,this.height=-1,this.minHeight=void 0,this.maxHeight=void 0,this.left=0,this.top=0,this.hoveredLocation=void 0,this.dragStartLocation=void 0,this.handleDrag=this.handleDrag.bind(this),this.handleDragBottom=this.handleDragBottom.bind(this),this.handleDragTop=this.handleDragTop.bind(this),this.handleDragLeft=this.handleDragLeft.bind(this),this.handleDragRight=this.handleDragRight.bind(this),this.handleWindowPointerUp=this.handleWindowPointerUp.bind(this),this.recomputeDimensions=this.recomputeDimensions.bind(this),this.mutationObserver=new MutationObserver(this.recomputeDimensions),this.resizeObserver=new ResizeObserver(this.recomputeDimensions)}componentDidLoad(){if(this.computeDimensions(),window.addEventListener("resize",this.recomputeDimensions),this.mutationObserver.observe(this.hostElement,{attributes:!0,attributeFilter:["class"]}),null!=this.parentSelector){const t=document.querySelector(this.parentSelector);null!=t&&this.resizeObserver.observe(t)}this.resizeObserver.observe(this.hostElement)}disconnectedCallback(){this.dimensionsComputed=!1,window.removeEventListener("resize",this.recomputeDimensions),this.mutationObserver.disconnect(),this.resizeObserver.disconnect()}render(){return o(h,{style:{width:this.width<0||"none"===this.horizontalDirection?"100%":`${this.width}px`,height:this.height<0||"none"===this.verticalDirection?"100%":`${this.height}px`,left:"relative"===this.position?`${this.left}px`:void 0,top:"relative"===this.position?`${this.top}px`:void 0}},o("div",{class:n("container",{hidden:this.width<=0&&this.height<=0})},o("div",{class:n("shadow",`hovered-location-${this.dragStartLocation||this.hoveredLocation}`)}),o("div",{class:n("handle","left-handle",`horizontal-direction-${this.horizontalDirection}`,`vertical-direction-${this.verticalDirection}`),onPointerDown:t=>this.handlePointerDown(t,"left"),onPointerEnter:()=>this.handlePointerEnter("left"),onPointerLeave:()=>this.handlePointerLeave("left")}),o("div",{class:n("handle","right-handle",`horizontal-direction-${this.horizontalDirection}`,`vertical-direction-${this.verticalDirection}`),onPointerDown:t=>this.handlePointerDown(t,"right"),onPointerEnter:()=>this.handlePointerEnter("right"),onPointerLeave:()=>this.handlePointerLeave("right")}),o("div",{class:n("handle","top-handle",`horizontal-direction-${this.horizontalDirection}`,`vertical-direction-${this.verticalDirection}`),onPointerDown:t=>this.handlePointerDown(t,"top"),onPointerEnter:()=>this.handlePointerEnter("top"),onPointerLeave:()=>this.handlePointerLeave("top")}),o("div",{class:n("handle","bottom-handle",`horizontal-direction-${this.horizontalDirection}`,`vertical-direction-${this.verticalDirection}`),onPointerDown:t=>this.handlePointerDown(t,"bottom"),onPointerEnter:()=>this.handlePointerEnter("bottom"),onPointerLeave:()=>this.handlePointerLeave("bottom")}),o("div",{class:n("handle","bottom-right-handle",`horizontal-direction-${this.horizontalDirection}`,`vertical-direction-${this.verticalDirection}`),onPointerDown:t=>this.handlePointerDown(t,"bottom-right"),onPointerEnter:()=>this.handlePointerEnter("bottom-right"),onPointerLeave:()=>this.handlePointerLeave("bottom-right")}),o("div",{class:n("handle","bottom-left-handle",`horizontal-direction-${this.horizontalDirection}`,`vertical-direction-${this.verticalDirection}`),onPointerDown:t=>this.handlePointerDown(t,"bottom-left"),onPointerEnter:()=>this.handlePointerEnter("bottom-left"),onPointerLeave:()=>this.handlePointerLeave("bottom-left")}),o("div",{class:n("handle","top-right-handle",`horizontal-direction-${this.horizontalDirection}`,`vertical-direction-${this.verticalDirection}`),onPointerDown:t=>this.handlePointerDown(t,"top-right"),onPointerEnter:()=>this.handlePointerEnter("top-right"),onPointerLeave:()=>this.handlePointerLeave("top-right")}),o("div",{class:n("handle","top-left-handle",`horizontal-direction-${this.horizontalDirection}`,`vertical-direction-${this.verticalDirection}`),onPointerDown:t=>this.handlePointerDown(t,"top-left"),onPointerEnter:()=>this.handlePointerEnter("top-left"),onPointerLeave:()=>this.handlePointerLeave("top-left")}),o("slot",null)))}async updateDimensions(t,i=!1){var o,h;const{host:e,slotted:s,parent:n,minWidth:r,maxWidth:l,minHeight:a,maxHeight:d}=t,v=this.fromComputedStyle(l,(null==n?void 0:n.width)||e.width||s.width);this.maxWidth=null!=v?v-this.getSiblingMinWidth((null==n?void 0:n.width)||e.width||s.width):void 0,this.minWidth=this.fromComputedStyle(r,(null==n?void 0:n.width)||e.width||s.width);const c=this.fromComputedStyle(d,(null==n?void 0:n.height)||e.height||s.height);if(this.maxHeight=null!=c?c-this.getSiblingMinHeight((null==n?void 0:n.height)||e.height||s.height):void 0,this.minHeight=this.fromComputedStyle(a,(null==n?void 0:n.height)||e.height||s.height),!i||this.height<=0){const t=null!=this.maxHeight&&null!=this.initialVerticalScale?this.maxHeight*this.initialVerticalScale:this.minHeight;this.width=(null!=this.maxWidth&&null!=this.initialHorizontalScale?this.maxWidth*this.initialHorizontalScale:this.minWidth)||s.width||this.width,this.height=t||s.height||this.height}else this.height=this.toBoundedValue(this.height,this.minHeight||0,this.maxHeight),this.width=this.toBoundedValue(this.width,this.minWidth||0,this.maxWidth);this.containerTop=null!==(o=null==n?void 0:n.top)&&void 0!==o?o:e.top,this.containerLeft=null!==(h=null==n?void 0:n.left)&&void 0!==h?h:e.left,this.top=null!=c&&this.initializeWithOffset&&"absolute"!==this.position?c-this.height:0,this.left=null!=v&&this.initializeWithOffset&&"absolute"!==this.position?v-this.width:0}computeDimensions(){e((()=>{var t;const i=this.getSlottedElement();if("undefined"!=typeof window&&null!=i){const o=window.getComputedStyle(this.hostElement);this.updateDimensions({host:this.hostElement.getBoundingClientRect(),slotted:i.getBoundingClientRect(),parent:null!=this.parentSelector?null===(t=document.querySelector(this.parentSelector))||void 0===t?void 0:t.getBoundingClientRect():void 0,minWidth:o.minWidth,maxWidth:o.maxWidth,minHeight:o.minHeight,maxHeight:o.maxHeight}),this.dimensionsComputed=!0}}))}recomputeDimensions(){null!=this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=void 0),this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=void 0,e((()=>{var t;const i=this.getSlottedElement();if("undefined"!=typeof window&&null!=i){const o=window.getComputedStyle(this.hostElement);this.updateDimensions({host:this.hostElement.getBoundingClientRect(),slotted:i.getBoundingClientRect(),parent:null!=this.parentSelector?null===(t=document.querySelector(this.parentSelector))||void 0===t?void 0:t.getBoundingClientRect():void 0,minWidth:o.minWidth,maxWidth:o.maxWidth,minHeight:o.minHeight,maxHeight:o.maxHeight},!0)}}))}),200)}handlePointerEnter(t){this.hoveredLocation=t}handlePointerLeave(t){t===this.hoveredLocation&&(this.hoveredLocation=void 0)}handlePointerDown(t,i){this.setStartPosition(t,i),this.emitResizeStart(i),window.addEventListener("pointermove",this.handleDrag),window.addEventListener("pointerup",this.handleWindowPointerUp)}handleDrag(t){if(null!=this.lastPointerPosition){const i={x:this.lastPointerPosition.x-t.clientX,y:this.lastPointerPosition.y-t.clientY};switch(this.lastPointerPosition={x:t.clientX,y:t.clientY},this.dragStartLocation){case"bottom":this.ifValidDragBottom(t,i,this.handleDragBottom);break;case"top":this.ifValidDragTop(t,i,this.handleDragTop);break;case"right":this.ifValidDragRight(t,i,this.handleDragRight);break;case"left":this.ifValidDragLeft(t,i,this.handleDragLeft);break;case"bottom-right":this.ifValidDragBottom(t,i,this.handleDragBottom),this.ifValidDragRight(t,i,this.handleDragRight);break;case"bottom-left":this.ifValidDragBottom(t,i,this.handleDragBottom),this.ifValidDragLeft(t,i,this.handleDragLeft);break;case"top-right":this.ifValidDragTop(t,i,this.handleDragTop),this.ifValidDragRight(t,i,this.handleDragRight);break;case"top-left":this.ifValidDragTop(t,i,this.handleDragTop),this.ifValidDragLeft(t,i,this.handleDragLeft)}}}handleWindowPointerUp(){null!=this.dragStartLocation&&this.emitResizeEnd(this.dragStartLocation),this.lastPointerPosition=void 0,this.dragStartLocation=void 0,window.removeEventListener("pointermove",this.handleDrag),window.removeEventListener("pointerup",this.handleWindowPointerUp)}ifValidDragTop(t,i,o){(i.y<0?t.clientY-this.containerTop>this.top:t.clientY-this.containerTop<=this.top)&&o(i)}ifValidDragBottom(t,i,o){(i.y>0?t.clientY<this.top+this.containerTop+this.height:t.clientY>=this.top+this.containerTop+this.height)&&o(i)}ifValidDragLeft(t,i,o){(i.x<0?t.clientX-this.containerLeft>this.left:t.clientX-this.containerLeft<=this.left)&&o(i)}ifValidDragRight(t,i,o){(i.x>0?t.clientX<this.left+this.containerLeft+this.width:t.clientX>=this.left+this.containerLeft+this.width)&&o(i)}handleDragTop(t){const i=this.height;this.height=this.toBoundedValue(this.height+t.y,this.minHeight||0,this.maxHeight),this.top-=this.height-i}handleDragBottom(t){this.height=this.toBoundedValue(this.height-t.y,this.minHeight||0,this.maxHeight)}handleDragLeft(t){const i=this.width;this.width=this.toBoundedValue(this.width+t.x,this.minWidth||0,this.maxWidth),this.left-=this.width-i}handleDragRight(t){this.width=this.toBoundedValue(this.width-t.x,this.minWidth||0,this.maxWidth)}setStartPosition(t,i){t.stopPropagation(),t.preventDefault(),this.lastPointerPosition={x:t.clientX,y:t.clientY},this.dragStartLocation=i}getSlottedElement(){var t,i,o;if(null!=this.contentSelector)return(null===(t=this.hostElement.shadowRoot)||void 0===t?void 0:t.querySelector(this.contentSelector))||this.hostElement.querySelector(this.contentSelector)||void 0;{const t=(null===(i=this.hostElement.shadowRoot)||void 0===i?void 0:i.querySelector("slot"))||void 0;if(null===(o=null==t?void 0:t.assignedElements)||void 0===o?void 0:o.call(t).length)return null==t?void 0:t.assignedElements()[0]}}getMinBounds(){return{x:null!=this.minWidth?this.width-this.minWidth:this.width,y:null!=this.minHeight?this.height-this.minHeight:this.height}}fromComputedStyle(t,i){const o=parseFloat(t);return isNaN(o)||o<=0?void 0:t.includes("%")?o/100*i:o}toBoundedValue(t,i,o){return Math.max(Math.min(t,null!=o?o:t),i)}getSiblingMinWidth(t){var i;const o=null!=this.horizontalSiblingSelector?document.querySelector(this.horizontalSiblingSelector):void 0;if("undefined"!=typeof window&&o){const h=window.getComputedStyle(o);return null!==(i=this.fromComputedStyle(h.minWidth,t))&&void 0!==i?i:0}return 0}getSiblingMinHeight(t){var i;const o=null!=this.verticalSiblingSelector?document.querySelector(this.verticalSiblingSelector):void 0;if("undefined"!=typeof window&&o){const h=window.getComputedStyle(o);return null!==(i=this.fromComputedStyle(h.minHeight,t))&&void 0!==i?i:0}return 0}emitResizeStart(t){e((()=>{this.resizeStart.emit(this.computeResizeEventDetails(t))}))}emitResizeEnd(t){e((()=>{this.resizeEnd.emit(this.computeResizeEventDetails(t))}))}computeResizeEventDetails(t){var i,o,h,e,s;const n=null!=this.parentSelector?null===(i=document.querySelector(this.parentSelector))||void 0===i?void 0:i.getBoundingClientRect():void 0;return{location:t,width:this.width,height:this.height,widthPercentage:this.width/(null!==(h=null!==(o=this.maxWidth)&&void 0!==o?o:null==n?void 0:n.width)&&void 0!==h?h:window.innerWidth),heightPercentage:this.height/(null!==(s=null!==(e=this.maxHeight)&&void 0!==e?e:null==n?void 0:n.height)&&void 0!==s?s:window.innerHeight)}}get hostElement(){return s(this)}};r.style=':host{--hover-shadow-color:var(--vertex-ui-blue-500);--vertical-handle-size:1rem;--vertical-handle-offset:-0.9rem;--horizontal-handle-size:1rem;--horizontal-handle-offset:-0.9rem;--side-direction-handle-z-index:var(--vertex-ui-popover-layer);--corner-handle-z-index:var(--vertex-ui-context-menu-layer)}:host(:not([dimensions-computed=""])){position:absolute;display:none}.container{position:relative;height:100%;width:100%}.container.hidden{position:absolute;visibility:hidden}.shadow{pointer-events:none;position:absolute;width:100%;height:100%;z-index:var(--vertex-ui-popover-layer)}.shadow.hovered-location-left{box-shadow:inset 1px 0 0 var(--hover-shadow-color)}.shadow.hovered-location-right{box-shadow:inset -1px 0 0 var(--hover-shadow-color)}.shadow.hovered-location-top{box-shadow:inset 0 1px 0 var(--hover-shadow-color)}.shadow.hovered-location-bottom{box-shadow:inset 0 -1px 0 var(--hover-shadow-color)}.shadow.hovered-location-bottom-left{box-shadow:inset 1px -1px 0 var(--hover-shadow-color)}.shadow.hovered-location-bottom-right{box-shadow:inset -1px -1px 0 var(--hover-shadow-color)}.shadow.hovered-location-top-left{box-shadow:inset 1px 1px 0 var(--hover-shadow-color)}.shadow.hovered-location-top-right{box-shadow:inset -1px 1px 0 var(--hover-shadow-color)}.handle{position:absolute;visibility:hidden;z-index:var(--side-direction-handle-z-index)}.corner-handle{z-index:var(--corner-handle-z-index)}.left-handle.horizontal-direction-left,.left-handle.horizontal-direction-both{visibility:visible;left:var(--horizontal-handle-offset);top:0;height:100%;width:var(--horizontal-handle-size);cursor:col-resize}.right-handle.horizontal-direction-right,.right-handle.horizontal-direction-both{visibility:visible;right:var(--horizontal-handle-offset);top:0;height:100%;width:var(--horizontal-handle-size);cursor:col-resize}.bottom-handle.vertical-direction-bottom,.bottom-handle.vertical-direction-both{visibility:visible;left:0;bottom:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:100%;cursor:row-resize}.top-handle.vertical-direction-top,.top-handle.vertical-direction-both{visibility:visible;left:0;top:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:100%;cursor:row-resize}.bottom-right-handle.vertical-direction-bottom.horizontal-direction-right,.bottom-right-handle.vertical-direction-both.horizontal-direction-right,.bottom-right-handle.vertical-direction-bottom.horizontal-direction-both,.bottom-right-handle.vertical-direction-both.horizontal-direction-both{visibility:visible;right:var(--horizontal-handle-offset);bottom:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:var(--horizontal-handle-size);cursor:nwse-resize}.bottom-left-handle.vertical-direction-bottom.horizontal-direction-left,.bottom-left-handle.vertical-direction-both.horizontal-direction-left,.bottom-left-handle.vertical-direction-bottom.horizontal-direction-both,.bottom-left-handle.vertical-direction-both.horizontal-direction-both{visibility:visible;left:var(--horizontal-handle-offset);bottom:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:var(--horizontal-handle-size);cursor:nesw-resize}.top-right-handle.vertical-direction-top.horizontal-direction-right,.top-right-handle.vertical-direction-both.horizontal-direction-right,.top-right-handle.vertical-direction-top.horizontal-direction-both,.top-right-handle.vertical-direction-both.horizontal-direction-both{visibility:visible;right:var(--horizontal-handle-offset);top:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:var(--horizontal-handle-size);cursor:nesw-resize}.top-left-handle.vertical-direction-top.horizontal-direction-left,.top-left-handle.vertical-direction-both.horizontal-direction-left,.top-left-handle.vertical-direction-top.horizontal-direction-both,.top-left-handle.vertical-direction-both.horizontal-direction-both{visibility:visible;left:var(--horizontal-handle-offset);top:var(--vertical-handle-offset);height:var(--vertical-handle-size);width:var(--horizontal-handle-size);cursor:nwse-resize}';export{r as R}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,e as i,h as t,g as e}from"./p-6834631c.js";import{c as o}from"./p-fe062eb0.js";const r=class{constructor(t){s(this,t),this.menuClosed=i(this,"menuClosed",7),this.animated=!0,this.open=!1,this.placement=void 0,this.fallbackPlacements=void 0,this.backdrop=!0,this.position=void 0,this.popoverProps=void 0,this.handlePopoverDismiss=this.handlePopoverDismiss.bind(this)}componentDidLoad(){var s;this.addEventListeners(),this.headerSlot=(null===(s=this.hostElement.shadowRoot)||void 0===s?void 0:s.querySelector('slot[name="header"]'))||void 0}disconnectedCallback(){this.removeEventListeners()}render(){return t("vertex-popover",Object.assign({ref:s=>{this.popoverRef=s},open:this.open,animated:this.animated,position:this.position,placement:this.placement,backdrop:this.backdrop,flipBehavior:null!=this.fallbackPlacements?{fallbackPlacements:this.fallbackPlacements}:void 0},this.popoverProps),null==this.position&&t("div",{slot:"anchor"},t("slot",{name:"anchor"})),t("div",{onClick:()=>{this.open=!1,this.menuClosed.emit()},class:o("root",{"has-header":null!=this.headerSlot})},t("slot",{name:"header"}),t("slot",null)))}addEventListeners(){var s;null===(s=this.popoverRef)||void 0===s||s.addEventListener("dismissed",this.handlePopoverDismiss)}removeEventListeners(){var s;null===(s=this.popoverRef)||void 0===s||s.removeEventListener("dismissed",this.handlePopoverDismiss)}handlePopoverDismiss(){this.open=!1,this.menuClosed.emit()}get hostElement(){return e(this)}};r.style=":host{--background-color:var(--vertex-ui-white);--menu-padding:0.19em 0}.root{padding:var(--menu-padding);border:1px solid var(--vertex-ui-neutral-400);border-radius:0.25rem;box-shadow:0px 2px 4px -1px rgb(0 0 0 / 20%),\n 0px 4px 5px 0px rgb(0 0 0 / 14%), 0px 1px 10px 0px rgb(0 0 0 / 12%);background-color:var(--background-color);z-index:var(--vertex-ui-context-menu-layer)}.has-header{padding-top:0}";export{r as M}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{R as vertex_resizable}from"./p-6ec189d2.js";import"./p-6834631c.js";import"./p-fe062eb0.js";
|