@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.
Files changed (100) hide show
  1. package/dist/components/auto-resize-textarea.js +157 -0
  2. package/dist/components/color-swatch.js +124 -0
  3. package/dist/components/dom.js +13 -0
  4. package/dist/components/expandable.js +100 -0
  5. package/dist/components/icon-button.js +63 -0
  6. package/dist/components/icon-helper.js +722 -0
  7. package/dist/components/icon.js +43 -0
  8. package/dist/components/index.d.ts +71 -0
  9. package/dist/components/index.js +52 -0
  10. package/dist/components/index2.js +89 -0
  11. package/dist/components/menu.js +89 -0
  12. package/dist/components/popover.js +1737 -0
  13. package/dist/components/result-list.js +565 -0
  14. package/dist/components/slots.js +26 -0
  15. package/dist/components/text-field.js +171 -0
  16. package/dist/components/tooltip.js +360 -0
  17. package/dist/components/tslib.es6.js +65 -0
  18. package/dist/components/vertex-auto-resize-textarea.d.ts +11 -0
  19. package/dist/components/vertex-auto-resize-textarea.js +6 -0
  20. package/dist/components/vertex-avatar-group.d.ts +11 -0
  21. package/dist/components/vertex-avatar-group.js +34 -0
  22. package/dist/components/vertex-avatar.d.ts +11 -0
  23. package/dist/components/vertex-avatar.js +68 -0
  24. package/dist/components/vertex-badge.d.ts +11 -0
  25. package/dist/components/vertex-badge.js +43 -0
  26. package/dist/components/vertex-banner.d.ts +11 -0
  27. package/dist/components/vertex-banner.js +141 -0
  28. package/dist/components/vertex-button.d.ts +11 -0
  29. package/dist/components/vertex-button.js +96 -0
  30. package/dist/components/vertex-card-group.d.ts +11 -0
  31. package/dist/components/vertex-card-group.js +51 -0
  32. package/dist/components/vertex-card.d.ts +11 -0
  33. package/dist/components/vertex-card.js +49 -0
  34. package/dist/components/vertex-chip.d.ts +11 -0
  35. package/dist/components/vertex-chip.js +45 -0
  36. package/dist/components/vertex-click-to-edit-textfield.d.ts +11 -0
  37. package/dist/components/vertex-click-to-edit-textfield.js +156 -0
  38. package/dist/components/vertex-collapsible.d.ts +11 -0
  39. package/dist/components/vertex-collapsible.js +63 -0
  40. package/dist/components/vertex-color-circle-picker.d.ts +11 -0
  41. package/dist/components/vertex-color-circle-picker.js +104 -0
  42. package/dist/components/vertex-color-picker.d.ts +11 -0
  43. package/dist/components/vertex-color-picker.js +75 -0
  44. package/dist/components/vertex-color-swatch.d.ts +11 -0
  45. package/dist/components/vertex-color-swatch.js +6 -0
  46. package/dist/components/vertex-context-menu.d.ts +11 -0
  47. package/dist/components/vertex-context-menu.js +125 -0
  48. package/dist/components/vertex-dialog.d.ts +11 -0
  49. package/dist/components/vertex-dialog.js +263 -0
  50. package/dist/components/vertex-draggable-popover.d.ts +11 -0
  51. package/dist/components/vertex-draggable-popover.js +119 -0
  52. package/dist/components/vertex-dropdown-menu.d.ts +11 -0
  53. package/dist/components/vertex-dropdown-menu.js +64 -0
  54. package/dist/components/vertex-expandable.d.ts +11 -0
  55. package/dist/components/vertex-expandable.js +6 -0
  56. package/dist/components/vertex-help-tooltip.d.ts +11 -0
  57. package/dist/components/vertex-help-tooltip.js +67 -0
  58. package/dist/components/vertex-icon-button.d.ts +11 -0
  59. package/dist/components/vertex-icon-button.js +6 -0
  60. package/dist/components/vertex-icon.d.ts +11 -0
  61. package/dist/components/vertex-icon.js +6 -0
  62. package/dist/components/vertex-logo-loading.d.ts +11 -0
  63. package/dist/components/vertex-logo-loading.js +34 -0
  64. package/dist/components/vertex-menu-divider.d.ts +11 -0
  65. package/dist/components/vertex-menu-divider.js +34 -0
  66. package/dist/components/vertex-menu-item.d.ts +11 -0
  67. package/dist/components/vertex-menu-item.js +44 -0
  68. package/dist/components/vertex-menu.d.ts +11 -0
  69. package/dist/components/vertex-menu.js +6 -0
  70. package/dist/components/vertex-popover.d.ts +11 -0
  71. package/dist/components/vertex-popover.js +6 -0
  72. package/dist/components/vertex-radio-group.d.ts +11 -0
  73. package/dist/components/vertex-radio-group.js +88 -0
  74. package/dist/components/vertex-radio.d.ts +11 -0
  75. package/dist/components/vertex-radio.js +56 -0
  76. package/dist/components/vertex-resizable.d.ts +11 -0
  77. package/dist/components/vertex-resizable.js +445 -0
  78. package/dist/components/vertex-result-list.d.ts +11 -0
  79. package/dist/components/vertex-result-list.js +6 -0
  80. package/dist/components/vertex-search-bar.d.ts +11 -0
  81. package/dist/components/vertex-search-bar.js +568 -0
  82. package/dist/components/vertex-select.d.ts +11 -0
  83. package/dist/components/vertex-select.js +200 -0
  84. package/dist/components/vertex-slider.d.ts +11 -0
  85. package/dist/components/vertex-slider.js +81 -0
  86. package/dist/components/vertex-spinner.d.ts +11 -0
  87. package/dist/components/vertex-spinner.js +49 -0
  88. package/dist/components/vertex-tab.d.ts +11 -0
  89. package/dist/components/vertex-tab.js +46 -0
  90. package/dist/components/vertex-tabs.d.ts +11 -0
  91. package/dist/components/vertex-tabs.js +133 -0
  92. package/dist/components/vertex-textfield.d.ts +11 -0
  93. package/dist/components/vertex-textfield.js +6 -0
  94. package/dist/components/vertex-toast.d.ts +11 -0
  95. package/dist/components/vertex-toast.js +127 -0
  96. package/dist/components/vertex-toggle.d.ts +11 -0
  97. package/dist/components/vertex-toggle.js +67 -0
  98. package/dist/components/vertex-tooltip.d.ts +11 -0
  99. package/dist/components/vertex-tooltip.js +6 -0
  100. package/package.json +2 -2
