@wavelengthusaf/web-components 1.7.1 → 1.8.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.
@@ -6093,6 +6093,70 @@ 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
+
6096
6160
 
6097
6161
 
6098
6162
 
@@ -6112,7 +6176,7 @@ if (!customElements.get("wavelength-planetrail")) {
6112
6176
 
6113
6177
 
6114
6178
 
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;
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;
6116
6180
  /*! Bundled license information:
6117
6181
 
6118
6182
  react/cjs/react.production.min.js:
@@ -2245,4 +2245,14 @@ declare const WavelengthPlaneTrail_base: {
2245
2245
  declare class WavelengthPlaneTrail extends WavelengthPlaneTrail_base {
2246
2246
  }
2247
2247
 
2248
- export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthSnackbar, WavelengthTitleBar };
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
+ export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthSnackbar, WavelengthTitleBar };
@@ -2245,4 +2245,14 @@ declare const WavelengthPlaneTrail_base: {
2245
2245
  declare class WavelengthPlaneTrail extends WavelengthPlaneTrail_base {
2246
2246
  }
2247
2247
 
2248
- export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthSnackbar, WavelengthTitleBar };
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
+ export { BaseWavelengthInput, BaseWavelengthMultiSelectAutocomplete, type CheckboxElements, ChildDataTable, SampleComponent, WavelengthBanner, WavelengthButton, WavelengthCheckbox, WavelengthDatePicker, WavelengthDropdown, WavelengthFileDropZone, WavelengthForm, WavelengthInput, WavelengthManyPlanes, WavelengthMultiSelectAutocomplete, WavelengthNavBar, WavelengthNotificationPanel, WavelengthPlaneTrail, WavelengthProgressBar, WavelengthSnackbar, WavelengthTitleBar };
package/dist/esm/index.js CHANGED
@@ -6092,6 +6092,69 @@ 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
+ }
6095
6158
  export {
6096
6159
  BaseWavelengthInput,
6097
6160
  BaseWavelengthMultiSelectAutocomplete,
@@ -6105,6 +6168,7 @@ export {
6105
6168
  WavelengthFileDropZone,
6106
6169
  WavelengthForm,
6107
6170
  WavelengthInput,
6171
+ WavelengthManyPlanes,
6108
6172
  WavelengthMultiSelectAutocomplete,
6109
6173
  WavelengthNavBar,
6110
6174
  WavelengthNotificationPanel,
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.7.1",
5
+ "version": "1.8.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",