@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.
Files changed (124) hide show
  1. package/dist/cjs/index.cjs.js +3 -3
  2. package/dist/cjs/{menu-d1ecf43b.js → menu-25f83cd7.js} +13 -3
  3. package/dist/cjs/{resizable-e4248256.js → resizable-c0a69532.js} +22 -4
  4. package/dist/cjs/vertex-menu.cjs.entry.js +1 -1
  5. package/dist/cjs/vertex-resizable.cjs.entry.js +2 -1
  6. package/dist/collection/components/menu/menu.js +13 -3
  7. package/dist/collection/components/resizable/resizable.js +23 -5
  8. package/dist/components/auto-resize-textarea.js +157 -0
  9. package/dist/components/color-swatch.js +124 -0
  10. package/dist/components/components.esm.js +1 -1
  11. package/dist/components/dom.js +13 -0
  12. package/dist/components/expandable.js +100 -0
  13. package/dist/components/icon-button.js +63 -0
  14. package/dist/components/icon-helper.js +722 -0
  15. package/dist/components/icon.js +43 -0
  16. package/dist/components/index.d.ts +71 -0
  17. package/dist/components/index.esm.js +1 -1
  18. package/dist/components/index.js +52 -0
  19. package/dist/components/index2.js +89 -0
  20. package/dist/components/menu.js +99 -0
  21. package/dist/components/p-1b85c1d1.entry.js +1 -0
  22. package/dist/components/p-95358d00.entry.js +1 -0
  23. package/dist/components/p-c9a967d9.js +1 -0
  24. package/dist/components/p-ee5c8bd3.js +1 -0
  25. package/dist/components/popover.js +1737 -0
  26. package/dist/components/result-list.js +565 -0
  27. package/dist/components/slots.js +26 -0
  28. package/dist/components/text-field.js +171 -0
  29. package/dist/components/tooltip.js +360 -0
  30. package/dist/components/tslib.es6.js +65 -0
  31. package/dist/components/vertex-auto-resize-textarea.d.ts +11 -0
  32. package/dist/components/vertex-auto-resize-textarea.js +6 -0
  33. package/dist/components/vertex-avatar-group.d.ts +11 -0
  34. package/dist/components/vertex-avatar-group.js +34 -0
  35. package/dist/components/vertex-avatar.d.ts +11 -0
  36. package/dist/components/vertex-avatar.js +68 -0
  37. package/dist/components/vertex-badge.d.ts +11 -0
  38. package/dist/components/vertex-badge.js +43 -0
  39. package/dist/components/vertex-banner.d.ts +11 -0
  40. package/dist/components/vertex-banner.js +141 -0
  41. package/dist/components/vertex-button.d.ts +11 -0
  42. package/dist/components/vertex-button.js +96 -0
  43. package/dist/components/vertex-card-group.d.ts +11 -0
  44. package/dist/components/vertex-card-group.js +51 -0
  45. package/dist/components/vertex-card.d.ts +11 -0
  46. package/dist/components/vertex-card.js +49 -0
  47. package/dist/components/vertex-chip.d.ts +11 -0
  48. package/dist/components/vertex-chip.js +45 -0
  49. package/dist/components/vertex-click-to-edit-textfield.d.ts +11 -0
  50. package/dist/components/vertex-click-to-edit-textfield.js +156 -0
  51. package/dist/components/vertex-collapsible.d.ts +11 -0
  52. package/dist/components/vertex-collapsible.js +63 -0
  53. package/dist/components/vertex-color-circle-picker.d.ts +11 -0
  54. package/dist/components/vertex-color-circle-picker.js +104 -0
  55. package/dist/components/vertex-color-picker.d.ts +11 -0
  56. package/dist/components/vertex-color-picker.js +75 -0
  57. package/dist/components/vertex-color-swatch.d.ts +11 -0
  58. package/dist/components/vertex-color-swatch.js +6 -0
  59. package/dist/components/vertex-context-menu.d.ts +11 -0
  60. package/dist/components/vertex-context-menu.js +125 -0
  61. package/dist/components/vertex-dialog.d.ts +11 -0
  62. package/dist/components/vertex-dialog.js +263 -0
  63. package/dist/components/vertex-draggable-popover.d.ts +11 -0
  64. package/dist/components/vertex-draggable-popover.js +119 -0
  65. package/dist/components/vertex-dropdown-menu.d.ts +11 -0
  66. package/dist/components/vertex-dropdown-menu.js +64 -0
  67. package/dist/components/vertex-expandable.d.ts +11 -0
  68. package/dist/components/vertex-expandable.js +6 -0
  69. package/dist/components/vertex-help-tooltip.d.ts +11 -0
  70. package/dist/components/vertex-help-tooltip.js +67 -0
  71. package/dist/components/vertex-icon-button.d.ts +11 -0
  72. package/dist/components/vertex-icon-button.js +6 -0
  73. package/dist/components/vertex-icon.d.ts +11 -0
  74. package/dist/components/vertex-icon.js +6 -0
  75. package/dist/components/vertex-logo-loading.d.ts +11 -0
  76. package/dist/components/vertex-logo-loading.js +34 -0
  77. package/dist/components/vertex-menu-divider.d.ts +11 -0
  78. package/dist/components/vertex-menu-divider.js +34 -0
  79. package/dist/components/vertex-menu-item.d.ts +11 -0
  80. package/dist/components/vertex-menu-item.js +44 -0
  81. package/dist/components/vertex-menu.d.ts +11 -0
  82. package/dist/components/vertex-menu.js +6 -0
  83. package/dist/components/vertex-popover.d.ts +11 -0
  84. package/dist/components/vertex-popover.js +6 -0
  85. package/dist/components/vertex-radio-group.d.ts +11 -0
  86. package/dist/components/vertex-radio-group.js +88 -0
  87. package/dist/components/vertex-radio.d.ts +11 -0
  88. package/dist/components/vertex-radio.js +56 -0
  89. package/dist/components/vertex-resizable.d.ts +11 -0
  90. package/dist/components/vertex-resizable.js +463 -0
  91. package/dist/components/vertex-result-list.d.ts +11 -0
  92. package/dist/components/vertex-result-list.js +6 -0
  93. package/dist/components/vertex-search-bar.d.ts +11 -0
  94. package/dist/components/vertex-search-bar.js +568 -0
  95. package/dist/components/vertex-select.d.ts +11 -0
  96. package/dist/components/vertex-select.js +200 -0
  97. package/dist/components/vertex-slider.d.ts +11 -0
  98. package/dist/components/vertex-slider.js +81 -0
  99. package/dist/components/vertex-spinner.d.ts +11 -0
  100. package/dist/components/vertex-spinner.js +49 -0
  101. package/dist/components/vertex-tab.d.ts +11 -0
  102. package/dist/components/vertex-tab.js +46 -0
  103. package/dist/components/vertex-tabs.d.ts +11 -0
  104. package/dist/components/vertex-tabs.js +133 -0
  105. package/dist/components/vertex-textfield.d.ts +11 -0
  106. package/dist/components/vertex-textfield.js +6 -0
  107. package/dist/components/vertex-toast.d.ts +11 -0
  108. package/dist/components/vertex-toast.js +127 -0
  109. package/dist/components/vertex-toggle.d.ts +11 -0
  110. package/dist/components/vertex-toggle.js +67 -0
  111. package/dist/components/vertex-tooltip.d.ts +11 -0
  112. package/dist/components/vertex-tooltip.js +6 -0
  113. package/dist/esm/index.js +3 -3
  114. package/dist/esm/{menu-daa7f9c9.js → menu-b8ff7d6a.js} +13 -3
  115. package/dist/esm/{resizable-a147709b.js → resizable-833336bf.js} +23 -5
  116. package/dist/esm/vertex-menu.entry.js +1 -1
  117. package/dist/esm/vertex-resizable.entry.js +2 -1
  118. package/dist/types/components/menu/menu.d.ts +2 -0
  119. package/dist/types/components/resizable/resizable.d.ts +1 -0
  120. package/package.json +2 -2
  121. package/dist/components/p-0517ca62.entry.js +0 -1
  122. package/dist/components/p-6ec189d2.js +0 -1
  123. package/dist/components/p-7b75e004.js +0 -1
  124. package/dist/components/p-ea4a2f74.entry.js +0 -1
