@wavelengthusaf/web-components 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +73 -1
- package/dist/cjs/index.d.cts +11 -1
- package/dist/esm/index.d.ts +11 -1
- package/dist/esm/index.js +73 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -6156,6 +6156,78 @@ if (!customElements.get("wavelength-manyplanes")) {
|
|
|
6156
6156
|
customElements.define("wavelength-manyplanes", WavelengthManyPlanes);
|
|
6157
6157
|
}
|
|
6158
6158
|
|
|
6159
|
+
// src/web-components/wavelength-tooltip.template.html
|
|
6160
|
+
var wavelength_tooltip_template_default = '<style>\n :host {\n display: inline-block;\n --color: #898989ff;\n --text-color: white;\n --text-content: "Tooltip Text";\n --font-family: "Arial";\n font-family: var(--font-family);\n font-size: 10px;\n }\n\n .textbox {\n background-color: var(--color);\n width: fit-content;\n height: fit-content;\n border-radius: 5px;\n padding: 5px;\n }\n\n p {\n margin: 0px;\n }\n\n .tooltip-text {\n color: var(--text-color);\n white-space: pre-wrap;\n }\n\n .flex-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .arrow {\n width: 0;\n height: 0;\n border: 6px solid transparent;\n }\n\n .tooltip {\n display: flex;\n align-items: center;\n width: fit-content;\n height: fit-content;\n }\n\n .tooltip[data-direction="up"] .arrow {\n border-bottom-color: var(--color);\n border-top-width: 0;\n }\n .tooltip[data-direction="down"] .arrow {\n border-top-color: var(--color);\n border-bottom-width: 0;\n }\n .tooltip[data-direction="left"] .arrow {\n border-right-color: var(--color);\n border-left-width: 0;\n }\n .tooltip[data-direction="right"] .arrow {\n border-left-color: var(--color);\n border-right-width: 0;\n }\n</style>\n<div class="tooltip flex-container">\n <div class="textbox">\n <p class="tooltip-text"></p>\n </div>\n <div class="arrow"></div>\n</div>\n\n\n';
|
|
6161
|
+
|
|
6162
|
+
// src/web-components/wavelength-tooltip.ts
|
|
6163
|
+
var WavelengthToolTip = class extends HTMLElement {
|
|
6164
|
+
static get observedAttributes() {
|
|
6165
|
+
return ["color", "font", "direction", "text-color", "text-content"];
|
|
6166
|
+
}
|
|
6167
|
+
constructor() {
|
|
6168
|
+
super();
|
|
6169
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
6170
|
+
this.shadow.innerHTML = wavelength_tooltip_template_default;
|
|
6171
|
+
}
|
|
6172
|
+
connectedCallback() {
|
|
6173
|
+
this.updateComponent();
|
|
6174
|
+
}
|
|
6175
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
6176
|
+
if (oldValue === newValue) {
|
|
6177
|
+
return;
|
|
6178
|
+
}
|
|
6179
|
+
this.updateComponent();
|
|
6180
|
+
}
|
|
6181
|
+
updateDirection(direction) {
|
|
6182
|
+
const tooltip = this.shadow.querySelector(".tooltip");
|
|
6183
|
+
if (tooltip === null) {
|
|
6184
|
+
return;
|
|
6185
|
+
}
|
|
6186
|
+
tooltip.setAttribute("data-direction", direction);
|
|
6187
|
+
switch (direction) {
|
|
6188
|
+
case "up":
|
|
6189
|
+
tooltip.style.flexDirection = "column-reverse";
|
|
6190
|
+
break;
|
|
6191
|
+
case "down":
|
|
6192
|
+
tooltip.style.flexDirection = "column";
|
|
6193
|
+
break;
|
|
6194
|
+
case "left":
|
|
6195
|
+
tooltip.style.flexDirection = "row-reverse";
|
|
6196
|
+
break;
|
|
6197
|
+
case "right":
|
|
6198
|
+
tooltip.style.flexDirection = "row";
|
|
6199
|
+
break;
|
|
6200
|
+
default:
|
|
6201
|
+
tooltip.style.flexDirection = "column";
|
|
6202
|
+
break;
|
|
6203
|
+
}
|
|
6204
|
+
}
|
|
6205
|
+
updateComponent() {
|
|
6206
|
+
const colorAttr = this.getAttribute("color") || "#898989ff";
|
|
6207
|
+
const textColorAttr = this.getAttribute("text-color") || "white";
|
|
6208
|
+
const font = this.getAttribute("font") || "Arial";
|
|
6209
|
+
const direction = this.getAttribute("direction") || "none";
|
|
6210
|
+
const textContent = this.getAttribute("text-content") || "Tooltip Text";
|
|
6211
|
+
const color = CSS.supports("color", colorAttr) ? colorAttr : "#898989ff";
|
|
6212
|
+
const textColor = CSS.supports("color", textColorAttr) ? textColorAttr : "white";
|
|
6213
|
+
const textbox = this.shadow.querySelector(".textbox");
|
|
6214
|
+
const tooltipText = this.shadow.querySelector(".tooltip-text");
|
|
6215
|
+
if (textbox === null || tooltipText === null) {
|
|
6216
|
+
return;
|
|
6217
|
+
}
|
|
6218
|
+
this.style.setProperty("--font-family", font);
|
|
6219
|
+
this.style.setProperty("--color", color);
|
|
6220
|
+
this.style.setProperty("--text-color", textColor);
|
|
6221
|
+
this.style.setProperty("--text-content", textContent);
|
|
6222
|
+
tooltipText.textContent = textContent;
|
|
6223
|
+
this.updateDirection(direction);
|
|
6224
|
+
}
|
|
6225
|
+
};
|
|
6226
|
+
if (!customElements.get("wavelength-tooltip")) {
|
|
6227
|
+
customElements.define("wavelength-tooltip", WavelengthToolTip);
|
|
6228
|
+
}
|
|
6229
|
+
|
|
6230
|
+
|
|
6159
6231
|
|
|
6160
6232
|
|
|
6161
6233
|
|
|
@@ -6176,7 +6248,7 @@ if (!customElements.get("wavelength-manyplanes")) {
|
|
|
6176
6248
|
|
|
6177
6249
|
|
|
6178
6250
|
|
|
6179
|
-
exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.ChildDataTable = ChildDataTable; exports.SampleComponent = SampleComponent; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthCheckbox = WavelengthCheckbox; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthFileDropZone = WavelengthFileDropZone; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthNotificationPanel = WavelengthNotificationPanel; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthTitleBar = WavelengthTitleBar;
|
|
6251
|
+
exports.BaseWavelengthInput = BaseWavelengthInput; exports.BaseWavelengthMultiSelectAutocomplete = BaseWavelengthMultiSelectAutocomplete; exports.ChildDataTable = ChildDataTable; exports.SampleComponent = SampleComponent; exports.WavelengthBanner = WavelengthBanner; exports.WavelengthButton = WavelengthButton; exports.WavelengthCheckbox = WavelengthCheckbox; exports.WavelengthDatePicker = WavelengthDatePicker; exports.WavelengthDropdown = WavelengthDropdown; exports.WavelengthFileDropZone = WavelengthFileDropZone; exports.WavelengthForm = WavelengthForm; exports.WavelengthInput = WavelengthInput; exports.WavelengthManyPlanes = WavelengthManyPlanes; exports.WavelengthMultiSelectAutocomplete = WavelengthMultiSelectAutocomplete; exports.WavelengthNavBar = WavelengthNavBar; exports.WavelengthNotificationPanel = WavelengthNotificationPanel; exports.WavelengthPlaneTrail = WavelengthPlaneTrail; exports.WavelengthProgressBar = WavelengthProgressBar; exports.WavelengthSnackbar = WavelengthSnackbar; exports.WavelengthTitleBar = WavelengthTitleBar; exports.WavelengthToolTip = WavelengthToolTip;
|
|
6180
6252
|
/*! Bundled license information:
|
|
6181
6253
|
|
|
6182
6254
|
react/cjs/react.production.min.js:
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -2255,4 +2255,14 @@ declare class WavelengthManyPlanes extends HTMLElement {
|
|
|
2255
2255
|
createPlane(opacity: string, color: string, flipped: boolean): SVGSVGElement;
|
|
2256
2256
|
}
|
|
2257
2257
|
|
|
2258
|
-
|
|
2258
|
+
declare class WavelengthToolTip extends HTMLElement {
|
|
2259
|
+
static get observedAttributes(): string[];
|
|
2260
|
+
private shadow;
|
|
2261
|
+
constructor();
|
|
2262
|
+
connectedCallback(): void;
|
|
2263
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
2264
|
+
updateDirection(direction: string): void;
|
|
2265
|
+
updateComponent(): void;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthSnackbar, WavelengthTitleBar, WavelengthToolTip };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -2255,4 +2255,14 @@ declare class WavelengthManyPlanes extends HTMLElement {
|
|
|
2255
2255
|
createPlane(opacity: string, color: string, flipped: boolean): SVGSVGElement;
|
|
2256
2256
|
}
|
|
2257
2257
|
|
|
2258
|
-
|
|
2258
|
+
declare class WavelengthToolTip extends HTMLElement {
|
|
2259
|
+
static get observedAttributes(): string[];
|
|
2260
|
+
private shadow;
|
|
2261
|
+
constructor();
|
|
2262
|
+
connectedCallback(): void;
|
|
2263
|
+
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
|
|
2264
|
+
updateDirection(direction: string): void;
|
|
2265
|
+
updateComponent(): void;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
2268
|
+
export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthSnackbar, WavelengthTitleBar, WavelengthToolTip };
|
package/dist/esm/index.js
CHANGED
|
@@ -6155,6 +6155,77 @@ var WavelengthManyPlanes = class extends HTMLElement {
|
|
|
6155
6155
|
if (!customElements.get("wavelength-manyplanes")) {
|
|
6156
6156
|
customElements.define("wavelength-manyplanes", WavelengthManyPlanes);
|
|
6157
6157
|
}
|
|
6158
|
+
|
|
6159
|
+
// src/web-components/wavelength-tooltip.template.html
|
|
6160
|
+
var wavelength_tooltip_template_default = '<style>\n :host {\n display: inline-block;\n --color: #898989ff;\n --text-color: white;\n --text-content: "Tooltip Text";\n --font-family: "Arial";\n font-family: var(--font-family);\n font-size: 10px;\n }\n\n .textbox {\n background-color: var(--color);\n width: fit-content;\n height: fit-content;\n border-radius: 5px;\n padding: 5px;\n }\n\n p {\n margin: 0px;\n }\n\n .tooltip-text {\n color: var(--text-color);\n white-space: pre-wrap;\n }\n\n .flex-container {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n\n .arrow {\n width: 0;\n height: 0;\n border: 6px solid transparent;\n }\n\n .tooltip {\n display: flex;\n align-items: center;\n width: fit-content;\n height: fit-content;\n }\n\n .tooltip[data-direction="up"] .arrow {\n border-bottom-color: var(--color);\n border-top-width: 0;\n }\n .tooltip[data-direction="down"] .arrow {\n border-top-color: var(--color);\n border-bottom-width: 0;\n }\n .tooltip[data-direction="left"] .arrow {\n border-right-color: var(--color);\n border-left-width: 0;\n }\n .tooltip[data-direction="right"] .arrow {\n border-left-color: var(--color);\n border-right-width: 0;\n }\n</style>\n<div class="tooltip flex-container">\n <div class="textbox">\n <p class="tooltip-text"></p>\n </div>\n <div class="arrow"></div>\n</div>\n\n\n';
|
|
6161
|
+
|
|
6162
|
+
// src/web-components/wavelength-tooltip.ts
|
|
6163
|
+
var WavelengthToolTip = class extends HTMLElement {
|
|
6164
|
+
static get observedAttributes() {
|
|
6165
|
+
return ["color", "font", "direction", "text-color", "text-content"];
|
|
6166
|
+
}
|
|
6167
|
+
constructor() {
|
|
6168
|
+
super();
|
|
6169
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
6170
|
+
this.shadow.innerHTML = wavelength_tooltip_template_default;
|
|
6171
|
+
}
|
|
6172
|
+
connectedCallback() {
|
|
6173
|
+
this.updateComponent();
|
|
6174
|
+
}
|
|
6175
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
6176
|
+
if (oldValue === newValue) {
|
|
6177
|
+
return;
|
|
6178
|
+
}
|
|
6179
|
+
this.updateComponent();
|
|
6180
|
+
}
|
|
6181
|
+
updateDirection(direction) {
|
|
6182
|
+
const tooltip = this.shadow.querySelector(".tooltip");
|
|
6183
|
+
if (tooltip === null) {
|
|
6184
|
+
return;
|
|
6185
|
+
}
|
|
6186
|
+
tooltip.setAttribute("data-direction", direction);
|
|
6187
|
+
switch (direction) {
|
|
6188
|
+
case "up":
|
|
6189
|
+
tooltip.style.flexDirection = "column-reverse";
|
|
6190
|
+
break;
|
|
6191
|
+
case "down":
|
|
6192
|
+
tooltip.style.flexDirection = "column";
|
|
6193
|
+
break;
|
|
6194
|
+
case "left":
|
|
6195
|
+
tooltip.style.flexDirection = "row-reverse";
|
|
6196
|
+
break;
|
|
6197
|
+
case "right":
|
|
6198
|
+
tooltip.style.flexDirection = "row";
|
|
6199
|
+
break;
|
|
6200
|
+
default:
|
|
6201
|
+
tooltip.style.flexDirection = "column";
|
|
6202
|
+
break;
|
|
6203
|
+
}
|
|
6204
|
+
}
|
|
6205
|
+
updateComponent() {
|
|
6206
|
+
const colorAttr = this.getAttribute("color") || "#898989ff";
|
|
6207
|
+
const textColorAttr = this.getAttribute("text-color") || "white";
|
|
6208
|
+
const font = this.getAttribute("font") || "Arial";
|
|
6209
|
+
const direction = this.getAttribute("direction") || "none";
|
|
6210
|
+
const textContent = this.getAttribute("text-content") || "Tooltip Text";
|
|
6211
|
+
const color = CSS.supports("color", colorAttr) ? colorAttr : "#898989ff";
|
|
6212
|
+
const textColor = CSS.supports("color", textColorAttr) ? textColorAttr : "white";
|
|
6213
|
+
const textbox = this.shadow.querySelector(".textbox");
|
|
6214
|
+
const tooltipText = this.shadow.querySelector(".tooltip-text");
|
|
6215
|
+
if (textbox === null || tooltipText === null) {
|
|
6216
|
+
return;
|
|
6217
|
+
}
|
|
6218
|
+
this.style.setProperty("--font-family", font);
|
|
6219
|
+
this.style.setProperty("--color", color);
|
|
6220
|
+
this.style.setProperty("--text-color", textColor);
|
|
6221
|
+
this.style.setProperty("--text-content", textContent);
|
|
6222
|
+
tooltipText.textContent = textContent;
|
|
6223
|
+
this.updateDirection(direction);
|
|
6224
|
+
}
|
|
6225
|
+
};
|
|
6226
|
+
if (!customElements.get("wavelength-tooltip")) {
|
|
6227
|
+
customElements.define("wavelength-tooltip", WavelengthToolTip);
|
|
6228
|
+
}
|
|
6158
6229
|
export {
|
|
6159
6230
|
BaseWavelengthInput,
|
|
6160
6231
|
BaseWavelengthMultiSelectAutocomplete,
|
|
@@ -6175,7 +6246,8 @@ export {
|
|
|
6175
6246
|
WavelengthPlaneTrail,
|
|
6176
6247
|
WavelengthProgressBar,
|
|
6177
6248
|
WavelengthSnackbar,
|
|
6178
|
-
WavelengthTitleBar
|
|
6249
|
+
WavelengthTitleBar,
|
|
6250
|
+
WavelengthToolTip
|
|
6179
6251
|
};
|
|
6180
6252
|
/*! Bundled license information:
|
|
6181
6253
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@wavelengthusaf/web-components",
|
|
3
3
|
"author": "563 EWS - Wavelength",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.9.0",
|
|
6
6
|
"description": "Common component library used by Wavelength developers (NATIVE WEB COMPONENTS)",
|
|
7
7
|
"main": "/dist/cjs/index.cjs",
|
|
8
8
|
"module": "/dist/esm/index.js",
|