@getflip/swirl-components 0.173.2 → 0.173.3

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/components.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "timestamp": "2024-03-21T11:58:01",
2
+ "timestamp": "2024-03-21T12:26:41",
3
3
  "compiler": {
4
4
  "name": "@stencil/core",
5
5
  "version": "3.3.1",
@@ -972,11 +972,12 @@ const SwirlText = class {
972
972
  }
973
973
  render() {
974
974
  const Tag = this.as;
975
+ const truncate = this.truncate && (!Boolean(this.lines) || this.lines === 1);
975
976
  const className = index.classnames("text", `text--align-${this.align}`, `text--color-${this.color}`, `text--font-family-${this.fontFamily}`, `text--font-style-${this.fontStyle}`, `text--size-${this.size}`, `text--truncate-direction-${this.truncateDirection}`, `text--weight-${this.weight}`, {
976
- "text--truncate": this.truncate && (!Boolean(this.lines) || this.lines === 1),
977
+ "text--truncate": truncate,
977
978
  });
978
979
  const styles = {
979
- whiteSpace: this.whiteSpace,
980
+ whiteSpace: truncate ? "nowrap" : this.whiteSpace,
980
981
  };
981
982
  return (index$1.h(index$1.Host, null, index$1.h(Tag, { class: className, ref: (el) => (this.textEl = el), style: styles }, index$1.h("slot", null))));
982
983
  }
@@ -45,11 +45,12 @@ export class SwirlText {
45
45
  }
46
46
  render() {
47
47
  const Tag = this.as;
48
+ const truncate = this.truncate && (!Boolean(this.lines) || this.lines === 1);
48
49
  const className = classnames("text", `text--align-${this.align}`, `text--color-${this.color}`, `text--font-family-${this.fontFamily}`, `text--font-style-${this.fontStyle}`, `text--size-${this.size}`, `text--truncate-direction-${this.truncateDirection}`, `text--weight-${this.weight}`, {
49
- "text--truncate": this.truncate && (!Boolean(this.lines) || this.lines === 1),
50
+ "text--truncate": truncate,
50
51
  });
51
52
  const styles = {
52
- whiteSpace: this.whiteSpace,
53
+ whiteSpace: truncate ? "nowrap" : this.whiteSpace,
53
54
  };
54
55
  return (h(Host, null, h(Tag, { class: className, ref: (el) => (this.textEl = el), style: styles }, h("slot", null))));
55
56
  }