@@ -0,0 +1,463 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { c as classnames } from './index2.js';
3
+ import { r as readDOM } from './dom.js';
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}";
6
+
7
+ const WINDOW_RESIZE_DEBOUNCE_THRESHOLD = 200;
8
+ const Resizable = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
9
+ constructor() {
10
+ super();
11
+ this.__registerHost();
12
+ this.__attachShadow();
13
+ this.resizeStart = createEvent(this, "resizeStart", 7);
14
+ this.resizeEnd = createEvent(this, "resizeEnd", 7);
15
+ this.containerTop = 0;
16
+ this.containerLeft = 0;
17
+ this.horizontalDirection = 'both';
18
+ this.verticalDirection = 'both';
19
+ this.initialHorizontalScale = undefined;
20
+ this.initialVerticalScale = undefined;
21
+ this.initializeWithOffset = false;
22
+ this.parentSelector = undefined;
23
+ this.verticalSiblingSelector = undefined;
24
+ this.horizontalSiblingSelector = undefined;
25
+ this.contentSelector = undefined;
26
+ this.position = 'relative';
27
+ this.dimensionsComputed = false;
28
+ this.width = -1;
29
+ this.minWidth = undefined;
30
+ this.maxWidth = undefined;
31
+ this.height = -1;
32
+ this.minHeight = undefined;
33
+ this.maxHeight = undefined;
34
+ this.left = 0;
35
+ this.top = 0;
36
+ this.hoveredLocation = undefined;
37
+ this.dragStartLocation = undefined;
38
+ this.handleDrag = this.handleDrag.bind(this);
39
+ this.handleDragBottom = this.handleDragBottom.bind(this);
40
+ this.handleDragTop = this.handleDragTop.bind(this);
41
+ this.handleDragLeft = this.handleDragLeft.bind(this);
42
+ this.handleDragRight = this.handleDragRight.bind(this);
43
+ this.handleWindowPointerUp = this.handleWindowPointerUp.bind(this);
44
+ this.updateDimensions = this.updateDimensions.bind(this);
45
+ this.recomputeDimensions = this.recomputeDimensions.bind(this);
46
+ this.computeDimensions = this.computeDimensions.bind(this);
47
+ this.mutationObserver = new MutationObserver(this.recomputeDimensions);
48
+ this.resizeObserver = new ResizeObserver(this.recomputeDimensions);
49
+ }
50
+ componentDidLoad() {
51
+ this.computeDimensions();
52
+ window.addEventListener('resize', this.recomputeDimensions);
53
+ this.mutationObserver.observe(this.hostElement, {
54
+ attributes: true,
55
+ attributeFilter: ['class'],
56
+ });
57
+ if (this.parentSelector != null) {
58
+ const parent = document.querySelector(this.parentSelector);
59
+ if (parent != null) {
60
+ this.resizeObserver.observe(parent);
61
+ }
62
+ }
63
+ this.resizeObserver.observe(this.hostElement);
64
+ }
65
+ disconnectedCallback() {
66
+ this.dimensionsComputed = false;
67
+ window.removeEventListener('resize', this.recomputeDimensions);
68
+ this.mutationObserver.disconnect();
69
+ this.resizeObserver.disconnect();
70
+ }
71
+ connectedCallback() {
72
+ this.computeDimensions();
73
+ window.addEventListener('resize', this.recomputeDimensions);
74
+ this.mutationObserver.observe(this.hostElement, {
75
+ attributes: true,
76
+ attributeFilter: ['class'],
77
+ });
78
+ if (this.parentSelector != null) {
79
+ const parent = document.querySelector(this.parentSelector);
80
+ if (parent != null) {
81
+ this.resizeObserver.observe(parent);
82
+ }
83
+ }
84
+ this.resizeObserver.observe(this.hostElement);
85
+ }
86
+ render() {
87
+ const width = this.width < 0 || this.horizontalDirection === 'none'
88
+ ? '100%'
89
+ : `${this.width}px`;
90
+ const height = this.height < 0 || this.verticalDirection === 'none'
91
+ ? '100%'
92
+ : `${this.height}px`;
93
+ return (h(Host, { style: {
94
+ width,
95
+ height,
96
+ left: this.position === 'relative' ? `${this.left}px` : undefined,
97
+ top: this.position === 'relative' ? `${this.top}px` : undefined,
98
+ } }, h("div", { class: classnames('container', {
99
+ hidden: this.width <= 0 && this.height <= 0,
100
+ }) }, h("div", { class: classnames('shadow', `hovered-location-${this.dragStartLocation || this.hoveredLocation}`) }), h("div", { class: classnames('handle', 'left-handle', `horizontal-direction-${this.horizontalDirection}`, `vertical-direction-${this.verticalDirection}`), onPointerDown: (e) => this.handlePointerDown(e, 'left'), onPointerEnter: () => this.handlePointerEnter('left'), onPointerLeave: () => this.handlePointerLeave('left') }), h("div", { class: classnames('handle', 'right-handle', `horizontal-direction-${this.horizontalDirection}`, `vertical-direction-${this.verticalDirection}`), onPointerDown: (e) => this.handlePointerDown(e, 'right'), onPointerEnter: () => this.handlePointerEnter('right'), onPointerLeave: () => this.handlePointerLeave('right') }), h("div", { class: classnames('handle', 'top-handle', `horizontal-direction-${this.horizontalDirection}`, `vertical-direction-${this.verticalDirection}`), onPointerDown: (e) => this.handlePointerDown(e, 'top'), onPointerEnter: () => this.handlePointerEnter('top'), onPointerLeave: () => this.handlePointerLeave('top') }), h("div", { class: classnames('handle', 'bottom-handle', `horizontal-direction-${this.horizontalDirection}`, `vertical-direction-${this.verticalDirection}`), onPointerDown: (e) => this.handlePointerDown(e, 'bottom'), onPointerEnter: () => this.handlePointerEnter('bottom'), onPointerLeave: () => this.handlePointerLeave('bottom') }), h("div", { class: classnames('handle', 'bottom-right-handle', `horizontal-direction-${this.horizontalDirection}`, `vertical-direction-${this.verticalDirection}`), onPointerDown: (e) => this.handlePointerDown(e, 'bottom-right'), onPointerEnter: () => this.handlePointerEnter('bottom-right'), onPointerLeave: () => this.handlePointerLeave('bottom-right') }), h("div", { class: classnames('handle', 'bottom-left-handle', `horizontal-direction-${this.horizontalDirection}`, `vertical-direction-${this.verticalDirection}`), onPointerDown: (e) => this.handlePointerDown(e, 'bottom-left'), onPointerEnter: () => this.handlePointerEnter('bottom-left'), onPointerLeave: () => this.handlePointerLeave('bottom-left') }), h("div", { class: classnames('handle', 'top-right-handle', `horizontal-direction-${this.horizontalDirection}`, `vertical-direction-${this.verticalDirection}`), onPointerDown: (e) => this.handlePointerDown(e, 'top-right'), onPointerEnter: () => this.handlePointerEnter('top-right'), onPointerLeave: () => this.handlePointerLeave('top-right') }), h("div", { class: classnames('handle', 'top-left-handle', `horizontal-direction-${this.horizontalDirection}`, `vertical-direction-${this.verticalDirection}`), onPointerDown: (e) => this.handlePointerDown(e, 'top-left'), onPointerEnter: () => this.handlePointerEnter('top-left'), onPointerLeave: () => this.handlePointerLeave('top-left') }), h("slot", null))));
101
+ }
102
+ /**
103
+ * @private
104
+ *
105
+ * Used for internals or testing.
106
+ */
107
+ async updateDimensions(bounds, isRecompute = false) {
108
+ var _a, _b;
109
+ const { host, slotted, parent, minWidth, maxWidth, minHeight, maxHeight } = bounds;
110
+ // Calculate the horizontal bounds of the component, where baseMaxWidth is the
111
+ // maximum width of the container and this.maxWidth is the maximum width of the
112
+ // component when taking siblings into account
113
+ const baseMaxWidth = this.fromComputedStyle(maxWidth, (parent === null || parent === void 0 ? void 0 : parent.width) || host.width || slotted.width);
114
+ this.maxWidth =
115
+ baseMaxWidth != null
116
+ ? baseMaxWidth -
117
+ this.getSiblingMinWidth((parent === null || parent === void 0 ? void 0 : parent.width) || host.width || slotted.width)
118
+ : undefined;
119
+ this.minWidth = this.fromComputedStyle(minWidth, (parent === null || parent === void 0 ? void 0 : parent.width) || host.width || slotted.width);
120
+ // Calculate the vertical bounds of the component, where baseMaxHeight is the
121
+ // maximum height of the container and this.maxHeight is the maximum height of
122
+ // the component when taking siblings into account
123
+ const baseMaxHeight = this.fromComputedStyle(maxHeight, (parent === null || parent === void 0 ? void 0 : parent.height) || host.height || slotted.height);
124
+ this.maxHeight =
125
+ baseMaxHeight != null
126
+ ? baseMaxHeight -
127
+ this.getSiblingMinHeight((parent === null || parent === void 0 ? void 0 : parent.height) || host.height || slotted.height)
128
+ : undefined;
129
+ this.minHeight = this.fromComputedStyle(minHeight, (parent === null || parent === void 0 ? void 0 : parent.height) || host.height || slotted.height);
130
+ // Initialize the component's height and width if it was previously hidden
131
+ if (!isRecompute || this.height <= 0) {
132
+ const initialWidth = this.maxWidth != null && this.initialHorizontalScale != null
133
+ ? this.maxWidth * this.initialHorizontalScale
134
+ : this.minWidth;
135
+ const initialHeight = this.maxHeight != null && this.initialVerticalScale != null
136
+ ? this.maxHeight * this.initialVerticalScale
137
+ : this.minHeight;
138
+ this.width = initialWidth || slotted.width || this.width;
139
+ this.height = initialHeight || slotted.height || this.height;
140
+ }
141
+ else {
142
+ this.height = this.toBoundedValue(this.height, this.minHeight || 0, this.maxHeight);
143
+ this.width = this.toBoundedValue(this.width, this.minWidth || 0, this.maxWidth);
144
+ }
145
+ this.containerTop = (_a = parent === null || parent === void 0 ? void 0 : parent.top) !== null && _a !== void 0 ? _a : host.top;
146
+ this.containerLeft = (_b = parent === null || parent === void 0 ? void 0 : parent.left) !== null && _b !== void 0 ? _b : host.left;
147
+ // this.left and this.top are only used internally, and in the case of absolute positioning, we only update
148
+ // the width/height, so we want to reset left & top to 0 to take into consideration the difference between
149
+ // it's parent container to the left/top position.
150
+ this.top =
151
+ baseMaxHeight != null &&
152
+ this.initializeWithOffset &&
153
+ this.position !== 'absolute'
154
+ ? baseMaxHeight - this.height
155
+ : 0;
156
+ this.left =
157
+ baseMaxWidth != null &&
158
+ this.initializeWithOffset &&
159
+ this.position !== 'absolute'
160
+ ? baseMaxWidth - this.width
161
+ : 0;
162
+ }
163
+ computeDimensions() {
164
+ readDOM(() => {
165
+ var _a;
166
+ const slotted = this.getSlottedElement();
167
+ if (typeof window !== 'undefined' && slotted != null) {
168
+ const computedStyles = window.getComputedStyle(this.hostElement);
169
+ this.updateDimensions({
170
+ host: this.hostElement.getBoundingClientRect(),
171
+ slotted: slotted.getBoundingClientRect(),
172
+ parent: this.parentSelector != null
173
+ ? (_a = document
174
+ .querySelector(this.parentSelector)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()
175
+ : undefined,
176
+ minWidth: computedStyles.minWidth,
177
+ maxWidth: computedStyles.maxWidth,
178
+ minHeight: computedStyles.minHeight,
179
+ maxHeight: computedStyles.maxHeight,
180
+ });
181
+ this.dimensionsComputed = true;
182
+ }
183
+ });
184
+ }
185
+ recomputeDimensions() {
186
+ if (this.resizeTimeout != null) {
187
+ clearTimeout(this.resizeTimeout);
188
+ this.resizeTimeout = undefined;
189
+ }
190
+ this.resizeTimeout = setTimeout(() => {
191
+ this.resizeTimeout = undefined;
192
+ readDOM(() => {
193
+ var _a;
194
+ const slotted = this.getSlottedElement();
195
+ if (typeof window !== 'undefined' && slotted != null) {
196
+ const computedStyles = window.getComputedStyle(this.hostElement);
197
+ this.updateDimensions({
198
+ host: this.hostElement.getBoundingClientRect(),
199
+ slotted: slotted.getBoundingClientRect(),
200
+ parent: this.parentSelector != null
201
+ ? (_a = document
202
+ .querySelector(this.parentSelector)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()
203
+ : undefined,
204
+ minWidth: computedStyles.minWidth,
205
+ maxWidth: computedStyles.maxWidth,
206
+ minHeight: computedStyles.minHeight,
207
+ maxHeight: computedStyles.maxHeight,
208
+ }, true);
209
+ }
210
+ });
211
+ }, WINDOW_RESIZE_DEBOUNCE_THRESHOLD);
212
+ }
213
+ handlePointerEnter(location) {
214
+ this.hoveredLocation = location;
215
+ }
216
+ handlePointerLeave(location) {
217
+ if (location === this.hoveredLocation) {
218
+ this.hoveredLocation = undefined;
219
+ }
220
+ }
221
+ handlePointerDown(e, location) {
222
+ this.setStartPosition(e, location);
223
+ this.emitResizeStart(location);
224
+ window.addEventListener('pointermove', this.handleDrag);
225
+ window.addEventListener('pointerup', this.handleWindowPointerUp);
226
+ }
227
+ handleDrag(e) {
228
+ if (this.lastPointerPosition != null) {
229
+ const difference = {
230
+ x: this.lastPointerPosition.x - e.clientX,
231
+ y: this.lastPointerPosition.y - e.clientY,
232
+ };
233
+ this.lastPointerPosition = { x: e.clientX, y: e.clientY };
234
+ switch (this.dragStartLocation) {
235
+ case 'bottom':
236
+ this.ifValidDragBottom(e, difference, this.handleDragBottom);
237
+ break;
238
+ case 'top':
239
+ this.ifValidDragTop(e, difference, this.handleDragTop);
240
+ break;
241
+ case 'right':
242
+ this.ifValidDragRight(e, difference, this.handleDragRight);
243
+ break;
244
+ case 'left':
245
+ this.ifValidDragLeft(e, difference, this.handleDragLeft);
246
+ break;
247
+ case 'bottom-right':
248
+ this.ifValidDragBottom(e, difference, this.handleDragBottom);
249
+ this.ifValidDragRight(e, difference, this.handleDragRight);
250
+ break;
251
+ case 'bottom-left':
252
+ this.ifValidDragBottom(e, difference, this.handleDragBottom);
253
+ this.ifValidDragLeft(e, difference, this.handleDragLeft);
254
+ break;
255
+ case 'top-right':
256
+ this.ifValidDragTop(e, difference, this.handleDragTop);
257
+ this.ifValidDragRight(e, difference, this.handleDragRight);
258
+ break;
259
+ case 'top-left':
260
+ this.ifValidDragTop(e, difference, this.handleDragTop);
261
+ this.ifValidDragLeft(e, difference, this.handleDragLeft);
262
+ break;
263
+ }
264
+ }
265
+ }
266
+ handleWindowPointerUp() {
267
+ if (this.dragStartLocation != null) {
268
+ this.emitResizeEnd(this.dragStartLocation);
269
+ }
270
+ this.lastPointerPosition = undefined;
271
+ this.dragStartLocation = undefined;
272
+ window.removeEventListener('pointermove', this.handleDrag);
273
+ window.removeEventListener('pointerup', this.handleWindowPointerUp);
274
+ }
275
+ ifValidDragTop(e, difference, fn) {
276
+ const isReducingSize = difference.y < 0;
277
+ const isValid = isReducingSize
278
+ ? e.clientY - this.containerTop > this.top
279
+ : e.clientY - this.containerTop <= this.top;
280
+ if (isValid) {
281
+ fn(difference);
282
+ }
283
+ }
284
+ ifValidDragBottom(e, difference, fn) {
285
+ const isReducingSize = difference.y > 0;
286
+ const isValid = isReducingSize
287
+ ? e.clientY < this.top + this.containerTop + this.height
288
+ : e.clientY >= this.top + this.containerTop + this.height;
289
+ if (isValid) {
290
+ fn(difference);
291
+ }
292
+ }
293
+ ifValidDragLeft(e, difference, fn) {
294
+ const isReducingSize = difference.x < 0;
295
+ const isValid = isReducingSize
296
+ ? e.clientX - this.containerLeft > this.left
297
+ : e.clientX - this.containerLeft <= this.left;
298
+ if (isValid) {
299
+ fn(difference);
300
+ }
301
+ }
302
+ ifValidDragRight(e, difference, fn) {
303
+ const isReducingSize = difference.x > 0;
304
+ const isValid = isReducingSize
305
+ ? e.clientX < this.left + this.containerLeft + this.width
306
+ : e.clientX >= this.left + this.containerLeft + this.width;
307
+ if (isValid) {
308
+ fn(difference);
309
+ }
310
+ }
311
+ handleDragTop(difference) {
312
+ const initialHeight = this.height;
313
+ this.height = this.toBoundedValue(this.height + difference.y, this.minHeight || 0, this.maxHeight);
314
+ const heightDifference = this.height - initialHeight;
315
+ this.top -= heightDifference;
316
+ }
317
+ handleDragBottom(difference) {
318
+ this.height = this.toBoundedValue(this.height - difference.y, this.minHeight || 0, this.maxHeight);
319
+ }
320
+ handleDragLeft(difference) {
321
+ const initialWidth = this.width;
322
+ this.width = this.toBoundedValue(this.width + difference.x, this.minWidth || 0, this.maxWidth);
323
+ const widthDifference = this.width - initialWidth;
324
+ this.left -= widthDifference;
325
+ }
326
+ handleDragRight(difference) {
327
+ this.width = this.toBoundedValue(this.width - difference.x, this.minWidth || 0, this.maxWidth);
328
+ }
329
+ setStartPosition(e, location) {
330
+ e.stopPropagation();
331
+ e.preventDefault();
332
+ this.lastPointerPosition = { x: e.clientX, y: e.clientY };
333
+ this.dragStartLocation = location;
334
+ }
335
+ getSlottedElement() {
336
+ var _a, _b, _c;
337
+ if (this.contentSelector != null) {
338
+ return (((_a = this.hostElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector(this.contentSelector)) ||
339
+ this.hostElement.querySelector(this.contentSelector) ||
340
+ undefined);
341
+ }
342
+ else {
343
+ const contentSlot = ((_b = this.hostElement.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('slot')) || undefined;
344
+ if (((_c = contentSlot === null || contentSlot === void 0 ? void 0 : contentSlot.assignedElements) === null || _c === void 0 ? void 0 : _c.call(contentSlot).length) || 0 > 0) {
345
+ return contentSlot === null || contentSlot === void 0 ? void 0 : contentSlot.assignedElements()[0];
346
+ }
347
+ }
348
+ }
349
+ getMinBounds() {
350
+ const boundedMinHeight = this.minHeight != null ? this.height - this.minHeight : this.height;
351
+ const boundedMinWidth = this.minWidth != null ? this.width - this.minWidth : this.width;
352
+ return {
353
+ x: boundedMinWidth,
354
+ y: boundedMinHeight,
355
+ };
356
+ }
357
+ fromComputedStyle(value, base) {
358
+ const parsed = parseFloat(value);
359
+ if (isNaN(parsed) || parsed <= 0) {
360
+ return undefined;
361
+ }
362
+ else if (value.includes('%')) {
363
+ return (parsed / 100) * base;
364
+ }
365
+ else {
366
+ return parsed;
367
+ }
368
+ }
369
+ toBoundedValue(value, min, max) {
370
+ return Math.max(Math.min(value, max !== null && max !== void 0 ? max : value), min);
371
+ }
372
+ getSiblingMinWidth(base) {
373
+ var _a;
374
+ const sibling = this.horizontalSiblingSelector != null
375
+ ? document.querySelector(this.horizontalSiblingSelector)
376
+ : undefined;
377
+ if (typeof window !== 'undefined' && sibling) {
378
+ const siblingComputedStyles = window.getComputedStyle(sibling);
379
+ return (_a = this.fromComputedStyle(siblingComputedStyles.minWidth, base)) !== null && _a !== void 0 ? _a : 0;
380
+ }
381
+ return 0;
382
+ }
383
+ getSiblingMinHeight(base) {
384
+ var _a;
385
+ const sibling = this.verticalSiblingSelector != null
386
+ ? document.querySelector(this.verticalSiblingSelector)
387
+ : undefined;
388
+ if (typeof window !== 'undefined' && sibling) {
389
+ const siblingComputedStyles = window.getComputedStyle(sibling);
390
+ return (_a = this.fromComputedStyle(siblingComputedStyles.minHeight, base)) !== null && _a !== void 0 ? _a : 0;
391
+ }
392
+ return 0;
393
+ }
394
+ emitResizeStart(location) {
395
+ readDOM(() => {
396
+ this.resizeStart.emit(this.computeResizeEventDetails(location));
397
+ });
398
+ }
399
+ emitResizeEnd(location) {
400
+ readDOM(() => {
401
+ this.resizeEnd.emit(this.computeResizeEventDetails(location));
402
+ });
403
+ }
404
+ computeResizeEventDetails(location) {
405
+ var _a, _b, _c, _d, _e;
406
+ const parentBounds = this.parentSelector != null
407
+ ? (_a = document.querySelector(this.parentSelector)) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()
408
+ : undefined;
409
+ return {
410
+ location,
411
+ width: this.width,
412
+ height: this.height,
413
+ widthPercentage: this.width /
414
+ ((_c = (_b = this.maxWidth) !== null && _b !== void 0 ? _b : parentBounds === null || parentBounds === void 0 ? void 0 : parentBounds.width) !== null && _c !== void 0 ? _c : window.innerWidth),
415
+ heightPercentage: this.height /
416
+ ((_e = (_d = this.maxHeight) !== null && _d !== void 0 ? _d : parentBounds === null || parentBounds === void 0 ? void 0 : parentBounds.height) !== null && _e !== void 0 ? _e : window.innerHeight),
417
+ };
418
+ }
419
+ get hostElement() { return this; }
420
+ static get style() { return resizableCss; }
421
+ }, [1, "vertex-resizable", {
422
+ "horizontalDirection": [1, "horizontal-direction"],
423
+ "verticalDirection": [1, "vertical-direction"],
424
+ "initialHorizontalScale": [2, "initial-horizontal-scale"],
425
+ "initialVerticalScale": [2, "initial-vertical-scale"],
426
+ "initializeWithOffset": [4, "initialize-with-offset"],
427
+ "parentSelector": [1, "parent-selector"],
428
+ "verticalSiblingSelector": [1, "vertical-sibling-selector"],
429
+ "horizontalSiblingSelector": [1, "horizontal-sibling-selector"],
430
+ "contentSelector": [1, "content-selector"],
431
+ "position": [1],
432
+ "dimensionsComputed": [1540, "dimensions-computed"],
433
+ "width": [32],
434
+ "minWidth": [32],
435
+ "maxWidth": [32],
436
+ "height": [32],
437
+ "minHeight": [32],
438
+ "maxHeight": [32],
439
+ "left": [32],
440
+ "top": [32],
441
+ "hoveredLocation": [32],
442
+ "dragStartLocation": [32],
443
+ "updateDimensions": [64]
444
+ }]);
445
+ function defineCustomElement$1() {
446
+ if (typeof customElements === "undefined") {
447
+ return;
448
+ }
449
+ const components = ["vertex-resizable"];
450
+ components.forEach(tagName => { switch (tagName) {
451
+ case "vertex-resizable":
452
+ if (!customElements.get(tagName)) {
453
+ customElements.define(tagName, Resizable);
454
+ }
455
+ break;
456
+ } });
457
+ }
458
+ defineCustomElement$1();
459
+
460
+ const VertexResizable = Resizable;
461
+ const defineCustomElement = defineCustomElement$1;
462
+
463
+ export { Resizable as R, VertexResizable, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VertexResultList extends Components.VertexResultList, HTMLElement {}
4
+ export const VertexResultList: {
5
+ prototype: VertexResultList;
6
+ new (): VertexResultList;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { R as ResultList, d as defineCustomElement$1 } from './result-list.js';
2
+
3
+ const VertexResultList = ResultList;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { VertexResultList, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VertexSearchBar extends Components.VertexSearchBar, HTMLElement {}
4
+ export const VertexSearchBar: {
5
+ prototype: VertexSearchBar;
6
+ new (): VertexSearchBar;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;