@deephaven/code-studio 0.64.0 → 0.64.1-beta.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/build/assets/{AppRoot-9de5140a.js → AppRoot-f366693a.js} +3 -3
- package/build/assets/{AppRoot-9de5140a.js.map → AppRoot-f366693a.js.map} +1 -1
- package/build/assets/{ControlType-1b90d1e3.js → ControlType-6337dc6d.js} +3 -3
- package/build/assets/{ControlType-1b90d1e3.js.map → ControlType-6337dc6d.js.map} +1 -1
- package/build/assets/{FontBootstrap-9b5ce71e.js → FontBootstrap-f7fb13f9.js} +2 -2
- package/build/assets/{FontBootstrap-9b5ce71e.js.map → FontBootstrap-f7fb13f9.js.map} +1 -1
- package/build/assets/{IrisGrid-ada0bc58.js → IrisGrid-a9bad2d6.js} +2 -2
- package/build/assets/{IrisGrid-ada0bc58.js.map → IrisGrid-a9bad2d6.js.map} +1 -1
- package/build/assets/{MarkdownEditor-d2357767.js → MarkdownEditor-12329c62.js} +2 -2
- package/build/assets/{MarkdownEditor-d2357767.js.map → MarkdownEditor-12329c62.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-28cb59a5.js → MarkdownNotebook-35f296c6.js} +2 -2
- package/build/assets/{MarkdownNotebook-28cb59a5.js.map → MarkdownNotebook-35f296c6.js.map} +1 -1
- package/build/assets/{StyleGuideRoot-81ed15ba.js → StyleGuideRoot-cb903232.js} +2 -2
- package/build/assets/{StyleGuideRoot-81ed15ba.js.map → StyleGuideRoot-cb903232.js.map} +1 -1
- package/build/assets/{index-02750775.js → index-2431385f.js} +2 -2
- package/build/assets/{index-02750775.js.map → index-2431385f.js.map} +1 -1
- package/build/assets/index-aded50a2.js +2 -0
- package/build/assets/index-aded50a2.js.map +1 -0
- package/build/assets/{index-0596c38c.js → index-bb3718e5.js} +3 -3
- package/build/assets/{index-0596c38c.js.map → index-bb3718e5.js.map} +1 -1
- package/build/assets/{useUser-e2a90215.js → useUser-0ea4bd27.js} +2 -2
- package/build/assets/{useUser-e2a90215.js.map → useUser-0ea4bd27.js.map} +1 -1
- package/build/index.html +1 -1
- package/package.json +31 -31
- package/build/assets/index-6a91d8a9.js +0 -2
- package/build/assets/index-6a91d8a9.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as s,C as i,bs as l,bu as d,bv as u,H as c}from"./vendor-beec23d9.js";import{cs as m,cw as f}from"./ControlType-
|
|
2
|
-
//# sourceMappingURL=MarkdownEditor-
|
|
1
|
+
import{r as s,C as i,bs as l,bu as d,bv as u,H as c}from"./vendor-beec23d9.js";import{cs as m,cw as f}from"./ControlType-6337dc6d.js";import"./helpers-de833af9.js";import"./index-2431385f.js";import"./monaco-b5248072.js";import"./plotly-a5b1f68a.js";function o(e,r,t){return r=p(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function p(e){var r=g(e,"string");return typeof r=="symbol"?r:String(r)}function g(e,r){if(typeof e!="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}var v=e=>{var{children:r,className:t}=e,n=t!=null&&t!==void 0&&t.startsWith("language-")?t.substring(9):"plaintext";return i.jsx("pre",{children:i.jsx("code",{children:i.jsx(f,{language:n,children:c.Children.map(r,a=>typeof a=="string"?a.trim():a)})})})};class h extends s.PureComponent{constructor(r){super(r),o(this,"container",void 0),this.container=null}render(){var{isEditing:r,content:t,onEditorInitialized:n}=this.props;return i.jsx("div",{className:"markdown-editor-container",ref:a=>{this.container=a},children:r?i.jsx(m,{settings:{language:"markdown",value:t,lineNumbers:"off"},onEditorInitialized:n}):i.jsx(l,{components:{code:v},remarkPlugins:[d],rehypePlugins:[u],children:t})})}}o(h,"defaultProps",{isEditing:!1,content:""});export{h as default};
|
|
2
|
+
//# sourceMappingURL=MarkdownEditor-12329c62.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownEditor-
|
|
1
|
+
{"version":3,"file":"MarkdownEditor-12329c62.js","sources":["../../../dashboard-core-plugins/dist/controls/markdown/MarkdownEditor.js"],"sourcesContent":["function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport React, { PureComponent } from 'react';\nimport Markdown from 'react-markdown';\nimport remarkMath from 'remark-math';\nimport rehypeMathjax from 'rehype-mathjax';\nimport { Code, Editor } from '@deephaven/console';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nvar renderMarkdown = props => {\n var {\n children,\n className\n } = props;\n var language = className !== undefined && className !== null && className !== void 0 && className.startsWith('language-') ? className.substring(9) : 'plaintext';\n return /*#__PURE__*/_jsx(\"pre\", {\n children: /*#__PURE__*/_jsx(\"code\", {\n children: /*#__PURE__*/_jsx(Code, {\n language: language,\n children: React.Children.map(children, child => typeof child === 'string' ? child.trim() : child)\n })\n })\n });\n};\nexport default class MarkdownEditor extends PureComponent {\n constructor(props) {\n super(props);\n _defineProperty(this, \"container\", void 0);\n this.container = null;\n }\n render() {\n var {\n isEditing,\n content,\n onEditorInitialized\n } = this.props;\n return /*#__PURE__*/_jsx(\"div\", {\n className: \"markdown-editor-container\",\n ref: container => {\n this.container = container;\n },\n children: isEditing ? /*#__PURE__*/_jsx(Editor, {\n settings: {\n language: 'markdown',\n value: content,\n lineNumbers: 'off'\n },\n onEditorInitialized: onEditorInitialized\n }) : /*#__PURE__*/_jsx(Markdown, {\n components: {\n code: renderMarkdown\n },\n remarkPlugins: [remarkMath],\n rehypePlugins: [rehypeMathjax],\n children: content\n })\n });\n }\n}\n_defineProperty(MarkdownEditor, \"defaultProps\", {\n isEditing: false,\n content: ''\n});\n//# sourceMappingURL=MarkdownEditor.js.map"],"names":["_defineProperty","obj","key","value","_toPropertyKey","arg","_toPrimitive","input","hint","prim","res","renderMarkdown","props","children","className","language","_jsx","Code","React","child","MarkdownEditor","PureComponent","isEditing","content","onEditorInitialized","container","Editor","Markdown","remarkMath","rehypeMathjax"],"mappings":"0PAAA,SAASA,EAAgBC,EAAKC,EAAKC,EAAO,CAAE,OAAAD,EAAME,EAAeF,CAAG,EAAOA,KAAOD,EAAO,OAAO,eAAeA,EAAKC,EAAK,CAAE,MAAOC,EAAO,WAAY,GAAM,aAAc,GAAM,SAAU,EAAM,CAAA,EAAYF,EAAIC,CAAG,EAAIC,EAAgBF,CAAM,CAC5O,SAASG,EAAeC,EAAK,CAAE,IAAIH,EAAMI,EAAaD,EAAK,QAAQ,EAAG,OAAO,OAAOH,GAAQ,SAAWA,EAAM,OAAOA,CAAG,CAAI,CAC3H,SAASI,EAAaC,EAAOC,EAAM,CAAE,GAAI,OAAOD,GAAU,UAAYA,IAAU,KAAM,OAAOA,EAAO,IAAIE,EAAOF,EAAM,OAAO,WAAW,EAAG,GAAIE,IAAS,OAAW,CAAE,IAAIC,EAAMD,EAAK,KAAKF,EAAOC,GAAQ,SAAS,EAAG,GAAI,OAAOE,GAAQ,SAAU,OAAOA,EAAK,MAAM,IAAI,UAAU,8CAA8C,CAAI,CAAC,OAAQF,IAAS,SAAW,OAAS,QAAQD,CAAK,CAAI,CAOzX,IAAII,EAAiBC,GAAS,CAC5B,GAAI,CACF,SAAAC,EACA,UAAAC,CACD,EAAGF,EACAG,EAAsCD,GAAc,MAAQA,IAAc,QAAUA,EAAU,WAAW,WAAW,EAAIA,EAAU,UAAU,CAAC,EAAI,YACrJ,OAAoBE,EAAAA,IAAK,MAAO,CAC9B,SAAuBA,EAAI,IAAC,OAAQ,CAClC,SAAuBA,EAAI,IAACC,EAAM,CAChC,SAAUF,EACV,SAAUG,EAAM,SAAS,IAAIL,EAAUM,GAAS,OAAOA,GAAU,SAAWA,EAAM,KAAI,EAAKA,CAAK,CACxG,CAAO,CACP,CAAK,CACL,CAAG,CACH,EACe,MAAMC,UAAuBC,EAAAA,aAAc,CACxD,YAAYT,EAAO,CACjB,MAAMA,CAAK,EACXZ,EAAgB,KAAM,YAAa,MAAM,EACzC,KAAK,UAAY,IAClB,CACD,QAAS,CACP,GAAI,CACF,UAAAsB,EACA,QAAAC,EACA,oBAAAC,CACN,EAAQ,KAAK,MACT,OAAoBR,EAAAA,IAAK,MAAO,CAC9B,UAAW,4BACX,IAAKS,GAAa,CAChB,KAAK,UAAYA,CAClB,EACD,SAAUH,EAAyBN,EAAI,IAACU,EAAQ,CAC9C,SAAU,CACR,SAAU,WACV,MAAOH,EACP,YAAa,KACd,EACD,oBAAqBC,CAC7B,CAAO,EAAiBR,EAAI,IAACW,EAAU,CAC/B,WAAY,CACV,KAAMhB,CACP,EACD,cAAe,CAACiB,CAAU,EAC1B,cAAe,CAACC,CAAa,EAC7B,SAAUN,CAClB,CAAO,CACP,CAAK,CACF,CACH,CACAvB,EAAgBoB,EAAgB,eAAgB,CAC9C,UAAW,GACX,QAAS,EACX,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as y,H as g,C as a,F as C,bs as L,bt as R,bu as N,bv as j}from"./vendor-beec23d9.js";import{e as E,aJ as b}from"./index-
|
|
2
|
-
//# sourceMappingURL=MarkdownNotebook-
|
|
1
|
+
import{r as y,H as g,C as a,F as C,bs as L,bt as R,bu as N,bv as j}from"./vendor-beec23d9.js";import{e as E,aJ as b}from"./index-2431385f.js";import{B as S,cw as P}from"./ControlType-6337dc6d.js";import"./helpers-de833af9.js";import"./monaco-b5248072.js";import"./plotly-a5b1f68a.js";function p(r,e,t){return e=B(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function B(r){var e=M(r,"string");return typeof e=="symbol"?e:String(e)}function M(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class I extends y.PureComponent{constructor(e){super(e),p(this,"commands",void 0),p(this,"codeElements",void 0),p(this,"editorScrollView",void 0),this.handleRunSelected=this.handleRunSelected.bind(this),this.renderCodeBlock=this.renderCodeBlock.bind(this),this.renderLink=this.renderLink.bind(this),this.commands=new Map,this.codeElements=new Map,this.editorScrollView=g.createRef(),this.state={hasCode:!1,hasRunCode:!1,nextStartLine:null}}componentDidMount(){this.updateHasCode()}componentDidUpdate(){this.updateHasCode()}updateHasCode(){var{hasCode:e}=this.state;this.commands.size===0&&e?this.setState({hasCode:!1}):this.commands.size>0&&!e&&this.setState({hasCode:!0})}getNextStartLine(e){var t=[...this.commands.keys()],n=t.findIndex(s=>s===e)+1;return n>=t.length?null:t[n]}handleRunSelected(e){var t,n;e.preventDefault(),e.stopPropagation();var{nextStartLine:s}=this.state,i=[...this.commands.keys()],d=i.findIndex(x=>x===s||s==null);if(!(d<0)){var l=i[d],f=this.commands.get(l),u=this.getNextStartLine(l),m=(t=this.codeElements.get(l))===null||t===void 0?void 0:t.current,o=m==null||(n=m.parentElement)===null||n===void 0?void 0:n.nextElementSibling;if(o!=null){var c,{offsetTop:v}=o,k=v;(c=this.editorScrollView.current)===null||c===void 0||c.scroll({top:k,left:0})}this.runCode(f),this.setState({nextStartLine:u})}}runCode(e){var{onRunCode:t}=this.props;t(e),this.setState({hasRunCode:!0})}renderCodeBlock(e){var{children:t,className:n,inline:s,node:i}=e,{hasRunCode:d,nextStartLine:l}=this.state,{children:f,position:u}=i;E(u);var{start:m}=u,{line:o}=m,c=f[0].value,v=g.createRef(),k=this.commands.size===0,x=l===o||k&&l==null&&!d,w=n!==void 0&&n.startsWith("language-")?n.substring(9):"plaintext";return s!=null&&s?a.jsx("code",{className:n,children:t}):(this.commands.set(o,c),this.codeElements.set(o,v),a.jsxs("div",{className:C("markdown-notebook-code-block",{"is-selected":x}),ref:v,onClick:()=>{this.setState({nextStartLine:o})},role:"presentation",children:[a.jsx(S,{kind:"ghost",icon:b,className:"btn-play-block",onClick:h=>{h.stopPropagation(),h.preventDefault(),this.runCode(c),this.setState({nextStartLine:o})},tooltip:"Run code"}),a.jsx("code",{children:a.jsx(P,{language:w,children:g.Children.map(t,h=>typeof h=="string"?h.trim():h)})})]}))}renderLink(e){var{onLinkClick:t}=this.props,{href:n,children:s,target:i}=e;return a.jsx("a",{href:n,onClick:t,target:i,children:s})}render(){var{content:e,transformImageUri:t,transformLinkUri:n}=this.props,{hasCode:s,hasRunCode:i,nextStartLine:d}=this.state;return a.jsxs("div",{className:"markdown-notebook",children:[a.jsx("div",{className:"markdown-notebook-toolbar",children:a.jsx(S,{className:C("btn-play-selected-cell",{flashing:s&&!i}),kind:"ghost",icon:b,onClick:this.handleRunSelected,tooltip:"Run code and select next",disabled:i&&d==null||!s,children:"Run Selected Code"})}),a.jsx("div",{className:"markdown-notebook-content",ref:this.editorScrollView,children:a.jsx(L,{components:{code:this.renderCodeBlock,a:this.renderLink},linkTarget:"_blank",remarkPlugins:[R,N],rehypePlugins:[j],transformLinkUri:n,transformImageUri:t,includeElementIndex:!0,children:e})})]})}}p(I,"defaultProps",{onRunCode:()=>{}});export{I as MarkdownNotebook,I as default};
|
|
2
|
+
//# sourceMappingURL=MarkdownNotebook-35f296c6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarkdownNotebook-28cb59a5.js","sources":["../../../dashboard-core-plugins/dist/panels/MarkdownNotebook.js"],"sourcesContent":["function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport React, { PureComponent } from 'react';\nimport classNames from 'classnames';\nimport Markdown from 'react-markdown';\nimport remarkGfm from 'remark-gfm';\nimport remarkMath from 'remark-math';\nimport rehypeMathjax from 'rehype-mathjax';\nimport { Button } from '@deephaven/components';\nimport { Code } from '@deephaven/console';\nimport { vsPlay } from '@deephaven/icons';\nimport \"./MarkdownNotebook.css\";\nimport { assertNotNull } from '@deephaven/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nexport class MarkdownNotebook extends PureComponent {\n constructor(props) {\n super(props);\n _defineProperty(this, \"commands\", void 0);\n _defineProperty(this, \"codeElements\", void 0);\n _defineProperty(this, \"editorScrollView\", void 0);\n this.handleRunSelected = this.handleRunSelected.bind(this);\n this.renderCodeBlock = this.renderCodeBlock.bind(this);\n this.renderLink = this.renderLink.bind(this);\n\n // Map of each code block from it's starting line number to the code within that block\n this.commands = new Map();\n this.codeElements = new Map();\n this.editorScrollView = /*#__PURE__*/React.createRef();\n this.state = {\n hasCode: false,\n // Keep track if any code has been executed yet. If not, make the run button flash\n hasRunCode: false,\n // Line of the next block to execute. Null to start at the first block\n nextStartLine: null\n };\n }\n componentDidMount() {\n this.updateHasCode();\n }\n componentDidUpdate() {\n this.updateHasCode();\n }\n updateHasCode() {\n var {\n hasCode\n } = this.state;\n if (this.commands.size === 0 && hasCode) {\n this.setState({\n hasCode: false\n });\n } else if (this.commands.size > 0 && !hasCode) {\n this.setState({\n hasCode: true\n });\n }\n }\n\n /**\n * @param line The line of the code block to start from\n * @returns The next line of the code block to start from\n */\n getNextStartLine(line) {\n var keys = [...this.commands.keys()];\n var nextIndex = keys.findIndex(key => key === line) + 1;\n if (nextIndex >= keys.length) {\n // We got to the last block, disable\n return null;\n }\n return keys[nextIndex];\n }\n handleRunSelected(event) {\n var _this$codeElements$ge, _element$parentElemen;\n event.preventDefault();\n event.stopPropagation();\n var {\n nextStartLine\n } = this.state;\n var keys = [...this.commands.keys()];\n var keyIndex = keys.findIndex(key => key === nextStartLine || nextStartLine == null);\n if (keyIndex < 0) {\n return;\n }\n var startLine = keys[keyIndex];\n var command = this.commands.get(startLine);\n var newNextStartLine = this.getNextStartLine(startLine);\n var element = (_this$codeElements$ge = this.codeElements.get(startLine)) === null || _this$codeElements$ge === void 0 ? void 0 : _this$codeElements$ge.current;\n var nextElement = element === null || element === void 0 ? void 0 : (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.nextElementSibling;\n if (nextElement != null) {\n var _this$editorScrollVie;\n var {\n offsetTop\n } = nextElement;\n var top = offsetTop;\n (_this$editorScrollVie = this.editorScrollView.current) === null || _this$editorScrollVie === void 0 ? void 0 : _this$editorScrollVie.scroll({\n top,\n left: 0\n });\n }\n this.runCode(command);\n this.setState({\n nextStartLine: newNextStartLine\n });\n }\n runCode(command) {\n var {\n onRunCode\n } = this.props;\n onRunCode(command);\n this.setState({\n hasRunCode: true\n });\n }\n renderCodeBlock(props) {\n var {\n children,\n className,\n inline,\n node\n } = props;\n var {\n hasRunCode,\n nextStartLine\n } = this.state;\n var {\n children: nodeChildren,\n position\n } = node;\n assertNotNull(position);\n var {\n start\n } = position;\n var {\n line\n } = start;\n var command = nodeChildren[0].value;\n var ref = /*#__PURE__*/React.createRef();\n var isFirstBlock = this.commands.size === 0;\n var isSelected = nextStartLine === line || isFirstBlock && nextStartLine == null && !hasRunCode;\n var language = className !== undefined && className.startsWith('language-') ? className.substring(9) : 'plaintext';\n if (inline != null && inline) {\n return /*#__PURE__*/_jsx(\"code\", {\n className: className,\n children: children\n });\n }\n this.commands.set(line, command);\n this.codeElements.set(line, ref);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: classNames('markdown-notebook-code-block', {\n 'is-selected': isSelected\n }),\n ref: ref,\n onClick: () => {\n this.setState({\n nextStartLine: line\n });\n },\n role: \"presentation\",\n children: [/*#__PURE__*/_jsx(Button, {\n kind: \"ghost\",\n icon: vsPlay,\n className: \"btn-play-block\",\n onClick: event => {\n event.stopPropagation();\n event.preventDefault();\n this.runCode(command);\n this.setState({\n nextStartLine: line\n });\n },\n tooltip: \"Run code\"\n }), /*#__PURE__*/_jsx(\"code\", {\n children: /*#__PURE__*/_jsx(Code, {\n language: language,\n children: React.Children.map(children, child => typeof child === 'string' ? child.trim() : child)\n })\n })]\n });\n }\n renderLink(props) {\n var {\n onLinkClick\n } = this.props;\n var {\n href,\n children,\n target\n } = props;\n return /*#__PURE__*/_jsx(\"a\", {\n href: href,\n onClick: onLinkClick,\n target: target,\n children: children\n });\n }\n render() {\n var {\n content,\n transformImageUri,\n transformLinkUri\n } = this.props;\n var {\n hasCode,\n hasRunCode,\n nextStartLine\n } = this.state;\n return /*#__PURE__*/_jsxs(\"div\", {\n className: \"markdown-notebook\",\n children: [/*#__PURE__*/_jsx(\"div\", {\n className: \"markdown-notebook-toolbar\",\n children: /*#__PURE__*/_jsx(Button, {\n className: classNames('btn-play-selected-cell', {\n flashing: hasCode && !hasRunCode\n }),\n kind: \"ghost\",\n icon: vsPlay,\n onClick: this.handleRunSelected,\n tooltip: \"Run code and select next\",\n disabled: hasRunCode && nextStartLine == null || !hasCode,\n children: \"Run Selected Code\"\n })\n }), /*#__PURE__*/_jsx(\"div\", {\n className: \"markdown-notebook-content\",\n ref: this.editorScrollView,\n children: /*#__PURE__*/_jsx(Markdown, {\n components: {\n code: this.renderCodeBlock,\n a: this.renderLink\n },\n linkTarget: \"_blank\",\n remarkPlugins: [remarkGfm, remarkMath],\n rehypePlugins: [rehypeMathjax],\n transformLinkUri: transformLinkUri,\n transformImageUri: transformImageUri,\n includeElementIndex: true,\n children: content\n })\n })]\n });\n }\n}\n_defineProperty(MarkdownNotebook, \"defaultProps\", {\n onRunCode: () => undefined\n});\nexport default MarkdownNotebook;\n//# sourceMappingURL=MarkdownNotebook.js.map"],"names":["_defineProperty","obj","key","value","_toPropertyKey","arg","_toPrimitive","input","hint","prim","res","MarkdownNotebook","PureComponent","props","React","hasCode","line","keys","nextIndex","event","_this$codeElements$ge","_element$parentElemen","nextStartLine","keyIndex","startLine","command","newNextStartLine","element","nextElement","_this$editorScrollVie","offsetTop","top","onRunCode","children","className","inline","node","hasRunCode","nodeChildren","position","assertNotNull","start","ref","isFirstBlock","isSelected","language","_jsx","_jsxs","classNames","Button","vsPlay","Code","child","onLinkClick","href","target","content","transformImageUri","transformLinkUri","Markdown","remarkGfm","remarkMath","rehypeMathjax"],"mappings":"4RAAA,SAASA,EAAgBC,EAAKC,EAAKC,EAAO,CAAE,OAAAD,EAAME,EAAeF,CAAG,EAAOA,KAAOD,EAAO,OAAO,eAAeA,EAAKC,EAAK,CAAE,MAAOC,EAAO,WAAY,GAAM,aAAc,GAAM,SAAU,EAAM,CAAA,EAAYF,EAAIC,CAAG,EAAIC,EAAgBF,CAAM,CAC5O,SAASG,EAAeC,EAAK,CAAE,IAAIH,EAAMI,EAAaD,EAAK,QAAQ,EAAG,OAAO,OAAOH,GAAQ,SAAWA,EAAM,OAAOA,CAAG,CAAI,CAC3H,SAASI,EAAaC,EAAOC,EAAM,CAAE,GAAI,OAAOD,GAAU,UAAYA,IAAU,KAAM,OAAOA,EAAO,IAAIE,EAAOF,EAAM,OAAO,WAAW,EAAG,GAAIE,IAAS,OAAW,CAAE,IAAIC,EAAMD,EAAK,KAAKF,EAAOC,GAAQ,SAAS,EAAG,GAAI,OAAOE,GAAQ,SAAU,OAAOA,EAAK,MAAM,IAAI,UAAU,8CAA8C,CAAI,CAAC,OA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CAClC,UAAWD,EAAW,yBAA0B,CAC9C,SAAUjC,GAAW,CAACsB,CAClC,CAAW,EACD,KAAM,QACN,KAAMa,EACN,QAAS,KAAK,kBACd,QAAS,2BACT,SAAUb,GAAcf,GAAiB,MAAQ,CAACP,EAClD,SAAU,mBACpB,CAAS,CACT,CAAO,EAAgB+B,EAAI,IAAC,MAAO,CAC3B,UAAW,4BACX,IAAK,KAAK,iBACV,SAAuBA,EAAI,IAACa,EAAU,CACpC,WAAY,CACV,KAAM,KAAK,gBACX,EAAG,KAAK,UACT,EACD,WAAY,SACZ,cAAe,CAACC,EAAWC,CAAU,EACrC,cAAe,CAACC,CAAa,EAC7B,iBAAkBJ,EAClB,kBAAmBD,EACnB,oBAAqB,GACrB,SAAUD,CACpB,CAAS,CACT,CAAO,CAAC,CACR,CAAK,CACF,CACH,CACAxD,EAAgBW,EAAkB,eAAgB,CAChD,UAAW,IAAA,EACb,CAAC"}
|
|
1
|
+
{"version":3,"file":"MarkdownNotebook-35f296c6.js","sources":["../../../dashboard-core-plugins/dist/panels/MarkdownNotebook.js"],"sourcesContent":["function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nimport React, { PureComponent } from 'react';\nimport classNames from 'classnames';\nimport Markdown from 'react-markdown';\nimport remarkGfm from 'remark-gfm';\nimport remarkMath from 'remark-math';\nimport rehypeMathjax from 'rehype-mathjax';\nimport { Button } from '@deephaven/components';\nimport { Code } from '@deephaven/console';\nimport { vsPlay } from '@deephaven/icons';\nimport \"./MarkdownNotebook.css\";\nimport { assertNotNull } from '@deephaven/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nexport class MarkdownNotebook extends PureComponent {\n constructor(props) {\n super(props);\n _defineProperty(this, \"commands\", void 0);\n _defineProperty(this, \"codeElements\", void 0);\n _defineProperty(this, \"editorScrollView\", void 0);\n this.handleRunSelected = this.handleRunSelected.bind(this);\n this.renderCodeBlock = this.renderCodeBlock.bind(this);\n this.renderLink = this.renderLink.bind(this);\n\n // Map of each code block from it's starting line number to the code within that block\n this.commands = new Map();\n this.codeElements = new Map();\n this.editorScrollView = /*#__PURE__*/React.createRef();\n this.state = {\n hasCode: false,\n // Keep track if any code has been executed yet. If not, make the run button flash\n hasRunCode: false,\n // Line of the next block to execute. Null to start at the first block\n nextStartLine: null\n };\n }\n componentDidMount() {\n this.updateHasCode();\n }\n componentDidUpdate() {\n this.updateHasCode();\n }\n updateHasCode() {\n var {\n hasCode\n } = this.state;\n if (this.commands.size === 0 && hasCode) {\n this.setState({\n hasCode: false\n });\n } else if (this.commands.size > 0 && !hasCode) {\n this.setState({\n hasCode: true\n });\n }\n }\n\n /**\n * @param line The line of the code block to start from\n * @returns The next line of the code block to start from\n */\n getNextStartLine(line) {\n var keys = [...this.commands.keys()];\n var nextIndex = keys.findIndex(key => key === line) + 1;\n if (nextIndex >= keys.length) {\n // We got to the last block, disable\n return null;\n }\n return keys[nextIndex];\n }\n handleRunSelected(event) {\n var _this$codeElements$ge, _element$parentElemen;\n event.preventDefault();\n event.stopPropagation();\n var {\n nextStartLine\n } = this.state;\n var keys = [...this.commands.keys()];\n var keyIndex = keys.findIndex(key => key === nextStartLine || nextStartLine == null);\n if (keyIndex < 0) {\n return;\n }\n var startLine = keys[keyIndex];\n var command = this.commands.get(startLine);\n var newNextStartLine = this.getNextStartLine(startLine);\n var element = (_this$codeElements$ge = this.codeElements.get(startLine)) === null || _this$codeElements$ge === void 0 ? void 0 : _this$codeElements$ge.current;\n var nextElement = element === null || element === void 0 ? void 0 : (_element$parentElemen = element.parentElement) === null || _element$parentElemen === void 0 ? void 0 : _element$parentElemen.nextElementSibling;\n if (nextElement != null) {\n var _this$editorScrollVie;\n var {\n offsetTop\n } = nextElement;\n var top = offsetTop;\n (_this$editorScrollVie = this.editorScrollView.current) === null || _this$editorScrollVie === void 0 ? void 0 : _this$editorScrollVie.scroll({\n top,\n left: 0\n });\n }\n this.runCode(command);\n this.setState({\n nextStartLine: newNextStartLine\n });\n }\n runCode(command) {\n var {\n onRunCode\n } = this.props;\n onRunCode(command);\n this.setState({\n hasRunCode: true\n });\n }\n renderCodeBlock(props) {\n var {\n children,\n className,\n inline,\n node\n } = props;\n var {\n hasRunCode,\n nextStartLine\n } = this.state;\n var {\n children: nodeChildren,\n position\n } = node;\n assertNotNull(position);\n var {\n start\n } = position;\n var {\n line\n } = start;\n var command = nodeChildren[0].value;\n var ref = /*#__PURE__*/React.createRef();\n var isFirstBlock = this.commands.size === 0;\n var isSelected = nextStartLine === line || isFirstBlock && nextStartLine == null && !hasRunCode;\n var language = className !== undefined && className.startsWith('language-') ? className.substring(9) : 'plaintext';\n if (inline != null && inline) {\n return /*#__PURE__*/_jsx(\"code\", {\n className: className,\n children: children\n });\n }\n this.commands.set(line, command);\n this.codeElements.set(line, ref);\n return /*#__PURE__*/_jsxs(\"div\", {\n className: classNames('markdown-notebook-code-block', {\n 'is-selected': isSelected\n }),\n ref: ref,\n onClick: () => {\n this.setState({\n nextStartLine: line\n });\n },\n role: \"presentation\",\n children: [/*#__PURE__*/_jsx(Button, {\n kind: \"ghost\",\n icon: vsPlay,\n className: \"btn-play-block\",\n onClick: event => {\n event.stopPropagation();\n event.preventDefault();\n this.runCode(command);\n this.setState({\n nextStartLine: line\n });\n },\n tooltip: \"Run code\"\n }), /*#__PURE__*/_jsx(\"code\", {\n children: /*#__PURE__*/_jsx(Code, {\n language: language,\n children: React.Children.map(children, child => typeof child === 'string' ? child.trim() : child)\n })\n })]\n });\n }\n renderLink(props) {\n var {\n onLinkClick\n } = this.props;\n var {\n href,\n children,\n target\n } = props;\n return /*#__PURE__*/_jsx(\"a\", {\n href: href,\n onClick: onLinkClick,\n target: target,\n children: children\n });\n }\n render() {\n var {\n content,\n transformImageUri,\n transformLinkUri\n } = this.props;\n var {\n hasCode,\n hasRunCode,\n nextStartLine\n } = this.state;\n return /*#__PURE__*/_jsxs(\"div\", {\n className: \"markdown-notebook\",\n children: [/*#__PURE__*/_jsx(\"div\", {\n className: \"markdown-notebook-toolbar\",\n children: /*#__PURE__*/_jsx(Button, {\n className: classNames('btn-play-selected-cell', {\n flashing: hasCode && !hasRunCode\n }),\n kind: \"ghost\",\n icon: vsPlay,\n onClick: this.handleRunSelected,\n tooltip: \"Run code and select next\",\n disabled: hasRunCode && nextStartLine == null || !hasCode,\n children: \"Run Selected Code\"\n })\n }), /*#__PURE__*/_jsx(\"div\", {\n className: \"markdown-notebook-content\",\n ref: this.editorScrollView,\n children: /*#__PURE__*/_jsx(Markdown, {\n components: {\n code: this.renderCodeBlock,\n a: this.renderLink\n },\n linkTarget: \"_blank\",\n remarkPlugins: [remarkGfm, remarkMath],\n rehypePlugins: [rehypeMathjax],\n transformLinkUri: transformLinkUri,\n transformImageUri: transformImageUri,\n includeElementIndex: true,\n children: content\n })\n })]\n });\n }\n}\n_defineProperty(MarkdownNotebook, \"defaultProps\", {\n onRunCode: () => undefined\n});\nexport default MarkdownNotebook;\n//# sourceMappingURL=MarkdownNotebook.js.map"],"names":["_defineProperty","obj","key","value","_toPropertyKey","arg","_toPrimitive","input","hint","prim","res","MarkdownNotebook","PureComponent","props","React","hasCode","line","keys","nextIndex","event","_this$codeElements$ge","_element$parentElemen","nextStartLine","keyIndex","startLine","command","newNextStartLine","element","nextElement","_this$editorScrollVie","offsetTop","top","onRunCode","children","className","inline","node","hasRunCode","nodeChildren","position","assertNotNull","start","ref","isFirstBlock","isSelected","language","_jsx","_jsxs","classNames","Button","vsPlay","Code","child","onLinkClick","href","target","content","transformImageUri","transformLinkUri","Markdown","remarkGfm","remarkMath","rehypeMathjax"],"mappings":"4RAAA,SAASA,EAAgBC,EAAKC,EAAKC,EAAO,CAAE,OAAAD,EAAME,EAAeF,CAAG,EAAOA,KAAOD,EAAO,OAAO,eAAeA,EAAKC,EAAK,CAAE,MAAOC,EAAO,WAAY,GAAM,aAAc,GAAM,SAAU,EAAM,CAAA,EAAYF,EAAIC,CAAG,EAAIC,EAAgBF,CAAM,CAC5O,SAASG,EAAeC,EAAK,CAAE,IAAIH,EAAMI,EAAaD,EAAK,QAAQ,EAAG,OAAO,OAAOH,GAAQ,SAAWA,EAAM,OAAOA,CAAG,CAAI,CAC3H,SAASI,EAAaC,EAAOC,EAAM,CAAE,GAAI,OAAOD,GAAU,UAAYA,IAAU,KAAM,OAAOA,EAAO,IAAIE,EAAOF,EAAM,OAAO,WAAW,EAAG,GAAIE,IAAS,OAAW,CAAE,IAAIC,EAAMD,EAAK,KAAKF,EAAOC,GAAQ,SAAS,EAAG,GAAI,OAAOE,GAAQ,SAAU,OAAOA,EAAK,MAAM,IAAI,UAAU,8CAA8C,CAAI,CAAC,OAAQF,IAAS,SAAW,OAAS,QAAQD,CAAK,CAAI,CAclX,MAAMI,UAAyBC,EAAAA,aAAc,CAClD,YAAYC,EAAO,CACjB,MAAMA,CAAK,EACXb,EAAgB,KAAM,WAAY,MAAM,EACxCA,EAAgB,KAAM,eAAgB,MAAM,EAC5CA,EAAgB,KAAM,mBAAoB,MAAM,EAChD,KAAK,kBAAoB,KAAK,kBAAkB,KAAK,IAAI,EACzD,KAAK,gBAAkB,KAAK,gBAAgB,KAAK,IAAI,EACrD,KAAK,WAAa,KAAK,WAAW,KAAK,IAAI,EAG3C,KAAK,SAAW,IAAI,IACpB,KAAK,aAAe,IAAI,IACxB,KAAK,iBAAgCc,EAAM,YAC3C,KAAK,MAAQ,CACX,QAAS,GAET,WAAY,GAEZ,cAAe,I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AAO,CAAC,CACR,CAAK,CACF,CACH,CACAxD,EAAgBW,EAAkB,eAAgB,CAChD,UAAW,IAAA,EACb,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,F as G,C as e,aL as C,H as he,U as jo,N as ve,G as k,a1 as ee,M as qe,ap as Bo,aM as P,aN as yo,aO as D,$ as Fo,a0 as R,a3 as Oo,a4 as Fe,aP as Vo,a5 as Uo,a6 as Oe,a2 as de,a8 as Go,a9 as b,aQ as Ho,aR as Me,aS as z,aT as zo,a7 as Wo,aU as Re,ad as wo,ac as S,aV as Pe,aW as qo,aX as Ko,ae as Yo,aY as Xo,aZ as Zo,a_ as Jo,a$ as W,b0 as Qo,b1 as fe,b2 as I,b3 as er,b4 as or,b5 as rr,ar as tr,b6 as ar,b7 as be,K as lr,_ as sr}from"./vendor-beec23d9.js";import{aW as Ke,aX as U,aN as ce,a3 as nr,aY as Ve,aZ as Ue,a_ as Co,aF as ir,a$ as q,b0 as Ye,G as Xe,b1 as Ze,I as Le,b2 as cr,b3 as dr,N as hr,b4 as ur,b5 as gr,aJ as Je}from"./index-02750775.js";import{W as mr}from"./monaco-b5248072.js";import{ah as xe,a9 as So,a6 as K,ai as To,B as vr,f as ae,l as pr,K as je,aj as oe,ak as xr,I as fr,R as ko,e as B,C as _e,O as br,a as jr,S as yr,b as ne,P as Qe,g as wr,c as Cr}from"./IrisGrid-ada0bc58.js";import{B as p,u as No,s as J,q as Q,aY as $,K as A,an as ge,al as Sr,J as eo,cs as oo,Q as Tr,C as L,a$ as le,S as me,aS as kr,ao as Nr,d as ro,aW as to,b1 as Do,z as ao,bw as Y,ar as Dr,aC as Er,ab as Ir,aI as $r,aJ as Ar,w as Mr}from"./ControlType-1b90d1e3.js";import{M as lo,H as Rr,A as Pr,V as ye,T as Lr,D as _r,C as Br,a as Fr,c as Or,b as Vr,d as Ur}from"./FontBootstrap-9b5ce71e.js";import{N as Gr,T as Hr}from"./useUser-e2a90215.js";import{L as zr}from"./AppRoot-9de5140a.js";import"./helpers-de833af9.js";import"./plotly-a5b1f68a.js";function so(t,o,r,a,l,s,n){try{var i=t[s](n),d=i.value}catch(h){r(h);return}i.done?o(d):Promise.resolve(d).then(a,l)}function we(t){return function(){var o=this,r=arguments;return new Promise(function(a,l){var s=t.apply(o,r);function n(d){so(s,a,l,n,i,"next",d)}function i(d){so(s,a,l,n,i,"throw",d)}n(void 0)})}}function _(t,o,r){return o=Wr(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function Wr(t){var o=qr(t,"string");return typeof o=="symbol"?o:String(o)}function qr(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}class Kr extends xe{constructor(){var{rowCount:o=1e9,columnCount:r=100,floatingTopRowCount:a=0,floatingBottomRowCount:l=0,floatingLeftColumnCount:s=0,floatingRightColumnCount:n=0,isEditable:i=!1,editedData:d=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),_(this,"numRows",void 0),_(this,"numColumns",void 0),_(this,"floatingTop",void 0),_(this,"floatingBottom",void 0),_(this,"floatingLeft",void 0),_(this,"floatingRight",void 0),_(this,"editable",void 0),_(this,"editedData",void 0),this.numRows=o,this.numColumns=r,this.floatingTop=a,this.floatingBottom=l,this.floatingLeft=s,this.floatingRight=n,this.editable=i,this.editedData=d}get rowCount(){return this.numRows}get columnCount(){return this.numColumns}get floatingTopRowCount(){return this.floatingTop}get floatingBottomRowCount(){return this.floatingBottom}get floatingLeftColumnCount(){return this.floatingLeft}get floatingRightColumnCount(){return this.floatingRight}get isEditable(){return this.editable}textForCell(o,r){var a,l;return(a=(l=this.editedData[o])===null||l===void 0?void 0:l[r])!==null&&a!==void 0?a:"".concat(o,",").concat(r)}colorForCell(o,r,a){return a.textColor}textForColumnHeader(o){return"".concat(o)}textForRowHeader(o){return"".concat(o)}textForRowFooter(o){return"".concat(o)}setValueForCell(o,r,a){var l=this;return we(function*(){l.editedData[o]==null&&(l.editedData[o]=[]),l.editedData[o][r]="".concat(a)})()}setValueForRanges(o,r){var a=this;return we(function*(){So.forEachCell(o,(l,s)=>{a.setValueForCell(l,s,r)})})()}setValues(o){var r=this;return we(function*(){for(var a=0;a<o.length;a+=1){var l,s,n=o[a];r.setValueForCell((l=n.column)!==null&&l!==void 0?l:n.x,(s=n.row)!==null&&s!==void 0?s:n.y,n.text)}})()}editValueForCell(o,r){return this.textForCell(o,r)}isValidForCell(o,r,a){return!0}isEditableRange(o){return this.isEditable}delete(o){throw new Error("Method not implemented.")}}const Ge=Kr;function w(t,o,r){return o=Yr(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function Yr(t){var o=Xr(t,"string");return typeof o=="symbol"?o:String(o)}function Xr(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}class E extends Ge{constructor(){var{rowCount:o=E.DEFAULT_ROW_COUNT,columnCount:r=E.DEFAULT_COLUMN_COUNT,children:a=new Map,childRowCount:l=Math.ceil(Math.max(E.MIN_CHILD_ROW_COUNT,o*E.DEFAULT_CHILD_ROW_COUNT_FACTOR)),maxDepth:s=E.MAX_DEPTH}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super({rowCount:o,columnCount:r}),w(this,"children",void 0),w(this,"childRowCount",void 0),w(this,"maxDepth",void 0),w(this,"getCachedModelRowOffset",K((n,i)=>{for(var d=null,h=i,c=[...n].sort((j,F)=>j[0]-F[0]),g=0;g<c.length;g+=1){var[m,v]=c[g];if(h<=m)break;var f=v.rowCount;if(h<=m+f){d=m,h=h-m-1;break}h-=f}return{key:d,offsetRow:h}})),w(this,"getCachedTextForRowHeader",K((n,i)=>{var{key:d,offsetRow:h}=this.getCachedModelRowOffset(n,i);if(d!=null){var c=n.get(d);if(c!==void 0)return"".concat(d,".").concat(c.textForRowHeader(h))}return"".concat(h)})),w(this,"getCachedTextForCell",K((n,i,d)=>{var{key:h,offsetRow:c}=this.getCachedModelRowOffset(n,d);if(h!=null){var g=n.get(h);if(g!==void 0)return"".concat(h,".").concat(g.textForCell(i,c))}return"".concat(i,",").concat(c)})),w(this,"getCachedIsRowExpandable",K((n,i,d)=>{var h=this.getCachedDepthForRow(n,i);return h<d})),w(this,"getCachedIsRowExpanded",K((n,i)=>{var{key:d,offsetRow:h}=this.getCachedModelRowOffset(n,i);if(d!=null){var c=n.get(d);if(c!==void 0)return c.isRowExpanded(h)}return n.has(h)})),w(this,"getCachedDepthForRow",K((n,i)=>{var{key:d,offsetRow:h}=this.getCachedModelRowOffset(n,i);if(d!=null){var c=n.get(d);if(c!==void 0)return c.depthForRow(h)+1}return 0})),this.children=a,this.childRowCount=l,this.maxDepth=s}textForCell(o,r){return this.getCachedTextForCell(this.children,o,r)}textForRowHeader(o){return this.getCachedTextForRowHeader(this.children,o)}isRowMovable(o){return!1}get hasExpandableRows(){return!0}get isExpandAllAvailable(){return!1}get floatingBottomRowCount(){return 0}isRowExpandable(o){return this.getCachedIsRowExpandable(this.children,o,this.maxDepth)}isRowExpanded(o){return this.getCachedIsRowExpanded(this.children,o)}setRowExpanded(o,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{key:l,offsetRow:s}=this.getCachedModelRowOffset(this.children,o),n=new Map(this.children);if(l!=null){var i=this.children.get(l);if(i!==void 0){var{rowCount:d}=i;i.setRowExpanded(s,r,a),this.numRows+=i.rowCount-d}}else if(r){var c=new E({rowCount:this.childRowCount,columnCount:this.numColumns});n.set(s,c),this.numRows+=c.rowCount}else{var h=n.get(s);h!==void 0&&(this.numRows-=h.rowCount,n.delete(s))}this.children=n}expandAll(){throw new Error("Expand all not implemented.")}collapseAll(){throw new Error("Collapse all not implemented.")}depthForRow(o){return this.getCachedDepthForRow(this.children,o)}}w(E,"DEFAULT_ROW_COUNT",1e9);w(E,"DEFAULT_COLUMN_COUNT",100);w(E,"DEFAULT_CHILD_ROW_COUNT_FACTOR",.01);w(E,"MIN_CHILD_ROW_COUNT",10);w(E,"MAX_DEPTH",10);const He=E;function Ce(t,o,r){return o=Zr(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function Zr(t){var o=Jr(t,"string");return typeof o=="symbol"?o:String(o)}function Jr(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}class Qr extends xe{constructor(o,r){var a;super(),Ce(this,"data",void 0),Ce(this,"columnHeaders",void 0),Ce(this,"numberOfColumns",void 0),this.data=o,this.numberOfColumns=Math.max(...o.map(l=>l.length),(a=r?.length)!==null&&a!==void 0?a:0),this.columnHeaders=r}get rowCount(){return this.data.length}get columnCount(){return this.numberOfColumns}textForCell(o,r){var a;return"".concat((a=this.data[r])===null||a===void 0?void 0:a[o])}textForColumnHeader(o){var r,a;return(r=(a=this.columnHeaders)===null||a===void 0?void 0:a[o])!==null&&r!==void 0?r:""}}const et=Qr;function Se(t,o,r){return o=ot(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function ot(t){var o=rt(t,"string");return typeof o=="symbol"?o:String(o)}function rt(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}class tt extends xe{constructor(o,r){super(),Se(this,"numberOfColumns",void 0),Se(this,"numberOfRows",void 0),Se(this,"viewportData",void 0),this.numberOfColumns=o,this.numberOfRows=r}get columnCount(){return this.numberOfColumns}get rowCount(){return this.numberOfRows}textForCell(o,r){var a,l,s,n,i,d,h,c=r-((a=(l=this.viewportData)===null||l===void 0?void 0:l.rowOffset)!==null&&a!==void 0?a:0),g=o-((s=(n=this.viewportData)===null||n===void 0?void 0:n.columnOffset)!==null&&s!==void 0?s:0);return"".concat((i=(d=this.viewportData)===null||d===void 0||(h=d.data[c])===null||h===void 0?void 0:h[g])!==null&&i!==void 0?i:"")}textForColumnHeader(o){return"".concat(o)}textForRowHeader(o){return"".concat(o)}}const at=tt;function T(t,o,r){return o=lt(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function lt(t){var o=st(t,"string");return typeof o=="symbol"?o:String(o)}function st(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}var nt="proportional",it=To.positiveBarColor,ct=To.negativeBarColor,dt="beside",ht="LTR",ut="right";function gt(t){return Array.isArray(t)&&t.every(o=>typeof o=="number")}class mt extends xe{constructor(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Map,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new Map,n=arguments.length>5&&arguments[5]!==void 0?arguments[5]:new Map,i=arguments.length>6&&arguments[6]!==void 0?arguments[6]:new Map,d=arguments.length>7&&arguments[7]!==void 0?arguments[7]:new Map,h=arguments.length>8&&arguments[8]!==void 0?arguments[8]:new Map;super(),T(this,"numberOfColumns",void 0),T(this,"numberOfRows",void 0),T(this,"data",void 0),T(this,"columnMins",void 0),T(this,"columnMaxs",void 0),T(this,"columnAxes",void 0),T(this,"valuePlacements",void 0),T(this,"directions",void 0),T(this,"positiveColors",void 0),T(this,"negativeColors",void 0),T(this,"opacities",void 0),T(this,"textAlignments",void 0),T(this,"markers",void 0),this.positiveColors=a,this.negativeColors=l,this.data=o,this.columnAxes=r,this.valuePlacements=s,this.opacities=n,this.directions=i,this.textAlignments=d,this.markers=h,this.numberOfRows=Math.max(...o.map(m=>m.length)),this.numberOfColumns=o.length,this.columnMins=new Map,this.columnMaxs=new Map;for(var c=0;c<o.length;c+=1){var g=o[c];gt(g)&&(this.columnMins.set(c,Math.min(...g)),this.columnMaxs.set(c,Math.max(...g)))}}get rowCount(){return this.numberOfRows}get columnCount(){return this.numberOfColumns}textForCell(o,r){var a;return"".concat((a=this.data[o])===null||a===void 0?void 0:a[r])}textForColumnHeader(o){return"".concat(o)}textAlignForCell(o,r){var a;return(a=this.textAlignments.get(o))!==null&&a!==void 0?a:ut}renderTypeForCell(o,r){return o<20||o%2===r%2?"dataBar":"text"}dataBarOptionsForCell(o,r){var a,l,s,n,i,d,h,c=Ke(this.columnMins,o),g=Ke(this.columnMaxs,o),m=(a=this.columnAxes.get(o))!==null&&a!==void 0?a:nt,v=(l=this.valuePlacements.get(o))!==null&&l!==void 0?l:dt,f=this.opacities.get(o);f==null||f>1?f=1:f<0&&(f=0);var j=(s=this.directions.get(o))!==null&&s!==void 0?s:ht,F=(n=this.positiveColors.get(o))!==null&&n!==void 0?n:it,re=(i=this.negativeColors.get(o))!==null&&i!==void 0?i:ct,O=Number((d=this.data[o])===null||d===void 0?void 0:d[r]),H=O>=0?F:re,ue=(h=this.markers.get(o))!==null&&h!==void 0?h:[];return{columnMin:c,columnMax:g,axis:m,color:H,valuePlacement:v,opacity:f,markers:ue,direction:j,value:O}}}const vt=mt,Te="hide-from-e2e-tests",no="sample-section";function*Eo(t=1){for(;;)t=t*16807%2147483647,yield t/2147483647}function pt(t=1){const[o]=u.useState(()=>Eo(t));return u.useCallback(()=>{const r=o.next();if(r.done===!0)throw new Error("Random number generator unexpectedly finished");return r.value},[o])}function x(t,o=[]){const r=`${no}-${t.toLocaleLowerCase().replaceAll(" ","-")}`,a=G(no,...o);return{id:r,className:a}}function N(t,o=[]){const{id:r,className:a}=x(t,o);return{id:r,UNSAFE_className:a}}function M(){}class Z extends u.Component{static renderButtonBrand(o,r){const a=o.length?`btn-${o}-${r}`:`btn-${r}`;return e.jsx(vr,{className:a,style:{marginBottom:"1rem",marginRight:"1rem"},children:r},r)}static renderButtons(o){const r=["primary","secondary","success","warning","danger","info"].map(a=>Z.renderButtonBrand(o,a));return e.jsxs("div",{...x(`buttons-${o.length?"outline":"regular"}`),children:[e.jsx("h5",{children:o.length?"Outline":"Regular"}),r]},o)}static renderLinks(){const o={primary:"accent",secondary:"neutral",success:"positive",info:"info",warning:"notice",danger:"negative"};return e.jsxs("div",{...x("links"),style:{paddingTop:"1rem"},children:[e.jsx("h5",{children:"Links"}),e.jsx(C,{gap:"1rem",children:Object.entries(o).map(([r,a])=>e.jsxs("a",{className:`text-${r}`,children:[r," (",a,")"]},r))})]})}static renderSocketedButtons(){return e.jsxs("div",{...x("buttons-socketed"),children:[e.jsx("h5",{children:"Socketed Buttons (for linker)"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},onClick:M,children:"Unlinked"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},isLinked:!0,onClick:M,children:"Linked"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},isLinkedSource:!0,onClick:M,children:"Linked Source"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},isLinked:!0,isInvalid:!0,onClick:M,children:"Error"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},disabled:!0,onClick:M,children:"Disabled"})]})}constructor(o){super(o),this.state={toggle:!0}}renderInlineButtons(){const{toggle:o}=this.state;return e.jsxs("div",{...x("buttons-inline"),style:{padding:"1rem 0"},children:[e.jsx("h5",{children:"Inline Buttons"}),"Regular btn-inline:",e.jsx(p,{className:"mx-2",kind:"inline",icon:U,tooltip:"test",onClick:M}),"Toggle button (class active):",e.jsx(p,{className:"mx-2",onClick:()=>{this.setState({toggle:!o})},active:o,kind:"inline",icon:U,tooltip:"test"}),"Disabled:",e.jsx(p,{className:"mx-2",kind:"inline",disabled:!0,onClick:M,children:"Disabled"}),"With Text:",e.jsx(p,{className:"mx-2",kind:"inline",icon:U,onClick:M,children:e.jsx("span",{children:"Text Button"})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("span",{children:"btn-link-icon (no text):"}),e.jsx(p,{kind:"ghost",icon:U,tooltip:"test",onClick:M}),e.jsx("span",{className:"mx-2",children:"btn-link:"}),e.jsx(p,{kind:"ghost",onClick:M,children:"Text Button"}),e.jsx("span",{className:"mx-2",children:"btn-link (text w/ optional with icon):"}),e.jsx(p,{kind:"ghost",icon:U,onClick:M,children:"Text Button"})]})}render(){const o=["","outline"].map(s=>Z.renderButtons(s)),r=this.renderInlineButtons(),a=Z.renderSocketedButtons(),l=Z.renderLinks();return e.jsxs("div",{children:[e.jsx("h2",{className:"ui-title",children:"Buttons"}),e.jsxs("div",{style:{padding:"1rem 0"},children:[o,r,a,l]})]})}}function xt(){const t=No();lo.random=pt();const[o]=u.useState(()=>new lo(t));return e.jsxs("div",{...x("charts"),children:[e.jsx("h2",{className:"ui-title",children:"Chart"}),e.jsx("div",{style:{height:500},children:e.jsx(pr,{model:o})})]})}const Be="2px solid var(--dh-color-notice-bg)",ft={"--dh-color-black":"gray","--dh-color-white":"gray","--dh-color-border":"General","--dh-color-bg":"General","--dh-color-surface-bg":"General","--dh-color-fg":"General","--dh-color-content-bg":"General","--dh-color-subdued-content-bg":"General","--dh-color-dropshadow":"General","--dh-color-keyboard-selected-bg":"Misc","--dh-color-hover-border":"Misc","--dh-color-visual-positive":"Visual Status","--dh-color-visual-negative":"Visual Status","--dh-color-visual-notice":"Visual Status","--dh-color-visual-info":"Visual Status","--dh-color-gray-bg":"Default Background","--dh-color-red-bg":"Default Background","--dh-color-orange-bg":"Default Background","--dh-color-yellow-bg":"Default Background","--dh-color-chartreuse-bg":"Default Background","--dh-color-celery-bg":"Default Background","--dh-color-green-bg":"Default Background","--dh-color-seafoam-bg":"Default Background","--dh-color-cyan-bg":"Default Background","--dh-color-blue-bg":"Default Background","--dh-color-indigo-bg":"Default Background","--dh-color-purple-bg":"Default Background","--dh-color-fuchsia-bg":"Default Background","--dh-color-magenta-bg":"Default Background","--dh-color-editor-bg":"editor","--dh-color-editor-fg":"editor","--dh-color-editor-context-menu-bg":"menus","--dh-color-editor-context-menu-fg":"menus","--dh-color-editor-menu-selection-bg":"menus","--dh-color-grid-bg":"grid","--dh-color-grid-number-positive":"Data Types","--dh-color-grid-number-negative":"Data Types","--dh-color-grid-number-zero":"Data Types","--dh-color-grid-date":"Data Types","--dh-color-grid-string-null":"Data Types"},io={"--dh-color-black":"","--dh-color-action-active-bg":"Action.active","--dh-color-action-down-bg":"Action:active","--dh-color-action-hover-bg":"Action:hover","--dh-color-action-active-hover-bg":"Action.active:hover","--dh-color-action-disabled-bg":"Action:disabled"},bt={palette:{black:"gray",white:"gray"},editor:{line:"editor",comment:"code",string:"code",number:"code",delimiter:"code",identifier:"code",keyword:"code",operator:"code",storage:"code",predefined:"code",selection:"state",focus:"state"},chart:{axis:"Chart",bg:"Chart",grid:"Chart",plot:"Chart",title:"Chart",active:"Data",trend:"Data",area:"Data",range:"Data",line:"Deprecated"},grid:{data:"Data Bars",context:"Context Menu"},semantic:{},component:{}};function ie(t){const o=ce.parseRgba(ce.asRgbOrRgbaString(t)??"");if(o==null||o.a<.5)return"white";const{r,g:a,b:l}=o;return ce.getBrightness([r,a,l])>=128?"black":"white"}function jt(t){const o=getComputedStyle(document.documentElement);return t.split(/[\n;]/g).map(a=>/^(?:\s{2}|:root\{)?(--dh-color-(?:[^:]+))/.exec(a)?.[1]).filter(a=>!!a).map(a=>{const l=o.getPropertyValue(a);return a==="--dh-color-chart-colorway"?nr(l??"").map(([n,i])=>l.substring(n,i+1)).map((n,i)=>({name:`${a}-${i}`,value:n})):{name:a,value:l}}).flat()}function X(t,o,r,a=ft){const l=bt[t];return jt(o).reduce((i,{name:d,value:h})=>{if(/^--dh-color-true-(.*?)$/.test(d)||/^--dh-color-gray-(light|mid|dark)$/.test(d))return i;const c=/^--dh-color-([^-]+)(?:-([^-]+))?/.exec(d);let g=a[d]??c?.[r]??c?.[1]??"???";return g=l[g]??g,i[g]==null&&(i[g]=[]),d in io&&i[g].push({isLabel:!0,name:io[d],value:""}),/^--dh-color-gray-(light|mid|dark)$/.test(d)||i[g].push({name:d,value:h}),i},{})}function yt(){const t=u.useRef(null);return u.useLayoutEffect(()=>{if(t.current==null)return;const o=getComputedStyle(t.current),{backgroundColor:r}=o;t.current.style.color=ie(r)},[]),t}function wt(t,o){const[r,a]=u.useState();return u.useEffect(()=>{if(t.current==null)return;const l=getComputedStyle(t.current,o).getPropertyValue("content"),s=/"(--dh-color-.*?)[,"]/.exec(l)?.[1];if(s==null)return;const n=getComputedStyle(t.current).getPropertyValue(s);a(n)},[t,o]),r}function ke({className:t,children:o}){const r=yt(),a=wt(r,":after"),l=u.useMemo(()=>a!=null?{value:a}:null,[a]),s=l!=null&&l.value!=="";return e.jsxs("div",{ref:r,className:t,style:{border:s?void 0:Be},children:[s&&e.jsx(J,{interactive:!0,children:e.jsx("div",{children:l.value})}),o]})}function Ct(){const t=["100","200","300","400","500","600","700","800","850","8XX","900"].map(a=>e.jsx(ke,{className:G("swatch","gray-swatch",`gray-swatch-${a}`),children:a==="8XX"?"N/A":`Gray-${a}`},a)),o=["red","orange","yellow","green","blue","purple","white","black"].map(a=>e.jsx(ke,{className:G("swatch",`swatch-${a}`),children:a},a)),r=["content-bg","background","foreground","primary","primary-dark","secondary","secondary-hover","success","info","warning","danger","danger-hover"].map(a=>e.jsx(ke,{className:G("swatch",`swatch-${a}`),children:a},a));return e.jsxs("div",{...x("colors"),children:[e.jsx("h2",{className:"ui-title",children:"Colors"}),e.jsxs("div",{className:"row",children:[e.jsxs("div",{className:"col",children:[t,o]}),e.jsx("div",{className:"col",children:r}),e.jsx("div",{className:"col",children:e.jsx("p",{children:"This section is for legacy reference only. Use the css variable based semantic colors in the following sections. You should not be using colors defined in the theme color palette directly."})})]})]})}class St extends u.Component{constructor(o){super(o),this.makeContextMenuItems=this.makeContextMenuItems.bind(this)}makeContextMenuItems(o){const r=o!==void 0?` ${o}`:"";return[{title:`Show Alert${r}`,icon:Ve,action:()=>{alert(`Alert${r}!`)},shortcut:new Q({id:"STYLEGUIDE.SHOW_ALERT",name:"Show Alert",shortcut:[$.CTRL,A.A],macShortcut:[$.CMD,A.A]})},{title:`Log Message${r}`,icon:Ue,action:()=>{console.log(`Logging a message${r}!`)},shortcut:new Q({id:"STYLEGUIDE.LOG_MESSAGE",name:"Log Message",shortcut:[$.CTRL,A.L],macShortcut:[$.CMD,A.L]})},{title:"Sub-menu",actions:()=>this.makeContextMenuItems((o??0)+1),order:3}].concat(new Array(10).fill({title:`Disabled Option${r}`,disabled:!0,order:2}))}render(){const o=this.makeContextMenuItems(),a=[{title:"Show Shortcuts",icon:Co,action:()=>{alert("Show keyboard shortcuts!")},shortcut:new Q({id:"STYLEGUIDE.SHOW_SHORTCUTS",name:"Show Shortcuts",shortcut:[$.CTRL,A.SLASH],macShortcut:[$.CMD,A.SLASH]}),group:ge.groups.global}].concat(o),l=()=>new Promise(s=>{setTimeout(()=>{s(o)},3e3)});return e.jsxs("div",{...x("context-menus"),children:[e.jsx("h2",{className:"ui-title",children:"Context Menu"}),e.jsxs(p,{kind:"primary",style:{cursor:"default",marginBottom:"1rem",marginRight:"1rem"},onClick:()=>{},children:["Right Click Me",e.jsx(ge,{actions:a})]}),e.jsxs(p,{kind:"tertiary",style:{cursor:"default",marginBottom:"1rem",marginRight:"1rem"},onClick:()=>{},children:["Right Click Me",e.jsx(ge,{actions:l})]})]})}}class Tt extends u.Component{constructor(o){super(o),this.sampleInput=he.createRef(),this.handleUpdateCheckboxMap=this.handleUpdateCheckboxMap.bind(this);const r=["Parent A",new Map([["Child 1",!0],["Child 2",!1]])],a=["Parent B",new Map([["Child 3",!0],["Child 4",!1],["Child 5",!0],["Child 6",!1]])],l=["Leaf Parent",!0];this.state={isShown:!1,checkBoxMap:new Map([r,a,l])}}handleUpdateCheckboxMap(o){this.setState({checkBoxMap:o})}renderChild(){return e.jsxs("div",{className:"p-3",children:[e.jsx("h4",{children:"Sample Child"}),e.jsxs("div",{className:"form-group",children:[e.jsxs("label",{htmlFor:"exampleInput1",children:["Input Label",e.jsx("input",{ref:this.sampleInput,type:"text",className:"form-control",id:"exampleInput1","aria-describedby":"emailHelp",placeholder:"Input Placeholder"})]}),e.jsx("small",{className:"form-text text-muted",children:"Help text for a form input"})]})]})}render(){const{isShown:o,checkBoxMap:r}=this.state;return e.jsxs("div",{...x("dialog"),children:[e.jsx("h2",{className:"ui-title",children:"Popover Dialog"}),e.jsx("p",{children:"Popover dialog that can contain interactive elements, can be set to self close on blur."}),e.jsxs(p,{kind:"primary",style:{marginBottom:"1rem",marginRight:"1rem"},onClick:()=>{o?this.setState({isShown:!1}):this.setState({isShown:!0})},children:["Open Dialog",e.jsx(Sr,{options:{placement:"bottom"},isShown:o,onEntered:()=>{this.sampleInput.current&&this.sampleInput.current.focus()},onExited:()=>{this.setState({isShown:!1})},closeOnBlur:!0,interactive:!0,children:this.renderChild()})]}),e.jsx("p",{children:"The Hierarchical Checkbox Menu uses a popover dialog to display hierarchical groups of checkboxes."}),e.jsx(Rr,{menuText:"Checkbox Menu",valueMap:r,onUpdateValueMap:this.handleUpdateCheckboxMap})]})}}class kt extends u.Component{constructor(o){super(o),this.state={isShown:!1}}render(){const o=[{title:"Show Alert",icon:Ve,action:()=>{alert("Alert!")},shortcut:new Q({id:"STYLEGUIDE.SHOW_ALERT",name:"Show Alert",shortcut:[$.CTRL,A.A],macShortcut:[$.CMD,A.A]})},{title:"Log Message",icon:Ue,action:()=>{console.log("Logging a message!")},shortcut:new Q({id:"STYLEGUIDE.LOG_MESSAGE",name:"Log Message",shortcut:[$.CTRL,A.L],macShortcut:[$.CMD,A.L]})}],a=[{title:"Show Shortcuts",icon:Co,action:()=>{alert("Show keyboard shortcuts!")},shortcut:new Q({id:"STYLEGUIDE.SHOW_SHORTCUTS",name:"Show Shortcuts",shortcut:[$.CTRL,A.SLASH],macShortcut:[$.CMD,A.SLASH]}),group:ge.groups.global}].concat(o),{isShown:l}=this.state;return e.jsxs("div",{...x("dropdown-menus"),children:[e.jsx("h2",{className:"ui-title",children:"Dropdown Menu"}),e.jsx("p",{children:"A simple dropdown menu of actions, can open on click of parent container, or controlled by prop."}),e.jsx(p,{kind:"inline",className:"mx-2",icon:ir,onClick:()=>{},children:e.jsx(eo,{actions:a})}),e.jsxs(p,{kind:"primary",style:{marginRight:"1rem",minWidth:"165px"},onClick:()=>{l?this.setState({isShown:!1}):this.setState({isShown:!0})},children:["Menu Shown: ",l.toString()]}),e.jsxs("div",{ref:this.button,className:"btn btn-secondary disabled",style:{marginRight:"1rem"},children:["Shown using isShown",e.jsx(eo,{isShown:l,onMenuClosed:()=>{this.setState({isShown:!1})},actions:a})]})]})}}const Nt=`trades = db.t("LearnDeephaven", "StockTrades").where("Date=\`2017-08-25\`")\\
|
|
1
|
+
import{r as u,F as G,C as e,aL as C,H as he,U as jo,N as ve,G as k,a1 as ee,M as qe,ap as Bo,aM as P,aN as yo,aO as D,$ as Fo,a0 as R,a3 as Oo,a4 as Fe,aP as Vo,a5 as Uo,a6 as Oe,a2 as de,a8 as Go,a9 as b,aQ as Ho,aR as Me,aS as z,aT as zo,a7 as Wo,aU as Re,ad as wo,ac as S,aV as Pe,aW as qo,aX as Ko,ae as Yo,aY as Xo,aZ as Zo,a_ as Jo,a$ as W,b0 as Qo,b1 as fe,b2 as I,b3 as er,b4 as or,b5 as rr,ar as tr,b6 as ar,b7 as be,K as lr,_ as sr}from"./vendor-beec23d9.js";import{aW as Ke,aX as U,aN as ce,a3 as nr,aY as Ve,aZ as Ue,a_ as Co,aF as ir,a$ as q,b0 as Ye,G as Xe,b1 as Ze,I as Le,b2 as cr,b3 as dr,N as hr,b4 as ur,b5 as gr,aJ as Je}from"./index-2431385f.js";import{W as mr}from"./monaco-b5248072.js";import{ah as xe,a9 as So,a6 as K,ai as To,B as vr,f as ae,l as pr,K as je,aj as oe,ak as xr,I as fr,R as ko,e as B,C as _e,O as br,a as jr,S as yr,b as ne,P as Qe,g as wr,c as Cr}from"./IrisGrid-a9bad2d6.js";import{B as p,u as No,s as J,q as Q,aY as $,K as A,an as ge,al as Sr,J as eo,cs as oo,Q as Tr,C as L,a$ as le,S as me,aS as kr,ao as Nr,d as ro,aW as to,b1 as Do,z as ao,bw as Y,ar as Dr,aC as Er,ab as Ir,aI as $r,aJ as Ar,w as Mr}from"./ControlType-6337dc6d.js";import{M as lo,H as Rr,A as Pr,V as ye,T as Lr,D as _r,C as Br,a as Fr,c as Or,b as Vr,d as Ur}from"./FontBootstrap-f7fb13f9.js";import{N as Gr,T as Hr}from"./useUser-0ea4bd27.js";import{L as zr}from"./AppRoot-f366693a.js";import"./helpers-de833af9.js";import"./plotly-a5b1f68a.js";function so(t,o,r,a,l,s,n){try{var i=t[s](n),d=i.value}catch(h){r(h);return}i.done?o(d):Promise.resolve(d).then(a,l)}function we(t){return function(){var o=this,r=arguments;return new Promise(function(a,l){var s=t.apply(o,r);function n(d){so(s,a,l,n,i,"next",d)}function i(d){so(s,a,l,n,i,"throw",d)}n(void 0)})}}function _(t,o,r){return o=Wr(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function Wr(t){var o=qr(t,"string");return typeof o=="symbol"?o:String(o)}function qr(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}class Kr extends xe{constructor(){var{rowCount:o=1e9,columnCount:r=100,floatingTopRowCount:a=0,floatingBottomRowCount:l=0,floatingLeftColumnCount:s=0,floatingRightColumnCount:n=0,isEditable:i=!1,editedData:d=[]}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),_(this,"numRows",void 0),_(this,"numColumns",void 0),_(this,"floatingTop",void 0),_(this,"floatingBottom",void 0),_(this,"floatingLeft",void 0),_(this,"floatingRight",void 0),_(this,"editable",void 0),_(this,"editedData",void 0),this.numRows=o,this.numColumns=r,this.floatingTop=a,this.floatingBottom=l,this.floatingLeft=s,this.floatingRight=n,this.editable=i,this.editedData=d}get rowCount(){return this.numRows}get columnCount(){return this.numColumns}get floatingTopRowCount(){return this.floatingTop}get floatingBottomRowCount(){return this.floatingBottom}get floatingLeftColumnCount(){return this.floatingLeft}get floatingRightColumnCount(){return this.floatingRight}get isEditable(){return this.editable}textForCell(o,r){var a,l;return(a=(l=this.editedData[o])===null||l===void 0?void 0:l[r])!==null&&a!==void 0?a:"".concat(o,",").concat(r)}colorForCell(o,r,a){return a.textColor}textForColumnHeader(o){return"".concat(o)}textForRowHeader(o){return"".concat(o)}textForRowFooter(o){return"".concat(o)}setValueForCell(o,r,a){var l=this;return we(function*(){l.editedData[o]==null&&(l.editedData[o]=[]),l.editedData[o][r]="".concat(a)})()}setValueForRanges(o,r){var a=this;return we(function*(){So.forEachCell(o,(l,s)=>{a.setValueForCell(l,s,r)})})()}setValues(o){var r=this;return we(function*(){for(var a=0;a<o.length;a+=1){var l,s,n=o[a];r.setValueForCell((l=n.column)!==null&&l!==void 0?l:n.x,(s=n.row)!==null&&s!==void 0?s:n.y,n.text)}})()}editValueForCell(o,r){return this.textForCell(o,r)}isValidForCell(o,r,a){return!0}isEditableRange(o){return this.isEditable}delete(o){throw new Error("Method not implemented.")}}const Ge=Kr;function w(t,o,r){return o=Yr(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function Yr(t){var o=Xr(t,"string");return typeof o=="symbol"?o:String(o)}function Xr(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}class E extends Ge{constructor(){var{rowCount:o=E.DEFAULT_ROW_COUNT,columnCount:r=E.DEFAULT_COLUMN_COUNT,children:a=new Map,childRowCount:l=Math.ceil(Math.max(E.MIN_CHILD_ROW_COUNT,o*E.DEFAULT_CHILD_ROW_COUNT_FACTOR)),maxDepth:s=E.MAX_DEPTH}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super({rowCount:o,columnCount:r}),w(this,"children",void 0),w(this,"childRowCount",void 0),w(this,"maxDepth",void 0),w(this,"getCachedModelRowOffset",K((n,i)=>{for(var d=null,h=i,c=[...n].sort((j,F)=>j[0]-F[0]),g=0;g<c.length;g+=1){var[m,v]=c[g];if(h<=m)break;var f=v.rowCount;if(h<=m+f){d=m,h=h-m-1;break}h-=f}return{key:d,offsetRow:h}})),w(this,"getCachedTextForRowHeader",K((n,i)=>{var{key:d,offsetRow:h}=this.getCachedModelRowOffset(n,i);if(d!=null){var c=n.get(d);if(c!==void 0)return"".concat(d,".").concat(c.textForRowHeader(h))}return"".concat(h)})),w(this,"getCachedTextForCell",K((n,i,d)=>{var{key:h,offsetRow:c}=this.getCachedModelRowOffset(n,d);if(h!=null){var g=n.get(h);if(g!==void 0)return"".concat(h,".").concat(g.textForCell(i,c))}return"".concat(i,",").concat(c)})),w(this,"getCachedIsRowExpandable",K((n,i,d)=>{var h=this.getCachedDepthForRow(n,i);return h<d})),w(this,"getCachedIsRowExpanded",K((n,i)=>{var{key:d,offsetRow:h}=this.getCachedModelRowOffset(n,i);if(d!=null){var c=n.get(d);if(c!==void 0)return c.isRowExpanded(h)}return n.has(h)})),w(this,"getCachedDepthForRow",K((n,i)=>{var{key:d,offsetRow:h}=this.getCachedModelRowOffset(n,i);if(d!=null){var c=n.get(d);if(c!==void 0)return c.depthForRow(h)+1}return 0})),this.children=a,this.childRowCount=l,this.maxDepth=s}textForCell(o,r){return this.getCachedTextForCell(this.children,o,r)}textForRowHeader(o){return this.getCachedTextForRowHeader(this.children,o)}isRowMovable(o){return!1}get hasExpandableRows(){return!0}get isExpandAllAvailable(){return!1}get floatingBottomRowCount(){return 0}isRowExpandable(o){return this.getCachedIsRowExpandable(this.children,o,this.maxDepth)}isRowExpanded(o){return this.getCachedIsRowExpanded(this.children,o)}setRowExpanded(o,r){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{key:l,offsetRow:s}=this.getCachedModelRowOffset(this.children,o),n=new Map(this.children);if(l!=null){var i=this.children.get(l);if(i!==void 0){var{rowCount:d}=i;i.setRowExpanded(s,r,a),this.numRows+=i.rowCount-d}}else if(r){var c=new E({rowCount:this.childRowCount,columnCount:this.numColumns});n.set(s,c),this.numRows+=c.rowCount}else{var h=n.get(s);h!==void 0&&(this.numRows-=h.rowCount,n.delete(s))}this.children=n}expandAll(){throw new Error("Expand all not implemented.")}collapseAll(){throw new Error("Collapse all not implemented.")}depthForRow(o){return this.getCachedDepthForRow(this.children,o)}}w(E,"DEFAULT_ROW_COUNT",1e9);w(E,"DEFAULT_COLUMN_COUNT",100);w(E,"DEFAULT_CHILD_ROW_COUNT_FACTOR",.01);w(E,"MIN_CHILD_ROW_COUNT",10);w(E,"MAX_DEPTH",10);const He=E;function Ce(t,o,r){return o=Zr(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function Zr(t){var o=Jr(t,"string");return typeof o=="symbol"?o:String(o)}function Jr(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}class Qr extends xe{constructor(o,r){var a;super(),Ce(this,"data",void 0),Ce(this,"columnHeaders",void 0),Ce(this,"numberOfColumns",void 0),this.data=o,this.numberOfColumns=Math.max(...o.map(l=>l.length),(a=r?.length)!==null&&a!==void 0?a:0),this.columnHeaders=r}get rowCount(){return this.data.length}get columnCount(){return this.numberOfColumns}textForCell(o,r){var a;return"".concat((a=this.data[r])===null||a===void 0?void 0:a[o])}textForColumnHeader(o){var r,a;return(r=(a=this.columnHeaders)===null||a===void 0?void 0:a[o])!==null&&r!==void 0?r:""}}const et=Qr;function Se(t,o,r){return o=ot(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function ot(t){var o=rt(t,"string");return typeof o=="symbol"?o:String(o)}function rt(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}class tt extends xe{constructor(o,r){super(),Se(this,"numberOfColumns",void 0),Se(this,"numberOfRows",void 0),Se(this,"viewportData",void 0),this.numberOfColumns=o,this.numberOfRows=r}get columnCount(){return this.numberOfColumns}get rowCount(){return this.numberOfRows}textForCell(o,r){var a,l,s,n,i,d,h,c=r-((a=(l=this.viewportData)===null||l===void 0?void 0:l.rowOffset)!==null&&a!==void 0?a:0),g=o-((s=(n=this.viewportData)===null||n===void 0?void 0:n.columnOffset)!==null&&s!==void 0?s:0);return"".concat((i=(d=this.viewportData)===null||d===void 0||(h=d.data[c])===null||h===void 0?void 0:h[g])!==null&&i!==void 0?i:"")}textForColumnHeader(o){return"".concat(o)}textForRowHeader(o){return"".concat(o)}}const at=tt;function T(t,o,r){return o=lt(o),o in t?Object.defineProperty(t,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[o]=r,t}function lt(t){var o=st(t,"string");return typeof o=="symbol"?o:String(o)}function st(t,o){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(t)}var nt="proportional",it=To.positiveBarColor,ct=To.negativeBarColor,dt="beside",ht="LTR",ut="right";function gt(t){return Array.isArray(t)&&t.every(o=>typeof o=="number")}class mt extends xe{constructor(o){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Map,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Map,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new Map,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new Map,n=arguments.length>5&&arguments[5]!==void 0?arguments[5]:new Map,i=arguments.length>6&&arguments[6]!==void 0?arguments[6]:new Map,d=arguments.length>7&&arguments[7]!==void 0?arguments[7]:new Map,h=arguments.length>8&&arguments[8]!==void 0?arguments[8]:new Map;super(),T(this,"numberOfColumns",void 0),T(this,"numberOfRows",void 0),T(this,"data",void 0),T(this,"columnMins",void 0),T(this,"columnMaxs",void 0),T(this,"columnAxes",void 0),T(this,"valuePlacements",void 0),T(this,"directions",void 0),T(this,"positiveColors",void 0),T(this,"negativeColors",void 0),T(this,"opacities",void 0),T(this,"textAlignments",void 0),T(this,"markers",void 0),this.positiveColors=a,this.negativeColors=l,this.data=o,this.columnAxes=r,this.valuePlacements=s,this.opacities=n,this.directions=i,this.textAlignments=d,this.markers=h,this.numberOfRows=Math.max(...o.map(m=>m.length)),this.numberOfColumns=o.length,this.columnMins=new Map,this.columnMaxs=new Map;for(var c=0;c<o.length;c+=1){var g=o[c];gt(g)&&(this.columnMins.set(c,Math.min(...g)),this.columnMaxs.set(c,Math.max(...g)))}}get rowCount(){return this.numberOfRows}get columnCount(){return this.numberOfColumns}textForCell(o,r){var a;return"".concat((a=this.data[o])===null||a===void 0?void 0:a[r])}textForColumnHeader(o){return"".concat(o)}textAlignForCell(o,r){var a;return(a=this.textAlignments.get(o))!==null&&a!==void 0?a:ut}renderTypeForCell(o,r){return o<20||o%2===r%2?"dataBar":"text"}dataBarOptionsForCell(o,r){var a,l,s,n,i,d,h,c=Ke(this.columnMins,o),g=Ke(this.columnMaxs,o),m=(a=this.columnAxes.get(o))!==null&&a!==void 0?a:nt,v=(l=this.valuePlacements.get(o))!==null&&l!==void 0?l:dt,f=this.opacities.get(o);f==null||f>1?f=1:f<0&&(f=0);var j=(s=this.directions.get(o))!==null&&s!==void 0?s:ht,F=(n=this.positiveColors.get(o))!==null&&n!==void 0?n:it,re=(i=this.negativeColors.get(o))!==null&&i!==void 0?i:ct,O=Number((d=this.data[o])===null||d===void 0?void 0:d[r]),H=O>=0?F:re,ue=(h=this.markers.get(o))!==null&&h!==void 0?h:[];return{columnMin:c,columnMax:g,axis:m,color:H,valuePlacement:v,opacity:f,markers:ue,direction:j,value:O}}}const vt=mt,Te="hide-from-e2e-tests",no="sample-section";function*Eo(t=1){for(;;)t=t*16807%2147483647,yield t/2147483647}function pt(t=1){const[o]=u.useState(()=>Eo(t));return u.useCallback(()=>{const r=o.next();if(r.done===!0)throw new Error("Random number generator unexpectedly finished");return r.value},[o])}function x(t,o=[]){const r=`${no}-${t.toLocaleLowerCase().replaceAll(" ","-")}`,a=G(no,...o);return{id:r,className:a}}function N(t,o=[]){const{id:r,className:a}=x(t,o);return{id:r,UNSAFE_className:a}}function M(){}class Z extends u.Component{static renderButtonBrand(o,r){const a=o.length?`btn-${o}-${r}`:`btn-${r}`;return e.jsx(vr,{className:a,style:{marginBottom:"1rem",marginRight:"1rem"},children:r},r)}static renderButtons(o){const r=["primary","secondary","success","warning","danger","info"].map(a=>Z.renderButtonBrand(o,a));return e.jsxs("div",{...x(`buttons-${o.length?"outline":"regular"}`),children:[e.jsx("h5",{children:o.length?"Outline":"Regular"}),r]},o)}static renderLinks(){const o={primary:"accent",secondary:"neutral",success:"positive",info:"info",warning:"notice",danger:"negative"};return e.jsxs("div",{...x("links"),style:{paddingTop:"1rem"},children:[e.jsx("h5",{children:"Links"}),e.jsx(C,{gap:"1rem",children:Object.entries(o).map(([r,a])=>e.jsxs("a",{className:`text-${r}`,children:[r," (",a,")"]},r))})]})}static renderSocketedButtons(){return e.jsxs("div",{...x("buttons-socketed"),children:[e.jsx("h5",{children:"Socketed Buttons (for linker)"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},onClick:M,children:"Unlinked"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},isLinked:!0,onClick:M,children:"Linked"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},isLinkedSource:!0,onClick:M,children:"Linked Source"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},isLinked:!0,isInvalid:!0,onClick:M,children:"Error"}),e.jsx(ae,{style:{marginBottom:"1rem",marginRight:"1rem"},disabled:!0,onClick:M,children:"Disabled"})]})}constructor(o){super(o),this.state={toggle:!0}}renderInlineButtons(){const{toggle:o}=this.state;return e.jsxs("div",{...x("buttons-inline"),style:{padding:"1rem 0"},children:[e.jsx("h5",{children:"Inline Buttons"}),"Regular btn-inline:",e.jsx(p,{className:"mx-2",kind:"inline",icon:U,tooltip:"test",onClick:M}),"Toggle button (class active):",e.jsx(p,{className:"mx-2",onClick:()=>{this.setState({toggle:!o})},active:o,kind:"inline",icon:U,tooltip:"test"}),"Disabled:",e.jsx(p,{className:"mx-2",kind:"inline",disabled:!0,onClick:M,children:"Disabled"}),"With Text:",e.jsx(p,{className:"mx-2",kind:"inline",icon:U,onClick:M,children:e.jsx("span",{children:"Text Button"})}),e.jsx("br",{}),e.jsx("br",{}),e.jsx("span",{children:"btn-link-icon (no text):"}),e.jsx(p,{kind:"ghost",icon:U,tooltip:"test",onClick:M}),e.jsx("span",{className:"mx-2",children:"btn-link:"}),e.jsx(p,{kind:"ghost",onClick:M,children:"Text Button"}),e.jsx("span",{className:"mx-2",children:"btn-link (text w/ optional with icon):"}),e.jsx(p,{kind:"ghost",icon:U,onClick:M,children:"Text Button"})]})}render(){const o=["","outline"].map(s=>Z.renderButtons(s)),r=this.renderInlineButtons(),a=Z.renderSocketedButtons(),l=Z.renderLinks();return e.jsxs("div",{children:[e.jsx("h2",{className:"ui-title",children:"Buttons"}),e.jsxs("div",{style:{padding:"1rem 0"},children:[o,r,a,l]})]})}}function xt(){const t=No();lo.random=pt();const[o]=u.useState(()=>new lo(t));return e.jsxs("div",{...x("charts"),children:[e.jsx("h2",{className:"ui-title",children:"Chart"}),e.jsx("div",{style:{height:500},children:e.jsx(pr,{model:o})})]})}const Be="2px solid var(--dh-color-notice-bg)",ft={"--dh-color-black":"gray","--dh-color-white":"gray","--dh-color-border":"General","--dh-color-bg":"General","--dh-color-surface-bg":"General","--dh-color-fg":"General","--dh-color-content-bg":"General","--dh-color-subdued-content-bg":"General","--dh-color-dropshadow":"General","--dh-color-keyboard-selected-bg":"Misc","--dh-color-hover-border":"Misc","--dh-color-visual-positive":"Visual Status","--dh-color-visual-negative":"Visual Status","--dh-color-visual-notice":"Visual Status","--dh-color-visual-info":"Visual Status","--dh-color-gray-bg":"Default Background","--dh-color-red-bg":"Default Background","--dh-color-orange-bg":"Default Background","--dh-color-yellow-bg":"Default Background","--dh-color-chartreuse-bg":"Default Background","--dh-color-celery-bg":"Default Background","--dh-color-green-bg":"Default Background","--dh-color-seafoam-bg":"Default Background","--dh-color-cyan-bg":"Default Background","--dh-color-blue-bg":"Default Background","--dh-color-indigo-bg":"Default Background","--dh-color-purple-bg":"Default Background","--dh-color-fuchsia-bg":"Default Background","--dh-color-magenta-bg":"Default Background","--dh-color-editor-bg":"editor","--dh-color-editor-fg":"editor","--dh-color-editor-context-menu-bg":"menus","--dh-color-editor-context-menu-fg":"menus","--dh-color-editor-menu-selection-bg":"menus","--dh-color-grid-bg":"grid","--dh-color-grid-number-positive":"Data Types","--dh-color-grid-number-negative":"Data Types","--dh-color-grid-number-zero":"Data Types","--dh-color-grid-date":"Data Types","--dh-color-grid-string-null":"Data Types"},io={"--dh-color-black":"","--dh-color-action-active-bg":"Action.active","--dh-color-action-down-bg":"Action:active","--dh-color-action-hover-bg":"Action:hover","--dh-color-action-active-hover-bg":"Action.active:hover","--dh-color-action-disabled-bg":"Action:disabled"},bt={palette:{black:"gray",white:"gray"},editor:{line:"editor",comment:"code",string:"code",number:"code",delimiter:"code",identifier:"code",keyword:"code",operator:"code",storage:"code",predefined:"code",selection:"state",focus:"state"},chart:{axis:"Chart",bg:"Chart",grid:"Chart",plot:"Chart",title:"Chart",active:"Data",trend:"Data",area:"Data",range:"Data",line:"Deprecated"},grid:{data:"Data Bars",context:"Context Menu"},semantic:{},component:{}};function ie(t){const o=ce.parseRgba(ce.asRgbOrRgbaString(t)??"");if(o==null||o.a<.5)return"white";const{r,g:a,b:l}=o;return ce.getBrightness([r,a,l])>=128?"black":"white"}function jt(t){const o=getComputedStyle(document.documentElement);return t.split(/[\n;]/g).map(a=>/^(?:\s{2}|:root\{)?(--dh-color-(?:[^:]+))/.exec(a)?.[1]).filter(a=>!!a).map(a=>{const l=o.getPropertyValue(a);return a==="--dh-color-chart-colorway"?nr(l??"").map(([n,i])=>l.substring(n,i+1)).map((n,i)=>({name:`${a}-${i}`,value:n})):{name:a,value:l}}).flat()}function X(t,o,r,a=ft){const l=bt[t];return jt(o).reduce((i,{name:d,value:h})=>{if(/^--dh-color-true-(.*?)$/.test(d)||/^--dh-color-gray-(light|mid|dark)$/.test(d))return i;const c=/^--dh-color-([^-]+)(?:-([^-]+))?/.exec(d);let g=a[d]??c?.[r]??c?.[1]??"???";return g=l[g]??g,i[g]==null&&(i[g]=[]),d in io&&i[g].push({isLabel:!0,name:io[d],value:""}),/^--dh-color-gray-(light|mid|dark)$/.test(d)||i[g].push({name:d,value:h}),i},{})}function yt(){const t=u.useRef(null);return u.useLayoutEffect(()=>{if(t.current==null)return;const o=getComputedStyle(t.current),{backgroundColor:r}=o;t.current.style.color=ie(r)},[]),t}function wt(t,o){const[r,a]=u.useState();return u.useEffect(()=>{if(t.current==null)return;const l=getComputedStyle(t.current,o).getPropertyValue("content"),s=/"(--dh-color-.*?)[,"]/.exec(l)?.[1];if(s==null)return;const n=getComputedStyle(t.current).getPropertyValue(s);a(n)},[t,o]),r}function ke({className:t,children:o}){const r=yt(),a=wt(r,":after"),l=u.useMemo(()=>a!=null?{value:a}:null,[a]),s=l!=null&&l.value!=="";return e.jsxs("div",{ref:r,className:t,style:{border:s?void 0:Be},children:[s&&e.jsx(J,{interactive:!0,children:e.jsx("div",{children:l.value})}),o]})}function Ct(){const t=["100","200","300","400","500","600","700","800","850","8XX","900"].map(a=>e.jsx(ke,{className:G("swatch","gray-swatch",`gray-swatch-${a}`),children:a==="8XX"?"N/A":`Gray-${a}`},a)),o=["red","orange","yellow","green","blue","purple","white","black"].map(a=>e.jsx(ke,{className:G("swatch",`swatch-${a}`),children:a},a)),r=["content-bg","background","foreground","primary","primary-dark","secondary","secondary-hover","success","info","warning","danger","danger-hover"].map(a=>e.jsx(ke,{className:G("swatch",`swatch-${a}`),children:a},a));return e.jsxs("div",{...x("colors"),children:[e.jsx("h2",{className:"ui-title",children:"Colors"}),e.jsxs("div",{className:"row",children:[e.jsxs("div",{className:"col",children:[t,o]}),e.jsx("div",{className:"col",children:r}),e.jsx("div",{className:"col",children:e.jsx("p",{children:"This section is for legacy reference only. Use the css variable based semantic colors in the following sections. You should not be using colors defined in the theme color palette directly."})})]})]})}class St extends u.Component{constructor(o){super(o),this.makeContextMenuItems=this.makeContextMenuItems.bind(this)}makeContextMenuItems(o){const r=o!==void 0?` ${o}`:"";return[{title:`Show Alert${r}`,icon:Ve,action:()=>{alert(`Alert${r}!`)},shortcut:new Q({id:"STYLEGUIDE.SHOW_ALERT",name:"Show Alert",shortcut:[$.CTRL,A.A],macShortcut:[$.CMD,A.A]})},{title:`Log Message${r}`,icon:Ue,action:()=>{console.log(`Logging a message${r}!`)},shortcut:new Q({id:"STYLEGUIDE.LOG_MESSAGE",name:"Log Message",shortcut:[$.CTRL,A.L],macShortcut:[$.CMD,A.L]})},{title:"Sub-menu",actions:()=>this.makeContextMenuItems((o??0)+1),order:3}].concat(new Array(10).fill({title:`Disabled Option${r}`,disabled:!0,order:2}))}render(){const o=this.makeContextMenuItems(),a=[{title:"Show Shortcuts",icon:Co,action:()=>{alert("Show keyboard shortcuts!")},shortcut:new Q({id:"STYLEGUIDE.SHOW_SHORTCUTS",name:"Show Shortcuts",shortcut:[$.CTRL,A.SLASH],macShortcut:[$.CMD,A.SLASH]}),group:ge.groups.global}].concat(o),l=()=>new Promise(s=>{setTimeout(()=>{s(o)},3e3)});return e.jsxs("div",{...x("context-menus"),children:[e.jsx("h2",{className:"ui-title",children:"Context Menu"}),e.jsxs(p,{kind:"primary",style:{cursor:"default",marginBottom:"1rem",marginRight:"1rem"},onClick:()=>{},children:["Right Click Me",e.jsx(ge,{actions:a})]}),e.jsxs(p,{kind:"tertiary",style:{cursor:"default",marginBottom:"1rem",marginRight:"1rem"},onClick:()=>{},children:["Right Click Me",e.jsx(ge,{actions:l})]})]})}}class Tt extends u.Component{constructor(o){super(o),this.sampleInput=he.createRef(),this.handleUpdateCheckboxMap=this.handleUpdateCheckboxMap.bind(this);const r=["Parent A",new Map([["Child 1",!0],["Child 2",!1]])],a=["Parent B",new Map([["Child 3",!0],["Child 4",!1],["Child 5",!0],["Child 6",!1]])],l=["Leaf Parent",!0];this.state={isShown:!1,checkBoxMap:new Map([r,a,l])}}handleUpdateCheckboxMap(o){this.setState({checkBoxMap:o})}renderChild(){return e.jsxs("div",{className:"p-3",children:[e.jsx("h4",{children:"Sample Child"}),e.jsxs("div",{className:"form-group",children:[e.jsxs("label",{htmlFor:"exampleInput1",children:["Input Label",e.jsx("input",{ref:this.sampleInput,type:"text",className:"form-control",id:"exampleInput1","aria-describedby":"emailHelp",placeholder:"Input Placeholder"})]}),e.jsx("small",{className:"form-text text-muted",children:"Help text for a form input"})]})]})}render(){const{isShown:o,checkBoxMap:r}=this.state;return e.jsxs("div",{...x("dialog"),children:[e.jsx("h2",{className:"ui-title",children:"Popover Dialog"}),e.jsx("p",{children:"Popover dialog that can contain interactive elements, can be set to self close on blur."}),e.jsxs(p,{kind:"primary",style:{marginBottom:"1rem",marginRight:"1rem"},onClick:()=>{o?this.setState({isShown:!1}):this.setState({isShown:!0})},children:["Open Dialog",e.jsx(Sr,{options:{placement:"bottom"},isShown:o,onEntered:()=>{this.sampleInput.current&&this.sampleInput.current.focus()},onExited:()=>{this.setState({isShown:!1})},closeOnBlur:!0,interactive:!0,children:this.renderChild()})]}),e.jsx("p",{children:"The Hierarchical Checkbox Menu uses a popover dialog to display hierarchical groups of checkboxes."}),e.jsx(Rr,{menuText:"Checkbox Menu",valueMap:r,onUpdateValueMap:this.handleUpdateCheckboxMap})]})}}class kt extends u.Component{constructor(o){super(o),this.state={isShown:!1}}render(){const o=[{title:"Show Alert",icon:Ve,action:()=>{alert("Alert!")},shortcut:new Q({id:"STYLEGUIDE.SHOW_ALERT",name:"Show Alert",shortcut:[$.CTRL,A.A],macShortcut:[$.CMD,A.A]})},{title:"Log Message",icon:Ue,action:()=>{console.log("Logging a message!")},shortcut:new Q({id:"STYLEGUIDE.LOG_MESSAGE",name:"Log Message",shortcut:[$.CTRL,A.L],macShortcut:[$.CMD,A.L]})}],a=[{title:"Show Shortcuts",icon:Co,action:()=>{alert("Show keyboard shortcuts!")},shortcut:new Q({id:"STYLEGUIDE.SHOW_SHORTCUTS",name:"Show Shortcuts",shortcut:[$.CTRL,A.SLASH],macShortcut:[$.CMD,A.SLASH]}),group:ge.groups.global}].concat(o),{isShown:l}=this.state;return e.jsxs("div",{...x("dropdown-menus"),children:[e.jsx("h2",{className:"ui-title",children:"Dropdown Menu"}),e.jsx("p",{children:"A simple dropdown menu of actions, can open on click of parent container, or controlled by prop."}),e.jsx(p,{kind:"inline",className:"mx-2",icon:ir,onClick:()=>{},children:e.jsx(eo,{actions:a})}),e.jsxs(p,{kind:"primary",style:{marginRight:"1rem",minWidth:"165px"},onClick:()=>{l?this.setState({isShown:!1}):this.setState({isShown:!0})},children:["Menu Shown: ",l.toString()]}),e.jsxs("div",{ref:this.button,className:"btn btn-secondary disabled",style:{marginRight:"1rem"},children:["Shown using isShown",e.jsx(eo,{isShown:l,onMenuClosed:()=>{this.setState({isShown:!1})},actions:a})]})]})}}const Nt=`trades = db.t("LearnDeephaven", "StockTrades").where("Date=\`2017-08-25\`")\\
|
|
2
2
|
.headBy(3, "Sym")\\
|
|
3
3
|
.view("Sym", "Last")
|
|
4
4
|
|
|
@@ -211,4 +211,4 @@ simulation = shares30min.update("Values=(double[])ss.update(Sym, TargetPosition,
|
|
|
211
211
|
`,ca="_themeColorsPalette_1mdfo_1",da="_swatch_1mdfo_7",ha="_themeColors_1mdfo_1",ua="_label_1mdfo_21",ga="_capitalize_1mdfo_29",V={themeColorsPalette:ca,swatch:da,themeColors:ha,label:ua,capitalize:ga};function ma(){return{"Theme Color Palette":X("palette",ta,1),"Semantic Colors":X("semantic",aa,1),"Chart Colors":X("chart",la,2),"Editor Colors":X("editor",sa,2),"Grid Colors":X("grid",na,2),"Component Colors":X("component",ia,1)}}function va(){const{selectedThemeKey:t}=Do(),o=u.useMemo(ma,[t]);return e.jsx(e.Fragment,{children:Object.entries(o).map(([r,a],l)=>r==="Theme Color Palette"?e.jsxs("div",{...x(r),children:[e.jsx("h2",{className:"ui-title",children:r}),e.jsx("div",{className:V.themeColorsPalette,children:Object.entries(a).map(([s,n],i)=>e.jsxs(u.Fragment,{children:[(i===0||i===1)&&n.map(({name:d},h)=>e.jsx("div",{style:{gridColumnStart:h+2,textAlign:"center"},className:"mt-3",children:d.split("-").pop()},d)),e.jsx("div",{className:"text-right pr-2",children:s}),n.map(({name:d,value:h})=>e.jsxs("div",{style:{backgroundColor:h,border:h===""&&d.length>0?Be:void 0,color:`var(--dh-color-${ie(h)})`},className:G(V.swatch,"px-0"),children:[e.jsxs(J,{interactive:!0,children:[e.jsx("div",{children:d}),e.jsx("div",{children:h}),e.jsx("div",{children:ce.normalizeCssColor(h,!0)})]}),e.jsx(ao,{copy:d,style:{color:`var(--dh-color-${ie(h)})`}})]},d))]},s))})]},r):e.jsxs("div",{...x(r),children:[e.jsx("h2",{className:"ui-title",children:r}),e.jsx("div",{className:V.themeColors,children:Object.entries(a).map(([s,n])=>e.jsxs("div",{style:{gridRow:`span ${n.length+1}`},children:[e.jsx("span",{className:G(V.label,V.capitalize),children:s}),n.map(({isLabel:i,name:d,value:h,note:c})=>i===!0?e.jsx("span",{className:V.label,children:d},d):e.jsxs("div",{className:V.swatch,style:{backgroundColor:h,border:h===""&&d.length>0?Be:void 0,color:`var(--dh-color-${ie(h)})`},children:[e.jsxs(J,{interactive:!0,children:[e.jsx("div",{children:d}),e.jsx("div",{children:h}),e.jsx("div",{children:ce.normalizeCssColor(h,!0)})]}),e.jsx("span",{children:d.replace("--dh-color-","")}),d.endsWith("-hue")||c!=null?e.jsx("span",{children:c??h}):null,e.jsx(ao,{copy:d,style:{color:`var(--dh-color-${ie(h)})`}})]},d))]},s))})]},r))})}const Ae="data-menu-category",pa="data-no-menu",xa="sample-section-e2e-ignore",$o="spectrum-component-samples",Ao="spectrum-comparison-samples";function fa(){return e.jsxs("div",{id:$o,children:[e.jsx("h2",{className:"ui-title","data-no-menu":!0,children:"Spectrum Components"}),e.jsxs(P,{gap:20,columns:yo("0px","1fr"),children:[e.jsxs(D,{...N("spectrum-buttons"),children:[e.jsx("h3",{children:"Buttons"}),e.jsx(ba,{})]}),e.jsxs(D,{...N("spectrum-collections"),children:[e.jsx("h3",{children:"Collections"}),e.jsx(Ca,{})]}),e.jsxs(D,{...N("spectrum-content"),children:[e.jsx("h3",{children:"Content"}),e.jsx(wa,{})]}),e.jsxs(D,{...N("spectrum-forms"),children:[e.jsx("h3",{children:"Forms"}),e.jsx(ya,{})]}),e.jsxs(D,{...N("spectrum-overlays"),children:[e.jsx("h3",{children:"Overlays"}),e.jsxs(C,{gap:"size-160",children:[e.jsx(ja,{}),e.jsxs(Fo,{children:[e.jsx(R,{children:"Dialog Trigger"}),t=>e.jsxs(Oo,{children:[e.jsx(Fe,{children:"Some Heading"}),e.jsx(Vo,{children:"Some Header"}),e.jsx(Uo,{}),e.jsx(Oe,{children:e.jsx(de,{children:"Are you sure?"})}),e.jsxs(Go,{children:[e.jsx(b,{variant:"secondary",onPress:t,children:"Cancel"}),e.jsx(b,{variant:"accent",onPress:t,children:"Confirm"})]})]})]})]})]}),e.jsxs(D,{...N("spectrum-well"),children:[e.jsx("h3",{children:"Wells"}),e.jsx(Ho,{children:"This is a well."})]})]})]})}function ba(){return e.jsxs(e.Fragment,{children:[e.jsxs(R,{marginBottom:"size-200",children:[e.jsx(ee,{children:e.jsx(k,{icon:U})}),e.jsx(de,{children:"Icon Button"})]}),e.jsxs(P,{autoFlow:"column",columnGap:"size-250",rowGap:"size-150",columns:Me(4,yo(0,"size-2000")),rows:Me(8,"size-400"),children:[e.jsx("label",{children:'Button style="outline"'}),e.jsx(b,{variant:"primary",style:"outline",children:"Primary"}),e.jsx(b,{variant:"secondary",style:"outline",children:"Secondary"}),e.jsx(b,{variant:"accent",style:"outline",children:"Accent"}),e.jsx(b,{variant:"negative",style:"outline",children:"Negative"}),e.jsx(b,{variant:"primary",staticColor:"black",style:"outline",children:"Static Black"}),e.jsx(b,{variant:"primary",staticColor:"white",style:"outline",children:"Static White"}),e.jsx(b,{variant:"primary",isDisabled:!0,style:"outline",children:"Disabled"}),e.jsx("label",{children:'Button style="fill"'}),e.jsx(b,{variant:"primary",style:"fill",children:"Primary"}),e.jsx(b,{variant:"secondary",style:"fill",children:"Secondary"}),e.jsx(b,{variant:"accent",style:"fill",children:"Accent"}),e.jsx(b,{variant:"negative",style:"fill",children:"Negative"}),e.jsx(b,{variant:"primary",staticColor:"black",style:"fill",children:"Static Black"}),e.jsx(b,{variant:"primary",staticColor:"white",style:"fill",children:"Static White"}),e.jsx(b,{variant:"primary",isDisabled:!0,style:"fill",children:"Disabled"}),e.jsx("label",{children:"Action Button"}),e.jsx(R,{children:"Normal"}),e.jsx(R,{gridRow:"span 3",isQuiet:!0,children:"Quiet"}),e.jsx(R,{staticColor:"black",children:"Static Black"}),e.jsx(R,{staticColor:"white",children:"Static White"}),e.jsx(R,{isDisabled:!0,children:"Disabled"}),e.jsx("label",{children:"Toggle Button"}),e.jsx(z,{children:"Normal"}),e.jsx(z,{isQuiet:!0,children:"Quiet"}),e.jsx(z,{gridRow:"span 2",isEmphasized:!0,children:"Emphasized"}),e.jsx(z,{staticColor:"black",children:"Static Black"}),e.jsx(z,{staticColor:"white",children:"Static White"}),e.jsx(z,{isDisabled:!0,children:"Disabled"})]})]})}function ja(){return e.jsxs(e.Fragment,{children:[e.jsx(de,{children:"Contextual Help"}),e.jsxs(zo,{variant:"info",children:[e.jsx(Fe,{children:"Need help?"}),e.jsx(Oe,{children:e.jsx(de,{children:"This is a helpful description of the thing you need help with."})})]})]})}function ya(){return e.jsx(Wo,{children:e.jsxs(P,{gap:20,columns:Me("auto-fit","210px"),alignItems:"end",children:[e.jsx(Re,{label:"Text Field"}),e.jsxs(wo,{label:"Combobox",menuTrigger:"focus",defaultSelectedKey:"two",children:[e.jsx(S,{children:"One"},"one"),e.jsx(S,{children:"Two"},"two"),e.jsx(S,{children:"Three"},"three")]}),e.jsx(Pe,{children:"Checkbox"}),e.jsx(qo,{label:"Slider",defaultValue:24}),e.jsx(Ko,{children:"Switch"})]})})}function wa(){return e.jsxs(Yo,{children:[e.jsx(ee,{size:"XL",children:e.jsx(k,{icon:hr})}),e.jsx(Fe,{children:"Illustrated Message"}),e.jsx(Oe,{children:"This is the content of the message."})]})}function Ca(){return e.jsxs(e.Fragment,{children:[e.jsx("label",{id:"table-view-sample",children:"List View"}),e.jsxs(Xo,{"aria-labelledby":"table-view-sample",selectionMode:"multiple",maxWidth:"size-6000",marginBottom:"size-200",children:[e.jsx(S,{children:"One"}),e.jsx(S,{children:"Two"}),e.jsx(S,{children:"Three"}),e.jsx(S,{children:"Four"})]}),e.jsx("label",{id:"table-view-sample",children:"Table View"}),e.jsxs(Zo,{"aria-labelledby":"table-view-sample",selectionMode:"multiple",children:[e.jsxs(Jo,{children:[e.jsxs(W,{title:"Person",children:[e.jsx(W,{allowsResizing:!0,children:"Name"}),e.jsx(W,{children:"Age"})]}),e.jsxs(W,{title:"Address",children:[e.jsx(W,{allowsResizing:!0,children:"City"}),e.jsx(W,{children:"State"})]})]}),e.jsxs(Qo,{children:[e.jsxs(fe,{children:[e.jsx(I,{children:"John"}),e.jsx(I,{children:"42"}),e.jsx(I,{children:"San Francisco"}),e.jsx(I,{children:"CA"})]}),e.jsxs(fe,{children:[e.jsx(I,{children:"Jane"}),e.jsx(I,{children:"38"}),e.jsx(I,{children:"San Francisco"}),e.jsx(I,{children:"CA"})]}),e.jsxs(fe,{children:[e.jsx(I,{children:"Becky"}),e.jsx(I,{children:"12"}),e.jsx(I,{children:"San Francisco"}),e.jsx(I,{children:"CA"})]})]})]})]})}function se(t){return e.jsx("div",{...t})}function Sa(){const[t,o]=u.useState([]);u.useEffect(()=>{let a={category:"",items:[]};const l=[a],s=document.querySelector(`#${$o}`),n=document.querySelector(`#${Ao}`);document.querySelectorAll(`h2,h3,[${Ae}]`).forEach(i=>{if(i.textContent==null||i.hasAttribute(pa))return;if(i.hasAttribute(Ae)){a={category:i.getAttribute(Ae)??"",items:[]},l.push(a);return}const h=`${s?.contains(i)===!0?"spectrum-":n?.contains(i)===!0?"spectrum-compare-":""}${i.textContent}`.toLowerCase().replace(/\s/g,"-");i.id=h,a.items.push({id:h,label:i.textContent})}),o(l)},[]),u.useEffect(()=>{const a=window.location.hash===""?null:document.querySelector(window.location.hash);setTimeout(()=>{a?a.scrollIntoView():window.scrollTo({top:0,behavior:"auto"})},0)},[]);const r=u.useCallback(a=>{const l=String(a);document.getElementById(l)?.scrollIntoView({behavior:"smooth"}),setTimeout(()=>{window.location.hash=l},1e3)},[]);return e.jsxs(er,{children:[e.jsx(R,{children:e.jsx(ee,{children:e.jsx(k,{icon:ur})})}),e.jsx(or,{items:t,onAction:r,children:({category:a,items:l})=>e.jsx(rr,{items:l,title:a,children:({id:s,label:n})=>e.jsx(S,{children:n},s)},a)})]})}function Ta(){const t=u.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"}),setTimeout(()=>{window.location.hash=""},500)},[]);return u.useEffect(()=>{const o=document.querySelector("h2")?.offsetTop??0;function r(){document.documentElement.dataset.scroll=String(window.scrollY>=o)}return document.addEventListener("scroll",r,{passive:!0}),()=>{document.removeEventListener("scroll",r)}},[]),e.jsx(b,{UNSAFE_className:"goto-top-button",variant:"accent",onPress:t,children:e.jsx(ee,{children:e.jsx(k,{icon:gr})})})}const ka=["Tab 1","Tab 2","Tab 3"];function Na({isActive:t,title:o}){return e.jsxs("li",{className:G("lm_tab",t&&"lm_active"),children:[e.jsx("span",{className:"lm_title_before"}),e.jsx("span",{className:"lm_title",children:o}),e.jsx("span",{className:"lm_close_tab"})]})}function Da(){return e.jsxs("div",{...x("golden-layout"),children:[e.jsx("h2",{className:"ui-title",children:"Golden Layout"}),[!1,!0].map(t=>e.jsxs(he.Fragment,{children:[e.jsx("h5",{children:t?"Minimized":"Maximised"}),e.jsx("div",{style:{position:"relative",border:"none"},className:t?"lm_maximised":void 0,children:e.jsxs("div",{className:"lm_header",children:[e.jsx("ul",{className:"lm_tabs",children:ka.map((o,r)=>e.jsx(Na,{isActive:r===0,title:o},o))}),e.jsxs("ul",{className:"lm_controls",children:[e.jsx("li",{className:"lm_tabpreviousbutton"}),e.jsx("li",{className:"lm_tabnextbutton"}),e.jsx("li",{className:"lm_maximise"}),e.jsx("li",{className:"lm_popout"}),e.jsx("li",{className:"lm_tabdropdown"}),e.jsx("li",{className:"lm_close"})]})]})})]},String(t)))]})}function Ea(){return e.jsxs("div",{...x("animations",["sample-section-e2e-ignore"]),children:[e.jsx("h2",{className:"ui-title",children:"Animations"}),e.jsx(D,{position:"relative",height:400,children:e.jsx(Vr,{})})]})}const fo=[["primary","accent"],["secondary","primary"],["danger","negative"]],Ia=[{title:"One",value:"1"},{title:"Two",value:"2"},{title:"Three",value:"3"}];function $a(){const[t,o]=u.useState(!1),[r,a]=u.useState("1"),l=u.useCallback(s=>{a(s.target.value)},[]);return e.jsxs("div",{...x(Ao,[xa]),children:[e.jsx("h2",{className:"ui-title","data-no-menu":!0,children:"Bootstrap / Spectrum Comparison"}),e.jsxs(C,{gap:20,wrap:!0,children:[e.jsxs(D,{children:[e.jsx("h3",{children:"Buttons - Filled"}),e.jsxs(P,{gap:20,columns:"repeat(2, 120px)",autoRows:"40x",justifyItems:"start",alignItems:"start",children:[e.jsx("label",{children:"Bootstrap"}),e.jsx("label",{children:"Spectrum"}),fo.map(([s,n])=>e.jsxs(u.Fragment,{children:[e.jsx(p,{onClick:Y,kind:s,icon:Je,children:"Button"}),e.jsxs(b,{variant:n,style:"fill",children:[e.jsx(ee,{children:e.jsx(k,{icon:Je})}),e.jsx(de,{children:"Button"})]})]},s)),e.jsx(p,{onClick:Y,kind:"primary",disabled:!0,children:"Disabled"}),e.jsx(b,{variant:"accent",style:"fill",isDisabled:!0,children:"Disabled"})]})]}),e.jsxs(D,{children:[e.jsx("h3",{children:"Buttons - Outline"}),e.jsxs(P,{gap:20,columns:"repeat(2, 120px)",children:[e.jsx("label",{children:"Bootstrap"}),e.jsx("label",{children:"Spectrum"}),fo.map(([s,n])=>e.jsxs(u.Fragment,{children:[e.jsx(p,{onClick:Y,kind:s,children:s}),e.jsx(b,{variant:n,style:"outline",children:n})]},s)),e.jsx(p,{onClick:Y,kind:"secondary",disabled:!0,children:"Disabled"}),e.jsx(b,{variant:"primary",style:"outline",isDisabled:!0,children:"Disabled"})]})]}),e.jsxs(D,{children:[e.jsx("h3",{children:"Action Buttons"}),e.jsxs(P,{gap:20,columns:"repeat(2, 120px)",autoRows:"40x",children:[e.jsx("label",{children:"Bootstrap"}),e.jsx("label",{children:"Spectrum"}),e.jsx(p,{onClick:Y,kind:"inline",children:"Inline"}),e.jsx(R,{children:"Action"}),e.jsx(p,{onClick:Y,kind:"inline",disabled:!0,children:"Disabled"}),e.jsx(R,{isDisabled:!0,children:"Disabled"})]})]}),e.jsxs(D,{children:[e.jsx("h3",{children:"Pickers"}),e.jsxs(P,{gap:20,columns:"repeat(2, 192px)",autoRows:"40x",children:[e.jsx("label",{children:"Bootstrap"}),e.jsx("label",{children:"Spectrum"}),[!1,!0].map(s=>e.jsxs(u.Fragment,{children:[e.jsxs("div",{children:[e.jsxs("label",{className:"input-label",children:[s?"Disabled ":"","Combobox"]}),e.jsx(_e,{disabled:s,options:Ia,defaultValue:"One"})]}),e.jsxs(wo,{isDisabled:s,label:s?"Disabled Combobox":"Combobox",inputValue:"One",children:[e.jsx(S,{children:"One"},"1"),e.jsx(S,{children:"Two"},"2"),e.jsx(S,{children:"Three"},"3")]})]},String(s))),[!1,!0].map(s=>e.jsxs(u.Fragment,{children:[e.jsxs("div",{children:[e.jsx("label",{className:"input-label",children:"Select"}),e.jsxs(me,{disabled:s,placeholder:"Select",onChange:n=>{},className:"custom-select",children:[e.jsxs("option",{disabled:!0,value:"0",children:[s?"":"Disabled ","Select"]}),e.jsx("option",{value:"1",children:"One"}),e.jsx("option",{value:"2",children:"Two"}),e.jsx("option",{value:"3",children:"Three"})]})]}),e.jsxs(tr,{isDisabled:s,label:s?"Disabled Picker":"Picker",placeholder:"Picker",children:[e.jsx(S,{children:"One"},"1"),e.jsx(S,{children:"Two"},"2"),e.jsx(S,{children:"Three"},"3")]})]},String(s)))]})]}),e.jsxs(D,{children:[e.jsx("h3",{children:"Text Field"}),e.jsxs(P,{gap:20,columns:"repeat(2, 192px)",autoRows:"40x",children:[e.jsx("label",{children:"Bootstrap"}),e.jsx("label",{children:"Spectrum"}),e.jsxs("div",{children:[e.jsx("label",{className:"input-label",children:"type=text"}),e.jsx("input",{type:"text",className:"form-control",placeholder:"Text Input"})]}),e.jsx(Re,{type:"text",label:"TextField"}),e.jsxs("div",{children:[e.jsx("label",{className:"input-label",children:"Disabled"}),e.jsx("input",{type:"text",className:"form-control",disabled:!0,value:"Disabled"})]}),e.jsx(Re,{type:"text",label:"Disabled",isDisabled:!0,value:"Disabled"})]})]}),e.jsxs(D,{children:[e.jsx("h3",{children:"Checkbox"}),e.jsxs(P,{gap:20,columns:"repeat(2, 120px)",children:[e.jsx("label",{children:"Bootstrap"}),e.jsx("label",{children:"Spectrum"}),e.jsx(L,{className:"form-group",checked:t,onChange:()=>o(s=>!s),children:"Checkbox"}),e.jsx(Pe,{children:"Checkbox"}),e.jsx(L,{className:"form-group",disabled:!0,checked:t,onChange:()=>o(s=>!s),children:"Disabled"}),e.jsx(Pe,{isDisabled:!0,children:"Disabled"}),e.jsx(C,{direction:"column",children:e.jsxs("label",{children:["Radio Group",e.jsxs(ko,{onChange:l,value:r,children:[e.jsx(B,{value:"1",children:"One"}),e.jsx(B,{value:"2",children:"Two"}),e.jsx(B,{value:"3",children:"Three"})]})]})}),e.jsxs(ar,{label:"Radio Group",value:r,onChange:a,children:[e.jsx(be,{value:"1",children:"One"}),e.jsx(be,{value:"2",children:"Two"}),e.jsx(be,{value:"3",children:"Three"})]})]})]})]})]})}const bo={position:"sticky",justifyContent:"end",zIndex:1,UNSAFE_style:{float:"right"}};function Aa(){const t=window.location.search.includes("isolateSection=true"),{themes:o}=Do(),r=o.length>1;return e.jsx("div",{tabIndex:-1,role:"main",children:e.jsxs("div",{className:"container style-guide-container",children:[t&&e.jsx("style",{children:`.${Te}, .sample-section:not(${window.location.hash}), :not(.sample-section) > h2 {
|
|
212
212
|
display: none;
|
|
213
213
|
}`}),e.jsx(C,{justifyContent:"space-between",alignItems:"center",marginTop:"2rem",marginBottom:"1rem",children:e.jsx("h1",{style:{paddingTop:"2rem"},children:"Deephaven UI Components"})}),e.jsxs(C,{...bo,UNSAFE_className:Te,marginTop:-56,top:20,gap:10,alignItems:"end",children:[r?e.jsx(Hr,{}):null,e.jsx(Sa,{})]}),e.jsx(C,{...bo,UNSAFE_className:Te,top:"calc(100vh - 40px)",marginTop:-32,marginEnd:r?-234:0,children:e.jsx(Ta,{})}),e.jsx(Yt,{}),e.jsx(se,{"data-menu-category":"Colors"}),e.jsx(Ct,{}),e.jsx(va,{}),e.jsx(se,{"data-menu-category":"Layout"}),e.jsx(Da,{}),e.jsx(se,{"data-menu-category":"Components"}),e.jsx(Z,{}),e.jsx(Wt,{}),e.jsx(Ut,{}),e.jsx(Ht,{}),e.jsx(pe,{}),e.jsx(qt,{}),e.jsx(Tt,{}),e.jsx(zt,{}),e.jsx(St,{}),e.jsx(kt,{}),e.jsx(ra,{}),e.jsx(Kt,{}),e.jsx(Ot,{}),e.jsx(Et,{}),e.jsx(_t,{}),e.jsx(xt,{}),e.jsx(Dr,{}),e.jsx(Ea,{}),e.jsx(se,{"data-menu-category":"Spectrum Components"}),e.jsx(fa,{}),e.jsx(se,{"data-menu-category":"Spectrum Comparison"}),e.jsx($a,{})]})})}function ze(t){const{workspace:o,setWorkspace:r}=t;return u.useEffect(()=>{zr.makeDefaultWorkspace({getLayouts:async()=>[],getLayout:async()=>({})}).then(r)},[r]),o!=null?e.jsx(Aa,{}):null}ze.propTypes={workspace:ve.shape({}),setWorkspace:ve.func.isRequired};ze.defaultProps={workspace:null};const Ma=t=>({workspace:Ir(t)}),Ra=lr(Ma,{setWorkspace:Er})(ze);function za(){return $r.register(new URL("./download/serviceWorker.js",window.location.href)),Ar.init({getWorker:()=>new mr}),window["__react-beautiful-dnd-disable-dev-warnings"]=!0,e.jsx(Ur,{children:e.jsx(sr,{store:Mr,children:e.jsx(Ra,{})})})}export{za as StyleGuideRoot,za as default};
|
|
214
|
-
//# sourceMappingURL=StyleGuideRoot-
|
|
214
|
+
//# sourceMappingURL=StyleGuideRoot-cb903232.js.map
|