@@ -0,0 +1,171 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { c as classnames } from './index2.js';
3
+ import { d as defineCustomElement$1 } from './auto-resize-textarea.js';
4
+
5
+ const TextField = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.inputFocus = createEvent(this, "inputFocus", 7);
10
+ this.inputBlur = createEvent(this, "inputBlur", 7);
11
+ this.inputInput = createEvent(this, "inputInput", 7);
12
+ this.inputChange = createEvent(this, "inputChange", 7);
13
+ this.textFieldKeyDown = createEvent(this, "textFieldKeyDown", 7);
14
+ this.inputAutofill = createEvent(this, "inputAutofill", 7);
15
+ this.handleFocus = (ev) => {
16
+ this.inputFocus.emit(ev);
17
+ };
18
+ this.handleBlur = (ev) => {
19
+ this.inputBlur.emit(ev);
20
+ };
21
+ this.handleKeyDown = (ev) => {
22
+ if (ev.key === 'Enter' && this.nearbyForm != null) {
23
+ this.nearbyForm.dispatchEvent(new CustomEvent('submit', {
24
+ bubbles: true,
25
+ cancelable: true,
26
+ }));
27
+ }
28
+ else {
29
+ this.textFieldKeyDown.emit(ev);
30
+ }
31
+ };
32
+ this.handleChanged = () => {
33
+ this.inputChange.emit({ value: this.nativeInput.value });
34
+ };
35
+ this.handleInput = () => {
36
+ this.inputInput.emit({ value: this.nativeInput.value });
37
+ };
38
+ this.type = 'text';
39
+ this.name = undefined;
40
+ this.variant = 'standard';
41
+ this.fontSize = 'standard';
42
+ this.multiline = false;
43
+ this.minRows = 1;
44
+ this.maxRows = undefined;
45
+ this.placeholder = undefined;
46
+ this.autoFocus = undefined;
47
+ this.autoComplete = undefined;
48
+ this.autoCorrect = undefined;
49
+ this.value = '';
50
+ this.disabled = undefined;
51
+ this.hasError = undefined;
52
+ }
53
+ componentDidLoad() {
54
+ var _a;
55
+ if (this.autoFocus) {
56
+ (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.focus();
57
+ }
58
+ }
59
+ /**
60
+ * updateInput is a method to take an input to automatically set the native input to the given input string
61
+ * @param input
62
+ */
63
+ async updateInput(input) {
64
+ if (this.nativeInput != null) {
65
+ this.nativeInput.value = input;
66
+ }
67
+ }
68
+ async blurInput() {
69
+ var _a;
70
+ (_a = this.nativeInput) === null || _a === void 0 ? void 0 : _a.blur();
71
+ }
72
+ async getInputValue() {
73
+ return this.nativeInput.value;
74
+ }
75
+ /**
76
+ * A method to select all in the input
77
+ */
78
+ async selectAll() {
79
+ this.nativeInput.select();
80
+ }
81
+ render() {
82
+ var _a;
83
+ const classes = classnames('txt-wrapper', {
84
+ 'txt-wrapper-border': !this.multiline,
85
+ 'txt-standard': this.variant === 'standard',
86
+ 'txt-filled': this.variant === 'filled',
87
+ 'txt-underlined': this.variant === 'underlined',
88
+ 'txt-blank': this.variant === 'blank',
89
+ 'txt-size-standard': this.fontSize === 'standard',
90
+ 'txt-size-sm': this.fontSize === 'sm',
91
+ 'txt-size-md': this.fontSize === 'md',
92
+ 'txt-size-lg': this.fontSize === 'lg',
93
+ 'txt-size-xl': this.fontSize === 'xl',
94
+ 'txt-size-xxl': this.fontSize === 'xxl',
95
+ disabled: this.disabled,
96
+ 'has-error': this.hasError,
97
+ });
98
+ const commonProps = {
99
+ class: 'txt',
100
+ 'data-testid': 'text-field',
101
+ name: this.name,
102
+ ref: (input) => {
103
+ if (input != null) {
104
+ this.nativeInput = input;
105
+ }
106
+ },
107
+ autoComplete: this.autoComplete,
108
+ autoFocus: this.autoFocus,
109
+ disabled: this.disabled,
110
+ placeholder: this.placeholder,
111
+ value: this.value || '',
112
+ onFocus: this.handleFocus,
113
+ onBlur: this.handleBlur,
114
+ onKeyDown: this.handleKeyDown,
115
+ onInput: this.handleInput,
116
+ onChange: this.handleChanged,
117
+ onAnimationStart: (ev) => {
118
+ if (['onAutoFillStart', 'onAutoFillCancel'].includes(ev.animationName)) {
119
+ this.inputAutofill.emit({ value: this.nativeInput.value });
120
+ }
121
+ },
122
+ };
123
+ return (h("div", { class: classes }, h("div", { class: "txt-slot" }, h("slot", { name: "left" })), this.multiline ? (h("vertex-auto-resize-textarea", { maxRows: this.maxRows, minRows: this.minRows, initialValue: ((_a = this.value) === null || _a === void 0 ? void 0 : _a.toString()) || '' }, h("textarea", Object.assign({}, commonProps, { class: classnames(commonProps.class, 'txt-textarea', classes), rows: this.minRows })))) : (h("input", Object.assign({}, commonProps, { type: this.type }))), h("div", { class: "txt-slot" }, h("slot", { name: "right" }))));
124
+ }
125
+ connectedCallback() {
126
+ if (this.hostElement != null) {
127
+ this.nearbyForm = this.hostElement.closest('form');
128
+ }
129
+ }
130
+ get hostElement() { return this; }
131
+ }, [6, "vertex-textfield", {
132
+ "type": [1],
133
+ "name": [1],
134
+ "variant": [1],
135
+ "fontSize": [1, "font-size"],
136
+ "multiline": [4],
137
+ "minRows": [2, "min-rows"],
138
+ "maxRows": [2, "max-rows"],
139
+ "placeholder": [1],
140
+ "autoFocus": [4, "auto-focus"],
141
+ "autoComplete": [1, "auto-complete"],
142
+ "autoCorrect": [1, "auto-correct"],
143
+ "value": [1032],
144
+ "disabled": [516],
145
+ "hasError": [4, "has-error"],
146
+ "updateInput": [64],
147
+ "blurInput": [64],
148
+ "getInputValue": [64],
149
+ "selectAll": [64]
150
+ }]);
151
+ function defineCustomElement() {
152
+ if (typeof customElements === "undefined") {
153
+ return;
154
+ }
155
+ const components = ["vertex-textfield", "vertex-auto-resize-textarea"];
156
+ components.forEach(tagName => { switch (tagName) {
157
+ case "vertex-textfield":
158
+ if (!customElements.get(tagName)) {
159
+ customElements.define(tagName, TextField);
160
+ }
161
+ break;
162
+ case "vertex-auto-resize-textarea":
163
+ if (!customElements.get(tagName)) {
164
+ defineCustomElement$1();
165
+ }
166
+ break;
167
+ } });
168
+ }
169
+ defineCustomElement();
170
+
171
+ export { TextField as T, defineCustomElement as d };
@@ -0,0 +1,360 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { a as __extends, b as __read } from './tslib.es6.js';
3
+ import { c as classnames } from './index2.js';
4
+ import { g as getBoundingClientRect } from './dom.js';
5
+ import { a as getSlottedContent } from './slots.js';
6
+ import { d as defineCustomElement$1 } from './popover.js';
7
+
8
+ /**
9
+ * A module for defining functional schemas to map between different types. This
10
+ * module is useful for parsing to or from JSON/protobufs to domain types.
11
+ *
12
+ * Mappers support greedy validation, so all validation errors are aggregated
13
+ * and reported vs failing on the first invalid input.
14
+ *
15
+ * @example
16
+ *
17
+ * ```ts
18
+ * import { Mapper as M } from '@vertexvis/utils';
19
+ *
20
+ * interface Address {
21
+ * address: string;
22
+ * city: string;
23
+ * state: string;
24
+ * zip: string;
25
+ * }
26
+ *
27
+ * interface Person {
28
+ * name: string;
29
+ * addresses: Address[];
30
+ * }
31
+ *
32
+ * type AddressJson = Partial<Address>;
33
+ * type PersonJson = {
34
+ * name?: string;
35
+ * addresses?: AddressJson[];
36
+ * }
37
+ *
38
+ * const mapAddress: M.Func<AddressJson, Address> = M.defineMapper(
39
+ * M.read(
40
+ * M.requireProp('address'),
41
+ * M.requireProp('city'),
42
+ * M.requireProp('state'),
43
+ * M.requireProp('zip')
44
+ * ),
45
+ * ([address, city, state, zip]) => ({
46
+ * address, city, state, zip
47
+ * })
48
+ * );
49
+ *
50
+ * const mapPerson: M.Func<PersonJson, Person> = M.defineMapper(
51
+ * M.read(
52
+ * M.requireProp('name'),
53
+ * M.mapProp(
54
+ * 'addresses',
55
+ * M.compose(M.required('addresses'), M.mapArray(mapAddress))
56
+ * )
57
+ * ),
58
+ * ([name, addresses]) => ({ name, addresses })
59
+ * );
60
+ *
61
+ * const person = mapPerson({
62
+ * name: 'John',
63
+ * addresses: [{ address: '123', city: 'Ames', state: 'IA', zip: '50010' }]
64
+ * });
65
+ *
66
+ * const invalidPerson = mapPerson({
67
+ * addresses: [{ city: 'Ames', state: 'IA', zip: '50010' }]
68
+ * });
69
+ * ```
70
+ * // {
71
+ * // errors: ["Name is required.", "Address is required."]
72
+ * // }
73
+ *
74
+ * @module
75
+ */
76
+ /**
77
+ * An error that is thrown when validation of a schema fails.
78
+ *
79
+ * @see {@link ifInvalidThrow} - for throwing errors on invalid input.
80
+ */
81
+ /** @class */ ((function (_super) {
82
+ __extends(MapperValidationError, _super);
83
+ function MapperValidationError(errors) {
84
+ var _this = _super.call(this, 'Validation error mapping object.') || this;
85
+ _this.errors = errors;
86
+ Object.setPrototypeOf(_this, MapperValidationError.prototype);
87
+ return _this;
88
+ }
89
+ return MapperValidationError;
90
+ })(Error));
91
+
92
+ // Unique ID creation requires a high quality random # generator. In the browser we therefore
93
+ // require the crypto API and do not support built-in fallback to lower quality random number
94
+ // generators (like Math.random()).
95
+ var getRandomValues;
96
+ var rnds8 = new Uint8Array(16);
97
+ function rng() {
98
+ // lazy load so that environments that need to polyfill have a chance to do so
99
+ if (!getRandomValues) {
100
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
101
+ // find the complete implementation of crypto (msCrypto) on IE11.
102
+ getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
103
+
104
+ if (!getRandomValues) {
105
+ throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
106
+ }
107
+ }
108
+
109
+ return getRandomValues(rnds8);
110
+ }
111
+
112
+ var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
113
+
114
+ function validate(uuid) {
115
+ return typeof uuid === 'string' && REGEX.test(uuid);
116
+ }
117
+
118
+ /**
119
+ * Convert array of 16 byte values to UUID string format of the form:
120
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
121
+ */
122
+
123
+ var byteToHex = [];
124
+
125
+ for (var i = 0; i < 256; ++i) {
126
+ byteToHex.push((i + 0x100).toString(16).substr(1));
127
+ }
128
+
129
+ function stringify(arr) {
130
+ var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
131
+ // Note: Be careful editing this code! It's been tuned for performance
132
+ // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
133
+ var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
134
+ // of the following:
135
+ // - One or more input array values don't map to a hex octet (leading to
136
+ // "undefined" in the uuid)
137
+ // - Invalid input values for the RFC `version` or `variant` fields
138
+
139
+ if (!validate(uuid)) {
140
+ throw TypeError('Stringified UUID is invalid');
141
+ }
142
+
143
+ return uuid;
144
+ }
145
+
146
+ function v4(options, buf, offset) {
147
+ options = options || {};
148
+ var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
149
+
150
+ rnds[6] = rnds[6] & 0x0f | 0x40;
151
+ rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
152
+
153
+ if (buf) {
154
+ offset = offset || 0;
155
+
156
+ for (var i = 0; i < 16; ++i) {
157
+ buf[offset + i] = rnds[i];
158
+ }
159
+
160
+ return buf;
161
+ }
162
+
163
+ return stringify(rnds);
164
+ }
165
+
166
+ function create() {
167
+ return v4();
168
+ }
169
+ function fromMsbLsb(msb, lsb) {
170
+ function digits(val, ds) {
171
+ var hi = BigInt(1) << (ds * BigInt(4));
172
+ return (hi | (val & (hi - BigInt(1)))).toString(16).substring(1);
173
+ }
174
+ var msbB = typeof msb === 'string' ? BigInt(msb) : msb;
175
+ var lsbB = typeof lsb === 'string' ? BigInt(lsb) : lsb;
176
+ var sec1 = digits(msbB >> BigInt(32), BigInt(8));
177
+ var sec2 = digits(msbB >> BigInt(16), BigInt(4));
178
+ var sec3 = digits(msbB, BigInt(4));
179
+ var sec4 = digits(lsbB >> BigInt(48), BigInt(4));
180
+ var sec5 = digits(lsbB, BigInt(12));
181
+ return "".concat(sec1, "-").concat(sec2, "-").concat(sec3, "-").concat(sec4, "-").concat(sec5);
182
+ }
183
+ function toMsbLsb(id) {
184
+ var _a = __read(id.split('-'), 5), c1 = _a[0], c2 = _a[1], c3 = _a[2], c4 = _a[3], c5 = _a[4];
185
+ if (c1 == null || c2 == null || c3 == null || c4 == null || c5 == null) {
186
+ throw new Error("Invalid UUID string ".concat(id));
187
+ }
188
+ var msb = BigInt.asIntN(64, BigInt("0x".concat(c1 + c2 + c3)));
189
+ var lsb = BigInt.asIntN(64, BigInt("0x".concat(c4 + c5)));
190
+ return { msb: msb.toString(), lsb: lsb.toString() };
191
+ }
192
+
193
+ var uuid = /*#__PURE__*/Object.freeze({
194
+ __proto__: null,
195
+ create: create,
196
+ fromMsbLsb: fromMsbLsb,
197
+ toMsbLsb: toMsbLsb
198
+ });
199
+
200
+ const tooltipCss = ":host{--tooltip-width:auto;--tooltip-white-space:normal;display:flex}.popover{width:100%;height:100%}.target{display:flex;width:100%;height:100%}.content-hidden{display:none}.tooltip{display:flex;justify-content:center;text-align:center;width:var(--tooltip-width);font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-xxs);background-color:var(--vertex-ui-neutral-700);color:var(--vertex-ui-white);padding:0.25rem 0.5rem;border-radius:4px;pointer-events:none;white-space:var(--tooltip-white-space);user-select:none}.tooltip.hidden{display:none}";
201
+
202
+ const TOOLTIP_OPEN_DELAY = 500;
203
+ const Tooltip = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
204
+ constructor() {
205
+ super();
206
+ this.__registerHost();
207
+ this.__attachShadow();
208
+ this.pointerEntered = false;
209
+ this.content = undefined;
210
+ this.disabled = undefined;
211
+ this.placement = 'bottom';
212
+ this.delay = TOOLTIP_OPEN_DELAY;
213
+ this.animated = true;
214
+ this.open = false;
215
+ this.handlePointerEnter = this.handlePointerEnter.bind(this);
216
+ this.handlePointerLeave = this.handlePointerLeave.bind(this);
217
+ this.handleContentChange = this.handleContentChange.bind(this);
218
+ this.handleDisabledChange = this.handleDisabledChange.bind(this);
219
+ this.tooltipId = `vertex-tooltip-${uuid.create()}`;
220
+ }
221
+ disconnectedCallback() {
222
+ this.removeElement();
223
+ this.clearOpenTimeout();
224
+ this.pointerEntered = false;
225
+ }
226
+ handleContentChange() {
227
+ if (this.internalContentElement != null) {
228
+ this.updateContentElementChildren(this.internalContentElement);
229
+ }
230
+ }
231
+ handleDisabledChange() {
232
+ if (this.internalContentElement != null) {
233
+ this.updateContentElementClass(this.internalContentElement);
234
+ }
235
+ if (!this.disabled && this.pointerEntered) {
236
+ this.handlePointerEnter();
237
+ }
238
+ }
239
+ render() {
240
+ return (h(Host, null, h("div", { class: "target", ref: (el) => {
241
+ this.targetElement = el;
242
+ }, onPointerEnter: this.handlePointerEnter, onPointerLeave: this.handlePointerLeave }, h("slot", null)), h("div", { class: "content-hidden", ref: (el) => {
243
+ this.contentElement = el;
244
+ } }, h("slot", { name: "content", onSlotchange: this.handleContentChange }))));
245
+ }
246
+ addElement() {
247
+ if (this.targetElement != null) {
248
+ const popover = this.createPopoverElement(this.targetElement);
249
+ const content = this.createContentElement();
250
+ this.updateContentElementChildren(content);
251
+ popover.appendChild(content);
252
+ this.hostElement.ownerDocument.body.appendChild(popover);
253
+ }
254
+ }
255
+ removeElement() {
256
+ const popover = this.hostElement.ownerDocument.getElementById(this.tooltipId);
257
+ if (popover != null) {
258
+ popover.remove();
259
+ }
260
+ this.internalContentElement = undefined;
261
+ }
262
+ createPopoverElement(anchorElement) {
263
+ const popover = this.hostElement.ownerDocument.createElement('vertex-popover');
264
+ popover.id = this.tooltipId;
265
+ popover.setAttribute('class', 'vertex-tooltip-popover');
266
+ popover.open = this.open;
267
+ popover.resizeBehavior = 'fixed';
268
+ popover.backdrop = false;
269
+ popover.placement = this.placement;
270
+ popover.animated = this.animated;
271
+ popover.anchorBounds = getBoundingClientRect(anchorElement);
272
+ return popover;
273
+ }
274
+ createContentElement() {
275
+ this.internalContentElement =
276
+ this.hostElement.ownerDocument.createElement('div');
277
+ this.internalContentElement.setAttribute('class', classnames('vertex-tooltip-content', {
278
+ hidden: !this.open || this.disabled,
279
+ }));
280
+ return this.internalContentElement;
281
+ }
282
+ updateContentElementClass(element) {
283
+ element.setAttribute('class', classnames('vertex-tooltip-content', {
284
+ hidden: !this.open || this.disabled,
285
+ }));
286
+ }
287
+ updateContentElementChildren(element) {
288
+ var _a;
289
+ this.displayedSlottedContent =
290
+ (_a = getSlottedContent(this.contentElement)) !== null && _a !== void 0 ? _a : this.displayedSlottedContent;
291
+ if (this.content != null) {
292
+ element.innerText = this.content;
293
+ }
294
+ else if (this.displayedSlottedContent != null) {
295
+ element.appendChild(this.displayedSlottedContent);
296
+ }
297
+ }
298
+ handlePointerEnter() {
299
+ if (this.openTimeout == null && !this.disabled) {
300
+ this.createOpenTimeout();
301
+ }
302
+ else if (this.openTimeout == null) {
303
+ this.pointerEntered = true;
304
+ }
305
+ }
306
+ handlePointerLeave() {
307
+ this.clearOpenTimeout();
308
+ this.removeElement();
309
+ this.open = false;
310
+ this.pointerEntered = false;
311
+ }
312
+ createOpenTimeout() {
313
+ this.openTimeout = setTimeout(() => {
314
+ this.open = true;
315
+ this.openTimeout = undefined;
316
+ this.addElement();
317
+ }, this.delay);
318
+ this.pointerEntered = false;
319
+ }
320
+ clearOpenTimeout() {
321
+ if (this.openTimeout != null) {
322
+ clearTimeout(this.openTimeout);
323
+ this.openTimeout = undefined;
324
+ }
325
+ }
326
+ get hostElement() { return this; }
327
+ static get watchers() { return {
328
+ "content": ["handleContentChange"],
329
+ "disabled": ["handleDisabledChange"]
330
+ }; }
331
+ static get style() { return tooltipCss; }
332
+ }, [1, "vertex-tooltip", {
333
+ "content": [1],
334
+ "disabled": [4],
335
+ "placement": [1],
336
+ "delay": [2],
337
+ "animated": [4],
338
+ "open": [32]
339
+ }]);
340
+ function defineCustomElement() {
341
+ if (typeof customElements === "undefined") {
342
+ return;
343
+ }
344
+ const components = ["vertex-tooltip", "vertex-popover"];
345
+ components.forEach(tagName => { switch (tagName) {
346
+ case "vertex-tooltip":
347
+ if (!customElements.get(tagName)) {
348
+ customElements.define(tagName, Tooltip);
349
+ }
350
+ break;
351
+ case "vertex-popover":
352
+ if (!customElements.get(tagName)) {
353
+ defineCustomElement$1();
354
+ }
355
+ break;
356
+ } });
357
+ }
358
+ defineCustomElement();
359
+
360
+ export { Tooltip as T, defineCustomElement as d };
@@ -0,0 +1,65 @@
1
+ /******************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
15
+ /* global Reflect, Promise, SuppressedError, Symbol */
16
+
17
+ var extendStatics = function(d, b) {
18
+ extendStatics = Object.setPrototypeOf ||
19
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
20
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
21
+ return extendStatics(d, b);
22
+ };
23
+
24
+ function __extends(d, b) {
25
+ if (typeof b !== "function" && b !== null)
26
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
27
+ extendStatics(d, b);
28
+ function __() { this.constructor = d; }
29
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
30
+ }
31
+
32
+ var __assign = function() {
33
+ __assign = Object.assign || function __assign(t) {
34
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
35
+ s = arguments[i];
36
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
37
+ }
38
+ return t;
39
+ };
40
+ return __assign.apply(this, arguments);
41
+ };
42
+
43
+ function __read(o, n) {
44
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
45
+ if (!m) return o;
46
+ var i = m.call(o), r, ar = [], e;
47
+ try {
48
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
49
+ }
50
+ catch (error) { e = { error: error }; }
51
+ finally {
52
+ try {
53
+ if (r && !r.done && (m = i["return"])) m.call(i);
54
+ }
55
+ finally { if (e) throw e.error; }
56
+ }
57
+ return ar;
58
+ }
59
+
60
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
61
+ var e = new Error(message);
62
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
63
+ };
64
+
65
+ export { __assign as _, __extends as a, __read as b };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VertexAutoResizeTextarea extends Components.VertexAutoResizeTextarea, HTMLElement {}
4
+ export const VertexAutoResizeTextarea: {
5
+ prototype: VertexAutoResizeTextarea;
6
+ new (): VertexAutoResizeTextarea;
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 { A as AutoResizeTextArea, d as defineCustomElement$1 } from './auto-resize-textarea.js';
2
+
3
+ const VertexAutoResizeTextarea = AutoResizeTextArea;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { VertexAutoResizeTextarea, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VertexAvatarGroup extends Components.VertexAvatarGroup, HTMLElement {}
4
+ export const VertexAvatarGroup: {
5
+ prototype: VertexAvatarGroup;
6
+ new (): VertexAvatarGroup;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,34 @@
1
+ import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
2
+
3
+ const avatarGroupCss = ".root{position:relative}.base{position:absolute;left:0;top:0}.top{position:absolute;left:0.5rem;top:0.5rem}";
4
+
5
+ const AvatarGroup = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ this.__registerHost();
9
+ this.__attachShadow();
10
+ }
11
+ render() {
12
+ return (h("div", { class: "root" }, h("div", { class: "base" }, h("slot", { name: "base" })), h("div", { class: "top" }, h("slot", null))));
13
+ }
14
+ static get style() { return avatarGroupCss; }
15
+ }, [1, "vertex-avatar-group"]);
16
+ function defineCustomElement$1() {
17
+ if (typeof customElements === "undefined") {
18
+ return;
19
+ }
20
+ const components = ["vertex-avatar-group"];
21
+ components.forEach(tagName => { switch (tagName) {
22
+ case "vertex-avatar-group":
23
+ if (!customElements.get(tagName)) {
24
+ customElements.define(tagName, AvatarGroup);
25
+ }
26
+ break;
27
+ } });
28
+ }
29
+ defineCustomElement$1();
30
+
31
+ const VertexAvatarGroup = AvatarGroup;
32
+ const defineCustomElement = defineCustomElement$1;
33
+
34
+ export { AvatarGroup as A, VertexAvatarGroup, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VertexAvatar extends Components.VertexAvatar, HTMLElement {}
4
+ export const VertexAvatar: {
5
+ prototype: VertexAvatar;
6
+ new (): VertexAvatar;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;