@wavelengthusaf/web-components 1.14.0 → 1.15.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 +257 -203
- package/dist/cjs/index.d.cts +24 -2
- package/dist/esm/index.d.ts +24 -2
- package/dist/esm/index.js +247 -193
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -28,17 +28,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var require_react_production_min = __commonJS({
|
|
29
29
|
"../../../node_modules/react/cjs/react.production.min.js"(exports) {
|
|
30
30
|
"use strict";
|
|
31
|
-
var l = Symbol.for("react.element");
|
|
32
|
-
var n = Symbol.for("react.portal");
|
|
33
|
-
var p = Symbol.for("react.fragment");
|
|
34
|
-
var q = Symbol.for("react.strict_mode");
|
|
35
|
-
var r = Symbol.for("react.profiler");
|
|
36
|
-
var t = Symbol.for("react.provider");
|
|
37
|
-
var u = Symbol.for("react.context");
|
|
38
|
-
var v = Symbol.for("react.forward_ref");
|
|
39
|
-
var w = Symbol.for("react.suspense");
|
|
40
|
-
var x = Symbol.for("react.memo");
|
|
41
|
-
var y = Symbol.for("react.lazy");
|
|
31
|
+
var l = /* @__PURE__ */ Symbol.for("react.element");
|
|
32
|
+
var n = /* @__PURE__ */ Symbol.for("react.portal");
|
|
33
|
+
var p = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
34
|
+
var q = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
35
|
+
var r = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
36
|
+
var t = /* @__PURE__ */ Symbol.for("react.provider");
|
|
37
|
+
var u = /* @__PURE__ */ Symbol.for("react.context");
|
|
38
|
+
var v = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
39
|
+
var w = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
40
|
+
var x = /* @__PURE__ */ Symbol.for("react.memo");
|
|
41
|
+
var y = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
42
42
|
var z = Symbol.iterator;
|
|
43
43
|
function A(a) {
|
|
44
44
|
if (null === a || "object" !== typeof a) return null;
|
|
@@ -308,19 +308,19 @@ var require_react_development = __commonJS({
|
|
|
308
308
|
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
309
309
|
}
|
|
310
310
|
var ReactVersion = "18.3.1";
|
|
311
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
312
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
313
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
314
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
315
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
316
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
317
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
318
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
319
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
320
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
321
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
322
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
323
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
311
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
|
|
312
|
+
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
313
|
+
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
314
|
+
var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
|
|
315
|
+
var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
|
|
316
|
+
var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider");
|
|
317
|
+
var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
|
|
318
|
+
var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
|
|
319
|
+
var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
|
|
320
|
+
var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list");
|
|
321
|
+
var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
|
|
322
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
323
|
+
var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen");
|
|
324
324
|
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
325
325
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
326
326
|
function getIteratorFn(maybeIterable) {
|
|
@@ -1284,7 +1284,7 @@ var require_react_development = __commonJS({
|
|
|
1284
1284
|
}
|
|
1285
1285
|
var REACT_MODULE_REFERENCE;
|
|
1286
1286
|
{
|
|
1287
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
1287
|
+
REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
1288
1288
|
}
|
|
1289
1289
|
function isValidElementType(type) {
|
|
1290
1290
|
if (typeof type === "string" || typeof type === "function") {
|
|
@@ -3183,7 +3183,7 @@ if (!customElements.get("wavelength-progress-bar")) {
|
|
|
3183
3183
|
}
|
|
3184
3184
|
|
|
3185
3185
|
// src/web-components/wavelength-input.template.html
|
|
3186
|
-
var wavelength_input_template_default = '<style>\n :host {\n display: block;\n width: 100%;\n font-family: sans-serif;\n --wavelength-container-background: #f8f8f8;\n --wavelength-label-background: #ffffff;\n }\n\n .field-wrapper {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .input-wrapper {\n width: 100%;\n height: 100%;\n }\n\n .floating-label {\n position: absolute;\n top: -0.325rem;\n left: 12px;\n font-size: 0.75rem;\n line-height: 1;\n color: var(--wavelength-label-color, #666666);\n padding: 0 4px;\n z-index: 1;\n pointer-events: none;\n user-select: none;\n }\n\n .floating-label::before,\n .floating-label::after {\n content: "";\n position: absolute;\n left: 0;\n width: 100%;\n z-index: -1;\n }\n\n .floating-label::before {\n top: 0;\n height: 50%;\n background: var(--wavelength-container-background, white);\n }\n\n .floating-label::after {\n bottom: 0;\n height: 50%;\n background: var(--wavelength-label-background, #ffffff);\n }\n\n :host([disabled]) .floating-label::before {\n opacity: 0;\n }\n\n input {\n font-size: 16px;\n padding: 16.5px 14px;\n border: 1px solid var(--wavelength-border-color, #cccccc);\n border-radius: 8px;\n width: 100%;\n box-sizing: border-box;\n background-color: var(--wavelength-background, #ffffff);\n transition: border-color 0.2s ease;\n overflow: auto;\n font-family: inherit;\n }\n\n input:focus {\n outline: none;\n }\n\n input:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n :host([disabled]) .floating-label::after {\n opacity: 0;\n cursor: not-allowed;\n }\n\n input::placeholder {\n color: #999999;\n }\n\n .helper-message {\n margin-top: 4px;\n font-size: 0.75rem;\n max-width: 100%;\n word-wrap: break-word;\n white-space: normal;\n overflow-wrap: break-word;\n color: #000000;\n padding-left: 14px;\n margin-left: 2px;\n user-select: none;\n }\n\n .required-marker {\n color: red;\n font-weight: lighter;\n font-size: 0.75rem;\n }\n\n .clear-button {\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n font-size: 1.25 rem;\n color: #666666;\n cursor: pointer;\n opacity: 0.5;\n user-select: none;\n transition: opacity 0.2s ease;\n z-index: 2;\n display: none;\n line-height: 1;\n padding: 0 4px;\n }\n\n .clear-button:hover {\n opacity: 1;\n }\n\n :host([disabled]) .clear-button {\n display: none;\n }\n</style>\n<div class="field-wrapper">\n <label class="floating-label" id="floating-label"></label>\n <div class="input-wrapper"></div>\n <div class="clear-button" id="clear-button" title="Clear input">\u2715</div>\n</div>\n<div class="helper-message" id="helper"></div>\n';
|
|
3186
|
+
var wavelength_input_template_default = '<style>\n :host {\n display: block;\n width: 100%;\n font-family: sans-serif;\n --wavelength-container-background: #f8f8f8;\n --wavelength-label-background: #ffffff;\n }\n\n .field-wrapper {\n position: relative;\n width: 100%;\n height: 100%;\n }\n\n .input-wrapper {\n width: 100%;\n height: 100%;\n }\n\n .floating-label {\n position: absolute;\n top: -0.325rem;\n left: 12px;\n font-size: 0.75rem;\n line-height: 1;\n color: var(--wavelength-label-color, #666666);\n padding: 0 4px;\n z-index: 1;\n pointer-events: none;\n user-select: none;\n }\n\n .floating-label::before,\n .floating-label::after {\n content: "";\n position: absolute;\n left: 0;\n width: 100%;\n z-index: -1;\n }\n\n .floating-label::before {\n top: 0;\n height: 50%;\n background: var(--wavelength-container-background, white);\n }\n\n .floating-label::after {\n bottom: 0;\n height: 50%;\n background: var(--wavelength-label-background, #ffffff);\n }\n\n :host([disabled]) .floating-label::before {\n opacity: 0;\n }\n\n input,\n textarea {\n font-size: 16px;\n padding: 16.5px 14px;\n border: 1px solid var(--wavelength-border-color, #cccccc);\n border-radius: 8px;\n width: 100%;\n box-sizing: border-box;\n background-color: var(--wavelength-background, #ffffff);\n transition: border-color 0.2s ease;\n overflow: auto;\n font-family: inherit;\n display: block;\n }\n\n textarea {\n resize: vertical;\n min-height: 100px;\n }\n\n input:focus,\n textarea:focus {\n outline: none;\n }\n\n input:disabled,\n textarea:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n :host([disabled]) .floating-label::after {\n opacity: 0;\n cursor: not-allowed;\n }\n\n input::placeholder,\n textarea::placeholder {\n color: #999999;\n }\n\n .helper-message {\n margin-top: 4px;\n font-size: 0.75rem;\n max-width: 100%;\n word-wrap: break-word;\n white-space: normal;\n overflow-wrap: break-word;\n color: #000000;\n padding-left: 14px;\n margin-left: 2px;\n user-select: none;\n }\n\n .required-marker {\n color: red;\n font-weight: lighter;\n font-size: 0.75rem;\n }\n\n .clear-button {\n position: absolute;\n right: 12px;\n top: 50%;\n transform: translateY(-50%);\n font-size: 1.25 rem;\n color: #666666;\n cursor: pointer;\n opacity: 0.5;\n user-select: none;\n transition: opacity 0.2s ease;\n z-index: 2;\n display: none;\n line-height: 1;\n padding: 0 4px;\n }\n\n .clear-button:hover {\n opacity: 1;\n }\n\n :host([disabled]) .clear-button {\n display: none;\n }\n</style>\n<div class="field-wrapper">\n <label class="floating-label" id="floating-label"></label>\n <div class="input-wrapper"></div>\n <div class="clear-button" id="clear-button" title="Clear input">\u2715</div>\n</div>\n<div class="helper-message" id="helper"></div>\n';
|
|
3187
3187
|
|
|
3188
3188
|
// src/web-components/wavelength-input.ts
|
|
3189
3189
|
function getAncestor(el) {
|
|
@@ -3264,12 +3264,11 @@ var BaseWavelengthInput = class extends HTMLElement {
|
|
|
3264
3264
|
this.internals = this.attachInternals();
|
|
3265
3265
|
const shadow = this.attachShadow({ mode: "open" });
|
|
3266
3266
|
shadow.innerHTML = wavelength_input_template_default;
|
|
3267
|
-
this.inputEl = document.createElement("input");
|
|
3268
3267
|
this.labelEl = shadow.getElementById("floating-label");
|
|
3269
3268
|
this.helperEl = shadow.getElementById("helper");
|
|
3270
3269
|
this.clearButtonEl = shadow.getElementById("clear-button");
|
|
3271
3270
|
this.clearButtonEl.addEventListener("click", this._onClearClick);
|
|
3272
|
-
|
|
3271
|
+
this._ensureInputType();
|
|
3273
3272
|
shadow.appendChild(this.placeholderStyleEl);
|
|
3274
3273
|
}
|
|
3275
3274
|
static get observedAttributes() {
|
|
@@ -3304,9 +3303,33 @@ var BaseWavelengthInput = class extends HTMLElement {
|
|
|
3304
3303
|
"force-error",
|
|
3305
3304
|
"label",
|
|
3306
3305
|
"font-size",
|
|
3307
|
-
"font-family"
|
|
3306
|
+
"font-family",
|
|
3307
|
+
"multi-line"
|
|
3308
3308
|
];
|
|
3309
3309
|
}
|
|
3310
|
+
_ensureInputType() {
|
|
3311
|
+
const isMulti = this.hasAttribute("multi-line");
|
|
3312
|
+
const newTag = isMulti ? "textarea" : "input";
|
|
3313
|
+
if (this.inputEl && this.inputEl.tagName.toLowerCase() === newTag) {
|
|
3314
|
+
return;
|
|
3315
|
+
}
|
|
3316
|
+
const oldValue = this.inputEl ? this.inputEl.value : "";
|
|
3317
|
+
const newEl = document.createElement(newTag);
|
|
3318
|
+
if (this.inputEl) {
|
|
3319
|
+
this.inputEl.removeEventListener("input", this._onInput);
|
|
3320
|
+
this.inputEl.removeEventListener("blur", this._onBlur);
|
|
3321
|
+
this.inputEl.removeEventListener("focus", this._onFocus);
|
|
3322
|
+
this.inputEl.replaceWith(newEl);
|
|
3323
|
+
} else {
|
|
3324
|
+
this.shadowRoot.querySelector(".input-wrapper").appendChild(newEl);
|
|
3325
|
+
}
|
|
3326
|
+
this.inputEl = newEl;
|
|
3327
|
+
this.inputEl.value = oldValue;
|
|
3328
|
+
this.inputEl.addEventListener("input", this._onInput);
|
|
3329
|
+
this.inputEl.addEventListener("blur", this._onBlur);
|
|
3330
|
+
this.inputEl.addEventListener("focus", this._onFocus);
|
|
3331
|
+
this._applyAttributes();
|
|
3332
|
+
}
|
|
3310
3333
|
connectedCallback() {
|
|
3311
3334
|
["placeholder", "value", "input-type", "disabled", "id", "name"].forEach(this._upgradeProperty.bind(this));
|
|
3312
3335
|
this.validationType = this.getAttribute("validation-type") || "none";
|
|
@@ -3486,7 +3509,9 @@ var BaseWavelengthInput = class extends HTMLElement {
|
|
|
3486
3509
|
if (maxLength) this.inputEl.maxLength = Number(maxLength);
|
|
3487
3510
|
this.inputEl.placeholder = this.getAttribute("placeholder") || "";
|
|
3488
3511
|
this.inputEl.value = this.getAttribute("value") || "";
|
|
3489
|
-
this.inputEl
|
|
3512
|
+
if (this.inputEl instanceof HTMLInputElement) {
|
|
3513
|
+
this.inputEl.type = this.getAttribute("input-type") || "text";
|
|
3514
|
+
}
|
|
3490
3515
|
this.inputEl.disabled = this.disabled;
|
|
3491
3516
|
this.labelEl.innerHTML = `
|
|
3492
3517
|
<span class="label-text">${label || ""}</span>
|
|
@@ -3626,6 +3651,9 @@ var BaseWavelengthInput = class extends HTMLElement {
|
|
|
3626
3651
|
case "required":
|
|
3627
3652
|
this._updateRequiredMarker();
|
|
3628
3653
|
break;
|
|
3654
|
+
case "multi-line":
|
|
3655
|
+
this._ensureInputType();
|
|
3656
|
+
break;
|
|
3629
3657
|
default:
|
|
3630
3658
|
this._applyAttributes();
|
|
3631
3659
|
break;
|
|
@@ -4603,167 +4631,42 @@ if (!customElements.get("wavelength-multi-select-autocomplete")) {
|
|
|
4603
4631
|
customElements.define("wavelength-multi-select-autocomplete", WavelengthMultiSelectAutocomplete);
|
|
4604
4632
|
}
|
|
4605
4633
|
|
|
4606
|
-
// src/web-components/wavelength-nav-bar.
|
|
4607
|
-
var
|
|
4608
|
-
template4.innerHTML = `
|
|
4609
|
-
<style>
|
|
4610
|
-
:host {
|
|
4611
|
-
display: block;
|
|
4612
|
-
font-family: sans-serif;
|
|
4613
|
-
height: 100%;
|
|
4614
|
-
}
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
nav {
|
|
4618
|
-
display: flex;
|
|
4619
|
-
width: 95%;
|
|
4620
|
-
height: var(--height, 25px);
|
|
4621
|
-
padding: var(--padding, 1rem);
|
|
4622
|
-
border-bottom: var(--border, 1px solid #ddd);
|
|
4623
|
-
position: fixed;
|
|
4624
|
-
top: -25;
|
|
4625
|
-
z-index: 1000;
|
|
4626
|
-
background: var(--bg, #ffffffff);
|
|
4627
|
-
color: var(--txt, #000);
|
|
4628
|
-
gap:1rem;
|
|
4629
|
-
white-space: nowrap;
|
|
4630
|
-
align-items: center;
|
|
4631
|
-
justify-content: space-between;
|
|
4632
|
-
}
|
|
4633
|
-
|
|
4634
|
-
.nav-center {
|
|
4635
|
-
display: flex;
|
|
4636
|
-
justify-content: center;
|
|
4637
|
-
}
|
|
4638
|
-
|
|
4639
|
-
.home {
|
|
4640
|
-
flex: 1;
|
|
4641
|
-
justify-content: flex-start;
|
|
4642
|
-
cursor: pointer;
|
|
4643
|
-
display: flex;
|
|
4644
|
-
align-items: center;
|
|
4645
|
-
gap: 0.5rem;
|
|
4646
|
-
}
|
|
4634
|
+
// src/web-components/wavelength-nav-bar.html
|
|
4635
|
+
var wavelength_nav_bar_default = '<style>\n :host {\n display: block;\n font-family: sans-serif;\n height: 100%;\n }\n\n nav {\n display: flex;\n width: 95%;\n height: var(--height, 25px);\n padding: var(--padding, 1rem);\n border-bottom: var(--border, 1px solid #ddd);\n position: fixed;\n top: -25;\n z-index: 1000;\n background: var(--bg, #ffffffff);\n color: var(--txt, #000);\n gap: 1rem;\n align-items: center;\n justify-content: space-between;\n }\n\n .nav-center {\n display: flex;\n justify-content: center;\n }\n\n .home {\n flex: 1;\n justify-content: flex-start;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n #logo svg {\n width: 28px;\n height: 28px;\n flex-shrink: 0;\n cursor: pointer;\n }\n\n .tab {\n padding: 0.35rem 0.75rem;\n border: 1px solid #ffffffff;\n border-radius: 4px;\n text-align: center;\n cursor: pointer;\n background: #fff;\n }\n\n .tab:hover {\n background: #f0f0f0; /* optional hover effect */\n }\n\n .settings {\n flex: 1;\n justify-content: flex-end;\n cursor: pointer;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n\n .profile-note {\n font-size: 0.8rem;\n opacity: 0.75;\n }\n\n .middle-tab-group {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex: 3;\n }\n .notification-wrapper {\n position: relative;\n height: 100%;\n display: flex;\n }\n</style>\n<nav>\n <div class="section home" id="logo">\n <svg id="a" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="280" height="280" viewBox="0 0 280 280">\n <defs>\n <style>\n .b {\n fill: #231f20;\n }\n .c {\n fill: #fff;\n }\n </style>\n </defs>\n <path\n class="b"\n d="M82.5,272.3c-8,.5-13.5-2-17.5-5.5s-34-47.5-36-50.5-2-2.5-2-7.5-1.5-122-1.5-122c1.5-5.5,7-17.5,18-16l72-3.5c1-3.5,4-4.5,4-4.5l-44.5-40.5c-5.5-5.5,1.5-11.5,6.5-7l46,41c4-1.5,10.5-2,15.5-1l38.5-44.5c5.5-5.5,12,0,8,5.5l-36,42.5c1.5,1,4,4.5,4.5,6l28-2c5.5,0,47.5,14,57,17s12,9,12,17-1.5,140-1.5,140c-2.7,12.3-10.5,19-27.5,20.5l-143.5,15Z"\n />\n <path class="c" d="M240,113.3c.3-11.6-9.4-21-21-20.4l-122.5,6.4c-10.6.6-19,9.3-19,20v100.8c0,11.9,10.3,21.1,22.1,19.9l120.4-12.8c10-1.1,17.7-9.4,17.9-19.4l2.1-94.4Z" />\n <ellipse class="c" cx="228.4" cy="241.6" rx="7" ry="6.5" transform="translate(-89 340.5) rotate(-63.9)" />\n <path\n d="M132,217.5c-9.5,0-16.3-3.5-21-9.9-6-8.3-7.5-23.5-7.5-39.6s1-29.2,9.5-38.6c6-6.6,10-9.9,22-9.9s16.5,2.8,21,9.4c6.5,9.6,7.5,23.1,7.5,39.2s-.4,20.3-3.1,27.7c-2.7,7.3-6.3,12.8-11,16.4-4.7,3.6-11.3,5.4-17.4,5.4ZM132.5,200.4c5.2,0,7.8-2.9,10-8.8,1.5-6.6,2-11.9,2-23.7s0-17.6-1.5-24.2c-2.3-5.8-4.8-8.8-9.8-8.8-5.2,1.1-6.4,3.6-8.7,9.4-1.5,10.5-1.5,12.7-1.5,23.7s0,19.3,1.5,25.3c2.5,5,2.7,7.2,8,7.2Z"\n />\n <path\n d="M172.7,209.3c-1.1-1.1-.5-12.3-.5-12.3,0,0,0-.6,1.1-1.1,5.9,0,10.1-1.6,10.7-2.8,1.1-1.1,1.6-1.3,1.6-3.9l.5-44.1c0-6.1-7-2.8-12.9-3.3-.5,0-1.1-.6-1.1-1.1v-12.8c3.7-.7,8-1.9,11.1-3.9,3.1-2,4.3-5.7,6.4-8.4l16.8-1.1-.5,73.1s.5,3.3,2.1,3.9c1.1.4,7.5.6,9.1.6s1.6,1.1,1.6,1.1c0,1.7.5,11.7,0,12.3,0,.6-45,5-46.1,3.9Z"\n />\n </svg>\n <slot name="home"></slot>\n </div>\n <div class="nav-center"></div>\n <div class="middle-tab-group"></div>\n <div class="notification-wrapper">\n <wavelength-notification-panel></wavelength-notification-panel>\n </div>\n</nav>\n`;\n';
|
|
4647
4636
|
|
|
4648
|
-
|
|
4649
|
-
width: 28px;
|
|
4650
|
-
height: 28px;
|
|
4651
|
-
flex-shrink: 0;
|
|
4652
|
-
cursor: pointer;
|
|
4653
|
-
}
|
|
4654
|
-
|
|
4655
|
-
.tab {
|
|
4656
|
-
padding: 0.35rem 0.75rem;
|
|
4657
|
-
border: 1px solid #ffffffff;
|
|
4658
|
-
border-radius: 4px;
|
|
4659
|
-
text-align: center;
|
|
4660
|
-
cursor: pointer;
|
|
4661
|
-
background: #fff;
|
|
4662
|
-
}
|
|
4663
|
-
|
|
4664
|
-
.tab:hover {
|
|
4665
|
-
background: #f0f0f0; /* optional hover effect */
|
|
4666
|
-
}
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
.settings {
|
|
4670
|
-
flex: 1;
|
|
4671
|
-
justify-content: flex-end;
|
|
4672
|
-
cursor: pointer;
|
|
4673
|
-
display: flex;
|
|
4674
|
-
align-items: center;
|
|
4675
|
-
gap: 0.5rem;
|
|
4676
|
-
}
|
|
4677
|
-
|
|
4678
|
-
.profile {
|
|
4679
|
-
padding: var(--padding, 1rem);
|
|
4680
|
-
border: 2px solid #ccc;
|
|
4681
|
-
border-radius: 6px;
|
|
4682
|
-
cursor: pointer;
|
|
4683
|
-
display: flex;
|
|
4684
|
-
flex-direction: column;
|
|
4685
|
-
text-align: center;
|
|
4686
|
-
width: 100%;
|
|
4687
|
-
height: var(--height, 25px);
|
|
4688
|
-
position: fixed;
|
|
4689
|
-
}
|
|
4690
|
-
|
|
4691
|
-
.profile-name {
|
|
4692
|
-
font-weight: 600;
|
|
4693
|
-
}
|
|
4694
|
-
|
|
4695
|
-
.profile-note {
|
|
4696
|
-
font-size: 0.8rem;
|
|
4697
|
-
opacity: 0.75;
|
|
4698
|
-
}
|
|
4699
|
-
|
|
4700
|
-
.middle-tab-group {
|
|
4701
|
-
display: flex;
|
|
4702
|
-
align-items: center;
|
|
4703
|
-
gap: 0.5rem;
|
|
4704
|
-
flex: 3;
|
|
4705
|
-
}
|
|
4706
|
-
.notification-wrapper {
|
|
4707
|
-
position: relative;
|
|
4708
|
-
height: 100%;
|
|
4709
|
-
display: flex;
|
|
4710
|
-
|
|
4711
|
-
}
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
</style>
|
|
4715
|
-
<nav>
|
|
4716
|
-
<div class="section home" id="logo">
|
|
4717
|
-
<!-- Inline SVG to ensure universal compatibility -->
|
|
4718
|
-
<svg id="a" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="280" height="280" viewBox="0 0 280 280">
|
|
4719
|
-
<defs>
|
|
4720
|
-
<style>
|
|
4721
|
-
.b {
|
|
4722
|
-
fill: #231f20;
|
|
4723
|
-
}
|
|
4724
|
-
.c {
|
|
4725
|
-
fill: #fff;
|
|
4726
|
-
}
|
|
4727
|
-
</style>
|
|
4728
|
-
</defs>
|
|
4729
|
-
<path class="b" d="M82.5,272.3c-8,.5-13.5-2-17.5-5.5s-34-47.5-36-50.5-2-2.5-2-7.5-1.5-122-1.5-122c1.5-5.5,7-17.5,18-16l72-3.5c1-3.5,4-4.5,4-4.5l-44.5-40.5c-5.5-5.5,1.5-11.5,6.5-7l46,41c4-1.5,10.5-2,15.5-1l38.5-44.5c5.5-5.5,12,0,8,5.5l-36,42.5c1.5,1,4,4.5,4.5,6l28-2c5.5,0,47.5,14,57,17s12,9,12,17-1.5,140-1.5,140c-2.7,12.3-10.5,19-27.5,20.5l-143.5,15Z"/>
|
|
4730
|
-
<path class="c" d="M240,113.3c.3-11.6-9.4-21-21-20.4l-122.5,6.4c-10.6.6-19,9.3-19,20v100.8c0,11.9,10.3,21.1,22.1,19.9l120.4-12.8c10-1.1,17.7-9.4,17.9-19.4l2.1-94.4Z"/>
|
|
4731
|
-
<ellipse class="c" cx="228.4" cy="241.6" rx="7" ry="6.5" transform="translate(-89 340.5) rotate(-63.9)"/>
|
|
4732
|
-
<path d="M132,217.5c-9.5,0-16.3-3.5-21-9.9-6-8.3-7.5-23.5-7.5-39.6s1-29.2,9.5-38.6c6-6.6,10-9.9,22-9.9s16.5,2.8,21,9.4c6.5,9.6,7.5,23.1,7.5,39.2s-.4,20.3-3.1,27.7c-2.7,7.3-6.3,12.8-11,16.4-4.7,3.6-11.3,5.4-17.4,5.4ZM132.5,200.4c5.2,0,7.8-2.9,10-8.8,1.5-6.6,2-11.9,2-23.7s0-17.6-1.5-24.2c-2.3-5.8-4.8-8.8-9.8-8.8-5.2,1.1-6.4,3.6-8.7,9.4-1.5,10.5-1.5,12.7-1.5,23.7s0,19.3,1.5,25.3c2.5,5,2.7,7.2,8,7.2Z"/>
|
|
4733
|
-
<path d="M172.7,209.3c-1.1-1.1-.5-12.3-.5-12.3,0,0,0-.6,1.1-1.1,5.9,0,10.1-1.6,10.7-2.8,1.1-1.1,1.6-1.3,1.6-3.9l.5-44.1c0-6.1-7-2.8-12.9-3.3-.5,0-1.1-.6-1.1-1.1v-12.8c3.7-.7,8-1.9,11.1-3.9,3.1-2,4.3-5.7,6.4-8.4l16.8-1.1-.5,73.1s.5,3.3,2.1,3.9c1.1.4,7.5.6,9.1.6s1.6,1.1,1.6,1.1c0,1.7.5,11.7,0,12.3,0,.6-45,5-46.1,3.9Z"/>
|
|
4734
|
-
</svg>
|
|
4735
|
-
<slot name="home"></slot>
|
|
4736
|
-
</div>
|
|
4737
|
-
<div class="nav-center"></div>
|
|
4738
|
-
<div class = "middle-tab-group">
|
|
4739
|
-
<div class="tab"><a href="/applications"><slot name="tab">Applications</slot></a></div>
|
|
4740
|
-
<div class="tab"><a href="/users"><slot name="tab">Users</slot></a></div>
|
|
4741
|
-
<div class="tab"><a href="/apikeys"><slot name="tab">API Keys</slot></a></div>
|
|
4742
|
-
</div>
|
|
4743
|
-
<div class="notification-wrapper">
|
|
4744
|
-
<wavelength-notification-panel ></wavelength-notification-panel>
|
|
4745
|
-
</div>
|
|
4746
|
-
</nav>
|
|
4747
|
-
`;
|
|
4637
|
+
// src/web-components/wavelength-nav-bar.ts
|
|
4748
4638
|
var WavelengthNavBar = class extends HTMLElement {
|
|
4749
|
-
static get observedAttributes() {
|
|
4750
|
-
return ["bg-color", "txt-color", "height", "padding", "border", "items"];
|
|
4751
|
-
}
|
|
4752
4639
|
constructor() {
|
|
4753
4640
|
super();
|
|
4641
|
+
this._handleHomeClick = () => {
|
|
4642
|
+
this.dispatchEvent(new CustomEvent("home-click", { bubbles: true, composed: true }));
|
|
4643
|
+
};
|
|
4754
4644
|
const shadow = this.attachShadow({ mode: "open" });
|
|
4755
|
-
shadow.
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4645
|
+
shadow.innerHTML = wavelength_nav_bar_default;
|
|
4646
|
+
}
|
|
4647
|
+
static get observedAttributes() {
|
|
4648
|
+
return ["bg-color", "txt-color", "height", "padding", "border", "items"];
|
|
4649
|
+
}
|
|
4650
|
+
disconnectedCallback() {
|
|
4651
|
+
const logo = this.shadowRoot?.querySelector("#logo");
|
|
4652
|
+
if (logo) {
|
|
4653
|
+
logo.removeEventListener("click", this._handleHomeClick);
|
|
4654
|
+
}
|
|
4759
4655
|
}
|
|
4760
4656
|
connectedCallback() {
|
|
4761
4657
|
this.applyStyles();
|
|
4762
4658
|
this.renderTabs();
|
|
4659
|
+
const logo = this.shadowRoot?.querySelector("#logo");
|
|
4660
|
+
if (logo) {
|
|
4661
|
+
logo.addEventListener("click", this._handleHomeClick);
|
|
4662
|
+
}
|
|
4763
4663
|
}
|
|
4764
|
-
attributeChangedCallback() {
|
|
4664
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
4665
|
+
if (oldValue === newValue) return;
|
|
4666
|
+
if (name === "items") {
|
|
4667
|
+
this.renderTabs();
|
|
4668
|
+
}
|
|
4765
4669
|
this.applyStyles();
|
|
4766
|
-
this.renderTabs();
|
|
4767
4670
|
}
|
|
4768
4671
|
applyStyles() {
|
|
4769
4672
|
this.style.setProperty("--bg", this.getAttribute("bg-color") || "#ffffffff");
|
|
@@ -4775,18 +4678,31 @@ var WavelengthNavBar = class extends HTMLElement {
|
|
|
4775
4678
|
renderTabs() {
|
|
4776
4679
|
const container = this.shadowRoot?.querySelector(".middle-tab-group");
|
|
4777
4680
|
if (!container) return;
|
|
4778
|
-
container.
|
|
4681
|
+
container.replaceChildren();
|
|
4779
4682
|
const itemsAttr = this.getAttribute("items");
|
|
4780
|
-
|
|
4683
|
+
let items = [];
|
|
4684
|
+
const attr = this.getAttribute("items");
|
|
4685
|
+
if (attr) {
|
|
4686
|
+
try {
|
|
4687
|
+
items = JSON.parse(attr);
|
|
4688
|
+
} catch (e) {
|
|
4689
|
+
console.warn("Invalid items JSON", e);
|
|
4690
|
+
}
|
|
4691
|
+
}
|
|
4781
4692
|
items.forEach((item) => {
|
|
4782
4693
|
const tab = document.createElement("div");
|
|
4783
4694
|
tab.className = "tab";
|
|
4784
4695
|
tab.textContent = item.title;
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4696
|
+
tab.setAttribute("role", "tab");
|
|
4697
|
+
tab.tabIndex = 0;
|
|
4698
|
+
this.dispatchEvent(
|
|
4699
|
+
new CustomEvent("tab-click", {
|
|
4700
|
+
detail: { title: item.title, path: item.path },
|
|
4701
|
+
bubbles: true,
|
|
4702
|
+
composed: true,
|
|
4703
|
+
cancelable: true
|
|
4704
|
+
})
|
|
4705
|
+
);
|
|
4790
4706
|
container.appendChild(tab);
|
|
4791
4707
|
});
|
|
4792
4708
|
}
|
|
@@ -4797,8 +4713,8 @@ if (!customElements.get("wavelength-nav-bar")) {
|
|
|
4797
4713
|
|
|
4798
4714
|
// src/web-components/wavelength-child-data-table.ts
|
|
4799
4715
|
var import_react = __toESM(require_react(), 1);
|
|
4800
|
-
var
|
|
4801
|
-
|
|
4716
|
+
var template4 = document.createElement("template");
|
|
4717
|
+
template4.innerHTML = `
|
|
4802
4718
|
|
|
4803
4719
|
<style>
|
|
4804
4720
|
|
|
@@ -4949,7 +4865,7 @@ var ChildDataTable = class extends HTMLElement {
|
|
|
4949
4865
|
<path d="M13.2375 0L7.5 5.725L1.7625 0L0 1.7625L7.5 9.2625L15 1.7625L13.2375 0Z" fill="currentColor"/>
|
|
4950
4866
|
</svg>`;
|
|
4951
4867
|
this.shadow = this.attachShadow({ mode: "open" });
|
|
4952
|
-
this.shadow.append(
|
|
4868
|
+
this.shadow.append(template4.content.cloneNode(true));
|
|
4953
4869
|
}
|
|
4954
4870
|
static get observedAttributes() {
|
|
4955
4871
|
return ["table-columns", "table-data", "dropdown-arrow-location", "sort-icon", "dropdown-button-icon"];
|
|
@@ -5747,8 +5663,8 @@ var WavelengthFileDropZone = class extends HTMLElement {
|
|
|
5747
5663
|
customElements.define("wavelength-file-drop-zone", WavelengthFileDropZone);
|
|
5748
5664
|
|
|
5749
5665
|
// src/web-components/wavelength-dropdown.ts
|
|
5750
|
-
var
|
|
5751
|
-
|
|
5666
|
+
var template5 = document.createElement("template");
|
|
5667
|
+
template5.innerHTML = `
|
|
5752
5668
|
<style>
|
|
5753
5669
|
:host {
|
|
5754
5670
|
display: inline-block;
|
|
@@ -5828,7 +5744,7 @@ var WavelengthDropdown = class extends HTMLElement {
|
|
|
5828
5744
|
super();
|
|
5829
5745
|
this._options = [];
|
|
5830
5746
|
const shadow = this.attachShadow({ mode: "open" });
|
|
5831
|
-
shadow.appendChild(
|
|
5747
|
+
shadow.appendChild(template5.content.cloneNode(true));
|
|
5832
5748
|
this.dropdownField = shadow.querySelector(".dropdown-field");
|
|
5833
5749
|
this.dropdownBox = shadow.querySelector(".dropdown-box");
|
|
5834
5750
|
this.selectedSpan = shadow.querySelector(".selected");
|
|
@@ -6903,11 +6819,149 @@ var WavelengthSwitch = class extends HTMLElement {
|
|
|
6903
6819
|
if (!customElements.get("wavelength-switch")) {
|
|
6904
6820
|
customElements.define("wavelength-switch", WavelengthSwitch);
|
|
6905
6821
|
}
|
|
6822
|
+
|
|
6823
|
+
// src/web-components/wavelength-badge.template.html
|
|
6824
|
+
var wavelength_badge_template_default = '<style>\n @import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap");\n\n :host {\n display: inline-block;\n font-family: var(--main-font-stack);\n --badge-font: "Montserrat";\n --font-family: "Montserrat";\n --fallback-fonts: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;\n\n --badge-font-stack: var(--badge-font), var(--fallback-fonts);\n --main-font-stack: var(--font-family), var(--fallback-fonts);\n\n --badge-color: rgb(69, 95, 230);\n --badge-text-color: rgb(255, 255, 255);\n --badge-hover-color: color-mix(in srgb, var(--badge-color), black 15%);\n --badge-border-radius: 50%;\n --font-size: 14px;\n --badge-size: 24px;\n\n --text-box-border-radius: 8px;\n --text-box-background-color: #f3f3f3;\n --text-box-text-color: black;\n --text-box-border-color: black;\n --text-box-hover-border-color: color-mix(in srgb, var(--text-box-border-color), black 40%);\n --text-box-font-size: 12px;\n --text-box-font-family: "Montserrat";\n --text-box-font-stack: var(--text-box-font-family), var(--fallback-fonts);\n --text-box-align-items: center;\n --text-box-justify-content: center;\n --text-box-width: auto;\n --text-box-height: auto;\n }\n\n :host([href]) {\n cursor: pointer;\n }\n\n :host([href]) .badge:hover {\n background: var(--badge-hover-color, color-mix(in srgb, var(--badge-color, rgb(69, 95, 230)), black 15%));\n color: #f3f3f3;\n }\n\n :host([href]) .contentBox:hover {\n border-color: var(--text-box-hover-border-color, color-mix(in srgb, var(--text-box-border-color, black), black 40%));\n }\n\n .badge {\n background: var(--badge-color, rgb(69, 95, 230));\n color: var(--badge-text-color, rgb(255, 255, 255));\n border-radius: var(--badge-border-radius, 50%);\n font-size: var(--font-size, 14px);\n text-align: center;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n line-height: 1;\n box-sizing: border-box;\n font-family: var(--badge-font-stack);\n min-width: var(--badge-size, 24px);\n width: var(--badge-size, 24px);\n height: var(--badge-size, 24px);\n transition: background-color 0.2s ease;\n padding: 0;\n overflow: hidden;\n white-space: nowrap;\n }\n\n .badge slot[name="badge"]::slotted(*) {\n display: inline-block;\n max-width: 100%;\n overflow: hidden;\n text-overflow: clip;\n font-size: inherit;\n padding: 0 1px;\n }\n\n .badge.len-3 {\n font-size: calc(var(--font-size) * 0.55);\n letter-spacing: -0.06em;\n }\n\n .badge.len-4 {\n font-size: calc(var(--font-size) * 0.45);\n letter-spacing: -0.08em;\n }\n\n .badge.len-long {\n font-size: calc(var(--font-size) * 0.35);\n letter-spacing: -0.12em;\n }\n\n .basic {\n display: inline-flex;\n }\n\n .wrapper {\n position: relative;\n display: inline-flex;\n width: fit-content;\n height: fit-content;\n }\n\n .instanceBadge {\n position: absolute;\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n z-index: 1;\n }\n\n .contentBox {\n border-radius: var(--text-box-border-radius, 8px);\n background: var(--text-box-background-color, #f3f3f3);\n color: var(--text-box-text-color, black);\n display: inline-flex;\n flex-direction: column;\n align-items: var(--text-box-align-items, center);\n justify-content: var(--text-box-justify-content, center);\n border: 1px solid var(--text-box-border-color, black);\n box-sizing: border-box;\n font-family: var(--text-box-font-stack);\n width: var(--text-box-width, auto);\n height: var(--text-box-height, auto);\n padding: 6px 10px;\n transition: border-color 0.2s ease;\n overflow: scroll;\n text-overflow: ellipsis;\n word-break: break-word;\n }\n\n .contentBox slot {\n display: flex;\n flex-direction: column;\n align-items: var(--text-box-align-items);\n justify-content: var(--text-box-justify-content);\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n\n ::slotted(:not([slot])) {\n max-width: 100%;\n max-height: 100%;\n width: 100%;\n height: 100%;\n flex: 1;\n }\n</style>\n<div id="root"></div>\n';
|
|
6825
|
+
|
|
6826
|
+
// src/web-components/wavelength-badge.ts
|
|
6827
|
+
var _WavelengthBadge = class _WavelengthBadge extends HTMLElement {
|
|
6828
|
+
constructor() {
|
|
6829
|
+
super();
|
|
6830
|
+
this.badgeSlot = null;
|
|
6831
|
+
this._handleClick = () => {
|
|
6832
|
+
const href = this.getAttribute("href");
|
|
6833
|
+
if (href) {
|
|
6834
|
+
window.open(href, "_blank");
|
|
6835
|
+
}
|
|
6836
|
+
};
|
|
6837
|
+
this._handleSlotChange = () => {
|
|
6838
|
+
if (!this.badgeSlot) return;
|
|
6839
|
+
const assignedNodes = this.badgeSlot.assignedNodes();
|
|
6840
|
+
const textContent = assignedNodes.map((node) => node.textContent).join("").trim();
|
|
6841
|
+
if (textContent) {
|
|
6842
|
+
this._updateLengthClass(textContent);
|
|
6843
|
+
}
|
|
6844
|
+
};
|
|
6845
|
+
this.shadow = this.attachShadow({ mode: "open" });
|
|
6846
|
+
this.shadow.innerHTML = wavelength_badge_template_default;
|
|
6847
|
+
this.rootElement = this.shadow.getElementById("root");
|
|
6848
|
+
}
|
|
6849
|
+
static get observedAttributes() {
|
|
6850
|
+
return [..._WavelengthBadge.styleAttributes, "variant", "badge-content", "href"];
|
|
6851
|
+
}
|
|
6852
|
+
connectedCallback() {
|
|
6853
|
+
this._syncStyles();
|
|
6854
|
+
this._render();
|
|
6855
|
+
this._updateA11y();
|
|
6856
|
+
this.addEventListener("click", this._handleClick);
|
|
6857
|
+
}
|
|
6858
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
6859
|
+
if (_WavelengthBadge.styleAttributes.includes(name)) {
|
|
6860
|
+
this._syncStyles();
|
|
6861
|
+
} else if (name === "variant") {
|
|
6862
|
+
this._render();
|
|
6863
|
+
} else if (name === "badge-content") {
|
|
6864
|
+
this._updateLengthClass(newValue || "");
|
|
6865
|
+
this._updateSlotText(newValue || "");
|
|
6866
|
+
} else if (name === "href") {
|
|
6867
|
+
this._updateA11y();
|
|
6868
|
+
}
|
|
6869
|
+
}
|
|
6870
|
+
disconnectedCallback() {
|
|
6871
|
+
this.removeEventListener("click", this._handleClick);
|
|
6872
|
+
this.badgeSlot?.removeEventListener("slotchange", this._handleSlotChange);
|
|
6873
|
+
}
|
|
6874
|
+
_syncStyles() {
|
|
6875
|
+
_WavelengthBadge.styleAttributes.forEach((attr) => {
|
|
6876
|
+
const value = this.getAttribute(attr);
|
|
6877
|
+
if (value !== null && value !== "") {
|
|
6878
|
+
this.style.setProperty(`--${attr}`, value);
|
|
6879
|
+
} else {
|
|
6880
|
+
this.style.removeProperty(`--${attr}`);
|
|
6881
|
+
}
|
|
6882
|
+
});
|
|
6883
|
+
}
|
|
6884
|
+
_render() {
|
|
6885
|
+
if (!this.rootElement) return;
|
|
6886
|
+
const variant = this.getAttribute("variant") || "basic";
|
|
6887
|
+
const badgeContent = this.getAttribute("badge-content") || "";
|
|
6888
|
+
const contentLength = badgeContent.length;
|
|
6889
|
+
const lengthClass = contentLength > 4 ? "len-long" : `len-${contentLength}`;
|
|
6890
|
+
this.rootElement.textContent = "";
|
|
6891
|
+
this.badgeSlot = document.createElement("slot");
|
|
6892
|
+
this.badgeSlot.name = "badge";
|
|
6893
|
+
this.badgeSlot.textContent = badgeContent;
|
|
6894
|
+
this.badgeSlot.addEventListener("slotchange", this._handleSlotChange);
|
|
6895
|
+
const badgeDiv = document.createElement("div");
|
|
6896
|
+
badgeDiv.appendChild(this.badgeSlot);
|
|
6897
|
+
if (variant === "withInstance") {
|
|
6898
|
+
const wrapper = document.createElement("div");
|
|
6899
|
+
wrapper.className = "wrapper";
|
|
6900
|
+
const contentBox = document.createElement("div");
|
|
6901
|
+
contentBox.className = "contentBox";
|
|
6902
|
+
const mainSlot = document.createElement("slot");
|
|
6903
|
+
contentBox.appendChild(mainSlot);
|
|
6904
|
+
badgeDiv.className = `badge instanceBadge ${lengthClass}`;
|
|
6905
|
+
wrapper.appendChild(contentBox);
|
|
6906
|
+
wrapper.appendChild(badgeDiv);
|
|
6907
|
+
this.rootElement.appendChild(wrapper);
|
|
6908
|
+
} else {
|
|
6909
|
+
badgeDiv.className = `badge basic ${lengthClass}`;
|
|
6910
|
+
this.rootElement.appendChild(badgeDiv);
|
|
6911
|
+
}
|
|
6912
|
+
this.badgeSlot = this.shadowRoot.querySelector('slot[name="badge"]');
|
|
6913
|
+
this.badgeSlot?.addEventListener("slotchange", this._handleSlotChange);
|
|
6914
|
+
}
|
|
6915
|
+
_updateLengthClass(content) {
|
|
6916
|
+
const badge = this.shadowRoot.querySelector(".badge");
|
|
6917
|
+
if (!badge) return;
|
|
6918
|
+
badge.classList.remove("len-1", "len-2", "len-3", "len-4", "len-long");
|
|
6919
|
+
const lengthClass = content.length > 4 ? "len-long" : `len-${content.length}`;
|
|
6920
|
+
badge.classList.add(lengthClass);
|
|
6921
|
+
}
|
|
6922
|
+
_updateSlotText(content) {
|
|
6923
|
+
const slot = this.shadowRoot.querySelector('slot[name="badge"]');
|
|
6924
|
+
if (slot) {
|
|
6925
|
+
slot.textContent = content;
|
|
6926
|
+
}
|
|
6927
|
+
}
|
|
6928
|
+
_updateA11y() {
|
|
6929
|
+
const href = this.getAttribute("href");
|
|
6930
|
+
if (href) {
|
|
6931
|
+
this.setAttribute("role", "link");
|
|
6932
|
+
this.setAttribute("tabindex", "0");
|
|
6933
|
+
} else {
|
|
6934
|
+
this.removeAttribute("role");
|
|
6935
|
+
this.removeAttribute("tabindex");
|
|
6936
|
+
}
|
|
6937
|
+
}
|
|
6938
|
+
};
|
|
6939
|
+
_WavelengthBadge.styleAttributes = [
|
|
6940
|
+
"badge-color",
|
|
6941
|
+
"badge-text-color",
|
|
6942
|
+
"badge-border-radius",
|
|
6943
|
+
"font-size",
|
|
6944
|
+
"badge-size",
|
|
6945
|
+
"badge-font",
|
|
6946
|
+
"text-box-width",
|
|
6947
|
+
"text-box-height",
|
|
6948
|
+
"text-box-background-color",
|
|
6949
|
+
"text-box-text-color",
|
|
6950
|
+
"text-box-border-color",
|
|
6951
|
+
"text-box-border-radius",
|
|
6952
|
+
"badge-hover-color",
|
|
6953
|
+
"text-box-hover-border-color"
|
|
6954
|
+
];
|
|
6955
|
+
var WavelengthBadge = _WavelengthBadge;
|
|
6956
|
+
if (!customElements.get("wavelength-badge")) {
|
|
6957
|
+
customElements.define("wavelength-badge", WavelengthBadge);
|
|
6958
|
+
}
|
|
6906
6959
|
export {
|
|
6907
6960
|
BaseWavelengthInput,
|
|
6908
6961
|
BaseWavelengthMultiSelectAutocomplete,
|
|
6909
6962
|
ChildDataTable,
|
|
6910
6963
|
SampleComponent,
|
|
6964
|
+
WavelengthBadge,
|
|
6911
6965
|
WavelengthBanner,
|
|
6912
6966
|
WavelengthButton,
|
|
6913
6967
|
WavelengthCheckbox,
|
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.15.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",
|