@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,200 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, readTask } 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 selectCss = ":host{--select-width:100%;--select-option-white-space:normal;--max-dropdown-height:80vh}.root{display:inline-block;color:var(--vertex-ui-neutral-700);width:var(--select-width);font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-base);overflow:hidden;user-select:none}.root:not(.disabled):hover{color:var(--vertex-ui-neutral-800)}.root.disabled{color:var(--vertex-ui-neutral-400)}.target,.selected-option{background-color:var(--vertex-ui-neutral-200);width:100%;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;padding:0.375rem 0.75rem 0.375rem 0.75rem}.target.hidden{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%)}.selected-option.disabled,.target.disabled{background-color:var(--vertex-ui-neutral-100);cursor:default}.target{border-radius:4px}.text{white-space:var(--select-option-white-space);overflow:hidden;text-overflow:ellipsis}.icon{padding-left:1rem;margin-left:auto}.options{position:relative;cursor:pointer;background-color:var(--vertex-ui-white);border-radius:4px;padding:0.25rem 0;top:-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%);max-height:var(--max-dropdown-height);overflow-y:auto}.options.animated{transition:opacity 0.1s ease-in 0.05s;opacity:0}.options.hidden{background-color:transparent}.options.visible{opacity:1}.options>*,.options>slot::slotted(*){padding:0.375rem 0.75rem 0.375rem 0.75rem}.options.hidden>*,.options.hidden>slot::slotted(*){opacity:0}.options>slot::slotted(:hover){background-color:var(--vertex-ui-neutral-200)}.options>slot::slotted([data-selected=\"true\"]){display:none}vertex-popover{--transform-origin:top left;--open-animation-name:open-scale-y;--close-animation-name:close-scale-y}";
|
|
7
|
+
|
|
8
|
+
const GET_BOUNDS_DEBOUNCE_THRESHOLD = 200;
|
|
9
|
+
const Select = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
this.optionChanged = createEvent(this, "optionChanged", 7);
|
|
15
|
+
this.removeListeners = [];
|
|
16
|
+
this.controlled = false;
|
|
17
|
+
this.value = undefined;
|
|
18
|
+
this.placeholder = 'Select an option...';
|
|
19
|
+
this.disabled = false;
|
|
20
|
+
this.animated = true;
|
|
21
|
+
this.hideSelected = true;
|
|
22
|
+
this.open = false;
|
|
23
|
+
this.position = undefined;
|
|
24
|
+
this.displayValue = undefined;
|
|
25
|
+
this.resizeObserverFactory = (cb) => new ResizeObserver(cb);
|
|
26
|
+
this.handleOpen = this.handleOpen.bind(this);
|
|
27
|
+
this.handleDismiss = this.handleDismiss.bind(this);
|
|
28
|
+
this.getBounds = this.getBounds.bind(this);
|
|
29
|
+
}
|
|
30
|
+
componentDidLoad() {
|
|
31
|
+
var _a;
|
|
32
|
+
this.resizeObserver = this.resizeObserverFactory(() => this.getBounds());
|
|
33
|
+
if (this.rootRef != null) {
|
|
34
|
+
this.resizeObserver.observe(this.rootRef);
|
|
35
|
+
}
|
|
36
|
+
this.slotElement =
|
|
37
|
+
((_a = this.hostElement.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot')) || undefined;
|
|
38
|
+
if (this.value != null) {
|
|
39
|
+
this.handleUpdateValue(this.value);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.handleUpdateDisplayValue();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
connectedCallback() {
|
|
46
|
+
window.addEventListener('resize', this.getBounds);
|
|
47
|
+
}
|
|
48
|
+
disconnectedCallback() {
|
|
49
|
+
var _a;
|
|
50
|
+
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
51
|
+
window.removeEventListener('resize', this.getBounds);
|
|
52
|
+
this.removeOptionListeners();
|
|
53
|
+
}
|
|
54
|
+
handleUpdateValue(value) {
|
|
55
|
+
if (value != null && value !== this.internalValue) {
|
|
56
|
+
this.internalValue = value;
|
|
57
|
+
this.updateDisplayValue(value);
|
|
58
|
+
}
|
|
59
|
+
this.controlled = value != null;
|
|
60
|
+
}
|
|
61
|
+
handleUpdateDisplayValue() {
|
|
62
|
+
var _a;
|
|
63
|
+
this.clearSelectedOptionFlag();
|
|
64
|
+
if (this.hideSelected) {
|
|
65
|
+
(_a = this.getSelectedOption()) === null || _a === void 0 ? void 0 : _a.setAttribute('data-selected', 'true');
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
render() {
|
|
69
|
+
return (h("div", { class: classnames('root', {
|
|
70
|
+
disabled: this.disabled,
|
|
71
|
+
}), ref: (element) => {
|
|
72
|
+
this.rootRef = element;
|
|
73
|
+
}, onClick: !this.open && !this.disabled ? this.handleOpen : undefined }, h("div", { class: classnames('target', {
|
|
74
|
+
hidden: this.open,
|
|
75
|
+
disabled: this.disabled,
|
|
76
|
+
}) }, h("div", { class: "text" }, this.displayValue || this.placeholder), h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("vertex-popover", { position: this.position, open: this.open, animated: this.animated, resizeBehavior: "fixed", onDismissed: this.handleDismiss }, h("div", { class: classnames('options', {
|
|
77
|
+
hidden: !this.open,
|
|
78
|
+
visible: this.open,
|
|
79
|
+
animated: this.animated,
|
|
80
|
+
}), style: {
|
|
81
|
+
minWidth: this.width != null ? `${this.width}px` : 'var(--select-width)',
|
|
82
|
+
} }, h("div", { class: classnames('selected-option', {
|
|
83
|
+
disabled: this.disabled,
|
|
84
|
+
}), onClick: this.handleDismiss }, h("div", { class: "text" }, this.displayValue || this.placeholder), h("div", { class: "icon" }, h("vertex-icon", { name: "chevron-down", size: "sm" }))), h("slot", null)))));
|
|
85
|
+
}
|
|
86
|
+
handleOpen() {
|
|
87
|
+
var _a, _b;
|
|
88
|
+
(_b = (_a = this.slotElement) === null || _a === void 0 ? void 0 : _a.assignedElements) === null || _b === void 0 ? void 0 : _b.call(_a).forEach((e) => {
|
|
89
|
+
const listener = () => {
|
|
90
|
+
var _a;
|
|
91
|
+
const updatedValue = e.getAttribute('data-value') || e.innerHTML;
|
|
92
|
+
const valueChanged = updatedValue !== this.internalValue;
|
|
93
|
+
this.handleDismiss();
|
|
94
|
+
if (!this.controlled) {
|
|
95
|
+
this.displayValue = e.innerHTML;
|
|
96
|
+
this.internalValue = updatedValue;
|
|
97
|
+
}
|
|
98
|
+
if (valueChanged) {
|
|
99
|
+
(_a = this.optionChanged) === null || _a === void 0 ? void 0 : _a.emit(updatedValue);
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
e.addEventListener('click', listener);
|
|
103
|
+
this.removeListeners = [
|
|
104
|
+
...this.removeListeners,
|
|
105
|
+
() => e.removeEventListener('click', listener),
|
|
106
|
+
];
|
|
107
|
+
});
|
|
108
|
+
this.open = true;
|
|
109
|
+
}
|
|
110
|
+
handleDismiss() {
|
|
111
|
+
this.removeOptionListeners();
|
|
112
|
+
this.open = false;
|
|
113
|
+
}
|
|
114
|
+
updateDisplayValue(value) {
|
|
115
|
+
var _a, _b;
|
|
116
|
+
const option = (_b = (_a = this.slotElement) === null || _a === void 0 ? void 0 : _a.assignedElements) === null || _b === void 0 ? void 0 : _b.call(_a).find((e) => e.getAttribute('data-value') === value || e.innerHTML === value);
|
|
117
|
+
this.displayValue = option === null || option === void 0 ? void 0 : option.innerHTML;
|
|
118
|
+
}
|
|
119
|
+
removeOptionListeners() {
|
|
120
|
+
this.removeListeners.forEach((l) => l());
|
|
121
|
+
this.removeListeners = [];
|
|
122
|
+
}
|
|
123
|
+
clearSelectedOptionFlag() {
|
|
124
|
+
var _a, _b;
|
|
125
|
+
(_b = (_a = this.slotElement) === null || _a === void 0 ? void 0 : _a.assignedElements) === null || _b === void 0 ? void 0 : _b.call(_a).forEach((e) => e.removeAttribute('data-selected'));
|
|
126
|
+
}
|
|
127
|
+
getSelectedOption() {
|
|
128
|
+
var _a, _b, _c;
|
|
129
|
+
const value = (_a = this.displayValue) !== null && _a !== void 0 ? _a : this.placeholder;
|
|
130
|
+
return (_c = (_b = this.slotElement) === null || _b === void 0 ? void 0 : _b.assignedElements) === null || _c === void 0 ? void 0 : _c.call(_b).find((e) => e.getAttribute('data-value') === value || e.innerHTML === value);
|
|
131
|
+
}
|
|
132
|
+
getBounds() {
|
|
133
|
+
if (this.getBoundsTimeout != null) {
|
|
134
|
+
clearTimeout(this.getBoundsTimeout);
|
|
135
|
+
this.getBoundsTimeout = undefined;
|
|
136
|
+
}
|
|
137
|
+
this.getBoundsTimeout = setTimeout(() => {
|
|
138
|
+
this.getBoundsTimeout = undefined;
|
|
139
|
+
readTask(() => {
|
|
140
|
+
var _a;
|
|
141
|
+
const bounds = (_a = this.rootRef) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
142
|
+
if (bounds != null) {
|
|
143
|
+
const position = {
|
|
144
|
+
x: bounds.x,
|
|
145
|
+
y: bounds.y,
|
|
146
|
+
};
|
|
147
|
+
this.position = position;
|
|
148
|
+
this.width = bounds.width;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}, GET_BOUNDS_DEBOUNCE_THRESHOLD);
|
|
152
|
+
}
|
|
153
|
+
get hostElement() { return this; }
|
|
154
|
+
static get watchers() { return {
|
|
155
|
+
"value": ["handleUpdateValue"],
|
|
156
|
+
"displayValue": ["handleUpdateDisplayValue"],
|
|
157
|
+
"hideSelected": ["handleUpdateDisplayValue"],
|
|
158
|
+
"placeholder": ["handleUpdateDisplayValue"]
|
|
159
|
+
}; }
|
|
160
|
+
static get style() { return selectCss; }
|
|
161
|
+
}, [1, "vertex-select", {
|
|
162
|
+
"value": [513],
|
|
163
|
+
"placeholder": [513],
|
|
164
|
+
"disabled": [516],
|
|
165
|
+
"animated": [4],
|
|
166
|
+
"hideSelected": [4, "hide-selected"],
|
|
167
|
+
"resizeObserverFactory": [16],
|
|
168
|
+
"open": [32],
|
|
169
|
+
"position": [32],
|
|
170
|
+
"displayValue": [32]
|
|
171
|
+
}]);
|
|
172
|
+
function defineCustomElement$1() {
|
|
173
|
+
if (typeof customElements === "undefined") {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
const components = ["vertex-select", "vertex-icon", "vertex-popover"];
|
|
177
|
+
components.forEach(tagName => { switch (tagName) {
|
|
178
|
+
case "vertex-select":
|
|
179
|
+
if (!customElements.get(tagName)) {
|
|
180
|
+
customElements.define(tagName, Select);
|
|
181
|
+
}
|
|
182
|
+
break;
|
|
183
|
+
case "vertex-icon":
|
|
184
|
+
if (!customElements.get(tagName)) {
|
|
185
|
+
defineCustomElement$3();
|
|
186
|
+
}
|
|
187
|
+
break;
|
|
188
|
+
case "vertex-popover":
|
|
189
|
+
if (!customElements.get(tagName)) {
|
|
190
|
+
defineCustomElement$2();
|
|
191
|
+
}
|
|
192
|
+
break;
|
|
193
|
+
} });
|
|
194
|
+
}
|
|
195
|
+
defineCustomElement$1();
|
|
196
|
+
|
|
197
|
+
const VertexSelect = Select;
|
|
198
|
+
const defineCustomElement = defineCustomElement$1;
|
|
199
|
+
|
|
200
|
+
export { Select as S, VertexSelect, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexSlider extends Components.VertexSlider, HTMLElement {}
|
|
4
|
+
export const VertexSlider: {
|
|
5
|
+
prototype: VertexSlider;
|
|
6
|
+
new (): VertexSlider;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as classnames } from './index2.js';
|
|
3
|
+
import { b as blurElement } from './dom.js';
|
|
4
|
+
import { d as defineCustomElement$3 } from './popover.js';
|
|
5
|
+
import { d as defineCustomElement$2 } from './tooltip.js';
|
|
6
|
+
|
|
7
|
+
const sliderCss = ":host{display:flex;--vertex-slider-track-color:var(--vertex-ui-neutral-400);--vertex-slider-thumb-color:var(--vertex-ui-blue-700)}:host([size=\"sm\"]){height:12px}:host([size=\"md\"]){height:14px}:host([size=\"lg\"]){height:16px}.input{-webkit-appearance:none;width:100%;height:100%;background:transparent;margin:0}.input:not(.disabled){cursor:pointer}.input.sm{height:12px}.input.md{height:14px}.input.lg{height:16px}.input.disabled{opacity:0.5}.tooltip{width:100%}.input::-webkit-slider-runnable-track{width:100%;height:2px;cursor:default;background:var(--vertex-slider-track-color);border-radius:1px}.input::-moz-range-track{width:100%;height:2px;cursor:default;background:var(--vertex-slider-track-color);border-radius:1px}.input::-ms-track{width:100%;height:2px;cursor:default;background:var(--vertex-slider-track-color);border-radius:1px}.input:not(.disabled)::-webkit-slider-runnable-track{cursor:pointer}.input:not(.disabled)::-moz-range-track{cursor:pointer}.input:not(.disabled)::-ms-track{cursor:pointer}.input.sm::-webkit-slider-thumb{height:12px;width:12px;margin-top:-5px}.input.sm::-moz-range-thumb{height:12px;width:12px;margin-top:-5px}.input.sm::-ms-thumb{height:12px;width:12px;margin-top:-5px}.input.md::-webkit-slider-thumb{height:14px;width:14px;margin-top:-6px}.input.md::-moz-range-thumb{height:14px;width:14px;margin-top:-6px}.input.md::-ms-thumb{height:14px;width:14px;margin-top:-6px}.input.lg::-webkit-slider-thumb{height:16px;width:16px;margin-top:-7px}.input.lg::-moz-range-thumb{height:16px;width:16px;margin-top:-7px}.input.lg::-ms-thumb{height:16px;width:16px;margin-top:-7px}.input::-webkit-slider-thumb{-webkit-appearance:none;border-radius:50%;background:var(--vertex-slider-thumb-color);border:none;cursor:default}.input::-moz-range-thumb{-webkit-appearance:none;border-radius:50%;background:var(--vertex-slider-thumb-color);border:none;cursor:default}.input::-ms-thumb{-webkit-appearance:none;border-radius:50%;background:var(--vertex-slider-thumb-color);border:none;cursor:default}.input:not(.disabled)::-webkit-slider-thumb{cursor:grab}.input:not(.disabled)::-moz-range-thumb{cursor:grab}.input:not(.disabled)::-ms-thumb{cursor:grab}.input::-webkit-slider-thumb:active{cursor:grabbing;box-shadow:0 1px 2px var(--vertex-ui-black)}.input::-moz-range-thumb:active{cursor:grabbing;box-shadow:0 1px 2px var(--vertex-ui-black)}.input::-ms-thumb:active{cursor:grabbing;box-shadow:0 1px 2px var(--vertex-ui-black)}";
|
|
8
|
+
|
|
9
|
+
const Slider = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super();
|
|
12
|
+
this.__registerHost();
|
|
13
|
+
this.__attachShadow();
|
|
14
|
+
this.valueChange = createEvent(this, "valueChange", 7);
|
|
15
|
+
this.valueInput = createEvent(this, "valueInput", 7);
|
|
16
|
+
this.handleChange = (event) => {
|
|
17
|
+
this.updateValueFromEvent(event);
|
|
18
|
+
this.valueChange.emit({ value: this.value, nativeEvent: event });
|
|
19
|
+
};
|
|
20
|
+
this.handleInput = (event) => {
|
|
21
|
+
this.updateValueFromEvent(event);
|
|
22
|
+
this.valueInput.emit({ value: this.value, nativeEvent: event });
|
|
23
|
+
};
|
|
24
|
+
this.min = 0;
|
|
25
|
+
this.max = 100;
|
|
26
|
+
this.valueLabelDisplay = 'off';
|
|
27
|
+
this.step = undefined;
|
|
28
|
+
this.size = 'sm';
|
|
29
|
+
this.value = 0;
|
|
30
|
+
this.disabled = false;
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
return (h("vertex-tooltip", { disabled: this.valueLabelDisplay === 'off', content: `${this.value}`, placement: 'top', class: "tooltip" }, h("input", { class: classnames('input', { disabled: this.disabled }, this.size), type: "range", disabled: this.disabled, min: this.min, max: this.max, step: this.step, value: this.value, onChange: this.handleChange, onInput: this.handleInput, onPointerUp: () => {
|
|
34
|
+
// Blur the slider on pointerup to prevent an issue where pressing
|
|
35
|
+
// any key on the keyboard would result in a focus state.
|
|
36
|
+
blurElement(this.hostEl);
|
|
37
|
+
} })));
|
|
38
|
+
}
|
|
39
|
+
updateValueFromEvent(event) {
|
|
40
|
+
this.value = event.target.valueAsNumber;
|
|
41
|
+
}
|
|
42
|
+
get hostEl() { return this; }
|
|
43
|
+
static get style() { return sliderCss; }
|
|
44
|
+
}, [1, "vertex-slider", {
|
|
45
|
+
"min": [2],
|
|
46
|
+
"max": [2],
|
|
47
|
+
"valueLabelDisplay": [1, "value-label-display"],
|
|
48
|
+
"step": [8],
|
|
49
|
+
"size": [1],
|
|
50
|
+
"value": [1026],
|
|
51
|
+
"disabled": [4]
|
|
52
|
+
}]);
|
|
53
|
+
function defineCustomElement$1() {
|
|
54
|
+
if (typeof customElements === "undefined") {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const components = ["vertex-slider", "vertex-popover", "vertex-tooltip"];
|
|
58
|
+
components.forEach(tagName => { switch (tagName) {
|
|
59
|
+
case "vertex-slider":
|
|
60
|
+
if (!customElements.get(tagName)) {
|
|
61
|
+
customElements.define(tagName, Slider);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
case "vertex-popover":
|
|
65
|
+
if (!customElements.get(tagName)) {
|
|
66
|
+
defineCustomElement$3();
|
|
67
|
+
}
|
|
68
|
+
break;
|
|
69
|
+
case "vertex-tooltip":
|
|
70
|
+
if (!customElements.get(tagName)) {
|
|
71
|
+
defineCustomElement$2();
|
|
72
|
+
}
|
|
73
|
+
break;
|
|
74
|
+
} });
|
|
75
|
+
}
|
|
76
|
+
defineCustomElement$1();
|
|
77
|
+
|
|
78
|
+
const VertexSlider = Slider;
|
|
79
|
+
const defineCustomElement = defineCustomElement$1;
|
|
80
|
+
|
|
81
|
+
export { Slider as S, VertexSlider, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexSpinner extends Components.VertexSpinner, HTMLElement {}
|
|
4
|
+
export const VertexSpinner: {
|
|
5
|
+
prototype: VertexSpinner;
|
|
6
|
+
new (): VertexSpinner;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as classnames } from './index2.js';
|
|
3
|
+
|
|
4
|
+
const spinnerCss = ".spinner{position:relative;display:flex}.spinner div{position:absolute;display:block;animation:spinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;border-radius:50%;border-style:solid;box-sizing:border-box}.spinner div:nth-child(1){animation-delay:-0.45s}.spinner div:nth-child(2){animation-delay:-0.3s}.spinner div:nth-child(3){animation-delay:-0.15s}.spinner.xs{height:16px;width:16px}.spinner.xs div{border-width:var(--border-width, 1px);height:16px;width:16px;margin:0}.spinner.sm{height:23px;width:23px}.spinner.sm div{border-width:var(--border-width, 3px);height:18px;width:18px;margin:2px}.spinner.md{height:32px;width:32px}.spinner.md div{border-width:var(--border-width, 3px);height:32px;width:32px;margin:2px}.spinner.lg{height:64px;width:64px}.spinner.lg div{border-width:var(--border-width, 6px);height:51px;width:51px;margin:6px}.spinner.blue div{border-color:var(--vertex-ui-blue-700) transparent transparent transparent}.spinner.white div{border-color:var(--vertex-ui-white) transparent transparent transparent}.spinner.grey div{border-color:var(--vertex-ui-neutral-700) transparent transparent transparent}@keyframes spinner{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
|
|
5
|
+
|
|
6
|
+
const Spinner = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.color = 'blue';
|
|
12
|
+
this.size = 'lg';
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
const classes = classnames('spinner', {
|
|
16
|
+
blue: this.color === 'blue',
|
|
17
|
+
white: this.color === 'white',
|
|
18
|
+
grey: this.color === 'grey',
|
|
19
|
+
xs: this.size === 'xs',
|
|
20
|
+
sm: this.size === 'sm',
|
|
21
|
+
md: this.size === 'md',
|
|
22
|
+
lg: this.size === 'lg',
|
|
23
|
+
});
|
|
24
|
+
return (h("div", { class: classes }, h("div", null), h("div", null), h("div", null), h("div", null)));
|
|
25
|
+
}
|
|
26
|
+
static get style() { return spinnerCss; }
|
|
27
|
+
}, [1, "vertex-spinner", {
|
|
28
|
+
"color": [1],
|
|
29
|
+
"size": [1]
|
|
30
|
+
}]);
|
|
31
|
+
function defineCustomElement$1() {
|
|
32
|
+
if (typeof customElements === "undefined") {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const components = ["vertex-spinner"];
|
|
36
|
+
components.forEach(tagName => { switch (tagName) {
|
|
37
|
+
case "vertex-spinner":
|
|
38
|
+
if (!customElements.get(tagName)) {
|
|
39
|
+
customElements.define(tagName, Spinner);
|
|
40
|
+
}
|
|
41
|
+
break;
|
|
42
|
+
} });
|
|
43
|
+
}
|
|
44
|
+
defineCustomElement$1();
|
|
45
|
+
|
|
46
|
+
const VertexSpinner = Spinner;
|
|
47
|
+
const defineCustomElement = defineCustomElement$1;
|
|
48
|
+
|
|
49
|
+
export { Spinner as S, VertexSpinner, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexTab extends Components.VertexTab, HTMLElement {}
|
|
4
|
+
export const VertexTab: {
|
|
5
|
+
prototype: VertexTab;
|
|
6
|
+
new (): VertexTab;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { c as classnames } from './index2.js';
|
|
3
|
+
|
|
4
|
+
const tabCss = ":host{position:relative;width:100%;height:100%}.content{display:none;height:0px}.content.active{display:flex;width:100%;height:100%}";
|
|
5
|
+
|
|
6
|
+
const Tab = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
7
|
+
constructor() {
|
|
8
|
+
super();
|
|
9
|
+
this.__registerHost();
|
|
10
|
+
this.__attachShadow();
|
|
11
|
+
this.tabClick = createEvent(this, "tabClick", 7);
|
|
12
|
+
this.handleClick = () => {
|
|
13
|
+
this.tabClick.emit(this.label);
|
|
14
|
+
};
|
|
15
|
+
this.label = undefined;
|
|
16
|
+
this.active = false;
|
|
17
|
+
}
|
|
18
|
+
render() {
|
|
19
|
+
return (h(Host, null, h("div", { class: classnames('content', {
|
|
20
|
+
active: this.active,
|
|
21
|
+
}) }, h("slot", null))));
|
|
22
|
+
}
|
|
23
|
+
static get style() { return tabCss; }
|
|
24
|
+
}, [1, "vertex-tab", {
|
|
25
|
+
"label": [1],
|
|
26
|
+
"active": [4]
|
|
27
|
+
}]);
|
|
28
|
+
function defineCustomElement$1() {
|
|
29
|
+
if (typeof customElements === "undefined") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const components = ["vertex-tab"];
|
|
33
|
+
components.forEach(tagName => { switch (tagName) {
|
|
34
|
+
case "vertex-tab":
|
|
35
|
+
if (!customElements.get(tagName)) {
|
|
36
|
+
customElements.define(tagName, Tab);
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
} });
|
|
40
|
+
}
|
|
41
|
+
defineCustomElement$1();
|
|
42
|
+
|
|
43
|
+
const VertexTab = Tab;
|
|
44
|
+
const defineCustomElement = defineCustomElement$1;
|
|
45
|
+
|
|
46
|
+
export { Tab as T, VertexTab, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexTabs extends Components.VertexTabs, HTMLElement {}
|
|
4
|
+
export const VertexTabs: {
|
|
5
|
+
prototype: VertexTabs;
|
|
6
|
+
new (): VertexTabs;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,133 @@
|
|
|
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, g as getBoundingClientRect } from './dom.js';
|
|
4
|
+
|
|
5
|
+
function isTabElement(element) {
|
|
6
|
+
return element.tagName === 'VERTEX-TAB';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const tabsCss = "button{border:none;background-color:transparent;font-family:var(--vertex-ui-font-family);font-size:0.875rem;padding:0}:host{display:flex;position:relative;width:100%;height:100%}.wrapper{display:flex;flex-direction:column;position:relative;height:100%;width:100%}.labels{display:flex;position:relative;border-bottom:solid 1px var(--vertex-ui-neutral-300)}.indicator{position:absolute;bottom:0;height:3px;background-color:var(--vertex-ui-blue-700);transition:left 0.2s ease-in-out}.label{position:relative;cursor:pointer;color:var(--vertex-ui-neutral-700);white-space:nowrap;font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-md);padding:0.75rem 1.25rem}.label:not(.active):hover{color:var(--vertex-ui-neutral-800)}.label.active{color:var(--vertex-ui-blue-700);font-weight:var(--vertex-ui-font-weight-bold)}.hidden-label-text{font-weight:bold;visibility:hidden;height:0px}.tab-content{display:flex;height:5%;flex-grow:1}";
|
|
10
|
+
|
|
11
|
+
const Tabs = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
this.__registerHost();
|
|
15
|
+
this.__attachShadow();
|
|
16
|
+
this.selectedTabChanged = createEvent(this, "selectedTabChanged", 7);
|
|
17
|
+
this.indicatorInitialized = false;
|
|
18
|
+
this.handleLabelClick = (label) => {
|
|
19
|
+
if (this.active != null) {
|
|
20
|
+
this.updateActiveOnTab(this.active, false);
|
|
21
|
+
}
|
|
22
|
+
this.active = label;
|
|
23
|
+
this.updateActiveOnTab(this.active, true);
|
|
24
|
+
this.selectedTabChanged.emit(label);
|
|
25
|
+
};
|
|
26
|
+
this.updateActiveOnTab = (label, active) => {
|
|
27
|
+
const activeTab = this.findTabByLabel(label);
|
|
28
|
+
if (activeTab != null) {
|
|
29
|
+
activeTab.active = active;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
this.findTabByLabel = (label) => {
|
|
33
|
+
var _a;
|
|
34
|
+
const slotEl = ((_a = this.hostEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot:not([name])')) || undefined;
|
|
35
|
+
const slotAssignedElements = slotEl === null || slotEl === void 0 ? void 0 : slotEl.assignedElements();
|
|
36
|
+
const slotChildren = slotAssignedElements != null && slotAssignedElements.length > 0
|
|
37
|
+
? Array.from(slotAssignedElements[0].children)
|
|
38
|
+
: undefined;
|
|
39
|
+
return slotChildren != null
|
|
40
|
+
? slotChildren.filter(isTabElement).find((el) => el.label === label)
|
|
41
|
+
: undefined;
|
|
42
|
+
};
|
|
43
|
+
this.updateTabLabels = () => {
|
|
44
|
+
var _a;
|
|
45
|
+
const slotEl = ((_a = this.hostEl.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot:not([name])')) || undefined;
|
|
46
|
+
const slotAssignedElements = slotEl === null || slotEl === void 0 ? void 0 : slotEl.assignedElements();
|
|
47
|
+
const slotChildren = slotAssignedElements != null && slotAssignedElements.length > 0
|
|
48
|
+
? Array.from(slotAssignedElements[0].children)
|
|
49
|
+
: undefined;
|
|
50
|
+
this.labels =
|
|
51
|
+
slotChildren != null
|
|
52
|
+
? slotChildren.filter(isTabElement).map((t) => t.label)
|
|
53
|
+
: [];
|
|
54
|
+
};
|
|
55
|
+
this.active = undefined;
|
|
56
|
+
this.labels = [];
|
|
57
|
+
this.activeBounds = undefined;
|
|
58
|
+
this.activeButtonEl = undefined;
|
|
59
|
+
}
|
|
60
|
+
componentWillLoad() {
|
|
61
|
+
this.updateTabLabels();
|
|
62
|
+
}
|
|
63
|
+
componentDidLoad() {
|
|
64
|
+
if (this.active != null) {
|
|
65
|
+
this.updateActiveOnTab(this.active, true);
|
|
66
|
+
}
|
|
67
|
+
this.indicatorInitialized = false;
|
|
68
|
+
this.handleActiveButtonChange();
|
|
69
|
+
}
|
|
70
|
+
componentDidUpdate() {
|
|
71
|
+
// Place the indicator if it hasn't been initialized yet
|
|
72
|
+
if (!this.indicatorInitialized) {
|
|
73
|
+
this.handleActiveButtonChange();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
handleActiveButtonChange() {
|
|
77
|
+
const button = this.activeButtonEl;
|
|
78
|
+
if (button != null) {
|
|
79
|
+
readDOM(() => {
|
|
80
|
+
const hostElBounds = getBoundingClientRect(this.hostEl);
|
|
81
|
+
const activeBounds = getBoundingClientRect(button);
|
|
82
|
+
this.activeBounds = {
|
|
83
|
+
x: activeBounds.x - hostElBounds.x,
|
|
84
|
+
width: activeBounds.width,
|
|
85
|
+
};
|
|
86
|
+
if (this.activeBounds.width !== 0) {
|
|
87
|
+
this.indicatorInitialized = true;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
render() {
|
|
93
|
+
return (h(Host, null, h("div", { class: "wrapper" }, h("div", { class: "labels" }, this.labels.map((label) => (h("button", { class: classnames('label', {
|
|
94
|
+
active: this.active === label,
|
|
95
|
+
}), "data-label": label, ref: (el) => {
|
|
96
|
+
if (this.active === label) {
|
|
97
|
+
this.activeButtonEl = el;
|
|
98
|
+
}
|
|
99
|
+
}, onClick: () => this.handleLabelClick(label) }, label, h("div", { class: "hidden-label-text" }, label)))), h("slot", { name: "label-header" }), this.activeBounds && (h("div", { class: "indicator", style: {
|
|
100
|
+
left: `${this.activeBounds.x}px`,
|
|
101
|
+
width: `${this.activeBounds.width}px`,
|
|
102
|
+
} }))), h("div", { class: "tab-content" }, h("slot", { onSlotchange: this.updateTabLabels })))));
|
|
103
|
+
}
|
|
104
|
+
get hostEl() { return this; }
|
|
105
|
+
static get watchers() { return {
|
|
106
|
+
"activeButtonEl": ["handleActiveButtonChange"]
|
|
107
|
+
}; }
|
|
108
|
+
static get style() { return tabsCss; }
|
|
109
|
+
}, [1, "vertex-tabs", {
|
|
110
|
+
"active": [1025],
|
|
111
|
+
"labels": [32],
|
|
112
|
+
"activeBounds": [32],
|
|
113
|
+
"activeButtonEl": [32]
|
|
114
|
+
}]);
|
|
115
|
+
function defineCustomElement$1() {
|
|
116
|
+
if (typeof customElements === "undefined") {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const components = ["vertex-tabs"];
|
|
120
|
+
components.forEach(tagName => { switch (tagName) {
|
|
121
|
+
case "vertex-tabs":
|
|
122
|
+
if (!customElements.get(tagName)) {
|
|
123
|
+
customElements.define(tagName, Tabs);
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
} });
|
|
127
|
+
}
|
|
128
|
+
defineCustomElement$1();
|
|
129
|
+
|
|
130
|
+
const VertexTabs = Tabs;
|
|
131
|
+
const defineCustomElement = defineCustomElement$1;
|
|
132
|
+
|
|
133
|
+
export { Tabs as T, VertexTabs, defineCustomElement };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface VertexTextfield extends Components.VertexTextfield, HTMLElement {}
|
|
4
|
+
export const VertexTextfield: {
|
|
5
|
+
prototype: VertexTextfield;
|
|
6
|
+
new (): VertexTextfield;
|
|
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 VertexToast extends Components.VertexToast, HTMLElement {}
|
|
4
|
+
export const VertexToast: {
|
|
5
|
+
prototype: VertexToast;
|
|
6
|
+
new (): VertexToast;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|