@wavelengthusaf/web-components 1.7.1 → 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 +137 -1
- package/dist/cjs/index.d.cts +21 -1
- package/dist/esm/index.d.ts +21 -1
- package/dist/esm/index.js +137 -1
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -6093,6 +6093,142 @@ if (!customElements.get("wavelength-planetrail")) {
|
|
|
6093
6093
|
customElements.define("wavelength-planetrail", WavelengthPlaneTrail);
|
|
6094
6094
|
}
|
|
6095
6095
|
|
|
6096
|
+
// src/web-components/wavelength-manyplanes.template.html
|
|
6097
|
+
var wavelength_manyplanes_template_default = '<style>\n :host {\n display: block;\n --color: #00308F;\n }\n #plane-container {\n display: flex;\n justify-content: flex-end;\n height: 40px;\n }\n</style>\n<div id="plane-container" class="flex-container"></div>';
|
|
6098
|
+
|
|
6099
|
+
// src/web-components/wavelength-manyplanes.ts
|
|
6100
|
+
var WavelengthManyPlanes = class extends HTMLElement {
|
|
6101
|
+
static get observedAttributes() {
|
|
6102
|
+
return ["number-of-planes", "trail-dir", "opacity", "color", "gradient", "spaced"];
|
|
6103
|
+
}
|
|
6104
|
+
constructor() {
|
|
6105
|
+
super();
|
|
6106
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
6107
|
+
this.shadow.innerHTML = wavelength_manyplanes_template_default;
|
|
6108
|
+
}
|
|
6109
|
+
connectedCallback() {
|
|
6110
|
+
this.updateComponent();
|
|
6111
|
+
}
|
|
6112
|
+
attributeChangedCallback() {
|
|
6113
|
+
this.updateComponent();
|
|
6114
|
+
}
|
|
6115
|
+
updateComponent() {
|
|
6116
|
+
const numberOfPlanes = this.getAttribute("number-of-planes") || "5";
|
|
6117
|
+
const trailDir = this.getAttribute("trail-dir") || "right";
|
|
6118
|
+
const opacity = this.getAttribute("opacity") || "1";
|
|
6119
|
+
const color = this.getAttribute("color") || "#00308F";
|
|
6120
|
+
const gradient = this.getAttribute("gradient") || "false";
|
|
6121
|
+
const spaced = this.getAttribute("spaced") || "true";
|
|
6122
|
+
const planeContainer = this.shadow.getElementById("plane-container");
|
|
6123
|
+
if (planeContainer === null) {
|
|
6124
|
+
return;
|
|
6125
|
+
}
|
|
6126
|
+
planeContainer.replaceChildren();
|
|
6127
|
+
planeContainer.style.flexDirection = trailDir === "right" ? "row" : "row-reverse";
|
|
6128
|
+
planeContainer.style.justifyContent = spaced === "true" ? "space-between" : "flex-end";
|
|
6129
|
+
for (let i = 0; i < parseInt(numberOfPlanes); i++) {
|
|
6130
|
+
let currentPlaneOpacity = opacity;
|
|
6131
|
+
if (gradient === "true") {
|
|
6132
|
+
currentPlaneOpacity = (parseFloat(opacity) * ((i + 1) / parseInt(numberOfPlanes))).toString();
|
|
6133
|
+
}
|
|
6134
|
+
planeContainer.appendChild(this.createPlane(currentPlaneOpacity, color, trailDir === "right" ? false : true));
|
|
6135
|
+
}
|
|
6136
|
+
}
|
|
6137
|
+
createPlane(opacity, color, flipped) {
|
|
6138
|
+
const svgNS = "http://www.w3.org/2000/svg";
|
|
6139
|
+
const newPlane = document.createElementNS(svgNS, "svg");
|
|
6140
|
+
const planePath = document.createElementNS(svgNS, "path");
|
|
6141
|
+
newPlane.setAttribute("width", "40");
|
|
6142
|
+
newPlane.setAttribute("height", "40");
|
|
6143
|
+
newPlane.setAttribute("id", "planes");
|
|
6144
|
+
newPlane.setAttribute("transform", flipped ? "matrix(-1, 0, 0, 1, 0, 0)" : "");
|
|
6145
|
+
newPlane.setAttribute("opacity", opacity);
|
|
6146
|
+
newPlane.appendChild(planePath);
|
|
6147
|
+
planePath.setAttribute(
|
|
6148
|
+
"d",
|
|
6149
|
+
"M 4.1666 16.3988 L 5.7608 16.3988 L 8.1645 19.6359 L 18.2616 19.6359 L 14.1291 5.6667 L 16.2425 5.6667 L 24.5075 19.6359 L 33.985 19.6359 C 34.5022 19.6359 34.9422 19.8172 35.305 20.18 C 35.6677 20.5428 35.8491 20.9828 35.8491 21.5 C 35.8491 22.0172 35.6677 22.4572 35.305 22.82 C 34.9422 23.1828 34.5022 23.3642 33.985 23.3642 L 24.5075 23.3642 L 16.2425 37.3334 L 14.1291 37.3334 L 18.2616 23.3642 L 8.1966 23.3642 L 5.7608 26.6013 L 4.1666 26.6013 L 5.6433 21.5 L 4.1666 16.3988 Z"
|
|
6150
|
+
);
|
|
6151
|
+
planePath.setAttribute("fill", color);
|
|
6152
|
+
return newPlane;
|
|
6153
|
+
}
|
|
6154
|
+
};
|
|
6155
|
+
if (!customElements.get("wavelength-manyplanes")) {
|
|
6156
|
+
customElements.define("wavelength-manyplanes", WavelengthManyPlanes);
|
|
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
|
+
}
|
|
6229
|
+
|
|
6230
|
+
|
|
6231
|
+
|
|
6096
6232
|
|
|
6097
6233
|
|
|
6098
6234
|
|
|
@@ -6112,7 +6248,7 @@ if (!customElements.get("wavelength-planetrail")) {
|
|
|
6112
6248
|
|
|
6113
6249
|
|
|
6114
6250
|
|
|
6115
|
-
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.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;
|
|
6116
6252
|
/*! Bundled license information:
|
|
6117
6253
|
|
|
6118
6254
|
react/cjs/react.production.min.js:
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -2245,4 +2245,24 @@ declare const WavelengthPlaneTrail_base: {
|
|
|
2245
2245
|
declare class WavelengthPlaneTrail extends WavelengthPlaneTrail_base {
|
|
2246
2246
|
}
|
|
2247
2247
|
|
|
2248
|
-
|
|
2248
|
+
declare class WavelengthManyPlanes extends HTMLElement {
|
|
2249
|
+
static get observedAttributes(): string[];
|
|
2250
|
+
private shadow;
|
|
2251
|
+
constructor();
|
|
2252
|
+
connectedCallback(): void;
|
|
2253
|
+
attributeChangedCallback(): void;
|
|
2254
|
+
updateComponent(): void;
|
|
2255
|
+
createPlane(opacity: string, color: string, flipped: boolean): SVGSVGElement;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
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
|
@@ -2245,4 +2245,24 @@ declare const WavelengthPlaneTrail_base: {
|
|
|
2245
2245
|
declare class WavelengthPlaneTrail extends WavelengthPlaneTrail_base {
|
|
2246
2246
|
}
|
|
2247
2247
|
|
|
2248
|
-
|
|
2248
|
+
declare class WavelengthManyPlanes extends HTMLElement {
|
|
2249
|
+
static get observedAttributes(): string[];
|
|
2250
|
+
private shadow;
|
|
2251
|
+
constructor();
|
|
2252
|
+
connectedCallback(): void;
|
|
2253
|
+
attributeChangedCallback(): void;
|
|
2254
|
+
updateComponent(): void;
|
|
2255
|
+
createPlane(opacity: string, color: string, flipped: boolean): SVGSVGElement;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
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
|
@@ -6092,6 +6092,140 @@ var WavelengthPlaneTrail = class extends StylingMixin(BasePlaneTrail) {
|
|
|
6092
6092
|
if (!customElements.get("wavelength-planetrail")) {
|
|
6093
6093
|
customElements.define("wavelength-planetrail", WavelengthPlaneTrail);
|
|
6094
6094
|
}
|
|
6095
|
+
|
|
6096
|
+
// src/web-components/wavelength-manyplanes.template.html
|
|
6097
|
+
var wavelength_manyplanes_template_default = '<style>\n :host {\n display: block;\n --color: #00308F;\n }\n #plane-container {\n display: flex;\n justify-content: flex-end;\n height: 40px;\n }\n</style>\n<div id="plane-container" class="flex-container"></div>';
|
|
6098
|
+
|
|
6099
|
+
// src/web-components/wavelength-manyplanes.ts
|
|
6100
|
+
var WavelengthManyPlanes = class extends HTMLElement {
|
|
6101
|
+
static get observedAttributes() {
|
|
6102
|
+
return ["number-of-planes", "trail-dir", "opacity", "color", "gradient", "spaced"];
|
|
6103
|
+
}
|
|
6104
|
+
constructor() {
|
|
6105
|
+
super();
|
|
6106
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
6107
|
+
this.shadow.innerHTML = wavelength_manyplanes_template_default;
|
|
6108
|
+
}
|
|
6109
|
+
connectedCallback() {
|
|
6110
|
+
this.updateComponent();
|
|
6111
|
+
}
|
|
6112
|
+
attributeChangedCallback() {
|
|
6113
|
+
this.updateComponent();
|
|
6114
|
+
}
|
|
6115
|
+
updateComponent() {
|
|
6116
|
+
const numberOfPlanes = this.getAttribute("number-of-planes") || "5";
|
|
6117
|
+
const trailDir = this.getAttribute("trail-dir") || "right";
|
|
6118
|
+
const opacity = this.getAttribute("opacity") || "1";
|
|
6119
|
+
const color = this.getAttribute("color") || "#00308F";
|
|
6120
|
+
const gradient = this.getAttribute("gradient") || "false";
|
|
6121
|
+
const spaced = this.getAttribute("spaced") || "true";
|
|
6122
|
+
const planeContainer = this.shadow.getElementById("plane-container");
|
|
6123
|
+
if (planeContainer === null) {
|
|
6124
|
+
return;
|
|
6125
|
+
}
|
|
6126
|
+
planeContainer.replaceChildren();
|
|
6127
|
+
planeContainer.style.flexDirection = trailDir === "right" ? "row" : "row-reverse";
|
|
6128
|
+
planeContainer.style.justifyContent = spaced === "true" ? "space-between" : "flex-end";
|
|
6129
|
+
for (let i = 0; i < parseInt(numberOfPlanes); i++) {
|
|
6130
|
+
let currentPlaneOpacity = opacity;
|
|
6131
|
+
if (gradient === "true") {
|
|
6132
|
+
currentPlaneOpacity = (parseFloat(opacity) * ((i + 1) / parseInt(numberOfPlanes))).toString();
|
|
6133
|
+
}
|
|
6134
|
+
planeContainer.appendChild(this.createPlane(currentPlaneOpacity, color, trailDir === "right" ? false : true));
|
|
6135
|
+
}
|
|
6136
|
+
}
|
|
6137
|
+
createPlane(opacity, color, flipped) {
|
|
6138
|
+
const svgNS = "http://www.w3.org/2000/svg";
|
|
6139
|
+
const newPlane = document.createElementNS(svgNS, "svg");
|
|
6140
|
+
const planePath = document.createElementNS(svgNS, "path");
|
|
6141
|
+
newPlane.setAttribute("width", "40");
|
|
6142
|
+
newPlane.setAttribute("height", "40");
|
|
6143
|
+
newPlane.setAttribute("id", "planes");
|
|
6144
|
+
newPlane.setAttribute("transform", flipped ? "matrix(-1, 0, 0, 1, 0, 0)" : "");
|
|
6145
|
+
newPlane.setAttribute("opacity", opacity);
|
|
6146
|
+
newPlane.appendChild(planePath);
|
|
6147
|
+
planePath.setAttribute(
|
|
6148
|
+
"d",
|
|
6149
|
+
"M 4.1666 16.3988 L 5.7608 16.3988 L 8.1645 19.6359 L 18.2616 19.6359 L 14.1291 5.6667 L 16.2425 5.6667 L 24.5075 19.6359 L 33.985 19.6359 C 34.5022 19.6359 34.9422 19.8172 35.305 20.18 C 35.6677 20.5428 35.8491 20.9828 35.8491 21.5 C 35.8491 22.0172 35.6677 22.4572 35.305 22.82 C 34.9422 23.1828 34.5022 23.3642 33.985 23.3642 L 24.5075 23.3642 L 16.2425 37.3334 L 14.1291 37.3334 L 18.2616 23.3642 L 8.1966 23.3642 L 5.7608 26.6013 L 4.1666 26.6013 L 5.6433 21.5 L 4.1666 16.3988 Z"
|
|
6150
|
+
);
|
|
6151
|
+
planePath.setAttribute("fill", color);
|
|
6152
|
+
return newPlane;
|
|
6153
|
+
}
|
|
6154
|
+
};
|
|
6155
|
+
if (!customElements.get("wavelength-manyplanes")) {
|
|
6156
|
+
customElements.define("wavelength-manyplanes", WavelengthManyPlanes);
|
|
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
|
+
}
|
|
6095
6229
|
export {
|
|
6096
6230
|
BaseWavelengthInput,
|
|
6097
6231
|
BaseWavelengthMultiSelectAutocomplete,
|
|
@@ -6105,13 +6239,15 @@ export {
|
|
|
6105
6239
|
WavelengthFileDropZone,
|
|
6106
6240
|
WavelengthForm,
|
|
6107
6241
|
WavelengthInput,
|
|
6242
|
+
WavelengthManyPlanes,
|
|
6108
6243
|
WavelengthMultiSelectAutocomplete,
|
|
6109
6244
|
WavelengthNavBar,
|
|
6110
6245
|
WavelengthNotificationPanel,
|
|
6111
6246
|
WavelengthPlaneTrail,
|
|
6112
6247
|
WavelengthProgressBar,
|
|
6113
6248
|
WavelengthSnackbar,
|
|
6114
|
-
WavelengthTitleBar
|
|
6249
|
+
WavelengthTitleBar,
|
|
6250
|
+
WavelengthToolTip
|
|
6115
6251
|
};
|
|
6116
6252
|
/*! Bundled license information:
|
|
6117
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",
|