@babylonjs/shared-ui-components 8.10.0 → 8.11.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.
@@ -21,10 +21,11 @@ export class TextLineComponent extends React.Component {
21
21
  if (this.props.ignoreValue) {
22
22
  return null;
23
23
  }
24
+ const title = this.props.tooltip ?? this.props.value ?? this.props.label ?? "";
24
25
  if (this.props.onLink || this.props.url) {
25
- return (_jsx("div", { className: "link-value", title: this.props.tooltip ?? this.props.label ?? "", onClick: () => this.onLink(), children: this.props.url ? "doc" : this.props.value || "no name" }));
26
+ return (_jsx("div", { className: "link-value", title: title, onClick: () => this.onLink(), children: this.props.url ? "doc" : this.props.value || "no name" }));
26
27
  }
27
- return (_jsx("div", { className: "value", title: this.props.tooltip ?? this.props.label ?? "", style: { color: this.props.color ? this.props.color : "" }, children: this.props.value || "no name" }));
28
+ return (_jsx("div", { className: "value", title: title, style: { color: this.props.color ? this.props.color : "" }, children: this.props.value || "no name" }));
28
29
  }
29
30
  render() {
30
31
  return (_jsxs("div", { className: MergeClassNames(["textLine", ["underline", this.props.underline], this.props.additionalClass, ["icon", this.props.onCopy]]), children: [this.props.icon && _jsx("img", { src: this.props.icon, title: this.props.iconLabel, alt: this.props.iconLabel, className: "icon" }), _jsx("div", { className: "label", title: this.props.tooltip ?? this.props.label ?? "", children: this.props.label ?? "" }), this.renderContent(), this.props.onCopy && (_jsx("div", { className: "copy hoverIcon", onClick: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"textLineComponent.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/lines/textLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAiBjD,MAAM,OAAO,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AK,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAC,MAAM,GAAG,GAC/B,CACT,IACC,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport copyIcon from \"../imgs/copy.svg\";\r\nimport { copyCommandToClipboard } from \"../copyCommandToClipboard\";\r\nimport { MergeClassNames } from \"../styleHelper\";\r\n\r\ninterface ITextLineComponentProps {\r\n label?: string;\r\n value?: string;\r\n color?: string;\r\n underline?: boolean;\r\n onLink?: () => void;\r\n url?: string;\r\n ignoreValue?: boolean;\r\n additionalClass?: string;\r\n icon?: string;\r\n iconLabel?: string;\r\n tooltip?: string;\r\n onCopy?: true | (() => string);\r\n}\r\n\r\nexport class TextLineComponent extends React.Component<ITextLineComponentProps> {\r\n constructor(props: ITextLineComponentProps) {\r\n super(props);\r\n }\r\n\r\n onLink() {\r\n if (this.props.url) {\r\n window.open(this.props.url, \"_blank\");\r\n return;\r\n }\r\n if (!this.props.onLink) {\r\n return;\r\n }\r\n\r\n this.props.onLink();\r\n }\r\n\r\n renderContent() {\r\n if (this.props.ignoreValue) {\r\n return null;\r\n }\r\n\r\n if (this.props.onLink || this.props.url) {\r\n return (\r\n <div className=\"link-value\" title={this.props.tooltip ?? this.props.label ?? \"\"} onClick={() => this.onLink()}>\r\n {this.props.url ? \"doc\" : this.props.value || \"no name\"}\r\n </div>\r\n );\r\n }\r\n return (\r\n <div className=\"value\" title={this.props.tooltip ?? this.props.label ?? \"\"} style={{ color: this.props.color ? this.props.color : \"\" }}>\r\n {this.props.value || \"no name\"}\r\n </div>\r\n );\r\n }\r\n\r\n override render() {\r\n return (\r\n <div className={MergeClassNames([\"textLine\", [\"underline\", this.props.underline], this.props.additionalClass, [\"icon\", this.props.onCopy]])}>\r\n {this.props.icon && <img src={this.props.icon} title={this.props.iconLabel} alt={this.props.iconLabel} className=\"icon\" />}\r\n <div className=\"label\" title={this.props.tooltip ?? this.props.label ?? \"\"}>\r\n {this.props.label ?? \"\"}\r\n </div>\r\n {this.renderContent()}\r\n {this.props.onCopy && (\r\n <div\r\n className=\"copy hoverIcon\"\r\n onClick={() => {\r\n const onCopy = this.props.onCopy;\r\n if (onCopy === true && this.props.value !== undefined) {\r\n copyCommandToClipboard(this.props.value);\r\n } else if (typeof onCopy === \"function\") {\r\n copyCommandToClipboard(onCopy());\r\n }\r\n }}\r\n title=\"Copy to clipboard\"\r\n >\r\n <img src={copyIcon} alt=\"Copy\" />\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"textLineComponent.js","sourceRoot":"","sources":["../../../../dev/sharedUiComponents/src/lines/textLineComponent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,QAAQ,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAiBjD,MAAM,OAAO,iBAAkB,SAAQ,KAAK,CAAC,SAAkC;IAC3E,YAAY,KAA8B;QACtC,KAAK,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC;IAED,MAAM;QACF,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YACjB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;YACtC,OAAO;QACX,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YACrB,OAAO;QACX,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;IAED,aAAa;QACT,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,KA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CAAC,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,YACrE,IAAI,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,GACrB,EACL,IAAI,CAAC,aAAa,EAAE,EACpB,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,CAClB,cACI,SAAS,EAAC,gBAAgB,EAC1B,OAAO,EAAE,GAAG,EAAE;wBACV,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;wBACjC,IAAI,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;4BACpD,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;wBAC7C,CAAC;6BAAM,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE,CAAC;4BACtC,sBAAsB,CAAC,MAAM,EAAE,CAAC,CAAC;wBACrC,CAAC;oBACL,CAAC,EACD,KAAK,EAAC,mBAAmB,YAEzB,cAAK,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAC,MAAM,GAAG,GAC/B,CACT,IACC,CACT,CAAC;IACN,CAAC;CACJ","sourcesContent":["import * as React from \"react\";\r\nimport copyIcon from \"../imgs/copy.svg\";\r\nimport { copyCommandToClipboard } from \"../copyCommandToClipboard\";\r\nimport { MergeClassNames } from \"../styleHelper\";\r\n\r\ninterface ITextLineComponentProps {\r\n label?: string;\r\n value?: string;\r\n color?: string;\r\n underline?: boolean;\r\n onLink?: () => void;\r\n url?: string;\r\n ignoreValue?: boolean;\r\n additionalClass?: string;\r\n icon?: string;\r\n iconLabel?: string;\r\n tooltip?: string;\r\n onCopy?: true | (() => string);\r\n}\r\n\r\nexport class TextLineComponent extends React.Component<ITextLineComponentProps> {\r\n constructor(props: ITextLineComponentProps) {\r\n super(props);\r\n }\r\n\r\n onLink() {\r\n if (this.props.url) {\r\n window.open(this.props.url, \"_blank\");\r\n return;\r\n }\r\n if (!this.props.onLink) {\r\n return;\r\n }\r\n\r\n this.props.onLink();\r\n }\r\n\r\n renderContent() {\r\n if (this.props.ignoreValue) {\r\n return null;\r\n }\r\n const title = this.props.tooltip ?? this.props.value ?? this.props.label ?? \"\";\r\n\r\n if (this.props.onLink || this.props.url) {\r\n return (\r\n <div className=\"link-value\" title={title} onClick={() => this.onLink()}>\r\n {this.props.url ? \"doc\" : this.props.value || \"no name\"}\r\n </div>\r\n );\r\n }\r\n return (\r\n <div className=\"value\" title={title} style={{ color: this.props.color ? this.props.color : \"\" }}>\r\n {this.props.value || \"no name\"}\r\n </div>\r\n );\r\n }\r\n\r\n override render() {\r\n return (\r\n <div className={MergeClassNames([\"textLine\", [\"underline\", this.props.underline], this.props.additionalClass, [\"icon\", this.props.onCopy]])}>\r\n {this.props.icon && <img src={this.props.icon} title={this.props.iconLabel} alt={this.props.iconLabel} className=\"icon\" />}\r\n <div className=\"label\" title={this.props.tooltip ?? this.props.label ?? \"\"}>\r\n {this.props.label ?? \"\"}\r\n </div>\r\n {this.renderContent()}\r\n {this.props.onCopy && (\r\n <div\r\n className=\"copy hoverIcon\"\r\n onClick={() => {\r\n const onCopy = this.props.onCopy;\r\n if (onCopy === true && this.props.value !== undefined) {\r\n copyCommandToClipboard(this.props.value);\r\n } else if (typeof onCopy === \"function\") {\r\n copyCommandToClipboard(onCopy());\r\n }\r\n }}\r\n title=\"Copy to clipboard\"\r\n >\r\n <img src={copyIcon} alt=\"Copy\" />\r\n </div>\r\n )}\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@babylonjs/shared-ui-components",
3
- "version": "8.10.0",
3
+ "version": "8.11.0",
4
4
  "main": "index.js",
5
5
  "module": "index.js",
6
6
  "types": "index.d.ts",