globuswebcomponents 2.2.9 → 2.3.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.
@@ -1340,6 +1340,7 @@ const GbSimpleSideBarItem = class {
1340
1340
  this.showBadge = false;
1341
1341
  this.showTooltip = false;
1342
1342
  this.leadingIconSvg = '';
1343
+ this.internalIcon = '';
1343
1344
  }
1344
1345
  async loadIcon(iconName) {
1345
1346
  const iconPath = index.getAssetPath(`${iconName}`);
@@ -1355,26 +1356,28 @@ const GbSimpleSideBarItem = class {
1355
1356
  });
1356
1357
  // Serialize and store
1357
1358
  const modifiedSvg = svgElement.outerHTML;
1358
- console.log(modifiedSvg);
1359
+ // console.log(modifiedSvg)
1359
1360
  this.leadingIconSvg = modifiedSvg;
1360
1361
  }
1362
+ updateSidebarIcon(_oldValue, newValue) {
1363
+ this.internalIcon = newValue;
1364
+ }
1361
1365
  componentWillLoad() {
1362
1366
  this.loadIcon(this.icon);
1363
- // this.textState = this.state === 'active' ? 'text-md-semi-bold' : 'text-md-medium';
1367
+ this.internalIcon = this.icon;
1364
1368
  }
1365
1369
  onSideBarItemClicked() {
1366
1370
  this.sideBarItemClicked.emit();
1367
1371
  }
1368
- // getLabel() {
1369
- // const slottedLabel = this.el.querySelector('slot');
1370
- // return slottedLabel.textContent;
1371
- // }
1372
1372
  render() {
1373
1373
  const redBarSrc = index.getAssetPath(`assets/bar.svg`);
1374
1374
  const whiteBarSrc = index.getAssetPath(`assets/bar_white.svg`);
1375
- return (index.h("div", { key: '8efa3a92ebdd076ba0e5793d275ea9747fdc9fe4', class: `side_bar_item_container`, onMouseEnter: () => (this.showTooltip = true), onMouseLeave: () => (this.showTooltip = false) }, index.h("div", { key: 'bb1ad61a75db0fe49be1cdf7ab1f910219c51066', class: `nav_item_base ${this.state} ${this.type} ${this.category}` }, this.state === 'active' && this.category === 'plain_background' && index.h("img", { key: '2e1fa4fc95ef93bb74523d3c787523c3e67f7973', src: redBarSrc, alt: "", class: "bar" }), this.state === 'active' && this.category === 'colored_background' && index.h("img", { key: 'c51f1465ec9f59e64c2635b23c685c7b76c4caf7', src: whiteBarSrc, alt: "", class: "bar" }), index.h("div", { key: '529f9cd42b9b8a0ba795e7be3442315818b3964b', class: "content" }, index.h("div", { key: '1536dc3ad52058b13c53830243aa744a5f12e679', class: `icon ${this.state} ${this.category}`, innerHTML: this.leadingIconSvg }), this.type === 'full_with_label' && (index.h("p", { key: 'c4d427e99552eca25f402efc838d157bc5ae3c3f', class: `label_text ${this.category} ${this.state} ${this.state === 'active' ? 'text-md-semi-bold' : 'text-md-medium'}` }, this.label))), this.type === 'full_with_label' && (index.h(index.Fragment, null, this.showBadge && (index.h("gb-badge", { key: '988fb0eb597e5bbeda3baf90e6a01d0a2aeeab71', size: "sm", type: "pill_outline", color: this.state === 'active' ? 'information' : 'gray' }, index.h("p", { key: 'b9d33d83bbbd87ba6fb853ee348a1f57c33d3c4e' }, "10"))), this.showArrow && (index.h("svg", { key: '10a3b41cbfd1ebc822a88f33eaaabefc74124093', xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", class: `arrow ${this.state} ${this.category}` }, index.h("path", { key: '646d789fb4b3bd8e70c78d8fb6a219ba7cbf110c', d: "M6.00003 4C6.00003 4 9.99999 6.94596 10 8.00003C10 9.05411 6 12 6 12", stroke: "#212C65", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })))))), this.type === 'icon_only' && this.showTooltip && (index.h("gb-tooltip", { key: '2b319b9ae3902c2e3518ebc09f0f0f1f90da984e', "show-arrow": true, arrow: "left", class: "tooltip" }, index.h("p", { key: 'bc69310481b9d2af3cae86c22a4a8520228022a1', slot: "label" }, this.label)))));
1375
+ return (index.h("div", { key: '60eee8c60123f64e69e0baccf05c98bf68837f70', class: `side_bar_item_container`, onMouseEnter: () => (this.showTooltip = true), onMouseLeave: () => (this.showTooltip = false) }, index.h("div", { key: 'd12ab9fadc0c86be8980af46abedde8b05550e4e', class: `nav_item_base ${this.state} ${this.type} ${this.category}` }, this.state === 'active' && this.category === 'plain_background' && index.h("img", { key: '17d24518519ab387534e55748e7d391cc474a180', src: redBarSrc, alt: "", class: "bar" }), this.state === 'active' && this.category === 'colored_background' && index.h("img", { key: '61d1e6f40a32b8af4db8ebf9c01ce3c380c95b2e', src: whiteBarSrc, alt: "", class: "bar" }), index.h("div", { key: '7deec2649a3b97ac9ff0d8ae796a3075c2ec1cdc', class: "content" }, index.h("div", { key: '920df27fed25f00b7ac444811c54920a3ce88555', class: `icon ${this.state} ${this.category}`, innerHTML: this.leadingIconSvg }), this.type === 'full_with_label' && (index.h("p", { key: '7b72a9b789e610b01c6285b4d8d002a0d32b0715', class: `label_text ${this.category} ${this.state} ${this.state === 'active' ? 'text-md-semi-bold' : 'text-md-medium'}` }, this.label))), this.type === 'full_with_label' && (index.h(index.Fragment, null, this.showBadge && (index.h("gb-badge", { key: 'bff6f2135eb26d83822592d5bb91b744580b86e0', size: "sm", type: "pill_outline", color: this.state === 'active' ? 'information' : 'gray' }, index.h("p", { key: '8f574bffd79cfd43f0685659d36d015dce6d12fe' }, "10"))), this.showArrow && (index.h("svg", { key: '833b814c400a6ab845ea1cd707f2f9c713555e8a', xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", class: `arrow ${this.state} ${this.category}` }, index.h("path", { key: '683b59136dc98448e9c7fd8bdab6b44a7cd5306b', d: "M6.00003 4C6.00003 4 9.99999 6.94596 10 8.00003C10 9.05411 6 12 6 12", stroke: "#212C65", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round" })))))), this.type === 'icon_only' && this.showTooltip && (index.h("gb-tooltip", { key: 'dd9304f2d03ee9470bb8d016422d021d15b946f8', "show-arrow": true, arrow: "left", class: "tooltip" }, index.h("p", { key: '8597fd268c9ab5f747319cf330a39de2d5c08ff5', slot: "label" }, this.label)))));
1376
1376
  }
1377
1377
  get el() { return index.getElement(this); }
1378
+ static get watchers() { return {
1379
+ "icon": ["updateSidebarIcon"]
1380
+ }; }
1378
1381
  };
1379
1382
  GbSimpleSideBarItem.style = gbSimpleSideBarItemCss;
1380
1383